@openclaw/slack 2026.10.1 → 2026.10.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/account-configured-zcR9TJJN.mjs +35 -0
- package/dist/.setup/{account-inspect-Cs-7DXXW.mjs → account-inspect-D58VVDjk.mjs} +15 -35
- package/dist/.setup/{accounts-CDgkV7Cm.mjs → accounts-BMg9YLIv.mjs} +44 -53
- package/dist/.setup/{action-runtime-DJ1daRAZ.mjs → action-runtime-BiRZNsIG.mjs} +20 -22
- package/dist/.setup/action-runtime.runtime-C5xceJoS.mjs +2 -0
- package/dist/.setup/{actions-DDoAJnrH.mjs → actions-KGKwTAKO.mjs} +34 -43
- package/dist/.setup/{approval-handler.runtime-BcE_shWc.mjs → approval-handler.runtime-DYrsG2Ox.mjs} +44 -70
- package/dist/.setup/{approval-message-updates-EgKGmFXx.mjs → approval-message-updates-CwdDew9i.mjs} +1 -1
- package/dist/.setup/{channel-DgKSu8Iv.mjs → channel-C7MY-Hhg.mjs} +138 -97
- package/dist/.setup/{channel-type-B9zYYzBU.mjs → channel-type-NjX2SwvS.mjs} +3 -3
- package/dist/.setup/{channel.setup-BYIlwbQ7.mjs → channel.setup-BFpQowO3.mjs} +7 -14
- package/dist/.setup/{directory-config-B_by7zrc.mjs → directory-config-BEDZPfDn.mjs} +1 -1
- package/dist/.setup/{directory-live-C48wazJt.mjs → directory-live-FipfeCwt.mjs} +33 -36
- package/dist/.setup/{message-tool-api-CcjLPN3v.mjs → message-tool-api-C7im5ETh.mjs} +2 -2
- package/dist/.setup/{monitor-BuYBDmm7.mjs → monitor-BnN2px0N.mjs} +609 -801
- package/dist/.setup/{outbound-adapter-BZFkK-mw.mjs → outbound-adapter-4HdGq-8r.mjs} +4 -4
- package/dist/.setup/{pipeline.runtime-CIepKmZt.mjs → pipeline.runtime-ByPbC6MN.mjs} +287 -365
- package/dist/.setup/{policy-KKTqEiDv.mjs → policy-BaY9_eh1.mjs} +2 -2
- package/dist/.setup/{probe-BVlJ3dp0.mjs → probe-CyX52GtD.mjs} +54 -61
- package/dist/.setup/{relay-source-CC3h6M7y.mjs → relay-source-CVfH-fBO.mjs} +28 -45
- package/dist/.setup/{replies-DHbuthIR.mjs → replies-WmfwvQxc.mjs} +38 -49
- package/dist/.setup/{reply-blocks-CKnO4BSG.mjs → reply-blocks-rqHQ_3pr.mjs} +87 -138
- package/dist/.setup/{resolve-channels-HR0TgArR.mjs → resolve-channels-B96cgprw.mjs} +17 -41
- package/dist/.setup/{resolve-users-BNYBhF0q.mjs → resolve-users-Xz9aPdns.mjs} +22 -58
- package/dist/.setup/{scopes-DrDbyUH2.mjs → scopes-aMcMHhXk.mjs} +1 -1
- package/dist/.setup/{send-CgPI3Zj8.mjs → send-CLmsR42r.mjs} +157 -284
- package/dist/.setup/{session-status-D46GHwOV.mjs → session-status-CcXe10zN.mjs} +181 -238
- package/dist/.setup/{setup-plugin-api-ZrHs0N4U.mjs → setup-plugin-api-D92P5p51.mjs} +1 -1
- package/dist/.setup/{setup-surface-83lxvE2y.mjs → setup-surface-368jx6Uc.mjs} +6 -6
- package/dist/.setup/{shared-VtmYNj-v.mjs → shared-CtprVh_G.mjs} +5 -5
- package/dist/.setup/{slash-dispatch.runtime-gBj_uaLM.mjs → slash-dispatch.runtime-Dzwj6TPI.mjs} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/api.js +12 -12
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +6 -13
- package/dist/directory-contract-api.js +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +10 -10
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts +1 -1
- package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/block-kit/blocks.d.ts +79 -4
- package/node_modules/@slack/types/dist/block-kit/blocks.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/block-kit/composition-objects.d.ts +17 -0
- package/node_modules/@slack/types/dist/block-kit/composition-objects.d.ts.map +1 -1
- package/node_modules/@slack/types/package.json +1 -1
- package/node_modules/@slack/web-api/dist/methods.d.ts +49 -2
- package/node_modules/@slack/web-api/dist/methods.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/methods.js +47 -0
- package/node_modules/@slack/web-api/dist/methods.js.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/agents.d.ts +186 -0
- package/node_modules/@slack/web-api/dist/types/request/agents.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/index.d.ts +1 -1
- package/node_modules/@slack/web-api/dist/types/request/index.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.d.ts +9 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsArchiveResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.d.ts +10 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsCreateResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.d.ts +29 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsGetCanvasResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.d.ts +18 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsListViewsResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.d.ts +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsRemoveViewResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.d.ts +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCanvasContentResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.d.ts +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetCommandsResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.d.ts +10 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetPropertiesResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.d.ts +15 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AgentsConversationsSetViewResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/ConversationsInfoResponse.d.ts +31 -0
- package/node_modules/@slack/web-api/dist/types/response/ConversationsInfoResponse.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/response/index.d.ts +9 -0
- package/node_modules/@slack/web-api/dist/types/response/index.d.ts.map +1 -1
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/README.md +15 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/assert/strict.d.ts +68 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/assert.d.ts +1077 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/buffer.d.ts +1800 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/child_process.d.ts +1361 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/console.d.ts +93 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/constants.d.ts +14 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/crypto.d.ts +3964 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dgram.d.ts +652 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/dns.d.ts +876 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/domain.d.ts +150 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/events.d.ts +1008 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ffi.d.ts +500 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/fs/promises.d.ts +1477 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/fs.d.ts +4803 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/globals.d.ts +150 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/http.d.ts +2218 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/http2.d.ts +2498 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/https.d.ts +400 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/index.d.ts +116 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector.d.ts +265 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/module.d.ts +726 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/net.d.ts +1074 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/os.d.ts +498 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/package.json +155 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/path.d.ts +178 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/perf_hooks.d.ts +617 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/process.d.ts +2269 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/punycode.d.ts +89 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/querystring.d.ts +139 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/quic.d.ts +2191 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/readline.d.ts +508 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/repl.d.ts +420 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/sea.d.ts +47 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/sqlite.d.ts +1140 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/iter.d.ts +449 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream/web.d.ts +320 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/stream.d.ts +1806 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/test/reporters.d.ts +60 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/test.d.ts +2558 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/timers.d.ts +149 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/tls.d.ts +1232 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/trace_events.d.ts +103 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +467 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.6/index.d.ts +118 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/ts5.7/index.d.ts +118 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/tty.d.ts +226 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/url.d.ts +556 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/util.d.ts +1677 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/v8.d.ts +1059 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/vfs.d.ts +211 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/vm.d.ts +1137 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/wasi.d.ts +131 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/streams.d.ts +119 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/worker_threads.d.ts +672 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/node_modules/@types/node/zlib.d.ts +606 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -17
- package/node_modules/@slack/web-api/package.json +2 -2
- package/openclaw.plugin.json +0 -3
- package/package.json +6 -14
- package/dist/.setup/account-configured-sUohAxZr.mjs +0 -33
- package/dist/.setup/action-runtime.runtime-CdWL2mLC.mjs +0 -2
- package/dist/control-ui/2f4b1e827be6b68ced2ea0d8b7da8529a4eafbe72be27ee37e1064bdd530ec10/index.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as renderSlackBlockFallbackText, J as chunkSlackMrkdwnText, K as encodeSlackQuestionAction, M as truncateSlackText, P as SLACK_BUTTON_ACTION_IDS, Q as hasSlackDataVisualizationBlock, T as buildSlackCompleteBlocksFallbackText, Y as markdownToSlackMrkdwnChunks, Z as buildSlackDataVisualizationBlock, ct as encodeSlackApprovalAction, dt as SLACK_SECTION_TEXT_MAX, et as buildSlackDataTableBlock, g as buildSlackNativeDataAccessibilityText, m as appendSlackNativeDataFallbackText, nt as countSlackDataTableCellCharacters, pt as parseSlackBlocksInput, rt as renderSlackMessagePresentationChartFallbackText, tt as countSlackDataTableBlocksCellCharacters, v as hasSlackNativeDataBlock, w as buildSlackBlocksFallbackText, z as SLACK_SELECT_ACTION_IDS } from "./session-status-CcXe10zN.mjs";
|
|
2
2
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
4
4
|
import { legacyInteractiveReplyToPresentation, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveMessagePresentationButtonAction, resolveMessagePresentationOptionAction } from "openclaw/plugin-sdk/interactive-runtime";
|
|
@@ -6,6 +6,13 @@ import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply
|
|
|
6
6
|
import { resolveAskUserQuestionOptionIndex, resolveAskUserQuestionOptionIndices, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
7
7
|
//#region extensions/slack/src/blocks-render.ts
|
|
8
8
|
const SLACK_BUTTON_URL_MAX = 3e3;
|
|
9
|
+
function buildSlackPlainText(text, maxLength) {
|
|
10
|
+
return {
|
|
11
|
+
type: "plain_text",
|
|
12
|
+
text: truncateSlackText(text, maxLength),
|
|
13
|
+
emoji: true
|
|
14
|
+
};
|
|
15
|
+
}
|
|
9
16
|
function resolveSlackButtonStyle(style) {
|
|
10
17
|
if (style === "primary" || style === "danger") return style;
|
|
11
18
|
if (style === "success") return "primary";
|
|
@@ -88,10 +95,6 @@ function resolveSlackOptionTarget(option) {
|
|
|
88
95
|
value
|
|
89
96
|
} : void 0;
|
|
90
97
|
}
|
|
91
|
-
function readSlackBlockId(block) {
|
|
92
|
-
const value = block.block_id;
|
|
93
|
-
return typeof value === "string" ? value : void 0;
|
|
94
|
-
}
|
|
95
98
|
function readSlackOpenClawBlockIndex(blockId, prefix) {
|
|
96
99
|
if (!blockId.startsWith(prefix)) return;
|
|
97
100
|
const value = Number.parseInt(blockId.slice(prefix.length), 10);
|
|
@@ -105,8 +108,8 @@ function resolveSlackBlockOffsets(blocks, mode = "all") {
|
|
|
105
108
|
let selectIndexOffset = 0;
|
|
106
109
|
for (const block of blocks ?? []) {
|
|
107
110
|
if (mode === "all" && hasSlackDataVisualizationBlock([block])) dataVisualizationCountOffset += 1;
|
|
108
|
-
const blockId =
|
|
109
|
-
if (!blockId) continue;
|
|
111
|
+
const blockId = block.block_id;
|
|
112
|
+
if (typeof blockId !== "string" || !blockId) continue;
|
|
110
113
|
buttonIndexOffset = Math.max(buttonIndexOffset, readSlackOpenClawBlockIndex(blockId, "openclaw_reply_buttons_") ?? 0);
|
|
111
114
|
selectIndexOffset = Math.max(selectIndexOffset, readSlackOpenClawBlockIndex(blockId, "openclaw_reply_select_") ?? 0);
|
|
112
115
|
}
|
|
@@ -123,23 +126,29 @@ function resolveSlackBlockOffsets(blocks, mode = "all") {
|
|
|
123
126
|
function buildSlackInteractiveBlocks(interactive, options = {}) {
|
|
124
127
|
return buildSlackPresentationBlocks(interactive ? legacyInteractiveReplyToPresentation(interactive) : void 0, options);
|
|
125
128
|
}
|
|
126
|
-
/** Render portable presentation blocks as Slack Block Kit blocks. */
|
|
127
129
|
function buildSlackPresentationBlocks(presentation, options = {}) {
|
|
130
|
+
return compileSlackPresentationBlocks(presentation, options, false) ?? [];
|
|
131
|
+
}
|
|
132
|
+
/** Return native blocks only when every portable control and data block fits. */
|
|
133
|
+
function buildSlackPresentationBlocksIfComplete(presentation, options = {}) {
|
|
134
|
+
return compileSlackPresentationBlocks(presentation, options, true);
|
|
135
|
+
}
|
|
136
|
+
function compileSlackPresentationBlocks(presentation, options, requireComplete) {
|
|
128
137
|
if (!presentation) return [];
|
|
129
|
-
|
|
138
|
+
if (requireComplete && presentation.title && presentation.title.trim().length > 150) return;
|
|
139
|
+
const tables = buildSlackPresentationTables(presentation, options);
|
|
140
|
+
if (requireComplete && !tables) return;
|
|
130
141
|
const blocks = [];
|
|
131
142
|
if (presentation.title) blocks.push({
|
|
132
143
|
type: "header",
|
|
133
|
-
text:
|
|
134
|
-
type: "plain_text",
|
|
135
|
-
text: truncateSlackText(presentation.title, 150),
|
|
136
|
-
emoji: true
|
|
137
|
-
}
|
|
144
|
+
text: buildSlackPlainText(presentation.title, 150)
|
|
138
145
|
});
|
|
139
|
-
|
|
140
|
-
|
|
146
|
+
const controlIndices = {
|
|
147
|
+
buttons: options.buttonIndexOffset ?? 0,
|
|
148
|
+
select: options.selectIndexOffset ?? 0
|
|
149
|
+
};
|
|
150
|
+
let tableIndex = 0;
|
|
141
151
|
let dataVisualizationCount = options.dataVisualizationCountOffset ?? 0;
|
|
142
|
-
let selectIndex = options.selectIndexOffset ?? 0;
|
|
143
152
|
for (const block of presentation.blocks) {
|
|
144
153
|
if (block.type === "text" || block.type === "context") {
|
|
145
154
|
const text = block.text.trim();
|
|
@@ -164,11 +173,17 @@ function buildSlackPresentationBlocks(presentation, options = {}) {
|
|
|
164
173
|
blocks.push({ type: "divider" });
|
|
165
174
|
continue;
|
|
166
175
|
}
|
|
167
|
-
if (block.type === "buttons") {
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
176
|
+
if (block.type === "buttons" || block.type === "select") {
|
|
177
|
+
const index = controlIndices[block.type] + 1;
|
|
178
|
+
const elements = block.type === "buttons" ? buildSlackPresentationButtonElements(block, index, options.questionOptionIndices, requireComplete) : buildSlackPresentationSelectElements(block, index, requireComplete);
|
|
179
|
+
if (!elements) return;
|
|
180
|
+
if (elements.length > 0) {
|
|
181
|
+
controlIndices[block.type] = index;
|
|
182
|
+
blocks.push({
|
|
183
|
+
type: "actions",
|
|
184
|
+
block_id: `openclaw_reply_${block.type}_${index}`,
|
|
185
|
+
elements
|
|
186
|
+
});
|
|
172
187
|
}
|
|
173
188
|
continue;
|
|
174
189
|
}
|
|
@@ -177,7 +192,8 @@ function buildSlackPresentationBlocks(presentation, options = {}) {
|
|
|
177
192
|
if (rendered) {
|
|
178
193
|
dataVisualizationCount += 1;
|
|
179
194
|
blocks.push(rendered);
|
|
180
|
-
} else
|
|
195
|
+
} else if (requireComplete) return;
|
|
196
|
+
else {
|
|
181
197
|
const fallback = renderSlackMessagePresentationChartFallbackText(block);
|
|
182
198
|
blocks.push(...chunkTextForOutbound(fallback, SLACK_SECTION_TEXT_MAX).map((text) => ({
|
|
183
199
|
type: "context",
|
|
@@ -191,123 +207,66 @@ function buildSlackPresentationBlocks(presentation, options = {}) {
|
|
|
191
207
|
continue;
|
|
192
208
|
}
|
|
193
209
|
if (block.type === "table") {
|
|
194
|
-
if (
|
|
195
|
-
const rendered = buildSlackDataTableBlock(block, { cellCharacterCountOffset: dataTableCellCharacterCount });
|
|
196
|
-
if (rendered) {
|
|
197
|
-
dataTableCellCharacterCount += countSlackDataTableCellCharacters(rendered);
|
|
198
|
-
blocks.push(rendered);
|
|
199
|
-
}
|
|
200
|
-
continue;
|
|
201
|
-
}
|
|
202
|
-
if (block.type === "select") {
|
|
203
|
-
const rendered = buildSlackPresentationSelectBlock(block, selectIndex + 1);
|
|
204
|
-
if (rendered) {
|
|
205
|
-
selectIndex += 1;
|
|
206
|
-
blocks.push(rendered);
|
|
207
|
-
}
|
|
210
|
+
if (tables) blocks.push(tables[tableIndex++]);
|
|
208
211
|
}
|
|
209
212
|
}
|
|
210
213
|
return blocks;
|
|
211
214
|
}
|
|
212
|
-
function
|
|
215
|
+
function buildSlackPresentationButtonElements(block, buttonIndex, questionOptionIndices, requireComplete) {
|
|
216
|
+
let complete = true;
|
|
213
217
|
const elements = block.buttons.flatMap((button, choiceIndex) => {
|
|
214
218
|
const target = resolveSlackButtonTarget(button, questionOptionIndices);
|
|
215
|
-
if (!target || (target.kind === "link" ? target.url.length > SLACK_BUTTON_URL_MAX : target.value.length > 2e3))
|
|
219
|
+
if (!target || (target.kind === "link" ? target.url.length > SLACK_BUTTON_URL_MAX : target.value.length > 2e3)) {
|
|
220
|
+
if (requireComplete && !isSlackTextFallbackButton(button)) complete = false;
|
|
221
|
+
return [];
|
|
222
|
+
}
|
|
223
|
+
if (button.label.length > 75) complete = false;
|
|
216
224
|
const style = resolveSlackButtonStyle(button.style);
|
|
217
225
|
return [{
|
|
218
226
|
type: "button",
|
|
219
227
|
action_id: `${SLACK_BUTTON_ACTION_IDS[target.kind]}:${buttonIndex}:${choiceIndex + 1}`,
|
|
220
|
-
text:
|
|
221
|
-
type: "plain_text",
|
|
222
|
-
text: truncateSlackText(button.label, 75),
|
|
223
|
-
emoji: true
|
|
224
|
-
},
|
|
228
|
+
text: buildSlackPlainText(button.label, 75),
|
|
225
229
|
...target.kind === "link" ? { url: target.url } : { value: target.value },
|
|
226
230
|
...style ? { style } : {}
|
|
227
231
|
}];
|
|
228
|
-
})
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
block_id: `openclaw_reply_buttons_${buttonIndex}`,
|
|
232
|
-
elements
|
|
233
|
-
} : void 0;
|
|
232
|
+
});
|
|
233
|
+
if (requireComplete && (!complete || elements.length > 25)) return;
|
|
234
|
+
return elements.slice(0, 25);
|
|
234
235
|
}
|
|
235
|
-
/**
|
|
236
|
-
function
|
|
236
|
+
/** Admit tables together: one invalid or over-budget table keeps every table on the text path. */
|
|
237
|
+
function buildSlackPresentationTables(presentation, options = {}) {
|
|
238
|
+
const tables = [];
|
|
237
239
|
let cellCharacterCount = options.dataTableCellCharacterCountOffset ?? 0;
|
|
238
240
|
for (const block of presentation.blocks) {
|
|
239
241
|
if (block.type !== "table") continue;
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
cellCharacterCount +=
|
|
243
|
-
|
|
244
|
-
return true;
|
|
245
|
-
}
|
|
246
|
-
/** True when native Slack rendering preserves every portable control. */
|
|
247
|
-
function canRenderSlackPresentation(presentation, options = {}) {
|
|
248
|
-
if (presentation.title && presentation.title.trim().length > 150) return false;
|
|
249
|
-
if (!canRenderSlackPresentationTables(presentation, options)) return false;
|
|
250
|
-
let dataVisualizationCount = options.dataVisualizationCountOffset ?? 0;
|
|
251
|
-
for (const block of presentation.blocks) {
|
|
252
|
-
if (block.type === "text" || block.type === "context") continue;
|
|
253
|
-
if (block.type === "buttons") {
|
|
254
|
-
let nativeButtonCount = 0;
|
|
255
|
-
if (!(block.buttons.every((button) => {
|
|
256
|
-
if (isSlackTextFallbackButton(button)) return true;
|
|
257
|
-
nativeButtonCount += 1;
|
|
258
|
-
if (button.label.length > 75) return false;
|
|
259
|
-
const target = resolveSlackButtonTarget(button, options.questionOptionIndices);
|
|
260
|
-
return target ? target.kind === "link" ? target.url.length <= SLACK_BUTTON_URL_MAX : target.value.length <= 2e3 : false;
|
|
261
|
-
}) && nativeButtonCount <= 25)) return false;
|
|
262
|
-
continue;
|
|
263
|
-
}
|
|
264
|
-
if (block.type === "select") {
|
|
265
|
-
if (!((normalizeOptionalString(block.placeholder) ?? "Choose an option").length <= 75 && block.options.length <= 100 && (!block.placeholder || block.placeholder.length <= 75) && block.options.every((option) => {
|
|
266
|
-
if (option.label.length > 75) return false;
|
|
267
|
-
const target = resolveSlackOptionTarget(option);
|
|
268
|
-
return target ? target.value.length <= 150 : false;
|
|
269
|
-
}) && new Set(block.options.map((option) => resolveSlackOptionTarget(option)?.kind)).size === 1)) return false;
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
if (block.type === "chart") {
|
|
273
|
-
if (dataVisualizationCount >= 2 || !canRenderSlackDataVisualization(block)) return false;
|
|
274
|
-
dataVisualizationCount += 1;
|
|
275
|
-
continue;
|
|
276
|
-
}
|
|
277
|
-
if (block.type === "table") continue;
|
|
242
|
+
const table = buildSlackDataTableBlock(block, { cellCharacterCountOffset: cellCharacterCount });
|
|
243
|
+
if (!table) return;
|
|
244
|
+
cellCharacterCount += countSlackDataTableCellCharacters(table);
|
|
245
|
+
tables.push(table);
|
|
278
246
|
}
|
|
279
|
-
return
|
|
247
|
+
return tables;
|
|
280
248
|
}
|
|
281
|
-
function
|
|
282
|
-
const
|
|
249
|
+
function buildSlackPresentationSelectElements(block, selectIndex, requireComplete) {
|
|
250
|
+
const placeholder = normalizeOptionalString(block.placeholder) ?? "Choose an option";
|
|
251
|
+
const candidates = block.options.map((option) => {
|
|
283
252
|
const target = resolveSlackOptionTarget(option);
|
|
284
|
-
return target ?
|
|
253
|
+
return target ? {
|
|
285
254
|
label: option.label,
|
|
286
255
|
...target
|
|
287
|
-
}
|
|
288
|
-
})
|
|
256
|
+
} : void 0;
|
|
257
|
+
});
|
|
258
|
+
if (requireComplete && (placeholder.length > 75 || block.options.length > 100 || block.placeholder && block.placeholder.length > 75 || !candidates.every((option) => option && option.label.length <= 75 && option.value.length <= 150) || new Set(candidates.map((option) => option?.kind)).size !== 1)) return;
|
|
259
|
+
const options = candidates.flatMap((option) => option && option.value.length <= 150 ? [option] : []).slice(0, 100);
|
|
289
260
|
const optionKinds = new Set(options.map((option) => option.kind));
|
|
290
|
-
return options.length > 0 && optionKinds.size === 1 ? {
|
|
291
|
-
type: "
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
emoji: true
|
|
300
|
-
},
|
|
301
|
-
options: options.map((option) => ({
|
|
302
|
-
text: {
|
|
303
|
-
type: "plain_text",
|
|
304
|
-
text: truncateSlackText(option.label, 75),
|
|
305
|
-
emoji: true
|
|
306
|
-
},
|
|
307
|
-
value: option.value
|
|
308
|
-
}))
|
|
309
|
-
}]
|
|
310
|
-
} : void 0;
|
|
261
|
+
return options.length > 0 && optionKinds.size === 1 ? [{
|
|
262
|
+
type: "static_select",
|
|
263
|
+
action_id: `${SLACK_SELECT_ACTION_IDS[options[0].kind]}:${selectIndex}`,
|
|
264
|
+
placeholder: buildSlackPlainText(placeholder, 75),
|
|
265
|
+
options: options.map((option) => ({
|
|
266
|
+
text: buildSlackPlainText(option.label, 75),
|
|
267
|
+
value: option.value
|
|
268
|
+
}))
|
|
269
|
+
}] : [];
|
|
311
270
|
}
|
|
312
271
|
//#endregion
|
|
313
272
|
//#region extensions/slack/src/authored-text.ts
|
|
@@ -566,28 +525,18 @@ function resolvePresentationRenderOptions(segments, mode) {
|
|
|
566
525
|
selectIndexOffset: allOffsets.selectIndexOffset
|
|
567
526
|
};
|
|
568
527
|
}
|
|
569
|
-
function renderNativePresentation(presentation, options) {
|
|
570
|
-
if (!canRenderSlackPresentation(presentation, options)) return;
|
|
571
|
-
const blocks = buildSlackPresentationBlocks(presentation, options);
|
|
572
|
-
return blocks.length > 0 ? blocks : void 0;
|
|
573
|
-
}
|
|
574
528
|
function appendPresentationPart(segments, presentation, questionOptionIndices) {
|
|
575
529
|
const currentBlocks = readLastBlockSegment(segments);
|
|
576
|
-
const
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
questionOptionIndices
|
|
587
|
-
});
|
|
588
|
-
if (freshRendered) {
|
|
589
|
-
appendBlockSegment(segments, freshRendered, true);
|
|
590
|
-
return;
|
|
530
|
+
for (const mode of ["current", "new-message"]) {
|
|
531
|
+
const rendered = buildSlackPresentationBlocksIfComplete(presentation, {
|
|
532
|
+
...resolvePresentationRenderOptions(segments, mode),
|
|
533
|
+
questionOptionIndices
|
|
534
|
+
});
|
|
535
|
+
const startNew = mode === "new-message";
|
|
536
|
+
if (rendered?.length && (startNew || currentBlocks.length + rendered.length <= 50)) {
|
|
537
|
+
appendBlockSegment(segments, rendered, startNew);
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
591
540
|
}
|
|
592
541
|
appendTextSegment(segments, renderMessagePresentationFallbackText({ presentation }));
|
|
593
542
|
}
|
|
@@ -699,4 +648,4 @@ function resolveSlackReplyBlocks(payload) {
|
|
|
699
648
|
return segments.length === 1 && segments[0]?.kind === "blocks" ? segments[0].blocks : void 0;
|
|
700
649
|
}
|
|
701
650
|
//#endregion
|
|
702
|
-
export { prepareSlackReply as a, resolveSlackReplyDeliveryMessages as c, buildSlackInteractiveBlocks as d, buildSlackPresentationBlocks as f, parseSlackReplyBlockSegments as i, resolveSlackReplyRenderPlan as l, iterateSlackReplyDeliveryMessages as n, resolveSlackReplyBlockResolution as o,
|
|
651
|
+
export { prepareSlackReply as a, resolveSlackReplyDeliveryMessages as c, buildSlackInteractiveBlocks as d, buildSlackPresentationBlocks as f, parseSlackReplyBlockSegments as i, resolveSlackReplyRenderPlan as l, iterateSlackReplyDeliveryMessages as n, resolveSlackReplyBlockResolution as o, buildSlackPresentationBlocksIfComplete as p, normalizeSlackReplyPayload as r, resolveSlackReplyBlocks as s, hasSlackReplyStructuredContent as t, resolveSlackAuthoredTextPlacement as u };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
3
|
-
import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-
|
|
3
|
+
import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-CyX52GtD.mjs";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
6
5
|
//#region extensions/slack/src/resolve-channels.ts
|
|
7
6
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveSlackChannelAllowlist: () => resolveSlackChannelAllowlist });
|
|
8
7
|
function parseSlackChannelMention(raw) {
|
|
@@ -14,7 +13,7 @@ function parseSlackChannelMention(raw) {
|
|
|
14
13
|
name: mention[2]?.trim()
|
|
15
14
|
};
|
|
16
15
|
const prefixed = trimmed.replace(/^(slack:|channel:)/i, "");
|
|
17
|
-
if (/^[CG][A-Z0-9]
|
|
16
|
+
if (/^[CG][A-Z0-9]{8,}$/i.test(prefixed)) return { id: prefixed.toUpperCase() };
|
|
18
17
|
const name = prefixed.replace(/^#/, "").trim();
|
|
19
18
|
return name ? { name } : {};
|
|
20
19
|
}
|
|
@@ -41,55 +40,32 @@ function resolveByName(name, channels) {
|
|
|
41
40
|
return matches.find((channel) => !channel.archived) ?? matches[0];
|
|
42
41
|
}
|
|
43
42
|
async function resolveSlackChannelAllowlist(params) {
|
|
44
|
-
const
|
|
45
|
-
const lookupEntries = params.entries.filter((_, index) => !workspaceResolved[index]);
|
|
46
|
-
if (lookupEntries.length === 0) return workspaceResolved.filter((entry) => entry !== void 0);
|
|
47
|
-
const parsedEntries = lookupEntries.map((input) => ({
|
|
43
|
+
const entries = params.entries.map((input) => ({
|
|
48
44
|
input,
|
|
45
|
+
workspace: resolveWorkspaceQualifiedSlackTarget(input, "channel"),
|
|
49
46
|
parsed: parseSlackChannelMention(input)
|
|
50
47
|
}));
|
|
51
|
-
if (
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}));
|
|
58
|
-
let resolvedIndex = 0;
|
|
59
|
-
return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
|
|
60
|
-
}
|
|
48
|
+
if (entries.every(({ workspace, parsed }) => workspace || parsed.id)) return entries.map(({ input, workspace, parsed }) => workspace ?? {
|
|
49
|
+
input,
|
|
50
|
+
resolved: true,
|
|
51
|
+
id: parsed.id,
|
|
52
|
+
name: parsed.name
|
|
53
|
+
});
|
|
61
54
|
const channels = await listSlackChannels(params.client ?? createSlackLookupClient(params.token));
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
findById: (lookup, id) => lookup.find((channel) => channel.id === id),
|
|
67
|
-
buildIdResolved: ({ input, parsed, match }) => ({
|
|
55
|
+
return entries.map(({ input, workspace, parsed }) => {
|
|
56
|
+
if (workspace) return workspace;
|
|
57
|
+
const match = parsed.id ? channels.find((channel) => channel.id === parsed.id) : parsed.name ? resolveByName(parsed.name, channels) : void 0;
|
|
58
|
+
return parsed.id || match ? {
|
|
68
59
|
input,
|
|
69
60
|
resolved: true,
|
|
70
|
-
id: parsed.id,
|
|
61
|
+
id: parsed.id ?? match?.id,
|
|
71
62
|
name: match?.name ?? parsed.name,
|
|
72
63
|
archived: match?.archived
|
|
73
|
-
}
|
|
74
|
-
resolveNonId: ({ input, parsed, lookup }) => {
|
|
75
|
-
if (!parsed.name) return;
|
|
76
|
-
const match = resolveByName(parsed.name, lookup);
|
|
77
|
-
if (!match) return;
|
|
78
|
-
return {
|
|
79
|
-
input,
|
|
80
|
-
resolved: true,
|
|
81
|
-
id: match.id,
|
|
82
|
-
name: match.name,
|
|
83
|
-
archived: match.archived
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
buildUnresolved: (input) => ({
|
|
64
|
+
} : {
|
|
87
65
|
input,
|
|
88
66
|
resolved: false
|
|
89
|
-
}
|
|
67
|
+
};
|
|
90
68
|
});
|
|
91
|
-
let resolvedIndex = 0;
|
|
92
|
-
return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
|
|
93
69
|
}
|
|
94
70
|
//#endregion
|
|
95
71
|
export { resolve_channels_exports as n, resolveSlackChannelAllowlist as t };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
3
|
-
import { c as collectSlackCursorPages, u as createSlackLookupClient } from "./probe-
|
|
3
|
+
import { c as collectSlackCursorPages, u as createSlackLookupClient } from "./probe-CyX52GtD.mjs";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
6
5
|
//#region extensions/slack/src/resolve-users.ts
|
|
7
6
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveSlackUserAllowlist: () => resolveSlackUserAllowlist });
|
|
8
7
|
function parseSlackUserInput(raw) {
|
|
@@ -51,71 +50,36 @@ function matchesSlackUserName(user, name) {
|
|
|
51
50
|
return Boolean(candidate) && candidate === target;
|
|
52
51
|
});
|
|
53
52
|
}
|
|
54
|
-
function scoreSlackUser(user
|
|
55
|
-
|
|
56
|
-
if (!user.deleted) score += 3;
|
|
57
|
-
if (!user.isBot && !user.isAppUser) score += 2;
|
|
58
|
-
if (match.email && user.email === match.email) score += 5;
|
|
59
|
-
if (match.name && matchesSlackUserName(user, match.name)) score += 2;
|
|
60
|
-
return score;
|
|
61
|
-
}
|
|
62
|
-
function resolveSlackUserFromMatches(input, matches, parsed) {
|
|
63
|
-
const best = matches.map((user) => ({
|
|
64
|
-
user,
|
|
65
|
-
score: scoreSlackUser(user, parsed)
|
|
66
|
-
})).toSorted((a, b) => b.score - a.score)[0]?.user;
|
|
67
|
-
if (!best) return {
|
|
68
|
-
input,
|
|
69
|
-
resolved: false
|
|
70
|
-
};
|
|
71
|
-
return {
|
|
72
|
-
input,
|
|
73
|
-
resolved: true,
|
|
74
|
-
id: best.id,
|
|
75
|
-
name: best.displayName ?? best.realName ?? best.name,
|
|
76
|
-
email: best.email,
|
|
77
|
-
deleted: best.deleted,
|
|
78
|
-
isBot: best.isBot,
|
|
79
|
-
note: matches.length > 1 ? "multiple matches; chose best" : void 0
|
|
80
|
-
};
|
|
53
|
+
function scoreSlackUser(user) {
|
|
54
|
+
return (user.deleted ? 0 : 3) + (user.isBot || user.isAppUser ? 0 : 2);
|
|
81
55
|
}
|
|
82
56
|
async function resolveSlackUserAllowlist(params) {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
57
|
+
const entries = params.entries.map((input) => ({
|
|
58
|
+
input,
|
|
59
|
+
workspace: resolveWorkspaceQualifiedSlackTarget(input, "user"),
|
|
60
|
+
parsed: parseSlackUserInput(input)
|
|
61
|
+
}));
|
|
62
|
+
const users = entries.some(({ workspace }) => !workspace) ? await listSlackUsers(params.client ?? createSlackLookupClient(params.token)) : [];
|
|
63
|
+
return entries.map(({ input, workspace, parsed }) => {
|
|
64
|
+
if (workspace) return workspace;
|
|
65
|
+
const matches = users.filter((user) => parsed.id ? user.id === parsed.id : parsed.email ? user.email === parsed.email : parsed.name ? matchesSlackUserName(user, parsed.name) : false);
|
|
66
|
+
const match = parsed.id ? matches[0] : matches.toSorted((a, b) => scoreSlackUser(b) - scoreSlackUser(a))[0];
|
|
67
|
+
if (!parsed.id && !match) return {
|
|
68
|
+
input,
|
|
69
|
+
resolved: false
|
|
70
|
+
};
|
|
71
|
+
const result = {
|
|
93
72
|
input,
|
|
94
73
|
resolved: true,
|
|
95
|
-
id: parsed.id,
|
|
74
|
+
id: parsed.id ?? match?.id,
|
|
96
75
|
name: match?.displayName ?? match?.realName ?? match?.name,
|
|
97
76
|
email: match?.email,
|
|
98
77
|
deleted: match?.deleted,
|
|
99
78
|
isBot: match?.isBot
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const matches = lookup.filter((user) => user.email === parsed.email);
|
|
104
|
-
if (matches.length > 0) return resolveSlackUserFromMatches(input, matches, parsed);
|
|
105
|
-
}
|
|
106
|
-
const name = parsed.name;
|
|
107
|
-
if (name) {
|
|
108
|
-
const matches = lookup.filter((user) => matchesSlackUserName(user, name));
|
|
109
|
-
if (matches.length > 0) return resolveSlackUserFromMatches(input, matches, parsed);
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
buildUnresolved: (input) => ({
|
|
113
|
-
input,
|
|
114
|
-
resolved: false
|
|
115
|
-
})
|
|
79
|
+
};
|
|
80
|
+
if (!parsed.id) result.note = matches.length > 1 ? "multiple matches; chose best" : void 0;
|
|
81
|
+
return result;
|
|
116
82
|
});
|
|
117
|
-
let resolvedIndex = 0;
|
|
118
|
-
return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
|
|
119
83
|
}
|
|
120
84
|
//#endregion
|
|
121
85
|
export { resolve_users_exports as n, resolveSlackUserAllowlist as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as createSlackReadClient, o as formatSlackError } from "./probe-
|
|
1
|
+
import { d as createSlackReadClient, o as formatSlackError } from "./probe-CyX52GtD.mjs";
|
|
2
2
|
import { isRecord, normalizeOptionalString, normalizeTrimmedStringList, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/slack/src/scopes.ts
|
|
4
4
|
function collectScopes(value, into) {
|