@openclaw/slack 2026.5.24-beta.2 → 2026.5.25-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.
Files changed (65) hide show
  1. package/dist/{action-runtime-ClZjzvJU.js → action-runtime-aNlZUC5X.js} +6 -4
  2. package/dist/action-runtime.runtime-CLBURvAS.js +2 -0
  3. package/dist/{actions-Dp1AKisQ.js → actions-DZqQvsrH.js} +2 -2
  4. package/dist/{actions.runtime-BzvmbC0z.js → actions.runtime-BnyePHn6.js} +1 -1
  5. package/dist/{allow-list-ChDz7vQO.js → allow-list-B1lkGjwl.js} +2 -2
  6. package/dist/api.js +10 -10
  7. package/dist/{approval-handler.runtime-DQdr992C.js → approval-handler.runtime-XWqmvXQj.js} +1 -1
  8. package/dist/{channel-CXs510aj.js → channel-DmywKR6E.js} +19 -18
  9. package/dist/channel-api-DdLCPu8a.js +20 -0
  10. package/dist/channel-plugin-api.js +1 -1
  11. package/dist/{channel.setup-CcyPmfoS.js → channel.setup-BVEey2Ge.js} +3 -2
  12. package/dist/{client-CMipJma0.js → client-Dc2Ji2YN.js} +1 -20
  13. package/dist/{directory-live-Dq12TcgS.js → directory-live-Cl83cGLZ.js} +1 -1
  14. package/dist/{errors-co-Fg3Ll.js → errors-CZtmv-h0.js} +1 -3
  15. package/dist/inbound-contract-test-api.js +2 -2
  16. package/dist/{interactive-replies-9v8OYeGV.js → interactive-replies-DtYu4Sf5.js} +4 -4
  17. package/dist/interactive-replies-api.js +1 -1
  18. package/dist/{message-tool-api-BXEWUFiV.js → message-tool-api-BieXX5lk.js} +1 -1
  19. package/dist/message-tool-api.js +1 -1
  20. package/dist/{monitor-CAfY1OZE.js → monitor-DxvDcCuQ.js} +4 -4
  21. package/dist/{outbound-adapter-Dtqbyixa.js → outbound-adapter-C3lEsGEd.js} +2 -2
  22. package/dist/outbound-payload-test-api.js +1 -1
  23. package/dist/{outbound-payload.test-harness-Ca13aYOM.js → outbound-payload.test-harness-C57ipELl.js} +1 -1
  24. package/dist/{pipeline.runtime-CwVyPQfY.js → pipeline.runtime-Dd4VXXjS.js} +9 -9
  25. package/dist/{policy-pdU_0AU0.js → policy-pu8tsF8_.js} +1 -1
  26. package/dist/{prepare-DFa-tK12.js → prepare-2yHC1V9V.js} +22 -28
  27. package/dist/{prepare.test-helpers-Y5XylD5f.js → prepare.test-helpers-dKm_6IFd.js} +1 -1
  28. package/dist/{probe-BRokY757.js → probe-cBVPhCKZ.js} +2 -2
  29. package/dist/{provider-GYmtqVRL.js → provider-CaIj5hMH.js} +27 -45
  30. package/dist/{replies-y6Coc_4v.js → replies-C6KAYDBW.js} +2 -2
  31. package/dist/{resolve-channels-D3v41FCM.js → resolve-channels-CT4oiz_9.js} +1 -1
  32. package/dist/{resolve-users-uMz1N7mm.js → resolve-users-o5S-Ijks.js} +1 -1
  33. package/dist/{room-context-C-6EgkTA.js → room-context-BsIaiZhE.js} +3 -3
  34. package/dist/{runtime-api-DHq45F2b.js → runtime-api-CyPE-EvY.js} +1 -1
  35. package/dist/runtime-api.js +9 -9
  36. package/dist/{scopes-BniaiyvU.js → scopes-CnyhLIPT.js} +4 -4
  37. package/dist/{send-B_Z5v6sU.js → send-CXGjjgpT.js} +8 -10
  38. package/dist/send.runtime-B0Gg0Ncx.js +2 -0
  39. package/dist/send.runtime-BbMOcD7_.js +2 -0
  40. package/dist/{setup-core-CJxjcOda.js → setup-core-DKe7Ug3V.js} +2 -2
  41. package/dist/setup-plugin-api.js +1 -1
  42. package/dist/{setup-surface-ByaVDcYW.js → setup-surface-DZAXKCKa.js} +6 -5
  43. package/dist/{shared-CHupOun0.js → shared-CqkL-uuZ.js} +4 -3
  44. package/dist/{slash-dispatch.runtime-u_Vj5RGB.js → slash-dispatch.runtime-CANn5muk.js} +1 -1
  45. package/dist/test-api.js +6 -6
  46. package/node_modules/qs/CHANGELOG.md +178 -0
  47. package/node_modules/qs/README.md +19 -1
  48. package/node_modules/qs/dist/qs.js +17 -17
  49. package/node_modules/qs/eslint.config.mjs +1 -0
  50. package/node_modules/qs/lib/parse.js +57 -25
  51. package/node_modules/qs/lib/stringify.js +11 -4
  52. package/node_modules/qs/lib/utils.js +2 -0
  53. package/node_modules/qs/package.json +3 -3
  54. package/node_modules/qs/test/parse.js +195 -4
  55. package/node_modules/qs/test/stringify.js +138 -0
  56. package/node_modules/qs/test/utils.js +38 -3
  57. package/node_modules/ws/lib/receiver.js +54 -0
  58. package/node_modules/ws/lib/websocket-server.js +8 -0
  59. package/node_modules/ws/lib/websocket.js +14 -0
  60. package/node_modules/ws/package.json +1 -1
  61. package/npm-shrinkwrap.json +9 -9
  62. package/package.json +4 -4
  63. package/dist/action-runtime.runtime-BUnUNH27.js +0 -2
  64. package/dist/send.runtime-BdYdgXuZ.js +0 -2
  65. package/dist/send.runtime-bgiJsule.js +0 -2
