@openclaw/slack 2026.5.14-beta.1 → 2026.5.14-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{action-runtime-gtC-RM3r.js → action-runtime-CyE2jfW-.js} +4 -4
- package/dist/action-runtime.runtime-DLhfKw4B.js +2 -0
- package/dist/{media-B-nNpS2G.js → actions-BibhOXpJ.js} +307 -2
- package/dist/{actions.runtime-DD6hfFCA.js → actions.runtime-B9XQG6X4.js} +1 -1
- package/dist/api.js +16 -16
- package/dist/{approval-handler.runtime-DeYBuIaU.js → approval-handler.runtime-BjzVRaXN.js} +3 -4
- package/dist/{blocks-render-BdLueE_v.js → blocks-render-BAVfd6r0.js} +1 -1
- package/dist/{channel-CC04F-xs.js → channel-Dh07mU_K.js} +23 -27
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-jzYjY634.js → channel.setup-CmG37S2W.js} +3 -3
- package/dist/{client-8r7r7aZ3.js → client-C_IaJbi5.js} +20 -1
- package/dist/{config-schema-Bueih4yH.js → config-schema-CNRousxw.js} +1 -1
- package/dist/contract-api.js +4 -4
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CuaWaGnM.js → directory-live-CZPzpQZF.js} +1 -1
- package/dist/{doctor-contract-DCkS8eNN.js → doctor-contract-B8QIWMs1.js} +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/http-routes-api.js +1 -1
- package/dist/inbound-contract-test-api.js +2 -2
- package/dist/interactive-replies-api.js +1 -1
- package/dist/{message-tool-api-B_bKUmP0.js → message-tool-api-C7gc7goF.js} +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-B3QB1ysK.js → monitor-DDE5AI2O.js} +3 -3
- package/dist/{outbound-adapter-DsAvCwpZ.js → outbound-adapter-BluPNDNi.js} +4 -5
- package/dist/outbound-payload-test-api.js +1 -1
- package/dist/{outbound-payload.test-harness-DM9ZdY2f.js → outbound-payload.test-harness-BNxnP6MC.js} +2 -2
- package/dist/{pipeline.runtime-D-YJZZaI.js → pipeline.runtime-Dft2-QU4.js} +11 -12
- package/dist/{plugin-routes-Dt_jh9W8.js → plugin-routes-CRnfsTTX.js} +1 -1
- package/dist/{prepare-CXI8nHbJ.js → prepare-D0tMg4dt.js} +8 -9
- package/dist/{prepare.test-helpers-BhFHtbz3.js → prepare.test-helpers-CU1qB54Q.js} +1 -1
- package/dist/{probe-D1wYA05H.js → probe-FL4sUJsH.js} +2 -2
- package/dist/{provider-Ut7IF0Mn.js → provider-C6WxaFFf.js} +21 -19
- package/dist/{replies-CzfjCaLG.js → replies-D0QXXSPP.js} +4 -4
- package/dist/reply-blocks-BFaJ_ejG.js +134 -0
- package/dist/{resolve-channels-BiVxSLVm.js → resolve-channels-B_eKaOkE.js} +2 -2
- package/dist/{resolve-users-CcpSlYw-.js → resolve-users-BzBAJwvq.js} +2 -2
- package/dist/{room-context-D0hGOp8m.js → room-context-Cd8jFpS-.js} +2 -2
- package/dist/{runtime-api-D8wiG9BS.js → runtime-api-B5HGOzX3.js} +2 -2
- package/dist/runtime-api.js +12 -12
- package/dist/runtime-setter-api.js +1 -1
- package/dist/{scopes-BTkB8PPE.js → scopes-Bvg_ZzqZ.js} +2 -2
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-ioky2Xpy.js → send-Dg9zcyYT.js} +4 -5
- package/dist/send.runtime-CjjQ9StM.js +2 -0
- package/dist/send.runtime-E47jGN-2.js +2 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-B6w9gtds.js → setup-surface-BLoTgna4.js} +4 -4
- package/dist/{shared-CSiHkaVO.js → shared-GoB-OuUq.js} +7 -7
- package/dist/{slash-dispatch.runtime-DNr1EDON.js → slash-dispatch.runtime-Bz_OkRcR.js} +1 -1
- package/dist/test-api.js +7 -7
- package/dist/thread-ts-As_dcNbD.js +52 -0
- package/package.json +5 -5
- package/dist/action-runtime.runtime-DbVd7_Na.js +0 -2
- package/dist/actions-Cqyj7oRr.js +0 -309
- package/dist/approval-auth-D3xf0sS6.js +0 -28
- package/dist/blocks-input-BJZ8vv03.js +0 -29
- package/dist/channel-api-BfBK89IN.js +0 -20
- package/dist/exec-approvals-BLn4Zx7V.js +0 -58
- package/dist/group-policy-utF2iWnE.js +0 -41
- package/dist/mrkdwn-18IzcEAY.js +0 -6
- package/dist/reply-blocks-DWoZrUll.js +0 -14
- package/dist/send.runtime-5Kl3Wzbf.js +0 -2
- package/dist/send.runtime-DoifekaA.js +0 -2
- package/dist/thread-ts-o-QBwB3k.js +0 -24
- /package/dist/{accounts.runtime-CkfFIisb.js → accounts.runtime-BhbEu1ZK.js} +0 -0
- /package/dist/{allow-list-T7ZDpUsF.js → allow-list-nwXs_eCP.js} +0 -0
- /package/dist/{config-api-B48Z4H47.js → config-api-CmgE_ORg.js} +0 -0
- /package/dist/{directory-config-BKKNBkCq.js → directory-config-CMvFiswf.js} +0 -0
- /package/dist/{errors-BrtayXHa.js → errors-C_sW0Zgl.js} +0 -0
- /package/dist/{interactive-replies-CawNPL-h.js → interactive-replies-BSg5hXhj.js} +0 -0
- /package/dist/{magic-string.es-BLAi6qQC.js → magic-string.es-9lw4MGoF.js} +0 -0
- /package/dist/{registry-BdfKYina.js → registry-D2cWOLZV.js} +0 -0
- /package/dist/{resolve-allowlist-common-rhfyDyWi.js → resolve-allowlist-common-DLub2I2i.js} +0 -0
- /package/dist/{runtime--VlVtTPu.js → runtime-DQxkf7k2.js} +0 -0
- /package/dist/{secret-contract-BurGIyhv.js → secret-contract-0TL3L5Kb.js} +0 -0
- /package/dist/{security-audit-DvOpSaZM.js → security-audit-BJzADAw3.js} +0 -0
- /package/dist/{setup-core-DgLJ7dQY.js → setup-core-WWQl-cE9.js} +0 -0
- /package/dist/{slash-commands.runtime-DRkNgIQ2.js → slash-commands.runtime-bcDwsGnu.js} +0 -0
- /package/dist/{slash-plugin-commands.runtime-Dj5h8hmv.js → slash-plugin-commands.runtime-DBHGUSj2.js} +0 -0
- /package/dist/{slash-skill-commands.runtime-B-_KAk0C.js → slash-skill-commands.runtime-rrY2hXvN.js} +0 -0
- /package/dist/{streaming-compat-C6rySwiD.js → streaming-compat-eu5Rj5gj.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as resolveSlackChannelId, r as parseSlackTarget } from "./target-parsing-CQmv-iSm.js";
|
|
2
2
|
import "./targets-B1tYCAr6.js";
|
|
3
|
-
import {
|
|
4
|
-
import { a as readNumberParam, c as withNormalizedTimestamp, n as imageResultFromFile, o as readReactionParams, r as jsonResult, s as readStringParam, t as createActionGate } from "./runtime-api-
|
|
3
|
+
import { i as parseSlackBlocksInput } from "./thread-ts-As_dcNbD.js";
|
|
4
|
+
import { a as readNumberParam, c as withNormalizedTimestamp, n as imageResultFromFile, o as readReactionParams, r as jsonResult, s as readStringParam, t as createActionGate } from "./runtime-api-B5HGOzX3.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { isSingleUseReplyToMode } from "openclaw/plugin-sdk/reply-reference";
|
|
7
7
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
@@ -28,11 +28,11 @@ function sameSlackChannelTarget(targetChannel, currentChannelId) {
|
|
|
28
28
|
let slackActionsRuntimePromise;
|
|
29
29
|
let slackAccountsRuntimePromise;
|
|
30
30
|
function loadSlackActionsRuntime() {
|
|
31
|
-
slackActionsRuntimePromise ??= import("./actions.runtime-
|
|
31
|
+
slackActionsRuntimePromise ??= import("./actions.runtime-B9XQG6X4.js");
|
|
32
32
|
return slackActionsRuntimePromise;
|
|
33
33
|
}
|
|
34
34
|
function loadSlackAccountsRuntime() {
|
|
35
|
-
slackAccountsRuntimePromise ??= import("./accounts.runtime-
|
|
35
|
+
slackAccountsRuntimePromise ??= import("./accounts.runtime-BhbEu1ZK.js");
|
|
36
36
|
return slackAccountsRuntimePromise;
|
|
37
37
|
}
|
|
38
38
|
function createLazySlackAction(key) {
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
|
|
2
|
+
import { a as resolveSlackAccount, d as resolveSlackBotToken } from "./accounts-yk5K3wQU.js";
|
|
3
|
+
import { a as validateSlackBlocksArray, o as SLACK_TEXT_LIMIT, s as truncateSlackText } from "./thread-ts-As_dcNbD.js";
|
|
4
|
+
import { a as getSlackWriteClient, r as createSlackWebClient } from "./client-C_IaJbi5.js";
|
|
5
|
+
import { c as buildSlackBlocksFallbackText, t as sendMessageSlack } from "./send-Dg9zcyYT.js";
|
|
2
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
import {
|
|
7
|
+
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
8
|
+
import { logVerbose, logVerbose as logVerbose$1 } from "openclaw/plugin-sdk/runtime-env";
|
|
9
|
+
import { z } from "zod";
|
|
4
10
|
import fs from "node:fs/promises";
|
|
5
11
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
6
12
|
import { normalizeHostname } from "openclaw/plugin-sdk/host-runtime";
|
|
@@ -8,6 +14,14 @@ import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url";
|
|
|
8
14
|
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
|
9
15
|
import { saveRemoteMedia } from "openclaw/plugin-sdk/media-runtime";
|
|
10
16
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
17
|
+
//#region extensions/slack/src/edit-text.ts
|
|
18
|
+
function buildSlackEditTextPayload(content, blocks) {
|
|
19
|
+
const trimmedContent = content.trim();
|
|
20
|
+
if (trimmedContent) return trimmedContent;
|
|
21
|
+
if (blocks?.length) return truncateSlackText(buildSlackBlocksFallbackText(blocks), SLACK_TEXT_LIMIT);
|
|
22
|
+
return " ";
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
11
25
|
//#region extensions/slack/src/file-reference.ts
|
|
12
26
|
function formatSlackFileReference(file) {
|
|
13
27
|
const name = normalizeOptionalString(file?.name) ?? "file";
|
|
@@ -477,4 +491,295 @@ async function resolveSlackAttachmentContent(params) {
|
|
|
477
491
|
};
|
|
478
492
|
}
|
|
479
493
|
//#endregion
|
|
480
|
-
|
|
494
|
+
//#region extensions/slack/src/actions.ts
|
|
495
|
+
function resolveToken(explicit, accountId, cfg) {
|
|
496
|
+
if (explicit?.trim()) {
|
|
497
|
+
const token = resolveSlackBotToken(explicit);
|
|
498
|
+
if (token) return token;
|
|
499
|
+
}
|
|
500
|
+
if (!cfg) throw new Error("Slack actions requires a resolved runtime config. Load and resolve config at the command or gateway boundary, then pass cfg through the runtime path.");
|
|
501
|
+
const account = resolveSlackAccount({
|
|
502
|
+
cfg: requireRuntimeConfig(cfg, "Slack actions"),
|
|
503
|
+
accountId
|
|
504
|
+
});
|
|
505
|
+
const token = resolveSlackBotToken(account.botToken ?? void 0);
|
|
506
|
+
if (!token) {
|
|
507
|
+
logVerbose(`slack actions: missing bot token for account=${account.accountId} explicit=${Boolean(explicit)} source=${account.botTokenSource ?? "unknown"}`);
|
|
508
|
+
throw new Error("SLACK_BOT_TOKEN or channels.slack.botToken is required for Slack actions");
|
|
509
|
+
}
|
|
510
|
+
return token;
|
|
511
|
+
}
|
|
512
|
+
function normalizeEmoji(raw) {
|
|
513
|
+
const trimmed = raw.trim();
|
|
514
|
+
if (!trimmed) throw new Error("Emoji is required for Slack reactions");
|
|
515
|
+
return trimmed.replace(/^:+|:+$/g, "");
|
|
516
|
+
}
|
|
517
|
+
const SLACK_TIMESTAMP_RE = /^\d+(?:\.\d+)?$/;
|
|
518
|
+
const ISO_8601_TIMESTAMP_SCHEMA = z.iso.datetime({ offset: true });
|
|
519
|
+
function formatEpochSeconds(milliseconds) {
|
|
520
|
+
const seconds = milliseconds / 1e3;
|
|
521
|
+
if (Number.isInteger(seconds)) return String(seconds);
|
|
522
|
+
return seconds.toFixed(3).replace(/0+$/, "").replace(/\.$/, "");
|
|
523
|
+
}
|
|
524
|
+
function normalizeSlackReadTimestamp(raw, field) {
|
|
525
|
+
const trimmed = raw?.trim();
|
|
526
|
+
if (!trimmed) return;
|
|
527
|
+
if (SLACK_TIMESTAMP_RE.test(trimmed)) return trimmed;
|
|
528
|
+
if (!ISO_8601_TIMESTAMP_SCHEMA.safeParse(trimmed).success) throw new Error(`Invalid Slack read ${field} timestamp "${trimmed}": expected a Slack timestamp or ISO-8601 date string`);
|
|
529
|
+
const parsed = Date.parse(trimmed);
|
|
530
|
+
if (!Number.isFinite(parsed)) throw new Error(`Invalid Slack read ${field} timestamp "${trimmed}": expected a Slack timestamp or ISO-8601 date string`);
|
|
531
|
+
return formatEpochSeconds(parsed);
|
|
532
|
+
}
|
|
533
|
+
function hasSlackPlatformError(err, code) {
|
|
534
|
+
if (!err || typeof err !== "object") return false;
|
|
535
|
+
const data = err.data;
|
|
536
|
+
if (!data || typeof data !== "object") return false;
|
|
537
|
+
return data.error === code;
|
|
538
|
+
}
|
|
539
|
+
async function getClient(opts = {}, mode = "read") {
|
|
540
|
+
if (opts.client) return opts.client;
|
|
541
|
+
const token = resolveToken(opts.token, opts.accountId, opts.cfg);
|
|
542
|
+
return mode === "write" ? getSlackWriteClient(token) : createSlackWebClient(token);
|
|
543
|
+
}
|
|
544
|
+
async function resolveBotUserId(client) {
|
|
545
|
+
const auth = await client.auth.test();
|
|
546
|
+
if (!auth?.user_id) throw new Error("Failed to resolve Slack bot user id");
|
|
547
|
+
return auth.user_id;
|
|
548
|
+
}
|
|
549
|
+
async function reactSlackMessage(channelId, messageId, emoji, opts = {}) {
|
|
550
|
+
const client = await getClient(opts, "write");
|
|
551
|
+
try {
|
|
552
|
+
await client.reactions.add({
|
|
553
|
+
channel: channelId,
|
|
554
|
+
timestamp: messageId,
|
|
555
|
+
name: normalizeEmoji(emoji)
|
|
556
|
+
});
|
|
557
|
+
} catch (err) {
|
|
558
|
+
if (hasSlackPlatformError(err, "already_reacted")) return;
|
|
559
|
+
throw err;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
async function removeSlackReaction(channelId, messageId, emoji, opts = {}) {
|
|
563
|
+
const client = await getClient(opts, "write");
|
|
564
|
+
try {
|
|
565
|
+
await client.reactions.remove({
|
|
566
|
+
channel: channelId,
|
|
567
|
+
timestamp: messageId,
|
|
568
|
+
name: normalizeEmoji(emoji)
|
|
569
|
+
});
|
|
570
|
+
} catch (err) {
|
|
571
|
+
if (hasSlackPlatformError(err, "no_reaction")) return;
|
|
572
|
+
throw err;
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
async function removeOwnSlackReactions(channelId, messageId, opts = {}) {
|
|
576
|
+
const client = await getClient(opts, "write");
|
|
577
|
+
const userId = await resolveBotUserId(client);
|
|
578
|
+
const reactions = await listSlackReactions(channelId, messageId, { client });
|
|
579
|
+
const toRemove = /* @__PURE__ */ new Set();
|
|
580
|
+
for (const reaction of reactions ?? []) {
|
|
581
|
+
const name = reaction?.name;
|
|
582
|
+
if (!name) continue;
|
|
583
|
+
if ((reaction?.users ?? []).includes(userId)) toRemove.add(name);
|
|
584
|
+
}
|
|
585
|
+
if (toRemove.size === 0) return [];
|
|
586
|
+
await Promise.all(Array.from(toRemove, (name) => removeSlackReaction(channelId, messageId, name, {
|
|
587
|
+
...opts,
|
|
588
|
+
client
|
|
589
|
+
})));
|
|
590
|
+
return Array.from(toRemove);
|
|
591
|
+
}
|
|
592
|
+
async function listSlackReactions(channelId, messageId, opts = {}) {
|
|
593
|
+
return (await (await getClient(opts)).reactions.get({
|
|
594
|
+
channel: channelId,
|
|
595
|
+
timestamp: messageId,
|
|
596
|
+
full: true
|
|
597
|
+
})).message?.reactions ?? [];
|
|
598
|
+
}
|
|
599
|
+
async function sendSlackMessage(to, content, opts) {
|
|
600
|
+
return await sendMessageSlack(to, content, {
|
|
601
|
+
accountId: opts.accountId,
|
|
602
|
+
cfg: opts.cfg,
|
|
603
|
+
token: opts.token,
|
|
604
|
+
mediaUrl: opts.mediaUrl,
|
|
605
|
+
mediaAccess: opts.mediaAccess,
|
|
606
|
+
mediaLocalRoots: opts.mediaLocalRoots,
|
|
607
|
+
mediaReadFile: opts.mediaReadFile,
|
|
608
|
+
client: opts.client,
|
|
609
|
+
threadTs: opts.threadTs,
|
|
610
|
+
replyBroadcast: opts.replyBroadcast,
|
|
611
|
+
...opts.uploadFileName ? { uploadFileName: opts.uploadFileName } : {},
|
|
612
|
+
...opts.uploadTitle ? { uploadTitle: opts.uploadTitle } : {},
|
|
613
|
+
blocks: opts.blocks
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
async function editSlackMessage(channelId, messageId, content, opts = {}) {
|
|
617
|
+
const client = await getClient(opts, "write");
|
|
618
|
+
const blocks = opts.blocks == null ? void 0 : validateSlackBlocksArray(opts.blocks);
|
|
619
|
+
await client.chat.update({
|
|
620
|
+
channel: channelId,
|
|
621
|
+
ts: messageId,
|
|
622
|
+
text: buildSlackEditTextPayload(content, blocks),
|
|
623
|
+
...blocks ? { blocks } : {}
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
async function deleteSlackMessage(channelId, messageId, opts = {}) {
|
|
627
|
+
await (await getClient(opts, "write")).chat.delete({
|
|
628
|
+
channel: channelId,
|
|
629
|
+
ts: messageId
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
async function readSlackMessages(channelId, opts = {}) {
|
|
633
|
+
const exactMessageId = opts.messageId?.trim();
|
|
634
|
+
const readLimit = exactMessageId ? 1 : opts.limit;
|
|
635
|
+
const exactBounds = exactMessageId ? {
|
|
636
|
+
inclusive: true,
|
|
637
|
+
latest: exactMessageId,
|
|
638
|
+
oldest: void 0
|
|
639
|
+
} : {
|
|
640
|
+
latest: normalizeSlackReadTimestamp(opts.before, "before"),
|
|
641
|
+
oldest: normalizeSlackReadTimestamp(opts.after, "after")
|
|
642
|
+
};
|
|
643
|
+
const client = await getClient(opts);
|
|
644
|
+
if (opts.threadId) {
|
|
645
|
+
const result = await client.conversations.replies({
|
|
646
|
+
channel: channelId,
|
|
647
|
+
ts: opts.threadId,
|
|
648
|
+
limit: readLimit,
|
|
649
|
+
...exactBounds
|
|
650
|
+
});
|
|
651
|
+
return {
|
|
652
|
+
messages: (result.messages ?? []).filter((message) => {
|
|
653
|
+
if (exactMessageId) return message.ts === exactMessageId;
|
|
654
|
+
return message.ts !== opts.threadId;
|
|
655
|
+
}),
|
|
656
|
+
hasMore: exactMessageId ? false : Boolean(result.has_more)
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
const result = await client.conversations.history({
|
|
660
|
+
channel: channelId,
|
|
661
|
+
limit: readLimit,
|
|
662
|
+
...exactBounds
|
|
663
|
+
});
|
|
664
|
+
return {
|
|
665
|
+
messages: (result.messages ?? []).filter((message) => !exactMessageId || message.ts === exactMessageId),
|
|
666
|
+
hasMore: exactMessageId ? false : Boolean(result.has_more)
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
async function getSlackMemberInfo(userId, opts = {}) {
|
|
670
|
+
return await (await getClient(opts)).users.info({ user: userId });
|
|
671
|
+
}
|
|
672
|
+
async function listSlackEmojis(opts = {}) {
|
|
673
|
+
return await (await getClient(opts)).emoji.list();
|
|
674
|
+
}
|
|
675
|
+
async function pinSlackMessage(channelId, messageId, opts = {}) {
|
|
676
|
+
await (await getClient(opts, "write")).pins.add({
|
|
677
|
+
channel: channelId,
|
|
678
|
+
timestamp: messageId
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
async function unpinSlackMessage(channelId, messageId, opts = {}) {
|
|
682
|
+
await (await getClient(opts, "write")).pins.remove({
|
|
683
|
+
channel: channelId,
|
|
684
|
+
timestamp: messageId
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
async function listSlackPins(channelId, opts = {}) {
|
|
688
|
+
return (await (await getClient(opts)).pins.list({ channel: channelId })).items ?? [];
|
|
689
|
+
}
|
|
690
|
+
function normalizeSlackScopeValue(value) {
|
|
691
|
+
const trimmed = value?.trim();
|
|
692
|
+
return trimmed ? trimmed : void 0;
|
|
693
|
+
}
|
|
694
|
+
function collectSlackDirectShareChannelIds(file) {
|
|
695
|
+
const ids = /* @__PURE__ */ new Set();
|
|
696
|
+
for (const group of [
|
|
697
|
+
file.channels,
|
|
698
|
+
file.groups,
|
|
699
|
+
file.ims
|
|
700
|
+
]) {
|
|
701
|
+
if (!Array.isArray(group)) continue;
|
|
702
|
+
for (const entry of group) {
|
|
703
|
+
if (typeof entry !== "string") continue;
|
|
704
|
+
const normalized = normalizeSlackScopeValue(entry);
|
|
705
|
+
if (normalized) ids.add(normalized);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
return ids;
|
|
709
|
+
}
|
|
710
|
+
function collectSlackShareMaps(file) {
|
|
711
|
+
if (!file.shares || typeof file.shares !== "object" || Array.isArray(file.shares)) return [];
|
|
712
|
+
const shares = file.shares;
|
|
713
|
+
return [shares.public, shares.private].filter((value) => Boolean(value) && typeof value === "object" && !Array.isArray(value));
|
|
714
|
+
}
|
|
715
|
+
function collectSlackSharedChannelIds(file) {
|
|
716
|
+
const ids = /* @__PURE__ */ new Set();
|
|
717
|
+
for (const shareMap of collectSlackShareMaps(file)) for (const channelId of Object.keys(shareMap)) {
|
|
718
|
+
const normalized = normalizeSlackScopeValue(channelId);
|
|
719
|
+
if (normalized) ids.add(normalized);
|
|
720
|
+
}
|
|
721
|
+
return ids;
|
|
722
|
+
}
|
|
723
|
+
function collectSlackThreadShares(file, channelId) {
|
|
724
|
+
const matches = [];
|
|
725
|
+
for (const shareMap of collectSlackShareMaps(file)) {
|
|
726
|
+
const rawEntries = shareMap[channelId];
|
|
727
|
+
if (!Array.isArray(rawEntries)) continue;
|
|
728
|
+
for (const rawEntry of rawEntries) {
|
|
729
|
+
if (!rawEntry || typeof rawEntry !== "object" || Array.isArray(rawEntry)) continue;
|
|
730
|
+
const entry = rawEntry;
|
|
731
|
+
const ts = typeof entry.ts === "string" ? normalizeSlackScopeValue(entry.ts) : void 0;
|
|
732
|
+
const threadTs = typeof entry.thread_ts === "string" ? normalizeSlackScopeValue(entry.thread_ts) : void 0;
|
|
733
|
+
matches.push({
|
|
734
|
+
channelId,
|
|
735
|
+
ts,
|
|
736
|
+
threadTs
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return matches;
|
|
741
|
+
}
|
|
742
|
+
function hasSlackScopeMismatch(params) {
|
|
743
|
+
const channelId = normalizeSlackScopeValue(params.channelId);
|
|
744
|
+
if (!channelId) return false;
|
|
745
|
+
const threadId = normalizeSlackScopeValue(params.threadId);
|
|
746
|
+
const directIds = collectSlackDirectShareChannelIds(params.file);
|
|
747
|
+
const sharedIds = collectSlackSharedChannelIds(params.file);
|
|
748
|
+
const hasChannelEvidence = directIds.size > 0 || sharedIds.size > 0;
|
|
749
|
+
const inChannel = directIds.has(channelId) || sharedIds.has(channelId);
|
|
750
|
+
if (hasChannelEvidence && !inChannel) return true;
|
|
751
|
+
if (!threadId) return false;
|
|
752
|
+
const threadShares = collectSlackThreadShares(params.file, channelId);
|
|
753
|
+
if (threadShares.length === 0) return false;
|
|
754
|
+
const threadEvidence = threadShares.filter((entry) => entry.threadTs || entry.ts);
|
|
755
|
+
if (threadEvidence.length === 0) return false;
|
|
756
|
+
return !threadEvidence.some((entry) => entry.threadTs === threadId || entry.ts === threadId);
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Downloads a Slack file by ID and saves it to the local media store.
|
|
760
|
+
* Fetches a fresh download URL via files.info to avoid using stale private URLs.
|
|
761
|
+
* Returns null when the file cannot be found or downloaded.
|
|
762
|
+
*/
|
|
763
|
+
async function downloadSlackFile(fileId, opts) {
|
|
764
|
+
const token = resolveToken(opts.token, opts.accountId, opts.cfg);
|
|
765
|
+
const file = (await (await getClient(opts)).files.info({ file: fileId })).file;
|
|
766
|
+
if (!file?.url_private_download && !file?.url_private) return null;
|
|
767
|
+
if (hasSlackScopeMismatch({
|
|
768
|
+
file,
|
|
769
|
+
channelId: opts.channelId,
|
|
770
|
+
threadId: opts.threadId
|
|
771
|
+
})) return null;
|
|
772
|
+
return (await resolveSlackMedia({
|
|
773
|
+
files: [{
|
|
774
|
+
id: file.id,
|
|
775
|
+
name: file.name,
|
|
776
|
+
mimetype: file.mimetype,
|
|
777
|
+
url_private: file.url_private,
|
|
778
|
+
url_private_download: file.url_private_download
|
|
779
|
+
}],
|
|
780
|
+
token,
|
|
781
|
+
maxBytes: opts.maxBytes
|
|
782
|
+
}))?.[0] ?? null;
|
|
783
|
+
}
|
|
784
|
+
//#endregion
|
|
785
|
+
export { resolveSlackThreadStarter as _, listSlackEmojis as a, buildSlackEditTextPayload as b, pinSlackMessage as c, removeOwnSlackReactions as d, removeSlackReaction as f, resolveSlackThreadHistory as g, media_exports as h, getSlackMemberInfo as i, reactSlackMessage as l, unpinSlackMessage as m, downloadSlackFile as n, listSlackPins as o, sendSlackMessage as p, editSlackMessage as r, listSlackReactions as s, deleteSlackMessage as t, readSlackMessages as u, MAX_SLACK_MEDIA_FILES as v, formatSlackFileReference as y };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
1
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-BibhOXpJ.js";
|
|
2
2
|
export { deleteSlackMessage, downloadSlackFile, editSlackMessage, getSlackMemberInfo, listSlackEmojis, listSlackPins, listSlackReactions, pinSlackMessage, reactSlackMessage, readSlackMessages, removeOwnSlackReactions, removeSlackReaction, sendSlackMessage, unpinSlackMessage };
|
package/dist/api.js
CHANGED
|
@@ -2,20 +2,20 @@ import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resol
|
|
|
2
2
|
import { t as inspectSlackAccount } from "./account-inspect-BJyQLSkN.js";
|
|
3
3
|
import { i as resolveSlackChannelId, n as normalizeSlackMessagingTarget, r as parseSlackTarget, t as looksLikeSlackTargetId } from "./target-parsing-CQmv-iSm.js";
|
|
4
4
|
import "./targets-B1tYCAr6.js";
|
|
5
|
-
import { i as resolveSlackChannelType, n as buildSlackThreadingToolContext, o as resolveSlackAutoThreadId, r as __resetSlackChannelTypeCacheForTest, t as slackPlugin } from "./channel-
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import { n as
|
|
13
|
-
import { t as slackSetupPlugin } from "./channel.setup-
|
|
14
|
-
import { a as recordSlackThreadParticipation, n as clearSlackThreadParticipationCache, r as hasSlackThreadParticipation } from "./send-
|
|
15
|
-
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-
|
|
16
|
-
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-
|
|
17
|
-
import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath, t as handleSlackHttpRequest } from "./registry-
|
|
18
|
-
import { t as probeSlack } from "./probe-
|
|
19
|
-
import { t as collectSlackSecurityAuditFindings } from "./security-audit-
|
|
20
|
-
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-
|
|
5
|
+
import { i as resolveSlackChannelType, n as buildSlackThreadingToolContext, o as resolveSlackAutoThreadId, r as __resetSlackChannelTypeCacheForTest, t as slackPlugin } from "./channel-Dh07mU_K.js";
|
|
6
|
+
import { n as resolveSlackGroupRequireMention, r as resolveSlackGroupToolPolicy } from "./reply-blocks-BFaJ_ejG.js";
|
|
7
|
+
import { n as buildSlackPresentationBlocks, t as buildSlackInteractiveBlocks } from "./blocks-render-BAVfd6r0.js";
|
|
8
|
+
import { a as validateSlackBlocksArray, i as parseSlackBlocksInput, r as SLACK_MAX_BLOCKS } from "./thread-ts-As_dcNbD.js";
|
|
9
|
+
import { n as extractSlackToolSend, r as listSlackMessageActions } from "./message-tool-api-C7gc7goF.js";
|
|
10
|
+
import { n as isSlackInteractiveRepliesEnabled, r as parseSlackOptionsLine, t as compileSlackInteractiveReplies } from "./interactive-replies-BSg5hXhj.js";
|
|
11
|
+
import { a as getSlackWriteClient, c as resolveSlackWebClientOptions, i as createSlackWriteClient, l as resolveSlackWriteClientOptions, n as createSlackTokenCacheKey, o as SLACK_DEFAULT_RETRY_OPTIONS, r as createSlackWebClient, s as SLACK_WRITE_RETRY_OPTIONS, t as clearSlackWriteClientCacheForTest } from "./client-C_IaJbi5.js";
|
|
12
|
+
import { a as normalizeSlackSlug, i as normalizeSlackAllowOwnerEntry, n as normalizeAllowList, o as resolveSlackAllowListMatch, r as normalizeAllowListLower, s as resolveSlackUserAllowed, t as allowListMatches } from "./allow-list-nwXs_eCP.js";
|
|
13
|
+
import { t as slackSetupPlugin } from "./channel.setup-CmG37S2W.js";
|
|
14
|
+
import { a as recordSlackThreadParticipation, n as clearSlackThreadParticipationCache, r as hasSlackThreadParticipation } from "./send-Dg9zcyYT.js";
|
|
15
|
+
import { a as listSlackEmojis, c as pinSlackMessage, d as removeOwnSlackReactions, f as removeSlackReaction, i as getSlackMemberInfo, l as reactSlackMessage, m as unpinSlackMessage, n as downloadSlackFile, o as listSlackPins, p as sendSlackMessage, r as editSlackMessage, s as listSlackReactions, t as deleteSlackMessage, u as readSlackMessages } from "./actions-BibhOXpJ.js";
|
|
16
|
+
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-CMvFiswf.js";
|
|
17
|
+
import { n as registerSlackHttpHandler, r as normalizeSlackWebhookPath, t as handleSlackHttpRequest } from "./registry-D2cWOLZV.js";
|
|
18
|
+
import { t as probeSlack } from "./probe-FL4sUJsH.js";
|
|
19
|
+
import { t as collectSlackSecurityAuditFindings } from "./security-audit-BJzADAw3.js";
|
|
20
|
+
import { n as resolveSlackRuntimeGroupPolicy } from "./provider-C6WxaFFf.js";
|
|
21
21
|
export { SLACK_DEFAULT_RETRY_OPTIONS, SLACK_MAX_BLOCKS, SLACK_WRITE_RETRY_OPTIONS, __resetSlackChannelTypeCacheForTest, allowListMatches, buildSlackInteractiveBlocks, buildSlackPresentationBlocks, buildSlackThreadingToolContext, clearSlackThreadParticipationCache, clearSlackWriteClientCacheForTest, collectSlackSecurityAuditFindings, compileSlackInteractiveReplies, createSlackTokenCacheKey, createSlackWebClient, createSlackWriteClient, deleteSlackMessage, downloadSlackFile, editSlackMessage, extractSlackToolSend, getSlackMemberInfo, getSlackWriteClient, handleSlackHttpRequest, hasSlackThreadParticipation, inspectSlackAccount, isSlackInteractiveRepliesEnabled, listEnabledSlackAccounts, listSlackAccountIds, listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig, listSlackEmojis, listSlackMessageActions, listSlackPins, listSlackReactions, looksLikeSlackTargetId, mergeSlackAccountConfig, normalizeAllowList, normalizeAllowListLower, normalizeSlackAllowOwnerEntry, normalizeSlackMessagingTarget, normalizeSlackSlug, normalizeSlackWebhookPath, parseSlackBlocksInput, parseSlackOptionsLine, parseSlackTarget, pinSlackMessage, probeSlack, reactSlackMessage, readSlackMessages, recordSlackThreadParticipation, registerSlackHttpHandler, removeOwnSlackReactions, removeSlackReaction, resolveDefaultSlackAccountId, resolveSlackAccount, resolveSlackAllowListMatch, resolveSlackAutoThreadId, resolveSlackChannelId, resolveSlackChannelType, resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy, resolveSlackReplyToMode, resolveSlackRuntimeGroupPolicy, resolveSlackUserAllowed, resolveSlackWebClientOptions, resolveSlackWriteClientOptions, sendSlackMessage, slackPlugin, slackSetupPlugin, unpinSlackMessage, validateSlackBlocksArray };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as sendMessageSlack } from "./send-ioky2Xpy.js";
|
|
1
|
+
import { c as normalizeSlackApproverId, s as isSlackExecApprovalClientEnabled, t as resolveSlackReplyBlocks, u as shouldHandleSlackExecApprovalRequest } from "./reply-blocks-BFaJ_ejG.js";
|
|
2
|
+
import { s as truncateSlackText } from "./thread-ts-As_dcNbD.js";
|
|
3
|
+
import { t as sendMessageSlack } from "./send-Dg9zcyYT.js";
|
|
5
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
5
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
|
7
6
|
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as truncateSlackText } from "./thread-ts-As_dcNbD.js";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { presentationToInteractiveControlsReply, reduceInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
|
|
4
4
|
//#region extensions/slack/src/reply-action-ids.ts
|
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import { a as resolveSlackAccount, i as resolveDefaultSlackAccountId, l as resolveSlackReplyToMode, n as listSlackAccountIds, o as resolveSlackAccountAllowFrom } from "./accounts-yk5K3wQU.js";
|
|
2
2
|
import { i as resolveSlackChannelId, n as normalizeSlackMessagingTarget, r as parseSlackTarget, t as looksLikeSlackTargetId } from "./target-parsing-CQmv-iSm.js";
|
|
3
3
|
import "./targets-B1tYCAr6.js";
|
|
4
|
-
import { a as resolveSlackExecApprovalTarget, n as
|
|
5
|
-
import { t as
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import { n as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { r as
|
|
13
|
-
import { n as
|
|
14
|
-
import { t as resolveSlackReplyBlocks } from "./reply-blocks-DWoZrUll.js";
|
|
15
|
-
import { t as getOptionalSlackRuntime } from "./runtime--VlVtTPu.js";
|
|
16
|
-
import { i as slackSecurityAdapter, n as isSlackPluginAccountConfigured, r as slackConfigAdapter, t as createSlackPluginBase } from "./shared-CSiHkaVO.js";
|
|
17
|
-
import { i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, r as slackSetupAdapter } from "./setup-core-DgLJ7dQY.js";
|
|
4
|
+
import { a as getSlackExecApprovalApprovers, d as shouldSuppressLocalSlackExecApprovalPrompt, i as isSlackApprovalAuthorizedSender, l as resolveSlackExecApprovalTarget, n as resolveSlackGroupRequireMention, o as isSlackExecApprovalAuthorizedSender, r as resolveSlackGroupToolPolicy, s as isSlackExecApprovalClientEnabled, t as resolveSlackReplyBlocks, u as shouldHandleSlackExecApprovalRequest } from "./reply-blocks-BFaJ_ejG.js";
|
|
5
|
+
import { n as buildSlackPresentationBlocks, r as resolveSlackInteractiveBlockOffsets, t as buildSlackInteractiveBlocks } from "./blocks-render-BAVfd6r0.js";
|
|
6
|
+
import { n as resolveSlackThreadTsValue, o as SLACK_TEXT_LIMIT, t as normalizeSlackThreadTsCandidate } from "./thread-ts-As_dcNbD.js";
|
|
7
|
+
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-C7gc7goF.js";
|
|
8
|
+
import { n as isSlackInteractiveRepliesEnabled, t as compileSlackInteractiveReplies } from "./interactive-replies-BSg5hXhj.js";
|
|
9
|
+
import { d as PAIRING_APPROVED_MESSAGE, m as resolveConfiguredFromRequiredCredentialStatuses, p as projectCredentialSnapshotFields, r as createSlackWebClient, u as DEFAULT_ACCOUNT_ID } from "./client-C_IaJbi5.js";
|
|
10
|
+
import { r as normalizeAllowListLower } from "./allow-list-nwXs_eCP.js";
|
|
11
|
+
import { t as getOptionalSlackRuntime } from "./runtime-DQxkf7k2.js";
|
|
12
|
+
import { i as slackSecurityAdapter, n as isSlackPluginAccountConfigured, r as slackConfigAdapter, t as createSlackPluginBase } from "./shared-GoB-OuUq.js";
|
|
13
|
+
import { i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, r as slackSetupAdapter } from "./setup-core-WWQl-cE9.js";
|
|
18
14
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
19
15
|
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
20
16
|
import { buildOutboundBaseSessionKey } from "openclaw/plugin-sdk/routing";
|
|
@@ -177,7 +173,7 @@ const slackApprovalCapability = createApproverRestrictedNativeApprovalCapability
|
|
|
177
173
|
accountId,
|
|
178
174
|
request
|
|
179
175
|
}),
|
|
180
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
176
|
+
load: async () => (await import("./approval-handler.runtime-BjzVRaXN.js")).slackApprovalNativeRuntime
|
|
181
177
|
})
|
|
182
178
|
});
|
|
183
179
|
splitChannelApprovalCapability(slackApprovalCapability);
|
|
@@ -344,7 +340,7 @@ async function handleSlackMessageAction(params) {
|
|
|
344
340
|
//#region extensions/slack/src/channel-actions.ts
|
|
345
341
|
let slackActionRuntimePromise$1;
|
|
346
342
|
async function loadSlackActionRuntime$1() {
|
|
347
|
-
slackActionRuntimePromise$1 ??= import("./action-runtime.runtime-
|
|
343
|
+
slackActionRuntimePromise$1 ??= import("./action-runtime.runtime-DLhfKw4B.js");
|
|
348
344
|
return await slackActionRuntimePromise$1;
|
|
349
345
|
}
|
|
350
346
|
function resolveSlackActionContext(params) {
|
|
@@ -468,9 +464,9 @@ const EXTENSION_SHARED_MODULE_ID = "openclaw/plugin-sdk/extension-shared";
|
|
|
468
464
|
const TARGET_RESOLVER_RUNTIME_MODULE_ID = "openclaw/plugin-sdk/target-resolver-runtime";
|
|
469
465
|
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import(EXTENSION_SHARED_MODULE_ID));
|
|
470
466
|
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import(TARGET_RESOLVER_RUNTIME_MODULE_ID));
|
|
471
|
-
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-
|
|
472
|
-
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-
|
|
473
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-
|
|
467
|
+
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-BLoTgna4.js"));
|
|
468
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-Bvg_ZzqZ.js"));
|
|
469
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-BluPNDNi.js").then((n) => n.t));
|
|
474
470
|
async function resolveSlackHandleAction() {
|
|
475
471
|
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? (await loadSlackActionRuntime()).handleSlackAction;
|
|
476
472
|
}
|
|
@@ -490,27 +486,27 @@ let slackSendRuntimePromise;
|
|
|
490
486
|
let slackProbeModulePromise;
|
|
491
487
|
let slackMonitorModulePromise;
|
|
492
488
|
let slackDirectoryLiveModulePromise;
|
|
493
|
-
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
494
|
-
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
495
|
-
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
489
|
+
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-CMvFiswf.js").then((n) => n.t));
|
|
490
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-B_eKaOkE.js").then((n) => n.n));
|
|
491
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-BzBAJwvq.js").then((n) => n.n));
|
|
496
492
|
async function loadSlackActionRuntime() {
|
|
497
|
-
slackActionRuntimePromise ??= import("./action-runtime.runtime-
|
|
493
|
+
slackActionRuntimePromise ??= import("./action-runtime.runtime-DLhfKw4B.js");
|
|
498
494
|
return await slackActionRuntimePromise;
|
|
499
495
|
}
|
|
500
496
|
async function loadSlackSendRuntime() {
|
|
501
|
-
slackSendRuntimePromise ??= import("./send.runtime-
|
|
497
|
+
slackSendRuntimePromise ??= import("./send.runtime-E47jGN-2.js");
|
|
502
498
|
return await slackSendRuntimePromise;
|
|
503
499
|
}
|
|
504
500
|
async function loadSlackProbeModule() {
|
|
505
|
-
slackProbeModulePromise ??= import("./probe-
|
|
501
|
+
slackProbeModulePromise ??= import("./probe-FL4sUJsH.js").then((n) => n.n);
|
|
506
502
|
return await slackProbeModulePromise;
|
|
507
503
|
}
|
|
508
504
|
async function loadSlackMonitorModule() {
|
|
509
|
-
slackMonitorModulePromise ??= import("./monitor-
|
|
505
|
+
slackMonitorModulePromise ??= import("./monitor-DDE5AI2O.js").then((n) => n.t);
|
|
510
506
|
return await slackMonitorModulePromise;
|
|
511
507
|
}
|
|
512
508
|
async function loadSlackDirectoryLiveModule() {
|
|
513
|
-
slackDirectoryLiveModulePromise ??= import("./directory-live-
|
|
509
|
+
slackDirectoryLiveModulePromise ??= import("./directory-live-CZPzpQZF.js").then((n) => n.t);
|
|
514
510
|
return await slackDirectoryLiveModulePromise;
|
|
515
511
|
}
|
|
516
512
|
async function resolveSlackSendContext(params) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-CNRousxw.js";
|
|
2
2
|
export { SlackChannelConfigSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as slackPlugin } from "./channel-
|
|
1
|
+
import { t as slackPlugin } from "./channel-Dh07mU_K.js";
|
|
2
2
|
export { slackPlugin };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as resolveSlackAccount, c as resolveSlackConfigAccessorAccount, i as resolveDefaultSlackAccountId, n as listSlackAccountIds } from "./accounts-yk5K3wQU.js";
|
|
2
|
-
import { a as describeSlackSetupAccount, i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, o as isSlackSetupAccountConfigured, r as slackSetupAdapter } from "./setup-core-
|
|
3
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
2
|
+
import { a as describeSlackSetupAccount, i as SLACK_CHANNEL, n as createSlackSetupWizardProxy, o as isSlackSetupAccountConfigured, r as slackSetupAdapter } from "./setup-core-WWQl-cE9.js";
|
|
3
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-CNRousxw.js";
|
|
4
4
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
5
5
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
6
6
|
//#region extensions/slack/src/channel.setup.ts
|
|
7
|
-
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-
|
|
7
|
+
const slackSetupWizard = createSlackSetupWizardProxy(async () => ({ slackSetupWizard: (await import("./setup-surface-BLoTgna4.js")).slackSetupWizard }));
|
|
8
8
|
const slackSetupConfigAdapter = createScopedChannelConfigAdapter({
|
|
9
9
|
sectionKey: SLACK_CHANNEL,
|
|
10
10
|
listAccountIds: listSlackAccountIds,
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
+
import "./target-parsing-CQmv-iSm.js";
|
|
2
|
+
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
|
|
3
|
+
import { PAIRING_APPROVED_MESSAGE, projectCredentialSnapshotFields, resolveConfiguredFromRequiredCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
|
|
1
4
|
import { createHash } from "node:crypto";
|
|
2
5
|
import { WebClient } from "@slack/web-api";
|
|
3
6
|
import { HttpsProxyAgent } from "https-proxy-agent";
|
|
4
7
|
import { resolveEnvHttpProxyUrl } from "openclaw/plugin-sdk/fetch-runtime";
|
|
8
|
+
//#region extensions/slack/src/channel-api.ts
|
|
9
|
+
const SLACK_CHANNEL_META = {
|
|
10
|
+
id: "slack",
|
|
11
|
+
label: "Slack",
|
|
12
|
+
selectionLabel: "Slack",
|
|
13
|
+
docsPath: "/channels/slack",
|
|
14
|
+
docsLabel: "slack",
|
|
15
|
+
blurb: "supports bot + app tokens, channels, threads, and interactive replies.",
|
|
16
|
+
systemImage: "number.square",
|
|
17
|
+
markdownCapable: true
|
|
18
|
+
};
|
|
19
|
+
function getChatChannelMeta(id) {
|
|
20
|
+
if (id !== SLACK_CHANNEL_META.id) throw new Error(`Unsupported Slack channel meta lookup: ${id}`);
|
|
21
|
+
return SLACK_CHANNEL_META;
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
5
24
|
//#region extensions/slack/src/client-options.ts
|
|
6
25
|
const SLACK_DEFAULT_RETRY_OPTIONS = {
|
|
7
26
|
retries: 2,
|
|
@@ -100,4 +119,4 @@ function clearSlackWriteClientCacheForTest() {
|
|
|
100
119
|
slackWriteClientCache.clear();
|
|
101
120
|
}
|
|
102
121
|
//#endregion
|
|
103
|
-
export { getSlackWriteClient as a, resolveSlackWebClientOptions as c, createSlackWriteClient as i, resolveSlackWriteClientOptions as l, createSlackTokenCacheKey as n, SLACK_DEFAULT_RETRY_OPTIONS as o, createSlackWebClient as r, SLACK_WRITE_RETRY_OPTIONS as s, clearSlackWriteClientCacheForTest as t };
|
|
122
|
+
export { getSlackWriteClient as a, resolveSlackWebClientOptions as c, PAIRING_APPROVED_MESSAGE as d, getChatChannelMeta as f, createSlackWriteClient as i, resolveSlackWriteClientOptions as l, resolveConfiguredFromRequiredCredentialStatuses as m, createSlackTokenCacheKey as n, SLACK_DEFAULT_RETRY_OPTIONS as o, projectCredentialSnapshotFields as p, createSlackWebClient as r, SLACK_WRITE_RETRY_OPTIONS as s, clearSlackWriteClientCacheForTest as t, DEFAULT_ACCOUNT_ID$1 as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as buildChannelConfigSchema, t as SlackConfigSchema } from "./config-api-
|
|
1
|
+
import { n as buildChannelConfigSchema, t as SlackConfigSchema } from "./config-api-CmgE_ORg.js";
|
|
2
2
|
//#endregion
|
|
3
3
|
//#region extensions/slack/src/config-schema.ts
|
|
4
4
|
const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { uiHints: {
|
package/dist/contract-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
2
|
-
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
3
|
-
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-
|
|
4
|
-
import { t as collectSlackSecurityAuditFindings } from "./security-audit-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-B8QIWMs1.js";
|
|
2
|
+
import { n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-0TL3L5Kb.js";
|
|
3
|
+
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-CMvFiswf.js";
|
|
4
|
+
import { t as collectSlackSecurityAuditFindings } from "./security-audit-BJzADAw3.js";
|
|
5
5
|
export { collectRuntimeConfigAssignments, collectSlackSecurityAuditFindings, legacyConfigRules, listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig, normalizeCompatibilityConfig, secretTargetRegistryEntries };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-
|
|
1
|
+
import { n as listSlackDirectoryGroupsFromConfig, r as listSlackDirectoryPeersFromConfig } from "./directory-config-CMvFiswf.js";
|
|
2
2
|
export { listSlackDirectoryGroupsFromConfig, listSlackDirectoryPeersFromConfig };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-CiIaOW0V.js";
|
|
2
2
|
import { a as resolveSlackAccount } from "./accounts-yk5K3wQU.js";
|
|
3
|
-
import { r as createSlackWebClient } from "./client-
|
|
3
|
+
import { r as createSlackWebClient } from "./client-C_IaJbi5.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
//#region extensions/slack/src/directory-live.ts
|
|
6
6
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as resolveSlackNativeStreaming, r as resolveSlackStreamingMode } from "./streaming-compat-
|
|
1
|
+
import { n as resolveSlackNativeStreaming, r as resolveSlackStreamingMode } from "./streaming-compat-eu5Rj5gj.js";
|
|
2
2
|
import { asObjectRecord, hasLegacyAccountStreamingAliases, hasLegacyStreamingAliases, normalizeLegacyChannelAliases } from "openclaw/plugin-sdk/runtime-doctor";
|
|
3
3
|
//#region extensions/slack/src/doctor-contract.ts
|
|
4
4
|
function hasLegacySlackStreamingAliases(value) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
1
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-B8QIWMs1.js";
|
|
2
2
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|