@openclaw/slack 2026.5.28-beta.4 → 2026.5.30-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-BQ5ny5AD.js} +1 -1
- package/dist/action-runtime.runtime-C-vhDKzY.js +2 -0
- package/dist/{actions-zfVWcIY6.js → actions-DMBUHKPy.js} +21 -10
- package/dist/{actions.runtime-CoijPN8g.js → actions.runtime-BfyFeTsT.js} +1 -1
- package/dist/api.js +3 -3
- package/dist/{approval-handler.runtime-CWz3XLfN.js → approval-handler.runtime-DVLnnq25.js} +32 -59
- package/dist/{channel-BvEE3i26.js → channel-CvkLuaXk.js} +4 -4
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{monitor-RVx8NyTs.js → monitor-BdzpEeNU.js} +1 -1
- package/dist/{pipeline.runtime-CwtZdUTK.js → pipeline.runtime-C52E8vGp.js} +21 -12
- package/dist/{provider-Do2x35qj.js → provider-Ba13bui0.js} +60 -26
- package/dist/runtime-api.js +4 -4
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/action-runtime.runtime-BXQYV0yA.js +0 -2
|
@@ -30,7 +30,7 @@ function sameSlackChannelTarget(targetChannel, currentChannelId) {
|
|
|
30
30
|
let slackActionsRuntimePromise;
|
|
31
31
|
let slackAccountsRuntimePromise;
|
|
32
32
|
function loadSlackActionsRuntime() {
|
|
33
|
-
slackActionsRuntimePromise ??= import("./actions.runtime-
|
|
33
|
+
slackActionsRuntimePromise ??= import("./actions.runtime-BfyFeTsT.js");
|
|
34
34
|
return slackActionsRuntimePromise;
|
|
35
35
|
}
|
|
36
36
|
function loadSlackAccountsRuntime() {
|
|
@@ -14,6 +14,7 @@ import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url";
|
|
|
14
14
|
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
|
15
15
|
import { saveRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
|
|
16
16
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
17
|
+
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
17
18
|
//#region extensions/slack/src/edit-text.ts
|
|
18
19
|
function buildSlackEditTextPayload(content, blocks) {
|
|
19
20
|
const trimmedContent = content.trim();
|
|
@@ -41,8 +42,12 @@ const THREAD_STARTER_CACHE = /* @__PURE__ */ new Map();
|
|
|
41
42
|
const THREAD_STARTER_CACHE_TTL_MS = 360 * 6e4;
|
|
42
43
|
const THREAD_STARTER_CACHE_MAX = 2e3;
|
|
43
44
|
function evictThreadStarterCache() {
|
|
44
|
-
const now = Date.now();
|
|
45
|
-
|
|
45
|
+
const now = asDateTimestampMs(Date.now());
|
|
46
|
+
if (now === void 0) {
|
|
47
|
+
THREAD_STARTER_CACHE.clear();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
for (const [cacheKey, entry] of THREAD_STARTER_CACHE.entries()) if (asDateTimestampMs(entry.expiresAt) === void 0 || entry.expiresAt <= now) THREAD_STARTER_CACHE.delete(cacheKey);
|
|
46
51
|
pruneMapToMaxSize(THREAD_STARTER_CACHE, THREAD_STARTER_CACHE_MAX);
|
|
47
52
|
}
|
|
48
53
|
function formatSlackFilePlaceholder(files) {
|
|
@@ -52,8 +57,11 @@ async function resolveSlackThreadStarter(params) {
|
|
|
52
57
|
evictThreadStarterCache();
|
|
53
58
|
const cacheKey = `${params.channelId}:${params.threadTs}`;
|
|
54
59
|
const cached = THREAD_STARTER_CACHE.get(cacheKey);
|
|
55
|
-
if (cached
|
|
56
|
-
|
|
60
|
+
if (cached) {
|
|
61
|
+
const now = asDateTimestampMs(Date.now());
|
|
62
|
+
if (now !== void 0 && cached.expiresAt > now) return cached.value;
|
|
63
|
+
THREAD_STARTER_CACHE.delete(cacheKey);
|
|
64
|
+
}
|
|
57
65
|
try {
|
|
58
66
|
const message = (await params.client.conversations.replies({
|
|
59
67
|
channel: params.channelId,
|
|
@@ -71,12 +79,15 @@ async function resolveSlackThreadStarter(params) {
|
|
|
71
79
|
ts: message.ts,
|
|
72
80
|
files
|
|
73
81
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(THREAD_STARTER_CACHE_TTL_MS);
|
|
83
|
+
if (expiresAt !== void 0) {
|
|
84
|
+
if (THREAD_STARTER_CACHE.has(cacheKey)) THREAD_STARTER_CACHE.delete(cacheKey);
|
|
85
|
+
THREAD_STARTER_CACHE.set(cacheKey, {
|
|
86
|
+
value: starter,
|
|
87
|
+
expiresAt
|
|
88
|
+
});
|
|
89
|
+
evictThreadStarterCache();
|
|
90
|
+
}
|
|
80
91
|
return starter;
|
|
81
92
|
} catch (err) {
|
|
82
93
|
logVerbose$1(`slack thread starter fetch failed channel=${params.channelId} ts=${params.threadTs}: ${formatErrorMessage(err)}`);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
1
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-DMBUHKPy.js";
|
|
2
2
|
export { deleteSlackMessage, downloadSlackFile, editSlackMessage, getSlackMemberInfo, listSlackEmojis, listSlackPins, listSlackReactions, pinSlackMessage, reactSlackMessage, readSlackMessages, removeOwnSlackReactions, removeSlackReaction, sendSlackMessage, unpinSlackMessage };
|
package/dist/api.js
CHANGED
|
@@ -3,16 +3,16 @@ import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resol
|
|
|
3
3
|
import { t as inspectSlackAccount } from "./account-inspect-CdGk6R7l.js";
|
|
4
4
|
import { i as resolveSlackChannelId, n as normalizeSlackMessagingTarget, r as parseSlackTarget, t as looksLikeSlackTargetId } from "./target-parsing-C7eeWg7M.js";
|
|
5
5
|
import "./targets-nUqxHGgg.js";
|
|
6
|
-
import { a as resolveSlackAutoThreadId, i as resolveSlackChannelType, n as buildSlackThreadingToolContext, r as resetSlackChannelTypeCacheForTest, t as slackPlugin } from "./channel-
|
|
6
|
+
import { a as resolveSlackAutoThreadId, i as resolveSlackChannelType, n as buildSlackThreadingToolContext, r as resetSlackChannelTypeCacheForTest, t as slackPlugin } from "./channel-CvkLuaXk.js";
|
|
7
7
|
import { _ as buildSlackInteractiveBlocks, a as parseSlackBlocksInput, c as resolveSlackGroupRequireMention, d as normalizeAllowList, f as normalizeAllowListLower, g as resolveSlackUserAllowed, h as resolveSlackAllowListMatch, i as SLACK_MAX_BLOCKS, l as resolveSlackGroupToolPolicy, m as normalizeSlackSlug, o as validateSlackBlocksArray, p as normalizeSlackAllowOwnerEntry, u as allowListMatches, v as buildSlackPresentationBlocks } from "./thread-ts-NSVqWybn.js";
|
|
8
8
|
import { n as extractSlackToolSend, r as listSlackMessageActions } from "./message-tool-api-B9M0zzlQ.js";
|
|
9
9
|
import { n as isSlackInteractiveRepliesEnabled, r as parseSlackOptionsLine, t as compileSlackInteractiveReplies } from "./interactive-replies-DrBq4Mld.js";
|
|
10
10
|
import { a as getSlackWriteClient, c as resolveSlackWebClientOptions, i as createSlackWriteClient, l as resolveSlackWriteClientOptions, n as createSlackTokenCacheKey, o as SLACK_DEFAULT_RETRY_OPTIONS, r as createSlackWebClient, s as SLACK_WRITE_RETRY_OPTIONS, t as clearSlackWriteClientCacheForTest } from "./client-DowBk5k0.js";
|
|
11
11
|
import { t as slackSetupPlugin } from "./channel.setup-oGp4gSTP.js";
|
|
12
12
|
import { a as recordSlackThreadParticipation, n as clearSlackThreadParticipationCache, r as hasSlackThreadParticipation } from "./send-BURYyCXI.js";
|
|
13
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
13
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-DMBUHKPy.js";
|
|
14
14
|
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-8UPAEyNg.js";
|
|
15
15
|
import { t as probeSlack } from "./probe-Djes9Fy6.js";
|
|
16
16
|
import { t as collectSlackSecurityAuditFindings } from "./security-audit-CikQhBUY.js";
|
|
17
|
-
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-
|
|
17
|
+
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-Ba13bui0.js";
|
|
18
18
|
export { SLACK_DEFAULT_RETRY_OPTIONS, SLACK_MAX_BLOCKS, SLACK_WRITE_RETRY_OPTIONS, resetSlackChannelTypeCacheForTest as __resetSlackChannelTypeCacheForTest, resetSlackChannelTypeCacheForTest, allowListMatches, buildSlackInteractiveBlocks, buildSlackPresentationBlocks, buildSlackThreadingToolContext, clearSlackThreadParticipationCache, clearSlackWriteClientCacheForTest, collectSlackSecurityAuditFindings, compileSlackInteractiveReplies, createSlackTokenCacheKey, createSlackWebClient, createSlackWriteClient, deleteSlackMessage, downloadSlackFile, editSlackMessage, extractSlackToolSend, getSlackMemberInfo, getSlackWriteClient, handleSlackHttpRequest, hasSlackThreadParticipation, inspectSlackAccount, isSlackInteractiveRepliesEnabled, listEnabledSlackAccounts, listSlackAccountIds, listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig, listSlackEmojis, listSlackMessageActions, listSlackPins, listSlackReactions, looksLikeSlackTargetId, mergeSlackAccountConfig, normalizeAllowList, normalizeAllowListLower, normalizeSlackAllowOwnerEntry, normalizeSlackMessagingTarget, normalizeSlackSlug, normalizeSlackWebhookPath, parseSlackBlocksInput, parseSlackOptionsLine, parseSlackTarget, pinSlackMessage, probeSlack, reactSlackMessage, readSlackMessages, recordSlackThreadParticipation, registerSlackHttpHandler, removeOwnSlackReactions, removeSlackReaction, resolveDefaultSlackAccountId, resolveSlackAccount, resolveSlackAllowListMatch, resolveSlackAutoThreadId, resolveSlackChannelId, resolveSlackChannelType, resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy, resolveSlackReplyToMode, resolveSlackRuntimeGroupPolicy, resolveSlackUserAllowed, resolveSlackWebClientOptions, resolveSlackWriteClientOptions, sendSlackMessage, slackPlugin, slackSetupPlugin, unpinSlackMessage, validateSlackBlocksArray };
|
|
@@ -58,6 +58,13 @@ function buildSlackMetadataContextElements(metadata) {
|
|
|
58
58
|
});
|
|
59
59
|
return elements;
|
|
60
60
|
}
|
|
61
|
+
function buildSlackMetadataContextBlocks(metadata) {
|
|
62
|
+
const metadataElements = buildSlackMetadataContextElements(metadata);
|
|
63
|
+
return metadataElements.length > 0 ? [{
|
|
64
|
+
type: "context",
|
|
65
|
+
elements: metadataElements
|
|
66
|
+
}] : [];
|
|
67
|
+
}
|
|
61
68
|
function resolveSlackApprovalDecisionLabel(decision) {
|
|
62
69
|
return decision === "allow-once" ? "Allowed once" : decision === "allow-always" ? "Allowed always" : "Denied";
|
|
63
70
|
}
|
|
@@ -70,6 +77,15 @@ function buildSlackPluginMetadata(view) {
|
|
|
70
77
|
function resolveSlackPluginDescription(view) {
|
|
71
78
|
return normalizeOptionalString(view.description) ?? "A plugin action needs your approval.";
|
|
72
79
|
}
|
|
80
|
+
function buildSlackPluginRequestBlocks(view) {
|
|
81
|
+
return [{
|
|
82
|
+
type: "section",
|
|
83
|
+
text: {
|
|
84
|
+
type: "mrkdwn",
|
|
85
|
+
text: `*Request*\n${truncateSlackMrkdwn(view.title, 2600)}`
|
|
86
|
+
}
|
|
87
|
+
}, ...buildSlackMetadataContextBlocks(buildSlackPluginMetadata(view))];
|
|
88
|
+
}
|
|
73
89
|
function buildSlackExecPendingApprovalText(view) {
|
|
74
90
|
const metadataLines = buildSlackMetadataLines(view.metadata);
|
|
75
91
|
return [
|
|
@@ -96,7 +112,6 @@ function buildSlackPendingApprovalText(view) {
|
|
|
96
112
|
return view.approvalKind === "plugin" ? buildSlackPluginPendingApprovalText(view) : buildSlackExecPendingApprovalText(view);
|
|
97
113
|
}
|
|
98
114
|
function buildSlackExecPendingApprovalBlocks(view) {
|
|
99
|
-
const metadataElements = buildSlackMetadataContextElements(view.metadata);
|
|
100
115
|
const interactiveBlocks = resolveSlackReplyBlocks({
|
|
101
116
|
text: "",
|
|
102
117
|
presentation: buildApprovalPresentationFromActionDescriptors(view.actions)
|
|
@@ -116,15 +131,11 @@ function buildSlackExecPendingApprovalBlocks(view) {
|
|
|
116
131
|
text: `*Command*\n${buildSlackCodeBlock(truncateSlackMrkdwn(view.commandText, 2600))}`
|
|
117
132
|
}
|
|
118
133
|
},
|
|
119
|
-
...
|
|
120
|
-
type: "context",
|
|
121
|
-
elements: metadataElements
|
|
122
|
-
}] : [],
|
|
134
|
+
...buildSlackMetadataContextBlocks(view.metadata),
|
|
123
135
|
...interactiveBlocks
|
|
124
136
|
];
|
|
125
137
|
}
|
|
126
138
|
function buildSlackPluginPendingApprovalBlocks(view) {
|
|
127
|
-
const metadataElements = buildSlackMetadataContextElements(buildSlackPluginMetadata(view));
|
|
128
139
|
const interactiveBlocks = resolveSlackReplyBlocks({
|
|
129
140
|
text: "",
|
|
130
141
|
presentation: buildApprovalPresentationFromActionDescriptors(view.actions)
|
|
@@ -137,17 +148,7 @@ function buildSlackPluginPendingApprovalBlocks(view) {
|
|
|
137
148
|
text: `*Plugin approval required*\n${truncateSlackMrkdwn(resolveSlackPluginDescription(view), 2600)}`
|
|
138
149
|
}
|
|
139
150
|
},
|
|
140
|
-
|
|
141
|
-
type: "section",
|
|
142
|
-
text: {
|
|
143
|
-
type: "mrkdwn",
|
|
144
|
-
text: `*Request*\n${truncateSlackMrkdwn(view.title, 2600)}`
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
...metadataElements.length > 0 ? [{
|
|
148
|
-
type: "context",
|
|
149
|
-
elements: metadataElements
|
|
150
|
-
}] : [],
|
|
151
|
+
...buildSlackPluginRequestBlocks(view),
|
|
151
152
|
...interactiveBlocks
|
|
152
153
|
];
|
|
153
154
|
}
|
|
@@ -197,27 +198,13 @@ function buildSlackExecResolvedBlocks(view) {
|
|
|
197
198
|
}
|
|
198
199
|
function buildSlackPluginResolvedBlocks(view) {
|
|
199
200
|
const resolvedBy = formatSlackApprover(view.resolvedBy);
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
{
|
|
203
|
-
type: "
|
|
204
|
-
text: {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
type: "section",
|
|
211
|
-
text: {
|
|
212
|
-
type: "mrkdwn",
|
|
213
|
-
text: `*Request*\n${truncateSlackMrkdwn(view.title, 2600)}`
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
...metadataElements.length > 0 ? [{
|
|
217
|
-
type: "context",
|
|
218
|
-
elements: metadataElements
|
|
219
|
-
}] : []
|
|
220
|
-
];
|
|
201
|
+
return [{
|
|
202
|
+
type: "section",
|
|
203
|
+
text: {
|
|
204
|
+
type: "mrkdwn",
|
|
205
|
+
text: `*Plugin approval: ${resolveSlackApprovalDecisionLabel(view.decision)}*\n${resolvedBy ? `Resolved by ${resolvedBy}.` : "Resolved."}`
|
|
206
|
+
}
|
|
207
|
+
}, ...buildSlackPluginRequestBlocks(view)];
|
|
221
208
|
}
|
|
222
209
|
function buildSlackResolvedBlocks(view) {
|
|
223
210
|
return view.approvalKind === "plugin" ? buildSlackPluginResolvedBlocks(view) : buildSlackExecResolvedBlocks(view);
|
|
@@ -261,27 +248,13 @@ function buildSlackExecExpiredBlocks(view) {
|
|
|
261
248
|
}];
|
|
262
249
|
}
|
|
263
250
|
function buildSlackPluginExpiredBlocks(view) {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
{
|
|
267
|
-
type: "
|
|
268
|
-
text:
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
type: "section",
|
|
275
|
-
text: {
|
|
276
|
-
type: "mrkdwn",
|
|
277
|
-
text: `*Request*\n${truncateSlackMrkdwn(view.title, 2600)}`
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
...metadataElements.length > 0 ? [{
|
|
281
|
-
type: "context",
|
|
282
|
-
elements: metadataElements
|
|
283
|
-
}] : []
|
|
284
|
-
];
|
|
251
|
+
return [{
|
|
252
|
+
type: "section",
|
|
253
|
+
text: {
|
|
254
|
+
type: "mrkdwn",
|
|
255
|
+
text: "*Plugin approval expired*\nThis approval request expired before it was resolved."
|
|
256
|
+
}
|
|
257
|
+
}, ...buildSlackPluginRequestBlocks(view)];
|
|
285
258
|
}
|
|
286
259
|
function buildSlackExpiredBlocks(view) {
|
|
287
260
|
return view.approvalKind === "plugin" ? buildSlackPluginExpiredBlocks(view) : buildSlackExecExpiredBlocks(view);
|
|
@@ -232,7 +232,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
232
232
|
approvalKind: resolveSlackApprovalKind(request),
|
|
233
233
|
request
|
|
234
234
|
}),
|
|
235
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
235
|
+
load: async () => (await import("./approval-handler.runtime-DVLnnq25.js")).slackApprovalNativeRuntime
|
|
236
236
|
})
|
|
237
237
|
});
|
|
238
238
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.native;
|
|
@@ -431,7 +431,7 @@ async function handleSlackMessageAction(params) {
|
|
|
431
431
|
//#region extensions/slack/src/channel-actions.ts
|
|
432
432
|
let slackActionRuntimePromise$1;
|
|
433
433
|
async function loadSlackActionRuntime$1() {
|
|
434
|
-
slackActionRuntimePromise$1 ??= import("./action-runtime.runtime-
|
|
434
|
+
slackActionRuntimePromise$1 ??= import("./action-runtime.runtime-C-vhDKzY.js");
|
|
435
435
|
return await slackActionRuntimePromise$1;
|
|
436
436
|
}
|
|
437
437
|
function resolveSlackActionContext(params) {
|
|
@@ -587,7 +587,7 @@ const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./d
|
|
|
587
587
|
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-zXt5f47h.js").then((n) => n.n));
|
|
588
588
|
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-BLfGAz1v.js").then((n) => n.n));
|
|
589
589
|
async function loadSlackActionRuntime() {
|
|
590
|
-
slackActionRuntimePromise ??= import("./action-runtime.runtime-
|
|
590
|
+
slackActionRuntimePromise ??= import("./action-runtime.runtime-C-vhDKzY.js");
|
|
591
591
|
return await slackActionRuntimePromise;
|
|
592
592
|
}
|
|
593
593
|
async function loadSlackSendRuntime() {
|
|
@@ -599,7 +599,7 @@ async function loadSlackProbeModule() {
|
|
|
599
599
|
return await slackProbeModulePromise;
|
|
600
600
|
}
|
|
601
601
|
async function loadSlackMonitorModule() {
|
|
602
|
-
slackMonitorModulePromise ??= import("./monitor-
|
|
602
|
+
slackMonitorModulePromise ??= import("./monitor-BdzpEeNU.js").then((n) => n.t);
|
|
603
603
|
return await slackMonitorModulePromise;
|
|
604
604
|
}
|
|
605
605
|
async function loadSlackDirectoryLiveModule() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackPlugin } from "./channel-
|
|
1
|
+
import { t as slackPlugin } from "./channel-CvkLuaXk.js";
|
|
2
2
|
export { slackPlugin };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { t as monitorSlackProvider, y as buildSlackSlashCommandMatcher } from "./provider-
|
|
2
|
+
import { t as monitorSlackProvider, y as buildSlackSlashCommandMatcher } from "./provider-Ba13bui0.js";
|
|
3
3
|
import { t as isSlackChannelAllowedByPolicy } from "./policy-BBDU-PQK.js";
|
|
4
4
|
import { o as resolveSlackThreadTs } from "./replies-DkmWK7JW.js";
|
|
5
5
|
//#region extensions/slack/src/monitor.ts
|
|
@@ -5,9 +5,9 @@ import { b as truncateSlackText, f as normalizeAllowListLower, h as resolveSlack
|
|
|
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
7
|
import { a as recordSlackThreadParticipation, i as hasSlackThreadParticipationWithPersistence, s as normalizeSlackOutboundText, t as sendMessageSlack } from "./send-BURYyCXI.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-
|
|
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-DMBUHKPy.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-Ba13bui0.js";
|
|
11
11
|
import { n as resolveSlackChannelConfig } from "./policy-BBDU-PQK.js";
|
|
12
12
|
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, t as createSlackReplyDeliveryPlan } from "./replies-DkmWK7JW.js";
|
|
13
13
|
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -16,6 +16,7 @@ import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, c
|
|
|
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
|
/**
|
|
@@ -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-DMBUHKPy.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-DMBUHKPy.js").then((n) => n.h);
|
|
2369
2373
|
return slackMediaModulePromise;
|
|
2370
2374
|
}
|
|
2371
2375
|
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
@@ -2590,7 +2594,11 @@ async function readSlackSubteamUsers(params) {
|
|
|
2590
2594
|
}
|
|
2591
2595
|
const cacheKey = `${normalizeSlackId(params.teamId) ?? ""}:${params.subteamId}`;
|
|
2592
2596
|
const cached = bySubteam.get(cacheKey);
|
|
2593
|
-
|
|
2597
|
+
const now = asDateTimestampMs(params.now);
|
|
2598
|
+
if (cached) {
|
|
2599
|
+
if (now !== void 0 && asDateTimestampMs(cached.expiresAt) !== void 0 && cached.expiresAt > now) return cached.users;
|
|
2600
|
+
bySubteam.delete(cacheKey);
|
|
2601
|
+
}
|
|
2594
2602
|
try {
|
|
2595
2603
|
const response = await params.client.usergroups.users.list({
|
|
2596
2604
|
usergroup: params.subteamId,
|
|
@@ -2601,8 +2609,9 @@ async function readSlackSubteamUsers(params) {
|
|
|
2601
2609
|
return /* @__PURE__ */ new Set();
|
|
2602
2610
|
}
|
|
2603
2611
|
const users = new Set((response.users ?? []).map((userId) => normalizeSlackId(userId)).filter(Boolean));
|
|
2604
|
-
|
|
2605
|
-
|
|
2612
|
+
const expiresAt = resolveExpiresAtMsFromDurationMs(SUBTEAM_MEMBER_CACHE_TTL_MS, { nowMs: params.now });
|
|
2613
|
+
if (expiresAt !== void 0) bySubteam.set(cacheKey, {
|
|
2614
|
+
expiresAt,
|
|
2606
2615
|
users
|
|
2607
2616
|
});
|
|
2608
2617
|
return users;
|
|
@@ -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-C52E8vGp.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
|
},
|
package/dist/runtime-api.js
CHANGED
|
@@ -3,12 +3,12 @@ import { a as resolveSlackAccount, d as resolveSlackBotToken, i as resolveDefaul
|
|
|
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
5
|
import { t as sendMessageSlack } from "./send-BURYyCXI.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-
|
|
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-DMBUHKPy.js";
|
|
7
7
|
import { t as probeSlack } from "./probe-Djes9Fy6.js";
|
|
8
8
|
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-zXt5f47h.js";
|
|
9
9
|
import { t as resolveSlackUserAllowlist } from "./resolve-users-BLfGAz1v.js";
|
|
10
|
-
import { t as monitorSlackProvider } from "./provider-
|
|
11
|
-
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-
|
|
10
|
+
import { t as monitorSlackProvider } from "./provider-Ba13bui0.js";
|
|
11
|
+
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-BQ5ny5AD.js";
|
|
12
12
|
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-BFB1pSax.js";
|
|
13
|
-
import "./monitor-
|
|
13
|
+
import "./monitor-BdzpEeNU.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 };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/slack",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.30-beta.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/slack",
|
|
9
|
-
"version": "2026.5.
|
|
9
|
+
"version": "2026.5.30-beta.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@slack/bolt": "4.7.2",
|
|
12
12
|
"@slack/types": "2.21.1",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"zod": "4.4.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"openclaw": ">=2026.5.
|
|
18
|
+
"openclaw": ">=2026.5.30-beta.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
21
21
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/slack",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.30-beta.1",
|
|
4
4
|
"description": "OpenClaw Slack channel plugin for channels, DMs, commands, and app events.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"zod": "4.4.3"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"openclaw": ">=2026.5.
|
|
18
|
+
"openclaw": ">=2026.5.30-beta.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependenciesMeta": {
|
|
21
21
|
"openclaw": {
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"allowInvalidConfigRecovery": true
|
|
61
61
|
},
|
|
62
62
|
"compat": {
|
|
63
|
-
"pluginApi": ">=2026.5.
|
|
63
|
+
"pluginApi": ">=2026.5.30-beta.1"
|
|
64
64
|
},
|
|
65
65
|
"startup": {
|
|
66
66
|
"deferConfiguredChannelFullLoadUntilAfterListen": true
|
|
67
67
|
},
|
|
68
68
|
"build": {
|
|
69
|
-
"openclawVersion": "2026.5.
|
|
69
|
+
"openclawVersion": "2026.5.30-beta.1",
|
|
70
70
|
"bundledDist": false
|
|
71
71
|
},
|
|
72
72
|
"release": {
|