@openclaw/slack 2026.8.1-beta.3 → 2026.8.2
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/account-configured-sUohAxZr.js +33 -0
- package/dist/account-inspect-C3sePHWa.js +87 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-BlzxuYle.js → accounts-Dm_H77gH.js} +7 -10
- package/dist/{accounts.runtime-CbabBL8x.js → accounts.runtime-DRuEK6mL.js} +1 -1
- package/dist/{action-runtime-D6jg2CQd.js → action-runtime-B0kRJ69h.js} +90 -75
- package/dist/action-runtime.runtime-IuA14rev.js +2 -0
- package/dist/{actions-DFk0ANVB.js → actions-BOxiu2Vy.js} +278 -102
- package/dist/api.js +15 -15
- package/dist/{approval-handler.runtime-BNvAoKdK.js → approval-handler.runtime-l5_2JLqi.js} +58 -180
- package/dist/{channel-CA5w7qDF.js → channel-BguxhhNG.js} +97 -154
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-CZWv55Wu.js → channel-type-ChkODKBW.js} +3 -3
- package/dist/{channel.setup-CpyYsEXH.js → channel.setup-BJohRJha.js} +54 -68
- package/dist/{config-schema-CN3XZRX5.js → config-schema-B9GwoRlE.js} +24 -15
- package/dist/configured-state.js +34 -0
- package/dist/{conversation-binding-route-DFVLUdYF.js → conversation-binding-route-Vee8Dgbf.js} +2 -2
- package/dist/{directory-config-BGYyuzWh.js → directory-config-Bmw4ykSy.js} +5 -4
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DjUJQLbq.js → directory-live-BOILcXPo.js} +2 -2
- package/dist/{doctor-contract-BAy7-EUQ.js → doctor-contract-BNjw9bxb.js} +5 -4
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{group-policy-DyfB_ZIE.js → group-policy-BYH74y50.js} +643 -774
- package/dist/{message-tool-api-CqMr5Rmc.js → message-tool-api-BsZbsulu.js} +23 -5
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-Chrecrb9.js → monitor-B72wWXWg.js} +3 -3
- package/dist/{outbound-adapter-DuRqAQXK.js → outbound-adapter-CPgYQ-BM.js} +94 -69
- package/dist/{pipeline.runtime-Bbfd5VFW.js → pipeline.runtime-CcdujV99.js} +357 -544
- package/dist/{policy-BKXSxrIS.js → policy-CUpBeOt9.js} +7 -4
- package/dist/{probe-BVA65leh.js → probe-gj5yQgN2.js} +209 -21
- package/dist/{provider-CUUiwsg2.js → provider-DW9YC_no.js} +301 -179
- package/dist/{relay-source-mhpMMRG-.js → relay-source-BLMdBrAw.js} +6 -4
- package/dist/{replies-SnWyXcsL.js → replies-DLjQ8RYU.js} +25 -10
- package/dist/{resolve-channels-BSpqC8jU.js → resolve-channels-Bv6IiGZ4.js} +4 -3
- package/dist/{resolve-users-Dvz9pDe0.js → resolve-users-BXw2pA7y.js} +4 -3
- package/dist/runtime-api.js +11 -11
- package/dist/{scopes-BSk4GZvZ.js → scopes-B9HRguDe.js} +1 -1
- package/dist/{send-CtnOxKCc.js → send-GUz4_v2E.js} +58 -42
- package/dist/send-results-eeOu_HYm.js +23 -0
- package/dist/{send.runtime-kYctMHSd.js → send.runtime-rScD-UJi.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BPFfp6So.js → setup-surface-Cc3P-z35.js} +6 -6
- package/dist/{shared-DJBaslN7.js → shared-CQGVZ_8a.js} +28 -8
- package/dist/{slash-dispatch.runtime-Cf2FTrnf.js → slash-dispatch.runtime-C2015r6s.js} +3 -3
- package/dist/{target-parsing-BnMD2ZqZ.js → target-parsing-PbxGDbr9.js} +11 -6
- package/dist/{targets-Cx5W_n3W.js → targets-7FexXJ62.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 +0 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/bolt/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/bolt/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/bolt/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/bolt/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/bolt/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/bolt/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/README.md +2 -0
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/package.json +1 -1
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/package.json +16 -10
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/README.md +2 -0
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/package.json +1 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/socket-mode/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/socket-mode/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/socket-mode/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/socket-mode/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/socket-mode/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/socket-mode/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/socket-mode/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/v8.d.ts +20 -23
- 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 +0 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/web-api/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/web-api/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +14 -6
- package/package.json +9 -7
- package/dist/account-configured-BwfXBo_F.js +0 -14
- package/dist/account-inspect-YJvFBbCR.js +0 -89
- package/dist/action-runtime.runtime-JtoOK9l5.js +0 -2
- package/dist/actions.runtime-CYLsYRai.js +0 -2
- package/dist/runtime-api-DBi7xc_g.js +0 -10
- package/dist/slack-client-kind-BXyOOICI.js +0 -94
- package/node_modules/@slack/bolt/node_modules/negotiator/HISTORY.md +0 -114
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h as formatUnknownError, m as SLACK_SOCKET_RECONNECT_POLICY } from "./provider-DW9YC_no.js";
|
|
2
2
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { computeBackoff, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
4
4
|
import { isIP } from "node:net";
|
|
@@ -10,7 +10,7 @@ const SLACK_RELAY_ROUTE_KINDS = /* @__PURE__ */ new Set([
|
|
|
10
10
|
"thread_affinity",
|
|
11
11
|
"channel_default"
|
|
12
12
|
]);
|
|
13
|
-
const SLACK_RELAY_MAX_PAYLOAD_BYTES =
|
|
13
|
+
const SLACK_RELAY_MAX_PAYLOAD_BYTES = 1048576;
|
|
14
14
|
async function monitorSlackRelaySource(params) {
|
|
15
15
|
let reconnectAttempts = 0;
|
|
16
16
|
while (!params.abortSignal?.aborted) {
|
|
@@ -56,7 +56,8 @@ async function monitorSlackRelaySource(params) {
|
|
|
56
56
|
function openRelayWebSocket(config, abortSignal) {
|
|
57
57
|
if (abortSignal?.aborted) return Promise.reject(/* @__PURE__ */ new Error("Slack relay websocket aborted before connect"));
|
|
58
58
|
return new Promise((resolve, reject) => {
|
|
59
|
-
const
|
|
59
|
+
const url = buildRelayWebSocketUrl(config);
|
|
60
|
+
const ws = new WebSocket(url, buildRelayWebSocketOptions(config.authToken));
|
|
60
61
|
const cleanup = () => {
|
|
61
62
|
ws.off("open", onOpen);
|
|
62
63
|
ws.off("error", onError);
|
|
@@ -210,7 +211,8 @@ function extractRelaySlackMessageEvent(frame) {
|
|
|
210
211
|
const routeRecord = asOptionalRecord(record.route);
|
|
211
212
|
const routeKind = stringValue(routeRecord?.kind);
|
|
212
213
|
const routeKey = stringValue(routeRecord?.key);
|
|
213
|
-
const
|
|
214
|
+
const payload = asOptionalRecord(record.payload);
|
|
215
|
+
const event = asOptionalRecord(payload?.event);
|
|
214
216
|
if (event?.type !== "message" || typeof event.channel !== "string") return;
|
|
215
217
|
if (!deliveryId || !routeKind || !SLACK_RELAY_ROUTE_KINDS.has(routeKind) || !routeKey) return;
|
|
216
218
|
return {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, r as sendMessageSlack } from "./send-
|
|
3
|
-
import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./provider-
|
|
1
|
+
import { C as isSlackNativeResponseUrlRejection, M as SLACK_TEXT_LIMIT, S as isSlackInvalidBlocksResponse, T as buildSlackBlocksFallbackText, Z as markdownToSlackMrkdwnChunks, b as hasSlackNativeDataBlock, d as resolveSlackReplyBlockResolution, f as resolveSlackReplyBlocks, l as hasSlackReplyStructuredContent, v as buildSlackNativeDataAccessibilityText } from "./group-policy-BYH74y50.js";
|
|
2
|
+
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, r as sendMessageSlack } from "./send-GUz4_v2E.js";
|
|
3
|
+
import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./provider-DW9YC_no.js";
|
|
4
4
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
5
|
+
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
5
6
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
7
|
+
import { deliverTextOrMediaReply, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
6
8
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
7
9
|
import { SILENT_REPLY_TOKEN, chunkMarkdownTextWithMode, isSilentReplyText } from "openclaw/plugin-sdk/reply-chunking";
|
|
8
|
-
import { deliverTextOrMediaReply, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
9
10
|
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
10
11
|
import { createChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
|
|
11
12
|
import { buildCanonicalSentMessageHookContext, createInternalHookEvent, fireAndForgetHook, toInternalMessageSentContext, toPluginMessageContext, toPluginMessageSentEvent, triggerInternalHook } from "openclaw/plugin-sdk/hook-runtime";
|
|
@@ -114,6 +115,15 @@ function compactSlackResponseUrlFallback(messages) {
|
|
|
114
115
|
function readSlackReplyBlocks(payload) {
|
|
115
116
|
return resolveSlackReplyBlocks(payload);
|
|
116
117
|
}
|
|
118
|
+
function sanitizeSlackMonitorReplyPayload(payload) {
|
|
119
|
+
if (payload.isReasoning === true || typeof payload.text !== "string") return payload.isReasoning === true ? null : payload;
|
|
120
|
+
const text = sanitizeAssistantVisibleText(payload.text);
|
|
121
|
+
if (text === payload.text) return payload;
|
|
122
|
+
return text || resolveSendableOutboundReplyParts(payload).hasMedia || hasSlackReplyStructuredContent(payload) ? {
|
|
123
|
+
...payload,
|
|
124
|
+
text: text || void 0
|
|
125
|
+
} : null;
|
|
126
|
+
}
|
|
117
127
|
function resolveSlackMediaHookSpokenText(payload) {
|
|
118
128
|
return (getReplyPayloadTtsSupplement(payload)?.spokenText ?? payload.spokenText)?.trim() || void 0;
|
|
119
129
|
}
|
|
@@ -131,7 +141,8 @@ async function deliverReplies(params) {
|
|
|
131
141
|
});
|
|
132
142
|
const reply = resolveSendableOutboundReplyParts(payload);
|
|
133
143
|
const textRaw = reply.hasText && !isSilentReplyText(reply.trimmedText, SILENT_REPLY_TOKEN) ? reply.trimmedText : void 0;
|
|
134
|
-
const
|
|
144
|
+
const materializeAuthoredText = !reply.hasMedia && hasSlackReplyStructuredContent(payload);
|
|
145
|
+
const { authoredTextPlacement, segments } = resolveSlackReplyBlockResolution(payload, { materializeAuthoredText });
|
|
135
146
|
if (!textRaw && !reply.hasMedia && segments.length === 0) continue;
|
|
136
147
|
const acceptedResults = [];
|
|
137
148
|
const sendReply = async (input) => {
|
|
@@ -287,8 +298,9 @@ function resolveSlackThreadTs(params) {
|
|
|
287
298
|
}).use();
|
|
288
299
|
}
|
|
289
300
|
function createSlackReplyReferencePlanner(params) {
|
|
301
|
+
const effectiveMode = params.isThreadReply ?? Boolean(params.incomingThreadTs && params.incomingThreadTs !== params.messageTs) ? "all" : params.replyToMode;
|
|
290
302
|
return createReplyReferencePlanner({
|
|
291
|
-
replyToMode:
|
|
303
|
+
replyToMode: effectiveMode,
|
|
292
304
|
existingId: params.incomingThreadTs,
|
|
293
305
|
startId: params.messageTs,
|
|
294
306
|
hasReplied: params.hasReplied
|
|
@@ -335,7 +347,8 @@ async function deliverSlackSlashReplies(params) {
|
|
|
335
347
|
if (payload.isReasoning === true) continue;
|
|
336
348
|
const reply = resolveSendableOutboundReplyParts(payload);
|
|
337
349
|
const textRaw = reply.hasText && !isSilentReplyText(reply.trimmedText, SILENT_REPLY_TOKEN) ? reply.trimmedText : void 0;
|
|
338
|
-
const
|
|
350
|
+
const materializeAuthoredText = hasSlackReplyStructuredContent(payload);
|
|
351
|
+
const { authoredTextPlacement, segments } = resolveSlackReplyBlockResolution(payload, { materializeAuthoredText });
|
|
339
352
|
let outsideText = authoredTextPlacement === "outside-blocks" ? textRaw ?? "" : "";
|
|
340
353
|
const messages = [];
|
|
341
354
|
const hookParts = [];
|
|
@@ -447,7 +460,8 @@ async function deliverSlackSlashReplies(params) {
|
|
|
447
460
|
if (initialRemaining !== void 0 && initialMinimumCalls > initialRemaining) await failOversizedDelivery();
|
|
448
461
|
const deliverNativeFallback = async (messages, onVisible) => {
|
|
449
462
|
for (const message of messages) {
|
|
450
|
-
|
|
463
|
+
const response = await respond(message);
|
|
464
|
+
if (await isSlackInvalidBlocksResponse(response)) throw new Error("Slack rejected the native-data fallback blocks with invalid_blocks.");
|
|
451
465
|
onVisible();
|
|
452
466
|
}
|
|
453
467
|
};
|
|
@@ -474,7 +488,8 @@ async function deliverSlackSlashReplies(params) {
|
|
|
474
488
|
}
|
|
475
489
|
let rejectedNativeBlocks = false;
|
|
476
490
|
try {
|
|
477
|
-
|
|
491
|
+
const response = await respond(planned.message);
|
|
492
|
+
rejectedNativeBlocks = await isSlackInvalidBlocksResponse(response);
|
|
478
493
|
if (!rejectedNativeBlocks) markVisible();
|
|
479
494
|
} catch (error) {
|
|
480
495
|
if (!isSlackNativeResponseUrlRejection(error)) throw error;
|
|
@@ -511,4 +526,4 @@ async function deliverSlackSlashReplies(params) {
|
|
|
511
526
|
}
|
|
512
527
|
}
|
|
513
528
|
//#endregion
|
|
514
|
-
export { resolveDeliveredSlackReplyThreadTs as a, readSlackReplyBlocks as i, deliverReplies as n, resolveSlackThreadTs as o, deliverSlackSlashReplies as r,
|
|
529
|
+
export { resolveDeliveredSlackReplyThreadTs as a, emitSlackMessageSentHooks as c, readSlackReplyBlocks as i, deliverReplies as n, resolveSlackThreadTs as o, deliverSlackSlashReplies as r, sanitizeSlackMonitorReplyPayload as s, createSlackReplyDeliveryPlan as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
2
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-PbxGDbr9.js";
|
|
3
|
+
import { s as createSlackLookupClient } from "./probe-gj5yQgN2.js";
|
|
4
4
|
import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
@@ -83,9 +83,10 @@ async function resolveSlackChannelAllowlist(params) {
|
|
|
83
83
|
let resolvedIndex = 0;
|
|
84
84
|
return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
|
|
85
85
|
}
|
|
86
|
+
const channels = await listSlackChannels(params.client ?? createSlackLookupClient(params.token));
|
|
86
87
|
const resolved = resolveDirectoryAllowlistEntries({
|
|
87
88
|
entries: lookupEntries,
|
|
88
|
-
lookup:
|
|
89
|
+
lookup: channels,
|
|
89
90
|
parseInput: parseSlackChannelMention,
|
|
90
91
|
findById: (lookup, id) => lookup.find((channel) => channel.id === id),
|
|
91
92
|
buildIdResolved: ({ input, parsed, match }) => ({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
2
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-PbxGDbr9.js";
|
|
3
|
+
import { s as createSlackLookupClient } from "./probe-gj5yQgN2.js";
|
|
4
4
|
import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
@@ -98,9 +98,10 @@ async function resolveSlackUserAllowlist(params) {
|
|
|
98
98
|
const workspaceResolved = params.entries.map(resolveWorkspaceQualifiedUser);
|
|
99
99
|
const lookupEntries = params.entries.filter((_, index) => !workspaceResolved[index]);
|
|
100
100
|
if (lookupEntries.length === 0) return workspaceResolved.filter((entry) => entry !== void 0);
|
|
101
|
+
const users = await listSlackUsers(params.client ?? createSlackLookupClient(params.token));
|
|
101
102
|
const resolved = resolveDirectoryAllowlistEntries({
|
|
102
103
|
entries: lookupEntries,
|
|
103
|
-
lookup:
|
|
104
|
+
lookup: users,
|
|
104
105
|
parseInput: parseSlackUserInput,
|
|
105
106
|
findById: (lookup, id) => lookup.find((user) => user.id === id),
|
|
106
107
|
buildIdResolved: ({ input, parsed, match }) => ({
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as registerSlackPluginHttpRoutes } from "./plugin-routes-CLp4obpN.js";
|
|
2
|
-
import { a as resolveSlackAccount, d as resolveSlackAppToken, f as resolveSlackBotToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, t as listEnabledSlackAccounts } from "./accounts-
|
|
3
|
-
import { i as resolveSlackGroupToolPolicy, r as resolveSlackGroupRequireMention } from "./group-policy-
|
|
4
|
-
import { t as probeSlack } from "./probe-
|
|
2
|
+
import { a as resolveSlackAccount, d as resolveSlackAppToken, f as resolveSlackBotToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, t as listEnabledSlackAccounts } from "./accounts-Dm_H77gH.js";
|
|
3
|
+
import { i as resolveSlackGroupToolPolicy, r as resolveSlackGroupRequireMention } from "./group-policy-BYH74y50.js";
|
|
4
|
+
import { t as probeSlack } from "./probe-gj5yQgN2.js";
|
|
5
5
|
import { r as setSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
6
|
-
import {
|
|
7
|
-
import { r as sendMessageSlack } from "./send-
|
|
8
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
9
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
10
|
-
import { t as monitorSlackProvider } from "./provider-
|
|
11
|
-
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-
|
|
12
|
-
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-
|
|
13
|
-
import "./monitor-
|
|
6
|
+
import { c as listSlackPins, d as reactSlackMessage, f as readSlackMessages, g as unpinSlackMessage, h as sendSlackMessage, i as editSlackMessage, l as listSlackReactions, m as removeSlackReaction, n as deleteSlackMessage, o as getSlackMemberInfo, p as removeOwnSlackReactions, s as listSlackEmojis, u as pinSlackMessage } from "./actions-BOxiu2Vy.js";
|
|
7
|
+
import { r as sendMessageSlack } from "./send-GUz4_v2E.js";
|
|
8
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-Bv6IiGZ4.js";
|
|
9
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-BXw2pA7y.js";
|
|
10
|
+
import { t as monitorSlackProvider } from "./provider-DW9YC_no.js";
|
|
11
|
+
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-B0kRJ69h.js";
|
|
12
|
+
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-BOILcXPo.js";
|
|
13
|
+
import "./monitor-B72wWXWg.js";
|
|
14
14
|
export { deleteSlackMessage, editSlackMessage, getSlackMemberInfo, handleSlackAction, listEnabledSlackAccounts, listSlackAccountIds, listSlackDirectoryGroupsLive, listSlackDirectoryPeersLive, listSlackEmojis, listSlackPins, listSlackReactions, monitorSlackProvider, pinSlackMessage, probeSlack, reactSlackMessage, readSlackMessages, registerSlackPluginHttpRoutes, removeOwnSlackReactions, removeSlackReaction, resolveDefaultSlackAccountId, resolveSlackAccount, resolveSlackAppToken, resolveSlackBotToken, resolveSlackChannelAllowlist, resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy, resolveSlackUserAllowlist, sendMessageSlack, sendSlackMessage, setSlackRuntime, slackActionRuntime, unpinSlackMessage };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as createSlackReadClient, o as formatSlackError } from "./probe-gj5yQgN2.js";
|
|
2
2
|
import { isRecord, normalizeOptionalString, normalizeStringEntries, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/slack/src/scopes.ts
|
|
4
4
|
function collectScopes(value, into) {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-
|
|
2
|
-
import { a as parseSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-
|
|
3
|
-
import {
|
|
1
|
+
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-Dm_H77gH.js";
|
|
2
|
+
import { a as parseSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-PbxGDbr9.js";
|
|
3
|
+
import { A as SLACK_MESSAGE_TEXT_HARD_LIMIT, D as renderSlackBlockFallbackText, E as buildSlackCompleteBlocksFallbackText, L as truncateSlackText, M as SLACK_TEXT_LIMIT, R as truncateSlackTextByUtf8Bytes, X as chunkSlackMrkdwnText, Z as markdownToSlackMrkdwnChunks, _ as appendSlackNativeDataPlainTextFallback, b as hasSlackNativeDataBlock, c as assertSlackDetachedTargetAllowed, j as SLACK_MESSAGE_TEXT_RECOMMENDED_LIMIT, k as SLACK_EDIT_TEXT_MAX_BYTES, q as resolveSlackQuestionActionIds, st as validateSlackBlocksArray, v as buildSlackNativeDataAccessibilityText, w as stripSlackNativeDataBlocks, x as isSlackInvalidBlocksError, y as createSlackNativeDataBaseTextConsumer, z as SLACK_QUESTION_FINALIZATION_BLOCKS } from "./group-policy-BYH74y50.js";
|
|
4
|
+
import { c as createSlackReadClient, m as getSlackWriteClient, o as formatSlackError, u as createSlackTokenCacheKey } from "./probe-gj5yQgN2.js";
|
|
4
5
|
import { n as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-DUGhaYKq.js";
|
|
5
|
-
import { a as createSlackReadClient, d as getSlackWriteClient, r as formatSlackError, s as createSlackTokenCacheKey } from "./probe-BVA65leh.js";
|
|
6
6
|
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
7
|
-
import {
|
|
8
|
-
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
|
+
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
8
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
9
|
import { logVerbose, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
11
10
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
12
11
|
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
12
|
+
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
13
|
+
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
|
13
14
|
import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
14
15
|
import { createHash, createHmac } from "node:crypto";
|
|
15
16
|
import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
|
|
16
17
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
17
18
|
import { PlatformMessageNotDispatchedError, extractErrorCode, readErrorName } from "openclaw/plugin-sdk/error-runtime";
|
|
18
19
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
19
|
-
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
20
20
|
import { chunkMarkdownTextWithMode, resolveChunkMode, resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-chunking";
|
|
21
|
-
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
|
22
21
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
23
22
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
24
23
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
24
|
+
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
25
25
|
import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
26
26
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
27
27
|
import { createPersistentDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
|
|
@@ -135,7 +135,8 @@ function isSlackCustomizeScopeError(err) {
|
|
|
135
135
|
}
|
|
136
136
|
function isSlackCustomIdentityRejectedError(err) {
|
|
137
137
|
if (isSlackCustomizeScopeError(err)) return true;
|
|
138
|
-
const
|
|
138
|
+
const data = getSlackWebApiErrorData$1(err);
|
|
139
|
+
const code = normalizeLowercaseStringOrEmpty(normalizeOptionalString(data?.error));
|
|
139
140
|
return code === "invalid_arguments" || code === "invalid_arg_name";
|
|
140
141
|
}
|
|
141
142
|
function hasCustomIdentity$1(identity) {
|
|
@@ -231,6 +232,16 @@ const SLACK_DNS_RETRY_CODES = /* @__PURE__ */ new Set([
|
|
|
231
232
|
]);
|
|
232
233
|
const SLACK_DNS_RETRY_ATTEMPTS = 2;
|
|
233
234
|
const SLACK_DNS_RETRY_BASE_DELAY_MS = 250;
|
|
235
|
+
function rethrowSlackPermanentOutboundApiRejection(err) {
|
|
236
|
+
const rawData = isRecord(err) && err.code === "slack_webapi_platform_error" ? err.data : void 0;
|
|
237
|
+
const data = isRecord(rawData) ? rawData : void 0;
|
|
238
|
+
const code = data?.error;
|
|
239
|
+
if (data?.ok === false && (code === "messages_tab_disabled" || code === "account_inactive")) throw new PlatformMessageNotDispatchedError(`Slack outbound delivery rejected: ${code}`, {
|
|
240
|
+
cause: err,
|
|
241
|
+
retryable: false
|
|
242
|
+
});
|
|
243
|
+
throw err;
|
|
244
|
+
}
|
|
234
245
|
function readSlackRequestErrorCode(value) {
|
|
235
246
|
if (!value || typeof value !== "object") return;
|
|
236
247
|
const code = value.code;
|
|
@@ -348,7 +359,7 @@ async function postSlackMessageBestEffort(params) {
|
|
|
348
359
|
const basePayload = buildSlackPostMessagePayload(params);
|
|
349
360
|
const postChatMessage = params.client.chat.postMessage.bind(params.client.chat);
|
|
350
361
|
const post = async (payload, identity) => ({
|
|
351
|
-
response: await withSlackDnsRequestRetry("chat.postMessage", () => postChatMessage(payload)),
|
|
362
|
+
response: await withSlackDnsRequestRetry("chat.postMessage", () => postChatMessage(payload)).catch(rethrowSlackPermanentOutboundApiRejection),
|
|
352
363
|
identity
|
|
353
364
|
});
|
|
354
365
|
const posted = await postSlackMessageWithIdentityFallback({
|
|
@@ -378,7 +389,7 @@ async function uploadSlackFile(params) {
|
|
|
378
389
|
const uploadUrlResp = await withSlackDnsRequestRetry("files.getUploadURLExternal", () => params.client.files.getUploadURLExternal({
|
|
379
390
|
filename: uploadFileName,
|
|
380
391
|
length: buffer.length
|
|
381
|
-
}));
|
|
392
|
+
})).catch(rethrowSlackPermanentOutboundApiRejection);
|
|
382
393
|
if (!uploadUrlResp.ok || !uploadUrlResp.upload_url || !uploadUrlResp.file_id) throw new Error(`Failed to get upload URL: ${uploadUrlResp.error ?? "unknown error"}`);
|
|
383
394
|
const uploadFileId = uploadUrlResp.file_id;
|
|
384
395
|
const uploadTransport = resolveSlackUploadTransportPolicy({
|
|
@@ -412,7 +423,8 @@ async function uploadSlackFile(params) {
|
|
|
412
423
|
await release();
|
|
413
424
|
}
|
|
414
425
|
} catch (error) {
|
|
415
|
-
|
|
426
|
+
const outcome = uploadTimeoutSignal?.aborted ? "timed out" : "failed";
|
|
427
|
+
throw new PlatformMessageNotDispatchedError(`Slack external upload ${outcome} before completion dispatch`, { cause: buildSlackUploadFailureCause(error) });
|
|
416
428
|
} finally {
|
|
417
429
|
cleanupUploadTimeout();
|
|
418
430
|
}
|
|
@@ -521,7 +533,7 @@ const SLACK_DELIVERY_METADATA_PART_INDEX_KEY = "openclaw_delivery_part_index";
|
|
|
521
533
|
const SLACK_DELIVERY_METADATA_PART_COUNT_KEY = "openclaw_delivery_part_count";
|
|
522
534
|
const SLACK_DELIVERY_METADATA_SIGNATURE_KEY = "openclaw_delivery_signature";
|
|
523
535
|
const SLACK_RECONCILE_LOOKBACK_MS = 3e4;
|
|
524
|
-
const SLACK_RECONCILE_CLOCK_SKEW_MS =
|
|
536
|
+
const SLACK_RECONCILE_CLOCK_SKEW_MS = 3e5;
|
|
525
537
|
const SLACK_RECONCILE_LIMIT = 100;
|
|
526
538
|
const SLACK_RECONCILE_MAX_PAGES = 10;
|
|
527
539
|
const SLACK_ENTERPRISE_LISTENER_QUEUE_CREDENTIAL = "listener-scoped-enterprise";
|
|
@@ -590,16 +602,18 @@ function resolvePostedMessageThreadTs(response) {
|
|
|
590
602
|
return typeof threadTs === "string" ? normalizeSlackThreadTsCandidate(threadTs) : void 0;
|
|
591
603
|
}
|
|
592
604
|
async function updateMessageSlack(params) {
|
|
605
|
+
const cfg = requireRuntimeConfig(params.cfg, "Slack update");
|
|
593
606
|
const account = resolveSlackAccount({
|
|
594
|
-
cfg
|
|
607
|
+
cfg,
|
|
595
608
|
accountId: params.accountId
|
|
596
609
|
});
|
|
597
610
|
assertSlackDetachedTargetAllowed(account.accountId, params.teamId);
|
|
598
|
-
|
|
611
|
+
const token = resolveToken({
|
|
599
612
|
accountId: account.accountId,
|
|
600
613
|
fallbackToken: account.botToken,
|
|
601
614
|
fallbackSource: account.botTokenSource
|
|
602
|
-
})
|
|
615
|
+
});
|
|
616
|
+
await getSlackWriteClient(token, { teamId: params.teamId }).chat.update({
|
|
603
617
|
channel: params.channelId,
|
|
604
618
|
ts: params.messageTs,
|
|
605
619
|
text: truncateSlackTextByUtf8Bytes(params.text, SLACK_EDIT_TEXT_MAX_BYTES),
|
|
@@ -607,8 +621,9 @@ async function updateMessageSlack(params) {
|
|
|
607
621
|
});
|
|
608
622
|
}
|
|
609
623
|
function createSlackSendReceipt(params) {
|
|
624
|
+
const platformMessageIds = params.platformMessageIds.map((messageId) => messageId.trim()).filter((messageId) => messageId && messageId !== "unknown");
|
|
610
625
|
return createMessageReceiptFromOutboundResults({
|
|
611
|
-
results:
|
|
626
|
+
results: platformMessageIds.map((messageId) => {
|
|
612
627
|
const result = {
|
|
613
628
|
channel: "slack",
|
|
614
629
|
messageId
|
|
@@ -620,6 +635,18 @@ function createSlackSendReceipt(params) {
|
|
|
620
635
|
threadId: params.threadTs
|
|
621
636
|
});
|
|
622
637
|
}
|
|
638
|
+
function createSlackSendReceiptFromResults(results, threadTs) {
|
|
639
|
+
const receipt = createMessageReceiptFromOutboundResults({
|
|
640
|
+
results,
|
|
641
|
+
threadId: threadTs
|
|
642
|
+
});
|
|
643
|
+
const thread = threadTs ? { threadId: threadTs } : {};
|
|
644
|
+
for (const [index, part] of receipt.parts.entries()) Object.assign(part, {
|
|
645
|
+
index,
|
|
646
|
+
...thread
|
|
647
|
+
});
|
|
648
|
+
return Object.assign(receipt, thread);
|
|
649
|
+
}
|
|
623
650
|
function resolveToken(params) {
|
|
624
651
|
const explicit = normalizeOptionalString(params.explicit);
|
|
625
652
|
if (explicit) return explicit;
|
|
@@ -714,7 +741,8 @@ function resolveSlackTextChunks(params) {
|
|
|
714
741
|
...params.accountId ? { accountId: params.accountId } : {}
|
|
715
742
|
});
|
|
716
743
|
const chunkMode = resolveChunkMode(params.cfg, "slack", params.accountId);
|
|
717
|
-
|
|
744
|
+
const chunks = (chunkMode === "newline" ? chunkMarkdownTextWithMode(text, chunkLimit, chunkMode) : [text]).flatMap((markdown) => markdownToSlackMrkdwnChunks(markdown, chunkLimit, { tableMode }));
|
|
745
|
+
return resolveTextChunksWithFallback(text, chunks);
|
|
718
746
|
}
|
|
719
747
|
function createSlackSendQueueKey(params) {
|
|
720
748
|
const recipientKey = `${params.recipient.kind}:${params.recipient.id}`;
|
|
@@ -766,7 +794,7 @@ async function resolveChannelId(client, recipient, params) {
|
|
|
766
794
|
isDm: true,
|
|
767
795
|
cacheHit: true
|
|
768
796
|
};
|
|
769
|
-
const channelId = (await withSlackDnsRequestRetry("conversations.open", () => client.conversations.open({ users: recipient.id }))).channel?.id;
|
|
797
|
+
const channelId = (await withSlackDnsRequestRetry("conversations.open", () => client.conversations.open({ users: recipient.id })).catch(rethrowSlackPermanentOutboundApiRejection)).channel?.id;
|
|
770
798
|
if (!channelId) throw new Error("Failed to open Slack DM channel");
|
|
771
799
|
setSlackDmChannelCache(cache, cacheKey, channelId);
|
|
772
800
|
return {
|
|
@@ -963,8 +991,9 @@ async function scanSlackConversationForDelivery(params) {
|
|
|
963
991
|
};
|
|
964
992
|
}
|
|
965
993
|
async function reconcileSlackUnknownSend(ctx) {
|
|
994
|
+
const cfg = requireRuntimeConfig(ctx.cfg, "Slack delivery reconciliation");
|
|
966
995
|
const account = resolveSlackAccount({
|
|
967
|
-
cfg
|
|
996
|
+
cfg,
|
|
968
997
|
accountId: ctx.accountId ?? void 0
|
|
969
998
|
});
|
|
970
999
|
const deliveryId = createSlackDeliveryMetadataId(ctx.queueId);
|
|
@@ -999,8 +1028,9 @@ async function reconcileSlackUnknownSend(ctx) {
|
|
|
999
1028
|
const readClient = createSlackReadClient(readToken, { teamId: recipient.teamId });
|
|
1000
1029
|
const writeClient = writeToken ? getSlackWriteClient(writeToken, { teamId: recipient.teamId }) : void 0;
|
|
1001
1030
|
const payloadReplyToId = ctx.payloads[0]?.replyToId;
|
|
1031
|
+
const effectiveReplyToId = Object.hasOwn(ctx, "effectiveReplyToId") ? normalizeOptionalString(ctx.effectiveReplyToId) : payloadReplyToId != null ? normalizeOptionalString(payloadReplyToId) : ctx.replyToMode === "off" ? void 0 : normalizeOptionalString(ctx.replyToId);
|
|
1002
1032
|
const threadTs = resolveSlackThreadTsValue({
|
|
1003
|
-
replyToId:
|
|
1033
|
+
replyToId: effectiveReplyToId,
|
|
1004
1034
|
threadId: ctx.threadId
|
|
1005
1035
|
});
|
|
1006
1036
|
const searchStartedAt = ctx.platformSendStartedAt ?? ctx.enqueuedAt;
|
|
@@ -1101,6 +1131,7 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1101
1131
|
accountId: account.accountId,
|
|
1102
1132
|
token: delivery.credential
|
|
1103
1133
|
});
|
|
1134
|
+
const deliveredResults = [];
|
|
1104
1135
|
const reportDelivery = async (result, deliveredBlocks) => {
|
|
1105
1136
|
const slackQuestionActionIds = resolveSlackQuestionActionIds(deliveredBlocks);
|
|
1106
1137
|
const deliveryResult = slackQuestionActionIds.length ? {
|
|
@@ -1111,6 +1142,7 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1111
1142
|
[SLACK_QUESTION_FINALIZATION_BLOCKS]: deliveredBlocks.filter((block) => block.type !== "actions")
|
|
1112
1143
|
}
|
|
1113
1144
|
} : result;
|
|
1145
|
+
deliveredResults.push(deliveryResult);
|
|
1114
1146
|
await opts.onDeliveryResult?.(deliveryResult);
|
|
1115
1147
|
return deliveryResult;
|
|
1116
1148
|
};
|
|
@@ -1140,7 +1172,6 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1140
1172
|
const rawBlockAccessibilityText = trimmedMessage ? [trimmedMessage, ...completeBlockFallbackText.includes(trimmedMessage) ? [] : [completeBlockFallbackText]].join("\n\n") : completeBlockFallbackText;
|
|
1141
1173
|
const blockAccessibilityText = blocks ? orderedBlockAccessibilityText ?? rawBlockAccessibilityText : void 0;
|
|
1142
1174
|
let pendingBlockFallback = (hasNativeData || opts.authoredTextPlacement !== void 0) && orderedBlockDeliveryPlan?.skipOriginalBlocks ? orderedBlockDeliveryPlan : void 0;
|
|
1143
|
-
const sentMessageIds = [];
|
|
1144
1175
|
let lastMessageId = "";
|
|
1145
1176
|
let deliveredChannelId = channelId;
|
|
1146
1177
|
let canonicalDeliveredThreadTs;
|
|
@@ -1220,7 +1251,6 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1220
1251
|
lastMessageId = response.ts;
|
|
1221
1252
|
deliveredChannelId = resolvePostedMessageChannelId(response, deliveredChannelId);
|
|
1222
1253
|
canonicalDeliveredThreadTs ??= resolvePostedMessageThreadTs(response);
|
|
1223
|
-
sentMessageIds.push(response.ts);
|
|
1224
1254
|
const deliveredThreadTs = resolvePostedMessageThreadTs(response) ?? normalizeSlackThreadTsCandidate(opts.threadTs);
|
|
1225
1255
|
const fallbackDelivery = await reportDelivery({
|
|
1226
1256
|
messageId: response.ts,
|
|
@@ -1235,22 +1265,16 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1235
1265
|
}, fallback.blocks);
|
|
1236
1266
|
if (fallbackDelivery.meta?.slackQuestionActionIds.length) questionDelivery = fallbackDelivery;
|
|
1237
1267
|
}
|
|
1238
|
-
const messageId = lastMessageId;
|
|
1239
1268
|
const deliveredThreadTs = canonicalDeliveredThreadTs ?? normalizeSlackThreadTsCandidate(opts.threadTs);
|
|
1240
1269
|
return {
|
|
1241
|
-
messageId,
|
|
1270
|
+
messageId: lastMessageId,
|
|
1242
1271
|
channelId: deliveredChannelId,
|
|
1243
1272
|
threadTs: deliveredThreadTs,
|
|
1244
1273
|
...questionDelivery?.meta ? { meta: {
|
|
1245
1274
|
...questionDelivery.meta,
|
|
1246
1275
|
slackQuestionMessageId: questionDelivery.messageId
|
|
1247
1276
|
} } : {},
|
|
1248
|
-
receipt:
|
|
1249
|
-
platformMessageIds: sentMessageIds,
|
|
1250
|
-
channelId: deliveredChannelId,
|
|
1251
|
-
kind: fallbackMessages.some((message) => message.blocks) ? "card" : "text",
|
|
1252
|
-
threadTs: deliveredThreadTs
|
|
1253
|
-
})
|
|
1277
|
+
receipt: createSlackSendReceiptFromResults(deliveredResults, deliveredThreadTs)
|
|
1254
1278
|
};
|
|
1255
1279
|
}
|
|
1256
1280
|
}
|
|
@@ -1283,7 +1307,6 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1283
1307
|
onPlatformSendDispatch: dispatchOnce,
|
|
1284
1308
|
...delivery.upload ? { auditContext: delivery.upload.auditContext } : {}
|
|
1285
1309
|
});
|
|
1286
|
-
sentMessageIds.push(lastMessageId);
|
|
1287
1310
|
await reportDelivery({
|
|
1288
1311
|
messageId: lastMessageId,
|
|
1289
1312
|
channelId,
|
|
@@ -1298,7 +1321,7 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1298
1321
|
chunksToPost = rest;
|
|
1299
1322
|
} else chunksToPost = resolvedChunks.length ? resolvedChunks : [""];
|
|
1300
1323
|
for (const [partIndex, chunk] of chunksToPost.entries()) {
|
|
1301
|
-
const carriesPrimaryMessageOptions = partIndex === 0 && !opts.mediaUrl
|
|
1324
|
+
const carriesPrimaryMessageOptions = partIndex === 0 && !opts.mediaUrl;
|
|
1302
1325
|
const baseMetadata = carriesPrimaryMessageOptions ? opts.metadata : void 0;
|
|
1303
1326
|
const metadata = opts.mediaUrl ? baseMetadata : withSlackDeliveryMetadata(baseMetadata, {
|
|
1304
1327
|
queueId: opts.deliveryQueueId,
|
|
@@ -1324,7 +1347,6 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1324
1347
|
lastMessageId = response.ts;
|
|
1325
1348
|
deliveredChannelId = resolvePostedMessageChannelId(response, deliveredChannelId);
|
|
1326
1349
|
canonicalDeliveredThreadTs ??= resolvePostedMessageThreadTs(response);
|
|
1327
|
-
sentMessageIds.push(response.ts);
|
|
1328
1350
|
await reportDelivery({
|
|
1329
1351
|
messageId: response.ts,
|
|
1330
1352
|
channelId: deliveredChannelId,
|
|
@@ -1337,18 +1359,12 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1337
1359
|
})
|
|
1338
1360
|
});
|
|
1339
1361
|
}
|
|
1340
|
-
const messageId = lastMessageId;
|
|
1341
1362
|
const deliveredThreadTs = canonicalDeliveredThreadTs ?? normalizeSlackThreadTsCandidate(opts.threadTs);
|
|
1342
1363
|
return {
|
|
1343
|
-
messageId,
|
|
1364
|
+
messageId: lastMessageId,
|
|
1344
1365
|
channelId: deliveredChannelId,
|
|
1345
1366
|
threadTs: deliveredThreadTs,
|
|
1346
|
-
receipt:
|
|
1347
|
-
platformMessageIds: sentMessageIds,
|
|
1348
|
-
channelId: deliveredChannelId,
|
|
1349
|
-
kind: opts.mediaUrl ? "media" : "text",
|
|
1350
|
-
threadTs: deliveredThreadTs
|
|
1351
|
-
})
|
|
1367
|
+
receipt: createSlackSendReceiptFromResults(deliveredResults, deliveredThreadTs)
|
|
1352
1368
|
};
|
|
1353
1369
|
}
|
|
1354
1370
|
//#endregion
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
2
|
+
//#region extensions/slack/src/send-results.ts
|
|
3
|
+
function mergeSlackSendResults(results) {
|
|
4
|
+
const lastResult = results.at(-1);
|
|
5
|
+
if (!lastResult) throw new Error("Slack send plan produced no delivery.");
|
|
6
|
+
if (results.length === 1) return lastResult;
|
|
7
|
+
const receipt = createMessageReceiptFromOutboundResults({ results });
|
|
8
|
+
receipt.parts = receipt.parts.map((part, index) => ({
|
|
9
|
+
...part,
|
|
10
|
+
index
|
|
11
|
+
}));
|
|
12
|
+
const questionResult = results.find((result) => result.meta?.slackQuestionActionIds.length);
|
|
13
|
+
return {
|
|
14
|
+
...lastResult,
|
|
15
|
+
receipt,
|
|
16
|
+
...questionResult?.meta ? { meta: {
|
|
17
|
+
...questionResult.meta,
|
|
18
|
+
slackQuestionMessageId: questionResult.meta.slackQuestionMessageId ?? questionResult.messageId
|
|
19
|
+
} } : {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { mergeSlackSendResults as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as updateMessageSlack, n as resolveSlackDmChannelId, r as sendMessageSlack, t as reconcileSlackUnknownSend } from "./send-
|
|
1
|
+
import { a as updateMessageSlack, n as resolveSlackDmChannelId, r as sendMessageSlack, t as reconcileSlackUnknownSend } from "./send-GUz4_v2E.js";
|
|
2
2
|
export { reconcileSlackUnknownSend, resolveSlackDmChannelId, sendMessageSlack, updateMessageSlack };
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as slackSetupPlugin } from "./channel.setup-BJohRJha.js";
|
|
2
2
|
export { slackSetupPlugin };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom } from "./accounts-
|
|
2
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
3
|
-
import "./shared-
|
|
4
|
-
import { o as SLACK_CHANNEL, r as createSlackSetupWizardBase } from "./channel.setup-
|
|
5
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
6
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom } from "./accounts-Dm_H77gH.js";
|
|
2
|
+
import { t as inspectSlackAccount } from "./account-inspect-C3sePHWa.js";
|
|
3
|
+
import "./shared-CQGVZ_8a.js";
|
|
4
|
+
import { o as SLACK_CHANNEL, r as createSlackSetupWizardBase } from "./channel.setup-BJohRJha.js";
|
|
5
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-Bv6IiGZ4.js";
|
|
6
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-BXw2pA7y.js";
|
|
7
7
|
import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
9
9
|
import { createSetupTranslator, noteChannelLookupFailure, noteChannelLookupSummary, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptResolvedAllowFrom, resolveEntriesWithOptionalToken, resolveSetupAccountId, splitSetupEntries } from "openclaw/plugin-sdk/setup-runtime";
|
|
@@ -1,16 +1,35 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { n as slackBaseConfigAdapter, t as slackSetupPlugin } from "./channel.setup-
|
|
7
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
1
|
+
import { n as isSlackPluginAccountConfigured } from "./account-configured-sUohAxZr.js";
|
|
2
|
+
import { n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig, s as resolveSlackAccountDmPolicy } from "./accounts-Dm_H77gH.js";
|
|
3
|
+
import { t as inspectSlackAccount } from "./account-inspect-C3sePHWa.js";
|
|
4
|
+
import { a as parseSlackTarget } from "./target-parsing-PbxGDbr9.js";
|
|
5
|
+
import { a as slackIngressIdentity, t as probeSlack } from "./probe-gj5yQgN2.js";
|
|
6
|
+
import { n as slackBaseConfigAdapter, t as slackSetupPlugin } from "./channel.setup-BJohRJha.js";
|
|
7
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BNjw9bxb.js";
|
|
8
8
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DxmvbxBF.js";
|
|
9
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
|
|
9
10
|
import { adaptScopedAccountAccessor, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
10
11
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
12
|
+
import { PAIRING_APPROVED_MESSAGE, projectCredentialSnapshotFields, resolveConfiguredFromRequiredCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
|
|
11
13
|
import { buildMutableAllowEntryDetector, collectStandardAllowlistLists, createConditionalWarningCollector, createDangerousNameMatchingMutableAllowlistWarningCollector, createOpenProviderConfiguredRouteWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
14
|
+
import { identityEntryAuthenticationClassifier } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
12
15
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
13
16
|
import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
17
|
+
//#region extensions/slack/src/channel-api.ts
|
|
18
|
+
const SLACK_CHANNEL_META = {
|
|
19
|
+
id: "slack",
|
|
20
|
+
label: "Slack",
|
|
21
|
+
selectionLabel: "Slack",
|
|
22
|
+
docsPath: "/channels/slack",
|
|
23
|
+
docsLabel: "slack",
|
|
24
|
+
blurb: "supports bot + app tokens, channels, threads, and interactive replies.",
|
|
25
|
+
systemImage: "number.square",
|
|
26
|
+
markdownCapable: true
|
|
27
|
+
};
|
|
28
|
+
function getChatChannelMeta(id) {
|
|
29
|
+
if (id !== SLACK_CHANNEL_META.id) throw new Error(`Unsupported Slack channel meta lookup: ${id}`);
|
|
30
|
+
return SLACK_CHANNEL_META;
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
14
33
|
//#region extensions/slack/src/security.ts
|
|
15
34
|
const resolveSlackDmPolicy = createScopedDmSecurityResolver({
|
|
16
35
|
channelKey: "slack",
|
|
@@ -27,6 +46,7 @@ const resolveSlackDmPolicy = createScopedDmSecurityResolver({
|
|
|
27
46
|
})
|
|
28
47
|
}),
|
|
29
48
|
policyPathSuffix: "dmPolicy",
|
|
49
|
+
classifyEntryAuthentication: identityEntryAuthenticationClassifier(slackIngressIdentity),
|
|
30
50
|
normalizeEntry: (raw) => raw.trim().replace(/^(slack|user):/i, "").trim()
|
|
31
51
|
});
|
|
32
52
|
const collectSlackSecurityWarnings = createOpenProviderConfiguredRouteWarningCollector({
|
|
@@ -265,4 +285,4 @@ function createSlackPluginBase(params) {
|
|
|
265
285
|
};
|
|
266
286
|
}
|
|
267
287
|
//#endregion
|
|
268
|
-
export { slackConfigAdapter as n, slackSecurityAdapter as r, createSlackPluginBase as t };
|
|
288
|
+
export { PAIRING_APPROVED_MESSAGE as a, DEFAULT_ACCOUNT_ID$1 as i, slackConfigAdapter as n, projectCredentialSnapshotFields as o, slackSecurityAdapter as r, resolveConfiguredFromRequiredCredentialStatuses as s, createSlackPluginBase as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as deliverSlackSlashReplies$1 } from "./replies-
|
|
1
|
+
import { r as deliverSlackSlashReplies$1, s as sanitizeSlackMonitorReplyPayload } from "./replies-DLjQ8RYU.js";
|
|
2
2
|
import { resolveAgentRoute as resolveAgentRoute$1 } from "openclaw/plugin-sdk/routing";
|
|
3
|
-
import { resolveConversationLabel as resolveConversationLabel$1 } from "openclaw/plugin-sdk/conversation-runtime";
|
|
4
3
|
import { resolveMarkdownTableMode as resolveMarkdownTableMode$1 } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
4
|
+
import { resolveConversationLabel as resolveConversationLabel$1 } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { dispatchChannelInboundTurn as dispatchChannelInboundTurn$1, isChannelPartialDeliveryError as isChannelPartialDeliveryError$1 } from "openclaw/plugin-sdk/channel-inbound";
|
|
6
6
|
import { finalizeInboundContext as finalizeInboundContext$1, resolveChunkMode as resolveChunkMode$1 } from "openclaw/plugin-sdk/reply-runtime";
|
|
7
7
|
//#region extensions/slack/src/monitor/slash-dispatch.runtime.ts
|
|
@@ -30,4 +30,4 @@ function deliverSlackSlashReplies(...args) {
|
|
|
30
30
|
return deliverSlackSlashReplies$1(...args);
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
|
-
export { deliverSlackSlashReplies, dispatchChannelInboundTurn, finalizeInboundContext, isChannelPartialDeliveryError, resolveAgentRoute, resolveChunkMode, resolveConversationLabel, resolveMarkdownTableMode };
|
|
33
|
+
export { deliverSlackSlashReplies, dispatchChannelInboundTurn, finalizeInboundContext, isChannelPartialDeliveryError, resolveAgentRoute, resolveChunkMode, resolveConversationLabel, resolveMarkdownTableMode, sanitizeSlackMonitorReplyPayload };
|