@openclaw/slack 2026.5.31-beta.2 → 2026.5.31-beta.4
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/{action-runtime-DEztkt37.js → action-runtime-Cg2tZbNu.js} +3 -3
- package/dist/action-runtime.runtime-Cy2yYwZP.js +2 -0
- package/dist/{actions-BA_6yvPC.js → actions-CkiDNtJN.js} +2 -2
- package/dist/{actions.runtime-BNL71SN3.js → actions.runtime-BCrYXk_p.js} +1 -1
- package/dist/api.js +6 -6
- package/dist/{approval-handler.runtime-D0rHmHTC.js → approval-handler.runtime-D89odl0s.js} +3 -3
- package/dist/{channel-ClgouPGI.js → channel-C3A408fP.js} +13 -13
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-DvU_3G7a.js → channel.setup-Bwe4Z6kB.js} +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/{doctor-contract-DpGLNqS3.js → doctor-contract-XL6HeNCb.js} +2 -2
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{monitor-D5FVBchh.js → monitor-NFID7817.js} +3 -3
- package/dist/{outbound-adapter-BxKw6eWi.js → outbound-adapter-C0WSWc70.js} +2 -2
- package/dist/{pipeline.runtime-Bo6reKXg.js → pipeline.runtime-DikPOwwv.js} +27 -17
- package/dist/{policy-BBDU-PQK.js → policy-Bb46UkJW.js} +1 -1
- package/dist/{provider-DNfFBEzl.js → provider-B4QaoPTL.js} +35 -25
- package/dist/{replies-BmFpkBXm.js → replies-BPnv9QT6.js} +2 -2
- package/dist/runtime-api.js +6 -6
- package/dist/{send-zvrcUvp2.js → send-DzphzfbK.js} +6 -3
- package/dist/send.runtime-2BUc6y7a.js +2 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-95xI4u2U.js → setup-surface-CMNvy84L.js} +1 -1
- package/dist/{shared-D5tOdKwQ.js → shared-VMk8NGYC.js} +1 -1
- package/dist/{slash-dispatch.runtime-BKo3qtpZ.js → slash-dispatch.runtime-Dr5g7nrJ.js} +1 -1
- package/dist/{thread-ts-NSVqWybn.js → thread-ts-CzxxhSE5.js} +28 -7
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/action-runtime.runtime-uN2B3l57.js +0 -2
- package/dist/send.runtime-iCVpfyB_.js +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as resolveSlackChannelId, r as parseSlackTarget } from "./target-parsing-C7eeWg7M.js";
|
|
2
2
|
import "./targets-nUqxHGgg.js";
|
|
3
|
-
import { a as parseSlackBlocksInput } from "./thread-ts-
|
|
3
|
+
import { a as parseSlackBlocksInput } from "./thread-ts-CzxxhSE5.js";
|
|
4
4
|
import { a as readPositiveIntegerParam, c as withNormalizedTimestamp, n as imageResultFromFile, o as readReactionParams, r as jsonResult, s as readStringParam, t as createActionGate } from "./runtime-api-BpGQDSTg.js";
|
|
5
|
-
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
5
|
+
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-Bb46UkJW.js";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { isSingleUseReplyToMode } from "openclaw/plugin-sdk/reply-reference";
|
|
8
8
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
@@ -30,7 +30,7 @@ function sameSlackChannelTarget(targetChannel, currentChannelId) {
|
|
|
30
30
|
let slackActionsRuntimePromise;
|
|
31
31
|
let slackAccountsRuntimePromise;
|
|
32
32
|
function loadSlackActionsRuntime() {
|
|
33
|
-
slackActionsRuntimePromise ??= import("./actions.runtime-
|
|
33
|
+
slackActionsRuntimePromise ??= import("./actions.runtime-BCrYXk_p.js");
|
|
34
34
|
return slackActionsRuntimePromise;
|
|
35
35
|
}
|
|
36
36
|
function loadSlackAccountsRuntime() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
2
|
import { a as resolveSlackAccount, d as resolveSlackBotToken } from "./accounts-f6Xcv9Vi.js";
|
|
3
|
-
import { b as truncateSlackText, o as validateSlackBlocksArray, s as SLACK_TEXT_LIMIT } from "./thread-ts-
|
|
3
|
+
import { b as truncateSlackText, o as validateSlackBlocksArray, s as SLACK_TEXT_LIMIT } from "./thread-ts-CzxxhSE5.js";
|
|
4
4
|
import { a as getSlackWriteClient, r as createSlackWebClient } from "./client-qvqS9fQM.js";
|
|
5
|
-
import { c as buildSlackBlocksFallbackText, t as sendMessageSlack } from "./send-
|
|
5
|
+
import { c as buildSlackBlocksFallbackText, t as sendMessageSlack } from "./send-DzphzfbK.js";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
8
8
|
import { logVerbose, logVerbose as logVerbose$1 } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
1
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-CkiDNtJN.js";
|
|
2
2
|
export { deleteSlackMessage, downloadSlackFile, editSlackMessage, getSlackMemberInfo, listSlackEmojis, listSlackPins, listSlackReactions, pinSlackMessage, reactSlackMessage, readSlackMessages, removeOwnSlackReactions, removeSlackReaction, sendSlackMessage, unpinSlackMessage };
|
package/dist/api.js
CHANGED
|
@@ -3,16 +3,16 @@ import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resol
|
|
|
3
3
|
import { t as inspectSlackAccount } from "./account-inspect-CdGk6R7l.js";
|
|
4
4
|
import { i as resolveSlackChannelId, n as normalizeSlackMessagingTarget, r as parseSlackTarget, t as looksLikeSlackTargetId } from "./target-parsing-C7eeWg7M.js";
|
|
5
5
|
import "./targets-nUqxHGgg.js";
|
|
6
|
-
import { a as resolveSlackAutoThreadId, i as resolveSlackChannelType, n as buildSlackThreadingToolContext, r as resetSlackChannelTypeCacheForTest, t as slackPlugin } from "./channel-
|
|
7
|
-
import { _ as buildSlackInteractiveBlocks, a as parseSlackBlocksInput, c as resolveSlackGroupRequireMention, d as normalizeAllowList, f as normalizeAllowListLower, g as resolveSlackUserAllowed, h as resolveSlackAllowListMatch, i as SLACK_MAX_BLOCKS, l as resolveSlackGroupToolPolicy, m as normalizeSlackSlug, o as validateSlackBlocksArray, p as normalizeSlackAllowOwnerEntry, u as allowListMatches, v as buildSlackPresentationBlocks } from "./thread-ts-
|
|
6
|
+
import { a as resolveSlackAutoThreadId, i as resolveSlackChannelType, n as buildSlackThreadingToolContext, r as resetSlackChannelTypeCacheForTest, t as slackPlugin } from "./channel-C3A408fP.js";
|
|
7
|
+
import { _ as buildSlackInteractiveBlocks, a as parseSlackBlocksInput, c as resolveSlackGroupRequireMention, d as normalizeAllowList, f as normalizeAllowListLower, g as resolveSlackUserAllowed, h as resolveSlackAllowListMatch, i as SLACK_MAX_BLOCKS, l as resolveSlackGroupToolPolicy, m as normalizeSlackSlug, o as validateSlackBlocksArray, p as normalizeSlackAllowOwnerEntry, u as allowListMatches, v as buildSlackPresentationBlocks } from "./thread-ts-CzxxhSE5.js";
|
|
8
8
|
import { n as extractSlackToolSend, r as listSlackMessageActions } from "./message-tool-api-B9M0zzlQ.js";
|
|
9
9
|
import { n as isSlackInteractiveRepliesEnabled, r as parseSlackOptionsLine, t as compileSlackInteractiveReplies } from "./interactive-replies-DrBq4Mld.js";
|
|
10
10
|
import { a as getSlackWriteClient, c as resolveSlackWebClientOptions, i as createSlackWriteClient, l as resolveSlackWriteClientOptions, n as createSlackTokenCacheKey, o as SLACK_DEFAULT_RETRY_OPTIONS, r as createSlackWebClient, s as SLACK_WRITE_RETRY_OPTIONS, t as clearSlackWriteClientCacheForTest } from "./client-qvqS9fQM.js";
|
|
11
|
-
import { t as slackSetupPlugin } from "./channel.setup-
|
|
12
|
-
import { a as recordSlackThreadParticipation, n as clearSlackThreadParticipationCache, r as hasSlackThreadParticipation } from "./send-
|
|
13
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
11
|
+
import { t as slackSetupPlugin } from "./channel.setup-Bwe4Z6kB.js";
|
|
12
|
+
import { a as recordSlackThreadParticipation, n as clearSlackThreadParticipationCache, r as hasSlackThreadParticipation } from "./send-DzphzfbK.js";
|
|
13
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-CkiDNtJN.js";
|
|
14
14
|
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-8UPAEyNg.js";
|
|
15
15
|
import { t as probeSlack } from "./probe-DczaQTdi.js";
|
|
16
16
|
import { t as collectSlackSecurityAuditFindings } from "./security-audit-CikQhBUY.js";
|
|
17
|
-
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-
|
|
17
|
+
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-B4QaoPTL.js";
|
|
18
18
|
export { SLACK_DEFAULT_RETRY_OPTIONS, SLACK_MAX_BLOCKS, SLACK_WRITE_RETRY_OPTIONS, resetSlackChannelTypeCacheForTest as __resetSlackChannelTypeCacheForTest, resetSlackChannelTypeCacheForTest, allowListMatches, buildSlackInteractiveBlocks, buildSlackPresentationBlocks, buildSlackThreadingToolContext, clearSlackThreadParticipationCache, clearSlackWriteClientCacheForTest, collectSlackSecurityAuditFindings, compileSlackInteractiveReplies, createSlackTokenCacheKey, createSlackWebClient, createSlackWriteClient, deleteSlackMessage, downloadSlackFile, editSlackMessage, extractSlackToolSend, getSlackMemberInfo, getSlackWriteClient, handleSlackHttpRequest, hasSlackThreadParticipation, inspectSlackAccount, isSlackInteractiveRepliesEnabled, listEnabledSlackAccounts, listSlackAccountIds, listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig, listSlackEmojis, listSlackMessageActions, listSlackPins, listSlackReactions, looksLikeSlackTargetId, mergeSlackAccountConfig, normalizeAllowList, normalizeAllowListLower, normalizeSlackAllowOwnerEntry, normalizeSlackMessagingTarget, normalizeSlackSlug, normalizeSlackWebhookPath, parseSlackBlocksInput, parseSlackOptionsLine, parseSlackTarget, pinSlackMessage, probeSlack, reactSlackMessage, readSlackMessages, recordSlackThreadParticipation, registerSlackHttpHandler, removeOwnSlackReactions, removeSlackReaction, resolveDefaultSlackAccountId, resolveSlackAccount, resolveSlackAllowListMatch, resolveSlackAutoThreadId, resolveSlackChannelId, resolveSlackChannelType, resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy, resolveSlackReplyToMode, resolveSlackRuntimeGroupPolicy, resolveSlackUserAllowed, resolveSlackWebClientOptions, resolveSlackWriteClientOptions, sendSlackMessage, slackPlugin, slackSetupPlugin, unpinSlackMessage, validateSlackBlocksArray };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as isSlackAnyNativeApprovalClientEnabled, T as shouldHandleSlackNativeApprovalRequest, b as truncateSlackText, j as normalizeSlackApproverId, r as resolveSlackReplyBlocks, w as resolveSlackApprovalKind } from "./thread-ts-
|
|
2
|
-
import { t as sendMessageSlack } from "./send-
|
|
1
|
+
import { C as isSlackAnyNativeApprovalClientEnabled, T as shouldHandleSlackNativeApprovalRequest, b as truncateSlackText, j as normalizeSlackApproverId, r as resolveSlackReplyBlocks, w as resolveSlackApprovalKind } from "./thread-ts-CzxxhSE5.js";
|
|
2
|
+
import { t as sendMessageSlack } from "./send-DzphzfbK.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
5
|
-
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
6
5
|
import { buildApprovalPresentationFromActionDescriptors } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
6
|
+
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
7
7
|
import { createChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
|
|
8
8
|
//#region extensions/slack/src/approval-handler.runtime.ts
|
|
9
9
|
const SLACK_CONTEXT_ELEMENTS_MAX = 10;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resolveSlackReplyToMode, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom } from "./accounts-f6Xcv9Vi.js";
|
|
2
2
|
import { i as resolveSlackChannelId, n as normalizeSlackMessagingTarget, r as parseSlackTarget, t as looksLikeSlackTargetId } from "./target-parsing-C7eeWg7M.js";
|
|
3
3
|
import "./targets-nUqxHGgg.js";
|
|
4
|
-
import { A as isSlackExecApprovalClientEnabled, C as isSlackAnyNativeApprovalClientEnabled, D as isSlackApprovalAuthorizedSender, E as getSlackApprovalApprovers, M as resolveSlackExecApprovalTarget, N as shouldSuppressLocalSlackExecApprovalPrompt, O as getSlackExecApprovalApprovers, T as shouldHandleSlackNativeApprovalRequest, _ as buildSlackInteractiveBlocks, c as resolveSlackGroupRequireMention, f as normalizeAllowListLower, k as isSlackExecApprovalAuthorizedSender, l as resolveSlackGroupToolPolicy, n as resolveSlackThreadTsValue, r as resolveSlackReplyBlocks, s as SLACK_TEXT_LIMIT, t as normalizeSlackThreadTsCandidate, v as buildSlackPresentationBlocks, w as resolveSlackApprovalKind, y as resolveSlackInteractiveBlockOffsets } from "./thread-ts-
|
|
4
|
+
import { A as isSlackExecApprovalClientEnabled, C as isSlackAnyNativeApprovalClientEnabled, D as isSlackApprovalAuthorizedSender, E as getSlackApprovalApprovers, M as resolveSlackExecApprovalTarget, N as shouldSuppressLocalSlackExecApprovalPrompt, O as getSlackExecApprovalApprovers, T as shouldHandleSlackNativeApprovalRequest, _ as buildSlackInteractiveBlocks, c as resolveSlackGroupRequireMention, f as normalizeAllowListLower, k as isSlackExecApprovalAuthorizedSender, l as resolveSlackGroupToolPolicy, n as resolveSlackThreadTsValue, r as resolveSlackReplyBlocks, s as SLACK_TEXT_LIMIT, t as normalizeSlackThreadTsCandidate, v as buildSlackPresentationBlocks, w as resolveSlackApprovalKind, y as resolveSlackInteractiveBlockOffsets } from "./thread-ts-CzxxhSE5.js";
|
|
5
5
|
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-B9M0zzlQ.js";
|
|
6
6
|
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-DrBq4Mld.js";
|
|
7
7
|
import { d as PAIRING_APPROVED_MESSAGE, m as resolveConfiguredFromRequiredCredentialStatuses, p as projectCredentialSnapshotFields, r as createSlackWebClient, u as DEFAULT_ACCOUNT_ID } from "./client-qvqS9fQM.js";
|
|
8
8
|
import { t as getOptionalSlackRuntime } from "./runtime-BOk7xkOl.js";
|
|
9
|
-
import { i as slackSecurityAdapter, n as isSlackPluginAccountConfigured, r as slackConfigAdapter, t as createSlackPluginBase } from "./shared-
|
|
9
|
+
import { i as slackSecurityAdapter, n as isSlackPluginAccountConfigured, r as slackConfigAdapter, t as createSlackPluginBase } from "./shared-VMk8NGYC.js";
|
|
10
10
|
import { i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, r as slackSetupAdapter } from "./setup-core-POfI_bgP.js";
|
|
11
11
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
12
12
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -231,7 +231,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
231
231
|
approvalKind: resolveSlackApprovalKind(request),
|
|
232
232
|
request
|
|
233
233
|
}),
|
|
234
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
234
|
+
load: async () => (await import("./approval-handler.runtime-D89odl0s.js")).slackApprovalNativeRuntime
|
|
235
235
|
})
|
|
236
236
|
});
|
|
237
237
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.native;
|
|
@@ -430,7 +430,7 @@ async function handleSlackMessageAction(params) {
|
|
|
430
430
|
//#region extensions/slack/src/channel-actions.ts
|
|
431
431
|
let slackActionRuntimePromise$1;
|
|
432
432
|
async function loadSlackActionRuntime$1() {
|
|
433
|
-
slackActionRuntimePromise$1 ??= import("./action-runtime.runtime-
|
|
433
|
+
slackActionRuntimePromise$1 ??= import("./action-runtime.runtime-Cy2yYwZP.js");
|
|
434
434
|
return await slackActionRuntimePromise$1;
|
|
435
435
|
}
|
|
436
436
|
function resolveSlackActionContext(params) {
|
|
@@ -560,9 +560,9 @@ const EXTENSION_SHARED_MODULE_ID = "openclaw/plugin-sdk/extension-shared";
|
|
|
560
560
|
const TARGET_RESOLVER_RUNTIME_MODULE_ID = "openclaw/plugin-sdk/target-resolver-runtime";
|
|
561
561
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import(EXTENSION_SHARED_MODULE_ID));
|
|
562
562
|
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import(TARGET_RESOLVER_RUNTIME_MODULE_ID));
|
|
563
|
-
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-
|
|
563
|
+
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-CMNvy84L.js"));
|
|
564
564
|
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-Q1VjNpWb.js"));
|
|
565
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-
|
|
565
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-C0WSWc70.js"));
|
|
566
566
|
async function resolveSlackHandleAction() {
|
|
567
567
|
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? (await loadSlackActionRuntime()).handleSlackAction;
|
|
568
568
|
}
|
|
@@ -586,11 +586,11 @@ const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./d
|
|
|
586
586
|
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-DIxJRl0F.js").then((n) => n.n));
|
|
587
587
|
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-B3vczJHE.js").then((n) => n.n));
|
|
588
588
|
async function loadSlackActionRuntime() {
|
|
589
|
-
slackActionRuntimePromise ??= import("./action-runtime.runtime-
|
|
589
|
+
slackActionRuntimePromise ??= import("./action-runtime.runtime-Cy2yYwZP.js");
|
|
590
590
|
return await slackActionRuntimePromise;
|
|
591
591
|
}
|
|
592
592
|
async function loadSlackSendRuntime() {
|
|
593
|
-
slackSendRuntimePromise ??= import("./send.runtime-
|
|
593
|
+
slackSendRuntimePromise ??= import("./send.runtime-2BUc6y7a.js");
|
|
594
594
|
return await slackSendRuntimePromise;
|
|
595
595
|
}
|
|
596
596
|
async function loadSlackProbeModule() {
|
|
@@ -598,7 +598,7 @@ async function loadSlackProbeModule() {
|
|
|
598
598
|
return await slackProbeModulePromise;
|
|
599
599
|
}
|
|
600
600
|
async function loadSlackMonitorModule() {
|
|
601
|
-
slackMonitorModulePromise ??= import("./monitor-
|
|
601
|
+
slackMonitorModulePromise ??= import("./monitor-NFID7817.js").then((n) => n.t);
|
|
602
602
|
return await slackMonitorModulePromise;
|
|
603
603
|
}
|
|
604
604
|
async function loadSlackDirectoryLiveModule() {
|
|
@@ -937,9 +937,9 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
937
937
|
token: normalizeOptionalString(account.config.userToken) ?? normalizeOptionalString(account.botToken),
|
|
938
938
|
inputs,
|
|
939
939
|
missingTokenNote: "missing Slack token",
|
|
940
|
-
resolveWithToken: async ({ token, inputs }) => (await loadSlackResolveChannelsModule()).resolveSlackChannelAllowlist({
|
|
940
|
+
resolveWithToken: async ({ token, inputs: inputsValue }) => (await loadSlackResolveChannelsModule()).resolveSlackChannelAllowlist({
|
|
941
941
|
token,
|
|
942
|
-
entries:
|
|
942
|
+
entries: inputsValue
|
|
943
943
|
}),
|
|
944
944
|
mapResolved: (entry) => toResolvedTarget(entry, entry.archived ? "archived" : void 0)
|
|
945
945
|
});
|
|
@@ -947,9 +947,9 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
947
947
|
token: normalizeOptionalString(account.config.userToken) ?? normalizeOptionalString(account.botToken),
|
|
948
948
|
inputs,
|
|
949
949
|
missingTokenNote: "missing Slack token",
|
|
950
|
-
resolveWithToken: async ({ token, inputs }) => (await loadSlackResolveUsersModule()).resolveSlackUserAllowlist({
|
|
950
|
+
resolveWithToken: async ({ token, inputs: inputsLocal }) => (await loadSlackResolveUsersModule()).resolveSlackUserAllowlist({
|
|
951
951
|
token,
|
|
952
|
-
entries:
|
|
952
|
+
entries: inputsLocal
|
|
953
953
|
}),
|
|
954
954
|
mapResolved: (entry) => toResolvedTarget(entry, entry.note)
|
|
955
955
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackPlugin } from "./channel-
|
|
1
|
+
import { t as slackPlugin } from "./channel-C3A408fP.js";
|
|
2
2
|
export { slackPlugin };
|
|
@@ -4,7 +4,7 @@ import { t as SlackChannelConfigSchema } from "./config-schema-BjAjs8_6.js";
|
|
|
4
4
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
5
5
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
6
6
|
//#region extensions/slack/src/channel.setup.ts
|
|
7
|
-
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-
|
|
7
|
+
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-CMNvy84L.js")).slackSetupWizard }));
|
|
8
8
|
const slackSetupConfigAdapter = createScopedChannelConfigAdapter({
|
|
9
9
|
sectionKey: SLACK_CHANNEL,
|
|
10
10
|
listAccountIds: listSlackAccountIds,
|
package/dist/contract-api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-XL6HeNCb.js";
|
|
2
2
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-g_PPWuoD.js";
|
|
3
3
|
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-8UPAEyNg.js";
|
|
4
4
|
import { t as collectSlackSecurityAuditFindings } from "./security-audit-CikQhBUY.js";
|
|
@@ -70,8 +70,8 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
70
70
|
changes: []
|
|
71
71
|
};
|
|
72
72
|
const changes = [];
|
|
73
|
-
let updated
|
|
74
|
-
let changed
|
|
73
|
+
let updated;
|
|
74
|
+
let changed;
|
|
75
75
|
const aliases = normalizeLegacyChannelAliases({
|
|
76
76
|
entry: rawEntry,
|
|
77
77
|
pathPrefix: "channels.slack",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-XL6HeNCb.js";
|
|
2
2
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { t as monitorSlackProvider, y as buildSlackSlashCommandMatcher } from "./provider-
|
|
3
|
-
import { t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
4
|
-
import { o as resolveSlackThreadTs } from "./replies-
|
|
2
|
+
import { t as monitorSlackProvider, y as buildSlackSlashCommandMatcher } from "./provider-B4QaoPTL.js";
|
|
3
|
+
import { t as isSlackChannelAllowedByPolicy } from "./policy-Bb46UkJW.js";
|
|
4
|
+
import { o as resolveSlackThreadTs } from "./replies-BPnv9QT6.js";
|
|
5
5
|
//#region extensions/slack/src/monitor.ts
|
|
6
6
|
var monitor_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
buildSlackSlashCommandMatcher: () => buildSlackSlashCommandMatcher,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as buildSlackInteractiveBlocks, a as parseSlackBlocksInput, n as resolveSlackThreadTsValue, s as SLACK_TEXT_LIMIT, v as buildSlackPresentationBlocks, y as resolveSlackInteractiveBlockOffsets } from "./thread-ts-
|
|
1
|
+
import { _ as buildSlackInteractiveBlocks, a as parseSlackBlocksInput, n as resolveSlackThreadTsValue, s as SLACK_TEXT_LIMIT, v as buildSlackPresentationBlocks, y as resolveSlackInteractiveBlockOffsets } from "./thread-ts-CzxxhSE5.js";
|
|
2
2
|
import { t as compileSlackInteractiveReplies } from "./interactive-replies-DrBq4Mld.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -9,7 +9,7 @@ import { resolvePayloadMediaUrls, sendPayloadMediaSequenceAndFinalize, sendTextM
|
|
|
9
9
|
const SLACK_MAX_BLOCKS = 50;
|
|
10
10
|
let slackSendRuntimePromise;
|
|
11
11
|
async function loadSlackSendRuntime() {
|
|
12
|
-
slackSendRuntimePromise ??= import("./send.runtime-
|
|
12
|
+
slackSendRuntimePromise ??= import("./send.runtime-2BUc6y7a.js");
|
|
13
13
|
return await slackSendRuntimePromise;
|
|
14
14
|
}
|
|
15
15
|
function resolveRenderedInteractiveBlocks(interactive, previousBlocks) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { l as resolveSlackReplyToMode } from "./accounts-f6Xcv9Vi.js";
|
|
2
2
|
import { r as parseSlackTarget } from "./target-parsing-C7eeWg7M.js";
|
|
3
3
|
import "./targets-nUqxHGgg.js";
|
|
4
|
-
import { b as truncateSlackText, f as normalizeAllowListLower, h as resolveSlackAllowListMatch, p as normalizeSlackAllowOwnerEntry, s as SLACK_TEXT_LIMIT } from "./thread-ts-
|
|
4
|
+
import { b as truncateSlackText, f as normalizeAllowListLower, h as resolveSlackAllowListMatch, p as normalizeSlackAllowOwnerEntry, s as SLACK_TEXT_LIMIT } from "./thread-ts-CzxxhSE5.js";
|
|
5
5
|
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-DrBq4Mld.js";
|
|
6
6
|
import { n as resolveSlackNativeStreaming, r as resolveSlackStreamingMode, t as mapStreamingModeToSlackLegacyDraftStreamMode } from "./streaming-compat-DjlgH-Be.js";
|
|
7
|
-
import { a as recordSlackThreadParticipation, i as hasSlackThreadParticipationWithPersistence, s as normalizeSlackOutboundText, t as sendMessageSlack } from "./send-
|
|
8
|
-
import { _ as resolveSlackThreadStarter, b as buildSlackEditTextPayload, f as removeSlackReaction, g as resolveSlackThreadHistory, l as reactSlackMessage, r as editSlackMessage, t as deleteSlackMessage, y as formatSlackFileReference } from "./actions-
|
|
7
|
+
import { a as recordSlackThreadParticipation, i as hasSlackThreadParticipationWithPersistence, s as normalizeSlackOutboundText, t as sendMessageSlack } from "./send-DzphzfbK.js";
|
|
8
|
+
import { _ as resolveSlackThreadStarter, b as buildSlackEditTextPayload, f as removeSlackReaction, g as resolveSlackThreadHistory, l as reactSlackMessage, r as editSlackMessage, t as deleteSlackMessage, y as formatSlackFileReference } from "./actions-CkiDNtJN.js";
|
|
9
9
|
import { t as formatSlackError } from "./errors-CZtmv-h0.js";
|
|
10
|
-
import { _ as resolveStorePath, a as escapeSlackMrkdwn, b as stripSlackMentionsForCommandDetection, c as authorizeSlackBotRoomMessage, d as buildSlackAssistantThreadMetadata, f as parseSlackAssistantThreadMetadata, g as resolveChannelContextVisibilityMode, h as readSessionUpdatedAt, i as authorizeSlackDirectMessage, l as resolveSlackCommandIngress, m as resolveSlackChatType, o as recordInboundSession, p as normalizeSlackChannelType, r as resolveSlackRoomContextHints, s as resolveConversationLabel$1, u as resolveSlackEffectiveAllowFrom, v as updateLastRoute } from "./provider-
|
|
11
|
-
import { n as resolveSlackChannelConfig } from "./policy-
|
|
12
|
-
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, t as createSlackReplyDeliveryPlan } from "./replies-
|
|
10
|
+
import { _ as resolveStorePath, a as escapeSlackMrkdwn, b as stripSlackMentionsForCommandDetection, c as authorizeSlackBotRoomMessage, d as buildSlackAssistantThreadMetadata, f as parseSlackAssistantThreadMetadata, g as resolveChannelContextVisibilityMode, h as readSessionUpdatedAt, i as authorizeSlackDirectMessage, l as resolveSlackCommandIngress, m as resolveSlackChatType, o as recordInboundSession, p as normalizeSlackChannelType, r as resolveSlackRoomContextHints, s as resolveConversationLabel$1, u as resolveSlackEffectiveAllowFrom, v as updateLastRoute } from "./provider-B4QaoPTL.js";
|
|
11
|
+
import { n as resolveSlackChannelConfig } from "./policy-Bb46UkJW.js";
|
|
12
|
+
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, t as createSlackReplyDeliveryPlan } from "./replies-BPnv9QT6.js";
|
|
13
13
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
14
14
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
15
15
|
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftGate, createDraftStreamLoop, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, resolveAgentOutboundIdentity, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelProgressDraftConfig, resolveChannelProgressDraftMaxLineChars, resolveChannelProgressDraftMaxLines, resolveChannelProgressDraftRender, resolveChannelStreamingBlockEnabled, resolveChannelStreamingNativeTransport, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -943,7 +943,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
943
943
|
},
|
|
944
944
|
onStartError: (err) => {
|
|
945
945
|
logTypingFailure({
|
|
946
|
-
log: (
|
|
946
|
+
log: (messageValue) => runtime.error?.(danger(messageValue)),
|
|
947
947
|
channel: "slack",
|
|
948
948
|
action: "start",
|
|
949
949
|
target: typingTarget,
|
|
@@ -952,7 +952,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
952
952
|
},
|
|
953
953
|
onStopError: (err) => {
|
|
954
954
|
logTypingFailure({
|
|
955
|
-
log: (
|
|
955
|
+
log: (messageLocal) => runtime.error?.(danger(messageLocal)),
|
|
956
956
|
channel: "slack",
|
|
957
957
|
action: "stop",
|
|
958
958
|
target: typingTarget,
|
|
@@ -1516,7 +1516,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1516
1516
|
return session;
|
|
1517
1517
|
})();
|
|
1518
1518
|
nativeProgressStreamStartPromise = startPromise;
|
|
1519
|
-
let startedSession
|
|
1519
|
+
let startedSession;
|
|
1520
1520
|
try {
|
|
1521
1521
|
startedSession = await startPromise;
|
|
1522
1522
|
} finally {
|
|
@@ -1565,8 +1565,8 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1565
1565
|
if (!line || !normalized) {
|
|
1566
1566
|
if (streamMode !== "status_final") return;
|
|
1567
1567
|
const alreadyStarted = progressDraftGate.hasStarted;
|
|
1568
|
-
await progressDraftGate.noteWork();
|
|
1569
|
-
if (alreadyStarted && progressDraftGate.hasStarted) await refreshStartedProgressDraft();
|
|
1568
|
+
const progressActive = await progressDraftGate.noteWork();
|
|
1569
|
+
if ((alreadyStarted || progressActive) && progressDraftGate.hasStarted) await refreshStartedProgressDraft();
|
|
1570
1570
|
return;
|
|
1571
1571
|
}
|
|
1572
1572
|
if (streamMode !== "status_final") {
|
|
@@ -1589,12 +1589,15 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1589
1589
|
}
|
|
1590
1590
|
if (useNativeProgressStreaming) {
|
|
1591
1591
|
if (progressDraftGate.hasStarted) await updateNativeProgressStream();
|
|
1592
|
-
else
|
|
1592
|
+
else {
|
|
1593
|
+
await progressDraftGate.startNow();
|
|
1594
|
+
if (progressDraftGate.hasStarted) await updateNativeProgressStream();
|
|
1595
|
+
}
|
|
1593
1596
|
return;
|
|
1594
1597
|
}
|
|
1595
1598
|
const alreadyStarted = progressDraftGate.hasStarted;
|
|
1596
|
-
await progressDraftGate.noteWork();
|
|
1597
|
-
if (alreadyStarted && progressDraftGate.hasStarted) await refreshStartedProgressDraft();
|
|
1599
|
+
const progressActive = await progressDraftGate.noteWork();
|
|
1600
|
+
if ((alreadyStarted || progressActive) && progressDraftGate.hasStarted) await refreshStartedProgressDraft();
|
|
1598
1601
|
};
|
|
1599
1602
|
const updateDraftFromPartial = (text) => {
|
|
1600
1603
|
const trimmed = text?.trimEnd();
|
|
@@ -1819,7 +1822,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1819
1822
|
})();
|
|
1820
1823
|
else statusReactions.restoreInitial();
|
|
1821
1824
|
} else await statusReactions.restoreInitial();
|
|
1822
|
-
if (dispatchError) throw dispatchError;
|
|
1825
|
+
if (dispatchError) throw toLintErrorObject(dispatchError, "Slack dispatch failed");
|
|
1823
1826
|
const participationThreadTs = usedReplyThreadTs ?? statusThreadTs;
|
|
1824
1827
|
if (anyReplyDelivered && participationThreadTs) recordSlackThreadParticipation(account.accountId, message.channel, participationThreadTs, { agentId: route.agentId });
|
|
1825
1828
|
if (!anyReplyDelivered && !draftPreviewCommitted) {
|
|
@@ -1848,6 +1851,13 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1848
1851
|
}
|
|
1849
1852
|
});
|
|
1850
1853
|
}
|
|
1854
|
+
function toLintErrorObject(value, fallbackMessage) {
|
|
1855
|
+
if (value instanceof Error) return value;
|
|
1856
|
+
if (typeof value === "string") return new Error(value);
|
|
1857
|
+
const error = new Error(fallbackMessage, { cause: value });
|
|
1858
|
+
if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
|
|
1859
|
+
return error;
|
|
1860
|
+
}
|
|
1851
1861
|
//#endregion
|
|
1852
1862
|
//#region extensions/slack/src/monitor/message-handler/prepare-content.ts
|
|
1853
1863
|
const SLACK_MENTION_RESOLUTION_CONCURRENCY = 4;
|
|
@@ -1855,7 +1865,7 @@ const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
|
1855
1865
|
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
1856
1866
|
let slackMediaModulePromise$1;
|
|
1857
1867
|
function loadSlackMediaModule$1() {
|
|
1858
|
-
slackMediaModulePromise$1 ??= import("./actions-
|
|
1868
|
+
slackMediaModulePromise$1 ??= import("./actions-CkiDNtJN.js").then((n) => n.h);
|
|
1859
1869
|
return slackMediaModulePromise$1;
|
|
1860
1870
|
}
|
|
1861
1871
|
function collectUniqueSlackMentionIds$1(texts) {
|
|
@@ -2369,7 +2379,7 @@ function formatSlackBotStarterThreadLabel(params) {
|
|
|
2369
2379
|
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
2370
2380
|
let slackMediaModulePromise;
|
|
2371
2381
|
function loadSlackMediaModule() {
|
|
2372
|
-
slackMediaModulePromise ??= import("./actions-
|
|
2382
|
+
slackMediaModulePromise ??= import("./actions-CkiDNtJN.js").then((n) => n.h);
|
|
2373
2383
|
return slackMediaModulePromise;
|
|
2374
2384
|
}
|
|
2375
2385
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as normalizeSlackSlug } from "./thread-ts-
|
|
1
|
+
import { m as normalizeSlackSlug } from "./thread-ts-CzxxhSE5.js";
|
|
2
2
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { applyChannelMatchMeta, buildChannelKeyCandidates, resolveChannelEntryMatchWithFallback } from "openclaw/plugin-sdk/channel-targets";
|
|
4
4
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath } from "./registry-bbjH7IHX.js";
|
|
2
2
|
import { a as resolveSlackAccount, d as resolveSlackBotToken, o as resolveSlackAccountAllowFrom, s as resolveSlackAccountDmPolicy, u as resolveSlackAppToken } from "./accounts-f6Xcv9Vi.js";
|
|
3
|
-
import { C as isSlackAnyNativeApprovalClientEnabled, D as isSlackApprovalAuthorizedSender, b as truncateSlackText, d as normalizeAllowList, f as normalizeAllowListLower, h as resolveSlackAllowListMatch, k as isSlackExecApprovalAuthorizedSender, m as normalizeSlackSlug, p as normalizeSlackAllowOwnerEntry, s as SLACK_TEXT_LIMIT, u as allowListMatches } from "./thread-ts-
|
|
3
|
+
import { C as isSlackAnyNativeApprovalClientEnabled, D as isSlackApprovalAuthorizedSender, b as truncateSlackText, d as normalizeAllowList, f as normalizeAllowListLower, h as resolveSlackAllowListMatch, k as isSlackExecApprovalAuthorizedSender, m as normalizeSlackSlug, p as normalizeSlackAllowOwnerEntry, s as SLACK_TEXT_LIMIT, u as allowListMatches } from "./thread-ts-CzxxhSE5.js";
|
|
4
4
|
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-DrBq4Mld.js";
|
|
5
5
|
import { c as resolveSlackWebClientOptions } from "./client-qvqS9fQM.js";
|
|
6
6
|
import { t as getOptionalSlackRuntime } from "./runtime-BOk7xkOl.js";
|
|
7
7
|
import { t as formatSlackError } from "./errors-CZtmv-h0.js";
|
|
8
8
|
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-DIxJRl0F.js";
|
|
9
9
|
import { t as resolveSlackUserAllowlist } from "./resolve-users-B3vczJHE.js";
|
|
10
|
-
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
10
|
+
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-Bb46UkJW.js";
|
|
11
11
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
12
12
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, normalizeStringEntriesLower, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
13
|
import { normalizeAccountId, normalizeMainKey, resolveAgentRoute, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
14
14
|
import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-outbound";
|
|
15
15
|
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
|
|
16
16
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
17
|
+
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
17
18
|
import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, formatAllowlistMatchMeta, mergeAllowlist, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
18
19
|
import { computeBackoff, createNonExitingRuntime, danger, getChildLogger, logVerbose, shouldLogVerbose, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
19
20
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -37,7 +38,6 @@ import { resolveChannelConfigWrites } from "openclaw/plugin-sdk/channel-config-w
|
|
|
37
38
|
import { mutateConfigFile } from "openclaw/plugin-sdk/config-mutation";
|
|
38
39
|
import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
39
40
|
import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway-runtime";
|
|
40
|
-
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
41
41
|
import { formatCommandArgMenuTitle, resolveCommandAuthorization, resolveNativeCommandSessionTargets, resolveStoredModelOverride } from "openclaw/plugin-sdk/command-auth-native";
|
|
42
42
|
import { requestHeartbeat } from "openclaw/plugin-sdk/heartbeat-runtime";
|
|
43
43
|
import { createInteractiveConversationBindingHelpers, dispatchPluginInteractiveHandler } from "openclaw/plugin-sdk/plugin-runtime";
|
|
@@ -593,23 +593,23 @@ function migrateSlackChannelConfig(params) {
|
|
|
593
593
|
//#region extensions/slack/src/monitor/events/channels.ts
|
|
594
594
|
function registerSlackChannelEvents(params) {
|
|
595
595
|
const { ctx, trackEvent } = params;
|
|
596
|
-
const enqueueChannelSystemEvent = (
|
|
596
|
+
const enqueueChannelSystemEvent = (paramsLocal) => {
|
|
597
597
|
if (!ctx.isChannelAllowed({
|
|
598
|
-
channelId:
|
|
599
|
-
channelName:
|
|
598
|
+
channelId: paramsLocal.channelId,
|
|
599
|
+
channelName: paramsLocal.channelName,
|
|
600
600
|
channelType: "channel"
|
|
601
601
|
})) return;
|
|
602
602
|
const label = resolveSlackChannelLabel({
|
|
603
|
-
channelId:
|
|
604
|
-
channelName:
|
|
603
|
+
channelId: paramsLocal.channelId,
|
|
604
|
+
channelName: paramsLocal.channelName
|
|
605
605
|
});
|
|
606
606
|
const sessionKey = ctx.resolveSlackSystemEventSessionKey({
|
|
607
|
-
channelId:
|
|
607
|
+
channelId: paramsLocal.channelId,
|
|
608
608
|
channelType: "channel"
|
|
609
609
|
});
|
|
610
|
-
enqueueSystemEvent(`Slack channel ${
|
|
610
|
+
enqueueSystemEvent(`Slack channel ${paramsLocal.kind}: ${label}.`, {
|
|
611
611
|
sessionKey,
|
|
612
|
-
contextKey: `slack:channel:${
|
|
612
|
+
contextKey: `slack:channel:${paramsLocal.kind}:${paramsLocal.channelId ?? paramsLocal.channelName ?? "unknown"}`
|
|
613
613
|
});
|
|
614
614
|
};
|
|
615
615
|
ctx.app.event("channel_created", async ({ event, body }) => {
|
|
@@ -874,7 +874,7 @@ function buildBaseAllowFrom(ctx) {
|
|
|
874
874
|
async function resolveSlackEffectiveAllowFrom(ctx, options) {
|
|
875
875
|
const base = buildBaseAllowFrom(ctx);
|
|
876
876
|
if (options?.includePairingStore !== true) return base;
|
|
877
|
-
let storeAllowFrom
|
|
877
|
+
let storeAllowFrom;
|
|
878
878
|
try {
|
|
879
879
|
const resolved = await readChannelIngressStoreAllowFromForDmPolicy({
|
|
880
880
|
provider: "slack",
|
|
@@ -2134,11 +2134,11 @@ async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
|
2134
2134
|
//#region extensions/slack/src/monitor/events/members.ts
|
|
2135
2135
|
function registerSlackMemberEvents(params) {
|
|
2136
2136
|
const { ctx, trackEvent } = params;
|
|
2137
|
-
const handleMemberChannelEvent = async (
|
|
2137
|
+
const handleMemberChannelEvent = async (paramsLocal) => {
|
|
2138
2138
|
try {
|
|
2139
|
-
if (ctx.shouldDropMismatchedSlackEvent(
|
|
2139
|
+
if (ctx.shouldDropMismatchedSlackEvent(paramsLocal.body)) return;
|
|
2140
2140
|
trackEvent?.();
|
|
2141
|
-
const payload =
|
|
2141
|
+
const payload = paramsLocal.event;
|
|
2142
2142
|
const channelId = payload.channel;
|
|
2143
2143
|
const channelInfo = channelId ? await ctx.resolveChannelName(channelId) : {};
|
|
2144
2144
|
const channelType = payload.channel_type ?? channelInfo?.type;
|
|
@@ -2147,15 +2147,15 @@ function registerSlackMemberEvents(params) {
|
|
|
2147
2147
|
senderId: payload.user,
|
|
2148
2148
|
channelId,
|
|
2149
2149
|
channelType,
|
|
2150
|
-
eventKind: `member-${
|
|
2150
|
+
eventKind: `member-${paramsLocal.verb}`
|
|
2151
2151
|
});
|
|
2152
2152
|
if (!ingressContext) return;
|
|
2153
|
-
enqueueSystemEvent(`Slack: ${(payload.user ? await ctx.resolveUserName(payload.user) : {})?.name ?? payload.user ?? "someone"} ${
|
|
2153
|
+
enqueueSystemEvent(`Slack: ${(payload.user ? await ctx.resolveUserName(payload.user) : {})?.name ?? payload.user ?? "someone"} ${paramsLocal.verb} ${ingressContext.channelLabel}.`, {
|
|
2154
2154
|
sessionKey: ingressContext.sessionKey,
|
|
2155
|
-
contextKey: `slack:member:${
|
|
2155
|
+
contextKey: `slack:member:${paramsLocal.verb}:${channelId ?? "unknown"}:${payload.user ?? "unknown"}`
|
|
2156
2156
|
});
|
|
2157
2157
|
} catch (err) {
|
|
2158
|
-
ctx.runtime.error?.(danger(`slack ${
|
|
2158
|
+
ctx.runtime.error?.(danger(`slack ${paramsLocal.verb} handler failed: ${formatErrorMessage(err)}`));
|
|
2159
2159
|
}
|
|
2160
2160
|
};
|
|
2161
2161
|
ctx.app.event("member_joined_channel", async ({ event, body }) => {
|
|
@@ -2699,7 +2699,7 @@ function createSlackThreadTsResolver(params) {
|
|
|
2699
2699
|
//#region extensions/slack/src/monitor/message-handler.ts
|
|
2700
2700
|
let slackMessagePipelinePromise;
|
|
2701
2701
|
function loadSlackMessagePipeline() {
|
|
2702
|
-
slackMessagePipelinePromise ??= import("./pipeline.runtime-
|
|
2702
|
+
slackMessagePipelinePromise ??= import("./pipeline.runtime-DikPOwwv.js");
|
|
2703
2703
|
return slackMessagePipelinePromise;
|
|
2704
2704
|
}
|
|
2705
2705
|
const APP_MENTION_RETRY_TTL_MS = 6e4;
|
|
@@ -2981,7 +2981,7 @@ function installSlackNativeReconnectFailureObserver(receiver) {
|
|
|
2981
2981
|
resolve(void 0);
|
|
2982
2982
|
return;
|
|
2983
2983
|
}
|
|
2984
|
-
reject(error);
|
|
2984
|
+
reject(toLintErrorObject(error, "Non-Error rejection"));
|
|
2985
2985
|
});
|
|
2986
2986
|
}, delayMs);
|
|
2987
2987
|
});
|
|
@@ -3156,14 +3156,17 @@ async function startSlackSocketAndWaitForDisconnect(params) {
|
|
|
3156
3156
|
await Promise.resolve();
|
|
3157
3157
|
const disconnect = disconnectWaiter.getLatest();
|
|
3158
3158
|
disconnectWaiter.cancel();
|
|
3159
|
-
if ((err
|
|
3160
|
-
if (err
|
|
3159
|
+
if (isMissingSocketStartErrorDetail(err) && disconnect?.error !== void 0) throw toLintErrorObject(disconnect.error, "Non-Error thrown");
|
|
3160
|
+
if (isMissingSocketStartErrorDetail(err)) {
|
|
3161
3161
|
const suffix = disconnect ? ` after ${disconnect.event}` : "";
|
|
3162
3162
|
throw new Error(`Slack Socket Mode start failed${suffix} without error detail`, { cause: err });
|
|
3163
3163
|
}
|
|
3164
3164
|
throw err;
|
|
3165
3165
|
}
|
|
3166
3166
|
}
|
|
3167
|
+
function isMissingSocketStartErrorDetail(err) {
|
|
3168
|
+
return err === void 0 || err === null || err === "" || err instanceof Error && err.message === "";
|
|
3169
|
+
}
|
|
3167
3170
|
function resolveSlackSocketShutdownClient(app) {
|
|
3168
3171
|
if (!app || typeof app !== "object") return;
|
|
3169
3172
|
const receiver = Reflect.get(app, "receiver");
|
|
@@ -3200,6 +3203,13 @@ function formatSlackUserResolved(entry) {
|
|
|
3200
3203
|
extra: entry.note ? [entry.note] : []
|
|
3201
3204
|
});
|
|
3202
3205
|
}
|
|
3206
|
+
function toLintErrorObject(value, fallbackMessage) {
|
|
3207
|
+
if (value instanceof Error) return value;
|
|
3208
|
+
if (typeof value === "string") return new Error(value);
|
|
3209
|
+
const error = new Error(fallbackMessage, { cause: value });
|
|
3210
|
+
if (typeof value === "object" && value !== null || typeof value === "function") Object.assign(error, value);
|
|
3211
|
+
return error;
|
|
3212
|
+
}
|
|
3203
3213
|
//#endregion
|
|
3204
3214
|
//#region extensions/slack/src/monitor/dm-auth.ts
|
|
3205
3215
|
async function authorizeSlackDirectMessage(params) {
|
|
@@ -3261,7 +3271,7 @@ function pruneSlackExternalArgMenuStore(store, rawNow) {
|
|
|
3261
3271
|
for (const [token, entry] of store.entries()) if (asDateTimestampMs(entry.expiresAt) === void 0 || entry.expiresAt <= now) store.delete(token);
|
|
3262
3272
|
}
|
|
3263
3273
|
function createSlackExternalArgMenuToken(store) {
|
|
3264
|
-
let token
|
|
3274
|
+
let token;
|
|
3265
3275
|
do
|
|
3266
3276
|
token = generateSecureToken(SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES);
|
|
3267
3277
|
while (store.has(token));
|
|
@@ -3331,7 +3341,7 @@ function loadSlashCommandsRuntime() {
|
|
|
3331
3341
|
return slashCommandsRuntimePromise;
|
|
3332
3342
|
}
|
|
3333
3343
|
function loadSlashDispatchRuntime() {
|
|
3334
|
-
slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-
|
|
3344
|
+
slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-Dr5g7nrJ.js");
|
|
3335
3345
|
return slashDispatchRuntimePromise;
|
|
3336
3346
|
}
|
|
3337
3347
|
function loadSlackPluginCommandsRuntime() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as resolveSlackReplyBlocks, s as SLACK_TEXT_LIMIT } from "./thread-ts-
|
|
2
|
-
import { o as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-
|
|
1
|
+
import { r as resolveSlackReplyBlocks, s as SLACK_TEXT_LIMIT } from "./thread-ts-CzxxhSE5.js";
|
|
2
|
+
import { o as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-DzphzfbK.js";
|
|
3
3
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
4
4
|
import { SILENT_REPLY_TOKEN, chunkMarkdownTextWithMode, isSilentReplyText } from "openclaw/plugin-sdk/reply-chunking";
|
|
5
5
|
import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as registerSlackPluginHttpRoutes } from "./plugin-routes-B9PvcDQJ.js";
|
|
2
2
|
import { a as resolveSlackAccount, d as resolveSlackBotToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, t as listEnabledSlackAccounts, u as resolveSlackAppToken } from "./accounts-f6Xcv9Vi.js";
|
|
3
|
-
import { c as resolveSlackGroupRequireMention, l as resolveSlackGroupToolPolicy } from "./thread-ts-
|
|
3
|
+
import { c as resolveSlackGroupRequireMention, l as resolveSlackGroupToolPolicy } from "./thread-ts-CzxxhSE5.js";
|
|
4
4
|
import { n as setSlackRuntime } from "./runtime-BOk7xkOl.js";
|
|
5
|
-
import { t as sendMessageSlack } from "./send-
|
|
6
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
5
|
+
import { t as sendMessageSlack } from "./send-DzphzfbK.js";
|
|
6
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-CkiDNtJN.js";
|
|
7
7
|
import { t as probeSlack } from "./probe-DczaQTdi.js";
|
|
8
8
|
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-DIxJRl0F.js";
|
|
9
9
|
import { t as resolveSlackUserAllowlist } from "./resolve-users-B3vczJHE.js";
|
|
10
|
-
import { t as monitorSlackProvider } from "./provider-
|
|
11
|
-
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-
|
|
10
|
+
import { t as monitorSlackProvider } from "./provider-B4QaoPTL.js";
|
|
11
|
+
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-Cg2tZbNu.js";
|
|
12
12
|
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-WZwhRYe2.js";
|
|
13
|
-
import "./monitor-
|
|
13
|
+
import "./monitor-NFID7817.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,7 +1,7 @@
|
|
|
1
1
|
import { a as resolveSlackAccount, d as resolveSlackBotToken } from "./accounts-f6Xcv9Vi.js";
|
|
2
2
|
import { r as parseSlackTarget } from "./target-parsing-C7eeWg7M.js";
|
|
3
3
|
import "./targets-nUqxHGgg.js";
|
|
4
|
-
import { b as truncateSlackText, o as validateSlackBlocksArray, s as SLACK_TEXT_LIMIT, t as normalizeSlackThreadTsCandidate } from "./thread-ts-
|
|
4
|
+
import { b as truncateSlackText, o as validateSlackBlocksArray, s as SLACK_TEXT_LIMIT, t as normalizeSlackThreadTsCandidate } from "./thread-ts-CzxxhSE5.js";
|
|
5
5
|
import { a as getSlackWriteClient, n as createSlackTokenCacheKey } from "./client-qvqS9fQM.js";
|
|
6
6
|
import { t as getOptionalSlackRuntime } from "./runtime-BOk7xkOl.js";
|
|
7
7
|
import { i as loadOutboundMediaFromUrl } from "./runtime-api-BpGQDSTg.js";
|
|
@@ -380,16 +380,19 @@ function hasSlackDnsRequestSignal(err) {
|
|
|
380
380
|
return false;
|
|
381
381
|
}
|
|
382
382
|
function delaySlackDnsRetry(attempt) {
|
|
383
|
-
return new Promise((resolve) =>
|
|
383
|
+
return new Promise((resolve) => {
|
|
384
|
+
setTimeout(resolve, SLACK_DNS_RETRY_BASE_DELAY_MS * Math.max(1, attempt));
|
|
385
|
+
});
|
|
384
386
|
}
|
|
385
387
|
async function withSlackDnsRequestRetry(operation, fn) {
|
|
386
|
-
for (
|
|
388
|
+
for (const attempt of Array.from({ length: 3 }, (_, index) => index)) try {
|
|
387
389
|
return await fn();
|
|
388
390
|
} catch (err) {
|
|
389
391
|
if (attempt >= SLACK_DNS_RETRY_ATTEMPTS || !hasSlackDnsRequestSignal(err)) throw err;
|
|
390
392
|
logVerbose(`slack send: retrying ${operation} after transient DNS request error (${attempt + 1}/${SLACK_DNS_RETRY_ATTEMPTS})`);
|
|
391
393
|
await delaySlackDnsRetry(attempt + 1);
|
|
392
394
|
}
|
|
395
|
+
throw new Error("unreachable Slack DNS retry loop exit");
|
|
393
396
|
}
|
|
394
397
|
function isSlackCustomizeScopeError(err) {
|
|
395
398
|
const data = getSlackWebApiErrorData(err);
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as slackSetupPlugin } from "./channel.setup-Bwe4Z6kB.js";
|
|
2
2
|
export { slackSetupPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom } from "./accounts-f6Xcv9Vi.js";
|
|
2
|
-
import "./shared-
|
|
2
|
+
import "./shared-VMk8NGYC.js";
|
|
3
3
|
import { i as SLACK_CHANNEL, t as createSlackSetupWizardBase } from "./setup-core-POfI_bgP.js";
|
|
4
4
|
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-DIxJRl0F.js";
|
|
5
5
|
import { t as resolveSlackUserAllowlist } from "./resolve-users-B3vczJHE.js";
|
|
@@ -4,7 +4,7 @@ import { n as isSlackInteractiveRepliesEnabled } from "./interactive-replies-DrB
|
|
|
4
4
|
import { f as getChatChannelMeta } from "./client-qvqS9fQM.js";
|
|
5
5
|
import { i as SLACK_CHANNEL } from "./setup-core-POfI_bgP.js";
|
|
6
6
|
import { t as SlackChannelConfigSchema } from "./config-schema-BjAjs8_6.js";
|
|
7
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
7
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-XL6HeNCb.js";
|
|
8
8
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-g_PPWuoD.js";
|
|
9
9
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
10
10
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as deliverSlackSlashReplies$1 } from "./replies-
|
|
1
|
+
import { r as deliverSlackSlashReplies$1 } from "./replies-BPnv9QT6.js";
|
|
2
2
|
import { resolveAgentRoute as resolveAgentRoute$1 } from "openclaw/plugin-sdk/routing";
|
|
3
3
|
import { resolveMarkdownTableMode as resolveMarkdownTableMode$1 } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
4
4
|
import { recordInboundSessionMetaSafe as recordInboundSessionMetaSafe$1, resolveConversationLabel as resolveConversationLabel$1 } from "openclaw/plugin-sdk/conversation-runtime";
|
|
@@ -5,7 +5,8 @@ import { normalizeMessageChannel } from "openclaw/plugin-sdk/routing";
|
|
|
5
5
|
import { doesApprovalRequestMatchChannelAccount, resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
6
6
|
import { createResolvedApproverActionAuthAdapter, resolveApprovalApprovers } from "openclaw/plugin-sdk/approval-auth-runtime";
|
|
7
7
|
import { createChannelExecApprovalProfile, isChannelExecApprovalClientEnabledFromConfig, isChannelExecApprovalTargetRecipient, matchesApprovalRequestFilters } from "openclaw/plugin-sdk/approval-client-runtime";
|
|
8
|
-
import { reduceInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
|
|
8
|
+
import { reduceInteractiveReply, resolveMessagePresentationControlValue } from "openclaw/plugin-sdk/interactive-runtime";
|
|
9
|
+
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
9
10
|
import { compileAllowlist, resolveCompiledAllowlistMatch } from "openclaw/plugin-sdk/allow-from";
|
|
10
11
|
import { normalizeHyphenSlug, normalizeStringEntries as normalizeStringEntries$1, normalizeStringEntriesLower as normalizeStringEntriesLower$1 } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
11
12
|
import { resolveToolsBySender } from "openclaw/plugin-sdk/channel-policy";
|
|
@@ -265,9 +266,21 @@ function resolveSlackButtonStyle(style) {
|
|
|
265
266
|
if (style === "primary" || style === "danger") return style;
|
|
266
267
|
if (style === "success") return "primary";
|
|
267
268
|
}
|
|
269
|
+
function resolveSlackControlValue(control) {
|
|
270
|
+
if (control.action?.type === "command") {
|
|
271
|
+
const command = normalizeOptionalString(control.action.command);
|
|
272
|
+
if (command && parseExecApprovalCommandText(command)) return command;
|
|
273
|
+
const legacyValue = normalizeOptionalString(control.value);
|
|
274
|
+
return legacyValue && parseExecApprovalCommandText(legacyValue) ? legacyValue : void 0;
|
|
275
|
+
}
|
|
276
|
+
return resolveMessagePresentationControlValue(control);
|
|
277
|
+
}
|
|
268
278
|
function isWithinSlackLimit(value, maxLength) {
|
|
269
279
|
return value.length <= maxLength;
|
|
270
280
|
}
|
|
281
|
+
function isRenderableSlackOption(option) {
|
|
282
|
+
return option.value !== void 0 && isWithinSlackLimit(option.value, SLACK_OPTION_VALUE_MAX);
|
|
283
|
+
}
|
|
271
284
|
function readSlackBlockId(block) {
|
|
272
285
|
const value = block.block_id;
|
|
273
286
|
return typeof value === "string" ? value : void 0;
|
|
@@ -315,7 +328,8 @@ function buildSlackInteractiveBlocks(interactive, options = {}) {
|
|
|
315
328
|
}
|
|
316
329
|
if (block.type === "buttons") {
|
|
317
330
|
const elements = block.buttons.flatMap((button, choiceIndex) => {
|
|
318
|
-
const
|
|
331
|
+
const callbackData = resolveSlackControlValue(button);
|
|
332
|
+
const value = callbackData && isWithinSlackLimit(callbackData, SLACK_BUTTON_VALUE_MAX) ? callbackData : void 0;
|
|
319
333
|
const url = button.url && isWithinSlackLimit(button.url, SLACK_BUTTON_URL_MAX) ? button.url : void 0;
|
|
320
334
|
if (!value && !url) return [];
|
|
321
335
|
const style = resolveSlackButtonStyle(button.style);
|
|
@@ -340,8 +354,11 @@ function buildSlackInteractiveBlocks(interactive, options = {}) {
|
|
|
340
354
|
});
|
|
341
355
|
return state;
|
|
342
356
|
}
|
|
343
|
-
const
|
|
344
|
-
|
|
357
|
+
const optionsLocal = block.options.map((option) => ({
|
|
358
|
+
label: option.label,
|
|
359
|
+
value: resolveSlackControlValue(option)
|
|
360
|
+
})).filter(isRenderableSlackOption).slice(0, SLACK_STATIC_SELECT_OPTIONS_MAX);
|
|
361
|
+
if (optionsLocal.length === 0) return state;
|
|
345
362
|
state.blocks.push({
|
|
346
363
|
type: "actions",
|
|
347
364
|
block_id: `openclaw_reply_select_${++state.selectIndex}`,
|
|
@@ -353,7 +370,7 @@ function buildSlackInteractiveBlocks(interactive, options = {}) {
|
|
|
353
370
|
text: truncateSlackText(normalizeOptionalString(block.placeholder) ?? "Choose an option", SLACK_PLAIN_TEXT_MAX),
|
|
354
371
|
emoji: true
|
|
355
372
|
},
|
|
356
|
-
options:
|
|
373
|
+
options: optionsLocal.map((option, _choiceIndex) => ({
|
|
357
374
|
text: {
|
|
358
375
|
type: "plain_text",
|
|
359
376
|
text: truncateSlackText(option.label, SLACK_PLAIN_TEXT_MAX),
|
|
@@ -423,7 +440,8 @@ function buildSlackPresentationBlocks(presentation, options = {}) {
|
|
|
423
440
|
}
|
|
424
441
|
function buildSlackPresentationButtonBlock(block, buttonIndex) {
|
|
425
442
|
const elements = block.buttons.flatMap((button, choiceIndex) => {
|
|
426
|
-
const
|
|
443
|
+
const callbackData = resolveSlackControlValue(button);
|
|
444
|
+
const value = callbackData && isWithinSlackLimit(callbackData, SLACK_BUTTON_VALUE_MAX) ? callbackData : void 0;
|
|
427
445
|
const url = button.url && isWithinSlackLimit(button.url, SLACK_BUTTON_URL_MAX) ? button.url : void 0;
|
|
428
446
|
if (!value && !url) return [];
|
|
429
447
|
const style = resolveSlackButtonStyle(button.style);
|
|
@@ -447,7 +465,10 @@ function buildSlackPresentationButtonBlock(block, buttonIndex) {
|
|
|
447
465
|
} : void 0;
|
|
448
466
|
}
|
|
449
467
|
function buildSlackPresentationSelectBlock(block, selectIndex) {
|
|
450
|
-
const options = block.options.
|
|
468
|
+
const options = block.options.map((option) => ({
|
|
469
|
+
label: option.label,
|
|
470
|
+
value: resolveSlackControlValue(option)
|
|
471
|
+
})).filter(isRenderableSlackOption).slice(0, SLACK_STATIC_SELECT_OPTIONS_MAX);
|
|
451
472
|
return options.length > 0 ? {
|
|
452
473
|
type: "actions",
|
|
453
474
|
block_id: `openclaw_reply_select_${selectIndex}`,
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/slack",
|
|
3
|
-
"version": "2026.5.31-beta.
|
|
3
|
+
"version": "2026.5.31-beta.4",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/slack",
|
|
9
|
-
"version": "2026.5.31-beta.
|
|
9
|
+
"version": "2026.5.31-beta.4",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@slack/bolt": "4.7.3",
|
|
12
12
|
"@slack/types": "2.21.1",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"zod": "4.4.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"openclaw": ">=2026.5.31-beta.
|
|
18
|
+
"openclaw": ">=2026.5.31-beta.4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
21
21
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/slack",
|
|
3
|
-
"version": "2026.5.31-beta.
|
|
3
|
+
"version": "2026.5.31-beta.4",
|
|
4
4
|
"description": "OpenClaw Slack channel plugin for channels, DMs, commands, and app events.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"zod": "4.4.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"openclaw": ">=2026.5.31-beta.
|
|
18
|
+
"openclaw": ">=2026.5.31-beta.4"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
21
21
|
"openclaw": {
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"allowInvalidConfigRecovery": true
|
|
61
61
|
},
|
|
62
62
|
"compat": {
|
|
63
|
-
"pluginApi": ">=2026.5.31-beta.
|
|
63
|
+
"pluginApi": ">=2026.5.31-beta.4"
|
|
64
64
|
},
|
|
65
65
|
"startup": {
|
|
66
66
|
"deferConfiguredChannelFullLoadUntilAfterListen": true
|
|
67
67
|
},
|
|
68
68
|
"build": {
|
|
69
|
-
"openclawVersion": "2026.5.31-beta.
|
|
69
|
+
"openclawVersion": "2026.5.31-beta.4",
|
|
70
70
|
"bundledDist": false
|
|
71
71
|
},
|
|
72
72
|
"release": {
|