@openclaw/slack 2026.9.1-beta.1 → 2026.9.1
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-DND4Pyp2.js} +84 -66
- package/dist/action-runtime.runtime-CEhbmS-Z.js +2 -0
- package/dist/{actions-XdQyjG_p.js → actions-fh66A6lc.js} +198 -54
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-DxXfGX_Z.js → approval-handler.runtime-D7d8sKM0.js} +18 -12
- package/dist/{channel-C_vnTgxo.js → channel-4m8IAdMD.js} +70 -128
- 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-3-SqEMVc.js} +2 -2
- package/dist/{channel.setup-aal8tokM.js → channel.setup-t_ghLGb_.js} +23 -22
- package/dist/{config-schema-CN3XZRX5.js → config-schema-bP3eV2ra.js} +25 -16
- package/dist/{conversation-binding-route-DFVLUdYF.js → conversation-binding-route-Vee8Dgbf.js} +2 -2
- 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-q32AW7N1.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/{group-policy-CU1tEGpS.js → group-policy-BKjMqT-8.js} +161 -260
- 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-Chwu_SiZ.js} +3 -3
- package/dist/{outbound-adapter-DkT2vUE9.js → outbound-adapter-BB8wAjm5.js} +95 -91
- package/dist/{pipeline.runtime-CRRng_Nw.js → pipeline.runtime-BklS_NEj.js} +347 -505
- package/dist/{policy-BoP6t88v.js → policy-D7PKkiet.js} +7 -4
- package/dist/{probe-4_aHtVT3.js → probe-gj5yQgN2.js} +210 -3
- package/dist/{provider-D4nDgxCh.js → provider-Do50wMWn.js} +168 -153
- package/dist/{relay-source-CEmze11m.js → relay-source-DWuduiJ2.js} +6 -4
- package/dist/{replies-D9XMM_S0.js → replies-Dc6WVh_Q.js} +20 -16
- package/dist/{resolve-channels-DSamDgVs.js → resolve-channels-CU7Bg5Ka.js} +6 -10
- package/dist/{resolve-users-CIzwbaJR.js → resolve-users-DrhttvRQ.js} +5 -4
- package/dist/runtime-api.js +10 -10
- package/dist/{scopes-BBrUzpBH.js → scopes-B9HRguDe.js} +1 -1
- package/dist/{send-DtjEnlLh.js → send-Djswy6lf.js} +24 -16
- package/dist/send-results-eeOu_HYm.js +23 -0
- package/dist/{send.runtime-DQeNKa2J.js → send.runtime-__WVTWLQ.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-CsBCM4rP.js → setup-surface-DO0e-MMS.js} +5 -5
- package/dist/{shared-D9GeeR9K.js → shared-DEQBEKBL.js} +7 -5
- package/dist/{slash-dispatch.runtime-Chr3YHnT.js → slash-dispatch.runtime-C3B4h5ZM.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/package.json +1 -1
- package/openclaw.plugin.json +15 -7
- package/package.json +5 -5
- package/dist/action-runtime.runtime-Dpa16J87.js +0 -2
- 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 { n as resolveSlackConversationBindingRoute, r as resolveSlackReplyToMode, t as normalizeSlackRouteBindingConfig } from "./conversation-binding-route-
|
|
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 { n as resolveSlackConversationBindingRoute, r as resolveSlackReplyToMode, t as normalizeSlackRouteBindingConfig } from "./conversation-binding-route-Vee8Dgbf.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 { $ as renderSlackMessagePresentationFallbackText, Ct as isSlackApprovalAuthorizedSender, Et as isSlackExecApprovalClientEnabled, F as canRenderSlackPresentation, I as countSlackTextUtf8Bytes, M as SLACK_TEXT_LIMIT, Ot as resolveSlackExecApprovalTarget, P as buildSlackPresentationBlocks, Q as normalizeSlackOutboundText, St as getSlackApprovalApproversForTeam, Tt as isSlackExecApprovalAuthorizedSender, _t as shouldHandleSlackPluginViaForwardingSession, a as qualifySlackConversationId, bt as isSlackWorkspaceInstallation, c as assertSlackDetachedTargetAllowed, ct as hasSlackPluginApprovers, d as resolveSlackReplyBlockResolution, dt as normalizeSlackOriginTarget, f as resolveSlackReplyBlocks, ft as resolveEnterpriseApprovalTeamId, gt as shouldHandleSlackNativeApprovalRequest, ht as resolveTurnSourceSlackOriginTarget, i as resolveSlackGroupToolPolicy, jt as resolveSlackAutoThreadId, k as SLACK_EDIT_TEXT_MAX_BYTES, kt as shouldSuppressLocalSlackExecApprovalPrompt, lt as isSlackAnyNativeApprovalClientEnabled, mt as resolveSlackFallbackOriginTarget, o as qualifySlackRoutePeerId, p as resolveSlackReplyDeliveryMessages, pt as resolveSessionSlackOriginTarget, r as resolveSlackGroupRequireMention, rt as SLACK_PRESENTATION_CAPABILITIES, ut as normalizeSlackForwardTarget, vt as slackTargetsMatch, wt as getSlackExecApprovalApprovers, yt as getSlackInstallationKind } from "./group-policy-BKjMqT-8.js";
|
|
7
|
+
import { m as getSlackWriteClient, o as formatSlackError } from "./probe-gj5yQgN2.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-DEQBEKBL.js";
|
|
11
|
+
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-3-SqEMVc.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-t_ghLGb_.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-D7d8sKM0.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-CEhbmS-Z.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-DO0e-MMS.js"));
|
|
571
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-B9HRguDe.js"));
|
|
572
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-BB8wAjm5.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-CU7Bg5Ka.js").then((n) => n.n));
|
|
581
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-DrhttvRQ.js").then((n) => n.n));
|
|
582
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-CEhbmS-Z.js"));
|
|
583
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send.runtime-__WVTWLQ.js"));
|
|
584
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-gj5yQgN2.js").then((n) => n.n));
|
|
585
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-Chwu_SiZ.js").then((n) => n.t));
|
|
586
|
+
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-q32AW7N1.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" });
|
|
@@ -609,15 +614,6 @@ async function setSlackHeartbeatThreadStatus(params) {
|
|
|
609
614
|
logVerbose(`slack heartbeat status update failed: ${formatSlackError(error)}`);
|
|
610
615
|
}
|
|
611
616
|
}
|
|
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
617
|
function resolveSlackRouteTarget(raw) {
|
|
622
618
|
const target = parseSlackTarget(raw, { defaultKind: "channel" });
|
|
623
619
|
if (!target) return null;
|
|
@@ -629,7 +625,8 @@ function resolveSlackRouteTarget(raw) {
|
|
|
629
625
|
function normalizeSlackAcpConversationId(raw) {
|
|
630
626
|
const trimmed = normalizeOptionalString(raw);
|
|
631
627
|
if (!trimmed) return null;
|
|
632
|
-
const
|
|
628
|
+
const parsed = parseSlackTarget(trimmed, { defaultKind: "channel" });
|
|
629
|
+
const conversationId = normalizeLowercaseStringOrEmpty(parsed?.id ?? trimmed.replace(/^slack:/i, "").replace(/^(?:channel|group|direct|user):/i, ""));
|
|
633
630
|
return conversationId ? { conversationId } : null;
|
|
634
631
|
}
|
|
635
632
|
function matchSlackAcpConversation(params) {
|
|
@@ -779,72 +776,16 @@ const slackChannelOutbound = {
|
|
|
779
776
|
}
|
|
780
777
|
}),
|
|
781
778
|
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
779
|
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
|
-
});
|
|
780
|
+
return await slackOutbound.sendPayload(ctx);
|
|
803
781
|
},
|
|
804
782
|
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
783
|
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
|
-
});
|
|
784
|
+
return await slackOutbound.sendText(ctx);
|
|
825
785
|
},
|
|
826
786
|
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
787
|
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
|
-
});
|
|
788
|
+
return await slackOutbound.sendMedia(ctx);
|
|
848
789
|
}
|
|
849
790
|
};
|
|
850
791
|
const slackMessageAdapterBase = createChannelMessageAdapterFromOutbound({
|
|
@@ -1204,12 +1145,13 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1204
1145
|
to,
|
|
1205
1146
|
toolContext
|
|
1206
1147
|
})),
|
|
1207
|
-
resolveReplyTransport: ({ threadId, replyToId, replyToIsExplicit, replyDelivery }) => {
|
|
1208
|
-
const
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1148
|
+
resolveReplyTransport: ({ threadId, replyToId, replyToIsExplicit, replyToCurrent, replyDelivery }) => {
|
|
1149
|
+
const resolvedReplyToId = resolveSlackReplyThreadTs({
|
|
1150
|
+
replyToId: normalizeSlackThreadTsCandidate(replyToId),
|
|
1151
|
+
threadId: normalizeSlackThreadTsCandidate(threadId),
|
|
1152
|
+
replyToMode: replyDelivery?.replyToMode,
|
|
1153
|
+
replyToIsExplicit,
|
|
1154
|
+
replyToCurrent
|
|
1213
1155
|
});
|
|
1214
1156
|
return {
|
|
1215
1157
|
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-bP3eV2ra.js";
|
|
2
2
|
export { SlackChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackPlugin } from "./channel-
|
|
1
|
+
import { t as slackPlugin } from "./channel-4m8IAdMD.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 { c as assertSlackDetachedTargetAllowed } from "./group-policy-BKjMqT-8.js";
|
|
4
|
+
import { C as normalizeAllowListLower, c as createSlackReadClient, d as createSlackWebClient } from "./probe-gj5yQgN2.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-bP3eV2ra.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";
|
|
@@ -260,6 +260,25 @@ const slackSetupAdapterBase = createPatchedAccountSetupAdapter({
|
|
|
260
260
|
};
|
|
261
261
|
}
|
|
262
262
|
});
|
|
263
|
+
const slackSetupAdapter = {
|
|
264
|
+
...slackSetupAdapterBase,
|
|
265
|
+
singleAccountKeysToMove: ["appToken"],
|
|
266
|
+
applyAccountConfig: ({ cfg, accountId, input }) => {
|
|
267
|
+
const setupInput = input;
|
|
268
|
+
const identity = setupInput.identity ?? inspectSlackAccount({
|
|
269
|
+
cfg,
|
|
270
|
+
accountId
|
|
271
|
+
}).config.postAs;
|
|
272
|
+
return slackSetupAdapterBase.applyAccountConfig({
|
|
273
|
+
cfg,
|
|
274
|
+
accountId,
|
|
275
|
+
input: identity === "user" ? {
|
|
276
|
+
...setupInput,
|
|
277
|
+
identity
|
|
278
|
+
} : setupInput
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
};
|
|
263
282
|
const slackSetupContract = defineChannelSetupContract({
|
|
264
283
|
fields: {
|
|
265
284
|
botToken: {
|
|
@@ -319,25 +338,7 @@ const slackSetupContract = defineChannelSetupContract({
|
|
|
319
338
|
envVars: ["SLACK_BOT_TOKEN"]
|
|
320
339
|
}
|
|
321
340
|
},
|
|
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
|
-
}
|
|
341
|
+
legacyAdapter: slackSetupAdapter
|
|
341
342
|
});
|
|
342
343
|
function createSlackSetupWizardBase(handlers) {
|
|
343
344
|
const slackDmPolicy = createChannelDmPolicy({
|
|
@@ -555,7 +556,7 @@ const slackBaseConfigAdapter = createScopedChannelConfigAdapter({
|
|
|
555
556
|
});
|
|
556
557
|
//#endregion
|
|
557
558
|
//#region extensions/slack/src/channel.setup.ts
|
|
558
|
-
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-
|
|
559
|
+
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-DO0e-MMS.js")).slackSetupWizard }));
|
|
559
560
|
const slackSetupPlugin = {
|
|
560
561
|
id: SLACK_CHANNEL,
|
|
561
562
|
meta: {
|
|
@@ -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 = {
|
|
@@ -32,11 +32,15 @@ const slackChannelConfigUiHints = {
|
|
|
32
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 assistant thread 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 one editable text draft that the final answer replaces in place when Slack can safely edit it. Defaults to \"compact\" when progress.toolProgress is 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 };
|
package/dist/{conversation-binding-route-DFVLUdYF.js → conversation-binding-route-Vee8Dgbf.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
2
|
-
import "./targets-
|
|
1
|
+
import { a as parseSlackTarget } from "./target-parsing-PbxGDbr9.js";
|
|
2
|
+
import "./targets-7FexXJ62.js";
|
|
3
3
|
import { resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-runtime";
|
|
4
4
|
//#region extensions/slack/src/account-reply-mode.ts
|
|
5
5
|
function normalizeSlackChatType(raw) {
|
|
@@ -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 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
2
|
import { a as resolveSlackAccount } from "./accounts-Dm_H77gH.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as collectSlackCursorPages } from "./cursor-pages-
|
|
3
|
+
import { s as createSlackLookupClient } from "./probe-gj5yQgN2.js";
|
|
4
|
+
import { n as fetchSlackChannelListPage, t as collectSlackCursorPages } from "./cursor-pages-ByFwo-Py.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
//#region extensions/slack/src/directory-live.ts
|
|
7
7
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -91,12 +91,7 @@ async function listSlackDirectoryGroupsLive(params) {
|
|
|
91
91
|
if (!client) return [];
|
|
92
92
|
const query = normalizeQuery(params.query);
|
|
93
93
|
const rows = (await collectSlackCursorPages({
|
|
94
|
-
fetchPage: (cursor) => client
|
|
95
|
-
types: "public_channel,private_channel",
|
|
96
|
-
exclude_archived: false,
|
|
97
|
-
limit: 1e3,
|
|
98
|
-
cursor
|
|
99
|
-
}),
|
|
94
|
+
fetchPage: (cursor) => fetchSlackChannelListPage(client, cursor),
|
|
100
95
|
collectPageItems: (res) => Array.isArray(res.channels) ? res.channels : []
|
|
101
96
|
})).filter((channel) => {
|
|
102
97
|
const name = normalizeOptionalLowercaseString(channel.name);
|
|
@@ -171,11 +171,12 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
171
171
|
scope: "root-and-accounts",
|
|
172
172
|
onRemove: ({ key, pathPrefix }) => changes.push(`Removed retired ${pathPrefix}.${key}; Slack detects org-wide installations automatically.`)
|
|
173
173
|
});
|
|
174
|
+
const aliases = streamingAliasMigration.normalizeChannelConfig({
|
|
175
|
+
cfg: retired.config,
|
|
176
|
+
changes
|
|
177
|
+
});
|
|
174
178
|
return normalizeChannelConfigEntries({
|
|
175
|
-
cfg:
|
|
176
|
-
cfg: retired.config,
|
|
177
|
-
changes
|
|
178
|
-
}).config,
|
|
179
|
+
cfg: aliases.config,
|
|
179
180
|
channelId: "slack",
|
|
180
181
|
changes,
|
|
181
182
|
normalizeEntry: normalizeSlackEntry
|