@openclaw/slack 2026.11.1 → 2026.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-configured-35y0-Hso.mjs → account-configured-zcR9TJJN.mjs} +2 -1
- package/dist/.setup/{account-inspect-Bc7TVU8F.mjs → account-inspect-CmkKiSb9.mjs} +4 -3
- package/dist/.setup/{accounts-CEgdyqoW.mjs → accounts-msihSF3-.mjs} +10 -6
- package/dist/.setup/{action-runtime-DPoxYao5.mjs → action-runtime-ChRfnnBu.mjs} +10 -9
- package/dist/.setup/action-runtime.runtime-vLxx_7s2.mjs +2 -0
- package/dist/.setup/{actions-PF2cP6to.mjs → actions-By7tvpvv.mjs} +22 -14
- package/dist/.setup/{approval-handler.runtime-BtRklemy.mjs → approval-handler.runtime-D8ArtDQt.mjs} +8 -7
- package/dist/.setup/{approval-message-updates-CpwbsEj6.mjs → approval-message-updates-DT7XBPbV.mjs} +3 -2
- package/dist/.setup/{channel-BzPa5LRe.mjs → channel-DLFiMJm2.mjs} +39 -32
- package/dist/.setup/{channel-meta-C5vsCo3a.mjs → channel-meta-C443t-lI.mjs} +2 -1
- package/dist/.setup/{channel-type-Dh4vwh1Y.mjs → channel-type-BEFP2ORi.mjs} +6 -5
- package/dist/.setup/{channel.setup-Cc6oaNPS.mjs → channel.setup-CzFw73mU.mjs} +14 -10
- package/dist/.setup/{config-schema-Cz3uId-c.mjs → config-schema-DNnh6bWU.mjs} +4 -2
- package/dist/.setup/{directory-config-BEPra1E2.mjs → directory-config-Cjj0N8R0.mjs} +6 -5
- package/dist/.setup/{directory-live-BkUwPrS0.mjs → directory-live-BIKD-5B_.mjs} +5 -4
- package/dist/.setup/{doctor-contract-HK8aedwU.mjs → doctor-contract-Cd4-VzIM.mjs} +13 -7
- package/dist/.setup/http-C9sM-FXe.mjs +2 -0
- package/dist/.setup/{message-tool-api-DeiQJoRV.mjs → message-tool-api-BS5ekEA_.mjs} +7 -5
- package/dist/.setup/{monitor-BSKi0nx-.mjs → monitor-CV6Z6FKP.mjs} +137 -78
- package/dist/.setup/{outbound-adapter-C0R5jz6S.mjs → outbound-adapter-9dbnYtL1.mjs} +9 -8
- package/dist/.setup/{pipeline.runtime-zTQpztym.mjs → pipeline.runtime-DLIQf1Bo.mjs} +68 -41
- package/dist/.setup/{plugin-routes-lXsy_bNV.mjs → plugin-routes-D4qozHVn.mjs} +3 -2
- package/dist/.setup/{policy-Bp1FvE6m.mjs → policy-yhn48xf5.mjs} +6 -4
- package/dist/.setup/{probe-C5VWf3sz.mjs → probe-IiHogLQN.mjs} +19 -11
- package/dist/.setup/{registry-1G0f1zuZ.mjs → registry-DizWcnNp.mjs} +4 -2
- package/dist/.setup/{relay-source-D1NGf3d2.mjs → relay-source-CxDcrn16.mjs} +4 -3
- package/dist/.setup/{replies-BY9G1WZH.mjs → replies-MRkrg3rC.mjs} +9 -7
- package/dist/.setup/{reply-blocks-DOjiDr44.mjs → reply-blocks-Ca-raz2z.mjs} +7 -4
- package/dist/.setup/{resolve-channels-BNQ1KZXh.mjs → resolve-channels-DRRhElwz.mjs} +5 -4
- package/dist/.setup/{resolve-users-C4dC8Z7D.mjs → resolve-users-Cz8e17ky.mjs} +5 -4
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-B4FMCO8f.mjs} +2 -1
- package/dist/.setup/{runtime-C6HKn7Av.mjs → runtime-JSVZSWAj.mjs} +2 -1
- package/dist/.setup/runtime-setter-api-CMFvhrAr.mjs +3 -0
- package/dist/.setup/{scopes-C1aeCBa6.mjs → scopes-DfQVi8Jw.mjs} +3 -2
- package/dist/.setup/secret-contract-api-DK9gZldc.mjs +3 -0
- package/dist/.setup/{secret-contract-BH1ergYo.mjs → secret-contract-vVRMoE1D.mjs} +3 -2
- package/dist/.setup/{security-audit-C3hXCfDt.mjs → security-audit-DFGiFLqd.mjs} +3 -2
- package/dist/.setup/{send-C5uXkmZV.mjs → send-C-8wY0lK.mjs} +21 -14
- package/dist/.setup/{send-results-D-o6PgtS.mjs → send-results-eeOu_HYm.mjs} +2 -1
- package/dist/.setup/{session-status-CHkEn3HM.mjs → session-status-Dv8wNBEt.mjs} +57 -31
- package/dist/.setup/setup-plugin-api-BGD1TYnK.mjs +3 -0
- package/dist/.setup/{setup-surface-b9gluDhT.mjs → setup-surface--n8VsDvV.mjs} +8 -7
- package/dist/.setup/{shared-DbdvOUXo.mjs → shared-BhJHIZs1.mjs} +18 -14
- package/dist/.setup/{slash-dispatch.runtime-Bf0r7kf2.mjs → slash-dispatch.runtime-D3Wq45ER.mjs} +1 -1
- package/dist/.setup/{target-parsing-0pRZtahO.mjs → target-parsing-FFE26kOV.mjs} +2 -1
- package/dist/.setup/{targets-BqXz7CpG.mjs → targets-C6LZQL1Q.mjs} +3 -2
- package/dist/.setup/{thread-ts-47Au2-Yn.mjs → thread-ts-Cvt7WD6B.mjs} +2 -1
- package/dist/account-inspect-api.js +3 -2
- package/dist/api.js +17 -17
- package/dist/channel-config-api.js +2 -1
- package/dist/channel-entry.js +2 -1
- package/dist/channel-plugin-api.js +2 -1
- package/dist/configured-state.js +3 -2
- package/dist/directory-contract-api.js +2 -1
- package/dist/doctor-contract-api.js +2 -1
- package/dist/http-routes-api.js +2 -1
- package/dist/index.js +3 -2
- package/dist/message-tool-api.js +2 -1
- package/dist/runtime-api.js +12 -12
- package/dist/runtime-setter-api.js +2 -1
- package/dist/secret-contract-api.js +2 -1
- package/dist/security-contract-api.js +2 -1
- package/dist/setup-entry.js +5 -4
- package/dist/setup-plugin-api.js +2 -1
- package/package.json +4 -4
- package/dist/.setup/action-runtime.runtime-DWKWaKgC.mjs +0 -1
- package/dist/.setup/http-GpAVKwSX.mjs +0 -2
- package/dist/.setup/runtime-setter-api-DrXr965r.mjs +0 -2
- package/dist/.setup/secret-contract-api-BdG3j9lT.mjs +0 -2
- package/dist/.setup/setup-plugin-api-9mACIIlc.mjs +0 -2
- package/dist/.source-module-urls/562d694877afe9d9dcbb3b32a8883c16974738f2aa892c48d45572cdc9a62529.json +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-
|
|
2
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
3
|
-
import { K as resolveSlackQuestionActionIds, L as SLACK_QUESTION_FINALIZATION_BLOCKS, M as SLACK_TEXT_LIMIT, ft as SLACK_PRESENTATION_CAPABILITIES, m as assertSlackDetachedTargetAllowed, st as escapeSlackMrkdwn } from "./session-status-
|
|
4
|
-
import { c as resolveSlackReplyDeliveryMessages, i as parseSlackReplyBlockSegments, o as resolveSlackReplyBlockResolution, r as normalizeSlackReplyPayload, u as resolveSlackAuthoredTextPlacement } from "./reply-blocks-
|
|
5
|
-
import { r as resolveSlackThreadTsValue } from "./thread-ts-
|
|
6
|
-
import { t as mergeSlackSendResults } from "./send-results-
|
|
1
|
+
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-msihSF3-.mjs";
|
|
2
|
+
import { a as parseSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
3
|
+
import { K as resolveSlackQuestionActionIds, L as SLACK_QUESTION_FINALIZATION_BLOCKS, M as SLACK_TEXT_LIMIT, ft as SLACK_PRESENTATION_CAPABILITIES, m as assertSlackDetachedTargetAllowed, st as escapeSlackMrkdwn } from "./session-status-Dv8wNBEt.mjs";
|
|
4
|
+
import { c as resolveSlackReplyDeliveryMessages, i as parseSlackReplyBlockSegments, o as resolveSlackReplyBlockResolution, r as normalizeSlackReplyPayload, u as resolveSlackAuthoredTextPlacement } from "./reply-blocks-Ca-raz2z.mjs";
|
|
5
|
+
import { r as resolveSlackThreadTsValue } from "./thread-ts-Cvt7WD6B.mjs";
|
|
6
|
+
import { t as mergeSlackSendResults } from "./send-results-eeOu_HYm.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
9
9
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -13,7 +13,7 @@ import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-run
|
|
|
13
13
|
import { createHmac, randomBytes } from "node:crypto";
|
|
14
14
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
15
15
|
import { attachChannelToResult } from "openclaw/plugin-sdk/channel-send-result";
|
|
16
|
-
|
|
16
|
+
//#region extensions/slack/src/outbound-adapter.ts
|
|
17
17
|
function toSlackOutboundResult(result) {
|
|
18
18
|
const { channelId, ...delivery } = result;
|
|
19
19
|
return attachChannelToResult("slack", channelId === void 0 ? delivery : {
|
|
@@ -44,7 +44,7 @@ function readSlackRenderedPresentation(slackData) {
|
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
47
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-C-8wY0lK.mjs").then((n) => n.n));
|
|
48
48
|
function resolveSlackSendIdentity(identity) {
|
|
49
49
|
if (!identity) return;
|
|
50
50
|
const username = normalizeOptionalString(identity.name);
|
|
@@ -254,4 +254,5 @@ const slackOutbound = {
|
|
|
254
254
|
}));
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
+
//#endregion
|
|
257
258
|
export { slackOutbound };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { f as resolveSlackReplyToMode, o as resolveDefaultSlackAccountId } from "./accounts-
|
|
3
|
-
import { n as formatSlackTarget } from "./target-parsing-
|
|
4
|
-
import { D as buildSlackCompleteBlocksFallbackText, E as buildSlackBlocksFallbackText, F as truncateSlackTextByUtf8Bytes, H as SLACK_SESSION_LINK_ACTION_ID, M as SLACK_TEXT_LIMIT, N as countSlackTextUtf8Bytes, P as truncateSlackText, Q as normalizeSlackOutboundText, b as hasSlackNativeDataBlock, k as SLACK_EDIT_TEXT_MAX_BYTES, l as qualifySlackRoutePeerId, st as escapeSlackMrkdwn } from "./session-status-
|
|
5
|
-
import { M as resolveSlackUserAllowed, O as normalizeSlackAllowOwnerEntry, b as writeLruMapEntry, o as formatSlackError, v as pruneExpiredMapEntries, y as readLruMapEntry } from "./probe-
|
|
6
|
-
import { a as prepareSlackReply, l as resolveSlackReplyRenderPlan, s as resolveSlackReplyBlocks } from "./reply-blocks-
|
|
7
|
-
import { n as resolveSlackReplyThreadTs } from "./thread-ts-
|
|
8
|
-
import { C as hasSlackTableBlock, D as buildSlackEditTextPayload, E as resolveSlackMessageText$1, T as resolveSlackBlocksText, a as editSlackRenderedMessage, b as formatSlackFileReference, d as reactSlackMessage, i as editSlackMessage, m as removeSlackReaction, n as deleteSlackMessage, w as isSlackUnfurlAttachment, x as formatSlackFileReferenceList } from "./actions-
|
|
9
|
-
import { c as hasSlackThreadParticipationWithPersistence, i as clearSlackThreadFailureNotice, l as recordSlackThreadFailureNotice, m as buildSlackNativeDataDeliveryPlan, o as hasSlackThreadFailureNotice, p as hasSlackMessageIdentity, s as hasSlackThreadParticipation, t as sendMessageSlack, u as recordSlackThreadParticipation } from "./send-
|
|
10
|
-
import { n as resolveSlackChannelConfig } from "./policy-
|
|
11
|
-
import { C as resolveSlackChatType, E as stripSlackMentionsForCommandDetection, S as normalizeSlackChannelType, T as readSlackAssistantThreadContext, _ as appendSlackStream, b as stopSlackStream, c as resolveSlackRoutingContext, g as SlackStreamNotDeliveredError, h as resolveSlackEffectiveAllowFrom, i as resolveSlackRoomContextHints, l as registerSlackSessionRun, m as resolveSlackCommandIngress, p as authorizeSlackBotRoomMessage, r as trackSlackDraftMessage, s as authorizeSlackDirectMessage, u as resolveSlackThreadContext, v as markSlackStreamFallbackDelivered, w as buildSlackAssistantThreadMetadata, y as startSlackStream } from "./monitor-
|
|
12
|
-
import { a as emitSlackMessageSentHooks, i as sanitizeSlackMonitorReplyPayload, n as deliverReplies, t as createSlackReplyDeliveryPlan } from "./replies-
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { f as resolveSlackReplyToMode, o as resolveDefaultSlackAccountId } from "./accounts-msihSF3-.mjs";
|
|
3
|
+
import { n as formatSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
4
|
+
import { D as buildSlackCompleteBlocksFallbackText, E as buildSlackBlocksFallbackText, F as truncateSlackTextByUtf8Bytes, H as SLACK_SESSION_LINK_ACTION_ID, M as SLACK_TEXT_LIMIT, N as countSlackTextUtf8Bytes, P as truncateSlackText, Q as normalizeSlackOutboundText, b as hasSlackNativeDataBlock, k as SLACK_EDIT_TEXT_MAX_BYTES, l as qualifySlackRoutePeerId, st as escapeSlackMrkdwn } from "./session-status-Dv8wNBEt.mjs";
|
|
5
|
+
import { M as resolveSlackUserAllowed, O as normalizeSlackAllowOwnerEntry, b as writeLruMapEntry, o as formatSlackError, v as pruneExpiredMapEntries, y as readLruMapEntry } from "./probe-IiHogLQN.mjs";
|
|
6
|
+
import { a as prepareSlackReply, l as resolveSlackReplyRenderPlan, s as resolveSlackReplyBlocks } from "./reply-blocks-Ca-raz2z.mjs";
|
|
7
|
+
import { n as resolveSlackReplyThreadTs } from "./thread-ts-Cvt7WD6B.mjs";
|
|
8
|
+
import { C as hasSlackTableBlock, D as buildSlackEditTextPayload, E as resolveSlackMessageText$1, T as resolveSlackBlocksText, a as editSlackRenderedMessage, b as formatSlackFileReference, d as reactSlackMessage, i as editSlackMessage, m as removeSlackReaction, n as deleteSlackMessage, w as isSlackUnfurlAttachment, x as formatSlackFileReferenceList } from "./actions-By7tvpvv.mjs";
|
|
9
|
+
import { c as hasSlackThreadParticipationWithPersistence, i as clearSlackThreadFailureNotice, l as recordSlackThreadFailureNotice, m as buildSlackNativeDataDeliveryPlan, o as hasSlackThreadFailureNotice, p as hasSlackMessageIdentity, s as hasSlackThreadParticipation, t as sendMessageSlack, u as recordSlackThreadParticipation } from "./send-C-8wY0lK.mjs";
|
|
10
|
+
import { n as resolveSlackChannelConfig } from "./policy-yhn48xf5.mjs";
|
|
11
|
+
import { C as resolveSlackChatType, E as stripSlackMentionsForCommandDetection, S as normalizeSlackChannelType, T as readSlackAssistantThreadContext, _ as appendSlackStream, b as stopSlackStream, c as resolveSlackRoutingContext, g as SlackStreamNotDeliveredError, h as resolveSlackEffectiveAllowFrom, i as resolveSlackRoomContextHints, l as registerSlackSessionRun, m as resolveSlackCommandIngress, p as authorizeSlackBotRoomMessage, r as trackSlackDraftMessage, s as authorizeSlackDirectMessage, u as resolveSlackThreadContext, v as markSlackStreamFallbackDelivered, w as buildSlackAssistantThreadMetadata, y as startSlackStream } from "./monitor-CV6Z6FKP.mjs";
|
|
12
|
+
import { a as emitSlackMessageSentHooks, i as sanitizeSlackMonitorReplyPayload, n as deliverReplies, t as createSlackReplyDeliveryPlan } from "./replies-MRkrg3rC.mjs";
|
|
13
13
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
14
14
|
import { resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
|
|
15
15
|
import { buildChannelProgressDraftLine, compactChannelProgressDraftLine, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createChannelProgressWorkCounter, createDraftStreamLoop, createFinalizableDraftLifecycle, createLivePreviewLifecycle, createMessageReceiptFromOutboundResults, resolveAgentOutboundIdentity, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelProgressDraftConfig, resolveChannelProgressDraftMaxLineChars, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages, selectPlanChecklistSteps } from "openclaw/plugin-sdk/channel-outbound";
|
|
@@ -45,7 +45,7 @@ import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
|
45
45
|
import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
46
46
|
import { DEFAULT_GROUP_HISTORY_LIMIT, buildHistoryContextFromEntries, buildInboundHistoryFromEntries } from "openclaw/plugin-sdk/reply-history";
|
|
47
47
|
import { createChannelPreflightAudio, formatAudioTranscriptForAgent } from "openclaw/plugin-sdk/media-understanding-runtime";
|
|
48
|
-
|
|
48
|
+
//#region extensions/slack/src/monitor/message-handler/timestamp.ts
|
|
49
49
|
const SLACK_TIMESTAMP_RE = /^\d+(?:\.\d+)?$/;
|
|
50
50
|
const MAX_SAFE_SLACK_TIMESTAMP_SECONDS = Number.MAX_SAFE_INTEGER / 1e3;
|
|
51
51
|
function resolveSlackTimestampMs(ts) {
|
|
@@ -57,7 +57,8 @@ function resolveSlackTimestampMs(ts) {
|
|
|
57
57
|
});
|
|
58
58
|
return seconds === void 0 ? void 0 : Math.round(seconds * 1e3);
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-helpers.ts
|
|
61
62
|
function resolveSlackBotLoopProtection(prepared) {
|
|
62
63
|
const senderBotId = prepared.message.bot_id;
|
|
63
64
|
if (!senderBotId) return;
|
|
@@ -139,7 +140,8 @@ async function resolveSlackStreamRecipientTeamId(params) {
|
|
|
139
140
|
}
|
|
140
141
|
return params.fallbackTeamId;
|
|
141
142
|
}
|
|
142
|
-
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region extensions/slack/src/draft-stream.ts
|
|
143
145
|
const DEFAULT_THROTTLE_MS = 1e3;
|
|
144
146
|
function createSlackDraftStream(params) {
|
|
145
147
|
const maxChars = Math.min(params.maxChars ?? 8e3, SLACK_TEXT_LIMIT);
|
|
@@ -313,7 +315,8 @@ function createSlackDraftStream(params) {
|
|
|
313
315
|
channelId: () => streamMessage?.channelId
|
|
314
316
|
};
|
|
315
317
|
}
|
|
316
|
-
|
|
318
|
+
//#endregion
|
|
319
|
+
//#region extensions/slack/src/stream-mode.ts
|
|
317
320
|
function resolveSlackStreamingConfig(params) {
|
|
318
321
|
return {
|
|
319
322
|
mode: params.streaming?.mode ?? "progress",
|
|
@@ -362,7 +365,8 @@ function applyAppendOnlyStreamUpdate(params) {
|
|
|
362
365
|
changed: true
|
|
363
366
|
};
|
|
364
367
|
}
|
|
365
|
-
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region extensions/slack/src/progress-blocks.ts
|
|
366
370
|
const SLACK_PROGRESS_FIELD_MAX = 1800;
|
|
367
371
|
const DEFAULT_SLACK_PROGRESS_DETAIL_MAX_CHARS = 120;
|
|
368
372
|
const DEFAULT_SLACK_PROGRESS_TASK_DETAIL_MAX_CHARS = 48;
|
|
@@ -747,7 +751,8 @@ function reconcileSlackNativeTaskChunks(params) {
|
|
|
747
751
|
}
|
|
748
752
|
};
|
|
749
753
|
}
|
|
750
|
-
|
|
754
|
+
//#endregion
|
|
755
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-progress-render.ts
|
|
751
756
|
function resolveStructuredProgressLines(lines) {
|
|
752
757
|
return lines.map((line) => {
|
|
753
758
|
if (typeof line !== "string") return line;
|
|
@@ -788,7 +793,8 @@ function isSlackProgressTitleText(text, snapshot, explicitTitle) {
|
|
|
788
793
|
const title = normalizeProgressText(combineProgressHeadlineAndExplanation(explicitTitle ?? (snapshot.statusHeadlineFormat === "plain" ? void 0 : snapshot.statusHeadline), snapshot.planExplanationFormat === "plain" ? void 0 : snapshot.planExplanation));
|
|
789
794
|
return title.length > 0 && title.includes(candidate);
|
|
790
795
|
}
|
|
791
|
-
|
|
796
|
+
//#endregion
|
|
797
|
+
//#region extensions/slack/src/monitor/message-handler/preview-finalize.ts
|
|
792
798
|
function buildExpectedSlackEditText(params) {
|
|
793
799
|
const trimmedText = params.text.trim();
|
|
794
800
|
if (trimmedText) return normalizeSlackOutboundText(trimmedText);
|
|
@@ -873,7 +879,8 @@ async function finalizeSlackPreviewEdit(params) {
|
|
|
873
879
|
throw err;
|
|
874
880
|
}
|
|
875
881
|
}
|
|
876
|
-
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-progress-card.ts
|
|
877
884
|
const MAX_VISIBLE_WORK_LINKS = 5;
|
|
878
885
|
function createSlackDraftProgressCardRuntime(params) {
|
|
879
886
|
const { cfg, prepared, slackClient } = params.setup;
|
|
@@ -1001,7 +1008,8 @@ function formatSlackProgressDraftLine(line) {
|
|
|
1001
1008
|
enclosingStyle: "italic"
|
|
1002
1009
|
})}_`;
|
|
1003
1010
|
}
|
|
1004
|
-
|
|
1011
|
+
//#endregion
|
|
1012
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-progress-native.ts
|
|
1005
1013
|
function createSlackNativeProgressTransport(params) {
|
|
1006
1014
|
const { replyPlan } = params.setup;
|
|
1007
1015
|
const { delivery } = params;
|
|
@@ -1062,7 +1070,8 @@ function createSlackNativeProgressTransport(params) {
|
|
|
1062
1070
|
waitForStart
|
|
1063
1071
|
};
|
|
1064
1072
|
}
|
|
1065
|
-
|
|
1073
|
+
//#endregion
|
|
1074
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-progress.ts
|
|
1066
1075
|
function createSlackProgressRuntime(runtimeParams) {
|
|
1067
1076
|
const { setup, delivery } = runtimeParams;
|
|
1068
1077
|
const { cfg, hasSlackCustomIdentity, prepared, replyPlan, runtime, slackIdentity, slackStreaming, slackProgressStyle, quietProgress, shouldUseDraftStream, useStreaming, previewStreamingEnabled } = setup;
|
|
@@ -1537,7 +1546,8 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1537
1546
|
updateDraftFromPartial
|
|
1538
1547
|
};
|
|
1539
1548
|
}
|
|
1540
|
-
|
|
1549
|
+
//#endregion
|
|
1550
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-setup.ts
|
|
1541
1551
|
async function createSlackDispatchSetup(prepared) {
|
|
1542
1552
|
const { ctx, account, message, route } = prepared;
|
|
1543
1553
|
const slackClient = prepared.eventScope?.client ?? ctx.app.client;
|
|
@@ -1755,7 +1765,8 @@ async function createSlackDispatchSetup(prepared) {
|
|
|
1755
1765
|
useStreaming
|
|
1756
1766
|
};
|
|
1757
1767
|
}
|
|
1758
|
-
|
|
1768
|
+
//#endregion
|
|
1769
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-streaming.ts
|
|
1759
1770
|
function createSlackStreamingDeliveryRuntime(setup) {
|
|
1760
1771
|
const { isThreadReply, messageSentHookContext, messageSentHookTarget, prepared, replyDeliveryMode, replyPlan, runtime, slackClient, slackClientOptions, slackIdentity, slackStreamFallbackTeamId } = setup;
|
|
1761
1772
|
const { account, ctx, forcedReplyThreadTs, message, slackMessageMetadata } = prepared;
|
|
@@ -2084,7 +2095,8 @@ function createSlackStreamingDeliveryRuntime(setup) {
|
|
|
2084
2095
|
resetDeliveryTracker: () => deliveredKeys.clear()
|
|
2085
2096
|
});
|
|
2086
2097
|
}
|
|
2087
|
-
|
|
2098
|
+
//#endregion
|
|
2099
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch.ts
|
|
2088
2100
|
function formatSlackGroupThreadReply(text, participant) {
|
|
2089
2101
|
return `**${participant.name.replace(/[\\`*_{}[\]()<>#!|]/g, "\\$&").replace(/\s+/g, " ")}**\n${text}`;
|
|
2090
2102
|
}
|
|
@@ -2443,7 +2455,8 @@ async function dispatchSlackMessageWithSetup(setup, beginSessionRun, turnAdoptio
|
|
|
2443
2455
|
logVerbose(`slack: delivered ${finalCount} repl${finalCount === 1 ? "y" : "ies"} to ${prepared.replyTarget}`);
|
|
2444
2456
|
}
|
|
2445
2457
|
}
|
|
2446
|
-
|
|
2458
|
+
//#endregion
|
|
2459
|
+
//#region extensions/slack/src/agent-context.ts
|
|
2447
2460
|
function normalizeEntity(value) {
|
|
2448
2461
|
const entity = asOptionalRecord(value);
|
|
2449
2462
|
const type = normalizeOptionalString(entity?.type);
|
|
@@ -2481,7 +2494,8 @@ function normalizeSlackAppContextEntities(value) {
|
|
|
2481
2494
|
return normalized ? [normalized] : [];
|
|
2482
2495
|
});
|
|
2483
2496
|
}
|
|
2484
|
-
|
|
2497
|
+
//#endregion
|
|
2498
|
+
//#region extensions/slack/src/monitor/thread.ts
|
|
2485
2499
|
const THREAD_STARTER_CACHE = /* @__PURE__ */ new Map();
|
|
2486
2500
|
const THREAD_STARTER_CACHE_TTL_MS = 216e5;
|
|
2487
2501
|
const THREAD_STARTER_CACHE_MAX = 2e3;
|
|
@@ -2662,7 +2676,8 @@ async function resolveSlackChannelHistory(params) {
|
|
|
2662
2676
|
}
|
|
2663
2677
|
return messages.slice(0, params.limit).toReversed();
|
|
2664
2678
|
}
|
|
2665
|
-
|
|
2679
|
+
//#endregion
|
|
2680
|
+
//#region extensions/slack/src/monitor/message-handler/preflight-audio.ts
|
|
2666
2681
|
function isSlackAudioFile(file) {
|
|
2667
2682
|
if (file.subtype === "slack_audio") return true;
|
|
2668
2683
|
if ((file.mimetype?.split(";")[0]?.trim().toLowerCase())?.startsWith("audio/")) return true;
|
|
@@ -2705,12 +2720,13 @@ const sendSlackPreflightAudioTranscriptEcho = slackPreflightAudio.send.bind(slac
|
|
|
2705
2720
|
async function discardSlackPreflightMedia(media) {
|
|
2706
2721
|
await Promise.allSettled((media ?? []).map((entry) => fs.rm(entry.path, { force: true })));
|
|
2707
2722
|
}
|
|
2708
|
-
|
|
2723
|
+
//#endregion
|
|
2724
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-content.ts
|
|
2709
2725
|
const SLACK_MENTION_RESOLUTION_CONCURRENCY = 4;
|
|
2710
2726
|
const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
2711
2727
|
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
2712
2728
|
const MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS = 2e3;
|
|
2713
|
-
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-
|
|
2729
|
+
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-By7tvpvv.mjs").then((n) => n._));
|
|
2714
2730
|
function formatSlackUnavailableMedia(params) {
|
|
2715
2731
|
let fileReferences = params.files?.map((file) => `${formatSlackFileReference(file)} unavailable (${file.reason})`).join(", ");
|
|
2716
2732
|
if (fileReferences && fileReferences.length > MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS) fileReferences = `${truncateUtf16Safe(fileReferences, MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS)}; … (file references truncated)`;
|
|
@@ -2818,7 +2834,8 @@ async function resolveSlackMessageContent(params) {
|
|
|
2818
2834
|
mentionStripPatterns
|
|
2819
2835
|
} : null;
|
|
2820
2836
|
}
|
|
2821
|
-
|
|
2837
|
+
//#endregion
|
|
2838
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-dm-history.ts
|
|
2822
2839
|
function resolveSlackDmHistoryLimit(params) {
|
|
2823
2840
|
const override = params.userId ? params.account.config.dms?.[params.userId]?.historyLimit : void 0;
|
|
2824
2841
|
return resolvePromptHistoryLimit(override ?? params.defaultLimit, 0);
|
|
@@ -2891,14 +2908,16 @@ async function resolveSlackDmHistoryContext(params) {
|
|
|
2891
2908
|
};
|
|
2892
2909
|
}
|
|
2893
2910
|
}
|
|
2894
|
-
|
|
2911
|
+
//#endregion
|
|
2912
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context-root.ts
|
|
2895
2913
|
function isSlackThreadAuthorCurrentBot(params) {
|
|
2896
2914
|
const { identity, author } = params;
|
|
2897
2915
|
if (identity.botUserId && author.userId && author.userId === identity.botUserId) return true;
|
|
2898
2916
|
if (identity.botId && author.botId && author.botId === identity.botId) return true;
|
|
2899
2917
|
return false;
|
|
2900
2918
|
}
|
|
2901
|
-
|
|
2919
|
+
//#endregion
|
|
2920
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-room-history.ts
|
|
2902
2921
|
const SLACK_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
|
|
2903
2922
|
const SLACK_HISTORY_MEDIA_MAX_BYTES = 10485760;
|
|
2904
2923
|
const SLACK_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1e3;
|
|
@@ -3053,15 +3072,17 @@ async function resolveSlackHistoryMedia(params) {
|
|
|
3053
3072
|
attempted
|
|
3054
3073
|
};
|
|
3055
3074
|
}
|
|
3056
|
-
|
|
3075
|
+
//#endregion
|
|
3076
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-session-presentation.ts
|
|
3057
3077
|
function resolveSlackGroupSessionSubject(params) {
|
|
3058
3078
|
const channelName = normalizeOptionalString(params.channelName);
|
|
3059
3079
|
const workspaceName = normalizeOptionalString(params.installationIdentity?.kind === "workspace" && params.installationIdentity.teamId === params.workspaceId ? params.installationIdentity.teamName : void 0);
|
|
3060
3080
|
if (channelName && workspaceName) return `${workspaceName} #${channelName}`;
|
|
3061
3081
|
return `Slack Channel (Workspace ID: ${params.workspaceId}, Channel ID: ${params.channelId})`;
|
|
3062
3082
|
}
|
|
3063
|
-
|
|
3064
|
-
|
|
3083
|
+
//#endregion
|
|
3084
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
3085
|
+
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-By7tvpvv.mjs").then((n) => n._));
|
|
3065
3086
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
3066
3087
|
function formatSlackThreadLabelSnippet(text) {
|
|
3067
3088
|
return truncateUtf16Safe(text.replace(/\s+/g, " "), 80);
|
|
@@ -3268,7 +3289,8 @@ async function resolveSlackThreadContextData(params) {
|
|
|
3268
3289
|
threadStarterMedia
|
|
3269
3290
|
};
|
|
3270
3291
|
}
|
|
3271
|
-
|
|
3292
|
+
//#endregion
|
|
3293
|
+
//#region src/channels/mention-gating.ts
|
|
3272
3294
|
function resolveBotThreadMentionPolicy(params) {
|
|
3273
3295
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
3274
3296
|
requireMention: params.requireMention,
|
|
@@ -3279,11 +3301,13 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
3279
3301
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
3280
3302
|
};
|
|
3281
3303
|
}
|
|
3282
|
-
|
|
3304
|
+
//#endregion
|
|
3305
|
+
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/channel-mention-gating
|
|
3283
3306
|
var channel_mention_gating_exports = /* @__PURE__ */ __exportAll({ resolveBotThreadMentionPolicy: () => resolveBotThreadMentionPolicy });
|
|
3284
3307
|
import * as import_openclaw_plugin_sdk_channel_mention_gating from "openclaw/plugin-sdk/channel-mention-gating";
|
|
3285
3308
|
__reExport(channel_mention_gating_exports, import_openclaw_plugin_sdk_channel_mention_gating);
|
|
3286
|
-
|
|
3309
|
+
//#endregion
|
|
3310
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-thread-mentions.ts
|
|
3287
3311
|
async function resolveSlackThreadMentionPolicy(params) {
|
|
3288
3312
|
const { ctx, account, message, conversation, thread } = params;
|
|
3289
3313
|
const { isRoom, isDirectMessage, channelConfig } = conversation;
|
|
@@ -3317,7 +3341,8 @@ async function resolveSlackThreadMentionPolicy(params) {
|
|
|
3317
3341
|
implicitMentionKinds
|
|
3318
3342
|
});
|
|
3319
3343
|
}
|
|
3320
|
-
|
|
3344
|
+
//#endregion
|
|
3345
|
+
//#region extensions/slack/src/monitor/message-handler/subteam-mentions.ts
|
|
3321
3346
|
const SUBTEAM_MENTION_RE = /<!subteam\^([A-Z0-9]+)(?:\|[^>]*)?>/gi;
|
|
3322
3347
|
const SUBTEAM_MEMBER_CACHE_TTL_MS = 3e5;
|
|
3323
3348
|
const subteamMemberCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3382,7 +3407,8 @@ async function isSlackSubteamMentionForBot(params) {
|
|
|
3382
3407
|
})).has(botUserId)) return true;
|
|
3383
3408
|
return false;
|
|
3384
3409
|
}
|
|
3385
|
-
|
|
3410
|
+
//#endregion
|
|
3411
|
+
//#region extensions/slack/src/monitor/message-handler/prepare.ts
|
|
3386
3412
|
const mentionRegexCache = /* @__PURE__ */ new WeakMap();
|
|
3387
3413
|
const SLACK_ANY_MENTION_RE = /<@[^>]+>|<!subteam\^[^>]+>/;
|
|
3388
3414
|
const SLACK_USER_MENTION_RE = /<@([^>|]+)(?:\|[^>]+)?>/g;
|
|
@@ -4324,4 +4350,5 @@ async function prepareSlackMessage(params) {
|
|
|
4324
4350
|
ackReactionPromise
|
|
4325
4351
|
};
|
|
4326
4352
|
}
|
|
4353
|
+
//#endregion
|
|
4327
4354
|
export { dispatchPreparedSlackMessage, prepareSlackMessage };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as normalizeSlackWebhookPath, t as handleSlackHttpRequest } from "./registry-
|
|
1
|
+
import { r as normalizeSlackWebhookPath, t as handleSlackHttpRequest } from "./registry-DizWcnNp.mjs";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
|
3
|
-
|
|
3
|
+
//#region extensions/slack/src/http/plugin-routes.ts
|
|
4
4
|
function resolveSlackWebhookPaths(config) {
|
|
5
5
|
const slack = config.channels?.slack;
|
|
6
6
|
const accountConfigs = slack?.accounts ?? {};
|
|
@@ -18,4 +18,5 @@ function registerSlackPluginHttpRoutes(api) {
|
|
|
18
18
|
handler: async (req, res) => await handleSlackHttpRequest(req, res)
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
+
//#endregion
|
|
21
22
|
export { registerSlackPluginHttpRoutes as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as buildSlackChannelPolicyScope, r as buildSlackChannelIdCandidates } from "./session-status-
|
|
2
|
-
import { j as resolveSlackUserAllowListForTeam, k as normalizeSlackSlug } from "./probe-
|
|
1
|
+
import { i as buildSlackChannelPolicyScope, r as buildSlackChannelIdCandidates } from "./session-status-Dv8wNBEt.mjs";
|
|
2
|
+
import { j as resolveSlackUserAllowListForTeam, k as normalizeSlackSlug } from "./probe-IiHogLQN.mjs";
|
|
3
3
|
import { applyChannelMatchMeta, buildChannelKeyCandidates } from "openclaw/plugin-sdk/channel-targets";
|
|
4
4
|
import { firstDefined } from "openclaw/plugin-sdk/allow-from";
|
|
5
5
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
6
|
-
|
|
6
|
+
//#region extensions/slack/src/monitor/channel-config.ts
|
|
7
7
|
function resolveSlackChannelLabel(params) {
|
|
8
8
|
const channelName = params.channelName?.trim();
|
|
9
9
|
if (channelName) return `#${normalizeSlackSlug(channelName) || channelName}`;
|
|
@@ -52,9 +52,11 @@ function resolveSlackChannelConfig(params) {
|
|
|
52
52
|
};
|
|
53
53
|
return applyChannelMatchMeta(result, match);
|
|
54
54
|
}
|
|
55
|
-
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region extensions/slack/src/monitor/policy.ts
|
|
56
57
|
function isSlackChannelAllowedByPolicy(params) {
|
|
57
58
|
if (params.groupPolicy === "disabled") return false;
|
|
58
59
|
return params.groupPolicy !== "allowlist" || params.channelAllowlistConfigured && params.channelAllowed;
|
|
59
60
|
}
|
|
61
|
+
//#endregion
|
|
60
62
|
export { resolveSlackChannelConfig as n, resolveSlackChannelLabel as r, isSlackChannelAllowedByPolicy as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { p as formatSlackBotTokenIdentityWarning } from "./accounts-
|
|
3
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { p as formatSlackBotTokenIdentityWarning } from "./accounts-msihSF3-.mjs";
|
|
3
|
+
import { a as parseSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { isRecord, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -16,7 +16,7 @@ import { parseRetryAfterHeaderSeconds, retryAsync } from "openclaw/plugin-sdk/re
|
|
|
16
16
|
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
|
17
17
|
import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
|
|
18
18
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
19
|
-
|
|
19
|
+
//#region extensions/slack/src/monitor/allow-list.ts
|
|
20
20
|
const SLACK_SLUG_CACHE_MAX = 512;
|
|
21
21
|
const SLACK_STABLE_USER_ID_RE = /^[ubw][a-z0-9]+$/;
|
|
22
22
|
const slackSlugCache = /* @__PURE__ */ new Map();
|
|
@@ -113,7 +113,8 @@ function resolveSlackUserAllowListForTeam(params) {
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region extensions/slack/src/client-options.ts
|
|
117
118
|
const SLACK_DEFAULT_RETRY_OPTIONS = {
|
|
118
119
|
retries: 2,
|
|
119
120
|
factor: 2,
|
|
@@ -285,7 +286,8 @@ function resolveSlackLookupClientOptions(options = {}, dispatcher = resolveSlack
|
|
|
285
286
|
resolved.timeout ??= SLACK_READ_TIMEOUT_MS;
|
|
286
287
|
return resolved;
|
|
287
288
|
}
|
|
288
|
-
|
|
289
|
+
//#endregion
|
|
290
|
+
//#region extensions/slack/src/monitor/lru-map-cache.ts
|
|
289
291
|
/** LRU-touch read: move hit to newest so pruneMapToMaxSize keeps active keys. */
|
|
290
292
|
function readLruMapEntry(cache, cacheKey) {
|
|
291
293
|
const cached = cache.get(cacheKey);
|
|
@@ -303,7 +305,8 @@ function writeLruMapEntry(cache, cacheKey, entry, maxEntries) {
|
|
|
303
305
|
function pruneExpiredMapEntries(cache, now) {
|
|
304
306
|
for (const [key, entry] of cache) if (entry.expiresAt <= now) cache.delete(key);
|
|
305
307
|
}
|
|
306
|
-
|
|
308
|
+
//#endregion
|
|
309
|
+
//#region extensions/slack/src/client.ts
|
|
307
310
|
const SLACK_WRITE_CLIENT_CACHE_MAX = 32;
|
|
308
311
|
const SLACK_STARTUP_AUTH_TIMEOUT_MS = 1e4;
|
|
309
312
|
const SLACK_STARTUP_AUTH_RETRY_BUDGET_MS = 35e3;
|
|
@@ -389,7 +392,8 @@ function getSlackListenerWriteClient(params) {
|
|
|
389
392
|
else if (!cached) slackListenerWriteClientCache.set(params.listenerClient, { teamId });
|
|
390
393
|
return client;
|
|
391
394
|
}
|
|
392
|
-
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region extensions/slack/src/cursor-pages.ts
|
|
393
397
|
const SLACK_CURSOR_PAGE_LIMIT = 1e4;
|
|
394
398
|
const fetchSlackChannelListPage = (client, cursor) => client.conversations.list({
|
|
395
399
|
types: "public_channel,private_channel",
|
|
@@ -412,7 +416,8 @@ async function collectSlackCursorPages(params) {
|
|
|
412
416
|
}
|
|
413
417
|
throw new Error(`Slack cursor pagination exceeded ${SLACK_CURSOR_PAGE_LIMIT} pages`);
|
|
414
418
|
}
|
|
415
|
-
|
|
419
|
+
//#endregion
|
|
420
|
+
//#region extensions/slack/src/errors.ts
|
|
416
421
|
const NO_ERROR_DETAIL = "no error detail";
|
|
417
422
|
const MAX_ERROR_CAUSE_DEPTH = 32;
|
|
418
423
|
function getSlackWebApiErrorData(error) {
|
|
@@ -523,7 +528,8 @@ function formatSlackErrorWithCauses(error, fallback, seen) {
|
|
|
523
528
|
function formatSlackError(error, fallback = NO_ERROR_DETAIL) {
|
|
524
529
|
return formatSlackErrorWithCauses(error, fallback, /* @__PURE__ */ new Set());
|
|
525
530
|
}
|
|
526
|
-
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region extensions/slack/src/monitor/ingress-identity.ts
|
|
527
533
|
const SLACK_USER_NAME_KIND = "plugin:slack-user-name";
|
|
528
534
|
const SLACK_WORKSPACE_USER_ID_KIND = "plugin:slack-workspace-user-id";
|
|
529
535
|
function normalizeSlackUserId(raw) {
|
|
@@ -623,7 +629,8 @@ function createSlackIngressSubject(params) {
|
|
|
623
629
|
}
|
|
624
630
|
};
|
|
625
631
|
}
|
|
626
|
-
|
|
632
|
+
//#endregion
|
|
633
|
+
//#region extensions/slack/src/probe.ts
|
|
627
634
|
var probe_exports = /* @__PURE__ */ __exportAll({ probeSlack: () => probeSlack });
|
|
628
635
|
async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
629
636
|
const dispatcher = createSlackProbeDispatcher(timeoutMs);
|
|
@@ -683,4 +690,5 @@ async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
|
683
690
|
await dispatcher.destroy().catch(() => void 0);
|
|
684
691
|
}
|
|
685
692
|
}
|
|
693
|
+
//#endregion
|
|
686
694
|
export { resolveSlackAllowListMatch as A, resolveSlackLookupClientOptions as C, allowListMatches as D, resolveSlackWriteClientOptions as E, resolveSlackUserAllowed as M, normalizeSlackAllowOwnerEntry as O, SLACK_WRITE_RETRY_OPTIONS as S, resolveSlackWebClientOptions as T, getSlackWriteClient as _, slackIngressIdentity as a, writeLruMapEntry as b, collectSlackCursorPages as c, createSlackReadClient as d, createSlackStartupAuthClient as f, getSlackListenerWriteClient as g, createSlackWriteClient as h, createSlackIngressSubject as i, resolveSlackUserAllowListForTeam as j, normalizeSlackSlug as k, fetchSlackChannelListPage as l, createSlackWebClient as m, probe_exports as n, formatSlackError as o, createSlackTokenCacheKey as p, SLACK_USER_NAME_KIND as r, getSlackWebApiErrorData as s, probeSlack as t, createSlackLookupClient as u, pruneExpiredMapEntries as v, resolveSlackMonitorDispatchers as w, SLACK_DEFAULT_RETRY_OPTIONS as x, readLruMapEntry as y };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { resolveGlobalMap } from "openclaw/plugin-sdk/global-singleton";
|
|
2
|
-
|
|
2
|
+
//#region extensions/slack/src/http/paths.ts
|
|
3
3
|
function normalizeSlackWebhookPath(path) {
|
|
4
4
|
const trimmed = path?.trim();
|
|
5
5
|
if (!trimmed) return "/slack/events";
|
|
6
6
|
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region extensions/slack/src/http/registry.ts
|
|
9
10
|
const slackHttpRoutes = resolveGlobalMap(Symbol.for("openclaw.slack.httpRoutes.v1"));
|
|
10
11
|
function registerSlackHttpHandler(params) {
|
|
11
12
|
const normalizedPath = normalizeSlackWebhookPath(params.path);
|
|
@@ -31,4 +32,5 @@ async function handleSlackHttpRequest(req, res) {
|
|
|
31
32
|
await handler(req, res);
|
|
32
33
|
return true;
|
|
33
34
|
}
|
|
35
|
+
//#endregion
|
|
34
36
|
export { registerSlackHttpHandler as n, normalizeSlackWebhookPath as r, handleSlackHttpRequest as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { o as formatSlackError } from "./probe-
|
|
2
|
-
import { d as parseSlackMessageEvent, f as requireSlackMessageEvent, x as SLACK_SOCKET_RECONNECT_POLICY } from "./monitor-
|
|
1
|
+
import { o as formatSlackError } from "./probe-IiHogLQN.mjs";
|
|
2
|
+
import { d as parseSlackMessageEvent, f as requireSlackMessageEvent, x as SLACK_SOCKET_RECONNECT_POLICY } from "./monitor-CV6Z6FKP.mjs";
|
|
3
3
|
import { asOptionalRecord, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { computeBackoff, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { createNodeProxyAgent } from "openclaw/plugin-sdk/fetch-runtime";
|
|
6
6
|
import { isIP } from "node:net";
|
|
7
7
|
import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress";
|
|
8
8
|
import { WebSocket, startWebSocketKeepalive } from "openclaw/plugin-sdk/websocket-runtime";
|
|
9
|
-
|
|
9
|
+
//#region extensions/slack/src/monitor/relay-source.ts
|
|
10
10
|
const SLACK_RELAY_ROUTE_KINDS = /* @__PURE__ */ new Set([
|
|
11
11
|
"user_group",
|
|
12
12
|
"thread_affinity",
|
|
@@ -251,4 +251,5 @@ function formatRelayClose(code, reason) {
|
|
|
251
251
|
const text = reason.toString("utf8");
|
|
252
252
|
return text ? `Slack relay websocket closed (${code} ${text})` : `Slack relay websocket closed (${code})`;
|
|
253
253
|
}
|
|
254
|
+
//#endregion
|
|
254
255
|
export { SLACK_RELAY_MAX_PAYLOAD_BYTES, SlackRelayMalformedFrameError, buildRelayWebSocketOptions, buildRelayWebSocketUrl, monitorSlackRelaySource, parseRelayFrame, requireSlackMessageEvent };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as isSlackNativeResponseUrlRejection, M as SLACK_TEXT_LIMIT, S as isSlackInvalidBlocksResponse, Z as markdownToSlackMrkdwnChunks, b as hasSlackNativeDataBlock } from "./session-status-
|
|
2
|
-
import { n as iterateSlackReplyDeliveryMessages, o as resolveSlackReplyBlockResolution, t as hasSlackReplyStructuredContent } from "./reply-blocks-
|
|
3
|
-
import { n as resolveSlackReplyThreadTs } from "./thread-ts-
|
|
4
|
-
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, t as sendMessageSlack } from "./send-
|
|
5
|
-
import { a as SlackResponseAlreadyReportedError, o as createSlackResponseUrlBudget } from "./monitor-
|
|
1
|
+
import { C as isSlackNativeResponseUrlRejection, M as SLACK_TEXT_LIMIT, S as isSlackInvalidBlocksResponse, Z as markdownToSlackMrkdwnChunks, b as hasSlackNativeDataBlock } from "./session-status-Dv8wNBEt.mjs";
|
|
2
|
+
import { n as iterateSlackReplyDeliveryMessages, o as resolveSlackReplyBlockResolution, t as hasSlackReplyStructuredContent } from "./reply-blocks-Ca-raz2z.mjs";
|
|
3
|
+
import { n as resolveSlackReplyThreadTs } from "./thread-ts-Cvt7WD6B.mjs";
|
|
4
|
+
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, t as sendMessageSlack } from "./send-C-8wY0lK.mjs";
|
|
5
|
+
import { a as SlackResponseAlreadyReportedError, o as createSlackResponseUrlBudget } from "./monitor-CV6Z6FKP.mjs";
|
|
6
6
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
7
7
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
8
8
|
import { deliverTextOrMediaReply, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -12,7 +12,7 @@ import { SILENT_REPLY_TOKEN, chunkMarkdownTextWithMode, isSilentReplyText } from
|
|
|
12
12
|
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
13
13
|
import { createAcceptedChannelDeliveryResult, createChannelPartialDeliveryError, getGroupThreadDeliverySession } from "openclaw/plugin-sdk/channel-inbound";
|
|
14
14
|
import { buildCanonicalSentMessageHookContext, createInternalHookEvent, fireAndForgetHook, toInternalMessageSentContext, toPluginMessageContext, toPluginMessageSentEvent, triggerInternalHook } from "openclaw/plugin-sdk/hook-runtime";
|
|
15
|
-
|
|
15
|
+
//#region extensions/slack/src/message-sent-hook.ts
|
|
16
16
|
function emitSlackMessageSentHooks(params) {
|
|
17
17
|
const hookRunner = getGlobalHookRunner();
|
|
18
18
|
const enabled = hookRunner?.hasHooks("message_sent") ?? false;
|
|
@@ -33,7 +33,8 @@ function emitSlackMessageSentHooks(params) {
|
|
|
33
33
|
if (enabled) fireAndForgetHook(Promise.resolve(hookRunner.runMessageSent(toPluginMessageSentEvent(canonical), toPluginMessageContext(canonical))), "slack: message_sent plugin hook failed");
|
|
34
34
|
if (params.sessionKeyForInternalHooks) fireAndForgetHook(triggerInternalHook(createInternalHookEvent("message", "sent", params.sessionKeyForInternalHooks, toInternalMessageSentContext(canonical))), "slack: message:sent internal hook failed");
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region extensions/slack/src/monitor/replies.ts
|
|
37
38
|
function compactSlackResponseUrlFallback(messages) {
|
|
38
39
|
if (messages.length <= 1) return [...messages];
|
|
39
40
|
if (messages.every((message) => !message.blocks?.length)) return chunkSlackTextAtHardLimit(messages.map((message) => message.text).join("")).map((text) => ({
|
|
@@ -420,4 +421,5 @@ async function deliverSlackSlashReplies(params) {
|
|
|
420
421
|
});
|
|
421
422
|
}
|
|
422
423
|
}
|
|
424
|
+
//#endregion
|
|
423
425
|
export { emitSlackMessageSentHooks as a, sanitizeSlackMonitorReplyPayload as i, deliverReplies as n, deliverSlackSlashReplies as r, createSlackReplyDeliveryPlan as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as buildSlackDataVisualizationBlock, D as buildSlackCompleteBlocksFallbackText, E as buildSlackBlocksFallbackText, I as SLACK_BUTTON_ACTION_IDS, J as encodeSlackQuestionAction, O as renderSlackBlockFallbackText, P as truncateSlackText, V as SLACK_SELECT_ACTION_IDS, X as chunkSlackMrkdwnText, Z as markdownToSlackMrkdwnChunks, at as renderSlackMessagePresentationChartFallbackText, b as hasSlackNativeDataBlock, et as hasSlackDataVisualizationBlock, g as appendSlackNativeDataFallbackText, ht as parseSlackBlocksInput, it as countSlackDataTableCellCharacters, nt as buildSlackDataTableBlock, pt as SLACK_SECTION_TEXT_MAX, rt as countSlackDataTableBlocksCellCharacters, ut as encodeSlackApprovalAction, v as buildSlackNativeDataAccessibilityText } from "./session-status-
|
|
1
|
+
import { $ as buildSlackDataVisualizationBlock, D as buildSlackCompleteBlocksFallbackText, E as buildSlackBlocksFallbackText, I as SLACK_BUTTON_ACTION_IDS, J as encodeSlackQuestionAction, O as renderSlackBlockFallbackText, P as truncateSlackText, V as SLACK_SELECT_ACTION_IDS, X as chunkSlackMrkdwnText, Z as markdownToSlackMrkdwnChunks, at as renderSlackMessagePresentationChartFallbackText, b as hasSlackNativeDataBlock, et as hasSlackDataVisualizationBlock, g as appendSlackNativeDataFallbackText, ht as parseSlackBlocksInput, it as countSlackDataTableCellCharacters, nt as buildSlackDataTableBlock, pt as SLACK_SECTION_TEXT_MAX, rt as countSlackDataTableBlocksCellCharacters, ut as encodeSlackApprovalAction, v as buildSlackNativeDataAccessibilityText } from "./session-status-Dv8wNBEt.mjs";
|
|
2
2
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
4
4
|
import { legacyInteractiveReplyToPresentation, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveMessagePresentationButtonAction, resolveMessagePresentationOptionAction } from "openclaw/plugin-sdk/interactive-runtime";
|
|
5
5
|
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
6
6
|
import { resolveAskUserQuestionOptionIndex, resolveAskUserQuestionOptionIndices, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
7
|
-
|
|
7
|
+
//#region extensions/slack/src/blocks-render.ts
|
|
8
8
|
const SLACK_BUTTON_URL_MAX = 3e3;
|
|
9
9
|
function buildSlackPlainText(text, maxLength) {
|
|
10
10
|
return {
|
|
@@ -268,7 +268,8 @@ function buildSlackPresentationSelectElements(block, selectIndex, requireComplet
|
|
|
268
268
|
}))
|
|
269
269
|
}] : [];
|
|
270
270
|
}
|
|
271
|
-
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region extensions/slack/src/authored-text.ts
|
|
272
273
|
function normalizeComparableSlackText(text) {
|
|
273
274
|
return text.trim().replace(/\s+/g, " ");
|
|
274
275
|
}
|
|
@@ -297,7 +298,8 @@ function resolveSlackAuthoredTextPlacement(params) {
|
|
|
297
298
|
if (!text) return "none";
|
|
298
299
|
return params.renderedInBlocks || isSlackAuthoredTextRepresentedInFragments(text, params.renderedTextFragments ?? []) || isSlackAuthoredTextRepresentedInFragments(text, params.interactive?.blocks.flatMap((block) => block.type === "text" ? [block.text] : []) ?? []) ? "blocks" : "outside-blocks";
|
|
299
300
|
}
|
|
300
|
-
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region extensions/slack/src/reply-blocks.ts
|
|
301
303
|
function normalizeSlackReplyPayload(payload) {
|
|
302
304
|
const previousSlackData = asOptionalRecord(payload.channelData?.slack) ?? {};
|
|
303
305
|
const { authoredPresentationText: _authoredPresentationText, ...slackData } = previousSlackData;
|
|
@@ -645,4 +647,5 @@ function resolveSlackReplyBlocks(payload) {
|
|
|
645
647
|
const { segments } = resolveSlackReplyBlockResolution(payload);
|
|
646
648
|
return segments.length === 1 && segments[0]?.kind === "blocks" ? segments[0].blocks : void 0;
|
|
647
649
|
}
|
|
650
|
+
//#endregion
|
|
648
651
|
export { prepareSlackReply as a, resolveSlackReplyDeliveryMessages as c, buildSlackInteractiveBlocks as d, buildSlackPresentationBlocks as f, parseSlackReplyBlockSegments as i, resolveSlackReplyRenderPlan as l, iterateSlackReplyDeliveryMessages as n, resolveSlackReplyBlockResolution as o, buildSlackPresentationBlocksIfComplete as p, normalizeSlackReplyPayload as r, resolveSlackReplyBlocks as s, hasSlackReplyStructuredContent as t, resolveSlackAuthoredTextPlacement as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-
|
|
3
|
-
import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
3
|
+
import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-IiHogLQN.mjs";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/slack/src/resolve-channels.ts
|
|
6
6
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveSlackChannelAllowlist: () => resolveSlackChannelAllowlist });
|
|
7
7
|
function parseSlackChannelMention(raw) {
|
|
8
8
|
const trimmed = raw.trim();
|
|
@@ -67,4 +67,5 @@ async function resolveSlackChannelAllowlist(params) {
|
|
|
67
67
|
};
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
|
+
//#endregion
|
|
70
71
|
export { resolve_channels_exports as n, resolveSlackChannelAllowlist as t };
|