@openclaw/slack 2026.8.1-beta.3 → 2026.8.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/account-configured-sUohAxZr.js +33 -0
- package/dist/account-inspect-CN2hBsim.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-044ldvNL.js} +53 -48
- package/dist/action-runtime.runtime-BL3KzX13.js +2 -0
- package/dist/{actions-DFk0ANVB.js → actions-BI7JkfVm.js} +266 -96
- package/dist/api.js +12 -12
- package/dist/{approval-handler.runtime-BNvAoKdK.js → approval-handler.runtime-DYv0UIZS.js} +53 -176
- package/dist/{channel-CA5w7qDF.js → channel-1vIJOzPx.js} +77 -142
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-CZWv55Wu.js → channel-type-DlFSKeIZ.js} +3 -3
- package/dist/{channel.setup-CpyYsEXH.js → channel.setup-ofDi3_Pu.js} +34 -49
- package/dist/{config-schema-CN3XZRX5.js → config-schema-BVIMyiDN.js} +19 -12
- package/dist/configured-state.js +34 -0
- package/dist/{directory-config-BGYyuzWh.js → directory-config-DqfQ42OV.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DjUJQLbq.js → directory-live-BPaNHjmP.js} +2 -2
- package/dist/{group-policy-DyfB_ZIE.js → group-policy-BdwszjYn.js} +581 -743
- package/dist/{message-tool-api-CqMr5Rmc.js → message-tool-api-CJ0kjcg5.js} +23 -5
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-Chrecrb9.js → monitor-Dq5Cmrvp.js} +3 -3
- package/dist/{outbound-adapter-DuRqAQXK.js → outbound-adapter-DYaI8ThX.js} +93 -68
- package/dist/{pipeline.runtime-Bbfd5VFW.js → pipeline.runtime-Bd22U0ga.js} +128 -160
- package/dist/{policy-BKXSxrIS.js → policy-CtQVbde1.js} +2 -1
- package/dist/{probe-BVA65leh.js → probe-0usmAb0i.js} +209 -22
- package/dist/{provider-CUUiwsg2.js → provider-CN_8hFv2.js} +243 -146
- package/dist/{relay-source-mhpMMRG-.js → relay-source-BNGpsdwV.js} +1 -1
- package/dist/{replies-SnWyXcsL.js → replies-BSiRQOJ1.js} +15 -5
- package/dist/{resolve-channels-BSpqC8jU.js → resolve-channels-Czheznc8.js} +1 -1
- package/dist/{resolve-users-Dvz9pDe0.js → resolve-users-BAOlNimr.js} +1 -1
- package/dist/runtime-api.js +11 -11
- package/dist/{scopes-BSk4GZvZ.js → scopes-COSlmhnH.js} +1 -1
- package/dist/{send-CtnOxKCc.js → send-DS9ICrBI.js} +39 -31
- package/dist/send-results-eeOu_HYm.js +23 -0
- package/dist/{send.runtime-kYctMHSd.js → send.runtime-D_Bb6IuH.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BPFfp6So.js → setup-surface-BGnd2pSe.js} +6 -6
- package/dist/{shared-DJBaslN7.js → shared-D5B-5hBg.js} +26 -6
- package/dist/{slash-dispatch.runtime-Cf2FTrnf.js → slash-dispatch.runtime-CilDmI0c.js} +3 -3
- 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/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 +23 -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/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,33 +1,34 @@
|
|
|
1
1
|
import { n as resolveSlackConversationBindingRoute, r as resolveSlackReplyToMode, t as normalizeSlackRouteBindingConfig } from "./conversation-binding-route-DFVLUdYF.js";
|
|
2
2
|
import { n as formatSlackTarget } from "./target-parsing-BnMD2ZqZ.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { I as countSlackTextUtf8Bytes, L as truncateSlackText, M as SLACK_TEXT_LIMIT, Q as normalizeSlackOutboundText, R as truncateSlackTextByUtf8Bytes, T as buildSlackBlocksFallbackText, U as SLACK_SESSION_LINK_ACTION_ID, a as qualifySlackConversationId, b as hasSlackNativeDataBlock, et as escapeSlackMrkdwn, k as SLACK_EDIT_TEXT_MAX_BYTES, m as resolveSlackReplyRenderPlan, o as qualifySlackRoutePeerId, s as resolveSlackEnterpriseMainDmSessionKey } from "./group-policy-BdwszjYn.js";
|
|
4
|
+
import { f as resolveSlackAllowListMatch, l as normalizeAllowListLower, o as formatSlackError, u as normalizeSlackAllowOwnerEntry } from "./probe-0usmAb0i.js";
|
|
5
5
|
import { n as resolveSlackStreamingMode, t as resolveSlackNativeStreaming } from "./streaming-compat-B-e0mqM0.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { c as
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
11
|
-
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, s as emitSlackMessageSentHooks, t as createSlackReplyDeliveryPlan } from "./replies-SnWyXcsL.js";
|
|
6
|
+
import { D as resolveSlackMessageText$1, E as resolveSlackBlocksText, O as buildSlackEditTextPayload, S as formatSlackFileReferenceList, T as isSlackUnfurlAttachment, a as editSlackRenderedMessage, d as reactSlackMessage, i as editSlackMessage, m as removeSlackReaction, n as deleteSlackMessage, v as logVerbose$1, w as hasSlackTableBlock, x as formatSlackFileReference } from "./actions-BI7JkfVm.js";
|
|
7
|
+
import { c as hasSlackThreadFailureNotice, d as recordSlackThreadFailureNotice, f as recordSlackThreadParticipation, l as hasSlackThreadParticipation, m as buildSlackNativeDataDeliveryPlan, o as clearSlackThreadFailureNotice, r as sendMessageSlack, u as hasSlackThreadParticipationWithPersistence } from "./send-DS9ICrBI.js";
|
|
8
|
+
import { C as resolveStorePath, E as stripSlackMentionsForCommandDetection, S as resolveChannelResetConfig, _ as resolveSlackChatType, b as readSessionUpdatedAt, c as resolveSlackThreadTargets, d as authorizeSlackBotRoomMessage, f as resolveSlackCommandIngress, g as normalizeSlackChannelType, l as trackSlackDraftMessage, o as authorizeSlackDirectMessage, p as resolveSlackEffectiveAllowFrom, r as resolveSlackRoomContextHints, s as resolveSlackThreadContext, u as resolveConversationLabel$1, v as buildSlackAssistantThreadMetadata, w as updateLastRoute, x as resolveChannelContextVisibilityMode, y as parseSlackAssistantThreadMetadata } from "./provider-CN_8hFv2.js";
|
|
9
|
+
import { n as resolveSlackChannelConfig } from "./policy-CtQVbde1.js";
|
|
10
|
+
import { a as resolveDeliveredSlackReplyThreadTs, c as emitSlackMessageSentHooks, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, s as sanitizeSlackMonitorReplyPayload, t as createSlackReplyDeliveryPlan } from "./replies-BSiRQOJ1.js";
|
|
12
11
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
12
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
14
13
|
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createChannelProgressWorkCounter, createFinalizableDraftStreamControlsForState, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftText, formatPlanChecklistLines, isChannelProgressDraftWorkToolName, resolveAgentOutboundIdentity, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelProgressDraftConfig, resolveChannelProgressDraftMaxLineChars, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
|
|
15
14
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
16
15
|
import { danger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
16
|
+
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
17
|
+
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
18
|
+
import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement, isReplyPayloadNonTerminalToolErrorWarning, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
17
19
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
18
20
|
import { createHash } from "node:crypto";
|
|
19
21
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
20
22
|
import { ensureConfiguredBindingRouteReady } from "openclaw/plugin-sdk/conversation-runtime";
|
|
23
|
+
import { resolveChannelImplicitMentions } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
21
24
|
import fs from "node:fs/promises";
|
|
22
25
|
import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
23
26
|
import { formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
24
|
-
import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement, isReplyPayloadNonTerminalToolErrorWarning, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
25
27
|
import { filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist, shouldIncludeSupplementalContext } from "openclaw/plugin-sdk/security-runtime";
|
|
26
28
|
import { mimeTypeFromFilePath } from "openclaw/plugin-sdk/media-mime";
|
|
27
29
|
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
28
30
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
29
31
|
import { enqueueRoutedSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
30
|
-
import { resolveChannelImplicitMentions } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
31
32
|
import { asDateTimestampMs, asFiniteNumberInRange, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
32
33
|
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
33
34
|
import { buildChannelInboundEventContext, buildMentionRegexes, classifyChannelInboundEvent, dispatchChannelInboundTurn, formatInboundEnvelope, formatInboundMediaUnavailableText, hasVisibleInboundReplyDispatch, implicitMentionKindWhen, logInboundDrop, matchesMentionWithExplicit, readAgentRunTerminalOutcome, recordDroppedChannelInboundHistory, resolveEnvelopeFormatOptions, resolveInboundMentionDecision, resolveInboundReplyDispatchCounts, resolveInboundSupplementalSenderAllowed, resolveUnmentionedGroupInboundPolicy, toInboundMediaFactsWithMetadata } from "openclaw/plugin-sdk/channel-inbound";
|
|
@@ -384,12 +385,12 @@ function createSlackDraftStream(params) {
|
|
|
384
385
|
const send = params.send ?? sendMessageSlack;
|
|
385
386
|
const edit = params.edit ?? editSlackMessage;
|
|
386
387
|
const remove = params.remove ?? deleteSlackMessage;
|
|
387
|
-
let
|
|
388
|
-
let streamChannelId;
|
|
388
|
+
let streamMessage;
|
|
389
389
|
let untrackConversationBoundary;
|
|
390
390
|
let lastVisibleUpdate;
|
|
391
391
|
let lastSentKey = "";
|
|
392
|
-
const
|
|
392
|
+
const pendingCleanupMessages = [];
|
|
393
|
+
let cleanupTail = Promise.resolve();
|
|
393
394
|
const finalizedMessageIds = /* @__PURE__ */ new Set();
|
|
394
395
|
const streamState = {
|
|
395
396
|
stopped: false,
|
|
@@ -411,8 +412,8 @@ function createSlackDraftStream(params) {
|
|
|
411
412
|
if (sentKey === lastSentKey) return;
|
|
412
413
|
lastSentKey = sentKey;
|
|
413
414
|
try {
|
|
414
|
-
if (
|
|
415
|
-
await edit(
|
|
415
|
+
if (streamMessage) {
|
|
416
|
+
await edit(streamMessage.channelId, streamMessage.messageId, trimmed, {
|
|
416
417
|
cfg: params.cfg,
|
|
417
418
|
token: params.token,
|
|
418
419
|
accountId: params.accountId,
|
|
@@ -444,27 +445,29 @@ function createSlackDraftStream(params) {
|
|
|
444
445
|
...params.metadata ? { metadata: params.metadata } : {},
|
|
445
446
|
...blocks ? { blocks } : {}
|
|
446
447
|
});
|
|
447
|
-
|
|
448
|
-
streamMessageId = sent.messageId || streamMessageId;
|
|
449
|
-
if (!streamChannelId || !streamMessageId) {
|
|
448
|
+
if (!sent.channelId || !sent.messageId) {
|
|
450
449
|
stopTrackingConversationBoundary();
|
|
451
450
|
streamState.stopped = true;
|
|
452
451
|
params.warn?.("slack stream preview stopped (missing identifiers from sendMessage)");
|
|
453
452
|
return;
|
|
454
453
|
}
|
|
454
|
+
streamMessage = {
|
|
455
|
+
channelId: sent.channelId,
|
|
456
|
+
messageId: sent.messageId
|
|
457
|
+
};
|
|
455
458
|
lastVisibleUpdate = {
|
|
456
459
|
text: trimmed,
|
|
457
460
|
...blocks ? { blocks } : {}
|
|
458
461
|
};
|
|
459
|
-
if (pendingBoundary && params.conversationChannelId ===
|
|
462
|
+
if (pendingBoundary && params.conversationChannelId === streamMessage.channelId) pendingBoundary.setMessageTs(streamMessage.messageId);
|
|
460
463
|
else {
|
|
461
464
|
stopTrackingConversationBoundary();
|
|
462
465
|
untrackConversationBoundary = trackSlackDraftMessage({
|
|
463
466
|
accountId: params.accountId,
|
|
464
467
|
teamId: params.eventScope?.teamId,
|
|
465
|
-
channelId:
|
|
468
|
+
channelId: streamMessage.channelId,
|
|
466
469
|
threadTs,
|
|
467
|
-
messageTs:
|
|
470
|
+
messageTs: streamMessage.messageId,
|
|
468
471
|
onInterveningMessage: forceNewMessage
|
|
469
472
|
}).stop;
|
|
470
473
|
}
|
|
@@ -485,60 +488,58 @@ function createSlackDraftStream(params) {
|
|
|
485
488
|
untrackConversationBoundary?.();
|
|
486
489
|
untrackConversationBoundary = void 0;
|
|
487
490
|
};
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
491
|
+
const dropDetachedMessages = () => {
|
|
492
|
+
cleanupTail = cleanupTail.then(async () => {
|
|
493
|
+
for (let index = 0; index < pendingCleanupMessages.length;) {
|
|
494
|
+
const message = pendingCleanupMessages[index];
|
|
495
|
+
if (!message) return;
|
|
496
|
+
try {
|
|
497
|
+
await remove(message.channelId, message.messageId, {
|
|
498
|
+
token: params.token,
|
|
499
|
+
accountId: params.accountId,
|
|
500
|
+
...params.eventScope ? { client: params.eventScope.client } : {}
|
|
501
|
+
});
|
|
502
|
+
pendingCleanupMessages.splice(index, 1);
|
|
503
|
+
} catch (err) {
|
|
504
|
+
params.warn?.(`slack stream preview cleanup failed: ${formatSlackError(err)}`);
|
|
505
|
+
index += 1;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
return cleanupTail;
|
|
498
510
|
};
|
|
499
511
|
const clear = async () => {
|
|
500
512
|
stopTrackingConversationBoundary();
|
|
501
513
|
await discardPending();
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
514
|
+
if (streamMessage) {
|
|
515
|
+
pendingCleanupMessages.push(streamMessage);
|
|
516
|
+
streamMessage = void 0;
|
|
517
|
+
}
|
|
506
518
|
lastVisibleUpdate = void 0;
|
|
507
519
|
lastSentKey = "";
|
|
508
|
-
|
|
509
|
-
await removeMessage(channelId, messageId);
|
|
520
|
+
await dropDetachedMessages();
|
|
510
521
|
};
|
|
511
522
|
const forceNewMessage = () => {
|
|
512
523
|
stopTrackingConversationBoundary();
|
|
513
524
|
streamState.stopped = false;
|
|
514
525
|
streamState.final = false;
|
|
515
|
-
if (
|
|
516
|
-
|
|
517
|
-
messageId: streamMessageId
|
|
518
|
-
});
|
|
519
|
-
streamMessageId = void 0;
|
|
520
|
-
streamChannelId = void 0;
|
|
526
|
+
if (streamMessage && !finalizedMessageIds.has(streamMessage.messageId)) pendingCleanupMessages.push(streamMessage);
|
|
527
|
+
streamMessage = void 0;
|
|
521
528
|
lastVisibleUpdate = void 0;
|
|
522
529
|
lastSentKey = "";
|
|
523
530
|
loop.resetPending();
|
|
524
531
|
};
|
|
525
|
-
const dropDetachedMessages = async () => {
|
|
526
|
-
let message;
|
|
527
|
-
while ((message = detachedMessages.shift()) !== void 0) {
|
|
528
|
-
const { channelId, messageId } = message;
|
|
529
|
-
await removeMessage(channelId, messageId);
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
532
|
const discardPendingAndStopTracking = async () => {
|
|
533
533
|
stopTrackingConversationBoundary();
|
|
534
534
|
await discardPending();
|
|
535
535
|
};
|
|
536
536
|
const finalizeMessage = async (messageId, editFinal) => {
|
|
537
|
-
const
|
|
537
|
+
const currentMessage = streamMessage;
|
|
538
538
|
const previousUpdate = lastVisibleUpdate;
|
|
539
|
-
if (!
|
|
539
|
+
if (!currentMessage || currentMessage.messageId !== messageId || !previousUpdate) return false;
|
|
540
|
+
const { channelId } = currentMessage;
|
|
540
541
|
await editFinal();
|
|
541
|
-
if (
|
|
542
|
+
if (streamMessage?.channelId === channelId && streamMessage.messageId === messageId) {
|
|
542
543
|
finalizedMessageIds.add(messageId);
|
|
543
544
|
stopTrackingConversationBoundary();
|
|
544
545
|
return true;
|
|
@@ -566,8 +567,8 @@ function createSlackDraftStream(params) {
|
|
|
566
567
|
forceNewMessage,
|
|
567
568
|
dropDetachedMessages,
|
|
568
569
|
finalizeMessage,
|
|
569
|
-
messageId: () =>
|
|
570
|
-
channelId: () =>
|
|
570
|
+
messageId: () => streamMessage?.messageId,
|
|
571
|
+
channelId: () => streamMessage?.channelId
|
|
571
572
|
};
|
|
572
573
|
}
|
|
573
574
|
//#endregion
|
|
@@ -1336,7 +1337,7 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1336
1337
|
log: logVerbose,
|
|
1337
1338
|
warn: logVerbose
|
|
1338
1339
|
}) : void 0;
|
|
1339
|
-
let
|
|
1340
|
+
let hasStreamedAnswer = false;
|
|
1340
1341
|
const isProgressMode = slackStreaming.mode === "progress";
|
|
1341
1342
|
const useNativeProgressStreaming = useStreaming && slackStreaming.mode === "progress";
|
|
1342
1343
|
const progressDraftActive = Boolean(draftStream) || useNativeProgressStreaming;
|
|
@@ -1513,7 +1514,6 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1513
1514
|
text: previewText,
|
|
1514
1515
|
blocks: progressCard.resolvePresentation(snapshot, "working")
|
|
1515
1516
|
} : previewText);
|
|
1516
|
-
hasStreamedMessage = true;
|
|
1517
1517
|
if (options?.flush) await draftStream.flush();
|
|
1518
1518
|
return Boolean(draftStream.messageId() && draftStream.channelId());
|
|
1519
1519
|
}
|
|
@@ -1595,10 +1595,7 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1595
1595
|
narration: explanation,
|
|
1596
1596
|
plan: steps
|
|
1597
1597
|
});
|
|
1598
|
-
if (text)
|
|
1599
|
-
draftStream.update(text);
|
|
1600
|
-
hasStreamedMessage = true;
|
|
1601
|
-
}
|
|
1598
|
+
if (text) draftStream.update(text);
|
|
1602
1599
|
return false;
|
|
1603
1600
|
};
|
|
1604
1601
|
const pushPreviewProgress = async (line, options) => {
|
|
@@ -1613,7 +1610,7 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1613
1610
|
return await progressDraft.pushToolProgress(line, options);
|
|
1614
1611
|
};
|
|
1615
1612
|
const updateDraftFromPartial = (text) => {
|
|
1616
|
-
const trimmed = text
|
|
1613
|
+
const trimmed = text && sanitizeAssistantVisibleText(text).trimEnd();
|
|
1617
1614
|
if (!trimmed) return false;
|
|
1618
1615
|
if (slackStreaming.mode === "block") {
|
|
1619
1616
|
previewToolProgressSuppressed = true;
|
|
@@ -1627,14 +1624,14 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1627
1624
|
appendSourceText = next.source;
|
|
1628
1625
|
if (!next.changed) return false;
|
|
1629
1626
|
draftStream?.update(next.rendered);
|
|
1630
|
-
|
|
1627
|
+
hasStreamedAnswer = true;
|
|
1631
1628
|
return false;
|
|
1632
1629
|
}
|
|
1633
1630
|
if (isProgressMode) return false;
|
|
1634
1631
|
previewToolProgressSuppressed = true;
|
|
1635
1632
|
progressDraft.suppress();
|
|
1636
1633
|
draftStream?.update(trimmed);
|
|
1637
|
-
|
|
1634
|
+
hasStreamedAnswer = true;
|
|
1638
1635
|
return false;
|
|
1639
1636
|
};
|
|
1640
1637
|
const pushReasoningProgress = async (payload) => {
|
|
@@ -1654,7 +1651,7 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1654
1651
|
return await progressDraft.pushReasoningProgress(payload.text, { snapshot: payload.isReasoningSnapshot === true });
|
|
1655
1652
|
};
|
|
1656
1653
|
const resetDraftDeliveryState = () => {
|
|
1657
|
-
|
|
1654
|
+
hasStreamedAnswer = false;
|
|
1658
1655
|
appendRenderedText = "";
|
|
1659
1656
|
appendSourceText = "";
|
|
1660
1657
|
};
|
|
@@ -1687,7 +1684,7 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1687
1684
|
await beginNewProgressTurn();
|
|
1688
1685
|
return;
|
|
1689
1686
|
}
|
|
1690
|
-
if (
|
|
1687
|
+
if (hasStreamedAnswer) draftStream?.forceNewMessage();
|
|
1691
1688
|
resetDraftDeliveryState();
|
|
1692
1689
|
resetDraftProgressState();
|
|
1693
1690
|
};
|
|
@@ -1742,41 +1739,6 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1742
1739
|
};
|
|
1743
1740
|
}
|
|
1744
1741
|
//#endregion
|
|
1745
|
-
//#region extensions/slack/src/threading.ts
|
|
1746
|
-
function resolveSlackThreadContext(params) {
|
|
1747
|
-
const incomingThreadTs = params.message.thread_ts;
|
|
1748
|
-
const eventTs = params.message.event_ts;
|
|
1749
|
-
const messageTs = params.message.ts ?? eventTs;
|
|
1750
|
-
const hasThreadTs = typeof incomingThreadTs === "string" && incomingThreadTs.length > 0;
|
|
1751
|
-
const isThreadReply = hasThreadTs && (incomingThreadTs !== messageTs || Boolean(params.message.parent_user_id));
|
|
1752
|
-
const replyToId = isThreadReply ? incomingThreadTs : void 0;
|
|
1753
|
-
const isAssistantDmThreadRoot = hasThreadTs && !isThreadReply && params.isDirectMessage === true;
|
|
1754
|
-
return {
|
|
1755
|
-
incomingThreadTs,
|
|
1756
|
-
messageTs,
|
|
1757
|
-
isThreadReply,
|
|
1758
|
-
replyToId,
|
|
1759
|
-
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
1760
|
-
};
|
|
1761
|
-
}
|
|
1762
|
-
/**
|
|
1763
|
-
* Resolves Slack thread targeting for replies and status indicators.
|
|
1764
|
-
*
|
|
1765
|
-
* @returns replyThreadTs - Thread timestamp for reply messages
|
|
1766
|
-
* @returns statusThreadTs - Thread timestamp for status indicators (typing, etc.)
|
|
1767
|
-
* @returns isThreadReply - true if this is a genuine user reply in a thread,
|
|
1768
|
-
* false if thread_ts comes from a bot status message (e.g. typing indicator)
|
|
1769
|
-
*/
|
|
1770
|
-
function resolveSlackThreadTargets(params) {
|
|
1771
|
-
const { incomingThreadTs, messageTs, isThreadReply } = resolveSlackThreadContext(params);
|
|
1772
|
-
const replyThreadTs = isThreadReply ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0;
|
|
1773
|
-
return {
|
|
1774
|
-
replyThreadTs,
|
|
1775
|
-
statusThreadTs: replyThreadTs,
|
|
1776
|
-
isThreadReply
|
|
1777
|
-
};
|
|
1778
|
-
}
|
|
1779
|
-
//#endregion
|
|
1780
1742
|
//#region extensions/slack/src/monitor/message-handler/dispatch-setup.ts
|
|
1781
1743
|
async function createSlackDispatchSetup(prepared) {
|
|
1782
1744
|
const { ctx, account, message, route } = prepared;
|
|
@@ -1898,10 +1860,7 @@ async function createSlackDispatchSetup(prepared) {
|
|
|
1898
1860
|
agentId: route.agentId,
|
|
1899
1861
|
channel: "slack",
|
|
1900
1862
|
accountId: route.accountId,
|
|
1901
|
-
transformReplyPayload:
|
|
1902
|
-
if (payload.isReasoning === true) return null;
|
|
1903
|
-
return payload;
|
|
1904
|
-
},
|
|
1863
|
+
transformReplyPayload: sanitizeSlackMonitorReplyPayload,
|
|
1905
1864
|
typing: {
|
|
1906
1865
|
start: async () => {
|
|
1907
1866
|
if (!threadStatusGate.hasVisibleOutput()) {
|
|
@@ -2187,7 +2146,6 @@ function createSlackStreamingDeliveryRuntime(setup) {
|
|
|
2187
2146
|
}
|
|
2188
2147
|
};
|
|
2189
2148
|
const deliverNormally = async (params) => {
|
|
2190
|
-
if (params.payload.isReasoning === true) return;
|
|
2191
2149
|
const replyThreadTs = resolveDeliveryThreadTs(params);
|
|
2192
2150
|
const deliveryReplyThreadTs = replyDeliveryMode === "off" && !forcedReplyThreadTs && !isThreadReply ? void 0 : replyThreadTs;
|
|
2193
2151
|
if (deliveryTracker.hasDelivered({
|
|
@@ -2250,7 +2208,6 @@ function createSlackStreamingDeliveryRuntime(setup) {
|
|
|
2250
2208
|
return !state.streamFailed && !reply.hasMedia && renderPlan.mode !== "split" && !plannedBlocks?.length && !readSlackReplyBlocks(payload)?.length && reply.hasText && (!options?.maxTextBytes || countSlackTextUtf8Bytes(reply.trimmedText) <= options.maxTextBytes);
|
|
2251
2209
|
};
|
|
2252
2210
|
const deliverWithStreaming = async (params) => {
|
|
2253
|
-
if (params.payload.isReasoning === true) return;
|
|
2254
2211
|
const reply = resolveSendableOutboundReplyParts(params.payload);
|
|
2255
2212
|
if (!isStreamingEligible(params.payload)) {
|
|
2256
2213
|
await deliverNormally({
|
|
@@ -2452,7 +2409,6 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
2452
2409
|
return payload;
|
|
2453
2410
|
};
|
|
2454
2411
|
const deliverSlackPayload = async (payload, info) => {
|
|
2455
|
-
if (payload.isReasoning === true) return { visibleReplySent: false };
|
|
2456
2412
|
if (info.kind === "final" && slackStreaming.mode === "progress" && progress.isProgressMode) {
|
|
2457
2413
|
if (progress.useNativeProgressStreaming) {
|
|
2458
2414
|
await progress.deliverNativeFinal(payload, info.kind);
|
|
@@ -2503,7 +2459,11 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
2503
2459
|
const slackBlocks = replyRenderPlan.mode === "single" ? replyRenderPlan.blocks : replyRenderPlan.blockPart?.blocks;
|
|
2504
2460
|
const requiresSeparateFallbackDelivery = replyRenderPlan.mode === "split";
|
|
2505
2461
|
const trimmedFinalText = replyRenderPlan.mode === "single" ? replyRenderPlan.text.trim() : replyRenderPlan.fallbackText.trim();
|
|
2506
|
-
const previewFinalText = replyRenderPlan.mode === "single" && replyRenderPlan.textIsSlackMrkdwn ? trimmedFinalText : normalizeSlackOutboundText((replySourceText ?? "").trim()
|
|
2462
|
+
const previewFinalText = replyRenderPlan.mode === "single" && replyRenderPlan.textIsSlackMrkdwn ? trimmedFinalText : normalizeSlackOutboundText((replySourceText ?? "").trim(), { tableMode: resolveMarkdownTableMode({
|
|
2463
|
+
cfg,
|
|
2464
|
+
channel: "slack",
|
|
2465
|
+
accountId: account.accountId
|
|
2466
|
+
}) });
|
|
2507
2467
|
const previewFinalTextFitsEdit = countSlackTextUtf8Bytes(previewFinalText) <= SLACK_EDIT_TEXT_MAX_BYTES;
|
|
2508
2468
|
const shouldRestoreTtsSupplementTextForPreviewFallback = Boolean(ttsSupplement) && ttsSupplement?.visibleTextAlreadyDelivered !== true && Boolean(draftStream) && !draftPreviewCommitted.value && !delivery.observedFinalReplyDelivery && previewStreamingEnabled && !payload.text?.trim();
|
|
2509
2469
|
let ttsPreviewFinalization;
|
|
@@ -2619,6 +2579,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
2619
2579
|
sessionKey: route.sessionKey
|
|
2620
2580
|
},
|
|
2621
2581
|
ctxPayload: prepared.ctxPayload,
|
|
2582
|
+
dispatchReplyFromConfig: ctx.dispatchReplyFromConfig,
|
|
2622
2583
|
dispatcherOptions: {
|
|
2623
2584
|
...replyPipeline,
|
|
2624
2585
|
transformReplyPayload: (payload) => {
|
|
@@ -3008,7 +2969,24 @@ async function discardSlackPreflightMedia(media) {
|
|
|
3008
2969
|
const SLACK_MENTION_RESOLUTION_CONCURRENCY = 4;
|
|
3009
2970
|
const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
3010
2971
|
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
3011
|
-
const
|
|
2972
|
+
const MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS = 2e3;
|
|
2973
|
+
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-BI7JkfVm.js").then((n) => n._));
|
|
2974
|
+
function formatSlackUnavailableMedia(params) {
|
|
2975
|
+
let fileReferences = params.files?.map((file) => `${formatSlackFileReference(file)} unavailable (${file.reason})`).join(", ");
|
|
2976
|
+
if (fileReferences && fileReferences.length > MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS) fileReferences = `${truncateUtf16Safe(fileReferences, MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS)}; … (file references truncated)`;
|
|
2977
|
+
const fileBlock = fileReferences ? `[Slack file: ${fileReferences}]` : void 0;
|
|
2978
|
+
const body = [params.body, fileBlock].filter(Boolean).join("\n");
|
|
2979
|
+
if (params.unavailableMediaCount === 0) return body;
|
|
2980
|
+
const notice = `[slack ${params.unavailableMediaCount > 1 ? `${params.unavailableMediaCount} attachments` : "attachment"} unavailable]`;
|
|
2981
|
+
return params.prependUnavailable ? [
|
|
2982
|
+
notice,
|
|
2983
|
+
fileBlock,
|
|
2984
|
+
params.body
|
|
2985
|
+
].filter(Boolean).join("\n") : formatInboundMediaUnavailableText({
|
|
2986
|
+
body,
|
|
2987
|
+
notice
|
|
2988
|
+
});
|
|
2989
|
+
}
|
|
3012
2990
|
function collectUniqueSlackMentionIds$1(texts) {
|
|
3013
2991
|
const seen = /* @__PURE__ */ new Set();
|
|
3014
2992
|
const mentionIds = [];
|
|
@@ -3046,8 +3024,9 @@ async function resolveSlackMessageContent(params) {
|
|
|
3046
3024
|
isThreadReply: params.isThreadReply,
|
|
3047
3025
|
threadStarter: params.threadStarter
|
|
3048
3026
|
});
|
|
3049
|
-
const
|
|
3027
|
+
const attachmentContent = ownFiles?.length || params.message.attachments?.length ? await loadSlackMediaModule$1().then(({ resolveSlackAttachmentContent }) => resolveSlackAttachmentContent({
|
|
3050
3028
|
files: ownFiles,
|
|
3029
|
+
attachments: params.message.attachments,
|
|
3051
3030
|
client: params.client,
|
|
3052
3031
|
token: params.botToken,
|
|
3053
3032
|
maxBytes: params.mediaMaxBytes,
|
|
@@ -3055,30 +3034,9 @@ async function resolveSlackMessageContent(params) {
|
|
|
3055
3034
|
totalTimeoutMs: params.mediaTotalTimeoutMs,
|
|
3056
3035
|
abortSignal: params.abortSignal,
|
|
3057
3036
|
preloadedMedia: params.preloadedMedia
|
|
3058
|
-
})) :
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3061
|
-
client: params.client,
|
|
3062
|
-
token: params.botToken,
|
|
3063
|
-
maxBytes: params.mediaMaxBytes,
|
|
3064
|
-
readIdleTimeoutMs: params.mediaReadIdleTimeoutMs,
|
|
3065
|
-
totalTimeoutMs: params.mediaTotalTimeoutMs,
|
|
3066
|
-
abortSignal: params.abortSignal
|
|
3067
|
-
})) : Promise.resolve(null);
|
|
3068
|
-
const [media, attachmentContent] = await Promise.all([mediaPromise, attachmentContentPromise]);
|
|
3069
|
-
const mergedMedia = [...media ?? [], ...attachmentContent?.media ?? []];
|
|
3070
|
-
const effectiveDirectMedia = mergedMedia.length > 0 ? mergedMedia : null;
|
|
3071
|
-
const mediaPlaceholder = effectiveDirectMedia ? effectiveDirectMedia.map((item) => item.placeholder).join(" ") : void 0;
|
|
3072
|
-
const fallbackFileIds = /* @__PURE__ */ new Set();
|
|
3073
|
-
const fallbackFiles = [...ownFiles ?? [], ...attachmentContent?.files ?? []].filter((file) => {
|
|
3074
|
-
const fileId = normalizeOptionalString(file.id);
|
|
3075
|
-
if (!fileId) return true;
|
|
3076
|
-
if (fallbackFileIds.has(fileId)) return false;
|
|
3077
|
-
fallbackFileIds.add(fileId);
|
|
3078
|
-
return true;
|
|
3079
|
-
});
|
|
3080
|
-
const fileOnlyFallback = !mediaPlaceholder && fallbackFiles.length > 0 ? fallbackFiles.slice(0, 8).map((file) => formatSlackFileReference(file)).join(", ") : void 0;
|
|
3081
|
-
const fileOnlyPlaceholder = fileOnlyFallback ? `[Slack file: ${fileOnlyFallback}]` : void 0;
|
|
3037
|
+
})) : null;
|
|
3038
|
+
const effectiveDirectMedia = attachmentContent?.media.length ? attachmentContent.media : null;
|
|
3039
|
+
const mediaPlaceholder = effectiveDirectMedia?.map((item) => item.placeholder).join(" ");
|
|
3082
3040
|
let botAttachmentText;
|
|
3083
3041
|
if (params.isBotMessage && !attachmentContent?.text) {
|
|
3084
3042
|
const botAttachmentTextParts = [];
|
|
@@ -3115,23 +3073,20 @@ async function resolveSlackMessageContent(params) {
|
|
|
3115
3073
|
renderedMentions.set(result.userId, result.rendered);
|
|
3116
3074
|
}
|
|
3117
3075
|
}
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
body: rawBody,
|
|
3128
|
-
notice: `[slack ${unavailableImageCount > 1 ? `${unavailableImageCount} forwarded images` : "forwarded image"} unavailable]`
|
|
3076
|
+
const rawBody = formatSlackUnavailableMedia({
|
|
3077
|
+
body: [
|
|
3078
|
+
renderSlackUserMentions(textParts[0], renderedMentions),
|
|
3079
|
+
renderSlackUserMentions(textParts[1], renderedMentions),
|
|
3080
|
+
renderSlackUserMentions(textParts[2], renderedMentions),
|
|
3081
|
+
mediaPlaceholder
|
|
3082
|
+
].filter(Boolean).join("\n") || "",
|
|
3083
|
+
files: attachmentContent?.files,
|
|
3084
|
+
unavailableMediaCount: attachmentContent?.unavailableMediaCount ?? 0
|
|
3129
3085
|
});
|
|
3130
|
-
|
|
3131
|
-
return {
|
|
3086
|
+
return rawBody ? {
|
|
3132
3087
|
rawBody,
|
|
3133
3088
|
effectiveDirectMedia
|
|
3134
|
-
};
|
|
3089
|
+
} : null;
|
|
3135
3090
|
}
|
|
3136
3091
|
//#endregion
|
|
3137
3092
|
//#region extensions/slack/src/monitor/message-handler/prepare-dm-history.ts
|
|
@@ -3359,7 +3314,7 @@ function formatSlackThreadLabelSnippet(text) {
|
|
|
3359
3314
|
}
|
|
3360
3315
|
//#endregion
|
|
3361
3316
|
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
3362
|
-
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-
|
|
3317
|
+
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-BI7JkfVm.js").then((n) => n._));
|
|
3363
3318
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
3364
3319
|
function resolveSlackThreadSessionFreshness(params) {
|
|
3365
3320
|
return params.ctx.channelRuntime?.session?.resolveEntryResetFreshness?.({
|
|
@@ -3471,13 +3426,20 @@ async function resolveSlackThreadContextData(params) {
|
|
|
3471
3426
|
const snippet = formatSlackThreadLabelSnippet(starter.text);
|
|
3472
3427
|
threadLabel = `Slack thread ${params.roomLabel}${snippet ? `: ${snippet}` : ""}`;
|
|
3473
3428
|
if (shouldSeedInitialThreadContext && !params.effectiveDirectMedia && starter.files && starter.files.length > 0) {
|
|
3474
|
-
const {
|
|
3475
|
-
|
|
3429
|
+
const { resolveSlackAttachmentContent } = await loadSlackMediaModule();
|
|
3430
|
+
const attachmentContent = await resolveSlackAttachmentContent({
|
|
3476
3431
|
files: starter.files,
|
|
3477
3432
|
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
3478
3433
|
token: params.ctx.botToken,
|
|
3479
3434
|
maxBytes: params.ctx.mediaMaxBytes
|
|
3480
3435
|
});
|
|
3436
|
+
threadStarterMedia = attachmentContent?.media.length ? attachmentContent.media : null;
|
|
3437
|
+
if (attachmentContent) threadStarterBody = formatSlackUnavailableMedia({
|
|
3438
|
+
body: threadStarterBody,
|
|
3439
|
+
files: attachmentContent.files,
|
|
3440
|
+
unavailableMediaCount: attachmentContent.unavailableMediaCount,
|
|
3441
|
+
prependUnavailable: true
|
|
3442
|
+
});
|
|
3481
3443
|
if (threadStarterMedia) logVerbose(`slack: hydrated thread starter file ${threadStarterMedia.map((item) => item.placeholder).join(", ")} from root message`);
|
|
3482
3444
|
}
|
|
3483
3445
|
} else threadLabel = `Slack thread ${params.roomLabel}`;
|
|
@@ -3498,14 +3460,20 @@ async function resolveSlackThreadContextData(params) {
|
|
|
3498
3460
|
const threadInitialHistoryLimit = params.account.config?.thread?.initialHistoryLimit ?? 20;
|
|
3499
3461
|
if (threadInitialHistoryLimit > 0 && shouldLoadInitialThreadHistory) {
|
|
3500
3462
|
const currentBotRootTs = starter?.ts ?? params.threadTs;
|
|
3463
|
+
const threadHistory = await resolveSlackThreadHistory({
|
|
3464
|
+
channelId: params.message.channel,
|
|
3465
|
+
threadTs: params.threadTs,
|
|
3466
|
+
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
3467
|
+
currentMessageTs: params.message.ts,
|
|
3468
|
+
limit: threadInitialHistoryLimit
|
|
3469
|
+
});
|
|
3470
|
+
const enrichedStarter = starter && threadStarterBody && threadStarterBody !== starter.text ? {
|
|
3471
|
+
...starter,
|
|
3472
|
+
text: threadStarterBody,
|
|
3473
|
+
ts: currentBotRootTs
|
|
3474
|
+
} : null;
|
|
3501
3475
|
const threadHistoryWithBotRoot = ensureSlackThreadHistoryHasBotRoot({
|
|
3502
|
-
history:
|
|
3503
|
-
channelId: params.message.channel,
|
|
3504
|
-
threadTs: params.threadTs,
|
|
3505
|
-
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
3506
|
-
currentMessageTs: params.message.ts,
|
|
3507
|
-
limit: threadInitialHistoryLimit
|
|
3508
|
-
}),
|
|
3476
|
+
history: enrichedStarter && !threadHistory.some((entry) => entry.ts === currentBotRootTs) ? [enrichedStarter, ...threadHistory.length >= threadInitialHistoryLimit ? threadHistory.slice(1) : threadHistory] : threadHistory,
|
|
3509
3477
|
includeBotStarterAsRootContext,
|
|
3510
3478
|
threadStarter: starter ? {
|
|
3511
3479
|
...starter,
|
|
@@ -3564,7 +3532,7 @@ async function resolveSlackThreadContextData(params) {
|
|
|
3564
3532
|
});
|
|
3565
3533
|
const role = isCurrentBot || isOtherBot || Boolean(historyMsg.botId) ? "assistant" : "user";
|
|
3566
3534
|
const msgSenderName = isCurrentBot ? "Bot (this assistant)" : msgUser?.name ?? (historyMsg.botId ? `Bot (${historyMsg.botId})` : "Unknown");
|
|
3567
|
-
const msgWithId = `${historyMsg.text}\n[slack message id: ${historyMsg.ts ?? "unknown"} channel: ${params.message.channel}]`;
|
|
3535
|
+
const msgWithId = `${historyMsg.ts === currentBotRootTs && threadStarterBody ? threadStarterBody : historyMsg.text}\n[slack message id: ${historyMsg.ts ?? "unknown"} channel: ${params.message.channel}]`;
|
|
3568
3536
|
historyParts.push(formatInboundEnvelope({
|
|
3569
3537
|
channel: "Slack",
|
|
3570
3538
|
from: `${msgSenderName} (${role})`,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as buildSlackChannelPolicyScope, t as buildSlackChannelIdCandidates } from "./group-policy-BdwszjYn.js";
|
|
2
|
+
import { d as normalizeSlackSlug, p as resolveSlackUserAllowListForTeam } from "./probe-0usmAb0i.js";
|
|
2
3
|
import { applyChannelMatchMeta, buildChannelKeyCandidates } from "openclaw/plugin-sdk/channel-targets";
|
|
3
4
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
4
5
|
//#region extensions/slack/src/monitor/channel-config.ts
|