@openclaw/slack 2026.11.7 → 2026.11.10-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/README.md +16 -0
- 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-Cs2IxOLc.mjs} +13 -12
- package/dist/.setup/action-runtime.runtime-me4Yd3j7.mjs +1 -0
- package/dist/.setup/{actions-D5S6D_BU.mjs → actions-BNOabmV6.mjs} +16 -24
- package/dist/.setup/{approval-handler.runtime-Buw5jh2Y.mjs → approval-handler.runtime-C2C-jNxi.mjs} +7 -8
- package/dist/.setup/{approval-message-updates-pmXcve5E.mjs → approval-message-updates-Bx2u_5-z.mjs} +2 -3
- package/dist/.setup/{channel-DSi3yBu5.mjs → channel-CSbCHg-I.mjs} +66 -53
- package/dist/.setup/{channel-meta-C443t-lI.mjs → channel-meta-C5vsCo3a.mjs} +1 -2
- package/dist/.setup/{channel-type-B5P3w9eA.mjs → channel-type-ZG0ErPTI.mjs} +5 -6
- package/dist/.setup/{channel.setup-Lq2OxKkF.mjs → channel.setup-DNnvYUKL.mjs} +10 -14
- package/dist/.setup/{config-schema-BWAaa5au.mjs → config-schema-DO2u-jsa.mjs} +5 -7
- 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/fork-DTKBA8Fm.mjs +155 -0
- package/dist/.setup/literal-text-DdCRYzYh.mjs +24 -0
- package/dist/.setup/{message-tool-api-LGIgVXJf.mjs → message-tool-api-B38BpEaE.mjs} +5 -7
- package/dist/.setup/{monitor-CZGrHb5a.mjs → monitor-C4cpeg1H.mjs} +105 -148
- package/dist/.setup/{outbound-adapter-C-95EWl2.mjs → outbound-adapter-1JpFMcJD.mjs} +14 -11
- package/dist/.setup/{paths-B1u59oLK.mjs → paths-CQZI_5WY.mjs} +1 -2
- package/dist/.setup/{pipeline.runtime-B-EtO-8F.mjs → pipeline.runtime-ozrJpZ8k.mjs} +100 -102
- package/dist/.setup/{policy-DxhGRvc2.mjs → policy-klXrk5vE.mjs} +3 -5
- package/dist/.setup/{probe-DANukR3O.mjs → probe-BHqvMbno.mjs} +72 -75
- package/dist/.setup/{question-delivery-CWC7sRhH.mjs → question-delivery-BGwm5Zmr.mjs} +2 -3
- package/dist/.setup/{relay-source-BH-NPqBP.mjs → relay-source-DEZ7qM1i.mjs} +3 -4
- package/dist/.setup/{replies-B5e7p3dD.mjs → replies-BK3Ht8o-.mjs} +8 -10
- package/dist/.setup/{reply-blocks-BzsXUUUL.mjs → reply-blocks-CFy-O-2B.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-DKl6yqIv.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-kGJWQtLk.mjs} +20 -38
- package/dist/.setup/{send-results-BGxlroJ-.mjs → send-results-Bm6V1ekL.mjs} +1 -2
- package/dist/.setup/setup-plugin-api-UWUSCOAK.mjs +2 -0
- package/dist/.setup/{setup-surface-C0KRtyqa.mjs → setup-surface-CPFVFPFM.mjs} +6 -7
- package/dist/.setup/{slash-dispatch.runtime-CZuMRdRx.mjs → slash-dispatch.runtime-B2oWiis5.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/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/zlib.d.ts +752 -0
- package/node_modules/@slack/bolt/node_modules/qs/.editorconfig +1 -1
- package/node_modules/@slack/bolt/node_modules/qs/CHANGELOG.md +87 -22
- package/node_modules/@slack/bolt/node_modules/qs/README.md +63 -10
- package/node_modules/@slack/bolt/node_modules/qs/dist/qs.js +17 -17
- package/node_modules/@slack/bolt/node_modules/qs/eslint.config.mjs +61 -50
- package/node_modules/@slack/bolt/node_modules/qs/lib/formats.js +7 -2
- package/node_modules/@slack/bolt/node_modules/qs/lib/parse.js +29 -10
- package/node_modules/@slack/bolt/node_modules/qs/lib/stringify.js +5 -3
- package/node_modules/@slack/bolt/node_modules/qs/lib/utils.js +28 -9
- package/node_modules/@slack/bolt/node_modules/qs/package.json +6 -6
- package/node_modules/@slack/bolt/node_modules/qs/test/parse.js +335 -2
- package/node_modules/@slack/bolt/node_modules/qs/test/stringify.js +222 -0
- package/node_modules/@slack/bolt/node_modules/qs/test/utils.js +61 -3
- package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts +14 -0
- package/node_modules/@slack/types/dist/block-kit/block-elements.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/block-kit/blocks.d.ts +65 -1
- package/node_modules/@slack/types/dist/block-kit/blocks.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/events/index.d.ts +2 -2
- package/node_modules/@slack/types/dist/events/index.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/events/index.js.map +1 -1
- package/node_modules/@slack/types/dist/events/message.d.ts +4 -0
- package/node_modules/@slack/types/dist/events/message.d.ts.map +1 -1
- package/node_modules/@slack/types/dist/events/user.d.ts +20 -0
- package/node_modules/@slack/types/dist/events/user.d.ts.map +1 -1
- package/node_modules/@slack/types/package.json +1 -1
- package/node_modules/@slack/web-api/dist/WebClient.js +1 -1
- package/node_modules/@slack/web-api/dist/WebClient.js.map +1 -1
- package/node_modules/@slack/web-api/dist/file-upload.js +1 -1
- package/node_modules/@slack/web-api/dist/file-upload.js.map +1 -1
- package/node_modules/@slack/web-api/dist/methods.d.ts +18 -3
- package/node_modules/@slack/web-api/dist/methods.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/methods.js +16 -1
- package/node_modules/@slack/web-api/dist/methods.js.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/apps.d.ts +62 -0
- package/node_modules/@slack/web-api/dist/types/request/apps.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/canvas.d.ts +4 -0
- package/node_modules/@slack/web-api/dist/types/request/canvas.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/files.d.ts +5 -1
- package/node_modules/@slack/web-api/dist/types/request/files.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/index.d.ts +2 -2
- package/node_modules/@slack/web-api/dist/types/request/index.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/manifest.d.ts +35 -3
- package/node_modules/@slack/web-api/dist/types/request/manifest.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/request/team.d.ts +6 -0
- package/node_modules/@slack/web-api/dist/types/request/team.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/response/AppsUserConnectionBulkUpdateResponse.d.ts +19 -0
- package/node_modules/@slack/web-api/dist/types/response/AppsUserConnectionBulkUpdateResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AppsUserConnectionBulkUpdateResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AppsUserConnectionBulkUpdateResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AppsUserConnectionRequestAuthResponse.d.ts +14 -0
- package/node_modules/@slack/web-api/dist/types/response/AppsUserConnectionRequestAuthResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/AppsUserConnectionRequestAuthResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/AppsUserConnectionRequestAuthResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/CanvasesGetContentResponse.d.ts +10 -0
- package/node_modules/@slack/web-api/dist/types/response/CanvasesGetContentResponse.d.ts.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/CanvasesGetContentResponse.js +11 -0
- package/node_modules/@slack/web-api/dist/types/response/CanvasesGetContentResponse.js.map +1 -0
- package/node_modules/@slack/web-api/dist/types/response/TeamInfoResponse.d.ts +1 -0
- package/node_modules/@slack/web-api/dist/types/response/TeamInfoResponse.d.ts.map +1 -1
- package/node_modules/@slack/web-api/dist/types/response/index.d.ts +3 -0
- package/node_modules/@slack/web-api/dist/types/response/index.d.ts.map +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +752 -0
- package/node_modules/@slack/web-api/package.json +3 -3
- package/node_modules/typebox/build/format/date_time.d.mts +2 -1
- package/node_modules/typebox/build/format/date_time.mjs +12 -3
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +13 -8
- package/package.json +7 -7
- 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
|
|
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 { $t as isSlackExecApprovalAuthorizedSender, C as resolveSlackConversationBindingRouteAsync, Gt as normalizeSlackSlug, J as isSlackCallbackActionId, Kt as resolveSlackAllowListMatch, Ot as escapeSlackMrkdwn, Q as decodeSlackQuestionAction, R as truncateSlackText, Ut as allowListMatches, Vt as isSlackPluginApprovalAuthorizedSender, Wt as normalizeSlackAllowOwnerEntry, X as isSlackQuestionActionId, Zt as registerSlackInstallationState, b as resolveSlackAgentRoute, c as slackIngressIdentity, ct as buildSlackCompleteBlocksFallbackText, et as resolveSlackQuestionAction, g as formatSlackError, i as setSlackSessionStatus, kt as isSlackAnyNativeApprovalClientEnabled, l as buildSlackChannelIdCandidates, m as setSlackChannelPolicyBindings, nt as decodeSlackApprovalAction, o as createSlackIngressSubject, q as isSlackApprovalActionId, qt as resolveSlackUserAllowListForTeam, r as renameSlackSession, v as qualifySlackConversationId, wt as SLACK_TEXT_LIMIT, x as normalizeSlackRouteBindingConfig, y as qualifySlackRoutePeerId } from "./probe-BHqvMbno.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-BNOabmV6.mjs";
|
|
8
|
+
import { f as requireSlackPostMessageTimestamp, p as buildSlackMessageIdentityPayload, r as setSlackDefaultSendIdentity } from "./send-kGJWQtLk.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-klXrk5vE.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-Bx2u_5-z.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";
|
|
@@ -21,13 +21,13 @@ import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel
|
|
|
21
21
|
import { createLazyRuntimeModule, createLazyRuntimeSurface } from "openclaw/plugin-sdk/lazy-runtime";
|
|
22
22
|
import { computeBackoff, createNonExitingRuntime, createSubsystemLogger, danger, getChildLogger, logVerbose, shouldLogVerbose, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
23
23
|
import { chunkItems } from "openclaw/plugin-sdk/text-chunking";
|
|
24
|
-
import { truncateUtf16Safe, withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
25
24
|
import { CHANNEL_APPROVAL_NATIVE_RUNTIME_CONTEXT_CAPABILITY } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
|
|
26
25
|
import { normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
27
26
|
import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary, formatAllowlistMatchMeta, mergeAllowlist, patchAllowlistUsersInConfigEntries, summarizeMapping } from "openclaw/plugin-sdk/allow-from";
|
|
28
27
|
import { createStaleWhileRevalidateCache, pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
29
28
|
import { parseStrictFiniteNumber, resolvePromptHistoryLimit, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
30
29
|
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
30
|
+
import { truncateUtf16Safe, withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
31
31
|
import { WebAPIHTTPError, WebAPIPlatformError, WebAPIRateLimitedError, WebAPIRequestError, WebClient } from "@slack/web-api";
|
|
32
32
|
import { classifyTransientNetworkErrorCode } from "openclaw/plugin-sdk/retry-runtime";
|
|
33
33
|
import { resolveRuntimeConversationBindingRouteAsync } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
@@ -54,6 +54,7 @@ import { buildCommandTextFromArgs, findCommandByNativeName, formatCommandArgMenu
|
|
|
54
54
|
import { createChannelInteractiveDispatcher } from "openclaw/plugin-sdk/plugin-runtime";
|
|
55
55
|
import { reportChannelRoomJoin } from "openclaw/plugin-sdk/channel-join-intro-runtime";
|
|
56
56
|
import { captureSessionEntryCurrentCheckAsync } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
57
|
+
import { loadCommandArgMenuModelCatalog } from "openclaw/plugin-sdk/command-surface";
|
|
57
58
|
import { mergeNativeCommandSpecs } from "openclaw/plugin-sdk/native-command-registry";
|
|
58
59
|
import { generateSecureToken } from "openclaw/plugin-sdk/secure-random-runtime";
|
|
59
60
|
import { resolveDefaultModelForAgent } from "openclaw/plugin-sdk/agent-runtime";
|
|
@@ -62,7 +63,7 @@ import { beginWebhookRequestPipelineOrReject, createWebhookInFlightLimiter, read
|
|
|
62
63
|
import { registerPluginHttpRoute } from "openclaw/plugin-sdk/webhook-targets";
|
|
63
64
|
import { createChannelInboundDebouncer, resolveInboundDebounceMs, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
|
|
64
65
|
import { createChannelReplayGuard, runClaimableDedupeClaimLoop } from "openclaw/plugin-sdk/persistent-dedupe";
|
|
65
|
-
|
|
66
|
+
// extensions/slack/src/monitor/commands.ts
|
|
66
67
|
/**
|
|
67
68
|
* Strip Slack mentions (<@U123>, <@U123|name>) so command detection works on
|
|
68
69
|
* normalized text. Use in both prepare and debounce gate for consistency.
|
|
@@ -87,8 +88,7 @@ function buildSlackSlashCommandMatcher(name) {
|
|
|
87
88
|
const escaped = normalizeSlackSlashCommandName(name).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
88
89
|
return new RegExp(`^/?${escaped}$`);
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
-
//#region extensions/slack/src/monitor/approval-runtime-context.ts
|
|
91
|
+
// extensions/slack/src/monitor/approval-runtime-context.ts
|
|
92
92
|
function registerSlackApprovalRuntimeContext(params) {
|
|
93
93
|
const approvalContext = {
|
|
94
94
|
app: params.app,
|
|
@@ -106,8 +106,7 @@ function registerSlackApprovalRuntimeContext(params) {
|
|
|
106
106
|
abortSignal: params.abortSignal
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
//#region extensions/slack/src/monitor/assistant-thread-context.ts
|
|
109
|
+
// extensions/slack/src/monitor/assistant-thread-context.ts
|
|
111
110
|
const SLACK_ASSISTANT_THREAD_CONTEXT_METADATA_EVENT = "assistant_thread_context";
|
|
112
111
|
const SLACK_ASSISTANT_CONTEXT_TTL_MS = 864e5;
|
|
113
112
|
const SLACK_ASSISTANT_CONTEXT_CLEANUP_INTERVAL_MS = 6e5;
|
|
@@ -183,8 +182,7 @@ function buildContextKey(accountId, channelId, threadTs, eventScope) {
|
|
|
183
182
|
const key = `${channelId}:${threadTs}`;
|
|
184
183
|
return eventScope ? `${accountId}:${eventScope.teamId}:${key}` : key;
|
|
185
184
|
}
|
|
186
|
-
|
|
187
|
-
//#region extensions/slack/src/monitor/channel-type.ts
|
|
185
|
+
// extensions/slack/src/monitor/channel-type.ts
|
|
188
186
|
function inferSlackChannelType(channelId) {
|
|
189
187
|
const trimmed = channelId?.trim();
|
|
190
188
|
if (!trimmed) return;
|
|
@@ -207,8 +205,7 @@ function resolveSlackChatType(channelType) {
|
|
|
207
205
|
if (channelType === "mpim") return "group";
|
|
208
206
|
return "channel";
|
|
209
207
|
}
|
|
210
|
-
|
|
211
|
-
//#region extensions/slack/src/monitor/enterprise-install.ts
|
|
208
|
+
// extensions/slack/src/monitor/enterprise-install.ts
|
|
212
209
|
const SLACK_CHANNEL_ID_RE = /^[CDG][A-Z0-9]{8,}$/;
|
|
213
210
|
const SLACK_USER_ID_RE = /^[BUW][A-Z0-9]{8,}$/;
|
|
214
211
|
function isWorkspaceScopedSlackChannelEntry(value, options) {
|
|
@@ -358,8 +355,7 @@ function resolveSlackIdentityHealth(params) {
|
|
|
358
355
|
lastError: null
|
|
359
356
|
};
|
|
360
357
|
}
|
|
361
|
-
|
|
362
|
-
//#region extensions/slack/src/monitor/reconnect-policy.ts
|
|
358
|
+
// extensions/slack/src/monitor/reconnect-policy.ts
|
|
363
359
|
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
360
|
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
361
|
/** Consecutive isolated invalid_auth failures before the channel turns terminal. */
|
|
@@ -461,8 +457,7 @@ function isIsolatedInvalidAuthSlackError(error) {
|
|
|
461
457
|
const text = formatSlackError(error, "");
|
|
462
458
|
return /invalid_auth/i.test(text) && !SLACK_DEFINITIVE_AUTH_ERROR_RE.test(text);
|
|
463
459
|
}
|
|
464
|
-
|
|
465
|
-
//#region extensions/slack/src/monitor/provider-support.ts
|
|
460
|
+
// extensions/slack/src/monitor/provider-support.ts
|
|
466
461
|
const OPENCLAW_SLACK_CLIENT_PING_TIMEOUT_MS = 15e3;
|
|
467
462
|
const OPENCLAW_SLACK_SOCKET_START_FAILED_EVENT = "unable_to_socket_mode_start";
|
|
468
463
|
const SLACK_SOCKET_PONG_TIMEOUT_WARNING_PREFIX = "A pong wasn't received from the server";
|
|
@@ -772,8 +767,7 @@ function formatSlackUserResolved(entry) {
|
|
|
772
767
|
extra: entry.note ? [entry.note] : []
|
|
773
768
|
});
|
|
774
769
|
}
|
|
775
|
-
|
|
776
|
-
//#region extensions/slack/src/monitor/system-event-session.ts
|
|
770
|
+
// extensions/slack/src/monitor/system-event-session.ts
|
|
777
771
|
function createSlackSystemEventRouteResolver(params) {
|
|
778
772
|
return async (event) => {
|
|
779
773
|
const channelId = normalizeOptionalString(event.channelId) ?? "";
|
|
@@ -836,8 +830,7 @@ function createSlackSystemEventRouteResolver(params) {
|
|
|
836
830
|
};
|
|
837
831
|
};
|
|
838
832
|
}
|
|
839
|
-
|
|
840
|
-
//#region extensions/slack/src/monitor/runtime-policy.ts
|
|
833
|
+
// extensions/slack/src/monitor/runtime-policy.ts
|
|
841
834
|
function resolveSlackMonitorPolicy(cfg, accountId, runtime) {
|
|
842
835
|
const slack = mergeSlackAccountConfig(cfg, accountId);
|
|
843
836
|
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy({
|
|
@@ -1009,8 +1002,7 @@ async function resolveWorkspacePolicy(ctx, resolveToken) {
|
|
|
1009
1002
|
summarizeMapping("slack users", mapping, unresolved, runtime);
|
|
1010
1003
|
ctx.channelsConfigKeys = Object.keys(ctx.channelsConfig ?? {});
|
|
1011
1004
|
}
|
|
1012
|
-
|
|
1013
|
-
//#region extensions/slack/src/monitor/transient-api-error.ts
|
|
1005
|
+
// extensions/slack/src/monitor/transient-api-error.ts
|
|
1014
1006
|
function isTransientSlackApiError(error) {
|
|
1015
1007
|
if (error instanceof WebAPIRateLimitedError) return true;
|
|
1016
1008
|
if (error instanceof WebAPIHTTPError) return error.statusCode === 408 || error.statusCode === 429 || error.statusCode >= 500 && error.statusCode < 600;
|
|
@@ -1024,8 +1016,7 @@ function isTransientSlackApiError(error) {
|
|
|
1024
1016
|
current.original
|
|
1025
1017
|
]).some((candidate) => classifyTransientNetworkErrorCode(extractErrorCode(candidate)) || readErrorName(candidate) === "TimeoutError");
|
|
1026
1018
|
}
|
|
1027
|
-
|
|
1028
|
-
//#region extensions/slack/src/monitor/suggested-prompts.ts
|
|
1019
|
+
// extensions/slack/src/monitor/suggested-prompts.ts
|
|
1029
1020
|
async function updateSlackSuggestedPrompts(params) {
|
|
1030
1021
|
const prompts = params.prompts.map(({ title, message }) => ({
|
|
1031
1022
|
title: title.trim(),
|
|
@@ -1052,8 +1043,7 @@ async function updateSlackSuggestedPrompts(params) {
|
|
|
1052
1043
|
return outcome;
|
|
1053
1044
|
}
|
|
1054
1045
|
}
|
|
1055
|
-
|
|
1056
|
-
//#region extensions/slack/src/monitor/context.ts
|
|
1046
|
+
// extensions/slack/src/monitor/context.ts
|
|
1057
1047
|
const SLACK_AGENT_VIEW_STATE_NAMESPACE = "agent-view-workspaces";
|
|
1058
1048
|
const SLACK_AGENT_VIEW_THREAD_STATE_NAMESPACE = "agent-view-threads";
|
|
1059
1049
|
const SLACK_AGENT_VIEW_STATE_MAX_ENTRIES = 4096;
|
|
@@ -1472,8 +1462,7 @@ function createSlackMonitorContext(params) {
|
|
|
1472
1462
|
ctx.readRuntimeContext = createSlackRuntimeContextReader(ctx, lookupToken ?? params.botToken);
|
|
1473
1463
|
return ctx;
|
|
1474
1464
|
}
|
|
1475
|
-
|
|
1476
|
-
//#region extensions/slack/src/streaming.ts
|
|
1465
|
+
// extensions/slack/src/streaming.ts
|
|
1477
1466
|
/**
|
|
1478
1467
|
* Thrown when Slack definitively rejects a stream flush/finalize while text
|
|
1479
1468
|
* remains buffered locally by the Slack SDK. Carries the pending text so the
|
|
@@ -1650,8 +1639,7 @@ function markSlackStreamFallbackDelivered(session) {
|
|
|
1650
1639
|
if (session.stopped) releaseSlackStream(session);
|
|
1651
1640
|
else stateBySession.get(session)?.sessions.add(session);
|
|
1652
1641
|
}
|
|
1653
|
-
|
|
1654
|
-
//#region extensions/slack/src/monitor/auth.ts
|
|
1642
|
+
// extensions/slack/src/monitor/auth.ts
|
|
1655
1643
|
const slackChannelMembersCache = /* @__PURE__ */ new WeakMap();
|
|
1656
1644
|
const CHANNEL_MEMBERS_CACHE_TTL_MS = 6e4;
|
|
1657
1645
|
const CHANNEL_MEMBERS_CACHE_MAX = 512;
|
|
@@ -1960,8 +1948,7 @@ async function authorizeSlackSystemEventSender(params) {
|
|
|
1960
1948
|
channelName
|
|
1961
1949
|
};
|
|
1962
1950
|
}
|
|
1963
|
-
|
|
1964
|
-
//#region extensions/slack/src/monitor/event-scope.ts
|
|
1951
|
+
// extensions/slack/src/monitor/event-scope.ts
|
|
1965
1952
|
function resolveSlackMonitorEventScope(params) {
|
|
1966
1953
|
const identity = params.ctx.installationIdentity;
|
|
1967
1954
|
const clientOptions = params.ctx.app.webClientOptions;
|
|
@@ -2008,8 +1995,7 @@ function resolveSlackInteractionEventScope(ctx, args, kind) {
|
|
|
2008
1995
|
}
|
|
2009
1996
|
return eventScope;
|
|
2010
1997
|
}
|
|
2011
|
-
|
|
2012
|
-
//#region extensions/slack/src/types.ts
|
|
1998
|
+
// extensions/slack/src/types.ts
|
|
2013
1999
|
function parseSlackMessageEvent(value) {
|
|
2014
2000
|
const record = asOptionalRecord(value);
|
|
2015
2001
|
return record?.type === "message" && typeof record.channel === "string" ? {
|
|
@@ -2023,8 +2009,7 @@ function requireSlackMessageEvent(value) {
|
|
|
2023
2009
|
if (!event) throw new TypeError("Invalid persisted Slack message event");
|
|
2024
2010
|
return event;
|
|
2025
2011
|
}
|
|
2026
|
-
|
|
2027
|
-
//#region extensions/slack/src/monitor/ingress.ts
|
|
2012
|
+
// extensions/slack/src/monitor/ingress.ts
|
|
2028
2013
|
const SLACK_INGRESS_PAYLOAD_VERSION = 1;
|
|
2029
2014
|
const SLACK_INGRESS_POLL_INTERVAL_MS = 1e3;
|
|
2030
2015
|
const SLACK_BOLT_AUTHORIZATION_ERROR = "slack_bolt_authorization_error";
|
|
@@ -2182,6 +2167,13 @@ function createSlackDurableIngress(options) {
|
|
|
2182
2167
|
releaseChannel?.();
|
|
2183
2168
|
lifecycle.abortSignal.removeEventListener("abort", settleTurn);
|
|
2184
2169
|
};
|
|
2170
|
+
const settleRoutedTurn = async (settle) => {
|
|
2171
|
+
try {
|
|
2172
|
+
await settle();
|
|
2173
|
+
} finally {
|
|
2174
|
+
settleTurn();
|
|
2175
|
+
}
|
|
2176
|
+
};
|
|
2185
2177
|
const retainChannelTurn = () => {
|
|
2186
2178
|
if (releaseChannel) return;
|
|
2187
2179
|
const channelTurn = createDeferred();
|
|
@@ -2228,25 +2220,14 @@ function createSlackDurableIngress(options) {
|
|
|
2228
2220
|
await previousTurn;
|
|
2229
2221
|
lifecycle.abortSignal.throwIfAborted();
|
|
2230
2222
|
},
|
|
2231
|
-
onAdopted:
|
|
2232
|
-
try {
|
|
2233
|
-
await lifecycle.onAdopted();
|
|
2234
|
-
} finally {
|
|
2235
|
-
settleTurn();
|
|
2236
|
-
}
|
|
2237
|
-
},
|
|
2223
|
+
onAdopted: () => settleRoutedTurn(() => lifecycle.onAdopted()),
|
|
2238
2224
|
onDeferred: () => {
|
|
2239
2225
|
lifecycle.onDeferred();
|
|
2240
2226
|
settleSession();
|
|
2241
2227
|
monitor.requestDrain();
|
|
2242
2228
|
},
|
|
2243
|
-
onAbandoned:
|
|
2244
|
-
|
|
2245
|
-
await lifecycle.onAbandoned();
|
|
2246
|
-
} finally {
|
|
2247
|
-
settleTurn();
|
|
2248
|
-
}
|
|
2249
|
-
}
|
|
2229
|
+
onAbandoned: () => settleRoutedTurn(() => lifecycle.onAbandoned()),
|
|
2230
|
+
onDropped: (reason) => settleRoutedTurn(() => lifecycle.onDropped ? lifecycle.onDropped(reason) : lifecycle.onAbandoned())
|
|
2250
2231
|
};
|
|
2251
2232
|
try {
|
|
2252
2233
|
const event = raw.kind === "events-api" ? asOptionalRecord(raw.body)?.event : void 0;
|
|
@@ -2301,14 +2282,15 @@ function createSlackDurableIngress(options) {
|
|
|
2301
2282
|
});
|
|
2302
2283
|
const acceptReceiverEvent = async (event) => {
|
|
2303
2284
|
if (!isSlackEventCallback(event.body)) {
|
|
2304
|
-
|
|
2305
|
-
|
|
2285
|
+
const receiverApp = app;
|
|
2286
|
+
if (!receiverApp) throw new Error("Slack ingress receiver is not attached to a Bolt app.");
|
|
2287
|
+
await monitor.dispatchDirect(() => receiverApp.processEvent({
|
|
2306
2288
|
...event,
|
|
2307
2289
|
customProperties: {
|
|
2308
2290
|
...event.customProperties,
|
|
2309
2291
|
[SLACK_NATIVE_INGRESS_CONTEXT_KEY]: nativeIngress
|
|
2310
2292
|
}
|
|
2311
|
-
});
|
|
2293
|
+
}));
|
|
2312
2294
|
return;
|
|
2313
2295
|
}
|
|
2314
2296
|
await monitor.admit({
|
|
@@ -2344,8 +2326,7 @@ function createSlackDurableIngress(options) {
|
|
|
2344
2326
|
waitForIdle: monitor.waitForIdle
|
|
2345
2327
|
};
|
|
2346
2328
|
}
|
|
2347
|
-
|
|
2348
|
-
//#region extensions/slack/src/monitor/events/assistant.ts
|
|
2329
|
+
// extensions/slack/src/monitor/events/assistant.ts
|
|
2349
2330
|
function registerSlackAssistantEvents(params) {
|
|
2350
2331
|
const { ctx, trackEvent } = params;
|
|
2351
2332
|
for (const eventName of ["assistant_thread_started", "assistant_thread_context_changed"]) ctx.app.event(eventName, async ({ event, body, context }) => {
|
|
@@ -2404,8 +2385,7 @@ function registerSlackAssistantEvents(params) {
|
|
|
2404
2385
|
}
|
|
2405
2386
|
});
|
|
2406
2387
|
}
|
|
2407
|
-
|
|
2408
|
-
//#region extensions/slack/src/channel-migration.ts
|
|
2388
|
+
// extensions/slack/src/channel-migration.ts
|
|
2409
2389
|
function migrateSlackChannelConfig(params) {
|
|
2410
2390
|
let migrated = false;
|
|
2411
2391
|
let skippedExisting = false;
|
|
@@ -2427,8 +2407,7 @@ function migrateSlackChannelConfig(params) {
|
|
|
2427
2407
|
skippedExisting
|
|
2428
2408
|
};
|
|
2429
2409
|
}
|
|
2430
|
-
|
|
2431
|
-
//#region extensions/slack/src/monitor/events/channels.ts
|
|
2410
|
+
// extensions/slack/src/monitor/events/channels.ts
|
|
2432
2411
|
function registerSlackChannelEvents(params) {
|
|
2433
2412
|
const { ctx, trackEvent } = params;
|
|
2434
2413
|
for (const [eventName, kind] of [["channel_created", "created"], ["channel_rename", "renamed"]]) ctx.app.event(eventName, async (args) => {
|
|
@@ -2515,8 +2494,7 @@ function registerSlackChannelIdChangedEvent(params) {
|
|
|
2515
2494
|
}
|
|
2516
2495
|
});
|
|
2517
2496
|
}
|
|
2518
|
-
|
|
2519
|
-
//#region extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2497
|
+
// extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2520
2498
|
function resolveSlackDeferredActionTarget(params) {
|
|
2521
2499
|
if (!params.id) throw new Error("Slack deferred action is missing a target ID");
|
|
2522
2500
|
if (!params.eventScope) return {
|
|
@@ -2529,8 +2507,7 @@ function resolveSlackDeferredActionTarget(params) {
|
|
|
2529
2507
|
target
|
|
2530
2508
|
};
|
|
2531
2509
|
}
|
|
2532
|
-
|
|
2533
|
-
//#region extensions/slack/src/monitor/events/interaction-event.ts
|
|
2510
|
+
// extensions/slack/src/monitor/events/interaction-event.ts
|
|
2534
2511
|
const SLACK_INTERACTION_EVENT_PREFIX = "Slack interaction: ";
|
|
2535
2512
|
const REDACTED_INTERACTION_VALUE = "[redacted]";
|
|
2536
2513
|
const SLACK_INTERACTION_EVENT_MAX_CHARS = 2400;
|
|
@@ -2669,8 +2646,7 @@ async function enqueueSlackInteractionEvent(payload, route, options, log) {
|
|
|
2669
2646
|
return false;
|
|
2670
2647
|
}
|
|
2671
2648
|
}
|
|
2672
|
-
|
|
2673
|
-
//#region extensions/slack/src/interactive-dispatch.ts
|
|
2649
|
+
// extensions/slack/src/interactive-dispatch.ts
|
|
2674
2650
|
const dispatchSlackInteractive = createChannelInteractiveDispatcher({
|
|
2675
2651
|
channel: "slack",
|
|
2676
2652
|
interactiveKey: "interaction"
|
|
@@ -2695,8 +2671,7 @@ async function dispatchSlackPluginInteractiveHandler(params) {
|
|
|
2695
2671
|
}
|
|
2696
2672
|
});
|
|
2697
2673
|
}
|
|
2698
|
-
|
|
2699
|
-
//#region extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
2674
|
+
// extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
2700
2675
|
function resolveSlackPluginApprovalSender(params) {
|
|
2701
2676
|
const senderId = formatSlackTarget({
|
|
2702
2677
|
kind: "user",
|
|
@@ -2712,8 +2687,7 @@ function resolveSlackPluginApprovalSender(params) {
|
|
|
2712
2687
|
})
|
|
2713
2688
|
};
|
|
2714
2689
|
}
|
|
2715
|
-
|
|
2716
|
-
//#region extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
2690
|
+
// extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
2717
2691
|
function readOptionValues(options, read) {
|
|
2718
2692
|
if (!Array.isArray(options)) return [];
|
|
2719
2693
|
return options.map((option) => option && typeof option === "object" ? read(option) : void 0);
|
|
@@ -2805,8 +2779,7 @@ function formatInteractionSelectionLabel(params) {
|
|
|
2805
2779
|
if (params.summary.richTextPreview) return params.summary.richTextPreview;
|
|
2806
2780
|
return normalizeOptionalString(params.summary.value) ?? params.actionId;
|
|
2807
2781
|
}
|
|
2808
|
-
|
|
2809
|
-
//#region extensions/slack/src/monitor/events/interactions.block-actions.context.ts
|
|
2782
|
+
// extensions/slack/src/monitor/events/interactions.block-actions.context.ts
|
|
2810
2783
|
function resolveSlackActionValue(summary) {
|
|
2811
2784
|
return normalizeOptionalString(summary.value) ?? summary.selectedValues?.[0];
|
|
2812
2785
|
}
|
|
@@ -2857,8 +2830,7 @@ function parseSlackBlockAction(params) {
|
|
|
2857
2830
|
actionSummary: summarizeAction(typedAction)
|
|
2858
2831
|
};
|
|
2859
2832
|
}
|
|
2860
|
-
|
|
2861
|
-
//#region extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
2833
|
+
// extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
2862
2834
|
async function respondEphemeral(respond, text) {
|
|
2863
2835
|
if (!respond) return;
|
|
2864
2836
|
try {
|
|
@@ -2963,7 +2935,7 @@ async function handleSlackApprovalInteraction(params) {
|
|
|
2963
2935
|
channelId,
|
|
2964
2936
|
messageTs
|
|
2965
2937
|
}, async () => {
|
|
2966
|
-
const { readSlackMessages } = await import("./actions-
|
|
2938
|
+
const { readSlackMessages } = await import("./actions-BNOabmV6.mjs").then((n) => n.t);
|
|
2967
2939
|
const { messages } = await readSlackMessages(channelId, {
|
|
2968
2940
|
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
2969
2941
|
messageId: messageTs,
|
|
@@ -3296,8 +3268,7 @@ function registerSlackBlockActionHandler(params) {
|
|
|
3296
3268
|
}, runtimeContext.runtime.log) && runtimeContext.isRuntimePolicyCurrent()) await updateSlackLegacyBlockAction(actionContext);
|
|
3297
3269
|
});
|
|
3298
3270
|
}
|
|
3299
|
-
|
|
3300
|
-
//#region extensions/slack/src/modal-metadata.ts
|
|
3271
|
+
// extensions/slack/src/modal-metadata.ts
|
|
3301
3272
|
function parseSlackModalPrivateMetadata(raw) {
|
|
3302
3273
|
if (typeof raw !== "string" || raw.trim().length === 0) return {};
|
|
3303
3274
|
try {
|
|
@@ -3313,8 +3284,7 @@ function parseSlackModalPrivateMetadata(raw) {
|
|
|
3313
3284
|
return {};
|
|
3314
3285
|
}
|
|
3315
3286
|
}
|
|
3316
|
-
|
|
3317
|
-
//#region extensions/slack/src/monitor/events/interactions.modal.ts
|
|
3287
|
+
// extensions/slack/src/monitor/events/interactions.modal.ts
|
|
3318
3288
|
const OPENCLAW_MODAL_CALLBACK_PREFIX = "openclaw:";
|
|
3319
3289
|
function resolveSlackPluginSystemEventPayload(result) {
|
|
3320
3290
|
const systemEvent = result?.systemEvent;
|
|
@@ -3511,8 +3481,7 @@ function registerModalLifecycleHandler(params) {
|
|
|
3511
3481
|
}, runtimeCtx.runtime.log);
|
|
3512
3482
|
});
|
|
3513
3483
|
}
|
|
3514
|
-
|
|
3515
|
-
//#region extensions/slack/src/monitor/events/interactions.ts
|
|
3484
|
+
// extensions/slack/src/monitor/events/interactions.ts
|
|
3516
3485
|
function registerSlackInteractionEvents(params) {
|
|
3517
3486
|
const { ctx, trackEvent } = params;
|
|
3518
3487
|
registerSlackBlockActionHandler(params);
|
|
@@ -3608,8 +3577,7 @@ function registerSlackInteractionEvents(params) {
|
|
|
3608
3577
|
interactionType
|
|
3609
3578
|
});
|
|
3610
3579
|
}
|
|
3611
|
-
|
|
3612
|
-
//#region extensions/slack/src/monitor/events/system-event-context.ts
|
|
3580
|
+
// extensions/slack/src/monitor/events/system-event-context.ts
|
|
3613
3581
|
async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
3614
3582
|
const { senderId, channelId, channelType, eventKind } = params;
|
|
3615
3583
|
const ctx = await params.ctx.readRuntimeContext();
|
|
@@ -3639,8 +3607,7 @@ async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
|
3639
3607
|
})
|
|
3640
3608
|
};
|
|
3641
3609
|
}
|
|
3642
|
-
|
|
3643
|
-
//#region extensions/slack/src/monitor/events/members.ts
|
|
3610
|
+
// extensions/slack/src/monitor/events/members.ts
|
|
3644
3611
|
function registerSlackMemberEvents(params) {
|
|
3645
3612
|
const { ctx, trackEvent } = params;
|
|
3646
3613
|
for (const verb of ["joined", "left"]) ctx.app.event(`member_${verb}_channel`, async (args) => {
|
|
@@ -3731,8 +3698,7 @@ function registerSlackMemberEvents(params) {
|
|
|
3731
3698
|
}
|
|
3732
3699
|
});
|
|
3733
3700
|
}
|
|
3734
|
-
|
|
3735
|
-
//#region extensions/slack/src/draft-message-boundaries.ts
|
|
3701
|
+
// extensions/slack/src/draft-message-boundaries.ts
|
|
3736
3702
|
const activeDraftsByConversation = /* @__PURE__ */ new Map();
|
|
3737
3703
|
function conversationKey(conversation) {
|
|
3738
3704
|
return [
|
|
@@ -3783,8 +3749,7 @@ function noteSlackDraftConversationMessage(conversation) {
|
|
|
3783
3749
|
if (isLaterSlackMessage(conversation.messageTs, draft.messageTs)) draft.onInterveningMessage();
|
|
3784
3750
|
}
|
|
3785
3751
|
}
|
|
3786
|
-
|
|
3787
|
-
//#region extensions/slack/src/threading.ts
|
|
3752
|
+
// extensions/slack/src/threading.ts
|
|
3788
3753
|
function resolveSlackThreadContext(params) {
|
|
3789
3754
|
const incomingThreadTs = params.message.thread_ts;
|
|
3790
3755
|
const eventTs = params.message.event_ts;
|
|
@@ -3801,8 +3766,7 @@ function resolveSlackThreadContext(params) {
|
|
|
3801
3766
|
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
3802
3767
|
};
|
|
3803
3768
|
}
|
|
3804
|
-
|
|
3805
|
-
//#region extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
3769
|
+
// extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
3806
3770
|
function resolveSlackMessageSubtypeHandler(event) {
|
|
3807
3771
|
const subtype = event.subtype;
|
|
3808
3772
|
if (subtype !== "message_changed" && subtype !== "message_deleted") return;
|
|
@@ -3826,8 +3790,7 @@ function resolveSlackMessageSubtypeHandler(event) {
|
|
|
3826
3790
|
}).replyToId : void 0
|
|
3827
3791
|
};
|
|
3828
3792
|
}
|
|
3829
|
-
|
|
3830
|
-
//#region extensions/slack/src/monitor/events/messages.ts
|
|
3793
|
+
// extensions/slack/src/monitor/events/messages.ts
|
|
3831
3794
|
const slackInboundLog = createSubsystemLogger("gateway/channels/slack").child("inbound");
|
|
3832
3795
|
function isBotAuthoredEnterpriseEvent(event) {
|
|
3833
3796
|
return Boolean(normalizeOptionalString(event.bot_id)) || event.subtype === "bot_message";
|
|
@@ -3987,8 +3950,7 @@ function registerSlackMessageEvents(params) {
|
|
|
3987
3950
|
}
|
|
3988
3951
|
});
|
|
3989
3952
|
}
|
|
3990
|
-
|
|
3991
|
-
//#region extensions/slack/src/monitor/session-run-targets.ts
|
|
3953
|
+
// extensions/slack/src/monitor/session-run-targets.ts
|
|
3992
3954
|
async function captureSlackSessionTargetGuard(ctx, route, isActive) {
|
|
3993
3955
|
return captureSessionEntryCurrentCheckAsync({
|
|
3994
3956
|
agentId: route.agentId,
|
|
@@ -4030,8 +3992,7 @@ function getSlackSessionRuns(ctx, address) {
|
|
|
4030
3992
|
isActive: () => targets.some((candidate) => candidate.route.sessionKey === target.route.sessionKey && candidate.isActive())
|
|
4031
3993
|
}));
|
|
4032
3994
|
}
|
|
4033
|
-
|
|
4034
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
3995
|
+
// extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
4035
3996
|
async function resolveSlackRoutingContext(params) {
|
|
4036
3997
|
const { ctx, account, message, chatType, channelConfig, seedTopLevelRoomThread, assistantThreadTs, agentViewThreadTs, eventScope } = params;
|
|
4037
3998
|
const isDirectMessage = chatType === "direct";
|
|
@@ -4208,8 +4169,7 @@ async function resolveSlackSessionEventRoutingContext(params) {
|
|
|
4208
4169
|
release: current.release
|
|
4209
4170
|
};
|
|
4210
4171
|
}
|
|
4211
|
-
|
|
4212
|
-
//#region extensions/slack/src/monitor/dm-auth.ts
|
|
4172
|
+
// extensions/slack/src/monitor/dm-auth.ts
|
|
4213
4173
|
async function authorizeSlackDirectMessage(params) {
|
|
4214
4174
|
if (!params.ctx.dmEnabled || params.ctx.dmPolicy === "disabled") {
|
|
4215
4175
|
await params.onDisabled();
|
|
@@ -4265,8 +4225,7 @@ async function authorizeSlackDirectMessage(params) {
|
|
|
4265
4225
|
});
|
|
4266
4226
|
return false;
|
|
4267
4227
|
}
|
|
4268
|
-
|
|
4269
|
-
//#region extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
4228
|
+
// extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
4270
4229
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
4271
4230
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(24)}}$`);
|
|
4272
4231
|
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 6e5;
|
|
@@ -4302,8 +4261,7 @@ function createSlackExternalArgMenuStore() {
|
|
|
4302
4261
|
}
|
|
4303
4262
|
};
|
|
4304
4263
|
}
|
|
4305
|
-
|
|
4306
|
-
//#region extensions/slack/src/monitor/response-url-budget.ts
|
|
4264
|
+
// extensions/slack/src/monitor/response-url-budget.ts
|
|
4307
4265
|
const SLACK_RESPONSE_URL_MAX_CALLS = 5;
|
|
4308
4266
|
var SlackResponseAlreadyReportedError = class extends Error {};
|
|
4309
4267
|
/** Count every response_url attempt, including requests Slack rejects. */
|
|
@@ -4318,8 +4276,7 @@ function createSlackResponseUrlBudget(respond) {
|
|
|
4318
4276
|
}
|
|
4319
4277
|
};
|
|
4320
4278
|
}
|
|
4321
|
-
|
|
4322
|
-
//#region extensions/slack/src/monitor/room-context.ts
|
|
4279
|
+
// extensions/slack/src/monitor/room-context.ts
|
|
4323
4280
|
function resolveSlackRoomContextHints(params) {
|
|
4324
4281
|
return {
|
|
4325
4282
|
channelMetadata: params.isRoomish ? buildChannelMetadata({
|
|
@@ -4330,8 +4287,7 @@ function resolveSlackRoomContextHints(params) {
|
|
|
4330
4287
|
groupSystemPrompt: params.isRoomish ? normalizeOptionalString(params.channelConfig?.systemPrompt) : void 0
|
|
4331
4288
|
};
|
|
4332
4289
|
}
|
|
4333
|
-
|
|
4334
|
-
//#region extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
4290
|
+
// extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
4335
4291
|
async function resolveSlackCommandMenuModelContext(params) {
|
|
4336
4292
|
if (!params.sessionKey.trim()) return {};
|
|
4337
4293
|
try {
|
|
@@ -4380,8 +4336,7 @@ async function resolveSlackCommandMenuModelContext(params) {
|
|
|
4380
4336
|
return {};
|
|
4381
4337
|
}
|
|
4382
4338
|
}
|
|
4383
|
-
|
|
4384
|
-
//#region extensions/slack/src/monitor/slash.ts
|
|
4339
|
+
// extensions/slack/src/monitor/slash.ts
|
|
4385
4340
|
const SLACK_COMMAND_ARG_ACTION_ID = "openclaw_cmdarg";
|
|
4386
4341
|
const SLACK_COMMAND_ARG_ACTION_LISTENER = /^openclaw_cmdarg/;
|
|
4387
4342
|
const SLACK_COMMAND_ARG_VALUE_PREFIX = "cmdarg";
|
|
@@ -4396,7 +4351,7 @@ const SLACK_COMMAND_ARG_BUTTON_VALUE_MAX = 2e3;
|
|
|
4396
4351
|
const SLACK_COMMAND_ARG_CONFIRM_TEXT_MAX = 300;
|
|
4397
4352
|
const SLACK_HEADER_TEXT_MAX = 150;
|
|
4398
4353
|
const SLACK_COMMAND_ARG_ACTION_BLOCKS_MAX = 47;
|
|
4399
|
-
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-
|
|
4354
|
+
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-B2oWiis5.mjs"));
|
|
4400
4355
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
4401
4356
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
4402
4357
|
function buildSlackArgMenuConfirm(params) {
|
|
@@ -4718,12 +4673,17 @@ function createSlackCommandHandler(params) {
|
|
|
4718
4673
|
agentId: menuRoute.agentId,
|
|
4719
4674
|
sessionKey: menuRoute.sessionKey
|
|
4720
4675
|
}) : {};
|
|
4676
|
+
const menuModelCatalog = commandDefinition.key === "think" && menuNeedsModelContext ? await loadCommandArgMenuModelCatalog({
|
|
4677
|
+
cfg,
|
|
4678
|
+
...menuRoute ? { agentId: menuRoute.agentId } : {}
|
|
4679
|
+
}) : void 0;
|
|
4721
4680
|
const menu = await resolveCommandArgMenuAsync({
|
|
4722
4681
|
command: commandDefinition,
|
|
4723
4682
|
args: commandArgs,
|
|
4724
4683
|
cfg,
|
|
4725
4684
|
session: menuRoute,
|
|
4726
|
-
...menuModelContext
|
|
4685
|
+
...menuModelContext,
|
|
4686
|
+
catalog: menuModelCatalog
|
|
4727
4687
|
});
|
|
4728
4688
|
if (menu) {
|
|
4729
4689
|
const route = menuRoute ?? await resolveSlashRoute();
|
|
@@ -5181,8 +5141,7 @@ async function deliverSlackSlashResponseWithWebApi(params) {
|
|
|
5181
5141
|
function isSlackBoltRespondError(error) {
|
|
5182
5142
|
return Boolean(error) && typeof error === "object" && error.code === "slack_bolt_respond_error";
|
|
5183
5143
|
}
|
|
5184
|
-
|
|
5185
|
-
//#region extensions/slack/src/monitor/events.ts
|
|
5144
|
+
// extensions/slack/src/monitor/events.ts
|
|
5186
5145
|
function buildSlackHomeView(slashCommandName) {
|
|
5187
5146
|
return {
|
|
5188
5147
|
type: "home",
|
|
@@ -5483,8 +5442,7 @@ function registerSlackWorkspaceEvents(params) {
|
|
|
5483
5442
|
trackEvent
|
|
5484
5443
|
});
|
|
5485
5444
|
}
|
|
5486
|
-
|
|
5487
|
-
//#region extensions/slack/src/monitor/http-handler.ts
|
|
5445
|
+
// extensions/slack/src/monitor/http-handler.ts
|
|
5488
5446
|
const SLACK_WEBHOOK_MAX_BODY_BYTES = 1048576;
|
|
5489
5447
|
const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
|
|
5490
5448
|
function registerSlackHttpHandler(params) {
|
|
@@ -5528,8 +5486,7 @@ function createSlackHttpRequestHandler(params) {
|
|
|
5528
5486
|
}
|
|
5529
5487
|
};
|
|
5530
5488
|
}
|
|
5531
|
-
|
|
5532
|
-
//#region extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5489
|
+
// extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5533
5490
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_TTL_MS = 864e5;
|
|
5534
5491
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_MEMORY_MAX_ENTRIES = 2e4;
|
|
5535
5492
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_STATE_MAX_ENTRIES = 2e4;
|
|
@@ -5582,8 +5539,7 @@ async function claimSlackMessageDispatchReplay(params) {
|
|
|
5582
5539
|
handle: claim.handle
|
|
5583
5540
|
} : { kind: "duplicate" };
|
|
5584
5541
|
}
|
|
5585
|
-
|
|
5586
|
-
//#region extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5542
|
+
// extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5587
5543
|
function resolveSlackSenderId(message) {
|
|
5588
5544
|
return message.user ?? message.bot_id ?? null;
|
|
5589
5545
|
}
|
|
@@ -5600,8 +5556,7 @@ function buildSlackDebounceKey(message, accountId, teamId) {
|
|
|
5600
5556
|
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
5557
|
return `slack:${accountId}:${teamId ? `${teamId}:` : ""}${threadKey}:${senderId}`;
|
|
5602
5558
|
}
|
|
5603
|
-
|
|
5604
|
-
//#region extensions/slack/src/monitor/thread-resolution.ts
|
|
5559
|
+
// extensions/slack/src/monitor/thread-resolution.ts
|
|
5605
5560
|
const DEFAULT_THREAD_TS_CACHE_TTL_MS = 6e4;
|
|
5606
5561
|
const DEFAULT_THREAD_TS_CACHE_MAX = 500;
|
|
5607
5562
|
const markAmbiguousThreadReply = (message) => ({
|
|
@@ -5651,9 +5606,8 @@ function createSlackThreadTsResolver(params) {
|
|
|
5651
5606
|
return markAmbiguousThreadReply(message);
|
|
5652
5607
|
} };
|
|
5653
5608
|
}
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-B-EtO-8F.mjs"));
|
|
5609
|
+
// extensions/slack/src/monitor/message-handler.ts
|
|
5610
|
+
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-ozrJpZ8k.mjs"));
|
|
5657
5611
|
const RETRYABLE_FLUSH_MAX_ATTEMPTS = 3;
|
|
5658
5612
|
function shouldDebounceSlackMessage(message, cfg) {
|
|
5659
5613
|
const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");
|
|
@@ -5825,7 +5779,16 @@ function createSlackMessageHandler(params) {
|
|
|
5825
5779
|
releaseClaims();
|
|
5826
5780
|
turnAdoptionLifecycle?.onAbandoned();
|
|
5827
5781
|
admissionLifecycle.onAbandoned();
|
|
5828
|
-
}
|
|
5782
|
+
},
|
|
5783
|
+
onDropped: turnAdoptionLifecycle?.onDropped ? async (reason) => {
|
|
5784
|
+
settlementHandedOff = true;
|
|
5785
|
+
const failure = (await Promise.allSettled([turnAdoptionLifecycle, admissionLifecycle].map(async (lifecycle) => lifecycle?.onDropped ? lifecycle.onDropped(reason) : lifecycle?.onAbandoned?.()))).find((result) => result.status === "rejected");
|
|
5786
|
+
if (failure?.status === "rejected") {
|
|
5787
|
+
releaseClaims(failure.reason);
|
|
5788
|
+
throw failure.reason;
|
|
5789
|
+
}
|
|
5790
|
+
await commitClaims();
|
|
5791
|
+
} : void 0
|
|
5829
5792
|
};
|
|
5830
5793
|
onPrepared?.(prepared);
|
|
5831
5794
|
if (surviving.length > 1 && sourceMessageIds.length > 0) {
|
|
@@ -5919,8 +5882,7 @@ function createSlackMessageHandler(params) {
|
|
|
5919
5882
|
await (await enqueueSlackMessage(message, opts))?.promise;
|
|
5920
5883
|
};
|
|
5921
5884
|
}
|
|
5922
|
-
|
|
5923
|
-
//#region extensions/slack/src/monitor/presence-monitor.ts
|
|
5885
|
+
// extensions/slack/src/monitor/presence-monitor.ts
|
|
5924
5886
|
const SLACK_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
5925
5887
|
const SLACK_PRESENCE_REQUEST_TIMEOUT_MS = 3e4;
|
|
5926
5888
|
const SLACK_PRESENCE_POLL_INTERVAL_MS = 6e4;
|
|
@@ -6154,8 +6116,7 @@ function createSlackPresenceMonitor(params) {
|
|
|
6154
6116
|
function presenceSubjectKey(subject) {
|
|
6155
6117
|
return `${subject.teamId ?? "workspace"}:${subject.userId}`;
|
|
6156
6118
|
}
|
|
6157
|
-
|
|
6158
|
-
//#region extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6119
|
+
// extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6159
6120
|
const SLACK_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
|
|
6160
6121
|
function openSlackPresenceCooldownStore() {
|
|
6161
6122
|
return getSlackRuntime().state.openKeyedStore({
|
|
@@ -6165,8 +6126,7 @@ function openSlackPresenceCooldownStore() {
|
|
|
6165
6126
|
defaultTtlMs: SLACK_PRESENCE_GREETING_COOLDOWN_MS
|
|
6166
6127
|
});
|
|
6167
6128
|
}
|
|
6168
|
-
|
|
6169
|
-
//#region extensions/slack/src/monitor/provider-workspace-client.ts
|
|
6129
|
+
// extensions/slack/src/monitor/provider-workspace-client.ts
|
|
6170
6130
|
function withSlackPresenceLifecycleSignal(fetchImpl, lifecycleSignal) {
|
|
6171
6131
|
return async (input, init) => await fetchImpl(input, {
|
|
6172
6132
|
...init,
|
|
@@ -6188,10 +6148,9 @@ function createSlackWorkspaceClientResolver(params) {
|
|
|
6188
6148
|
return client;
|
|
6189
6149
|
};
|
|
6190
6150
|
}
|
|
6191
|
-
|
|
6192
|
-
//#region extensions/slack/src/monitor/provider.ts
|
|
6151
|
+
// extensions/slack/src/monitor/provider.ts
|
|
6193
6152
|
const getSlackBoltInterop = createLazyRuntimeSurface(() => import("@slack/bolt"), resolveSlackBoltInterop);
|
|
6194
|
-
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-
|
|
6153
|
+
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-DEZ7qM1i.mjs"));
|
|
6195
6154
|
function resolveSlackRuntimeIdentity(params) {
|
|
6196
6155
|
const botUserId = normalizeOptionalString(params.botUserId);
|
|
6197
6156
|
const botId = normalizeOptionalString(params.botId);
|
|
@@ -6665,12 +6624,10 @@ async function monitorSlackProvider(opts) {
|
|
|
6665
6624
|
await slackDispatchers.close();
|
|
6666
6625
|
}
|
|
6667
6626
|
}
|
|
6668
|
-
|
|
6669
|
-
//#region extensions/slack/src/monitor.ts
|
|
6627
|
+
// extensions/slack/src/monitor.ts
|
|
6670
6628
|
var monitor_exports = /* @__PURE__ */ __exportAll({
|
|
6671
6629
|
buildSlackSlashCommandMatcher: () => buildSlackSlashCommandMatcher,
|
|
6672
6630
|
isSlackChannelAllowedByPolicy: () => isSlackChannelAllowedByPolicy,
|
|
6673
6631
|
monitorSlackProvider: () => monitorSlackProvider
|
|
6674
6632
|
});
|
|
6675
|
-
//#endregion
|
|
6676
6633
|
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 };
|