@openclaw/slack 2026.10.10-beta.5 → 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-ChRfnnBu.mjs → action-runtime-DPoxYao5.mjs} +9 -10
- package/dist/.setup/action-runtime.runtime-DWKWaKgC.mjs +1 -0
- package/dist/.setup/{actions-By7tvpvv.mjs → actions-PF2cP6to.mjs} +14 -22
- package/dist/.setup/{approval-handler.runtime-D8ArtDQt.mjs → approval-handler.runtime-BtRklemy.mjs} +7 -8
- package/dist/.setup/{approval-message-updates-DT7XBPbV.mjs → approval-message-updates-CpwbsEj6.mjs} +2 -3
- package/dist/.setup/{channel-6YzXl_63.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-BEFP2ORi.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-BFilOuM_.mjs → monitor-DsZUQtTM.mjs} +78 -137
- package/dist/.setup/{outbound-adapter-9dbnYtL1.mjs → outbound-adapter-C0R5jz6S.mjs} +8 -9
- package/dist/.setup/{pipeline.runtime-BG5swHnj.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-yhn48xf5.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-oY9SbDiX.mjs → relay-source-DFBDTA5Z.mjs} +3 -4
- package/dist/.setup/{replies-CJwjTqDr.mjs → replies-7DRN46EL.mjs} +7 -9
- package/dist/.setup/{reply-blocks-Ca-raz2z.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-C-8wY0lK.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-Dv8wNBEt.mjs → session-status-CHkEn3HM.mjs} +31 -57
- 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-v5kQqJPh.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-Ck_j1YTn.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,8 +477,7 @@ 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;
|
|
488
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;
|
|
489
483
|
/** Consecutive isolated invalid_auth failures before the channel turns terminal. */
|
|
@@ -603,8 +597,7 @@ function isIsolatedInvalidAuthSlackError(error) {
|
|
|
603
597
|
const text = formatSlackError(error, "");
|
|
604
598
|
return /invalid_auth/i.test(text) && !SLACK_DEFINITIVE_AUTH_ERROR_RE.test(text);
|
|
605
599
|
}
|
|
606
|
-
|
|
607
|
-
//#region extensions/slack/src/monitor/socket-mode-envelope.ts
|
|
600
|
+
// extensions/slack/src/monitor/socket-mode-envelope.ts
|
|
608
601
|
function installSlackSocketModeEnvelopeGuard(client, acknowledge, logger) {
|
|
609
602
|
const dispatchers = client.listeners("ws_message");
|
|
610
603
|
for (const dispatch of dispatchers) client.off("ws_message", dispatch);
|
|
@@ -628,8 +621,7 @@ function installSlackSocketModeEnvelopeGuard(client, acknowledge, logger) {
|
|
|
628
621
|
for (const dispatch of dispatchers) dispatch.call(client, data, isBinary);
|
|
629
622
|
});
|
|
630
623
|
}
|
|
631
|
-
|
|
632
|
-
//#region extensions/slack/src/monitor/provider-support.ts
|
|
624
|
+
// extensions/slack/src/monitor/provider-support.ts
|
|
633
625
|
const OPENCLAW_SLACK_CLIENT_PING_TIMEOUT_MS = 15e3;
|
|
634
626
|
const SLACK_SOCKET_START_FAILED_EVENT = "unable_to_socket_mode_start";
|
|
635
627
|
const SLACK_NATIVE_RECONNECT_OBSERVER_KEY = "__openclawNativeReconnectFailureObserver";
|
|
@@ -911,8 +903,7 @@ function formatSlackUserResolved(entry) {
|
|
|
911
903
|
extra: entry.note ? [entry.note] : []
|
|
912
904
|
});
|
|
913
905
|
}
|
|
914
|
-
|
|
915
|
-
//#region extensions/slack/src/monitor/system-event-session.ts
|
|
906
|
+
// extensions/slack/src/monitor/system-event-session.ts
|
|
916
907
|
function createSlackSystemEventRouteResolver(params) {
|
|
917
908
|
return async (event) => {
|
|
918
909
|
const channelId = normalizeOptionalString(event.channelId) ?? "";
|
|
@@ -975,8 +966,7 @@ function createSlackSystemEventRouteResolver(params) {
|
|
|
975
966
|
};
|
|
976
967
|
};
|
|
977
968
|
}
|
|
978
|
-
|
|
979
|
-
//#region extensions/slack/src/monitor/runtime-policy.ts
|
|
969
|
+
// extensions/slack/src/monitor/runtime-policy.ts
|
|
980
970
|
function resolveSlackMonitorPolicy(cfg, accountId, runtime) {
|
|
981
971
|
const slack = mergeSlackAccountConfig(cfg, accountId);
|
|
982
972
|
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy({
|
|
@@ -1148,8 +1138,7 @@ async function resolveWorkspacePolicy(ctx, resolveToken) {
|
|
|
1148
1138
|
summarizeMapping("slack users", mapping, unresolved, runtime);
|
|
1149
1139
|
ctx.channelsConfigKeys = Object.keys(ctx.channelsConfig ?? {});
|
|
1150
1140
|
}
|
|
1151
|
-
|
|
1152
|
-
//#region extensions/slack/src/monitor/suggested-prompts.ts
|
|
1141
|
+
// extensions/slack/src/monitor/suggested-prompts.ts
|
|
1153
1142
|
async function updateSlackSuggestedPrompts(params) {
|
|
1154
1143
|
const prompts = params.prompts.map(({ title, message }) => ({
|
|
1155
1144
|
title: title.trim(),
|
|
@@ -1175,8 +1164,7 @@ async function updateSlackSuggestedPrompts(params) {
|
|
|
1175
1164
|
return outcome;
|
|
1176
1165
|
}
|
|
1177
1166
|
}
|
|
1178
|
-
|
|
1179
|
-
//#region extensions/slack/src/monitor/context.ts
|
|
1167
|
+
// extensions/slack/src/monitor/context.ts
|
|
1180
1168
|
function classifySlackChannelLookupFailure(error) {
|
|
1181
1169
|
if (error instanceof WebAPIRateLimitedError) return "rate_limited";
|
|
1182
1170
|
if (error instanceof WebAPIHTTPError) return error.statusCode === 429 ? "rate_limited" : error.statusCode === 404 ? "not_found" : "other";
|
|
@@ -1498,8 +1486,7 @@ function createSlackMonitorContext(params) {
|
|
|
1498
1486
|
ctx.readRuntimeContext = createSlackRuntimeContextReader(ctx, lookupToken ?? params.botToken);
|
|
1499
1487
|
return ctx;
|
|
1500
1488
|
}
|
|
1501
|
-
|
|
1502
|
-
//#region extensions/slack/src/streaming.ts
|
|
1489
|
+
// extensions/slack/src/streaming.ts
|
|
1503
1490
|
/**
|
|
1504
1491
|
* Thrown when Slack definitively rejects a stream flush/finalize while text
|
|
1505
1492
|
* remains buffered locally by the Slack SDK. Carries the pending text so the
|
|
@@ -1671,8 +1658,7 @@ function markSlackStreamFallbackDelivered(session) {
|
|
|
1671
1658
|
if (session.stopped) releaseSlackStream(session);
|
|
1672
1659
|
else stateBySession.get(session)?.sessions.add(session);
|
|
1673
1660
|
}
|
|
1674
|
-
|
|
1675
|
-
//#region extensions/slack/src/monitor/thread-resolution.ts
|
|
1661
|
+
// extensions/slack/src/monitor/thread-resolution.ts
|
|
1676
1662
|
const DEFAULT_THREAD_TS_CACHE_TTL_MS = 6e4;
|
|
1677
1663
|
const DEFAULT_THREAD_TS_CACHE_MAX = 500;
|
|
1678
1664
|
const markAmbiguousThreadReply = (message) => ({
|
|
@@ -1767,8 +1753,7 @@ function createSlackThreadTsResolver(params) {
|
|
|
1767
1753
|
return markAmbiguousThreadReply(message);
|
|
1768
1754
|
} };
|
|
1769
1755
|
}
|
|
1770
|
-
|
|
1771
|
-
//#region extensions/slack/src/monitor/auth.ts
|
|
1756
|
+
// extensions/slack/src/monitor/auth.ts
|
|
1772
1757
|
const slackChannelMembersCache = /* @__PURE__ */ new WeakMap();
|
|
1773
1758
|
const CHANNEL_MEMBERS_CACHE_TTL_MS = 6e4;
|
|
1774
1759
|
const CHANNEL_MEMBERS_CACHE_MAX = 512;
|
|
@@ -2106,8 +2091,7 @@ async function authorizeSlackSystemEventSender(params) {
|
|
|
2106
2091
|
channelName
|
|
2107
2092
|
};
|
|
2108
2093
|
}
|
|
2109
|
-
|
|
2110
|
-
//#region extensions/slack/src/monitor/event-scope.ts
|
|
2094
|
+
// extensions/slack/src/monitor/event-scope.ts
|
|
2111
2095
|
function resolveSlackMonitorEventScope(params) {
|
|
2112
2096
|
const identity = params.ctx.installationIdentity;
|
|
2113
2097
|
const clientOptions = params.ctx.app.webClientOptions;
|
|
@@ -2139,8 +2123,7 @@ function resolveSlackMonitorEventScope(params) {
|
|
|
2139
2123
|
...writeClient ? { writeClient } : {}
|
|
2140
2124
|
};
|
|
2141
2125
|
}
|
|
2142
|
-
|
|
2143
|
-
//#region extensions/slack/src/types.ts
|
|
2126
|
+
// extensions/slack/src/types.ts
|
|
2144
2127
|
function parseSlackMessageEvent(value) {
|
|
2145
2128
|
const record = asOptionalRecord(value);
|
|
2146
2129
|
return record?.type === "message" && typeof record.channel === "string" ? {
|
|
@@ -2154,8 +2137,7 @@ function requireSlackMessageEvent(value) {
|
|
|
2154
2137
|
if (!event) throw new TypeError("Invalid persisted Slack message event");
|
|
2155
2138
|
return event;
|
|
2156
2139
|
}
|
|
2157
|
-
|
|
2158
|
-
//#region extensions/slack/src/monitor/ingress.ts
|
|
2140
|
+
// extensions/slack/src/monitor/ingress.ts
|
|
2159
2141
|
const SLACK_INGRESS_PAYLOAD_VERSION = 1;
|
|
2160
2142
|
const SLACK_INGRESS_POLL_INTERVAL_MS = 1e3;
|
|
2161
2143
|
const SLACK_BOLT_AUTHORIZATION_ERROR = "slack_bolt_authorization_error";
|
|
@@ -2479,8 +2461,7 @@ function createSlackDurableIngress(options) {
|
|
|
2479
2461
|
waitForIdle: monitor.waitForIdle
|
|
2480
2462
|
};
|
|
2481
2463
|
}
|
|
2482
|
-
|
|
2483
|
-
//#region extensions/slack/src/threading.ts
|
|
2464
|
+
// extensions/slack/src/threading.ts
|
|
2484
2465
|
function resolveSlackThreadContext(params) {
|
|
2485
2466
|
const incomingThreadTs = params.message.thread_ts;
|
|
2486
2467
|
const eventTs = params.message.event_ts;
|
|
@@ -2497,8 +2478,7 @@ function resolveSlackThreadContext(params) {
|
|
|
2497
2478
|
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
2498
2479
|
};
|
|
2499
2480
|
}
|
|
2500
|
-
|
|
2501
|
-
//#region extensions/slack/src/monitor/session-run-targets.ts
|
|
2481
|
+
// extensions/slack/src/monitor/session-run-targets.ts
|
|
2502
2482
|
async function captureSlackSessionTargetGuard(ctx, route, isActive) {
|
|
2503
2483
|
return captureSessionEntryCurrentCheckAsync({
|
|
2504
2484
|
agentId: route.agentId,
|
|
@@ -2540,8 +2520,7 @@ function getSlackSessionRuns(ctx, address) {
|
|
|
2540
2520
|
isActive: () => targets.some((candidate) => candidate.route.sessionKey === target.route.sessionKey && candidate.isActive())
|
|
2541
2521
|
}));
|
|
2542
2522
|
}
|
|
2543
|
-
|
|
2544
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
2523
|
+
// extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
2545
2524
|
async function resolveSlackRoutingContext(params) {
|
|
2546
2525
|
const { ctx, account, message, chatType, channelConfig, seedTopLevelRoomThread, assistantThreadTs, agentViewThreadTs, eventScope } = params;
|
|
2547
2526
|
const isDirectMessage = chatType === "direct";
|
|
@@ -2719,8 +2698,7 @@ async function resolveSlackSessionEventRoutingContext(params) {
|
|
|
2719
2698
|
release: current.release
|
|
2720
2699
|
};
|
|
2721
2700
|
}
|
|
2722
|
-
|
|
2723
|
-
//#region extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2701
|
+
// extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2724
2702
|
function resolveSlackDeferredActionTarget(params) {
|
|
2725
2703
|
if (!params.id) throw new Error("Slack deferred action is missing a target ID");
|
|
2726
2704
|
if (!params.eventScope) return {
|
|
@@ -2733,8 +2711,7 @@ function resolveSlackDeferredActionTarget(params) {
|
|
|
2733
2711
|
target
|
|
2734
2712
|
};
|
|
2735
2713
|
}
|
|
2736
|
-
|
|
2737
|
-
//#region extensions/slack/src/monitor/dm-auth.ts
|
|
2714
|
+
// extensions/slack/src/monitor/dm-auth.ts
|
|
2738
2715
|
async function authorizeSlackDirectMessage(params) {
|
|
2739
2716
|
if (!params.ctx.dmEnabled || params.ctx.dmPolicy === "disabled") {
|
|
2740
2717
|
await params.onDisabled();
|
|
@@ -2790,8 +2767,7 @@ async function authorizeSlackDirectMessage(params) {
|
|
|
2790
2767
|
});
|
|
2791
2768
|
return false;
|
|
2792
2769
|
}
|
|
2793
|
-
|
|
2794
|
-
//#region extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
2770
|
+
// extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
2795
2771
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
2796
2772
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(24)}}$`);
|
|
2797
2773
|
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 6e5;
|
|
@@ -2827,8 +2803,7 @@ function createSlackExternalArgMenuStore() {
|
|
|
2827
2803
|
}
|
|
2828
2804
|
};
|
|
2829
2805
|
}
|
|
2830
|
-
|
|
2831
|
-
//#region extensions/slack/src/monitor/response-url-budget.ts
|
|
2806
|
+
// extensions/slack/src/monitor/response-url-budget.ts
|
|
2832
2807
|
const SLACK_RESPONSE_URL_MAX_CALLS = 5;
|
|
2833
2808
|
var SlackResponseAlreadyReportedError = class extends Error {};
|
|
2834
2809
|
/** Count every response_url attempt, including requests Slack rejects. */
|
|
@@ -2843,8 +2818,7 @@ function createSlackResponseUrlBudget(respond, maxCalls = SLACK_RESPONSE_URL_MAX
|
|
|
2843
2818
|
}
|
|
2844
2819
|
};
|
|
2845
2820
|
}
|
|
2846
|
-
|
|
2847
|
-
//#region extensions/slack/src/monitor/room-context.ts
|
|
2821
|
+
// extensions/slack/src/monitor/room-context.ts
|
|
2848
2822
|
function resolveSlackRoomContextHints(params) {
|
|
2849
2823
|
return {
|
|
2850
2824
|
channelMetadata: params.isRoomish ? buildChannelMetadata({
|
|
@@ -2855,8 +2829,7 @@ function resolveSlackRoomContextHints(params) {
|
|
|
2855
2829
|
groupSystemPrompt: params.isRoomish ? normalizeOptionalString(params.channelConfig?.systemPrompt) : void 0
|
|
2856
2830
|
};
|
|
2857
2831
|
}
|
|
2858
|
-
|
|
2859
|
-
//#region extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
2832
|
+
// extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
2860
2833
|
async function resolveSlackCommandMenuModelContext(params) {
|
|
2861
2834
|
if (!params.sessionKey.trim()) return {};
|
|
2862
2835
|
try {
|
|
@@ -2905,8 +2878,7 @@ async function resolveSlackCommandMenuModelContext(params) {
|
|
|
2905
2878
|
return {};
|
|
2906
2879
|
}
|
|
2907
2880
|
}
|
|
2908
|
-
|
|
2909
|
-
//#region extensions/slack/src/monitor/slash.ts
|
|
2881
|
+
// extensions/slack/src/monitor/slash.ts
|
|
2910
2882
|
const SLACK_COMMAND_ARG_ACTION_ID = "openclaw_cmdarg";
|
|
2911
2883
|
const SLACK_COMMAND_ARG_ACTION_LISTENER = /^openclaw_cmdarg/;
|
|
2912
2884
|
const SLACK_COMMAND_ARG_VALUE_PREFIX = "cmdarg";
|
|
@@ -2921,7 +2893,7 @@ const SLACK_COMMAND_ARG_BUTTON_VALUE_MAX = 2e3;
|
|
|
2921
2893
|
const SLACK_COMMAND_ARG_CONFIRM_TEXT_MAX = 300;
|
|
2922
2894
|
const SLACK_HEADER_TEXT_MAX = 150;
|
|
2923
2895
|
const SLACK_COMMAND_ARG_ACTION_BLOCKS_MAX = 47;
|
|
2924
|
-
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-
|
|
2896
|
+
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-Bnn9a5qB.mjs"));
|
|
2925
2897
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
2926
2898
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
2927
2899
|
function buildSlackArgMenuConfirm(params) {
|
|
@@ -3720,8 +3692,7 @@ async function deliverSlackSlashResponseWithWebApi(params) {
|
|
|
3720
3692
|
function isSlackBoltRespondError(error) {
|
|
3721
3693
|
return Boolean(error) && typeof error === "object" && error.code === "slack_bolt_respond_error";
|
|
3722
3694
|
}
|
|
3723
|
-
|
|
3724
|
-
//#region extensions/slack/src/monitor/events/agent.ts
|
|
3695
|
+
// extensions/slack/src/monitor/events/agent.ts
|
|
3725
3696
|
function registerSlackAgentEvents(params) {
|
|
3726
3697
|
const { ctx, trackEvent } = params;
|
|
3727
3698
|
const handleCommand = createSlackCommandHandler({
|
|
@@ -3860,8 +3831,7 @@ function registerSlackAgentEvents(params) {
|
|
|
3860
3831
|
}
|
|
3861
3832
|
});
|
|
3862
3833
|
}
|
|
3863
|
-
|
|
3864
|
-
//#region extensions/slack/src/monitor/events/assistant.ts
|
|
3834
|
+
// extensions/slack/src/monitor/events/assistant.ts
|
|
3865
3835
|
function normalizeAssistantThread(event, getPrevious) {
|
|
3866
3836
|
const thread = event.assistant_thread;
|
|
3867
3837
|
if (!thread) return null;
|
|
@@ -3924,8 +3894,7 @@ function registerSlackAssistantEvents(params) {
|
|
|
3924
3894
|
});
|
|
3925
3895
|
});
|
|
3926
3896
|
}
|
|
3927
|
-
|
|
3928
|
-
//#region extensions/slack/src/channel-migration.ts
|
|
3897
|
+
// extensions/slack/src/channel-migration.ts
|
|
3929
3898
|
function resolveAccountChannels(cfg, accountId) {
|
|
3930
3899
|
if (!accountId) return {};
|
|
3931
3900
|
const normalized = normalizeAccountId$1(accountId);
|
|
@@ -3975,8 +3944,7 @@ function migrateSlackChannelConfig(params) {
|
|
|
3975
3944
|
scopes
|
|
3976
3945
|
};
|
|
3977
3946
|
}
|
|
3978
|
-
|
|
3979
|
-
//#region extensions/slack/src/monitor/events/channels.ts
|
|
3947
|
+
// extensions/slack/src/monitor/events/channels.ts
|
|
3980
3948
|
function registerSlackChannelEvents(params) {
|
|
3981
3949
|
const { ctx, trackEvent } = params;
|
|
3982
3950
|
for (const [eventName, kind] of [["channel_created", "created"], ["channel_rename", "renamed"]]) ctx.app.event(eventName, async (args) => {
|
|
@@ -4063,8 +4031,7 @@ function registerSlackChannelIdChangedEvent(params) {
|
|
|
4063
4031
|
}
|
|
4064
4032
|
});
|
|
4065
4033
|
}
|
|
4066
|
-
|
|
4067
|
-
//#region extensions/slack/src/monitor/events/home.ts
|
|
4034
|
+
// extensions/slack/src/monitor/events/home.ts
|
|
4068
4035
|
function buildSlackHomeView(slashCommandName) {
|
|
4069
4036
|
return {
|
|
4070
4037
|
type: "home",
|
|
@@ -4118,8 +4085,7 @@ function registerSlackHomeEvents(params) {
|
|
|
4118
4085
|
});
|
|
4119
4086
|
});
|
|
4120
4087
|
}
|
|
4121
|
-
|
|
4122
|
-
//#region extensions/slack/src/interactive-dispatch.ts
|
|
4088
|
+
// extensions/slack/src/interactive-dispatch.ts
|
|
4123
4089
|
const dispatchSlackInteractive = createChannelInteractiveDispatcher({
|
|
4124
4090
|
channel: "slack",
|
|
4125
4091
|
interactiveKey: "interaction"
|
|
@@ -4144,8 +4110,7 @@ async function dispatchSlackPluginInteractiveHandler(params) {
|
|
|
4144
4110
|
}
|
|
4145
4111
|
});
|
|
4146
4112
|
}
|
|
4147
|
-
|
|
4148
|
-
//#region extensions/slack/src/monitor/events/interaction-event.ts
|
|
4113
|
+
// extensions/slack/src/monitor/events/interaction-event.ts
|
|
4149
4114
|
const SLACK_INTERACTION_EVENT_PREFIX = "Slack interaction: ";
|
|
4150
4115
|
const REDACTED_INTERACTION_VALUE = "[redacted]";
|
|
4151
4116
|
const SLACK_INTERACTION_EVENT_MAX_CHARS = 2400;
|
|
@@ -4258,8 +4223,7 @@ function enqueueSlackInteractionEvent(payload, route, options) {
|
|
|
4258
4223
|
heartbeat: { target: "last" }
|
|
4259
4224
|
});
|
|
4260
4225
|
}
|
|
4261
|
-
|
|
4262
|
-
//#region extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
4226
|
+
// extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
4263
4227
|
function resolveSlackPluginApprovalSender(params) {
|
|
4264
4228
|
const senderId = formatSlackTarget({
|
|
4265
4229
|
kind: "user",
|
|
@@ -4275,8 +4239,7 @@ function resolveSlackPluginApprovalSender(params) {
|
|
|
4275
4239
|
})
|
|
4276
4240
|
};
|
|
4277
4241
|
}
|
|
4278
|
-
|
|
4279
|
-
//#region extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
4242
|
+
// extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
4280
4243
|
function readOptionStrings(options, read) {
|
|
4281
4244
|
if (!Array.isArray(options)) return [];
|
|
4282
4245
|
return options.map((option) => option && typeof option === "object" ? read(option) : void 0).filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
@@ -4370,8 +4333,7 @@ function formatInteractionSelectionLabel(params) {
|
|
|
4370
4333
|
if (params.summary.value?.trim()) return params.summary.value.trim();
|
|
4371
4334
|
return params.actionId;
|
|
4372
4335
|
}
|
|
4373
|
-
|
|
4374
|
-
//#region extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
4336
|
+
// extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
4375
4337
|
function resolveSlackActionValue(summary) {
|
|
4376
4338
|
return normalizeOptionalString(summary.value) ?? summary.selectedValues?.[0];
|
|
4377
4339
|
}
|
|
@@ -4540,7 +4502,7 @@ async function handleSlackApprovalInteraction(params) {
|
|
|
4540
4502
|
channelId,
|
|
4541
4503
|
messageTs
|
|
4542
4504
|
}, async () => {
|
|
4543
|
-
const { readSlackMessages } = await import("./actions-
|
|
4505
|
+
const { readSlackMessages } = await import("./actions-PF2cP6to.mjs").then((n) => n.t);
|
|
4544
4506
|
const { messages } = await readSlackMessages(channelId, {
|
|
4545
4507
|
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
4546
4508
|
messageId: messageTs,
|
|
@@ -4895,8 +4857,7 @@ function registerSlackBlockActionHandler(params) {
|
|
|
4895
4857
|
await updateSlackLegacyBlockAction(actionContext);
|
|
4896
4858
|
});
|
|
4897
4859
|
}
|
|
4898
|
-
|
|
4899
|
-
//#region extensions/slack/src/modal-metadata.ts
|
|
4860
|
+
// extensions/slack/src/modal-metadata.ts
|
|
4900
4861
|
function parseSlackModalPrivateMetadata(raw) {
|
|
4901
4862
|
if (typeof raw !== "string" || raw.trim().length === 0) return {};
|
|
4902
4863
|
try {
|
|
@@ -4912,8 +4873,7 @@ function parseSlackModalPrivateMetadata(raw) {
|
|
|
4912
4873
|
return {};
|
|
4913
4874
|
}
|
|
4914
4875
|
}
|
|
4915
|
-
|
|
4916
|
-
//#region extensions/slack/src/monitor/events/interactions.modal.ts
|
|
4876
|
+
// extensions/slack/src/monitor/events/interactions.modal.ts
|
|
4917
4877
|
const OPENCLAW_MODAL_CALLBACK_PREFIX = "openclaw:";
|
|
4918
4878
|
function resolveSlackModalPluginInteractiveData(params) {
|
|
4919
4879
|
const metadataData = params.metadata.pluginInteractiveData?.trim();
|
|
@@ -5142,8 +5102,7 @@ function registerModalLifecycleHandler(params) {
|
|
|
5142
5102
|
});
|
|
5143
5103
|
});
|
|
5144
5104
|
}
|
|
5145
|
-
|
|
5146
|
-
//#region extensions/slack/src/monitor/events/interactions.shortcuts.ts
|
|
5105
|
+
// extensions/slack/src/monitor/events/interactions.shortcuts.ts
|
|
5147
5106
|
function registerSlackShortcutHandler(params) {
|
|
5148
5107
|
if (typeof params.ctx.app.shortcut !== "function") return;
|
|
5149
5108
|
params.ctx.app.shortcut(/.+/, async (args) => {
|
|
@@ -5242,8 +5201,7 @@ function registerSlackShortcutHandler(params) {
|
|
|
5242
5201
|
});
|
|
5243
5202
|
});
|
|
5244
5203
|
}
|
|
5245
|
-
|
|
5246
|
-
//#region extensions/slack/src/monitor/events/interactions.ts
|
|
5204
|
+
// extensions/slack/src/monitor/events/interactions.ts
|
|
5247
5205
|
function registerSlackInteractionEvents(params) {
|
|
5248
5206
|
const { ctx, trackEvent } = params;
|
|
5249
5207
|
registerSlackBlockActionHandler(params);
|
|
@@ -5255,8 +5213,7 @@ function registerSlackInteractionEvents(params) {
|
|
|
5255
5213
|
interactionType
|
|
5256
5214
|
});
|
|
5257
5215
|
}
|
|
5258
|
-
|
|
5259
|
-
//#region extensions/slack/src/monitor/events/system-event-context.ts
|
|
5216
|
+
// extensions/slack/src/monitor/events/system-event-context.ts
|
|
5260
5217
|
async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
5261
5218
|
const { senderId, channelId, channelType, eventKind } = params;
|
|
5262
5219
|
const ctx = await params.ctx.readRuntimeContext();
|
|
@@ -5286,8 +5243,7 @@ async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
|
5286
5243
|
})
|
|
5287
5244
|
};
|
|
5288
5245
|
}
|
|
5289
|
-
|
|
5290
|
-
//#region extensions/slack/src/monitor/events/members.ts
|
|
5246
|
+
// extensions/slack/src/monitor/events/members.ts
|
|
5291
5247
|
function registerSlackMemberEvents(params) {
|
|
5292
5248
|
const { ctx, trackEvent } = params;
|
|
5293
5249
|
for (const verb of ["joined", "left"]) ctx.app.event(`member_${verb}_channel`, async (args) => {
|
|
@@ -5374,8 +5330,7 @@ function registerSlackMemberEvents(params) {
|
|
|
5374
5330
|
}
|
|
5375
5331
|
});
|
|
5376
5332
|
}
|
|
5377
|
-
|
|
5378
|
-
//#region extensions/slack/src/draft-message-boundaries.ts
|
|
5333
|
+
// extensions/slack/src/draft-message-boundaries.ts
|
|
5379
5334
|
const activeDraftsByConversation = /* @__PURE__ */ new Map();
|
|
5380
5335
|
function conversationKey(conversation) {
|
|
5381
5336
|
return [
|
|
@@ -5426,8 +5381,7 @@ function noteSlackDraftConversationMessage(conversation) {
|
|
|
5426
5381
|
if (isLaterSlackMessage(conversation.messageTs, draft.messageTs)) draft.onInterveningMessage();
|
|
5427
5382
|
}
|
|
5428
5383
|
}
|
|
5429
|
-
|
|
5430
|
-
//#region extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
5384
|
+
// extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
5431
5385
|
function resolveSlackMessageSubtypeHandler(event) {
|
|
5432
5386
|
const subtype = event.subtype;
|
|
5433
5387
|
if (subtype !== "message_changed" && subtype !== "message_deleted") return;
|
|
@@ -5451,8 +5405,7 @@ function resolveSlackMessageSubtypeHandler(event) {
|
|
|
5451
5405
|
}).replyToId : void 0
|
|
5452
5406
|
};
|
|
5453
5407
|
}
|
|
5454
|
-
|
|
5455
|
-
//#region extensions/slack/src/monitor/events/messages.ts
|
|
5408
|
+
// extensions/slack/src/monitor/events/messages.ts
|
|
5456
5409
|
const slackInboundLog = createSubsystemLogger("gateway/channels/slack").child("inbound");
|
|
5457
5410
|
function isBotAuthoredEnterpriseEvent(event) {
|
|
5458
5411
|
return Boolean(normalizeOptionalString(event.bot_id)) || event.subtype === "bot_message";
|
|
@@ -5620,8 +5573,7 @@ function registerSlackMessageEvents(params) {
|
|
|
5620
5573
|
}
|
|
5621
5574
|
});
|
|
5622
5575
|
}
|
|
5623
|
-
|
|
5624
|
-
//#region extensions/slack/src/monitor/events/pins.ts
|
|
5576
|
+
// extensions/slack/src/monitor/events/pins.ts
|
|
5625
5577
|
function registerSlackPinEvents(params) {
|
|
5626
5578
|
const { ctx, trackEvent } = params;
|
|
5627
5579
|
for (const contextKeySuffix of ["added", "removed"]) {
|
|
@@ -5658,8 +5610,7 @@ function registerSlackPinEvents(params) {
|
|
|
5658
5610
|
});
|
|
5659
5611
|
}
|
|
5660
5612
|
}
|
|
5661
|
-
|
|
5662
|
-
//#region extensions/slack/src/monitor/events/reactions.ts
|
|
5613
|
+
// extensions/slack/src/monitor/events/reactions.ts
|
|
5663
5614
|
function shouldEmitSlackReactionNotification(params) {
|
|
5664
5615
|
const { ctx, event, actorName } = params;
|
|
5665
5616
|
if (ctx.reactionMode === "off") return false;
|
|
@@ -5724,8 +5675,7 @@ function registerSlackReactionEvents(params) {
|
|
|
5724
5675
|
}
|
|
5725
5676
|
});
|
|
5726
5677
|
}
|
|
5727
|
-
|
|
5728
|
-
//#region extensions/slack/src/monitor/events.ts
|
|
5678
|
+
// extensions/slack/src/monitor/events.ts
|
|
5729
5679
|
function registerSlackCommonEvents(params) {
|
|
5730
5680
|
registerSlackMessageEvents({
|
|
5731
5681
|
ctx: params.ctx,
|
|
@@ -5771,8 +5721,7 @@ function registerSlackWorkspaceEvents(params) {
|
|
|
5771
5721
|
trackEvent: params.trackEvent
|
|
5772
5722
|
});
|
|
5773
5723
|
}
|
|
5774
|
-
|
|
5775
|
-
//#region extensions/slack/src/monitor/http-handler.ts
|
|
5724
|
+
// extensions/slack/src/monitor/http-handler.ts
|
|
5776
5725
|
const SLACK_WEBHOOK_MAX_BODY_BYTES = 1048576;
|
|
5777
5726
|
const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
|
|
5778
5727
|
function createSlackHttpRequestHandler(params) {
|
|
@@ -5804,8 +5753,7 @@ function createSlackHttpRequestHandler(params) {
|
|
|
5804
5753
|
}
|
|
5805
5754
|
};
|
|
5806
5755
|
}
|
|
5807
|
-
|
|
5808
|
-
//#region extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5756
|
+
// extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5809
5757
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_TTL_MS = 864e5;
|
|
5810
5758
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_MEMORY_MAX_ENTRIES = 2e4;
|
|
5811
5759
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_STATE_MAX_ENTRIES = 2e4;
|
|
@@ -5859,8 +5807,7 @@ async function claimSlackMessageDispatchReplay(params) {
|
|
|
5859
5807
|
handle: claim.handle
|
|
5860
5808
|
} : { kind: "duplicate" };
|
|
5861
5809
|
}
|
|
5862
|
-
|
|
5863
|
-
//#region extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5810
|
+
// extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5864
5811
|
function resolveSlackSenderId(message) {
|
|
5865
5812
|
return message.user ?? message.bot_id ?? null;
|
|
5866
5813
|
}
|
|
@@ -5877,9 +5824,8 @@ function buildSlackDebounceKey(message, accountId, teamId) {
|
|
|
5877
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;
|
|
5878
5825
|
return `slack:${accountId}:${teamId ? `${teamId}:` : ""}${threadKey}:${senderId}`;
|
|
5879
5826
|
}
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-BG5swHnj.mjs"));
|
|
5827
|
+
// extensions/slack/src/monitor/message-handler.ts
|
|
5828
|
+
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-CIFVL0kf.mjs"));
|
|
5883
5829
|
const RETRYABLE_FLUSH_MAX_ATTEMPTS = 3;
|
|
5884
5830
|
function shouldDebounceSlackMessage(message, cfg) {
|
|
5885
5831
|
const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");
|
|
@@ -6145,8 +6091,7 @@ function createSlackMessageHandler(params) {
|
|
|
6145
6091
|
await (await enqueueSlackMessage(message, opts))?.promise;
|
|
6146
6092
|
};
|
|
6147
6093
|
}
|
|
6148
|
-
|
|
6149
|
-
//#region extensions/slack/src/monitor/presence-monitor.ts
|
|
6094
|
+
// extensions/slack/src/monitor/presence-monitor.ts
|
|
6150
6095
|
const SLACK_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
6151
6096
|
const SLACK_PRESENCE_REQUEST_TIMEOUT_MS = 3e4;
|
|
6152
6097
|
const SLACK_PRESENCE_POLL_INTERVAL_MS = 6e4;
|
|
@@ -6384,8 +6329,7 @@ function createSlackPresenceMonitor(params) {
|
|
|
6384
6329
|
function presenceSubjectKey(subject) {
|
|
6385
6330
|
return `${subject.teamId ?? "workspace"}:${subject.userId}`;
|
|
6386
6331
|
}
|
|
6387
|
-
|
|
6388
|
-
//#region extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6332
|
+
// extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6389
6333
|
const SLACK_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
|
|
6390
6334
|
function openSlackPresenceCooldownStore() {
|
|
6391
6335
|
return getSlackRuntime().state.openKeyedStore({
|
|
@@ -6395,8 +6339,7 @@ function openSlackPresenceCooldownStore() {
|
|
|
6395
6339
|
defaultTtlMs: SLACK_PRESENCE_GREETING_COOLDOWN_MS
|
|
6396
6340
|
});
|
|
6397
6341
|
}
|
|
6398
|
-
|
|
6399
|
-
//#region extensions/slack/src/monitor/provider.ts
|
|
6342
|
+
// extensions/slack/src/monitor/provider.ts
|
|
6400
6343
|
let slackBoltInterop;
|
|
6401
6344
|
function withSlackPresenceLifecycleSignal(fetchImpl, lifecycleSignal) {
|
|
6402
6345
|
return async (input, init) => await fetchImpl(input, {
|
|
@@ -6414,7 +6357,7 @@ async function getSlackBoltInterop() {
|
|
|
6414
6357
|
}
|
|
6415
6358
|
return slackBoltInterop;
|
|
6416
6359
|
}
|
|
6417
|
-
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-
|
|
6360
|
+
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-DFBDTA5Z.mjs"));
|
|
6418
6361
|
function resolveSlackRuntimeIdentity(params) {
|
|
6419
6362
|
const botUserId = normalizeOptionalString(params.botUserId);
|
|
6420
6363
|
const botId = normalizeOptionalString(params.botId);
|
|
@@ -6915,12 +6858,10 @@ function createSlackWorkspaceClientResolver(params) {
|
|
|
6915
6858
|
return client;
|
|
6916
6859
|
};
|
|
6917
6860
|
}
|
|
6918
|
-
|
|
6919
|
-
//#region extensions/slack/src/monitor.ts
|
|
6861
|
+
// extensions/slack/src/monitor.ts
|
|
6920
6862
|
var monitor_exports = /* @__PURE__ */ __exportAll({
|
|
6921
6863
|
buildSlackSlashCommandMatcher: () => buildSlackSlashCommandMatcher,
|
|
6922
6864
|
isSlackChannelAllowedByPolicy: () => isSlackChannelAllowedByPolicy,
|
|
6923
6865
|
monitorSlackProvider: () => monitorSlackProvider
|
|
6924
6866
|
});
|
|
6925
|
-
//#endregion
|
|
6926
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 };
|