@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,6 +1,6 @@
|
|
|
1
1
|
import { a as parseSlackTarget } from "./target-parsing-BnMD2ZqZ.js";
|
|
2
|
-
import {
|
|
3
|
-
import { r as sendMessageSlack } from "./send-
|
|
2
|
+
import { Ft as normalizeSlackApproverId, K as truncateSlackTextByUtf8Bytes, L as SLACK_EDIT_TEXT_MAX_BYTES, _t as isSlackAnyNativeApprovalClientEnabled, b as resolveSlackReplyBlocks, lt as SLACK_APPROVAL_HEADER_BLOCK_ID, wt as shouldHandleSlackNativeApprovalRequest } from "./group-policy-CU1tEGpS.js";
|
|
3
|
+
import { r as sendMessageSlack } from "./send-DtjEnlLh.js";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
6
6
|
import { buildApprovalPresentationFromActionDescriptors } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
@@ -90,180 +90,57 @@ function buildSlackPluginRequestBlocks(view) {
|
|
|
90
90
|
}
|
|
91
91
|
}, ...buildSlackMetadataContextBlocks(buildSlackPluginMetadata(view))];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return view.approvalKind === "plugin" ? buildSlackPluginPendingApprovalText(view) : buildSlackExecPendingApprovalText(view);
|
|
117
|
-
}
|
|
118
|
-
function buildSlackExecPendingApprovalBlocks(view) {
|
|
119
|
-
const interactiveBlocks = resolveSlackReplyBlocks({
|
|
120
|
-
text: "",
|
|
121
|
-
presentation: buildApprovalPresentationFromActionDescriptors(view.actions)
|
|
122
|
-
}) ?? [];
|
|
123
|
-
return [
|
|
124
|
-
{
|
|
125
|
-
type: "section",
|
|
126
|
-
block_id: SLACK_APPROVAL_HEADER_BLOCK_ID,
|
|
127
|
-
text: {
|
|
128
|
-
type: "mrkdwn",
|
|
129
|
-
text: "*Exec approval required*\nA command needs your approval."
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
type: "section",
|
|
134
|
-
text: {
|
|
135
|
-
type: "mrkdwn",
|
|
136
|
-
text: `*Command*\n${buildSlackCodeBlock(truncateSlackMrkdwn(view.commandText, 2600))}`
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
...buildSlackMetadataContextBlocks(view.metadata),
|
|
140
|
-
...interactiveBlocks
|
|
141
|
-
];
|
|
142
|
-
}
|
|
143
|
-
function buildSlackPluginPendingApprovalBlocks(view) {
|
|
144
|
-
const interactiveBlocks = resolveSlackReplyBlocks({
|
|
145
|
-
text: "",
|
|
146
|
-
presentation: buildApprovalPresentationFromActionDescriptors(view.actions)
|
|
147
|
-
}) ?? [];
|
|
148
|
-
return [
|
|
149
|
-
{
|
|
150
|
-
type: "section",
|
|
151
|
-
block_id: SLACK_APPROVAL_HEADER_BLOCK_ID,
|
|
152
|
-
text: {
|
|
153
|
-
type: "mrkdwn",
|
|
154
|
-
text: `*Plugin approval required*\n${truncateSlackMrkdwn(resolveSlackPluginDescription(view), 2600)}`
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
...buildSlackPluginRequestBlocks(view),
|
|
158
|
-
...interactiveBlocks
|
|
159
|
-
];
|
|
160
|
-
}
|
|
161
|
-
function buildSlackPendingApprovalBlocks(view) {
|
|
162
|
-
return view.approvalKind === "plugin" ? buildSlackPluginPendingApprovalBlocks(view) : buildSlackExecPendingApprovalBlocks(view);
|
|
163
|
-
}
|
|
164
|
-
function buildSlackExecResolvedText(view) {
|
|
165
|
-
const resolvedBy = formatSlackApprover(view.resolvedBy);
|
|
166
|
-
return [
|
|
167
|
-
`*Exec approval: ${resolveSlackApprovalDecisionLabel(view.decision)}*`,
|
|
168
|
-
resolvedBy ? `Resolved by ${resolvedBy}.` : "Resolved.",
|
|
169
|
-
"",
|
|
170
|
-
"*Command*",
|
|
171
|
-
buildSlackCodeBlock(view.commandText)
|
|
172
|
-
].join("\n");
|
|
173
|
-
}
|
|
174
|
-
function buildSlackPluginResolvedText(view) {
|
|
175
|
-
const resolvedBy = formatSlackApprover(view.resolvedBy);
|
|
176
|
-
const metadataLines = buildSlackMetadataLines(buildSlackPluginMetadata(view));
|
|
177
|
-
return [
|
|
178
|
-
`*Plugin approval: ${resolveSlackApprovalDecisionLabel(view.decision)}*`,
|
|
179
|
-
resolvedBy ? `Resolved by ${resolvedBy}.` : "Resolved.",
|
|
180
|
-
"",
|
|
181
|
-
"*Request*",
|
|
182
|
-
view.title,
|
|
183
|
-
...metadataLines
|
|
184
|
-
].join("\n");
|
|
185
|
-
}
|
|
186
|
-
function buildSlackResolvedText(view) {
|
|
187
|
-
return view.approvalKind === "plugin" ? buildSlackPluginResolvedText(view) : buildSlackExecResolvedText(view);
|
|
188
|
-
}
|
|
189
|
-
function buildSlackExecResolvedBlocks(view) {
|
|
190
|
-
const resolvedBy = formatSlackApprover(view.resolvedBy);
|
|
191
|
-
return [{
|
|
192
|
-
type: "section",
|
|
193
|
-
text: {
|
|
194
|
-
type: "mrkdwn",
|
|
195
|
-
text: `*Exec approval: ${resolveSlackApprovalDecisionLabel(view.decision)}*\n${resolvedBy ? `Resolved by ${resolvedBy}.` : "Resolved."}`
|
|
196
|
-
}
|
|
197
|
-
}, {
|
|
198
|
-
type: "section",
|
|
199
|
-
text: {
|
|
200
|
-
type: "mrkdwn",
|
|
201
|
-
text: `*Command*\n${buildSlackCodeBlock(truncateSlackMrkdwn(view.commandText, 2600))}`
|
|
202
|
-
}
|
|
203
|
-
}];
|
|
204
|
-
}
|
|
205
|
-
function buildSlackPluginResolvedBlocks(view) {
|
|
206
|
-
const resolvedBy = formatSlackApprover(view.resolvedBy);
|
|
207
|
-
return [{
|
|
208
|
-
type: "section",
|
|
209
|
-
text: {
|
|
210
|
-
type: "mrkdwn",
|
|
211
|
-
text: `*Plugin approval: ${resolveSlackApprovalDecisionLabel(view.decision)}*\n${resolvedBy ? `Resolved by ${resolvedBy}.` : "Resolved."}`
|
|
212
|
-
}
|
|
213
|
-
}, ...buildSlackPluginRequestBlocks(view)];
|
|
214
|
-
}
|
|
215
|
-
function buildSlackResolvedBlocks(view) {
|
|
216
|
-
return view.approvalKind === "plugin" ? buildSlackPluginResolvedBlocks(view) : buildSlackExecResolvedBlocks(view);
|
|
217
|
-
}
|
|
218
|
-
function buildSlackExecExpiredText(view) {
|
|
219
|
-
return [
|
|
220
|
-
"*Exec approval expired*",
|
|
221
|
-
"This approval request expired before it was resolved.",
|
|
222
|
-
"",
|
|
223
|
-
"*Command*",
|
|
224
|
-
buildSlackCodeBlock(view.commandText)
|
|
225
|
-
].join("\n");
|
|
226
|
-
}
|
|
227
|
-
function buildSlackPluginExpiredText(view) {
|
|
228
|
-
const metadataLines = buildSlackMetadataLines(buildSlackPluginMetadata(view));
|
|
229
|
-
return [
|
|
230
|
-
"*Plugin approval expired*",
|
|
231
|
-
"This approval request expired before it was resolved.",
|
|
93
|
+
function buildSlackApprovalPayload(input) {
|
|
94
|
+
const { phase, view } = input;
|
|
95
|
+
const isPlugin = view.approvalKind === "plugin";
|
|
96
|
+
const approvalName = isPlugin ? "Plugin" : "Exec";
|
|
97
|
+
let heading;
|
|
98
|
+
let description;
|
|
99
|
+
if (phase === "pending") {
|
|
100
|
+
heading = `*${approvalName} approval required*`;
|
|
101
|
+
description = view.approvalKind === "plugin" ? resolveSlackPluginDescription(view) : "A command needs your approval.";
|
|
102
|
+
} else if (phase === "resolved") {
|
|
103
|
+
heading = `*${approvalName} approval: ${resolveSlackApprovalDecisionLabel(view.decision)}*`;
|
|
104
|
+
const resolvedBy = formatSlackApprover(view.resolvedBy);
|
|
105
|
+
description = resolvedBy ? `Resolved by ${resolvedBy}.` : "Resolved.";
|
|
106
|
+
} else {
|
|
107
|
+
heading = `*${approvalName} approval expired*`;
|
|
108
|
+
description = "This approval request expired before it was resolved.";
|
|
109
|
+
}
|
|
110
|
+
const metadata = isPlugin ? buildSlackPluginMetadata(view) : view.metadata;
|
|
111
|
+
const bodyLabel = isPlugin ? "*Request*" : "*Command*";
|
|
112
|
+
const bodyText = isPlugin ? view.title : buildSlackCodeBlock(view.commandText);
|
|
113
|
+
const text = [
|
|
114
|
+
heading,
|
|
115
|
+
description,
|
|
232
116
|
"",
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
...
|
|
117
|
+
bodyLabel,
|
|
118
|
+
bodyText,
|
|
119
|
+
...isPlugin || phase === "pending" ? buildSlackMetadataLines(metadata) : []
|
|
236
120
|
].join("\n");
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
return view.approvalKind === "plugin" ? buildSlackPluginExpiredText(view) : buildSlackExecExpiredText(view);
|
|
240
|
-
}
|
|
241
|
-
function buildSlackExecExpiredBlocks(view) {
|
|
242
|
-
return [{
|
|
121
|
+
const headerDescription = isPlugin && phase === "pending" ? truncateSlackMrkdwn(description, 2600) : description;
|
|
122
|
+
const blocks = [{
|
|
243
123
|
type: "section",
|
|
124
|
+
...phase === "pending" ? { block_id: SLACK_APPROVAL_HEADER_BLOCK_ID } : {},
|
|
244
125
|
text: {
|
|
245
126
|
type: "mrkdwn",
|
|
246
|
-
text:
|
|
127
|
+
text: `${heading}\n${headerDescription}`
|
|
247
128
|
}
|
|
248
|
-
}, {
|
|
129
|
+
}, ...view.approvalKind === "plugin" ? buildSlackPluginRequestBlocks(view) : [{
|
|
249
130
|
type: "section",
|
|
250
131
|
text: {
|
|
251
132
|
type: "mrkdwn",
|
|
252
133
|
text: `*Command*\n${buildSlackCodeBlock(truncateSlackMrkdwn(view.commandText, 2600))}`
|
|
253
134
|
}
|
|
254
|
-
}];
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}, ...buildSlackPluginRequestBlocks(view)];
|
|
264
|
-
}
|
|
265
|
-
function buildSlackExpiredBlocks(view) {
|
|
266
|
-
return view.approvalKind === "plugin" ? buildSlackPluginExpiredBlocks(view) : buildSlackExecExpiredBlocks(view);
|
|
135
|
+
}, ...phase === "pending" ? buildSlackMetadataContextBlocks(view.metadata) : []]];
|
|
136
|
+
if (phase === "pending") blocks.push(...resolveSlackReplyBlocks({
|
|
137
|
+
text: "",
|
|
138
|
+
presentation: buildApprovalPresentationFromActionDescriptors(view.actions)
|
|
139
|
+
}) ?? []);
|
|
140
|
+
return {
|
|
141
|
+
text,
|
|
142
|
+
blocks
|
|
143
|
+
};
|
|
267
144
|
}
|
|
268
145
|
async function updateMessage(params) {
|
|
269
146
|
try {
|
|
@@ -299,23 +176,23 @@ const slackApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
|
299
176
|
}
|
|
300
177
|
},
|
|
301
178
|
presentation: {
|
|
302
|
-
buildPendingPayload: ({ view }) => ({
|
|
303
|
-
|
|
304
|
-
|
|
179
|
+
buildPendingPayload: ({ view }) => buildSlackApprovalPayload({
|
|
180
|
+
phase: "pending",
|
|
181
|
+
view
|
|
305
182
|
}),
|
|
306
183
|
buildResolvedResult: ({ view }) => ({
|
|
307
184
|
kind: "update",
|
|
308
|
-
payload: {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
185
|
+
payload: buildSlackApprovalPayload({
|
|
186
|
+
phase: "resolved",
|
|
187
|
+
view
|
|
188
|
+
})
|
|
312
189
|
}),
|
|
313
190
|
buildExpiredResult: ({ view }) => ({
|
|
314
191
|
kind: "update",
|
|
315
|
-
payload: {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
}
|
|
192
|
+
payload: buildSlackApprovalPayload({
|
|
193
|
+
phase: "expired",
|
|
194
|
+
view
|
|
195
|
+
})
|
|
319
196
|
})
|
|
320
197
|
},
|
|
321
198
|
transport: {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as isSlackPluginAccountConfigured } from "./account-configured-sUohAxZr.js";
|
|
2
|
+
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resolveSlackOperationToken, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom } from "./accounts-Dm_H77gH.js";
|
|
2
3
|
import { n as resolveSlackConversationBindingRoute, r as resolveSlackReplyToMode, t as normalizeSlackRouteBindingConfig } from "./conversation-binding-route-DFVLUdYF.js";
|
|
3
4
|
import { a as parseSlackTarget, i as normalizeSlackMessagingTarget, n as formatSlackTarget, o as resolveSlackChannelId, r as looksLikeSlackTargetId, t as canonicalizeSlackApiTargetId } from "./target-parsing-BnMD2ZqZ.js";
|
|
4
5
|
import { t as slackContextTargetsMatch } from "./targets-Cx5W_n3W.js";
|
|
5
|
-
import { At as
|
|
6
|
-
import { t as isSlackPluginAccountConfigured } from "./account-configured-BwfXBo_F.js";
|
|
6
|
+
import { At as getSlackApprovalApprovers, B as SLACK_TEXT_LIMIT, Ct as resolveTurnSourceSlackOriginTarget, Dt as getSlackInstallationKind, Et as slackTargetsMatch, H as buildSlackPresentationBlocks, It as resolveSlackExecApprovalTarget, L as SLACK_EDIT_TEXT_MAX_BYTES, Lt as shouldSuppressLocalSlackExecApprovalPrompt, Mt as getSlackExecApprovalApprovers, Nt as isSlackExecApprovalAuthorizedSender, Ot as isSlackWorkspaceInstallation, Pt as isSlackExecApprovalClientEnabled, St as resolveSlackFallbackOriginTarget, Tt as shouldHandleSlackPluginViaForwardingSession, U as canRenderSlackPresentation, W as countSlackTextUtf8Bytes, _t as isSlackAnyNativeApprovalClientEnabled, a as qualifySlackConversationId, b as resolveSlackReplyBlocks, bt as resolveEnterpriseApprovalTeamId, dt as SLACK_PRESENTATION_CAPABILITIES, g as assertSlackDetachedTargetAllowed, gt as hasSlackPluginApprovers, i as resolveSlackGroupToolPolicy, jt as isSlackApprovalAuthorizedSender, o as qualifySlackRoutePeerId, ot as normalizeSlackOutboundText, r as resolveSlackGroupRequireMention, st as renderSlackMessagePresentationFallbackText, vt as normalizeSlackForwardTarget, wt as shouldHandleSlackNativeApprovalRequest, x as resolveSlackReplyDeliveryMessages, xt as resolveSessionSlackOriginTarget, y as resolveSlackReplyBlockResolution, yt as normalizeSlackOriginTarget, zt as resolveSlackAutoThreadId } from "./group-policy-CU1tEGpS.js";
|
|
7
7
|
import { n as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-DUGhaYKq.js";
|
|
8
|
-
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-CWosHSi5.js";
|
|
9
|
+
import { a as PAIRING_APPROVED_MESSAGE, i as DEFAULT_ACCOUNT_ID$1, n as slackConfigAdapter, o as projectCredentialSnapshotFields, r as slackSecurityAdapter, s as resolveConfiguredFromRequiredCredentialStatuses, t as createSlackPluginBase } from "./shared-D9GeeR9K.js";
|
|
10
|
+
import { d as getSlackWriteClient, r as formatSlackError } from "./probe-4_aHtVT3.js";
|
|
11
|
+
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-j-2lalcC.js";
|
|
11
12
|
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
12
|
-
import {
|
|
13
|
-
import { a as slackSetupContract, i as createSlackSetupWizardProxy, o as SLACK_CHANNEL } from "./channel.setup-CpyYsEXH.js";
|
|
13
|
+
import { a as slackSetupContract, i as createSlackSetupWizardProxy, o as SLACK_CHANNEL } from "./channel.setup-aal8tokM.js";
|
|
14
14
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
15
15
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
16
16
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -30,7 +30,7 @@ import { createChannelNativeOriginTargetResolver, createNativeApprovalForwarding
|
|
|
30
30
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
31
31
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
32
32
|
import { normalizeLegacyInteractiveReply, normalizeMessagePresentation } from "openclaw/plugin-sdk/interactive-runtime";
|
|
33
|
-
import { readPositiveIntegerParam, readStringParam } from "openclaw/plugin-sdk/param-readers";
|
|
33
|
+
import { readPositiveIntegerParam as readPositiveIntegerParam$1, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/param-readers";
|
|
34
34
|
//#region extensions/slack/src/approval-native.ts
|
|
35
35
|
function resolveSlackNativeSuppressionAccountId({ target, request }) {
|
|
36
36
|
return normalizeOptionalString(target.accountId) ?? normalizeOptionalString(request.request.turnSourceAccountId);
|
|
@@ -130,7 +130,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
130
130
|
approvalKind,
|
|
131
131
|
request
|
|
132
132
|
}),
|
|
133
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
133
|
+
load: async () => (await import("./approval-handler.runtime-DxXfGX_Z.js")).slackApprovalNativeRuntime
|
|
134
134
|
})
|
|
135
135
|
});
|
|
136
136
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.native;
|
|
@@ -192,7 +192,7 @@ function resolveSlackPresentationText(content, presentation) {
|
|
|
192
192
|
}
|
|
193
193
|
function renderSlackActionPresentation(presentation) {
|
|
194
194
|
if (!presentation) return { usesPresentationTextFallback: false };
|
|
195
|
-
const renderedBlocks = canRenderSlackPresentation(presentation) ? buildSlackPresentationBlocks(presentation) : void 0;
|
|
195
|
+
const renderedBlocks = !presentation.blocks.some((block) => (block.type === "text" || block.type === "context") && block.text.trim().length > 3e3) && canRenderSlackPresentation(presentation) ? buildSlackPresentationBlocks(presentation) : void 0;
|
|
196
196
|
const usesPresentationTextFallback = !renderedBlocks || renderedBlocks.length > 50;
|
|
197
197
|
const blocks = usesPresentationTextFallback ? void 0 : renderedBlocks;
|
|
198
198
|
return {
|
|
@@ -206,16 +206,16 @@ async function handleSlackMessageAction(params) {
|
|
|
206
206
|
const { action, cfg, params: actionParams } = ctx;
|
|
207
207
|
const accountId = ctx.accountId ?? void 0;
|
|
208
208
|
const resolveChannelId = () => {
|
|
209
|
-
const channelId = readStringParam(actionParams, "channelId") ?? readStringParam(actionParams, "to", { required: true });
|
|
209
|
+
const channelId = readStringParam$1(actionParams, "channelId") ?? readStringParam$1(actionParams, "to", { required: true });
|
|
210
210
|
return normalizeChannelId ? normalizeChannelId(channelId) : channelId;
|
|
211
211
|
};
|
|
212
212
|
if (action === "send") {
|
|
213
|
-
const to = readStringParam(actionParams, "to", { required: true });
|
|
214
|
-
const content = readStringParam(actionParams, "message", {
|
|
213
|
+
const to = readStringParam$1(actionParams, "to", { required: true });
|
|
214
|
+
const content = readStringParam$1(actionParams, "message", {
|
|
215
215
|
required: false,
|
|
216
216
|
allowEmpty: true
|
|
217
217
|
});
|
|
218
|
-
const mediaUrl = readStringParam(actionParams, "media", { trim: false });
|
|
218
|
+
const mediaUrl = readStringParam$1(actionParams, "media", { trim: false });
|
|
219
219
|
const presentation = normalizeMessagePresentation(actionParams.presentation);
|
|
220
220
|
const interactive = normalizeLegacyInteractiveReply(actionParams.interactive);
|
|
221
221
|
const hasStructuredContent = Boolean(presentation || interactive?.blocks.length);
|
|
@@ -232,8 +232,8 @@ async function handleSlackMessageAction(params) {
|
|
|
232
232
|
if (!content && preparedMessages.length === 0 && !mediaUrl) throw new Error("Slack send requires message, blocks, or media.");
|
|
233
233
|
const replyBroadcast = readBooleanParam(actionParams, "replyBroadcast");
|
|
234
234
|
if (replyBroadcast && mediaUrl) throw new Error("Slack replyBroadcast is only supported for text or block thread replies.");
|
|
235
|
-
const threadId = readStringParam(actionParams, "threadId");
|
|
236
|
-
const replyTo = readStringParam(actionParams, "replyTo");
|
|
235
|
+
const threadId = readStringParam$1(actionParams, "threadId");
|
|
236
|
+
const replyTo = readStringParam$1(actionParams, "replyTo");
|
|
237
237
|
const topLevel = readBooleanParam(actionParams, "topLevel") === true || actionParams.threadId === null;
|
|
238
238
|
const toolContext = preparedMessages.length > 0 ? {
|
|
239
239
|
...ctx.toolContext,
|
|
@@ -246,7 +246,10 @@ async function handleSlackMessageAction(params) {
|
|
|
246
246
|
mediaUrl: mediaUrl ?? void 0,
|
|
247
247
|
...readSlackForceDocument(actionParams) ? { forceDocument: true } : {},
|
|
248
248
|
accountId,
|
|
249
|
-
threadTs:
|
|
249
|
+
threadTs: resolveSlackThreadTsValue({
|
|
250
|
+
replyToId: replyTo,
|
|
251
|
+
threadId
|
|
252
|
+
}),
|
|
250
253
|
...topLevel ? { topLevel: true } : {},
|
|
251
254
|
...replyBroadcast ? { replyBroadcast } : {}
|
|
252
255
|
}, cfg, toolContext);
|
|
@@ -258,7 +261,7 @@ async function handleSlackMessageAction(params) {
|
|
|
258
261
|
});
|
|
259
262
|
if (messageIdRaw == null) throw new Error("messageId required. Provide messageId explicitly or react to the current inbound message.");
|
|
260
263
|
const messageId = String(messageIdRaw);
|
|
261
|
-
const emoji = readStringParam(actionParams, "emoji", { allowEmpty: true });
|
|
264
|
+
const emoji = readStringParam$1(actionParams, "emoji", { allowEmpty: true });
|
|
262
265
|
const remove = typeof actionParams.remove === "boolean" ? actionParams.remove : void 0;
|
|
263
266
|
return await invoke({
|
|
264
267
|
action: "react",
|
|
@@ -270,7 +273,7 @@ async function handleSlackMessageAction(params) {
|
|
|
270
273
|
}, cfg, ctx.toolContext);
|
|
271
274
|
}
|
|
272
275
|
if (action === "reactions") {
|
|
273
|
-
const messageId = readStringParam(actionParams, "messageId", { required: true });
|
|
276
|
+
const messageId = readStringParam$1(actionParams, "messageId", { required: true });
|
|
274
277
|
return await invoke({
|
|
275
278
|
action: "reactions",
|
|
276
279
|
channelId: resolveChannelId(),
|
|
@@ -284,17 +287,17 @@ async function handleSlackMessageAction(params) {
|
|
|
284
287
|
action: "readMessages",
|
|
285
288
|
channelId: resolveChannelId(),
|
|
286
289
|
limit: actionParams.limit,
|
|
287
|
-
before: readStringParam(actionParams, "before"),
|
|
288
|
-
after: readStringParam(actionParams, "after"),
|
|
289
|
-
messageId: readStringParam(actionParams, "messageId"),
|
|
290
|
+
before: readStringParam$1(actionParams, "before"),
|
|
291
|
+
after: readStringParam$1(actionParams, "after"),
|
|
292
|
+
messageId: readStringParam$1(actionParams, "messageId"),
|
|
290
293
|
accountId
|
|
291
294
|
};
|
|
292
|
-
if (includeReadThreadId) readAction.threadId = readStringParam(actionParams, "threadId");
|
|
295
|
+
if (includeReadThreadId) readAction.threadId = readStringParam$1(actionParams, "threadId");
|
|
293
296
|
return await invoke(readAction, cfg, ctx.toolContext);
|
|
294
297
|
}
|
|
295
298
|
if (action === "edit") {
|
|
296
|
-
const messageId = readStringParam(actionParams, "messageId", { required: true });
|
|
297
|
-
const content = readStringParam(actionParams, "message", { allowEmpty: true });
|
|
299
|
+
const messageId = readStringParam$1(actionParams, "messageId", { required: true });
|
|
300
|
+
const content = readStringParam$1(actionParams, "message", { allowEmpty: true });
|
|
298
301
|
const presentation = normalizeMessagePresentation(actionParams.presentation);
|
|
299
302
|
const renderedPresentation = renderSlackActionPresentation(presentation);
|
|
300
303
|
const blocks = renderedPresentation.usesPresentationTextFallback ? void 0 : renderedPresentation.blocks;
|
|
@@ -302,7 +305,10 @@ async function handleSlackMessageAction(params) {
|
|
|
302
305
|
text: content,
|
|
303
306
|
presentation
|
|
304
307
|
}) : resolveSlackPresentationText(content, presentation);
|
|
305
|
-
if (
|
|
308
|
+
if (!blocks && countSlackTextUtf8Bytes(normalizeSlackOutboundText(accessibleContent)) > 4e3) {
|
|
309
|
+
const editSubject = renderedPresentation.usesPresentationTextFallback ? "Slack presentation fallback" : "Slack edit";
|
|
310
|
+
throw new Error(`${editSubject} exceeds the ${String(SLACK_EDIT_TEXT_MAX_BYTES)}-byte edit limit. Send a new message instead.`);
|
|
311
|
+
}
|
|
306
312
|
if (!accessibleContent && !blocks) throw new Error("Slack edit requires message or blocks.");
|
|
307
313
|
return await invoke({
|
|
308
314
|
action: "editMessage",
|
|
@@ -314,7 +320,7 @@ async function handleSlackMessageAction(params) {
|
|
|
314
320
|
}, cfg, ctx.toolContext);
|
|
315
321
|
}
|
|
316
322
|
if (action === "delete") {
|
|
317
|
-
const messageId = readStringParam(actionParams, "messageId", { required: true });
|
|
323
|
+
const messageId = readStringParam$1(actionParams, "messageId", { required: true });
|
|
318
324
|
return await invoke({
|
|
319
325
|
action: "deleteMessage",
|
|
320
326
|
channelId: resolveChannelId(),
|
|
@@ -323,7 +329,7 @@ async function handleSlackMessageAction(params) {
|
|
|
323
329
|
}, cfg, ctx.toolContext);
|
|
324
330
|
}
|
|
325
331
|
if (action === "pin" || action === "unpin" || action === "list-pins") {
|
|
326
|
-
const messageId = action === "list-pins" ? void 0 : readStringParam(actionParams, "messageId", { required: true });
|
|
332
|
+
const messageId = action === "list-pins" ? void 0 : readStringParam$1(actionParams, "messageId", { required: true });
|
|
327
333
|
return await invoke({
|
|
328
334
|
action: action === "pin" ? "pinMessage" : action === "unpin" ? "unpinMessage" : "listPins",
|
|
329
335
|
channelId: resolveChannelId(),
|
|
@@ -335,7 +341,7 @@ async function handleSlackMessageAction(params) {
|
|
|
335
341
|
const requesterAccountId = ctx.requesterAccountId ? normalizeAccountId(ctx.requesterAccountId) : void 0;
|
|
336
342
|
const targetAccountId = normalizeAccountId(accountId ?? resolveDefaultSlackAccountId(cfg));
|
|
337
343
|
const requesterUserId = normalizeOptionalLowercaseString(ctx.toolContext?.currentChannelProvider) === "slack" && requesterAccountId !== void 0 && requesterAccountId === targetAccountId ? normalizeOptionalString(ctx.requesterSenderId) : void 0;
|
|
338
|
-
const userId = readStringParam(actionParams, "userId") ?? requesterUserId;
|
|
344
|
+
const userId = readStringParam$1(actionParams, "userId") ?? requesterUserId;
|
|
339
345
|
if (!userId) throw new Error("member-info requires a userId outside a current Slack conversation.");
|
|
340
346
|
return await invoke({
|
|
341
347
|
action: "memberInfo",
|
|
@@ -345,16 +351,16 @@ async function handleSlackMessageAction(params) {
|
|
|
345
351
|
}
|
|
346
352
|
if (action === "emoji-list") return await invoke({
|
|
347
353
|
action: "emojiList",
|
|
348
|
-
limit: readPositiveIntegerParam(actionParams, "limit", { message: "limit must be a positive integer." }),
|
|
354
|
+
limit: readPositiveIntegerParam$1(actionParams, "limit", { message: "limit must be a positive integer." }),
|
|
349
355
|
accountId
|
|
350
356
|
}, cfg, ctx.toolContext);
|
|
351
357
|
if (action === "download-file") {
|
|
352
|
-
const fileIdParam = readStringParam(actionParams, "fileId");
|
|
353
|
-
const messageIdParam = readStringParam(actionParams, "messageId") ?? readStringParam(actionParams, "message_id");
|
|
358
|
+
const fileIdParam = readStringParam$1(actionParams, "fileId");
|
|
359
|
+
const messageIdParam = readStringParam$1(actionParams, "messageId") ?? readStringParam$1(actionParams, "message_id");
|
|
354
360
|
if (!fileIdParam && messageIdParam) throw new Error("download-file requires fileId (the Slack file id, for example F0B0LTT8M36 from event.files[].id), not messageId. Did you mean to pass fileId? messageId is the Slack message timestamp and is used by react / reactions / edit / delete / pin / unpin actions, not download-file.");
|
|
355
|
-
const fileId = readStringParam(actionParams, "fileId", { required: true });
|
|
356
|
-
const channelId = readStringParam(actionParams, "channelId") ?? readStringParam(actionParams, "to");
|
|
357
|
-
const threadId = readStringParam(actionParams, "threadId") ?? readStringParam(actionParams, "replyTo");
|
|
361
|
+
const fileId = readStringParam$1(actionParams, "fileId", { required: true });
|
|
362
|
+
const channelId = readStringParam$1(actionParams, "channelId") ?? readStringParam$1(actionParams, "to");
|
|
363
|
+
const threadId = readStringParam$1(actionParams, "threadId") ?? readStringParam$1(actionParams, "replyTo");
|
|
358
364
|
return await invoke({
|
|
359
365
|
action: "downloadFile",
|
|
360
366
|
fileId,
|
|
@@ -365,18 +371,18 @@ async function handleSlackMessageAction(params) {
|
|
|
365
371
|
}
|
|
366
372
|
if (action === "upload-file") {
|
|
367
373
|
if (readBooleanParam(actionParams, "replyBroadcast")) throw new Error("Slack replyBroadcast is only supported for text or block thread replies.");
|
|
368
|
-
const to = readStringParam(actionParams, "to") ?? resolveChannelId();
|
|
369
|
-
const filePath = readStringParam(actionParams, "filePath", { trim: false }) ?? readStringParam(actionParams, "path", { trim: false }) ?? readStringParam(actionParams, "media", { trim: false });
|
|
374
|
+
const to = readStringParam$1(actionParams, "to") ?? resolveChannelId();
|
|
375
|
+
const filePath = readStringParam$1(actionParams, "filePath", { trim: false }) ?? readStringParam$1(actionParams, "path", { trim: false }) ?? readStringParam$1(actionParams, "media", { trim: false });
|
|
370
376
|
if (!filePath) throw new Error("upload-file requires filePath, path, or media");
|
|
371
|
-
const threadId = readStringParam(actionParams, "threadId") ?? readStringParam(actionParams, "replyTo");
|
|
377
|
+
const threadId = readStringParam$1(actionParams, "threadId") ?? readStringParam$1(actionParams, "replyTo");
|
|
372
378
|
const topLevel = readBooleanParam(actionParams, "topLevel") === true || actionParams.threadId === null;
|
|
373
379
|
return await invoke({
|
|
374
380
|
action: "uploadFile",
|
|
375
381
|
to,
|
|
376
382
|
filePath,
|
|
377
|
-
initialComment: readStringParam(actionParams, "initialComment", { allowEmpty: true }) ?? readStringParam(actionParams, "message", { allowEmpty: true }) ?? readStringParam(actionParams, "caption", { allowEmpty: true }) ?? "",
|
|
378
|
-
filename: readStringParam(actionParams, "filename"),
|
|
379
|
-
title: readStringParam(actionParams, "title"),
|
|
383
|
+
initialComment: readStringParam$1(actionParams, "initialComment", { allowEmpty: true }) ?? readStringParam$1(actionParams, "message", { allowEmpty: true }) ?? readStringParam$1(actionParams, "caption", { allowEmpty: true }) ?? "",
|
|
384
|
+
filename: readStringParam$1(actionParams, "filename"),
|
|
385
|
+
title: readStringParam$1(actionParams, "title"),
|
|
380
386
|
threadTs: threadId ?? void 0,
|
|
381
387
|
...readSlackForceDocument(actionParams) ? { forceDocument: true } : {},
|
|
382
388
|
...topLevel ? { topLevel: true } : {},
|
|
@@ -396,7 +402,7 @@ const SLACK_TOOL_DELIVERY_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
396
402
|
"unpinMessage",
|
|
397
403
|
"uploadFile"
|
|
398
404
|
]);
|
|
399
|
-
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
405
|
+
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-Dpa16J87.js"));
|
|
400
406
|
function resolveSlackActionContext(ctx, toolContext) {
|
|
401
407
|
if (!toolContext && !ctx.mediaAccess && !ctx.mediaLocalRoots && !ctx.mediaReadFile && !ctx.conversationReadOrigin && !ctx.requesterAccountId && !ctx.requesterSenderId) return;
|
|
402
408
|
return {
|
|
@@ -538,23 +544,23 @@ const EXTENSION_SHARED_MODULE_ID = "openclaw/plugin-sdk/extension-shared";
|
|
|
538
544
|
const TARGET_RESOLVER_RUNTIME_MODULE_ID = "openclaw/plugin-sdk/target-resolver-runtime";
|
|
539
545
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import(EXTENSION_SHARED_MODULE_ID));
|
|
540
546
|
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import(TARGET_RESOLVER_RUNTIME_MODULE_ID));
|
|
541
|
-
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-
|
|
542
|
-
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-
|
|
543
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-
|
|
547
|
+
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-CsBCM4rP.js"));
|
|
548
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-BBrUzpBH.js"));
|
|
549
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-DkT2vUE9.js"));
|
|
544
550
|
async function resolveSlackHandleAction() {
|
|
545
551
|
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? (await loadSlackActionRuntime()).handleSlackAction;
|
|
546
552
|
}
|
|
547
553
|
function shouldTreatSlackDeliveredTextAsVisible(params) {
|
|
548
554
|
return params.kind === "block" && typeof params.text === "string" && params.text.trim().length > 0;
|
|
549
555
|
}
|
|
550
|
-
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
551
|
-
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
552
|
-
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
553
|
-
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
554
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-
|
|
555
|
-
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
556
|
-
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
557
|
-
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
556
|
+
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-DqfQ42OV.js").then((n) => n.t));
|
|
557
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-DSamDgVs.js").then((n) => n.n));
|
|
558
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-CIzwbaJR.js").then((n) => n.n));
|
|
559
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-Dpa16J87.js"));
|
|
560
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-DQeNKa2J.js"));
|
|
561
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-4_aHtVT3.js").then((n) => n.n));
|
|
562
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-DrNCGneD.js").then((n) => n.t));
|
|
563
|
+
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-lC6X_Ru-.js").then((n) => n.t));
|
|
558
564
|
async function resolveSlackSendContext(params) {
|
|
559
565
|
const account = resolveSlackAccount({
|
|
560
566
|
cfg: params.cfg,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackPlugin } from "./channel-
|
|
1
|
+
import { t as slackPlugin } from "./channel-C_vnTgxo.js";
|
|
2
2
|
export { slackPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-
|
|
3
|
-
import { g as assertSlackDetachedTargetAllowed, u as normalizeAllowListLower } from "./group-policy-
|
|
4
|
-
import { a as createSlackReadClient, c as createSlackWebClient } from "./probe-
|
|
2
|
+
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-Dm_H77gH.js";
|
|
3
|
+
import { g as assertSlackDetachedTargetAllowed, u as normalizeAllowListLower } from "./group-policy-CU1tEGpS.js";
|
|
4
|
+
import { a as createSlackReadClient, c as createSlackWebClient } from "./probe-4_aHtVT3.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|