@openclaw/slack 2026.7.2-beta.1 → 2026.7.2-beta.3
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/{account-configured-DzC407uv.js → account-configured-BwfXBo_F.js} +1 -1
- package/dist/{account-inspect-Di7ditqZ.js → account-inspect-Bvbtu3iH.js} +9 -2
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-BOJJiHSr.js → accounts-DQEbYKh9.js} +9 -0
- package/dist/accounts.runtime-BIKmJdtJ.js +2 -0
- package/dist/{action-runtime-p6M2ULpv.js → action-runtime-DqkRwO3Z.js} +14 -17
- package/dist/action-runtime.runtime-DEWOcFM4.js +2 -0
- package/dist/{actions-DkTcWmpT.js → actions-CF0tUY5q.js} +5 -9
- package/dist/{actions.runtime-BSxpwgUc.js → actions.runtime-hCbx4RXg.js} +1 -1
- package/dist/api.js +13 -14
- package/dist/{approval-handler.runtime-UGbnz9OC.js → approval-handler.runtime-Em8I1-8-.js} +2 -2
- package/dist/{channel-B0_j6C6z.js → channel-4-TRi1D6.js} +75 -41
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-BpeTezY4.js → channel-type-Cu1yjNg2.js} +3 -3
- package/dist/{channel.setup-BQFut21T.js → channel.setup-CgkADtZg.js} +6 -4
- package/dist/{config-schema-DYI01PV2.js → config-schema-XjJGfwQC.js} +18 -5
- package/dist/{directory-config-DRkFujwG.js → directory-config-Bv0lcUlH.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DX7yFsM-.js → directory-live-CzUIB7th.js} +2 -2
- package/dist/{doctor-contract-DddfkMlF.js → doctor-contract-DKpe5VBr.js} +80 -12
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{group-policy-C-b2ZnSl.js → group-policy-Bw-65m3V.js} +94 -135
- package/dist/{interactive-replies-BilWUdcI.js → interactive-replies-Dm_t2R9S.js} +1 -1
- package/dist/interactive-replies-api.js +1 -1
- package/dist/{message-tool-api-CA9jZrCY.js → message-tool-api-C2pcf5du.js} +3 -3
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-BN_uuvrQ.js → monitor-CNFeF30h.js} +3 -3
- package/dist/{outbound-adapter-ECl0go7d.js → outbound-adapter-CVi2uok0.js} +49 -5
- package/dist/{pipeline.runtime-f0eJJoJL.js → pipeline.runtime-CTvokbty.js} +485 -251
- package/dist/{policy-f8b0edSi.js → policy-b_dOPDCq.js} +7 -7
- package/dist/probe-Borhn9PQ.js +340 -0
- package/dist/{provider-Ds-y-imP.js → provider-B-HVL5ZE.js} +831 -329
- package/dist/{relay-source-B-6LFUdz.js → relay-source-Ea_P9VcO.js} +6 -11
- package/dist/{replies-BMvf3ihj.js → replies-B4bOdrYb.js} +3 -3
- package/dist/{resolve-channels-DOMgNCWb.js → resolve-channels-KTc568SU.js} +1 -1
- package/dist/{resolve-users-aL6-Ssee.js → resolve-users-DeGJf1yp.js} +1 -1
- package/dist/{runtime-CauEvswP.js → runtime-JSVZSWAj.js} +2 -2
- package/dist/{runtime-api-CVb6CQjX.js → runtime-api-BFfNpzDe.js} +1 -1
- package/dist/runtime-api.js +12 -12
- package/dist/runtime-setter-api.js +1 -1
- package/dist/{scopes-Dw8wbU0j.js → scopes-lx08L56K.js} +1 -2
- package/dist/{secret-contract-CMohXFWS.js → secret-contract-DxmvbxBF.js} +1 -0
- package/dist/secret-contract-api.js +1 -1
- package/dist/{send-NEfJ0GvM.js → send-KuTDky7i.js} +29 -12
- package/dist/send.runtime-CXyxws1D.js +2 -0
- package/dist/setup-core-CeiAVwQ3.js +502 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BN2WeG5c.js → setup-surface-DLA0vHXp.js} +23 -13
- package/dist/{shared-BLnB9R1T.js → shared-C4yVB0Q-.js} +64 -41
- package/dist/{slash-dispatch.runtime-C0Otuf_T.js → slash-dispatch.runtime-BT-mMm-f.js} +1 -1
- package/npm-shrinkwrap.json +3 -3
- package/openclaw.plugin.json +134 -10
- package/package.json +5 -7
- package/dist/accounts.runtime-KvftRRek.js +0 -2
- package/dist/action-runtime.runtime-DQstDkHG.js +0 -2
- package/dist/client-D2F6m8CP.js +0 -152
- package/dist/configured-state.js +0 -11
- package/dist/probe-CfALk0l4.js +0 -48
- package/dist/send.runtime-BkKpitPu.js +0 -2
- package/dist/setup-core-fGd6Gquy.js +0 -343
|
@@ -2,7 +2,7 @@ import { hasConfiguredAccountValue } from "openclaw/plugin-sdk/account-resolutio
|
|
|
2
2
|
//#region extensions/slack/src/account-configured.ts
|
|
3
3
|
function isSlackPluginAccountConfigured(account) {
|
|
4
4
|
const mode = account.config.mode ?? "socket";
|
|
5
|
-
if (!Boolean(account.botToken?.trim())) return false;
|
|
5
|
+
if (!(account.identity === "user" ? Boolean(account.userToken?.trim()) : Boolean(account.botToken?.trim()))) return false;
|
|
6
6
|
if (mode === "http") return hasConfiguredAccountValue(account.config.signingSecret);
|
|
7
7
|
if (mode === "relay") {
|
|
8
8
|
const relay = account.config.relay;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as resolveDefaultSlackAccountId, r as mergeSlackAccountConfig } from "./accounts-
|
|
1
|
+
import { i as resolveDefaultSlackAccountId, r as mergeSlackAccountConfig } from "./accounts-DQEbYKh9.js";
|
|
2
2
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
3
3
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -25,6 +25,7 @@ function inspectSlackAccount(params) {
|
|
|
25
25
|
const enabled = params.cfg.channels?.slack?.enabled !== false && merged.enabled !== false;
|
|
26
26
|
const allowEnv = accountId === DEFAULT_ACCOUNT_ID;
|
|
27
27
|
const mode = merged.mode ?? "socket";
|
|
28
|
+
const identity = merged.identity ?? "bot";
|
|
28
29
|
const isHttpMode = mode === "http";
|
|
29
30
|
const isRelayMode = mode === "relay";
|
|
30
31
|
const configBot = inspectSlackToken(merged.botToken);
|
|
@@ -46,6 +47,7 @@ function inspectSlackAccount(params) {
|
|
|
46
47
|
return {
|
|
47
48
|
accountId,
|
|
48
49
|
enabled,
|
|
50
|
+
...identity === "user" ? { identity } : {},
|
|
49
51
|
name: normalizeOptionalString(merged.name),
|
|
50
52
|
mode,
|
|
51
53
|
botToken,
|
|
@@ -60,7 +62,12 @@ function inspectSlackAccount(params) {
|
|
|
60
62
|
appTokenStatus: configApp.token ? "available" : configApp.status === "configured_unavailable" ? "configured_unavailable" : envApp ? "available" : "missing",
|
|
61
63
|
...isHttpMode ? { signingSecretStatus: configSigningSecret.token ? "available" : configSigningSecret.status === "configured_unavailable" ? "configured_unavailable" : "missing" } : {},
|
|
62
64
|
userTokenStatus: configUser.token ? "available" : configUser.status === "configured_unavailable" ? "configured_unavailable" : envUser ? "available" : "missing",
|
|
63
|
-
configured:
|
|
65
|
+
configured: (() => {
|
|
66
|
+
const identityTokenConfigured = identity === "user" ? configUser.status !== "missing" || Boolean(envUser) : configBot.status !== "missing" || Boolean(envBot);
|
|
67
|
+
if (isHttpMode) return identityTokenConfigured && configSigningSecret.status !== "missing";
|
|
68
|
+
if (isRelayMode) return identityTokenConfigured && relayConfigured;
|
|
69
|
+
return identityTokenConfigured && (configApp.status !== "missing" || Boolean(envApp));
|
|
70
|
+
})(),
|
|
64
71
|
config: merged,
|
|
65
72
|
groupPolicy: merged.groupPolicy,
|
|
66
73
|
textChunkLimit: merged.textChunkLimit,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
1
|
+
import { t as inspectSlackAccount } from "./account-inspect-Bvbtu3iH.js";
|
|
2
2
|
//#region extensions/slack/account-inspect-api.ts
|
|
3
3
|
function inspectSlackReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectSlackAccount({
|
|
@@ -46,6 +46,7 @@ function resolveSlackReplyToMode(account, chatType) {
|
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region extensions/slack/src/accounts.ts
|
|
48
48
|
function resolveSlackOperationToken(account, operation) {
|
|
49
|
+
if (account.identity === "user") return normalizeOptionalString(account.userToken);
|
|
49
50
|
const userToken = normalizeOptionalString(account.userToken);
|
|
50
51
|
const botToken = normalizeOptionalString(account.botToken);
|
|
51
52
|
if (operation === "read") return userToken ?? botToken;
|
|
@@ -53,6 +54,12 @@ function resolveSlackOperationToken(account, operation) {
|
|
|
53
54
|
}
|
|
54
55
|
const { listAccountIds, resolveDefaultAccountId } = createAccountListHelpers("slack", { hasImplicitDefaultAccount: (cfg) => {
|
|
55
56
|
const slack = cfg.channels?.slack;
|
|
57
|
+
if (slack?.identity === "user") {
|
|
58
|
+
if (!(hasConfiguredAccountValue(slack.userToken) || hasConfiguredAccountValue(process.env.SLACK_USER_TOKEN))) return false;
|
|
59
|
+
if (slack.mode === "http") return hasConfiguredAccountValue(slack.signingSecret);
|
|
60
|
+
if (slack.mode === "relay") return hasConfiguredAccountValue(slack.relay?.url) && hasConfiguredAccountValue(slack.relay?.authToken) && hasConfiguredAccountValue(slack.relay?.gatewayId);
|
|
61
|
+
return hasConfiguredAccountValue(slack.appToken) || hasConfiguredAccountValue(process.env.SLACK_APP_TOKEN);
|
|
62
|
+
}
|
|
56
63
|
if (!(hasConfiguredAccountValue(slack?.botToken) || hasConfiguredAccountValue(process.env.SLACK_BOT_TOKEN))) return false;
|
|
57
64
|
if (slack?.mode === "http") return hasConfiguredAccountValue(slack.signingSecret);
|
|
58
65
|
if (slack?.mode === "relay") return hasConfiguredAccountValue(slack.relay?.url) && hasConfiguredAccountValue(slack.relay?.authToken) && hasConfiguredAccountValue(slack.relay?.gatewayId);
|
|
@@ -147,6 +154,7 @@ function resolveSlackAccount(params) {
|
|
|
147
154
|
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultSlackAccountId(params.cfg));
|
|
148
155
|
const baseEnabled = params.cfg.channels?.slack?.enabled !== false;
|
|
149
156
|
const merged = mergeSlackAccountConfig(params.cfg, accountId);
|
|
157
|
+
const identity = merged.identity ?? "bot";
|
|
150
158
|
const accountEnabled = merged.enabled !== false;
|
|
151
159
|
const enabled = baseEnabled && accountEnabled;
|
|
152
160
|
const mode = merged.mode ?? "socket";
|
|
@@ -169,6 +177,7 @@ function resolveSlackAccount(params) {
|
|
|
169
177
|
return {
|
|
170
178
|
accountId,
|
|
171
179
|
enabled,
|
|
180
|
+
identity,
|
|
172
181
|
name: normalizeOptionalString(merged.name),
|
|
173
182
|
botToken,
|
|
174
183
|
appToken,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as resolveSlackChannelId, i as parseSlackTarget } from "./target-parsing-N6lHogYZ.js";
|
|
2
2
|
import { t as slackContextTargetsMatch } from "./targets-KmjP2E8s.js";
|
|
3
|
-
import {
|
|
4
|
-
import { a as readPositiveIntegerParam, c as withNormalizedTimestamp, n as imageResultFromFile, o as readReactionParams, r as jsonResult, s as readStringParam, t as createActionGate } from "./runtime-api-
|
|
5
|
-
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
3
|
+
import { $ as parseSlackBlocksInput, C as hasSlackNativeDataBlock } from "./group-policy-Bw-65m3V.js";
|
|
4
|
+
import { a as readPositiveIntegerParam, c as withNormalizedTimestamp, n as imageResultFromFile, o as readReactionParams, r as jsonResult, s as readStringParam, t as createActionGate } from "./runtime-api-BFfNpzDe.js";
|
|
5
|
+
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-b_dOPDCq.js";
|
|
6
6
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
7
7
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -24,9 +24,9 @@ const pinActions = /* @__PURE__ */ new Set([
|
|
|
24
24
|
"unpinMessage",
|
|
25
25
|
"listPins"
|
|
26
26
|
]);
|
|
27
|
-
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions.runtime-
|
|
28
|
-
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts.runtime-
|
|
29
|
-
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-
|
|
27
|
+
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions.runtime-hCbx4RXg.js"));
|
|
28
|
+
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts.runtime-BIKmJdtJ.js"));
|
|
29
|
+
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-Cu1yjNg2.js").then((n) => n.t));
|
|
30
30
|
function createLazySlackAction(key) {
|
|
31
31
|
return (async (...args) => {
|
|
32
32
|
const action = (await loadSlackActionsRuntime())[key];
|
|
@@ -238,23 +238,17 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
238
238
|
const resolveChannelId = () => resolveSlackChannelId(readStringParam(params, "channelId", { required: true }));
|
|
239
239
|
const action = readStringParam(params, "action", { required: true });
|
|
240
240
|
const accountId = readStringParam(params, "accountId");
|
|
241
|
-
const { resolveSlackAccount } = await loadSlackAccountsRuntime();
|
|
241
|
+
const { resolveSlackAccount, resolveSlackOperationToken } = await loadSlackAccountsRuntime();
|
|
242
242
|
const account = resolveSlackAccount({
|
|
243
243
|
cfg,
|
|
244
244
|
accountId
|
|
245
245
|
});
|
|
246
246
|
if (account.config.enterpriseOrgInstall === true) throw new Error("Slack action tools are unavailable for Enterprise Grid org installs.");
|
|
247
247
|
const isActionEnabled = createActionGate(account.actions ?? cfg.channels?.slack?.actions);
|
|
248
|
-
const userToken = account.userToken;
|
|
249
248
|
const botToken = account.botToken?.trim();
|
|
250
|
-
const allowUserWrites = account.config.userTokenReadOnly === false;
|
|
251
|
-
const getTokenForOperation = (operation) => {
|
|
252
|
-
if (operation === "read") return userToken ?? botToken;
|
|
253
|
-
if (!allowUserWrites) return botToken;
|
|
254
|
-
return botToken ?? userToken;
|
|
255
|
-
};
|
|
256
249
|
const buildActionOpts = (operation) => {
|
|
257
|
-
const token =
|
|
250
|
+
const token = resolveSlackOperationToken(account, operation);
|
|
251
|
+
if (!token && account.identity === "user") throw new Error(`Slack operation token missing for account "${account.accountId}".`);
|
|
258
252
|
const tokenOverride = token && token !== botToken ? token : void 0;
|
|
259
253
|
return {
|
|
260
254
|
cfg,
|
|
@@ -447,9 +441,12 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
447
441
|
threadId: threadId ?? void 0,
|
|
448
442
|
messageId: messageId ?? void 0
|
|
449
443
|
});
|
|
444
|
+
const messages = result.messages.map((message) => withNormalizedTimestamp(message, message.ts));
|
|
450
445
|
return jsonResult({
|
|
451
446
|
ok: true,
|
|
452
|
-
|
|
447
|
+
channelId,
|
|
448
|
+
...threadId ? { threadId } : {},
|
|
449
|
+
messages,
|
|
453
450
|
hasMore: result.hasMore
|
|
454
451
|
});
|
|
455
452
|
}
|
|
@@ -461,7 +458,7 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
461
458
|
await assertReadTargetAllowed(channelId);
|
|
462
459
|
const threadId = readStringParam(params, "threadId") ?? readStringParam(params, "replyTo");
|
|
463
460
|
const maxBytes = account.config?.mediaMaxMb ? account.config.mediaMaxMb * 1024 * 1024 : 20 * 1024 * 1024;
|
|
464
|
-
const readToken =
|
|
461
|
+
const readToken = resolveSlackOperationToken(account, "read");
|
|
465
462
|
const downloaded = await slackActionRuntime.downloadSlackFile(fileId, {
|
|
466
463
|
...readOpts,
|
|
467
464
|
...readToken && !readOpts?.token ? { token: readToken } : {},
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as resolveSlackAccount, p as resolveSlackBotToken } from "./accounts-
|
|
3
|
-
import { A as buildSlackCompleteBlocksFallbackText, C as hasSlackNativeDataBlock,
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { a as resolveSlackAccount, p as resolveSlackBotToken } from "./accounts-DQEbYKh9.js";
|
|
3
|
+
import { A as buildSlackCompleteBlocksFallbackText, C as hasSlackNativeDataBlock, N as SLACK_EDIT_TEXT_LIMIT, T as stripSlackNativeDataBlocks, Y as escapeSlackMrkdwn, b as appendSlackNativeDataPlainTextFallback, et as validateSlackBlocksArray, j as renderSlackBlockFallbackText, k as buildSlackBlocksFallbackText, w as isSlackInvalidBlocksError, y as appendSlackNativeDataFallbackText, z as truncateSlackText } from "./group-policy-Bw-65m3V.js";
|
|
4
|
+
import { a as createSlackLookupClient, d as getSlackWriteClient } from "./probe-Borhn9PQ.js";
|
|
5
|
+
import { r as sendMessageSlack, u as buildSlackNativeDataDeliveryPlan } from "./send-KuTDky7i.js";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { logVerbose, logVerbose as logVerbose$1 } from "openclaw/plugin-sdk/runtime-env";
|
|
8
8
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
@@ -40,9 +40,6 @@ function formatSlackFileReferenceList(files) {
|
|
|
40
40
|
return files.map((file) => formatSlackFileReference(file)).join(", ");
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
|
-
//#region extensions/slack/src/monitor/media-types.ts
|
|
44
|
-
const MAX_SLACK_MEDIA_FILES = 8;
|
|
45
|
-
//#endregion
|
|
46
43
|
//#region extensions/slack/src/monitor/block-text.ts
|
|
47
44
|
function readSlackBlockType(block) {
|
|
48
45
|
return block && typeof block === "object" && !Array.isArray(block) ? block.type : void 0;
|
|
@@ -227,7 +224,6 @@ async function resolveSlackThreadHistory(params) {
|
|
|
227
224
|
//#endregion
|
|
228
225
|
//#region extensions/slack/src/monitor/media.ts
|
|
229
226
|
var media_exports = /* @__PURE__ */ __exportAll({
|
|
230
|
-
MAX_SLACK_MEDIA_FILES: () => 8,
|
|
231
227
|
SLACK_MEDIA_READ_IDLE_TIMEOUT_MS: () => SLACK_MEDIA_READ_IDLE_TIMEOUT_MS,
|
|
232
228
|
resetSlackThreadStarterCacheForTest: () => resetSlackThreadStarterCacheForTest,
|
|
233
229
|
resolveSlackAttachmentContent: () => resolveSlackAttachmentContent,
|
|
@@ -901,4 +897,4 @@ async function downloadSlackFile(fileId, opts) {
|
|
|
901
897
|
}))?.[0] ?? null;
|
|
902
898
|
}
|
|
903
899
|
//#endregion
|
|
904
|
-
export { buildSlackEditTextPayload as
|
|
900
|
+
export { buildSlackEditTextPayload as S, resolveSlackThreadHistory as _, listSlackEmojis as a, resolveSlackBlocksText as b, pinSlackMessage as c, removeOwnSlackReactions as d, removeSlackReaction as f, media_exports as g, unpinSlackMessage as h, getSlackMemberInfo as i, reactSlackMessage as l, sendSlackMessage as m, downloadSlackFile as n, listSlackPins as o, resolveSlackConversationName as p, editSlackMessage as r, listSlackReactions as s, deleteSlackMessage as t, readSlackMessages as u, resolveSlackThreadStarter as v, formatSlackFileReference as x, chooseSlackPrimaryText as y };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, h as unpinSlackMessage, i as getSlackMemberInfo, l as reactSlackMessage, m as sendSlackMessage, n as downloadSlackFile, o as listSlackPins, p as resolveSlackConversationName, 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, h as unpinSlackMessage, i as getSlackMemberInfo, l as reactSlackMessage, m as sendSlackMessage, n as downloadSlackFile, o as listSlackPins, p as resolveSlackConversationName, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-CF0tUY5q.js";
|
|
2
2
|
export { deleteSlackMessage, downloadSlackFile, editSlackMessage, getSlackMemberInfo, listSlackEmojis, listSlackPins, listSlackReactions, pinSlackMessage, reactSlackMessage, readSlackMessages, removeOwnSlackReactions, removeSlackReaction, resolveSlackConversationName, sendSlackMessage, unpinSlackMessage };
|
package/dist/api.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath, t as handleSlackHttpRequest } from "./registry-bbjH7IHX.js";
|
|
2
|
-
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, r as mergeSlackAccountConfig, t as listEnabledSlackAccounts, u as resolveSlackReplyToMode } from "./accounts-
|
|
3
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
2
|
+
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, r as mergeSlackAccountConfig, t as listEnabledSlackAccounts, u as resolveSlackReplyToMode } from "./accounts-DQEbYKh9.js";
|
|
3
|
+
import { t as inspectSlackAccount } from "./account-inspect-Bvbtu3iH.js";
|
|
4
4
|
import { a as resolveSlackChannelId, i as parseSlackTarget, n as looksLikeSlackTargetId, r as normalizeSlackMessagingTarget } from "./target-parsing-N6lHogYZ.js";
|
|
5
5
|
import "./targets-KmjP2E8s.js";
|
|
6
|
-
import { n as buildSlackThreadingToolContext, r as resolveSlackAutoThreadId, t as slackPlugin } from "./channel-
|
|
7
|
-
import {
|
|
8
|
-
import { n as extractSlackToolSend, r as listSlackMessageActions } from "./message-tool-api-
|
|
9
|
-
import { n as isSlackInteractiveRepliesEnabled, r as parseSlackOptionsLine, t as compileSlackInteractiveReplies } from "./interactive-replies-
|
|
10
|
-
import {
|
|
11
|
-
import { n as resetSlackChannelTypeCacheForTest, r as resolveSlackChannelType } from "./channel-type-
|
|
12
|
-
import { t as slackSetupPlugin } from "./channel.setup-
|
|
13
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, h as unpinSlackMessage, i as getSlackMemberInfo, l as reactSlackMessage, m as sendSlackMessage, n as downloadSlackFile, o as listSlackPins, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
14
|
-
import {
|
|
15
|
-
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-
|
|
16
|
-
import { t as probeSlack } from "./probe-CfALk0l4.js";
|
|
6
|
+
import { n as buildSlackThreadingToolContext, r as resolveSlackAutoThreadId, t as slackPlugin } from "./channel-4-TRi1D6.js";
|
|
7
|
+
import { $ as parseSlackBlocksInput, I as buildSlackInteractiveBlocks, L as buildSlackPresentationBlocks, Q as SLACK_MAX_BLOCKS, a as allowListMatches, c as normalizeSlackAllowOwnerEntry, d as resolveSlackUserAllowed, et as validateSlackBlocksArray, l as normalizeSlackSlug, n as resolveSlackGroupRequireMention, o as normalizeAllowList, r as resolveSlackGroupToolPolicy, s as normalizeAllowListLower, u as resolveSlackAllowListMatch } from "./group-policy-Bw-65m3V.js";
|
|
8
|
+
import { n as extractSlackToolSend, r as listSlackMessageActions } from "./message-tool-api-C2pcf5du.js";
|
|
9
|
+
import { n as isSlackInteractiveRepliesEnabled, r as parseSlackOptionsLine, t as compileSlackInteractiveReplies } from "./interactive-replies-Dm_t2R9S.js";
|
|
10
|
+
import { c as createSlackWebClient, d as getSlackWriteClient, f as SLACK_DEFAULT_RETRY_OPTIONS, h as resolveSlackWriteClientOptions, i as clearSlackWriteClientCacheForTest, l as createSlackWriteClient, m as resolveSlackWebClientOptions, p as SLACK_WRITE_RETRY_OPTIONS, s as createSlackTokenCacheKey, t as probeSlack } from "./probe-Borhn9PQ.js";
|
|
11
|
+
import { n as resetSlackChannelTypeCacheForTest, r as resolveSlackChannelType } from "./channel-type-Cu1yjNg2.js";
|
|
12
|
+
import { t as slackSetupPlugin } from "./channel.setup-CgkADtZg.js";
|
|
13
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, h as unpinSlackMessage, i as getSlackMemberInfo, l as reactSlackMessage, m as sendSlackMessage, n as downloadSlackFile, o as listSlackPins, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-CF0tUY5q.js";
|
|
14
|
+
import { l as recordSlackThreadParticipation, o as clearSlackThreadParticipationCache, s as hasSlackThreadParticipation } from "./send-KuTDky7i.js";
|
|
15
|
+
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-Bv0lcUlH.js";
|
|
17
16
|
import { t as collectSlackSecurityAuditFindings } from "./security-audit-CikQhBUY.js";
|
|
18
|
-
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-
|
|
17
|
+
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-B-HVL5ZE.js";
|
|
19
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as sendMessageSlack } from "./send-
|
|
1
|
+
import { ct as shouldHandleSlackNativeApprovalRequest, gt as normalizeSlackApproverId, h as resolveSlackReplyBlocks, nt as isSlackAnyNativeApprovalClientEnabled, z as truncateSlackText } from "./group-policy-Bw-65m3V.js";
|
|
2
|
+
import { r as sendMessageSlack } from "./send-KuTDky7i.js";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
5
5
|
import { buildApprovalPresentationFromActionDescriptors } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resolveSlackOperationToken, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig, u as resolveSlackReplyToMode } from "./accounts-
|
|
1
|
+
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resolveSlackOperationToken, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig, u as resolveSlackReplyToMode } from "./accounts-DQEbYKh9.js";
|
|
2
2
|
import { a as resolveSlackChannelId, i as parseSlackTarget, n as looksLikeSlackTargetId, r as normalizeSlackMessagingTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-N6lHogYZ.js";
|
|
3
3
|
import { t as slackContextTargetsMatch } from "./targets-KmjP2E8s.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as isSlackPluginAccountConfigured } from "./account-configured-
|
|
4
|
+
import { F as SLACK_TEXT_LIMIT, J as renderSlackMessagePresentationFallbackText, L as buildSlackPresentationBlocks, N as SLACK_EDIT_TEXT_LIMIT, R as canRenderSlackPresentation, Z as SLACK_PRESENTATION_CAPABILITIES, _t as resolveSlackExecApprovalTarget, at as resolveSessionSlackOriginTarget, ct as shouldHandleSlackNativeApprovalRequest, dt as getSlackApprovalApprovers, ft as isSlackApprovalAuthorizedSender, g as resolveSlackReplyDeliveryMessages, h as resolveSlackReplyBlocks, ht as isSlackExecApprovalClientEnabled, i as assertSlackDirectSendAllowed, it as normalizeSlackOriginTarget, lt as shouldHandleSlackPluginViaForwardingSession, m as resolveSlackReplyBlockResolution, mt as isSlackExecApprovalAuthorizedSender, n as resolveSlackGroupRequireMention, nt as isSlackAnyNativeApprovalClientEnabled, ot as resolveSlackFallbackOriginTarget, pt as getSlackExecApprovalApprovers, r as resolveSlackGroupToolPolicy, rt as normalizeSlackForwardTarget, st as resolveTurnSourceSlackOriginTarget, tt as hasSlackPluginApprovers, ut as slackTargetsMatch, vt as shouldSuppressLocalSlackExecApprovalPrompt } from "./group-policy-Bw-65m3V.js";
|
|
5
|
+
import { t as isSlackPluginAccountConfigured } from "./account-configured-BwfXBo_F.js";
|
|
6
6
|
import { n as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-DUGhaYKq.js";
|
|
7
|
-
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-
|
|
8
|
-
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-
|
|
9
|
-
import {
|
|
10
|
-
import { i as resolveSlackConversationInfo, r as resolveSlackChannelType } from "./channel-type-
|
|
11
|
-
import { t as getOptionalSlackRuntime } from "./runtime-
|
|
12
|
-
import { n as slackConfigAdapter, r as slackSecurityAdapter, t as createSlackPluginBase } from "./shared-
|
|
13
|
-
import { i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, r as slackSetupAdapter } from "./setup-core-
|
|
7
|
+
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-C2pcf5du.js";
|
|
8
|
+
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-Dm_t2R9S.js";
|
|
9
|
+
import { _ as PAIRING_APPROVED_MESSAGE, b as resolveConfiguredFromRequiredCredentialStatuses, c as createSlackWebClient, g as DEFAULT_ACCOUNT_ID$1, r as formatSlackError, y as projectCredentialSnapshotFields } from "./probe-Borhn9PQ.js";
|
|
10
|
+
import { i as resolveSlackConversationInfo, r as resolveSlackChannelType } from "./channel-type-Cu1yjNg2.js";
|
|
11
|
+
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
12
|
+
import { n as slackConfigAdapter, r as slackSecurityAdapter, t as createSlackPluginBase } from "./shared-C4yVB0Q-.js";
|
|
13
|
+
import { i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, r as slackSetupAdapter } from "./setup-core-CeiAVwQ3.js";
|
|
14
14
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
15
15
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
16
16
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -30,7 +30,7 @@ import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-s
|
|
|
30
30
|
import { createChannelNativeOriginTargetResolver, createNativeApprovalForwardingFallbackSuppressor } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
31
31
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
32
32
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
33
|
-
import {
|
|
33
|
+
import { normalizeLegacyInteractiveReply, normalizeMessagePresentation } from "openclaw/plugin-sdk/interactive-runtime";
|
|
34
34
|
import { readPositiveIntegerParam, readStringParam } from "openclaw/plugin-sdk/param-readers";
|
|
35
35
|
//#region extensions/slack/src/action-threading.ts
|
|
36
36
|
function resolveSlackAutoThreadId(params) {
|
|
@@ -138,7 +138,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
138
138
|
approvalKind,
|
|
139
139
|
request
|
|
140
140
|
}),
|
|
141
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
141
|
+
load: async () => (await import("./approval-handler.runtime-Em8I1-8-.js")).slackApprovalNativeRuntime
|
|
142
142
|
})
|
|
143
143
|
});
|
|
144
144
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.native;
|
|
@@ -222,7 +222,7 @@ async function handleSlackMessageAction(params) {
|
|
|
222
222
|
});
|
|
223
223
|
const mediaUrl = readStringParam(actionParams, "media", { trim: false });
|
|
224
224
|
const presentation = normalizeMessagePresentation(actionParams.presentation);
|
|
225
|
-
const interactive =
|
|
225
|
+
const interactive = normalizeLegacyInteractiveReply(actionParams.interactive);
|
|
226
226
|
const hasStructuredContent = Boolean(presentation || interactive?.blocks.length);
|
|
227
227
|
const resolution = resolveSlackReplyBlockResolution({
|
|
228
228
|
text: content,
|
|
@@ -401,7 +401,7 @@ const SLACK_TOOL_DELIVERY_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
401
401
|
"unpinMessage",
|
|
402
402
|
"uploadFile"
|
|
403
403
|
]);
|
|
404
|
-
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
404
|
+
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-DEWOcFM4.js"));
|
|
405
405
|
function resolveSlackActionContext(params) {
|
|
406
406
|
if (!params.toolContext && !params.mediaLocalRoots && !params.mediaReadFile && !params.conversationReadOrigin && !params.requesterAccountId && !params.requesterSenderId) return;
|
|
407
407
|
return {
|
|
@@ -471,23 +471,23 @@ const EXTENSION_SHARED_MODULE_ID = "openclaw/plugin-sdk/extension-shared";
|
|
|
471
471
|
const TARGET_RESOLVER_RUNTIME_MODULE_ID = "openclaw/plugin-sdk/target-resolver-runtime";
|
|
472
472
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import(EXTENSION_SHARED_MODULE_ID));
|
|
473
473
|
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import(TARGET_RESOLVER_RUNTIME_MODULE_ID));
|
|
474
|
-
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-
|
|
475
|
-
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-
|
|
476
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-
|
|
474
|
+
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-DLA0vHXp.js"));
|
|
475
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-lx08L56K.js"));
|
|
476
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-CVi2uok0.js"));
|
|
477
477
|
async function resolveSlackHandleAction() {
|
|
478
478
|
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? (await loadSlackActionRuntime()).handleSlackAction;
|
|
479
479
|
}
|
|
480
480
|
function shouldTreatSlackDeliveredTextAsVisible(params) {
|
|
481
481
|
return params.kind === "block" && typeof params.text === "string" && params.text.trim().length > 0;
|
|
482
482
|
}
|
|
483
|
-
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
484
|
-
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
485
|
-
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
486
|
-
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
487
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-
|
|
488
|
-
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
489
|
-
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
490
|
-
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
483
|
+
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-Bv0lcUlH.js").then((n) => n.t));
|
|
484
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-KTc568SU.js").then((n) => n.n));
|
|
485
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DeGJf1yp.js").then((n) => n.n));
|
|
486
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-DEWOcFM4.js"));
|
|
487
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-CXyxws1D.js"));
|
|
488
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-Borhn9PQ.js").then((n) => n.n));
|
|
489
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-CNFeF30h.js").then((n) => n.t));
|
|
490
|
+
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-CzUIB7th.js").then((n) => n.t));
|
|
491
491
|
async function resolveSlackSendContext(params) {
|
|
492
492
|
const account = resolveSlackAccount({
|
|
493
493
|
cfg: params.cfg,
|
|
@@ -842,6 +842,8 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
842
842
|
} },
|
|
843
843
|
messaging: {
|
|
844
844
|
targetPrefixes: ["slack"],
|
|
845
|
+
directTargetStyle: "user-prefixed",
|
|
846
|
+
targetIdComparison: "lowercase",
|
|
845
847
|
normalizeTarget: normalizeSlackMessagingTarget,
|
|
846
848
|
resolveDeliveryTarget: ({ conversationId, parentConversationId }) => {
|
|
847
849
|
const parent = parentConversationId?.trim();
|
|
@@ -955,18 +957,25 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
955
957
|
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID$1),
|
|
956
958
|
buildChannelSummary: async ({ snapshot }) => {
|
|
957
959
|
const { buildPassiveProbedChannelStatusSummary } = await loadExtensionSharedSdk();
|
|
958
|
-
return buildPassiveProbedChannelStatusSummary(snapshot, {
|
|
960
|
+
return buildPassiveProbedChannelStatusSummary(snapshot, snapshot.identity === "user" ? {
|
|
961
|
+
identity: "user",
|
|
962
|
+
userTokenSource: snapshot.userTokenSource ?? "none",
|
|
963
|
+
...snapshot.mode === "http" ? { signingSecretSource: snapshot.signingSecretSource ?? "none" } : { appTokenSource: snapshot.appTokenSource ?? "none" }
|
|
964
|
+
} : {
|
|
959
965
|
botTokenSource: snapshot.botTokenSource ?? "none",
|
|
960
966
|
appTokenSource: snapshot.appTokenSource ?? "none"
|
|
961
967
|
});
|
|
962
968
|
},
|
|
963
969
|
probeAccount: async ({ account, timeoutMs }) => {
|
|
964
|
-
const token = account.botToken?.trim();
|
|
970
|
+
const token = account.identity === "user" ? account.userToken?.trim() : account.botToken?.trim();
|
|
965
971
|
if (!token) return {
|
|
966
972
|
ok: false,
|
|
967
|
-
error: "missing token"
|
|
973
|
+
error: account.identity === "user" ? "missing user token" : "missing token"
|
|
968
974
|
};
|
|
969
|
-
return await (await loadSlackProbeModule()).probeSlack(token, timeoutMs, {
|
|
975
|
+
return await (await loadSlackProbeModule()).probeSlack(token, timeoutMs, {
|
|
976
|
+
accountId: account.accountId,
|
|
977
|
+
...account.identity === "user" ? { identity: "user" } : {}
|
|
978
|
+
});
|
|
970
979
|
},
|
|
971
980
|
formatCapabilitiesProbe: ({ probe }) => {
|
|
972
981
|
const slackProbe = probe;
|
|
@@ -976,6 +985,11 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
976
985
|
tone: "warn"
|
|
977
986
|
});
|
|
978
987
|
if (slackProbe?.bot?.name) lines.push({ text: `Bot: @${slackProbe.bot.name}` });
|
|
988
|
+
if (slackProbe?.user?.id || slackProbe?.user?.name) {
|
|
989
|
+
const name = slackProbe.user.name ? `@${slackProbe.user.name}` : "unknown";
|
|
990
|
+
const id = slackProbe.user.id ? ` (${slackProbe.user.id})` : "";
|
|
991
|
+
lines.push({ text: `User identity: ${name}${id}` });
|
|
992
|
+
}
|
|
979
993
|
if (slackProbe?.team?.name || slackProbe?.team?.id) {
|
|
980
994
|
const id = slackProbe.team?.id ? ` (${slackProbe.team.id})` : "";
|
|
981
995
|
lines.push({ text: `Team: ${slackProbe.team?.name ?? "unknown"}${id}` });
|
|
@@ -988,16 +1002,28 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
988
1002
|
const botToken = account.botToken?.trim();
|
|
989
1003
|
const userToken = account.userToken?.trim();
|
|
990
1004
|
const { fetchSlackScopes } = await loadSlackScopesModule();
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1005
|
+
if (account.identity === "user") {
|
|
1006
|
+
const userScopes = userToken ? await fetchSlackScopes(userToken, timeoutMs) : {
|
|
1007
|
+
ok: false,
|
|
1008
|
+
error: "Slack user token missing."
|
|
1009
|
+
};
|
|
1010
|
+
lines.push(formatSlackScopeDiagnostic({
|
|
1011
|
+
tokenType: "user",
|
|
1012
|
+
result: userScopes
|
|
1013
|
+
}));
|
|
1014
|
+
details.userScopes = userScopes;
|
|
1015
|
+
} else {
|
|
1016
|
+
const botScopes = botToken ? await fetchSlackScopes(botToken, timeoutMs) : {
|
|
1017
|
+
ok: false,
|
|
1018
|
+
error: "Slack bot token missing."
|
|
1019
|
+
};
|
|
1020
|
+
lines.push(formatSlackScopeDiagnostic({
|
|
1021
|
+
tokenType: "bot",
|
|
1022
|
+
result: botScopes
|
|
1023
|
+
}));
|
|
1024
|
+
details.botScopes = botScopes;
|
|
1025
|
+
}
|
|
1026
|
+
if (account.identity !== "user" && userToken) {
|
|
1001
1027
|
const userScopes = await fetchSlackScopes(userToken, timeoutMs);
|
|
1002
1028
|
lines.push(formatSlackScopeDiagnostic({
|
|
1003
1029
|
tokenType: "user",
|
|
@@ -1012,13 +1038,21 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1012
1038
|
},
|
|
1013
1039
|
resolveAccountSnapshot: ({ account }) => {
|
|
1014
1040
|
const mode = account.config.mode ?? "socket";
|
|
1015
|
-
const
|
|
1041
|
+
const identity = account.config.identity ?? "bot";
|
|
1042
|
+
const configured = (mode === "http" ? resolveConfiguredFromRequiredCredentialStatuses(account, [identity === "user" ? "userTokenStatus" : "botTokenStatus", "signingSecretStatus"]) : mode === "socket" ? resolveConfiguredFromRequiredCredentialStatuses(account, [identity === "user" ? "userTokenStatus" : "botTokenStatus", "appTokenStatus"]) : void 0) ?? isSlackPluginAccountConfigured(account);
|
|
1016
1043
|
return {
|
|
1017
1044
|
accountId: account.accountId,
|
|
1018
1045
|
name: account.name,
|
|
1019
1046
|
enabled: account.enabled,
|
|
1020
1047
|
configured,
|
|
1021
|
-
extra: {
|
|
1048
|
+
extra: {
|
|
1049
|
+
...projectCredentialSnapshotFields(account),
|
|
1050
|
+
...identity === "user" ? {
|
|
1051
|
+
identity,
|
|
1052
|
+
mode,
|
|
1053
|
+
userTokenSource: account.userTokenSource
|
|
1054
|
+
} : {}
|
|
1055
|
+
}
|
|
1022
1056
|
};
|
|
1023
1057
|
}
|
|
1024
1058
|
}),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-XjJGfwQC.js";
|
|
2
2
|
export { SlackChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackPlugin } from "./channel-
|
|
1
|
+
import { t as slackPlugin } from "./channel-4-TRi1D6.js";
|
|
2
2
|
export { slackPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-
|
|
3
|
-
import { s as normalizeAllowListLower } from "./group-policy-
|
|
4
|
-
import {
|
|
2
|
+
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-DQEbYKh9.js";
|
|
3
|
+
import { s as normalizeAllowListLower } from "./group-policy-Bw-65m3V.js";
|
|
4
|
+
import { c as createSlackWebClient } from "./probe-Borhn9PQ.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as resolveSlackAccount, c as resolveSlackConfigAccessorAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds } from "./accounts-
|
|
2
|
-
import { a as describeSlackSetupAccount, i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, o as isSlackSetupAccountConfigured, r as slackSetupAdapter } from "./setup-core-
|
|
3
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { a as resolveSlackAccount, c as resolveSlackConfigAccessorAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds } from "./accounts-DQEbYKh9.js";
|
|
2
|
+
import { a as describeSlackSetupAccount, i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, o as isSlackSetupAccountConfigured, r as slackSetupAdapter } from "./setup-core-CeiAVwQ3.js";
|
|
3
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-XjJGfwQC.js";
|
|
4
4
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
5
5
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
6
6
|
//#region extensions/slack/src/channel.setup.ts
|
|
7
|
-
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-
|
|
7
|
+
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-DLA0vHXp.js")).slackSetupWizard }));
|
|
8
8
|
const slackSetupConfigAdapter = createScopedChannelConfigAdapter({
|
|
9
9
|
sectionKey: SLACK_CHANNEL,
|
|
10
10
|
listAccountIds: listSlackAccountIds,
|
|
@@ -14,6 +14,8 @@ const slackSetupConfigAdapter = createScopedChannelConfigAdapter({
|
|
|
14
14
|
clearBaseFields: [
|
|
15
15
|
"botToken",
|
|
16
16
|
"appToken",
|
|
17
|
+
"userToken",
|
|
18
|
+
"signingSecret",
|
|
17
19
|
"name"
|
|
18
20
|
],
|
|
19
21
|
resolveAllowFrom: (account) => account.allowFrom,
|
|
@@ -11,6 +11,10 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { u
|
|
|
11
11
|
label: "Slack Enterprise Grid Org Install",
|
|
12
12
|
help: "Enable only for an Enterprise Grid org-wide bot installation. OpenClaw verifies the token with Slack auth.test at startup; DMs must be disabled or use dmPolicy=\"open\" with allowFrom=[\"*\"]."
|
|
13
13
|
},
|
|
14
|
+
identity: {
|
|
15
|
+
label: "Slack Identity",
|
|
16
|
+
help: "Select \"bot\" (default) for the classic Slack app/bot identity or \"user\" to post as the authorizing human through a user token while the app carries event transport."
|
|
17
|
+
},
|
|
14
18
|
...createChannelConfigUiHints({
|
|
15
19
|
channelLabel: "Slack",
|
|
16
20
|
dmPolicy: {
|
|
@@ -23,7 +27,8 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { u
|
|
|
23
27
|
policyNote: "Native Slack @mentions still trigger even when regex patterns are denied.",
|
|
24
28
|
denyNote: "Native @mentions still trigger."
|
|
25
29
|
},
|
|
26
|
-
nativeCommands: true
|
|
30
|
+
nativeCommands: true,
|
|
31
|
+
implicitMentions: true
|
|
27
32
|
}),
|
|
28
33
|
allowBots: {
|
|
29
34
|
label: "Slack Allow Bot Messages",
|
|
@@ -105,6 +110,18 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { u
|
|
|
105
110
|
label: "Slack Exec Approvals",
|
|
106
111
|
help: "Slack-native exec approval routing and approver authorization. When unset, OpenClaw auto-enables DM-first native approvals if approvers can be resolved for this workspace account."
|
|
107
112
|
},
|
|
113
|
+
presenceEvents: {
|
|
114
|
+
label: "Slack Presence Events",
|
|
115
|
+
help: "Poll observed human participants and wake the routed agent on away-to-active transitions. Default: \"off\"."
|
|
116
|
+
},
|
|
117
|
+
"presenceEvents.mode": {
|
|
118
|
+
label: "Slack Presence Event Mode",
|
|
119
|
+
help: "\"off\" disables polling; \"auto\" covers DMs, MPIMs, and recent threads with up to 8 observed people; \"on\" also covers larger threads and top-level channels."
|
|
120
|
+
},
|
|
121
|
+
"channels.*.presenceEvents.mode": {
|
|
122
|
+
label: "Slack Channel Presence Event Mode",
|
|
123
|
+
help: "Override presence events for one Slack channel. Use \"on\" to include large threads or top-level channel sessions."
|
|
124
|
+
},
|
|
108
125
|
"execApprovals.enabled": {
|
|
109
126
|
label: "Slack Exec Approvals Enabled",
|
|
110
127
|
help: "Controls Slack native exec approvals for this account: unset or \"auto\" enables DM-first native approvals when approvers can be resolved, true forces native approvals on, and false disables them."
|
|
@@ -200,10 +217,6 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { u
|
|
|
200
217
|
"thread.initialHistoryLimit": {
|
|
201
218
|
label: "Slack Thread Initial History Limit",
|
|
202
219
|
help: "Maximum number of existing Slack thread messages to fetch when starting a new thread session (default: 20, set to 0 to disable)."
|
|
203
|
-
},
|
|
204
|
-
"thread.requireExplicitMention": {
|
|
205
|
-
label: "Slack Thread Require Explicit Mention",
|
|
206
|
-
help: "If true, require an explicit @mention even inside threads where the bot has participated. Suppresses implicit thread mention behavior so the bot only responds to explicit @bot mentions in threads (default: false)."
|
|
207
220
|
}
|
|
208
221
|
} });
|
|
209
222
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig } from "./accounts-
|
|
2
|
+
import { i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig } from "./accounts-DQEbYKh9.js";
|
|
3
3
|
import { i as parseSlackTarget } from "./target-parsing-N6lHogYZ.js";
|
|
4
4
|
import "./targets-KmjP2E8s.js";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-
|
|
1
|
+
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-Bv0lcUlH.js";
|
|
2
2
|
export { listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig };
|