@openclaw/slack 2026.7.2-beta.7 → 2026.8.1-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/{account-inspect-DEKpg9Ip.js → account-inspect-YJvFBbCR.js} +1 -1
  2. package/dist/account-inspect-api.js +1 -1
  3. package/dist/{accounts-CHAeNZOX.js → accounts-BlzxuYle.js} +7 -3
  4. package/dist/{accounts.runtime-BHD4Ma2R.js → accounts.runtime-CbabBL8x.js} +1 -1
  5. package/dist/{action-runtime-DfuYoMjG.js → action-runtime-D6jg2CQd.js} +193 -125
  6. package/dist/action-runtime.runtime-JtoOK9l5.js +2 -0
  7. package/dist/{actions-D3NuJvva.js → actions-DFk0ANVB.js} +116 -235
  8. package/dist/actions.runtime-CYLsYRai.js +2 -0
  9. package/dist/api.js +17 -17
  10. package/dist/{approval-handler.runtime-BA05P0QT.js → approval-handler.runtime-BNvAoKdK.js} +53 -14
  11. package/dist/{channel-B9fVdW3s.js → channel-CA5w7qDF.js} +209 -110
  12. package/dist/channel-config-api.js +1 -1
  13. package/dist/channel-plugin-api.js +1 -1
  14. package/dist/{channel-type-DXyos1d2.js → channel-type-CZWv55Wu.js} +9 -12
  15. package/dist/{config-adapter-CxBQH8fq.js → channel.setup-CpyYsEXH.js} +83 -25
  16. package/dist/{config-schema-SgZT6nXV.js → config-schema-CN3XZRX5.js} +27 -17
  17. package/dist/conversation-binding-route-DFVLUdYF.js +115 -0
  18. package/dist/{directory-config-CnCIAktf.js → directory-config-BGYyuzWh.js} +3 -3
  19. package/dist/directory-contract-api.js +1 -1
  20. package/dist/{directory-live-DKunWh3A.js → directory-live-DjUJQLbq.js} +13 -22
  21. package/dist/{doctor-contract-CsGH1Dfc.js → doctor-contract-BAy7-EUQ.js} +30 -3
  22. package/dist/doctor-contract-api.js +1 -1
  23. package/dist/{group-policy-NQZti9t-.js → group-policy-DyfB_ZIE.js} +282 -183
  24. package/dist/index.js +4 -1
  25. package/dist/{message-tool-api-DkhFpMoy.js → message-tool-api-CqMr5Rmc.js} +14 -3
  26. package/dist/message-tool-api.js +1 -1
  27. package/dist/{monitor-CmKz0wtI.js → monitor-Chrecrb9.js} +3 -3
  28. package/dist/{outbound-adapter-BkuMp2Vs.js → outbound-adapter-DuRqAQXK.js} +35 -23
  29. package/dist/{pipeline.runtime-DgtmuYCP.js → pipeline.runtime-Bbfd5VFW.js} +1386 -929
  30. package/dist/{policy-PRysPn23.js → policy-BKXSxrIS.js} +18 -14
  31. package/dist/{probe-CgDsSops.js → probe-BVA65leh.js} +38 -18
  32. package/dist/{provider-DmRizMZt.js → provider-CUUiwsg2.js} +3454 -2601
  33. package/dist/{relay-source-Blxj8xb4.js → relay-source-mhpMMRG-.js} +11 -21
  34. package/dist/{replies-4s_Vq_z9.js → replies-SnWyXcsL.js} +84 -27
  35. package/dist/{resolve-channels-yEqmM-3I.js → resolve-channels-BSpqC8jU.js} +39 -12
  36. package/dist/{resolve-users-BOrt5K-5.js → resolve-users-Dvz9pDe0.js} +28 -5
  37. package/dist/{runtime-api-QMb-Q5Ko.js → runtime-api-DBi7xc_g.js} +3 -3
  38. package/dist/runtime-api.js +11 -11
  39. package/dist/{scopes-BJSrkAp6.js → scopes-BSk4GZvZ.js} +1 -1
  40. package/dist/security-contract-api.js +1 -1
  41. package/dist/{send-DsLeZpST.js → send-CtnOxKCc.js} +249 -163
  42. package/dist/{send.runtime-gUdK6V3h.js → send.runtime-kYctMHSd.js} +1 -1
  43. package/dist/setup-entry.js +1 -4
  44. package/dist/setup-plugin-api.js +1 -1
  45. package/dist/{setup-surface-BeNzrMrJ.js → setup-surface-BPFfp6So.js} +6 -6
  46. package/dist/{shared-DgIN3Dcr.js → shared-DJBaslN7.js} +45 -45
  47. package/dist/{block-text-DkHaoGem.js → slack-client-kind-BXyOOICI.js} +17 -2
  48. package/dist/{slash-dispatch.runtime-zPkyl7dB.js → slash-dispatch.runtime-Cf2FTrnf.js} +2 -2
  49. package/dist/{streaming-compat-3_X-21wW.js → streaming-compat-B-e0mqM0.js} +3 -8
  50. package/dist/{target-parsing-N6lHogYZ.js → target-parsing-BnMD2ZqZ.js} +40 -2
  51. package/dist/{targets-KmjP2E8s.js → targets-Cx5W_n3W.js} +1 -1
  52. package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
  53. package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +1 -1
  54. package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
  55. package/node_modules/@slack/socket-mode/node_modules/@types/node/README.md +1 -1
  56. package/node_modules/@slack/socket-mode/node_modules/@types/node/crypto.d.ts +1 -1
  57. package/node_modules/@slack/socket-mode/node_modules/@types/node/package.json +2 -2
  58. package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
  59. package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +1 -1
  60. package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
  61. package/node_modules/undici/lib/cache/memory-cache-store.js +54 -9
  62. package/node_modules/undici/lib/cache/sqlite-cache-store.js +7 -1
  63. package/node_modules/undici/lib/core/request.js +12 -1
  64. package/node_modules/undici/lib/dispatcher/client-h1.js +11 -2
  65. package/node_modules/undici/lib/handler/cache-handler.js +246 -64
  66. package/node_modules/undici/lib/handler/cache-revalidation-handler.js +3 -3
  67. package/node_modules/undici/lib/handler/retry-handler.js +24 -0
  68. package/node_modules/undici/lib/interceptor/cache.js +159 -52
  69. package/node_modules/undici/lib/util/cache.js +324 -62
  70. package/node_modules/undici/lib/util/date.js +23 -6
  71. package/node_modules/undici/lib/web/cookies/util.js +79 -9
  72. package/node_modules/undici/package.json +1 -1
  73. package/openclaw.plugin.json +280 -33
  74. package/package.json +9 -11
  75. package/skills/slack/SKILL.md +10 -68
  76. package/dist/account-reply-mode-DrUXogvO.js +0 -14
  77. package/dist/action-runtime.runtime-DQErZYpz.js +0 -2
  78. package/dist/actions.runtime-BIRU_G4M.js +0 -2
  79. package/dist/channel.setup-CLP5oTvh.js +0 -56
  80. package/dist/preflight-audio.runtime-D5Bgags0.js +0 -3
  81. package/dist/slash-plugin-commands.runtime-Dosfcx3X.js +0 -2
  82. package/node_modules/p-map/index.d.ts +0 -155
  83. package/node_modules/p-map/index.js +0 -285
  84. package/node_modules/p-map/license +0 -9
  85. package/node_modules/p-map/package.json +0 -57
  86. package/node_modules/p-map/readme.md +0 -190
  87. package/dist/{security-audit-DR097212.js → security-audit-B_yKr7MW.js} +1 -1
