@openclaw/slack 2026.7.2-beta.2 → 2026.7.2-beta.4
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-api.js +1 -1
- package/dist/{account-inspect-Di7ditqZ.js → account-inspect-jn1xLaVi.js} +9 -2
- package/dist/account-reply-mode-DrUXogvO.js +14 -0
- package/dist/{accounts-BOJJiHSr.js → accounts-BSr252c_.js} +13 -25
- package/dist/accounts.runtime-CjULMLTa.js +2 -0
- package/dist/{action-runtime-Cee2ih0s.js → action-runtime-CFU52n4W.js} +11 -17
- package/dist/action-runtime.runtime-9-17zvKH.js +2 -0
- package/dist/{actions-BZiuSTIq.js → actions-D51foiwR.js} +5 -5
- package/dist/{actions.runtime-DoD0-gxw.js → actions.runtime-BMJwtf5C.js} +1 -1
- package/dist/api.js +15 -15
- package/dist/{approval-handler.runtime-CUPtIM4k.js → approval-handler.runtime-3b4-wxMl.js} +2 -2
- package/dist/{channel-DaIiGUOp.js → channel-Ds8NKvfr.js} +75 -41
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-Cfm6_6n1.js → channel-type-DXkUajFP.js} +3 -3
- package/dist/{channel.setup-C-mLz50O.js → channel.setup-DOSTEDfA.js} +8 -5
- package/dist/{config-schema-xPSnK2VK.js → config-schema-B4j4tCOI.js} +236 -30
- package/dist/{directory-config-DRkFujwG.js → directory-config-B08pm5ZT.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-D_yZhjgp.js → directory-live-DpPKzPrn.js} +2 -2
- package/dist/doctor-contract-U6oVntbM.js +173 -0
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{group-policy-85UWiriS.js → group-policy-CdnQzQBI.js} +98 -125
- package/dist/{interactive-replies-BilWUdcI.js → interactive-replies-C3ffk6oN.js} +1 -1
- package/dist/interactive-replies-api.js +1 -1
- package/dist/{message-tool-api-CA9jZrCY.js → message-tool-api-ByVyIVOh.js} +3 -3
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-CalGciTs.js → monitor-CnB_WKvF.js} +3 -3
- package/dist/{outbound-adapter-BiLKcnyH.js → outbound-adapter-DuPz2HHt.js} +49 -5
- package/dist/{pipeline.runtime-DofAvTtb.js → pipeline.runtime-5rRYZuX5.js} +490 -345
- package/dist/{policy-BVs4LiSa.js → policy-C31RYSuT.js} +1 -1
- package/dist/probe-CVRuArHA.js +340 -0
- package/dist/{provider-CmeoUiIM.js → provider-htuIJGFD.js} +791 -359
- package/dist/{relay-source-DMmgtvg4.js → relay-source-Df9EaiTF.js} +6 -11
- package/dist/{replies-CJJCp6qz.js → replies-Cgr2Gli4.js} +3 -3
- package/dist/{resolve-channels-Rfts6POK.js → resolve-channels-DodP2TFx.js} +1 -1
- package/dist/{resolve-users-y6wAxR8E.js → resolve-users-M9eF8891.js} +1 -1
- package/dist/{runtime-api-BGDyOt1D.js → runtime-api-D5XYMMsf.js} +3 -2
- package/dist/runtime-api.js +11 -11
- package/dist/{scopes-CuxNQZ6v.js → scopes-CJRpHkDC.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/{security-audit-CikQhBUY.js → security-audit-Cz6erklv.js} +0 -10
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-DYp8ca-l.js → send-BZ1tPv7-.js} +28 -11
- package/dist/send.runtime-a2pilFor.js +2 -0
- package/dist/setup-core-tPxMuFez.js +600 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-oSd3NX9J.js → setup-surface-wV-S1dE_.js} +58 -32
- package/dist/{shared-D9yz5Otg.js → shared-BfMskaMx.js} +57 -10
- package/dist/{slash-dispatch.runtime-CSja9VuD.js → slash-dispatch.runtime-lfeIsXTX.js} +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/fs/promises.d.ts +16 -6
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/agent-base/README.md +145 -0
- package/node_modules/agent-base/dist/src/index.d.ts +78 -0
- package/node_modules/agent-base/dist/src/index.js +203 -0
- package/node_modules/agent-base/dist/src/index.js.map +1 -0
- package/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
- package/node_modules/agent-base/dist/src/promisify.js +18 -0
- package/node_modules/agent-base/dist/src/promisify.js.map +1 -0
- package/node_modules/agent-base/package.json +64 -0
- package/node_modules/agent-base/src/index.ts +345 -0
- package/node_modules/agent-base/src/promisify.ts +33 -0
- package/node_modules/axios/CHANGELOG.md +197 -1
- package/node_modules/axios/README.md +424 -256
- package/node_modules/axios/dist/axios.js +589 -204
- package/node_modules/axios/dist/axios.min.js +3 -3
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +630 -185
- package/node_modules/axios/dist/esm/axios.js +630 -185
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +949 -301
- package/node_modules/axios/index.d.cts +28 -5
- package/node_modules/axios/index.d.ts +24 -3
- package/node_modules/axios/lib/adapters/adapters.js +1 -1
- package/node_modules/axios/lib/adapters/fetch.js +223 -49
- package/node_modules/axios/lib/adapters/http.js +408 -193
- package/node_modules/axios/lib/adapters/xhr.js +3 -1
- package/node_modules/axios/lib/core/Axios.js +4 -2
- package/node_modules/axios/lib/core/AxiosError.js +13 -1
- package/node_modules/axios/lib/core/AxiosHeaders.js +13 -42
- package/node_modules/axios/lib/core/buildFullPath.js +29 -1
- package/node_modules/axios/lib/core/mergeConfig.js +35 -0
- package/node_modules/axios/lib/defaults/transitional.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +1 -3
- package/node_modules/axios/lib/helpers/Http2Sessions.js +119 -0
- package/node_modules/axios/lib/helpers/buildURL.js +7 -4
- package/node_modules/axios/lib/helpers/composeSignals.js +48 -47
- package/node_modules/axios/lib/helpers/cookies.js +5 -1
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +16 -11
- package/node_modules/axios/lib/helpers/formDataToJSON.js +26 -4
- package/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
- package/node_modules/axios/lib/helpers/fromDataURI.js +20 -5
- package/node_modules/axios/lib/helpers/progressEventReducer.js +3 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +26 -13
- package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +33 -1
- package/node_modules/axios/lib/helpers/toFormData.js +48 -12
- package/node_modules/axios/lib/helpers/validator.js +1 -1
- package/node_modules/axios/lib/utils.js +105 -19
- package/node_modules/axios/package.json +31 -13
- package/node_modules/https-proxy-agent/README.md +137 -0
- package/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
- package/node_modules/https-proxy-agent/dist/agent.js +177 -0
- package/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
- package/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
- package/node_modules/https-proxy-agent/dist/index.js +14 -0
- package/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
- package/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
- package/node_modules/https-proxy-agent/package.json +56 -0
- package/node_modules/iconv-lite/encodings/sbcs-data.js +2 -0
- package/node_modules/iconv-lite/encodings/utf32.js +10 -3
- package/node_modules/iconv-lite/package.json +2 -2
- package/node_modules/iconv-lite/types/encodings.d.ts +2 -0
- package/node_modules/path-to-regexp/Readme.md +3 -3
- package/node_modules/path-to-regexp/dist/index.js +135 -158
- package/node_modules/path-to-regexp/dist/index.js.map +1 -1
- package/node_modules/path-to-regexp/package.json +2 -2
- package/node_modules/qs/CHANGELOG.md +11 -0
- package/node_modules/qs/dist/qs.js +17 -17
- package/node_modules/qs/lib/parse.js +19 -8
- package/node_modules/qs/lib/utils.js +47 -8
- package/node_modules/qs/package.json +6 -5
- package/node_modules/qs/test/parse.js +230 -0
- package/node_modules/qs/test/utils.js +194 -0
- package/node_modules/typebox/build/compile/validator.d.mts +1 -4
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +5 -2
- package/node_modules/typebox/build/guard/string.mjs +16 -4
- package/node_modules/typebox/build/schema/engine/_functions.mjs +34 -15
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +5 -0
- package/node_modules/typebox/build/type/action/readonly_object.mjs +8 -0
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +29 -32
- package/node_modules/ws/lib/receiver.js +15 -32
- package/node_modules/ws/lib/websocket-server.js +4 -4
- package/node_modules/ws/lib/websocket.js +4 -4
- package/node_modules/ws/package.json +5 -1
- package/npm-shrinkwrap.json +54 -27
- package/openclaw.plugin.json +1331 -1424
- package/package.json +92 -14
- package/dist/accounts.runtime-KvftRRek.js +0 -2
- package/dist/action-runtime.runtime-DZfd7IFr.js +0 -2
- package/dist/client-WIPAS3Yr.js +0 -160
- package/dist/config-api-Df9a1B8C.js +0 -3
- package/dist/doctor-contract-DddfkMlF.js +0 -134
- package/dist/probe-CN0ssfLN.js +0 -48
- package/dist/send.runtime-CJLxAt26.js +0 -2
- package/dist/setup-core-CkwVLzFO.js +0 -337
- package/node_modules/axios/dist/axios.js.map +0 -1
- package/node_modules/axios/dist/browser/axios.cjs.map +0 -1
- package/node_modules/axios/dist/esm/axios.js.map +0 -1
- package/node_modules/axios/dist/node/axios.cjs.map +0 -1
|
@@ -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 { t as inspectSlackAccount } from "./account-inspect-
|
|
1
|
+
import { t as inspectSlackAccount } from "./account-inspect-jn1xLaVi.js";
|
|
2
2
|
//#region extensions/slack/account-inspect-api.ts
|
|
3
3
|
function inspectSlackReadOnlyAccount(cfg, accountId) {
|
|
4
4
|
return inspectSlackAccount({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as resolveDefaultSlackAccountId, r as mergeSlackAccountConfig } from "./accounts-
|
|
1
|
+
import { i as resolveDefaultSlackAccountId, r as mergeSlackAccountConfig } from "./accounts-BSr252c_.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.postAs ?? "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,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region extensions/slack/src/account-reply-mode.ts
|
|
2
|
+
function normalizeSlackChatType(raw) {
|
|
3
|
+
const value = raw?.trim().toLowerCase();
|
|
4
|
+
if (!value) return;
|
|
5
|
+
if (value === "direct" || value === "dm") return "direct";
|
|
6
|
+
if (value === "group" || value === "channel") return value;
|
|
7
|
+
}
|
|
8
|
+
function resolveSlackReplyToMode(account, chatType) {
|
|
9
|
+
const normalized = normalizeSlackChatType(chatType ?? void 0);
|
|
10
|
+
if (normalized && account.replyToModeByChatType?.[normalized] !== void 0) return account.replyToModeByChatType[normalized] ?? "off";
|
|
11
|
+
return account.replyToMode ?? "off";
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { resolveSlackReplyToMode as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_ACCOUNT_ID, createAccountListHelpers, hasConfiguredAccountValue, normalizeAccountId, resolveMergedAccountConfig } from "openclaw/plugin-sdk/account-resolution";
|
|
2
2
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
import { mapAllowFromEntries, normalizeChannelDmPolicy
|
|
4
|
+
import { mapAllowFromEntries, normalizeChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
5
5
|
import { resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
//#region extensions/slack/src/token.ts
|
|
7
7
|
function formatSlackBotTokenIdentityWarning(params) {
|
|
@@ -30,22 +30,9 @@ function resolveSlackUserToken(raw, path = "channels.slack.userToken") {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
//#endregion
|
|
33
|
-
//#region extensions/slack/src/account-reply-mode.ts
|
|
34
|
-
function normalizeSlackChatType(raw) {
|
|
35
|
-
const value = raw?.trim().toLowerCase();
|
|
36
|
-
if (!value) return;
|
|
37
|
-
if (value === "direct" || value === "dm") return "direct";
|
|
38
|
-
if (value === "group" || value === "channel") return value;
|
|
39
|
-
}
|
|
40
|
-
function resolveSlackReplyToMode(account, chatType) {
|
|
41
|
-
const normalized = normalizeSlackChatType(chatType ?? void 0);
|
|
42
|
-
if (normalized && account.replyToModeByChatType?.[normalized] !== void 0) return account.replyToModeByChatType[normalized] ?? "off";
|
|
43
|
-
if (normalized === "direct" && account.dm?.replyToMode !== void 0) return account.dm.replyToMode;
|
|
44
|
-
return account.replyToMode ?? "off";
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
33
|
//#region extensions/slack/src/accounts.ts
|
|
48
34
|
function resolveSlackOperationToken(account, operation) {
|
|
35
|
+
if (account.identity === "user") return normalizeOptionalString(account.userToken);
|
|
49
36
|
const userToken = normalizeOptionalString(account.userToken);
|
|
50
37
|
const botToken = normalizeOptionalString(account.botToken);
|
|
51
38
|
if (operation === "read") return userToken ?? botToken;
|
|
@@ -53,6 +40,12 @@ function resolveSlackOperationToken(account, operation) {
|
|
|
53
40
|
}
|
|
54
41
|
const { listAccountIds, resolveDefaultAccountId } = createAccountListHelpers("slack", { hasImplicitDefaultAccount: (cfg) => {
|
|
55
42
|
const slack = cfg.channels?.slack;
|
|
43
|
+
if (slack?.postAs === "user") {
|
|
44
|
+
if (!(hasConfiguredAccountValue(slack.userToken) || hasConfiguredAccountValue(process.env.SLACK_USER_TOKEN))) return false;
|
|
45
|
+
if (slack.mode === "http") return hasConfiguredAccountValue(slack.signingSecret);
|
|
46
|
+
if (slack.mode === "relay") return hasConfiguredAccountValue(slack.relay?.url) && hasConfiguredAccountValue(slack.relay?.authToken) && hasConfiguredAccountValue(slack.relay?.gatewayId);
|
|
47
|
+
return hasConfiguredAccountValue(slack.appToken) || hasConfiguredAccountValue(process.env.SLACK_APP_TOKEN);
|
|
48
|
+
}
|
|
56
49
|
if (!(hasConfiguredAccountValue(slack?.botToken) || hasConfiguredAccountValue(process.env.SLACK_BOT_TOKEN))) return false;
|
|
57
50
|
if (slack?.mode === "http") return hasConfiguredAccountValue(slack.signingSecret);
|
|
58
51
|
if (slack?.mode === "relay") return hasConfiguredAccountValue(slack.relay?.url) && hasConfiguredAccountValue(slack.relay?.authToken) && hasConfiguredAccountValue(slack.relay?.gatewayId);
|
|
@@ -116,10 +109,7 @@ function resolveSlackAccountAllowFrom(params) {
|
|
|
116
109
|
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultSlackAccountId(params.cfg));
|
|
117
110
|
const accountConfig = resolveSlackAccountConfig(params.cfg, accountId);
|
|
118
111
|
const rootConfig = params.cfg.channels?.slack;
|
|
119
|
-
const allowFrom =
|
|
120
|
-
account: accountConfig,
|
|
121
|
-
parent: rootConfig
|
|
122
|
-
});
|
|
112
|
+
const allowFrom = accountConfig?.allowFrom ?? rootConfig?.allowFrom;
|
|
123
113
|
return allowFrom ? mapAllowFromEntries(allowFrom) : void 0;
|
|
124
114
|
}
|
|
125
115
|
function resolveSlackConfigAccessorAccount(params) {
|
|
@@ -137,16 +127,13 @@ function resolveSlackAccountDmPolicy(params) {
|
|
|
137
127
|
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultSlackAccountId(params.cfg));
|
|
138
128
|
const accountConfig = resolveSlackAccountConfig(params.cfg, accountId);
|
|
139
129
|
const rootConfig = params.cfg.channels?.slack;
|
|
140
|
-
return normalizeChannelDmPolicy(
|
|
141
|
-
account: accountConfig,
|
|
142
|
-
parent: rootConfig,
|
|
143
|
-
defaultPolicy: "pairing"
|
|
144
|
-
}));
|
|
130
|
+
return normalizeChannelDmPolicy(accountConfig?.dmPolicy ?? rootConfig?.dmPolicy ?? "pairing");
|
|
145
131
|
}
|
|
146
132
|
function resolveSlackAccount(params) {
|
|
147
133
|
const accountId = normalizeAccountId(params.accountId ?? resolveDefaultSlackAccountId(params.cfg));
|
|
148
134
|
const baseEnabled = params.cfg.channels?.slack?.enabled !== false;
|
|
149
135
|
const merged = mergeSlackAccountConfig(params.cfg, accountId);
|
|
136
|
+
const identity = merged.postAs ?? "bot";
|
|
150
137
|
const accountEnabled = merged.enabled !== false;
|
|
151
138
|
const enabled = baseEnabled && accountEnabled;
|
|
152
139
|
const mode = merged.mode ?? "socket";
|
|
@@ -169,6 +156,7 @@ function resolveSlackAccount(params) {
|
|
|
169
156
|
return {
|
|
170
157
|
accountId,
|
|
171
158
|
enabled,
|
|
159
|
+
identity,
|
|
172
160
|
name: normalizeOptionalString(merged.name),
|
|
173
161
|
botToken,
|
|
174
162
|
appToken,
|
|
@@ -197,4 +185,4 @@ function listEnabledSlackAccounts(cfg) {
|
|
|
197
185
|
})).filter((account) => account.enabled);
|
|
198
186
|
}
|
|
199
187
|
//#endregion
|
|
200
|
-
export { resolveSlackAccount as a, resolveSlackConfigAccessorAccount as c,
|
|
188
|
+
export { resolveSlackAccount as a, resolveSlackConfigAccessorAccount as c, resolveSlackAppToken as d, resolveSlackBotToken as f, resolveDefaultSlackAccountId as i, resolveSlackOperationToken as l, listSlackAccountIds as n, resolveSlackAccountAllowFrom as o, mergeSlackAccountConfig as r, resolveSlackAccountDmPolicy as s, listEnabledSlackAccounts as t, formatSlackBotTokenIdentityWarning as u };
|
|
@@ -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-CdnQzQBI.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-D5XYMMsf.js";
|
|
5
|
+
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-C31RYSuT.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-BMJwtf5C.js"));
|
|
28
|
+
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts.runtime-CjULMLTa.js"));
|
|
29
|
+
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-DXkUajFP.js").then((n) => n.t));
|
|
30
30
|
function createLazySlackAction(key) {
|
|
31
31
|
return (async (...args) => {
|
|
32
32
|
const action = (await loadSlackActionsRuntime())[key];
|
|
@@ -90,7 +90,7 @@ function hasPotentialSlackNamedPolicy(params) {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
function resolveSlackDmReadAllowed(account) {
|
|
93
|
-
const dmPolicy = account.config.dmPolicy ??
|
|
93
|
+
const dmPolicy = account.config.dmPolicy ?? "pairing";
|
|
94
94
|
return account.config.dm?.enabled !== false && dmPolicy !== "disabled";
|
|
95
95
|
}
|
|
96
96
|
function normalizeConfiguredSlackDmUserId(value) {
|
|
@@ -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,
|
|
@@ -464,7 +458,7 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
464
458
|
await assertReadTargetAllowed(channelId);
|
|
465
459
|
const threadId = readStringParam(params, "threadId") ?? readStringParam(params, "replyTo");
|
|
466
460
|
const maxBytes = account.config?.mediaMaxMb ? account.config.mediaMaxMb * 1024 * 1024 : 20 * 1024 * 1024;
|
|
467
|
-
const readToken =
|
|
461
|
+
const readToken = resolveSlackOperationToken(account, "read");
|
|
468
462
|
const downloaded = await slackActionRuntime.downloadSlackFile(fileId, {
|
|
469
463
|
...readOpts,
|
|
470
464
|
...readToken && !readOpts?.token ? { token: readToken } : {},
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as resolveSlackAccount,
|
|
3
|
-
import { A as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { a as resolveSlackAccount, f as resolveSlackBotToken } from "./accounts-BSr252c_.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-CdnQzQBI.js";
|
|
4
|
+
import { a as createSlackLookupClient, d as getSlackWriteClient } from "./probe-CVRuArHA.js";
|
|
5
|
+
import { r as sendMessageSlack, u as buildSlackNativeDataDeliveryPlan } from "./send-BZ1tPv7-.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";
|
|
9
|
-
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
10
9
|
import { z } from "zod";
|
|
10
|
+
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
11
11
|
import fs from "node:fs/promises";
|
|
12
12
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
13
13
|
import { normalizeHostname } from "openclaw/plugin-sdk/host-runtime";
|
|
@@ -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-D51foiwR.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,19 @@
|
|
|
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
|
|
3
|
-
import { t as
|
|
2
|
+
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, r as mergeSlackAccountConfig, t as listEnabledSlackAccounts } from "./accounts-BSr252c_.js";
|
|
3
|
+
import { t as resolveSlackReplyToMode } from "./account-reply-mode-DrUXogvO.js";
|
|
4
|
+
import { t as inspectSlackAccount } from "./account-inspect-jn1xLaVi.js";
|
|
4
5
|
import { a as resolveSlackChannelId, i as parseSlackTarget, n as looksLikeSlackTargetId, r as normalizeSlackMessagingTarget } from "./target-parsing-N6lHogYZ.js";
|
|
5
6
|
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
|
|
17
|
-
import {
|
|
18
|
-
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-CmeoUiIM.js";
|
|
7
|
+
import { n as buildSlackThreadingToolContext, r as resolveSlackAutoThreadId, t as slackPlugin } from "./channel-Ds8NKvfr.js";
|
|
8
|
+
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-CdnQzQBI.js";
|
|
9
|
+
import { n as extractSlackToolSend, r as listSlackMessageActions } from "./message-tool-api-ByVyIVOh.js";
|
|
10
|
+
import { n as isSlackInteractiveRepliesEnabled, r as parseSlackOptionsLine, t as compileSlackInteractiveReplies } from "./interactive-replies-C3ffk6oN.js";
|
|
11
|
+
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-CVRuArHA.js";
|
|
12
|
+
import { n as resetSlackChannelTypeCacheForTest, r as resolveSlackChannelType } from "./channel-type-DXkUajFP.js";
|
|
13
|
+
import { t as slackSetupPlugin } from "./channel.setup-DOSTEDfA.js";
|
|
14
|
+
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-D51foiwR.js";
|
|
15
|
+
import { l as recordSlackThreadParticipation, o as clearSlackThreadParticipationCache, s as hasSlackThreadParticipation } from "./send-BZ1tPv7-.js";
|
|
16
|
+
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-B08pm5ZT.js";
|
|
17
|
+
import { t as collectSlackSecurityAuditFindings } from "./security-audit-Cz6erklv.js";
|
|
18
|
+
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-htuIJGFD.js";
|
|
19
19
|
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-CdnQzQBI.js";
|
|
2
|
+
import { r as sendMessageSlack } from "./send-BZ1tPv7-.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,17 @@
|
|
|
1
|
-
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resolveSlackOperationToken, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig
|
|
1
|
+
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resolveSlackOperationToken, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig } from "./accounts-BSr252c_.js";
|
|
2
|
+
import { t as resolveSlackReplyToMode } from "./account-reply-mode-DrUXogvO.js";
|
|
2
3
|
import { a as resolveSlackChannelId, i as parseSlackTarget, n as looksLikeSlackTargetId, r as normalizeSlackMessagingTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-N6lHogYZ.js";
|
|
3
4
|
import { t as slackContextTargetsMatch } from "./targets-KmjP2E8s.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as isSlackPluginAccountConfigured } from "./account-configured-
|
|
5
|
+
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-CdnQzQBI.js";
|
|
6
|
+
import { t as isSlackPluginAccountConfigured } from "./account-configured-BwfXBo_F.js";
|
|
6
7
|
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 { _ as resolveConfiguredFromRequiredCredentialStatuses,
|
|
10
|
-
import { i as resolveSlackConversationInfo, r as resolveSlackChannelType } from "./channel-type-
|
|
8
|
+
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-ByVyIVOh.js";
|
|
9
|
+
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-C3ffk6oN.js";
|
|
10
|
+
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-CVRuArHA.js";
|
|
11
|
+
import { i as resolveSlackConversationInfo, r as resolveSlackChannelType } from "./channel-type-DXkUajFP.js";
|
|
11
12
|
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
12
|
-
import { n as slackConfigAdapter, r as slackSecurityAdapter, t as createSlackPluginBase } from "./shared-
|
|
13
|
-
import {
|
|
13
|
+
import { n as slackConfigAdapter, r as slackSecurityAdapter, t as createSlackPluginBase } from "./shared-BfMskaMx.js";
|
|
14
|
+
import { a as SLACK_CHANNEL, i as slackSetupContract, n as createSlackSetupWizardProxy, r as slackSetupAdapter } from "./setup-core-tPxMuFez.js";
|
|
14
15
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
15
16
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
16
17
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -30,7 +31,7 @@ import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-s
|
|
|
30
31
|
import { createChannelNativeOriginTargetResolver, createNativeApprovalForwardingFallbackSuppressor } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
31
32
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
32
33
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
33
|
-
import {
|
|
34
|
+
import { normalizeLegacyInteractiveReply, normalizeMessagePresentation } from "openclaw/plugin-sdk/interactive-runtime";
|
|
34
35
|
import { readPositiveIntegerParam, readStringParam } from "openclaw/plugin-sdk/param-readers";
|
|
35
36
|
//#region extensions/slack/src/action-threading.ts
|
|
36
37
|
function resolveSlackAutoThreadId(params) {
|
|
@@ -138,7 +139,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
138
139
|
approvalKind,
|
|
139
140
|
request
|
|
140
141
|
}),
|
|
141
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
142
|
+
load: async () => (await import("./approval-handler.runtime-3b4-wxMl.js")).slackApprovalNativeRuntime
|
|
142
143
|
})
|
|
143
144
|
});
|
|
144
145
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.native;
|
|
@@ -222,7 +223,7 @@ async function handleSlackMessageAction(params) {
|
|
|
222
223
|
});
|
|
223
224
|
const mediaUrl = readStringParam(actionParams, "media", { trim: false });
|
|
224
225
|
const presentation = normalizeMessagePresentation(actionParams.presentation);
|
|
225
|
-
const interactive =
|
|
226
|
+
const interactive = normalizeLegacyInteractiveReply(actionParams.interactive);
|
|
226
227
|
const hasStructuredContent = Boolean(presentation || interactive?.blocks.length);
|
|
227
228
|
const resolution = resolveSlackReplyBlockResolution({
|
|
228
229
|
text: content,
|
|
@@ -401,7 +402,7 @@ const SLACK_TOOL_DELIVERY_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
401
402
|
"unpinMessage",
|
|
402
403
|
"uploadFile"
|
|
403
404
|
]);
|
|
404
|
-
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
405
|
+
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-9-17zvKH.js"));
|
|
405
406
|
function resolveSlackActionContext(params) {
|
|
406
407
|
if (!params.toolContext && !params.mediaLocalRoots && !params.mediaReadFile && !params.conversationReadOrigin && !params.requesterAccountId && !params.requesterSenderId) return;
|
|
407
408
|
return {
|
|
@@ -471,23 +472,23 @@ const EXTENSION_SHARED_MODULE_ID = "openclaw/plugin-sdk/extension-shared";
|
|
|
471
472
|
const TARGET_RESOLVER_RUNTIME_MODULE_ID = "openclaw/plugin-sdk/target-resolver-runtime";
|
|
472
473
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import(EXTENSION_SHARED_MODULE_ID));
|
|
473
474
|
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-
|
|
475
|
+
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-wV-S1dE_.js"));
|
|
476
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-CJRpHkDC.js"));
|
|
477
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-DuPz2HHt.js"));
|
|
477
478
|
async function resolveSlackHandleAction() {
|
|
478
479
|
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? (await loadSlackActionRuntime()).handleSlackAction;
|
|
479
480
|
}
|
|
480
481
|
function shouldTreatSlackDeliveredTextAsVisible(params) {
|
|
481
482
|
return params.kind === "block" && typeof params.text === "string" && params.text.trim().length > 0;
|
|
482
483
|
}
|
|
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-
|
|
484
|
+
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-B08pm5ZT.js").then((n) => n.t));
|
|
485
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-DodP2TFx.js").then((n) => n.n));
|
|
486
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-M9eF8891.js").then((n) => n.n));
|
|
487
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-9-17zvKH.js"));
|
|
488
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-a2pilFor.js"));
|
|
489
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-CVRuArHA.js").then((n) => n.n));
|
|
490
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-CnB_WKvF.js").then((n) => n.t));
|
|
491
|
+
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-DpPKzPrn.js").then((n) => n.t));
|
|
491
492
|
async function resolveSlackSendContext(params) {
|
|
492
493
|
const account = resolveSlackAccount({
|
|
493
494
|
cfg: params.cfg,
|
|
@@ -803,7 +804,8 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
803
804
|
base: {
|
|
804
805
|
...createSlackPluginBase({
|
|
805
806
|
setupWizard: createSlackSetupWizardProxy(loadSlackSetupSurfaceModule),
|
|
806
|
-
setup: slackSetupAdapter
|
|
807
|
+
setup: slackSetupAdapter,
|
|
808
|
+
setupContract: slackSetupContract
|
|
807
809
|
}),
|
|
808
810
|
allowlist: {
|
|
809
811
|
...buildLegacyDmAccountAllowlistAdapter({
|
|
@@ -957,18 +959,25 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
957
959
|
defaultRuntime: createDefaultChannelRuntimeState(DEFAULT_ACCOUNT_ID$1),
|
|
958
960
|
buildChannelSummary: async ({ snapshot }) => {
|
|
959
961
|
const { buildPassiveProbedChannelStatusSummary } = await loadExtensionSharedSdk();
|
|
960
|
-
return buildPassiveProbedChannelStatusSummary(snapshot, {
|
|
962
|
+
return buildPassiveProbedChannelStatusSummary(snapshot, snapshot.identity === "user" ? {
|
|
963
|
+
postAs: "user",
|
|
964
|
+
userTokenSource: snapshot.userTokenSource ?? "none",
|
|
965
|
+
...snapshot.mode === "http" ? { signingSecretSource: snapshot.signingSecretSource ?? "none" } : { appTokenSource: snapshot.appTokenSource ?? "none" }
|
|
966
|
+
} : {
|
|
961
967
|
botTokenSource: snapshot.botTokenSource ?? "none",
|
|
962
968
|
appTokenSource: snapshot.appTokenSource ?? "none"
|
|
963
969
|
});
|
|
964
970
|
},
|
|
965
971
|
probeAccount: async ({ account, timeoutMs }) => {
|
|
966
|
-
const token = account.botToken?.trim();
|
|
972
|
+
const token = account.identity === "user" ? account.userToken?.trim() : account.botToken?.trim();
|
|
967
973
|
if (!token) return {
|
|
968
974
|
ok: false,
|
|
969
|
-
error: "missing token"
|
|
975
|
+
error: account.identity === "user" ? "missing user token" : "missing token"
|
|
970
976
|
};
|
|
971
|
-
return await (await loadSlackProbeModule()).probeSlack(token, timeoutMs, {
|
|
977
|
+
return await (await loadSlackProbeModule()).probeSlack(token, timeoutMs, {
|
|
978
|
+
accountId: account.accountId,
|
|
979
|
+
...account.identity === "user" ? { identity: "user" } : {}
|
|
980
|
+
});
|
|
972
981
|
},
|
|
973
982
|
formatCapabilitiesProbe: ({ probe }) => {
|
|
974
983
|
const slackProbe = probe;
|
|
@@ -978,6 +987,11 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
978
987
|
tone: "warn"
|
|
979
988
|
});
|
|
980
989
|
if (slackProbe?.bot?.name) lines.push({ text: `Bot: @${slackProbe.bot.name}` });
|
|
990
|
+
if (slackProbe?.user?.id || slackProbe?.user?.name) {
|
|
991
|
+
const name = slackProbe.user.name ? `@${slackProbe.user.name}` : "unknown";
|
|
992
|
+
const id = slackProbe.user.id ? ` (${slackProbe.user.id})` : "";
|
|
993
|
+
lines.push({ text: `User identity: ${name}${id}` });
|
|
994
|
+
}
|
|
981
995
|
if (slackProbe?.team?.name || slackProbe?.team?.id) {
|
|
982
996
|
const id = slackProbe.team?.id ? ` (${slackProbe.team.id})` : "";
|
|
983
997
|
lines.push({ text: `Team: ${slackProbe.team?.name ?? "unknown"}${id}` });
|
|
@@ -990,16 +1004,28 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
990
1004
|
const botToken = account.botToken?.trim();
|
|
991
1005
|
const userToken = account.userToken?.trim();
|
|
992
1006
|
const { fetchSlackScopes } = await loadSlackScopesModule();
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1007
|
+
if (account.identity === "user") {
|
|
1008
|
+
const userScopes = userToken ? await fetchSlackScopes(userToken, timeoutMs) : {
|
|
1009
|
+
ok: false,
|
|
1010
|
+
error: "Slack user token missing."
|
|
1011
|
+
};
|
|
1012
|
+
lines.push(formatSlackScopeDiagnostic({
|
|
1013
|
+
tokenType: "user",
|
|
1014
|
+
result: userScopes
|
|
1015
|
+
}));
|
|
1016
|
+
details.userScopes = userScopes;
|
|
1017
|
+
} else {
|
|
1018
|
+
const botScopes = botToken ? await fetchSlackScopes(botToken, timeoutMs) : {
|
|
1019
|
+
ok: false,
|
|
1020
|
+
error: "Slack bot token missing."
|
|
1021
|
+
};
|
|
1022
|
+
lines.push(formatSlackScopeDiagnostic({
|
|
1023
|
+
tokenType: "bot",
|
|
1024
|
+
result: botScopes
|
|
1025
|
+
}));
|
|
1026
|
+
details.botScopes = botScopes;
|
|
1027
|
+
}
|
|
1028
|
+
if (account.identity !== "user" && userToken) {
|
|
1003
1029
|
const userScopes = await fetchSlackScopes(userToken, timeoutMs);
|
|
1004
1030
|
lines.push(formatSlackScopeDiagnostic({
|
|
1005
1031
|
tokenType: "user",
|
|
@@ -1014,13 +1040,21 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1014
1040
|
},
|
|
1015
1041
|
resolveAccountSnapshot: ({ account }) => {
|
|
1016
1042
|
const mode = account.config.mode ?? "socket";
|
|
1017
|
-
const
|
|
1043
|
+
const identity = account.config.postAs ?? "bot";
|
|
1044
|
+
const configured = (mode === "http" ? resolveConfiguredFromRequiredCredentialStatuses(account, [identity === "user" ? "userTokenStatus" : "botTokenStatus", "signingSecretStatus"]) : mode === "socket" ? resolveConfiguredFromRequiredCredentialStatuses(account, [identity === "user" ? "userTokenStatus" : "botTokenStatus", "appTokenStatus"]) : void 0) ?? isSlackPluginAccountConfigured(account);
|
|
1018
1045
|
return {
|
|
1019
1046
|
accountId: account.accountId,
|
|
1020
1047
|
name: account.name,
|
|
1021
1048
|
enabled: account.enabled,
|
|
1022
1049
|
configured,
|
|
1023
|
-
extra: {
|
|
1050
|
+
extra: {
|
|
1051
|
+
...projectCredentialSnapshotFields(account),
|
|
1052
|
+
...identity === "user" ? {
|
|
1053
|
+
identity,
|
|
1054
|
+
mode,
|
|
1055
|
+
userTokenSource: account.userTokenSource
|
|
1056
|
+
} : {}
|
|
1057
|
+
}
|
|
1024
1058
|
};
|
|
1025
1059
|
}
|
|
1026
1060
|
}),
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-B4j4tCOI.js";
|
|
2
2
|
export { SlackChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackPlugin } from "./channel-
|
|
1
|
+
import { t as slackPlugin } from "./channel-Ds8NKvfr.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 {
|
|
4
|
-
import {
|
|
2
|
+
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-BSr252c_.js";
|
|
3
|
+
import { s as normalizeAllowListLower } from "./group-policy-CdnQzQBI.js";
|
|
4
|
+
import { c as createSlackWebClient } from "./probe-CVRuArHA.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
|
|
3
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { a as resolveSlackAccount, c as resolveSlackConfigAccessorAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds } from "./accounts-BSr252c_.js";
|
|
2
|
+
import { a as SLACK_CHANNEL, i as slackSetupContract, n as createSlackSetupWizardProxy, o as describeSlackSetupAccount, r as slackSetupAdapter, s as isSlackSetupAccountConfigured } from "./setup-core-tPxMuFez.js";
|
|
3
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-B4j4tCOI.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-wV-S1dE_.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,
|
|
@@ -67,7 +69,8 @@ const slackSetupPlugin = {
|
|
|
67
69
|
isConfigured: (account) => isSlackSetupAccountConfigured(account),
|
|
68
70
|
describeAccount: (account) => describeSlackSetupAccount(account)
|
|
69
71
|
},
|
|
70
|
-
setup: slackSetupAdapter
|
|
72
|
+
setup: slackSetupAdapter,
|
|
73
|
+
setupContract: slackSetupContract
|
|
71
74
|
};
|
|
72
75
|
//#endregion
|
|
73
76
|
export { slackSetupPlugin as t };
|