@openclaw/slack 2026.11.5 → 2026.11.10-beta.1
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-lxmLyPDr.mjs → channel-CyxJGWYr.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-C1oM6vom.mjs → monitor-DEKC3W7P.mjs} +147 -159
- 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-D398MsEc.mjs → pipeline.runtime-CJ9dBvJp.mjs} +113 -107
- 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-DNdK-_wn.mjs → relay-source-BPCzwy4s.mjs} +3 -4
- package/dist/.setup/{replies-BGZkt6tB.mjs → replies-DSFvZ-sZ.mjs} +11 -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-B9IcPnHV.mjs → slash-dispatch.runtime-BddQT-3Z.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";
|
|
@@ -62,13 +62,14 @@ 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.
|
|
69
69
|
*/
|
|
70
70
|
function stripSlackMentionsForCommandDetection(text) {
|
|
71
|
-
|
|
71
|
+
const body = text.replace(/<@[^>]+>/g, " ").trim();
|
|
72
|
+
return body.startsWith("/") && /[\r\n]/.test(body) ? body : body.replace(/\s+/g, " ");
|
|
72
73
|
}
|
|
73
74
|
function normalizeSlackSlashCommandName(raw) {
|
|
74
75
|
return raw.replace(/^\/+/, "");
|
|
@@ -86,8 +87,7 @@ function buildSlackSlashCommandMatcher(name) {
|
|
|
86
87
|
const escaped = normalizeSlackSlashCommandName(name).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
87
88
|
return new RegExp(`^/?${escaped}$`);
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
-
//#region extensions/slack/src/monitor/approval-runtime-context.ts
|
|
90
|
+
// extensions/slack/src/monitor/approval-runtime-context.ts
|
|
91
91
|
function registerSlackApprovalRuntimeContext(params) {
|
|
92
92
|
const approvalContext = {
|
|
93
93
|
app: params.app,
|
|
@@ -105,8 +105,7 @@ function registerSlackApprovalRuntimeContext(params) {
|
|
|
105
105
|
abortSignal: params.abortSignal
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
|
-
|
|
109
|
-
//#region extensions/slack/src/monitor/assistant-thread-context.ts
|
|
108
|
+
// extensions/slack/src/monitor/assistant-thread-context.ts
|
|
110
109
|
const SLACK_ASSISTANT_THREAD_CONTEXT_METADATA_EVENT = "assistant_thread_context";
|
|
111
110
|
const SLACK_ASSISTANT_CONTEXT_TTL_MS = 864e5;
|
|
112
111
|
const SLACK_ASSISTANT_CONTEXT_CLEANUP_INTERVAL_MS = 6e5;
|
|
@@ -182,8 +181,7 @@ function buildContextKey(accountId, channelId, threadTs, eventScope) {
|
|
|
182
181
|
const key = `${channelId}:${threadTs}`;
|
|
183
182
|
return eventScope ? `${accountId}:${eventScope.teamId}:${key}` : key;
|
|
184
183
|
}
|
|
185
|
-
|
|
186
|
-
//#region extensions/slack/src/monitor/channel-type.ts
|
|
184
|
+
// extensions/slack/src/monitor/channel-type.ts
|
|
187
185
|
function inferSlackChannelType(channelId) {
|
|
188
186
|
const trimmed = channelId?.trim();
|
|
189
187
|
if (!trimmed) return;
|
|
@@ -206,8 +204,7 @@ function resolveSlackChatType(channelType) {
|
|
|
206
204
|
if (channelType === "mpim") return "group";
|
|
207
205
|
return "channel";
|
|
208
206
|
}
|
|
209
|
-
|
|
210
|
-
//#region extensions/slack/src/monitor/enterprise-install.ts
|
|
207
|
+
// extensions/slack/src/monitor/enterprise-install.ts
|
|
211
208
|
const SLACK_CHANNEL_ID_RE = /^[CDG][A-Z0-9]{8,}$/;
|
|
212
209
|
const SLACK_USER_ID_RE = /^[BUW][A-Z0-9]{8,}$/;
|
|
213
210
|
function isWorkspaceScopedSlackChannelEntry(value, options) {
|
|
@@ -357,8 +354,7 @@ function resolveSlackIdentityHealth(params) {
|
|
|
357
354
|
lastError: null
|
|
358
355
|
};
|
|
359
356
|
}
|
|
360
|
-
|
|
361
|
-
//#region extensions/slack/src/monitor/reconnect-policy.ts
|
|
357
|
+
// extensions/slack/src/monitor/reconnect-policy.ts
|
|
362
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;
|
|
363
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;
|
|
364
360
|
/** Consecutive isolated invalid_auth failures before the channel turns terminal. */
|
|
@@ -460,8 +456,7 @@ function isIsolatedInvalidAuthSlackError(error) {
|
|
|
460
456
|
const text = formatSlackError(error, "");
|
|
461
457
|
return /invalid_auth/i.test(text) && !SLACK_DEFINITIVE_AUTH_ERROR_RE.test(text);
|
|
462
458
|
}
|
|
463
|
-
|
|
464
|
-
//#region extensions/slack/src/monitor/provider-support.ts
|
|
459
|
+
// extensions/slack/src/monitor/provider-support.ts
|
|
465
460
|
const OPENCLAW_SLACK_CLIENT_PING_TIMEOUT_MS = 15e3;
|
|
466
461
|
const OPENCLAW_SLACK_SOCKET_START_FAILED_EVENT = "unable_to_socket_mode_start";
|
|
467
462
|
const SLACK_SOCKET_PONG_TIMEOUT_WARNING_PREFIX = "A pong wasn't received from the server";
|
|
@@ -473,25 +468,45 @@ function isConstructorFunction(value) {
|
|
|
473
468
|
}
|
|
474
469
|
function installSlackNativeReconnectFailureObserver(receiver) {
|
|
475
470
|
const client = receiver.client;
|
|
476
|
-
Reflect.
|
|
471
|
+
const start = Reflect.get(client, "start");
|
|
472
|
+
const receiverStart = Reflect.get(receiver, "start");
|
|
473
|
+
let receiverStarting = false;
|
|
474
|
+
Reflect.set(receiver, "start", function startReceiver() {
|
|
475
|
+
receiverStarting = true;
|
|
476
|
+
try {
|
|
477
|
+
return receiverStart.call(this);
|
|
478
|
+
} finally {
|
|
479
|
+
receiverStarting = false;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
Reflect.set(client, "start", function startSocket() {
|
|
483
|
+
const attempt = start.call(this);
|
|
484
|
+
if (receiverStarting) return attempt;
|
|
485
|
+
return attempt.catch((error) => {
|
|
486
|
+
if (!Reflect.get(this, "shuttingDown")) this.emit(OPENCLAW_SLACK_SOCKET_START_FAILED_EVENT, error);
|
|
487
|
+
});
|
|
488
|
+
});
|
|
489
|
+
Reflect.set(client, "delayReconnectAttempt", function patchedDelayReconnectAttempt(callback, signal) {
|
|
477
490
|
const nextFailureCount = Number(Reflect.get(this, "numOfConsecutiveReconnectionFailures") ?? 0) + 1;
|
|
478
491
|
Reflect.set(this, "numOfConsecutiveReconnectionFailures", nextFailureCount);
|
|
479
492
|
const pingTimeoutMs = Number(Reflect.get(this, "clientPingTimeoutMS"));
|
|
480
493
|
const delayMs = (Number.isFinite(pingTimeoutMs) && pingTimeoutMs >= 0 ? pingTimeoutMs : OPENCLAW_SLACK_CLIENT_PING_TIMEOUT_MS) * nextFailureCount;
|
|
481
494
|
return new Promise((resolve, reject) => {
|
|
495
|
+
const cancel = () => {
|
|
496
|
+
clearTimeout(Reflect.get(this, "reconnectionTimer"));
|
|
497
|
+
if (signal || callback === Reflect.get(this, "start")) resolve(void 0);
|
|
498
|
+
else reject(/* @__PURE__ */ new Error("Slack Socket Mode stopped during reconnect"));
|
|
499
|
+
};
|
|
500
|
+
if (Reflect.get(this, "shuttingDown")) {
|
|
501
|
+
cancel();
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
this.once("disconnecting", cancel);
|
|
482
505
|
const reconnectTimer = setTimeout(() => {
|
|
506
|
+
this.off("disconnecting", cancel);
|
|
483
507
|
Reflect.set(this, "reconnectionTimer", void 0);
|
|
484
|
-
if (Reflect.get(this, "shuttingDown")) {
|
|
485
|
-
resolve(void 0);
|
|
486
|
-
return;
|
|
487
|
-
}
|
|
488
508
|
this.emit("reconnecting");
|
|
489
509
|
callback.call(this).then(resolve, (error) => {
|
|
490
|
-
if (callback === Reflect.get(this, "start")) {
|
|
491
|
-
this.emit(OPENCLAW_SLACK_SOCKET_START_FAILED_EVENT, error);
|
|
492
|
-
resolve(void 0);
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
510
|
reject(toErrorObject(error, "Non-Error rejection"));
|
|
496
511
|
});
|
|
497
512
|
}, delayMs);
|
|
@@ -751,8 +766,7 @@ function formatSlackUserResolved(entry) {
|
|
|
751
766
|
extra: entry.note ? [entry.note] : []
|
|
752
767
|
});
|
|
753
768
|
}
|
|
754
|
-
|
|
755
|
-
//#region extensions/slack/src/monitor/system-event-session.ts
|
|
769
|
+
// extensions/slack/src/monitor/system-event-session.ts
|
|
756
770
|
function createSlackSystemEventRouteResolver(params) {
|
|
757
771
|
return async (event) => {
|
|
758
772
|
const channelId = normalizeOptionalString(event.channelId) ?? "";
|
|
@@ -815,8 +829,7 @@ function createSlackSystemEventRouteResolver(params) {
|
|
|
815
829
|
};
|
|
816
830
|
};
|
|
817
831
|
}
|
|
818
|
-
|
|
819
|
-
//#region extensions/slack/src/monitor/runtime-policy.ts
|
|
832
|
+
// extensions/slack/src/monitor/runtime-policy.ts
|
|
820
833
|
function resolveSlackMonitorPolicy(cfg, accountId, runtime) {
|
|
821
834
|
const slack = mergeSlackAccountConfig(cfg, accountId);
|
|
822
835
|
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy({
|
|
@@ -988,8 +1001,7 @@ async function resolveWorkspacePolicy(ctx, resolveToken) {
|
|
|
988
1001
|
summarizeMapping("slack users", mapping, unresolved, runtime);
|
|
989
1002
|
ctx.channelsConfigKeys = Object.keys(ctx.channelsConfig ?? {});
|
|
990
1003
|
}
|
|
991
|
-
|
|
992
|
-
//#region extensions/slack/src/monitor/transient-api-error.ts
|
|
1004
|
+
// extensions/slack/src/monitor/transient-api-error.ts
|
|
993
1005
|
function isTransientSlackApiError(error) {
|
|
994
1006
|
if (error instanceof WebAPIRateLimitedError) return true;
|
|
995
1007
|
if (error instanceof WebAPIHTTPError) return error.statusCode === 408 || error.statusCode === 429 || error.statusCode >= 500 && error.statusCode < 600;
|
|
@@ -1003,8 +1015,7 @@ function isTransientSlackApiError(error) {
|
|
|
1003
1015
|
current.original
|
|
1004
1016
|
]).some((candidate) => classifyTransientNetworkErrorCode(extractErrorCode(candidate)) || readErrorName(candidate) === "TimeoutError");
|
|
1005
1017
|
}
|
|
1006
|
-
|
|
1007
|
-
//#region extensions/slack/src/monitor/suggested-prompts.ts
|
|
1018
|
+
// extensions/slack/src/monitor/suggested-prompts.ts
|
|
1008
1019
|
async function updateSlackSuggestedPrompts(params) {
|
|
1009
1020
|
const prompts = params.prompts.map(({ title, message }) => ({
|
|
1010
1021
|
title: title.trim(),
|
|
@@ -1031,8 +1042,7 @@ async function updateSlackSuggestedPrompts(params) {
|
|
|
1031
1042
|
return outcome;
|
|
1032
1043
|
}
|
|
1033
1044
|
}
|
|
1034
|
-
|
|
1035
|
-
//#region extensions/slack/src/monitor/context.ts
|
|
1045
|
+
// extensions/slack/src/monitor/context.ts
|
|
1036
1046
|
const SLACK_AGENT_VIEW_STATE_NAMESPACE = "agent-view-workspaces";
|
|
1037
1047
|
const SLACK_AGENT_VIEW_THREAD_STATE_NAMESPACE = "agent-view-threads";
|
|
1038
1048
|
const SLACK_AGENT_VIEW_STATE_MAX_ENTRIES = 4096;
|
|
@@ -1451,8 +1461,7 @@ function createSlackMonitorContext(params) {
|
|
|
1451
1461
|
ctx.readRuntimeContext = createSlackRuntimeContextReader(ctx, lookupToken ?? params.botToken);
|
|
1452
1462
|
return ctx;
|
|
1453
1463
|
}
|
|
1454
|
-
|
|
1455
|
-
//#region extensions/slack/src/streaming.ts
|
|
1464
|
+
// extensions/slack/src/streaming.ts
|
|
1456
1465
|
/**
|
|
1457
1466
|
* Thrown when Slack definitively rejects a stream flush/finalize while text
|
|
1458
1467
|
* remains buffered locally by the Slack SDK. Carries the pending text so the
|
|
@@ -1466,6 +1475,18 @@ var SlackStreamNotDeliveredError = class extends Error {
|
|
|
1466
1475
|
this.slackCode = slackCode;
|
|
1467
1476
|
}
|
|
1468
1477
|
};
|
|
1478
|
+
/**
|
|
1479
|
+
* Slack rejected an append or stop with `msg_too_long`: the message already
|
|
1480
|
+
* holds as much as Slack allows. Nothing from the rejected call landed and the
|
|
1481
|
+
* stream stays open; discard the text the SDK kept
|
|
1482
|
+
* ({@link discardSlackStreamPendingText}) before stopping it.
|
|
1483
|
+
*/
|
|
1484
|
+
var SlackStreamMessageTooLongError = class extends SlackStreamNotDeliveredError {
|
|
1485
|
+
constructor(pendingText) {
|
|
1486
|
+
super(pendingText, "msg_too_long");
|
|
1487
|
+
this.name = "SlackStreamMessageTooLongError";
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1469
1490
|
const streamsByClient = /* @__PURE__ */ new WeakMap();
|
|
1470
1491
|
const stateBySession = /* @__PURE__ */ new WeakMap();
|
|
1471
1492
|
const SLACK_STOPPED_STREAMS_MAX = 1024;
|
|
@@ -1591,6 +1612,10 @@ const BENIGN_SLACK_FINALIZE_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
|
1591
1612
|
]);
|
|
1592
1613
|
function throwSlackStreamFailure(session, err) {
|
|
1593
1614
|
const code = extractSlackErrorCode(err) ?? "unknown";
|
|
1615
|
+
if (code === "msg_too_long") {
|
|
1616
|
+
if (session.delivered || session.streamer.ts) stateBySession.get(session)?.sessions.add(session);
|
|
1617
|
+
throw new SlackStreamMessageTooLongError(session.pendingText);
|
|
1618
|
+
}
|
|
1594
1619
|
if (session.pendingText && (BENIGN_SLACK_FINALIZE_ERROR_CODES.has(code) || code === "missing_scope")) throw new SlackStreamNotDeliveredError(session.pendingText, code);
|
|
1595
1620
|
session.stopped = true;
|
|
1596
1621
|
throw err;
|
|
@@ -1613,8 +1638,7 @@ function markSlackStreamFallbackDelivered(session) {
|
|
|
1613
1638
|
if (session.stopped) releaseSlackStream(session);
|
|
1614
1639
|
else stateBySession.get(session)?.sessions.add(session);
|
|
1615
1640
|
}
|
|
1616
|
-
|
|
1617
|
-
//#region extensions/slack/src/monitor/auth.ts
|
|
1641
|
+
// extensions/slack/src/monitor/auth.ts
|
|
1618
1642
|
const slackChannelMembersCache = /* @__PURE__ */ new WeakMap();
|
|
1619
1643
|
const CHANNEL_MEMBERS_CACHE_TTL_MS = 6e4;
|
|
1620
1644
|
const CHANNEL_MEMBERS_CACHE_MAX = 512;
|
|
@@ -1923,8 +1947,7 @@ async function authorizeSlackSystemEventSender(params) {
|
|
|
1923
1947
|
channelName
|
|
1924
1948
|
};
|
|
1925
1949
|
}
|
|
1926
|
-
|
|
1927
|
-
//#region extensions/slack/src/monitor/event-scope.ts
|
|
1950
|
+
// extensions/slack/src/monitor/event-scope.ts
|
|
1928
1951
|
function resolveSlackMonitorEventScope(params) {
|
|
1929
1952
|
const identity = params.ctx.installationIdentity;
|
|
1930
1953
|
const clientOptions = params.ctx.app.webClientOptions;
|
|
@@ -1971,8 +1994,7 @@ function resolveSlackInteractionEventScope(ctx, args, kind) {
|
|
|
1971
1994
|
}
|
|
1972
1995
|
return eventScope;
|
|
1973
1996
|
}
|
|
1974
|
-
|
|
1975
|
-
//#region extensions/slack/src/types.ts
|
|
1997
|
+
// extensions/slack/src/types.ts
|
|
1976
1998
|
function parseSlackMessageEvent(value) {
|
|
1977
1999
|
const record = asOptionalRecord(value);
|
|
1978
2000
|
return record?.type === "message" && typeof record.channel === "string" ? {
|
|
@@ -1986,8 +2008,7 @@ function requireSlackMessageEvent(value) {
|
|
|
1986
2008
|
if (!event) throw new TypeError("Invalid persisted Slack message event");
|
|
1987
2009
|
return event;
|
|
1988
2010
|
}
|
|
1989
|
-
|
|
1990
|
-
//#region extensions/slack/src/monitor/ingress.ts
|
|
2011
|
+
// extensions/slack/src/monitor/ingress.ts
|
|
1991
2012
|
const SLACK_INGRESS_PAYLOAD_VERSION = 1;
|
|
1992
2013
|
const SLACK_INGRESS_POLL_INTERVAL_MS = 1e3;
|
|
1993
2014
|
const SLACK_BOLT_AUTHORIZATION_ERROR = "slack_bolt_authorization_error";
|
|
@@ -2145,6 +2166,13 @@ function createSlackDurableIngress(options) {
|
|
|
2145
2166
|
releaseChannel?.();
|
|
2146
2167
|
lifecycle.abortSignal.removeEventListener("abort", settleTurn);
|
|
2147
2168
|
};
|
|
2169
|
+
const settleRoutedTurn = async (settle) => {
|
|
2170
|
+
try {
|
|
2171
|
+
await settle();
|
|
2172
|
+
} finally {
|
|
2173
|
+
settleTurn();
|
|
2174
|
+
}
|
|
2175
|
+
};
|
|
2148
2176
|
const retainChannelTurn = () => {
|
|
2149
2177
|
if (releaseChannel) return;
|
|
2150
2178
|
const channelTurn = createDeferred();
|
|
@@ -2191,25 +2219,14 @@ function createSlackDurableIngress(options) {
|
|
|
2191
2219
|
await previousTurn;
|
|
2192
2220
|
lifecycle.abortSignal.throwIfAborted();
|
|
2193
2221
|
},
|
|
2194
|
-
onAdopted:
|
|
2195
|
-
try {
|
|
2196
|
-
await lifecycle.onAdopted();
|
|
2197
|
-
} finally {
|
|
2198
|
-
settleTurn();
|
|
2199
|
-
}
|
|
2200
|
-
},
|
|
2222
|
+
onAdopted: () => settleRoutedTurn(() => lifecycle.onAdopted()),
|
|
2201
2223
|
onDeferred: () => {
|
|
2202
2224
|
lifecycle.onDeferred();
|
|
2203
2225
|
settleSession();
|
|
2204
2226
|
monitor.requestDrain();
|
|
2205
2227
|
},
|
|
2206
|
-
onAbandoned:
|
|
2207
|
-
|
|
2208
|
-
await lifecycle.onAbandoned();
|
|
2209
|
-
} finally {
|
|
2210
|
-
settleTurn();
|
|
2211
|
-
}
|
|
2212
|
-
}
|
|
2228
|
+
onAbandoned: () => settleRoutedTurn(() => lifecycle.onAbandoned()),
|
|
2229
|
+
onDropped: (reason) => settleRoutedTurn(() => lifecycle.onDropped ? lifecycle.onDropped(reason) : lifecycle.onAbandoned())
|
|
2213
2230
|
};
|
|
2214
2231
|
try {
|
|
2215
2232
|
const event = raw.kind === "events-api" ? asOptionalRecord(raw.body)?.event : void 0;
|
|
@@ -2264,14 +2281,15 @@ function createSlackDurableIngress(options) {
|
|
|
2264
2281
|
});
|
|
2265
2282
|
const acceptReceiverEvent = async (event) => {
|
|
2266
2283
|
if (!isSlackEventCallback(event.body)) {
|
|
2267
|
-
|
|
2268
|
-
|
|
2284
|
+
const receiverApp = app;
|
|
2285
|
+
if (!receiverApp) throw new Error("Slack ingress receiver is not attached to a Bolt app.");
|
|
2286
|
+
await monitor.dispatchDirect(() => receiverApp.processEvent({
|
|
2269
2287
|
...event,
|
|
2270
2288
|
customProperties: {
|
|
2271
2289
|
...event.customProperties,
|
|
2272
2290
|
[SLACK_NATIVE_INGRESS_CONTEXT_KEY]: nativeIngress
|
|
2273
2291
|
}
|
|
2274
|
-
});
|
|
2292
|
+
}));
|
|
2275
2293
|
return;
|
|
2276
2294
|
}
|
|
2277
2295
|
await monitor.admit({
|
|
@@ -2307,8 +2325,7 @@ function createSlackDurableIngress(options) {
|
|
|
2307
2325
|
waitForIdle: monitor.waitForIdle
|
|
2308
2326
|
};
|
|
2309
2327
|
}
|
|
2310
|
-
|
|
2311
|
-
//#region extensions/slack/src/monitor/events/assistant.ts
|
|
2328
|
+
// extensions/slack/src/monitor/events/assistant.ts
|
|
2312
2329
|
function registerSlackAssistantEvents(params) {
|
|
2313
2330
|
const { ctx, trackEvent } = params;
|
|
2314
2331
|
for (const eventName of ["assistant_thread_started", "assistant_thread_context_changed"]) ctx.app.event(eventName, async ({ event, body, context }) => {
|
|
@@ -2367,8 +2384,7 @@ function registerSlackAssistantEvents(params) {
|
|
|
2367
2384
|
}
|
|
2368
2385
|
});
|
|
2369
2386
|
}
|
|
2370
|
-
|
|
2371
|
-
//#region extensions/slack/src/channel-migration.ts
|
|
2387
|
+
// extensions/slack/src/channel-migration.ts
|
|
2372
2388
|
function migrateSlackChannelConfig(params) {
|
|
2373
2389
|
let migrated = false;
|
|
2374
2390
|
let skippedExisting = false;
|
|
@@ -2390,8 +2406,7 @@ function migrateSlackChannelConfig(params) {
|
|
|
2390
2406
|
skippedExisting
|
|
2391
2407
|
};
|
|
2392
2408
|
}
|
|
2393
|
-
|
|
2394
|
-
//#region extensions/slack/src/monitor/events/channels.ts
|
|
2409
|
+
// extensions/slack/src/monitor/events/channels.ts
|
|
2395
2410
|
function registerSlackChannelEvents(params) {
|
|
2396
2411
|
const { ctx, trackEvent } = params;
|
|
2397
2412
|
for (const [eventName, kind] of [["channel_created", "created"], ["channel_rename", "renamed"]]) ctx.app.event(eventName, async (args) => {
|
|
@@ -2478,8 +2493,7 @@ function registerSlackChannelIdChangedEvent(params) {
|
|
|
2478
2493
|
}
|
|
2479
2494
|
});
|
|
2480
2495
|
}
|
|
2481
|
-
|
|
2482
|
-
//#region extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2496
|
+
// extensions/slack/src/monitor/deferred-action-routing.ts
|
|
2483
2497
|
function resolveSlackDeferredActionTarget(params) {
|
|
2484
2498
|
if (!params.id) throw new Error("Slack deferred action is missing a target ID");
|
|
2485
2499
|
if (!params.eventScope) return {
|
|
@@ -2492,8 +2506,7 @@ function resolveSlackDeferredActionTarget(params) {
|
|
|
2492
2506
|
target
|
|
2493
2507
|
};
|
|
2494
2508
|
}
|
|
2495
|
-
|
|
2496
|
-
//#region extensions/slack/src/monitor/events/interaction-event.ts
|
|
2509
|
+
// extensions/slack/src/monitor/events/interaction-event.ts
|
|
2497
2510
|
const SLACK_INTERACTION_EVENT_PREFIX = "Slack interaction: ";
|
|
2498
2511
|
const REDACTED_INTERACTION_VALUE = "[redacted]";
|
|
2499
2512
|
const SLACK_INTERACTION_EVENT_MAX_CHARS = 2400;
|
|
@@ -2632,8 +2645,7 @@ async function enqueueSlackInteractionEvent(payload, route, options, log) {
|
|
|
2632
2645
|
return false;
|
|
2633
2646
|
}
|
|
2634
2647
|
}
|
|
2635
|
-
|
|
2636
|
-
//#region extensions/slack/src/interactive-dispatch.ts
|
|
2648
|
+
// extensions/slack/src/interactive-dispatch.ts
|
|
2637
2649
|
const dispatchSlackInteractive = createChannelInteractiveDispatcher({
|
|
2638
2650
|
channel: "slack",
|
|
2639
2651
|
interactiveKey: "interaction"
|
|
@@ -2658,8 +2670,7 @@ async function dispatchSlackPluginInteractiveHandler(params) {
|
|
|
2658
2670
|
}
|
|
2659
2671
|
});
|
|
2660
2672
|
}
|
|
2661
|
-
|
|
2662
|
-
//#region extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
2673
|
+
// extensions/slack/src/monitor/events/interactions.approval-sender.ts
|
|
2663
2674
|
function resolveSlackPluginApprovalSender(params) {
|
|
2664
2675
|
const senderId = formatSlackTarget({
|
|
2665
2676
|
kind: "user",
|
|
@@ -2675,8 +2686,7 @@ function resolveSlackPluginApprovalSender(params) {
|
|
|
2675
2686
|
})
|
|
2676
2687
|
};
|
|
2677
2688
|
}
|
|
2678
|
-
|
|
2679
|
-
//#region extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
2689
|
+
// extensions/slack/src/monitor/events/modal-input-summary.ts
|
|
2680
2690
|
function readOptionValues(options, read) {
|
|
2681
2691
|
if (!Array.isArray(options)) return [];
|
|
2682
2692
|
return options.map((option) => option && typeof option === "object" ? read(option) : void 0);
|
|
@@ -2768,8 +2778,7 @@ function formatInteractionSelectionLabel(params) {
|
|
|
2768
2778
|
if (params.summary.richTextPreview) return params.summary.richTextPreview;
|
|
2769
2779
|
return normalizeOptionalString(params.summary.value) ?? params.actionId;
|
|
2770
2780
|
}
|
|
2771
|
-
|
|
2772
|
-
//#region extensions/slack/src/monitor/events/interactions.block-actions.context.ts
|
|
2781
|
+
// extensions/slack/src/monitor/events/interactions.block-actions.context.ts
|
|
2773
2782
|
function resolveSlackActionValue(summary) {
|
|
2774
2783
|
return normalizeOptionalString(summary.value) ?? summary.selectedValues?.[0];
|
|
2775
2784
|
}
|
|
@@ -2820,8 +2829,7 @@ function parseSlackBlockAction(params) {
|
|
|
2820
2829
|
actionSummary: summarizeAction(typedAction)
|
|
2821
2830
|
};
|
|
2822
2831
|
}
|
|
2823
|
-
|
|
2824
|
-
//#region extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
2832
|
+
// extensions/slack/src/monitor/events/interactions.block-actions.ts
|
|
2825
2833
|
async function respondEphemeral(respond, text) {
|
|
2826
2834
|
if (!respond) return;
|
|
2827
2835
|
try {
|
|
@@ -2925,7 +2933,7 @@ async function handleSlackApprovalInteraction(params) {
|
|
|
2925
2933
|
channelId,
|
|
2926
2934
|
messageTs
|
|
2927
2935
|
}, async () => {
|
|
2928
|
-
const { readSlackMessages } = await import("./actions-
|
|
2936
|
+
const { readSlackMessages } = await import("./actions-BNOabmV6.mjs").then((n) => n.t);
|
|
2929
2937
|
const { messages } = await readSlackMessages(channelId, {
|
|
2930
2938
|
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
2931
2939
|
messageId: messageTs,
|
|
@@ -3258,8 +3266,7 @@ function registerSlackBlockActionHandler(params) {
|
|
|
3258
3266
|
}, runtimeContext.runtime.log) && runtimeContext.isRuntimePolicyCurrent()) await updateSlackLegacyBlockAction(actionContext);
|
|
3259
3267
|
});
|
|
3260
3268
|
}
|
|
3261
|
-
|
|
3262
|
-
//#region extensions/slack/src/modal-metadata.ts
|
|
3269
|
+
// extensions/slack/src/modal-metadata.ts
|
|
3263
3270
|
function parseSlackModalPrivateMetadata(raw) {
|
|
3264
3271
|
if (typeof raw !== "string" || raw.trim().length === 0) return {};
|
|
3265
3272
|
try {
|
|
@@ -3275,8 +3282,7 @@ function parseSlackModalPrivateMetadata(raw) {
|
|
|
3275
3282
|
return {};
|
|
3276
3283
|
}
|
|
3277
3284
|
}
|
|
3278
|
-
|
|
3279
|
-
//#region extensions/slack/src/monitor/events/interactions.modal.ts
|
|
3285
|
+
// extensions/slack/src/monitor/events/interactions.modal.ts
|
|
3280
3286
|
const OPENCLAW_MODAL_CALLBACK_PREFIX = "openclaw:";
|
|
3281
3287
|
function resolveSlackPluginSystemEventPayload(result) {
|
|
3282
3288
|
const systemEvent = result?.systemEvent;
|
|
@@ -3473,8 +3479,7 @@ function registerModalLifecycleHandler(params) {
|
|
|
3473
3479
|
}, runtimeCtx.runtime.log);
|
|
3474
3480
|
});
|
|
3475
3481
|
}
|
|
3476
|
-
|
|
3477
|
-
//#region extensions/slack/src/monitor/events/interactions.ts
|
|
3482
|
+
// extensions/slack/src/monitor/events/interactions.ts
|
|
3478
3483
|
function registerSlackInteractionEvents(params) {
|
|
3479
3484
|
const { ctx, trackEvent } = params;
|
|
3480
3485
|
registerSlackBlockActionHandler(params);
|
|
@@ -3570,8 +3575,7 @@ function registerSlackInteractionEvents(params) {
|
|
|
3570
3575
|
interactionType
|
|
3571
3576
|
});
|
|
3572
3577
|
}
|
|
3573
|
-
|
|
3574
|
-
//#region extensions/slack/src/monitor/events/system-event-context.ts
|
|
3578
|
+
// extensions/slack/src/monitor/events/system-event-context.ts
|
|
3575
3579
|
async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
3576
3580
|
const { senderId, channelId, channelType, eventKind } = params;
|
|
3577
3581
|
const ctx = await params.ctx.readRuntimeContext();
|
|
@@ -3601,8 +3605,7 @@ async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
|
3601
3605
|
})
|
|
3602
3606
|
};
|
|
3603
3607
|
}
|
|
3604
|
-
|
|
3605
|
-
//#region extensions/slack/src/monitor/events/members.ts
|
|
3608
|
+
// extensions/slack/src/monitor/events/members.ts
|
|
3606
3609
|
function registerSlackMemberEvents(params) {
|
|
3607
3610
|
const { ctx, trackEvent } = params;
|
|
3608
3611
|
for (const verb of ["joined", "left"]) ctx.app.event(`member_${verb}_channel`, async (args) => {
|
|
@@ -3693,8 +3696,7 @@ function registerSlackMemberEvents(params) {
|
|
|
3693
3696
|
}
|
|
3694
3697
|
});
|
|
3695
3698
|
}
|
|
3696
|
-
|
|
3697
|
-
//#region extensions/slack/src/draft-message-boundaries.ts
|
|
3699
|
+
// extensions/slack/src/draft-message-boundaries.ts
|
|
3698
3700
|
const activeDraftsByConversation = /* @__PURE__ */ new Map();
|
|
3699
3701
|
function conversationKey(conversation) {
|
|
3700
3702
|
return [
|
|
@@ -3745,8 +3747,7 @@ function noteSlackDraftConversationMessage(conversation) {
|
|
|
3745
3747
|
if (isLaterSlackMessage(conversation.messageTs, draft.messageTs)) draft.onInterveningMessage();
|
|
3746
3748
|
}
|
|
3747
3749
|
}
|
|
3748
|
-
|
|
3749
|
-
//#region extensions/slack/src/threading.ts
|
|
3750
|
+
// extensions/slack/src/threading.ts
|
|
3750
3751
|
function resolveSlackThreadContext(params) {
|
|
3751
3752
|
const incomingThreadTs = params.message.thread_ts;
|
|
3752
3753
|
const eventTs = params.message.event_ts;
|
|
@@ -3763,8 +3764,7 @@ function resolveSlackThreadContext(params) {
|
|
|
3763
3764
|
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
3764
3765
|
};
|
|
3765
3766
|
}
|
|
3766
|
-
|
|
3767
|
-
//#region extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
3767
|
+
// extensions/slack/src/monitor/events/message-subtype-handlers.ts
|
|
3768
3768
|
function resolveSlackMessageSubtypeHandler(event) {
|
|
3769
3769
|
const subtype = event.subtype;
|
|
3770
3770
|
if (subtype !== "message_changed" && subtype !== "message_deleted") return;
|
|
@@ -3788,8 +3788,7 @@ function resolveSlackMessageSubtypeHandler(event) {
|
|
|
3788
3788
|
}).replyToId : void 0
|
|
3789
3789
|
};
|
|
3790
3790
|
}
|
|
3791
|
-
|
|
3792
|
-
//#region extensions/slack/src/monitor/events/messages.ts
|
|
3791
|
+
// extensions/slack/src/monitor/events/messages.ts
|
|
3793
3792
|
const slackInboundLog = createSubsystemLogger("gateway/channels/slack").child("inbound");
|
|
3794
3793
|
function isBotAuthoredEnterpriseEvent(event) {
|
|
3795
3794
|
return Boolean(normalizeOptionalString(event.bot_id)) || event.subtype === "bot_message";
|
|
@@ -3949,8 +3948,7 @@ function registerSlackMessageEvents(params) {
|
|
|
3949
3948
|
}
|
|
3950
3949
|
});
|
|
3951
3950
|
}
|
|
3952
|
-
|
|
3953
|
-
//#region extensions/slack/src/monitor/session-run-targets.ts
|
|
3951
|
+
// extensions/slack/src/monitor/session-run-targets.ts
|
|
3954
3952
|
async function captureSlackSessionTargetGuard(ctx, route, isActive) {
|
|
3955
3953
|
return captureSessionEntryCurrentCheckAsync({
|
|
3956
3954
|
agentId: route.agentId,
|
|
@@ -3992,8 +3990,7 @@ function getSlackSessionRuns(ctx, address) {
|
|
|
3992
3990
|
isActive: () => targets.some((candidate) => candidate.route.sessionKey === target.route.sessionKey && candidate.isActive())
|
|
3993
3991
|
}));
|
|
3994
3992
|
}
|
|
3995
|
-
|
|
3996
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
3993
|
+
// extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
3997
3994
|
async function resolveSlackRoutingContext(params) {
|
|
3998
3995
|
const { ctx, account, message, chatType, channelConfig, seedTopLevelRoomThread, assistantThreadTs, agentViewThreadTs, eventScope } = params;
|
|
3999
3996
|
const isDirectMessage = chatType === "direct";
|
|
@@ -4170,8 +4167,7 @@ async function resolveSlackSessionEventRoutingContext(params) {
|
|
|
4170
4167
|
release: current.release
|
|
4171
4168
|
};
|
|
4172
4169
|
}
|
|
4173
|
-
|
|
4174
|
-
//#region extensions/slack/src/monitor/dm-auth.ts
|
|
4170
|
+
// extensions/slack/src/monitor/dm-auth.ts
|
|
4175
4171
|
async function authorizeSlackDirectMessage(params) {
|
|
4176
4172
|
if (!params.ctx.dmEnabled || params.ctx.dmPolicy === "disabled") {
|
|
4177
4173
|
await params.onDisabled();
|
|
@@ -4227,8 +4223,7 @@ async function authorizeSlackDirectMessage(params) {
|
|
|
4227
4223
|
});
|
|
4228
4224
|
return false;
|
|
4229
4225
|
}
|
|
4230
|
-
|
|
4231
|
-
//#region extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
4226
|
+
// extensions/slack/src/monitor/external-arg-menu-store.ts
|
|
4232
4227
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
4233
4228
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(24)}}$`);
|
|
4234
4229
|
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 6e5;
|
|
@@ -4264,8 +4259,7 @@ function createSlackExternalArgMenuStore() {
|
|
|
4264
4259
|
}
|
|
4265
4260
|
};
|
|
4266
4261
|
}
|
|
4267
|
-
|
|
4268
|
-
//#region extensions/slack/src/monitor/response-url-budget.ts
|
|
4262
|
+
// extensions/slack/src/monitor/response-url-budget.ts
|
|
4269
4263
|
const SLACK_RESPONSE_URL_MAX_CALLS = 5;
|
|
4270
4264
|
var SlackResponseAlreadyReportedError = class extends Error {};
|
|
4271
4265
|
/** Count every response_url attempt, including requests Slack rejects. */
|
|
@@ -4280,8 +4274,7 @@ function createSlackResponseUrlBudget(respond) {
|
|
|
4280
4274
|
}
|
|
4281
4275
|
};
|
|
4282
4276
|
}
|
|
4283
|
-
|
|
4284
|
-
//#region extensions/slack/src/monitor/room-context.ts
|
|
4277
|
+
// extensions/slack/src/monitor/room-context.ts
|
|
4285
4278
|
function resolveSlackRoomContextHints(params) {
|
|
4286
4279
|
return {
|
|
4287
4280
|
channelMetadata: params.isRoomish ? buildChannelMetadata({
|
|
@@ -4292,8 +4285,7 @@ function resolveSlackRoomContextHints(params) {
|
|
|
4292
4285
|
groupSystemPrompt: params.isRoomish ? normalizeOptionalString(params.channelConfig?.systemPrompt) : void 0
|
|
4293
4286
|
};
|
|
4294
4287
|
}
|
|
4295
|
-
|
|
4296
|
-
//#region extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
4288
|
+
// extensions/slack/src/monitor/slash-menu-model-context.ts
|
|
4297
4289
|
async function resolveSlackCommandMenuModelContext(params) {
|
|
4298
4290
|
if (!params.sessionKey.trim()) return {};
|
|
4299
4291
|
try {
|
|
@@ -4342,8 +4334,7 @@ async function resolveSlackCommandMenuModelContext(params) {
|
|
|
4342
4334
|
return {};
|
|
4343
4335
|
}
|
|
4344
4336
|
}
|
|
4345
|
-
|
|
4346
|
-
//#region extensions/slack/src/monitor/slash.ts
|
|
4337
|
+
// extensions/slack/src/monitor/slash.ts
|
|
4347
4338
|
const SLACK_COMMAND_ARG_ACTION_ID = "openclaw_cmdarg";
|
|
4348
4339
|
const SLACK_COMMAND_ARG_ACTION_LISTENER = /^openclaw_cmdarg/;
|
|
4349
4340
|
const SLACK_COMMAND_ARG_VALUE_PREFIX = "cmdarg";
|
|
@@ -4358,7 +4349,7 @@ const SLACK_COMMAND_ARG_BUTTON_VALUE_MAX = 2e3;
|
|
|
4358
4349
|
const SLACK_COMMAND_ARG_CONFIRM_TEXT_MAX = 300;
|
|
4359
4350
|
const SLACK_HEADER_TEXT_MAX = 150;
|
|
4360
4351
|
const SLACK_COMMAND_ARG_ACTION_BLOCKS_MAX = 47;
|
|
4361
|
-
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-
|
|
4352
|
+
const loadSlashDispatchRuntime = createLazyRuntimeModule(() => import("./slash-dispatch.runtime-BddQT-3Z.mjs"));
|
|
4362
4353
|
const loadPluginCommandRuntime = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/plugin-command-runtime"));
|
|
4363
4354
|
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
4364
4355
|
function buildSlackArgMenuConfirm(params) {
|
|
@@ -5152,8 +5143,7 @@ async function deliverSlackSlashResponseWithWebApi(params) {
|
|
|
5152
5143
|
function isSlackBoltRespondError(error) {
|
|
5153
5144
|
return Boolean(error) && typeof error === "object" && error.code === "slack_bolt_respond_error";
|
|
5154
5145
|
}
|
|
5155
|
-
|
|
5156
|
-
//#region extensions/slack/src/monitor/events.ts
|
|
5146
|
+
// extensions/slack/src/monitor/events.ts
|
|
5157
5147
|
function buildSlackHomeView(slashCommandName) {
|
|
5158
5148
|
return {
|
|
5159
5149
|
type: "home",
|
|
@@ -5454,8 +5444,7 @@ function registerSlackWorkspaceEvents(params) {
|
|
|
5454
5444
|
trackEvent
|
|
5455
5445
|
});
|
|
5456
5446
|
}
|
|
5457
|
-
|
|
5458
|
-
//#region extensions/slack/src/monitor/http-handler.ts
|
|
5447
|
+
// extensions/slack/src/monitor/http-handler.ts
|
|
5459
5448
|
const SLACK_WEBHOOK_MAX_BODY_BYTES = 1048576;
|
|
5460
5449
|
const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
|
|
5461
5450
|
function registerSlackHttpHandler(params) {
|
|
@@ -5499,8 +5488,7 @@ function createSlackHttpRequestHandler(params) {
|
|
|
5499
5488
|
}
|
|
5500
5489
|
};
|
|
5501
5490
|
}
|
|
5502
|
-
|
|
5503
|
-
//#region extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5491
|
+
// extensions/slack/src/monitor/message-dispatch-dedupe.ts
|
|
5504
5492
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_TTL_MS = 864e5;
|
|
5505
5493
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_MEMORY_MAX_ENTRIES = 2e4;
|
|
5506
5494
|
const SLACK_MESSAGE_DISPATCH_DEDUPE_STATE_MAX_ENTRIES = 2e4;
|
|
@@ -5553,8 +5541,7 @@ async function claimSlackMessageDispatchReplay(params) {
|
|
|
5553
5541
|
handle: claim.handle
|
|
5554
5542
|
} : { kind: "duplicate" };
|
|
5555
5543
|
}
|
|
5556
|
-
|
|
5557
|
-
//#region extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5544
|
+
// extensions/slack/src/monitor/message-handler/debounce-key.ts
|
|
5558
5545
|
function resolveSlackSenderId(message) {
|
|
5559
5546
|
return message.user ?? message.bot_id ?? null;
|
|
5560
5547
|
}
|
|
@@ -5571,8 +5558,7 @@ function buildSlackDebounceKey(message, accountId, teamId) {
|
|
|
5571
5558
|
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;
|
|
5572
5559
|
return `slack:${accountId}:${teamId ? `${teamId}:` : ""}${threadKey}:${senderId}`;
|
|
5573
5560
|
}
|
|
5574
|
-
|
|
5575
|
-
//#region extensions/slack/src/monitor/thread-resolution.ts
|
|
5561
|
+
// extensions/slack/src/monitor/thread-resolution.ts
|
|
5576
5562
|
const DEFAULT_THREAD_TS_CACHE_TTL_MS = 6e4;
|
|
5577
5563
|
const DEFAULT_THREAD_TS_CACHE_MAX = 500;
|
|
5578
5564
|
const markAmbiguousThreadReply = (message) => ({
|
|
@@ -5622,9 +5608,8 @@ function createSlackThreadTsResolver(params) {
|
|
|
5622
5608
|
return markAmbiguousThreadReply(message);
|
|
5623
5609
|
} };
|
|
5624
5610
|
}
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-D398MsEc.mjs"));
|
|
5611
|
+
// extensions/slack/src/monitor/message-handler.ts
|
|
5612
|
+
const loadSlackMessagePipeline = createLazyRuntimeModule(() => import("./pipeline.runtime-CJ9dBvJp.mjs"));
|
|
5628
5613
|
const RETRYABLE_FLUSH_MAX_ATTEMPTS = 3;
|
|
5629
5614
|
function shouldDebounceSlackMessage(message, cfg) {
|
|
5630
5615
|
const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");
|
|
@@ -5796,7 +5781,16 @@ function createSlackMessageHandler(params) {
|
|
|
5796
5781
|
releaseClaims();
|
|
5797
5782
|
turnAdoptionLifecycle?.onAbandoned();
|
|
5798
5783
|
admissionLifecycle.onAbandoned();
|
|
5799
|
-
}
|
|
5784
|
+
},
|
|
5785
|
+
onDropped: turnAdoptionLifecycle?.onDropped ? async (reason) => {
|
|
5786
|
+
settlementHandedOff = true;
|
|
5787
|
+
const failure = (await Promise.allSettled([turnAdoptionLifecycle, admissionLifecycle].map(async (lifecycle) => lifecycle?.onDropped ? lifecycle.onDropped(reason) : lifecycle?.onAbandoned?.()))).find((result) => result.status === "rejected");
|
|
5788
|
+
if (failure?.status === "rejected") {
|
|
5789
|
+
releaseClaims(failure.reason);
|
|
5790
|
+
throw failure.reason;
|
|
5791
|
+
}
|
|
5792
|
+
await commitClaims();
|
|
5793
|
+
} : void 0
|
|
5800
5794
|
};
|
|
5801
5795
|
onPrepared?.(prepared);
|
|
5802
5796
|
if (surviving.length > 1 && sourceMessageIds.length > 0) {
|
|
@@ -5890,8 +5884,7 @@ function createSlackMessageHandler(params) {
|
|
|
5890
5884
|
await (await enqueueSlackMessage(message, opts))?.promise;
|
|
5891
5885
|
};
|
|
5892
5886
|
}
|
|
5893
|
-
|
|
5894
|
-
//#region extensions/slack/src/monitor/presence-monitor.ts
|
|
5887
|
+
// extensions/slack/src/monitor/presence-monitor.ts
|
|
5895
5888
|
const SLACK_PRESENCE_GREETING_COOLDOWN_MS = 288e5;
|
|
5896
5889
|
const SLACK_PRESENCE_REQUEST_TIMEOUT_MS = 3e4;
|
|
5897
5890
|
const SLACK_PRESENCE_POLL_INTERVAL_MS = 6e4;
|
|
@@ -6125,8 +6118,7 @@ function createSlackPresenceMonitor(params) {
|
|
|
6125
6118
|
function presenceSubjectKey(subject) {
|
|
6126
6119
|
return `${subject.teamId ?? "workspace"}:${subject.userId}`;
|
|
6127
6120
|
}
|
|
6128
|
-
|
|
6129
|
-
//#region extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6121
|
+
// extensions/slack/src/monitor/presence-cooldown-store.ts
|
|
6130
6122
|
const SLACK_PRESENCE_COOLDOWN_MAX_ENTRIES = 25e3;
|
|
6131
6123
|
function openSlackPresenceCooldownStore() {
|
|
6132
6124
|
return getSlackRuntime().state.openKeyedStore({
|
|
@@ -6136,8 +6128,7 @@ function openSlackPresenceCooldownStore() {
|
|
|
6136
6128
|
defaultTtlMs: SLACK_PRESENCE_GREETING_COOLDOWN_MS
|
|
6137
6129
|
});
|
|
6138
6130
|
}
|
|
6139
|
-
|
|
6140
|
-
//#region extensions/slack/src/monitor/provider-workspace-client.ts
|
|
6131
|
+
// extensions/slack/src/monitor/provider-workspace-client.ts
|
|
6141
6132
|
function withSlackPresenceLifecycleSignal(fetchImpl, lifecycleSignal) {
|
|
6142
6133
|
return async (input, init) => await fetchImpl(input, {
|
|
6143
6134
|
...init,
|
|
@@ -6159,10 +6150,9 @@ function createSlackWorkspaceClientResolver(params) {
|
|
|
6159
6150
|
return client;
|
|
6160
6151
|
};
|
|
6161
6152
|
}
|
|
6162
|
-
|
|
6163
|
-
//#region extensions/slack/src/monitor/provider.ts
|
|
6153
|
+
// extensions/slack/src/monitor/provider.ts
|
|
6164
6154
|
const getSlackBoltInterop = createLazyRuntimeSurface(() => import("@slack/bolt"), resolveSlackBoltInterop);
|
|
6165
|
-
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-
|
|
6155
|
+
const loadSlackRelaySource = createLazyRuntimeModule(() => import("./relay-source-BPCzwy4s.mjs"));
|
|
6166
6156
|
function resolveSlackRuntimeIdentity(params) {
|
|
6167
6157
|
const botUserId = normalizeOptionalString(params.botUserId);
|
|
6168
6158
|
const botId = normalizeOptionalString(params.botId);
|
|
@@ -6636,12 +6626,10 @@ async function monitorSlackProvider(opts) {
|
|
|
6636
6626
|
await slackDispatchers.close();
|
|
6637
6627
|
}
|
|
6638
6628
|
}
|
|
6639
|
-
|
|
6640
|
-
//#region extensions/slack/src/monitor.ts
|
|
6629
|
+
// extensions/slack/src/monitor.ts
|
|
6641
6630
|
var monitor_exports = /* @__PURE__ */ __exportAll({
|
|
6642
6631
|
buildSlackSlashCommandMatcher: () => buildSlackSlashCommandMatcher,
|
|
6643
6632
|
isSlackChannelAllowedByPolicy: () => isSlackChannelAllowedByPolicy,
|
|
6644
6633
|
monitorSlackProvider: () => monitorSlackProvider
|
|
6645
6634
|
});
|
|
6646
|
-
|
|
6647
|
-
export { resolveSlackChatType as C, stripSlackMentionsForCommandDetection as E, normalizeSlackChannelType as S, readSlackAssistantThreadContext as T, appendSlackStream as _, createSlackResponseUrlBudget as a, stopSlackStream as b, registerSlackSessionRun as c, parseSlackMessageEvent as d, requireSlackMessageEvent as f, SlackStreamNotDeliveredError as g, resolveSlackEffectiveAllowFrom as h, SlackResponseAlreadyReportedError as i, resolveSlackThreadContext as l, resolveSlackCommandIngress as m, monitorSlackProvider as n, authorizeSlackDirectMessage as o, authorizeSlackBotRoomMessage as p, resolveSlackRoomContextHints as r, resolveSlackRoutingContext as s, monitor_exports as t, trackSlackDraftMessage as u, markSlackStreamFallbackDelivered as v, buildSlackAssistantThreadMetadata as w, SLACK_SOCKET_RECONNECT_POLICY as x, startSlackStream as y };
|
|
6635
|
+
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 };
|