@openclaw/slack 2026.10.5-beta.4 → 2026.10.10-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-inspect-D58VVDjk.mjs → account-inspect-CmkKiSb9.mjs} +1 -1
- package/dist/.setup/{accounts-BMg9YLIv.mjs → accounts-msihSF3-.mjs} +1 -1
- package/dist/.setup/{action-runtime-BiRZNsIG.mjs → action-runtime-CgYsBWl6.mjs} +5 -5
- package/dist/.setup/action-runtime.runtime-WS3mGjut.mjs +1 -0
- package/dist/.setup/{actions-KGKwTAKO.mjs → actions-CafoV8hS.mjs} +4 -4
- package/dist/.setup/{approval-handler.runtime-DYrsG2Ox.mjs → approval-handler.runtime-Pty8hAZ9.mjs} +8 -8
- package/dist/.setup/{approval-message-updates-CwdDew9i.mjs → approval-message-updates-DCnXFLf3.mjs} +1 -1
- package/dist/.setup/{channel-C7MY-Hhg.mjs → channel-B-jnk0Gl.mjs} +51 -55
- package/dist/.setup/{channel-type-NjX2SwvS.mjs → channel-type-BrbGGbzI.mjs} +3 -3
- package/dist/.setup/{channel.setup-BFpQowO3.mjs → channel.setup-u6QQdbTa.mjs} +4 -4
- package/dist/.setup/{config-schema-BH0K9-Um.mjs → config-schema-DNnh6bWU.mjs} +1 -1
- package/dist/.setup/{directory-config-BEDZPfDn.mjs → directory-config-Cjj0N8R0.mjs} +1 -1
- package/dist/.setup/{directory-live-FipfeCwt.mjs → directory-live-BIKD-5B_.mjs} +2 -2
- package/dist/.setup/http-C9sM-FXe.mjs +2 -0
- package/dist/.setup/{message-tool-api-C7im5ETh.mjs → message-tool-api-BS5ekEA_.mjs} +2 -2
- package/dist/.setup/{monitor-BnN2px0N.mjs → monitor-DmJ-Qbx4.mjs} +181 -145
- package/dist/.setup/{outbound-adapter-4HdGq-8r.mjs → outbound-adapter-BlN9vmT-.mjs} +4 -4
- package/dist/.setup/{pipeline.runtime-ByPbC6MN.mjs → pipeline.runtime-DOf1Ghcz.mjs} +66 -129
- package/dist/.setup/{plugin-routes-B8tooDLj.mjs → plugin-routes-D4qozHVn.mjs} +1 -1
- package/dist/.setup/{policy-BaY9_eh1.mjs → policy-D4eNyn8m.mjs} +2 -2
- package/dist/.setup/{probe-CyX52GtD.mjs → probe-IiHogLQN.mjs} +3 -9
- package/dist/.setup/{registry-CIbMfuf8.mjs → registry-DizWcnNp.mjs} +4 -11
- package/dist/.setup/{relay-source-CVfH-fBO.mjs → relay-source-CUVJNz6R.mjs} +2 -2
- package/dist/.setup/{replies-WmfwvQxc.mjs → replies-Cs9SqIIs.mjs} +4 -4
- package/dist/.setup/{reply-blocks-rqHQ_3pr.mjs → reply-blocks-CoZ_dGM_.mjs} +1 -1
- package/dist/.setup/{resolve-channels-B96cgprw.mjs → resolve-channels-DRRhElwz.mjs} +1 -1
- package/dist/.setup/{resolve-users-Xz9aPdns.mjs → resolve-users-Cz8e17ky.mjs} +1 -1
- package/dist/.setup/runtime-setter-api-Cx_PV-xu.mjs +2 -0
- package/dist/.setup/{scopes-aMcMHhXk.mjs → scopes-DfQVi8Jw.mjs} +1 -1
- package/dist/.setup/secret-contract-api-DB6CMdgc.mjs +2 -0
- package/dist/.setup/{send-CLmsR42r.mjs → send-pi6r24yv.mjs} +5 -5
- package/dist/.setup/{session-status-CcXe10zN.mjs → session-status-DQY4hZLd.mjs} +73 -29
- package/dist/.setup/setup-plugin-api-B18kDKtr.mjs +2 -0
- package/dist/.setup/{setup-surface-368jx6Uc.mjs → setup-surface-9WVQgYCT.mjs} +6 -6
- package/dist/.setup/{shared-CtprVh_G.mjs → shared-DpHCoKy2.mjs} +7 -6
- package/dist/.setup/{slash-dispatch.runtime-Dzwj6TPI.mjs → slash-dispatch.runtime-BlBuHX9x.mjs} +3 -2
- package/dist/account-inspect-api.js +1 -1
- package/dist/api.js +15 -14
- package/dist/channel-config-api.js +1 -2
- package/dist/channel-plugin-api.js +1 -2
- package/dist/directory-contract-api.js +1 -2
- package/dist/doctor-contract-api.js +1 -2
- package/dist/http-routes-api.js +1 -2
- package/dist/index.js +1 -1
- package/dist/message-tool-api.js +1 -2
- package/dist/runtime-api.js +11 -11
- package/dist/runtime-setter-api.js +1 -2
- package/dist/secret-contract-api.js +1 -2
- package/dist/security-contract-api.js +1 -2
- package/dist/setup-entry.js +3 -3
- package/dist/setup-plugin-api.js +1 -2
- package/node_modules/typebox/build/value/clean/from_object.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +5 -5
- package/dist/.setup/action-runtime.runtime-C5xceJoS.mjs +0 -2
- package/dist/.setup/runtime-setter-api-CMFvhrAr.mjs +0 -3
- package/dist/.setup/secret-contract-api-DmUVxIRs.mjs +0 -3
- package/dist/.setup/setup-plugin-api-D92P5p51.mjs +0 -3
- package/dist/.setup/{security-audit-C1nOGzJa.mjs → security-audit-DFGiFLqd.mjs} +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-
|
|
1
|
+
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-msihSF3-.mjs";
|
|
2
2
|
import { a as parseSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { c as resolveSlackReplyDeliveryMessages, i as parseSlackReplyBlockSegments, o as resolveSlackReplyBlockResolution, r as normalizeSlackReplyPayload, u as resolveSlackAuthoredTextPlacement } from "./reply-blocks-
|
|
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-DQY4hZLd.mjs";
|
|
4
|
+
import { c as resolveSlackReplyDeliveryMessages, i as parseSlackReplyBlockSegments, o as resolveSlackReplyBlockResolution, r as normalizeSlackReplyPayload, u as resolveSlackAuthoredTextPlacement } from "./reply-blocks-CoZ_dGM_.mjs";
|
|
5
5
|
import { r as resolveSlackThreadTsValue } from "./thread-ts-Cvt7WD6B.mjs";
|
|
6
6
|
import { t as mergeSlackSendResults } from "./send-results-eeOu_HYm.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -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-pi6r24yv.mjs").then((n) => n.n));
|
|
48
48
|
function resolveSlackSendIdentity(identity) {
|
|
49
49
|
if (!identity) return;
|
|
50
50
|
const username = normalizeOptionalString(identity.name);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { f as resolveSlackReplyToMode } from "./accounts-
|
|
2
|
+
import { f as resolveSlackReplyToMode, o as resolveDefaultSlackAccountId } from "./accounts-msihSF3-.mjs";
|
|
3
3
|
import { n as formatSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
4
|
-
import {
|
|
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-
|
|
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-DQY4hZLd.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-CoZ_dGM_.mjs";
|
|
7
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-
|
|
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-
|
|
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-CafoV8hS.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-pi6r24yv.mjs";
|
|
10
|
+
import { n as resolveSlackChannelConfig } from "./policy-D4eNyn8m.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-DmJ-Qbx4.mjs";
|
|
12
|
+
import { a as emitSlackMessageSentHooks, i as sanitizeSlackMonitorReplyPayload, n as deliverReplies, t as createSlackReplyDeliveryPlan } from "./replies-Cs9SqIIs.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";
|
|
@@ -23,15 +23,15 @@ import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-run
|
|
|
23
23
|
import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement, isReplyPayloadNonTerminalToolErrorWarning, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
24
24
|
import { asDateTimestampMs, asFiniteNumberInRange, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, resolvePromptHistoryLimit } from "openclaw/plugin-sdk/number-runtime";
|
|
25
25
|
import { hash } from "node:crypto";
|
|
26
|
-
import { ensureConfiguredBindingRouteReady, resolveConversationLabel } from "openclaw/plugin-sdk/conversation-runtime";
|
|
27
26
|
import { resolveChannelImplicitMentions } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
28
27
|
import fs from "node:fs/promises";
|
|
29
28
|
import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
30
29
|
import { formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
31
30
|
import { filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist, shouldIncludeSupplementalContext } from "openclaw/plugin-sdk/security-runtime";
|
|
32
31
|
import { mimeTypeFromFilePath, normalizeMimeType } from "openclaw/plugin-sdk/media-mime";
|
|
32
|
+
import { ensureConfiguredBindingRouteReady, resolveConversationLabel } from "openclaw/plugin-sdk/conversation-runtime";
|
|
33
33
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
34
|
-
import {
|
|
34
|
+
import { getSessionEntryAsync, readSessionUpdatedAtAsync, resolveChannelResetConfig, resolveStorePath, updateLastRoute } from "openclaw/plugin-sdk/session-store-runtime";
|
|
35
35
|
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
36
36
|
import { enqueueRoutedSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
37
37
|
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
@@ -147,12 +147,9 @@ function createSlackDraftStream(params) {
|
|
|
147
147
|
const maxChars = Math.min(params.maxChars ?? 8e3, SLACK_TEXT_LIMIT);
|
|
148
148
|
const throttleMs = Math.max(250, params.throttleMs ?? DEFAULT_THROTTLE_MS);
|
|
149
149
|
const send = params.send ?? sendMessageSlack;
|
|
150
|
-
const edit = params.edit ?? editSlackMessage;
|
|
151
150
|
const remove = params.remove ?? deleteSlackMessage;
|
|
152
151
|
let streamMessage;
|
|
153
|
-
let cleanupGeneration = -1;
|
|
154
152
|
let untrackConversationBoundary;
|
|
155
|
-
let lastVisibleUpdate;
|
|
156
153
|
let lastSentKey = "";
|
|
157
154
|
let preserveHumanReplies = false;
|
|
158
155
|
const streamState = {
|
|
@@ -162,15 +159,14 @@ function createSlackDraftStream(params) {
|
|
|
162
159
|
const normalizeUpdate = (update) => typeof update === "string" ? { text: update } : update;
|
|
163
160
|
const clearMessageId = () => {
|
|
164
161
|
streamMessage = void 0;
|
|
165
|
-
lastVisibleUpdate = void 0;
|
|
166
162
|
lastSentKey = "";
|
|
167
163
|
};
|
|
168
|
-
const editPreview = (message,
|
|
164
|
+
const editPreview = (message, update) => (params.edit ?? (update.textIsSlackMrkdwn ? editSlackRenderedMessage : editSlackMessage))(message.channelId, message.messageId, update.text, {
|
|
169
165
|
cfg: params.cfg,
|
|
170
166
|
token: params.token,
|
|
171
167
|
accountId: params.accountId,
|
|
172
168
|
...params.eventScope ? { client: params.eventScope.client } : {},
|
|
173
|
-
...blocks ? { blocks } : {}
|
|
169
|
+
...update.blocks ? { blocks: update.blocks } : {}
|
|
174
170
|
});
|
|
175
171
|
const sendOrEditStreamMessage = async (pending) => {
|
|
176
172
|
const update = normalizeUpdate(pending);
|
|
@@ -182,19 +178,24 @@ function createSlackDraftStream(params) {
|
|
|
182
178
|
params.warn?.(`slack stream preview stopped (text length ${trimmed.length} > ${maxChars})`);
|
|
183
179
|
return;
|
|
184
180
|
}
|
|
185
|
-
const
|
|
186
|
-
|
|
181
|
+
const visibleUpdate = {
|
|
182
|
+
text: update.escapeMentions ? normalizeSlackOutboundText(trimmed, {
|
|
183
|
+
mentions: "escape-controls",
|
|
184
|
+
tableMode: resolveMarkdownTableMode({
|
|
185
|
+
cfg: params.cfg,
|
|
186
|
+
channel: "slack",
|
|
187
|
+
accountId: params.accountId ?? resolveDefaultSlackAccountId(params.cfg)
|
|
188
|
+
})
|
|
189
|
+
}) : trimmed,
|
|
190
|
+
...update.blocks ? { blocks: update.blocks } : {},
|
|
191
|
+
...update.escapeMentions ? { textIsSlackMrkdwn: true } : {}
|
|
192
|
+
};
|
|
193
|
+
const sentKey = JSON.stringify(visibleUpdate);
|
|
187
194
|
if (sentKey === lastSentKey) return;
|
|
188
195
|
lastSentKey = sentKey;
|
|
189
|
-
const generation = lifecycle.generation;
|
|
190
196
|
try {
|
|
191
197
|
if (streamMessage) {
|
|
192
|
-
|
|
193
|
-
await editPreview(message, trimmed, blocks);
|
|
194
|
-
if (streamMessage === message) lastVisibleUpdate = {
|
|
195
|
-
text: trimmed,
|
|
196
|
-
...blocks ? { blocks } : {}
|
|
197
|
-
};
|
|
198
|
+
await editPreview(streamMessage, visibleUpdate);
|
|
198
199
|
return;
|
|
199
200
|
}
|
|
200
201
|
const threadTs = params.resolveThreadTs?.();
|
|
@@ -206,23 +207,21 @@ function createSlackDraftStream(params) {
|
|
|
206
207
|
messageTs,
|
|
207
208
|
onInterveningMessage: () => forceNewMessage("human")
|
|
208
209
|
});
|
|
209
|
-
const pendingBoundary = params.conversationChannelId ? trackMessage(params.conversationChannelId) : void 0;
|
|
210
|
-
untrackConversationBoundary = pendingBoundary?.stop;
|
|
211
210
|
await lifecycle.createMessage(async () => {
|
|
212
|
-
const sent = await send(params.target,
|
|
211
|
+
const sent = await send(params.target, visibleUpdate.text, {
|
|
213
212
|
cfg: params.cfg,
|
|
214
213
|
token: params.token,
|
|
215
214
|
accountId: params.accountId,
|
|
216
215
|
threadTs,
|
|
217
216
|
identity: params.identity,
|
|
218
217
|
eventScope: params.eventScope,
|
|
218
|
+
...visibleUpdate.textIsSlackMrkdwn ? { textIsSlackMrkdwn: true } : {},
|
|
219
219
|
...params.metadata ? { metadata: params.metadata } : {},
|
|
220
|
-
...blocks ? { blocks } : {}
|
|
220
|
+
...visibleUpdate.blocks ? { blocks: visibleUpdate.blocks } : {}
|
|
221
221
|
});
|
|
222
222
|
return sent.channelId && sent.messageId ? {
|
|
223
223
|
channelId: sent.channelId,
|
|
224
|
-
messageId: sent.messageId
|
|
225
|
-
generation
|
|
224
|
+
messageId: sent.messageId
|
|
226
225
|
} : void 0;
|
|
227
226
|
}, (sentMessage) => {
|
|
228
227
|
if (!sentMessage) {
|
|
@@ -233,22 +232,13 @@ function createSlackDraftStream(params) {
|
|
|
233
232
|
}
|
|
234
233
|
const { channelId, messageId } = sentMessage;
|
|
235
234
|
streamMessage = sentMessage;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
...blocks ? { blocks } : {}
|
|
239
|
-
};
|
|
240
|
-
if (pendingBoundary && params.conversationChannelId === channelId) pendingBoundary.setMessageTs(messageId);
|
|
241
|
-
else {
|
|
242
|
-
stopTrackingConversationBoundary();
|
|
243
|
-
untrackConversationBoundary = trackMessage(channelId, messageId).stop;
|
|
244
|
-
}
|
|
235
|
+
stopTrackingConversationBoundary();
|
|
236
|
+
untrackConversationBoundary = trackMessage(channelId, messageId).stop;
|
|
245
237
|
return true;
|
|
246
238
|
}, { defer: true });
|
|
247
239
|
} catch (err) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
streamState.stopped = true;
|
|
251
|
-
}
|
|
240
|
+
stopTrackingConversationBoundary();
|
|
241
|
+
streamState.stopped = true;
|
|
252
242
|
params.warn?.(`slack stream preview failed: ${formatSlackError(err)}`);
|
|
253
243
|
}
|
|
254
244
|
};
|
|
@@ -263,7 +253,6 @@ function createSlackDraftStream(params) {
|
|
|
263
253
|
clearMessageId,
|
|
264
254
|
isValidMessageId: (value) => typeof value === "object" && value !== null,
|
|
265
255
|
deleteMessage: async (message) => {
|
|
266
|
-
if (message.generation > cleanupGeneration) return false;
|
|
267
256
|
if (!message.retained && !(preserveHumanReplies && message.detachedByHuman)) await remove(message.channelId, message.messageId, {
|
|
268
257
|
token: params.token,
|
|
269
258
|
accountId: params.accountId,
|
|
@@ -279,36 +268,17 @@ function createSlackDraftStream(params) {
|
|
|
279
268
|
untrackConversationBoundary?.();
|
|
280
269
|
untrackConversationBoundary = void 0;
|
|
281
270
|
};
|
|
282
|
-
const dropDetachedMessages = () => {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
preserveHumanReplies = false;
|
|
286
|
-
cleanupGeneration = generation;
|
|
287
|
-
});
|
|
288
|
-
};
|
|
271
|
+
const dropDetachedMessages = () => lifecycle.cleanupPending(() => {
|
|
272
|
+
preserveHumanReplies = false;
|
|
273
|
+
});
|
|
289
274
|
const discardPendingAndStopTracking = async () => {
|
|
290
|
-
const generation = lifecycle.generation;
|
|
291
275
|
await discardPending();
|
|
292
|
-
|
|
276
|
+
stopTrackingConversationBoundary();
|
|
293
277
|
};
|
|
294
278
|
const clear = async (options) => {
|
|
295
|
-
const generation = lifecycle.generation;
|
|
296
|
-
let clearingMessage = streamMessage;
|
|
297
279
|
await lifecycle.clearWithStop(async () => {
|
|
298
|
-
|
|
299
|
-
await discardPendingAndStopTracking();
|
|
300
|
-
if (generation === lifecycle.generation) {
|
|
301
|
-
clearingMessage = streamMessage;
|
|
302
|
-
clearMessageId();
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
cleanupGeneration = generation;
|
|
280
|
+
await discardPendingAndStopTracking();
|
|
306
281
|
preserveHumanReplies = options?.preserveHumanReplies === true;
|
|
307
|
-
}, {
|
|
308
|
-
readMessageId: () => clearingMessage,
|
|
309
|
-
clearMessageId: () => {
|
|
310
|
-
clearingMessage = void 0;
|
|
311
|
-
}
|
|
312
282
|
});
|
|
313
283
|
};
|
|
314
284
|
const forceNewMessage = (reason = "turn") => {
|
|
@@ -325,21 +295,11 @@ function createSlackDraftStream(params) {
|
|
|
325
295
|
};
|
|
326
296
|
const finalizeMessage = async (messageId, editFinal) => {
|
|
327
297
|
const currentMessage = streamMessage;
|
|
328
|
-
|
|
329
|
-
if (!currentMessage || currentMessage.messageId !== messageId || !previousUpdate) return false;
|
|
330
|
-
const { channelId } = currentMessage;
|
|
298
|
+
if (!currentMessage || currentMessage.messageId !== messageId) return false;
|
|
331
299
|
await editFinal();
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
return true;
|
|
336
|
-
}
|
|
337
|
-
try {
|
|
338
|
-
await editPreview(currentMessage, previousUpdate.text, previousUpdate.blocks);
|
|
339
|
-
} catch (err) {
|
|
340
|
-
params.warn?.(`slack stream preview restore failed: ${formatSlackError(err)}`);
|
|
341
|
-
}
|
|
342
|
-
return false;
|
|
300
|
+
currentMessage.retained = true;
|
|
301
|
+
stopTrackingConversationBoundary();
|
|
302
|
+
return true;
|
|
343
303
|
};
|
|
344
304
|
params.log?.(`slack stream preview ready (maxChars=${maxChars}, throttleMs=${throttleMs})`);
|
|
345
305
|
return {
|
|
@@ -1330,14 +1290,16 @@ function createSlackProgressRuntime(runtimeParams) {
|
|
|
1330
1290
|
}
|
|
1331
1291
|
draftStream.update(preambleOnlyProgress ? {
|
|
1332
1292
|
text: previewText,
|
|
1293
|
+
escapeMentions: true,
|
|
1333
1294
|
allowNewMessage: typeof latestLine !== "object" || latestLine.complete !== false,
|
|
1334
1295
|
...snapshot.preparedBlocks ? { blocks: buildSlackProgressTextBlocks(snapshot.preparedBlocks) } : {}
|
|
1335
1296
|
} : cardBlocks ? {
|
|
1336
1297
|
text: progressCard.resolveCardText(cardBlocks),
|
|
1337
1298
|
blocks: cardBlocks
|
|
1338
|
-
} : snapshot.preparedBlocks ? {
|
|
1299
|
+
} : snapshot.preparedBlocks || isProgressMode && slackProgressStyle === "compact" ? {
|
|
1339
1300
|
text: previewText,
|
|
1340
|
-
|
|
1301
|
+
...isProgressMode && slackProgressStyle === "compact" ? { escapeMentions: true } : {},
|
|
1302
|
+
...snapshot.preparedBlocks ? { blocks: buildSlackProgressTextBlocks(snapshot.preparedBlocks) } : {}
|
|
1341
1303
|
} : previewText);
|
|
1342
1304
|
if (cardBlocks) cardPostRequested = true;
|
|
1343
1305
|
if (options?.flush) await draftStream.flush();
|
|
@@ -2583,11 +2545,7 @@ async function resolveSlackThreadStarter(params) {
|
|
|
2583
2545
|
params.threadTs
|
|
2584
2546
|
]);
|
|
2585
2547
|
const cached = THREAD_STARTER_CACHE.get(cacheKey);
|
|
2586
|
-
if (cached && !params.refresh)
|
|
2587
|
-
const now = asDateTimestampMs(Date.now());
|
|
2588
|
-
if (now !== void 0 && cached.expiresAt > now) return cached.value;
|
|
2589
|
-
THREAD_STARTER_CACHE.delete(cacheKey);
|
|
2590
|
-
}
|
|
2548
|
+
if (cached && !params.refresh) return cached.value;
|
|
2591
2549
|
if (params.refresh) THREAD_STARTER_CACHE.delete(cacheKey);
|
|
2592
2550
|
try {
|
|
2593
2551
|
const message = (await params.client.conversations.replies({
|
|
@@ -2606,15 +2564,12 @@ async function resolveSlackThreadStarter(params) {
|
|
|
2606
2564
|
ts: message.ts,
|
|
2607
2565
|
files
|
|
2608
2566
|
};
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
});
|
|
2616
|
-
evictThreadStarterCache();
|
|
2617
|
-
}
|
|
2567
|
+
THREAD_STARTER_CACHE.delete(cacheKey);
|
|
2568
|
+
THREAD_STARTER_CACHE.set(cacheKey, {
|
|
2569
|
+
value: starter,
|
|
2570
|
+
expiresAt: Date.now() + THREAD_STARTER_CACHE_TTL_MS
|
|
2571
|
+
});
|
|
2572
|
+
evictThreadStarterCache();
|
|
2618
2573
|
return starter;
|
|
2619
2574
|
} catch (err) {
|
|
2620
2575
|
logVerbose(`slack thread starter fetch failed channel=${params.channelId} ts=${params.threadTs}: ${formatErrorMessage(err)}`);
|
|
@@ -2771,7 +2726,7 @@ const SLACK_MENTION_RESOLUTION_CONCURRENCY = 4;
|
|
|
2771
2726
|
const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
2772
2727
|
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
2773
2728
|
const MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS = 2e3;
|
|
2774
|
-
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-
|
|
2729
|
+
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-CafoV8hS.mjs").then((n) => n._));
|
|
2775
2730
|
function formatSlackUnavailableMedia(params) {
|
|
2776
2731
|
let fileReferences = params.files?.map((file) => `${formatSlackFileReference(file)} unavailable (${file.reason})`).join(", ");
|
|
2777
2732
|
if (fileReferences && fileReferences.length > MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS) fileReferences = `${truncateUtf16Safe(fileReferences, MAX_SLACK_UNAVAILABLE_FILE_TEXT_CHARS)}; … (file references truncated)`;
|
|
@@ -3127,7 +3082,7 @@ function resolveSlackGroupSessionSubject(params) {
|
|
|
3127
3082
|
}
|
|
3128
3083
|
//#endregion
|
|
3129
3084
|
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
3130
|
-
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-
|
|
3085
|
+
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-CafoV8hS.mjs").then((n) => n._));
|
|
3131
3086
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
3132
3087
|
function formatSlackThreadLabelSnippet(text) {
|
|
3133
3088
|
return truncateUtf16Safe(text.replace(/\s+/g, " "), 80);
|
|
@@ -3761,7 +3716,7 @@ async function prepareSlackMessage(params) {
|
|
|
3761
3716
|
agentViewThreadTs,
|
|
3762
3717
|
eventScope: opts.eventScope
|
|
3763
3718
|
});
|
|
3764
|
-
let routing = resolveMessageRouting(seedTopLevelRoomThreadBySource);
|
|
3719
|
+
let routing = await resolveMessageRouting(seedTopLevelRoomThreadBySource);
|
|
3765
3720
|
const groupThreadPeerId = isDirectMessage ? qualifySlackRoutePeerId({
|
|
3766
3721
|
id: message.user ?? "unknown",
|
|
3767
3722
|
kind: "user",
|
|
@@ -3928,15 +3883,15 @@ async function prepareSlackMessage(params) {
|
|
|
3928
3883
|
if (isRoomish && messageIngress.commandAccess.shouldBlockControlCommand) return drop("control-command-unauthorized");
|
|
3929
3884
|
const canSeedMentionedRoomThread = !seedTopLevelRoomThreadBySource && isRoom && !routing.isThreadReply && !hasBoundSession;
|
|
3930
3885
|
let seededMentionRouting;
|
|
3931
|
-
const getSeededMentionRouting = () => {
|
|
3932
|
-
seededMentionRouting ??= resolveMessageRouting(true);
|
|
3886
|
+
const getSeededMentionRouting = async () => {
|
|
3887
|
+
seededMentionRouting ??= await resolveMessageRouting(true);
|
|
3933
3888
|
return seededMentionRouting;
|
|
3934
3889
|
};
|
|
3935
3890
|
let preflightAudioTranscript;
|
|
3936
3891
|
let preflightAudioMedia;
|
|
3937
3892
|
const preflightAudioFile = findSlackPreflightAudioFile(message, { allowCaptioned: groupThreadConfigured });
|
|
3938
3893
|
if (!isBotMessage && cfg.tools?.media?.audio?.enabled !== false && (groupThreadConfigured || isRoom && shouldRequireMention && messageIngress.activationAccess.shouldSkip && mentionRegexes.length > 0) && Boolean(preflightAudioFile) && preflightAudioFile) {
|
|
3939
|
-
const preflightRouting = canSeedMentionedRoomThread ? getSeededMentionRouting() : routing;
|
|
3894
|
+
const preflightRouting = canSeedMentionedRoomThread ? await getSeededMentionRouting() : routing;
|
|
3940
3895
|
const preflightMedia = (await resolveMessageContent({
|
|
3941
3896
|
...message,
|
|
3942
3897
|
files: [preflightAudioFile],
|
|
@@ -3973,7 +3928,7 @@ async function prepareSlackMessage(params) {
|
|
|
3973
3928
|
});
|
|
3974
3929
|
wasMentioned = resolveWasMentioned(mentionRegexes);
|
|
3975
3930
|
if (canSeedMentionedRoomThread && wasMentioned) {
|
|
3976
|
-
routing = getSeededMentionRouting();
|
|
3931
|
+
routing = await getSeededMentionRouting();
|
|
3977
3932
|
if (isGroupThreadRouteExclusive({
|
|
3978
3933
|
sessionKey: routing.sessionKey,
|
|
3979
3934
|
acpBinding: Boolean(routing.configuredBinding)
|
|
@@ -4113,23 +4068,16 @@ async function prepareSlackMessage(params) {
|
|
|
4113
4068
|
inboundEventKind
|
|
4114
4069
|
}, boundMessageThreadId);
|
|
4115
4070
|
if (messageIngress.ingress.admission !== "dispatch") return drop("final-route-denied");
|
|
4116
|
-
const sessionEntry =
|
|
4071
|
+
const sessionEntry = await getSessionEntryAsync({
|
|
4117
4072
|
storePath,
|
|
4118
4073
|
sessionKey
|
|
4119
4074
|
});
|
|
4120
4075
|
const previousTimestamp = sessionEntry?.updatedAt;
|
|
4121
4076
|
const excludedMessageIds = new Set(opts.sourceMessageIds);
|
|
4122
4077
|
if (message.ts) excludedMessageIds.add(message.ts);
|
|
4123
|
-
const isHistorySessionCurrent = () => {
|
|
4124
|
-
const current = getSessionEntry({
|
|
4125
|
-
storePath,
|
|
4126
|
-
sessionKey
|
|
4127
|
-
});
|
|
4128
|
-
return current?.sessionId === sessionEntry?.sessionId && current?.lifecycleRevision === sessionEntry?.lifecycleRevision && current?.sessionStartedAt === sessionEntry?.sessionStartedAt && current?.updatedAt === 0 === (sessionEntry?.updatedAt === 0);
|
|
4129
|
-
};
|
|
4130
4078
|
const assertHistoryCurrent = () => {
|
|
4131
4079
|
opts.abortSignal?.throwIfAborted();
|
|
4132
|
-
if (opts.isRuntimePolicyCurrent?.() === false
|
|
4080
|
+
if (opts.isRuntimePolicyCurrent?.() === false) throw new Error("Slack history policy changed during recovery");
|
|
4133
4081
|
};
|
|
4134
4082
|
const dmHistoryLimit = isDirectMessage ? resolveSlackDmHistoryLimit({
|
|
4135
4083
|
account,
|
|
@@ -4191,7 +4139,7 @@ async function prepareSlackMessage(params) {
|
|
|
4191
4139
|
abortSignal: opts.abortSignal
|
|
4192
4140
|
});
|
|
4193
4141
|
const { threadLabel, threadStarterMedia } = threadContextData;
|
|
4194
|
-
|
|
4142
|
+
const { threadStarterBody, threadHistoryBody, shouldSeedInitialThreadContext } = threadContextData;
|
|
4195
4143
|
const threadScopedHistory = isThreadReply && ctx.threadHistoryScope === "thread";
|
|
4196
4144
|
let roomHistory = [];
|
|
4197
4145
|
if (isRoomish && ctx.historyLimit > 0 && (!threadScopedHistory || !shouldSeedInitialThreadContext) && sessionEntry?.updatedAt !== 0) roomHistory = await resolveSlackRoomHistory({
|
|
@@ -4207,20 +4155,9 @@ async function prepareSlackMessage(params) {
|
|
|
4207
4155
|
abortSignal: opts.abortSignal
|
|
4208
4156
|
});
|
|
4209
4157
|
const effectiveMedia = effectiveDirectMedia ?? threadStarterMedia;
|
|
4210
|
-
|
|
4158
|
+
const inboundMedia = await toInboundMediaFactsWithMetadata(effectiveMedia, { transcribed: (entry) => effectiveMedia === effectiveDirectMedia && entry === preflightAudioMedia });
|
|
4211
4159
|
opts.abortSignal?.throwIfAborted();
|
|
4212
4160
|
if (opts.isRuntimePolicyCurrent?.() === false) return drop("final-route-denied");
|
|
4213
|
-
if (isRoomish && ctx.historyLimit > 0 && !isHistorySessionCurrent()) {
|
|
4214
|
-
roomHistory = [];
|
|
4215
|
-
threadHistoryBody = void 0;
|
|
4216
|
-
threadStarterBody = void 0;
|
|
4217
|
-
shouldSeedInitialThreadContext = false;
|
|
4218
|
-
if (effectiveMedia === threadStarterMedia) inboundMedia = [];
|
|
4219
|
-
ctx.logger.warn({
|
|
4220
|
-
channelId: message.channel,
|
|
4221
|
-
sessionKey
|
|
4222
|
-
}, "Slack automatic history omitted after session changed");
|
|
4223
|
-
}
|
|
4224
4161
|
combinedBody = buildHistoryContextFromEntries({
|
|
4225
4162
|
entries: roomHistory,
|
|
4226
4163
|
currentMessage: combinedBody,
|
|
@@ -1,4 +1,4 @@
|
|
|
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) {
|
|
@@ -1,5 +1,5 @@
|
|
|
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-DQY4hZLd.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { p as formatSlackBotTokenIdentityWarning } from "./accounts-
|
|
2
|
+
import { p as formatSlackBotTokenIdentityWarning } from "./accounts-msihSF3-.mjs";
|
|
3
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";
|
|
@@ -8,7 +8,6 @@ import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
8
8
|
import { normalizeHyphenSlug, normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
9
9
|
import { compileAllowlist, resolveCompiledAllowlistMatch } from "openclaw/plugin-sdk/allow-from";
|
|
10
10
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
11
|
-
import { asDateTimestampMs } from "openclaw/plugin-sdk/number-runtime";
|
|
12
11
|
import { hash } from "node:crypto";
|
|
13
12
|
import { WebAPIRateLimitedError, WebClient } from "@slack/web-api";
|
|
14
13
|
import { addActiveManagedProxyTlsOptions, captureChannelReadAuthority, captureEffectAuthority, createHttp1EnvHttpProxyAgent, resolveEnvHttpProxyAgentOptions, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
@@ -303,13 +302,8 @@ function writeLruMapEntry(cache, cacheKey, entry, maxEntries) {
|
|
|
303
302
|
cache.set(cacheKey, entry);
|
|
304
303
|
pruneMapToMaxSize(cache, maxEntries);
|
|
305
304
|
}
|
|
306
|
-
function pruneExpiredMapEntries(cache,
|
|
307
|
-
const
|
|
308
|
-
if (now === void 0) {
|
|
309
|
-
cache.clear();
|
|
310
|
-
return;
|
|
311
|
-
}
|
|
312
|
-
for (const [key, entry] of cache) if (asDateTimestampMs(entry.expiresAt) === void 0 || entry.expiresAt <= now) cache.delete(key);
|
|
305
|
+
function pruneExpiredMapEntries(cache, now) {
|
|
306
|
+
for (const [key, entry] of cache) if (entry.expiresAt <= now) cache.delete(key);
|
|
313
307
|
}
|
|
314
308
|
//#endregion
|
|
315
309
|
//#region extensions/slack/src/client.ts
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { resolveGlobalMap } from "openclaw/plugin-sdk/global-singleton";
|
|
1
2
|
//#region extensions/slack/src/http/paths.ts
|
|
2
3
|
function normalizeSlackWebhookPath(path) {
|
|
3
4
|
const trimmed = path?.trim();
|
|
@@ -6,18 +7,10 @@ function normalizeSlackWebhookPath(path) {
|
|
|
6
7
|
}
|
|
7
8
|
//#endregion
|
|
8
9
|
//#region extensions/slack/src/http/registry.ts
|
|
9
|
-
const
|
|
10
|
-
function getSlackHttpRoutes() {
|
|
11
|
-
const globalStore = globalThis;
|
|
12
|
-
const existing = globalStore[SLACK_HTTP_ROUTES_GLOBAL_KEY];
|
|
13
|
-
if (existing instanceof Map) return existing;
|
|
14
|
-
const routes = /* @__PURE__ */ new Map();
|
|
15
|
-
globalStore[SLACK_HTTP_ROUTES_GLOBAL_KEY] = routes;
|
|
16
|
-
return routes;
|
|
17
|
-
}
|
|
10
|
+
const slackHttpRoutes = resolveGlobalMap(Symbol.for("openclaw.slack.httpRoutes.v1"));
|
|
18
11
|
function registerSlackHttpHandler(params) {
|
|
19
12
|
const normalizedPath = normalizeSlackWebhookPath(params.path);
|
|
20
|
-
const routes =
|
|
13
|
+
const routes = slackHttpRoutes;
|
|
21
14
|
if (routes.has(normalizedPath)) {
|
|
22
15
|
const suffix = params.accountId ? ` for account "${params.accountId}"` : "";
|
|
23
16
|
params.log?.(`slack: webhook path ${normalizedPath} already registered${suffix}`);
|
|
@@ -34,7 +27,7 @@ function registerSlackHttpHandler(params) {
|
|
|
34
27
|
}
|
|
35
28
|
async function handleSlackHttpRequest(req, res) {
|
|
36
29
|
const url = new URL(req.url ?? "/", "http://localhost");
|
|
37
|
-
const handler =
|
|
30
|
+
const handler = slackHttpRoutes.get(url.pathname);
|
|
38
31
|
if (!handler) return false;
|
|
39
32
|
await handler(req, res);
|
|
40
33
|
return true;
|
|
@@ -1,5 +1,5 @@
|
|
|
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-DmJ-Qbx4.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";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as iterateSlackReplyDeliveryMessages, o as resolveSlackReplyBlockResolution, t as hasSlackReplyStructuredContent } from "./reply-blocks-
|
|
1
|
+
import { C as isSlackNativeResponseUrlRejection, M as SLACK_TEXT_LIMIT, S as isSlackInvalidBlocksResponse, Z as markdownToSlackMrkdwnChunks, b as hasSlackNativeDataBlock } from "./session-status-DQY4hZLd.mjs";
|
|
2
|
+
import { n as iterateSlackReplyDeliveryMessages, o as resolveSlackReplyBlockResolution, t as hasSlackReplyStructuredContent } from "./reply-blocks-CoZ_dGM_.mjs";
|
|
3
3
|
import { n as resolveSlackReplyThreadTs } from "./thread-ts-Cvt7WD6B.mjs";
|
|
4
|
-
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, t as sendMessageSlack } from "./send-
|
|
5
|
-
import { a as SlackResponseAlreadyReportedError, o as createSlackResponseUrlBudget } from "./monitor-
|
|
4
|
+
import { h as chunkSlackTextAtHardLimit, m as buildSlackNativeDataDeliveryPlan, t as sendMessageSlack } from "./send-pi6r24yv.mjs";
|
|
5
|
+
import { a as SlackResponseAlreadyReportedError, o as createSlackResponseUrlBudget } from "./monitor-DmJ-Qbx4.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-DQY4hZLd.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";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
3
|
-
import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-
|
|
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 });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
3
|
-
import { c as collectSlackCursorPages, u as createSlackLookupClient } from "./probe-
|
|
3
|
+
import { c as collectSlackCursorPages, u as createSlackLookupClient } from "./probe-IiHogLQN.mjs";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/slack/src/resolve-users.ts
|
|
6
6
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveSlackUserAllowlist: () => resolveSlackUserAllowlist });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as createSlackReadClient, o as formatSlackError } from "./probe-
|
|
1
|
+
import { d as createSlackReadClient, o as formatSlackError } from "./probe-IiHogLQN.mjs";
|
|
2
2
|
import { isRecord, normalizeOptionalString, normalizeTrimmedStringList, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/slack/src/scopes.ts
|
|
4
4
|
function collectScopes(value, into) {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-
|
|
2
|
+
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-msihSF3-.mjs";
|
|
3
3
|
import { a as parseSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-FFE26kOV.mjs";
|
|
4
|
-
import { A as
|
|
5
|
-
import { _ as getSlackWriteClient, b as writeLruMapEntry, d as createSlackReadClient, h as createSlackWriteClient, o as formatSlackError, p as createSlackTokenCacheKey, s as getSlackWebApiErrorData } from "./probe-
|
|
4
|
+
import { A as SLACK_MESSAGE_TEXT_HARD_LIMIT, D as buildSlackCompleteBlocksFallbackText, F as truncateSlackTextByUtf8Bytes, K as resolveSlackQuestionActionIds, L as SLACK_QUESTION_FINALIZATION_BLOCKS, M as SLACK_TEXT_LIMIT, O as renderSlackBlockFallbackText, P as truncateSlackText, T as stripSlackNativeDataBlocks, X as chunkSlackMrkdwnText, Z as markdownToSlackMrkdwnChunks, b as hasSlackNativeDataBlock, gt as validateSlackBlocksArray, j as SLACK_MESSAGE_TEXT_RECOMMENDED_LIMIT, k as SLACK_EDIT_TEXT_MAX_BYTES, m as assertSlackDetachedTargetAllowed, v as buildSlackNativeDataAccessibilityText, w as renderSlackNativeDataPlainTextBlock, x as isSlackInvalidBlocksError, y as createSlackNativeDataBaseTextConsumer } from "./session-status-DQY4hZLd.mjs";
|
|
5
|
+
import { _ as getSlackWriteClient, b as writeLruMapEntry, d as createSlackReadClient, h as createSlackWriteClient, o as formatSlackError, p as createSlackTokenCacheKey, s as getSlackWebApiErrorData } from "./probe-IiHogLQN.mjs";
|
|
6
6
|
import { r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-Cvt7WD6B.mjs";
|
|
7
7
|
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.mjs";
|
|
8
|
+
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
8
9
|
import { asOptionalObjectRecord, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
10
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
11
|
import { logVerbose, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
11
12
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
12
|
-
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
13
13
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
14
14
|
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
|
15
15
|
import { createHash, createHmac } from "node:crypto";
|
|
@@ -402,7 +402,7 @@ const threadParticipation = createPersistentDedupeCache({
|
|
|
402
402
|
persistent: {
|
|
403
403
|
namespace: PERSISTENT_NAMESPACE,
|
|
404
404
|
maxEntries: PERSISTENT_MAX_ENTRIES,
|
|
405
|
-
openStore: (options) => getOptionalSlackRuntime()?.state.
|
|
405
|
+
openStore: (options) => getOptionalSlackRuntime()?.state.openKeyedStoreV2(options),
|
|
406
406
|
logError: createPluginStateErrorReporter(getOptionalSlackRuntime, "slack", "thread-participation-state", "Slack persistent thread participation state failed")
|
|
407
407
|
}
|
|
408
408
|
});
|