@openclaw/slack 2026.11.7 → 2026.11.9
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-BLVha-ov.mjs → account-inspect-DgQgj0wk.mjs} +3 -4
- package/dist/.setup/{accounts-CGJScKtk.mjs → accounts-EaPP0fFY.mjs} +6 -10
- package/dist/.setup/{action-runtime-D01wBhx5.mjs → action-runtime-CK9QZgQl.mjs} +9 -10
- package/dist/.setup/action-runtime.runtime-CpZktret.mjs +1 -0
- package/dist/.setup/{actions-D5S6D_BU.mjs → actions-s3CcFO45.mjs} +14 -22
- package/dist/.setup/{approval-handler.runtime-Buw5jh2Y.mjs → approval-handler.runtime-Ch7BecYK.mjs} +7 -8
- package/dist/.setup/{approval-message-updates-pmXcve5E.mjs → approval-message-updates-CqcRoa28.mjs} +2 -3
- package/dist/.setup/{channel-meta-C443t-lI.mjs → channel-meta-C5vsCo3a.mjs} +1 -2
- package/dist/.setup/{channel-type-B5P3w9eA.mjs → channel-type-9Lw6yLf2.mjs} +5 -6
- package/dist/.setup/{channel-DSi3yBu5.mjs → channel-zlQxHZXl.mjs} +36 -45
- package/dist/.setup/{channel.setup-Lq2OxKkF.mjs → channel.setup-BlgXNuCJ.mjs} +10 -14
- package/dist/.setup/{config-schema-BWAaa5au.mjs → config-schema-Bx1tCZB0.mjs} +2 -4
- package/dist/.setup/{cursor-pages-CATAzbTT.mjs → cursor-pages-jVn3Vkfi.mjs} +4 -8
- package/dist/.setup/{directory-config-D-hf9KGQ.mjs → directory-config-CGvKYg9F.mjs} +5 -6
- package/dist/.setup/{directory-live-onKAFI1E.mjs → directory-live-DNdw97LA.mjs} +4 -5
- package/dist/.setup/{doctor-contract-9-QJRCXk.mjs → doctor-contract-BB2KJ9Ni.mjs} +7 -13
- package/dist/.setup/{message-tool-api-LGIgVXJf.mjs → message-tool-api-B38BpEaE.mjs} +5 -7
- package/dist/.setup/{monitor-CZGrHb5a.mjs → monitor-BJId9dWb.mjs} +73 -128
- package/dist/.setup/{outbound-adapter-C-95EWl2.mjs → outbound-adapter-BH6iPWBj.mjs} +9 -10
- package/dist/.setup/{paths-B1u59oLK.mjs → paths-CQZI_5WY.mjs} +1 -2
- package/dist/.setup/{pipeline.runtime-B-EtO-8F.mjs → pipeline.runtime-Bwv_G13H.mjs} +43 -71
- package/dist/.setup/{policy-DxhGRvc2.mjs → policy-C6_DdlSf.mjs} +3 -5
- package/dist/.setup/{probe-DANukR3O.mjs → probe-B_Ax1vS1.mjs} +36 -66
- package/dist/.setup/{question-delivery-CWC7sRhH.mjs → question-delivery-D3qAIwuv.mjs} +2 -3
- package/dist/.setup/{relay-source-BH-NPqBP.mjs → relay-source-D1SVBMhk.mjs} +3 -4
- package/dist/.setup/{replies-B5e7p3dD.mjs → replies-C9j_tM8I.mjs} +8 -10
- package/dist/.setup/{reply-blocks-BzsXUUUL.mjs → reply-blocks-DyYYRrP_.mjs} +4 -7
- package/dist/.setup/{resolve-channels-XDPgnesf.mjs → resolve-channels-CF2JME9q.mjs} +4 -5
- package/dist/.setup/{resolve-users-aDAv24U2.mjs → resolve-users-DDcCAjH1.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-BocHwImV.mjs → scopes-CzHC_dwV.mjs} +3 -4
- package/dist/.setup/{secret-contract-uiQtoNlu.mjs → secret-contract-CqVqR7MP.mjs} +2 -3
- package/dist/.setup/{secret-contract-api-BlLz88mj.mjs → secret-contract-api-DaCXZ47j.mjs} +1 -1
- package/dist/.setup/{security-audit-DFGiFLqd.mjs → security-audit-C3hXCfDt.mjs} +2 -3
- package/dist/.setup/{send-yK6_-px6.mjs → send-WJZ73VSf.mjs} +13 -19
- package/dist/.setup/{send-results-BGxlroJ-.mjs → send-results-Bm6V1ekL.mjs} +1 -2
- package/dist/.setup/setup-plugin-api-DJXIB8CF.mjs +2 -0
- package/dist/.setup/{setup-surface-C0KRtyqa.mjs → setup-surface-uIqP2B0Y.mjs} +6 -7
- package/dist/.setup/{slash-dispatch.runtime-CZuMRdRx.mjs → slash-dispatch.runtime-DhIREf-h.mjs} +1 -1
- package/dist/.setup/{target-parsing-Bx2UZniD.mjs → target-parsing-DwYAP3ts.mjs} +1 -2
- package/dist/.setup/{targets-D-ASeWHy.mjs → targets-eeOxA_b_.mjs} +2 -3
- package/dist/.setup/{thread-ts-Cvt7WD6B.mjs → thread-ts-47Au2-Yn.mjs} +1 -2
- package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -1
- package/dist/account-inspect-api.js +2 -3
- package/dist/api.js +16 -16
- 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/index.js +1 -2
- 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 +4 -5
- package/dist/setup-plugin-api.js +1 -1
- package/package.json +4 -4
- package/dist/.setup/action-runtime.runtime-VQGaR6g8.mjs +0 -1
- package/dist/.setup/runtime-setter-api-Cx_PV-xu.mjs +0 -2
- package/dist/.setup/setup-plugin-api-Cfz58xoh.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-nwUcYXjP.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-EaPP0fFY.mjs";
|
|
3
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-DwYAP3ts.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-B_Ax1vS1.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-jVn3Vkfi.mjs";
|
|
6
|
+
import { t as DEFAULT_SLACK_SUGGESTED_PROMPTS } from "./channel-meta-C5vsCo3a.mjs";
|
|
7
|
+
import { S as hasSlackMessageTableBlock, f as readSlackMessages, v as isGovSlackClient, y as saveRemoteMedia } from "./actions-s3CcFO45.mjs";
|
|
8
|
+
import { f as requireSlackPostMessageTimestamp, p as buildSlackMessageIdentityPayload, r as setSlackDefaultSendIdentity } from "./send-WJZ73VSf.mjs";
|
|
9
|
+
import { n as getSlackRuntime, t as getOptionalSlackRuntime } from "./runtime-C6HKn7Av.mjs";
|
|
10
|
+
import { t as normalizeSlackWebhookPath } from "./paths-CQZI_5WY.mjs";
|
|
11
|
+
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-C6_DdlSf.mjs";
|
|
12
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-CF2JME9q.mjs";
|
|
13
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-DDcCAjH1.mjs";
|
|
14
|
+
import { n as runSlackApprovalMessageUpdate, t as hasSlackApprovalControl } from "./approval-message-updates-CqcRoa28.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
|
+
// 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.
|
|
@@ -87,8 +87,7 @@ function buildSlackSlashCommandMatcher(name) {
|
|
|
87
87
|
const escaped = normalizeSlackSlashCommandName(name).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
88
88
|
return new RegExp(`^/?${escaped}$`);
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
//#region extensions/slack/src/monitor/approval-runtime-context.ts
|
|
90
|
+
// extensions/slack/src/monitor/approval-runtime-context.ts
|
|
92
91
|
function registerSlackApprovalRuntimeContext(params) {
|
|
93
92
|
const approvalContext = {
|
|
94
93
|
app: params.app,
|
|
@@ -106,8 +105,7 @@ function registerSlackApprovalRuntimeContext(params) {
|
|
|
106
105
|
abortSignal: params.abortSignal
|
|
107
106
|
});
|
|
108
107
|
}
|
|
109
|
-
|
|
110
|
-
//#region extensions/slack/src/monitor/assistant-thread-context.ts
|
|
108
|
+
// extensions/slack/src/monitor/assistant-thread-context.ts
|
|
111
109
|
const SLACK_ASSISTANT_THREAD_CONTEXT_METADATA_EVENT = "assistant_thread_context";
|
|
112
110
|
const SLACK_ASSISTANT_CONTEXT_TTL_MS = 864e5;
|
|
113
111
|
const SLACK_ASSISTANT_CONTEXT_CLEANUP_INTERVAL_MS = 6e5;
|
|
@@ -183,8 +181,7 @@ function buildContextKey(accountId, channelId, threadTs, eventScope) {
|
|
|
183
181
|
const key = `${channelId}:${threadTs}`;
|
|
184
182
|
return eventScope ? `${accountId}:${eventScope.teamId}:${key}` : key;
|
|
185
183
|
}
|
|
186
|
-
|
|
187
|
-
//#region extensions/slack/src/monitor/channel-type.ts
|
|
184
|
+
// extensions/slack/src/monitor/channel-type.ts
|
|
188
185
|
function inferSlackChannelType(channelId) {
|
|
189
186
|
const trimmed = channelId?.trim();
|
|
190
187
|
if (!trimmed) return;
|
|
@@ -207,8 +204,7 @@ function resolveSlackChatType(channelType) {
|
|
|
207
204
|
if (channelType === "mpim") return "group";
|
|
208
205
|
return "channel";
|
|
209
206
|
}
|
|
210
|
-
|
|
211
|
-
//#region extensions/slack/src/monitor/enterprise-install.ts
|
|
207
|
+
// extensions/slack/src/monitor/enterprise-install.ts
|
|
212
208
|
const SLACK_CHANNEL_ID_RE = /^[CDG][A-Z0-9]{8,}$/;
|
|
213
209
|
const SLACK_USER_ID_RE = /^[BUW][A-Z0-9]{8,}$/;
|
|
214
210
|
function isWorkspaceScopedSlackChannelEntry(value, options) {
|
|
@@ -358,8 +354,7 @@ function resolveSlackIdentityHealth(params) {
|
|
|
358
354
|
lastError: null
|
|
359
355
|
};
|
|
360
356
|
}
|
|
361
|
-
|
|
362
|
-
//#region extensions/slack/src/monitor/reconnect-policy.ts
|
|
357
|
+
// extensions/slack/src/monitor/reconnect-policy.ts
|
|
363
358
|
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;
|
|
364
359
|
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;
|
|
365
360
|
/** Consecutive isolated invalid_auth failures before the channel turns terminal. */
|
|
@@ -461,8 +456,7 @@ function isIsolatedInvalidAuthSlackError(error) {
|
|
|
461
456
|
const text = formatSlackError(error, "");
|
|
462
457
|
return /invalid_auth/i.test(text) && !SLACK_DEFINITIVE_AUTH_ERROR_RE.test(text);
|
|
463
458
|
}
|
|
464
|
-
|
|
465
|
-
//#region extensions/slack/src/monitor/provider-support.ts
|
|
459
|
+
// extensions/slack/src/monitor/provider-support.ts
|
|
466
460
|
const OPENCLAW_SLACK_CLIENT_PING_TIMEOUT_MS = 15e3;
|
|
467
461
|
const OPENCLAW_SLACK_SOCKET_START_FAILED_EVENT = "unable_to_socket_mode_start";
|
|
468
462
|
const SLACK_SOCKET_PONG_TIMEOUT_WARNING_PREFIX = "A pong wasn't received from the server";
|
|
@@ -772,8 +766,7 @@ function formatSlackUserResolved(entry) {
|
|
|
772
766
|
extra: entry.note ? [entry.note] : []
|
|
773
767
|
});
|
|
774
768
|
}
|
|
775
|
-
|
|
776
|
-
//#region extensions/slack/src/monitor/system-event-session.ts
|
|
769
|
+
// extensions/slack/src/monitor/system-event-session.ts
|
|
777
770
|
function createSlackSystemEventRouteResolver(params) {
|
|
778
771
|
return async (event) => {
|
|
779
772
|
const channelId = normalizeOptionalString(event.channelId) ?? "";
|
|
@@ -836,8 +829,7 @@ function createSlackSystemEventRouteResolver(params) {
|
|
|
836
829
|
};
|
|
837
830
|
};
|
|
838
831
|
}
|
|
839
|
-
|
|
840
|
-
//#region extensions/slack/src/monitor/runtime-policy.ts
|
|
832
|
+
// extensions/slack/src/monitor/runtime-policy.ts
|
|
841
833
|
function resolveSlackMonitorPolicy(cfg, accountId, runtime) {
|
|
842
834
|
const slack = mergeSlackAccountConfig(cfg, accountId);
|
|
843
835
|
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy({
|
|
@@ -1009,8 +1001,7 @@ async function resolveWorkspacePolicy(ctx, resolveToken) {
|
|
|
1009
1001
|
summarizeMapping("slack users", mapping, unresolved, runtime);
|
|
1010
1002
|
ctx.channelsConfigKeys = Object.keys(ctx.channelsConfig ?? {});
|
|
1011
1003
|
}
|
|
1012
|
-
|
|
1013
|
-
//#region extensions/slack/src/monitor/transient-api-error.ts
|
|
1004
|
+
// extensions/slack/src/monitor/transient-api-error.ts
|
|
1014
1005
|
function isTransientSlackApiError(error) {
|
|
1015
1006
|
if (error instanceof WebAPIRateLimitedError) return true;
|
|
1016
1007
|
if (error instanceof WebAPIHTTPError) return error.statusCode === 408 || error.statusCode === 429 || error.statusCode >= 500 && error.statusCode < 600;
|
|
@@ -1024,8 +1015,7 @@ function isTransientSlackApiError(error) {
|
|
|
1024
1015
|
current.original
|
|
1025
1016
|
]).some((candidate) => classifyTransientNetworkErrorCode(extractErrorCode(candidate)) || readErrorName(candidate) === "TimeoutError");
|
|
1026
1017
|
}
|
|
1027
|
-
|
|
1028
|
-
//#region extensions/slack/src/monitor/suggested-prompts.ts
|
|
1018
|
+
// extensions/slack/src/monitor/suggested-prompts.ts
|
|
1029
1019
|
async function updateSlackSuggestedPrompts(params) {
|
|
1030
1020
|
const prompts = params.prompts.map(({ title, message }) => ({
|
|
1031
1021
|
title: title.trim(),
|
|
@@ -1052,8 +1042,7 @@ async function updateSlackSuggestedPrompts(params) {
|
|
|
1052
1042
|
return outcome;
|
|
1053
1043
|
}
|
|
1054
1044
|
}
|
|
1055
|
-
|
|
1056
|
-
//#region extensions/slack/src/monitor/context.ts
|
|
1045
|
+
// extensions/slack/src/monitor/context.ts
|
|
1057
1046
|
const SLACK_AGENT_VIEW_STATE_NAMESPACE = "agent-view-workspaces";
|
|
1058
1047
|
const SLACK_AGENT_VIEW_THREAD_STATE_NAMESPACE = "agent-view-threads";
|
|
1059
1048
|
const SLACK_AGENT_VIEW_STATE_MAX_ENTRIES = 4096;
|
|
@@ -1472,8 +1461,7 @@ function createSlackMonitorContext(params) {
|
|
|
1472
1461
|
ctx.readRuntimeContext = createSlackRuntimeContextReader(ctx, lookupToken ?? params.botToken);
|
|
1473
1462
|
return ctx;
|
|
1474
1463
|
}
|
|
1475
|
-
|
|
1476
|
-
//#region extensions/slack/src/streaming.ts
|
|
1464
|
+
// extensions/slack/src/streaming.ts
|
|
1477
1465
|
/**
|
|
1478
1466
|
* Thrown when Slack definitively rejects a stream flush/finalize while text
|
|
1479
1467
|
* remains buffered locally by the Slack SDK. Carries the pending text so the
|
|
@@ -1650,8 +1638,7 @@ function markSlackStreamFallbackDelivered(session) {
|
|
|
1650
1638
|
if (session.stopped) releaseSlackStream(session);
|
|
1651
1639
|
else stateBySession.get(session)?.sessions.add(session);
|
|
1652
1640
|
}
|
|
1653
|
-
|
|
1654
|
-
//#region extensions/slack/src/monitor/auth.ts
|
|
1641
|
+
// extensions/slack/src/monitor/auth.ts
|
|
1655
1642
|
const slackChannelMembersCache = /* @__PURE__ */ new WeakMap();
|
|
1656
1643
|
const CHANNEL_MEMBERS_CACHE_TTL_MS = 6e4;
|
|
1657
1644
|
const CHANNEL_MEMBERS_CACHE_MAX = 512;
|
|
@@ -1960,8 +1947,7 @@ async function authorizeSlackSystemEventSender(params) {
|
|
|
1960
1947
|
channelName
|
|
1961
1948
|
};
|
|
1962
1949
|
}
|
|
1963
|
-
|
|
1964
|
-
//#region extensions/slack/src/monitor/event-scope.ts
|
|
1950
|
+
// extensions/slack/src/monitor/event-scope.ts
|
|
1965
1951
|
function resolveSlackMonitorEventScope(params) {
|
|
1966
1952
|
const identity = params.ctx.installationIdentity;
|
|
1967
1953
|
const clientOptions = params.ctx.app.webClientOptions;
|
|
@@ -2008,8 +1994,7 @@ function resolveSlackInteractionEventScope(ctx, args, kind) {
|
|
|
2008
1994
|
}
|
|
2009
1995
|
return eventScope;
|
|
2010
1996
|
}
|
|
2011
|
-
|
|
2012
|
-
//#region extensions/slack/src/types.ts
|
|
1997
|
+
// extensions/slack/src/types.ts
|
|
2013
1998
|
function parseSlackMessageEvent(value) {
|
|
2014
1999
|
const record = asOptionalRecord(value);
|
|
2015
2000
|
return record?.type === "message" && typeof record.channel === "string" ? {
|
|
@@ -2023,8 +2008,7 @@ function requireSlackMessageEvent(value) {
|
|
|
2023
2008
|
if (!event) throw new TypeError("Invalid persisted Slack message event");
|
|
2024
2009
|
return event;
|
|
2025
2010
|
}
|
|
2026
|
-
|
|
2027
|
-
//#region extensions/slack/src/monitor/ingress.ts
|
|
2011
|
+
// extensions/slack/src/monitor/ingress.ts
|
|
2028
2012
|
const SLACK_INGRESS_PAYLOAD_VERSION = 1;
|
|
2029
2013
|
const SLACK_INGRESS_POLL_INTERVAL_MS = 1e3;
|
|
2030
2014
|
const SLACK_BOLT_AUTHORIZATION_ERROR = "slack_bolt_authorization_error";
|
|
@@ -2344,8 +2328,7 @@ function createSlackDurableIngress(options) {
|
|
|
2344
2328
|
waitForIdle: monitor.waitForIdle
|
|
2345
2329
|
};
|
|
2346
2330
|
}
|
|
2347
|
-
|
|
2348
|
-
//#region extensions/slack/src/monitor/events/assistant.ts
|
|
2331
|
+
// extensions/slack/src/monitor/events/assistant.ts
|
|
2349
2332
|
function registerSlackAssistantEvents(params) {
|
|
2350
2333
|
const { ctx, trackEvent } = params;
|
|
2351
2334
|
for (const eventName of ["assistant_thread_started", "assistant_thread_context_changed"]) ctx.app.event(eventName, async ({ event, body, context }) => {
|
|
@@ -2404,8 +2387,7 @@ function registerSlackAssistantEvents(params) {
|
|
|
2404
2387
|
}
|
|
2405
2388
|
});
|
|
2406
2389
|
}
|
|
2407
|
-
|
|
2408
|
-
//#region extensions/slack/src/channel-migration.ts
|
|
2390
|
+
// extensions/slack/src/channel-migration.ts
|
|
2409
2391
|
function migrateSlackChannelConfig(params) {
|
|
2410
2392
|
let migrated = false;
|
|
2411
2393
|
let skippedExisting = false;
|
|
@@ -2427,8 +2409,7 @@ function migrateSlackChannelConfig(params) {
|
|
|
2427
2409
|
skippedExisting
|
|
2428
2410
|
};
|
|
2429
2411
|
}
|
|
2430
|
-
|
|
2431
|
-
//#region extensions/slack/src/monitor/events/channels.ts
|
|
2412
|
+
// extensions/slack/src/monitor/events/channels.ts
|
|
2432
2413
|
function registerSlackChannelEvents(params) {
|
|
2433
2414
|
const { ctx, trackEvent } = params;
|
|
2434
2415
|
for (const [eventName, kind] of [["channel_created", "created"], ["channel_rename", "renamed"]]) ctx.app.event(eventName, async (args) => {
|
|
@@ -2515,8 +2496,7 @@ function registerSlackChannelIdChangedEvent(params) {
|
|
|
2515
2496
|
}
|
|
2516
2497
|
});
|
|
2517
2498
|
}
|
|
2518
|
-
|
|
2519
|
-
//#region extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2499
|
+
// extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2520
2500
|
function resolveSlackDeferredActionTarget(params) {
|
|
2521
2501
|
if (!params.id) throw new Error("Slack deferred action is missing a target ID");
|
|
2522
2502
|
if (!params.eventScope) return {
|
|
@@ -2529,8 +2509,7 @@ function resolveSlackDeferredActionTarget(params) {
|
|
|
2529
2509
|
target
|
|
2530
2510
|
};
|
|
2531
2511
|
}
|
|
2532
|
-
|
|
2533
|
-
//#region extensions/slack/src/monitor/events/interaction-event.ts
|
|
2512
|
+
// extensions/slack/src/monitor/events/interaction-event.ts
|
|
2534
2513
|
const SLACK_INTERACTION_EVENT_PREFIX = "Slack interaction: ";
|
|
2535
2514
|
const REDACTED_INTERACTION_VALUE = "[redacted]";
|
|
2536
2515
|
const SLACK_INTERACTION_EVENT_MAX_CHARS = 2400;
|
|
@@ -2669,8 +2648,7 @@ async function enqueueSlackInteractionEvent(payload, route, options, log) {
|
|
|
2669
2648
|
return false;
|
|
2670
2649
|
}
|
|
2671
2650
|
}
|
|
2672
|
-
|
|
2673
|
-
//#region extensions/slack/src/interactive-dispatch.ts
|
|
2651
|
+
// extensions/slack/src/interactive-dispatch.ts
|
|
2674
2652
|
const dispatchSlackInteractive = createChannelInteractiveDispatcher({
|
|
2675
2653
|
channel: "slack",
|
|
2676
2654
|
interactiveKey: "interaction"
|
|
@@ -2695,8 +2673,7 @@ async function dispatchSlackPluginInteractiveHandler(params) {
|
|
|
2695
2673
|
}
|
|
2696
2674
|
});
|
|
2697
2675
|
}
|
|
2698
|
-
|
|
2699
|
-
//#region extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
2676
|
+
// extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
2700
2677
|
function resolveSlackPluginApprovalSender(params) {
|
|
2701
2678
|
const senderId = formatSlackTarget({
|
|
2702
2679
|
kind: "user",
|
|
@@ -2712,8 +2689,7 @@ function resolveSlackPluginApprovalSender(params) {
|
|
|
2712
2689
|
})
|
|
2713
2690
|
};
|
|
2714
2691
|
}
|
|
2715
|
-
|
|
2716
|
-
//#region extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
2692
|
+
// extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
2717
2693
|
function readOptionValues(options, read) {
|
|
2718
2694
|
if (!Array.isArray(options)) return [];
|
|
2719
2695
|
return options.map((option) => option && typeof option === "object" ? read(option) : void 0);
|
|
@@ -2805,8 +2781,7 @@ function formatInteractionSelectionLabel(params) {
|
|
|
2805
2781
|
if (params.summary.richTextPreview) return params.summary.richTextPreview;
|
|
2806
2782
|
return normalizeOptionalString(params.summary.value) ?? params.actionId;
|
|
2807
2783
|
}
|
|
2808
|
-
|
|
2809
|
-
//#region extensions/slack/src/monitor/events/interactions.block-actions.context.ts
|
|
2784
|
+
// extensions/slack/src/monitor/events/interactions.block-actions.context.ts
|
|
2810
2785
|
function resolveSlackActionValue(summary) {
|
|
2811
2786
|
return normalizeOptionalString(summary.value) ?? summary.selectedValues?.[0];
|
|
2812
2787
|
}
|
|
@@ -2857,8 +2832,7 @@ function parseSlackBlockAction(params) {
|
|
|
2857
2832
|
actionSummary: summarizeAction(typedAction)
|
|
2858
2833
|
};
|
|
2859
2834
|
}
|
|
2860
|
-
|
|
2861
|
-
//#region extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
2835
|
+
// extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
2862
2836
|
async function respondEphemeral(respond, text) {
|
|
2863
2837
|
if (!respond) return;
|
|
2864
2838
|
try {
|
|
@@ -2963,7 +2937,7 @@ async function handleSlackApprovalInteraction(params) {
|
|
|
2963
2937
|
channelId,
|
|
2964
2938
|
messageTs
|
|
2965
2939
|
}, async () => {
|
|
2966
|
-
const { readSlackMessages } = await import("./actions-
|
|
2940
|
+
const { readSlackMessages } = await import("./actions-s3CcFO45.mjs").then((n) => n.t);
|
|
2967
2941
|
const { messages } = await readSlackMessages(channelId, {
|
|
2968
2942
|
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
2969
2943
|
messageId: messageTs,
|
|
@@ -3296,8 +3270,7 @@ function registerSlackBlockActionHandler(params) {
|
|
|
3296
3270
|
}, runtimeContext.runtime.log) && runtimeContext.isRuntimePolicyCurrent()) await updateSlackLegacyBlockAction(actionContext);
|
|
3297
3271
|
});
|
|
3298
3272
|
}
|
|
3299
|
-
|
|
3300
|
-
//#region extensions/slack/src/modal-metadata.ts
|
|
3273
|
+
// extensions/slack/src/modal-metadata.ts
|
|
3301
3274
|
function parseSlackModalPrivateMetadata(raw) {
|
|
3302
3275
|
if (typeof raw !== "string" || raw.trim().length === 0) return {};
|
|
3303
3276
|
try {
|
|
@@ -3313,8 +3286,7 @@ function parseSlackModalPrivateMetadata(raw) {
|
|
|
3313
3286
|
return {};
|
|
3314
3287
|
}
|
|
3315
3288
|
}
|
|
3316
|
-
|
|
3317
|
-
//#region extensions/slack/src/monitor/events/interactions.modal.ts
|
|
3289
|
+
// extensions/slack/src/monitor/events/interactions.modal.ts
|
|
3318
3290
|
const OPENCLAW_MODAL_CALLBACK_PREFIX = "openclaw:";
|
|
3319
3291
|
function resolveSlackPluginSystemEventPayload(result) {
|
|
3320
3292
|
const systemEvent = result?.systemEvent;
|
|
@@ -3511,8 +3483,7 @@ function registerModalLifecycleHandler(params) {
|
|
|
3511
3483
|
}, runtimeCtx.runtime.log);
|
|
3512
3484
|
});
|
|
3513
3485
|
}
|
|
3514
|
-
|
|
3515
|
-
//#region extensions/slack/src/monitor/events/interactions.ts
|
|
3486
|
+
// extensions/slack/src/monitor/events/interactions.ts
|
|
3516
3487
|
function registerSlackInteractionEvents(params) {
|
|
3517
3488
|
const { ctx, trackEvent } = params;
|
|
3518
3489
|
registerSlackBlockActionHandler(params);
|
|
@@ -3608,8 +3579,7 @@ function registerSlackInteractionEvents(params) {
|
|
|
3608
3579
|
interactionType
|
|
3609
3580
|
});
|
|
3610
3581
|
}
|
|
3611
|
-
|
|
3612
|
-
//#region extensions/slack/src/monitor/events/system-event-context.ts
|
|
3582
|
+
// extensions/slack/src/monitor/events/system-event-context.ts
|
|
3613
3583
|
async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
3614
3584
|
const { senderId, channelId, channelType, eventKind } = params;
|
|
3615
3585
|
const ctx = await params.ctx.readRuntimeContext();
|
|
@@ -3639,8 +3609,7 @@ async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
|
3639
3609
|
})
|
|
3640
3610
|
};
|
|
3641
3611
|
}
|
|
3642
|
-
|
|
3643
|
-
//#region extensions/slack/src/monitor/events/members.ts
|
|
3612
|
+
// extensions/slack/src/monitor/events/members.ts
|
|
3644
3613
|
function registerSlackMemberEvents(params) {
|
|
3645
3614
|
const { ctx, trackEvent } = params;
|
|
3646
3615
|
for (const verb of ["joined", "left"]) ctx.app.event(`member_${verb}_channel`, async (args) => {
|
|
@@ -3731,8 +3700,7 @@ function registerSlackMemberEvents(params) {
|
|
|
3731
3700
|
}
|
|
3732
3701
|
});
|
|
3733
3702
|
}
|
|
3734
|
-
|
|
3735
|
-
//#region extensions/slack/src/draft-message-boundaries.ts
|
|
3703
|
+
// extensions/slack/src/draft-message-boundaries.ts
|
|
3736
3704
|
const activeDraftsByConversation = /* @__PURE__ */ new Map();
|
|
3737
3705
|
function conversationKey(conversation) {
|
|
3738
3706
|
return [
|
|
@@ -3783,8 +3751,7 @@ function noteSlackDraftConversationMessage(conversation) {
|
|
|
3783
3751
|
if (isLaterSlackMessage(conversation.messageTs, draft.messageTs)) draft.onInterveningMessage();
|
|
3784
3752
|
}
|
|
3785
3753
|
}
|
|
3786
|
-
|
|
3787
|
-
//#region extensions/slack/src/threading.ts
|
|
3754
|
+
// extensions/slack/src/threading.ts
|
|
3788
3755
|
function resolveSlackThreadContext(params) {
|
|
3789
3756
|
const incomingThreadTs = params.message.thread_ts;
|
|
3790
3757
|
const eventTs = params.message.event_ts;
|
|
@@ -3801,8 +3768,7 @@ function resolveSlackThreadContext(params) {
|
|
|
3801
3768
|
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
3802
3769
|
};
|
|
3803
3770
|
}
|
|
3804
|
-
|
|
3805
|
-
//#region extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
3771
|
+
// extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
3806
3772
|
function resolveSlackMessageSubtypeHandler(event) {
|
|
3807
3773
|
const subtype = event.subtype;
|
|
3808
3774
|
if (subtype !== "message_changed" && subtype !== "message_deleted") return;
|
|
@@ -3826,8 +3792,7 @@ function resolveSlackMessageSubtypeHandler(event) {
|
|
|
3826
3792
|
}).replyToId : void 0
|
|
3827
3793
|
};
|
|
3828
3794
|
}
|
|
3829
|
-
|
|
3830
|
-
//#region extensions/slack/src/monitor/events/messages.ts
|
|
3795
|
+
// extensions/slack/src/monitor/events/messages.ts
|
|
3831
3796
|
const slackInboundLog = createSubsystemLogger("gateway/channels/slack").child("inbound");
|
|
3832
3797
|
function isBotAuthoredEnterpriseEvent(event) {
|
|
3833
3798
|
return Boolean(normalizeOptionalString(event.bot_id)) || event.subtype === "bot_message";
|
|
@@ -3987,8 +3952,7 @@ function registerSlackMessageEvents(params) {
|
|
|
3987
3952
|
}
|
|
3988
3953
|
});
|
|
3989
3954
|
}
|
|
3990
|
-
|
|
3991
|
-
//#region extensions/slack/src/monitor/session-run-targets.ts
|
|
3955
|
+
// extensions/slack/src/monitor/session-run-targets.ts
|
|
3992
3956
|
async function captureSlackSessionTargetGuard(ctx, route, isActive) {
|
|
3993
3957
|
return captureSessionEntryCurrentCheckAsync({
|
|
3994
3958
|
agentId: route.agentId,
|
|
@@ -4030,8 +3994,7 @@ function getSlackSessionRuns(ctx, address) {
|
|
|
4030
3994
|
isActive: () => targets.some((candidate) => candidate.route.sessionKey === target.route.sessionKey && candidate.isActive())
|
|
4031
3995
|
}));
|
|
4032
3996
|
}
|
|
4033
|
-
|
|
4034
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
3997
|
+
// extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
4035
3998
|
async function resolveSlackRoutingContext(params) {
|
|
4036
3999
|
const { ctx, account, message, chatType, channelConfig, seedTopLevelRoomThread, assistantThreadTs, agentViewThreadTs, eventScope } = params;
|
|
4037
4000
|
const isDirectMessage = chatType === "direct";
|
|
@@ -4208,8 +4171,7 @@ async function resolveSlackSessionEventRoutingContext(params) {
|
|
|
4208
4171
|
release: current.release
|
|
4209
4172
|
};
|
|
4210
4173
|
}
|
|
4211
|
-
|
|
4212
|
-
//#region extensions/slack/src/monitor/dm-auth.ts
|
|
4174
|
+
// extensions/slack/src/monitor/dm-auth.ts
|
|
4213
4175
|
async function authorizeSlackDirectMessage(params) {
|
|
4214
4176
|
if (!params.ctx.dmEnabled || params.ctx.dmPolicy === "disabled") {
|
|
4215
4177
|
await params.onDisabled();
|
|
@@ -4265,8 +4227,7 @@ async function authorizeSlackDirectMessage(params) {
|
|
|
4265
4227
|
});
|
|
4266
4228
|
return false;
|
|
4267
4229
|
}
|
|
4268
|
-
|
|
4269
|
-
//#region extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
4230
|
+
// extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
4270
4231
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
4271
4232
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(24)}}$`);
|
|
4272
4233
|
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 6e5;
|
|
@@ -4302,8 +4263,7 @@ function createSlackExternalArgMenuStore() {
|
|
|
4302
4263
|
}
|
|
4303
4264
|
};
|
|
4304
4265
|
}
|
|
4305
|
-
|
|
4306
|
-
//#region extensions/slack/src/monitor/response-url-budget.ts
|
|
4266
|
+
// extensions/slack/src/monitor/response-url-budget.ts
|
|
4307
4267
|
const SLACK_RESPONSE_URL_MAX_CALLS = 5;
|
|
4308
4268
|
var SlackResponseAlreadyReportedError = class extends Error {};
|
|
4309
4269
|
/** Count every response_url attempt, including requests Slack rejects. */
|
|
@@ -4318,8 +4278,7 @@ function createSlackResponseUrlBudget(respond) {
|
|
|
4318
4278
|
}
|
|
4319
4279
|
};
|
|
4320
4280
|
}
|
|
4321
|
-
|
|
4322
|
-
//#region extensions/slack/src/monitor/room-context.ts
|
|
4281
|
+
// extensions/slack/src/monitor/room-context.ts
|
|
4323
4282
|
function resolveSlackRoomContextHints(params) {
|
|
4324
4283
|
return {
|
|
4325
4284
|
channelMetadata: params.isRoomish ? buildChannelMetadata({
|
|
@@ -4330,8 +4289,7 @@ function resolveSlackRoomContextHints(params) {
|
|
|
4330
4289
|
groupSystemPrompt: params.isRoomish ? normalizeOptionalString(params.channelConfig?.systemPrompt) : void 0
|
|
4331
4290
|
};
|
|
4332
4291
|
}
|
|
4333
|
-
|
|
4334
|
-
//#region extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
4292
|
+
// extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
4335
4293
|
async function resolveSlackCommandMenuModelContext(params) {
|
|
4336
4294
|
if (!params.sessionKey.trim()) return {};
|
|
4337
4295
|
try {
|
|
@@ -4380,8 +4338,7 @@ async function resolveSlackCommandMenuModelContext(params) {
|
|
|
4380
4338
|
return {};
|
|
4381
4339
|
}
|
|
4382
4340
|
}
|
|
4383
|
-
|
|
4384
|
-
//#region extensions/slack/src/monitor/slash.ts
|
|
4341
|
+
// extensions/slack/src/monitor/slash.ts
|
|
4385
4342
|
const SLACK_COMMAND_ARG_ACTION_ID = "openclaw_cmdarg";
|
|
4386
4343
|
const SLACK_COMMAND_ARG_ACTION_LISTENER = /^openclaw_cmdarg/;
|
|
4387
4344
|
const SLACK_COMMAND_ARG_VALUE_PREFIX = "cmdarg";
|
|
@@ -4396,7 +4353,7 @@ const SLACK_COMMAND_ARG_BUTTON_VALUE_MAX = 2e3;
|
|
|
4396
4353
|
const SLACK_COMMAND_ARG_CONFIRM_TEXT_MAX = 300;
|
|
4397
4354
|
const SLACK_HEADER_TEXT_MAX = 150;
|
|
4398
4355
|
const SLACK_COMMAND_ARG_ACTION_BLOCKS_MAX = 47;
|
|
4399
|
-
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-
|
|
4356
|
+
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-DhIREf-h.mjs"));
|
|
4400
4357
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
4401
4358
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
4402
4359
|
function buildSlackArgMenuConfirm(params) {
|
|
@@ -5181,8 +5138,7 @@ async function deliverSlackSlashResponseWithWebApi(params) {
|
|
|
5181
5138
|
function isSlackBoltRespondError(error) {
|
|
5182
5139
|
return Boolean(error) && typeof error === "object" && error.code === "slack_bolt_respond_error";
|
|
5183
5140
|
}
|
|
5184
|
-
|
|
5185
|
-
//#region extensions/slack/src/monitor/events.ts
|
|
5141
|
+
// extensions/slack/src/monitor/events.ts
|
|
5186
5142
|
function buildSlackHomeView(slashCommandName) {
|
|
5187
5143
|
return {
|
|
5188
5144
|
type: "home",
|
|
@@ -5483,8 +5439,7 @@ function registerSlackWorkspaceEvents(params) {
|
|
|
5483
5439
|
trackEvent
|
|
5484
5440
|
});
|
|
5485
5441
|
}
|
|
5486
|
-
|
|
5487
|
-
//#region extensions/slack/src/monitor/http-handler.ts
|
|
5442
|
+
// extensions/slack/src/monitor/http-handler.ts
|
|
5488
5443
|
const SLACK_WEBHOOK_MAX_BODY_BYTES = 1048576;
|
|
5489
5444
|
const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
|
|
5490
5445
|
function registerSlackHttpHandler(params) {
|
|
@@ -5528,8 +5483,7 @@ function createSlackHttpRequestHandler(params) {
|
|
|
5528
5483
|
}
|
|
5529
5484
|
};
|
|
5530
5485
|
}
|
|
5531
|
-
|
|
5532
|
-
//#region extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5486
|
+
// extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5533
5487
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_TTL_MS = 864e5;
|
|
5534
5488
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_MEMORY_MAX_ENTRIES = 2e4;
|
|
5535
5489
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_STATE_MAX_ENTRIES = 2e4;
|
|
@@ -5582,8 +5536,7 @@ async function claimSlackMessageDispatchReplay(params) {
|
|
|
5582
5536
|
handle: claim.handle
|
|
5583
5537
|
} : { kind: "duplicate" };
|
|
5584
5538
|
}
|
|
5585
|
-
|
|
5586
|
-
//#region extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5539
|
+
// extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5587
5540
|
function resolveSlackSenderId(message) {
|
|
5588
5541
|
return message.user ?? message.bot_id ?? null;
|
|
5589
5542
|
}
|
|
@@ -5600,8 +5553,7 @@ function buildSlackDebounceKey(message, accountId, teamId) {
|
|
|
5600
5553
|
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;
|
|
5601
5554
|
return `slack:${accountId}:${teamId ? `${teamId}:` : ""}${threadKey}:${senderId}`;
|
|
5602
5555
|
}
|
|
5603
|
-
|
|
5604
|
-
//#region extensions/slack/src/monitor/thread-resolution.ts
|
|
5556
|
+
// extensions/slack/src/monitor/thread-resolution.ts
|
|
5605
5557
|
const DEFAULT_THREAD_TS_CACHE_TTL_MS = 6e4;
|
|
5606
5558
|
const DEFAULT_THREAD_TS_CACHE_MAX = 500;
|
|
5607
5559
|
const markAmbiguousThreadReply = (message) => ({
|
|
@@ -5651,9 +5603,8 @@ function createSlackThreadTsResolver(params) {
|
|
|
5651
5603
|
return markAmbiguousThreadReply(message);
|
|
5652
5604
|
} };
|
|
5653
5605
|
}
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-B-EtO-8F.mjs"));
|
|
5606
|
+
// extensions/slack/src/monitor/message-handler.ts
|
|
5607
|
+
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-Bwv_G13H.mjs"));
|
|
5657
5608
|
const RETRYABLE_FLUSH_MAX_ATTEMPTS = 3;
|
|
5658
5609
|
function shouldDebounceSlackMessage(message, cfg) {
|
|
5659
5610
|
const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");
|
|
@@ -5919,8 +5870,7 @@ function createSlackMessageHandler(params) {
|
|
|
5919
5870
|
await (await enqueueSlackMessage(message, opts))?.promise;
|
|
5920
5871
|
};
|
|
5921
5872
|
}
|
|
5922
|
-
|
|
5923
|
-
//#region extensions/slack/src/monitor/presence-monitor.ts
|
|
5873
|
+
// extensions/slack/src/monitor/presence-monitor.ts
|
|
5924
5874
|
const SLACK_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
5925
5875
|
const SLACK_PRESENCE_REQUEST_TIMEOUT_MS = 3e4;
|
|
5926
5876
|
const SLACK_PRESENCE_POLL_INTERVAL_MS = 6e4;
|
|
@@ -6154,8 +6104,7 @@ function createSlackPresenceMonitor(params) {
|
|
|
6154
6104
|
function presenceSubjectKey(subject) {
|
|
6155
6105
|
return `${subject.teamId ?? "workspace"}:${subject.userId}`;
|
|
6156
6106
|
}
|
|
6157
|
-
|
|
6158
|
-
//#region extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6107
|
+
// extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6159
6108
|
const SLACK_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
|
|
6160
6109
|
function openSlackPresenceCooldownStore() {
|
|
6161
6110
|
return getSlackRuntime().state.openKeyedStore({
|
|
@@ -6165,8 +6114,7 @@ function openSlackPresenceCooldownStore() {
|
|
|
6165
6114
|
defaultTtlMs: SLACK_PRESENCE_GREETING_COOLDOWN_MS
|
|
6166
6115
|
});
|
|
6167
6116
|
}
|
|
6168
|
-
|
|
6169
|
-
//#region extensions/slack/src/monitor/provider-workspace-client.ts
|
|
6117
|
+
// extensions/slack/src/monitor/provider-workspace-client.ts
|
|
6170
6118
|
function withSlackPresenceLifecycleSignal(fetchImpl, lifecycleSignal) {
|
|
6171
6119
|
return async (input, init) => await fetchImpl(input, {
|
|
6172
6120
|
...init,
|
|
@@ -6188,10 +6136,9 @@ function createSlackWorkspaceClientResolver(params) {
|
|
|
6188
6136
|
return client;
|
|
6189
6137
|
};
|
|
6190
6138
|
}
|
|
6191
|
-
|
|
6192
|
-
//#region extensions/slack/src/monitor/provider.ts
|
|
6139
|
+
// extensions/slack/src/monitor/provider.ts
|
|
6193
6140
|
const getSlackBoltInterop = createLazyRuntimeSurface(() => import("@slack/bolt"), resolveSlackBoltInterop);
|
|
6194
|
-
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-
|
|
6141
|
+
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-D1SVBMhk.mjs"));
|
|
6195
6142
|
function resolveSlackRuntimeIdentity(params) {
|
|
6196
6143
|
const botUserId = normalizeOptionalString(params.botUserId);
|
|
6197
6144
|
const botId = normalizeOptionalString(params.botId);
|
|
@@ -6665,12 +6612,10 @@ async function monitorSlackProvider(opts) {
|
|
|
6665
6612
|
await slackDispatchers.close();
|
|
6666
6613
|
}
|
|
6667
6614
|
}
|
|
6668
|
-
|
|
6669
|
-
//#region extensions/slack/src/monitor.ts
|
|
6615
|
+
// extensions/slack/src/monitor.ts
|
|
6670
6616
|
var monitor_exports = /* @__PURE__ */ __exportAll({
|
|
6671
6617
|
buildSlackSlashCommandMatcher: () => buildSlackSlashCommandMatcher,
|
|
6672
6618
|
isSlackChannelAllowedByPolicy: () => isSlackChannelAllowedByPolicy,
|
|
6673
6619
|
monitorSlackProvider: () => monitorSlackProvider
|
|
6674
6620
|
});
|
|
6675
|
-
//#endregion
|
|
6676
6621
|
export { normalizeSlackChannelType as C, stripSlackMentionsForCommandDetection as D, readSlackAssistantThreadContext as E, SLACK_SOCKET_RECONNECT_POLICY as S, buildSlackAssistantThreadMetadata as T, SlackStreamNotDeliveredError as _, createSlackResponseUrlBudget as a, startSlackStream as b, registerSlackSessionRun as c, parseSlackMessageEvent as d, requireSlackMessageEvent as f, SlackStreamMessageTooLongError 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, appendSlackStream as v, resolveSlackChatType as w, stopSlackStream as x, markSlackStreamFallbackDelivered 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-EaPP0fFY.mjs";
|
|
2
|
+
import { a as parseSlackTarget } from "./target-parsing-DwYAP3ts.mjs";
|
|
3
|
+
import { J as resolveSlackQuestionActionIds, S as assertSlackDetachedTargetAllowed, mt as SLACK_PRESENTATION_CAPABILITIES, xt as SLACK_TEXT_LIMIT } from "./probe-B_Ax1vS1.mjs";
|
|
4
|
+
import { r as resolveSlackThreadTsValue } from "./thread-ts-47Au2-Yn.mjs";
|
|
5
|
+
import { a as resolveSlackReplyBlockResolution, d as resolveSlackAuthoredTextPlacement, r as normalizeSlackReplyPayload, s as resolveSlackReplyDeliveryMessages } from "./reply-blocks-DyYYRrP_.mjs";
|
|
6
|
+
import { t as mergeSlackSendResults } from "./send-results-Bm6V1ekL.mjs";
|
|
7
|
+
import { t as registerSlackQuestionDelivery } from "./question-delivery-D3qAIwuv.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
|
+
// 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-WJZ73VSf.mjs").then((n) => n.n));
|
|
49
49
|
function resolveSlackSendIdentity(identity) {
|
|
50
50
|
if (!identity) return;
|
|
51
51
|
const username = normalizeOptionalString(identity.name);
|
|
@@ -248,5 +248,4 @@ const slackOutbound = {
|
|
|
248
248
|
}));
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
//#endregion
|
|
252
251
|
export { slackOutbound };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// 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
|
|
8
7
|
export { normalizeSlackWebhookPath as t };
|