@openclaw/slack 2026.11.10 → 2026.12.1-beta.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/.setup/{action-runtime-Cs2IxOLc.mjs → action-runtime-BvoZDGSu.mjs} +228 -85
- package/dist/.setup/action-runtime.runtime-BwRLINj-.mjs +1 -0
- package/dist/.setup/{actions-BNOabmV6.mjs → actions-DAWAKRJ9.mjs} +53 -3
- package/dist/.setup/{approval-handler.runtime-C2C-jNxi.mjs → approval-handler.runtime-BIePVIYr.mjs} +5 -5
- package/dist/.setup/{approval-message-updates-Bx2u_5-z.mjs → approval-message-updates-DocYhToX.mjs} +1 -1
- package/dist/.setup/{channel-DbcKs2sx.mjs → channel-paKIY8u4.mjs} +29 -17
- package/dist/.setup/{channel-type-ZG0ErPTI.mjs → channel-type-Ku_QceM7.mjs} +3 -3
- package/dist/.setup/{channel.setup-DNnvYUKL.mjs → channel.setup-BW3ogoi5.mjs} +1 -1
- package/dist/.setup/{cursor-pages-jVn3Vkfi.mjs → client-DQqLIemQ.mjs} +1 -24
- package/dist/.setup/cursor-pages-DiOrzZtc.mjs +30 -0
- package/dist/.setup/{directory-live-DNdw97LA.mjs → directory-live-CJl5MPac.mjs} +2 -1
- package/dist/.setup/{fork-DTKBA8Fm.mjs → fork-Cua6YBp0.mjs} +3 -3
- package/dist/.setup/{literal-text-DdCRYzYh.mjs → literal-text-CXYRhsDp.mjs} +1 -1
- package/dist/.setup/{message-tool-api-B38BpEaE.mjs → message-tool-api-CTxYxzPZ.mjs} +18 -2
- package/dist/.setup/{monitor-MmW89Bu-.mjs → monitor-CkoNScT9.mjs} +44 -32
- package/dist/.setup/{outbound-adapter-1JpFMcJD.mjs → outbound-adapter-lDejfL01.mjs} +4 -4
- package/dist/.setup/{pipeline.runtime-Jl0lv8Nv.mjs → pipeline.runtime-B4H65MB2.mjs} +1565 -164
- package/dist/.setup/{policy-klXrk5vE.mjs → policy-B7_AZUCl.mjs} +1 -1
- package/dist/.setup/{probe-BHqvMbno.mjs → probe-ME1HsC0x.mjs} +71 -107
- package/dist/.setup/{question-delivery-BGwm5Zmr.mjs → question-delivery-CFd8xhhn.mjs} +1 -1
- package/dist/.setup/{relay-source-CukshFI4.mjs → relay-source-D6xKiatj.mjs} +2 -2
- package/dist/.setup/{replies-iMC3Vvxk.mjs → replies-BLOhFQoK.mjs} +5 -5
- package/dist/.setup/{reply-blocks-CFy-O-2B.mjs → reply-blocks-BXQwrMaA.mjs} +1 -1
- package/dist/.setup/{resolve-channels-CF2JME9q.mjs → resolve-channels-CtkJuB1X.mjs} +2 -1
- package/dist/.setup/{resolve-users-DDcCAjH1.mjs → resolve-users-Bqf-wJF9.mjs} +2 -1
- package/dist/.setup/{scopes-DKl6yqIv.mjs → scopes-Dbu5pO1O.mjs} +2 -2
- package/dist/.setup/{send-kGJWQtLk.mjs → send-CNGjlL3z.mjs} +51 -15
- package/dist/.setup/setup-plugin-api-gni0-Cwn.mjs +2 -0
- package/dist/.setup/{setup-surface-CPFVFPFM.mjs → setup-surface--ug5_htx.mjs} +3 -3
- package/dist/.setup/{slash-dispatch.runtime-COX_8_Kh.mjs → slash-dispatch.runtime-ln-mu0Wb.mjs} +1 -1
- package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -1
- package/dist/api.js +9 -9
- package/dist/channel-plugin-api.js +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +8 -8
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/undici/README.md +1 -1
- package/node_modules/undici/docs/docs/api/Dispatcher.md +4 -1
- package/node_modules/undici/docs/docs/api/RetryAgent.md +1 -1
- package/node_modules/undici/docs/docs/api/RetryHandler.md +1 -1
- package/node_modules/undici/docs/docs/index.md +1 -1
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +58 -12
- package/node_modules/undici/lib/dispatcher/client-h1.js +3 -1
- package/node_modules/undici/lib/dispatcher/client-h2.js +80 -23
- package/node_modules/undici/lib/dispatcher/parser-h1.js +2 -1
- package/node_modules/undici/lib/handler/cache-handler.js +305 -39
- package/node_modules/undici/lib/handler/decorator-handler.js +6 -2
- package/node_modules/undici/lib/handler/redirect-handler.js +32 -11
- package/node_modules/undici/lib/interceptor/cache.js +112 -23
- package/node_modules/undici/lib/mock/mock-utils.js +11 -1
- package/node_modules/undici/lib/web/fetch/body.js +28 -8
- package/node_modules/undici/lib/web/fetch/index.js +3 -9
- package/node_modules/undici/lib/web/fetch/request.js +93 -115
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +2 -2
- package/node_modules/undici/package.json +2 -2
- package/node_modules/undici/types/dispatcher.d.ts +1 -1
- package/node_modules/undici/types/formdata.d.ts +6 -6
- package/node_modules/undici/types/retry-handler.d.ts +3 -3
- package/package.json +5 -5
- package/dist/.setup/action-runtime.runtime-me4Yd3j7.mjs +0 -1
- package/dist/.setup/setup-plugin-api-UWUSCOAK.mjs +0 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as parseSlackTarget, n as formatSlackTarget, o as resolveSlackChannelId } from "./target-parsing-DwYAP3ts.mjs";
|
|
2
2
|
import { t as slackContextTargetsMatch } from "./targets-eeOxA_b_.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { J as parseSlackBlocksInput, Jt as getSlackInstallationTeamId, T as assertSlackDetachedTargetAllowed, an as resolveSlackThreadTsFromContext, d as hasPotentialSlackNamedPolicy, l as buildSlackChannelIdCandidates, qt as getSlackInstallationKind, rn as SLACK_PRIVATE_ACTION_DELIVERY_RESULT, rt as hasSlackNativeDataBlock } from "./probe-ME1HsC0x.mjs";
|
|
4
|
+
import { t as SLACK_CONVERSATION_LIST_TYPES } from "./cursor-pages-DiOrzZtc.mjs";
|
|
5
|
+
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-B7_AZUCl.mjs";
|
|
5
6
|
import { t as mergeSlackSendResults } from "./send-results-Bm6V1ekL.mjs";
|
|
6
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
7
8
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -9,52 +10,8 @@ import { createLazyRuntimeMethodBinder, createLazyRuntimeModule } from "openclaw
|
|
|
9
10
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
10
11
|
import { createActionGate, imageResultFromFile, jsonResult, readPositiveIntegerParam, readReactionParams, readStringParam, withNormalizedTimestamp } from "openclaw/plugin-sdk/channel-actions";
|
|
11
12
|
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
|
|
12
|
-
// extensions/slack/src/action-
|
|
13
|
-
const
|
|
14
|
-
"openConversation",
|
|
15
|
-
"sendMessage",
|
|
16
|
-
"uploadFile",
|
|
17
|
-
"editMessage",
|
|
18
|
-
"deleteMessage",
|
|
19
|
-
"readMessages",
|
|
20
|
-
"downloadFile"
|
|
21
|
-
]);
|
|
22
|
-
const reactionsActions = /* @__PURE__ */ new Set(["react", "reactions"]);
|
|
23
|
-
const pinActions = /* @__PURE__ */ new Set([
|
|
24
|
-
"pinMessage",
|
|
25
|
-
"unpinMessage",
|
|
26
|
-
"listPins"
|
|
27
|
-
]);
|
|
28
|
-
const SLACK_REACTION_RESULT_LIMIT = 100;
|
|
29
|
-
function readSlackResultLimit(params) {
|
|
30
|
-
return Math.min(readPositiveIntegerParam(params, "limit", { message: "limit must be a positive integer." }) ?? SLACK_REACTION_RESULT_LIMIT, SLACK_REACTION_RESULT_LIMIT);
|
|
31
|
-
}
|
|
32
|
-
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions-BNOabmV6.mjs").then((n) => n.t));
|
|
33
|
-
const bindSlackAction = createLazyRuntimeMethodBinder(loadSlackActionsRuntime);
|
|
34
|
-
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts-EaPP0fFY.mjs").then((n) => n.t));
|
|
35
|
-
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-ZG0ErPTI.mjs").then((n) => n.t));
|
|
36
|
-
const bindSlackChannelType = createLazyRuntimeMethodBinder(loadSlackChannelTypeRuntime);
|
|
37
|
-
const slackActionRuntime = {
|
|
38
|
-
createSlackChannel: bindSlackAction((runtime) => runtime.createSlackChannel),
|
|
39
|
-
deleteSlackMessage: bindSlackAction((runtime) => runtime.deleteSlackMessage),
|
|
40
|
-
downloadSlackFile: bindSlackAction((runtime) => runtime.downloadSlackFile),
|
|
41
|
-
editSlackMessage: bindSlackAction((runtime) => runtime.editSlackMessage),
|
|
42
|
-
editSlackRenderedMessage: bindSlackAction((runtime) => runtime.editSlackRenderedMessage),
|
|
43
|
-
getSlackMemberInfo: bindSlackAction((runtime) => runtime.getSlackMemberInfo),
|
|
44
|
-
listSlackEmojis: bindSlackAction((runtime) => runtime.listSlackEmojis),
|
|
45
|
-
listSlackPins: bindSlackAction((runtime) => runtime.listSlackPins),
|
|
46
|
-
listSlackReactions: bindSlackAction((runtime) => runtime.listSlackReactions),
|
|
47
|
-
openSlackConversation: bindSlackAction((runtime) => runtime.openSlackConversation),
|
|
48
|
-
parseSlackBlocksInput,
|
|
49
|
-
pinSlackMessage: bindSlackAction((runtime) => runtime.pinSlackMessage),
|
|
50
|
-
reactSlackMessage: bindSlackAction((runtime) => runtime.reactSlackMessage),
|
|
51
|
-
readSlackMessages: bindSlackAction((runtime) => runtime.readSlackMessages),
|
|
52
|
-
removeOwnSlackReactions: bindSlackAction((runtime) => runtime.removeOwnSlackReactions),
|
|
53
|
-
removeSlackReaction: bindSlackAction((runtime) => runtime.removeSlackReaction),
|
|
54
|
-
resolveSlackConversationInfo: bindSlackChannelType((runtime) => runtime.resolveSlackConversationInfo),
|
|
55
|
-
sendSlackMessage: bindSlackAction((runtime) => runtime.sendSlackMessage),
|
|
56
|
-
unpinSlackMessage: bindSlackAction((runtime) => runtime.unpinSlackMessage)
|
|
57
|
-
};
|
|
13
|
+
// extensions/slack/src/action-read-policy.ts
|
|
14
|
+
const loadSlackAccountsRuntime$1 = createLazyRuntimeModule(() => import("./accounts-EaPP0fFY.mjs").then((n) => n.t));
|
|
58
15
|
function resolveSlackDmReadAllowed(account) {
|
|
59
16
|
const dmPolicy = account.config.dmPolicy ?? "pairing";
|
|
60
17
|
return account.config.dm?.enabled !== false && dmPolicy !== "disabled";
|
|
@@ -70,7 +27,7 @@ async function isSlackDmTargetConfigured(params) {
|
|
|
70
27
|
if (defaultTo && slackContextTargetsMatch(params.channelId, { currentChannelId: defaultTo })) return true;
|
|
71
28
|
const userId = normalizeConfiguredSlackDmUserId(params.userId);
|
|
72
29
|
if (!userId) return false;
|
|
73
|
-
const { resolveSlackAccountAllowFrom } = await loadSlackAccountsRuntime();
|
|
30
|
+
const { resolveSlackAccountAllowFrom } = await loadSlackAccountsRuntime$1();
|
|
74
31
|
return [
|
|
75
32
|
...resolveSlackAccountAllowFrom({
|
|
76
33
|
cfg: params.cfg,
|
|
@@ -84,11 +41,6 @@ function hasSlackRequesterAccount(account, context) {
|
|
|
84
41
|
const requesterAccountId = context?.requesterAccountId?.trim();
|
|
85
42
|
return Boolean(normalizeOptionalLowercaseString(context?.currentChannelProvider) === "slack" && requesterAccountId && normalizeAccountId(requesterAccountId) === normalizeAccountId(account.accountId));
|
|
86
43
|
}
|
|
87
|
-
function assertSlackMemberInfoAllowed(params) {
|
|
88
|
-
if (params.context?.conversationReadOrigin === "direct-operator") return;
|
|
89
|
-
const requesterSenderId = normalizeOptionalLowercaseString(params.context?.requesterSenderId);
|
|
90
|
-
if (!hasSlackRequesterAccount(params.account, params.context) || !requesterSenderId || requesterSenderId !== normalizeOptionalLowercaseString(params.userId)) throw new Error("Delegated Slack member info is limited to the current requester.");
|
|
91
|
-
}
|
|
92
44
|
function resolveSlackChannelReadPolicy(params) {
|
|
93
45
|
const channels = params.account.config.channels;
|
|
94
46
|
const channelKeys = Object.keys(channels ?? {});
|
|
@@ -134,7 +86,180 @@ function resolveSlackChannelReadPolicy(params) {
|
|
|
134
86
|
shouldResolveName
|
|
135
87
|
};
|
|
136
88
|
}
|
|
89
|
+
async function isSlackResolvedReadTargetAllowed(params) {
|
|
90
|
+
const { info } = params;
|
|
91
|
+
const resolved = resolveSlackChannelReadPolicy({
|
|
92
|
+
...params,
|
|
93
|
+
channelName: info.name,
|
|
94
|
+
metadataResolved: true
|
|
95
|
+
});
|
|
96
|
+
if (resolved.channelExplicitlyDisabled) return false;
|
|
97
|
+
if (info.type === "dm") return resolveSlackDmReadAllowed(params.account) && (params.conversationReadOrigin === "direct-operator" || params.currentConversation || await isSlackDmTargetConfigured({
|
|
98
|
+
...params,
|
|
99
|
+
userId: info.user
|
|
100
|
+
}));
|
|
101
|
+
return info.type === "channel" ? resolved.channelAllowed : info.type === "group" ? resolved.groupDmAllowed : resolved.channelAllowed && resolved.groupDmAllowed;
|
|
102
|
+
}
|
|
103
|
+
function isSlackGroupDmTargetConfigured(account, channelId, teamId) {
|
|
104
|
+
const entries = account.config.dm?.groupChannels ?? [];
|
|
105
|
+
if (entries.length === 0) return true;
|
|
106
|
+
const candidates = new Set(buildSlackChannelIdCandidates(channelId, teamId, { allowUnscoped: getSlackInstallationKind(account.accountId) !== "enterprise" }).map((candidate) => candidate.toLowerCase()));
|
|
107
|
+
const target = channelId.trim().toLowerCase();
|
|
108
|
+
return entries.some((entry) => {
|
|
109
|
+
const candidate = String(entry).trim().toLowerCase();
|
|
110
|
+
return candidate === "*" || candidates.has(candidate) || candidate === target || candidate === `slack:${target}` || candidate === `channel:${target}` || candidate === `group:${target}` || candidate === `mpim:${target}`;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/** Whether any policy entry is qualified by workspace, so unqualified reads need one. */
|
|
114
|
+
function hasSlackTeamScopedPolicy(account) {
|
|
115
|
+
return [...Object.keys(account.config.channels ?? {}), ...(account.config.dm?.groupChannels ?? []).map(String)].some((key) => /^team:/i.test(key.trim()));
|
|
116
|
+
}
|
|
117
|
+
// extensions/slack/src/action-read-params.ts
|
|
118
|
+
const SLACK_CONVERSATION_LIST_DEFAULT_LIMIT = 200;
|
|
119
|
+
const SLACK_CONVERSATION_LIST_MAX_LIMIT = 1e3;
|
|
120
|
+
/** readAs makes the owner's token choice explicit; omitted keeps the account default. */
|
|
121
|
+
function resolveSlackReadAsToken(account, params) {
|
|
122
|
+
const readAs = readStringParam(params, "readAs");
|
|
123
|
+
if (readAs === void 0) return;
|
|
124
|
+
if (readAs !== "bot" && readAs !== "user") throw new Error("Slack readAs must be \"bot\" or \"user\".");
|
|
125
|
+
const token = readAs === "bot" ? account.botToken?.trim() : account.userToken?.trim();
|
|
126
|
+
if (!token) throw new Error(`Slack readAs "${readAs}" requires a configured ${readAs} token for account "${account.accountId}".`);
|
|
127
|
+
return token;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Workspace whose policy applies to conversations read with the selected token: the
|
|
131
|
+
* requested one, the monitor's when it authenticated this same credential, else auth.test.
|
|
132
|
+
*/
|
|
133
|
+
async function resolveSlackTokenPolicyTeamId(params) {
|
|
134
|
+
const { account, requestedTeamId } = params;
|
|
135
|
+
const monitorToken = account.identity === "user" ? account.userToken : account.botToken;
|
|
136
|
+
const installTeamId = params.selectedToken && params.selectedToken === monitorToken?.trim() ? getSlackInstallationTeamId(account.accountId) : void 0;
|
|
137
|
+
const workspace = installTeamId ? {
|
|
138
|
+
teamId: installTeamId,
|
|
139
|
+
enterpriseInstall: false
|
|
140
|
+
} : await params.lookup();
|
|
141
|
+
if (requestedTeamId && workspace.teamId && !workspace.enterpriseInstall && workspace.teamId.toLowerCase() !== requestedTeamId.toLowerCase()) throw new Error(`Slack teamId ${requestedTeamId} does not match workspace ${workspace.teamId} of the selected token.`);
|
|
142
|
+
return requestedTeamId ?? workspace.teamId;
|
|
143
|
+
}
|
|
144
|
+
/** Policy workspace for a read target the caller left unqualified. */
|
|
145
|
+
async function resolveSlackReadPolicyTeamId(params) {
|
|
146
|
+
return params.targetTeamId ?? (hasSlackTeamScopedPolicy(params.account) ? await resolveSlackTokenPolicyTeamId(params) : void 0);
|
|
147
|
+
}
|
|
148
|
+
function readSlackConversationListParams(params) {
|
|
149
|
+
return {
|
|
150
|
+
types: readSlackConversationListTypes(params.types),
|
|
151
|
+
includeArchived: readBooleanParam(params, "includeArchived") === true,
|
|
152
|
+
limit: Math.min(readPositiveIntegerParam(params, "limit", { message: "limit must be a positive integer." }) ?? SLACK_CONVERSATION_LIST_DEFAULT_LIMIT, SLACK_CONVERSATION_LIST_MAX_LIMIT),
|
|
153
|
+
cursor: readStringParam(params, "pageToken")
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
function readSlackConversationListTypes(value) {
|
|
157
|
+
if (value === void 0) return SLACK_CONVERSATION_LIST_TYPES.filter((type) => type.endsWith("_channel"));
|
|
158
|
+
const requested = typeof value === "string" ? value.split(",") : value;
|
|
159
|
+
const known = new Set(SLACK_CONVERSATION_LIST_TYPES);
|
|
160
|
+
if (!Array.isArray(requested) || requested.length === 0 || requested.some((entry) => !known.has(typeof entry === "string" ? entry.trim() : entry))) throw new Error(`Slack channel-list types must be one or more of: ${SLACK_CONVERSATION_LIST_TYPES.join(", ")}.`);
|
|
161
|
+
return SLACK_CONVERSATION_LIST_TYPES.filter((type) => requested.some((entry) => typeof entry === "string" && entry.trim() === type));
|
|
162
|
+
}
|
|
163
|
+
// extensions/slack/src/action-channel-list.ts
|
|
164
|
+
/** One channel-list page, limited to conversations `read` would allow for this caller. */
|
|
165
|
+
async function listSlackReadableConversations(params) {
|
|
166
|
+
const { account, context } = params;
|
|
167
|
+
const membersOnly = !params.readToken || params.readToken !== account.userToken?.trim();
|
|
168
|
+
const teamId = await resolveSlackTokenPolicyTeamId({
|
|
169
|
+
account,
|
|
170
|
+
selectedToken: params.readToken,
|
|
171
|
+
requestedTeamId: params.requestedTeamId,
|
|
172
|
+
lookup: params.lookupWorkspace
|
|
173
|
+
});
|
|
174
|
+
const page = await params.listConversations(readSlackConversationListParams(params.params));
|
|
175
|
+
const requesterAccount = hasSlackRequesterAccount(account, context);
|
|
176
|
+
const channels = [];
|
|
177
|
+
for (const conversation of page.conversations) {
|
|
178
|
+
if (membersOnly && !conversation.isMember) continue;
|
|
179
|
+
const target = formatSlackTarget({
|
|
180
|
+
teamId: params.requestedTeamId,
|
|
181
|
+
kind: "channel",
|
|
182
|
+
id: conversation.id
|
|
183
|
+
});
|
|
184
|
+
if (await isSlackResolvedReadTargetAllowed({
|
|
185
|
+
account,
|
|
186
|
+
cfg: params.cfg,
|
|
187
|
+
channelId: conversation.id,
|
|
188
|
+
teamId,
|
|
189
|
+
conversationReadOrigin: context?.conversationReadOrigin,
|
|
190
|
+
info: {
|
|
191
|
+
type: conversation.type === "im" ? "dm" : conversation.type === "mpim" ? "group" : "channel",
|
|
192
|
+
name: conversation.name,
|
|
193
|
+
user: conversation.userId
|
|
194
|
+
},
|
|
195
|
+
currentConversation: Boolean(requesterAccount && context && slackContextTargetsMatch(target, context))
|
|
196
|
+
})) channels.push(conversation);
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
ok: true,
|
|
200
|
+
...teamId ? { teamId } : {},
|
|
201
|
+
channels,
|
|
202
|
+
...page.nextCursor ? { nextPageToken: page.nextCursor } : {}
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
// extensions/slack/src/action-runtime.ts
|
|
206
|
+
const messagingActions = /* @__PURE__ */ new Set([
|
|
207
|
+
"openConversation",
|
|
208
|
+
"sendMessage",
|
|
209
|
+
"uploadFile",
|
|
210
|
+
"editMessage",
|
|
211
|
+
"deleteMessage",
|
|
212
|
+
"readMessages",
|
|
213
|
+
"downloadFile"
|
|
214
|
+
]);
|
|
215
|
+
const reactionsActions = /* @__PURE__ */ new Set(["react", "reactions"]);
|
|
216
|
+
const pinActions = /* @__PURE__ */ new Set([
|
|
217
|
+
"pinMessage",
|
|
218
|
+
"unpinMessage",
|
|
219
|
+
"listPins"
|
|
220
|
+
]);
|
|
221
|
+
const SLACK_REACTION_RESULT_LIMIT = 100;
|
|
222
|
+
function readSlackResultLimit(params) {
|
|
223
|
+
return Math.min(readPositiveIntegerParam(params, "limit", { message: "limit must be a positive integer." }) ?? SLACK_REACTION_RESULT_LIMIT, SLACK_REACTION_RESULT_LIMIT);
|
|
224
|
+
}
|
|
225
|
+
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions-DAWAKRJ9.mjs").then((n) => n.t));
|
|
226
|
+
const bindSlackAction = createLazyRuntimeMethodBinder(loadSlackActionsRuntime);
|
|
227
|
+
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts-EaPP0fFY.mjs").then((n) => n.t));
|
|
228
|
+
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-Ku_QceM7.mjs").then((n) => n.t));
|
|
229
|
+
const bindSlackChannelType = createLazyRuntimeMethodBinder(loadSlackChannelTypeRuntime);
|
|
230
|
+
const slackActionRuntime = {
|
|
231
|
+
createSlackChannel: bindSlackAction((runtime) => runtime.createSlackChannel),
|
|
232
|
+
deleteSlackMessage: bindSlackAction((runtime) => runtime.deleteSlackMessage),
|
|
233
|
+
downloadSlackFile: bindSlackAction((runtime) => runtime.downloadSlackFile),
|
|
234
|
+
editSlackMessage: bindSlackAction((runtime) => runtime.editSlackMessage),
|
|
235
|
+
editSlackRenderedMessage: bindSlackAction((runtime) => runtime.editSlackRenderedMessage),
|
|
236
|
+
getSlackMemberInfo: bindSlackAction((runtime) => runtime.getSlackMemberInfo),
|
|
237
|
+
listSlackConversations: bindSlackAction((runtime) => runtime.listSlackConversations),
|
|
238
|
+
resolveSlackTokenWorkspace: bindSlackAction((runtime) => runtime.resolveSlackTokenWorkspace),
|
|
239
|
+
listSlackEmojis: bindSlackAction((runtime) => runtime.listSlackEmojis),
|
|
240
|
+
listSlackPins: bindSlackAction((runtime) => runtime.listSlackPins),
|
|
241
|
+
listSlackReactions: bindSlackAction((runtime) => runtime.listSlackReactions),
|
|
242
|
+
openSlackConversation: bindSlackAction((runtime) => runtime.openSlackConversation),
|
|
243
|
+
parseSlackBlocksInput,
|
|
244
|
+
pinSlackMessage: bindSlackAction((runtime) => runtime.pinSlackMessage),
|
|
245
|
+
reactSlackMessage: bindSlackAction((runtime) => runtime.reactSlackMessage),
|
|
246
|
+
readSlackMessages: bindSlackAction((runtime) => runtime.readSlackMessages),
|
|
247
|
+
removeOwnSlackReactions: bindSlackAction((runtime) => runtime.removeOwnSlackReactions),
|
|
248
|
+
removeSlackReaction: bindSlackAction((runtime) => runtime.removeSlackReaction),
|
|
249
|
+
resolveSlackConversationInfo: bindSlackChannelType((runtime) => runtime.resolveSlackConversationInfo),
|
|
250
|
+
sendSlackMessage: bindSlackAction((runtime) => runtime.sendSlackMessage),
|
|
251
|
+
unpinSlackMessage: bindSlackAction((runtime) => runtime.unpinSlackMessage)
|
|
252
|
+
};
|
|
253
|
+
function assertSlackMemberInfoAllowed(params) {
|
|
254
|
+
if (params.context?.conversationReadOrigin === "direct-operator") return;
|
|
255
|
+
const requesterSenderId = normalizeOptionalLowercaseString(params.context?.requesterSenderId);
|
|
256
|
+
if (!hasSlackRequesterAccount(params.account, params.context) || !requesterSenderId || requesterSenderId !== normalizeOptionalLowercaseString(params.userId)) throw new Error("Delegated Slack member info is limited to the current requester.");
|
|
257
|
+
}
|
|
137
258
|
async function assertSlackReadTargetAllowed(params) {
|
|
259
|
+
const policy = {
|
|
260
|
+
...params,
|
|
261
|
+
teamId: params.policyTeamId ?? params.teamId
|
|
262
|
+
};
|
|
138
263
|
const deny = () => {
|
|
139
264
|
throw new Error("Slack read target channel is not allowed.");
|
|
140
265
|
};
|
|
@@ -154,6 +279,7 @@ async function assertSlackReadTargetAllowed(params) {
|
|
|
154
279
|
channelId: params.channelId,
|
|
155
280
|
teamId: params.teamId,
|
|
156
281
|
operation: "read",
|
|
282
|
+
...params.token ? { token: params.token } : {},
|
|
157
283
|
assertDirectAdapterHandoff: params.context?.assertDirectAdapterHandoff
|
|
158
284
|
});
|
|
159
285
|
if (info.type !== "dm" || !await isSlackDmTargetConfigured({
|
|
@@ -163,7 +289,7 @@ async function assertSlackReadTargetAllowed(params) {
|
|
|
163
289
|
return;
|
|
164
290
|
}
|
|
165
291
|
const preliminary = resolveSlackChannelReadPolicy({
|
|
166
|
-
...
|
|
292
|
+
...policy,
|
|
167
293
|
currentConversation
|
|
168
294
|
});
|
|
169
295
|
if (preliminary.channelExplicitlyDisabled) deny();
|
|
@@ -177,35 +303,16 @@ async function assertSlackReadTargetAllowed(params) {
|
|
|
177
303
|
channelId: params.channelId,
|
|
178
304
|
teamId: params.teamId,
|
|
179
305
|
operation: "read",
|
|
306
|
+
...params.token ? { token: params.token } : {},
|
|
180
307
|
...preliminary.shouldResolveName ? { requireFreshName: true } : {},
|
|
181
308
|
assertDirectAdapterHandoff: params.context?.assertDirectAdapterHandoff
|
|
182
309
|
});
|
|
183
310
|
if (preliminary.shouldResolveName && (info.type === "channel" || info.type === "unknown") && !info.name) deny();
|
|
184
|
-
|
|
185
|
-
...
|
|
186
|
-
|
|
187
|
-
metadataResolved: true,
|
|
311
|
+
if (!await isSlackResolvedReadTargetAllowed({
|
|
312
|
+
...policy,
|
|
313
|
+
info,
|
|
188
314
|
currentConversation
|
|
189
|
-
});
|
|
190
|
-
if (resolved.channelExplicitlyDisabled) deny();
|
|
191
|
-
if (info.type === "dm") {
|
|
192
|
-
if (!resolveSlackDmReadAllowed(params.account) || !directOperator && !currentConversation && !await isSlackDmTargetConfigured({
|
|
193
|
-
...params,
|
|
194
|
-
userId: info.user
|
|
195
|
-
})) deny();
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
if (!(info.type === "channel" ? resolved.channelAllowed : info.type === "group" ? resolved.groupDmAllowed : resolved.channelAllowed && resolved.groupDmAllowed)) deny();
|
|
199
|
-
}
|
|
200
|
-
function isSlackGroupDmTargetConfigured(account, channelId, teamId) {
|
|
201
|
-
const entries = account.config.dm?.groupChannels ?? [];
|
|
202
|
-
if (entries.length === 0) return true;
|
|
203
|
-
const candidates = new Set(buildSlackChannelIdCandidates(channelId, teamId, { allowUnscoped: getSlackInstallationKind(account.accountId) !== "enterprise" }).map((candidate) => candidate.toLowerCase()));
|
|
204
|
-
const target = channelId.trim().toLowerCase();
|
|
205
|
-
return entries.some((entry) => {
|
|
206
|
-
const candidate = String(entry).trim().toLowerCase();
|
|
207
|
-
return candidate === "*" || candidates.has(candidate) || candidate === target || candidate === `slack:${target}` || candidate === `channel:${target}` || candidate === `group:${target}` || candidate === `mpim:${target}`;
|
|
208
|
-
});
|
|
315
|
+
})) deny();
|
|
209
316
|
}
|
|
210
317
|
function resolveTrustedCurrentSlackTeamId(params) {
|
|
211
318
|
if (!hasSlackRequesterAccount(params.account, params.context)) return;
|
|
@@ -255,8 +362,8 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
255
362
|
const isActionEnabled = createActionGate(actionConfig);
|
|
256
363
|
const botToken = account.botToken?.trim();
|
|
257
364
|
if (action === "createChannel" && !isActionEnabled("channels", false)) throw new Error("Slack channel creation is disabled.");
|
|
258
|
-
const buildActionOpts = (operation, teamId) => {
|
|
259
|
-
const token = resolveSlackOperationToken(account, operation);
|
|
365
|
+
const buildActionOpts = (operation, teamId, readToken) => {
|
|
366
|
+
const token = readToken ?? resolveSlackOperationToken(account, operation);
|
|
260
367
|
if (!token && account.identity === "user") throw new Error(`Slack operation token missing for account "${account.accountId}".`);
|
|
261
368
|
const tokenOverride = token && token !== botToken ? token : void 0;
|
|
262
369
|
return {
|
|
@@ -267,14 +374,16 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
267
374
|
assertDirectAdapterHandoff: context?.assertDirectAdapterHandoff
|
|
268
375
|
};
|
|
269
376
|
};
|
|
270
|
-
const assertReadTargetAllowed = async (target) => {
|
|
377
|
+
const assertReadTargetAllowed = async (target, token) => {
|
|
271
378
|
await assertSlackReadTargetAllowed({
|
|
272
379
|
account,
|
|
273
380
|
cfg,
|
|
274
381
|
channelId: target.channelId,
|
|
275
382
|
teamId: target.teamId,
|
|
383
|
+
policyTeamId: target.policyTeamId,
|
|
276
384
|
conversationReadOrigin: context?.conversationReadOrigin,
|
|
277
|
-
context
|
|
385
|
+
context,
|
|
386
|
+
token
|
|
278
387
|
});
|
|
279
388
|
};
|
|
280
389
|
if (action === "createChannel") {
|
|
@@ -477,8 +586,18 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
477
586
|
case "readMessages": {
|
|
478
587
|
const target = resolveChannelTarget();
|
|
479
588
|
const { channelId } = target;
|
|
480
|
-
|
|
481
|
-
const
|
|
589
|
+
const readToken = resolveSlackReadAsToken(account, params);
|
|
590
|
+
const policyTeamId = await resolveSlackReadPolicyTeamId({
|
|
591
|
+
account,
|
|
592
|
+
targetTeamId: target.teamId,
|
|
593
|
+
selectedToken: readToken ?? resolveSlackOperationToken(account, "read"),
|
|
594
|
+
lookup: () => slackActionRuntime.resolveSlackTokenWorkspace(buildActionOpts("read", void 0, readToken))
|
|
595
|
+
});
|
|
596
|
+
await assertReadTargetAllowed({
|
|
597
|
+
...target,
|
|
598
|
+
policyTeamId
|
|
599
|
+
}, readToken);
|
|
600
|
+
const readOpts = buildActionOpts("read", target.teamId, readToken);
|
|
482
601
|
const limit = readPositiveIntegerParam(params, "limit", { message: "limit must be a positive integer." });
|
|
483
602
|
const before = readStringParam(params, "before");
|
|
484
603
|
const after = readStringParam(params, "after");
|
|
@@ -613,6 +732,30 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
613
732
|
emojis
|
|
614
733
|
});
|
|
615
734
|
}
|
|
735
|
+
if (action === "channelList") {
|
|
736
|
+
if (!isActionEnabled("channelInfo")) throw new Error("Slack channel list is disabled.");
|
|
737
|
+
const requestedTeamId = readStringParam(params, "teamId") ?? resolveTrustedCurrentSlackTeamId({
|
|
738
|
+
account,
|
|
739
|
+
context
|
|
740
|
+
});
|
|
741
|
+
assertSlackDetachedTargetAllowed(account.accountId, requestedTeamId);
|
|
742
|
+
const readAsToken = resolveSlackReadAsToken(account, params);
|
|
743
|
+
const readToken = readAsToken ?? resolveSlackOperationToken(account, "read");
|
|
744
|
+
const listOpts = buildActionOpts("read", requestedTeamId, readAsToken);
|
|
745
|
+
return jsonResult(await listSlackReadableConversations({
|
|
746
|
+
account,
|
|
747
|
+
cfg,
|
|
748
|
+
params,
|
|
749
|
+
context,
|
|
750
|
+
readToken,
|
|
751
|
+
requestedTeamId,
|
|
752
|
+
listConversations: (options) => slackActionRuntime.listSlackConversations({
|
|
753
|
+
...listOpts,
|
|
754
|
+
...options
|
|
755
|
+
}),
|
|
756
|
+
lookupWorkspace: () => slackActionRuntime.resolveSlackTokenWorkspace(listOpts)
|
|
757
|
+
}));
|
|
758
|
+
}
|
|
616
759
|
throw new Error(`Unknown action: ${action}`);
|
|
617
760
|
}
|
|
618
761
|
export { slackActionRuntime as n, handleSlackAction as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as handleSlackAction } from "./action-runtime-BvoZDGSu.mjs";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
2
|
import { g as resolveSlackBotToken, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-EaPP0fFY.mjs";
|
|
3
3
|
import { n as formatSlackTarget } from "./target-parsing-DwYAP3ts.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { $ as buildSlackBlocksFallbackText, E as countSlackTextUtf8Bytes, O as truncateSlackTextByUtf8Bytes, Q as appendSlackNativeDataPlainTextFallback, T as assertSlackDetachedTargetAllowed, Tt as escapeSlackMrkdwn, Y as validateSlackBlocksArray, Z as appendSlackNativeDataFallbackText, et as buildSlackCompleteBlocksFallbackText, h as enrichSlackWebApiError, it as renderSlackBlockFallbackText, ot as stripSlackNativeDataBlocks, rn as SLACK_PRIVATE_ACTION_DELIVERY_RESULT, rt as hasSlackNativeDataBlock, vt as SLACK_EDIT_TEXT_MAX_BYTES, wt as normalizeSlackOutboundText } from "./probe-ME1HsC0x.mjs";
|
|
5
|
+
import { r as fetchSlackChannelListPage } from "./cursor-pages-DiOrzZtc.mjs";
|
|
6
|
+
import { c as getSlackWriteClient, o as createSlackWriteClient, t as createSlackLookupClient } from "./client-DQqLIemQ.mjs";
|
|
7
|
+
import { _ as isSlackInvalidBlocksError, h as buildSlackNativeDataDeliveryPlan, t as sendMessageSlack } from "./send-CNGjlL3z.mjs";
|
|
7
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
8
9
|
import { asOptionalObjectRecord, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
10
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
@@ -20,6 +21,48 @@ import { normalizeHostname } from "openclaw/plugin-sdk/host-runtime";
|
|
|
20
21
|
import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url";
|
|
21
22
|
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
22
23
|
import { saveRemoteMedia, unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
|
|
24
|
+
// extensions/slack/src/conversation-list.ts
|
|
25
|
+
async function resolveSlackTokenWorkspaceWithClient(client) {
|
|
26
|
+
const auth = await client.auth.test();
|
|
27
|
+
const teamId = normalizeOptionalString(auth.team_id);
|
|
28
|
+
return {
|
|
29
|
+
...teamId ? { teamId } : {},
|
|
30
|
+
enterpriseInstall: auth.is_enterprise_install === true
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
async function listSlackConversationsWithClient(client, opts) {
|
|
34
|
+
const result = await fetchSlackChannelListPage(client, opts.cursor, {
|
|
35
|
+
types: opts.types.join(","),
|
|
36
|
+
excludeArchived: !opts.includeArchived,
|
|
37
|
+
limit: opts.limit
|
|
38
|
+
}).catch((err) => {
|
|
39
|
+
throw enrichSlackWebApiError(err);
|
|
40
|
+
});
|
|
41
|
+
const conversations = (result.channels ?? []).flatMap((channel) => {
|
|
42
|
+
const id = normalizeOptionalString(channel.id);
|
|
43
|
+
if (!id) return [];
|
|
44
|
+
const name = normalizeOptionalString(channel.name);
|
|
45
|
+
const userId = normalizeOptionalString(channel.user);
|
|
46
|
+
const topic = normalizeOptionalString(channel.topic?.value);
|
|
47
|
+
const purpose = normalizeOptionalString(channel.purpose?.value);
|
|
48
|
+
const type = channel.is_im ? "im" : channel.is_mpim ? "mpim" : channel.is_private || channel.is_group ? "private_channel" : "public_channel";
|
|
49
|
+
return [{
|
|
50
|
+
id,
|
|
51
|
+
...name ? { name } : {},
|
|
52
|
+
type,
|
|
53
|
+
isMember: type === "im" || type === "mpim" || channel.is_member === true,
|
|
54
|
+
isArchived: channel.is_archived === true,
|
|
55
|
+
...userId ? { userId } : {},
|
|
56
|
+
...topic ? { topic } : {},
|
|
57
|
+
...purpose ? { purpose } : {}
|
|
58
|
+
}];
|
|
59
|
+
});
|
|
60
|
+
const nextCursor = normalizeOptionalString(result.response_metadata?.next_cursor);
|
|
61
|
+
return {
|
|
62
|
+
conversations,
|
|
63
|
+
...nextCursor ? { nextCursor } : {}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
23
66
|
// extensions/slack/src/conversation-open.ts
|
|
24
67
|
const slackTeamIdSchema = z.string().trim().regex(/^T[A-Z0-9]+$/i).optional();
|
|
25
68
|
function parseSlackConversationOpenInput(userIds, teamId) {
|
|
@@ -483,6 +526,7 @@ var actions_exports = /* @__PURE__ */ __exportAll({
|
|
|
483
526
|
editSlackMessage: () => editSlackMessage,
|
|
484
527
|
editSlackRenderedMessage: () => editSlackRenderedMessage,
|
|
485
528
|
getSlackMemberInfo: () => getSlackMemberInfo,
|
|
529
|
+
listSlackConversations: () => listSlackConversations,
|
|
486
530
|
listSlackEmojis: () => listSlackEmojis,
|
|
487
531
|
listSlackPins: () => listSlackPins,
|
|
488
532
|
listSlackReactions: () => listSlackReactions,
|
|
@@ -493,6 +537,7 @@ var actions_exports = /* @__PURE__ */ __exportAll({
|
|
|
493
537
|
readSlackMessages: () => readSlackMessages,
|
|
494
538
|
removeOwnSlackReactions: () => removeOwnSlackReactions,
|
|
495
539
|
removeSlackReaction: () => removeSlackReaction,
|
|
540
|
+
resolveSlackTokenWorkspace: () => resolveSlackTokenWorkspace,
|
|
496
541
|
sendSlackMessage: () => sendSlackMessage,
|
|
497
542
|
unpinSlackMessage: () => unpinSlackMessage
|
|
498
543
|
});
|
|
@@ -786,6 +831,11 @@ async function readSlackMessages(channelId, opts = {}) {
|
|
|
786
831
|
hasMore: exactMessageId ? false : Boolean(result.has_more)
|
|
787
832
|
};
|
|
788
833
|
}
|
|
834
|
+
async function listSlackConversations(opts) {
|
|
835
|
+
slackTeamIdSchema.parse(opts.teamId);
|
|
836
|
+
return await listSlackConversationsWithClient(await getClient(opts), opts);
|
|
837
|
+
}
|
|
838
|
+
const resolveSlackTokenWorkspace = async (opts = {}) => await resolveSlackTokenWorkspaceWithClient(await getClient(opts));
|
|
789
839
|
async function getSlackMemberInfo(userId, opts = {}) {
|
|
790
840
|
return await (await getClient(opts)).users.info({ user: userId });
|
|
791
841
|
}
|
package/dist/.setup/{approval-handler.runtime-C2C-jNxi.mjs → approval-handler.runtime-BIePVIYr.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as parseSlackTarget } from "./target-parsing-DwYAP3ts.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { o as resolveSlackReplyBlocks } from "./reply-blocks-
|
|
4
|
-
import {
|
|
5
|
-
import { t as sendMessageSlack } from "./send-
|
|
6
|
-
import { n as runSlackApprovalMessageUpdate } from "./approval-message-updates-
|
|
2
|
+
import { $t as normalizeSlackApproverId, D as truncateSlackText, Et as isSlackAnyNativeApprovalClientEnabled, O as truncateSlackTextByUtf8Bytes, Pt as shouldHandleSlackNativeApprovalRequest, W as SLACK_APPROVAL_HEADER_BLOCK_ID, i as setSlackSessionStatus, vt as SLACK_EDIT_TEXT_MAX_BYTES } from "./probe-ME1HsC0x.mjs";
|
|
3
|
+
import { o as resolveSlackReplyBlocks } from "./reply-blocks-BXQwrMaA.mjs";
|
|
4
|
+
import { s as getSlackListenerWriteClient } from "./client-DQqLIemQ.mjs";
|
|
5
|
+
import { t as sendMessageSlack } from "./send-CNGjlL3z.mjs";
|
|
6
|
+
import { n as runSlackApprovalMessageUpdate } from "./approval-message-updates-DocYhToX.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
9
9
|
import { buildApprovalPresentationFromActionDescriptors } from "openclaw/plugin-sdk/approval-reply-runtime";
|
package/dist/.setup/{approval-message-updates-Bx2u_5-z.mjs → approval-message-updates-DocYhToX.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as decodeSlackApprovalAction, I as isSlackApprovalActionId } from "./probe-ME1HsC0x.mjs";
|
|
2
2
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
4
4
|
// extensions/slack/src/approval-message-updates.ts
|
|
@@ -3,14 +3,15 @@ import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, d as r
|
|
|
3
3
|
import { t as inspectSlackAccount } from "./account-inspect-DgQgj0wk.mjs";
|
|
4
4
|
import { a as parseSlackTarget, i as normalizeSlackMessagingTarget, n as formatSlackTarget, o as resolveSlackChannelId, r as looksLikeSlackTargetId, t as canonicalizeSlackApiTargetId } from "./target-parsing-DwYAP3ts.mjs";
|
|
5
5
|
import { t as slackContextTargetsMatch } from "./targets-eeOxA_b_.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { At as resolveSessionSlackOriginTarget, Dt as isSlackPluginApprovalRequest, E as countSlackTextUtf8Bytes, Et as isSlackAnyNativeApprovalClientEnabled, Ft as shouldHandleSlackPluginViaForwardingSession, It as slackTargetsMatch, Lt as getSlackApprovalApproversForTeam, Mt as resolveSlackFallbackOriginTarget, Nt as resolveTurnSourceSlackOriginTarget, Ot as normalizeSlackForwardTarget, Pt as shouldHandleSlackNativeApprovalRequest, Qt as isSlackExecApprovalClientEnabled, Rt as isSlackPluginApprovalAuthorizedSender, S as resolveSlackConversationBindingRoute, T as assertSlackDetachedTargetAllowed, Xt as getSlackExecApprovalApprovers, Zt as isSlackExecApprovalAuthorizedSender, _t as renderSlackMessagePresentationFallbackText, c as slackIngressIdentity, en as resolveSlackExecApprovalTarget, f as resolveSlackGroupRequireMention, g as formatSlackError, i as setSlackSessionStatus, in as resolveSlackAutoThreadId, jt as resolveSlackApproverDmTargets, kt as normalizeSlackOriginTarget, mt as SLACK_PRESENTATION_CAPABILITIES, nn as resolvePluginApprovalSlackApprovers, p as resolveSlackGroupToolPolicy, qt as getSlackInstallationKind, s as normalizeSlackStableEntry, t as probeSlack, tn as shouldSuppressLocalSlackExecApprovalPrompt, v as qualifySlackConversationId, vt as SLACK_EDIT_TEXT_MAX_BYTES, w as slackConversationBindings, wt as normalizeSlackOutboundText, x as normalizeSlackRouteBindingConfig, xt as SLACK_TEXT_LIMIT, y as qualifySlackRoutePeerId, zt as resolveSlackApprovalTeamId } from "./probe-ME1HsC0x.mjs";
|
|
7
7
|
import { n as resolveSlackReplyThreadTs, r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-47Au2-Yn.mjs";
|
|
8
|
-
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-CTxYxzPZ.mjs";
|
|
9
|
+
import { n as collectSlackCursorPages } from "./cursor-pages-DiOrzZtc.mjs";
|
|
10
|
+
import { a as resolveSlackReplyBlockResolution, o as resolveSlackReplyBlocks, r as normalizeSlackReplyPayload, s as resolveSlackReplyDeliveryMessages } from "./reply-blocks-BXQwrMaA.mjs";
|
|
11
|
+
import { c as getSlackWriteClient, t as createSlackLookupClient } from "./client-DQqLIemQ.mjs";
|
|
12
|
+
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-Ku_QceM7.mjs";
|
|
12
13
|
import { n as SLACK_CHANNEL_META } from "./channel-meta-C5vsCo3a.mjs";
|
|
13
|
-
import { i as SLACK_CHANNEL, r as slackBaseConfigAdapter, t as slackSetupPlugin } from "./channel.setup-
|
|
14
|
+
import { i as SLACK_CHANNEL, r as slackBaseConfigAdapter, t as slackSetupPlugin } from "./channel.setup-BW3ogoi5.mjs";
|
|
14
15
|
import { n as normalizeCompatibilityConfig, r as runtime_doctor_migrations_exports, t as legacyConfigRules } from "./doctor-contract-BB2KJ9Ni.mjs";
|
|
15
16
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-CqVqR7MP.mjs";
|
|
16
17
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
@@ -103,7 +104,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
103
104
|
],
|
|
104
105
|
isConfigured: isSlackAnyNativeApprovalClientEnabled,
|
|
105
106
|
shouldHandle: shouldHandleSlackNativeApprovalRequest,
|
|
106
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
107
|
+
load: async () => (await import("./approval-handler.runtime-BIePVIYr.mjs")).slackApprovalNativeRuntime
|
|
107
108
|
})
|
|
108
109
|
});
|
|
109
110
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.nativeAsync;
|
|
@@ -213,7 +214,7 @@ const SLACK_TOOL_DELIVERY_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
213
214
|
"unpinMessage",
|
|
214
215
|
"uploadFile"
|
|
215
216
|
]);
|
|
216
|
-
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
217
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-BwRLINj-.mjs"));
|
|
217
218
|
function resolveSlackActionContext(ctx, toolContext) {
|
|
218
219
|
if (!toolContext && !ctx.mediaAccess && !ctx.mediaLocalRoots && !ctx.mediaReadFile && !ctx.conversationReadOrigin && !ctx.requesterAccountId && !ctx.requesterSenderId && !ctx.assertDirectAdapterHandoff) return;
|
|
219
220
|
return {
|
|
@@ -236,6 +237,7 @@ function createSlackActions(providerId, options) {
|
|
|
236
237
|
"list-pins",
|
|
237
238
|
"member-info",
|
|
238
239
|
"emoji-list",
|
|
240
|
+
"channel-list",
|
|
239
241
|
"download-file"
|
|
240
242
|
],
|
|
241
243
|
describeMessageTool: describeSlackMessageTool,
|
|
@@ -361,7 +363,8 @@ function createSlackActions(providerId, options) {
|
|
|
361
363
|
before: readStringParam$1(actionParams, "before"),
|
|
362
364
|
after: readStringParam$1(actionParams, "after"),
|
|
363
365
|
messageId: readStringParam$1(actionParams, "messageId"),
|
|
364
|
-
threadId: readStringParam$1(actionParams, "threadId")
|
|
366
|
+
threadId: readStringParam$1(actionParams, "threadId"),
|
|
367
|
+
readAs: readStringParam$1(actionParams, "readAs")
|
|
365
368
|
});
|
|
366
369
|
if (action === "edit") {
|
|
367
370
|
const messageId = readStringParam$1(actionParams, "messageId", { required: true });
|
|
@@ -393,6 +396,15 @@ function createSlackActions(providerId, options) {
|
|
|
393
396
|
userId
|
|
394
397
|
});
|
|
395
398
|
}
|
|
399
|
+
if (action === "channel-list") return await invokeSlackAction({
|
|
400
|
+
action: "channelList",
|
|
401
|
+
types: actionParams.types,
|
|
402
|
+
limit: actionParams.limit,
|
|
403
|
+
pageToken: readStringParam$1(actionParams, "pageToken"),
|
|
404
|
+
includeArchived: readBooleanParam(actionParams, "includeArchived"),
|
|
405
|
+
teamId: readStringParam$1(actionParams, "teamId"),
|
|
406
|
+
readAs: readStringParam$1(actionParams, "readAs")
|
|
407
|
+
});
|
|
396
408
|
if (action === "emoji-list") return await invokeSlackAction({
|
|
397
409
|
action: "emojiList",
|
|
398
410
|
limit: readPositiveIntegerParam$1(actionParams, "limit", { message: "limit must be a positive integer." })
|
|
@@ -878,16 +890,16 @@ function buildSlackThreadingToolContext(params) {
|
|
|
878
890
|
// extensions/slack/src/channel.ts
|
|
879
891
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/extension-shared"));
|
|
880
892
|
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/target-resolver-runtime"));
|
|
881
|
-
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-
|
|
882
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-
|
|
893
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-Dbu5pO1O.mjs"));
|
|
894
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-lDejfL01.mjs"));
|
|
883
895
|
const bindSlackOutbound = createLazyRuntimeMethodBinder(loadSlackOutboundAdapterModule);
|
|
884
896
|
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-CGvKYg9F.mjs").then((n) => n.t));
|
|
885
|
-
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
886
|
-
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
887
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
888
|
-
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
889
|
-
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
890
|
-
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
897
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-CtkJuB1X.mjs").then((n) => n.n));
|
|
898
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-Bqf-wJF9.mjs").then((n) => n.n));
|
|
899
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-CNGjlL3z.mjs").then((n) => n.n));
|
|
900
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-ME1HsC0x.mjs").then((n) => n.n));
|
|
901
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-CkoNScT9.mjs").then((n) => n.t));
|
|
902
|
+
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-CJl5MPac.mjs").then((n) => n.t));
|
|
891
903
|
async function setSlackHeartbeatThreadStatus(params) {
|
|
892
904
|
const threadTs = resolveSlackThreadTsValue({ threadId: params.threadId });
|
|
893
905
|
const target = parseSlackTarget(params.to, { defaultKind: "channel" });
|