@openclaw/slack 2026.10.10-beta.4 → 2026.10.10
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/.setup/{account-configured-zcR9TJJN.mjs → account-configured-35y0-Hso.mjs} +1 -2
- package/dist/.setup/{account-inspect-CmkKiSb9.mjs → account-inspect-Bc7TVU8F.mjs} +3 -4
- package/dist/.setup/{accounts-msihSF3-.mjs → accounts-CEgdyqoW.mjs} +6 -10
- package/dist/.setup/{action-runtime-CgYsBWl6.mjs → action-runtime-DPoxYao5.mjs} +9 -10
- package/dist/.setup/action-runtime.runtime-DWKWaKgC.mjs +1 -0
- package/dist/.setup/{actions-CafoV8hS.mjs → actions-PF2cP6to.mjs} +14 -22
- package/dist/.setup/{approval-handler.runtime-Pty8hAZ9.mjs → approval-handler.runtime-BtRklemy.mjs} +7 -8
- package/dist/.setup/{approval-message-updates-DCnXFLf3.mjs → approval-message-updates-CpwbsEj6.mjs} +2 -3
- package/dist/.setup/{channel-B7jkkIen.mjs → channel-B6bRmYmX.mjs} +32 -39
- package/dist/.setup/{channel-meta-C443t-lI.mjs → channel-meta-C5vsCo3a.mjs} +1 -2
- package/dist/.setup/{channel-type-BrbGGbzI.mjs → channel-type-Dh4vwh1Y.mjs} +5 -6
- package/dist/.setup/{channel.setup-u6QQdbTa.mjs → channel.setup-BBzT6uKA.mjs} +10 -14
- package/dist/.setup/{config-schema-DNnh6bWU.mjs → config-schema-Cz3uId-c.mjs} +2 -4
- package/dist/.setup/{directory-config-Cjj0N8R0.mjs → directory-config-BEPra1E2.mjs} +5 -6
- package/dist/.setup/{directory-live-BIKD-5B_.mjs → directory-live-BkUwPrS0.mjs} +4 -5
- package/dist/.setup/{doctor-contract-Cd4-VzIM.mjs → doctor-contract-HK8aedwU.mjs} +7 -13
- package/dist/.setup/http-GpAVKwSX.mjs +2 -0
- package/dist/.setup/{message-tool-api-BS5ekEA_.mjs → message-tool-api-DeiQJoRV.mjs} +5 -7
- package/dist/.setup/{monitor-B36YZetK.mjs → monitor-DsZUQtTM.mjs} +116 -147
- package/dist/.setup/{outbound-adapter-BlN9vmT-.mjs → outbound-adapter-C0R5jz6S.mjs} +8 -9
- package/dist/.setup/{pipeline.runtime-CT7Krkyw.mjs → pipeline.runtime-CIFVL0kf.mjs} +41 -68
- package/dist/.setup/{plugin-routes-D4qozHVn.mjs → plugin-routes-lXsy_bNV.mjs} +2 -3
- package/dist/.setup/{policy-D4eNyn8m.mjs → policy-Bp1FvE6m.mjs} +4 -6
- package/dist/.setup/{probe-IiHogLQN.mjs → probe-C5VWf3sz.mjs} +11 -19
- package/dist/.setup/{registry-DizWcnNp.mjs → registry-1G0f1zuZ.mjs} +2 -4
- package/dist/.setup/{relay-source-DCfb4yWT.mjs → relay-source-DFBDTA5Z.mjs} +4 -6
- package/dist/.setup/{replies-Dwwt4eVi.mjs → replies-7DRN46EL.mjs} +7 -9
- package/dist/.setup/{reply-blocks-CoZ_dGM_.mjs → reply-blocks-DOjiDr44.mjs} +4 -7
- package/dist/.setup/{resolve-channels-DRRhElwz.mjs → resolve-channels-BNQ1KZXh.mjs} +4 -5
- package/dist/.setup/{resolve-users-Cz8e17ky.mjs → resolve-users-C4dC8Z7D.mjs} +4 -5
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime-JSVZSWAj.mjs → runtime-C6HKn7Av.mjs} +1 -2
- package/dist/.setup/runtime-setter-api-DrXr965r.mjs +2 -0
- package/dist/.setup/{scopes-DfQVi8Jw.mjs → scopes-C1aeCBa6.mjs} +2 -3
- package/dist/.setup/{secret-contract-B-Qm6aQQ.mjs → secret-contract-D0UY2JWF.mjs} +1 -2
- package/dist/.setup/{secret-contract-api-DB6CMdgc.mjs → secret-contract-api-BhzGpUb0.mjs} +1 -1
- package/dist/.setup/{security-audit-DFGiFLqd.mjs → security-audit-C3hXCfDt.mjs} +2 -3
- package/dist/.setup/{send-pi6r24yv.mjs → send-C5uXkmZV.mjs} +14 -21
- package/dist/.setup/{send-results-eeOu_HYm.mjs → send-results-D-o6PgtS.mjs} +1 -2
- package/dist/.setup/{session-status-DQY4hZLd.mjs → session-status-CHkEn3HM.mjs} +39 -59
- package/dist/.setup/setup-plugin-api-D7DoueEh.mjs +2 -0
- package/dist/.setup/{setup-surface-9WVQgYCT.mjs → setup-surface-CtM1pm-9.mjs} +7 -8
- package/dist/.setup/{shared-DpHCoKy2.mjs → shared-CohTHxM1.mjs} +14 -18
- package/dist/.setup/{slash-dispatch.runtime-BDEJ2s49.mjs → slash-dispatch.runtime-Bnn9a5qB.mjs} +1 -1
- package/dist/.setup/{target-parsing-FFE26kOV.mjs → target-parsing-0pRZtahO.mjs} +1 -2
- package/dist/.setup/{targets-C6LZQL1Q.mjs → targets-BqXz7CpG.mjs} +2 -3
- package/dist/.setup/{thread-ts-Cvt7WD6B.mjs → thread-ts-47Au2-Yn.mjs} +1 -2
- package/dist/.source-module-urls/562d694877afe9d9dcbb3b32a8883c16974738f2aa892c48d45572cdc9a62529.json +1 -1
- package/dist/account-inspect-api.js +2 -3
- package/dist/api.js +17 -17
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-entry.js +1 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +2 -3
- 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 +2 -3
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +12 -12
- 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 -5
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/@slack/bolt/node_modules/body-parser/README.md +17 -13
- package/node_modules/@slack/bolt/node_modules/body-parser/lib/read.js +74 -57
- package/node_modules/@slack/bolt/node_modules/body-parser/lib/types/json.js +11 -11
- package/node_modules/@slack/bolt/node_modules/body-parser/lib/types/urlencoded.js +5 -5
- package/node_modules/@slack/bolt/node_modules/body-parser/lib/utils.js +0 -15
- package/node_modules/@slack/bolt/node_modules/body-parser/package.json +7 -12
- package/node_modules/undici/README.md +25 -3
- package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
- package/node_modules/undici/docs/docs/api/Errors.md +76 -1
- package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/undici/docs/docs/api/Interceptors.md +13 -6
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/undici/docs/docs/index.md +12 -12
- package/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/undici/lib/core/request.js +16 -1
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/core/util.js +26 -1
- package/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
- package/node_modules/undici/lib/dispatcher/client-h2.js +46 -14
- package/node_modules/undici/lib/dispatcher/client.js +4 -1
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/undici/lib/dispatcher/pool-base.js +65 -28
- package/node_modules/undici/lib/dispatcher/pool.js +11 -8
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
- package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
- package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
- package/node_modules/undici/lib/handler/retry-handler.js +44 -11
- package/node_modules/undici/lib/interceptor/cache.js +11 -3
- package/node_modules/undici/lib/interceptor/decompress.js +22 -9
- package/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/undici/lib/web/cookies/util.js +19 -2
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
- package/node_modules/undici/lib/web/fetch/body.js +47 -38
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/undici/lib/web/fetch/headers.js +2 -2
- package/node_modules/undici/lib/web/fetch/index.js +8 -4
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
- package/node_modules/undici/package.json +7 -5
- package/node_modules/undici/types/cache-interceptor.d.ts +10 -0
- package/node_modules/undici/types/client.d.ts +10 -4
- package/node_modules/undici/types/errors.d.ts +16 -1
- package/node_modules/undici/types/h2c-client.d.ts +1 -1
- package/node_modules/undici/types/interceptors.d.ts +6 -1
- package/package.json +5 -5
- package/dist/.setup/action-runtime.runtime-WS3mGjut.mjs +0 -1
- package/dist/.setup/http-C9sM-FXe.mjs +0 -2
- package/dist/.setup/runtime-setter-api-Cx_PV-xu.mjs +0 -2
- package/dist/.setup/setup-plugin-api-B18kDKtr.mjs +0 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath } from "./registry-
|
|
3
|
-
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, f as resolveSlackReplyToMode, h as resolveSlackBotToken, l as resolveSlackAccountDmPolicy, m as resolveSlackAppToken, o as resolveDefaultSlackAccountId, p as formatSlackBotTokenIdentityWarning, s as resolveSlackAccount } from "./accounts-
|
|
4
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
5
|
-
import { D as buildSlackCompleteBlocksFallbackText, Ft as isSlackExecApprovalAuthorizedSender, G as isSlackQuestionActionId, M as SLACK_TEXT_LIMIT, Nt as registerSlackInstallationState, P as truncateSlackText, U as isSlackApprovalActionId, W as isSlackCallbackActionId, Y as resolveSlackQuestionAction, _t as isSlackAnyNativeApprovalClientEnabled, c as qualifySlackConversationId, d as normalizeSlackRouteBindingConfig, kt as isSlackPluginApprovalAuthorizedSender, l as qualifySlackRoutePeerId, lt as decodeSlackApprovalAction, n as setSlackSessionStatus, p as resolveSlackConversationBindingRouteAsync, q as decodeSlackQuestionAction, r as buildSlackChannelIdCandidates, s as setSlackChannelPolicyBindings, st as escapeSlackMrkdwn, t as renameSlackSession, u as resolveSlackAgentRoute } from "./session-status-
|
|
6
|
-
import { A as resolveSlackAllowListMatch, C as resolveSlackLookupClientOptions, D as allowListMatches, O as normalizeSlackAllowOwnerEntry, T as resolveSlackWebClientOptions, a as slackIngressIdentity, b as writeLruMapEntry, c as collectSlackCursorPages, f as createSlackStartupAuthClient, g as getSlackListenerWriteClient, i as createSlackIngressSubject, j as resolveSlackUserAllowListForTeam, k as normalizeSlackSlug, m as createSlackWebClient, o as formatSlackError, v as pruneExpiredMapEntries, w as resolveSlackMonitorDispatchers, y as readLruMapEntry } from "./probe-
|
|
7
|
-
import { n as getSlackRuntime, t as getOptionalSlackRuntime } from "./runtime-
|
|
8
|
-
import { t as DEFAULT_SLACK_SUGGESTED_PROMPTS } from "./channel-meta-
|
|
9
|
-
import { S as hasSlackMessageTableBlock, f as readSlackMessages, v as isGovSlackClient, y as saveRemoteMedia } from "./actions-
|
|
10
|
-
import { d as requireSlackPostMessageTimestamp, f as buildSlackMessageIdentityPayload, r as setSlackDefaultSendIdentity } from "./send-
|
|
11
|
-
import "./http-
|
|
12
|
-
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
13
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
14
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
15
|
-
import { n as runSlackApprovalMessageUpdate, t as hasSlackApprovalControl } from "./approval-message-updates-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath } from "./registry-1G0f1zuZ.mjs";
|
|
3
|
+
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, f as resolveSlackReplyToMode, h as resolveSlackBotToken, l as resolveSlackAccountDmPolicy, m as resolveSlackAppToken, o as resolveDefaultSlackAccountId, p as formatSlackBotTokenIdentityWarning, s as resolveSlackAccount } from "./accounts-CEgdyqoW.mjs";
|
|
4
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-0pRZtahO.mjs";
|
|
5
|
+
import { D as buildSlackCompleteBlocksFallbackText, Ft as isSlackExecApprovalAuthorizedSender, G as isSlackQuestionActionId, M as SLACK_TEXT_LIMIT, Nt as registerSlackInstallationState, P as truncateSlackText, U as isSlackApprovalActionId, W as isSlackCallbackActionId, Y as resolveSlackQuestionAction, _t as isSlackAnyNativeApprovalClientEnabled, c as qualifySlackConversationId, d as normalizeSlackRouteBindingConfig, kt as isSlackPluginApprovalAuthorizedSender, l as qualifySlackRoutePeerId, lt as decodeSlackApprovalAction, n as setSlackSessionStatus, p as resolveSlackConversationBindingRouteAsync, q as decodeSlackQuestionAction, r as buildSlackChannelIdCandidates, s as setSlackChannelPolicyBindings, st as escapeSlackMrkdwn, t as renameSlackSession, u as resolveSlackAgentRoute } from "./session-status-CHkEn3HM.mjs";
|
|
6
|
+
import { A as resolveSlackAllowListMatch, C as resolveSlackLookupClientOptions, D as allowListMatches, O as normalizeSlackAllowOwnerEntry, T as resolveSlackWebClientOptions, a as slackIngressIdentity, b as writeLruMapEntry, c as collectSlackCursorPages, f as createSlackStartupAuthClient, g as getSlackListenerWriteClient, i as createSlackIngressSubject, j as resolveSlackUserAllowListForTeam, k as normalizeSlackSlug, m as createSlackWebClient, o as formatSlackError, v as pruneExpiredMapEntries, w as resolveSlackMonitorDispatchers, y as readLruMapEntry } from "./probe-C5VWf3sz.mjs";
|
|
7
|
+
import { n as getSlackRuntime, t as getOptionalSlackRuntime } from "./runtime-C6HKn7Av.mjs";
|
|
8
|
+
import { t as DEFAULT_SLACK_SUGGESTED_PROMPTS } from "./channel-meta-C5vsCo3a.mjs";
|
|
9
|
+
import { S as hasSlackMessageTableBlock, f as readSlackMessages, v as isGovSlackClient, y as saveRemoteMedia } from "./actions-PF2cP6to.mjs";
|
|
10
|
+
import { d as requireSlackPostMessageTimestamp, f as buildSlackMessageIdentityPayload, r as setSlackDefaultSendIdentity } from "./send-C5uXkmZV.mjs";
|
|
11
|
+
import "./http-GpAVKwSX.mjs";
|
|
12
|
+
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-Bp1FvE6m.mjs";
|
|
13
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-BNQ1KZXh.mjs";
|
|
14
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-C4dC8Z7D.mjs";
|
|
15
|
+
import { n as runSlackApprovalMessageUpdate, t as hasSlackApprovalControl } from "./approval-message-updates-CpwbsEj6.mjs";
|
|
16
16
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
17
17
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
18
18
|
import { asNonArrayRecord, asOptionalObjectRecord, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -62,7 +62,7 @@ import { finished } from "node:stream/promises";
|
|
|
62
62
|
import { beginWebhookRequestPipelineOrReject, createWebhookInFlightLimiter, readWebhookBodyOrReject } from "openclaw/plugin-sdk/webhook-request-guards";
|
|
63
63
|
import { createChannelInboundDebouncer, resolveInboundDebounceMs, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
|
|
64
64
|
import { createChannelReplayGuard, runClaimableDedupeClaimLoop } from "openclaw/plugin-sdk/persistent-dedupe";
|
|
65
|
-
|
|
65
|
+
// extensions/slack/src/monitor/commands.ts
|
|
66
66
|
/**
|
|
67
67
|
* Strip Slack mentions (<@U123>, <@U123|name>) so command detection works on
|
|
68
68
|
* normalized text. Use in both prepare and debounce gate for consistency.
|
|
@@ -86,8 +86,7 @@ function buildSlackSlashCommandMatcher(name) {
|
|
|
86
86
|
const escaped = normalizeSlackSlashCommandName(name).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
87
87
|
return new RegExp(`^/?${escaped}$`);
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
//#region extensions/slack/src/monitor/approval-runtime-context.ts
|
|
89
|
+
// extensions/slack/src/monitor/approval-runtime-context.ts
|
|
91
90
|
function registerSlackApprovalRuntimeContext(params) {
|
|
92
91
|
const approvalContext = {
|
|
93
92
|
app: params.app,
|
|
@@ -105,8 +104,7 @@ function registerSlackApprovalRuntimeContext(params) {
|
|
|
105
104
|
abortSignal: params.abortSignal
|
|
106
105
|
});
|
|
107
106
|
}
|
|
108
|
-
|
|
109
|
-
//#region extensions/slack/src/monitor/agent-view-state.ts
|
|
107
|
+
// extensions/slack/src/monitor/agent-view-state.ts
|
|
110
108
|
const SLACK_AGENT_VIEW_STATE_NAMESPACE = "agent-view-workspaces";
|
|
111
109
|
const SLACK_AGENT_VIEW_THREAD_STATE_NAMESPACE = "agent-view-threads";
|
|
112
110
|
const SLACK_AGENT_VIEW_STATE_MAX_ENTRIES = 4096;
|
|
@@ -229,8 +227,7 @@ function createSlackAgentViewState(params) {
|
|
|
229
227
|
recordManagedThread
|
|
230
228
|
};
|
|
231
229
|
}
|
|
232
|
-
|
|
233
|
-
//#region extensions/slack/src/monitor/assistant-thread-context.ts
|
|
230
|
+
// extensions/slack/src/monitor/assistant-thread-context.ts
|
|
234
231
|
const SLACK_ASSISTANT_THREAD_CONTEXT_METADATA_EVENT = "assistant_thread_context";
|
|
235
232
|
const SLACK_ASSISTANT_CONTEXT_TTL_MS = 864e5;
|
|
236
233
|
const SLACK_ASSISTANT_CONTEXT_CLEANUP_INTERVAL_MS = 6e5;
|
|
@@ -307,8 +304,7 @@ function buildContextKey(accountId, channelId, threadTs, eventScope) {
|
|
|
307
304
|
const key = `${channelId}:${threadTs}`;
|
|
308
305
|
return eventScope ? `${accountId}:${eventScope.teamId}:${key}` : key;
|
|
309
306
|
}
|
|
310
|
-
|
|
311
|
-
//#region extensions/slack/src/monitor/channel-type.ts
|
|
307
|
+
// extensions/slack/src/monitor/channel-type.ts
|
|
312
308
|
function inferSlackChannelType(channelId) {
|
|
313
309
|
const trimmed = channelId?.trim();
|
|
314
310
|
if (!trimmed) return;
|
|
@@ -331,8 +327,7 @@ function resolveSlackChatType(channelType) {
|
|
|
331
327
|
if (channelType === "mpim") return "group";
|
|
332
328
|
return "channel";
|
|
333
329
|
}
|
|
334
|
-
|
|
335
|
-
//#region extensions/slack/src/monitor/enterprise-install.ts
|
|
330
|
+
// extensions/slack/src/monitor/enterprise-install.ts
|
|
336
331
|
const SLACK_CHANNEL_ID_RE = /^[CDG][A-Z0-9]{8,}$/;
|
|
337
332
|
const SLACK_USER_ID_RE = /^[BUW][A-Z0-9]{8,}$/;
|
|
338
333
|
function isWorkspaceScopedSlackChannelEntry(value, options) {
|
|
@@ -482,9 +477,11 @@ function resolveSlackIdentityHealth(params) {
|
|
|
482
477
|
lastError: null
|
|
483
478
|
};
|
|
484
479
|
}
|
|
485
|
-
|
|
486
|
-
//#region extensions/slack/src/monitor/reconnect-policy.ts
|
|
480
|
+
// extensions/slack/src/monitor/reconnect-policy.ts
|
|
487
481
|
const SLACK_AUTH_ERROR_RE = /account_inactive|invalid_auth|token_revoked|token_expired|not_authed|org_login_required|team_access_not_granted|user_removed_from_team|team_disabled|missing_scope|cannot_find_service|invalid_token/i;
|
|
482
|
+
const SLACK_DEFINITIVE_AUTH_ERROR_RE = /account_inactive|token_revoked|token_expired|not_authed|org_login_required|team_access_not_granted|user_removed_from_team|team_disabled|missing_scope|cannot_find_service|invalid_token/i;
|
|
483
|
+
/** Consecutive isolated invalid_auth failures before the channel turns terminal. */
|
|
484
|
+
const SLACK_ISOLATED_INVALID_AUTH_TERMINAL_LIMIT = 3;
|
|
488
485
|
const SLACK_SOCKET_RECONNECT_POLICY = {
|
|
489
486
|
initialMs: 2e3,
|
|
490
487
|
maxMs: 3e4,
|
|
@@ -578,8 +575,29 @@ function waitForSlackSocketDisconnect(app, abortSignal) {
|
|
|
578
575
|
function isNonRecoverableSlackAuthError(error) {
|
|
579
576
|
return SLACK_AUTH_ERROR_RE.test(formatSlackError(error, ""));
|
|
580
577
|
}
|
|
581
|
-
|
|
582
|
-
|
|
578
|
+
/** Terminal, retryable-isolated, or undefined (not auth-shaped) for this failure. */
|
|
579
|
+
function nextSlackAuthFailureState(error, consecutiveInvalidAuth) {
|
|
580
|
+
if (error && isIsolatedInvalidAuthSlackError(error)) {
|
|
581
|
+
const next = consecutiveInvalidAuth + 1;
|
|
582
|
+
return next >= SLACK_ISOLATED_INVALID_AUTH_TERMINAL_LIMIT ? {
|
|
583
|
+
decision: "terminal",
|
|
584
|
+
consecutiveInvalidAuth: next
|
|
585
|
+
} : {
|
|
586
|
+
decision: "retry-isolated",
|
|
587
|
+
consecutiveInvalidAuth: next
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
return {
|
|
591
|
+
decision: error && isNonRecoverableSlackAuthError(error) ? "terminal" : void 0,
|
|
592
|
+
consecutiveInvalidAuth
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
/** Isolated invalid_auth: auth-shaped, but not a definitive credential verdict. */
|
|
596
|
+
function isIsolatedInvalidAuthSlackError(error) {
|
|
597
|
+
const text = formatSlackError(error, "");
|
|
598
|
+
return /invalid_auth/i.test(text) && !SLACK_DEFINITIVE_AUTH_ERROR_RE.test(text);
|
|
599
|
+
}
|
|
600
|
+
// extensions/slack/src/monitor/socket-mode-envelope.ts
|
|
583
601
|
function installSlackSocketModeEnvelopeGuard(client, acknowledge, logger) {
|
|
584
602
|
const dispatchers = client.listeners("ws_message");
|
|
585
603
|
for (const dispatch of dispatchers) client.off("ws_message", dispatch);
|
|
@@ -603,8 +621,7 @@ function installSlackSocketModeEnvelopeGuard(client, acknowledge, logger) {
|
|
|
603
621
|
for (const dispatch of dispatchers) dispatch.call(client, data, isBinary);
|
|
604
622
|
});
|
|
605
623
|
}
|
|
606
|
-
|
|
607
|
-
//#region extensions/slack/src/monitor/provider-support.ts
|
|
624
|
+
// extensions/slack/src/monitor/provider-support.ts
|
|
608
625
|
const OPENCLAW_SLACK_CLIENT_PING_TIMEOUT_MS = 15e3;
|
|
609
626
|
const SLACK_SOCKET_START_FAILED_EVENT = "unable_to_socket_mode_start";
|
|
610
627
|
const SLACK_NATIVE_RECONNECT_OBSERVER_KEY = "__openclawNativeReconnectFailureObserver";
|
|
@@ -700,6 +717,14 @@ function publishSlackConnectedStatus(setStatus, identityHealth = {
|
|
|
700
717
|
lastConnectedAt
|
|
701
718
|
}) : channelReadyPatch({ lastConnectedAt }));
|
|
702
719
|
}
|
|
720
|
+
function trackSlackAuthFailure(failure, phase, setStatus, logError, state) {
|
|
721
|
+
const auth = nextSlackAuthFailureState(failure, state.consecutiveInvalidAuth);
|
|
722
|
+
state.consecutiveInvalidAuth = auth.consecutiveInvalidAuth;
|
|
723
|
+
if (auth.decision !== "terminal") return;
|
|
724
|
+
publishSlackBlockedStatus(setStatus, failure);
|
|
725
|
+
logError(`slack ${phase} (${formatSlackError(failure)})`);
|
|
726
|
+
throw failure instanceof Error ? failure : new Error(formatSlackError(failure));
|
|
727
|
+
}
|
|
703
728
|
function publishSlackBlockedStatus(setStatus, error) {
|
|
704
729
|
if (!setStatus) return;
|
|
705
730
|
setStatus(channelBlockedPatch(formatSlackError(error), { connected: false }));
|
|
@@ -878,8 +903,7 @@ function formatSlackUserResolved(entry) {
|
|
|
878
903
|
extra: entry.note ? [entry.note] : []
|
|
879
904
|
});
|
|
880
905
|
}
|
|
881
|
-
|
|
882
|
-
//#region extensions/slack/src/monitor/system-event-session.ts
|
|
906
|
+
// extensions/slack/src/monitor/system-event-session.ts
|
|
883
907
|
function createSlackSystemEventRouteResolver(params) {
|
|
884
908
|
return async (event) => {
|
|
885
909
|
const channelId = normalizeOptionalString(event.channelId) ?? "";
|
|
@@ -942,8 +966,7 @@ function createSlackSystemEventRouteResolver(params) {
|
|
|
942
966
|
};
|
|
943
967
|
};
|
|
944
968
|
}
|
|
945
|
-
|
|
946
|
-
//#region extensions/slack/src/monitor/runtime-policy.ts
|
|
969
|
+
// extensions/slack/src/monitor/runtime-policy.ts
|
|
947
970
|
function resolveSlackMonitorPolicy(cfg, accountId, runtime) {
|
|
948
971
|
const slack = mergeSlackAccountConfig(cfg, accountId);
|
|
949
972
|
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy({
|
|
@@ -1115,8 +1138,7 @@ async function resolveWorkspacePolicy(ctx, resolveToken) {
|
|
|
1115
1138
|
summarizeMapping("slack users", mapping, unresolved, runtime);
|
|
1116
1139
|
ctx.channelsConfigKeys = Object.keys(ctx.channelsConfig ?? {});
|
|
1117
1140
|
}
|
|
1118
|
-
|
|
1119
|
-
//#region extensions/slack/src/monitor/suggested-prompts.ts
|
|
1141
|
+
// extensions/slack/src/monitor/suggested-prompts.ts
|
|
1120
1142
|
async function updateSlackSuggestedPrompts(params) {
|
|
1121
1143
|
const prompts = params.prompts.map(({ title, message }) => ({
|
|
1122
1144
|
title: title.trim(),
|
|
@@ -1142,8 +1164,7 @@ async function updateSlackSuggestedPrompts(params) {
|
|
|
1142
1164
|
return outcome;
|
|
1143
1165
|
}
|
|
1144
1166
|
}
|
|
1145
|
-
|
|
1146
|
-
//#region extensions/slack/src/monitor/context.ts
|
|
1167
|
+
// extensions/slack/src/monitor/context.ts
|
|
1147
1168
|
function classifySlackChannelLookupFailure(error) {
|
|
1148
1169
|
if (error instanceof WebAPIRateLimitedError) return "rate_limited";
|
|
1149
1170
|
if (error instanceof WebAPIHTTPError) return error.statusCode === 429 ? "rate_limited" : error.statusCode === 404 ? "not_found" : "other";
|
|
@@ -1465,8 +1486,7 @@ function createSlackMonitorContext(params) {
|
|
|
1465
1486
|
ctx.readRuntimeContext = createSlackRuntimeContextReader(ctx, lookupToken ?? params.botToken);
|
|
1466
1487
|
return ctx;
|
|
1467
1488
|
}
|
|
1468
|
-
|
|
1469
|
-
//#region extensions/slack/src/streaming.ts
|
|
1489
|
+
// extensions/slack/src/streaming.ts
|
|
1470
1490
|
/**
|
|
1471
1491
|
* Thrown when Slack definitively rejects a stream flush/finalize while text
|
|
1472
1492
|
* remains buffered locally by the Slack SDK. Carries the pending text so the
|
|
@@ -1638,8 +1658,7 @@ function markSlackStreamFallbackDelivered(session) {
|
|
|
1638
1658
|
if (session.stopped) releaseSlackStream(session);
|
|
1639
1659
|
else stateBySession.get(session)?.sessions.add(session);
|
|
1640
1660
|
}
|
|
1641
|
-
|
|
1642
|
-
//#region extensions/slack/src/monitor/thread-resolution.ts
|
|
1661
|
+
// extensions/slack/src/monitor/thread-resolution.ts
|
|
1643
1662
|
const DEFAULT_THREAD_TS_CACHE_TTL_MS = 6e4;
|
|
1644
1663
|
const DEFAULT_THREAD_TS_CACHE_MAX = 500;
|
|
1645
1664
|
const markAmbiguousThreadReply = (message) => ({
|
|
@@ -1734,8 +1753,7 @@ function createSlackThreadTsResolver(params) {
|
|
|
1734
1753
|
return markAmbiguousThreadReply(message);
|
|
1735
1754
|
} };
|
|
1736
1755
|
}
|
|
1737
|
-
|
|
1738
|
-
//#region extensions/slack/src/monitor/auth.ts
|
|
1756
|
+
// extensions/slack/src/monitor/auth.ts
|
|
1739
1757
|
const slackChannelMembersCache = /* @__PURE__ */ new WeakMap();
|
|
1740
1758
|
const CHANNEL_MEMBERS_CACHE_TTL_MS = 6e4;
|
|
1741
1759
|
const CHANNEL_MEMBERS_CACHE_MAX = 512;
|
|
@@ -2073,8 +2091,7 @@ async function authorizeSlackSystemEventSender(params) {
|
|
|
2073
2091
|
channelName
|
|
2074
2092
|
};
|
|
2075
2093
|
}
|
|
2076
|
-
|
|
2077
|
-
//#region extensions/slack/src/monitor/event-scope.ts
|
|
2094
|
+
// extensions/slack/src/monitor/event-scope.ts
|
|
2078
2095
|
function resolveSlackMonitorEventScope(params) {
|
|
2079
2096
|
const identity = params.ctx.installationIdentity;
|
|
2080
2097
|
const clientOptions = params.ctx.app.webClientOptions;
|
|
@@ -2106,8 +2123,7 @@ function resolveSlackMonitorEventScope(params) {
|
|
|
2106
2123
|
...writeClient ? { writeClient } : {}
|
|
2107
2124
|
};
|
|
2108
2125
|
}
|
|
2109
|
-
|
|
2110
|
-
//#region extensions/slack/src/types.ts
|
|
2126
|
+
// extensions/slack/src/types.ts
|
|
2111
2127
|
function parseSlackMessageEvent(value) {
|
|
2112
2128
|
const record = asOptionalRecord(value);
|
|
2113
2129
|
return record?.type === "message" && typeof record.channel === "string" ? {
|
|
@@ -2121,8 +2137,7 @@ function requireSlackMessageEvent(value) {
|
|
|
2121
2137
|
if (!event) throw new TypeError("Invalid persisted Slack message event");
|
|
2122
2138
|
return event;
|
|
2123
2139
|
}
|
|
2124
|
-
|
|
2125
|
-
//#region extensions/slack/src/monitor/ingress.ts
|
|
2140
|
+
// extensions/slack/src/monitor/ingress.ts
|
|
2126
2141
|
const SLACK_INGRESS_PAYLOAD_VERSION = 1;
|
|
2127
2142
|
const SLACK_INGRESS_POLL_INTERVAL_MS = 1e3;
|
|
2128
2143
|
const SLACK_BOLT_AUTHORIZATION_ERROR = "slack_bolt_authorization_error";
|
|
@@ -2446,8 +2461,7 @@ function createSlackDurableIngress(options) {
|
|
|
2446
2461
|
waitForIdle: monitor.waitForIdle
|
|
2447
2462
|
};
|
|
2448
2463
|
}
|
|
2449
|
-
|
|
2450
|
-
//#region extensions/slack/src/threading.ts
|
|
2464
|
+
// extensions/slack/src/threading.ts
|
|
2451
2465
|
function resolveSlackThreadContext(params) {
|
|
2452
2466
|
const incomingThreadTs = params.message.thread_ts;
|
|
2453
2467
|
const eventTs = params.message.event_ts;
|
|
@@ -2464,8 +2478,7 @@ function resolveSlackThreadContext(params) {
|
|
|
2464
2478
|
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
2465
2479
|
};
|
|
2466
2480
|
}
|
|
2467
|
-
|
|
2468
|
-
//#region extensions/slack/src/monitor/session-run-targets.ts
|
|
2481
|
+
// extensions/slack/src/monitor/session-run-targets.ts
|
|
2469
2482
|
async function captureSlackSessionTargetGuard(ctx, route, isActive) {
|
|
2470
2483
|
return captureSessionEntryCurrentCheckAsync({
|
|
2471
2484
|
agentId: route.agentId,
|
|
@@ -2507,8 +2520,7 @@ function getSlackSessionRuns(ctx, address) {
|
|
|
2507
2520
|
isActive: () => targets.some((candidate) => candidate.route.sessionKey === target.route.sessionKey && candidate.isActive())
|
|
2508
2521
|
}));
|
|
2509
2522
|
}
|
|
2510
|
-
|
|
2511
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
2523
|
+
// extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
2512
2524
|
async function resolveSlackRoutingContext(params) {
|
|
2513
2525
|
const { ctx, account, message, chatType, channelConfig, seedTopLevelRoomThread, assistantThreadTs, agentViewThreadTs, eventScope } = params;
|
|
2514
2526
|
const isDirectMessage = chatType === "direct";
|
|
@@ -2686,8 +2698,7 @@ async function resolveSlackSessionEventRoutingContext(params) {
|
|
|
2686
2698
|
release: current.release
|
|
2687
2699
|
};
|
|
2688
2700
|
}
|
|
2689
|
-
|
|
2690
|
-
//#region extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2701
|
+
// extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2691
2702
|
function resolveSlackDeferredActionTarget(params) {
|
|
2692
2703
|
if (!params.id) throw new Error("Slack deferred action is missing a target ID");
|
|
2693
2704
|
if (!params.eventScope) return {
|
|
@@ -2700,8 +2711,7 @@ function resolveSlackDeferredActionTarget(params) {
|
|
|
2700
2711
|
target
|
|
2701
2712
|
};
|
|
2702
2713
|
}
|
|
2703
|
-
|
|
2704
|
-
//#region extensions/slack/src/monitor/dm-auth.ts
|
|
2714
|
+
// extensions/slack/src/monitor/dm-auth.ts
|
|
2705
2715
|
async function authorizeSlackDirectMessage(params) {
|
|
2706
2716
|
if (!params.ctx.dmEnabled || params.ctx.dmPolicy === "disabled") {
|
|
2707
2717
|
await params.onDisabled();
|
|
@@ -2757,8 +2767,7 @@ async function authorizeSlackDirectMessage(params) {
|
|
|
2757
2767
|
});
|
|
2758
2768
|
return false;
|
|
2759
2769
|
}
|
|
2760
|
-
|
|
2761
|
-
//#region extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
2770
|
+
// extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
2762
2771
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
2763
2772
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(24)}}$`);
|
|
2764
2773
|
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 6e5;
|
|
@@ -2794,8 +2803,7 @@ function createSlackExternalArgMenuStore() {
|
|
|
2794
2803
|
}
|
|
2795
2804
|
};
|
|
2796
2805
|
}
|
|
2797
|
-
|
|
2798
|
-
//#region extensions/slack/src/monitor/response-url-budget.ts
|
|
2806
|
+
// extensions/slack/src/monitor/response-url-budget.ts
|
|
2799
2807
|
const SLACK_RESPONSE_URL_MAX_CALLS = 5;
|
|
2800
2808
|
var SlackResponseAlreadyReportedError = class extends Error {};
|
|
2801
2809
|
/** Count every response_url attempt, including requests Slack rejects. */
|
|
@@ -2810,8 +2818,7 @@ function createSlackResponseUrlBudget(respond, maxCalls = SLACK_RESPONSE_URL_MAX
|
|
|
2810
2818
|
}
|
|
2811
2819
|
};
|
|
2812
2820
|
}
|
|
2813
|
-
|
|
2814
|
-
//#region extensions/slack/src/monitor/room-context.ts
|
|
2821
|
+
// extensions/slack/src/monitor/room-context.ts
|
|
2815
2822
|
function resolveSlackRoomContextHints(params) {
|
|
2816
2823
|
return {
|
|
2817
2824
|
channelMetadata: params.isRoomish ? buildChannelMetadata({
|
|
@@ -2822,8 +2829,7 @@ function resolveSlackRoomContextHints(params) {
|
|
|
2822
2829
|
groupSystemPrompt: params.isRoomish ? normalizeOptionalString(params.channelConfig?.systemPrompt) : void 0
|
|
2823
2830
|
};
|
|
2824
2831
|
}
|
|
2825
|
-
|
|
2826
|
-
//#region extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
2832
|
+
// extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
2827
2833
|
async function resolveSlackCommandMenuModelContext(params) {
|
|
2828
2834
|
if (!params.sessionKey.trim()) return {};
|
|
2829
2835
|
try {
|
|
@@ -2872,8 +2878,7 @@ async function resolveSlackCommandMenuModelContext(params) {
|
|
|
2872
2878
|
return {};
|
|
2873
2879
|
}
|
|
2874
2880
|
}
|
|
2875
|
-
|
|
2876
|
-
//#region extensions/slack/src/monitor/slash.ts
|
|
2881
|
+
// extensions/slack/src/monitor/slash.ts
|
|
2877
2882
|
const SLACK_COMMAND_ARG_ACTION_ID = "openclaw_cmdarg";
|
|
2878
2883
|
const SLACK_COMMAND_ARG_ACTION_LISTENER = /^openclaw_cmdarg/;
|
|
2879
2884
|
const SLACK_COMMAND_ARG_VALUE_PREFIX = "cmdarg";
|
|
@@ -2888,7 +2893,7 @@ const SLACK_COMMAND_ARG_BUTTON_VALUE_MAX = 2e3;
|
|
|
2888
2893
|
const SLACK_COMMAND_ARG_CONFIRM_TEXT_MAX = 300;
|
|
2889
2894
|
const SLACK_HEADER_TEXT_MAX = 150;
|
|
2890
2895
|
const SLACK_COMMAND_ARG_ACTION_BLOCKS_MAX = 47;
|
|
2891
|
-
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-
|
|
2896
|
+
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-Bnn9a5qB.mjs"));
|
|
2892
2897
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
2893
2898
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
2894
2899
|
function buildSlackArgMenuConfirm(params) {
|
|
@@ -3687,8 +3692,7 @@ async function deliverSlackSlashResponseWithWebApi(params) {
|
|
|
3687
3692
|
function isSlackBoltRespondError(error) {
|
|
3688
3693
|
return Boolean(error) && typeof error === "object" && error.code === "slack_bolt_respond_error";
|
|
3689
3694
|
}
|
|
3690
|
-
|
|
3691
|
-
//#region extensions/slack/src/monitor/events/agent.ts
|
|
3695
|
+
// extensions/slack/src/monitor/events/agent.ts
|
|
3692
3696
|
function registerSlackAgentEvents(params) {
|
|
3693
3697
|
const { ctx, trackEvent } = params;
|
|
3694
3698
|
const handleCommand = createSlackCommandHandler({
|
|
@@ -3827,8 +3831,7 @@ function registerSlackAgentEvents(params) {
|
|
|
3827
3831
|
}
|
|
3828
3832
|
});
|
|
3829
3833
|
}
|
|
3830
|
-
|
|
3831
|
-
//#region extensions/slack/src/monitor/events/assistant.ts
|
|
3834
|
+
// extensions/slack/src/monitor/events/assistant.ts
|
|
3832
3835
|
function normalizeAssistantThread(event, getPrevious) {
|
|
3833
3836
|
const thread = event.assistant_thread;
|
|
3834
3837
|
if (!thread) return null;
|
|
@@ -3891,8 +3894,7 @@ function registerSlackAssistantEvents(params) {
|
|
|
3891
3894
|
});
|
|
3892
3895
|
});
|
|
3893
3896
|
}
|
|
3894
|
-
|
|
3895
|
-
//#region extensions/slack/src/channel-migration.ts
|
|
3897
|
+
// extensions/slack/src/channel-migration.ts
|
|
3896
3898
|
function resolveAccountChannels(cfg, accountId) {
|
|
3897
3899
|
if (!accountId) return {};
|
|
3898
3900
|
const normalized = normalizeAccountId$1(accountId);
|
|
@@ -3942,8 +3944,7 @@ function migrateSlackChannelConfig(params) {
|
|
|
3942
3944
|
scopes
|
|
3943
3945
|
};
|
|
3944
3946
|
}
|
|
3945
|
-
|
|
3946
|
-
//#region extensions/slack/src/monitor/events/channels.ts
|
|
3947
|
+
// extensions/slack/src/monitor/events/channels.ts
|
|
3947
3948
|
function registerSlackChannelEvents(params) {
|
|
3948
3949
|
const { ctx, trackEvent } = params;
|
|
3949
3950
|
for (const [eventName, kind] of [["channel_created", "created"], ["channel_rename", "renamed"]]) ctx.app.event(eventName, async (args) => {
|
|
@@ -4030,8 +4031,7 @@ function registerSlackChannelIdChangedEvent(params) {
|
|
|
4030
4031
|
}
|
|
4031
4032
|
});
|
|
4032
4033
|
}
|
|
4033
|
-
|
|
4034
|
-
//#region extensions/slack/src/monitor/events/home.ts
|
|
4034
|
+
// extensions/slack/src/monitor/events/home.ts
|
|
4035
4035
|
function buildSlackHomeView(slashCommandName) {
|
|
4036
4036
|
return {
|
|
4037
4037
|
type: "home",
|
|
@@ -4085,8 +4085,7 @@ function registerSlackHomeEvents(params) {
|
|
|
4085
4085
|
});
|
|
4086
4086
|
});
|
|
4087
4087
|
}
|
|
4088
|
-
|
|
4089
|
-
//#region extensions/slack/src/interactive-dispatch.ts
|
|
4088
|
+
// extensions/slack/src/interactive-dispatch.ts
|
|
4090
4089
|
const dispatchSlackInteractive = createChannelInteractiveDispatcher({
|
|
4091
4090
|
channel: "slack",
|
|
4092
4091
|
interactiveKey: "interaction"
|
|
@@ -4111,8 +4110,7 @@ async function dispatchSlackPluginInteractiveHandler(params) {
|
|
|
4111
4110
|
}
|
|
4112
4111
|
});
|
|
4113
4112
|
}
|
|
4114
|
-
|
|
4115
|
-
//#region extensions/slack/src/monitor/events/interaction-event.ts
|
|
4113
|
+
// extensions/slack/src/monitor/events/interaction-event.ts
|
|
4116
4114
|
const SLACK_INTERACTION_EVENT_PREFIX = "Slack interaction: ";
|
|
4117
4115
|
const REDACTED_INTERACTION_VALUE = "[redacted]";
|
|
4118
4116
|
const SLACK_INTERACTION_EVENT_MAX_CHARS = 2400;
|
|
@@ -4225,8 +4223,7 @@ function enqueueSlackInteractionEvent(payload, route, options) {
|
|
|
4225
4223
|
heartbeat: { target: "last" }
|
|
4226
4224
|
});
|
|
4227
4225
|
}
|
|
4228
|
-
|
|
4229
|
-
//#region extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
4226
|
+
// extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
4230
4227
|
function resolveSlackPluginApprovalSender(params) {
|
|
4231
4228
|
const senderId = formatSlackTarget({
|
|
4232
4229
|
kind: "user",
|
|
@@ -4242,8 +4239,7 @@ function resolveSlackPluginApprovalSender(params) {
|
|
|
4242
4239
|
})
|
|
4243
4240
|
};
|
|
4244
4241
|
}
|
|
4245
|
-
|
|
4246
|
-
//#region extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
4242
|
+
// extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
4247
4243
|
function readOptionStrings(options, read) {
|
|
4248
4244
|
if (!Array.isArray(options)) return [];
|
|
4249
4245
|
return options.map((option) => option && typeof option === "object" ? read(option) : void 0).filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
@@ -4337,8 +4333,7 @@ function formatInteractionSelectionLabel(params) {
|
|
|
4337
4333
|
if (params.summary.value?.trim()) return params.summary.value.trim();
|
|
4338
4334
|
return params.actionId;
|
|
4339
4335
|
}
|
|
4340
|
-
|
|
4341
|
-
//#region extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
4336
|
+
// extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
4342
4337
|
function resolveSlackActionValue(summary) {
|
|
4343
4338
|
return normalizeOptionalString(summary.value) ?? summary.selectedValues?.[0];
|
|
4344
4339
|
}
|
|
@@ -4507,7 +4502,7 @@ async function handleSlackApprovalInteraction(params) {
|
|
|
4507
4502
|
channelId,
|
|
4508
4503
|
messageTs
|
|
4509
4504
|
}, async () => {
|
|
4510
|
-
const { readSlackMessages } = await import("./actions-
|
|
4505
|
+
const { readSlackMessages } = await import("./actions-PF2cP6to.mjs").then((n) => n.t);
|
|
4511
4506
|
const { messages } = await readSlackMessages(channelId, {
|
|
4512
4507
|
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
4513
4508
|
messageId: messageTs,
|
|
@@ -4862,8 +4857,7 @@ function registerSlackBlockActionHandler(params) {
|
|
|
4862
4857
|
await updateSlackLegacyBlockAction(actionContext);
|
|
4863
4858
|
});
|
|
4864
4859
|
}
|
|
4865
|
-
|
|
4866
|
-
//#region extensions/slack/src/modal-metadata.ts
|
|
4860
|
+
// extensions/slack/src/modal-metadata.ts
|
|
4867
4861
|
function parseSlackModalPrivateMetadata(raw) {
|
|
4868
4862
|
if (typeof raw !== "string" || raw.trim().length === 0) return {};
|
|
4869
4863
|
try {
|
|
@@ -4879,8 +4873,7 @@ function parseSlackModalPrivateMetadata(raw) {
|
|
|
4879
4873
|
return {};
|
|
4880
4874
|
}
|
|
4881
4875
|
}
|
|
4882
|
-
|
|
4883
|
-
//#region extensions/slack/src/monitor/events/interactions.modal.ts
|
|
4876
|
+
// extensions/slack/src/monitor/events/interactions.modal.ts
|
|
4884
4877
|
const OPENCLAW_MODAL_CALLBACK_PREFIX = "openclaw:";
|
|
4885
4878
|
function resolveSlackModalPluginInteractiveData(params) {
|
|
4886
4879
|
const metadataData = params.metadata.pluginInteractiveData?.trim();
|
|
@@ -5109,8 +5102,7 @@ function registerModalLifecycleHandler(params) {
|
|
|
5109
5102
|
});
|
|
5110
5103
|
});
|
|
5111
5104
|
}
|
|
5112
|
-
|
|
5113
|
-
//#region extensions/slack/src/monitor/events/interactions.shortcuts.ts
|
|
5105
|
+
// extensions/slack/src/monitor/events/interactions.shortcuts.ts
|
|
5114
5106
|
function registerSlackShortcutHandler(params) {
|
|
5115
5107
|
if (typeof params.ctx.app.shortcut !== "function") return;
|
|
5116
5108
|
params.ctx.app.shortcut(/.+/, async (args) => {
|
|
@@ -5209,8 +5201,7 @@ function registerSlackShortcutHandler(params) {
|
|
|
5209
5201
|
});
|
|
5210
5202
|
});
|
|
5211
5203
|
}
|
|
5212
|
-
|
|
5213
|
-
//#region extensions/slack/src/monitor/events/interactions.ts
|
|
5204
|
+
// extensions/slack/src/monitor/events/interactions.ts
|
|
5214
5205
|
function registerSlackInteractionEvents(params) {
|
|
5215
5206
|
const { ctx, trackEvent } = params;
|
|
5216
5207
|
registerSlackBlockActionHandler(params);
|
|
@@ -5222,8 +5213,7 @@ function registerSlackInteractionEvents(params) {
|
|
|
5222
5213
|
interactionType
|
|
5223
5214
|
});
|
|
5224
5215
|
}
|
|
5225
|
-
|
|
5226
|
-
//#region extensions/slack/src/monitor/events/system-event-context.ts
|
|
5216
|
+
// extensions/slack/src/monitor/events/system-event-context.ts
|
|
5227
5217
|
async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
5228
5218
|
const { senderId, channelId, channelType, eventKind } = params;
|
|
5229
5219
|
const ctx = await params.ctx.readRuntimeContext();
|
|
@@ -5253,8 +5243,7 @@ async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
|
5253
5243
|
})
|
|
5254
5244
|
};
|
|
5255
5245
|
}
|
|
5256
|
-
|
|
5257
|
-
//#region extensions/slack/src/monitor/events/members.ts
|
|
5246
|
+
// extensions/slack/src/monitor/events/members.ts
|
|
5258
5247
|
function registerSlackMemberEvents(params) {
|
|
5259
5248
|
const { ctx, trackEvent } = params;
|
|
5260
5249
|
for (const verb of ["joined", "left"]) ctx.app.event(`member_${verb}_channel`, async (args) => {
|
|
@@ -5341,8 +5330,7 @@ function registerSlackMemberEvents(params) {
|
|
|
5341
5330
|
}
|
|
5342
5331
|
});
|
|
5343
5332
|
}
|
|
5344
|
-
|
|
5345
|
-
//#region extensions/slack/src/draft-message-boundaries.ts
|
|
5333
|
+
// extensions/slack/src/draft-message-boundaries.ts
|
|
5346
5334
|
const activeDraftsByConversation = /* @__PURE__ */ new Map();
|
|
5347
5335
|
function conversationKey(conversation) {
|
|
5348
5336
|
return [
|
|
@@ -5393,8 +5381,7 @@ function noteSlackDraftConversationMessage(conversation) {
|
|
|
5393
5381
|
if (isLaterSlackMessage(conversation.messageTs, draft.messageTs)) draft.onInterveningMessage();
|
|
5394
5382
|
}
|
|
5395
5383
|
}
|
|
5396
|
-
|
|
5397
|
-
//#region extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
5384
|
+
// extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
5398
5385
|
function resolveSlackMessageSubtypeHandler(event) {
|
|
5399
5386
|
const subtype = event.subtype;
|
|
5400
5387
|
if (subtype !== "message_changed" && subtype !== "message_deleted") return;
|
|
@@ -5418,8 +5405,7 @@ function resolveSlackMessageSubtypeHandler(event) {
|
|
|
5418
5405
|
}).replyToId : void 0
|
|
5419
5406
|
};
|
|
5420
5407
|
}
|
|
5421
|
-
|
|
5422
|
-
//#region extensions/slack/src/monitor/events/messages.ts
|
|
5408
|
+
// extensions/slack/src/monitor/events/messages.ts
|
|
5423
5409
|
const slackInboundLog = createSubsystemLogger("gateway/channels/slack").child("inbound");
|
|
5424
5410
|
function isBotAuthoredEnterpriseEvent(event) {
|
|
5425
5411
|
return Boolean(normalizeOptionalString(event.bot_id)) || event.subtype === "bot_message";
|
|
@@ -5587,8 +5573,7 @@ function registerSlackMessageEvents(params) {
|
|
|
5587
5573
|
}
|
|
5588
5574
|
});
|
|
5589
5575
|
}
|
|
5590
|
-
|
|
5591
|
-
//#region extensions/slack/src/monitor/events/pins.ts
|
|
5576
|
+
// extensions/slack/src/monitor/events/pins.ts
|
|
5592
5577
|
function registerSlackPinEvents(params) {
|
|
5593
5578
|
const { ctx, trackEvent } = params;
|
|
5594
5579
|
for (const contextKeySuffix of ["added", "removed"]) {
|
|
@@ -5625,8 +5610,7 @@ function registerSlackPinEvents(params) {
|
|
|
5625
5610
|
});
|
|
5626
5611
|
}
|
|
5627
5612
|
}
|
|
5628
|
-
|
|
5629
|
-
//#region extensions/slack/src/monitor/events/reactions.ts
|
|
5613
|
+
// extensions/slack/src/monitor/events/reactions.ts
|
|
5630
5614
|
function shouldEmitSlackReactionNotification(params) {
|
|
5631
5615
|
const { ctx, event, actorName } = params;
|
|
5632
5616
|
if (ctx.reactionMode === "off") return false;
|
|
@@ -5691,8 +5675,7 @@ function registerSlackReactionEvents(params) {
|
|
|
5691
5675
|
}
|
|
5692
5676
|
});
|
|
5693
5677
|
}
|
|
5694
|
-
|
|
5695
|
-
//#region extensions/slack/src/monitor/events.ts
|
|
5678
|
+
// extensions/slack/src/monitor/events.ts
|
|
5696
5679
|
function registerSlackCommonEvents(params) {
|
|
5697
5680
|
registerSlackMessageEvents({
|
|
5698
5681
|
ctx: params.ctx,
|
|
@@ -5738,8 +5721,7 @@ function registerSlackWorkspaceEvents(params) {
|
|
|
5738
5721
|
trackEvent: params.trackEvent
|
|
5739
5722
|
});
|
|
5740
5723
|
}
|
|
5741
|
-
|
|
5742
|
-
//#region extensions/slack/src/monitor/http-handler.ts
|
|
5724
|
+
// extensions/slack/src/monitor/http-handler.ts
|
|
5743
5725
|
const SLACK_WEBHOOK_MAX_BODY_BYTES = 1048576;
|
|
5744
5726
|
const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
|
|
5745
5727
|
function createSlackHttpRequestHandler(params) {
|
|
@@ -5771,8 +5753,7 @@ function createSlackHttpRequestHandler(params) {
|
|
|
5771
5753
|
}
|
|
5772
5754
|
};
|
|
5773
5755
|
}
|
|
5774
|
-
|
|
5775
|
-
//#region extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5756
|
+
// extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5776
5757
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_TTL_MS = 864e5;
|
|
5777
5758
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_MEMORY_MAX_ENTRIES = 2e4;
|
|
5778
5759
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_STATE_MAX_ENTRIES = 2e4;
|
|
@@ -5826,8 +5807,7 @@ async function claimSlackMessageDispatchReplay(params) {
|
|
|
5826
5807
|
handle: claim.handle
|
|
5827
5808
|
} : { kind: "duplicate" };
|
|
5828
5809
|
}
|
|
5829
|
-
|
|
5830
|
-
//#region extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5810
|
+
// extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5831
5811
|
function resolveSlackSenderId(message) {
|
|
5832
5812
|
return message.user ?? message.bot_id ?? null;
|
|
5833
5813
|
}
|
|
@@ -5844,9 +5824,8 @@ function buildSlackDebounceKey(message, accountId, teamId) {
|
|
|
5844
5824
|
const threadKey = message.thread_ts ? `${message.channel}:${message.thread_ts}` : message.parent_user_id && messageTs ? `${message.channel}:maybe-thread:${messageTs}` : messageTs && !message.channel.startsWith("D") ? `${message.channel}:${messageTs}` : message.channel;
|
|
5845
5825
|
return `slack:${accountId}:${teamId ? `${teamId}:` : ""}${threadKey}:${senderId}`;
|
|
5846
5826
|
}
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-CT7Krkyw.mjs"));
|
|
5827
|
+
// extensions/slack/src/monitor/message-handler.ts
|
|
5828
|
+
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-CIFVL0kf.mjs"));
|
|
5850
5829
|
const RETRYABLE_FLUSH_MAX_ATTEMPTS = 3;
|
|
5851
5830
|
function shouldDebounceSlackMessage(message, cfg) {
|
|
5852
5831
|
const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");
|
|
@@ -6112,8 +6091,7 @@ function createSlackMessageHandler(params) {
|
|
|
6112
6091
|
await (await enqueueSlackMessage(message, opts))?.promise;
|
|
6113
6092
|
};
|
|
6114
6093
|
}
|
|
6115
|
-
|
|
6116
|
-
//#region extensions/slack/src/monitor/presence-monitor.ts
|
|
6094
|
+
// extensions/slack/src/monitor/presence-monitor.ts
|
|
6117
6095
|
const SLACK_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
6118
6096
|
const SLACK_PRESENCE_REQUEST_TIMEOUT_MS = 3e4;
|
|
6119
6097
|
const SLACK_PRESENCE_POLL_INTERVAL_MS = 6e4;
|
|
@@ -6351,8 +6329,7 @@ function createSlackPresenceMonitor(params) {
|
|
|
6351
6329
|
function presenceSubjectKey(subject) {
|
|
6352
6330
|
return `${subject.teamId ?? "workspace"}:${subject.userId}`;
|
|
6353
6331
|
}
|
|
6354
|
-
|
|
6355
|
-
//#region extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6332
|
+
// extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6356
6333
|
const SLACK_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
|
|
6357
6334
|
function openSlackPresenceCooldownStore() {
|
|
6358
6335
|
return getSlackRuntime().state.openKeyedStore({
|
|
@@ -6362,8 +6339,7 @@ function openSlackPresenceCooldownStore() {
|
|
|
6362
6339
|
defaultTtlMs: SLACK_PRESENCE_GREETING_COOLDOWN_MS
|
|
6363
6340
|
});
|
|
6364
6341
|
}
|
|
6365
|
-
|
|
6366
|
-
//#region extensions/slack/src/monitor/provider.ts
|
|
6342
|
+
// extensions/slack/src/monitor/provider.ts
|
|
6367
6343
|
let slackBoltInterop;
|
|
6368
6344
|
function withSlackPresenceLifecycleSignal(fetchImpl, lifecycleSignal) {
|
|
6369
6345
|
return async (input, init) => await fetchImpl(input, {
|
|
@@ -6381,7 +6357,7 @@ async function getSlackBoltInterop() {
|
|
|
6381
6357
|
}
|
|
6382
6358
|
return slackBoltInterop;
|
|
6383
6359
|
}
|
|
6384
|
-
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-
|
|
6360
|
+
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-DFBDTA5Z.mjs"));
|
|
6385
6361
|
function resolveSlackRuntimeIdentity(params) {
|
|
6386
6362
|
const botUserId = normalizeOptionalString(params.botUserId);
|
|
6387
6363
|
const botId = normalizeOptionalString(params.botId);
|
|
@@ -6778,6 +6754,8 @@ async function monitorSlackProvider(opts) {
|
|
|
6778
6754
|
}
|
|
6779
6755
|
if (slackMode === "socket") {
|
|
6780
6756
|
let reconnectAttempts = 0;
|
|
6757
|
+
const authState = { consecutiveInvalidAuth: 0 };
|
|
6758
|
+
const logError = (message) => runtime.error?.(message);
|
|
6781
6759
|
let hasLoggedSocketConnected = false;
|
|
6782
6760
|
while (!opts.abortSignal?.aborted) {
|
|
6783
6761
|
let delayMs;
|
|
@@ -6787,6 +6765,7 @@ async function monitorSlackProvider(opts) {
|
|
|
6787
6765
|
abortSignal: opts.abortSignal,
|
|
6788
6766
|
onStarted: async () => {
|
|
6789
6767
|
reconnectAttempts = 0;
|
|
6768
|
+
authState.consecutiveInvalidAuth = 0;
|
|
6790
6769
|
await recoverSlackIdentity();
|
|
6791
6770
|
publishSlackConnectedStatus(opts.setStatus, ctx.identityHealth);
|
|
6792
6771
|
if (!hasLoggedSocketConnected) {
|
|
@@ -6798,11 +6777,7 @@ async function monitorSlackProvider(opts) {
|
|
|
6798
6777
|
if (!disconnect) break;
|
|
6799
6778
|
if (opts.abortSignal?.aborted) break;
|
|
6800
6779
|
publishSlackDisconnectedStatus(opts.setStatus, disconnect.error);
|
|
6801
|
-
|
|
6802
|
-
publishSlackBlockedStatus(opts.setStatus, disconnect.error);
|
|
6803
|
-
runtime.error?.(`slack socket mode disconnected due to non-recoverable auth error — skipping channel (${formatSlackError(disconnect.error)})`);
|
|
6804
|
-
throw disconnect.error instanceof Error ? disconnect.error : new Error(formatSlackError(disconnect.error));
|
|
6805
|
-
}
|
|
6780
|
+
trackSlackAuthFailure(disconnect.error, "auth: disconnected, skipping channel", opts.setStatus, logError, authState);
|
|
6806
6781
|
reconnectAttempts += 1;
|
|
6807
6782
|
delayMs = computeBackoff(SLACK_SOCKET_RECONNECT_POLICY, reconnectAttempts);
|
|
6808
6783
|
runtime.log?.(warn(formatSlackSocketReconnectMessage({
|
|
@@ -6813,11 +6788,7 @@ async function monitorSlackProvider(opts) {
|
|
|
6813
6788
|
})));
|
|
6814
6789
|
await gracefulStopSlackApp(app);
|
|
6815
6790
|
} catch (err) {
|
|
6816
|
-
|
|
6817
|
-
publishSlackBlockedStatus(opts.setStatus, err);
|
|
6818
|
-
runtime.error?.(`slack socket mode failed to start due to non-recoverable auth error — skipping channel (${formatSlackError(err)})`);
|
|
6819
|
-
throw err;
|
|
6820
|
-
}
|
|
6791
|
+
trackSlackAuthFailure(err, "auth: start failed, skipping channel", opts.setStatus, logError, authState);
|
|
6821
6792
|
publishSlackDisconnectedStatus(opts.setStatus, err);
|
|
6822
6793
|
reconnectAttempts += 1;
|
|
6823
6794
|
delayMs = computeBackoff(SLACK_SOCKET_RECONNECT_POLICY, reconnectAttempts);
|
|
@@ -6887,12 +6858,10 @@ function createSlackWorkspaceClientResolver(params) {
|
|
|
6887
6858
|
return client;
|
|
6888
6859
|
};
|
|
6889
6860
|
}
|
|
6890
|
-
|
|
6891
|
-
//#region extensions/slack/src/monitor.ts
|
|
6861
|
+
// extensions/slack/src/monitor.ts
|
|
6892
6862
|
var monitor_exports = /* @__PURE__ */ __exportAll({
|
|
6893
6863
|
buildSlackSlashCommandMatcher: () => buildSlackSlashCommandMatcher,
|
|
6894
6864
|
isSlackChannelAllowedByPolicy: () => isSlackChannelAllowedByPolicy,
|
|
6895
6865
|
monitorSlackProvider: () => monitorSlackProvider
|
|
6896
6866
|
});
|
|
6897
|
-
//#endregion
|
|
6898
6867
|
export { resolveSlackChatType as C, stripSlackMentionsForCommandDetection as E, normalizeSlackChannelType as S, readSlackAssistantThreadContext as T, appendSlackStream as _, SlackResponseAlreadyReportedError as a, stopSlackStream as b, resolveSlackRoutingContext as c, parseSlackMessageEvent as d, requireSlackMessageEvent as f, SlackStreamNotDeliveredError as g, resolveSlackEffectiveAllowFrom as h, resolveSlackRoomContextHints as i, registerSlackSessionRun as l, resolveSlackCommandIngress as m, monitorSlackProvider as n, createSlackResponseUrlBudget as o, authorizeSlackBotRoomMessage as p, trackSlackDraftMessage as r, authorizeSlackDirectMessage as s, monitor_exports as t, resolveSlackThreadContext as u, markSlackStreamFallbackDelivered as v, buildSlackAssistantThreadMetadata as w, SLACK_SOCKET_RECONNECT_POLICY as x, startSlackStream as y };
|