@@ -2,18 +2,18 @@ import { a as resolveSlackAccount, d as resolveSlackBotToken, o as resolveSlackA
2
2
  import { c as isSlackApprovalAuthorizedSender, i as isSlackAnyNativeApprovalClientEnabled, u as isSlackExecApprovalAuthorizedSender } from "./reply-blocks-BlOURkUm.js";
3
3
  import "./blocks-render-CNC4vQnd.js";
4
4
  import { o as SLACK_TEXT_LIMIT, s as truncateSlackText } from "./thread-ts-ks-O8cEG.js";
5
- import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-9v8OYeGV.js";
6
- import { c as resolveSlackWebClientOptions } from "./client-CMipJma0.js";
7
- import { n as normalizeAllowList, r as normalizeAllowListLower, t as allowListMatches } from "./allow-list-ChDz7vQO.js";
5
+ import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-DtYu4Sf5.js";
6
+ import { c as resolveSlackWebClientOptions } from "./client-Dc2Ji2YN.js";
7
+ import { n as normalizeAllowList, r as normalizeAllowListLower, t as allowListMatches } from "./allow-list-B1lkGjwl.js";
8
8
  import { t as getOptionalSlackRuntime } from "./runtime-BOk7xkOl.js";
9
9
  import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath } from "./registry-bbjH7IHX.js";
10
- import { t as formatSlackError } from "./errors-co-Fg3Ll.js";
11
- import { t as resolveSlackChannelAllowlist } from "./resolve-channels-D3v41FCM.js";
12
- import { t as resolveSlackUserAllowlist } from "./resolve-users-uMz1N7mm.js";
13
- import { D as resolveSlackSlashCommandConfig, E as buildSlackSlashCommandMatcher, O as stripSlackMentionsForCommandDetection, S as resolveOpenProviderRuntimeGroupPolicy, T as warnMissingProviderGroupPolicyFallbackOnce, _ as getRuntimeConfig$1, d as resolveSlackEffectiveAllowFrom, f as buildSlackAssistantThreadMetadata, g as resolveSlackChatType, h as normalizeSlackChannelType, i as parsePluginBindingApprovalCustomId, l as authorizeSlackSystemEventSender, n as authorizeSlackDirectMessage, p as createSlackMonitorContext, r as buildPluginBindingResolvedText, s as resolvePluginConversationBindingApproval, t as resolveSlackRoomContextHints, u as resolveSlackCommandIngress, v as isDangerousNameMatchingEnabled, x as resolveDefaultGroupPolicy } from "./room-context-C-6EgkTA.js";
14
- import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-pdU_0AU0.js";
10
+ import { t as formatSlackError } from "./errors-CZtmv-h0.js";
11
+ import { t as resolveSlackChannelAllowlist } from "./resolve-channels-CT4oiz_9.js";
12
+ import { t as resolveSlackUserAllowlist } from "./resolve-users-o5S-Ijks.js";
13
+ import { D as resolveSlackSlashCommandConfig, E as buildSlackSlashCommandMatcher, O as stripSlackMentionsForCommandDetection, S as resolveOpenProviderRuntimeGroupPolicy, T as warnMissingProviderGroupPolicyFallbackOnce, _ as getRuntimeConfig$1, d as resolveSlackEffectiveAllowFrom, f as buildSlackAssistantThreadMetadata, g as resolveSlackChatType, h as normalizeSlackChannelType, i as parsePluginBindingApprovalCustomId, l as authorizeSlackSystemEventSender, n as authorizeSlackDirectMessage, p as createSlackMonitorContext, r as buildPluginBindingResolvedText, s as resolvePluginConversationBindingApproval, t as resolveSlackRoomContextHints, u as resolveSlackCommandIngress, v as isDangerousNameMatchingEnabled, x as resolveDefaultGroupPolicy } from "./room-context-BsIaiZhE.js";
14
+ import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-pu8tsF8_.js";
15
15
  import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
