@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
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildSecretInputSchema, hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
|
|
2
2
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelImplicitMentionsSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, GroupPolicySchema, ProviderCommandsSchema, ReplyToModeSchema, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildCommonChannelAccountShape, buildGroupEntrySchema, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
//#region extensions/slack/src/config-ui-hints.ts
|
|
6
|
+
const slackChannelConfigUiHints = {
|
|
6
7
|
"": {
|
|
7
8
|
label: "Slack",
|
|
8
9
|
help: "Slack channel provider configuration for bot/app tokens, streaming behavior, and DM policy controls. Keep token handling and thread behavior explicit to avoid noisy workspace interactions."
|
|
@@ -11,19 +12,21 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { u
|
|
|
11
12
|
label: "Slack Enterprise Grid Org Install",
|
|
12
13
|
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
14
|
},
|
|
15
|
+
postAs: {
|
|
16
|
+
label: "Slack Identity",
|
|
17
|
+
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."
|
|
18
|
+
},
|
|
14
19
|
...createChannelConfigUiHints({
|
|
15
20
|
channelLabel: "Slack",
|
|
16
|
-
dmPolicy: {
|
|
17
|
-
channelKey: "slack",
|
|
18
|
-
includeLegacyNestedPolicy: true
|
|
19
|
-
},
|
|
21
|
+
dmPolicy: { channelKey: "slack" },
|
|
20
22
|
configWrites: true,
|
|
21
23
|
mentionPatterns: {
|
|
22
24
|
targetDescription: "Slack channel IDs",
|
|
23
25
|
policyNote: "Native Slack @mentions still trigger even when regex patterns are denied.",
|
|
24
26
|
denyNote: "Native @mentions still trigger."
|
|
25
27
|
},
|
|
26
|
-
nativeCommands: true
|
|
28
|
+
nativeCommands: true,
|
|
29
|
+
implicitMentions: true
|
|
27
30
|
}),
|
|
28
31
|
allowBots: {
|
|
29
32
|
label: "Slack Allow Bot Messages",
|
|
@@ -49,22 +52,6 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { u
|
|
|
49
52
|
label: "Slack Bot Loop Cooldown Seconds",
|
|
50
53
|
help: "How long to suppress the bot pair after it exceeds the budget. Default: 60."
|
|
51
54
|
},
|
|
52
|
-
socketMode: {
|
|
53
|
-
label: "Slack Socket Mode Transport",
|
|
54
|
-
help: "Slack Socket Mode transport tuning passed to the Slack SDK. Use only when investigating ping/pong timeout or stale websocket behavior."
|
|
55
|
-
},
|
|
56
|
-
"socketMode.clientPingTimeout": {
|
|
57
|
-
label: "Slack Socket Mode Pong Timeout",
|
|
58
|
-
help: "Milliseconds the Slack SDK waits for a pong after its client ping before treating the websocket as stale (OpenClaw default: 15000). Increase on hosts with event-loop starvation or slow network scheduling."
|
|
59
|
-
},
|
|
60
|
-
"socketMode.serverPingTimeout": {
|
|
61
|
-
label: "Slack Socket Mode Server Ping Timeout",
|
|
62
|
-
help: "Milliseconds the Slack SDK waits for Slack server pings before treating the websocket as stale."
|
|
63
|
-
},
|
|
64
|
-
"socketMode.pingPongLoggingEnabled": {
|
|
65
|
-
label: "Slack Socket Mode Ping/Pong Logging",
|
|
66
|
-
help: "Enable Slack SDK ping/pong transport logs while debugging Socket Mode websocket health."
|
|
67
|
-
},
|
|
68
55
|
relay: {
|
|
69
56
|
label: "Slack Relay Mode",
|
|
70
57
|
help: "Relay-delivered Slack events. Use with mode=\"relay\" when openclaw-slack-router owns the Slack Socket Mode connection."
|
|
@@ -212,11 +199,230 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { u
|
|
|
212
199
|
"thread.initialHistoryLimit": {
|
|
213
200
|
label: "Slack Thread Initial History Limit",
|
|
214
201
|
help: "Maximum number of existing Slack thread messages to fetch when starting a new thread session (default: 20, set to 0 to disable)."
|
|
215
|
-
},
|
|
216
|
-
"thread.requireExplicitMention": {
|
|
217
|
-
label: "Slack Thread Require Explicit Mention",
|
|
218
|
-
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)."
|
|
219
202
|
}
|
|
220
|
-
}
|
|
203
|
+
};
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region extensions/slack/src/config-schema.ts
|
|
206
|
+
const SecretInputSchema = buildSecretInputSchema();
|
|
207
|
+
const SlackStreamingProgressSchema = ChannelStreamingProgressSchema.extend({ nativeTaskCards: z.boolean().optional() }).strict();
|
|
208
|
+
const SlackStreamingConfigSchema = ChannelPreviewStreamingConfigSchema.extend({
|
|
209
|
+
nativeTransport: z.boolean().optional(),
|
|
210
|
+
progress: SlackStreamingProgressSchema.optional()
|
|
211
|
+
}).strict();
|
|
212
|
+
const SlackCapabilitiesSchema = z.union([z.array(z.string()), z.object({ interactiveReplies: z.boolean().optional() }).strict()]);
|
|
213
|
+
const SlackDmSchema = z.object({
|
|
214
|
+
enabled: z.boolean().optional(),
|
|
215
|
+
groupEnabled: z.boolean().optional(),
|
|
216
|
+
groupChannels: z.array(z.union([z.string(), z.number()])).optional()
|
|
217
|
+
}).strict();
|
|
218
|
+
const SlackPresenceEventsSchema = z.object({ mode: z.enum([
|
|
219
|
+
"off",
|
|
220
|
+
"auto",
|
|
221
|
+
"on"
|
|
222
|
+
]).optional() }).strict();
|
|
223
|
+
const SlackChannelSchema = buildGroupEntrySchema({
|
|
224
|
+
ignoreOtherMentions: z.boolean().optional(),
|
|
225
|
+
replyToMode: ReplyToModeSchema.optional(),
|
|
226
|
+
allowBots: buildChannelAllowBotsSchema({ allowMentions: true }),
|
|
227
|
+
botLoopProtection: ChannelBotLoopProtectionSchema.optional(),
|
|
228
|
+
users: z.array(z.union([z.string(), z.number()])).optional(),
|
|
229
|
+
presenceEvents: SlackPresenceEventsSchema.optional()
|
|
230
|
+
}, { omit: ["allowFrom"] });
|
|
231
|
+
const SlackThreadSchema = z.object({
|
|
232
|
+
historyScope: z.enum(["thread", "channel"]).optional(),
|
|
233
|
+
inheritParent: z.boolean().optional(),
|
|
234
|
+
initialHistoryLimit: z.number().int().min(0).optional()
|
|
235
|
+
}).strict();
|
|
236
|
+
const ReplyToModeByChatTypeSchema = z.object({
|
|
237
|
+
direct: ReplyToModeSchema.optional(),
|
|
238
|
+
group: ReplyToModeSchema.optional(),
|
|
239
|
+
channel: ReplyToModeSchema.optional()
|
|
240
|
+
}).strict();
|
|
241
|
+
const SlackRelaySchema = z.object({
|
|
242
|
+
url: z.string().optional(),
|
|
243
|
+
authToken: SecretInputSchema.optional(),
|
|
244
|
+
gatewayId: z.string().optional()
|
|
245
|
+
}).strict();
|
|
246
|
+
const SlackIdentitySchema = z.enum(["bot", "user"]);
|
|
247
|
+
const SlackAccountSchema = z.object({
|
|
248
|
+
...buildCommonChannelAccountShape({
|
|
249
|
+
omit: ["groupAllowFrom"],
|
|
250
|
+
capabilities: SlackCapabilitiesSchema.optional(),
|
|
251
|
+
streaming: SlackStreamingConfigSchema.optional()
|
|
252
|
+
}),
|
|
253
|
+
postAs: SlackIdentitySchema.default("bot"),
|
|
254
|
+
mode: z.enum([
|
|
255
|
+
"socket",
|
|
256
|
+
"http",
|
|
257
|
+
"relay"
|
|
258
|
+
]).optional(),
|
|
259
|
+
enterpriseOrgInstall: z.boolean().optional(),
|
|
260
|
+
relay: SlackRelaySchema.optional(),
|
|
261
|
+
signingSecret: SecretInputSchema.optional(),
|
|
262
|
+
webhookPath: z.string().optional(),
|
|
263
|
+
execApprovals: buildChannelExecApprovalsSchema(z.union([z.string(), z.number()])),
|
|
264
|
+
commands: ProviderCommandsSchema,
|
|
265
|
+
botToken: SecretInputSchema.optional(),
|
|
266
|
+
appToken: SecretInputSchema.optional(),
|
|
267
|
+
userToken: SecretInputSchema.optional(),
|
|
268
|
+
userTokenReadOnly: z.boolean().optional().default(true),
|
|
269
|
+
allowBots: buildChannelAllowBotsSchema({ allowMentions: true }),
|
|
270
|
+
botLoopProtection: ChannelBotLoopProtectionSchema.optional(),
|
|
271
|
+
dangerouslyAllowNameMatching: ChannelDangerouslyAllowNameMatchingSchema,
|
|
272
|
+
requireMention: z.boolean().optional(),
|
|
273
|
+
implicitMentions: ChannelImplicitMentionsSchema.optional(),
|
|
274
|
+
unfurlLinks: z.boolean().optional(),
|
|
275
|
+
unfurlMedia: z.boolean().optional(),
|
|
276
|
+
...buildChannelReactionShape({
|
|
277
|
+
notificationModes: [
|
|
278
|
+
"off",
|
|
279
|
+
"own",
|
|
280
|
+
"all",
|
|
281
|
+
"allowlist"
|
|
282
|
+
],
|
|
283
|
+
reactionAllowlist: true,
|
|
284
|
+
ackReaction: z.string().optional()
|
|
285
|
+
}),
|
|
286
|
+
replyToModeByChatType: ReplyToModeByChatTypeSchema.optional(),
|
|
287
|
+
thread: SlackThreadSchema.optional(),
|
|
288
|
+
presenceEvents: SlackPresenceEventsSchema.optional(),
|
|
289
|
+
actions: z.object({
|
|
290
|
+
reactions: z.boolean().optional(),
|
|
291
|
+
messages: z.boolean().optional(),
|
|
292
|
+
pins: z.boolean().optional(),
|
|
293
|
+
search: z.boolean().optional(),
|
|
294
|
+
permissions: z.boolean().optional(),
|
|
295
|
+
memberInfo: z.boolean().optional(),
|
|
296
|
+
channelInfo: z.boolean().optional(),
|
|
297
|
+
emojiList: z.boolean().optional()
|
|
298
|
+
}).strict().optional(),
|
|
299
|
+
slashCommand: z.object({
|
|
300
|
+
enabled: z.boolean().optional(),
|
|
301
|
+
name: z.string().optional(),
|
|
302
|
+
sessionPrefix: z.string().optional(),
|
|
303
|
+
ephemeral: z.boolean().optional()
|
|
304
|
+
}).strict().optional(),
|
|
305
|
+
dm: SlackDmSchema.optional(),
|
|
306
|
+
channels: z.record(z.string(), SlackChannelSchema.optional()).optional(),
|
|
307
|
+
typingReaction: z.string().optional()
|
|
308
|
+
}).strict();
|
|
309
|
+
const SlackAccountEntrySchema = SlackAccountSchema.extend({ postAs: SlackIdentitySchema.optional() });
|
|
310
|
+
function validateSlackSigningSecretRequirements(value, ctx) {
|
|
311
|
+
const resolveMode = (mode) => mode === "http" || mode === "socket" || mode === "relay" ? mode : void 0;
|
|
312
|
+
const baseMode = resolveMode(value.mode) ?? "socket";
|
|
313
|
+
if (baseMode === "http" && !hasConfiguredSecretInput(value.signingSecret)) ctx.addIssue({
|
|
314
|
+
code: z.ZodIssueCode.custom,
|
|
315
|
+
message: "channels.slack.mode=\"http\" requires channels.slack.signingSecret",
|
|
316
|
+
path: ["signingSecret"]
|
|
317
|
+
});
|
|
318
|
+
for (const [accountId, account] of Object.entries(value.accounts ?? {})) {
|
|
319
|
+
if (!account || account.enabled === false) continue;
|
|
320
|
+
if ((resolveMode(account.mode) ?? baseMode) !== "http") continue;
|
|
321
|
+
if (!hasConfiguredSecretInput(account.signingSecret ?? value.signingSecret)) ctx.addIssue({
|
|
322
|
+
code: z.ZodIssueCode.custom,
|
|
323
|
+
message: "channels.slack.accounts.*.mode=\"http\" requires channels.slack.signingSecret or channels.slack.accounts.*.signingSecret",
|
|
324
|
+
path: [
|
|
325
|
+
"accounts",
|
|
326
|
+
accountId,
|
|
327
|
+
"signingSecret"
|
|
328
|
+
]
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
const SlackChannelConfigSchema = buildChannelConfigSchema(SlackAccountSchema.safeExtend({
|
|
333
|
+
mode: z.enum([
|
|
334
|
+
"socket",
|
|
335
|
+
"http",
|
|
336
|
+
"relay"
|
|
337
|
+
]).optional().default("socket"),
|
|
338
|
+
signingSecret: SecretInputSchema.optional(),
|
|
339
|
+
webhookPath: z.string().optional().default("/slack/events"),
|
|
340
|
+
groupPolicy: GroupPolicySchema.optional().default("allowlist"),
|
|
341
|
+
accounts: z.record(z.string(), SlackAccountEntrySchema.optional()).optional(),
|
|
342
|
+
defaultAccount: z.string().optional()
|
|
343
|
+
}).superRefine((value, ctx) => {
|
|
344
|
+
const dmPolicy = value.dmPolicy ?? "pairing";
|
|
345
|
+
const allowFrom = value.allowFrom;
|
|
346
|
+
requireOpenAllowFrom({
|
|
347
|
+
policy: dmPolicy,
|
|
348
|
+
allowFrom,
|
|
349
|
+
ctx,
|
|
350
|
+
path: ["allowFrom"],
|
|
351
|
+
message: "channels.slack.dmPolicy=\"open\" requires channels.slack.allowFrom to include \"*\""
|
|
352
|
+
});
|
|
353
|
+
requireAllowlistAllowFrom({
|
|
354
|
+
policy: dmPolicy,
|
|
355
|
+
allowFrom,
|
|
356
|
+
ctx,
|
|
357
|
+
path: ["allowFrom"],
|
|
358
|
+
message: "channels.slack.dmPolicy=\"allowlist\" requires channels.slack.allowFrom to contain at least one sender ID"
|
|
359
|
+
});
|
|
360
|
+
const requireRelayConfig = (relay, path) => {
|
|
361
|
+
if (typeof relay?.url !== "string" || !relay.url.trim()) ctx.addIssue({
|
|
362
|
+
code: z.ZodIssueCode.custom,
|
|
363
|
+
message: "channels.slack.mode=\"relay\" requires relay.url",
|
|
364
|
+
path: [...path, "url"]
|
|
365
|
+
});
|
|
366
|
+
if (!hasConfiguredSecretInput(relay?.authToken)) ctx.addIssue({
|
|
367
|
+
code: z.ZodIssueCode.custom,
|
|
368
|
+
message: "channels.slack.mode=\"relay\" requires relay.authToken",
|
|
369
|
+
path: [...path, "authToken"]
|
|
370
|
+
});
|
|
371
|
+
if (typeof relay?.gatewayId !== "string" || !relay.gatewayId.trim()) ctx.addIssue({
|
|
372
|
+
code: z.ZodIssueCode.custom,
|
|
373
|
+
message: "channels.slack.mode=\"relay\" requires relay.gatewayId",
|
|
374
|
+
path: [...path, "gatewayId"]
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
const baseMode = value.mode ?? "socket";
|
|
378
|
+
const accountIds = value.accounts ? Object.keys(value.accounts) : [];
|
|
379
|
+
if (!value.accounts) {
|
|
380
|
+
if (baseMode === "relay") requireRelayConfig(value.relay, ["relay"]);
|
|
381
|
+
validateSlackSigningSecretRequirements(value, ctx);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
for (const accountId of accountIds) {
|
|
385
|
+
const account = value.accounts[accountId];
|
|
386
|
+
if (!account || account.enabled === false) continue;
|
|
387
|
+
const accountMode = account.mode ?? baseMode;
|
|
388
|
+
const effectiveRelay = {
|
|
389
|
+
...value.relay,
|
|
390
|
+
...account.relay
|
|
391
|
+
};
|
|
392
|
+
const effectivePolicy = account.dmPolicy ?? value.dmPolicy ?? "pairing";
|
|
393
|
+
const effectiveAllowFrom = account.allowFrom ?? value.allowFrom;
|
|
394
|
+
requireOpenAllowFrom({
|
|
395
|
+
policy: effectivePolicy,
|
|
396
|
+
allowFrom: effectiveAllowFrom,
|
|
397
|
+
ctx,
|
|
398
|
+
path: [
|
|
399
|
+
"accounts",
|
|
400
|
+
accountId,
|
|
401
|
+
"allowFrom"
|
|
402
|
+
],
|
|
403
|
+
message: "channels.slack.accounts.*.dmPolicy=\"open\" requires channels.slack.accounts.*.allowFrom (or channels.slack.allowFrom) to include \"*\""
|
|
404
|
+
});
|
|
405
|
+
requireAllowlistAllowFrom({
|
|
406
|
+
policy: effectivePolicy,
|
|
407
|
+
allowFrom: effectiveAllowFrom,
|
|
408
|
+
ctx,
|
|
409
|
+
path: [
|
|
410
|
+
"accounts",
|
|
411
|
+
accountId,
|
|
412
|
+
"allowFrom"
|
|
413
|
+
],
|
|
414
|
+
message: "channels.slack.accounts.*.dmPolicy=\"allowlist\" requires channels.slack.accounts.*.allowFrom (or channels.slack.allowFrom) to contain at least one sender ID"
|
|
415
|
+
});
|
|
416
|
+
if (accountMode !== "http") {
|
|
417
|
+
if (accountMode === "relay") requireRelayConfig(effectiveRelay, [
|
|
418
|
+
"accounts",
|
|
419
|
+
accountId,
|
|
420
|
+
"relay"
|
|
421
|
+
]);
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
validateSlackSigningSecretRequirements(value, ctx);
|
|
426
|
+
}), { uiHints: slackChannelConfigUiHints });
|
|
221
427
|
//#endregion
|
|
222
428
|
export { SlackChannelConfigSchema as t };
|
|
@@ -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-BSr252c_.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-B08pm5ZT.js";
|
|
2
2
|
export { listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
-
import { a as resolveSlackAccount } from "./accounts-
|
|
3
|
-
import {
|
|
2
|
+
import { a as resolveSlackAccount } from "./accounts-BSr252c_.js";
|
|
3
|
+
import { a as createSlackLookupClient } from "./probe-CVRuArHA.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/slack/src/directory-live.ts
|
|
6
6
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { n as resolveSlackNativeStreaming, r as resolveSlackStreamingMode } from "./streaming-compat-3_X-21wW.js";
|
|
2
|
+
import { asObjectRecord, defineChannelAliasMigration, hasLegacyAccountStreamingAliases, normalizeChannelConfigEntries } from "openclaw/plugin-sdk/runtime-doctor";
|
|
3
|
+
//#region extensions/slack/src/doctor-contract.ts
|
|
4
|
+
const streamingAliasMigration = defineChannelAliasMigration({
|
|
5
|
+
channelId: "slack",
|
|
6
|
+
streaming: {
|
|
7
|
+
defaultMode: "partial",
|
|
8
|
+
resolveMode: resolveSlackStreamingMode,
|
|
9
|
+
resolveNativeTransport: resolveSlackNativeStreaming
|
|
10
|
+
},
|
|
11
|
+
dm: {
|
|
12
|
+
root: true,
|
|
13
|
+
accounts: true
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
function hasLegacySlackChannelAllowAlias(value) {
|
|
17
|
+
const channels = asObjectRecord(asObjectRecord(value)?.channels);
|
|
18
|
+
if (!channels) return false;
|
|
19
|
+
return Object.values(channels).some((channel) => Object.hasOwn(asObjectRecord(channel) ?? {}, "allow"));
|
|
20
|
+
}
|
|
21
|
+
function hasLegacySlackThreadMentionPolicy(value) {
|
|
22
|
+
const thread = asObjectRecord(asObjectRecord(value)?.thread);
|
|
23
|
+
return Boolean(thread && Object.hasOwn(thread, "requireExplicitMention"));
|
|
24
|
+
}
|
|
25
|
+
function hasLegacyDmReplyMode(value) {
|
|
26
|
+
return Object.hasOwn(asObjectRecord(asObjectRecord(value)?.dm) ?? {}, "replyToMode");
|
|
27
|
+
}
|
|
28
|
+
function migrateDmReplyMode(entry, path, changes) {
|
|
29
|
+
const dm = asObjectRecord(entry.dm);
|
|
30
|
+
if (!dm || !Object.hasOwn(dm, "replyToMode")) return false;
|
|
31
|
+
const byType = asObjectRecord(entry.replyToModeByChatType) ?? {};
|
|
32
|
+
if (byType.direct === void 0) {
|
|
33
|
+
byType.direct = dm.replyToMode;
|
|
34
|
+
entry.replyToModeByChatType = byType;
|
|
35
|
+
changes.push(`Moved ${path}.dm.replyToMode → ${path}.replyToModeByChatType.direct.`);
|
|
36
|
+
} else changes.push(`Removed ${path}.dm.replyToMode (replyToModeByChatType.direct already set).`);
|
|
37
|
+
delete dm.replyToMode;
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
function normalizeSlackThreadMentionPolicy(params) {
|
|
41
|
+
const thread = asObjectRecord(params.value.thread);
|
|
42
|
+
if (!thread || !Object.hasOwn(thread, "requireExplicitMention")) return {
|
|
43
|
+
value: params.value,
|
|
44
|
+
changed: false
|
|
45
|
+
};
|
|
46
|
+
const next = { ...params.value };
|
|
47
|
+
const nextThread = { ...thread };
|
|
48
|
+
const nextImplicitMentions = { ...asObjectRecord(params.value.implicitMentions) ?? {} };
|
|
49
|
+
const legacyValue = thread.requireExplicitMention;
|
|
50
|
+
const targetPath = `${params.pathPrefix}.implicitMentions.threadParticipation`;
|
|
51
|
+
if (nextImplicitMentions.threadParticipation !== void 0) params.changes.push(`Removed ${params.pathPrefix}.thread.requireExplicitMention (${targetPath} already set).`);
|
|
52
|
+
else if (typeof legacyValue === "boolean") {
|
|
53
|
+
nextImplicitMentions.threadParticipation = !legacyValue;
|
|
54
|
+
params.changes.push(`Moved ${params.pathPrefix}.thread.requireExplicitMention → ${targetPath} (${String(!legacyValue)}).`);
|
|
55
|
+
} else params.changes.push(`Removed invalid ${params.pathPrefix}.thread.requireExplicitMention value.`);
|
|
56
|
+
delete nextThread.requireExplicitMention;
|
|
57
|
+
if (Object.keys(nextThread).length > 0) next.thread = nextThread;
|
|
58
|
+
else delete next.thread;
|
|
59
|
+
if (Object.keys(nextImplicitMentions).length > 0) next.implicitMentions = nextImplicitMentions;
|
|
60
|
+
return {
|
|
61
|
+
value: next,
|
|
62
|
+
changed: true
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function normalizeSlackChannelAllowAliases(params) {
|
|
66
|
+
let changed = false;
|
|
67
|
+
const nextChannels = { ...params.channels };
|
|
68
|
+
for (const [channelId, channelValue] of Object.entries(params.channels)) {
|
|
69
|
+
const channel = asObjectRecord(channelValue);
|
|
70
|
+
if (!channel || !Object.hasOwn(channel, "allow")) continue;
|
|
71
|
+
const nextChannel = { ...channel };
|
|
72
|
+
if (nextChannel.enabled === void 0) {
|
|
73
|
+
nextChannel.enabled = channel.allow;
|
|
74
|
+
params.changes.push(`Moved ${params.pathPrefix}.${channelId}.allow → ${params.pathPrefix}.${channelId}.enabled.`);
|
|
75
|
+
} else params.changes.push(`Removed ${params.pathPrefix}.${channelId}.allow (${params.pathPrefix}.${channelId}.enabled already set).`);
|
|
76
|
+
delete nextChannel.allow;
|
|
77
|
+
nextChannels[channelId] = nextChannel;
|
|
78
|
+
changed = true;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
channels: nextChannels,
|
|
82
|
+
changed
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const legacyConfigRules = [
|
|
86
|
+
...streamingAliasMigration.legacyConfigRules,
|
|
87
|
+
{
|
|
88
|
+
path: ["channels", "slack"],
|
|
89
|
+
message: "channels.slack.dm.replyToMode moved to replyToModeByChatType.direct. Run \"openclaw doctor --fix\".",
|
|
90
|
+
match: hasLegacyDmReplyMode
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
path: [
|
|
94
|
+
"channels",
|
|
95
|
+
"slack",
|
|
96
|
+
"accounts"
|
|
97
|
+
],
|
|
98
|
+
message: "channels.slack.accounts.<id>.dm.replyToMode moved to replyToModeByChatType.direct. Run \"openclaw doctor --fix\".",
|
|
99
|
+
match: (value) => hasLegacyAccountStreamingAliases(value, hasLegacyDmReplyMode)
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
path: ["channels", "slack"],
|
|
103
|
+
message: "channels.slack.thread.requireExplicitMention is legacy; use channels.slack.implicitMentions.threadParticipation instead. Run \"openclaw doctor --fix\".",
|
|
104
|
+
match: hasLegacySlackThreadMentionPolicy
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
path: [
|
|
108
|
+
"channels",
|
|
109
|
+
"slack",
|
|
110
|
+
"accounts"
|
|
111
|
+
],
|
|
112
|
+
message: "channels.slack.accounts.<id>.thread.requireExplicitMention is legacy; use channels.slack.accounts.<id>.implicitMentions.threadParticipation instead. Run \"openclaw doctor --fix\".",
|
|
113
|
+
match: (value) => hasLegacyAccountStreamingAliases(value, hasLegacySlackThreadMentionPolicy)
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
path: ["channels", "slack"],
|
|
117
|
+
message: "channels.slack.channels.<id>.allow is legacy; use channels.slack.channels.<id>.enabled instead. Run \"openclaw doctor --fix\".",
|
|
118
|
+
match: hasLegacySlackChannelAllowAlias
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
path: [
|
|
122
|
+
"channels",
|
|
123
|
+
"slack",
|
|
124
|
+
"accounts"
|
|
125
|
+
],
|
|
126
|
+
message: "channels.slack.accounts.<id>.channels.<id>.allow is legacy; use channels.slack.accounts.<id>.channels.<id>.enabled instead. Run \"openclaw doctor --fix\".",
|
|
127
|
+
match: (value) => hasLegacyAccountStreamingAliases(value, hasLegacySlackChannelAllowAlias)
|
|
128
|
+
}
|
|
129
|
+
];
|
|
130
|
+
function normalizeSlackEntry(params) {
|
|
131
|
+
let entry = params.entry;
|
|
132
|
+
let changed = migrateDmReplyMode(entry, params.pathPrefix, params.changes);
|
|
133
|
+
const threadPolicy = normalizeSlackThreadMentionPolicy({
|
|
134
|
+
value: entry,
|
|
135
|
+
pathPrefix: params.pathPrefix,
|
|
136
|
+
changes: params.changes
|
|
137
|
+
});
|
|
138
|
+
entry = threadPolicy.value;
|
|
139
|
+
changed = changed || threadPolicy.changed;
|
|
140
|
+
const channels = asObjectRecord(entry.channels);
|
|
141
|
+
if (channels) {
|
|
142
|
+
const normalized = normalizeSlackChannelAllowAliases({
|
|
143
|
+
channels,
|
|
144
|
+
pathPrefix: `${params.pathPrefix}.channels`,
|
|
145
|
+
changes: params.changes
|
|
146
|
+
});
|
|
147
|
+
if (normalized.changed) {
|
|
148
|
+
entry = {
|
|
149
|
+
...entry,
|
|
150
|
+
channels: normalized.channels
|
|
151
|
+
};
|
|
152
|
+
changed = true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
entry,
|
|
157
|
+
changed
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function normalizeCompatibilityConfig({ cfg }) {
|
|
161
|
+
const changes = [];
|
|
162
|
+
return normalizeChannelConfigEntries({
|
|
163
|
+
cfg: streamingAliasMigration.normalizeChannelConfig({
|
|
164
|
+
cfg,
|
|
165
|
+
changes
|
|
166
|
+
}).config,
|
|
167
|
+
channelId: "slack",
|
|
168
|
+
changes,
|
|
169
|
+
normalizeEntry: normalizeSlackEntry
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
export { normalizeCompatibilityConfig as n, legacyConfigRules as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-U6oVntbM.js";
|
|
2
2
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|