@openclaw/slack 2026.5.28 → 2026.5.31-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/{action-runtime-BOEgcnv6.js → action-runtime-DEztkt37.js} +2 -2
- package/dist/action-runtime.runtime-uN2B3l57.js +2 -0
- package/dist/{actions-zfVWcIY6.js → actions-BA_6yvPC.js} +23 -12
- package/dist/{actions.runtime-CoijPN8g.js → actions.runtime-BNL71SN3.js} +1 -1
- package/dist/api.js +7 -7
- package/dist/{approval-handler.runtime-CWz3XLfN.js → approval-handler.runtime-D0rHmHTC.js} +33 -60
- package/dist/{channel-BvEE3i26.js → channel-ClgouPGI.js} +14 -15
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-oGp4gSTP.js → channel.setup-DvU_3G7a.js} +2 -3
- package/dist/{client-DowBk5k0.js → client-qvqS9fQM.js} +20 -1
- package/dist/{config-schema-C0RewpJQ.js → config-schema-BjAjs8_6.js} +16 -0
- package/dist/contract-api.js +1 -1
- package/dist/{directory-live-BFB1pSax.js → directory-live-WZwhRYe2.js} +1 -1
- package/dist/{doctor-contract-DIMUXDHO.js → doctor-contract-DpGLNqS3.js} +2 -2
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{monitor-RVx8NyTs.js → monitor-D5FVBchh.js} +2 -2
- package/dist/{outbound-adapter-BHZMgblN.js → outbound-adapter-BxKw6eWi.js} +1 -1
- package/dist/{pipeline.runtime-CwtZdUTK.js → pipeline.runtime-Bo6reKXg.js} +54 -34
- package/dist/{probe-Djes9Fy6.js → probe-DczaQTdi.js} +1 -1
- package/dist/{provider-Do2x35qj.js → provider-DNfFBEzl.js} +65 -31
- package/dist/{replies-DkmWK7JW.js → replies-BmFpkBXm.js} +1 -1
- package/dist/{resolve-channels-zXt5f47h.js → resolve-channels-DIxJRl0F.js} +1 -1
- package/dist/{resolve-users-BLfGAz1v.js → resolve-users-B3vczJHE.js} +1 -1
- package/dist/{runtime-api-DvpUD2hw.js → runtime-api-BpGQDSTg.js} +1 -1
- package/dist/runtime-api.js +9 -9
- package/dist/{scopes-DiiHsqh1.js → scopes-Q1VjNpWb.js} +1 -1
- package/dist/{send-BURYyCXI.js → send-zvrcUvp2.js} +2 -3
- package/dist/send.runtime-iCVpfyB_.js +2 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-DJTHAguz.js → setup-surface-95xI4u2U.js} +3 -3
- package/dist/{shared-D9WMYymo.js → shared-D5tOdKwQ.js} +3 -4
- package/dist/{slash-dispatch.runtime-lsyTm_q5.js → slash-dispatch.runtime-BKo3qtpZ.js} +1 -1
- package/node_modules/@slack/bolt/README.md +1 -1
- package/node_modules/@slack/bolt/dist/App.d.ts +3 -3
- package/node_modules/@slack/bolt/dist/App.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/App.js +8 -12
- package/node_modules/@slack/bolt/dist/App.js.map +1 -1
- package/node_modules/@slack/bolt/dist/Assistant.d.ts +1 -2
- package/node_modules/@slack/bolt/dist/Assistant.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/Assistant.js.map +1 -1
- package/node_modules/@slack/bolt/dist/context/index.d.ts +5 -5
- package/node_modules/@slack/bolt/dist/context/index.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/context/index.js +7 -7
- package/node_modules/@slack/bolt/dist/context/index.js.map +1 -1
- package/node_modules/@slack/bolt/dist/index.d.ts +19 -19
- package/node_modules/@slack/bolt/dist/index.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/index.js +16 -16
- package/node_modules/@slack/bolt/dist/index.js.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.d.ts +1 -1
- package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.js +2 -0
- package/node_modules/@slack/bolt/dist/receivers/AwsLambdaReceiver.js.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/ExpressReceiver.d.ts +2 -2
- package/node_modules/@slack/bolt/dist/receivers/ExpressReceiver.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/ExpressReceiver.js +8 -1
- package/node_modules/@slack/bolt/dist/receivers/ExpressReceiver.js.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/HTTPReceiver.d.ts +2 -2
- package/node_modules/@slack/bolt/dist/receivers/HTTPReceiver.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/HTTPReceiver.js +4 -2
- package/node_modules/@slack/bolt/dist/receivers/HTTPReceiver.js.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.d.ts +1 -1
- package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.js +1 -1
- package/node_modules/@slack/bolt/dist/receivers/SocketModeReceiver.js.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/verify-request.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/verify-request.js +3 -0
- package/node_modules/@slack/bolt/dist/receivers/verify-request.js.map +1 -1
- package/node_modules/@slack/bolt/dist/receivers/verify-signing-secret.d.ts +2 -0
- package/node_modules/@slack/bolt/dist/receivers/verify-signing-secret.d.ts.map +1 -0
- package/node_modules/@slack/bolt/dist/receivers/verify-signing-secret.js +12 -0
- package/node_modules/@slack/bolt/dist/receivers/verify-signing-secret.js.map +1 -0
- package/node_modules/@slack/bolt/dist/types/actions/index.d.ts +1 -1
- package/node_modules/@slack/bolt/dist/types/actions/index.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/types/actions/index.js +1 -1
- package/node_modules/@slack/bolt/dist/types/actions/index.js.map +1 -1
- package/node_modules/@slack/bolt/dist/types/events/index.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/types/index.d.ts +3 -3
- package/node_modules/@slack/bolt/dist/types/index.d.ts.map +1 -1
- package/node_modules/@slack/bolt/dist/types/index.js +3 -3
- package/node_modules/@slack/bolt/dist/types/index.js.map +1 -1
- package/node_modules/@slack/bolt/dist/types/options/index.d.ts.map +1 -1
- package/node_modules/@slack/bolt/package.json +4 -4
- package/node_modules/@types/retry/LICENSE +21 -21
- package/node_modules/@types/retry/README.md +4 -5
- package/node_modules/@types/retry/index.d.ts +13 -20
- package/node_modules/@types/retry/package.json +11 -9
- package/node_modules/es-object-atoms/CHANGELOG.md +21 -14
- package/node_modules/es-object-atoms/isObject.d.ts +1 -1
- package/node_modules/es-object-atoms/package.json +6 -7
- package/node_modules/es-object-atoms/tsconfig.json +1 -0
- package/node_modules/hasown/CHANGELOG.md +7 -0
- package/node_modules/hasown/index.d.ts +0 -1
- package/node_modules/hasown/package.json +4 -5
- package/node_modules/typebox/build/type/script/mapping.d.mts +5 -2
- package/node_modules/typebox/build/type/script/mapping.mjs +15 -8
- package/node_modules/typebox/build/type/script/parser.d.mts +3 -1
- package/node_modules/typebox/build/type/script/parser.mjs +2 -1
- package/node_modules/typebox/package.json +29 -29
- package/npm-shrinkwrap.json +22 -101
- package/openclaw.plugin.json +76 -0
- package/package.json +6 -6
- package/dist/action-runtime.runtime-BXQYV0yA.js +0 -2
- package/dist/channel-api-DdLCPu8a.js +0 -20
- package/dist/send.runtime-CKaMG3s-.js +0 -2
|
@@ -4,18 +4,19 @@ import "./targets-nUqxHGgg.js";
|
|
|
4
4
|
import { b as truncateSlackText, f as normalizeAllowListLower, h as resolveSlackAllowListMatch, p as normalizeSlackAllowOwnerEntry, s as SLACK_TEXT_LIMIT } from "./thread-ts-NSVqWybn.js";
|
|
5
5
|
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-DrBq4Mld.js";
|
|
6
6
|
import { n as resolveSlackNativeStreaming, r as resolveSlackStreamingMode, t as mapStreamingModeToSlackLegacyDraftStreamMode } from "./streaming-compat-DjlgH-Be.js";
|
|
7
|
-
import { a as recordSlackThreadParticipation, i as hasSlackThreadParticipationWithPersistence, s as normalizeSlackOutboundText, t as sendMessageSlack } from "./send-
|
|
8
|
-
import { _ as resolveSlackThreadStarter, b as buildSlackEditTextPayload, f as removeSlackReaction, g as resolveSlackThreadHistory, l as reactSlackMessage, r as editSlackMessage, t as deleteSlackMessage, y as formatSlackFileReference } from "./actions-
|
|
7
|
+
import { a as recordSlackThreadParticipation, i as hasSlackThreadParticipationWithPersistence, s as normalizeSlackOutboundText, t as sendMessageSlack } from "./send-zvrcUvp2.js";
|
|
8
|
+
import { _ as resolveSlackThreadStarter, b as buildSlackEditTextPayload, f as removeSlackReaction, g as resolveSlackThreadHistory, l as reactSlackMessage, r as editSlackMessage, t as deleteSlackMessage, y as formatSlackFileReference } from "./actions-BA_6yvPC.js";
|
|
9
9
|
import { t as formatSlackError } from "./errors-CZtmv-h0.js";
|
|
10
|
-
import { _ as resolveStorePath, a as escapeSlackMrkdwn, b as stripSlackMentionsForCommandDetection, c as authorizeSlackBotRoomMessage, d as buildSlackAssistantThreadMetadata, f as parseSlackAssistantThreadMetadata, g as resolveChannelContextVisibilityMode, h as readSessionUpdatedAt, i as authorizeSlackDirectMessage, l as resolveSlackCommandIngress, m as resolveSlackChatType, o as recordInboundSession, p as normalizeSlackChannelType, r as resolveSlackRoomContextHints, s as resolveConversationLabel$1, u as resolveSlackEffectiveAllowFrom, v as updateLastRoute } from "./provider-
|
|
10
|
+
import { _ as resolveStorePath, a as escapeSlackMrkdwn, b as stripSlackMentionsForCommandDetection, c as authorizeSlackBotRoomMessage, d as buildSlackAssistantThreadMetadata, f as parseSlackAssistantThreadMetadata, g as resolveChannelContextVisibilityMode, h as readSessionUpdatedAt, i as authorizeSlackDirectMessage, l as resolveSlackCommandIngress, m as resolveSlackChatType, o as recordInboundSession, p as normalizeSlackChannelType, r as resolveSlackRoomContextHints, s as resolveConversationLabel$1, u as resolveSlackEffectiveAllowFrom, v as updateLastRoute } from "./provider-DNfFBEzl.js";
|
|
11
11
|
import { n as resolveSlackChannelConfig } from "./policy-BBDU-PQK.js";
|
|
12
|
-
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, t as createSlackReplyDeliveryPlan } from "./replies-
|
|
12
|
+
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, t as createSlackReplyDeliveryPlan } from "./replies-BmFpkBXm.js";
|
|
13
13
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
14
14
|
import { resolveAgentRoute, resolveInboundLastRouteSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
15
15
|
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftGate, createDraftStreamLoop, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftText, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, resolveAgentOutboundIdentity, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelProgressDraftConfig, resolveChannelProgressDraftMaxLineChars, resolveChannelProgressDraftMaxLines, resolveChannelProgressDraftRender, resolveChannelStreamingBlockEnabled, resolveChannelStreamingNativeTransport, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
|
|
16
16
|
import { createHash } from "node:crypto";
|
|
17
17
|
import { danger, logVerbose, shouldLogVerbose, sleep } from "openclaw/plugin-sdk/runtime-env";
|
|
18
18
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
19
|
+
import { asDateTimestampMs, asFiniteNumberInRange, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
19
20
|
import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
20
21
|
import { stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
21
22
|
import { ensureConfiguredBindingRouteReady, resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-runtime";
|
|
@@ -23,7 +24,6 @@ import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
|
23
24
|
import { resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
24
25
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
25
26
|
import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
26
|
-
import { asFiniteNumberInRange, parseStrictFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
|
|
27
27
|
import { buildChannelInboundEventContext, buildMentionRegexes, classifyChannelInboundEvent, dispatchChannelInboundReply, formatInboundEnvelope, hasVisibleInboundReplyDispatch, implicitMentionKindWhen, logInboundDrop, matchesMentionWithExplicit, recordDroppedChannelInboundHistory, resolveEnvelopeFormatOptions, resolveUnmentionedGroupInboundPolicy, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
|
|
28
28
|
import { filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist, shouldIncludeSupplementalContext } from "openclaw/plugin-sdk/security-runtime";
|
|
29
29
|
import { DEFAULT_TIMING, createStatusReactionController, logAckFailure, logTypingFailure, removeAckReactionAfterReply, resolveAckReaction, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
@@ -484,13 +484,16 @@ function resolveSlackThreadContext(params) {
|
|
|
484
484
|
const incomingThreadTs = params.message.thread_ts;
|
|
485
485
|
const eventTs = params.message.event_ts;
|
|
486
486
|
const messageTs = params.message.ts ?? eventTs;
|
|
487
|
-
const
|
|
487
|
+
const hasThreadTs = typeof incomingThreadTs === "string" && incomingThreadTs.length > 0;
|
|
488
|
+
const isThreadReply = hasThreadTs && (incomingThreadTs !== messageTs || Boolean(params.message.parent_user_id));
|
|
489
|
+
const replyToId = incomingThreadTs ?? messageTs;
|
|
490
|
+
const isAssistantDmThreadRoot = hasThreadTs && !isThreadReply && params.isDirectMessage === true;
|
|
488
491
|
return {
|
|
489
492
|
incomingThreadTs,
|
|
490
493
|
messageTs,
|
|
491
494
|
isThreadReply,
|
|
492
|
-
replyToId
|
|
493
|
-
messageThreadId: isThreadReply ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
495
|
+
replyToId,
|
|
496
|
+
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
494
497
|
};
|
|
495
498
|
}
|
|
496
499
|
/**
|
|
@@ -559,7 +562,6 @@ async function finalizeSlackPreviewEdit(params) {
|
|
|
559
562
|
client: params.client,
|
|
560
563
|
...params.blocks?.length ? { blocks: params.blocks } : {}
|
|
561
564
|
});
|
|
562
|
-
return;
|
|
563
565
|
} catch (err) {
|
|
564
566
|
try {
|
|
565
567
|
if (await didSlackPreviewEditApplyAfterError({
|
|
@@ -1036,10 +1038,11 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1036
1038
|
const deliverNormally = async (params) => {
|
|
1037
1039
|
if (params.payload.isReasoning === true) return;
|
|
1038
1040
|
const replyThreadTs = resolveDeliveryThreadTs(params);
|
|
1041
|
+
const deliveryReplyThreadTs = replyDeliveryMode === "off" && !forcedReplyThreadTs && !isThreadReply ? void 0 : replyThreadTs;
|
|
1039
1042
|
if (deliveryTracker.hasDelivered({
|
|
1040
1043
|
kind: params.kind,
|
|
1041
1044
|
payload: params.payload,
|
|
1042
|
-
threadTs:
|
|
1045
|
+
threadTs: deliveryReplyThreadTs
|
|
1043
1046
|
})) {
|
|
1044
1047
|
logVerbose("slack: suppressed duplicate normal delivery within the same turn");
|
|
1045
1048
|
return;
|
|
@@ -1052,7 +1055,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1052
1055
|
accountId: account.accountId,
|
|
1053
1056
|
runtime,
|
|
1054
1057
|
textLimit: ctx.textLimit,
|
|
1055
|
-
replyThreadTs,
|
|
1058
|
+
replyThreadTs: deliveryReplyThreadTs,
|
|
1056
1059
|
replyToMode: replyDeliveryMode,
|
|
1057
1060
|
...slackIdentity ? { identity: slackIdentity } : {},
|
|
1058
1061
|
...slackMessageMetadata ? { metadata: slackMessageMetadata } : {}
|
|
@@ -1062,14 +1065,14 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1062
1065
|
const deliveredThreadTs = resolveDeliveredSlackReplyThreadTs({
|
|
1063
1066
|
replyToMode: replyDeliveryMode,
|
|
1064
1067
|
payloadReplyToId: params.payload.replyToId,
|
|
1065
|
-
replyThreadTs
|
|
1068
|
+
replyThreadTs: deliveryReplyThreadTs
|
|
1066
1069
|
});
|
|
1067
1070
|
rememberDeliveredThreadTs(params.kind, deliveredThreadTs);
|
|
1068
1071
|
replyPlan.markSent();
|
|
1069
1072
|
deliveryTracker.markDelivered({
|
|
1070
1073
|
kind: params.kind,
|
|
1071
1074
|
payload: params.payload,
|
|
1072
|
-
threadTs:
|
|
1075
|
+
threadTs: deliveryReplyThreadTs
|
|
1073
1076
|
});
|
|
1074
1077
|
};
|
|
1075
1078
|
const deliverBufferedStreamFallback = async (params) => {
|
|
@@ -1318,7 +1321,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1318
1321
|
return;
|
|
1319
1322
|
}
|
|
1320
1323
|
}
|
|
1321
|
-
|
|
1324
|
+
await deliverWithFinalizableLivePreviewAdapter({
|
|
1322
1325
|
kind: info.kind,
|
|
1323
1326
|
payload,
|
|
1324
1327
|
adapter: defineFinalizableLivePreviewAdapter({
|
|
@@ -1395,7 +1398,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1395
1398
|
kind: info.kind
|
|
1396
1399
|
});
|
|
1397
1400
|
}
|
|
1398
|
-
})
|
|
1401
|
+
});
|
|
1399
1402
|
};
|
|
1400
1403
|
const onSlackDeliveryError = (err, info) => {
|
|
1401
1404
|
runtime.error?.(danger(`slack ${info.kind} reply failed: ${formatSlackError(err)}`));
|
|
@@ -1441,7 +1444,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1441
1444
|
const progressDraftMaxLineChars = resolveChannelProgressDraftMaxLineChars(account.config);
|
|
1442
1445
|
const renderProgressDraft = () => {
|
|
1443
1446
|
if (!draftStream || streamMode !== "status_final") return;
|
|
1444
|
-
const progressLines =
|
|
1447
|
+
const progressLines = previewToolProgressLines.length === 0 ? lastNonEmptyPreviewToolProgressLines : previewToolProgressLines;
|
|
1445
1448
|
const previewText = formatChannelProgressDraftText({
|
|
1446
1449
|
entry: account.config,
|
|
1447
1450
|
lines: progressLines,
|
|
@@ -1636,7 +1639,7 @@ async function dispatchPreparedSlackMessage(prepared) {
|
|
|
1636
1639
|
});
|
|
1637
1640
|
};
|
|
1638
1641
|
const onDraftBoundary = !shouldUseDraftStream ? void 0 : async () => {
|
|
1639
|
-
if (hasStreamedMessage) {
|
|
1642
|
+
if (hasStreamedMessage && streamMode !== "status_final") {
|
|
1640
1643
|
draftStream?.forceNewMessage();
|
|
1641
1644
|
hasStreamedMessage = false;
|
|
1642
1645
|
appendRenderedText = "";
|
|
@@ -1852,7 +1855,7 @@ const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
|
1852
1855
|
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
1853
1856
|
let slackMediaModulePromise$1;
|
|
1854
1857
|
function loadSlackMediaModule$1() {
|
|
1855
|
-
slackMediaModulePromise$1 ??= import("./actions-
|
|
1858
|
+
slackMediaModulePromise$1 ??= import("./actions-BA_6yvPC.js").then((n) => n.h);
|
|
1856
1859
|
return slackMediaModulePromise$1;
|
|
1857
1860
|
}
|
|
1858
1861
|
function collectUniqueSlackMentionIds$1(texts) {
|
|
@@ -2242,7 +2245,8 @@ function resolveSlackRoutingContext(params) {
|
|
|
2242
2245
|
const replyToMode = resolveSlackReplyToMode(account, chatType);
|
|
2243
2246
|
const threadContext = resolveSlackThreadContext({
|
|
2244
2247
|
message,
|
|
2245
|
-
replyToMode
|
|
2248
|
+
replyToMode,
|
|
2249
|
+
isDirectMessage
|
|
2246
2250
|
});
|
|
2247
2251
|
const threadTs = threadContext.incomingThreadTs;
|
|
2248
2252
|
const isThreadReply = threadContext.isThreadReply;
|
|
@@ -2365,7 +2369,7 @@ function formatSlackBotStarterThreadLabel(params) {
|
|
|
2365
2369
|
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
2366
2370
|
let slackMediaModulePromise;
|
|
2367
2371
|
function loadSlackMediaModule() {
|
|
2368
|
-
slackMediaModulePromise ??= import("./actions-
|
|
2372
|
+
slackMediaModulePromise ??= import("./actions-BA_6yvPC.js").then((n) => n.h);
|
|
2369
2373
|
return slackMediaModulePromise;
|
|
2370
2374
|
}
|
|
2371
2375
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
@@ -2413,9 +2417,12 @@ async function resolveSlackThreadContextData(params) {
|
|
|
2413
2417
|
});
|
|
2414
2418
|
let threadStarterBody;
|
|
2415
2419
|
let threadHistoryBody;
|
|
2416
|
-
let threadSessionPreviousTimestamp;
|
|
2417
2420
|
let threadLabel;
|
|
2418
2421
|
let threadStarterMedia = null;
|
|
2422
|
+
const threadSessionPreviousTimestamp = params.isThreadReply && params.threadTs ? readSessionUpdatedAt({
|
|
2423
|
+
storePath: params.storePath,
|
|
2424
|
+
sessionKey: params.sessionKey
|
|
2425
|
+
}) : void 0;
|
|
2419
2426
|
if (!params.isThreadReply || !params.threadTs) return {
|
|
2420
2427
|
threadStarterBody,
|
|
2421
2428
|
threadHistoryBody,
|
|
@@ -2456,10 +2463,6 @@ async function resolveSlackThreadContextData(params) {
|
|
|
2456
2463
|
if (threadStarterMedia) logVerbose(`slack: hydrated thread starter file ${threadStarterMedia.map((item) => item.placeholder).join(", ")} from root message`);
|
|
2457
2464
|
}
|
|
2458
2465
|
} else threadLabel = `Slack thread ${params.roomLabel}`;
|
|
2459
|
-
threadSessionPreviousTimestamp = readSessionUpdatedAt({
|
|
2460
|
-
storePath: params.storePath,
|
|
2461
|
-
sessionKey: params.sessionKey
|
|
2462
|
-
});
|
|
2463
2466
|
const includeBotStarterAsRootContext = shouldIncludeBotThreadStarterContext({
|
|
2464
2467
|
starterIsCurrentBot,
|
|
2465
2468
|
isNewThreadSession: !threadSessionPreviousTimestamp,
|
|
@@ -2590,7 +2593,11 @@ async function readSlackSubteamUsers(params) {
|
|
|
2590
2593
|
}
|
|
2591
2594
|
const cacheKey = `${normalizeSlackId(params.teamId) ?? ""}:${params.subteamId}`;
|
|
2592
2595
|
const cached = bySubteam.get(cacheKey);
|
|
2593
|
-
|
|
2596
|
+
const now = asDateTimestampMs(params.now);
|
|
2597
|
+
if (cached) {
|
|
2598
|
+
if (now !== void 0 && asDateTimestampMs(cached.expiresAt) !== void 0 && cached.expiresAt > now) return cached.users;
|
|
2599
|
+
bySubteam.delete(cacheKey);
|
|
2600
|
+
}
|
|
2594
2601
|
try {
|
|
2595
2602
|
const response = await params.client.usergroups.users.list({
|
|
2596
2603
|
usergroup: params.subteamId,
|
|
@@ -2601,8 +2608,9 @@ async function readSlackSubteamUsers(params) {
|
|
|
2601
2608
|
return /* @__PURE__ */ new Set();
|
|
2602
2609
|
}
|
|
2603
2610
|
const users = new Set((response.users ?? []).map((userId) => normalizeSlackId(userId)).filter(Boolean));
|
|
2604
|
-
|
|
2605
|
-
|
|
2611
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(SUBTEAM_MEMBER_CACHE_TTL_MS, { nowMs: params.now });
|
|
2612
|
+
if (expiresAt !== void 0) bySubteam.set(cacheKey, {
|
|
2613
|
+
expiresAt,
|
|
2606
2614
|
users
|
|
2607
2615
|
});
|
|
2608
2616
|
return users;
|
|
@@ -2704,8 +2712,13 @@ async function restoreSlackAssistantThreadContextFromMetadata(params) {
|
|
|
2704
2712
|
logVerbose(`slack assistant context restore failed channel=${params.message.channel} ts=${threadTs}: ${formatErrorMessage(err)}`);
|
|
2705
2713
|
}
|
|
2706
2714
|
}
|
|
2707
|
-
function resolveCachedMentionRegexes(ctx, agentId) {
|
|
2708
|
-
const key =
|
|
2715
|
+
function resolveCachedMentionRegexes(ctx, agentId, options) {
|
|
2716
|
+
const key = [
|
|
2717
|
+
normalizeOptionalString(agentId) ?? "__default__",
|
|
2718
|
+
normalizeOptionalString(options?.provider),
|
|
2719
|
+
normalizeOptionalString(options?.conversationId ?? void 0),
|
|
2720
|
+
options?.providerPolicy ? JSON.stringify(options.providerPolicy) : ""
|
|
2721
|
+
].join("");
|
|
2709
2722
|
let byAgent = mentionRegexCache.get(ctx);
|
|
2710
2723
|
if (!byAgent) {
|
|
2711
2724
|
byAgent = /* @__PURE__ */ new Map();
|
|
@@ -2713,7 +2726,7 @@ function resolveCachedMentionRegexes(ctx, agentId) {
|
|
|
2713
2726
|
}
|
|
2714
2727
|
const cached = byAgent.get(key);
|
|
2715
2728
|
if (cached) return cached;
|
|
2716
|
-
const built = buildMentionRegexes(ctx.cfg, agentId);
|
|
2729
|
+
const built = buildMentionRegexes(ctx.cfg, agentId, options);
|
|
2717
2730
|
byAgent.set(key, built);
|
|
2718
2731
|
return built;
|
|
2719
2732
|
}
|
|
@@ -2983,7 +2996,12 @@ async function prepareSlackMessage(params) {
|
|
|
2983
2996
|
canResolveExplicit: Boolean(ctx.botUserId)
|
|
2984
2997
|
}
|
|
2985
2998
|
}));
|
|
2986
|
-
|
|
2999
|
+
const buildPolicyMentionRegexes = (agentId) => resolveCachedMentionRegexes(ctx, agentId, {
|
|
3000
|
+
provider: "slack",
|
|
3001
|
+
conversationId: message.channel,
|
|
3002
|
+
providerPolicy: account.config.mentionPatterns
|
|
3003
|
+
});
|
|
3004
|
+
let mentionRegexes = buildPolicyMentionRegexes(routing.route.agentId);
|
|
2987
3005
|
let wasMentioned = resolveWasMentioned(mentionRegexes);
|
|
2988
3006
|
const hasBoundSession = Boolean(routing.runtimeBoundSessionKey || routing.configuredBindingSessionKey);
|
|
2989
3007
|
if (!seedTopLevelRoomThreadBySource && wasMentioned && isRoom && !routing.isThreadReply && !hasBoundSession) {
|
|
@@ -2998,10 +3016,12 @@ async function prepareSlackMessage(params) {
|
|
|
2998
3016
|
seedTopLevelRoomThread: true,
|
|
2999
3017
|
assistantThreadTs: assistantThreadContext?.threadTs
|
|
3000
3018
|
});
|
|
3001
|
-
mentionRegexes =
|
|
3019
|
+
mentionRegexes = buildPolicyMentionRegexes(routing.route.agentId);
|
|
3002
3020
|
wasMentioned = resolveWasMentioned(mentionRegexes);
|
|
3003
3021
|
}
|
|
3004
3022
|
const { route, runtimeBinding, configuredBinding, configuredBindingSessionKey, replyToMode, threadContext, threadTs, isThreadReply, threadKeys, sessionKey, historyKey } = routing;
|
|
3023
|
+
const isAssistantThreadMessage = Boolean(isDirectMessage && messageAssistantThreadContext);
|
|
3024
|
+
const forcedAssistantReplyThreadTs = Boolean(assistantThreadContext?.threadTs && (isThreadReply || isAssistantThreadMessage || replyToMode !== "off")) ? assistantThreadContext?.threadTs : void 0;
|
|
3005
3025
|
if (runtimeBinding && shouldLogVerbose()) logVerbose(`slack: routed via bound conversation ${runtimeBinding.conversation.conversationId} -> ${runtimeBinding.targetSessionKey}`);
|
|
3006
3026
|
if (configuredBinding) {
|
|
3007
3027
|
const ensured = await ensureConfiguredBindingRouteReady({
|
|
@@ -3487,7 +3507,7 @@ async function prepareSlackMessage(params) {
|
|
|
3487
3507
|
} : void 0
|
|
3488
3508
|
},
|
|
3489
3509
|
replyToMode,
|
|
3490
|
-
...
|
|
3510
|
+
...forcedAssistantReplyThreadTs ? { forcedReplyThreadTs: forcedAssistantReplyThreadTs } : {},
|
|
3491
3511
|
...assistantThreadContext ? { slackMessageMetadata: buildSlackAssistantThreadMetadata(assistantThreadContext) } : {},
|
|
3492
3512
|
requireMention: shouldRequireMention,
|
|
3493
3513
|
isDirectMessage,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { r as createSlackWebClient } from "./client-
|
|
2
|
+
import { r as createSlackWebClient } from "./client-qvqS9fQM.js";
|
|
3
3
|
import { t as formatSlackError } from "./errors-CZtmv-h0.js";
|
|
4
4
|
import { withTimeout } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
5
5
|
//#region extensions/slack/src/probe.ts
|
|
@@ -2,11 +2,11 @@ import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath } from ".
|
|
|
2
2
|
import { a as resolveSlackAccount, d as resolveSlackBotToken, o as resolveSlackAccountAllowFrom, s as resolveSlackAccountDmPolicy, u as resolveSlackAppToken } from "./accounts-f6Xcv9Vi.js";
|
|
3
3
|
import { C as isSlackAnyNativeApprovalClientEnabled, D as isSlackApprovalAuthorizedSender, b as truncateSlackText, d as normalizeAllowList, f as normalizeAllowListLower, h as resolveSlackAllowListMatch, k as isSlackExecApprovalAuthorizedSender, m as normalizeSlackSlug, p as normalizeSlackAllowOwnerEntry, s as SLACK_TEXT_LIMIT, u as allowListMatches } from "./thread-ts-NSVqWybn.js";
|
|
4
4
|
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-DrBq4Mld.js";
|
|
5
|
-
import { c as resolveSlackWebClientOptions } from "./client-
|
|
5
|
+
import { c as resolveSlackWebClientOptions } from "./client-qvqS9fQM.js";
|
|
6
6
|
import { t as getOptionalSlackRuntime } from "./runtime-BOk7xkOl.js";
|
|
7
7
|
import { t as formatSlackError } from "./errors-CZtmv-h0.js";
|
|
8
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
9
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
8
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-DIxJRl0F.js";
|
|
9
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-B3vczJHE.js";
|
|
10
10
|
import { n as resolveSlackChannelConfig, r as resolveSlackChannelLabel, t as isSlackChannelAllowedByPolicy } from "./policy-BBDU-PQK.js";
|
|
11
11
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
12
12
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries, normalizeStringEntriesLower, normalizeUniqueTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -18,6 +18,7 @@ import { addAllowlistUserEntriesFromConfigEntry, buildAllowlistResolutionSummary
|
|
|
18
18
|
import { computeBackoff, createNonExitingRuntime, danger, getChildLogger, logVerbose, shouldLogVerbose, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
19
19
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
20
20
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
21
|
+
import { asDateTimestampMs, parseFiniteNumber, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
21
22
|
import { resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-chunking";
|
|
22
23
|
import { chunkItems } from "openclaw/plugin-sdk/text-chunking";
|
|
23
24
|
import { createDedupeCache, resolveGlobalDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
|
|
@@ -39,7 +40,6 @@ import { resolveApprovalOverGateway } from "openclaw/plugin-sdk/approval-gateway
|
|
|
39
40
|
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
40
41
|
import { formatCommandArgMenuTitle, resolveCommandAuthorization, resolveNativeCommandSessionTargets, resolveStoredModelOverride } from "openclaw/plugin-sdk/command-auth-native";
|
|
41
42
|
import { requestHeartbeat } from "openclaw/plugin-sdk/heartbeat-runtime";
|
|
42
|
-
import { parseFiniteNumber, parseStrictFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
|
|
43
43
|
import { createInteractiveConversationBindingHelpers, dispatchPluginInteractiveHandler } from "openclaw/plugin-sdk/plugin-runtime";
|
|
44
44
|
import { createChannelIngressResolver, defineStableChannelIngressIdentity, readChannelIngressStoreAllowFromForDmPolicy } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
45
45
|
import { createChannelInboundDebouncer, shouldDebounceTextInbound } from "openclaw/plugin-sdk/channel-inbound";
|
|
@@ -907,21 +907,27 @@ async function resolveSlackChannelMemberIds(ctx, channelId) {
|
|
|
907
907
|
const cache = getChannelMembersCache(ctx);
|
|
908
908
|
const key = `${ctx.accountId}:${channelId}`;
|
|
909
909
|
const ttlMs = readSlackCacheTtlMs("OPENCLAW_SLACK_CHANNEL_MEMBERS_CACHE_TTL_MS", DEFAULT_CHANNEL_MEMBERS_CACHE_TTL_MS);
|
|
910
|
-
const
|
|
910
|
+
const rawNowMs = Date.now();
|
|
911
|
+
const nowMs = asDateTimestampMs(rawNowMs);
|
|
911
912
|
const cached = cache.get(key);
|
|
912
|
-
if (
|
|
913
|
+
if (cached?.members) {
|
|
914
|
+
if (ttlMs > 0 && nowMs !== void 0 && cached.expiresAtMs >= nowMs) return cached.members;
|
|
915
|
+
cache.delete(key);
|
|
916
|
+
}
|
|
913
917
|
if (cached?.pending) return await cached.pending;
|
|
914
918
|
const pending = fetchSlackChannelMemberIds(ctx, channelId);
|
|
919
|
+
const pendingExpiresAtMs = ttlMs > 0 ? resolveExpiresAtMsFromDurationMs(ttlMs, { nowMs: rawNowMs }) : void 0;
|
|
915
920
|
cache.set(key, {
|
|
916
|
-
expiresAtMs:
|
|
921
|
+
expiresAtMs: pendingExpiresAtMs ?? 0,
|
|
917
922
|
pending
|
|
918
923
|
});
|
|
919
924
|
pruneChannelMembersCache(cache);
|
|
920
925
|
try {
|
|
921
926
|
const members = await pending;
|
|
922
|
-
|
|
927
|
+
const membersExpiresAtMs = ttlMs > 0 ? resolveExpiresAtMsFromDurationMs(ttlMs) : void 0;
|
|
928
|
+
if (membersExpiresAtMs !== void 0) {
|
|
923
929
|
cache.set(key, {
|
|
924
|
-
expiresAtMs:
|
|
930
|
+
expiresAtMs: membersExpiresAtMs,
|
|
925
931
|
members
|
|
926
932
|
});
|
|
927
933
|
pruneChannelMembersCache(cache);
|
|
@@ -1240,7 +1246,10 @@ function formatInteractionSelectionLabel(params) {
|
|
|
1240
1246
|
}
|
|
1241
1247
|
if (params.summary.selectedDate) return params.summary.selectedDate;
|
|
1242
1248
|
if (params.summary.selectedTime) return params.summary.selectedTime;
|
|
1243
|
-
if (typeof params.summary.selectedDateTime === "number")
|
|
1249
|
+
if (typeof params.summary.selectedDateTime === "number") {
|
|
1250
|
+
const selectedDateTime = timestampMsToIsoString(params.summary.selectedDateTime * 1e3);
|
|
1251
|
+
if (selectedDateTime) return selectedDateTime;
|
|
1252
|
+
}
|
|
1244
1253
|
if (params.summary.richTextPreview) return params.summary.richTextPreview;
|
|
1245
1254
|
if (params.summary.value?.trim()) return params.summary.value.trim();
|
|
1246
1255
|
return params.actionId;
|
|
@@ -2622,22 +2631,30 @@ function createSlackThreadTsResolver(params) {
|
|
|
2622
2631
|
const getCached = (key, now) => {
|
|
2623
2632
|
const entry = cache.get(key);
|
|
2624
2633
|
if (!entry) return;
|
|
2625
|
-
if (
|
|
2634
|
+
if (entry.expiresAt === 0) {
|
|
2635
|
+
cache.delete(key);
|
|
2636
|
+
cache.set(key, entry);
|
|
2637
|
+
return entry.threadTs;
|
|
2638
|
+
}
|
|
2639
|
+
const normalizedNow = asDateTimestampMs(now);
|
|
2640
|
+
if (normalizedNow === void 0 || asDateTimestampMs(entry.expiresAt) === void 0 || entry.expiresAt <= normalizedNow) {
|
|
2626
2641
|
cache.delete(key);
|
|
2627
2642
|
return;
|
|
2628
2643
|
}
|
|
2629
2644
|
cache.delete(key);
|
|
2630
|
-
cache.set(key,
|
|
2631
|
-
...entry,
|
|
2632
|
-
updatedAt: now
|
|
2633
|
-
});
|
|
2645
|
+
cache.set(key, entry);
|
|
2634
2646
|
return entry.threadTs;
|
|
2635
2647
|
};
|
|
2636
2648
|
const setCached = (key, threadTs, now) => {
|
|
2649
|
+
const expiresAt = ttlMs > 0 ? resolveExpiresAtMsFromDurationMs(ttlMs, { nowMs: now }) : 0;
|
|
2650
|
+
if (expiresAt === void 0) {
|
|
2651
|
+
cache.delete(key);
|
|
2652
|
+
return;
|
|
2653
|
+
}
|
|
2637
2654
|
cache.delete(key);
|
|
2638
2655
|
cache.set(key, {
|
|
2639
2656
|
threadTs,
|
|
2640
|
-
|
|
2657
|
+
expiresAt
|
|
2641
2658
|
});
|
|
2642
2659
|
pruneMapToMaxSize(cache, maxSize);
|
|
2643
2660
|
};
|
|
@@ -2682,7 +2699,7 @@ function createSlackThreadTsResolver(params) {
|
|
|
2682
2699
|
//#region extensions/slack/src/monitor/message-handler.ts
|
|
2683
2700
|
let slackMessagePipelinePromise;
|
|
2684
2701
|
function loadSlackMessagePipeline() {
|
|
2685
|
-
slackMessagePipelinePromise ??= import("./pipeline.runtime-
|
|
2702
|
+
slackMessagePipelinePromise ??= import("./pipeline.runtime-Bo6reKXg.js");
|
|
2686
2703
|
return slackMessagePipelinePromise;
|
|
2687
2704
|
}
|
|
2688
2705
|
const APP_MENTION_RETRY_TTL_MS = 6e4;
|
|
@@ -2743,7 +2760,7 @@ function createSlackMessageHandler(params) {
|
|
|
2743
2760
|
if (!prepared) return;
|
|
2744
2761
|
if (seenMessageKey) {
|
|
2745
2762
|
pruneAppMentionRetryKeys(Date.now());
|
|
2746
|
-
if (last.opts.source === "app_mention") appMentionDispatchedKeys
|
|
2763
|
+
if (last.opts.source === "app_mention") rememberExpiringAppMentionKey(appMentionDispatchedKeys, seenMessageKey);
|
|
2747
2764
|
else if (last.opts.source === "message" && appMentionDispatchedKeys.has(seenMessageKey)) {
|
|
2748
2765
|
appMentionDispatchedKeys.delete(seenMessageKey);
|
|
2749
2766
|
appMentionRetryKeys.delete(seenMessageKey);
|
|
@@ -2788,17 +2805,28 @@ function createSlackMessageHandler(params) {
|
|
|
2788
2805
|
const pendingTopLevelDebounceKeys = /* @__PURE__ */ new Map();
|
|
2789
2806
|
const appMentionRetryKeys = /* @__PURE__ */ new Map();
|
|
2790
2807
|
const appMentionDispatchedKeys = /* @__PURE__ */ new Map();
|
|
2791
|
-
const pruneAppMentionRetryKeys = (
|
|
2792
|
-
|
|
2793
|
-
|
|
2808
|
+
const pruneAppMentionRetryKeys = (rawNow) => {
|
|
2809
|
+
const now = asDateTimestampMs(rawNow);
|
|
2810
|
+
if (now === void 0) {
|
|
2811
|
+
appMentionRetryKeys.clear();
|
|
2812
|
+
appMentionDispatchedKeys.clear();
|
|
2813
|
+
return false;
|
|
2814
|
+
}
|
|
2815
|
+
for (const [key, expiresAt] of appMentionRetryKeys) if (asDateTimestampMs(expiresAt) === void 0 || expiresAt <= now) appMentionRetryKeys.delete(key);
|
|
2816
|
+
for (const [key, expiresAt] of appMentionDispatchedKeys) if (asDateTimestampMs(expiresAt) === void 0 || expiresAt <= now) appMentionDispatchedKeys.delete(key);
|
|
2817
|
+
return true;
|
|
2794
2818
|
};
|
|
2795
|
-
const
|
|
2819
|
+
const rememberExpiringAppMentionKey = (map, key) => {
|
|
2796
2820
|
const now = Date.now();
|
|
2797
|
-
pruneAppMentionRetryKeys(now);
|
|
2798
|
-
|
|
2821
|
+
if (!pruneAppMentionRetryKeys(now)) return;
|
|
2822
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(APP_MENTION_RETRY_TTL_MS, { nowMs: now });
|
|
2823
|
+
if (expiresAt !== void 0) map.set(key, expiresAt);
|
|
2824
|
+
};
|
|
2825
|
+
const rememberAppMentionRetryKey = (key) => {
|
|
2826
|
+
rememberExpiringAppMentionKey(appMentionRetryKeys, key);
|
|
2799
2827
|
};
|
|
2800
2828
|
const consumeAppMentionRetryKey = (key) => {
|
|
2801
|
-
pruneAppMentionRetryKeys(Date.now());
|
|
2829
|
+
if (!pruneAppMentionRetryKeys(Date.now())) return false;
|
|
2802
2830
|
if (!appMentionRetryKeys.has(key)) return false;
|
|
2803
2831
|
appMentionRetryKeys.delete(key);
|
|
2804
2832
|
return true;
|
|
@@ -3224,8 +3252,13 @@ const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
|
3224
3252
|
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${Math.ceil(SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES * 8 / 6)}}$`);
|
|
3225
3253
|
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 600 * 1e3;
|
|
3226
3254
|
const SLACK_EXTERNAL_ARG_MENU_PREFIX = "openclaw_cmdarg_ext:";
|
|
3227
|
-
function pruneSlackExternalArgMenuStore(store,
|
|
3228
|
-
|
|
3255
|
+
function pruneSlackExternalArgMenuStore(store, rawNow) {
|
|
3256
|
+
const now = asDateTimestampMs(rawNow);
|
|
3257
|
+
if (now === void 0) {
|
|
3258
|
+
store.clear();
|
|
3259
|
+
return;
|
|
3260
|
+
}
|
|
3261
|
+
for (const [token, entry] of store.entries()) if (asDateTimestampMs(entry.expiresAt) === void 0 || entry.expiresAt <= now) store.delete(token);
|
|
3229
3262
|
}
|
|
3230
3263
|
function createSlackExternalArgMenuToken(store) {
|
|
3231
3264
|
let token = "";
|
|
@@ -3240,10 +3273,11 @@ function createSlackExternalArgMenuStore() {
|
|
|
3240
3273
|
create(params, now = Date.now()) {
|
|
3241
3274
|
pruneSlackExternalArgMenuStore(store, now);
|
|
3242
3275
|
const token = createSlackExternalArgMenuToken(store);
|
|
3243
|
-
|
|
3276
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(SLACK_EXTERNAL_ARG_MENU_TTL_MS, { nowMs: now });
|
|
3277
|
+
if (expiresAt !== void 0) store.set(token, {
|
|
3244
3278
|
choices: params.choices,
|
|
3245
3279
|
userId: params.userId,
|
|
3246
|
-
expiresAt
|
|
3280
|
+
expiresAt
|
|
3247
3281
|
});
|
|
3248
3282
|
return token;
|
|
3249
3283
|
},
|
|
@@ -3297,7 +3331,7 @@ function loadSlashCommandsRuntime() {
|
|
|
3297
3331
|
return slashCommandsRuntimePromise;
|
|
3298
3332
|
}
|
|
3299
3333
|
function loadSlashDispatchRuntime() {
|
|
3300
|
-
slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-
|
|
3334
|
+
slashDispatchRuntimePromise ??= import("./slash-dispatch.runtime-BKo3qtpZ.js");
|
|
3301
3335
|
return slashDispatchRuntimePromise;
|
|
3302
3336
|
}
|
|
3303
3337
|
function loadSlackPluginCommandsRuntime() {
|
|
@@ -4037,7 +4071,7 @@ function parseApiAppIdFromAppToken(raw) {
|
|
|
4037
4071
|
async function monitorSlackProvider(opts = {}) {
|
|
4038
4072
|
const cfg = opts.config ?? getRuntimeConfig$1();
|
|
4039
4073
|
const runtime = opts.runtime ?? createNonExitingRuntime();
|
|
4040
|
-
|
|
4074
|
+
const account = resolveSlackAccount({
|
|
4041
4075
|
cfg,
|
|
4042
4076
|
accountId: opts.accountId
|
|
4043
4077
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as resolveSlackReplyBlocks, s as SLACK_TEXT_LIMIT } from "./thread-ts-NSVqWybn.js";
|
|
2
|
-
import { o as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-
|
|
2
|
+
import { o as markdownToSlackMrkdwnChunks, t as sendMessageSlack } from "./send-zvrcUvp2.js";
|
|
3
3
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
4
4
|
import { SILENT_REPLY_TOKEN, chunkMarkdownTextWithMode, isSilentReplyText } from "openclaw/plugin-sdk/reply-chunking";
|
|
5
5
|
import { deliverTextOrMediaReply, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { r as createSlackWebClient } from "./client-
|
|
2
|
+
import { r as createSlackWebClient } from "./client-qvqS9fQM.js";
|
|
3
3
|
import { n as resolveSlackAllowlistEntries, t as collectSlackCursorItems } from "./resolve-allowlist-common-CP8SH0Zf.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/slack/src/resolve-channels.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { r as createSlackWebClient } from "./client-
|
|
2
|
+
import { r as createSlackWebClient } from "./client-qvqS9fQM.js";
|
|
3
3
|
import { n as resolveSlackAllowlistEntries, t as collectSlackCursorItems } from "./resolve-allowlist-common-CP8SH0Zf.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/slack/src/resolve-users.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./target-parsing-C7eeWg7M.js";
|
|
2
|
-
import "./
|
|
2
|
+
import "./client-qvqS9fQM.js";
|
|
3
3
|
import "./config-api-DnT9ohtE.js";
|
|
4
4
|
import "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { createActionGate as createActionGate$1, imageResultFromFile, jsonResult, readPositiveIntegerParam, readReactionParams, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
package/dist/runtime-api.js
CHANGED
|
@@ -2,13 +2,13 @@ import { t as registerSlackPluginHttpRoutes } from "./plugin-routes-B9PvcDQJ.js"
|
|
|
2
2
|
import { a as resolveSlackAccount, d as resolveSlackBotToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, t as listEnabledSlackAccounts, u as resolveSlackAppToken } from "./accounts-f6Xcv9Vi.js";
|
|
3
3
|
import { c as resolveSlackGroupRequireMention, l as resolveSlackGroupToolPolicy } from "./thread-ts-NSVqWybn.js";
|
|
4
4
|
import { n as setSlackRuntime } from "./runtime-BOk7xkOl.js";
|
|
5
|
-
import { t as sendMessageSlack } from "./send-
|
|
6
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
7
|
-
import { t as probeSlack } from "./probe-
|
|
8
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
9
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
10
|
-
import { t as monitorSlackProvider } from "./provider-
|
|
11
|
-
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-
|
|
12
|
-
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-
|
|
13
|
-
import "./monitor-
|
|
5
|
+
import { t as sendMessageSlack } from "./send-zvrcUvp2.js";
|
|
6
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-BA_6yvPC.js";
|
|
7
|
+
import { t as probeSlack } from "./probe-DczaQTdi.js";
|
|
8
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-DIxJRl0F.js";
|
|
9
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-B3vczJHE.js";
|
|
10
|
+
import { t as monitorSlackProvider } from "./provider-DNfFBEzl.js";
|
|
11
|
+
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-DEztkt37.js";
|
|
12
|
+
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-WZwhRYe2.js";
|
|
13
|
+
import "./monitor-D5FVBchh.js";
|
|
14
14
|
export { deleteSlackMessage, editSlackMessage, getSlackMemberInfo, handleSlackAction, listEnabledSlackAccounts, listSlackAccountIds, listSlackDirectoryGroupsLive, listSlackDirectoryPeersLive, listSlackEmojis, listSlackPins, listSlackReactions, monitorSlackProvider, pinSlackMessage, probeSlack, reactSlackMessage, readSlackMessages, registerSlackPluginHttpRoutes, removeOwnSlackReactions, removeSlackReaction, resolveDefaultSlackAccountId, resolveSlackAccount, resolveSlackAppToken, resolveSlackBotToken, resolveSlackChannelAllowlist, resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy, resolveSlackUserAllowlist, sendMessageSlack, sendSlackMessage, setSlackRuntime, slackActionRuntime, unpinSlackMessage };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as createSlackWebClient } from "./client-
|
|
1
|
+
import { r as createSlackWebClient } from "./client-qvqS9fQM.js";
|
|
2
2
|
import { t as formatSlackError } from "./errors-CZtmv-h0.js";
|
|
3
3
|
import { isRecord, normalizeOptionalString, normalizeStringEntries, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
//#region extensions/slack/src/scopes.ts
|
|
@@ -2,12 +2,11 @@ import { a as resolveSlackAccount, d as resolveSlackBotToken } from "./accounts-
|
|
|
2
2
|
import { r as parseSlackTarget } from "./target-parsing-C7eeWg7M.js";
|
|
3
3
|
import "./targets-nUqxHGgg.js";
|
|
4
4
|
import { b as truncateSlackText, o as validateSlackBlocksArray, s as SLACK_TEXT_LIMIT, t as normalizeSlackThreadTsCandidate } from "./thread-ts-NSVqWybn.js";
|
|
5
|
-
import { a as getSlackWriteClient, n as createSlackTokenCacheKey } from "./client-
|
|
5
|
+
import { a as getSlackWriteClient, n as createSlackTokenCacheKey } from "./client-qvqS9fQM.js";
|
|
6
6
|
import { t as getOptionalSlackRuntime } from "./runtime-BOk7xkOl.js";
|
|
7
|
-
import { i as loadOutboundMediaFromUrl } from "./runtime-api-
|
|
7
|
+
import { i as loadOutboundMediaFromUrl } from "./runtime-api-BpGQDSTg.js";
|
|
8
8
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
10
|
-
import "@slack/web-api";
|
|
11
10
|
import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
|
|
12
11
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
13
12
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as slackSetupPlugin } from "./channel.setup-DvU_3G7a.js";
|
|
2
2
|
export { slackSetupPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom } from "./accounts-f6Xcv9Vi.js";
|
|
2
|
-
import "./shared-
|
|
2
|
+
import "./shared-D5tOdKwQ.js";
|
|
3
3
|
import { i as SLACK_CHANNEL, t as createSlackSetupWizardBase } from "./setup-core-POfI_bgP.js";
|
|
4
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
5
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
4
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-DIxJRl0F.js";
|
|
5
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-B3vczJHE.js";
|
|
6
6
|
import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
8
8
|
import { createSetupTranslator, noteChannelLookupFailure, noteChannelLookupSummary, parseMentionOrPrefixedId, promptLegacyChannelAllowFromForAccount, resolveEntriesWithOptionalToken } from "openclaw/plugin-sdk/setup-runtime";
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { a as resolveSlackAccount, c as resolveSlackConfigAccessorAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, s as resolveSlackAccountDmPolicy } from "./accounts-f6Xcv9Vi.js";
|
|
2
2
|
import { t as inspectSlackAccount } from "./account-inspect-CdGk6R7l.js";
|
|
3
3
|
import { n as isSlackInteractiveRepliesEnabled } from "./interactive-replies-DrBq4Mld.js";
|
|
4
|
-
import {
|
|
4
|
+
import { f as getChatChannelMeta } from "./client-qvqS9fQM.js";
|
|
5
5
|
import { i as SLACK_CHANNEL } from "./setup-core-POfI_bgP.js";
|
|
6
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
7
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
6
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-BjAjs8_6.js";
|
|
7
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-DpGLNqS3.js";
|
|
8
8
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-g_PPWuoD.js";
|
|
9
9
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
10
10
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
11
11
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
12
12
|
import { createDangerousNameMatchingMutableAllowlistWarningCollector, createOpenProviderConfiguredRouteWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
13
13
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
14
|
-
import "openclaw/plugin-sdk/channel-contract";
|
|
15
14
|
//#region extensions/slack/src/security.ts
|
|
16
15
|
const resolveSlackDmPolicy = createScopedDmSecurityResolver({
|
|
17
16
|
channelKey: "slack",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as deliverSlackSlashReplies$1 } from "./replies-
|
|
1
|
+
import { r as deliverSlackSlashReplies$1 } from "./replies-BmFpkBXm.js";
|
|
2
2
|
import { resolveAgentRoute as resolveAgentRoute$1 } from "openclaw/plugin-sdk/routing";
|
|
3
3
|
import { resolveMarkdownTableMode as resolveMarkdownTableMode$1 } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
4
4
|
import { recordInboundSessionMetaSafe as recordInboundSessionMetaSafe$1, resolveConversationLabel as resolveConversationLabel$1 } from "openclaw/plugin-sdk/conversation-runtime";
|