@openclaw/slack 2026.12.2 → 2026.12.6-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-zVonj7Ub.mjs → action-runtime-B2JYA0KK.mjs} +30 -39
- package/dist/.setup/action-runtime.runtime-DhTK_A6l.mjs +1 -0
- package/dist/.setup/{actions-0x2TsQH6.mjs → actions-cVgdS6sU.mjs} +147 -22
- package/dist/.setup/{approval-handler.runtime-BBYoz7El.mjs → approval-handler.runtime-DDn3L7Gd.mjs} +5 -5
- package/dist/.setup/{approval-message-updates-BrGg-eis.mjs → approval-message-updates-CnjKG4If.mjs} +1 -1
- package/dist/.setup/{channel-C6-Cp-Fz.mjs → channel-BWLl8hAf.mjs} +24 -28
- package/dist/.setup/{channel-type-BQCZqcgg.mjs → channel-type-CNYPuhN7.mjs} +1 -1
- package/dist/.setup/{channel.setup-Dzt1s8XR.mjs → channel.setup-C0NEy9hG.mjs} +1 -1
- package/dist/.setup/{directory-config-CWeEzb_Y.mjs → directory-config-CFrpmf6d.mjs} +2 -2
- package/dist/.setup/{fork-CiiHD26T.mjs → fork-CyGNd27b.mjs} +3 -3
- package/dist/.setup/{literal-text-DXy7nGRR.mjs → literal-text-D5exd3B9.mjs} +1 -1
- package/dist/.setup/{monitor-D5erEc0i.mjs → monitor-dVQQ8XII.mjs} +264 -150
- package/dist/.setup/{outbound-adapter-BmJCT3Qj.mjs → outbound-adapter-CIJgw3fk.mjs} +6 -6
- package/dist/.setup/{pipeline.runtime-C51V3mhq.mjs → pipeline.runtime-Bet_aK1D.mjs} +53 -37
- package/dist/.setup/{policy-l2IjJV43.mjs → policy-Bo-JJQ2c.mjs} +1 -1
- package/dist/.setup/{probe-DKu67cjh.mjs → probe-DhQ6LeKX.mjs} +70 -12
- package/dist/.setup/{question-delivery-BRQza6lN.mjs → question-delivery-D-WigwxO.mjs} +1 -1
- package/dist/.setup/{relay-source-D2WA09C-.mjs → relay-source-BWKpwdJT.mjs} +2 -2
- package/dist/.setup/{replies-kwdtXt3e.mjs → replies-BFqakO6L.mjs} +6 -6
- package/dist/.setup/{reply-blocks-Cf8e9Sau.mjs → reply-blocks-BsJPukUN.mjs} +28 -6
- package/dist/.setup/{resolve-channels-BoQiIEny.mjs → resolve-channels-Cl7l3BLf.mjs} +1 -1
- package/dist/.setup/{resolve-users-PpJHZiBC.mjs → resolve-users-mep8kUHy.mjs} +1 -1
- package/dist/.setup/{scopes-bvZxH5i3.mjs → scopes-CnMdp9Pj.mjs} +1 -1
- package/dist/.setup/{send-DJpeS70B.mjs → send-kbYZlK6B.mjs} +133 -145
- package/dist/.setup/send-results-DVKN1Zix.mjs +77 -0
- package/dist/.setup/setup-plugin-api-TYFn_irv.mjs +2 -0
- package/dist/.setup/{setup-surface-BqdskNYS.mjs → setup-surface-D8hoExQs.mjs} +3 -3
- package/dist/.setup/slash-dispatch.runtime--T5PbqoB.mjs +7 -0
- package/dist/.setup/{target-parsing-DwYAP3ts.mjs → target-parsing-DaLcdOoQ.mjs} +10 -1
- package/dist/.setup/{targets-eeOxA_b_.mjs → targets-DaKqo4kn.mjs} +1 -1
- package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -1
- package/dist/api.js +10 -10
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/runtime-api.js +7 -7
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/package.json +4 -4
- package/dist/.setup/action-runtime.runtime-YBV3dNF-.mjs +0 -1
- package/dist/.setup/send-results-Bm6V1ekL.mjs +0 -21
- package/dist/.setup/setup-plugin-api-DPOqeRW0.mjs +0 -2
- package/dist/.setup/slash-dispatch.runtime-CMQgSmJc.mjs +0 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as parseSlackTarget, n as formatSlackTarget, o as resolveSlackChannelId } from "./target-parsing-
|
|
2
|
-
import { t as slackContextTargetsMatch } from "./targets-
|
|
3
|
-
import {
|
|
1
|
+
import { a as parseSlackTarget, n as formatSlackTarget, o as resolveSlackChannelId } from "./target-parsing-DaLcdOoQ.mjs";
|
|
2
|
+
import { t as slackContextTargetsMatch } from "./targets-DaKqo4kn.mjs";
|
|
3
|
+
import { D as assertSlackDetachedTargetAllowed, X as parseSlackBlocksInput, Xt as getSlackInstallationKind, Zt as getSlackInstallationTeamId, at as hasSlackNativeDataBlock, cn as resolveSlackThreadTsFromContext, d as hasPotentialSlackNamedPolicy, h as resolveSlackBoundChannelEntries, l as buildSlackChannelIdCandidates, on as SLACK_PRIVATE_ACTION_DELIVERY_RESULT } from "./probe-DhQ6LeKX.mjs";
|
|
4
4
|
import { t as SLACK_CONVERSATION_LIST_TYPES } from "./cursor-pages-DiOrzZtc.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { t as
|
|
5
|
+
import { a as slackPostMutationResult, i as slackActionSendResult } from "./send-results-DVKN1Zix.mjs";
|
|
6
|
+
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-Bo-JJQ2c.mjs";
|
|
7
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
8
8
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { createLazyRuntimeMethodBinder, createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -42,7 +42,7 @@ function hasSlackRequesterAccount(account, context) {
|
|
|
42
42
|
return Boolean(normalizeOptionalLowercaseString(context?.currentChannelProvider) === "slack" && requesterAccountId && normalizeAccountId(requesterAccountId) === normalizeAccountId(account.accountId));
|
|
43
43
|
}
|
|
44
44
|
function resolveSlackChannelReadPolicy(params) {
|
|
45
|
-
const channels = params.account.config.channels;
|
|
45
|
+
const channels = resolveSlackBoundChannelEntries(params.account.accountId, params.account.config.channels);
|
|
46
46
|
const channelKeys = Object.keys(channels ?? {});
|
|
47
47
|
const channelConfig = resolveSlackChannelConfig({
|
|
48
48
|
teamId: params.teamId,
|
|
@@ -222,17 +222,16 @@ const SLACK_REACTION_RESULT_LIMIT = 100;
|
|
|
222
222
|
function readSlackResultLimit(params) {
|
|
223
223
|
return Math.min(readPositiveIntegerParam(params, "limit", { message: "limit must be a positive integer." }) ?? SLACK_REACTION_RESULT_LIMIT, SLACK_REACTION_RESULT_LIMIT);
|
|
224
224
|
}
|
|
225
|
-
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions-
|
|
225
|
+
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions-cVgdS6sU.mjs").then((n) => n.t));
|
|
226
226
|
const bindSlackAction = createLazyRuntimeMethodBinder(loadSlackActionsRuntime);
|
|
227
227
|
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts-Dsl3wabY.mjs").then((n) => n.t));
|
|
228
|
-
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-
|
|
228
|
+
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-CNYPuhN7.mjs").then((n) => n.t));
|
|
229
229
|
const bindSlackChannelType = createLazyRuntimeMethodBinder(loadSlackChannelTypeRuntime);
|
|
230
230
|
const slackActionRuntime = {
|
|
231
231
|
createSlackChannel: bindSlackAction((runtime) => runtime.createSlackChannel),
|
|
232
232
|
deleteSlackMessage: bindSlackAction((runtime) => runtime.deleteSlackMessage),
|
|
233
233
|
downloadSlackFile: bindSlackAction((runtime) => runtime.downloadSlackFile),
|
|
234
|
-
|
|
235
|
-
editSlackRenderedMessage: bindSlackAction((runtime) => runtime.editSlackRenderedMessage),
|
|
234
|
+
applySlackMessageEdit: bindSlackAction((runtime) => runtime.applySlackMessageEdit),
|
|
236
235
|
getSlackMemberInfo: bindSlackAction((runtime) => runtime.getSlackMemberInfo),
|
|
237
236
|
listSlackConversations: bindSlackAction((runtime) => runtime.listSlackConversations),
|
|
238
237
|
resolveSlackTokenWorkspace: bindSlackAction((runtime) => runtime.resolveSlackTokenWorkspace),
|
|
@@ -532,10 +531,7 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
532
531
|
mediaUrl,
|
|
533
532
|
blocks
|
|
534
533
|
});
|
|
535
|
-
return
|
|
536
|
-
ok: true,
|
|
537
|
-
result: mergeSlackSendResults(sentResults)
|
|
538
|
-
});
|
|
534
|
+
return slackActionSendResult(sentResults);
|
|
539
535
|
}
|
|
540
536
|
case "uploadFile": {
|
|
541
537
|
const destination = resolveSlackActionTarget(account, readStringParam(params, "to", { required: true }), context).routingTarget;
|
|
@@ -548,40 +544,34 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
548
544
|
const title = readStringParam(params, "title");
|
|
549
545
|
const forceDocument = readBooleanParam(params, "forceDocument") === true;
|
|
550
546
|
if (readBooleanParam(params, "replyBroadcast")) throw new Error("Slack replyBroadcast is only supported for text or block thread replies.");
|
|
551
|
-
|
|
547
|
+
await sendSlackMessage(destination, initialComment ?? "", {
|
|
552
548
|
...buildSendOpts(destination, forceDocument),
|
|
553
549
|
mediaUrl: filePath,
|
|
554
550
|
...filename ? { uploadFileName: filename } : {},
|
|
555
551
|
...title ? { uploadTitle: title } : {}
|
|
556
552
|
});
|
|
557
|
-
return
|
|
558
|
-
ok: true,
|
|
559
|
-
result
|
|
560
|
-
});
|
|
553
|
+
return slackActionSendResult(sentResults);
|
|
561
554
|
}
|
|
562
|
-
case "editMessage":
|
|
555
|
+
case "editMessage":
|
|
556
|
+
case "deleteMessage": {
|
|
563
557
|
const target = resolveChannelTarget();
|
|
564
|
-
const { channelId } = target;
|
|
558
|
+
const { channelId, teamId } = target;
|
|
565
559
|
const messageId = readStringParam(params, "messageId", { required: true });
|
|
560
|
+
if (action === "deleteMessage") {
|
|
561
|
+
await assertReadTargetAllowed(target);
|
|
562
|
+
await slackActionRuntime.deleteSlackMessage(channelId, messageId, buildActionOpts("write", teamId));
|
|
563
|
+
return slackPostMutationResult(target, account.accountId, messageId);
|
|
564
|
+
}
|
|
566
565
|
const content = readStringParam(params, "content", { allowEmpty: true });
|
|
567
566
|
const blocks = slackActionRuntime.parseSlackBlocksInput(params.blocks);
|
|
568
567
|
if (!content && !blocks) throw new Error("Slack editMessage requires content or blocks.");
|
|
569
568
|
await assertReadTargetAllowed(target);
|
|
570
|
-
const
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
569
|
+
const text = await slackActionRuntime.applySlackMessageEdit(channelId, messageId, content ?? "", {
|
|
570
|
+
...buildActionOpts("write", teamId),
|
|
571
|
+
blocks,
|
|
572
|
+
preparedEditText: context?.preparedEditText
|
|
574
573
|
});
|
|
575
|
-
return
|
|
576
|
-
}
|
|
577
|
-
case "deleteMessage": {
|
|
578
|
-
const target = resolveChannelTarget();
|
|
579
|
-
const { channelId } = target;
|
|
580
|
-
const messageId = readStringParam(params, "messageId", { required: true });
|
|
581
|
-
await assertReadTargetAllowed(target);
|
|
582
|
-
const writeOpts = buildActionOpts("write", target.teamId);
|
|
583
|
-
await slackActionRuntime.deleteSlackMessage(channelId, messageId, writeOpts);
|
|
584
|
-
return jsonResult({ ok: true });
|
|
574
|
+
return slackPostMutationResult(target, account.accountId, messageId, text);
|
|
585
575
|
}
|
|
586
576
|
case "readMessages": {
|
|
587
577
|
const target = resolveChannelTarget();
|
|
@@ -609,15 +599,16 @@ async function handleSlackAction(params, cfg, context) {
|
|
|
609
599
|
before,
|
|
610
600
|
after,
|
|
611
601
|
threadId,
|
|
612
|
-
messageId
|
|
602
|
+
messageId,
|
|
603
|
+
includeUserProfiles: true
|
|
613
604
|
});
|
|
614
|
-
const messages = result.messages.map((
|
|
605
|
+
const messages = result.messages.map((m) => withNormalizedTimestamp(m, m.ts));
|
|
615
606
|
return jsonResult({
|
|
616
607
|
ok: true,
|
|
617
608
|
channelId,
|
|
618
609
|
...threadId ? { threadId } : {},
|
|
619
|
-
|
|
620
|
-
|
|
610
|
+
...result,
|
|
611
|
+
messages
|
|
621
612
|
});
|
|
622
613
|
}
|
|
623
614
|
case "downloadFile": {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as handleSlackAction } from "./action-runtime-B2JYA0KK.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { i as __exportAll } from "./doctor-contract-CcNdculn.mjs";
|
|
2
2
|
import { g as resolveSlackBotToken, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-Dsl3wabY.mjs";
|
|
3
|
-
import { n as formatSlackTarget } from "./target-parsing-
|
|
4
|
-
import { $ as
|
|
3
|
+
import { n as formatSlackTarget } from "./target-parsing-DaLcdOoQ.mjs";
|
|
4
|
+
import { $ as appendSlackNativeDataFallbackText, A as truncateSlackTextByUtf8Bytes, D as assertSlackDetachedTargetAllowed, Dt as escapeSlackMrkdwn, Et as normalizeSlackOutboundText, O as countSlackTextUtf8Bytes, Z as validateSlackBlocksArray, _ as enrichSlackWebApiError, at as hasSlackNativeDataBlock, bt as SLACK_EDIT_TEXT_MAX_BYTES, ct as stripSlackNativeDataBlocks, et as appendSlackNativeDataPlainTextFallback, nt as buildSlackCompleteBlocksFallbackText, on as SLACK_PRIVATE_ACTION_DELIVERY_RESULT, ot as renderSlackBlockFallbackText, tt as buildSlackBlocksFallbackText } from "./probe-DhQ6LeKX.mjs";
|
|
5
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 {
|
|
6
|
+
import { c as getSlackWriteClient, d as readLruMapEntry, f as writeLruMapEntry, i as createSlackTokenCacheKey, o as createSlackWriteClient, t as createSlackLookupClient } from "./client-DQqLIemQ.mjs";
|
|
7
|
+
import { f as buildSlackNativeDataDeliveryPlan, m as isSlackInvalidBlocksError, t as sendMessageSlack, v as slackComparisonText } from "./send-kbYZlK6B.mjs";
|
|
8
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
9
9
|
import { asOptionalObjectRecord, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
@@ -14,9 +14,9 @@ import { fetchWithRuntimeDispatcher as fetchWithRuntimeDispatcher$1 } from "open
|
|
|
14
14
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
15
15
|
import { z } from "zod";
|
|
16
16
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
17
|
+
import { formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
17
18
|
import fs from "node:fs/promises";
|
|
18
19
|
import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
19
|
-
import { formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
20
20
|
import { normalizeHostname } from "openclaw/plugin-sdk/host-runtime";
|
|
21
21
|
import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url";
|
|
22
22
|
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
@@ -518,8 +518,101 @@ async function resolveSlackAttachmentContent(params) {
|
|
|
518
518
|
...unavailableFiles.length > 0 ? { files: unavailableFiles } : {}
|
|
519
519
|
};
|
|
520
520
|
}
|
|
521
|
+
// extensions/slack/src/user-profiles.ts
|
|
522
|
+
const SLACK_USER_PROFILE_CACHE_MAX_ENTRIES = 2048;
|
|
523
|
+
const profileCaches = /* @__PURE__ */ new Map();
|
|
524
|
+
function accountCache(accountId) {
|
|
525
|
+
let cache = profileCaches.get(accountId);
|
|
526
|
+
if (!cache) {
|
|
527
|
+
cache = /* @__PURE__ */ new Map();
|
|
528
|
+
profileCaches.set(accountId, cache);
|
|
529
|
+
}
|
|
530
|
+
return cache;
|
|
531
|
+
}
|
|
532
|
+
const cacheKey = (scope, userId) => `${scope.token ? createSlackTokenCacheKey(scope.token) : "client"}\0${scope.teamId ?? ""}\0${userId}`;
|
|
533
|
+
/** Starts an empty cache for the account, so a monitor start reads current names. */
|
|
534
|
+
function resetSlackUserProfileCache(accountId) {
|
|
535
|
+
profileCaches.set(accountId, /* @__PURE__ */ new Map());
|
|
536
|
+
}
|
|
537
|
+
function readCachedSlackUserProfile(scope, userId) {
|
|
538
|
+
return readLruMapEntry(accountCache(scope.accountId), cacheKey(scope, userId));
|
|
539
|
+
}
|
|
540
|
+
/** Returns the cached profile or calls users.info; failures throw and are not cached. */
|
|
541
|
+
async function resolveSlackUserProfile(params) {
|
|
542
|
+
const cached = readCachedSlackUserProfile(params, params.userId);
|
|
543
|
+
if (cached) return cached;
|
|
544
|
+
const { user } = await params.client.users.info({
|
|
545
|
+
...params.token ? { token: params.token } : {},
|
|
546
|
+
user: params.userId
|
|
547
|
+
});
|
|
548
|
+
const profile = user?.profile;
|
|
549
|
+
const entry = {
|
|
550
|
+
displayName: normalizeOptionalString(profile?.display_name),
|
|
551
|
+
realName: normalizeOptionalString(profile?.real_name),
|
|
552
|
+
handle: normalizeOptionalString(user?.name),
|
|
553
|
+
imageUrl: normalizeOptionalString(profile?.image_192) ?? normalizeOptionalString(profile?.image_512) ?? normalizeOptionalString(profile?.image_72)
|
|
554
|
+
};
|
|
555
|
+
writeLruMapEntry(accountCache(params.accountId), cacheKey(params, params.userId), entry, SLACK_USER_PROFILE_CACHE_MAX_ENTRIES);
|
|
556
|
+
return entry;
|
|
557
|
+
}
|
|
558
|
+
const MENTION_PATTERN = /<@([UW][A-Z0-9]+)(?:\|[^>]*)?>/g;
|
|
559
|
+
function blockMentions(node, ids) {
|
|
560
|
+
if (Array.isArray(node)) node.forEach((child) => blockMentions(child, ids));
|
|
561
|
+
else if (isRecord(node)) {
|
|
562
|
+
if (node.type === "user" && typeof node.user_id === "string") ids.add(node.user_id);
|
|
563
|
+
Object.values(node).forEach((child) => blockMentions(child, ids));
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
/** The users a message mentions, from its text and blocks. */
|
|
567
|
+
function mentionedUsers(message) {
|
|
568
|
+
const ids = /* @__PURE__ */ new Set();
|
|
569
|
+
for (const match of message.text?.matchAll(MENTION_PATTERN) ?? []) ids.add(match[1]);
|
|
570
|
+
blockMentions(message.blocks, ids);
|
|
571
|
+
return ids;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Adds `user_profile` names to messages and answers the names of the users they mention, by
|
|
575
|
+
* user ID. Each uncached author or mentioned user is looked up once, in parallel; one whose lookup
|
|
576
|
+
* fails keeps only its ID.
|
|
577
|
+
*/
|
|
578
|
+
async function addSlackUserProfiles(params) {
|
|
579
|
+
const authors = params.messages.flatMap((message) => message.user && !message.user_profile ? [message.user] : []);
|
|
580
|
+
const mentions = new Set(params.messages.flatMap((message) => [...mentionedUsers(message)]));
|
|
581
|
+
const profiles = new Map(await Promise.all([.../* @__PURE__ */ new Set([...authors, ...mentions])].map(async (userId) => {
|
|
582
|
+
try {
|
|
583
|
+
const { displayName, realName, handle } = await resolveSlackUserProfile({
|
|
584
|
+
...params,
|
|
585
|
+
userId
|
|
586
|
+
});
|
|
587
|
+
return [userId, displayName || realName || handle ? {
|
|
588
|
+
display_name: displayName,
|
|
589
|
+
real_name: realName,
|
|
590
|
+
name: handle
|
|
591
|
+
} : void 0];
|
|
592
|
+
} catch (error) {
|
|
593
|
+
logVerbose(`slack read: users.info failed for ${userId}: ${String(error)}`);
|
|
594
|
+
return [userId, void 0];
|
|
595
|
+
}
|
|
596
|
+
})));
|
|
597
|
+
const mentioned = {};
|
|
598
|
+
for (const userId of mentions) {
|
|
599
|
+
const profile = profiles.get(userId);
|
|
600
|
+
if (profile) mentioned[userId] = profile;
|
|
601
|
+
}
|
|
602
|
+
return {
|
|
603
|
+
messages: params.messages.map((message) => {
|
|
604
|
+
const profile = message.user && !message.user_profile ? profiles.get(message.user) : void 0;
|
|
605
|
+
return profile ? {
|
|
606
|
+
...message,
|
|
607
|
+
user_profile: profile
|
|
608
|
+
} : message;
|
|
609
|
+
}),
|
|
610
|
+
mentioned
|
|
611
|
+
};
|
|
612
|
+
}
|
|
521
613
|
// extensions/slack/src/actions.ts
|
|
522
614
|
var actions_exports = /* @__PURE__ */ __exportAll({
|
|
615
|
+
applySlackMessageEdit: () => applySlackMessageEdit,
|
|
523
616
|
createSlackChannel: () => createSlackChannel,
|
|
524
617
|
deleteSlackMessage: () => deleteSlackMessage,
|
|
525
618
|
downloadSlackFile: () => downloadSlackFile,
|
|
@@ -635,12 +728,15 @@ function normalizeSlackReadTimestamp(raw, field) {
|
|
|
635
728
|
if (!Number.isFinite(parsed)) throw new Error(`Invalid Slack read ${field} timestamp "${trimmed}": expected a Slack timestamp or ISO-8601 date string`);
|
|
636
729
|
return formatEpochSeconds(parsed);
|
|
637
730
|
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
const accountId = opts.cfg ? resolveSlackAccount({
|
|
731
|
+
function resolveActionAccountId(opts) {
|
|
732
|
+
return opts.cfg ? resolveSlackAccount({
|
|
641
733
|
cfg: requireRuntimeConfig(opts.cfg, "Slack actions"),
|
|
642
734
|
accountId: opts.accountId
|
|
643
735
|
}).accountId : normalizeAccountId(opts.accountId);
|
|
736
|
+
}
|
|
737
|
+
async function getClient(opts = {}, mode = "read") {
|
|
738
|
+
if (opts.client && !opts.assertDirectAdapterHandoff) return opts.client;
|
|
739
|
+
const accountId = resolveActionAccountId(opts);
|
|
644
740
|
assertSlackDetachedTargetAllowed(accountId, opts.teamId);
|
|
645
741
|
const token = resolveToken(opts.token, opts.accountId, opts.cfg);
|
|
646
742
|
const clientTeamId = opts.omitTeamId ? void 0 : opts.teamId;
|
|
@@ -741,38 +837,51 @@ async function sendSlackMessage(to, content, opts) {
|
|
|
741
837
|
});
|
|
742
838
|
}
|
|
743
839
|
async function editSlackMessage(channelId, messageId, content, opts = {}) {
|
|
744
|
-
|
|
745
|
-
const tableMode = resolveMarkdownTableMode({
|
|
746
|
-
cfg: opts.cfg,
|
|
747
|
-
channel: "slack",
|
|
748
|
-
accountId
|
|
749
|
-
});
|
|
750
|
-
await editSlackRenderedMessage(channelId, messageId, normalizeSlackOutboundText(content, { tableMode }), opts);
|
|
840
|
+
await applySlackMessageEdit(channelId, messageId, content, opts);
|
|
751
841
|
}
|
|
752
842
|
function slackNativeEditLimitError(options) {
|
|
753
843
|
return new Error(`Slack native chart or table fallback exceeds the ${String(SLACK_EDIT_TEXT_MAX_BYTES)}-byte edit limit. Send a new message instead.`, options);
|
|
754
844
|
}
|
|
755
845
|
async function editSlackRenderedMessage(channelId, messageId, content, opts = {}) {
|
|
846
|
+
await applySlackMessageEdit(channelId, messageId, content, {
|
|
847
|
+
...opts,
|
|
848
|
+
preparedEditText: content
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
/** Return final-comparison text for the successful update, including its native-block retry. */
|
|
852
|
+
async function applySlackMessageEdit(channelId, messageId, content, opts) {
|
|
853
|
+
let renderedContent = opts.preparedEditText;
|
|
854
|
+
if (renderedContent === void 0) {
|
|
855
|
+
const accountId = opts.accountId ?? (opts.cfg ? resolveDefaultSlackAccountId(opts.cfg) : void 0);
|
|
856
|
+
const tableMode = resolveMarkdownTableMode({
|
|
857
|
+
cfg: opts.cfg,
|
|
858
|
+
channel: "slack",
|
|
859
|
+
accountId
|
|
860
|
+
});
|
|
861
|
+
renderedContent = normalizeSlackOutboundText(content, { tableMode });
|
|
862
|
+
}
|
|
756
863
|
const client = await getClient(opts, "write");
|
|
757
864
|
const blocks = opts.blocks == null ? void 0 : validateSlackBlocksArray(opts.blocks);
|
|
758
|
-
const editText = buildSlackEditTextPayload(
|
|
865
|
+
const editText = buildSlackEditTextPayload(renderedContent, blocks);
|
|
759
866
|
const hasNativeData = hasSlackNativeDataBlock(blocks);
|
|
760
867
|
const nativeFallbackText = hasNativeData ? appendSlackNativeDataFallbackText(editText, blocks) : editText;
|
|
761
868
|
if (hasNativeData && countSlackTextUtf8Bytes(nativeFallbackText) > 4e3) throw slackNativeEditLimitError();
|
|
869
|
+
const text = countSlackTextUtf8Bytes(nativeFallbackText) <= 4e3 ? nativeFallbackText : truncateSlackTextByUtf8Bytes(nativeFallbackText, SLACK_EDIT_TEXT_MAX_BYTES);
|
|
762
870
|
const update = {
|
|
763
871
|
channel: channelId,
|
|
764
872
|
ts: messageId,
|
|
765
|
-
text
|
|
873
|
+
text,
|
|
766
874
|
...blocks ? { blocks } : {}
|
|
767
875
|
};
|
|
768
876
|
try {
|
|
769
|
-
await client.chat.update(update);
|
|
877
|
+
const response = await client.chat.update(update);
|
|
878
|
+
return blocks ? text : slackComparisonText(response.message?.text ?? response.text ?? text, renderedContent, content);
|
|
770
879
|
} catch (error) {
|
|
771
880
|
if (!hasNativeData || !isSlackInvalidBlocksError(error)) throw error;
|
|
772
881
|
logVerbose("slack edit: native data block rejected, retrying with text fallback");
|
|
773
882
|
const survivorBlocks = stripSlackNativeDataBlocks(blocks);
|
|
774
883
|
const survivorText = buildSlackBlocksFallbackText(survivorBlocks);
|
|
775
|
-
const authoredEditText =
|
|
884
|
+
const authoredEditText = renderedContent.trim();
|
|
776
885
|
const baseText = authoredEditText && !survivorText.includes(authoredEditText) ? authoredEditText : "";
|
|
777
886
|
const fallbackPlan = buildSlackNativeDataDeliveryPlan({
|
|
778
887
|
baseText,
|
|
@@ -789,6 +898,7 @@ async function editSlackRenderedMessage(channelId, messageId, content, opts = {}
|
|
|
789
898
|
text: fallbackText,
|
|
790
899
|
...fallback.blocks ? { blocks: fallback.blocks } : {}
|
|
791
900
|
});
|
|
901
|
+
return fallbackText;
|
|
792
902
|
}
|
|
793
903
|
}
|
|
794
904
|
async function deleteSlackMessage(channelId, messageId, opts = {}) {
|
|
@@ -826,9 +936,24 @@ async function readSlackMessages(channelId, opts = {}) {
|
|
|
826
936
|
ts: opts.threadId,
|
|
827
937
|
oldest: exactMessageId ? exactMessageId : exactBounds.oldest && Number(exactBounds.oldest) > Number(opts.threadId) ? exactBounds.oldest : opts.threadId
|
|
828
938
|
}) : await client.conversations.history(query);
|
|
939
|
+
const messages = (result.messages ?? []).filter((message) => exactMessageId ? message.ts === exactMessageId : !opts.threadId || message.ts !== opts.threadId).map(renderSlackReadMessageText);
|
|
940
|
+
const hasMore = exactMessageId ? false : Boolean(result.has_more);
|
|
941
|
+
if (!opts.includeUserProfiles) return {
|
|
942
|
+
messages,
|
|
943
|
+
hasMore
|
|
944
|
+
};
|
|
945
|
+
const named = await addSlackUserProfiles({
|
|
946
|
+
accountId: resolveActionAccountId(opts),
|
|
947
|
+
teamId: opts.teamId,
|
|
948
|
+
token: opts.client ? opts.token : resolveToken(opts.token, opts.accountId, opts.cfg),
|
|
949
|
+
client,
|
|
950
|
+
messages
|
|
951
|
+
});
|
|
952
|
+
const mentioned = Object.keys(named.mentioned).length ? { userProfiles: named.mentioned } : {};
|
|
829
953
|
return {
|
|
830
|
-
messages:
|
|
831
|
-
hasMore
|
|
954
|
+
messages: named.messages,
|
|
955
|
+
hasMore,
|
|
956
|
+
...mentioned
|
|
832
957
|
};
|
|
833
958
|
}
|
|
834
959
|
async function listSlackConversations(opts) {
|
|
@@ -903,4 +1028,4 @@ async function downloadSlackFile(fileId, opts) {
|
|
|
903
1028
|
maxBytes: opts.maxBytes
|
|
904
1029
|
}))?.[0] ?? null;
|
|
905
1030
|
}
|
|
906
|
-
export {
|
|
1031
|
+
export { buildSlackEditTextPayload as A, formatSlackFileReference as C, isSlackUnfurlAttachment as D, hasSlackTableBlock as E, resolveSlackBlocksText as O, saveRemoteMedia as S, hasSlackMessageTableBlock as T, readCachedSlackUserProfile as _, editSlackRenderedMessage as a, media_exports as b, listSlackPins as c, reactSlackMessage as d, readSlackMessages as f, unpinSlackMessage as g, sendSlackMessage as h, editSlackMessage as i, resolveSlackMessageText as k, listSlackReactions as l, removeSlackReaction as m, deleteSlackMessage as n, getSlackMemberInfo as o, removeOwnSlackReactions as p, downloadSlackFile as r, listSlackEmojis as s, actions_exports as t, pinSlackMessage as u, resetSlackUserProfileCache as v, formatSlackFileReferenceList as w, isGovSlackClient as x, resolveSlackUserProfile as y };
|
package/dist/.setup/{approval-handler.runtime-BBYoz7El.mjs → approval-handler.runtime-DDn3L7Gd.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
2
|
-
import {
|
|
3
|
-
import { o as resolveSlackReplyBlocks } from "./reply-blocks-
|
|
1
|
+
import { a as parseSlackTarget } from "./target-parsing-DaLcdOoQ.mjs";
|
|
2
|
+
import { A as truncateSlackTextByUtf8Bytes, It as shouldHandleSlackNativeApprovalRequest, K as SLACK_APPROVAL_HEADER_BLOCK_ID, Ot as isSlackAnyNativeApprovalClientEnabled, bt as SLACK_EDIT_TEXT_MAX_BYTES, i as setSlackSessionStatus, k as truncateSlackText, nn as normalizeSlackApproverId } from "./probe-DhQ6LeKX.mjs";
|
|
3
|
+
import { o as resolveSlackReplyBlocks } from "./reply-blocks-BsJPukUN.mjs";
|
|
4
4
|
import { s as getSlackListenerWriteClient } from "./client-DQqLIemQ.mjs";
|
|
5
|
-
import { t as sendMessageSlack } from "./send-
|
|
6
|
-
import { n as runSlackApprovalMessageUpdate } from "./approval-message-updates-
|
|
5
|
+
import { t as sendMessageSlack } from "./send-kbYZlK6B.mjs";
|
|
6
|
+
import { n as runSlackApprovalMessageUpdate } from "./approval-message-updates-CnjKG4If.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-BrGg-eis.mjs → approval-message-updates-CnjKG4If.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { R as isSlackApprovalActionId, q as decodeSlackApprovalAction } from "./probe-DhQ6LeKX.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
|
|
@@ -2,17 +2,17 @@ import { n as normalizeCompatibilityConfig, r as runtime_doctor_migrations_expor
|
|
|
2
2
|
import { r as isSlackPluginAccountConfigured } from "./account-configured-35y0-Hso.mjs";
|
|
3
3
|
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, d as resolveSlackMarkdownOptions, f as resolveSlackOperationToken, i as listSlackAccountIds, l as resolveSlackAccountDmPolicy, n as hasImplicitDefaultSlackAccount, o as resolveDefaultSlackAccountId, p as resolveSlackReplyToMode, s as resolveSlackAccount } from "./accounts-Dsl3wabY.mjs";
|
|
4
4
|
import { t as inspectSlackAccount } from "./account-inspect-Cvn3f95c.mjs";
|
|
5
|
-
import { a as parseSlackTarget, i as normalizeSlackMessagingTarget, n as formatSlackTarget, o as resolveSlackChannelId, r as looksLikeSlackTargetId, t as canonicalizeSlackApiTargetId } from "./target-parsing-
|
|
6
|
-
import { t as slackContextTargetsMatch } from "./targets-
|
|
7
|
-
import { At as
|
|
5
|
+
import { a as parseSlackTarget, i as normalizeSlackMessagingTarget, n as formatSlackTarget, o as resolveSlackChannelId, r as looksLikeSlackTargetId, s as resolveSlackDeliveryTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-DaLcdOoQ.mjs";
|
|
6
|
+
import { t as slackContextTargetsMatch } from "./targets-DaKqo4kn.mjs";
|
|
7
|
+
import { $t as getSlackExecApprovalApprovers, At as normalizeSlackForwardTarget, Bt as getSlackApprovalApproversForTeam, C as normalizeSlackRouteBindingConfig, Ct as SLACK_TEXT_LIMIT, D as assertSlackDetachedTargetAllowed, E as slackConversationBindings, Et as normalizeSlackOutboundText, Ft as resolveTurnSourceSlackOriginTarget, Ht as resolveSlackApprovalTeamId, It as shouldHandleSlackNativeApprovalRequest, Lt as shouldHandleSlackPluginViaForwardingSession, Mt as resolveSessionSlackOriginTarget, Nt as resolveSlackApproverDmTargets, O as countSlackTextUtf8Bytes, Ot as isSlackAnyNativeApprovalClientEnabled, Pt as resolveSlackFallbackOriginTarget, Rt as slackTargetsMatch, Vt as isSlackPluginApprovalAuthorizedSender, Xt as getSlackInstallationKind, an as resolvePluginApprovalSlackApprovers, b as qualifySlackConversationId, bt as SLACK_EDIT_TEXT_MAX_BYTES, c as slackIngressIdentity, en as isSlackExecApprovalAuthorizedSender, f as resolveSlackGroupRequireMention, gt as SLACK_PRESENTATION_CAPABILITIES, i as setSlackSessionStatus, in as shouldSuppressLocalSlackExecApprovalPrompt, jt as normalizeSlackOriginTarget, kt as isSlackPluginApprovalRequest, p as resolveSlackGroupToolPolicy, rn as resolveSlackExecApprovalTarget, s as normalizeSlackStableEntry, sn as resolveSlackAutoThreadId, t as probeSlack, tn as isSlackExecApprovalClientEnabled, v as formatSlackError, w as resolveSlackConversationBindingRoute, x as qualifySlackRoutePeerId, yt as renderSlackMessagePresentationFallbackText, zt as resolveSlackAccountDirectTarget } from "./probe-DhQ6LeKX.mjs";
|
|
8
8
|
import { n as resolveSlackReplyThreadTs, r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-47Au2-Yn.mjs";
|
|
9
9
|
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-9DmIWHzY.mjs";
|
|
10
10
|
import { n as collectSlackCursorPages } from "./cursor-pages-DiOrzZtc.mjs";
|
|
11
|
-
import { a as resolveSlackReplyBlockResolution, o as resolveSlackReplyBlocks, r as normalizeSlackReplyPayload, s as resolveSlackReplyDeliveryMessages } from "./reply-blocks-
|
|
11
|
+
import { a as resolveSlackReplyBlockResolution, o as resolveSlackReplyBlocks, r as normalizeSlackReplyPayload, s as resolveSlackReplyDeliveryMessages } from "./reply-blocks-BsJPukUN.mjs";
|
|
12
12
|
import { c as getSlackWriteClient, t as createSlackLookupClient } from "./client-DQqLIemQ.mjs";
|
|
13
|
-
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-
|
|
13
|
+
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-CNYPuhN7.mjs";
|
|
14
14
|
import { n as SLACK_CHANNEL_META } from "./channel-meta-C5vsCo3a.mjs";
|
|
15
|
-
import { i as SLACK_CHANNEL, r as slackBaseConfigAdapter, t as slackSetupPlugin } from "./channel.setup-
|
|
15
|
+
import { i as SLACK_CHANNEL, r as slackBaseConfigAdapter, t as slackSetupPlugin } from "./channel.setup-C0NEy9hG.mjs";
|
|
16
16
|
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-CqVqR7MP.mjs";
|
|
17
17
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
18
18
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -104,7 +104,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
104
104
|
],
|
|
105
105
|
isConfigured: isSlackAnyNativeApprovalClientEnabled,
|
|
106
106
|
shouldHandle: shouldHandleSlackNativeApprovalRequest,
|
|
107
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
107
|
+
load: async () => (await import("./approval-handler.runtime-DDn3L7Gd.mjs")).slackApprovalNativeRuntime
|
|
108
108
|
})
|
|
109
109
|
});
|
|
110
110
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.nativeAsync;
|
|
@@ -214,7 +214,7 @@ const SLACK_TOOL_DELIVERY_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
214
214
|
"unpinMessage",
|
|
215
215
|
"uploadFile"
|
|
216
216
|
]);
|
|
217
|
-
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
217
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-DhTK_A6l.mjs"));
|
|
218
218
|
function resolveSlackActionContext(ctx, toolContext) {
|
|
219
219
|
if (!toolContext && !ctx.mediaAccess && !ctx.mediaLocalRoots && !ctx.mediaReadFile && !ctx.conversationReadOrigin && !ctx.requesterAccountId && !ctx.requesterSenderId && !ctx.assertDirectAdapterHandoff) return;
|
|
220
220
|
return {
|
|
@@ -368,7 +368,9 @@ function createSlackActions(providerId, options) {
|
|
|
368
368
|
});
|
|
369
369
|
if (action === "edit") {
|
|
370
370
|
const messageId = readStringParam$1(actionParams, "messageId", { required: true });
|
|
371
|
-
const
|
|
371
|
+
const content = readStringParam$1(actionParams, "message", { allowEmpty: true });
|
|
372
|
+
const presentation = normalizeMessagePresentation(actionParams.presentation);
|
|
373
|
+
const { blocks, text: accessibleContent, usesPresentationTextFallback } = renderSlackActionPresentation(content, presentation, resolveSlackMarkdownOptions({
|
|
372
374
|
cfg,
|
|
373
375
|
accountId
|
|
374
376
|
}));
|
|
@@ -378,7 +380,7 @@ function createSlackActions(providerId, options) {
|
|
|
378
380
|
action: "editMessage",
|
|
379
381
|
channelId: resolveChannelId(),
|
|
380
382
|
messageId,
|
|
381
|
-
content: accessibleContent,
|
|
383
|
+
content: presentation ? accessibleContent : content,
|
|
382
384
|
blocks
|
|
383
385
|
}, {
|
|
384
386
|
...ctx.toolContext,
|
|
@@ -750,10 +752,10 @@ function collectSlackNameKeyedChannelWarnings({ cfg }) {
|
|
|
750
752
|
if (looksLikeSlackChannelId(channelKey)) continue;
|
|
751
753
|
if (account.dangerouslyAllowNameMatching === true && looksLikeSlackChannelNameKey(channelKey)) continue;
|
|
752
754
|
if (SLACK_AMBIGUOUS_LOWERCASE_CHANNEL_ID_RE.test(channelKey)) {
|
|
753
|
-
warnings.add(`${channelsPrefix}.channels."${channelKey}" is ambiguous: it may be a lowercase Slack channel ID or a channel name. If it is a channel name,
|
|
755
|
+
warnings.add(`${channelsPrefix}.channels."${channelKey}" is ambiguous: it may be a lowercase Slack channel ID or a channel name. If it is a channel name, it applies only when the Slack lookup at startup resolves it to a channel ID; otherwise ${fallbackDescription}. Re-key it with the channel's stable ID (e.g. C0123ABCD, from the channel's About details or conversations.info).`);
|
|
754
756
|
continue;
|
|
755
757
|
}
|
|
756
|
-
warnings.add(`${channelsPrefix}.channels."${channelKey}" is keyed by a channel name or unsupported ID form, not a
|
|
758
|
+
warnings.add(`${channelsPrefix}.channels."${channelKey}" is keyed by a channel name or unsupported ID form, not a Slack channel ID. Under groupPolicy: "${effectiveGroupPolicy}", a channel name applies only when the Slack lookup at startup resolves it to a channel ID; otherwise ${fallbackDescription}. Re-key it with the channel's ID (e.g. C0123ABCD, from the channel's About details or conversations.info).`);
|
|
757
759
|
}
|
|
758
760
|
}
|
|
759
761
|
return [...warnings];
|
|
@@ -890,15 +892,15 @@ function buildSlackThreadingToolContext(params) {
|
|
|
890
892
|
// extensions/slack/src/channel.ts
|
|
891
893
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/extension-shared"));
|
|
892
894
|
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/target-resolver-runtime"));
|
|
893
|
-
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-
|
|
894
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-
|
|
895
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-CnMdp9Pj.mjs"));
|
|
896
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-CIJgw3fk.mjs"));
|
|
895
897
|
const bindSlackOutbound = createLazyRuntimeMethodBinder(loadSlackOutboundAdapterModule);
|
|
896
|
-
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
897
|
-
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
898
|
-
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
899
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
900
|
-
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
901
|
-
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
898
|
+
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-CFrpmf6d.mjs").then((n) => n.t));
|
|
899
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-Cl7l3BLf.mjs").then((n) => n.n));
|
|
900
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-mep8kUHy.mjs").then((n) => n.n));
|
|
901
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-kbYZlK6B.mjs").then((n) => n.n));
|
|
902
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-DhQ6LeKX.mjs").then((n) => n.n));
|
|
903
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-dVQQ8XII.mjs").then((n) => n.t));
|
|
902
904
|
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-ZhSt3r1s.mjs").then((n) => n.t));
|
|
903
905
|
async function setSlackHeartbeatThreadStatus(params) {
|
|
904
906
|
const threadTs = resolveSlackThreadTsValue({ threadId: params.threadId });
|
|
@@ -1084,14 +1086,8 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1084
1086
|
directTargetStyle: "user-prefixed",
|
|
1085
1087
|
targetIdComparison: "lowercase",
|
|
1086
1088
|
normalizeTarget: normalizeSlackMessagingTarget,
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
const child = conversationId.trim();
|
|
1090
|
-
return parent && parent !== child ? {
|
|
1091
|
-
to: normalizeSlackMessagingTarget(parent),
|
|
1092
|
-
threadId: child
|
|
1093
|
-
} : { to: normalizeSlackMessagingTarget(child) };
|
|
1094
|
-
},
|
|
1089
|
+
resolveDirectTarget: resolveSlackAccountDirectTarget,
|
|
1090
|
+
resolveDeliveryTarget: resolveSlackDeliveryTarget,
|
|
1095
1091
|
resolveSessionTarget: ({ id }) => {
|
|
1096
1092
|
return normalizeSlackMessagingTarget(`channel:${id}`);
|
|
1097
1093
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __exportAll } from "./doctor-contract-CcNdculn.mjs";
|
|
2
2
|
import { f as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-Dsl3wabY.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { D as assertSlackDetachedTargetAllowed } from "./probe-DhQ6LeKX.mjs";
|
|
4
4
|
import { a as createSlackWebClient, d as readLruMapEntry, i as createSlackTokenCacheKey, n as createSlackReadClient } from "./client-DQqLIemQ.mjs";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
@@ -547,7 +547,7 @@ const slackSetupPlugin = {
|
|
|
547
547
|
markdownCapable: true,
|
|
548
548
|
preferSessionLookupForAnnounceTarget: true
|
|
549
549
|
},
|
|
550
|
-
setupWizard: createSlackSetupWizardProxy(() => import("./setup-surface-
|
|
550
|
+
setupWizard: createSlackSetupWizardProxy(() => import("./setup-surface-D8hoExQs.mjs")),
|
|
551
551
|
capabilities: {
|
|
552
552
|
chatTypes: [
|
|
553
553
|
"direct",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __exportAll } from "./doctor-contract-CcNdculn.mjs";
|
|
2
2
|
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, o as resolveDefaultSlackAccountId } from "./accounts-Dsl3wabY.mjs";
|
|
3
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
4
|
-
import "./targets-
|
|
3
|
+
import { a as parseSlackTarget } from "./target-parsing-DaLcdOoQ.mjs";
|
|
4
|
+
import "./targets-DaKqo4kn.mjs";
|
|
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";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { f as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-Dsl3wabY.mjs";
|
|
2
|
-
import { a as parseSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-
|
|
3
|
-
import {
|
|
2
|
+
import { a as parseSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-DaLcdOoQ.mjs";
|
|
3
|
+
import { Yt as captureSlackWorkspaceInstallation } from "./probe-DhQ6LeKX.mjs";
|
|
4
4
|
import { t as normalizeSlackThreadTsCandidate } from "./thread-ts-47Au2-Yn.mjs";
|
|
5
5
|
import { n as createSlackReadClient, o as createSlackWriteClient } from "./client-DQqLIemQ.mjs";
|
|
6
|
-
import { t as buildSlackLiteralText } from "./literal-text-
|
|
6
|
+
import { t as buildSlackLiteralText } from "./literal-text-D5exd3B9.mjs";
|
|
7
7
|
import { n as getSlackRuntime } from "./runtime-C6HKn7Av.mjs";
|
|
8
8
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
9
9
|
import { getSessionBindingService } from "openclaw/plugin-sdk/session-binding-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dt as escapeSlackMrkdwn, _t as SLACK_SECTION_TEXT_MAX } from "./probe-DhQ6LeKX.mjs";
|
|
2
2
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
3
3
|
// extensions/slack/src/literal-text.ts
|
|
4
4
|
/** Native plain-text blocks plus a non-parsing accessibility fallback. */
|