@openclaw/slack 2026.10.10 → 2026.10.33
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-B6bRmYmX.mjs → channel-DQKq-0IZ.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-BBzT6uKA.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-DsZUQtTM.mjs → monitor-Dcd6ymHV.mjs} +137 -78
- package/dist/.setup/{outbound-adapter-C0R5jz6S.mjs → outbound-adapter-9dbnYtL1.mjs} +9 -8
- package/dist/.setup/{pipeline.runtime-CIFVL0kf.mjs → pipeline.runtime-CdF95Pej.mjs} +69 -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-DFBDTA5Z.mjs → relay-source-BPXstGYg.mjs} +10 -4
- package/dist/.setup/{replies-7DRN46EL.mjs → replies-C60dQn3J.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-D0UY2JWF.mjs → secret-contract-vVRMoE1D.mjs} +4 -1
- 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-CtM1pm-9.mjs → setup-surface--n8VsDvV.mjs} +8 -7
- package/dist/.setup/{shared-CohTHxM1.mjs → shared-BhJHIZs1.mjs} +18 -14
- package/dist/.setup/{slash-dispatch.runtime-Bnn9a5qB.mjs → slash-dispatch.runtime-DNddQpYP.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-BhzGpUb0.mjs +0 -2
- package/dist/.setup/setup-plugin-api-D7DoueEh.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-Dcd6ymHV.mjs";
|
|
12
|
+
import { a as emitSlackMessageSentHooks, i as sanitizeSlackMonitorReplyPayload, n as deliverReplies, t as createSlackReplyDeliveryPlan } from "./replies-C60dQn3J.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;
|
|
@@ -1417,6 +1426,7 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1417
1426
|
const pushReasoningProgress = async (payload) => {
|
|
1418
1427
|
if (!payload?.text) return false;
|
|
1419
1428
|
if (!isProgressMode) {
|
|
1429
|
+
if (!previewToolProgressEnabled) return false;
|
|
1420
1430
|
const normalized = progressDraft.mergeReasoningProgress(payload.text, { snapshot: payload.isReasoningSnapshot === true }).replace(/^_(.*)_$/su, "$1").trim();
|
|
1421
1431
|
if (!normalized) return false;
|
|
1422
1432
|
const visible = await progressDraft.pushToolProgress({
|
|
@@ -1537,7 +1547,8 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1537
1547
|
updateDraftFromPartial
|
|
1538
1548
|
};
|
|
1539
1549
|
}
|
|
1540
|
-
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-setup.ts
|
|
1541
1552
|
async function createSlackDispatchSetup(prepared) {
|
|
1542
1553
|
const { ctx, account, message, route } = prepared;
|
|
1543
1554
|
const slackClient = prepared.eventScope?.client ?? ctx.app.client;
|
|
@@ -1755,7 +1766,8 @@ async function createSlackDispatchSetup(prepared) {
|
|
|
1755
1766
|
useStreaming
|
|
1756
1767
|
};
|
|
1757
1768
|
}
|
|
1758
|
-
|
|
1769
|
+
//#endregion
|
|
1770
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch-streaming.ts
|
|
1759
1771
|
function createSlackStreamingDeliveryRuntime(setup) {
|
|
1760
1772
|
const { isThreadReply, messageSentHookContext, messageSentHookTarget, prepared, replyDeliveryMode, replyPlan, runtime, slackClient, slackClientOptions, slackIdentity, slackStreamFallbackTeamId } = setup;
|
|
1761
1773
|
const { account, ctx, forcedReplyThreadTs, message, slackMessageMetadata } = prepared;
|
|
@@ -2084,7 +2096,8 @@ function createSlackStreamingDeliveryRuntime(setup) {
|
|
|
2084
2096
|
resetDeliveryTracker: () => deliveredKeys.clear()
|
|
2085
2097
|
});
|
|
2086
2098
|
}
|
|
2087
|
-
|
|
2099
|
+
//#endregion
|
|
2100
|
+
//#region extensions/slack/src/monitor/message-handler/dispatch.ts
|
|
2088
2101
|
function formatSlackGroupThreadReply(text, participant) {
|
|
2089
2102
|
return `**${participant.name.replace(/[\\`*_{}[\]()<>#!|]/g, "\\$&").replace(/\s+/g, " ")}**\n${text}`;
|
|
2090
2103
|
}
|
|
@@ -2443,7 +2456,8 @@ async function dispatchSlackMessageWithSetup(setup, beginSessionRun, turnAdoptio
|
|
|
2443
2456
|
logVerbose(`slack: delivered ${finalCount} repl${finalCount === 1 ? "y" : "ies"} to ${prepared.replyTarget}`);
|
|
2444
2457
|
}
|
|
2445
2458
|
}
|
|
2446
|
-
|
|
2459
|
+
//#endregion
|
|
2460
|
+
//#region extensions/slack/src/agent-context.ts
|
|
2447
2461
|
function normalizeEntity(value) {
|
|
2448
2462
|
const entity = asOptionalRecord(value);
|
|
2449
2463
|
const type = normalizeOptionalString(entity?.type);
|
|
@@ -2481,7 +2495,8 @@ function normalizeSlackAppContextEntities(value) {
|
|
|
2481
2495
|
return normalized ? [normalized] : [];
|
|
2482
2496
|
});
|
|
2483
2497
|
}
|
|
2484
|
-
|
|
2498
|
+
//#endregion
|
|
2499
|
+
//#region extensions/slack/src/monitor/thread.ts
|
|
2485
2500
|
const THREAD_STARTER_CACHE = /* @__PURE__ */ new Map();
|
|
2486
2501
|
const THREAD_STARTER_CACHE_TTL_MS = 216e5;
|
|
2487
2502
|
const THREAD_STARTER_CACHE_MAX = 2e3;
|
|
@@ -2662,7 +2677,8 @@ async function resolveSlackChannelHistory(params) {
|
|
|
2662
2677
|
}
|
|
2663
2678
|
return messages.slice(0, params.limit).toReversed();
|
|
2664
2679
|
}
|
|
2665
|
-
|
|
2680
|
+
//#endregion
|
|
2681
|
+
//#region extensions/slack/src/monitor/message-handler/preflight-audio.ts
|
|
2666
2682
|
function isSlackAudioFile(file) {
|
|
2667
2683
|
if (file.subtype === "slack_audio") return true;
|
|
2668
2684
|
if ((file.mimetype?.split(";")[0]?.trim().toLowerCase())?.startsWith("audio/")) return true;
|
|
@@ -2705,12 +2721,13 @@ const sendSlackPreflightAudioTranscriptEcho = slackPreflightAudio.send.bind(slac
|
|
|
2705
2721
|
async function discardSlackPreflightMedia(media) {
|
|
2706
2722
|
await Promise.allSettled((media ?? []).map((entry) => fs.rm(entry.path, { force: true })));
|
|
2707
2723
|
}
|
|
2708
|
-
|
|
2724
|
+
//#endregion
|
|
2725
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-content.ts
|
|
2709
2726
|
const SLACK_MENTION_RESOLUTION_CONCURRENCY = 4;
|
|
2710
2727
|
const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
2711
2728
|
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
2712
2729
|
const MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS = 2e3;
|
|
2713
|
-
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-
|
|
2730
|
+
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-By7tvpvv.mjs").then((n) => n._));
|
|
2714
2731
|
function formatSlackUnavailableMedia(params) {
|
|
2715
2732
|
let fileReferences = params.files?.map((file) => `${formatSlackFileReference(file)} unavailable (${file.reason})`).join(", ");
|
|
2716
2733
|
if (fileReferences && fileReferences.length > MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS) fileReferences = `${truncateUtf16Safe(fileReferences, MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS)}; … (file references truncated)`;
|
|
@@ -2818,7 +2835,8 @@ async function resolveSlackMessageContent(params) {
|
|
|
2818
2835
|
mentionStripPatterns
|
|
2819
2836
|
} : null;
|
|
2820
2837
|
}
|
|
2821
|
-
|
|
2838
|
+
//#endregion
|
|
2839
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-dm-history.ts
|
|
2822
2840
|
function resolveSlackDmHistoryLimit(params) {
|
|
2823
2841
|
const override = params.userId ? params.account.config.dms?.[params.userId]?.historyLimit : void 0;
|
|
2824
2842
|
return resolvePromptHistoryLimit(override ?? params.defaultLimit, 0);
|
|
@@ -2891,14 +2909,16 @@ async function resolveSlackDmHistoryContext(params) {
|
|
|
2891
2909
|
};
|
|
2892
2910
|
}
|
|
2893
2911
|
}
|
|
2894
|
-
|
|
2912
|
+
//#endregion
|
|
2913
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context-root.ts
|
|
2895
2914
|
function isSlackThreadAuthorCurrentBot(params) {
|
|
2896
2915
|
const { identity, author } = params;
|
|
2897
2916
|
if (identity.botUserId && author.userId && author.userId === identity.botUserId) return true;
|
|
2898
2917
|
if (identity.botId && author.botId && author.botId === identity.botId) return true;
|
|
2899
2918
|
return false;
|
|
2900
2919
|
}
|
|
2901
|
-
|
|
2920
|
+
//#endregion
|
|
2921
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-room-history.ts
|
|
2902
2922
|
const SLACK_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
|
|
2903
2923
|
const SLACK_HISTORY_MEDIA_MAX_BYTES = 10485760;
|
|
2904
2924
|
const SLACK_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1e3;
|
|
@@ -3053,15 +3073,17 @@ async function resolveSlackHistoryMedia(params) {
|
|
|
3053
3073
|
attempted
|
|
3054
3074
|
};
|
|
3055
3075
|
}
|
|
3056
|
-
|
|
3076
|
+
//#endregion
|
|
3077
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-session-presentation.ts
|
|
3057
3078
|
function resolveSlackGroupSessionSubject(params) {
|
|
3058
3079
|
const channelName = normalizeOptionalString(params.channelName);
|
|
3059
3080
|
const workspaceName = normalizeOptionalString(params.installationIdentity?.kind === "workspace" && params.installationIdentity.teamId === params.workspaceId ? params.installationIdentity.teamName : void 0);
|
|
3060
3081
|
if (channelName && workspaceName) return `${workspaceName} #${channelName}`;
|
|
3061
3082
|
return `Slack Channel (Workspace ID: ${params.workspaceId}, Channel ID: ${params.channelId})`;
|
|
3062
3083
|
}
|
|
3063
|
-
|
|
3064
|
-
|
|
3084
|
+
//#endregion
|
|
3085
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
3086
|
+
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-By7tvpvv.mjs").then((n) => n._));
|
|
3065
3087
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
3066
3088
|
function formatSlackThreadLabelSnippet(text) {
|
|
3067
3089
|
return truncateUtf16Safe(text.replace(/\s+/g, " "), 80);
|
|
@@ -3268,7 +3290,8 @@ async function resolveSlackThreadContextData(params) {
|
|
|
3268
3290
|
threadStarterMedia
|
|
3269
3291
|
};
|
|
3270
3292
|
}
|
|
3271
|
-
|
|
3293
|
+
//#endregion
|
|
3294
|
+
//#region src/channels/mention-gating.ts
|
|
3272
3295
|
function resolveBotThreadMentionPolicy(params) {
|
|
3273
3296
|
if (!params.isBotOwnedThread || params.requireMentionInBotThreads === void 0) return {
|
|
3274
3297
|
requireMention: params.requireMention,
|
|
@@ -3279,11 +3302,13 @@ function resolveBotThreadMentionPolicy(params) {
|
|
|
3279
3302
|
implicitMentionKinds: params.requireMentionInBotThreads ? params.implicitMentionKinds?.filter((kind) => kind === "native") : params.implicitMentionKinds
|
|
3280
3303
|
};
|
|
3281
3304
|
}
|
|
3282
|
-
|
|
3305
|
+
//#endregion
|
|
3306
|
+
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/channel-mention-gating
|
|
3283
3307
|
var channel_mention_gating_exports = /* @__PURE__ */ __exportAll({ resolveBotThreadMentionPolicy: () => resolveBotThreadMentionPolicy });
|
|
3284
3308
|
import * as import_openclaw_plugin_sdk_channel_mention_gating from "openclaw/plugin-sdk/channel-mention-gating";
|
|
3285
3309
|
__reExport(channel_mention_gating_exports, import_openclaw_plugin_sdk_channel_mention_gating);
|
|
3286
|
-
|
|
3310
|
+
//#endregion
|
|
3311
|
+
//#region extensions/slack/src/monitor/message-handler/prepare-thread-mentions.ts
|
|
3287
3312
|
async function resolveSlackThreadMentionPolicy(params) {
|
|
3288
3313
|
const { ctx, account, message, conversation, thread } = params;
|
|
3289
3314
|
const { isRoom, isDirectMessage, channelConfig } = conversation;
|
|
@@ -3317,7 +3342,8 @@ async function resolveSlackThreadMentionPolicy(params) {
|
|
|
3317
3342
|
implicitMentionKinds
|
|
3318
3343
|
});
|
|
3319
3344
|
}
|
|
3320
|
-
|
|
3345
|
+
//#endregion
|
|
3346
|
+
//#region extensions/slack/src/monitor/message-handler/subteam-mentions.ts
|
|
3321
3347
|
const SUBTEAM_MENTION_RE = /<!subteam\^([A-Z0-9]+)(?:\|[^>]*)?>/gi;
|
|
3322
3348
|
const SUBTEAM_MEMBER_CACHE_TTL_MS = 3e5;
|
|
3323
3349
|
const subteamMemberCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -3382,7 +3408,8 @@ async function isSlackSubteamMentionForBot(params) {
|
|
|
3382
3408
|
})).has(botUserId)) return true;
|
|
3383
3409
|
return false;
|
|
3384
3410
|
}
|
|
3385
|
-
|
|
3411
|
+
//#endregion
|
|
3412
|
+
//#region extensions/slack/src/monitor/message-handler/prepare.ts
|
|
3386
3413
|
const mentionRegexCache = /* @__PURE__ */ new WeakMap();
|
|
3387
3414
|
const SLACK_ANY_MENTION_RE = /<@[^>]+>|<!subteam\^[^>]+>/;
|
|
3388
3415
|
const SLACK_USER_MENTION_RE = /<@([^>|]+)(?:\|[^>]+)?>/g;
|
|
@@ -4324,4 +4351,5 @@ async function prepareSlackMessage(params) {
|
|
|
4324
4351
|
ackReactionPromise
|
|
4325
4352
|
};
|
|
4326
4353
|
}
|
|
4354
|
+
//#endregion
|
|
4327
4355
|
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-Dcd6ymHV.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
|
-
import { WebSocket } from "openclaw/plugin-sdk/websocket-runtime";
|
|
9
|
-
|
|
8
|
+
import { WebSocket, startWebSocketKeepalive } from "openclaw/plugin-sdk/websocket-runtime";
|
|
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",
|
|
@@ -93,7 +93,12 @@ function runRelayWebSocket(params) {
|
|
|
93
93
|
const ws = params.connection;
|
|
94
94
|
let pending = Promise.resolve();
|
|
95
95
|
return new Promise((resolve, reject) => {
|
|
96
|
+
const stopKeepalive = startWebSocketKeepalive(ws, () => {
|
|
97
|
+
ws.terminate();
|
|
98
|
+
settleReject(/* @__PURE__ */ new Error("Slack relay websocket heartbeat timed out"));
|
|
99
|
+
});
|
|
96
100
|
const cleanup = () => {
|
|
101
|
+
stopKeepalive();
|
|
97
102
|
ws.off("message", onMessage);
|
|
98
103
|
ws.off("error", onError);
|
|
99
104
|
ws.off("close", onClose);
|
|
@@ -246,4 +251,5 @@ function formatRelayClose(code, reason) {
|
|
|
246
251
|
const text = reason.toString("utf8");
|
|
247
252
|
return text ? `Slack relay websocket closed (${code} ${text})` : `Slack relay websocket closed (${code})`;
|
|
248
253
|
}
|
|
254
|
+
//#endregion
|
|
249
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-Dcd6ymHV.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 };
|