16
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
16
+ import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries, normalizeStringEntriesLower, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
17
17
  import { normalizeAccountId, normalizeMainKey } from "openclaw/plugin-sdk/routing";
18
18
  import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-message";
19
19
  import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
@@ -416,16 +416,7 @@ function readOptionLabels(options) {
416
416
  return labels.length > 0 ? labels : void 0;
417
417
  }
418
418
  function uniqueNonEmptyStrings(values) {
419
- const unique = [];
420
- const seen = /* @__PURE__ */ new Set();
421
- for (const entry of values) {
422
- if (typeof entry !== "string") continue;
423
- const trimmed = entry.trim();
424
- if (!trimmed || seen.has(trimmed)) continue;
425
- seen.add(trimmed);
426
- unique.push(trimmed);
427
- }
428
- return unique;
419
+ return normalizeUniqueTrimmedStringList(values);
429
420
  }
430
421
  function collectRichTextFragments(value, out) {
431
422
  if (!value || typeof value !== "object") return;
@@ -1474,22 +1465,16 @@ function resolveSlackMessageSubtypeHandler(event) {
1474
1465
  }
1475
1466
  //#endregion
1476
1467
  //#region extensions/slack/src/monitor/events/messages.ts
1477
- function asRecord$1(value) {
1478
- return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
1479
- }
1480
- function asString(value) {
1481
- return typeof value === "string" && value.trim() ? value.trim() : void 0;
1482
- }
1483
1468
  function isSlackUserId(value) {
1484
1469
  return /^[UW][A-Z0-9]+$/.test(value);
1485
1470
  }
1486
1471
  function addUserCandidate(candidates, value, botUserId) {
1487
- const id = asString(value);
1472
+ const id = normalizeOptionalString(value);
1488
1473
  if (!id || id === botUserId || !isSlackUserId(id)) return;
1489
1474
  candidates.add(id);
1490
1475
  }
1491
1476
  function collectMetadataUserCandidates(candidates, value, botUserId) {
1492
- const payload = asRecord$1(asRecord$1(value)?.event_payload);
1477
+ const payload = asOptionalRecord(asOptionalRecord(value)?.event_payload);
1493
1478
  if (!payload) return;
1494
1479
  for (const key of [
1495
1480
  "user",
@@ -1505,21 +1490,21 @@ function resolveAssistantMessageChangedSender(params) {
1505
1490
  return candidates.size === 1 ? [...candidates][0] : void 0;
1506
1491
  }
1507
1492
  function isSelfAttributedMessageChange(params) {
1508
- const topUser = asString(params.event.user);
1509
- const messageUser = asString(params.message?.user);
1510
- const messageBotId = asString(params.message?.bot_id);
1493
+ const topUser = normalizeOptionalString(params.event.user);
1494
+ const messageUser = normalizeOptionalString(params.message?.user);
1495
+ const messageBotId = normalizeOptionalString(params.message?.bot_id);
1511
1496
  return Boolean(params.ctx.botUserId) && (topUser === params.ctx.botUserId || messageUser === params.ctx.botUserId) || Boolean(params.ctx.botId) && messageBotId === params.ctx.botId;
1512
1497
  }
1513
1498
  function resolveAssistantMessageChangedInbound(params) {
1514
1499
  if (params.event.subtype !== "message_changed") return;
1515
1500
  const changed = params.event;
1516
- const message = asRecord$1(changed.message);
1501
+ const message = asOptionalRecord(changed.message);
1517
1502
  if (!message || !isSelfAttributedMessageChange({
1518
1503
  event: changed,
1519
1504
  message,
1520
1505
  ctx: params.ctx
1521
1506
  })) return;
1522
- if (normalizeSlackChannelType(asString(changed.channel_type), changed.channel) !== "im") return;
1507
+ if (normalizeSlackChannelType(normalizeOptionalString(changed.channel_type), changed.channel) !== "im") return;
1523
1508
  const senderId = resolveAssistantMessageChangedSender({
1524
1509
  message,
1525
1510
  botUserId: params.ctx.botUserId
@@ -1533,11 +1518,11 @@ function resolveAssistantMessageChangedInbound(params) {
1533
1518
  channel: changed.channel ?? params.event.channel,
1534
1519
  channel_type: "im",
1535
1520
  user: senderId,
1536
- text: asString(message.text),
1537
- ts: asString(message.ts) ?? asString(changed.event_ts),
1538
- thread_ts: asString(message.thread_ts),
1521
+ text: normalizeOptionalString(message.text),
1522
+ ts: normalizeOptionalString(message.ts) ?? normalizeOptionalString(changed.event_ts),
1523
+ thread_ts: normalizeOptionalString(message.thread_ts),
1539
1524
  event_ts: changed.event_ts,
1540
- assistant_thread: asRecord$1(message.assistant_thread) ?? asRecord$1(changed.assistant_thread),
1525
+ assistant_thread: asOptionalRecord(message.assistant_thread) ?? asOptionalRecord(changed.assistant_thread),
1541
1526
  files: Array.isArray(message.files) ? message.files : void 0,
1542
1527
  attachments: Array.isArray(message.attachments) ? message.attachments : void 0
1543
1528
  };
@@ -1558,7 +1543,7 @@ function registerSlackMessageEvents(params) {
1558
1543
  }
1559
1544
  if (message.subtype === "message_changed" && isSelfAttributedMessageChange({
1560
1545
  event: message,
1561
- message: asRecord$1(message.message),
1546
+ message: asOptionalRecord(message.message),
1562
1547
  ctx
1563
1548
  })) return;
1564
1549
  const subtypeHandler = resolveSlackMessageSubtypeHandler(message);
@@ -1957,7 +1942,7 @@ function createSlackThreadTsResolver(params) {
1957
1942
  //#region extensions/slack/src/monitor/message-handler.ts
1958
1943
  let slackMessagePipelinePromise;
1959
1944
  function loadSlackMessagePipeline() {
1960
- slackMessagePipelinePromise ??= import("./pipeline.runtime-CwVyPQfY.js");
1945
+ slackMessagePipelinePromise ??= import("./pipeline.runtime-Dd4VXXjS.js");
1961
1946
  return slackMessagePipelinePromise;
1962
1947
  }
1963
1948
  const APP_MENTION_RETRY_TTL_MS = 6e4;
@@ -2324,15 +2309,12 @@ function createSlackSocketModeLogger(sink = console) {
2324
2309
  getLastMessage: () => lastMessage
2325
2310
  };
2326
2311
  }
2327
- function asRecord(value) {
2328
- return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
2329
- }
2330
2312
  function shouldSkipOpenClawSlackSelfEvent(args) {
2331
2313
  const botId = args.context?.botId;
2332
2314
  const botUserId = args.context?.botUserId;
2333
- const message = asRecord(args.message);
2315
+ const message = asOptionalRecord(args.message);
2334
2316
  if (message?.subtype === "bot_message" && botId && message.bot_id === botId) return true;
2335
- const event = asRecord(args.event);
2317
+ const event = asOptionalRecord(args.event);
2336
2318
  if (event?.type === "message" && event.subtype === "message_changed" && event.user === botUserId) return false;
2337
2319
  const eventsWhichShouldBeKept = new Set(["member_joined_channel", "member_left_channel"]);
2338
2320
  return Boolean(botUserId && event && event.user === botUserId && typeof event.type === "string" && !eventsWhichShouldBeKept.has(event.type));
@@ -2515,7 +2497,7 @@ function loadSlashCommandsRuntime() {
2515
2497
  return slashCommandsRuntimePromise;
2516
2498
  }
2517
2499
  function loadSlashDispatchRuntime() {
2518
- slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-u_Vj5RGB.js");
2500
+ slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-CANn5muk.js");
2519
2501
  return slashDispatchRuntimePromise;
2520
2502
  }
2521
2503
  function loadSlackPluginCommandsRuntime() {
@@ -3062,7 +3044,7 @@ async function registerSlackMonitorSlashCommands(params) {
3062
3044
  skillCommands,
3063
3045
  provider: "slack"
3064
3046
  });
3065
- const existingNativeNames = new Set(nativeCommands.map((c) => normalizeLowercaseStringOrEmpty(c.name)).filter(Boolean));
3047
+ const existingNativeNames = new Set(normalizeStringEntriesLower(nativeCommands.map((command) => command.name)));
3066
3048
  const { listProviderPluginCommandSpecs } = await loadSlackPluginCommandsRuntime();
3067
3049
  for (const pluginCommand of listProviderPluginCommandSpecs("slack")) {
3068
3050
  const normalizedName = normalizeLowercaseStringOrEmpty(pluginCommand.name);
@@ -1,7 +1,7 @@
1
1
  import { t as resolveSlackReplyBlocks } from "./reply-blocks-BlOURkUm.js";
2
2
  import { o as SLACK_TEXT_LIMIT } from "./thread-ts-ks-O8cEG.js";
3
- import { o as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-B_Z5v6sU.js";
4
- import "./send.runtime-BdYdgXuZ.js";
3
+ import { o as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-CXGjjgpT.js";
4
+ import "./send.runtime-BbMOcD7_.js";
5
5
  import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
6
6
  import { SILENT_REPLY_TOKEN, chunkMarkdownTextWithMode, isSilentReplyText } from "openclaw/plugin-sdk/reply-chunking";
7
7
  import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { r as createSlackWebClient } from "./client-CMipJma0.js";
2
+ import { r as createSlackWebClient } from "./client-Dc2Ji2YN.js";
3
3
  import { n as resolveSlackAllowlistEntries, t as collectSlackCursorItems } from "./resolve-allowlist-common-CP8SH0Zf.js";
4
4
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/slack/src/resolve-channels.ts
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { r as createSlackWebClient } from "./client-CMipJma0.js";
2
+ import { r as createSlackWebClient } from "./client-Dc2Ji2YN.js";
3
3
  import { n as resolveSlackAllowlistEntries, t as collectSlackCursorItems } from "./resolve-allowlist-common-CP8SH0Zf.js";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  //#region extensions/slack/src/resolve-users.ts
@@ -1,6 +1,6 @@
1
- import { a as normalizeSlackSlug, i as normalizeSlackAllowOwnerEntry, n as normalizeAllowList, o as resolveSlackAllowListMatch, r as normalizeAllowListLower, t as allowListMatches } from "./allow-list-ChDz7vQO.js";
2
- import { t as formatSlackError } from "./errors-co-Fg3Ll.js";
3
- import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-pdU_0AU0.js";
1
+ import { a as normalizeSlackSlug, i as normalizeSlackAllowOwnerEntry, n as normalizeAllowList, o as resolveSlackAllowListMatch, r as normalizeAllowListLower, t as allowListMatches } from "./allow-list-B1lkGjwl.js";
2
+ import { t as formatSlackError } from "./errors-CZtmv-h0.js";
3
+ import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-pu8tsF8_.js";
4
4
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { resolveAgentRoute, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
6
6
  import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
@@ -1,5 +1,5 @@
1
1
  import "./target-parsing-C7eeWg7M.js";
2
- import "./client-CMipJma0.js";
2
+ import "./channel-api-DdLCPu8a.js";
3
3
  import "./config-api-DnT9ohtE.js";
4
4
  import { createActionGate as createActionGate$1, imageResultFromFile, jsonResult, readNumberParam, readReactionParams, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
5
5
  import "openclaw/plugin-sdk/account-id";
@@ -1,14 +1,14 @@
1
1
  import { a as resolveSlackAccount, d as resolveSlackBotToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, t as listEnabledSlackAccounts, u as resolveSlackAppToken } from "./accounts-BnLQ3fe2.js";
2
2
  import { n as resolveSlackGroupRequireMention, r as resolveSlackGroupToolPolicy } from "./reply-blocks-BlOURkUm.js";
3
3
  import { n as setSlackRuntime } from "./runtime-BOk7xkOl.js";
4
- import { t as sendMessageSlack } from "./send-B_Z5v6sU.js";
5
- 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-Dp1AKisQ.js";
6
- import { t as probeSlack } from "./probe-BRokY757.js";
7
- import { t as resolveSlackChannelAllowlist } from "./resolve-channels-D3v41FCM.js";
8
- import { t as resolveSlackUserAllowlist } from "./resolve-users-uMz1N7mm.js";
9
- import { t as monitorSlackProvider } from "./provider-GYmtqVRL.js";
4
+ import { t as sendMessageSlack } from "./send-CXGjjgpT.js";
5
+ 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-DZqQvsrH.js";
6
+ import { t as probeSlack } from "./probe-cBVPhCKZ.js";
7
+ import { t as resolveSlackChannelAllowlist } from "./resolve-channels-CT4oiz_9.js";
8
+ import { t as resolveSlackUserAllowlist } from "./resolve-users-o5S-Ijks.js";
9
+ import { t as monitorSlackProvider } from "./provider-CaIj5hMH.js";
10
10
  import { t as registerSlackPluginHttpRoutes } from "./plugin-routes-DRR3ijKM.js";
11
- import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-ClZjzvJU.js";
12
- import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-Dq12TcgS.js";
13
- import "./monitor-CAfY1OZE.js";
11
+ import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-aNlZUC5X.js";
12
+ import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-Cl83cGLZ.js";
13
+ import "./monitor-DxvDcCuQ.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,6 +1,6 @@
1
- import { r as createSlackWebClient } from "./client-CMipJma0.js";
2
- import { t as formatSlackError } from "./errors-co-Fg3Ll.js";
3
- import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
1
+ import { r as createSlackWebClient } from "./client-Dc2Ji2YN.js";
2
+ import { t as formatSlackError } from "./errors-CZtmv-h0.js";
3
+ import { isRecord, normalizeOptionalString, normalizeStringEntries, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
4
4
  //#region extensions/slack/src/scopes.ts
5
5
  function collectScopes(value, into) {
6
6
  if (!value) return;
@@ -19,7 +19,7 @@ function collectScopes(value, into) {
19
19
  for (const entry of Object.values(value)) if (Array.isArray(entry) || typeof entry === "string") collectScopes(entry, into);
20
20
  }
21
21
  function normalizeScopes(scopes) {
22
- return Array.from(new Set(scopes.map((scope) => scope.trim()).filter(Boolean))).toSorted();
22
+ return sortUniqueStrings(normalizeStringEntries(scopes));
23
23
  }
24
24
  function extractScopes(payload) {
25
25
  if (!isRecord(payload)) return [];
@@ -2,11 +2,12 @@ import { a as resolveSlackAccount, d as resolveSlackBotToken } from "./accounts-
2
2
  import { r as parseSlackTarget } from "./target-parsing-C7eeWg7M.js";
3
3
  import "./targets-nUqxHGgg.js";
4
4
  import { a as validateSlackBlocksArray, o as SLACK_TEXT_LIMIT, s as truncateSlackText, t as normalizeSlackThreadTsCandidate } from "./thread-ts-ks-O8cEG.js";
5
- import { a as getSlackWriteClient, n as createSlackTokenCacheKey } from "./client-CMipJma0.js";
5
+ import { a as getSlackWriteClient, n as createSlackTokenCacheKey } from "./client-Dc2Ji2YN.js";
6
6
  import { t as getOptionalSlackRuntime } from "./runtime-BOk7xkOl.js";
7
- import { i as loadOutboundMediaFromUrl } from "./runtime-api-DHq45F2b.js";
7
+ import { i as loadOutboundMediaFromUrl } from "./runtime-api-CyPE-EvY.js";
8
8
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-message";
10
+ import "@slack/web-api";
10
11
  import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
11
12
  import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
12
13
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
@@ -324,13 +325,10 @@ function buildSlackPostMessagePayload(params) {
324
325
  ...unfurlPayload
325
326
  };
326
327
  }
327
- function normalizeSlackApiString(value) {
328
- return typeof value === "string" && value.trim() ? value.trim() : void 0;
329
- }
330
328
  function normalizeSlackScopeList(value) {
331
329
  if (!Array.isArray(value)) return [];
332
330
  return value.flatMap((scope) => {
333
- const normalized = normalizeSlackApiString(scope);
331
+ const normalized = normalizeOptionalString(scope);
334
332
  return normalized ? [normalized] : [];
335
333
  });
336
334
  }
@@ -343,10 +341,10 @@ function getSlackWebApiErrorData(err) {
343
341
  function formatSlackWebApiErrorMessage(err) {
344
342
  if (!(err instanceof Error)) return;
345
343
  const data = getSlackWebApiErrorData(err);
346
- const code = normalizeSlackApiString(data?.error);
344
+ const code = normalizeOptionalString(data?.error);
347
345
  if (!code) return;
348
346
  const details = [];
349
- const needed = normalizeSlackApiString(data?.needed);
347
+ const needed = normalizeOptionalString(data?.needed);
350
348
  if (needed) details.push(`needed: ${needed}`);
351
349
  const scopes = normalizeSlackScopeList(data?.response_metadata?.scopes);
352
350
  if (scopes.length) details.push(`granted: ${scopes.join(", ")}`);
@@ -396,8 +394,8 @@ async function withSlackDnsRequestRetry(operation, fn) {
396
394
  }
397
395
  function isSlackCustomizeScopeError(err) {
398
396
  const data = getSlackWebApiErrorData(err);
399
- if (normalizeLowercaseStringOrEmpty(normalizeSlackApiString(data?.error)) !== "missing_scope") return false;
400
- if (normalizeLowercaseStringOrEmpty(normalizeSlackApiString(data?.needed))?.includes("chat:write.customize")) return true;
397
+ if (normalizeLowercaseStringOrEmpty(normalizeOptionalString(data?.error)) !== "missing_scope") return false;
398
+ if (normalizeLowercaseStringOrEmpty(normalizeOptionalString(data?.needed))?.includes("chat:write.customize")) return true;
401
399
  return [...normalizeSlackScopeList(data?.response_metadata?.scopes), ...normalizeSlackScopeList(data?.response_metadata?.acceptedScopes)].map((scope) => normalizeLowercaseStringOrEmpty(scope)).includes("chat:write.customize");
402
400
  }
403
401
  async function postSlackMessageBestEffort(params) {
@@ -0,0 +1,2 @@
1
+ import { t as sendMessageSlack } from "./send-CXGjjgpT.js";
2
+ export { sendMessageSlack };
@@ -0,0 +1,2 @@
1
+ import "./send-CXGjjgpT.js";
2
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { a as resolveSlackAccount } from "./accounts-BnLQ3fe2.js";
2
2
  import { t as inspectSlackAccount } from "./account-inspect-vVg3pT03.js";
3
3
  import { hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
4
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
4
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
5
5
  import { DEFAULT_ACCOUNT_ID, createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createAllowlistSetupWizardProxy, createEnvPatchedAccountSetupAdapter, createLegacyCompatChannelDmPolicy, createSetupTranslator, createStandardChannelSetupStatus, parseMentionOrPrefixedId, patchChannelConfigForAccount, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
6
6
  import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
7
7
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
@@ -159,7 +159,7 @@ function setSlackInteractiveReplies(cfg, accountId, interactiveReplies) {
159
159
  cfg,
160
160
  channel: SLACK_CHANNEL,
161
161
  accountId,
162
- patch: { capabilities: Array.isArray(capabilities) ? interactiveReplies ? [...new Set([...capabilities, "interactiveReplies"])] : capabilities.filter((entry) => normalizeLowercaseStringOrEmpty(entry) !== "interactivereplies") : {
162
+ patch: { capabilities: Array.isArray(capabilities) ? interactiveReplies ? uniqueStrings([...capabilities, "interactiveReplies"]) : capabilities.filter((entry) => normalizeLowercaseStringOrEmpty(entry) !== "interactivereplies") : {
163
163
  ...capabilities && typeof capabilities === "object" ? capabilities : {},
164
164
  interactiveReplies
165
165
  } }
@@ -1,2 +1,2 @@
1
- import { t as slackSetupPlugin } from "./channel.setup-CcyPmfoS.js";
1
+ import { t as slackSetupPlugin } from "./channel.setup-BVEey2Ge.js";
2
2
  export { slackSetupPlugin };
@@ -1,8 +1,9 @@
1
1
  import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom } from "./accounts-BnLQ3fe2.js";
2
- import "./shared-CHupOun0.js";
3
- import { i as SLACK_CHANNEL, t as createSlackSetupWizardBase } from "./setup-core-CJxjcOda.js";
4
- import { t as resolveSlackChannelAllowlist } from "./resolve-channels-D3v41FCM.js";
5
- import { t as resolveSlackUserAllowlist } from "./resolve-users-uMz1N7mm.js";
2
+ import "./shared-CqkL-uuZ.js";
3
+ import { i as SLACK_CHANNEL, t as createSlackSetupWizardBase } from "./setup-core-DKe7Ug3V.js";
4
+ import { t as resolveSlackChannelAllowlist } from "./resolve-channels-CT4oiz_9.js";
5
+ import { t as resolveSlackUserAllowlist } from "./resolve-users-o5S-Ijks.js";
6
+ import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
6
7
  import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
7
8
  import { createSetupTranslator, noteChannelLookupFailure, noteChannelLookupSummary, parseMentionOrPrefixedId, promptLegacyChannelAllowFromForAccount, resolveEntriesWithOptionalToken } from "openclaw/plugin-sdk/setup-runtime";
8
9
  import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
@@ -92,7 +93,7 @@ async function resolveSlackGroupAllowlist(params) {
92
93
  });
93
94
  const resolvedKeys = resolved.filter((entry) => entry.resolved && entry.id).map((entry) => entry.id);
94
95
  const unresolved = resolved.filter((entry) => !entry.resolved).map((entry) => entry.input);
95
- keys = [...resolvedKeys, ...unresolved.map((entry) => entry.trim()).filter(Boolean)];
96
+ keys = [...resolvedKeys, ...normalizeStringEntries(unresolved)];
96
97
  await noteChannelLookupSummary({
97
98
  prompter: params.prompter,
98
99
  label: t("wizard.slack.channelsLabel"),
@@ -1,8 +1,8 @@
1
1
  import { a as resolveSlackAccount, c as resolveSlackConfigAccessorAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, s as resolveSlackAccountDmPolicy } from "./accounts-BnLQ3fe2.js";
2
2
  import { t as inspectSlackAccount } from "./account-inspect-vVg3pT03.js";
3
- import { n as isSlackInteractiveRepliesEnabled } from "./interactive-replies-9v8OYeGV.js";
4
- import { f as getChatChannelMeta } from "./client-CMipJma0.js";
5
- import { i as SLACK_CHANNEL } from "./setup-core-CJxjcOda.js";
3
+ import { n as isSlackInteractiveRepliesEnabled } from "./interactive-replies-DtYu4Sf5.js";
4
+ import { r as getChatChannelMeta } from "./channel-api-DdLCPu8a.js";
5
+ import { i as SLACK_CHANNEL } from "./setup-core-DKe7Ug3V.js";
6
6
  import { t as SlackChannelConfigSchema } from "./config-schema-CUiDK8HV.js";
7
7
  import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BVvVoRt-.js";
8
8
  import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-g_PPWuoD.js";
@@ -11,6 +11,7 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
11
11
  import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
12
12
  import { createDangerousNameMatchingMutableAllowlistWarningCollector, createOpenProviderConfiguredRouteWarningCollector } from "openclaw/plugin-sdk/channel-policy";
13
13
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
14
+ import "openclaw/plugin-sdk/channel-contract";
14
15
  //#region extensions/slack/src/security.ts
15
16
  const resolveSlackDmPolicy = createScopedDmSecurityResolver({
16
17
  channelKey: "slack",
@@ -1,4 +1,4 @@
1
- import { r as deliverSlackSlashReplies$1 } from "./replies-y6Coc_4v.js";
1
+ import { r as deliverSlackSlashReplies$1 } from "./replies-C6KAYDBW.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";
package/dist/test-api.js CHANGED
@@ -1,8 +1,8 @@
1
- import { a as createSlackActions, t as slackPlugin } from "./channel-CXs510aj.js";
1
+ import { a as createSlackActions, t as slackPlugin } from "./channel-DmywKR6E.js";
2
2
  import { n as setSlackRuntime } from "./runtime-BOk7xkOl.js";
3
- import { t as sendMessageSlack } from "./send-B_Z5v6sU.js";
4
- import { t as prepareSlackMessage } from "./prepare-DFa-tK12.js";
5
- import { t as createInboundSlackTestContext } from "./prepare.test-helpers-Y5XylD5f.js";
6
- import { t as createSlackOutboundPayloadHarness } from "./outbound-payload.test-harness-Ca13aYOM.js";
7
- import { n as slackOutbound } from "./outbound-adapter-Dtqbyixa.js";
3
+ import { t as sendMessageSlack } from "./send-CXGjjgpT.js";
4
+ import { t as prepareSlackMessage } from "./prepare-2yHC1V9V.js";
5
+ import { t as createInboundSlackTestContext } from "./prepare.test-helpers-dKm_6IFd.js";
6
+ import { t as createSlackOutboundPayloadHarness } from "./outbound-payload.test-harness-C57ipELl.js";
7
+ import { n as slackOutbound } from "./outbound-adapter-C3lEsGEd.js";
8
8
  export { createInboundSlackTestContext, createSlackActions, createSlackOutboundPayloadHarness, prepareSlackMessage, sendMessageSlack, setSlackRuntime, slackOutbound, slackPlugin };