@@ -1,8 +1,8 @@
1
- import { c as formatUnknownError, s as SLACK_SOCKET_RECONNECT_POLICY } from "./provider-DmRizMZt.js";
2
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
1
+ import { f as SLACK_SOCKET_RECONNECT_POLICY, p as formatUnknownError } from "./provider-CUUiwsg2.js";
2
+ import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  import { computeBackoff, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
4
- import { Buffer } from "node:buffer";
5
4
  import { isIP } from "node:net";
5
+ import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress";
6
6
  import WebSocket from "ws";
7
7
  //#region extensions/slack/src/monitor/relay-source.ts
8
8
  const SLACK_RELAY_ROUTE_KINDS = /* @__PURE__ */ new Set([
@@ -21,8 +21,7 @@ async function monitorSlackRelaySource(params) {
21
21
  params.setStatus?.({
22
22
  connected: true,
23
23
  lastConnectedAt: Date.now(),
24
- healthState: "healthy",
25
- lastError: null
24
+ ...params.identityHealth
26
25
  });
27
26
  params.runtime.log?.(`slack relay mode connected gateway_id:${params.config.gatewayId}`);
28
27
  await runRelayWebSocket({
@@ -39,7 +38,7 @@ async function monitorSlackRelaySource(params) {
39
38
  const delayMs = computeBackoff(SLACK_SOCKET_RECONNECT_POLICY, reconnectAttempts);
40
39
  params.setStatus?.({
41
40
  connected: false,
42
- healthState: "disconnected",
41
+ lifecycle: "recovering",
43
42
  lastDisconnect: {
44
43
  at: Date.now(),
45
44
  error: formatUnknownError(err)
@@ -125,7 +124,7 @@ function runRelayWebSocket(params) {
125
124
  const closeReason = formatRelayClose(code, reason);
126
125
  params.setStatus?.({
127
126
  connected: false,
128
- healthState: "disconnected",
127
+ lifecycle: "recovering",
129
128
  lastDisconnect: {
130
129
  at: Date.now(),
131
130
  error: closeReason
@@ -204,20 +203,14 @@ function parseRelayFrame(data) {
204
203
  throw new SlackRelayMalformedFrameError("Slack relay received malformed JSON frame", { cause });
205
204
  }
206
205
  }
207
- function rawDataToString(data) {
208
- if (typeof data === "string") return data;
209
- if (Buffer.isBuffer(data)) return data.toString("utf8");
210
- if (Array.isArray(data)) return Buffer.concat(data).toString("utf8");
211
- return Buffer.from(data).toString("utf8");
212
- }
213
206
  function extractRelaySlackMessageEvent(frame) {
214
- const record = asRecord(frame);
207
+ const record = asOptionalRecord(frame);
215
208
  if (!record || record.type !== "slack_event") return;
216
209
  const deliveryId = stringValue(record.delivery_id);
217
- const routeRecord = asRecord(record.route);
210
+ const routeRecord = asOptionalRecord(record.route);
218
211
  const routeKind = stringValue(routeRecord?.kind);
219
212
  const routeKey = stringValue(routeRecord?.key);
220
- const event = asRecord(asRecord(record.payload)?.event);
213
+ const event = asOptionalRecord(asOptionalRecord(record.payload)?.event);
221
214
  if (event?.type !== "message" || typeof event.channel !== "string") return;
222
215
  if (!deliveryId || !routeKind || !SLACK_RELAY_ROUTE_KINDS.has(routeKind) || !routeKey) return;
223
216
  return {
@@ -230,12 +223,12 @@ function extractRelaySlackMessageEvent(frame) {
230
223
  };
231
224
  }
232
225
  function extractRelayHello(frame) {
233
- const record = asRecord(frame);
226
+ const record = asOptionalRecord(frame);
234
227
  if (!record || record.type !== "hello") return;
235
228
  return { identity: extractRelayIdentity(record) };
236
229
  }
237
230
  function extractRelayIdentity(record) {
238
- const identityRecord = asRecord(record.slack_identity) ?? asRecord(record.slackIdentity);
231
+ const identityRecord = asOptionalRecord(record.slack_identity) ?? asOptionalRecord(record.slackIdentity);
239
232
  if (!identityRecord) return;
240
233
  const username = normalizeOptionalString(identityRecord.username);
241
234
  const iconUrl = normalizeOptionalString(identityRecord.icon_url) ?? normalizeOptionalString(identityRecord.iconUrl);
@@ -262,9 +255,6 @@ function formatRelayClose(code, reason) {
262
255
  const text = reason.toString("utf8");
263
256
  return text ? `Slack relay websocket closed (${code} ${text})` : `Slack relay websocket closed (${code})`;
264
257
  }
265
- function asRecord(value) {
266
- return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
267
- }
268
258
  function stringValue(value) {
269
259
  return typeof value === "string" ? value : void 0;
270
260
  }
@@ -1,6 +1,7 @@
1
- import { C as hasSlackNativeDataBlock, E as isSlackNativeResponseUrlRejection, L as SLACK_TEXT_LIMIT, T as isSlackInvalidBlocksResponse, f as hasSlackReplyStructuredContent, h as resolveSlackReplyBlocks, j as buildSlackBlocksFallbackText, k as markdownToSlackMrkdwnChunks, m as resolveSlackReplyBlockResolution, x as buildSlackNativeDataAccessibilityText } from "./group-policy-NQZti9t-.js";
2
- import { d as chunkSlackTextAtHardLimit, r as sendMessageSlack, u as buildSlackNativeDataDeliveryPlan } from "./send-DsLeZpST.js";
3
- import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./provider-DmRizMZt.js";
1
+ import { A as isSlackInvalidBlocksResponse, E as buildSlackNativeDataAccessibilityText, I as buildSlackBlocksFallbackText, O as hasSlackNativeDataBlock, P as markdownToSlackMrkdwnChunks, U as SLACK_TEXT_LIMIT, _ as hasSlackReplyStructuredContent, b as resolveSlackReplyBlocks, j as isSlackNativeResponseUrlRejection, y as resolveSlackReplyBlockResolution } from "./group-policy-DyfB_ZIE.js";
2
+ import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, r as sendMessageSlack } from "./send-CtnOxKCc.js";
3
+ import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./provider-CUUiwsg2.js";
4
+ import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
4
5
  import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
5
6
  import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
6
7
  import { SILENT_REPLY_TOKEN, chunkMarkdownTextWithMode, isSilentReplyText } from "openclaw/plugin-sdk/reply-chunking";
@@ -64,6 +65,52 @@ function emitSlackMessageSentHooks(params) {
64
65
  }
65
66
  //#endregion
66
67
  //#region extensions/slack/src/monitor/replies.ts
68
+ function compactSlackResponseUrlFallback(messages) {
69
+ if (messages.length <= 1) return [...messages];
70
+ if (messages.every((message) => !message.blocks?.length)) return chunkSlackTextAtHardLimit(messages.map((message) => message.text).join("")).map((text) => ({
71
+ text,
72
+ mrkdwn: false
73
+ }));
74
+ const compacted = [];
75
+ let pending;
76
+ const flush = () => {
77
+ if (pending) {
78
+ compacted.push(pending);
79
+ pending = void 0;
80
+ }
81
+ };
82
+ for (const message of messages) {
83
+ if (!message.blocks?.length) {
84
+ flush();
85
+ compacted.push(message);
86
+ continue;
87
+ }
88
+ if (!pending?.blocks?.length) {
89
+ pending = {
90
+ ...message,
91
+ blocks: [...message.blocks]
92
+ };
93
+ continue;
94
+ }
95
+ const text = `${pending.text}\n\n${message.text}`;
96
+ const blocks = [...pending.blocks, ...message.blocks];
97
+ if (text.length > 4e4 || blocks.length > 50) {
98
+ flush();
99
+ pending = {
100
+ ...message,
101
+ blocks: [...message.blocks]
102
+ };
103
+ continue;
104
+ }
105
+ pending = {
106
+ text,
107
+ blocks,
108
+ mrkdwn: false
109
+ };
110
+ }
111
+ flush();
112
+ return compacted;
113
+ }
67
114
  function readSlackReplyBlocks(payload) {
68
115
  return resolveSlackReplyBlocks(payload);
69
116
  }
@@ -75,28 +122,6 @@ function resolveDeliveredSlackReplyThreadTs(params) {
75
122
  }
76
123
  async function deliverReplies(params) {
77
124
  let latestResult;
78
- const sendReply = async (input) => {
79
- return await sendMessageSlack(params.target, input.text, {
80
- cfg: params.cfg,
81
- token: params.token,
82
- threadTs: input.threadTs,
83
- accountId: params.accountId,
84
- ...input.mediaUrl ? { mediaUrl: input.mediaUrl } : {},
85
- ...input.blocks ? { blocks: input.blocks } : {},
86
- ...input.authoredTextPlacement ? { authoredTextPlacement: input.authoredTextPlacement } : {},
87
- ...Object.hasOwn(input, "nativeDataFallbackBaseText") ? { nativeDataFallbackBaseText: input.nativeDataFallbackBaseText } : {},
88
- ...input.textIsSlackMrkdwn ? { textIsSlackMrkdwn: true } : {},
89
- ...input.textIsSlackPlainText ? { textIsSlackPlainText: true } : {},
90
- ...params.eventScope ? {
91
- client: params.eventScope.client,
92
- enterpriseEventScope: params.eventScope,
93
- textLimit: params.textLimit,
94
- ...params.mediaMaxBytes !== void 0 ? { mediaMaxBytes: params.mediaMaxBytes } : {}
95
- } : {},
96
- ...params.identity ? { identity: params.identity } : {},
97
- ...params.metadata ? { metadata: params.metadata } : {}
98
- });
99
- };
100
125
  for (const payload of params.replies) {
101
126
  if (payload.isReasoning === true) continue;
102
127
  const threadTs = resolveDeliveredSlackReplyThreadTs({
@@ -108,6 +133,31 @@ async function deliverReplies(params) {
108
133
  const textRaw = reply.hasText && !isSilentReplyText(reply.trimmedText, SILENT_REPLY_TOKEN) ? reply.trimmedText : void 0;
109
134
  const { authoredTextPlacement, segments } = resolveSlackReplyBlockResolution(payload, { materializeAuthoredText: !reply.hasMedia && hasSlackReplyStructuredContent(payload) });
110
135
  if (!textRaw && !reply.hasMedia && segments.length === 0) continue;
136
+ const acceptedResults = [];
137
+ const sendReply = async (input) => {
138
+ return await sendMessageSlack(params.target, input.text, {
139
+ cfg: params.cfg,
140
+ token: params.token,
141
+ threadTs: input.threadTs,
142
+ accountId: params.accountId,
143
+ onDeliveryResult: (result) => {
144
+ acceptedResults.push(result);
145
+ },
146
+ ...input.mediaUrl ? { mediaUrl: input.mediaUrl } : {},
147
+ ...input.blocks ? { blocks: input.blocks } : {},
148
+ ...input.authoredTextPlacement ? { authoredTextPlacement: input.authoredTextPlacement } : {},
149
+ ...Object.hasOwn(input, "nativeDataFallbackBaseText") ? { nativeDataFallbackBaseText: input.nativeDataFallbackBaseText } : {},
150
+ ...input.textIsSlackMrkdwn ? { textIsSlackMrkdwn: true } : {},
151
+ ...input.textIsSlackPlainText ? { textIsSlackPlainText: true } : {},
152
+ ...params.eventScope ? {
153
+ eventScope: params.eventScope,
154
+ textLimit: params.textLimit,
155
+ ...params.mediaMaxBytes !== void 0 ? { mediaMaxBytes: params.mediaMaxBytes } : {}
156
+ } : {},
157
+ ...params.identity ? { identity: params.identity } : {},
158
+ ...params.metadata ? { metadata: params.metadata } : {}
159
+ });
160
+ };
111
161
  const emitSent = (content, result) => {
112
162
  if (params.deferMessageSentHooks) return;
113
163
  emitSlackMessageSentHooks({
@@ -205,7 +255,13 @@ async function deliverReplies(params) {
205
255
  }
206
256
  } catch (error) {
207
257
  emitFailed(hookParts.join("\n\n") || textRaw || spokenText || "", error);
208
- throw error;
258
+ if (acceptedResults.length === 0) throw error;
259
+ const receipt = createMessageReceiptFromOutboundResults({ results: acceptedResults });
260
+ throw createChannelPartialDeliveryError(error, {
261
+ messageIds: receipt.platformMessageIds,
262
+ receipt,
263
+ visibleReplySent: true
264
+ });
209
265
  }
210
266
  if (delivered) {
211
267
  emitSent(hookParts.join("\n\n") || textRaw || spokenText || "", reply.hasMedia ? void 0 : lastResult);
@@ -264,13 +320,14 @@ async function deliverSlackSlashReplies(params) {
264
320
  blocks: input.blocks,
265
321
  baseText: input.baseText
266
322
  });
323
+ const nativeFallback = responseBudget.remaining() === void 0 ? plan.fallbackMessages : compactSlackResponseUrlFallback(plan.fallbackMessages);
267
324
  return {
268
325
  message: {
269
326
  text: plan.accessibilityText,
270
327
  blocks: input.blocks,
271
328
  mrkdwn: false
272
329
  },
273
- nativeFallback: plan.fallbackMessages,
330
+ nativeFallback,
274
331
  ...plan.skipOriginalBlocks ? { skipOriginalBlocks: true } : {}
275
332
  };
276
333
  };
@@ -1,10 +1,29 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { a as createSlackLookupClient } from "./probe-CgDsSops.js";
2
+ import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-BnMD2ZqZ.js";
3
+ import { i as createSlackLookupClient } from "./probe-BVA65leh.js";
3
4
  import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.js";
4
5
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
5
6
  import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
6
7
  //#region extensions/slack/src/resolve-channels.ts
7
8
  var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveSlackChannelAllowlist: () => resolveSlackChannelAllowlist });
9
+ function resolveWorkspaceQualifiedChannel(input) {
10
+ if (!/^team:/i.test(input)) return;
11
+ try {
12
+ const target = parseSlackTarget(input);
13
+ if (target?.kind !== "channel" || !target.teamId) return;
14
+ return {
15
+ input,
16
+ resolved: true,
17
+ id: formatSlackTarget({
18
+ teamId: target.teamId,
19
+ kind: "channel",
20
+ id: target.id
21
+ })
22
+ };
23
+ } catch {
24
+ return;
25
+ }
26
+ }
8
27
  function parseSlackChannelMention(raw) {
9
28
  const trimmed = raw.trim();
10
29
  if (!trimmed) return {};
@@ -47,20 +66,26 @@ function resolveByName(name, channels) {
47
66
  return matches.find((channel) => !channel.archived) ?? matches[0];
48
67
  }
49
68
  async function resolveSlackChannelAllowlist(params) {
50
- const parsedEntries = params.entries.map((input) => ({
69
+ const workspaceResolved = params.entries.map(resolveWorkspaceQualifiedChannel);
70
+ const lookupEntries = params.entries.filter((_, index) => !workspaceResolved[index]);
71
+ if (lookupEntries.length === 0) return workspaceResolved.filter((entry) => entry !== void 0);
72
+ const parsedEntries = lookupEntries.map((input) => ({
51
73
  input,
52
74
  parsed: parseSlackChannelMention(input)
53
75
  }));
54
- if (parsedEntries.every((entry) => Boolean(entry.parsed.id))) return parsedEntries.map(({ input, parsed }) => ({
55
- input,
56
- resolved: true,
57
- id: parsed.id,
58
- name: parsed.name
59
- }));
60
- const channels = await listSlackChannels(params.client ?? createSlackLookupClient(params.token));
61
- return resolveDirectoryAllowlistEntries({
62
- entries: params.entries,
63
- lookup: channels,
76
+ if (parsedEntries.every((entry) => Boolean(entry.parsed.id))) {
77
+ const resolved = parsedEntries.map(({ input, parsed }) => ({
78
+ input,
79
+ resolved: true,
80
+ id: parsed.id,
81
+ name: parsed.name
82
+ }));
83
+ let resolvedIndex = 0;
84
+ return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
85
+ }
86
+ const resolved = resolveDirectoryAllowlistEntries({
87
+ entries: lookupEntries,
88
+ lookup: await listSlackChannels(params.client ?? createSlackLookupClient(params.token)),
64
89
  parseInput: parseSlackChannelMention,
65
90
  findById: (lookup, id) => lookup.find((channel) => channel.id === id),
66
91
  buildIdResolved: ({ input, parsed, match }) => ({
@@ -87,6 +112,8 @@ async function resolveSlackChannelAllowlist(params) {
87
112
  resolved: false
88
113
  })
89
114
  });
115
+ let resolvedIndex = 0;
116
+ return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
90
117
  }
91
118
  //#endregion
92
119
  export { resolve_channels_exports as n, resolveSlackChannelAllowlist as t };
@@ -1,10 +1,29 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
2
- import { a as createSlackLookupClient } from "./probe-CgDsSops.js";
2
+ import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-BnMD2ZqZ.js";
3
+ import { i as createSlackLookupClient } from "./probe-BVA65leh.js";
3
4
  import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.js";
4
5
  import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
5
6
  import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
6
7
  //#region extensions/slack/src/resolve-users.ts
7
8
  var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveSlackUserAllowlist: () => resolveSlackUserAllowlist });
9
+ function resolveWorkspaceQualifiedUser(input) {
10
+ if (!/^team:/i.test(input)) return;
11
+ try {
12
+ const target = parseSlackTarget(input);
13
+ if (target?.kind !== "user" || !target.teamId) return;
14
+ return {
15
+ input,
16
+ resolved: true,
17
+ id: formatSlackTarget({
18
+ teamId: target.teamId,
19
+ kind: "user",
20
+ id: target.id
21
+ })
22
+ };
23
+ } catch {
24
+ return;
25
+ }
26
+ }
8
27
  function parseSlackUserInput(raw) {
9
28
  const trimmed = raw.trim();
10
29
  if (!trimmed) return {};
@@ -76,10 +95,12 @@ function resolveSlackUserFromMatches(input, matches, parsed) {
76
95
  };
77
96
  }
78
97
  async function resolveSlackUserAllowlist(params) {
79
- const users = await listSlackUsers(params.client ?? createSlackLookupClient(params.token));
80
- return resolveDirectoryAllowlistEntries({
81
- entries: params.entries,
82
- lookup: users,
98
+ const workspaceResolved = params.entries.map(resolveWorkspaceQualifiedUser);
99
+ const lookupEntries = params.entries.filter((_, index) => !workspaceResolved[index]);
100
+ if (lookupEntries.length === 0) return workspaceResolved.filter((entry) => entry !== void 0);
101
+ const resolved = resolveDirectoryAllowlistEntries({
102
+ entries: lookupEntries,
103
+ lookup: await listSlackUsers(params.client ?? createSlackLookupClient(params.token)),
83
104
  parseInput: parseSlackUserInput,
84
105
  findById: (lookup, id) => lookup.find((user) => user.id === id),
85
106
  buildIdResolved: ({ input, parsed, match }) => ({
@@ -113,6 +134,8 @@ async function resolveSlackUserAllowlist(params) {
113
134
  resolved: false
114
135
  })
115
136
  });
137
+ let resolvedIndex = 0;
138
+ return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
116
139
  }
117
140
  //#endregion
118
141
  export { resolve_users_exports as n, resolveSlackUserAllowlist as t };
@@ -1,6 +1,6 @@
1
- import "./target-parsing-N6lHogYZ.js";
2
- import "./probe-CgDsSops.js";
3
- import "./config-schema-SgZT6nXV.js";
1
+ import "./target-parsing-BnMD2ZqZ.js";
2
+ import "./probe-BVA65leh.js";
3
+ import "./config-schema-CN3XZRX5.js";
4
4
  import "openclaw/plugin-sdk/account-id";
5
5
  import { createActionGate as createActionGate$1, imageResultFromFile, jsonResult, readPositiveIntegerParam, readReactionParams, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
6
6
  import "openclaw/plugin-sdk/channel-status";
@@ -1,14 +1,14 @@
1
1
  import { t as registerSlackPluginHttpRoutes } from "./plugin-routes-CLp4obpN.js";
2
- import { a as resolveSlackAccount, d as resolveSlackAppToken, f as resolveSlackBotToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, t as listEnabledSlackAccounts } from "./accounts-CHAeNZOX.js";
3
- import { n as resolveSlackGroupRequireMention, r as resolveSlackGroupToolPolicy } from "./group-policy-NQZti9t-.js";
4
- import { t as probeSlack } from "./probe-CgDsSops.js";
2
+ import { a as resolveSlackAccount, d as resolveSlackAppToken, f as resolveSlackBotToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, t as listEnabledSlackAccounts } from "./accounts-BlzxuYle.js";
3
+ import { i as resolveSlackGroupToolPolicy, r as resolveSlackGroupRequireMention } from "./group-policy-DyfB_ZIE.js";
4
+ import { t as probeSlack } from "./probe-BVA65leh.js";
5
5
  import { r as setSlackRuntime } from "./runtime-JSVZSWAj.js";
6
- import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, h as unpinSlackMessage, i as getSlackMemberInfo, l as reactSlackMessage, m as sendSlackMessage, o as listSlackPins, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-D3NuJvva.js";
7
- import { r as sendMessageSlack } from "./send-DsLeZpST.js";
8
- import { t as resolveSlackChannelAllowlist } from "./resolve-channels-yEqmM-3I.js";
9
- import { t as resolveSlackUserAllowlist } from "./resolve-users-BOrt5K-5.js";
10
- import { t as monitorSlackProvider } from "./provider-DmRizMZt.js";
11
- import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-DfuYoMjG.js";
12
- import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-DKunWh3A.js";
13
- import "./monitor-CmKz0wtI.js";
6
+ import { a as getSlackMemberInfo, c as listSlackReactions, d as readSlackMessages, f as removeOwnSlackReactions, g as unpinSlackMessage, h as sendSlackMessage, l as pinSlackMessage, o as listSlackEmojis, p as removeSlackReaction, r as editSlackMessage, s as listSlackPins, t as deleteSlackMessage, u as reactSlackMessage } from "./actions-DFk0ANVB.js";
7
+ import { r as sendMessageSlack } from "./send-CtnOxKCc.js";
8
+ import { t as resolveSlackChannelAllowlist } from "./resolve-channels-BSpqC8jU.js";
9
+ import { t as resolveSlackUserAllowlist } from "./resolve-users-Dvz9pDe0.js";
10
+ import { t as monitorSlackProvider } from "./provider-CUUiwsg2.js";
11
+ import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-D6jg2CQd.js";
12
+ import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-DjUJQLbq.js";
13
+ import "./monitor-Chrecrb9.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,4 +1,4 @@
1
- import { o as createSlackReadClient, r as formatSlackError } from "./probe-CgDsSops.js";
1
+ import { a as createSlackReadClient, r as formatSlackError } from "./probe-BVA65leh.js";
2
2
  import { isRecord, normalizeOptionalString, normalizeStringEntries, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
3
3
  //#region extensions/slack/src/scopes.ts
4
4
  function collectScopes(value, into) {
@@ -1,2 +1,2 @@
1
- import { t as collectSlackSecurityAuditFindings } from "./security-audit-DR097212.js";
1
+ import { t as collectSlackSecurityAuditFindings } from "./security-audit-B_yKr7MW.js";
2
2
  export { collectSlackSecurityAuditFindings };