@openclaw/slack 2026.7.2-beta.7 → 2026.8.1-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-inspect-DEKpg9Ip.js → account-inspect-YJvFBbCR.js} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-CHAeNZOX.js → accounts-BlzxuYle.js} +7 -3
- package/dist/{accounts.runtime-BHD4Ma2R.js → accounts.runtime-CbabBL8x.js} +1 -1
- package/dist/{action-runtime-DfuYoMjG.js → action-runtime-D6jg2CQd.js} +193 -125
- package/dist/action-runtime.runtime-JtoOK9l5.js +2 -0
- package/dist/{actions-D3NuJvva.js → actions-DFk0ANVB.js} +116 -235
- package/dist/actions.runtime-CYLsYRai.js +2 -0
- package/dist/api.js +17 -17
- package/dist/{approval-handler.runtime-BA05P0QT.js → approval-handler.runtime-BNvAoKdK.js} +53 -14
- package/dist/{channel-B9fVdW3s.js → channel-CA5w7qDF.js} +209 -110
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-DXyos1d2.js → channel-type-CZWv55Wu.js} +9 -12
- package/dist/{config-adapter-CxBQH8fq.js → channel.setup-CpyYsEXH.js} +83 -25
- package/dist/{config-schema-SgZT6nXV.js → config-schema-CN3XZRX5.js} +27 -17
- package/dist/conversation-binding-route-DFVLUdYF.js +115 -0
- package/dist/{directory-config-CnCIAktf.js → directory-config-BGYyuzWh.js} +3 -3
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DKunWh3A.js → directory-live-DjUJQLbq.js} +13 -22
- package/dist/{doctor-contract-CsGH1Dfc.js → doctor-contract-BAy7-EUQ.js} +30 -3
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{group-policy-NQZti9t-.js → group-policy-DyfB_ZIE.js} +282 -183
- package/dist/index.js +4 -1
- package/dist/{message-tool-api-DkhFpMoy.js → message-tool-api-CqMr5Rmc.js} +14 -3
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-CmKz0wtI.js → monitor-Chrecrb9.js} +3 -3
- package/dist/{outbound-adapter-BkuMp2Vs.js → outbound-adapter-DuRqAQXK.js} +35 -23
- package/dist/{pipeline.runtime-DgtmuYCP.js → pipeline.runtime-Bbfd5VFW.js} +1386 -929
- package/dist/{policy-PRysPn23.js → policy-BKXSxrIS.js} +18 -14
- package/dist/{probe-CgDsSops.js → probe-BVA65leh.js} +38 -18
- package/dist/{provider-DmRizMZt.js → provider-CUUiwsg2.js} +3454 -2601
- package/dist/{relay-source-Blxj8xb4.js → relay-source-mhpMMRG-.js} +11 -21
- package/dist/{replies-4s_Vq_z9.js → replies-SnWyXcsL.js} +84 -27
- package/dist/{resolve-channels-yEqmM-3I.js → resolve-channels-BSpqC8jU.js} +39 -12
- package/dist/{resolve-users-BOrt5K-5.js → resolve-users-Dvz9pDe0.js} +28 -5
- package/dist/{runtime-api-QMb-Q5Ko.js → runtime-api-DBi7xc_g.js} +3 -3
- package/dist/runtime-api.js +11 -11
- package/dist/{scopes-BJSrkAp6.js → scopes-BSk4GZvZ.js} +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-DsLeZpST.js → send-CtnOxKCc.js} +249 -163
- package/dist/{send.runtime-gUdK6V3h.js → send.runtime-kYctMHSd.js} +1 -1
- package/dist/setup-entry.js +1 -4
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BeNzrMrJ.js → setup-surface-BPFfp6So.js} +6 -6
- package/dist/{shared-DgIN3Dcr.js → shared-DJBaslN7.js} +45 -45
- package/dist/{block-text-DkHaoGem.js → slack-client-kind-BXyOOICI.js} +17 -2
- package/dist/{slash-dispatch.runtime-zPkyl7dB.js → slash-dispatch.runtime-Cf2FTrnf.js} +2 -2
- package/dist/{streaming-compat-3_X-21wW.js → streaming-compat-B-e0mqM0.js} +3 -8
- package/dist/{target-parsing-N6lHogYZ.js → target-parsing-BnMD2ZqZ.js} +40 -2
- package/dist/{targets-KmjP2E8s.js → targets-Cx5W_n3W.js} +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/socket-mode/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/undici/lib/cache/memory-cache-store.js +54 -9
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +7 -1
- package/node_modules/undici/lib/core/request.js +12 -1
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -2
- package/node_modules/undici/lib/handler/cache-handler.js +246 -64
- package/node_modules/undici/lib/handler/cache-revalidation-handler.js +3 -3
- package/node_modules/undici/lib/handler/retry-handler.js +24 -0
- package/node_modules/undici/lib/interceptor/cache.js +159 -52
- package/node_modules/undici/lib/util/cache.js +324 -62
- package/node_modules/undici/lib/util/date.js +23 -6
- package/node_modules/undici/lib/web/cookies/util.js +79 -9
- package/node_modules/undici/package.json +1 -1
- package/openclaw.plugin.json +280 -33
- package/package.json +9 -11
- package/skills/slack/SKILL.md +10 -68
- package/dist/account-reply-mode-DrUXogvO.js +0 -14
- package/dist/action-runtime.runtime-DQErZYpz.js +0 -2
- package/dist/actions.runtime-BIRU_G4M.js +0 -2
- package/dist/channel.setup-CLP5oTvh.js +0 -56
- package/dist/preflight-audio.runtime-D5Bgags0.js +0 -3
- package/dist/slash-plugin-commands.runtime-Dosfcx3X.js +0 -2
- package/node_modules/p-map/index.d.ts +0 -155
- package/node_modules/p-map/index.js +0 -285
- package/node_modules/p-map/license +0 -9
- package/node_modules/p-map/package.json +0 -57
- package/node_modules/p-map/readme.md +0 -190
- package/dist/{security-audit-DR097212.js → security-audit-B_yKr7MW.js} +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as updateMessageSlack, n as resolveSlackDmChannelId, r as sendMessageSlack, t as reconcileSlackUnknownSend } from "./send-
|
|
1
|
+
import { a as updateMessageSlack, n as resolveSlackDmChannelId, r as sendMessageSlack, t as reconcileSlackUnknownSend } from "./send-CtnOxKCc.js";
|
|
2
2
|
export { reconcileSlackUnknownSend, resolveSlackDmChannelId, sendMessageSlack, updateMessageSlack };
|
package/dist/setup-entry.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { t as registerSlackPluginHttpRoutes } from "./plugin-routes-CLp4obpN.js";
|
|
2
|
-
import "./http-routes-api.js";
|
|
3
1
|
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
4
2
|
//#region extensions/slack/setup-entry.ts
|
|
5
3
|
var setup_entry_default = defineBundledChannelSetupEntry({
|
|
@@ -15,8 +13,7 @@ var setup_entry_default = defineBundledChannelSetupEntry({
|
|
|
15
13
|
runtime: {
|
|
16
14
|
specifier: "./runtime-setter-api.js",
|
|
17
15
|
exportName: "setSlackRuntime"
|
|
18
|
-
}
|
|
19
|
-
registerSetupRuntime: registerSlackPluginHttpRoutes
|
|
16
|
+
}
|
|
20
17
|
});
|
|
21
18
|
//#endregion
|
|
22
19
|
export { setup_entry_default as default };
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as slackSetupPlugin } from "./channel.setup-CpyYsEXH.js";
|
|
2
2
|
export { slackSetupPlugin };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom } from "./accounts-
|
|
2
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
3
|
-
import "./shared-
|
|
4
|
-
import {
|
|
5
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
6
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
1
|
+
import { i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom } from "./accounts-BlzxuYle.js";
|
|
2
|
+
import { t as inspectSlackAccount } from "./account-inspect-YJvFBbCR.js";
|
|
3
|
+
import "./shared-DJBaslN7.js";
|
|
4
|
+
import { o as SLACK_CHANNEL, r as createSlackSetupWizardBase } from "./channel.setup-CpyYsEXH.js";
|
|
5
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-BSpqC8jU.js";
|
|
6
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-Dvz9pDe0.js";
|
|
7
7
|
import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
9
9
|
import { createSetupTranslator, noteChannelLookupFailure, noteChannelLookupSummary, parseMentionOrPrefixedId, patchChannelConfigForAccount, promptResolvedAllowFrom, resolveEntriesWithOptionalToken, resolveSetupAccountId, splitSetupEntries } from "openclaw/plugin-sdk/setup-runtime";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig, s as resolveSlackAccountDmPolicy } from "./accounts-
|
|
2
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
1
|
+
import { n as listSlackAccountIds, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig, s as resolveSlackAccountDmPolicy } from "./accounts-BlzxuYle.js";
|
|
2
|
+
import { t as inspectSlackAccount } from "./account-inspect-YJvFBbCR.js";
|
|
3
|
+
import { a as parseSlackTarget } from "./target-parsing-BnMD2ZqZ.js";
|
|
3
4
|
import { t as isSlackPluginAccountConfigured } from "./account-configured-BwfXBo_F.js";
|
|
4
|
-
import { b as getChatChannelMeta, t as probeSlack } from "./probe-
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
7
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-CsGH1Dfc.js";
|
|
5
|
+
import { b as getChatChannelMeta, t as probeSlack } from "./probe-BVA65leh.js";
|
|
6
|
+
import { n as slackBaseConfigAdapter, t as slackSetupPlugin } from "./channel.setup-CpyYsEXH.js";
|
|
7
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-BAy7-EUQ.js";
|
|
8
8
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-DxmvbxBF.js";
|
|
9
9
|
import { adaptScopedAccountAccessor, createScopedDmSecurityResolver } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
10
10
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
11
|
-
import { buildMutableAllowEntryDetector, collectStandardAllowlistLists, createDangerousNameMatchingMutableAllowlistWarningCollector, createOpenProviderConfiguredRouteWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
11
|
+
import { buildMutableAllowEntryDetector, collectStandardAllowlistLists, createConditionalWarningCollector, createDangerousNameMatchingMutableAllowlistWarningCollector, createOpenProviderConfiguredRouteWarningCollector } from "openclaw/plugin-sdk/channel-policy";
|
|
12
12
|
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
13
|
-
import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor";
|
|
13
|
+
import { asObjectRecord } from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
14
14
|
//#region extensions/slack/src/security.ts
|
|
15
15
|
const resolveSlackDmPolicy = createScopedDmSecurityResolver({
|
|
16
16
|
channelKey: "slack",
|
|
@@ -45,20 +45,36 @@ const collectSlackSecurityWarnings = createOpenProviderConfiguredRouteWarningCol
|
|
|
45
45
|
remediation: "Set channels.slack.groupPolicy=\"allowlist\" and configure channels.slack.channels"
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
const
|
|
48
|
+
const collectSlackSecurityFindings = createConditionalWarningCollector.findings({
|
|
49
|
+
collectWarnings: collectSlackSecurityWarnings,
|
|
50
|
+
checkId: "channels.slack.groups.open",
|
|
51
|
+
severity: "critical",
|
|
52
|
+
title: "Slack security warning"
|
|
53
|
+
});
|
|
54
|
+
const loadSlackSecurityAuditModule = createLazyRuntimeModule(() => import("./security-audit-B_yKr7MW.js").then((n) => n.n));
|
|
49
55
|
const slackSecurityAdapter = {
|
|
50
56
|
resolveDmPolicy: resolveSlackDmPolicy,
|
|
51
|
-
collectWarnings:
|
|
57
|
+
collectWarnings: collectSlackSecurityFindings,
|
|
52
58
|
collectAuditFindings: async (params) => {
|
|
53
59
|
const { collectSlackSecurityAuditFindings } = await loadSlackSecurityAuditModule();
|
|
54
60
|
return await collectSlackSecurityAuditFindings(params);
|
|
55
61
|
}
|
|
56
62
|
};
|
|
57
63
|
//#endregion
|
|
64
|
+
//#region extensions/slack/src/security-doctor.ts
|
|
65
|
+
const isSlackMutableUnqualifiedAllowEntry = buildMutableAllowEntryDetector({ stableIdPattern: /^(?:(?:(?:[sS][lL][aA][cC][kK]|[uU][sS][eE][rR]):)?(?:[UWBCGDT][A-Z0-9]{2,}|[A-Za-z0-9]{8,})|<@[A-Za-z0-9]{8,}>)$/ });
|
|
66
|
+
function isSlackMutableAllowEntry(entry) {
|
|
67
|
+
if (/^team:/i.test(entry)) try {
|
|
68
|
+
const target = parseSlackTarget(entry);
|
|
69
|
+
if (target?.kind === "user" && target.teamId) return false;
|
|
70
|
+
} catch {}
|
|
71
|
+
return isSlackMutableUnqualifiedAllowEntry(entry);
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
58
74
|
//#region extensions/slack/src/doctor.ts
|
|
59
75
|
const collectSlackMutableAllowlistWarnings = createDangerousNameMatchingMutableAllowlistWarningCollector({
|
|
60
76
|
channel: "slack",
|
|
61
|
-
detector:
|
|
77
|
+
detector: isSlackMutableAllowEntry,
|
|
62
78
|
collectLists: (scope) => collectStandardAllowlistLists(scope, {
|
|
63
79
|
includeGroupAllowFrom: false,
|
|
64
80
|
includeDm: true,
|
|
@@ -78,10 +94,21 @@ const SLACK_AMBIGUOUS_LOWERCASE_CHANNEL_ID_RE = /^(?:channel:)?[cgd][a-z][a-z0-9
|
|
|
78
94
|
const SLACK_CHANNEL_NAME_RE = /^[\p{L}\p{M}\p{N}_-]{1,80}$/u;
|
|
79
95
|
const SLACK_CHANNEL_NAME_ALPHANUMERIC_RE = /[\p{L}\p{N}]/u;
|
|
80
96
|
function looksLikeSlackChannelId(channelKey) {
|
|
81
|
-
|
|
97
|
+
const workspaceChannelId = parseWorkspaceQualifiedChannelId(channelKey);
|
|
98
|
+
return workspaceChannelId !== void 0 && /^[CG]/i.test(workspaceChannelId) || SLACK_CANONICAL_CHANNEL_ID_RE.test(channelKey) || SLACK_LOWERCASE_CHANNEL_ID_RE.test(channelKey) || SLACK_PREFIXED_CANONICAL_CHANNEL_ID_RE.test(channelKey) || SLACK_PREFIXED_LOWERCASE_CHANNEL_ID_RE.test(channelKey);
|
|
82
99
|
}
|
|
83
100
|
function looksLikeSlackDmId(channelKey) {
|
|
84
|
-
|
|
101
|
+
const workspaceChannelId = parseWorkspaceQualifiedChannelId(channelKey);
|
|
102
|
+
return workspaceChannelId !== void 0 && /^D/i.test(workspaceChannelId) || SLACK_CANONICAL_DM_ID_RE.test(channelKey) || SLACK_PREFIXED_LOWERCASE_DM_ID_RE.test(channelKey);
|
|
103
|
+
}
|
|
104
|
+
function parseWorkspaceQualifiedChannelId(channelKey) {
|
|
105
|
+
if (!/^team:/i.test(channelKey)) return;
|
|
106
|
+
try {
|
|
107
|
+
const target = parseSlackTarget(channelKey);
|
|
108
|
+
return target?.kind === "channel" && target.teamId ? target.id : void 0;
|
|
109
|
+
} catch {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
85
112
|
}
|
|
86
113
|
function looksLikeSlackChannelNameKey(channelKey) {
|
|
87
114
|
const name = channelKey.startsWith("#") ? channelKey.slice(1) : channelKey;
|
|
@@ -189,29 +216,13 @@ const slackConfigAdapter = {
|
|
|
189
216
|
};
|
|
190
217
|
function createSlackPluginBase(params) {
|
|
191
218
|
return {
|
|
192
|
-
|
|
219
|
+
...slackSetupPlugin,
|
|
193
220
|
meta: {
|
|
194
|
-
...getChatChannelMeta(
|
|
221
|
+
...getChatChannelMeta(slackSetupPlugin.id),
|
|
195
222
|
preferSessionLookupForAnnounceTarget: true
|
|
196
223
|
},
|
|
197
224
|
setupWizard: params.setupWizard,
|
|
198
|
-
|
|
199
|
-
capabilities: {
|
|
200
|
-
chatTypes: [
|
|
201
|
-
"direct",
|
|
202
|
-
"channel",
|
|
203
|
-
"thread"
|
|
204
|
-
],
|
|
205
|
-
reactions: true,
|
|
206
|
-
threads: true,
|
|
207
|
-
media: true,
|
|
208
|
-
nativeCommands: true
|
|
209
|
-
},
|
|
210
|
-
commands: {
|
|
211
|
-
nativeCommandsAutoEnabled: false,
|
|
212
|
-
nativeSkillsAutoEnabled: false,
|
|
213
|
-
resolveNativeCommandName: ({ commandKey, defaultName }) => commandKey === "status" ? "agentstatus" : defaultName
|
|
214
|
-
},
|
|
225
|
+
setupContract: params.setupContract,
|
|
215
226
|
doctor: slackDoctor,
|
|
216
227
|
agentPrompt: {
|
|
217
228
|
inboundFormattingHints: () => ({
|
|
@@ -233,20 +244,10 @@ function createSlackPluginBase(params) {
|
|
|
233
244
|
"- Slack Block Kit or presentation text fields are sent as Slack mrkdwn directly; use `*bold*`, `_italic_`, `~strike~`, `<url|label>` links, and avoid Markdown headings or pipe tables there."
|
|
234
245
|
]
|
|
235
246
|
},
|
|
236
|
-
streaming: { blockStreamingCoalesceDefaults: {
|
|
237
|
-
minChars: 1500,
|
|
238
|
-
idleMs: 1e3
|
|
239
|
-
} },
|
|
240
|
-
reload: { configPrefixes: ["channels.slack"] },
|
|
241
247
|
security: slackSecurityAdapter,
|
|
242
|
-
configSchema: SlackChannelConfigSchema,
|
|
243
248
|
config: {
|
|
249
|
+
...slackSetupPlugin.config,
|
|
244
250
|
...slackConfigAdapter,
|
|
245
|
-
hasConfiguredState: ({ env }) => [
|
|
246
|
-
"SLACK_APP_TOKEN",
|
|
247
|
-
"SLACK_BOT_TOKEN",
|
|
248
|
-
"SLACK_USER_TOKEN"
|
|
249
|
-
].some((key) => typeof env?.[key] === "string" && env[key]?.trim().length > 0),
|
|
250
251
|
isConfigured: (account) => isSlackPluginAccountConfigured(account),
|
|
251
252
|
describeAccount: (account) => describeAccountSnapshot({
|
|
252
253
|
account,
|
|
@@ -260,8 +261,7 @@ function createSlackPluginBase(params) {
|
|
|
260
261
|
secrets: {
|
|
261
262
|
secretTargetRegistryEntries,
|
|
262
263
|
collectRuntimeConfigAssignments
|
|
263
|
-
}
|
|
264
|
-
setup: params.setup
|
|
264
|
+
}
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
267
|
//#endregion
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as renderSlackBlockFallbackText } from "./group-policy-DyfB_ZIE.js";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { normalizeHostname } from "openclaw/plugin-sdk/host-runtime";
|
|
4
|
+
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
|
5
|
+
import { saveRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
|
|
3
6
|
//#region extensions/slack/src/monitor/block-text.ts
|
|
4
7
|
function readSlackBlockType(block) {
|
|
5
8
|
return block && typeof block === "object" && !Array.isArray(block) ? block.type : void 0;
|
|
@@ -76,4 +79,16 @@ function chooseSlackPrimaryText(params) {
|
|
|
76
79
|
return blocksText.text.length > messageText.length && blocksText.text.startsWith(messageText) ? blocksText.text : messageText;
|
|
77
80
|
}
|
|
78
81
|
//#endregion
|
|
79
|
-
|
|
82
|
+
//#region extensions/slack/src/monitor/slack-client-kind.ts
|
|
83
|
+
/** Detects the isolated GovSlack API plane without consulting mutable config. */
|
|
84
|
+
function isGovSlackClient(client) {
|
|
85
|
+
if (!client?.slackApiUrl) return false;
|
|
86
|
+
try {
|
|
87
|
+
const apiUrl = new URL(client.slackApiUrl);
|
|
88
|
+
return apiUrl.protocol === "https:" && !apiUrl.port && normalizeHostname(apiUrl.hostname) === "slack-gov.com";
|
|
89
|
+
} catch {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { hasSlackTableBlock as a, resolveSlackMessageText as c, hasSlackMessageTableBlock as i, fetchWithRuntimeDispatcher as n, isSlackUnfurlAttachment as o, saveRemoteMedia as r, resolveSlackBlocksText as s, isGovSlackClient as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as deliverSlackSlashReplies$1 } from "./replies-
|
|
1
|
+
import { r as deliverSlackSlashReplies$1 } from "./replies-SnWyXcsL.js";
|
|
2
2
|
import { resolveAgentRoute as resolveAgentRoute$1 } from "openclaw/plugin-sdk/routing";
|
|
3
|
-
import { resolveMarkdownTableMode as resolveMarkdownTableMode$1 } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
4
3
|
import { resolveConversationLabel as resolveConversationLabel$1 } from "openclaw/plugin-sdk/conversation-runtime";
|
|
4
|
+
import { resolveMarkdownTableMode as resolveMarkdownTableMode$1 } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
5
5
|
import { dispatchChannelInboundTurn as dispatchChannelInboundTurn$1, isChannelPartialDeliveryError as isChannelPartialDeliveryError$1 } from "openclaw/plugin-sdk/channel-inbound";
|
|
6
6
|
import { finalizeInboundContext as finalizeInboundContext$1, resolveChunkMode as resolveChunkMode$1 } from "openclaw/plugin-sdk/reply-runtime";
|
|
7
7
|
//#region extensions/slack/src/monitor/slash-dispatch.runtime.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
import { getChannelStreamingConfigObject, resolveChannelStreamingNativeTransport } from "openclaw/plugin-sdk/channel-
|
|
2
|
+
import { getChannelStreamingConfigObject, resolveChannelStreamingNativeTransport } from "openclaw/plugin-sdk/channel-streaming-config";
|
|
3
3
|
//#region extensions/slack/src/streaming-compat.ts
|
|
4
4
|
function normalizeStreamingMode(value) {
|
|
5
5
|
if (typeof value !== "string") return null;
|
|
@@ -20,18 +20,13 @@ function mapSlackLegacyDraftStreamModeToStreaming(mode) {
|
|
|
20
20
|
if (mode === "status_final") return "progress";
|
|
21
21
|
return "partial";
|
|
22
22
|
}
|
|
23
|
-
function mapStreamingModeToSlackLegacyDraftStreamMode(mode) {
|
|
24
|
-
if (mode === "block") return "append";
|
|
25
|
-
if (mode === "progress") return "status_final";
|
|
26
|
-
return "replace";
|
|
27
|
-
}
|
|
28
23
|
function resolveSlackStreamingMode(params = {}) {
|
|
29
24
|
const parsedStreaming = parseStreamingMode(getChannelStreamingConfigObject(params)?.mode ?? params.streaming);
|
|
30
25
|
if (parsedStreaming) return parsedStreaming;
|
|
31
26
|
const legacyStreamMode = parseSlackLegacyDraftStreamMode(params.streamMode);
|
|
32
27
|
if (legacyStreamMode) return mapSlackLegacyDraftStreamModeToStreaming(legacyStreamMode);
|
|
33
28
|
if (typeof params.streaming === "boolean") return params.streaming ? "partial" : "off";
|
|
34
|
-
return "
|
|
29
|
+
return "progress";
|
|
35
30
|
}
|
|
36
31
|
function resolveSlackNativeStreaming(params = {}) {
|
|
37
32
|
const canonical = resolveChannelStreamingNativeTransport(params);
|
|
@@ -41,4 +36,4 @@ function resolveSlackNativeStreaming(params = {}) {
|
|
|
41
36
|
return true;
|
|
42
37
|
}
|
|
43
38
|
//#endregion
|
|
44
|
-
export {
|
|
39
|
+
export { resolveSlackStreamingMode as n, resolveSlackNativeStreaming as t };
|
|
@@ -1,7 +1,42 @@
|
|
|
1
1
|
import { buildMessagingTarget, ensureTargetId, parseMentionPrefixOrAtUserTarget, requireTargetKind } from "openclaw/plugin-sdk/channel-targets";
|
|
2
2
|
//#region extensions/slack/src/target-parsing.ts
|
|
3
3
|
const SLACK_CHANNEL_API_ID_RE = /^[CDG][0-9][A-Z0-9]{7,}$/i;
|
|
4
|
-
const SLACK_USER_API_ID_RE = /^[
|
|
4
|
+
const SLACK_USER_API_ID_RE = /^[BUW][A-Z0-9]{8,}$/i;
|
|
5
|
+
const SLACK_QUALIFIED_TARGET_RE = /^team:([^:]+):(user|channel):([^:]+)$/i;
|
|
6
|
+
function decodeSlackTargetPart(raw) {
|
|
7
|
+
try {
|
|
8
|
+
return decodeURIComponent(raw).trim() || void 0;
|
|
9
|
+
} catch {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function parseQualifiedSlackTarget(raw) {
|
|
14
|
+
const match = SLACK_QUALIFIED_TARGET_RE.exec(raw);
|
|
15
|
+
if (!match) {
|
|
16
|
+
if (/^team:/i.test(raw)) throw new Error("Slack workspace targets require team:<team-id>:channel:<channel-id> or team:<team-id>:user:<user-id>");
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const teamId = decodeSlackTargetPart(match[1] ?? "");
|
|
20
|
+
const kind = match[2]?.toLowerCase();
|
|
21
|
+
const id = decodeSlackTargetPart(match[3] ?? "");
|
|
22
|
+
const idPattern = kind === "user" ? /^[BUW][A-Z0-9]+$/i : /^[CDG][A-Z0-9]+$/i;
|
|
23
|
+
if (!teamId || !/^T[A-Z0-9]+$/i.test(teamId) || !kind || !id || !idPattern.test(id)) throw new Error("Invalid Slack workspace-qualified target");
|
|
24
|
+
return {
|
|
25
|
+
kind,
|
|
26
|
+
id,
|
|
27
|
+
teamId,
|
|
28
|
+
raw,
|
|
29
|
+
normalized: `team:${teamId.toLowerCase()}:${kind}:${id.toLowerCase()}`
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function formatSlackTarget(params) {
|
|
33
|
+
const teamId = params.teamId?.trim();
|
|
34
|
+
const id = params.id.trim();
|
|
35
|
+
if (!teamId) return params.explicitKind ? `${params.kind}:${id}` : id;
|
|
36
|
+
const idPattern = params.kind === "user" ? /^[BUW][A-Z0-9]+$/i : /^[CDG][A-Z0-9]+$/i;
|
|
37
|
+
if (!/^T[A-Z0-9]+$/i.test(teamId) || !idPattern.test(id)) throw new Error("Invalid Slack workspace-qualified target");
|
|
38
|
+
return `team:${encodeURIComponent(teamId)}:${params.kind}:${encodeURIComponent(id)}`;
|
|
39
|
+
}
|
|
5
40
|
function isUnambiguousSlackUserId(rawId) {
|
|
6
41
|
const id = rawId.trim();
|
|
7
42
|
return /^[UW][A-Z0-9]+$/.test(id) || /^[uw][0-9][a-z0-9]{7,}$/.test(id);
|
|
@@ -15,6 +50,8 @@ function canonicalizeSlackApiTargetId(kind, rawId, rawTarget) {
|
|
|
15
50
|
function parseSlackTarget(raw, options = {}) {
|
|
16
51
|
const trimmed = raw.trim();
|
|
17
52
|
if (!trimmed) return;
|
|
53
|
+
const qualifiedTarget = parseQualifiedSlackTarget(trimmed);
|
|
54
|
+
if (qualifiedTarget) return qualifiedTarget;
|
|
18
55
|
const userTarget = parseMentionPrefixOrAtUserTarget({
|
|
19
56
|
raw: trimmed,
|
|
20
57
|
mentionPattern: /^<@([A-Z0-9]+)>$/i,
|
|
@@ -66,8 +103,9 @@ function looksLikeSlackTargetId(raw) {
|
|
|
66
103
|
if (/^<@([A-Z0-9]+)>$/i.test(trimmed)) return true;
|
|
67
104
|
if (/^(user|channel):/i.test(trimmed)) return true;
|
|
68
105
|
if (/^slack:/i.test(trimmed)) return true;
|
|
106
|
+
if (/^team:/i.test(trimmed)) return true;
|
|
69
107
|
if (/^[@#]/.test(trimmed)) return true;
|
|
70
108
|
return /^[CUWGD][A-Z0-9]{8,}$/i.test(trimmed);
|
|
71
109
|
}
|
|
72
110
|
//#endregion
|
|
73
|
-
export {
|
|
111
|
+
export { parseSlackTarget as a, normalizeSlackMessagingTarget as i, formatSlackTarget as n, resolveSlackChannelId as o, looksLikeSlackTargetId as r, slackTargetsMatch as s, canonicalizeSlackApiTargetId as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as parseSlackTarget, s as slackTargetsMatch } from "./target-parsing-BnMD2ZqZ.js";
|
|
2
2
|
//#region extensions/slack/src/targets.ts
|
|
3
3
|
function matchesResolvedUserTarget(target, currentMessagingTarget) {
|
|
4
4
|
const resolvedId = target.trim();
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 27 Jul 2026 17:32:10 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -1185,7 +1185,7 @@ declare module "node:crypto" {
|
|
|
1185
1185
|
* and it will be impossible to extract the private key from the returned object.
|
|
1186
1186
|
* @since v11.6.0
|
|
1187
1187
|
*/
|
|
1188
|
-
function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput |
|
|
1188
|
+
function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput | KeyLike): KeyObject;
|
|
1189
1189
|
/**
|
|
1190
1190
|
* Creates and returns a new key object containing a secret key for symmetric
|
|
1191
1191
|
* encryption or `Hmac`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.1.
|
|
3
|
+
"version": "26.1.2",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~8.3.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "359a01a58cecf5a30fb7b7a7b10c4f5c332339421ef5cbc9932fc492f472a5b4",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 27 Jul 2026 17:32:10 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -1185,7 +1185,7 @@ declare module "node:crypto" {
|
|
|
1185
1185
|
* and it will be impossible to extract the private key from the returned object.
|
|
1186
1186
|
* @since v11.6.0
|
|
1187
1187
|
*/
|
|
1188
|
-
function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput |
|
|
1188
|
+
function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput | KeyLike): KeyObject;
|
|
1189
1189
|
/**
|
|
1190
1190
|
* Creates and returns a new key object containing a secret key for symmetric
|
|
1191
1191
|
* encryption or `Hmac`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.1.
|
|
3
|
+
"version": "26.1.2",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~8.3.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "359a01a58cecf5a30fb7b7a7b10c4f5c332339421ef5cbc9932fc492f472a5b4",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
|
@@ -8,7 +8,7 @@ This package contains type definitions for node (https://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Mon, 27 Jul 2026 17:32:10 GMT
|
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -1185,7 +1185,7 @@ declare module "node:crypto" {
|
|
|
1185
1185
|
* and it will be impossible to extract the private key from the returned object.
|
|
1186
1186
|
* @since v11.6.0
|
|
1187
1187
|
*/
|
|
1188
|
-
function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput |
|
|
1188
|
+
function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput | KeyLike): KeyObject;
|
|
1189
1189
|
/**
|
|
1190
1190
|
* Creates and returns a new key object containing a secret key for symmetric
|
|
1191
1191
|
* encryption or `Hmac`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "26.1.
|
|
3
|
+
"version": "26.1.2",
|
|
4
4
|
"description": "TypeScript definitions for node",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -150,6 +150,6 @@
|
|
|
150
150
|
"undici-types": "~8.3.0"
|
|
151
151
|
},
|
|
152
152
|
"peerDependencies": {},
|
|
153
|
-
"typesPublisherContentHash": "
|
|
153
|
+
"typesPublisherContentHash": "359a01a58cecf5a30fb7b7a7b10c4f5c332339421ef5cbc9932fc492f472a5b4",
|
|
154
154
|
"typeScriptVersion": "5.6"
|
|
155
155
|
}
|
|
@@ -218,17 +218,62 @@ class MemoryCacheStore extends EventEmitter {
|
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
function findEntry (key, entries, now) {
|
|
221
|
-
|
|
222
|
-
entry
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
for (let i = 0; i < entries.length; i++) {
|
|
222
|
+
const entry = entries[i]
|
|
223
|
+
if (
|
|
224
|
+
entry.deleteAt > now &&
|
|
225
|
+
entry.method === key.method &&
|
|
226
|
+
varyMatches(key, entry)
|
|
227
|
+
) {
|
|
228
|
+
return entry
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function varyMatches (key, entry) {
|
|
234
|
+
if (entry.vary == null) {
|
|
235
|
+
return true
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
for (const headerName in entry.vary) {
|
|
239
|
+
if (Object.hasOwn(entry.vary, headerName) && !headerValueEquals(key.headers?.[headerName], entry.vary[headerName])) {
|
|
240
|
+
return false
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return true
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @param {string|string[]|null|undefined} lhs
|
|
249
|
+
* @param {string|string[]|null|undefined} rhs
|
|
250
|
+
* @returns {boolean}
|
|
251
|
+
*/
|
|
252
|
+
function headerValueEquals (lhs, rhs) {
|
|
253
|
+
if (lhs == null && rhs == null) {
|
|
254
|
+
return true
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
if ((lhs == null && rhs != null) ||
|
|
258
|
+
(lhs != null && rhs == null)) {
|
|
259
|
+
return false
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (Array.isArray(lhs) && Array.isArray(rhs)) {
|
|
263
|
+
if (lhs.length !== rhs.length) {
|
|
264
|
+
return false
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
for (let i = 0; i < lhs.length; i++) {
|
|
268
|
+
if (lhs[i] !== rhs[i]) {
|
|
269
|
+
return false
|
|
227
270
|
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return true
|
|
274
|
+
}
|
|
228
275
|
|
|
229
|
-
|
|
230
|
-
}))
|
|
231
|
-
))
|
|
276
|
+
return lhs === rhs
|
|
232
277
|
}
|
|
233
278
|
|
|
234
279
|
module.exports = MemoryCacheStore
|
|
@@ -454,7 +454,13 @@ function headerValueEquals (lhs, rhs) {
|
|
|
454
454
|
return false
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
|
|
457
|
+
for (let i = 0; i < lhs.length; i++) {
|
|
458
|
+
if (lhs[i] !== rhs[i]) {
|
|
459
|
+
return false
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
return true
|
|
458
464
|
}
|
|
459
465
|
|
|
460
466
|
return lhs === rhs
|
|
@@ -390,7 +390,13 @@ function processHeader (request, key, val) {
|
|
|
390
390
|
} else if (typeof val[i] === 'object') {
|
|
391
391
|
throw new InvalidArgumentError(`invalid ${key} header`)
|
|
392
392
|
} else {
|
|
393
|
-
|
|
393
|
+
// Coerce primitives (and reject unsafe coercions such as functions
|
|
394
|
+
// with a crafted toString/Symbol.toPrimitive).
|
|
395
|
+
const str = `${val[i]}`
|
|
396
|
+
if (!isValidHeaderValue(str)) {
|
|
397
|
+
throw new InvalidArgumentError(`invalid ${key} header`)
|
|
398
|
+
}
|
|
399
|
+
arr.push(str)
|
|
394
400
|
}
|
|
395
401
|
}
|
|
396
402
|
val = arr
|
|
@@ -401,7 +407,12 @@ function processHeader (request, key, val) {
|
|
|
401
407
|
} else if (val === null) {
|
|
402
408
|
val = ''
|
|
403
409
|
} else {
|
|
410
|
+
// Coerce primitives (and reject unsafe coercions such as functions
|
|
411
|
+
// with a crafted toString/Symbol.toPrimitive).
|
|
404
412
|
val = `${val}`
|
|
413
|
+
if (!isValidHeaderValue(val)) {
|
|
414
|
+
throw new InvalidArgumentError(`invalid ${key} header`)
|
|
415
|
+
}
|
|
405
416
|
}
|
|
406
417
|
|
|
407
418
|
if (headerName === 'host') {
|
|
@@ -10,6 +10,7 @@ const {
|
|
|
10
10
|
RequestContentLengthMismatchError,
|
|
11
11
|
ResponseContentLengthMismatchError,
|
|
12
12
|
RequestAbortedError,
|
|
13
|
+
InvalidArgumentError,
|
|
13
14
|
HeadersTimeoutError,
|
|
14
15
|
HeadersOverflowError,
|
|
15
16
|
SocketError,
|
|
@@ -1134,8 +1135,16 @@ function writeH1 (client, request) {
|
|
|
1134
1135
|
}
|
|
1135
1136
|
body = bodyStream.stream
|
|
1136
1137
|
contentLength = bodyStream.length
|
|
1137
|
-
} else if (util.isBlobLike(body) && request.contentType == null
|
|
1138
|
-
|
|
1138
|
+
} else if (util.isBlobLike(body) && request.contentType == null) {
|
|
1139
|
+
const contentType = body.type
|
|
1140
|
+
if (contentType) {
|
|
1141
|
+
const contentTypeValue = `${contentType}`
|
|
1142
|
+
if (!util.isValidHeaderValue(contentTypeValue)) {
|
|
1143
|
+
util.errorRequest(client, request, new InvalidArgumentError('invalid content-type header'))
|
|
1144
|
+
return false
|
|
1145
|
+
}
|
|
1146
|
+
headers.push('content-type', contentTypeValue)
|
|
1147
|
+
}
|
|
1139
1148
|
}
|
|
1140
1149
|
|
|
1141
1150
|
if (body && typeof body.read === 'function') {
|