@openclaw/slack 2026.8.1 → 2026.8.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{account-inspect-CN2hBsim.js → .setup/account-inspect-B86OaUEt.mjs} +5 -5
- package/dist/{accounts-Dm_H77gH.js → .setup/accounts-C1FspRF-.mjs} +1 -1
- package/dist/{accounts.runtime-DRuEK6mL.js → .setup/accounts.runtime-BpWv-6-2.mjs} +1 -1
- package/dist/{action-runtime-044ldvNL.js → .setup/action-runtime-C_G4J1MV.mjs} +52 -42
- package/dist/.setup/action-runtime.runtime-DldZIYpL.mjs +2 -0
- package/dist/{actions-BI7JkfVm.js → .setup/actions-8uuOLGDR.mjs} +20 -14
- package/dist/{approval-handler.runtime-DYv0UIZS.js → .setup/approval-handler.runtime-Bj-Kl-Ak.mjs} +7 -6
- package/dist/{channel-1vIJOzPx.js → .setup/channel-Dmbj_FF6.mjs} +43 -35
- package/dist/{channel-type-DlFSKeIZ.js → .setup/channel-type-CncPqtvr.mjs} +4 -4
- package/dist/{channel.setup-ofDi3_Pu.js → .setup/channel.setup-CTV8N2nI.mjs} +25 -24
- package/dist/{config-schema-BVIMyiDN.js → .setup/config-schema-B9GwoRlE.mjs} +5 -3
- package/dist/{conversation-binding-route-DFVLUdYF.js → .setup/conversation-binding-route-shed4O6L.mjs} +2 -2
- package/dist/{directory-config-DqfQ42OV.js → .setup/directory-config-CW4ICy0y.mjs} +6 -5
- package/dist/{directory-live-BPaNHjmP.js → .setup/directory-live-C2hI1rq1.mjs} +4 -4
- package/dist/{doctor-contract-BAy7-EUQ.js → .setup/doctor-contract-CtMUqjvk.mjs} +6 -5
- package/dist/{group-policy-BdwszjYn.js → .setup/group-policy-9pMyFFRP.mjs} +72 -41
- package/dist/{message-tool-api-CJ0kjcg5.js → .setup/message-tool-api-CBtuGn2d.mjs} +3 -3
- package/dist/{monitor-Dq5Cmrvp.js → .setup/monitor-t4yqSbLZ.mjs} +4 -4
- package/dist/{outbound-adapter-DYaI8ThX.js → .setup/outbound-adapter-CIO-lnfQ.mjs} +6 -6
- package/dist/{pipeline.runtime-Bd22U0ga.js → .setup/pipeline.runtime-xjOJ8ltM.mjs} +239 -394
- package/dist/{plugin-routes-CLp4obpN.js → .setup/plugin-routes-C3X0eVaK.mjs} +1 -1
- package/dist/{policy-CtQVbde1.js → .setup/policy-CpLMTEad.mjs} +7 -5
- package/dist/{probe-0usmAb0i.js → .setup/probe-DnWN6oBa.mjs} +115 -114
- package/dist/{provider-CN_8hFv2.js → .setup/provider-1mRMBuV5.mjs} +75 -50
- package/dist/{relay-source-BNGpsdwV.js → .setup/relay-source-DiUZ6ltP.mjs} +6 -4
- package/dist/{replies-BSiRQOJ1.js → .setup/replies-Cpng2F6w.mjs} +13 -8
- package/dist/{resolve-channels-Czheznc8.js → .setup/resolve-channels-Dpv7OyKO.mjs} +6 -5
- package/dist/{resolve-users-BAOlNimr.js → .setup/resolve-users-DmyA3D_2.mjs} +6 -5
- package/dist/.setup/runtime-setter-api-CMFvhrAr.mjs +3 -0
- package/dist/{scopes-COSlmhnH.js → .setup/scopes-Dcgl9Nme.mjs} +1 -1
- package/dist/.setup/secret-contract-api-D9UfYujm.mjs +3 -0
- package/dist/{security-audit-B_yKr7MW.js → .setup/security-audit-tCbGyCfU.mjs} +1 -1
- package/dist/{send-DS9ICrBI.js → .setup/send-CBfhmYDj.mjs} +24 -16
- package/dist/{send.runtime-D_Bb6IuH.js → .setup/send.runtime-BTyALMiN.mjs} +1 -1
- package/dist/.setup/setup-plugin-api-B1Y-kMp_.mjs +3 -0
- package/dist/{setup-surface-BGnd2pSe.js → .setup/setup-surface-BcIT0kDT.mjs} +6 -6
- package/dist/{shared-D5B-5hBg.js → .setup/shared-DWQcLrb8.mjs} +9 -9
- package/dist/{slash-dispatch.runtime-CilDmI0c.js → .setup/slash-dispatch.runtime-D5WAai-5.mjs} +1 -1
- package/dist/{target-parsing-BnMD2ZqZ.js → .setup/target-parsing-PbxGDbr9.mjs} +11 -6
- package/dist/{targets-Cx5W_n3W.js → .setup/targets-BlQcnjPc.mjs} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/api.js +17 -17
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/http-routes-api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +13 -13
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +4 -3
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/package.json +16 -10
- package/node_modules/@slack/bolt/node_modules/proxy-addr/HISTORY.md +60 -54
- package/node_modules/@slack/bolt/node_modules/proxy-addr/README.md +1 -1
- package/node_modules/@slack/bolt/node_modules/proxy-addr/index.js +32 -0
- package/node_modules/@slack/bolt/node_modules/proxy-addr/package.json +8 -4
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/retry-handler.js +42 -7
- package/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/undici/lib/interceptor/decompress.js +146 -14
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/package.json +6 -6
- package/dist/action-runtime.runtime-BL3KzX13.js +0 -2
- package/node_modules/@slack/bolt/node_modules/negotiator/HISTORY.md +0 -114
- /package/dist/{account-configured-sUohAxZr.js → .setup/account-configured-sUohAxZr.mjs} +0 -0
- /package/dist/{cursor-pages-eX7p8Wwt.js → .setup/cursor-pages-eX7p8Wwt.mjs} +0 -0
- /package/dist/{registry-bbjH7IHX.js → .setup/registry-bbjH7IHX.mjs} +0 -0
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{runtime-JSVZSWAj.js → .setup/runtime-JSVZSWAj.mjs} +0 -0
- /package/dist/{secret-contract-DxmvbxBF.js → .setup/secret-contract-DxmvbxBF.mjs} +0 -0
- /package/dist/{send-results-eeOu_HYm.js → .setup/send-results-eeOu_HYm.mjs} +0 -0
- /package/dist/{slash-commands.runtime-BTTMlmwy.js → .setup/slash-commands.runtime-BTTMlmwy.mjs} +0 -0
- /package/dist/{slash-skill-commands.runtime-CD1J2ODY.js → .setup/slash-skill-commands.runtime-CD1J2ODY.mjs} +0 -0
- /package/dist/{streaming-compat-B-e0mqM0.js → .setup/streaming-compat-B-e0mqM0.mjs} +0 -0
- /package/dist/{thread-ts-DUGhaYKq.js → .setup/thread-ts-DUGhaYKq.mjs} +0 -0
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath } from "./registry-bbjH7IHX.
|
|
2
|
-
import { a as resolveSlackAccount, d as resolveSlackAppToken, f as resolveSlackBotToken, i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom, s as resolveSlackAccountDmPolicy, u as formatSlackBotTokenIdentityWarning } from "./accounts-
|
|
3
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
4
|
-
import { Ct as isSlackApprovalAuthorizedSender, G as isSlackCallbackActionId, J as decodeSlackQuestionAction, K as isSlackQuestionActionId, L as truncateSlackText, M as SLACK_TEXT_LIMIT, Tt as isSlackExecApprovalAuthorizedSender, W as isSlackApprovalActionId, Y as resolveSlackQuestionAction, a as qualifySlackConversationId, et as escapeSlackMrkdwn, lt as isSlackAnyNativeApprovalClientEnabled, nt as decodeSlackApprovalAction, o as qualifySlackRoutePeerId, s as resolveSlackEnterpriseMainDmSessionKey, t as buildSlackChannelIdCandidates, xt as registerSlackInstallationState } from "./group-policy-
|
|
5
|
-
import {
|
|
6
|
-
import { n as getSlackRuntime, t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.
|
|
7
|
-
import { C as hasSlackMessageTableBlock, b as saveRemoteMedia, f as readSlackMessages, y as isGovSlackClient } from "./actions-
|
|
8
|
-
import { i as setSlackDefaultSendIdentity, p as requireSlackPostMessageTimestamp } from "./send-
|
|
9
|
-
import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.
|
|
10
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
11
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
12
|
-
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
1
|
+
import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath } from "./registry-bbjH7IHX.mjs";
|
|
2
|
+
import { a as resolveSlackAccount, d as resolveSlackAppToken, f as resolveSlackBotToken, i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom, s as resolveSlackAccountDmPolicy, u as formatSlackBotTokenIdentityWarning } from "./accounts-C1FspRF-.mjs";
|
|
3
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-PbxGDbr9.mjs";
|
|
4
|
+
import { Ct as isSlackApprovalAuthorizedSender, G as isSlackCallbackActionId, J as decodeSlackQuestionAction, K as isSlackQuestionActionId, L as truncateSlackText, M as SLACK_TEXT_LIMIT, Tt as isSlackExecApprovalAuthorizedSender, W as isSlackApprovalActionId, Y as resolveSlackQuestionAction, a as qualifySlackConversationId, et as escapeSlackMrkdwn, lt as isSlackAnyNativeApprovalClientEnabled, nt as decodeSlackApprovalAction, o as qualifySlackRoutePeerId, s as resolveSlackEnterpriseMainDmSessionKey, t as buildSlackChannelIdCandidates, xt as registerSlackInstallationState } from "./group-policy-9pMyFFRP.mjs";
|
|
5
|
+
import { C as normalizeAllowListLower, D as resolveSlackUserAllowListForTeam, E as resolveSlackAllowListMatch, S as normalizeAllowList, T as normalizeSlackSlug, _ as resolveSlackLookupClientOptions, a as slackIngressIdentity, d as createSlackWebClient, i as createSlackIngressSubject, l as createSlackStartupAuthClient, o as formatSlackError, p as getSlackListenerUploadCompletionClient, v as resolveSlackProxyDispatcher, w as normalizeSlackAllowOwnerEntry, x as allowListMatches, y as resolveSlackWebClientOptions } from "./probe-DnWN6oBa.mjs";
|
|
6
|
+
import { n as getSlackRuntime, t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.mjs";
|
|
7
|
+
import { C as hasSlackMessageTableBlock, b as saveRemoteMedia, f as readSlackMessages, y as isGovSlackClient } from "./actions-8uuOLGDR.mjs";
|
|
8
|
+
import { i as setSlackDefaultSendIdentity, p as requireSlackPostMessageTimestamp } from "./send-CBfhmYDj.mjs";
|
|
9
|
+
import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.mjs";
|
|
10
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-Dpv7OyKO.mjs";
|
|
11
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-DmyA3D_2.mjs";
|
|
12
|
+
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-CpLMTEad.mjs";
|
|
13
13
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
14
14
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
15
15
|
import { asNonArrayRecord, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -20,11 +20,11 @@ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
|
20
20
|
import { computeBackoff, createNonExitingRuntime, createSubsystemLogger, danger, getChildLogger, logVerbose, shouldLogVerbose, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
21
21
|
import { chunkItems } from "openclaw/plugin-sdk/text-chunking";
|
|
22
22
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
23
|
+
import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, formatAllowlistMatchMeta, mergeAllowlist, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
23
24
|
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
24
25
|
import { withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
25
26
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
26
27
|
import { WebAPIHTTPError, WebAPIPlatformError, WebAPIRateLimitedError, WebAPIRequestError, WebClient } from "@slack/web-api";
|
|
27
|
-
import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, formatAllowlistMatchMeta, mergeAllowlist, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
28
28
|
import { buildPluginBindingResolvedText, parsePluginBindingApprovalCustomId, resolveConversationLabel as resolveConversationLabel$1, resolvePluginConversationBindingApproval, resolveRuntimeConversationBindingRoute, upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
|
|
29
29
|
import { createChannelIngressResolver, readChannelIngressStoreAllowFromForDmPolicy } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
30
30
|
import { collectErrorGraphCandidates, extractErrorCode, formatErrorMessage, isApprovalNotFoundError, readErrorName, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -237,8 +237,8 @@ function createSlackAgentViewState(params) {
|
|
|
237
237
|
//#endregion
|
|
238
238
|
//#region extensions/slack/src/monitor/assistant-thread-context.ts
|
|
239
239
|
const SLACK_ASSISTANT_THREAD_CONTEXT_METADATA_EVENT = "assistant_thread_context";
|
|
240
|
-
const SLACK_ASSISTANT_CONTEXT_TTL_MS =
|
|
241
|
-
const SLACK_ASSISTANT_CONTEXT_CLEANUP_INTERVAL_MS =
|
|
240
|
+
const SLACK_ASSISTANT_CONTEXT_TTL_MS = 864e5;
|
|
241
|
+
const SLACK_ASSISTANT_CONTEXT_CLEANUP_INTERVAL_MS = 6e5;
|
|
242
242
|
function buildSlackAssistantThreadMetadata(context) {
|
|
243
243
|
const eventPayload = {};
|
|
244
244
|
if (context.channelId) eventPayload.channel_id = context.channelId;
|
|
@@ -477,12 +477,12 @@ function resolveSlackSystemEventRoute(params) {
|
|
|
477
477
|
const SLACK_CHANNEL_CACHE_MAX_ENTRIES = 1024;
|
|
478
478
|
const SLACK_USER_CACHE_MAX_ENTRIES = 2048;
|
|
479
479
|
const SLACK_AVATAR_CACHE_MAX_ENTRIES = 128;
|
|
480
|
-
const SLACK_AVATAR_MAX_BYTES =
|
|
480
|
+
const SLACK_AVATAR_MAX_BYTES = 262144;
|
|
481
481
|
const SLACK_AVATAR_SSRF_POLICY = {
|
|
482
482
|
allowedHostnames: ["avatars.slack-edge.com", "*.slack-edge.com"],
|
|
483
483
|
hostnameAllowlist: ["avatars.slack-edge.com", "*.slack-edge.com"]
|
|
484
484
|
};
|
|
485
|
-
const SLACK_CHANNEL_DENIAL_WARNING_TTL_MS =
|
|
485
|
+
const SLACK_CHANNEL_DENIAL_WARNING_TTL_MS = 3e5;
|
|
486
486
|
const SLACK_CHANNEL_DENIAL_WARNING_MAX_ENTRIES = 1024;
|
|
487
487
|
function createSlackMonitorContext(params) {
|
|
488
488
|
const channelHistories = /* @__PURE__ */ new Map();
|
|
@@ -587,7 +587,8 @@ function createSlackMonitorContext(params) {
|
|
|
587
587
|
}
|
|
588
588
|
};
|
|
589
589
|
const resolveUserAvatar = (userId, eventScope) => {
|
|
590
|
-
|
|
590
|
+
const client = eventScope?.client ?? params.app.client;
|
|
591
|
+
if (isGovSlackClient(client)) return;
|
|
591
592
|
const imageUrl = readLruMapEntry(userCache, scopedKey(userId, eventScope))?.imageUrl;
|
|
592
593
|
if (!imageUrl) return;
|
|
593
594
|
const cacheKey = scopedKey(`${userId}\0${imageUrl}`, eventScope);
|
|
@@ -1389,7 +1390,8 @@ function createSlackDurableIngress(options) {
|
|
|
1389
1390
|
}
|
|
1390
1391
|
};
|
|
1391
1392
|
try {
|
|
1392
|
-
|
|
1393
|
+
const event = raw.kind === "events-api" ? asOptionalRecord(raw.body)?.event : void 0;
|
|
1394
|
+
if (asOptionalRecord(event)?.type === "channel_id_changed") {
|
|
1393
1395
|
const channelTurns = activeChannelTurns.get(laneKey);
|
|
1394
1396
|
if (channelTurns && channelTurns.size > 0) {
|
|
1395
1397
|
adoptOnCompletion = true;
|
|
@@ -1501,7 +1503,8 @@ async function resolveThreadTsFromHistory(params) {
|
|
|
1501
1503
|
inclusive: true,
|
|
1502
1504
|
limit: 1
|
|
1503
1505
|
});
|
|
1504
|
-
|
|
1506
|
+
const message = response.messages?.find((entry) => entry.ts === params.messageTs) ?? response.messages?.[0];
|
|
1507
|
+
return normalizeOptionalString(message?.thread_ts);
|
|
1505
1508
|
}
|
|
1506
1509
|
function createSlackThreadTsResolver(params) {
|
|
1507
1510
|
const ttlMs = Math.max(0, parseFiniteNumber(params.cacheTtlMs) ?? DEFAULT_THREAD_TS_CACHE_TTL_MS);
|
|
@@ -1957,7 +1960,8 @@ function resolveSlackEventScope(params) {
|
|
|
1957
1960
|
ok: false,
|
|
1958
1961
|
reason: "enterprise_event_for_workspace_account"
|
|
1959
1962
|
} : { ok: true };
|
|
1960
|
-
const
|
|
1963
|
+
const body = params.body && typeof params.body === "object" ? params.body : {};
|
|
1964
|
+
const apiAppId = normalizeOptionalString(body.api_app_id);
|
|
1961
1965
|
if (apiAppId && params.identity.apiAppId && apiAppId !== params.identity.apiAppId) return {
|
|
1962
1966
|
ok: false,
|
|
1963
1967
|
reason: "wrong_app"
|
|
@@ -2120,9 +2124,10 @@ function registerSlackChannelIdChangedEvent(params) {
|
|
|
2120
2124
|
const oldChannelId = payload.old_channel_id;
|
|
2121
2125
|
const newChannelId = payload.new_channel_id;
|
|
2122
2126
|
if (!oldChannelId || !newChannelId) return;
|
|
2127
|
+
const channelInfo = await ctx.resolveChannelName(newChannelId);
|
|
2123
2128
|
const label = resolveSlackChannelLabel({
|
|
2124
2129
|
channelId: newChannelId,
|
|
2125
|
-
channelName:
|
|
2130
|
+
channelName: channelInfo?.name
|
|
2126
2131
|
});
|
|
2127
2132
|
ctx.runtime.log?.(warn(`[slack] Channel ID changed: ${oldChannelId} → ${newChannelId} (${label})`));
|
|
2128
2133
|
if (!resolveChannelConfigWrites({
|
|
@@ -2375,7 +2380,8 @@ function isSlackReplyActionId(actionId) {
|
|
|
2375
2380
|
return actionId === "openclaw:reply_button" || actionId === "openclaw:reply_select" || actionId.startsWith(`openclaw:reply_button:`) || actionId.startsWith(`openclaw:reply_select:`);
|
|
2376
2381
|
}
|
|
2377
2382
|
function readSlackApprovalAction(parsed) {
|
|
2378
|
-
|
|
2383
|
+
const value = normalizeOptionalString(parsed.actionSummary.value) ?? parsed.actionSummary.selectedValues?.map((entry) => normalizeOptionalString(entry)).find((entry) => Boolean(entry));
|
|
2384
|
+
return decodeSlackApprovalAction(value);
|
|
2379
2385
|
}
|
|
2380
2386
|
function isSlackReplyLinkAction(parsed) {
|
|
2381
2387
|
if (parsed.actionId === "openclaw:session_link") return true;
|
|
@@ -2500,11 +2506,19 @@ async function handleSlackPluginBindingApproval(params) {
|
|
|
2500
2506
|
await respondEphemeral(params.respond, buildPluginBindingResolvedText(resolved));
|
|
2501
2507
|
return true;
|
|
2502
2508
|
}
|
|
2509
|
+
function formatSlackPluginApprovalSenderId(userId, eventScope) {
|
|
2510
|
+
return formatSlackTarget({
|
|
2511
|
+
kind: "user",
|
|
2512
|
+
id: userId,
|
|
2513
|
+
teamId: eventScope?.teamId
|
|
2514
|
+
});
|
|
2515
|
+
}
|
|
2503
2516
|
async function handleSlackApprovalInteraction(params) {
|
|
2517
|
+
const pluginSenderId = formatSlackPluginApprovalSenderId(params.parsed.userId, params.eventScope);
|
|
2504
2518
|
const pluginApprovalAuthorizedSender = isSlackApprovalAuthorizedSender({
|
|
2505
2519
|
cfg: params.ctx.cfg,
|
|
2506
2520
|
accountId: params.ctx.accountId,
|
|
2507
|
-
senderId:
|
|
2521
|
+
senderId: pluginSenderId
|
|
2508
2522
|
});
|
|
2509
2523
|
const execApprovalAuthorizedSender = isSlackExecApprovalAuthorizedSender({
|
|
2510
2524
|
cfg: params.ctx.cfg,
|
|
@@ -2524,7 +2538,7 @@ async function handleSlackApprovalInteraction(params) {
|
|
|
2524
2538
|
decision: params.approval.decision,
|
|
2525
2539
|
channel: "slack",
|
|
2526
2540
|
accountId: params.ctx.accountId,
|
|
2527
|
-
senderId: params.parsed.userId
|
|
2541
|
+
senderId: params.approval.approvalKind === "plugin" ? pluginSenderId : params.parsed.userId
|
|
2528
2542
|
});
|
|
2529
2543
|
const terminalLabel = resolveSlackApprovalTerminalLabel(result.approval);
|
|
2530
2544
|
const prefix = result.applied ? "Resolved" : "Already resolved";
|
|
@@ -2560,10 +2574,11 @@ async function handleSlackApprovalInteraction(params) {
|
|
|
2560
2574
|
async function handleSlackLegacyApprovalInteraction(params) {
|
|
2561
2575
|
const parsedApproval = parseExecApprovalCommandText(params.pluginInteractionData);
|
|
2562
2576
|
if (!parsedApproval) return false;
|
|
2577
|
+
const pluginSenderId = formatSlackPluginApprovalSenderId(params.parsed.userId, params.eventScope);
|
|
2563
2578
|
const pluginAuthorized = isSlackApprovalAuthorizedSender({
|
|
2564
2579
|
cfg: params.ctx.cfg,
|
|
2565
2580
|
accountId: params.ctx.accountId,
|
|
2566
|
-
senderId:
|
|
2581
|
+
senderId: pluginSenderId
|
|
2567
2582
|
});
|
|
2568
2583
|
const execAuthorized = isSlackExecApprovalAuthorizedSender({
|
|
2569
2584
|
cfg: params.ctx.cfg,
|
|
@@ -2585,7 +2600,7 @@ async function handleSlackLegacyApprovalInteraction(params) {
|
|
|
2585
2600
|
decision: parsedApproval.decision,
|
|
2586
2601
|
channel: "slack",
|
|
2587
2602
|
accountId: params.ctx.accountId,
|
|
2588
|
-
senderId: params.parsed.userId,
|
|
2603
|
+
senderId: resolveMethod === "plugin" ? pluginSenderId : params.parsed.userId,
|
|
2589
2604
|
resolveMethod
|
|
2590
2605
|
});
|
|
2591
2606
|
try {
|
|
@@ -3629,7 +3644,8 @@ function registerSlackMemberEvents(params) {
|
|
|
3629
3644
|
eventScope
|
|
3630
3645
|
});
|
|
3631
3646
|
if (!ingressContext) return;
|
|
3632
|
-
|
|
3647
|
+
const userLabel = (payload.user ? await ctx.resolveUserName(payload.user, eventScope) : {})?.name ?? payload.user ?? "someone";
|
|
3648
|
+
enqueueRoutedSystemEvent(`Slack: ${userLabel} ${paramsLocal.verb} ${ingressContext.channelLabel}.`, ingressContext.route, { contextKey: `slack:member:${eventScope ? `${eventScope.teamId}:` : ""}${paramsLocal.verb}:${channelId ?? "unknown"}:${payload.user ?? "unknown"}:${paramsLocal.eventId}` });
|
|
3633
3649
|
} catch (err) {
|
|
3634
3650
|
ctx.runtime.error?.(danger(`slack ${paramsLocal.verb} handler failed: ${formatErrorMessage(err)}`));
|
|
3635
3651
|
if (err instanceof SlackSystemEventAuthRetryError) throw err;
|
|
@@ -3819,7 +3835,8 @@ function addUserCandidate(candidates, value, botUserId) {
|
|
|
3819
3835
|
candidates.add(id);
|
|
3820
3836
|
}
|
|
3821
3837
|
function collectMetadataUserCandidates(candidates, value, botUserId) {
|
|
3822
|
-
const
|
|
3838
|
+
const metadata = asOptionalRecord(value);
|
|
3839
|
+
const payload = asOptionalRecord(metadata?.event_payload);
|
|
3823
3840
|
if (!payload) return;
|
|
3824
3841
|
for (const key of [
|
|
3825
3842
|
"user",
|
|
@@ -4119,7 +4136,8 @@ function registerSlackReactionEvents(params) {
|
|
|
4119
4136
|
const emojiLabel = event.reaction ?? "emoji";
|
|
4120
4137
|
const authorLabel = authorInfo?.name ?? event.item_user;
|
|
4121
4138
|
const baseText = `Slack reaction ${action}: :${emojiLabel}: by ${actorLabel} in ${ingressContext.channelLabel} msg ${item.ts}`;
|
|
4122
|
-
|
|
4139
|
+
const text = authorLabel ? `${baseText} from ${authorLabel}` : baseText;
|
|
4140
|
+
enqueueRoutedSystemEvent(text, ingressContext.route, { contextKey: `slack:reaction:${eventScope ? `${eventScope.teamId}:` : ""}${action}:${item.channel}:${item.ts}:${event.user}:${emojiLabel}:${eventId}` });
|
|
4123
4141
|
} catch (err) {
|
|
4124
4142
|
ctx.runtime.error?.(danger(`slack reaction handler failed: ${formatErrorMessage(err)}`));
|
|
4125
4143
|
}
|
|
@@ -4198,7 +4216,7 @@ function registerSlackWorkspaceEvents(params) {
|
|
|
4198
4216
|
}
|
|
4199
4217
|
//#endregion
|
|
4200
4218
|
//#region extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
4201
|
-
const SLACK_MESSAGE_DISPATCH_DEDUPE_TTL_MS =
|
|
4219
|
+
const SLACK_MESSAGE_DISPATCH_DEDUPE_TTL_MS = 864e5;
|
|
4202
4220
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_MEMORY_MAX_ENTRIES = 2e4;
|
|
4203
4221
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_STATE_MAX_ENTRIES = 2e4;
|
|
4204
4222
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_NAMESPACE = "global";
|
|
@@ -4265,7 +4283,7 @@ function buildSlackDebounceKey(message, accountId, teamId) {
|
|
|
4265
4283
|
}
|
|
4266
4284
|
//#endregion
|
|
4267
4285
|
//#region extensions/slack/src/monitor/message-handler.ts
|
|
4268
|
-
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-
|
|
4286
|
+
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-xjOJ8ltM.mjs"));
|
|
4269
4287
|
const RETRYABLE_FLUSH_MAX_ATTEMPTS = 3;
|
|
4270
4288
|
const RETRYABLE_FLUSH_RETRY_DELAY_MS = 1e3;
|
|
4271
4289
|
const REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE = /reply session initialization conflicted for \S+/u;
|
|
@@ -4273,8 +4291,9 @@ function isRetryableSlackInboundError(error) {
|
|
|
4273
4291
|
return collectErrorGraphCandidates(error, (current) => [current.cause, current.error]).some((candidate) => REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE.test(formatErrorMessage(candidate)));
|
|
4274
4292
|
}
|
|
4275
4293
|
function shouldDebounceSlackMessage(message, cfg) {
|
|
4294
|
+
const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");
|
|
4276
4295
|
return shouldDebounceTextInbound({
|
|
4277
|
-
text:
|
|
4296
|
+
text: textForCommandDetection,
|
|
4278
4297
|
cfg,
|
|
4279
4298
|
hasMedia: Boolean(message.files && message.files.length > 0) || hasSlackMessageTableBlock(message)
|
|
4280
4299
|
});
|
|
@@ -4532,11 +4551,11 @@ function createSlackMessageHandler(params) {
|
|
|
4532
4551
|
}
|
|
4533
4552
|
//#endregion
|
|
4534
4553
|
//#region extensions/slack/src/monitor/presence-monitor.ts
|
|
4535
|
-
const SLACK_PRESENCE_GREETING_COOLDOWN_MS =
|
|
4554
|
+
const SLACK_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
4536
4555
|
const SLACK_PRESENCE_REQUEST_TIMEOUT_MS = 3e4;
|
|
4537
4556
|
const SLACK_PRESENCE_POLL_INTERVAL_MS = 6e4;
|
|
4538
4557
|
const SLACK_PRESENCE_AUTO_MAX_PARTICIPANTS = 8;
|
|
4539
|
-
const SLACK_PRESENCE_TARGET_TTL_MS =
|
|
4558
|
+
const SLACK_PRESENCE_TARGET_TTL_MS = 864e5;
|
|
4540
4559
|
const SLACK_PRESENCE_MAX_POLLS_PER_INTERVAL = 45;
|
|
4541
4560
|
const SLACK_PRESENCE_MAX_TARGETS = 2e3;
|
|
4542
4561
|
const DEFAULT_SLACK_PRESENCE_EVENT_PROMPT = ["Before greeting, retrieve relevant memory and wiki context for this immutable user_id, including a known timezone when available. Use their local time; if their timezone is unknown, do not guess.", "Send at most one short, natural greeting in this Slack conversation. Do not reveal private memory. If no greeting is appropriate, stay silent."];
|
|
@@ -5144,8 +5163,8 @@ async function authorizeSlackDirectMessage(params) {
|
|
|
5144
5163
|
//#endregion
|
|
5145
5164
|
//#region extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
5146
5165
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
5147
|
-
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(
|
|
5148
|
-
const SLACK_EXTERNAL_ARG_MENU_TTL_MS =
|
|
5166
|
+
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(24)}}$`);
|
|
5167
|
+
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 6e5;
|
|
5149
5168
|
const SLACK_EXTERNAL_ARG_MENU_PREFIX = "openclaw_cmdarg_ext:";
|
|
5150
5169
|
function pruneSlackExternalArgMenuStore(store, rawNow) {
|
|
5151
5170
|
const now = asDateTimestampMs(rawNow);
|
|
@@ -5236,9 +5255,9 @@ const SLACK_COMMAND_ARG_BUTTON_VALUE_MAX = 2e3;
|
|
|
5236
5255
|
const SLACK_COMMAND_ARG_CONFIRM_TEXT_MAX = 300;
|
|
5237
5256
|
const SLACK_HEADER_TEXT_MAX = 150;
|
|
5238
5257
|
const SLACK_COMMAND_ARG_ACTION_BLOCKS_MAX = 47;
|
|
5239
|
-
const loadSlashCommandsRuntime = createLazyRuntimeModule(() => import("./slash-commands.runtime-BTTMlmwy.
|
|
5240
|
-
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-
|
|
5241
|
-
const loadSlashSkillCommandsRuntime = createLazyRuntimeModule(() => import("./slash-skill-commands.runtime-CD1J2ODY.
|
|
5258
|
+
const loadSlashCommandsRuntime = createLazyRuntimeModule(() => import("./slash-commands.runtime-BTTMlmwy.mjs"));
|
|
5259
|
+
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-D5WAai-5.mjs"));
|
|
5260
|
+
const loadSlashSkillCommandsRuntime = createLazyRuntimeModule(() => import("./slash-skill-commands.runtime-CD1J2ODY.mjs"));
|
|
5242
5261
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
5243
5262
|
function resolveSlackCommandMenuModelContext(params) {
|
|
5244
5263
|
if (!params.sessionKey.trim()) return {};
|
|
@@ -5288,6 +5307,8 @@ function resolveSlackCommandMenuModelContext(params) {
|
|
|
5288
5307
|
}
|
|
5289
5308
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
5290
5309
|
function buildSlackArgMenuConfirm(params) {
|
|
5310
|
+
const command = escapeSlackMrkdwn(params.command);
|
|
5311
|
+
const arg = escapeSlackMrkdwn(params.arg);
|
|
5291
5312
|
return {
|
|
5292
5313
|
title: {
|
|
5293
5314
|
type: "plain_text",
|
|
@@ -5295,7 +5316,7 @@ function buildSlackArgMenuConfirm(params) {
|
|
|
5295
5316
|
},
|
|
5296
5317
|
text: {
|
|
5297
5318
|
type: "mrkdwn",
|
|
5298
|
-
text: truncateSlackText(`Run */${
|
|
5319
|
+
text: truncateSlackText(`Run */${command}* with *${arg}* set to this value?`, SLACK_COMMAND_ARG_CONFIRM_TEXT_MAX)
|
|
5299
5320
|
},
|
|
5300
5321
|
confirm: {
|
|
5301
5322
|
type: "plain_text",
|
|
@@ -6096,12 +6117,13 @@ async function deliverSlackSlashResponseWithWebApi(params) {
|
|
|
6096
6117
|
const mrkdwn = "mrkdwn" in payload && typeof payload.mrkdwn === "boolean" ? payload.mrkdwn : void 0;
|
|
6097
6118
|
if (payload.response_type === "in_channel") {
|
|
6098
6119
|
const postSlackMessage = params.client.chat.postMessage;
|
|
6099
|
-
|
|
6120
|
+
const response = await postSlackMessage({
|
|
6100
6121
|
channel: params.command.channel_id,
|
|
6101
6122
|
text,
|
|
6102
6123
|
...blocks ? { blocks } : {},
|
|
6103
6124
|
...mrkdwn !== void 0 ? { mrkdwn } : {}
|
|
6104
|
-
})
|
|
6125
|
+
});
|
|
6126
|
+
requireSlackPostMessageTimestamp(response);
|
|
6105
6127
|
} else await params.client.chat.postEphemeral({
|
|
6106
6128
|
channel: params.command.channel_id,
|
|
6107
6129
|
user: params.command.user_id,
|
|
@@ -6133,8 +6155,8 @@ async function getSlackBoltInterop() {
|
|
|
6133
6155
|
}
|
|
6134
6156
|
return slackBoltInterop;
|
|
6135
6157
|
}
|
|
6136
|
-
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-
|
|
6137
|
-
const SLACK_WEBHOOK_MAX_BODY_BYTES =
|
|
6158
|
+
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-DiUZ6ltP.mjs"));
|
|
6159
|
+
const SLACK_WEBHOOK_MAX_BODY_BYTES = 1048576;
|
|
6138
6160
|
const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
|
|
6139
6161
|
function resolveSlackRuntimeIdentity(params) {
|
|
6140
6162
|
const botUserId = normalizeOptionalString(params.botUserId);
|
|
@@ -6275,8 +6297,9 @@ async function monitorSlackProvider(opts = {}) {
|
|
|
6275
6297
|
const groupDmChannels = dmConfig?.groupChannels;
|
|
6276
6298
|
let channelsConfig = slackCfg.channels;
|
|
6277
6299
|
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
6300
|
+
const providerConfigPresent = cfg.channels?.slack !== void 0;
|
|
6278
6301
|
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy$1({
|
|
6279
|
-
providerConfigPresent
|
|
6302
|
+
providerConfigPresent,
|
|
6280
6303
|
groupPolicy: slackCfg.groupPolicy,
|
|
6281
6304
|
defaultGroupPolicy
|
|
6282
6305
|
});
|
|
@@ -6577,10 +6600,11 @@ async function monitorSlackProvider(opts = {}) {
|
|
|
6577
6600
|
summarizeMapping("slack users", mapping, [], runtime);
|
|
6578
6601
|
}
|
|
6579
6602
|
if (allowNameMatching) try {
|
|
6580
|
-
const
|
|
6603
|
+
const resolvedUsers = await resolveSlackUserAllowlist({
|
|
6581
6604
|
token: resolveToken,
|
|
6582
6605
|
entries: allowEntries
|
|
6583
|
-
})
|
|
6606
|
+
});
|
|
6607
|
+
const { mapping, unresolved, additions } = buildAllowlistResolutionSummary(resolvedUsers, { formatResolved: formatSlackUserResolved });
|
|
6584
6608
|
allowFrom = mergeAllowlist({
|
|
6585
6609
|
existing: allowFrom,
|
|
6586
6610
|
additions
|
|
@@ -6607,10 +6631,11 @@ async function monitorSlackProvider(opts = {}) {
|
|
|
6607
6631
|
summarizeMapping("slack channel users", mapping, [], runtime);
|
|
6608
6632
|
}
|
|
6609
6633
|
if (allowNameMatching) try {
|
|
6610
|
-
const
|
|
6634
|
+
const resolvedUsers = await resolveSlackUserAllowlist({
|
|
6611
6635
|
token: resolveToken,
|
|
6612
6636
|
entries: Array.from(userEntries)
|
|
6613
|
-
})
|
|
6637
|
+
});
|
|
6638
|
+
const { resolvedMap, mapping, unresolved } = buildAllowlistResolutionSummary(resolvedUsers, { formatResolved: formatSlackUserResolved });
|
|
6614
6639
|
const nextChannels = patchAllowlistUsersInConfigEntries({
|
|
6615
6640
|
entries: channelsConfig,
|
|
6616
6641
|
resolvedMap
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as formatUnknownError, m as SLACK_SOCKET_RECONNECT_POLICY } from "./provider-
|
|
1
|
+
import { h as formatUnknownError, m as SLACK_SOCKET_RECONNECT_POLICY } from "./provider-1mRMBuV5.mjs";
|
|
2
2
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { computeBackoff, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
4
4
|
import { isIP } from "node:net";
|
|
@@ -10,7 +10,7 @@ const SLACK_RELAY_ROUTE_KINDS = /* @__PURE__ */ new Set([
|
|
|
10
10
|
"thread_affinity",
|
|
11
11
|
"channel_default"
|
|
12
12
|
]);
|
|
13
|
-
const SLACK_RELAY_MAX_PAYLOAD_BYTES =
|
|
13
|
+
const SLACK_RELAY_MAX_PAYLOAD_BYTES = 1048576;
|
|
14
14
|
async function monitorSlackRelaySource(params) {
|
|
15
15
|
let reconnectAttempts = 0;
|
|
16
16
|
while (!params.abortSignal?.aborted) {
|
|
@@ -56,7 +56,8 @@ async function monitorSlackRelaySource(params) {
|
|
|
56
56
|
function openRelayWebSocket(config, abortSignal) {
|
|
57
57
|
if (abortSignal?.aborted) return Promise.reject(/* @__PURE__ */ new Error("Slack relay websocket aborted before connect"));
|
|
58
58
|
return new Promise((resolve, reject) => {
|
|
59
|
-
const
|
|
59
|
+
const url = buildRelayWebSocketUrl(config);
|
|
60
|
+
const ws = new WebSocket(url, buildRelayWebSocketOptions(config.authToken));
|
|
60
61
|
const cleanup = () => {
|
|
61
62
|
ws.off("open", onOpen);
|
|
62
63
|
ws.off("error", onError);
|
|
@@ -210,7 +211,8 @@ function extractRelaySlackMessageEvent(frame) {
|
|
|
210
211
|
const routeRecord = asOptionalRecord(record.route);
|
|
211
212
|
const routeKind = stringValue(routeRecord?.kind);
|
|
212
213
|
const routeKey = stringValue(routeRecord?.key);
|
|
213
|
-
const
|
|
214
|
+
const payload = asOptionalRecord(record.payload);
|
|
215
|
+
const event = asOptionalRecord(payload?.event);
|
|
214
216
|
if (event?.type !== "message" || typeof event.channel !== "string") return;
|
|
215
217
|
if (!deliveryId || !routeKind || !SLACK_RELAY_ROUTE_KINDS.has(routeKind) || !routeKey) return;
|
|
216
218
|
return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as isSlackNativeResponseUrlRejection, M as SLACK_TEXT_LIMIT, S as isSlackInvalidBlocksResponse, T as buildSlackBlocksFallbackText, Z as markdownToSlackMrkdwnChunks, b as hasSlackNativeDataBlock, d as resolveSlackReplyBlockResolution, f as resolveSlackReplyBlocks, l as hasSlackReplyStructuredContent, v as buildSlackNativeDataAccessibilityText } from "./group-policy-
|
|
2
|
-
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, r as sendMessageSlack } from "./send-
|
|
3
|
-
import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./provider-
|
|
1
|
+
import { C as isSlackNativeResponseUrlRejection, M as SLACK_TEXT_LIMIT, S as isSlackInvalidBlocksResponse, T as buildSlackBlocksFallbackText, Z as markdownToSlackMrkdwnChunks, b as hasSlackNativeDataBlock, d as resolveSlackReplyBlockResolution, f as resolveSlackReplyBlocks, l as hasSlackReplyStructuredContent, v as buildSlackNativeDataAccessibilityText } from "./group-policy-9pMyFFRP.mjs";
|
|
2
|
+
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, r as sendMessageSlack } from "./send-CBfhmYDj.mjs";
|
|
3
|
+
import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./provider-1mRMBuV5.mjs";
|
|
4
4
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
5
5
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
6
6
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
@@ -141,7 +141,8 @@ async function deliverReplies(params) {
|
|
|
141
141
|
});
|
|
142
142
|
const reply = resolveSendableOutboundReplyParts(payload);
|
|
143
143
|
const textRaw = reply.hasText && !isSilentReplyText(reply.trimmedText, SILENT_REPLY_TOKEN) ? reply.trimmedText : void 0;
|
|
144
|
-
const
|
|
144
|
+
const materializeAuthoredText = !reply.hasMedia && hasSlackReplyStructuredContent(payload);
|
|
145
|
+
const { authoredTextPlacement, segments } = resolveSlackReplyBlockResolution(payload, { materializeAuthoredText });
|
|
145
146
|
if (!textRaw && !reply.hasMedia && segments.length === 0) continue;
|
|
146
147
|
const acceptedResults = [];
|
|
147
148
|
const sendReply = async (input) => {
|
|
@@ -297,8 +298,9 @@ function resolveSlackThreadTs(params) {
|
|
|
297
298
|
}).use();
|
|
298
299
|
}
|
|
299
300
|
function createSlackReplyReferencePlanner(params) {
|
|
301
|
+
const effectiveMode = params.isThreadReply ?? Boolean(params.incomingThreadTs && params.incomingThreadTs !== params.messageTs) ? "all" : params.replyToMode;
|
|
300
302
|
return createReplyReferencePlanner({
|
|
301
|
-
replyToMode:
|
|
303
|
+
replyToMode: effectiveMode,
|
|
302
304
|
existingId: params.incomingThreadTs,
|
|
303
305
|
startId: params.messageTs,
|
|
304
306
|
hasReplied: params.hasReplied
|
|
@@ -345,7 +347,8 @@ async function deliverSlackSlashReplies(params) {
|
|
|
345
347
|
if (payload.isReasoning === true) continue;
|
|
346
348
|
const reply = resolveSendableOutboundReplyParts(payload);
|
|
347
349
|
const textRaw = reply.hasText && !isSilentReplyText(reply.trimmedText, SILENT_REPLY_TOKEN) ? reply.trimmedText : void 0;
|
|
348
|
-
const
|
|
350
|
+
const materializeAuthoredText = hasSlackReplyStructuredContent(payload);
|
|
351
|
+
const { authoredTextPlacement, segments } = resolveSlackReplyBlockResolution(payload, { materializeAuthoredText });
|
|
349
352
|
let outsideText = authoredTextPlacement === "outside-blocks" ? textRaw ?? "" : "";
|
|
350
353
|
const messages = [];
|
|
351
354
|
const hookParts = [];
|
|
@@ -457,7 +460,8 @@ async function deliverSlackSlashReplies(params) {
|
|
|
457
460
|
if (initialRemaining !== void 0 && initialMinimumCalls > initialRemaining) await failOversizedDelivery();
|
|
458
461
|
const deliverNativeFallback = async (messages, onVisible) => {
|
|
459
462
|
for (const message of messages) {
|
|
460
|
-
|
|
463
|
+
const response = await respond(message);
|
|
464
|
+
if (await isSlackInvalidBlocksResponse(response)) throw new Error("Slack rejected the native-data fallback blocks with invalid_blocks.");
|
|
461
465
|
onVisible();
|
|
462
466
|
}
|
|
463
467
|
};
|
|
@@ -484,7 +488,8 @@ async function deliverSlackSlashReplies(params) {
|
|
|
484
488
|
}
|
|
485
489
|
let rejectedNativeBlocks = false;
|
|
486
490
|
try {
|
|
487
|
-
|
|
491
|
+
const response = await respond(planned.message);
|
|
492
|
+
rejectedNativeBlocks = await isSlackInvalidBlocksResponse(response);
|
|
488
493
|
if (!rejectedNativeBlocks) markVisible();
|
|
489
494
|
} catch (error) {
|
|
490
495
|
if (!isSlackNativeResponseUrlRejection(error)) throw error;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
4
|
-
import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-PbxGDbr9.mjs";
|
|
3
|
+
import { s as createSlackLookupClient } from "./probe-DnWN6oBa.mjs";
|
|
4
|
+
import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.mjs";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
7
7
|
//#region extensions/slack/src/resolve-channels.ts
|
|
@@ -83,9 +83,10 @@ async function resolveSlackChannelAllowlist(params) {
|
|
|
83
83
|
let resolvedIndex = 0;
|
|
84
84
|
return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
|
|
85
85
|
}
|
|
86
|
+
const channels = await listSlackChannels(params.client ?? createSlackLookupClient(params.token));
|
|
86
87
|
const resolved = resolveDirectoryAllowlistEntries({
|
|
87
88
|
entries: lookupEntries,
|
|
88
|
-
lookup:
|
|
89
|
+
lookup: channels,
|
|
89
90
|
parseInput: parseSlackChannelMention,
|
|
90
91
|
findById: (lookup, id) => lookup.find((channel) => channel.id === id),
|
|
91
92
|
buildIdResolved: ({ input, parsed, match }) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
2
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
4
|
-
import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-PbxGDbr9.mjs";
|
|
3
|
+
import { s as createSlackLookupClient } from "./probe-DnWN6oBa.mjs";
|
|
4
|
+
import { t as collectSlackCursorPages } from "./cursor-pages-eX7p8Wwt.mjs";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
7
7
|
//#region extensions/slack/src/resolve-users.ts
|
|
@@ -98,9 +98,10 @@ async function resolveSlackUserAllowlist(params) {
|
|
|
98
98
|
const workspaceResolved = params.entries.map(resolveWorkspaceQualifiedUser);
|
|
99
99
|
const lookupEntries = params.entries.filter((_, index) => !workspaceResolved[index]);
|
|
100
100
|
if (lookupEntries.length === 0) return workspaceResolved.filter((entry) => entry !== void 0);
|
|
101
|
+
const users = await listSlackUsers(params.client ?? createSlackLookupClient(params.token));
|
|
101
102
|
const resolved = resolveDirectoryAllowlistEntries({
|
|
102
103
|
entries: lookupEntries,
|
|
103
|
-
lookup:
|
|
104
|
+
lookup: users,
|
|
104
105
|
parseInput: parseSlackUserInput,
|
|
105
106
|
findById: (lookup, id) => lookup.find((user) => user.id === id),
|
|
106
107
|
buildIdResolved: ({ input, parsed, match }) => ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as createSlackReadClient, o as formatSlackError } from "./probe-DnWN6oBa.mjs";
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import { readChannelAllowFromStore } from "openclaw/plugin-sdk/conversation-runtime";
|
|
3
3
|
import { coerceNativeSetting, normalizeAllowFromList } from "openclaw/plugin-sdk/channel-policy";
|
|
4
4
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
|