@openclaw/slack 2026.9.1-beta.1 → 2026.9.2
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-CN2hBsim.js → account-inspect-C3sePHWa.js} +3 -3
- package/dist/account-inspect-api.js +1 -1
- package/dist/{action-runtime-BoSeX09X.js → action-runtime-DftQWpI4.js} +84 -66
- package/dist/action-runtime.runtime-rHI3UAh4.js +2 -0
- package/dist/{actions-XdQyjG_p.js → actions-CFkvEv1d.js} +198 -54
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-DxXfGX_Z.js → approval-handler.runtime-BeILKdw4.js} +47 -25
- package/dist/{channel-C_vnTgxo.js → channel-CmOuxbOD.js} +76 -133
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-j-2lalcC.js → channel-type-BWt2CRaI.js} +2 -2
- package/dist/{channel.setup-aal8tokM.js → channel.setup-D5z1ReaT.js} +29 -23
- package/dist/{config-schema-CN3XZRX5.js → config-schema-JDx_f9Zb.js} +26 -17
- package/dist/{cursor-pages-eX7p8Wwt.js → cursor-pages-ByFwo-Py.js} +7 -1
- package/dist/{directory-config-DqfQ42OV.js → directory-config-Bmw4ykSy.js} +4 -3
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-lC6X_Ru-.js → directory-live-BuBPHmju.js} +3 -8
- package/dist/{doctor-contract-BAy7-EUQ.js → doctor-contract-BNjw9bxb.js} +5 -4
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{message-tool-api-CWosHSi5.js → message-tool-api-uNEfQYGY.js} +19 -2
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-DrNCGneD.js → monitor-DI07pfJl.js} +3 -3
- package/dist/{outbound-adapter-DkT2vUE9.js → outbound-adapter-B5QyTRpJ.js} +96 -91
- package/dist/{pipeline.runtime-CRRng_Nw.js → pipeline.runtime-BdIwZgm4.js} +596 -920
- package/dist/{policy-BoP6t88v.js → policy-Bh5TOqII.js} +7 -4
- package/dist/{probe-4_aHtVT3.js → probe-Biy--yhL.js} +251 -12
- package/dist/{provider-D4nDgxCh.js → provider-DoaUvAM4.js} +5621 -4944
- package/dist/{relay-source-CEmze11m.js → relay-source-D4uecp68.js} +6 -4
- package/dist/{replies-D9XMM_S0.js → replies-DENuTcPO.js} +21 -16
- package/dist/reply-blocks-PRkhyAN7.js +790 -0
- package/dist/{resolve-channels-DSamDgVs.js → resolve-channels-DQGV2VrE.js} +6 -10
- package/dist/{resolve-users-CIzwbaJR.js → resolve-users-DRGt_Q4I.js} +5 -4
- package/dist/runtime-api.js +10 -10
- package/dist/{scopes-BBrUzpBH.js → scopes-CZzeGdWV.js} +1 -1
- package/dist/{send-DtjEnlLh.js → send-DElUcgIs.js} +32 -24
- package/dist/send-results-eeOu_HYm.js +23 -0
- package/dist/{send.runtime-DQeNKa2J.js → send.runtime-C8D6cKGm.js} +1 -1
- package/dist/{group-policy-CU1tEGpS.js → session-status-BynwcZSO.js} +284 -1013
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-CsBCM4rP.js → setup-surface-B1_gpGBl.js} +5 -5
- package/dist/{shared-D9GeeR9K.js → shared-CNQsWJT7.js} +7 -5
- package/dist/{slash-dispatch.runtime-Chr3YHnT.js → slash-dispatch.runtime-DhsXavSY.js} +2 -2
- package/dist/{target-parsing-BnMD2ZqZ.js → target-parsing-PbxGDbr9.js} +11 -6
- package/dist/{targets-Cx5W_n3W.js → targets-7FexXJ62.js} +1 -1
- package/dist/{thread-ts-DUGhaYKq.js → thread-ts-CukseRVL.js} +5 -1
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/package.json +16 -10
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/retry-handler.js +42 -7
- package/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/undici/lib/interceptor/decompress.js +146 -14
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/openclaw.plugin.json +17 -9
- package/package.json +6 -6
- package/skills/_vendor/slack-skills-plugin.LICENSE +21 -0
- package/skills/_vendor/slack-skills-plugin.json +31 -0
- package/skills/block-kit/SKILL.md +37 -0
- package/skills/block-kit/references/official-block-kit.md +257 -0
- package/skills/block-kit/references/official-common-patterns.md +385 -0
- package/skills/slack/SKILL.md +1 -1
- package/dist/action-runtime.runtime-Dpa16J87.js +0 -2
- package/dist/conversation-binding-route-DFVLUdYF.js +0 -115
- package/dist/slack-client-kind-hSfjXyUM.js +0 -94
- package/node_modules/@slack/bolt/node_modules/negotiator/HISTORY.md +0 -114
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { n as isSlackPluginAccountConfigured } from "./account-configured-sUohAxZr.js";
|
|
2
2
|
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resolveSlackOperationToken, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom } from "./accounts-Dm_H77gH.js";
|
|
3
|
-
import {
|
|
4
|
-
import { a as parseSlackTarget, i as normalizeSlackMessagingTarget, n as formatSlackTarget, o as resolveSlackChannelId, r as looksLikeSlackTargetId, t as canonicalizeSlackApiTargetId } from "./target-parsing-
|
|
5
|
-
import { t as slackContextTargetsMatch } from "./targets-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-
|
|
3
|
+
import { A as countSlackTextUtf8Bytes, At as shouldSuppressLocalSlackExecApprovalPrompt, Ct as getSlackApprovalApproversForTeam, Dt as isSlackExecApprovalClientEnabled, E as SLACK_EDIT_TEXT_MAX_BYTES, Et as isSlackExecApprovalAuthorizedSender, Mt as resolveSlackAutoThreadId, Nt as resolveSlackReplyToMode, Tt as getSlackExecApprovalApprovers, Y as normalizeSlackOutboundText, _t as shouldHandleSlackNativeApprovalRequest, a as resolveSlackGroupRequireMention, bt as getSlackInstallationKind, c as qualifySlackRoutePeerId, d as resolveSlackConversationBindingRoute, dt as normalizeSlackForwardTarget, f as assertSlackDetachedTargetAllowed, ft as normalizeSlackOriginTarget, gt as resolveTurnSourceSlackOriginTarget, ht as resolveSlackFallbackOriginTarget, it as renderSlackMessagePresentationFallbackText, k as SLACK_TEXT_LIMIT, kt as resolveSlackExecApprovalTarget, lt as hasSlackPluginApprovers, mt as resolveSessionSlackOriginTarget, n as setSlackSessionStatus, o as resolveSlackGroupToolPolicy, pt as resolveEnterpriseApprovalTeamId, s as qualifySlackConversationId, u as normalizeSlackRouteBindingConfig, ut as isSlackAnyNativeApprovalClientEnabled, vt as shouldHandleSlackPluginViaForwardingSession, wt as isSlackApprovalAuthorizedSender, xt as isSlackWorkspaceInstallation, yt as slackTargetsMatch } from "./session-status-BynwcZSO.js";
|
|
4
|
+
import { a as parseSlackTarget, i as normalizeSlackMessagingTarget, n as formatSlackTarget, o as resolveSlackChannelId, r as looksLikeSlackTargetId, t as canonicalizeSlackApiTargetId } from "./target-parsing-PbxGDbr9.js";
|
|
5
|
+
import { t as slackContextTargetsMatch } from "./targets-7FexXJ62.js";
|
|
6
|
+
import { m as getSlackWriteClient, o as formatSlackError } from "./probe-Biy--yhL.js";
|
|
7
|
+
import { a as resolveSlackReplyDeliveryMessages, h as SLACK_PRESENTATION_CAPABILITIES, i as resolveSlackReplyBlocks, l as buildSlackPresentationBlocks, r as resolveSlackReplyBlockResolution, u as canRenderSlackPresentation } from "./reply-blocks-PRkhyAN7.js";
|
|
8
|
+
import { n as resolveSlackReplyThreadTs, r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-CukseRVL.js";
|
|
9
|
+
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-uNEfQYGY.js";
|
|
10
|
+
import { a as PAIRING_APPROVED_MESSAGE, i as DEFAULT_ACCOUNT_ID$1, n as slackConfigAdapter, o as projectCredentialSnapshotFields, r as slackSecurityAdapter, s as resolveConfiguredFromRequiredCredentialStatuses, t as createSlackPluginBase } from "./shared-CNQsWJT7.js";
|
|
11
|
+
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-BWt2CRaI.js";
|
|
12
12
|
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
13
|
-
import { a as slackSetupContract, i as createSlackSetupWizardProxy, o as SLACK_CHANNEL } from "./channel.setup-
|
|
13
|
+
import { a as slackSetupContract, i as createSlackSetupWizardProxy, o as SLACK_CHANNEL } from "./channel.setup-D5z1ReaT.js";
|
|
14
14
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
15
15
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
16
16
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
17
17
|
import { buildOutboundBaseSessionKey, normalizeMessageChannel, resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
18
18
|
import { buildLegacyDmAccountAllowlistAdapter, createAccountScopedAllowlistNameResolver, createFlatAllowlistOverrideResolver } from "openclaw/plugin-sdk/allowlist-config-edit";
|
|
19
19
|
import { buildThreadAwareOutboundSessionRoute, createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
|
|
20
|
-
import { createChannelMessageAdapterFromOutbound, createRuntimeOutboundDelegates
|
|
20
|
+
import { createChannelMessageAdapterFromOutbound, createRuntimeOutboundDelegates } from "openclaw/plugin-sdk/channel-outbound";
|
|
21
21
|
import { createPairingPrefixStripper } from "openclaw/plugin-sdk/channel-pairing";
|
|
22
22
|
import { createChannelDirectoryAdapter, createRuntimeDirectoryLiveAdapter } from "openclaw/plugin-sdk/directory-runtime";
|
|
23
23
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -30,6 +30,7 @@ import { createChannelNativeOriginTargetResolver, createNativeApprovalForwarding
|
|
|
30
30
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
31
31
|
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
|
|
32
32
|
import { normalizeLegacyInteractiveReply, normalizeMessagePresentation } from "openclaw/plugin-sdk/interactive-runtime";
|
|
33
|
+
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
33
34
|
import { readPositiveIntegerParam as readPositiveIntegerParam$1, readStringParam as readStringParam$1 } from "openclaw/plugin-sdk/param-readers";
|
|
34
35
|
//#region extensions/slack/src/approval-native.ts
|
|
35
36
|
function resolveSlackNativeSuppressionAccountId({ target, request }) {
|
|
@@ -61,14 +62,20 @@ function resolveSlackApproverDmTargets(params) {
|
|
|
61
62
|
approvalKind: params.approvalKind,
|
|
62
63
|
request: params.request
|
|
63
64
|
})) return [];
|
|
64
|
-
const approvers = params.approvalKind === "plugin" ? getSlackApprovalApprovers(params) : getSlackExecApprovalApprovers(params);
|
|
65
65
|
const teamId = resolveEnterpriseApprovalTeamId(params.request);
|
|
66
|
-
return
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
return (params.approvalKind === "plugin" ? getSlackApprovalApproversForTeam({
|
|
67
|
+
...params,
|
|
68
|
+
teamId
|
|
69
|
+
}) : getSlackExecApprovalApprovers(params)).map((approver) => {
|
|
70
|
+
const target = parseSlackTarget(approver, { defaultKind: "user" });
|
|
71
|
+
if (!target || target.kind !== "user") throw new Error("Slack approval approver target must be a user");
|
|
72
|
+
return { to: formatSlackTarget({
|
|
73
|
+
kind: "user",
|
|
74
|
+
id: target.id,
|
|
75
|
+
teamId: target.teamId ?? teamId,
|
|
76
|
+
explicitKind: true
|
|
77
|
+
}) };
|
|
78
|
+
});
|
|
72
79
|
}
|
|
73
80
|
const shouldSuppressSlackForwardingFallback = createNativeApprovalForwardingFallbackSuppressor({
|
|
74
81
|
channel: "slack",
|
|
@@ -88,7 +95,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
88
95
|
channelLabel: "Slack",
|
|
89
96
|
describeExecApprovalSetup: ({ accountId }) => {
|
|
90
97
|
const prefix = accountId && accountId !== "default" ? `channels.slack.accounts.${accountId}` : "channels.slack";
|
|
91
|
-
return `Approve it from the Web UI or terminal UI for now. Slack supports native exec approvals for this account. Configure \`${prefix}.execApprovals.approvers\` or \`commands.ownerAllowFrom\`;
|
|
98
|
+
return `Approve it from the Web UI or terminal UI for now. Slack supports native exec approvals for this account. Configure \`${prefix}.execApprovals.approvers\` or \`commands.ownerAllowFrom\`; set \`${prefix}.execApprovals.enabled\` to \`auto\` or \`true\`. Unset or \`false\` disables native exec approval delivery.`;
|
|
92
99
|
},
|
|
93
100
|
listAccountIds: listSlackAccountIds,
|
|
94
101
|
hasApprovers: ({ cfg, accountId }) => getSlackExecApprovalApprovers({
|
|
@@ -119,7 +126,11 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
119
126
|
resolveApproverDmTargets: resolveSlackApproverDmTargets,
|
|
120
127
|
notifyOriginWhenDmOnly: true,
|
|
121
128
|
nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
|
|
122
|
-
eventKinds: [
|
|
129
|
+
eventKinds: [
|
|
130
|
+
"exec",
|
|
131
|
+
"plugin",
|
|
132
|
+
"system-agent"
|
|
133
|
+
],
|
|
123
134
|
isConfigured: ({ cfg, accountId }) => isSlackAnyNativeApprovalClientEnabled({
|
|
124
135
|
cfg,
|
|
125
136
|
accountId
|
|
@@ -130,7 +141,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
130
141
|
approvalKind,
|
|
131
142
|
request
|
|
132
143
|
}),
|
|
133
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
144
|
+
load: async () => (await import("./approval-handler.runtime-BeILKdw4.js")).slackApprovalNativeRuntime
|
|
134
145
|
})
|
|
135
146
|
});
|
|
136
147
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.native;
|
|
@@ -172,7 +183,8 @@ const slackApprovalCapability = {
|
|
|
172
183
|
preferredSurface: "origin",
|
|
173
184
|
supportsApproverDmSurface: hasSlackPluginApprovers({
|
|
174
185
|
cfg: params.cfg,
|
|
175
|
-
accountId: params.accountId
|
|
186
|
+
accountId: params.accountId,
|
|
187
|
+
teamId: resolveEnterpriseApprovalTeamId(request)
|
|
176
188
|
})
|
|
177
189
|
} : {}
|
|
178
190
|
};
|
|
@@ -209,6 +221,12 @@ async function handleSlackMessageAction(params) {
|
|
|
209
221
|
const channelId = readStringParam$1(actionParams, "channelId") ?? readStringParam$1(actionParams, "to", { required: true });
|
|
210
222
|
return normalizeChannelId ? normalizeChannelId(channelId) : channelId;
|
|
211
223
|
};
|
|
224
|
+
if (action === "conversation-open") return await invoke({
|
|
225
|
+
action: "openConversation",
|
|
226
|
+
userIds: actionParams.userIds,
|
|
227
|
+
teamId: readStringParam$1(actionParams, "teamId"),
|
|
228
|
+
accountId
|
|
229
|
+
}, cfg, ctx.toolContext);
|
|
212
230
|
if (action === "send") {
|
|
213
231
|
const to = readStringParam$1(actionParams, "to", { required: true });
|
|
214
232
|
const content = readStringParam$1(actionParams, "message", {
|
|
@@ -305,7 +323,12 @@ async function handleSlackMessageAction(params) {
|
|
|
305
323
|
text: content,
|
|
306
324
|
presentation
|
|
307
325
|
}) : resolveSlackPresentationText(content, presentation);
|
|
308
|
-
|
|
326
|
+
const tableMode = resolveMarkdownTableMode({
|
|
327
|
+
cfg,
|
|
328
|
+
channel: "slack",
|
|
329
|
+
accountId: accountId ?? resolveDefaultSlackAccountId(cfg)
|
|
330
|
+
});
|
|
331
|
+
if (!blocks && countSlackTextUtf8Bytes(normalizeSlackOutboundText(accessibleContent, { tableMode })) > 4e3) {
|
|
309
332
|
const editSubject = renderedPresentation.usesPresentationTextFallback ? "Slack presentation fallback" : "Slack edit";
|
|
310
333
|
throw new Error(`${editSubject} exceeds the ${String(SLACK_EDIT_TEXT_MAX_BYTES)}-byte edit limit. Send a new message instead.`);
|
|
311
334
|
}
|
|
@@ -402,7 +425,7 @@ const SLACK_TOOL_DELIVERY_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
402
425
|
"unpinMessage",
|
|
403
426
|
"uploadFile"
|
|
404
427
|
]);
|
|
405
|
-
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
428
|
+
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-rHI3UAh4.js"));
|
|
406
429
|
function resolveSlackActionContext(ctx, toolContext) {
|
|
407
430
|
if (!toolContext && !ctx.mediaAccess && !ctx.mediaLocalRoots && !ctx.mediaReadFile && !ctx.conversationReadOrigin && !ctx.requesterAccountId && !ctx.requesterSenderId) return;
|
|
408
431
|
return {
|
|
@@ -544,41 +567,23 @@ const EXTENSION_SHARED_MODULE_ID = "openclaw/plugin-sdk/extension-shared";
|
|
|
544
567
|
const TARGET_RESOLVER_RUNTIME_MODULE_ID = "openclaw/plugin-sdk/target-resolver-runtime";
|
|
545
568
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import(EXTENSION_SHARED_MODULE_ID));
|
|
546
569
|
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import(TARGET_RESOLVER_RUNTIME_MODULE_ID));
|
|
547
|
-
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-
|
|
548
|
-
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-
|
|
549
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-
|
|
570
|
+
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-B1_gpGBl.js"));
|
|
571
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-CZzeGdWV.js"));
|
|
572
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-B5QyTRpJ.js"));
|
|
550
573
|
async function resolveSlackHandleAction() {
|
|
551
574
|
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? (await loadSlackActionRuntime()).handleSlackAction;
|
|
552
575
|
}
|
|
553
576
|
function shouldTreatSlackDeliveredTextAsVisible(params) {
|
|
554
577
|
return params.kind === "block" && typeof params.text === "string" && params.text.trim().length > 0;
|
|
555
578
|
}
|
|
556
|
-
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
557
|
-
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
558
|
-
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
559
|
-
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
560
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-
|
|
561
|
-
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
562
|
-
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
563
|
-
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
564
|
-
async function resolveSlackSendContext(params) {
|
|
565
|
-
const account = resolveSlackAccount({
|
|
566
|
-
cfg: params.cfg,
|
|
567
|
-
accountId: params.accountId
|
|
568
|
-
});
|
|
569
|
-
const target = parseSlackTarget(params.to, { defaultKind: "channel" });
|
|
570
|
-
assertSlackDetachedTargetAllowed(account.accountId, target?.teamId);
|
|
571
|
-
const send = resolveOutboundSendDep(params.deps, "slack") ?? (await loadSlackSendRuntime()).sendMessageSlack;
|
|
572
|
-
const token = resolveSlackOperationToken(account, "write");
|
|
573
|
-
const botToken = account.botToken?.trim();
|
|
574
|
-
const tokenOverride = token && token !== botToken ? token : void 0;
|
|
575
|
-
return {
|
|
576
|
-
send,
|
|
577
|
-
threadTsValue: resolveSlackThreadTsValue(params),
|
|
578
|
-
tokenOverride,
|
|
579
|
-
to: params.to
|
|
580
|
-
};
|
|
581
|
-
}
|
|
579
|
+
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-Bmw4ykSy.js").then((n) => n.t));
|
|
580
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-DQGV2VrE.js").then((n) => n.n));
|
|
581
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DRGt_Q4I.js").then((n) => n.n));
|
|
582
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-rHI3UAh4.js"));
|
|
583
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-C8D6cKGm.js"));
|
|
584
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-Biy--yhL.js").then((n) => n.n));
|
|
585
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-DI07pfJl.js").then((n) => n.t));
|
|
586
|
+
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-BuBPHmju.js").then((n) => n.t));
|
|
582
587
|
async function setSlackHeartbeatThreadStatus(params) {
|
|
583
588
|
const threadTs = resolveSlackThreadTsValue({ threadId: params.threadId });
|
|
584
589
|
const target = parseSlackTarget(params.to, { defaultKind: "channel" });
|
|
@@ -599,25 +604,17 @@ async function setSlackHeartbeatThreadStatus(params) {
|
|
|
599
604
|
accountId: account.accountId,
|
|
600
605
|
token: botToken
|
|
601
606
|
});
|
|
602
|
-
await
|
|
607
|
+
await setSlackSessionStatus({
|
|
608
|
+
client,
|
|
603
609
|
token: botToken,
|
|
604
|
-
|
|
605
|
-
|
|
610
|
+
channelId,
|
|
611
|
+
threadTs,
|
|
606
612
|
status: params.status
|
|
607
613
|
});
|
|
608
614
|
} catch (error) {
|
|
609
615
|
logVerbose(`slack heartbeat status update failed: ${formatSlackError(error)}`);
|
|
610
616
|
}
|
|
611
617
|
}
|
|
612
|
-
function withSlackSendOverride(params) {
|
|
613
|
-
return {
|
|
614
|
-
...params.deps,
|
|
615
|
-
slack: async (to, text, opts) => await params.send(to, text, {
|
|
616
|
-
...opts,
|
|
617
|
-
...params.tokenOverride ? { token: params.tokenOverride } : {}
|
|
618
|
-
})
|
|
619
|
-
};
|
|
620
|
-
}
|
|
621
618
|
function resolveSlackRouteTarget(raw) {
|
|
622
619
|
const target = parseSlackTarget(raw, { defaultKind: "channel" });
|
|
623
620
|
if (!target) return null;
|
|
@@ -629,7 +626,8 @@ function resolveSlackRouteTarget(raw) {
|
|
|
629
626
|
function normalizeSlackAcpConversationId(raw) {
|
|
630
627
|
const trimmed = normalizeOptionalString(raw);
|
|
631
628
|
if (!trimmed) return null;
|
|
632
|
-
const
|
|
629
|
+
const parsed = parseSlackTarget(trimmed, { defaultKind: "channel" });
|
|
630
|
+
const conversationId = normalizeLowercaseStringOrEmpty(parsed?.id ?? trimmed.replace(/^slack:/i, "").replace(/^(?:channel|group|direct|user):/i, ""));
|
|
633
631
|
return conversationId ? { conversationId } : null;
|
|
634
632
|
}
|
|
635
633
|
function matchSlackAcpConversation(params) {
|
|
@@ -779,72 +777,16 @@ const slackChannelOutbound = {
|
|
|
779
777
|
}
|
|
780
778
|
}),
|
|
781
779
|
sendPayload: async (ctx) => {
|
|
782
|
-
const { send, threadTsValue, tokenOverride, to } = await resolveSlackSendContext({
|
|
783
|
-
cfg: ctx.cfg,
|
|
784
|
-
accountId: ctx.accountId ?? void 0,
|
|
785
|
-
to: ctx.to,
|
|
786
|
-
deps: ctx.deps,
|
|
787
|
-
replyToId: ctx.replyToId,
|
|
788
|
-
threadId: ctx.threadId
|
|
789
|
-
});
|
|
790
780
|
const { slackOutbound } = await loadSlackOutboundAdapterModule();
|
|
791
|
-
return await slackOutbound.sendPayload(
|
|
792
|
-
...ctx,
|
|
793
|
-
to,
|
|
794
|
-
replyToId: threadTsValue,
|
|
795
|
-
threadId: null,
|
|
796
|
-
deliveryQueueId: void 0,
|
|
797
|
-
deps: withSlackSendOverride({
|
|
798
|
-
deps: ctx.deps,
|
|
799
|
-
send,
|
|
800
|
-
tokenOverride
|
|
801
|
-
})
|
|
802
|
-
});
|
|
781
|
+
return await slackOutbound.sendPayload(ctx);
|
|
803
782
|
},
|
|
804
783
|
sendText: async (ctx) => {
|
|
805
|
-
const { send, threadTsValue, tokenOverride, to } = await resolveSlackSendContext({
|
|
806
|
-
cfg: ctx.cfg,
|
|
807
|
-
accountId: ctx.accountId ?? void 0,
|
|
808
|
-
to: ctx.to,
|
|
809
|
-
deps: ctx.deps,
|
|
810
|
-
replyToId: ctx.replyToId,
|
|
811
|
-
threadId: ctx.threadId
|
|
812
|
-
});
|
|
813
784
|
const { slackOutbound } = await loadSlackOutboundAdapterModule();
|
|
814
|
-
return await slackOutbound.sendText(
|
|
815
|
-
...ctx,
|
|
816
|
-
to,
|
|
817
|
-
replyToId: threadTsValue,
|
|
818
|
-
threadId: null,
|
|
819
|
-
deps: withSlackSendOverride({
|
|
820
|
-
deps: ctx.deps,
|
|
821
|
-
send,
|
|
822
|
-
tokenOverride
|
|
823
|
-
})
|
|
824
|
-
});
|
|
785
|
+
return await slackOutbound.sendText(ctx);
|
|
825
786
|
},
|
|
826
787
|
sendMedia: async (ctx) => {
|
|
827
|
-
const { send, threadTsValue, tokenOverride, to } = await resolveSlackSendContext({
|
|
828
|
-
cfg: ctx.cfg,
|
|
829
|
-
accountId: ctx.accountId ?? void 0,
|
|
830
|
-
to: ctx.to,
|
|
831
|
-
deps: ctx.deps,
|
|
832
|
-
replyToId: ctx.replyToId,
|
|
833
|
-
threadId: ctx.threadId
|
|
834
|
-
});
|
|
835
788
|
const { slackOutbound } = await loadSlackOutboundAdapterModule();
|
|
836
|
-
return await slackOutbound.sendMedia(
|
|
837
|
-
...ctx,
|
|
838
|
-
to,
|
|
839
|
-
replyToId: threadTsValue,
|
|
840
|
-
threadId: null,
|
|
841
|
-
deliveryQueueId: void 0,
|
|
842
|
-
deps: withSlackSendOverride({
|
|
843
|
-
deps: ctx.deps,
|
|
844
|
-
send,
|
|
845
|
-
tokenOverride
|
|
846
|
-
})
|
|
847
|
-
});
|
|
789
|
+
return await slackOutbound.sendMedia(ctx);
|
|
848
790
|
}
|
|
849
791
|
};
|
|
850
792
|
const slackMessageAdapterBase = createChannelMessageAdapterFromOutbound({
|
|
@@ -1022,7 +964,7 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1022
964
|
to,
|
|
1023
965
|
accountId,
|
|
1024
966
|
threadId,
|
|
1025
|
-
status: "
|
|
967
|
+
status: "processing"
|
|
1026
968
|
});
|
|
1027
969
|
},
|
|
1028
970
|
clearTyping: async ({ cfg, to, accountId, threadId }) => {
|
|
@@ -1031,7 +973,7 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1031
973
|
to,
|
|
1032
974
|
accountId,
|
|
1033
975
|
threadId,
|
|
1034
|
-
status: ""
|
|
976
|
+
status: "active"
|
|
1035
977
|
});
|
|
1036
978
|
}
|
|
1037
979
|
},
|
|
@@ -1204,12 +1146,13 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1204
1146
|
to,
|
|
1205
1147
|
toolContext
|
|
1206
1148
|
})),
|
|
1207
|
-
resolveReplyTransport: ({ threadId, replyToId, replyToIsExplicit, replyDelivery }) => {
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1149
|
+
resolveReplyTransport: ({ threadId, replyToId, replyToIsExplicit, replyToCurrent, replyDelivery }) => {
|
|
1150
|
+
const resolvedReplyToId = resolveSlackReplyThreadTs({
|
|
1151
|
+
replyToId: normalizeSlackThreadTsCandidate(replyToId),
|
|
1152
|
+
threadId: normalizeSlackThreadTsCandidate(threadId),
|
|
1153
|
+
replyToMode: replyDelivery?.replyToMode,
|
|
1154
|
+
replyToIsExplicit,
|
|
1155
|
+
replyToCurrent
|
|
1213
1156
|
});
|
|
1214
1157
|
return {
|
|
1215
1158
|
replyToId: replyDelivery?.replyToMode === "off" && !resolvedReplyToId ? null : resolvedReplyToId,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-JDx_f9Zb.js";
|
|
2
2
|
export { SlackChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackPlugin } from "./channel-
|
|
1
|
+
import { t as slackPlugin } from "./channel-CmOuxbOD.js";
|
|
2
2
|
export { slackPlugin };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-Dm_H77gH.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { f as assertSlackDetachedTargetAllowed } from "./session-status-BynwcZSO.js";
|
|
4
|
+
import { C as normalizeAllowListLower, c as createSlackReadClient, d as createSlackWebClient } from "./probe-Biy--yhL.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,7 +1,7 @@
|
|
|
1
1
|
import { r as isSlackSetupAccountConfigured } from "./account-configured-sUohAxZr.js";
|
|
2
2
|
import { a as resolveSlackAccount, c as resolveSlackConfigAccessorAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds } from "./accounts-Dm_H77gH.js";
|
|
3
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
4
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
3
|
+
import { t as inspectSlackAccount } from "./account-inspect-C3sePHWa.js";
|
|
4
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-JDx_f9Zb.js";
|
|
5
5
|
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -84,6 +84,8 @@ function buildSlackManifest(botName = "OpenClaw") {
|
|
|
84
84
|
"app_home_opened",
|
|
85
85
|
"app_mention",
|
|
86
86
|
"app_context_changed",
|
|
87
|
+
"agent_session_stopped",
|
|
88
|
+
"agent_session_title_changed",
|
|
87
89
|
"channel_rename",
|
|
88
90
|
"member_joined_channel",
|
|
89
91
|
"member_left_channel",
|
|
@@ -260,6 +262,25 @@ const slackSetupAdapterBase = createPatchedAccountSetupAdapter({
|
|
|
260
262
|
};
|
|
261
263
|
}
|
|
262
264
|
});
|
|
265
|
+
const slackSetupAdapter = {
|
|
266
|
+
...slackSetupAdapterBase,
|
|
267
|
+
singleAccountKeysToMove: ["appToken"],
|
|
268
|
+
applyAccountConfig: ({ cfg, accountId, input }) => {
|
|
269
|
+
const setupInput = input;
|
|
270
|
+
const identity = setupInput.identity ?? inspectSlackAccount({
|
|
271
|
+
cfg,
|
|
272
|
+
accountId
|
|
273
|
+
}).config.postAs;
|
|
274
|
+
return slackSetupAdapterBase.applyAccountConfig({
|
|
275
|
+
cfg,
|
|
276
|
+
accountId,
|
|
277
|
+
input: identity === "user" ? {
|
|
278
|
+
...setupInput,
|
|
279
|
+
identity
|
|
280
|
+
} : setupInput
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
};
|
|
263
284
|
const slackSetupContract = defineChannelSetupContract({
|
|
264
285
|
fields: {
|
|
265
286
|
botToken: {
|
|
@@ -319,25 +340,7 @@ const slackSetupContract = defineChannelSetupContract({
|
|
|
319
340
|
envVars: ["SLACK_BOT_TOKEN"]
|
|
320
341
|
}
|
|
321
342
|
},
|
|
322
|
-
legacyAdapter:
|
|
323
|
-
...slackSetupAdapterBase,
|
|
324
|
-
singleAccountKeysToMove: ["appToken"],
|
|
325
|
-
applyAccountConfig: ({ cfg, accountId, input }) => {
|
|
326
|
-
const setupInput = input;
|
|
327
|
-
const identity = setupInput.identity ?? inspectSlackAccount({
|
|
328
|
-
cfg,
|
|
329
|
-
accountId
|
|
330
|
-
}).config.postAs;
|
|
331
|
-
return slackSetupAdapterBase.applyAccountConfig({
|
|
332
|
-
cfg,
|
|
333
|
-
accountId,
|
|
334
|
-
input: identity === "user" ? {
|
|
335
|
-
...setupInput,
|
|
336
|
-
identity
|
|
337
|
-
} : setupInput
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
}
|
|
343
|
+
legacyAdapter: slackSetupAdapter
|
|
341
344
|
});
|
|
342
345
|
function createSlackSetupWizardBase(handlers) {
|
|
343
346
|
const slackDmPolicy = createChannelDmPolicy({
|
|
@@ -555,7 +558,7 @@ const slackBaseConfigAdapter = createScopedChannelConfigAdapter({
|
|
|
555
558
|
});
|
|
556
559
|
//#endregion
|
|
557
560
|
//#region extensions/slack/src/channel.setup.ts
|
|
558
|
-
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-
|
|
561
|
+
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-B1_gpGBl.js")).slackSetupWizard }));
|
|
559
562
|
const slackSetupPlugin = {
|
|
560
563
|
id: SLACK_CHANNEL,
|
|
561
564
|
meta: {
|
|
@@ -591,7 +594,10 @@ const slackSetupPlugin = {
|
|
|
591
594
|
minChars: 1500,
|
|
592
595
|
idleMs: 1e3
|
|
593
596
|
} },
|
|
594
|
-
reload: {
|
|
597
|
+
reload: {
|
|
598
|
+
configPrefixes: ["channels.slack"],
|
|
599
|
+
noopPrefixes: ["messages.inbound", "messages.ackReactionScope"]
|
|
600
|
+
},
|
|
595
601
|
configSchema: SlackChannelConfigSchema,
|
|
596
602
|
config: {
|
|
597
603
|
...slackBaseConfigAdapter,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { buildSecretInputSchema, hasConfiguredSecretInput } from "openclaw/plugin-sdk/secret-input";
|
|
2
2
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
3
|
-
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelImplicitMentionsSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema,
|
|
3
|
+
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelImplicitMentionsSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, ProviderCommandsSchema, ReplyToModeSchema, buildChannelAccountSchemaParts, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildGroupEntrySchema, requireAllowlistAllowFrom, requireOpenAllowFrom } from "openclaw/plugin-sdk/channel-config-schema";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region extensions/slack/src/config-ui-hints.ts
|
|
6
6
|
const slackChannelConfigUiHints = {
|
|
@@ -29,14 +29,18 @@ const slackChannelConfigUiHints = {
|
|
|
29
29
|
chunkMode: "Chunking mode for outbound Slack text delivery: \"length\" (default) or \"newline\".",
|
|
30
30
|
"block.enabled": "Enable chunked block-style Slack preview delivery when channels.slack.streaming.mode=\"block\".",
|
|
31
31
|
"block.coalesce": "Merge streamed Slack block replies before final delivery.",
|
|
32
|
-
nativeTransport: "Enable native Slack text streaming (chat.startStream/chat.appendStream/chat.stopStream) when channels.slack.streaming.mode is partial (default: true). Native streaming and Slack
|
|
32
|
+
nativeTransport: "Enable native Slack text streaming (chat.startStream/chat.appendStream/chat.stopStream) when channels.slack.streaming.mode is partial (default: true). Native streaming and Slack session status require a reply thread target; top-level DMs can still use draft post-and-edit preview streaming.",
|
|
33
33
|
"preview.toolProgress": "Show tool/progress activity in the live draft preview message (default: true). Set false to hide interim tool updates while the draft preview stays active.",
|
|
34
34
|
"preview.commandText": "Command/exec detail in preview tool-progress lines: \"status\" is the safe default; \"raw\" opts into command text.",
|
|
35
|
-
"progress.style": "Slack progress presentation: \"card\"
|
|
35
|
+
"progress.style": "Slack progress presentation: \"card\" uses structured task/session cards; \"compact\" keeps a temporary editable text draft. The final response is posted as a new message, then the draft is deleted after confirmed delivery. Defaults to \"compact\" when progress.toolProgress is explicitly false, otherwise \"card\".",
|
|
36
36
|
"progress.nativeTaskCards": "Slack native task-card progress updates when channels.slack.streaming.mode=\"progress\", progress.style=\"card\", and streaming.nativeTransport is enabled. Set false to fall back to the Block Kit progress card. Default: true."
|
|
37
37
|
},
|
|
38
38
|
progress: { labels: "openclaw" }
|
|
39
39
|
}),
|
|
40
|
+
joinIntro: {
|
|
41
|
+
label: "Slack Channel Join Introduction",
|
|
42
|
+
help: "Post one brief, room-specific introduction when the bot joins an allowed Slack channel (default: true). Account settings override the channel-wide setting."
|
|
43
|
+
},
|
|
40
44
|
allowBots: {
|
|
41
45
|
label: "Slack Allow Bot Messages",
|
|
42
46
|
help: "Allow bot-authored messages to trigger Slack replies (default: false)."
|
|
@@ -95,7 +99,7 @@ const slackChannelConfigUiHints = {
|
|
|
95
99
|
},
|
|
96
100
|
execApprovals: {
|
|
97
101
|
label: "Slack Exec Approvals",
|
|
98
|
-
help: "Slack-native exec approval routing and approver authorization.
|
|
102
|
+
help: "Slack-native exec approval routing and approver authorization. Set enabled to \"auto\" or true to enable DM-first native approvals when approvers can be resolved for this Slack account; unset or false disables them."
|
|
99
103
|
},
|
|
100
104
|
presenceEvents: {
|
|
101
105
|
label: "Slack Presence Events",
|
|
@@ -119,7 +123,7 @@ const slackChannelConfigUiHints = {
|
|
|
119
123
|
},
|
|
120
124
|
"execApprovals.enabled": {
|
|
121
125
|
label: "Slack Exec Approvals Enabled",
|
|
122
|
-
help: "Controls Slack native exec approvals for this account:
|
|
126
|
+
help: "Controls Slack native exec approvals for this account: \"auto\" or true enables DM-first native approvals when approvers can be resolved; unset or false disables them."
|
|
123
127
|
},
|
|
124
128
|
"execApprovals.approvers": {
|
|
125
129
|
label: "Slack Exec Approval Approvers",
|
|
@@ -199,12 +203,14 @@ const SlackRelaySchema = z.object({
|
|
|
199
203
|
gatewayId: z.string().optional()
|
|
200
204
|
}).strict();
|
|
201
205
|
const SlackIdentitySchema = z.enum(["bot", "user"]);
|
|
206
|
+
const { accountShape, rootPolicyShape } = buildChannelAccountSchemaParts({
|
|
207
|
+
omit: ["groupAllowFrom"],
|
|
208
|
+
streaming: SlackStreamingConfigSchema.optional()
|
|
209
|
+
});
|
|
202
210
|
const SlackAccountSchema = z.object({
|
|
203
|
-
...
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}),
|
|
207
|
-
postAs: SlackIdentitySchema.default("bot"),
|
|
211
|
+
...accountShape,
|
|
212
|
+
joinIntro: z.boolean().optional(),
|
|
213
|
+
postAs: SlackIdentitySchema.optional(),
|
|
208
214
|
mode: z.enum([
|
|
209
215
|
"socket",
|
|
210
216
|
"http",
|
|
@@ -218,7 +224,7 @@ const SlackAccountSchema = z.object({
|
|
|
218
224
|
botToken: SecretInputSchema.optional(),
|
|
219
225
|
appToken: SecretInputSchema.optional(),
|
|
220
226
|
userToken: SecretInputSchema.optional(),
|
|
221
|
-
userTokenReadOnly: z.boolean().optional()
|
|
227
|
+
userTokenReadOnly: z.boolean().optional(),
|
|
222
228
|
allowBots: buildChannelAllowBotsSchema({ allowMentions: true }),
|
|
223
229
|
botLoopProtection: ChannelBotLoopProtectionSchema.optional(),
|
|
224
230
|
dangerouslyAllowNameMatching: ChannelDangerouslyAllowNameMatchingSchema,
|
|
@@ -259,7 +265,6 @@ const SlackAccountSchema = z.object({
|
|
|
259
265
|
channels: z.record(z.string(), SlackChannelSchema.optional()).optional(),
|
|
260
266
|
typingReaction: z.string().optional()
|
|
261
267
|
}).strict();
|
|
262
|
-
const SlackAccountEntrySchema = SlackAccountSchema.extend({ postAs: SlackIdentitySchema.optional() });
|
|
263
268
|
function validateSlackSigningSecretRequirements(value, ctx) {
|
|
264
269
|
const resolveMode = (mode) => mode === "http" || mode === "socket" || mode === "relay" ? mode : void 0;
|
|
265
270
|
const baseMode = resolveMode(value.mode) ?? "socket";
|
|
@@ -272,7 +277,8 @@ function validateSlackSigningSecretRequirements(value, ctx) {
|
|
|
272
277
|
for (const [accountId, account] of Object.entries(value.accounts ?? {})) {
|
|
273
278
|
if (!account || account.enabled === false) continue;
|
|
274
279
|
if ((resolveMode(account.mode) ?? baseMode) !== "http") continue;
|
|
275
|
-
|
|
280
|
+
const accountSecret = account.signingSecret ?? value.signingSecret;
|
|
281
|
+
if (!hasConfiguredSecretInput(accountSecret)) ctx.addIssue({
|
|
276
282
|
code: z.ZodIssueCode.custom,
|
|
277
283
|
message: "channels.slack.accounts.*.mode=\"http\" requires channels.slack.signingSecret or channels.slack.accounts.*.signingSecret",
|
|
278
284
|
path: [
|
|
@@ -283,7 +289,10 @@ function validateSlackSigningSecretRequirements(value, ctx) {
|
|
|
283
289
|
});
|
|
284
290
|
}
|
|
285
291
|
}
|
|
286
|
-
const
|
|
292
|
+
const SlackConfigSchema = SlackAccountSchema.safeExtend({
|
|
293
|
+
...rootPolicyShape,
|
|
294
|
+
postAs: SlackIdentitySchema.default("bot"),
|
|
295
|
+
userTokenReadOnly: z.boolean().optional().default(true),
|
|
287
296
|
mode: z.enum([
|
|
288
297
|
"socket",
|
|
289
298
|
"http",
|
|
@@ -291,8 +300,7 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackAccountSchema.saf
|
|
|
291
300
|
]).optional().default("socket"),
|
|
292
301
|
signingSecret: SecretInputSchema.optional(),
|
|
293
302
|
webhookPath: z.string().optional().default("/slack/events"),
|
|
294
|
-
|
|
295
|
-
accounts: z.record(z.string(), SlackAccountEntrySchema.optional()).optional(),
|
|
303
|
+
accounts: z.record(z.string(), SlackAccountSchema.optional()).optional(),
|
|
296
304
|
defaultAccount: z.string().optional()
|
|
297
305
|
}).superRefine((value, ctx) => {
|
|
298
306
|
if (value.enabled === false) return;
|
|
@@ -378,6 +386,7 @@ const SlackChannelConfigSchema = buildChannelConfigSchema(SlackAccountSchema.saf
|
|
|
378
386
|
}
|
|
379
387
|
}
|
|
380
388
|
validateSlackSigningSecretRequirements(value, ctx);
|
|
381
|
-
})
|
|
389
|
+
});
|
|
390
|
+
const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { uiHints: slackChannelConfigUiHints });
|
|
382
391
|
//#endregion
|
|
383
392
|
export { SlackChannelConfigSchema as t };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
//#region extensions/slack/src/cursor-pages.ts
|
|
2
2
|
const SLACK_CURSOR_PAGE_LIMIT = 1e4;
|
|
3
|
+
const fetchSlackChannelListPage = (client, cursor) => client.conversations.list({
|
|
4
|
+
types: "public_channel,private_channel",
|
|
5
|
+
exclude_archived: false,
|
|
6
|
+
limit: 1e3,
|
|
7
|
+
cursor
|
|
8
|
+
});
|
|
3
9
|
async function collectSlackCursorPages(params) {
|
|
4
10
|
const items = [];
|
|
5
11
|
let cursor;
|
|
@@ -16,4 +22,4 @@ async function collectSlackCursorPages(params) {
|
|
|
16
22
|
throw new Error(`Slack cursor pagination exceeded ${SLACK_CURSOR_PAGE_LIMIT} pages`);
|
|
17
23
|
}
|
|
18
24
|
//#endregion
|
|
19
|
-
export { collectSlackCursorPages as t };
|
|
25
|
+
export { fetchSlackChannelListPage as n, collectSlackCursorPages as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { i as resolveDefaultSlackAccountId, o as resolveSlackAccountAllowFrom, r as mergeSlackAccountConfig } from "./accounts-Dm_H77gH.js";
|
|
3
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
4
|
-
import "./targets-
|
|
3
|
+
import { a as parseSlackTarget } from "./target-parsing-PbxGDbr9.js";
|
|
4
|
+
import "./targets-7FexXJ62.js";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
@@ -37,7 +37,8 @@ const listSlackDirectoryPeersFromConfig = createResolvedDirectoryEntriesLister({
|
|
|
37
37
|
normalizeId: (raw) => {
|
|
38
38
|
const normalizedUserId = (raw.match(/^<@([A-Z0-9]+)>$/i)?.[1] ?? raw).replace(/^(slack|user):/i, "").trim();
|
|
39
39
|
if (!normalizedUserId) return null;
|
|
40
|
-
const
|
|
40
|
+
const target = `user:${normalizedUserId}`;
|
|
41
|
+
const normalized = parseSlackTarget(target, { defaultKind: "user" });
|
|
41
42
|
return normalized?.kind === "user" ? `user:${normalizeLowercaseStringOrEmpty(normalized.id)}` : null;
|
|
42
43
|
}
|
|
43
44
|
});
|
|
@@ -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-Bmw4ykSy.js";
|
|
2
2
|
export { listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig };
|