@openclaw/slack 2026.7.2-beta.1 → 2026.7.2-beta.3
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-DzC407uv.js → account-configured-BwfXBo_F.js} +1 -1
- package/dist/{account-inspect-Di7ditqZ.js → account-inspect-Bvbtu3iH.js} +9 -2
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-BOJJiHSr.js → accounts-DQEbYKh9.js} +9 -0
- package/dist/accounts.runtime-BIKmJdtJ.js +2 -0
- package/dist/{action-runtime-p6M2ULpv.js → action-runtime-DqkRwO3Z.js} +14 -17
- package/dist/action-runtime.runtime-DEWOcFM4.js +2 -0
- package/dist/{actions-DkTcWmpT.js → actions-CF0tUY5q.js} +5 -9
- package/dist/{actions.runtime-BSxpwgUc.js → actions.runtime-hCbx4RXg.js} +1 -1
- package/dist/api.js +13 -14
- package/dist/{approval-handler.runtime-UGbnz9OC.js → approval-handler.runtime-Em8I1-8-.js} +2 -2
- package/dist/{channel-B0_j6C6z.js → channel-4-TRi1D6.js} +75 -41
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-BpeTezY4.js → channel-type-Cu1yjNg2.js} +3 -3
- package/dist/{channel.setup-BQFut21T.js → channel.setup-CgkADtZg.js} +6 -4
- package/dist/{config-schema-DYI01PV2.js → config-schema-XjJGfwQC.js} +18 -5
- package/dist/{directory-config-DRkFujwG.js → directory-config-Bv0lcUlH.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DX7yFsM-.js → directory-live-CzUIB7th.js} +2 -2
- package/dist/{doctor-contract-DddfkMlF.js → doctor-contract-DKpe5VBr.js} +80 -12
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{group-policy-C-b2ZnSl.js → group-policy-Bw-65m3V.js} +94 -135
- package/dist/{interactive-replies-BilWUdcI.js → interactive-replies-Dm_t2R9S.js} +1 -1
- package/dist/interactive-replies-api.js +1 -1
- package/dist/{message-tool-api-CA9jZrCY.js → message-tool-api-C2pcf5du.js} +3 -3
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-BN_uuvrQ.js → monitor-CNFeF30h.js} +3 -3
- package/dist/{outbound-adapter-ECl0go7d.js → outbound-adapter-CVi2uok0.js} +49 -5
- package/dist/{pipeline.runtime-f0eJJoJL.js → pipeline.runtime-CTvokbty.js} +485 -251
- package/dist/{policy-f8b0edSi.js → policy-b_dOPDCq.js} +7 -7
- package/dist/probe-Borhn9PQ.js +340 -0
- package/dist/{provider-Ds-y-imP.js → provider-B-HVL5ZE.js} +831 -329
- package/dist/{relay-source-B-6LFUdz.js → relay-source-Ea_P9VcO.js} +6 -11
- package/dist/{replies-BMvf3ihj.js → replies-B4bOdrYb.js} +3 -3
- package/dist/{resolve-channels-DOMgNCWb.js → resolve-channels-KTc568SU.js} +1 -1
- package/dist/{resolve-users-aL6-Ssee.js → resolve-users-DeGJf1yp.js} +1 -1
- package/dist/{runtime-CauEvswP.js → runtime-JSVZSWAj.js} +2 -2
- package/dist/{runtime-api-CVb6CQjX.js → runtime-api-BFfNpzDe.js} +1 -1
- package/dist/runtime-api.js +12 -12
- package/dist/runtime-setter-api.js +1 -1
- package/dist/{scopes-Dw8wbU0j.js → scopes-lx08L56K.js} +1 -2
- package/dist/{secret-contract-CMohXFWS.js → secret-contract-DxmvbxBF.js} +1 -0
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-NEfJ0GvM.js → send-KuTDky7i.js} +29 -12
- package/dist/send.runtime-CXyxws1D.js +2 -0
- package/dist/setup-core-CeiAVwQ3.js +502 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BN2WeG5c.js → setup-surface-DLA0vHXp.js} +23 -13
- package/dist/{shared-BLnB9R1T.js → shared-C4yVB0Q-.js} +64 -41
- package/dist/{slash-dispatch.runtime-C0Otuf_T.js → slash-dispatch.runtime-BT-mMm-f.js} +1 -1
- package/npm-shrinkwrap.json +3 -3
- package/openclaw.plugin.json +134 -10
- package/package.json +5 -7
- package/dist/accounts.runtime-KvftRRek.js +0 -2
- package/dist/action-runtime.runtime-DQstDkHG.js +0 -2
- package/dist/client-D2F6m8CP.js +0 -152
- package/dist/configured-state.js +0 -11
- package/dist/probe-CfALk0l4.js +0 -48
- package/dist/send.runtime-BkKpitPu.js +0 -2
- package/dist/setup-core-fGd6Gquy.js +0 -343
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as formatUnknownError, s as SLACK_SOCKET_RECONNECT_POLICY } from "./provider-
|
|
1
|
+
import { c as formatUnknownError, s as SLACK_SOCKET_RECONNECT_POLICY } from "./provider-B-HVL5ZE.js";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { computeBackoff, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
4
4
|
import { Buffer } from "node:buffer";
|
|
@@ -27,7 +27,7 @@ async function monitorSlackRelaySource(params) {
|
|
|
27
27
|
params.runtime.log?.(`slack relay mode connected gateway_id:${params.config.gatewayId}`);
|
|
28
28
|
await runRelayWebSocket({
|
|
29
29
|
connection,
|
|
30
|
-
|
|
30
|
+
acceptRelayEvent: params.acceptRelayEvent,
|
|
31
31
|
runtime: params.runtime,
|
|
32
32
|
abortSignal: params.abortSignal,
|
|
33
33
|
setStatus: params.setStatus,
|
|
@@ -90,7 +90,6 @@ function openRelayWebSocket(config, abortSignal) {
|
|
|
90
90
|
}
|
|
91
91
|
function runRelayWebSocket(params) {
|
|
92
92
|
const ws = params.connection;
|
|
93
|
-
const relayState = {};
|
|
94
93
|
let pending = Promise.resolve();
|
|
95
94
|
return new Promise((resolve, reject) => {
|
|
96
95
|
const cleanup = () => {
|
|
@@ -111,8 +110,7 @@ function runRelayWebSocket(params) {
|
|
|
111
110
|
pending = pending.then(() => handleRelayFrame({
|
|
112
111
|
ws,
|
|
113
112
|
data,
|
|
114
|
-
|
|
115
|
-
relayState,
|
|
113
|
+
acceptRelayEvent: params.acceptRelayEvent,
|
|
116
114
|
setStatus: params.setStatus,
|
|
117
115
|
setIdentity: params.setIdentity
|
|
118
116
|
})).catch((err) => {
|
|
@@ -150,7 +148,6 @@ async function handleRelayFrame(params) {
|
|
|
150
148
|
const frame = parseRelayFrame(params.data);
|
|
151
149
|
const hello = extractRelayHello(frame);
|
|
152
150
|
if (hello) {
|
|
153
|
-
params.relayState.identity = hello.identity;
|
|
154
151
|
params.setIdentity?.(hello.identity);
|
|
155
152
|
params.setStatus?.({ relayIdentity: hello.identity ?? null });
|
|
156
153
|
return;
|
|
@@ -163,11 +160,9 @@ async function handleRelayFrame(params) {
|
|
|
163
160
|
lastInboundAt: now
|
|
164
161
|
});
|
|
165
162
|
params.setStatus?.({ relayRoute: event.route });
|
|
166
|
-
await params.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
awaitDispatch: true,
|
|
170
|
-
...params.relayState.identity ? { relayIdentity: params.relayState.identity } : {}
|
|
163
|
+
await params.acceptRelayEvent({
|
|
164
|
+
deliveryId: event.deliveryId,
|
|
165
|
+
message: event.message
|
|
171
166
|
});
|
|
172
167
|
sendRelayAck(params.ws, event.deliveryId);
|
|
173
168
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as hasSlackNativeDataBlock, D as markdownToSlackMrkdwnChunks, F as SLACK_TEXT_LIMIT, f as hasSlackReplyStructuredContent, h as resolveSlackReplyBlocks, k as buildSlackBlocksFallbackText, m as resolveSlackReplyBlockResolution, w as isSlackInvalidBlocksError, x as buildSlackNativeDataAccessibilityText } from "./group-policy-
|
|
2
|
-
import {
|
|
3
|
-
import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./provider-
|
|
1
|
+
import { C as hasSlackNativeDataBlock, D as markdownToSlackMrkdwnChunks, F as SLACK_TEXT_LIMIT, f as hasSlackReplyStructuredContent, h as resolveSlackReplyBlocks, k as buildSlackBlocksFallbackText, m as resolveSlackReplyBlockResolution, w as isSlackInvalidBlocksError, x as buildSlackNativeDataAccessibilityText } from "./group-policy-Bw-65m3V.js";
|
|
2
|
+
import { d as chunkSlackTextAtHardLimit, r as sendMessageSlack, u as buildSlackNativeDataDeliveryPlan } from "./send-KuTDky7i.js";
|
|
3
|
+
import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./provider-B-HVL5ZE.js";
|
|
4
4
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
5
5
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
6
6
|
import { SILENT_REPLY_TOKEN, chunkMarkdownTextWithMode, isSilentReplyText } from "openclaw/plugin-sdk/reply-chunking";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as createSlackLookupClient } from "./probe-Borhn9PQ.js";
|
|
3
3
|
import { t as collectSlackCursorPages } from "./cursor-pages-DSmTg0su.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import {
|
|
2
|
+
import { a as createSlackLookupClient } from "./probe-Borhn9PQ.js";
|
|
3
3
|
import { t as collectSlackCursorPages } from "./cursor-pages-DSmTg0su.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
2
|
//#region extensions/slack/src/runtime.ts
|
|
3
|
-
const { setRuntime: setSlackRuntime, tryGetRuntime: getOptionalSlackRuntime } = createPluginRuntimeStore({
|
|
3
|
+
const { setRuntime: setSlackRuntime, tryGetRuntime: getOptionalSlackRuntime, getRuntime: getSlackRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "slack",
|
|
5
5
|
errorMessage: "Slack runtime not initialized"
|
|
6
6
|
});
|
|
7
7
|
//#endregion
|
|
8
|
-
export {
|
|
8
|
+
export { getSlackRuntime as n, setSlackRuntime as r, getOptionalSlackRuntime as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./target-parsing-N6lHogYZ.js";
|
|
2
|
-
import "./
|
|
2
|
+
import "./probe-Borhn9PQ.js";
|
|
3
3
|
import "./config-api-Df9a1B8C.js";
|
|
4
4
|
import "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { createActionGate as createActionGate$1, imageResultFromFile, jsonResult, readPositiveIntegerParam, readReactionParams, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as registerSlackPluginHttpRoutes } from "./plugin-routes-CLp4obpN.js";
|
|
2
|
-
import { a as resolveSlackAccount, f as resolveSlackAppToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, p as resolveSlackBotToken, t as listEnabledSlackAccounts } from "./accounts-
|
|
3
|
-
import { n as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { r as
|
|
7
|
-
import {
|
|
8
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
9
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
10
|
-
import { t as monitorSlackProvider } from "./provider-
|
|
11
|
-
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-
|
|
12
|
-
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-
|
|
13
|
-
import "./monitor-
|
|
2
|
+
import { a as resolveSlackAccount, f as resolveSlackAppToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, p as resolveSlackBotToken, t as listEnabledSlackAccounts } from "./accounts-DQEbYKh9.js";
|
|
3
|
+
import { n as resolveSlackGroupRequireMention, r as resolveSlackGroupToolPolicy } from "./group-policy-Bw-65m3V.js";
|
|
4
|
+
import { t as probeSlack } from "./probe-Borhn9PQ.js";
|
|
5
|
+
import { r as setSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
6
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, h as unpinSlackMessage, i as getSlackMemberInfo, l as reactSlackMessage, m as sendSlackMessage, o as listSlackPins, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-CF0tUY5q.js";
|
|
7
|
+
import { r as sendMessageSlack } from "./send-KuTDky7i.js";
|
|
8
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-KTc568SU.js";
|
|
9
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-DeGJf1yp.js";
|
|
10
|
+
import { t as monitorSlackProvider } from "./provider-B-HVL5ZE.js";
|
|
11
|
+
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-DqkRwO3Z.js";
|
|
12
|
+
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-CzUIB7th.js";
|
|
13
|
+
import "./monitor-CNFeF30h.js";
|
|
14
14
|
export { deleteSlackMessage, editSlackMessage, getSlackMemberInfo, handleSlackAction, listEnabledSlackAccounts, listSlackAccountIds, listSlackDirectoryGroupsLive, listSlackDirectoryPeersLive, listSlackEmojis, listSlackPins, listSlackReactions, monitorSlackProvider, pinSlackMessage, probeSlack, reactSlackMessage, readSlackMessages, registerSlackPluginHttpRoutes, removeOwnSlackReactions, removeSlackReaction, resolveDefaultSlackAccountId, resolveSlackAccount, resolveSlackAppToken, resolveSlackBotToken, resolveSlackChannelAllowlist, resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy, resolveSlackUserAllowlist, sendMessageSlack, sendSlackMessage, setSlackRuntime, slackActionRuntime, unpinSlackMessage };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as setSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
2
2
|
export { setSlackRuntime };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { r as formatSlackError } from "./
|
|
2
|
-
import { i as createSlackWebClient } from "./client-D2F6m8CP.js";
|
|
1
|
+
import { c as createSlackWebClient, r as formatSlackError } from "./probe-Borhn9PQ.js";
|
|
3
2
|
import { isRecord, normalizeOptionalString, normalizeStringEntries, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
3
|
//#region extensions/slack/src/scopes.ts
|
|
5
4
|
function collectScopes(value, into) {
|
|
@@ -73,6 +73,7 @@ function collectRuntimeConfigAssignments(params) {
|
|
|
73
73
|
defaults: params.defaults,
|
|
74
74
|
context: params.context,
|
|
75
75
|
topLevelActive: surface.channelEnabled && (!surface.hasExplicitAccounts && baseMode === "relay" || surface.accounts.some(({ account, enabled }) => enabled && resolveAccountMode(account) === "relay" && !hasNestedAuthTokenOverride(account))),
|
|
76
|
+
topLevelInheritedAccountActive: ({ account, enabled }) => enabled && resolveAccountMode(account) === "relay" && !hasNestedAuthTokenOverride(account),
|
|
76
77
|
topInactiveReason: "no enabled Slack relay-mode surface inherits this top-level relay authToken.",
|
|
77
78
|
accountActive: ({ account, enabled }) => enabled && resolveAccountMode(account) === "relay",
|
|
78
79
|
accountInactiveReason: "Slack account is disabled or not running in relay mode."
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-
|
|
1
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries, t as channelSecrets } from "./secret-contract-DxmvbxBF.js";
|
|
2
2
|
export { channelSecrets, collectRuntimeConfigAssignments, secretTargetRegistryEntries };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as resolveSlackAccount, l as resolveSlackOperationToken
|
|
1
|
+
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-DQEbYKh9.js";
|
|
2
2
|
import { i as parseSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-N6lHogYZ.js";
|
|
3
|
-
import { A as buildSlackCompleteBlocksFallbackText, C as hasSlackNativeDataBlock, D as markdownToSlackMrkdwnChunks, E as chunkSlackMrkdwnText, F as SLACK_TEXT_LIMIT, P as SLACK_MESSAGE_TEXT_HARD_LIMIT, S as createSlackNativeDataBaseTextConsumer, T as stripSlackNativeDataBlocks,
|
|
3
|
+
import { A as buildSlackCompleteBlocksFallbackText, C as hasSlackNativeDataBlock, D as markdownToSlackMrkdwnChunks, E as chunkSlackMrkdwnText, F as SLACK_TEXT_LIMIT, P as SLACK_MESSAGE_TEXT_HARD_LIMIT, S as createSlackNativeDataBaseTextConsumer, T as stripSlackNativeDataBlocks, b as appendSlackNativeDataPlainTextFallback, et as validateSlackBlocksArray, i as assertSlackDirectSendAllowed, j as renderSlackBlockFallbackText, w as isSlackInvalidBlocksError, x as buildSlackNativeDataAccessibilityText, z as truncateSlackText } from "./group-policy-Bw-65m3V.js";
|
|
4
4
|
import { n as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-DUGhaYKq.js";
|
|
5
|
-
import {
|
|
6
|
-
import { t as getOptionalSlackRuntime } from "./runtime-
|
|
7
|
-
import { i as loadOutboundMediaFromUrl } from "./runtime-api-
|
|
5
|
+
import { c as createSlackWebClient, d as getSlackWriteClient, s as createSlackTokenCacheKey } from "./probe-Borhn9PQ.js";
|
|
6
|
+
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
7
|
+
import { i as loadOutboundMediaFromUrl } from "./runtime-api-BFfNpzDe.js";
|
|
8
8
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
10
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -389,6 +389,7 @@ async function uploadSlackFile(params) {
|
|
|
389
389
|
...contentType ? { headers: { "Content-Type": contentType } } : {},
|
|
390
390
|
body: new Uint8Array(buffer)
|
|
391
391
|
},
|
|
392
|
+
timeoutMs: SLACK_UPLOAD_POST_TIMEOUT_MS,
|
|
392
393
|
signal: uploadTimeoutSignal,
|
|
393
394
|
requireHttps: uploadTransport.requireHttps,
|
|
394
395
|
policy: uploadTransport.policy,
|
|
@@ -545,6 +546,22 @@ function resolvePostedMessageThreadTs(response) {
|
|
|
545
546
|
const threadTs = response.message?.thread_ts;
|
|
546
547
|
return typeof threadTs === "string" ? normalizeSlackThreadTsCandidate(threadTs) : void 0;
|
|
547
548
|
}
|
|
549
|
+
async function updateMessageSlack(params) {
|
|
550
|
+
const account = resolveSlackAccount({
|
|
551
|
+
cfg: requireRuntimeConfig(params.cfg, "Slack update"),
|
|
552
|
+
accountId: params.accountId
|
|
553
|
+
});
|
|
554
|
+
await getSlackWriteClient(resolveToken({
|
|
555
|
+
accountId: account.accountId,
|
|
556
|
+
fallbackToken: account.botToken,
|
|
557
|
+
fallbackSource: account.botTokenSource
|
|
558
|
+
})).chat.update({
|
|
559
|
+
channel: params.channelId,
|
|
560
|
+
ts: params.messageTs,
|
|
561
|
+
text: truncateSlackText(params.text, SLACK_TEXT_LIMIT),
|
|
562
|
+
blocks: validateSlackBlocksArray(params.blocks)
|
|
563
|
+
});
|
|
564
|
+
}
|
|
548
565
|
function createSlackSendReceipt(params) {
|
|
549
566
|
return createMessageReceiptFromOutboundResults({
|
|
550
567
|
results: params.platformMessageIds.map((messageId) => messageId.trim()).filter((messageId) => messageId && messageId !== "unknown" && messageId !== "suppressed").map((messageId) => {
|
|
@@ -560,12 +577,12 @@ function createSlackSendReceipt(params) {
|
|
|
560
577
|
});
|
|
561
578
|
}
|
|
562
579
|
function resolveToken(params) {
|
|
563
|
-
const explicit =
|
|
580
|
+
const explicit = normalizeOptionalString(params.explicit);
|
|
564
581
|
if (explicit) return explicit;
|
|
565
|
-
const fallback =
|
|
582
|
+
const fallback = normalizeOptionalString(params.fallbackToken);
|
|
566
583
|
if (!fallback) {
|
|
567
|
-
logVerbose(`slack send: missing
|
|
568
|
-
throw new Error(`Slack
|
|
584
|
+
logVerbose(`slack send: missing write token for account=${params.accountId} explicit=${Boolean(params.explicit)} source=${params.fallbackSource ?? "unknown"}`);
|
|
585
|
+
throw new Error(`Slack write token missing for account "${params.accountId}".`);
|
|
569
586
|
}
|
|
570
587
|
return fallback;
|
|
571
588
|
}
|
|
@@ -969,8 +986,8 @@ async function sendMessageSlack(to, message, opts) {
|
|
|
969
986
|
const token = enterpriseDelivery ? SLACK_ENTERPRISE_LISTENER_QUEUE_CREDENTIAL : resolveToken({
|
|
970
987
|
explicit: opts.token,
|
|
971
988
|
accountId: account.accountId,
|
|
972
|
-
fallbackToken: account
|
|
973
|
-
fallbackSource: account.botTokenSource
|
|
989
|
+
fallbackToken: resolveSlackOperationToken(account, "write"),
|
|
990
|
+
fallbackSource: account.identity === "user" ? account.userTokenSource : account.botTokenSource
|
|
974
991
|
});
|
|
975
992
|
const recipient = enterpriseDelivery ? parseEnterpriseEventRecipient(to) : parseRecipient(to);
|
|
976
993
|
const queueKey = createSlackSendQueueKey({
|
|
@@ -1263,4 +1280,4 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1263
1280
|
};
|
|
1264
1281
|
}
|
|
1265
1282
|
//#endregion
|
|
1266
|
-
export {
|
|
1283
|
+
export { updateMessageSlack as a, hasSlackThreadParticipationWithPersistence as c, chunkSlackTextAtHardLimit as d, setSlackDefaultSendIdentity as i, recordSlackThreadParticipation as l, resolveSlackDmChannelId as n, clearSlackThreadParticipationCache as o, sendMessageSlack as r, hasSlackThreadParticipation as s, reconcileSlackUnknownSend as t, buildSlackNativeDataDeliveryPlan as u };
|