@openclaw/slack 2026.9.8 → 2026.10.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{account-inspect-DWBXpER6.mjs → account-inspect-Cs-7DXXW.mjs} +1 -1
- package/dist/.setup/{accounts-D_N9IqNA.mjs → accounts-CDgkV7Cm.mjs} +4 -16
- package/dist/.setup/{action-runtime-DfWvuiZd.mjs → action-runtime-DJ1daRAZ.mjs} +5 -7
- package/dist/.setup/action-runtime.runtime-CdWL2mLC.mjs +2 -0
- package/dist/.setup/{actions-Df0CzcDl.mjs → actions-DDoAJnrH.mjs} +16 -35
- package/dist/.setup/{approval-handler.runtime-Ed6Sw5VK.mjs → approval-handler.runtime-BcE_shWc.mjs} +5 -5
- package/dist/.setup/{approval-message-updates-BadvtA7R.mjs → approval-message-updates-EgKGmFXx.mjs} +1 -1
- package/dist/.setup/{channel-C7bgPSTE.mjs → channel-DgKSu8Iv.mjs} +46 -48
- package/dist/.setup/{channel-type-ClOttrZ5.mjs → channel-type-B9zYYzBU.mjs} +4 -4
- package/dist/.setup/{channel.setup-Dh2jzAjN.mjs → channel.setup-BYIlwbQ7.mjs} +27 -27
- package/dist/.setup/{config-schema-BZCxmHKG.mjs → config-schema-BH0K9-Um.mjs} +4 -0
- package/dist/.setup/{directory-config-BOUWH3hR.mjs → directory-config-B_by7zrc.mjs} +2 -2
- package/dist/.setup/{directory-live-B2O4B_Ho.mjs → directory-live-C48wazJt.mjs} +3 -3
- package/dist/.setup/{doctor-contract-CRN1Z_c7.mjs → doctor-contract-Cd4-VzIM.mjs} +28 -28
- package/dist/.setup/{message-tool-api-Cu4lwlGy.mjs → message-tool-api-CcjLPN3v.mjs} +2 -2
- package/dist/.setup/{monitor-BPVfkumU.mjs → monitor-BuYBDmm7.mjs} +190 -315
- package/dist/.setup/{outbound-adapter-Bv48XUjq.mjs → outbound-adapter-BZFkK-mw.mjs} +6 -17
- package/dist/.setup/{pipeline.runtime-B1H63Frf.mjs → pipeline.runtime-CIepKmZt.mjs} +241 -247
- package/dist/.setup/{policy-D-jfM174.mjs → policy-KKTqEiDv.mjs} +12 -22
- package/dist/.setup/{probe-B2Y9qc_z.mjs → probe-BVlJ3dp0.mjs} +4 -7
- package/dist/.setup/{relay-source-BpKdjsll.mjs → relay-source-CC3h6M7y.mjs} +2 -2
- package/dist/.setup/{replies-BAnUtr2f.mjs → replies-DHbuthIR.mjs} +12 -26
- package/dist/.setup/{reply-blocks-SE1kTE3I.mjs → reply-blocks-CKnO4BSG.mjs} +4 -29
- package/dist/.setup/{resolve-channels-XXBn8UU_.mjs → resolve-channels-HR0TgArR.mjs} +2 -2
- package/dist/.setup/{resolve-users-DW0ngD03.mjs → resolve-users-BNYBhF0q.mjs} +4 -4
- package/dist/.setup/rolldown-runtime-B4FMCO8f.mjs +28 -0
- package/dist/.setup/{scopes-CasuDvaa.mjs → scopes-DrDbyUH2.mjs} +1 -1
- package/dist/.setup/secret-contract-B-Qm6aQQ.mjs +65 -0
- package/dist/.setup/{secret-contract-api-Dp6290Vg.mjs → secret-contract-api-DmUVxIRs.mjs} +1 -1
- package/dist/.setup/{security-audit-BqDc-6VL.mjs → security-audit-C1nOGzJa.mjs} +1 -1
- package/dist/.setup/{send-BOVLQi3n.mjs → send-CgPI3Zj8.mjs} +22 -53
- package/dist/.setup/{session-status-DscajIsd.mjs → session-status-D46GHwOV.mjs} +39 -49
- package/dist/.setup/{setup-plugin-api-DTtbTKNk.mjs → setup-plugin-api-ZrHs0N4U.mjs} +1 -1
- package/dist/.setup/{setup-surface-Dn7QgWRE.mjs → setup-surface-83lxvE2y.mjs} +10 -13
- package/dist/.setup/{shared-qau-uDGl.mjs → shared-VtmYNj-v.mjs} +53 -57
- package/dist/.setup/{slash-dispatch.runtime--AEzLVBF.mjs → slash-dispatch.runtime-gBj_uaLM.mjs} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/api.js +13 -13
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/control-ui/2f4b1e827be6b68ced2ea0d8b7da8529a4eafbe72be27ee37e1064bdd530ec10/index.js +1 -0
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +10 -10
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +2 -2
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/undici/README.md +10 -1
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +9 -0
- package/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/undici/docs/docs/api/Fetch.md +10 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/docs/docs/index.md +10 -1
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/undici/lib/dispatcher/client.js +6 -1
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/undici/lib/web/fetch/index.js +46 -25
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/connection.js +33 -12
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +2 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +19 -4
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/diagnostics-channel.d.ts +2 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/webidl.d.ts +13 -7
- package/openclaw.plugin.json +4 -1
- package/package.json +14 -6
- package/dist/.setup/action-runtime.runtime-Ck4bAWOX.mjs +0 -2
- package/dist/.setup/secret-contract-BaZcu6P_.mjs +0 -82
- package/dist/.setup/streaming-compat-C5Wut626.mjs +0 -62
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as hasSlackAccountCredentials } from "./account-configured-sUohAxZr.mjs";
|
|
2
|
-
import { a as mergeSlackAccountConfig, o as resolveDefaultSlackAccountId } from "./accounts-
|
|
2
|
+
import { a as mergeSlackAccountConfig, o as resolveDefaultSlackAccountId } from "./accounts-CDgkV7Cm.mjs";
|
|
3
3
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
4
4
|
import { hasConfiguredSecretInput, normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { t as hasSlackAccountCredentials } from "./account-configured-sUohAxZr.mjs";
|
|
3
3
|
import { DEFAULT_ACCOUNT_ID, createAccountListHelpers, hasConfiguredAccountValue, normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
4
4
|
import { normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
5
|
-
import {
|
|
5
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { mapAllowFromEntries, normalizeChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
7
7
|
import { resolveAccountEntry } from "openclaw/plugin-sdk/routing";
|
|
8
8
|
import { normalizeChatType } from "openclaw/plugin-sdk/account-core";
|
|
@@ -83,19 +83,7 @@ const resolveDefaultSlackAccountId = resolveDefaultAccountId;
|
|
|
83
83
|
function resolveSlackAccountConfig(cfg, accountId) {
|
|
84
84
|
return resolveAccountEntry(cfg.channels?.slack?.accounts, accountId);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return asOptionalRecord(value);
|
|
88
|
-
}
|
|
89
|
-
function asLegacyStreamingScalar(value) {
|
|
90
|
-
return typeof value === "boolean" || typeof value === "string" ? value : void 0;
|
|
91
|
-
}
|
|
92
|
-
function mergeSlackStreamingConfig(base, account) {
|
|
93
|
-
const accountObject = asStreamingConfigObject(account);
|
|
94
|
-
if (account !== void 0 && !accountObject) return asLegacyStreamingScalar(account);
|
|
95
|
-
const baseObject = asStreamingConfigObject(base);
|
|
96
|
-
if (base !== void 0 && !baseObject) return accountObject ?? asLegacyStreamingScalar(base);
|
|
97
|
-
const baseConfig = baseObject;
|
|
98
|
-
const accountConfig = accountObject;
|
|
86
|
+
function mergeSlackStreamingConfig(baseConfig, accountConfig) {
|
|
99
87
|
if (!baseConfig || !accountConfig) return accountConfig ?? baseConfig;
|
|
100
88
|
return {
|
|
101
89
|
...baseConfig,
|
|
@@ -121,7 +109,7 @@ function mergeSlackStreamingConfig(base, account) {
|
|
|
121
109
|
function mergeSlackAccountConfig(cfg, accountId) {
|
|
122
110
|
const accountConfig = resolveSlackAccountConfig(cfg, accountId);
|
|
123
111
|
const merged = resolveMergedSlackAccountConfig(cfg, accountId);
|
|
124
|
-
const streaming = mergeSlackStreamingConfig(
|
|
112
|
+
const streaming = mergeSlackStreamingConfig(cfg.channels?.slack?.streaming, accountConfig?.streaming);
|
|
125
113
|
return streaming !== void 0 ? {
|
|
126
114
|
...merged,
|
|
127
115
|
streaming
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as parseSlackTarget, n as formatSlackTarget, o as resolveSlackChannelId } from "./target-parsing-FFE26kOV.mjs";
|
|
2
2
|
import { t as slackContextTargetsMatch } from "./targets-C6LZQL1Q.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-
|
|
3
|
+
import { At as getSlackInstallationKind, Bt as SLACK_PRIVATE_ACTION_DELIVERY_RESULT, Vt as resolveSlackAutoThreadId, f as assertSlackDetachedTargetAllowed, mt as parseSlackBlocksInput, r as buildSlackChannelIdCandidates, v as hasSlackNativeDataBlock } from "./session-status-D46GHwOV.mjs";
|
|
4
|
+
import { n as resolveSlackChannelConfig, t as isSlackChannelAllowedByPolicy } from "./policy-KKTqEiDv.mjs";
|
|
5
5
|
import { t as mergeSlackSendResults } from "./send-results-eeOu_HYm.mjs";
|
|
6
6
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
7
7
|
import { normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -27,10 +27,10 @@ const pinActions = /* @__PURE__ */ new Set([
|
|
|
27
27
|
"listPins"
|
|
28
28
|
]);
|
|
29
29
|
const SLACK_REACTION_RESULT_LIMIT = 100;
|
|
30
|
-
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions-
|
|
30
|
+
const loadSlackActionsRuntime = createLazyRuntimeModule(() => import("./actions-DDoAJnrH.mjs").then((n) => n.t));
|
|
31
31
|
const bindSlackAction = createLazyRuntimeMethodBinder(loadSlackActionsRuntime);
|
|
32
|
-
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts-
|
|
33
|
-
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-
|
|
32
|
+
const loadSlackAccountsRuntime = createLazyRuntimeModule(() => import("./accounts-CDgkV7Cm.mjs").then((n) => n.t));
|
|
33
|
+
const loadSlackChannelTypeRuntime = createLazyRuntimeModule(() => import("./channel-type-B9zYYzBU.mjs").then((n) => n.t));
|
|
34
34
|
const bindSlackChannelType = createLazyRuntimeMethodBinder(loadSlackChannelTypeRuntime);
|
|
35
35
|
const slackActionRuntime = {
|
|
36
36
|
deleteSlackMessage: bindSlackAction((runtime) => runtime.deleteSlackMessage),
|
|
@@ -47,9 +47,7 @@ const slackActionRuntime = {
|
|
|
47
47
|
readSlackMessages: bindSlackAction((runtime) => runtime.readSlackMessages),
|
|
48
48
|
removeOwnSlackReactions: bindSlackAction((runtime) => runtime.removeOwnSlackReactions),
|
|
49
49
|
removeSlackReaction: bindSlackAction((runtime) => runtime.removeSlackReaction),
|
|
50
|
-
resolveSlackConversationName: bindSlackAction((runtime) => runtime.resolveSlackConversationName),
|
|
51
50
|
resolveSlackConversationInfo: bindSlackChannelType((runtime) => runtime.resolveSlackConversationInfo),
|
|
52
|
-
resolveSlackChannelType: bindSlackChannelType((runtime) => runtime.resolveSlackChannelType),
|
|
53
51
|
sendSlackMessage: bindSlackAction((runtime) => runtime.sendSlackMessage),
|
|
54
52
|
unpinSlackMessage: bindSlackAction((runtime) => runtime.unpinSlackMessage)
|
|
55
53
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { h as resolveSlackBotToken, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { h as resolveSlackBotToken, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-CDgkV7Cm.mjs";
|
|
3
3
|
import { n as formatSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
4
|
-
import { A as countSlackTextUtf8Bytes, C as buildSlackBlocksFallbackText, E as SLACK_EDIT_TEXT_MAX_BYTES, M as truncateSlackTextByUtf8Bytes,
|
|
5
|
-
import { _ as getSlackWriteClient, h as createSlackWriteClient, u as createSlackLookupClient } from "./probe-
|
|
6
|
-
import {
|
|
4
|
+
import { A as countSlackTextUtf8Bytes, Bt as SLACK_PRIVATE_ACTION_DELIVERY_RESULT, C as buildSlackBlocksFallbackText, E as SLACK_EDIT_TEXT_MAX_BYTES, M as truncateSlackTextByUtf8Bytes, S as stripSlackNativeDataBlocks, T as renderSlackBlockFallbackText, Y as normalizeSlackOutboundText, f as assertSlackDetachedTargetAllowed, h as appendSlackNativeDataPlainTextFallback, ht as validateSlackBlocksArray, m as appendSlackNativeDataFallbackText, ot as escapeSlackMrkdwn, v as hasSlackNativeDataBlock, w as buildSlackCompleteBlocksFallbackText, y as isSlackInvalidBlocksError } from "./session-status-D46GHwOV.mjs";
|
|
5
|
+
import { _ as getSlackWriteClient, h as createSlackWriteClient, u as createSlackLookupClient } from "./probe-BVlJ3dp0.mjs";
|
|
6
|
+
import { m as buildSlackNativeDataDeliveryPlan, t as sendMessageSlack } from "./send-CgPI3Zj8.mjs";
|
|
7
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
8
|
-
import { asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
+
import { asOptionalObjectRecord, asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { createSubsystemLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
10
10
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
11
11
|
import { captureChannelReadAuthority as captureChannelReadAuthority$1 } from "openclaw/plugin-sdk/fetch-runtime";
|
|
@@ -18,6 +18,7 @@ import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime
|
|
|
18
18
|
import { formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
19
19
|
import { normalizeHostname } from "openclaw/plugin-sdk/host-runtime";
|
|
20
20
|
import { resolveRequestUrl } from "openclaw/plugin-sdk/request-url";
|
|
21
|
+
import { raceWithTimeout } from "openclaw/plugin-sdk/time-runtime";
|
|
21
22
|
import { saveRemoteMedia, unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
|
|
22
23
|
//#region extensions/slack/src/conversation-open.ts
|
|
23
24
|
function parseSlackConversationOpenInput(userIds, teamId) {
|
|
@@ -241,7 +242,6 @@ async function saveSlackMedia(params) {
|
|
|
241
242
|
const abortSignals = [params.abortSignal, timeoutAbortController?.signal].filter((signal) => Boolean(signal));
|
|
242
243
|
const signal = abortSignals.length > 1 ? AbortSignal.any(abortSignals) : abortSignals[0];
|
|
243
244
|
let timedOut = false;
|
|
244
|
-
let timeoutHandle = null;
|
|
245
245
|
const savePromise = saveRemoteMedia({
|
|
246
246
|
url,
|
|
247
247
|
fetchImpl: createSlackMediaFetch(params.govSlack, params.assertReadAuthority),
|
|
@@ -262,20 +262,12 @@ async function saveSlackMedia(params) {
|
|
|
262
262
|
if (timedOut) return new Promise(() => {});
|
|
263
263
|
throw error;
|
|
264
264
|
});
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
reject(/* @__PURE__ */ new Error(`slack media download timed out after ${totalTimeoutMs}ms`));
|
|
272
|
-
}, totalTimeoutMs);
|
|
273
|
-
timeoutHandle.unref?.();
|
|
274
|
-
});
|
|
275
|
-
return await Promise.race([savePromise, timeoutPromise]);
|
|
276
|
-
} finally {
|
|
277
|
-
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
278
|
-
}
|
|
265
|
+
if (!totalTimeoutMs) return await savePromise;
|
|
266
|
+
return await raceWithTimeout(savePromise, totalTimeoutMs, () => {
|
|
267
|
+
timedOut = true;
|
|
268
|
+
timeoutAbortController?.abort();
|
|
269
|
+
throw new Error(`slack media download timed out after ${totalTimeoutMs}ms`);
|
|
270
|
+
}, { ref: false });
|
|
279
271
|
}
|
|
280
272
|
/**
|
|
281
273
|
* Slack voice messages (audio clips, huddle recordings) carry a `subtype` of
|
|
@@ -289,7 +281,7 @@ function resolveSlackMediaMimetype(file, fetchedContentType) {
|
|
|
289
281
|
return mime;
|
|
290
282
|
}
|
|
291
283
|
function looksLikeHtmlBuffer(buffer) {
|
|
292
|
-
const head = normalizeLowercaseStringOrEmpty(buffer.subarray(0, 512).toString("utf-8")
|
|
284
|
+
const head = normalizeLowercaseStringOrEmpty(buffer.subarray(0, 512).toString("utf-8"));
|
|
293
285
|
return head.startsWith("<!doctype html") || head.startsWith("<html");
|
|
294
286
|
}
|
|
295
287
|
async function looksLikeHtmlFile(filePath) {
|
|
@@ -529,7 +521,6 @@ var actions_exports = /* @__PURE__ */ __exportAll({
|
|
|
529
521
|
readSlackMessages: () => readSlackMessages,
|
|
530
522
|
removeOwnSlackReactions: () => removeOwnSlackReactions,
|
|
531
523
|
removeSlackReaction: () => removeSlackReaction,
|
|
532
|
-
resolveSlackConversationName: () => resolveSlackConversationName,
|
|
533
524
|
sendSlackMessage: () => sendSlackMessage,
|
|
534
525
|
unpinSlackMessage: () => unpinSlackMessage
|
|
535
526
|
});
|
|
@@ -623,17 +614,10 @@ function normalizeSlackReadTimestamp(raw, field) {
|
|
|
623
614
|
const trimmed = raw?.trim();
|
|
624
615
|
if (!trimmed) return;
|
|
625
616
|
if (SLACK_TIMESTAMP_RE.test(trimmed)) return trimmed;
|
|
626
|
-
|
|
627
|
-
const parsed = Date.parse(trimmed);
|
|
617
|
+
const parsed = ISO_8601_TIMESTAMP_SCHEMA.safeParse(trimmed).success ? Date.parse(trimmed) : NaN;
|
|
628
618
|
if (!Number.isFinite(parsed)) throw new Error(`Invalid Slack read ${field} timestamp "${trimmed}": expected a Slack timestamp or ISO-8601 date string`);
|
|
629
619
|
return formatEpochSeconds(parsed);
|
|
630
620
|
}
|
|
631
|
-
function hasSlackPlatformError(err, code) {
|
|
632
|
-
if (!err || typeof err !== "object") return false;
|
|
633
|
-
const data = err.data;
|
|
634
|
-
if (!data || typeof data !== "object") return false;
|
|
635
|
-
return data.error === code;
|
|
636
|
-
}
|
|
637
621
|
async function getClient(opts = {}, mode = "read") {
|
|
638
622
|
if (opts.client && !opts.assertDirectAdapterHandoff) return opts.client;
|
|
639
623
|
const accountId = opts.cfg ? resolveSlackAccount({
|
|
@@ -663,7 +647,7 @@ function createSlackReactionUpdater(method, unchangedError) {
|
|
|
663
647
|
name: normalizeSlackEmojiName(emoji)
|
|
664
648
|
});
|
|
665
649
|
} catch (err) {
|
|
666
|
-
if (
|
|
650
|
+
if (asOptionalObjectRecord(asOptionalObjectRecord(err)?.data)?.error !== unchangedError) throw err;
|
|
667
651
|
}
|
|
668
652
|
};
|
|
669
653
|
}
|
|
@@ -776,9 +760,6 @@ async function openSlackConversation(userIds, opts = {}) {
|
|
|
776
760
|
teamId: input.teamId
|
|
777
761
|
}, "write"), input);
|
|
778
762
|
}
|
|
779
|
-
async function resolveSlackConversationName(channelId, opts = {}) {
|
|
780
|
-
return (await (await getClient(opts, "read")).conversations.info({ channel: channelId })).channel?.name?.trim() || void 0;
|
|
781
|
-
}
|
|
782
763
|
async function readSlackMessages(channelId, opts = {}) {
|
|
783
764
|
const exactMessageId = opts.messageId?.trim();
|
|
784
765
|
const readLimit = exactMessageId ? 1 : opts.limit;
|
package/dist/.setup/{approval-handler.runtime-Ed6Sw5VK.mjs → approval-handler.runtime-BcE_shWc.mjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as parseSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { g as getSlackListenerWriteClient } from "./probe-
|
|
4
|
-
import { s as resolveSlackReplyBlocks } from "./reply-blocks-
|
|
5
|
-
import { t as sendMessageSlack } from "./send-
|
|
6
|
-
import { n as runSlackApprovalMessageUpdate } from "./approval-message-updates-
|
|
2
|
+
import { E as SLACK_EDIT_TEXT_MAX_BYTES, It as normalizeSlackApproverId, M as truncateSlackTextByUtf8Bytes, gt as isSlackAnyNativeApprovalClientEnabled, n as setSlackSessionStatus, st as SLACK_APPROVAL_HEADER_BLOCK_ID, wt as shouldHandleSlackNativeApprovalRequest } from "./session-status-D46GHwOV.mjs";
|
|
3
|
+
import { g as getSlackListenerWriteClient } from "./probe-BVlJ3dp0.mjs";
|
|
4
|
+
import { s as resolveSlackReplyBlocks } from "./reply-blocks-CKnO4BSG.mjs";
|
|
5
|
+
import { t as sendMessageSlack } from "./send-CgPI3Zj8.mjs";
|
|
6
|
+
import { n as runSlackApprovalMessageUpdate } from "./approval-message-updates-EgKGmFXx.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
9
9
|
import { buildChannelApprovalNativeTargetKey } from "openclaw/plugin-sdk/approval-native-runtime";
|
package/dist/.setup/{approval-message-updates-BadvtA7R.mjs → approval-message-updates-EgKGmFXx.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as isSlackApprovalActionId, ct as decodeSlackApprovalAction } from "./session-status-D46GHwOV.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
|
//#region extensions/slack/src/approval-message-updates.ts
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { n as isSlackPluginAccountConfigured } from "./account-configured-sUohAxZr.mjs";
|
|
2
|
-
import { c as resolveSlackAccountAllowFrom, d as resolveSlackOperationToken, f as resolveSlackReplyToMode, i as listSlackAccountIds, n as hasImplicitDefaultSlackAccount, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-
|
|
2
|
+
import { c as resolveSlackAccountAllowFrom, d as resolveSlackOperationToken, f as resolveSlackReplyToMode, i as listSlackAccountIds, n as hasImplicitDefaultSlackAccount, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-CDgkV7Cm.mjs";
|
|
3
3
|
import { a as parseSlackTarget, i as normalizeSlackMessagingTarget, n as formatSlackTarget, o as resolveSlackChannelId, r as looksLikeSlackTargetId, t as canonicalizeSlackApiTargetId } from "./target-parsing-FFE26kOV.mjs";
|
|
4
4
|
import { t as slackContextTargetsMatch } from "./targets-C6LZQL1Q.mjs";
|
|
5
|
-
import { A as countSlackTextUtf8Bytes, At as
|
|
6
|
-
import { _ as getSlackWriteClient, c as collectSlackCursorPages, o as formatSlackError, u as createSlackLookupClient } from "./probe-
|
|
7
|
-
import { c as resolveSlackReplyDeliveryMessages, f as buildSlackPresentationBlocks, o as resolveSlackReplyBlockResolution, p as canRenderSlackPresentation, r as normalizeSlackReplyPayload, s as resolveSlackReplyBlocks } from "./reply-blocks-
|
|
5
|
+
import { A as countSlackTextUtf8Bytes, At as getSlackInstallationKind, Ct as resolveTurnSourceSlackOriginTarget, Dt as getSlackApprovalApproversForTeam, E as SLACK_EDIT_TEXT_MAX_BYTES, Et as slackTargetsMatch, Ft as isSlackExecApprovalClientEnabled, Lt as resolveSlackExecApprovalTarget, Nt as getSlackExecApprovalApprovers, Ot as isSlackPluginApprovalAuthorizedSender, Pt as isSlackExecApprovalAuthorizedSender, Rt as shouldSuppressLocalSlackExecApprovalPrompt, St as resolveSlackFallbackOriginTarget, Tt as shouldHandleSlackPluginViaForwardingSession, Vt as resolveSlackAutoThreadId, Y as normalizeSlackOutboundText, _t as isSlackPluginApprovalRequest, a as resolveSlackGroupRequireMention, at as renderSlackMessagePresentationFallbackText, bt as resolveSessionSlackOriginTarget, c as qualifySlackRoutePeerId, d as resolveSlackConversationBindingRoute, dt as SLACK_PRESENTATION_CAPABILITIES, f as assertSlackDetachedTargetAllowed, gt as isSlackAnyNativeApprovalClientEnabled, jt as isSlackWorkspaceInstallation, k as SLACK_TEXT_LIMIT, kt as resolveSlackApprovalTeamId, n as setSlackSessionStatus, o as resolveSlackGroupToolPolicy, s as qualifySlackConversationId, u as normalizeSlackRouteBindingConfig, vt as normalizeSlackForwardTarget, wt as shouldHandleSlackNativeApprovalRequest, xt as resolveSlackApproverDmTargets, yt as normalizeSlackOriginTarget, zt as resolvePluginApprovalSlackApprovers } from "./session-status-D46GHwOV.mjs";
|
|
6
|
+
import { _ as getSlackWriteClient, c as collectSlackCursorPages, o as formatSlackError, u as createSlackLookupClient } from "./probe-BVlJ3dp0.mjs";
|
|
7
|
+
import { c as resolveSlackReplyDeliveryMessages, f as buildSlackPresentationBlocks, o as resolveSlackReplyBlockResolution, p as canRenderSlackPresentation, r as normalizeSlackReplyPayload, s as resolveSlackReplyBlocks } from "./reply-blocks-CKnO4BSG.mjs";
|
|
8
8
|
import { n as resolveSlackReplyThreadTs, r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-Cvt7WD6B.mjs";
|
|
9
|
-
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-
|
|
10
|
-
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-
|
|
9
|
+
import { n as extractSlackToolSend, t as describeSlackMessageTool } from "./message-tool-api-CcjLPN3v.mjs";
|
|
10
|
+
import { n as resolveSlackChannelType, r as resolveSlackConversationInfo } from "./channel-type-B9zYYzBU.mjs";
|
|
11
11
|
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.mjs";
|
|
12
|
-
import { n as
|
|
13
|
-
import {
|
|
12
|
+
import { n as slackPluginBase, r as slackSecurityAdapter, t as slackConfigAdapter } from "./shared-VtmYNj-v.mjs";
|
|
13
|
+
import { i as SLACK_CHANNEL } from "./channel.setup-BYIlwbQ7.mjs";
|
|
14
14
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
15
15
|
import { normalizeAccountId as normalizeAccountId$1 } from "openclaw/plugin-sdk/account-resolution";
|
|
16
16
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -99,7 +99,7 @@ const baseSlackApprovalCapability = createApproverRestrictedNativeApprovalCapabi
|
|
|
99
99
|
],
|
|
100
100
|
isConfigured: isSlackAnyNativeApprovalClientEnabled,
|
|
101
101
|
shouldHandle: shouldHandleSlackNativeApprovalRequest,
|
|
102
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
102
|
+
load: async () => (await import("./approval-handler.runtime-BcE_shWc.mjs")).slackApprovalNativeRuntime
|
|
103
103
|
})
|
|
104
104
|
});
|
|
105
105
|
const baseSlackNativeAdapter = baseSlackApprovalCapability.native;
|
|
@@ -403,7 +403,7 @@ const SLACK_TOOL_DELIVERY_ACTIONS = /* @__PURE__ */ new Set([
|
|
|
403
403
|
"unpinMessage",
|
|
404
404
|
"uploadFile"
|
|
405
405
|
]);
|
|
406
|
-
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
406
|
+
const loadSlackActionRuntime$1 = createLazyRuntimeModule(() => import("./action-runtime.runtime-CdWL2mLC.mjs"));
|
|
407
407
|
function resolveSlackActionContext(ctx, toolContext) {
|
|
408
408
|
if (!toolContext && !ctx.mediaAccess && !ctx.mediaLocalRoots && !ctx.mediaReadFile && !ctx.conversationReadOrigin && !ctx.requesterAccountId && !ctx.requesterSenderId && !ctx.assertDirectAdapterHandoff) return;
|
|
409
409
|
return {
|
|
@@ -569,25 +569,22 @@ function buildSlackThreadingToolContext(params) {
|
|
|
569
569
|
}
|
|
570
570
|
//#endregion
|
|
571
571
|
//#region extensions/slack/src/channel.ts
|
|
572
|
-
const
|
|
573
|
-
const
|
|
574
|
-
const
|
|
575
|
-
const
|
|
576
|
-
const loadSlackSetupSurfaceModule = createLazyRuntimeModule(() => import("./setup-surface-Dn7QgWRE.mjs"));
|
|
577
|
-
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-CasuDvaa.mjs"));
|
|
578
|
-
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-Bv48XUjq.mjs"));
|
|
572
|
+
const loadExtensionSharedSdk = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/extension-shared"));
|
|
573
|
+
const loadTargetResolverRuntimeSdk = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/target-resolver-runtime"));
|
|
574
|
+
const loadSlackScopesModule = createLazyRuntimeModule(() => import("./scopes-DrDbyUH2.mjs"));
|
|
575
|
+
const loadSlackOutboundAdapterModule = createLazyRuntimeModule(() => import("./outbound-adapter-BZFkK-mw.mjs"));
|
|
579
576
|
const bindSlackOutbound = createLazyRuntimeMethodBinder(loadSlackOutboundAdapterModule);
|
|
580
577
|
async function resolveSlackHandleAction() {
|
|
581
578
|
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? (await loadSlackActionRuntime()).handleSlackAction;
|
|
582
579
|
}
|
|
583
|
-
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
584
|
-
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
585
|
-
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
586
|
-
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-
|
|
587
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
588
|
-
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-
|
|
589
|
-
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-
|
|
590
|
-
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
580
|
+
const loadSlackDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-B_by7zrc.mjs").then((n) => n.t));
|
|
581
|
+
const loadSlackResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-HR0TgArR.mjs").then((n) => n.n));
|
|
582
|
+
const loadSlackResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-BNYBhF0q.mjs").then((n) => n.n));
|
|
583
|
+
const loadSlackActionRuntime = createLazyRuntimeModule(() => import("./action-runtime.runtime-CdWL2mLC.mjs"));
|
|
584
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-CgPI3Zj8.mjs").then((n) => n.n));
|
|
585
|
+
const loadSlackProbeModule = createLazyRuntimeModule(() => import("./probe-BVlJ3dp0.mjs").then((n) => n.n));
|
|
586
|
+
const loadSlackMonitorModule = createLazyRuntimeModule(() => import("./monitor-BuYBDmm7.mjs").then((n) => n.t));
|
|
587
|
+
const loadSlackDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-C48wazJt.mjs").then((n) => n.t));
|
|
591
588
|
async function setSlackHeartbeatThreadStatus(params) {
|
|
592
589
|
const threadTs = resolveSlackThreadTsValue({ threadId: params.threadId });
|
|
593
590
|
const target = parseSlackTarget(params.to, { defaultKind: "channel" });
|
|
@@ -823,10 +820,7 @@ const slackMessageAdapter = {
|
|
|
823
820
|
};
|
|
824
821
|
const slackPlugin = createChatChannelPlugin({
|
|
825
822
|
base: {
|
|
826
|
-
...
|
|
827
|
-
setupWizard: createSlackSetupWizardProxy(loadSlackSetupSurfaceModule),
|
|
828
|
-
setupContract: slackSetupContract
|
|
829
|
-
}),
|
|
823
|
+
...slackPluginBase,
|
|
830
824
|
allowlist: {
|
|
831
825
|
...buildLegacyDmAccountAllowlistAdapter({
|
|
832
826
|
channelId: "slack",
|
|
@@ -1041,25 +1035,29 @@ const slackPlugin = createChatChannelPlugin({
|
|
|
1041
1035
|
};
|
|
1042
1036
|
}
|
|
1043
1037
|
}),
|
|
1044
|
-
gateway: {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1038
|
+
gateway: {
|
|
1039
|
+
apiVersion: 2,
|
|
1040
|
+
startAccount: async (ctx) => {
|
|
1041
|
+
const account = ctx.account;
|
|
1042
|
+
const botToken = account.botToken?.trim();
|
|
1043
|
+
const appToken = account.appToken?.trim();
|
|
1044
|
+
ctx.log?.info(`[${account.accountId}] starting provider`);
|
|
1045
|
+
return (await loadSlackMonitorModule()).monitorSlackProvider({
|
|
1046
|
+
scheduler: ctx.scheduler,
|
|
1047
|
+
botToken: botToken ?? "",
|
|
1048
|
+
appToken: appToken ?? "",
|
|
1049
|
+
accountId: account.accountId,
|
|
1050
|
+
config: ctx.cfg,
|
|
1051
|
+
runtime: ctx.runtime,
|
|
1052
|
+
channelRuntime: ctx.channelRuntime,
|
|
1053
|
+
abortSignal: ctx.abortSignal,
|
|
1054
|
+
mediaMaxMb: account.config.mediaMaxMb,
|
|
1055
|
+
slashCommand: account.config.slashCommand,
|
|
1056
|
+
setStatus: ctx.setStatus,
|
|
1057
|
+
getStatus: ctx.getStatus
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1063
1061
|
mentions: { stripPatterns: ({ ctx }) => {
|
|
1064
1062
|
const preparedPatterns = ctx.ChannelContext?.chat?.mentionStripPatterns;
|
|
1065
1063
|
return [...Array.isArray(preparedPatterns) ? preparedPatterns.flatMap((pattern) => typeof pattern === "string" ? [escapeRegExp(pattern)] : []) : [], "<@[^>\\s]+>"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-
|
|
3
|
-
import { f as assertSlackDetachedTargetAllowed } from "./session-status-
|
|
4
|
-
import { d as createSlackReadClient, m as createSlackWebClient, v as readLruMapEntry } from "./probe-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-CDgkV7Cm.mjs";
|
|
3
|
+
import { f as assertSlackDetachedTargetAllowed } from "./session-status-D46GHwOV.mjs";
|
|
4
|
+
import { d as createSlackReadClient, m as createSlackWebClient, v as readLruMapEntry } from "./probe-BVlJ3dp0.mjs";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
7
7
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { r as isSlackSetupAccountConfigured } from "./account-configured-sUohAxZr.mjs";
|
|
2
|
-
import { i as listSlackAccountIds, o as resolveDefaultSlackAccountId, s as resolveSlackAccount, u as resolveSlackConfigAccessorAccount } from "./accounts-
|
|
3
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
2
|
+
import { i as listSlackAccountIds, o as resolveDefaultSlackAccountId, s as resolveSlackAccount, u as resolveSlackConfigAccessorAccount } from "./accounts-CDgkV7Cm.mjs";
|
|
3
|
+
import { t as inspectSlackAccount } from "./account-inspect-Cs-7DXXW.mjs";
|
|
4
4
|
import { t as DEFAULT_SLACK_SUGGESTED_PROMPTS } from "./channel-meta-C443t-lI.mjs";
|
|
5
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
5
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-BH0K9-Um.mjs";
|
|
6
6
|
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
9
9
|
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
|
10
|
+
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
11
|
+
import { DEFAULT_ACCOUNT_ID, createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createAllowlistSetupWizardProxy, createPatchedAccountSetupAdapter, createSetupTranslator, createStandardChannelSetupStatus, defineTokenCredential, parseMentionOrPrefixedId, patchChannelConfigForAccount, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
|
|
12
|
+
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
10
13
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
11
14
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
12
15
|
import { patchTopLevelChannelConfigSection } from "openclaw/plugin-sdk/setup";
|
|
13
|
-
import { DEFAULT_ACCOUNT_ID, createAccountScopedAllowFromSection, createAccountScopedGroupAccessSection, createAllowlistSetupWizardProxy, createPatchedAccountSetupAdapter, createSetupTranslator, createStandardChannelSetupStatus, defineTokenCredential, parseMentionOrPrefixedId, patchChannelConfigForAccount, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup-runtime";
|
|
14
|
-
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
15
|
-
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
|
16
16
|
//#region extensions/slack/src/setup-shared.ts
|
|
17
17
|
const SLACK_CHANNEL = "slack";
|
|
18
18
|
function buildSlackAllowFromPrompt() {
|
|
@@ -151,6 +151,25 @@ function describeSlackSetupAccount(account) {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
+
//#region extensions/slack/src/config-adapter.ts
|
|
155
|
+
const slackBaseConfigAdapter = createScopedChannelConfigAdapter({
|
|
156
|
+
sectionKey: SLACK_CHANNEL,
|
|
157
|
+
listAccountIds: listSlackAccountIds,
|
|
158
|
+
resolveAccount: adaptScopedAccountAccessor(resolveSlackAccount),
|
|
159
|
+
resolveAccessorAccount: resolveSlackConfigAccessorAccount,
|
|
160
|
+
defaultAccountId: resolveDefaultSlackAccountId,
|
|
161
|
+
clearBaseFields: [
|
|
162
|
+
"botToken",
|
|
163
|
+
"appToken",
|
|
164
|
+
"userToken",
|
|
165
|
+
"signingSecret",
|
|
166
|
+
"name"
|
|
167
|
+
],
|
|
168
|
+
resolveAllowFrom: (account) => account.allowFrom,
|
|
169
|
+
formatAllowFrom: (allowFrom) => formatAllowFromLowercase({ allowFrom }),
|
|
170
|
+
resolveDefaultTo: (account) => account.defaultTo
|
|
171
|
+
});
|
|
172
|
+
//#endregion
|
|
154
173
|
//#region extensions/slack/src/setup-core.ts
|
|
155
174
|
const t = createSetupTranslator();
|
|
156
175
|
function enableSlackAccount(cfg, accountId) {
|
|
@@ -523,25 +542,6 @@ function createSlackSetupWizardProxy(loadWizard) {
|
|
|
523
542
|
});
|
|
524
543
|
}
|
|
525
544
|
//#endregion
|
|
526
|
-
//#region extensions/slack/src/config-adapter.ts
|
|
527
|
-
const slackBaseConfigAdapter = createScopedChannelConfigAdapter({
|
|
528
|
-
sectionKey: SLACK_CHANNEL,
|
|
529
|
-
listAccountIds: listSlackAccountIds,
|
|
530
|
-
resolveAccount: adaptScopedAccountAccessor(resolveSlackAccount),
|
|
531
|
-
resolveAccessorAccount: resolveSlackConfigAccessorAccount,
|
|
532
|
-
defaultAccountId: resolveDefaultSlackAccountId,
|
|
533
|
-
clearBaseFields: [
|
|
534
|
-
"botToken",
|
|
535
|
-
"appToken",
|
|
536
|
-
"userToken",
|
|
537
|
-
"signingSecret",
|
|
538
|
-
"name"
|
|
539
|
-
],
|
|
540
|
-
resolveAllowFrom: (account) => account.allowFrom,
|
|
541
|
-
formatAllowFrom: (allowFrom) => formatAllowFromLowercase({ allowFrom }),
|
|
542
|
-
resolveDefaultTo: (account) => account.defaultTo
|
|
543
|
-
});
|
|
544
|
-
//#endregion
|
|
545
545
|
//#region extensions/slack/src/channel.setup.ts
|
|
546
546
|
const slackSetupPlugin = {
|
|
547
547
|
id: SLACK_CHANNEL,
|
|
@@ -557,7 +557,7 @@ const slackSetupPlugin = {
|
|
|
557
557
|
markdownCapable: true,
|
|
558
558
|
preferSessionLookupForAnnounceTarget: true
|
|
559
559
|
},
|
|
560
|
-
setupWizard: createSlackSetupWizardProxy(() => import("./setup-surface-
|
|
560
|
+
setupWizard: createSlackSetupWizardProxy(() => import("./setup-surface-83lxvE2y.mjs")),
|
|
561
561
|
capabilities: {
|
|
562
562
|
chatTypes: [
|
|
563
563
|
"direct",
|
|
@@ -636,4 +636,4 @@ const slackSetupPlugin = {
|
|
|
636
636
|
setupContract: slackSetupContract
|
|
637
637
|
};
|
|
638
638
|
//#endregion
|
|
639
|
-
export {
|
|
639
|
+
export { buildSlackAllowFromPrompt as a, SLACK_CHANNEL as i, createSlackSetupWizardBase as n, slackBaseConfigAdapter as r, slackSetupPlugin as t };
|
|
@@ -53,6 +53,10 @@ const slackChannelConfigUiHints = {
|
|
|
53
53
|
},
|
|
54
54
|
progress: { labels: "openclaw" }
|
|
55
55
|
}),
|
|
56
|
+
"streaming.progress.toolProgress": {
|
|
57
|
+
label: "Slack Progress Tool Lines",
|
|
58
|
+
help: "Show individual tool activity, including intermediate failures, in progress drafts (default: false). Native cards add a task row per tool call. Block Kit cards add tool activity, the plan checklist, and tool/file/time totals while working; finished cards retain only file diff totals. Default Block Kit cards show commentary and text, approval requests, and available session links. Failed turns show a plain Failed line on the Block Kit card, even without an error reply."
|
|
59
|
+
},
|
|
56
60
|
joinIntro: {
|
|
57
61
|
label: "Slack Channel Join Introduction",
|
|
58
62
|
help: "Post one brief, room-specific introduction when the bot joins an allowed Slack channel (default: true). Account settings override the channel-wide setting."
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, o as resolveDefaultSlackAccountId } from "./accounts-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, o as resolveDefaultSlackAccountId } from "./accounts-CDgkV7Cm.mjs";
|
|
3
3
|
import { a as parseSlackTarget } from "./target-parsing-FFE26kOV.mjs";
|
|
4
4
|
import "./targets-C6LZQL1Q.mjs";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { s as resolveSlackAccount } from "./accounts-
|
|
3
|
-
import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { s as resolveSlackAccount } from "./accounts-CDgkV7Cm.mjs";
|
|
3
|
+
import { c as collectSlackCursorPages, l as fetchSlackChannelListPage, u as createSlackLookupClient } from "./probe-BVlJ3dp0.mjs";
|
|
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,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
+
import { getChannelStreamingConfigObject, resolveChannelStreamingNativeTransport } from "openclaw/plugin-sdk/channel-streaming-config";
|
|
2
4
|
//#region packages/normalization-core/src/record-coerce.ts
|
|
3
5
|
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
4
|
-
function isRecord(value) {
|
|
6
|
+
function isRecord$1(value) {
|
|
5
7
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
6
8
|
}
|
|
7
9
|
/** Returns a non-array record or null. */
|
|
8
10
|
function asNullableRecord(value) {
|
|
9
|
-
return isRecord(value) ? value : null;
|
|
11
|
+
return isRecord$1(value) ? value : null;
|
|
10
12
|
}
|
|
11
13
|
//#endregion
|
|
12
14
|
//#region src/config/channel-config-normalization.ts
|
|
@@ -99,6 +101,12 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
99
101
|
};
|
|
100
102
|
const prefix = `channels.${params.channelKey}`;
|
|
101
103
|
return {
|
|
104
|
+
historicalWebhookListener: {
|
|
105
|
+
channelId: params.channelKey,
|
|
106
|
+
port: params.defaultPort,
|
|
107
|
+
preserveAuthoredActivation: params.preserveAuthoredActivation,
|
|
108
|
+
...params.defaultHost === void 0 ? {} : { host: params.defaultHost }
|
|
109
|
+
},
|
|
102
110
|
legacyConfigRules: [{
|
|
103
111
|
path: ["channels", params.channelKey],
|
|
104
112
|
message: `${prefix} webhook listeners moved to Gateway routes. Run "openclaw doctor --fix" to preserve explicitly configured listener settings as legacyWebhook.`,
|
|
@@ -156,6 +164,21 @@ var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLega
|
|
|
156
164
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
157
165
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
158
166
|
//#endregion
|
|
167
|
+
//#region extensions/slack/src/streaming-compat.ts
|
|
168
|
+
function resolveSlackStreamingMode(params = {}) {
|
|
169
|
+
const mode = normalizeLowercaseStringOrEmpty(getChannelStreamingConfigObject(params)?.mode ?? params.streaming);
|
|
170
|
+
if (mode === "off" || mode === "partial" || mode === "block" || mode === "progress") return mode;
|
|
171
|
+
switch (normalizeLowercaseStringOrEmpty(params.streamMode)) {
|
|
172
|
+
case "append": return "block";
|
|
173
|
+
case "status_final": return "progress";
|
|
174
|
+
case "replace": return "partial";
|
|
175
|
+
default: return typeof params.streaming === "boolean" ? params.streaming ? "partial" : "off" : "progress";
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function resolveSlackNativeStreaming(params = {}) {
|
|
179
|
+
return resolveChannelStreamingNativeTransport(params) ?? (typeof params.nativeStreaming === "boolean" ? params.nativeStreaming : typeof params.streaming === "boolean" ? params.streaming : true);
|
|
180
|
+
}
|
|
181
|
+
//#endregion
|
|
159
182
|
//#region extensions/slack/src/doctor-contract.ts
|
|
160
183
|
const streamingAliasMigration = (0, runtime_doctor_migrations_exports.defineChannelAliasMigration)({
|
|
161
184
|
channelId: "slack",
|
|
@@ -180,11 +203,6 @@ const threadMentionPolicyMigration = (0, runtime_doctor_migrations_exports.defin
|
|
|
180
203
|
pruneEmptySource: true,
|
|
181
204
|
movedMessage: ({ sourcePath, targetPath, mappedValue }) => `Moved ${sourcePath} → ${targetPath} (${String(mappedValue)}).`
|
|
182
205
|
});
|
|
183
|
-
const channelAllowMigration = (0, runtime_doctor_migrations_exports.defineKeyMoveMigration)({
|
|
184
|
-
scope: ["channels", "*"],
|
|
185
|
-
from: ["allow"],
|
|
186
|
-
to: ["enabled"]
|
|
187
|
-
});
|
|
188
206
|
function hasInteractiveRepliesCapability(value) {
|
|
189
207
|
const capabilities = (0, runtime_doctor_migrations_exports.asObjectRecord)(value)?.capabilities;
|
|
190
208
|
if (Array.isArray(capabilities)) return capabilities.some((entry) => typeof entry === "string" && entry.trim().toLowerCase() === "interactivereplies");
|
|
@@ -283,20 +301,6 @@ const legacyConfigRules = [
|
|
|
283
301
|
],
|
|
284
302
|
message: "channels.slack.accounts.<id>.thread.requireExplicitMention is legacy; use channels.slack.accounts.<id>.implicitMentions.threadParticipation instead. Run \"openclaw doctor --fix\".",
|
|
285
303
|
match: (value) => (0, runtime_doctor_migrations_exports.hasLegacyAccountStreamingAliases)(value, threadMentionPolicyMigration.hasLegacy)
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
path: ["channels", "slack"],
|
|
289
|
-
message: "channels.slack.channels.<id>.allow is legacy; use channels.slack.channels.<id>.enabled instead. Run \"openclaw doctor --fix\".",
|
|
290
|
-
match: channelAllowMigration.hasLegacy
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
path: [
|
|
294
|
-
"channels",
|
|
295
|
-
"slack",
|
|
296
|
-
"accounts"
|
|
297
|
-
],
|
|
298
|
-
message: "channels.slack.accounts.<id>.channels.<id>.allow is legacy; use channels.slack.accounts.<id>.channels.<id>.enabled instead. Run \"openclaw doctor --fix\".",
|
|
299
|
-
match: (value) => (0, runtime_doctor_migrations_exports.hasLegacyAccountStreamingAliases)(value, channelAllowMigration.hasLegacy)
|
|
300
304
|
}
|
|
301
305
|
];
|
|
302
306
|
function normalizeSlackEntry(params) {
|
|
@@ -309,13 +313,9 @@ function normalizeSlackEntry(params) {
|
|
|
309
313
|
...params,
|
|
310
314
|
entry: dm.entry
|
|
311
315
|
});
|
|
312
|
-
const channels = channelAllowMigration.normalize({
|
|
313
|
-
...params,
|
|
314
|
-
entry: thread.entry
|
|
315
|
-
});
|
|
316
316
|
return {
|
|
317
|
-
entry:
|
|
318
|
-
changed: retiredInteractiveReplies.changed || dm.changed || thread.changed
|
|
317
|
+
entry: thread.entry,
|
|
318
|
+
changed: retiredInteractiveReplies.changed || dm.changed || thread.changed
|
|
319
319
|
};
|
|
320
320
|
}
|
|
321
321
|
function normalizeCompatibilityConfig({ cfg }) {
|