@openclaw/slack 2026.11.5-beta.1 → 2026.11.5-beta.2
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-DgQgj0wk.mjs → account-inspect-BLVha-ov.mjs} +4 -3
- package/dist/.setup/{accounts-EaPP0fFY.mjs → accounts-CGJScKtk.mjs} +10 -6
- package/dist/.setup/{action-runtime-CK9QZgQl.mjs → action-runtime-D01wBhx5.mjs} +10 -9
- package/dist/.setup/action-runtime.runtime-VQGaR6g8.mjs +1 -0
- package/dist/.setup/{actions-s3CcFO45.mjs → actions-D5S6D_BU.mjs} +22 -14
- package/dist/.setup/{approval-handler.runtime-Ch7BecYK.mjs → approval-handler.runtime-Buw5jh2Y.mjs} +8 -7
- package/dist/.setup/{approval-message-updates-CqcRoa28.mjs → approval-message-updates-pmXcve5E.mjs} +3 -2
- package/dist/.setup/{channel-CAvo_WNZ.mjs → channel-C_R98Nbv.mjs} +45 -36
- package/dist/.setup/{channel-meta-C5vsCo3a.mjs → channel-meta-C443t-lI.mjs} +2 -1
- package/dist/.setup/{channel-type-9Lw6yLf2.mjs → channel-type-B5P3w9eA.mjs} +6 -5
- package/dist/.setup/{channel.setup-BlgXNuCJ.mjs → channel.setup-Lq2OxKkF.mjs} +14 -10
- package/dist/.setup/{config-schema-Bx1tCZB0.mjs → config-schema-BWAaa5au.mjs} +4 -2
- package/dist/.setup/{cursor-pages-jVn3Vkfi.mjs → cursor-pages-CATAzbTT.mjs} +8 -4
- package/dist/.setup/{directory-config-CGvKYg9F.mjs → directory-config-D-hf9KGQ.mjs} +6 -5
- package/dist/.setup/{directory-live-DNdw97LA.mjs → directory-live-onKAFI1E.mjs} +5 -4
- package/dist/.setup/{doctor-contract-BB2KJ9Ni.mjs → doctor-contract-9-QJRCXk.mjs} +13 -7
- package/dist/.setup/{message-tool-api-B38BpEaE.mjs → message-tool-api-LGIgVXJf.mjs} +7 -5
- package/dist/.setup/{monitor-BD86SotB.mjs → monitor-Cm1TuqxN.mjs} +128 -73
- package/dist/.setup/{outbound-adapter-BH6iPWBj.mjs → outbound-adapter-C-95EWl2.mjs} +10 -9
- package/dist/.setup/{paths-CQZI_5WY.mjs → paths-B1u59oLK.mjs} +2 -1
- package/dist/.setup/{pipeline.runtime-C4ELxaRU.mjs → pipeline.runtime-DGnV6akc.mjs} +71 -43
- package/dist/.setup/{policy-C6_DdlSf.mjs → policy-DxhGRvc2.mjs} +5 -3
- package/dist/.setup/{probe-B_Ax1vS1.mjs → probe-DANukR3O.mjs} +66 -36
- package/dist/.setup/{question-delivery-D3qAIwuv.mjs → question-delivery-CWC7sRhH.mjs} +3 -2
- package/dist/.setup/{relay-source-a8jodKuO.mjs → relay-source-DoyOlTbK.mjs} +4 -3
- package/dist/.setup/{replies-Bq7n0gfM.mjs → replies-BcmUKord.mjs} +10 -8
- package/dist/.setup/{reply-blocks-DyYYRrP_.mjs → reply-blocks-BzsXUUUL.mjs} +7 -4
- package/dist/.setup/{resolve-channels-CF2JME9q.mjs → resolve-channels-XDPgnesf.mjs} +5 -4
- package/dist/.setup/{resolve-users-DDcCAjH1.mjs → resolve-users-aDAv24U2.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-Cx_PV-xu.mjs +2 -0
- package/dist/.setup/{scopes-CzHC_dwV.mjs → scopes-BocHwImV.mjs} +4 -3
- package/dist/.setup/{secret-contract-api-DaCXZ47j.mjs → secret-contract-api-BlLz88mj.mjs} +1 -1
- package/dist/.setup/{secret-contract-CqVqR7MP.mjs → secret-contract-uiQtoNlu.mjs} +3 -2
- package/dist/.setup/{security-audit-C3hXCfDt.mjs → security-audit-DFGiFLqd.mjs} +3 -2
- package/dist/.setup/{send-results-Bm6V1ekL.mjs → send-results-BGxlroJ-.mjs} +2 -1
- package/dist/.setup/{send-WJZ73VSf.mjs → send-yK6_-px6.mjs} +19 -13
- package/dist/.setup/setup-plugin-api-Cfz58xoh.mjs +2 -0
- package/dist/.setup/{setup-surface-uIqP2B0Y.mjs → setup-surface-C0KRtyqa.mjs} +7 -6
- package/dist/.setup/{slash-dispatch.runtime-Cwuwv7FL.mjs → slash-dispatch.runtime-CyVC3bYx.mjs} +1 -1
- package/dist/.setup/{target-parsing-DwYAP3ts.mjs → target-parsing-Bx2UZniD.mjs} +2 -1
- package/dist/.setup/{targets-eeOxA_b_.mjs → targets-D-ASeWHy.mjs} +3 -2
- package/dist/.setup/{thread-ts-47Au2-Yn.mjs → thread-ts-Cvt7WD6B.mjs} +2 -1
- package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -1
- package/dist/account-inspect-api.js +3 -2
- package/dist/api.js +16 -16
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-entry.js +2 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +3 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +2 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +10 -10
- 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 +5 -4
- 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/package.json +4 -4
- package/dist/.setup/action-runtime.runtime-CpZktret.mjs +0 -1
- package/dist/.setup/runtime-setter-api-DrXr965r.mjs +0 -2
- package/dist/.setup/setup-plugin-api-DJXIB8CF.mjs +0 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, g as resolveSlackBotToken, h as resolveSlackAppToken, l as resolveSlackAccountDmPolicy, m as formatSlackBotTokenIdentityWarning, o as resolveDefaultSlackAccountId, p as resolveSlackReplyToMode, s as resolveSlackAccount } from "./accounts-
|
|
3
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
4
|
-
import { $ as decodeSlackApprovalAction, Bt as allowListMatches, Et as isSlackAnyNativeApprovalClientEnabled, F as truncateSlackText, G as isSlackCallbackActionId, Ht as normalizeSlackSlug, Jt as registerSlackInstallationState, Rt as isSlackPluginApprovalAuthorizedSender, Tt as escapeSlackMrkdwn, Ut as resolveSlackAllowListMatch, Vt as normalizeSlackAllowOwnerEntry, W as isSlackApprovalActionId, Wt as resolveSlackUserAllowListForTeam, Xt as isSlackExecApprovalAuthorizedSender, Y as decodeSlackQuestionAction, Z as resolveSlackQuestionAction, _ as qualifySlackRoutePeerId, at as buildSlackCompleteBlocksFallbackText, c as buildSlackChannelIdCandidates, g as qualifySlackConversationId, i as setSlackSessionStatus, m as formatSlackError, o as createSlackIngressSubject, p as setSlackChannelPolicyBindings, q as isSlackQuestionActionId, r as renameSlackSession, s as slackIngressIdentity, v as resolveSlackAgentRoute, x as resolveSlackConversationBindingRouteAsync, xt as SLACK_TEXT_LIMIT, y as normalizeSlackRouteBindingConfig } from "./probe-
|
|
5
|
-
import { a as createSlackStartupAuthClient, b as resolveSlackWebClientOptions, d as getOrCreateWeakOwnerMap, f as pruneExpiredMapEntries, l as getSlackListenerWriteClient, m as writeLruMapEntry, p as readLruMapEntry, s as createSlackWebClient, t as collectSlackCursorPages, v as resolveSlackLookupClientOptions, y as resolveSlackMonitorDispatchers } from "./cursor-pages-
|
|
6
|
-
import { t as DEFAULT_SLACK_SUGGESTED_PROMPTS } from "./channel-meta-
|
|
7
|
-
import { S as hasSlackMessageTableBlock, f as readSlackMessages, v as isGovSlackClient, y as saveRemoteMedia } from "./actions-
|
|
8
|
-
import { f as requireSlackPostMessageTimestamp, p as buildSlackMessageIdentityPayload, r as setSlackDefaultSendIdentity } from "./send-
|
|
9
|
-
import { n as getSlackRuntime, t as getOptionalSlackRuntime } from "./runtime-
|
|
10
|
-
import { t as normalizeSlackWebhookPath } from "./paths-
|
|
11
|
-
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
12
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
13
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
14
|
-
import { n as runSlackApprovalMessageUpdate, t as hasSlackApprovalControl } from "./approval-message-updates-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, g as resolveSlackBotToken, h as resolveSlackAppToken, l as resolveSlackAccountDmPolicy, m as formatSlackBotTokenIdentityWarning, o as resolveDefaultSlackAccountId, p as resolveSlackReplyToMode, s as resolveSlackAccount } from "./accounts-CGJScKtk.mjs";
|
|
3
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-Bx2UZniD.mjs";
|
|
4
|
+
import { $ as decodeSlackApprovalAction, Bt as allowListMatches, Et as isSlackAnyNativeApprovalClientEnabled, F as truncateSlackText, G as isSlackCallbackActionId, Ht as normalizeSlackSlug, Jt as registerSlackInstallationState, Rt as isSlackPluginApprovalAuthorizedSender, Tt as escapeSlackMrkdwn, Ut as resolveSlackAllowListMatch, Vt as normalizeSlackAllowOwnerEntry, W as isSlackApprovalActionId, Wt as resolveSlackUserAllowListForTeam, Xt as isSlackExecApprovalAuthorizedSender, Y as decodeSlackQuestionAction, Z as resolveSlackQuestionAction, _ as qualifySlackRoutePeerId, at as buildSlackCompleteBlocksFallbackText, c as buildSlackChannelIdCandidates, g as qualifySlackConversationId, i as setSlackSessionStatus, m as formatSlackError, o as createSlackIngressSubject, p as setSlackChannelPolicyBindings, q as isSlackQuestionActionId, r as renameSlackSession, s as slackIngressIdentity, v as resolveSlackAgentRoute, x as resolveSlackConversationBindingRouteAsync, xt as SLACK_TEXT_LIMIT, y as normalizeSlackRouteBindingConfig } from "./probe-DANukR3O.mjs";
|
|
5
|
+
import { a as createSlackStartupAuthClient, b as resolveSlackWebClientOptions, d as getOrCreateWeakOwnerMap, f as pruneExpiredMapEntries, l as getSlackListenerWriteClient, m as writeLruMapEntry, p as readLruMapEntry, s as createSlackWebClient, t as collectSlackCursorPages, v as resolveSlackLookupClientOptions, y as resolveSlackMonitorDispatchers } from "./cursor-pages-CATAzbTT.mjs";
|
|
6
|
+
import { t as DEFAULT_SLACK_SUGGESTED_PROMPTS } from "./channel-meta-C443t-lI.mjs";
|
|
7
|
+
import { S as hasSlackMessageTableBlock, f as readSlackMessages, v as isGovSlackClient, y as saveRemoteMedia } from "./actions-D5S6D_BU.mjs";
|
|
8
|
+
import { f as requireSlackPostMessageTimestamp, p as buildSlackMessageIdentityPayload, r as setSlackDefaultSendIdentity } from "./send-yK6_-px6.mjs";
|
|
9
|
+
import { n as getSlackRuntime, t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.mjs";
|
|
10
|
+
import { t as normalizeSlackWebhookPath } from "./paths-B1u59oLK.mjs";
|
|
11
|
+
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-DxhGRvc2.mjs";
|
|
12
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-XDPgnesf.mjs";
|
|
13
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-aDAv24U2.mjs";
|
|
14
|
+
import { n as runSlackApprovalMessageUpdate, t as hasSlackApprovalControl } from "./approval-message-updates-pmXcve5E.mjs";
|
|
15
15
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
16
16
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
17
17
|
import { asNonArrayRecord, asOptionalObjectRecord, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -62,7 +62,7 @@ import { beginWebhookRequestPipelineOrReject, createWebhookInFlightLimiter, read
|
|
|
62
62
|
import { registerPluginHttpRoute } from "openclaw/plugin-sdk/webhook-targets";
|
|
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/assistant-thread-context.ts
|
|
108
110
|
const SLACK_ASSISTANT_THREAD_CONTEXT_METADATA_EVENT = "assistant_thread_context";
|
|
109
111
|
const SLACK_ASSISTANT_CONTEXT_TTL_MS = 864e5;
|
|
110
112
|
const SLACK_ASSISTANT_CONTEXT_CLEANUP_INTERVAL_MS = 6e5;
|
|
@@ -180,7 +182,8 @@ function buildContextKey(accountId, channelId, threadTs, eventScope) {
|
|
|
180
182
|
const key = `${channelId}:${threadTs}`;
|
|
181
183
|
return eventScope ? `${accountId}:${eventScope.teamId}:${key}` : key;
|
|
182
184
|
}
|
|
183
|
-
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region extensions/slack/src/monitor/channel-type.ts
|
|
184
187
|
function inferSlackChannelType(channelId) {
|
|
185
188
|
const trimmed = channelId?.trim();
|
|
186
189
|
if (!trimmed) return;
|
|
@@ -203,7 +206,8 @@ function resolveSlackChatType(channelType) {
|
|
|
203
206
|
if (channelType === "mpim") return "group";
|
|
204
207
|
return "channel";
|
|
205
208
|
}
|
|
206
|
-
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region extensions/slack/src/monitor/enterprise-install.ts
|
|
207
211
|
const SLACK_CHANNEL_ID_RE = /^[CDG][A-Z0-9]{8,}$/;
|
|
208
212
|
const SLACK_USER_ID_RE = /^[BUW][A-Z0-9]{8,}$/;
|
|
209
213
|
function isWorkspaceScopedSlackChannelEntry(value, options) {
|
|
@@ -353,7 +357,8 @@ function resolveSlackIdentityHealth(params) {
|
|
|
353
357
|
lastError: null
|
|
354
358
|
};
|
|
355
359
|
}
|
|
356
|
-
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region extensions/slack/src/monitor/reconnect-policy.ts
|
|
357
362
|
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;
|
|
358
363
|
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;
|
|
359
364
|
/** Consecutive isolated invalid_auth failures before the channel turns terminal. */
|
|
@@ -455,7 +460,8 @@ function isIsolatedInvalidAuthSlackError(error) {
|
|
|
455
460
|
const text = formatSlackError(error, "");
|
|
456
461
|
return /invalid_auth/i.test(text) && !SLACK_DEFINITIVE_AUTH_ERROR_RE.test(text);
|
|
457
462
|
}
|
|
458
|
-
|
|
463
|
+
//#endregion
|
|
464
|
+
//#region extensions/slack/src/monitor/provider-support.ts
|
|
459
465
|
const OPENCLAW_SLACK_CLIENT_PING_TIMEOUT_MS = 15e3;
|
|
460
466
|
const OPENCLAW_SLACK_SOCKET_START_FAILED_EVENT = "unable_to_socket_mode_start";
|
|
461
467
|
const SLACK_SOCKET_PONG_TIMEOUT_WARNING_PREFIX = "A pong wasn't received from the server";
|
|
@@ -745,7 +751,8 @@ function formatSlackUserResolved(entry) {
|
|
|
745
751
|
extra: entry.note ? [entry.note] : []
|
|
746
752
|
});
|
|
747
753
|
}
|
|
748
|
-
|
|
754
|
+
//#endregion
|
|
755
|
+
//#region extensions/slack/src/monitor/system-event-session.ts
|
|
749
756
|
function createSlackSystemEventRouteResolver(params) {
|
|
750
757
|
return async (event) => {
|
|
751
758
|
const channelId = normalizeOptionalString(event.channelId) ?? "";
|
|
@@ -808,7 +815,8 @@ function createSlackSystemEventRouteResolver(params) {
|
|
|
808
815
|
};
|
|
809
816
|
};
|
|
810
817
|
}
|
|
811
|
-
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region extensions/slack/src/monitor/runtime-policy.ts
|
|
812
820
|
function resolveSlackMonitorPolicy(cfg, accountId, runtime) {
|
|
813
821
|
const slack = mergeSlackAccountConfig(cfg, accountId);
|
|
814
822
|
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy({
|
|
@@ -980,7 +988,8 @@ async function resolveWorkspacePolicy(ctx, resolveToken) {
|
|
|
980
988
|
summarizeMapping("slack users", mapping, unresolved, runtime);
|
|
981
989
|
ctx.channelsConfigKeys = Object.keys(ctx.channelsConfig ?? {});
|
|
982
990
|
}
|
|
983
|
-
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region extensions/slack/src/monitor/transient-api-error.ts
|
|
984
993
|
function isTransientSlackApiError(error) {
|
|
985
994
|
if (error instanceof WebAPIRateLimitedError) return true;
|
|
986
995
|
if (error instanceof WebAPIHTTPError) return error.statusCode === 408 || error.statusCode === 429 || error.statusCode >= 500 && error.statusCode < 600;
|
|
@@ -994,7 +1003,8 @@ function isTransientSlackApiError(error) {
|
|
|
994
1003
|
current.original
|
|
995
1004
|
]).some((candidate) => classifyTransientNetworkErrorCode(extractErrorCode(candidate)) || readErrorName(candidate) === "TimeoutError");
|
|
996
1005
|
}
|
|
997
|
-
|
|
1006
|
+
//#endregion
|
|
1007
|
+
//#region extensions/slack/src/monitor/suggested-prompts.ts
|
|
998
1008
|
async function updateSlackSuggestedPrompts(params) {
|
|
999
1009
|
const prompts = params.prompts.map(({ title, message }) => ({
|
|
1000
1010
|
title: title.trim(),
|
|
@@ -1021,7 +1031,8 @@ async function updateSlackSuggestedPrompts(params) {
|
|
|
1021
1031
|
return outcome;
|
|
1022
1032
|
}
|
|
1023
1033
|
}
|
|
1024
|
-
|
|
1034
|
+
//#endregion
|
|
1035
|
+
//#region extensions/slack/src/monitor/context.ts
|
|
1025
1036
|
const SLACK_AGENT_VIEW_STATE_NAMESPACE = "agent-view-workspaces";
|
|
1026
1037
|
const SLACK_AGENT_VIEW_THREAD_STATE_NAMESPACE = "agent-view-threads";
|
|
1027
1038
|
const SLACK_AGENT_VIEW_STATE_MAX_ENTRIES = 4096;
|
|
@@ -1440,7 +1451,8 @@ function createSlackMonitorContext(params) {
|
|
|
1440
1451
|
ctx.readRuntimeContext = createSlackRuntimeContextReader(ctx, lookupToken ?? params.botToken);
|
|
1441
1452
|
return ctx;
|
|
1442
1453
|
}
|
|
1443
|
-
|
|
1454
|
+
//#endregion
|
|
1455
|
+
//#region extensions/slack/src/streaming.ts
|
|
1444
1456
|
/**
|
|
1445
1457
|
* Thrown when Slack definitively rejects a stream flush/finalize while text
|
|
1446
1458
|
* remains buffered locally by the Slack SDK. Carries the pending text so the
|
|
@@ -1601,7 +1613,8 @@ function markSlackStreamFallbackDelivered(session) {
|
|
|
1601
1613
|
if (session.stopped) releaseSlackStream(session);
|
|
1602
1614
|
else stateBySession.get(session)?.sessions.add(session);
|
|
1603
1615
|
}
|
|
1604
|
-
|
|
1616
|
+
//#endregion
|
|
1617
|
+
//#region extensions/slack/src/monitor/auth.ts
|
|
1605
1618
|
const slackChannelMembersCache = /* @__PURE__ */ new WeakMap();
|
|
1606
1619
|
const CHANNEL_MEMBERS_CACHE_TTL_MS = 6e4;
|
|
1607
1620
|
const CHANNEL_MEMBERS_CACHE_MAX = 512;
|
|
@@ -1910,7 +1923,8 @@ async function authorizeSlackSystemEventSender(params) {
|
|
|
1910
1923
|
channelName
|
|
1911
1924
|
};
|
|
1912
1925
|
}
|
|
1913
|
-
|
|
1926
|
+
//#endregion
|
|
1927
|
+
//#region extensions/slack/src/monitor/event-scope.ts
|
|
1914
1928
|
function resolveSlackMonitorEventScope(params) {
|
|
1915
1929
|
const identity = params.ctx.installationIdentity;
|
|
1916
1930
|
const clientOptions = params.ctx.app.webClientOptions;
|
|
@@ -1957,7 +1971,8 @@ function resolveSlackInteractionEventScope(ctx, args, kind) {
|
|
|
1957
1971
|
}
|
|
1958
1972
|
return eventScope;
|
|
1959
1973
|
}
|
|
1960
|
-
|
|
1974
|
+
//#endregion
|
|
1975
|
+
//#region extensions/slack/src/types.ts
|
|
1961
1976
|
function parseSlackMessageEvent(value) {
|
|
1962
1977
|
const record = asOptionalRecord(value);
|
|
1963
1978
|
return record?.type === "message" && typeof record.channel === "string" ? {
|
|
@@ -1971,7 +1986,8 @@ function requireSlackMessageEvent(value) {
|
|
|
1971
1986
|
if (!event) throw new TypeError("Invalid persisted Slack message event");
|
|
1972
1987
|
return event;
|
|
1973
1988
|
}
|
|
1974
|
-
|
|
1989
|
+
//#endregion
|
|
1990
|
+
//#region extensions/slack/src/monitor/ingress.ts
|
|
1975
1991
|
const SLACK_INGRESS_PAYLOAD_VERSION = 1;
|
|
1976
1992
|
const SLACK_INGRESS_POLL_INTERVAL_MS = 1e3;
|
|
1977
1993
|
const SLACK_BOLT_AUTHORIZATION_ERROR = "slack_bolt_authorization_error";
|
|
@@ -2291,7 +2307,8 @@ function createSlackDurableIngress(options) {
|
|
|
2291
2307
|
waitForIdle: monitor.waitForIdle
|
|
2292
2308
|
};
|
|
2293
2309
|
}
|
|
2294
|
-
|
|
2310
|
+
//#endregion
|
|
2311
|
+
//#region extensions/slack/src/monitor/events/assistant.ts
|
|
2295
2312
|
function registerSlackAssistantEvents(params) {
|
|
2296
2313
|
const { ctx, trackEvent } = params;
|
|
2297
2314
|
for (const eventName of ["assistant_thread_started", "assistant_thread_context_changed"]) ctx.app.event(eventName, async ({ event, body, context }) => {
|
|
@@ -2350,7 +2367,8 @@ function registerSlackAssistantEvents(params) {
|
|
|
2350
2367
|
}
|
|
2351
2368
|
});
|
|
2352
2369
|
}
|
|
2353
|
-
|
|
2370
|
+
//#endregion
|
|
2371
|
+
//#region extensions/slack/src/channel-migration.ts
|
|
2354
2372
|
function migrateSlackChannelConfig(params) {
|
|
2355
2373
|
let migrated = false;
|
|
2356
2374
|
let skippedExisting = false;
|
|
@@ -2372,7 +2390,8 @@ function migrateSlackChannelConfig(params) {
|
|
|
2372
2390
|
skippedExisting
|
|
2373
2391
|
};
|
|
2374
2392
|
}
|
|
2375
|
-
|
|
2393
|
+
//#endregion
|
|
2394
|
+
//#region extensions/slack/src/monitor/events/channels.ts
|
|
2376
2395
|
function registerSlackChannelEvents(params) {
|
|
2377
2396
|
const { ctx, trackEvent } = params;
|
|
2378
2397
|
for (const [eventName, kind] of [["channel_created", "created"], ["channel_rename", "renamed"]]) ctx.app.event(eventName, async (args) => {
|
|
@@ -2459,7 +2478,8 @@ function registerSlackChannelIdChangedEvent(params) {
|
|
|
2459
2478
|
}
|
|
2460
2479
|
});
|
|
2461
2480
|
}
|
|
2462
|
-
|
|
2481
|
+
//#endregion
|
|
2482
|
+
//#region extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2463
2483
|
function resolveSlackDeferredActionTarget(params) {
|
|
2464
2484
|
if (!params.id) throw new Error("Slack deferred action is missing a target ID");
|
|
2465
2485
|
if (!params.eventScope) return {
|
|
@@ -2472,7 +2492,8 @@ function resolveSlackDeferredActionTarget(params) {
|
|
|
2472
2492
|
target
|
|
2473
2493
|
};
|
|
2474
2494
|
}
|
|
2475
|
-
|
|
2495
|
+
//#endregion
|
|
2496
|
+
//#region extensions/slack/src/monitor/events/interaction-event.ts
|
|
2476
2497
|
const SLACK_INTERACTION_EVENT_PREFIX = "Slack interaction: ";
|
|
2477
2498
|
const REDACTED_INTERACTION_VALUE = "[redacted]";
|
|
2478
2499
|
const SLACK_INTERACTION_EVENT_MAX_CHARS = 2400;
|
|
@@ -2611,7 +2632,8 @@ async function enqueueSlackInteractionEvent(payload, route, options, log) {
|
|
|
2611
2632
|
return false;
|
|
2612
2633
|
}
|
|
2613
2634
|
}
|
|
2614
|
-
|
|
2635
|
+
//#endregion
|
|
2636
|
+
//#region extensions/slack/src/interactive-dispatch.ts
|
|
2615
2637
|
const dispatchSlackInteractive = createChannelInteractiveDispatcher({
|
|
2616
2638
|
channel: "slack",
|
|
2617
2639
|
interactiveKey: "interaction"
|
|
@@ -2636,7 +2658,8 @@ async function dispatchSlackPluginInteractiveHandler(params) {
|
|
|
2636
2658
|
}
|
|
2637
2659
|
});
|
|
2638
2660
|
}
|
|
2639
|
-
|
|
2661
|
+
//#endregion
|
|
2662
|
+
//#region extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
2640
2663
|
function resolveSlackPluginApprovalSender(params) {
|
|
2641
2664
|
const senderId = formatSlackTarget({
|
|
2642
2665
|
kind: "user",
|
|
@@ -2652,7 +2675,8 @@ function resolveSlackPluginApprovalSender(params) {
|
|
|
2652
2675
|
})
|
|
2653
2676
|
};
|
|
2654
2677
|
}
|
|
2655
|
-
|
|
2678
|
+
//#endregion
|
|
2679
|
+
//#region extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
2656
2680
|
function readOptionValues(options, read) {
|
|
2657
2681
|
if (!Array.isArray(options)) return [];
|
|
2658
2682
|
return options.map((option) => option && typeof option === "object" ? read(option) : void 0);
|
|
@@ -2744,7 +2768,8 @@ function formatInteractionSelectionLabel(params) {
|
|
|
2744
2768
|
if (params.summary.richTextPreview) return params.summary.richTextPreview;
|
|
2745
2769
|
return normalizeOptionalString(params.summary.value) ?? params.actionId;
|
|
2746
2770
|
}
|
|
2747
|
-
|
|
2771
|
+
//#endregion
|
|
2772
|
+
//#region extensions/slack/src/monitor/events/interactions.block-actions.context.ts
|
|
2748
2773
|
function resolveSlackActionValue(summary) {
|
|
2749
2774
|
return normalizeOptionalString(summary.value) ?? summary.selectedValues?.[0];
|
|
2750
2775
|
}
|
|
@@ -2795,7 +2820,8 @@ function parseSlackBlockAction(params) {
|
|
|
2795
2820
|
actionSummary: summarizeAction(typedAction)
|
|
2796
2821
|
};
|
|
2797
2822
|
}
|
|
2798
|
-
|
|
2823
|
+
//#endregion
|
|
2824
|
+
//#region extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
2799
2825
|
async function respondEphemeral(respond, text) {
|
|
2800
2826
|
if (!respond) return;
|
|
2801
2827
|
try {
|
|
@@ -2899,7 +2925,7 @@ async function handleSlackApprovalInteraction(params) {
|
|
|
2899
2925
|
channelId,
|
|
2900
2926
|
messageTs
|
|
2901
2927
|
}, async () => {
|
|
2902
|
-
const { readSlackMessages } = await import("./actions-
|
|
2928
|
+
const { readSlackMessages } = await import("./actions-D5S6D_BU.mjs").then((n) => n.t);
|
|
2903
2929
|
const { messages } = await readSlackMessages(channelId, {
|
|
2904
2930
|
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
2905
2931
|
messageId: messageTs,
|
|
@@ -3232,7 +3258,8 @@ function registerSlackBlockActionHandler(params) {
|
|
|
3232
3258
|
}, runtimeContext.runtime.log) && runtimeContext.isRuntimePolicyCurrent()) await updateSlackLegacyBlockAction(actionContext);
|
|
3233
3259
|
});
|
|
3234
3260
|
}
|
|
3235
|
-
|
|
3261
|
+
//#endregion
|
|
3262
|
+
//#region extensions/slack/src/modal-metadata.ts
|
|
3236
3263
|
function parseSlackModalPrivateMetadata(raw) {
|
|
3237
3264
|
if (typeof raw !== "string" || raw.trim().length === 0) return {};
|
|
3238
3265
|
try {
|
|
@@ -3248,7 +3275,8 @@ function parseSlackModalPrivateMetadata(raw) {
|
|
|
3248
3275
|
return {};
|
|
3249
3276
|
}
|
|
3250
3277
|
}
|
|
3251
|
-
|
|
3278
|
+
//#endregion
|
|
3279
|
+
//#region extensions/slack/src/monitor/events/interactions.modal.ts
|
|
3252
3280
|
const OPENCLAW_MODAL_CALLBACK_PREFIX = "openclaw:";
|
|
3253
3281
|
function resolveSlackPluginSystemEventPayload(result) {
|
|
3254
3282
|
const systemEvent = result?.systemEvent;
|
|
@@ -3445,7 +3473,8 @@ function registerModalLifecycleHandler(params) {
|
|
|
3445
3473
|
}, runtimeCtx.runtime.log);
|
|
3446
3474
|
});
|
|
3447
3475
|
}
|
|
3448
|
-
|
|
3476
|
+
//#endregion
|
|
3477
|
+
//#region extensions/slack/src/monitor/events/interactions.ts
|
|
3449
3478
|
function registerSlackInteractionEvents(params) {
|
|
3450
3479
|
const { ctx, trackEvent } = params;
|
|
3451
3480
|
registerSlackBlockActionHandler(params);
|
|
@@ -3541,7 +3570,8 @@ function registerSlackInteractionEvents(params) {
|
|
|
3541
3570
|
interactionType
|
|
3542
3571
|
});
|
|
3543
3572
|
}
|
|
3544
|
-
|
|
3573
|
+
//#endregion
|
|
3574
|
+
//#region extensions/slack/src/monitor/events/system-event-context.ts
|
|
3545
3575
|
async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
3546
3576
|
const { senderId, channelId, channelType, eventKind } = params;
|
|
3547
3577
|
const ctx = await params.ctx.readRuntimeContext();
|
|
@@ -3571,7 +3601,8 @@ async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
|
3571
3601
|
})
|
|
3572
3602
|
};
|
|
3573
3603
|
}
|
|
3574
|
-
|
|
3604
|
+
//#endregion
|
|
3605
|
+
//#region extensions/slack/src/monitor/events/members.ts
|
|
3575
3606
|
function registerSlackMemberEvents(params) {
|
|
3576
3607
|
const { ctx, trackEvent } = params;
|
|
3577
3608
|
for (const verb of ["joined", "left"]) ctx.app.event(`member_${verb}_channel`, async (args) => {
|
|
@@ -3662,7 +3693,8 @@ function registerSlackMemberEvents(params) {
|
|
|
3662
3693
|
}
|
|
3663
3694
|
});
|
|
3664
3695
|
}
|
|
3665
|
-
|
|
3696
|
+
//#endregion
|
|
3697
|
+
//#region extensions/slack/src/draft-message-boundaries.ts
|
|
3666
3698
|
const activeDraftsByConversation = /* @__PURE__ */ new Map();
|
|
3667
3699
|
function conversationKey(conversation) {
|
|
3668
3700
|
return [
|
|
@@ -3713,7 +3745,8 @@ function noteSlackDraftConversationMessage(conversation) {
|
|
|
3713
3745
|
if (isLaterSlackMessage(conversation.messageTs, draft.messageTs)) draft.onInterveningMessage();
|
|
3714
3746
|
}
|
|
3715
3747
|
}
|
|
3716
|
-
|
|
3748
|
+
//#endregion
|
|
3749
|
+
//#region extensions/slack/src/threading.ts
|
|
3717
3750
|
function resolveSlackThreadContext(params) {
|
|
3718
3751
|
const incomingThreadTs = params.message.thread_ts;
|
|
3719
3752
|
const eventTs = params.message.event_ts;
|
|
@@ -3730,7 +3763,8 @@ function resolveSlackThreadContext(params) {
|
|
|
3730
3763
|
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
3731
3764
|
};
|
|
3732
3765
|
}
|
|
3733
|
-
|
|
3766
|
+
//#endregion
|
|
3767
|
+
//#region extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
3734
3768
|
function resolveSlackMessageSubtypeHandler(event) {
|
|
3735
3769
|
const subtype = event.subtype;
|
|
3736
3770
|
if (subtype !== "message_changed" && subtype !== "message_deleted") return;
|
|
@@ -3754,7 +3788,8 @@ function resolveSlackMessageSubtypeHandler(event) {
|
|
|
3754
3788
|
}).replyToId : void 0
|
|
3755
3789
|
};
|
|
3756
3790
|
}
|
|
3757
|
-
|
|
3791
|
+
//#endregion
|
|
3792
|
+
//#region extensions/slack/src/monitor/events/messages.ts
|
|
3758
3793
|
const slackInboundLog = createSubsystemLogger("gateway/channels/slack").child("inbound");
|
|
3759
3794
|
function isBotAuthoredEnterpriseEvent(event) {
|
|
3760
3795
|
return Boolean(normalizeOptionalString(event.bot_id)) || event.subtype === "bot_message";
|
|
@@ -3914,7 +3949,8 @@ function registerSlackMessageEvents(params) {
|
|
|
3914
3949
|
}
|
|
3915
3950
|
});
|
|
3916
3951
|
}
|
|
3917
|
-
|
|
3952
|
+
//#endregion
|
|
3953
|
+
//#region extensions/slack/src/monitor/session-run-targets.ts
|
|
3918
3954
|
async function captureSlackSessionTargetGuard(ctx, route, isActive) {
|
|
3919
3955
|
return captureSessionEntryCurrentCheckAsync({
|
|
3920
3956
|
agentId: route.agentId,
|
|
@@ -3956,7 +3992,8 @@ function getSlackSessionRuns(ctx, address) {
|
|
|
3956
3992
|
isActive: () => targets.some((candidate) => candidate.route.sessionKey === target.route.sessionKey && candidate.isActive())
|
|
3957
3993
|
}));
|
|
3958
3994
|
}
|
|
3959
|
-
|
|
3995
|
+
//#endregion
|
|
3996
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
3960
3997
|
async function resolveSlackRoutingContext(params) {
|
|
3961
3998
|
const { ctx, account, message, chatType, channelConfig, seedTopLevelRoomThread, assistantThreadTs, agentViewThreadTs, eventScope } = params;
|
|
3962
3999
|
const isDirectMessage = chatType === "direct";
|
|
@@ -4133,7 +4170,8 @@ async function resolveSlackSessionEventRoutingContext(params) {
|
|
|
4133
4170
|
release: current.release
|
|
4134
4171
|
};
|
|
4135
4172
|
}
|
|
4136
|
-
|
|
4173
|
+
//#endregion
|
|
4174
|
+
//#region extensions/slack/src/monitor/dm-auth.ts
|
|
4137
4175
|
async function authorizeSlackDirectMessage(params) {
|
|
4138
4176
|
if (!params.ctx.dmEnabled || params.ctx.dmPolicy === "disabled") {
|
|
4139
4177
|
await params.onDisabled();
|
|
@@ -4189,7 +4227,8 @@ async function authorizeSlackDirectMessage(params) {
|
|
|
4189
4227
|
});
|
|
4190
4228
|
return false;
|
|
4191
4229
|
}
|
|
4192
|
-
|
|
4230
|
+
//#endregion
|
|
4231
|
+
//#region extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
4193
4232
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
4194
4233
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(24)}}$`);
|
|
4195
4234
|
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 6e5;
|
|
@@ -4225,7 +4264,8 @@ function createSlackExternalArgMenuStore() {
|
|
|
4225
4264
|
}
|
|
4226
4265
|
};
|
|
4227
4266
|
}
|
|
4228
|
-
|
|
4267
|
+
//#endregion
|
|
4268
|
+
//#region extensions/slack/src/monitor/response-url-budget.ts
|
|
4229
4269
|
const SLACK_RESPONSE_URL_MAX_CALLS = 5;
|
|
4230
4270
|
var SlackResponseAlreadyReportedError = class extends Error {};
|
|
4231
4271
|
/** Count every response_url attempt, including requests Slack rejects. */
|
|
@@ -4240,7 +4280,8 @@ function createSlackResponseUrlBudget(respond) {
|
|
|
4240
4280
|
}
|
|
4241
4281
|
};
|
|
4242
4282
|
}
|
|
4243
|
-
|
|
4283
|
+
//#endregion
|
|
4284
|
+
//#region extensions/slack/src/monitor/room-context.ts
|
|
4244
4285
|
function resolveSlackRoomContextHints(params) {
|
|
4245
4286
|
return {
|
|
4246
4287
|
channelMetadata: params.isRoomish ? buildChannelMetadata({
|
|
@@ -4251,7 +4292,8 @@ function resolveSlackRoomContextHints(params) {
|
|
|
4251
4292
|
groupSystemPrompt: params.isRoomish ? normalizeOptionalString(params.channelConfig?.systemPrompt) : void 0
|
|
4252
4293
|
};
|
|
4253
4294
|
}
|
|
4254
|
-
|
|
4295
|
+
//#endregion
|
|
4296
|
+
//#region extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
4255
4297
|
async function resolveSlackCommandMenuModelContext(params) {
|
|
4256
4298
|
if (!params.sessionKey.trim()) return {};
|
|
4257
4299
|
try {
|
|
@@ -4300,7 +4342,8 @@ async function resolveSlackCommandMenuModelContext(params) {
|
|
|
4300
4342
|
return {};
|
|
4301
4343
|
}
|
|
4302
4344
|
}
|
|
4303
|
-
|
|
4345
|
+
//#endregion
|
|
4346
|
+
//#region extensions/slack/src/monitor/slash.ts
|
|
4304
4347
|
const SLACK_COMMAND_ARG_ACTION_ID = "openclaw_cmdarg";
|
|
4305
4348
|
const SLACK_COMMAND_ARG_ACTION_LISTENER = /^openclaw_cmdarg/;
|
|
4306
4349
|
const SLACK_COMMAND_ARG_VALUE_PREFIX = "cmdarg";
|
|
@@ -4315,7 +4358,7 @@ const SLACK_COMMAND_ARG_BUTTON_VALUE_MAX = 2e3;
|
|
|
4315
4358
|
const SLACK_COMMAND_ARG_CONFIRM_TEXT_MAX = 300;
|
|
4316
4359
|
const SLACK_HEADER_TEXT_MAX = 150;
|
|
4317
4360
|
const SLACK_COMMAND_ARG_ACTION_BLOCKS_MAX = 47;
|
|
4318
|
-
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-
|
|
4361
|
+
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-CyVC3bYx.mjs"));
|
|
4319
4362
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
4320
4363
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
4321
4364
|
function buildSlackArgMenuConfirm(params) {
|
|
@@ -5109,7 +5152,8 @@ async function deliverSlackSlashResponseWithWebApi(params) {
|
|
|
5109
5152
|
function isSlackBoltRespondError(error) {
|
|
5110
5153
|
return Boolean(error) && typeof error === "object" && error.code === "slack_bolt_respond_error";
|
|
5111
5154
|
}
|
|
5112
|
-
|
|
5155
|
+
//#endregion
|
|
5156
|
+
//#region extensions/slack/src/monitor/events.ts
|
|
5113
5157
|
function buildSlackHomeView(slashCommandName) {
|
|
5114
5158
|
return {
|
|
5115
5159
|
type: "home",
|
|
@@ -5410,7 +5454,8 @@ function registerSlackWorkspaceEvents(params) {
|
|
|
5410
5454
|
trackEvent
|
|
5411
5455
|
});
|
|
5412
5456
|
}
|
|
5413
|
-
|
|
5457
|
+
//#endregion
|
|
5458
|
+
//#region extensions/slack/src/monitor/http-handler.ts
|
|
5414
5459
|
const SLACK_WEBHOOK_MAX_BODY_BYTES = 1048576;
|
|
5415
5460
|
const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
|
|
5416
5461
|
function registerSlackHttpHandler(params) {
|
|
@@ -5454,7 +5499,8 @@ function createSlackHttpRequestHandler(params) {
|
|
|
5454
5499
|
}
|
|
5455
5500
|
};
|
|
5456
5501
|
}
|
|
5457
|
-
|
|
5502
|
+
//#endregion
|
|
5503
|
+
//#region extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5458
5504
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_TTL_MS = 864e5;
|
|
5459
5505
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_MEMORY_MAX_ENTRIES = 2e4;
|
|
5460
5506
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_STATE_MAX_ENTRIES = 2e4;
|
|
@@ -5507,7 +5553,8 @@ async function claimSlackMessageDispatchReplay(params) {
|
|
|
5507
5553
|
handle: claim.handle
|
|
5508
5554
|
} : { kind: "duplicate" };
|
|
5509
5555
|
}
|
|
5510
|
-
|
|
5556
|
+
//#endregion
|
|
5557
|
+
//#region extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5511
5558
|
function resolveSlackSenderId(message) {
|
|
5512
5559
|
return message.user ?? message.bot_id ?? null;
|
|
5513
5560
|
}
|
|
@@ -5524,7 +5571,8 @@ function buildSlackDebounceKey(message, accountId, teamId) {
|
|
|
5524
5571
|
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;
|
|
5525
5572
|
return `slack:${accountId}:${teamId ? `${teamId}:` : ""}${threadKey}:${senderId}`;
|
|
5526
5573
|
}
|
|
5527
|
-
|
|
5574
|
+
//#endregion
|
|
5575
|
+
//#region extensions/slack/src/monitor/thread-resolution.ts
|
|
5528
5576
|
const DEFAULT_THREAD_TS_CACHE_TTL_MS = 6e4;
|
|
5529
5577
|
const DEFAULT_THREAD_TS_CACHE_MAX = 500;
|
|
5530
5578
|
const markAmbiguousThreadReply = (message) => ({
|
|
@@ -5574,8 +5622,9 @@ function createSlackThreadTsResolver(params) {
|
|
|
5574
5622
|
return markAmbiguousThreadReply(message);
|
|
5575
5623
|
} };
|
|
5576
5624
|
}
|
|
5577
|
-
|
|
5578
|
-
|
|
5625
|
+
//#endregion
|
|
5626
|
+
//#region extensions/slack/src/monitor/message-handler.ts
|
|
5627
|
+
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-DGnV6akc.mjs"));
|
|
5579
5628
|
const RETRYABLE_FLUSH_MAX_ATTEMPTS = 3;
|
|
5580
5629
|
function shouldDebounceSlackMessage(message, cfg) {
|
|
5581
5630
|
const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");
|
|
@@ -5841,7 +5890,8 @@ function createSlackMessageHandler(params) {
|
|
|
5841
5890
|
await (await enqueueSlackMessage(message, opts))?.promise;
|
|
5842
5891
|
};
|
|
5843
5892
|
}
|
|
5844
|
-
|
|
5893
|
+
//#endregion
|
|
5894
|
+
//#region extensions/slack/src/monitor/presence-monitor.ts
|
|
5845
5895
|
const SLACK_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
5846
5896
|
const SLACK_PRESENCE_REQUEST_TIMEOUT_MS = 3e4;
|
|
5847
5897
|
const SLACK_PRESENCE_POLL_INTERVAL_MS = 6e4;
|
|
@@ -6075,7 +6125,8 @@ function createSlackPresenceMonitor(params) {
|
|
|
6075
6125
|
function presenceSubjectKey(subject) {
|
|
6076
6126
|
return `${subject.teamId ?? "workspace"}:${subject.userId}`;
|
|
6077
6127
|
}
|
|
6078
|
-
|
|
6128
|
+
//#endregion
|
|
6129
|
+
//#region extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6079
6130
|
const SLACK_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
|
|
6080
6131
|
function openSlackPresenceCooldownStore() {
|
|
6081
6132
|
return getSlackRuntime().state.openKeyedStore({
|
|
@@ -6085,7 +6136,8 @@ function openSlackPresenceCooldownStore() {
|
|
|
6085
6136
|
defaultTtlMs: SLACK_PRESENCE_GREETING_COOLDOWN_MS
|
|
6086
6137
|
});
|
|
6087
6138
|
}
|
|
6088
|
-
|
|
6139
|
+
//#endregion
|
|
6140
|
+
//#region extensions/slack/src/monitor/provider-workspace-client.ts
|
|
6089
6141
|
function withSlackPresenceLifecycleSignal(fetchImpl, lifecycleSignal) {
|
|
6090
6142
|
return async (input, init) => await fetchImpl(input, {
|
|
6091
6143
|
...init,
|
|
@@ -6107,9 +6159,10 @@ function createSlackWorkspaceClientResolver(params) {
|
|
|
6107
6159
|
return client;
|
|
6108
6160
|
};
|
|
6109
6161
|
}
|
|
6110
|
-
|
|
6162
|
+
//#endregion
|
|
6163
|
+
//#region extensions/slack/src/monitor/provider.ts
|
|
6111
6164
|
const getSlackBoltInterop = createLazyRuntimeSurface(() => import("@slack/bolt"), resolveSlackBoltInterop);
|
|
6112
|
-
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-
|
|
6165
|
+
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-DoyOlTbK.mjs"));
|
|
6113
6166
|
function resolveSlackRuntimeIdentity(params) {
|
|
6114
6167
|
const botUserId = normalizeOptionalString(params.botUserId);
|
|
6115
6168
|
const botId = normalizeOptionalString(params.botId);
|
|
@@ -6583,10 +6636,12 @@ async function monitorSlackProvider(opts) {
|
|
|
6583
6636
|
await slackDispatchers.close();
|
|
6584
6637
|
}
|
|
6585
6638
|
}
|
|
6586
|
-
|
|
6639
|
+
//#endregion
|
|
6640
|
+
//#region extensions/slack/src/monitor.ts
|
|
6587
6641
|
var monitor_exports = /* @__PURE__ */ __exportAll({
|
|
6588
6642
|
buildSlackSlashCommandMatcher: () => buildSlackSlashCommandMatcher,
|
|
6589
6643
|
isSlackChannelAllowedByPolicy: () => isSlackChannelAllowedByPolicy,
|
|
6590
6644
|
monitorSlackProvider: () => monitorSlackProvider
|
|
6591
6645
|
});
|
|
6646
|
+
//#endregion
|
|
6592
6647
|
export { resolveSlackChatType as C, stripSlackMentionsForCommandDetection as E, normalizeSlackChannelType as S, readSlackAssistantThreadContext as T, appendSlackStream as _, createSlackResponseUrlBudget as a, stopSlackStream as b, registerSlackSessionRun as c, parseSlackMessageEvent as d, requireSlackMessageEvent as f, SlackStreamNotDeliveredError as g, resolveSlackEffectiveAllowFrom as h, SlackResponseAlreadyReportedError as i, resolveSlackThreadContext as l, resolveSlackCommandIngress as m, monitorSlackProvider as n, authorizeSlackDirectMessage as o, authorizeSlackBotRoomMessage as p, resolveSlackRoomContextHints as r, resolveSlackRoutingContext as s, monitor_exports as t, trackSlackDraftMessage as u, markSlackStreamFallbackDelivered as v, buildSlackAssistantThreadMetadata as w, SLACK_SOCKET_RECONNECT_POLICY as x, startSlackStream as y };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as resolveSlackMarkdownOptions, f as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-
|
|
2
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
3
|
-
import { J as resolveSlackQuestionActionIds, S as assertSlackDetachedTargetAllowed, mt as SLACK_PRESENTATION_CAPABILITIES, xt as SLACK_TEXT_LIMIT } from "./probe-
|
|
4
|
-
import { r as resolveSlackThreadTsValue } from "./thread-ts-
|
|
5
|
-
import { a as resolveSlackReplyBlockResolution, d as resolveSlackAuthoredTextPlacement, r as normalizeSlackReplyPayload, s as resolveSlackReplyDeliveryMessages } from "./reply-blocks-
|
|
6
|
-
import { t as mergeSlackSendResults } from "./send-results-
|
|
7
|
-
import { t as registerSlackQuestionDelivery } from "./question-delivery-
|
|
1
|
+
import { d as resolveSlackMarkdownOptions, f as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-CGJScKtk.mjs";
|
|
2
|
+
import { a as parseSlackTarget } from "./target-parsing-Bx2UZniD.mjs";
|
|
3
|
+
import { J as resolveSlackQuestionActionIds, S as assertSlackDetachedTargetAllowed, mt as SLACK_PRESENTATION_CAPABILITIES, xt as SLACK_TEXT_LIMIT } from "./probe-DANukR3O.mjs";
|
|
4
|
+
import { r as resolveSlackThreadTsValue } from "./thread-ts-Cvt7WD6B.mjs";
|
|
5
|
+
import { a as resolveSlackReplyBlockResolution, d as resolveSlackAuthoredTextPlacement, r as normalizeSlackReplyPayload, s as resolveSlackReplyDeliveryMessages } from "./reply-blocks-BzsXUUUL.mjs";
|
|
6
|
+
import { t as mergeSlackSendResults } from "./send-results-BGxlroJ-.mjs";
|
|
7
|
+
import { t as registerSlackQuestionDelivery } from "./question-delivery-CWC7sRhH.mjs";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
10
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -14,7 +14,7 @@ import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-run
|
|
|
14
14
|
import { createHmac, randomBytes } from "node:crypto";
|
|
15
15
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
16
16
|
import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result";
|
|
17
|
-
|
|
17
|
+
//#region extensions/slack/src/outbound-adapter.ts
|
|
18
18
|
function toSlackOutboundResult(result) {
|
|
19
19
|
const { channelId, ...delivery } = result;
|
|
20
20
|
return attachChannelToResult("slack", channelId === void 0 ? delivery : {
|
|
@@ -45,7 +45,7 @@ function readSlackRenderedPresentation(slackData) {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
48
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-yK6_-px6.mjs").then((n) => n.n));
|
|
49
49
|
function resolveSlackSendIdentity(identity) {
|
|
50
50
|
if (!identity) return;
|
|
51
51
|
const username = normalizeOptionalString(identity.name);
|
|
@@ -248,4 +248,5 @@ const slackOutbound = {
|
|
|
248
248
|
}));
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
+
//#endregion
|
|
251
252
|
export { slackOutbound };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
//#region extensions/slack/src/http/paths.ts
|
|
2
2
|
function normalizeSlackWebhookPath(path) {
|
|
3
3
|
const trimmed = path?.trim();
|
|
4
4
|
if (!trimmed) return "/slack/events";
|
|
5
5
|
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
6
6
|
}
|
|
7
|
+
//#endregion
|
|
7
8
|
export { normalizeSlackWebhookPath as t };
|