@openclaw/slack 2026.8.1-beta.3 → 2026.9.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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-BoSeX09X.js} +18 -21
- package/dist/action-runtime.runtime-Dpa16J87.js +2 -0
- package/dist/{actions-DFk0ANVB.js → actions-XdQyjG_p.js} +98 -66
- package/dist/api.js +12 -12
- package/dist/{approval-handler.runtime-BNvAoKdK.js → approval-handler.runtime-DxXfGX_Z.js} +53 -176
- package/dist/{channel-CA5w7qDF.js → channel-C_vnTgxo.js} +60 -54
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-CZWv55Wu.js → channel-type-j-2lalcC.js} +3 -3
- package/dist/{channel.setup-CpyYsEXH.js → channel.setup-aal8tokM.js} +33 -48
- 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-lC6X_Ru-.js} +2 -2
- package/dist/{group-policy-DyfB_ZIE.js → group-policy-CU1tEGpS.js} +536 -609
- package/dist/{message-tool-api-CqMr5Rmc.js → message-tool-api-CWosHSi5.js} +6 -5
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-Chrecrb9.js → monitor-DrNCGneD.js} +3 -3
- package/dist/{outbound-adapter-DuRqAQXK.js → outbound-adapter-DkT2vUE9.js} +34 -13
- package/dist/{pipeline.runtime-Bbfd5VFW.js → pipeline.runtime-CRRng_Nw.js} +74 -137
- package/dist/{policy-BKXSxrIS.js → policy-BoP6t88v.js} +1 -1
- package/dist/{probe-BVA65leh.js → probe-4_aHtVT3.js} +2 -21
- package/dist/{provider-CUUiwsg2.js → provider-D4nDgxCh.js} +187 -63
- package/dist/{relay-source-mhpMMRG-.js → relay-source-CEmze11m.js} +1 -1
- package/dist/{replies-SnWyXcsL.js → replies-D9XMM_S0.js} +14 -4
- package/dist/{resolve-channels-BSpqC8jU.js → resolve-channels-DSamDgVs.js} +1 -1
- package/dist/{resolve-users-Dvz9pDe0.js → resolve-users-CIzwbaJR.js} +1 -1
- package/dist/runtime-api.js +11 -11
- package/dist/{scopes-BSk4GZvZ.js → scopes-BBrUzpBH.js} +1 -1
- package/dist/{send-CtnOxKCc.js → send-DtjEnlLh.js} +37 -29
- package/dist/{send.runtime-kYctMHSd.js → send.runtime-DQeNKa2J.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BPFfp6So.js → setup-surface-CsBCM4rP.js} +6 -6
- package/dist/{shared-DJBaslN7.js → shared-D9GeeR9K.js} +24 -6
- package/dist/{slack-client-kind-BXyOOICI.js → slack-client-kind-hSfjXyUM.js} +1 -1
- package/dist/{slash-dispatch.runtime-Cf2FTrnf.js → slash-dispatch.runtime-Chr3YHnT.js} +2 -2
- 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/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/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,5 +1,5 @@
|
|
|
1
|
-
import { n as listSlackAccountIds } from "./accounts-
|
|
2
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
1
|
+
import { n as listSlackAccountIds } from "./accounts-Dm_H77gH.js";
|
|
2
|
+
import { t as inspectSlackAccount } from "./account-inspect-CN2hBsim.js";
|
|
3
3
|
import { n as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-DUGhaYKq.js";
|
|
4
4
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
5
5
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
@@ -71,8 +71,9 @@ const SLACK_MESSAGE_ID_ACTIONS = [
|
|
|
71
71
|
function createSlackFileActionSchema() {
|
|
72
72
|
return { fileId: Type.Optional(Type.String({ description: "Slack file id, starting with \"F\" (for example F0B0LTT8M36). Required for action=\"download-file\". Read it from inbound Slack file metadata at event.files[].id. This is not the Slack message timestamp/messageId." })) };
|
|
73
73
|
}
|
|
74
|
-
function createSlackReactionEmojiSchema() {
|
|
75
|
-
|
|
74
|
+
function createSlackReactionEmojiSchema(emojiListAvailable) {
|
|
75
|
+
const discoveryHint = emojiListAvailable ? " Discover workspace custom emoji with action:\"emoji-list\"." : "";
|
|
76
|
+
return { emoji: Type.Optional(Type.String({ description: "Slack standard or workspace custom emoji shortcode (for example \"white_check_mark\" or \"+1\") or common emoji character (for example \"✅\"). Colons are optional." + discoveryHint })) };
|
|
76
77
|
}
|
|
77
78
|
function createSlackForcedMediaSchema() {
|
|
78
79
|
const description = "Preserve original image bytes without image optimization. Slack still uploads a regular file; this does not convert it into a Slack document.";
|
|
@@ -119,7 +120,7 @@ function describeSlackMessageTool({ cfg, accountId }) {
|
|
|
119
120
|
actions: ["upload-file"]
|
|
120
121
|
});
|
|
121
122
|
if (actions.includes("react")) schema.push({
|
|
122
|
-
properties: createSlackReactionEmojiSchema(),
|
|
123
|
+
properties: createSlackReactionEmojiSchema(actions.includes("emoji-list")),
|
|
123
124
|
actions: ["react", "reactions"]
|
|
124
125
|
});
|
|
125
126
|
const messageIdActions = [];
|
package/dist/message-tool-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as describeSlackMessageTool } from "./message-tool-api-
|
|
1
|
+
import { t as describeSlackMessageTool } from "./message-tool-api-CWosHSi5.js";
|
|
2
2
|
export { describeSlackMessageTool as describeMessageTool };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
4
|
-
import { o as resolveSlackThreadTs } from "./replies-
|
|
2
|
+
import { T as buildSlackSlashCommandMatcher, t as monitorSlackProvider } from "./provider-D4nDgxCh.js";
|
|
3
|
+
import { t as isSlackChannelAllowedByPolicy } from "./policy-BoP6t88v.js";
|
|
4
|
+
import { o as resolveSlackThreadTs } from "./replies-D9XMM_S0.js";
|
|
5
5
|
//#region extensions/slack/src/monitor.ts
|
|
6
6
|
var monitor_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
buildSlackSlashCommandMatcher: () => buildSlackSlashCommandMatcher,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as parseSlackTarget } from "./target-parsing-BnMD2ZqZ.js";
|
|
2
|
-
import {
|
|
2
|
+
import { B as SLACK_TEXT_LIMIT, I as resolveSlackAuthoredTextPlacement, ct as escapeSlackMrkdwn, dt as SLACK_PRESENTATION_CAPABILITIES, q as SLACK_QUESTION_FINALIZATION_BLOCKS, tt as resolveSlackQuestionActionIds, v as parseSlackReplyBlockSegments, x as resolveSlackReplyDeliveryMessages, y as resolveSlackReplyBlockResolution } from "./group-policy-CU1tEGpS.js";
|
|
3
3
|
import { n as resolveSlackThreadTsValue } from "./thread-ts-DUGhaYKq.js";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
5
|
+
import { createMessageReceiptFromOutboundResults, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
6
6
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
7
7
|
import { normalizeMessagePresentation, resolveLegacyInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
|
|
8
8
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
@@ -49,7 +49,7 @@ function readSlackRenderedPresentation(slackData) {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-
|
|
52
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-DQeNKa2J.js"));
|
|
53
53
|
function resolveSlackSendIdentity(identity) {
|
|
54
54
|
if (!identity) return;
|
|
55
55
|
const username = normalizeOptionalString(identity.name);
|
|
@@ -173,6 +173,7 @@ const slackOutbound = {
|
|
|
173
173
|
text: payload.text
|
|
174
174
|
});
|
|
175
175
|
const useSingleDeliveryMarker = mediaUrls.length === 0 && deliveryMessages.length === 1;
|
|
176
|
+
const sentResults = [];
|
|
176
177
|
return attachChannelToResult("slack", toSlackOutboundResult(await sendPayloadMediaSequenceAndFinalize({
|
|
177
178
|
text: "",
|
|
178
179
|
mediaUrls,
|
|
@@ -182,19 +183,39 @@ const slackOutbound = {
|
|
|
182
183
|
mediaUrl,
|
|
183
184
|
deliveryQueueId: useSingleDeliveryMarker ? ctx.deliveryQueueId : void 0
|
|
184
185
|
}),
|
|
186
|
+
onResult: (result) => {
|
|
187
|
+
sentResults.push(result);
|
|
188
|
+
},
|
|
185
189
|
finalize: async () => {
|
|
186
190
|
let lastResult;
|
|
187
|
-
for (const message of deliveryMessages)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
for (const message of deliveryMessages) {
|
|
192
|
+
lastResult = await sendSlackOutboundMessage({
|
|
193
|
+
...ctx,
|
|
194
|
+
text: message.text,
|
|
195
|
+
...message.blocks ? { blocks: message.blocks } : {},
|
|
196
|
+
...message.authoredTextPlacement ? { authoredTextPlacement: message.authoredTextPlacement } : {},
|
|
197
|
+
...message.nativeDataFallbackBaseText ? { nativeDataFallbackBaseText: message.nativeDataFallbackBaseText } : {},
|
|
198
|
+
...message.textIsSlackPlainText ? { textIsSlackPlainText: true } : {},
|
|
199
|
+
deliveryQueueId: useSingleDeliveryMarker ? ctx.deliveryQueueId : void 0
|
|
200
|
+
});
|
|
201
|
+
sentResults.push(lastResult);
|
|
202
|
+
}
|
|
196
203
|
if (!lastResult) throw new Error("Slack rendered presentation produced no deliverable segment");
|
|
197
|
-
return lastResult;
|
|
204
|
+
if (sentResults.length === 1) return lastResult;
|
|
205
|
+
const receipt = createMessageReceiptFromOutboundResults({ results: sentResults });
|
|
206
|
+
receipt.parts = receipt.parts.map((part, index) => ({
|
|
207
|
+
...part,
|
|
208
|
+
index
|
|
209
|
+
}));
|
|
210
|
+
const questionResult = sentResults.find((result) => result.meta?.slackQuestionActionIds.length);
|
|
211
|
+
return {
|
|
212
|
+
...lastResult,
|
|
213
|
+
receipt,
|
|
214
|
+
...questionResult?.meta ? { meta: {
|
|
215
|
+
...questionResult.meta,
|
|
216
|
+
slackQuestionMessageId: questionResult.meta.slackQuestionMessageId ?? questionResult.messageId
|
|
217
|
+
} } : {}
|
|
218
|
+
};
|
|
198
219
|
}
|
|
199
220
|
})));
|
|
200
221
|
},
|
|
@@ -1,19 +1,20 @@
|
|
|
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 { B as
|
|
4
|
-
import { r as formatSlackError } from "./probe-
|
|
3
|
+
import { B as SLACK_TEXT_LIMIT, G as truncateSlackText, K as truncateSlackTextByUtf8Bytes, L as SLACK_EDIT_TEXT_MAX_BYTES, N as buildSlackBlocksFallbackText, O as hasSlackNativeDataBlock, S as resolveSlackReplyRenderPlan, W as countSlackTextUtf8Bytes, Z as SLACK_SESSION_LINK_ACTION_ID, a as qualifySlackConversationId, ct as escapeSlackMrkdwn, d as normalizeSlackAllowOwnerEntry, o as qualifySlackRoutePeerId, ot as normalizeSlackOutboundText, p as resolveSlackAllowListMatch, s as resolveSlackEnterpriseMainDmSessionKey, u as normalizeAllowListLower } from "./group-policy-CU1tEGpS.js";
|
|
4
|
+
import { r as formatSlackError } from "./probe-4_aHtVT3.js";
|
|
5
5
|
import { n as resolveSlackStreamingMode, t as resolveSlackNativeStreaming } from "./streaming-compat-B-e0mqM0.js";
|
|
6
|
-
import {
|
|
7
|
-
import { a as hasSlackTableBlock, c as resolveSlackMessageText$1, o as isSlackUnfurlAttachment, s as resolveSlackBlocksText } from "./slack-client-kind-
|
|
8
|
-
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-
|
|
9
|
-
import { S as
|
|
10
|
-
import { n as resolveSlackChannelConfig } from "./policy-
|
|
11
|
-
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, s as
|
|
6
|
+
import { a as editSlackRenderedMessage, b as formatSlackFileReferenceList, d as reactSlackMessage, i as editSlackMessage, m as removeSlackReaction, n as deleteSlackMessage, v as logVerbose$1, x as buildSlackEditTextPayload, y as formatSlackFileReference } from "./actions-XdQyjG_p.js";
|
|
7
|
+
import { a as hasSlackTableBlock, c as resolveSlackMessageText$1, o as isSlackUnfurlAttachment, s as resolveSlackBlocksText } from "./slack-client-kind-hSfjXyUM.js";
|
|
8
|
+
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-DtjEnlLh.js";
|
|
9
|
+
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-D4nDgxCh.js";
|
|
10
|
+
import { n as resolveSlackChannelConfig } from "./policy-BoP6t88v.js";
|
|
11
|
+
import { a as resolveDeliveredSlackReplyThreadTs, c as emitSlackMessageSentHooks, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, s as sanitizeSlackMonitorReplyPayload, t as createSlackReplyDeliveryPlan } from "./replies-D9XMM_S0.js";
|
|
12
12
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
13
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
14
14
|
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
15
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
16
16
|
import { danger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
17
|
+
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
17
18
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
18
19
|
import { createHash } from "node:crypto";
|
|
19
20
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
@@ -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);
|
|
@@ -2619,6 +2575,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
2619
2575
|
sessionKey: route.sessionKey
|
|
2620
2576
|
},
|
|
2621
2577
|
ctxPayload: prepared.ctxPayload,
|
|
2578
|
+
dispatchReplyFromConfig: ctx.dispatchReplyFromConfig,
|
|
2622
2579
|
dispatcherOptions: {
|
|
2623
2580
|
...replyPipeline,
|
|
2624
2581
|
transformReplyPayload: (payload) => {
|
|
@@ -3008,7 +2965,7 @@ async function discardSlackPreflightMedia(media) {
|
|
|
3008
2965
|
const SLACK_MENTION_RESOLUTION_CONCURRENCY = 4;
|
|
3009
2966
|
const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
3010
2967
|
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
3011
|
-
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-
|
|
2968
|
+
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-XdQyjG_p.js").then((n) => n._));
|
|
3012
2969
|
function collectUniqueSlackMentionIds$1(texts) {
|
|
3013
2970
|
const seen = /* @__PURE__ */ new Set();
|
|
3014
2971
|
const mentionIds = [];
|
|
@@ -3046,8 +3003,9 @@ async function resolveSlackMessageContent(params) {
|
|
|
3046
3003
|
isThreadReply: params.isThreadReply,
|
|
3047
3004
|
threadStarter: params.threadStarter
|
|
3048
3005
|
});
|
|
3049
|
-
const
|
|
3006
|
+
const attachmentContent = ownFiles?.length || params.message.attachments?.length ? await loadSlackMediaModule$1().then(({ resolveSlackAttachmentContent }) => resolveSlackAttachmentContent({
|
|
3050
3007
|
files: ownFiles,
|
|
3008
|
+
attachments: params.message.attachments,
|
|
3051
3009
|
client: params.client,
|
|
3052
3010
|
token: params.botToken,
|
|
3053
3011
|
maxBytes: params.mediaMaxBytes,
|
|
@@ -3055,30 +3013,10 @@ async function resolveSlackMessageContent(params) {
|
|
|
3055
3013
|
totalTimeoutMs: params.mediaTotalTimeoutMs,
|
|
3056
3014
|
abortSignal: params.abortSignal,
|
|
3057
3015
|
preloadedMedia: params.preloadedMedia
|
|
3058
|
-
})) :
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3061
|
-
|
|
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;
|
|
3016
|
+
})) : null;
|
|
3017
|
+
const effectiveDirectMedia = attachmentContent?.media.length ? attachmentContent.media : null;
|
|
3018
|
+
const mediaPlaceholder = effectiveDirectMedia?.map((item) => item.placeholder).join(" ");
|
|
3019
|
+
const fileOnlyFallback = attachmentContent?.files?.map(formatSlackFileReference).join(", ");
|
|
3082
3020
|
let botAttachmentText;
|
|
3083
3021
|
if (params.isBotMessage && !attachmentContent?.text) {
|
|
3084
3022
|
const botAttachmentTextParts = [];
|
|
@@ -3120,18 +3058,17 @@ async function resolveSlackMessageContent(params) {
|
|
|
3120
3058
|
renderSlackUserMentions(textParts[1], renderedMentions),
|
|
3121
3059
|
renderSlackUserMentions(textParts[2], renderedMentions),
|
|
3122
3060
|
mediaPlaceholder,
|
|
3123
|
-
|
|
3061
|
+
fileOnlyFallback ? `[Slack file: ${fileOnlyFallback}]` : void 0
|
|
3124
3062
|
].filter(Boolean).join("\n") || "";
|
|
3125
3063
|
const unavailableImageCount = attachmentContent?.unavailableImageCount ?? 0;
|
|
3126
3064
|
if (unavailableImageCount > 0) rawBody = formatInboundMediaUnavailableText({
|
|
3127
3065
|
body: rawBody,
|
|
3128
3066
|
notice: `[slack ${unavailableImageCount > 1 ? `${unavailableImageCount} forwarded images` : "forwarded image"} unavailable]`
|
|
3129
3067
|
});
|
|
3130
|
-
|
|
3131
|
-
return {
|
|
3068
|
+
return rawBody ? {
|
|
3132
3069
|
rawBody,
|
|
3133
3070
|
effectiveDirectMedia
|
|
3134
|
-
};
|
|
3071
|
+
} : null;
|
|
3135
3072
|
}
|
|
3136
3073
|
//#endregion
|
|
3137
3074
|
//#region extensions/slack/src/monitor/message-handler/prepare-dm-history.ts
|
|
@@ -3359,7 +3296,7 @@ function formatSlackThreadLabelSnippet(text) {
|
|
|
3359
3296
|
}
|
|
3360
3297
|
//#endregion
|
|
3361
3298
|
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
3362
|
-
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-
|
|
3299
|
+
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-XdQyjG_p.js").then((n) => n._));
|
|
3363
3300
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
3364
3301
|
function resolveSlackThreadSessionFreshness(params) {
|
|
3365
3302
|
return params.ctx.channelRuntime?.session?.resolveEntryResetFreshness?.({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as normalizeSlackSlug, m as resolveSlackUserAllowListForTeam, n as buildSlackChannelPolicyScope, t as buildSlackChannelIdCandidates } from "./group-policy-
|
|
1
|
+
import { f as normalizeSlackSlug, m as resolveSlackUserAllowListForTeam, n as buildSlackChannelPolicyScope, t as buildSlackChannelIdCandidates } from "./group-policy-CU1tEGpS.js";
|
|
2
2
|
import { applyChannelMatchMeta, buildChannelKeyCandidates } from "openclaw/plugin-sdk/channel-targets";
|
|
3
3
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
4
4
|
//#region extensions/slack/src/monitor/channel-config.ts
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { u as formatSlackBotTokenIdentityWarning } from "./accounts-
|
|
3
|
-
import "./target-parsing-BnMD2ZqZ.js";
|
|
2
|
+
import { u as formatSlackBotTokenIdentityWarning } from "./accounts-Dm_H77gH.js";
|
|
4
3
|
import { createRequire } from "node:module";
|
|
5
|
-
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
|
|
6
4
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
5
|
import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
|
-
import { PAIRING_APPROVED_MESSAGE, projectCredentialSnapshotFields, resolveConfiguredFromRequiredCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
|
|
9
6
|
import { createHash } from "node:crypto";
|
|
10
7
|
import { WebClient } from "@slack/web-api";
|
|
11
8
|
import { addActiveManagedProxyTlsOptions, resolveEnvHttpProxyAgentOptions, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
12
9
|
import { isDebugProxyGlobalFetchPatchInstalled } from "openclaw/plugin-sdk/proxy-capture";
|
|
13
10
|
import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
|
|
14
|
-
//#region extensions/slack/src/channel-api.ts
|
|
15
|
-
const SLACK_CHANNEL_META = {
|
|
16
|
-
id: "slack",
|
|
17
|
-
label: "Slack",
|
|
18
|
-
selectionLabel: "Slack",
|
|
19
|
-
docsPath: "/channels/slack",
|
|
20
|
-
docsLabel: "slack",
|
|
21
|
-
blurb: "supports bot + app tokens, channels, threads, and interactive replies.",
|
|
22
|
-
systemImage: "number.square",
|
|
23
|
-
markdownCapable: true
|
|
24
|
-
};
|
|
25
|
-
function getChatChannelMeta(id) {
|
|
26
|
-
if (id !== SLACK_CHANNEL_META.id) throw new Error(`Unsupported Slack channel meta lookup: ${id}`);
|
|
27
|
-
return SLACK_CHANNEL_META;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
30
11
|
//#region extensions/slack/src/client-options.ts
|
|
31
12
|
const requireFromSlackSocketMode = (() => {
|
|
32
13
|
return createRequire(createRequire(import.meta.url).resolve("@slack/socket-mode/package.json"));
|
|
@@ -362,4 +343,4 @@ async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
|
362
343
|
}));
|
|
363
344
|
}
|
|
364
345
|
//#endregion
|
|
365
|
-
export {
|
|
346
|
+
export { resolveSlackWriteClientOptions as _, createSlackReadClient as a, createSlackWebClient as c, getSlackWriteClient as d, SLACK_DEFAULT_RETRY_OPTIONS as f, resolveSlackWebClientOptions as g, resolveSlackProxyDispatcher as h, createSlackLookupClient as i, createSlackWriteClient as l, resolveSlackLookupClientOptions as m, probe_exports as n, createSlackStartupAuthClient as o, SLACK_WRITE_RETRY_OPTIONS as p, formatSlackError as r, createSlackTokenCacheKey as s, probeSlack as t, getSlackListenerUploadCompletionClient as u };
|