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