@openclaw/slack 2026.11.5-beta.1 → 2026.11.5-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/.setup/{account-configured-35y0-Hso.mjs → account-configured-zcR9TJJN.mjs} +2 -1
- package/dist/.setup/{account-inspect-DgQgj0wk.mjs → account-inspect-BLVha-ov.mjs} +4 -3
- package/dist/.setup/{accounts-EaPP0fFY.mjs → accounts-CGJScKtk.mjs} +10 -6
- package/dist/.setup/{action-runtime-CK9QZgQl.mjs → action-runtime-D01wBhx5.mjs} +10 -9
- package/dist/.setup/action-runtime.runtime-VQGaR6g8.mjs +1 -0
- package/dist/.setup/{actions-s3CcFO45.mjs → actions-D5S6D_BU.mjs} +22 -14
- package/dist/.setup/{approval-handler.runtime-Ch7BecYK.mjs → approval-handler.runtime-Buw5jh2Y.mjs} +8 -7
- package/dist/.setup/{approval-message-updates-CqcRoa28.mjs → approval-message-updates-pmXcve5E.mjs} +3 -2
- package/dist/.setup/{channel-CAvo_WNZ.mjs → channel-C_R98Nbv.mjs} +45 -36
- package/dist/.setup/{channel-meta-C5vsCo3a.mjs → channel-meta-C443t-lI.mjs} +2 -1
- package/dist/.setup/{channel-type-9Lw6yLf2.mjs → channel-type-B5P3w9eA.mjs} +6 -5
- package/dist/.setup/{channel.setup-BlgXNuCJ.mjs → channel.setup-Lq2OxKkF.mjs} +14 -10
- package/dist/.setup/{config-schema-Bx1tCZB0.mjs → config-schema-BWAaa5au.mjs} +4 -2
- package/dist/.setup/{cursor-pages-jVn3Vkfi.mjs → cursor-pages-CATAzbTT.mjs} +8 -4
- package/dist/.setup/{directory-config-CGvKYg9F.mjs → directory-config-D-hf9KGQ.mjs} +6 -5
- package/dist/.setup/{directory-live-DNdw97LA.mjs → directory-live-onKAFI1E.mjs} +5 -4
- package/dist/.setup/{doctor-contract-BB2KJ9Ni.mjs → doctor-contract-9-QJRCXk.mjs} +13 -7
- package/dist/.setup/{message-tool-api-B38BpEaE.mjs → message-tool-api-LGIgVXJf.mjs} +7 -5
- package/dist/.setup/{monitor-BD86SotB.mjs → monitor-Cm1TuqxN.mjs} +128 -73
- package/dist/.setup/{outbound-adapter-BH6iPWBj.mjs → outbound-adapter-C-95EWl2.mjs} +10 -9
- package/dist/.setup/{paths-CQZI_5WY.mjs → paths-B1u59oLK.mjs} +2 -1
- package/dist/.setup/{pipeline.runtime-C4ELxaRU.mjs → pipeline.runtime-DGnV6akc.mjs} +71 -43
- package/dist/.setup/{policy-C6_DdlSf.mjs → policy-DxhGRvc2.mjs} +5 -3
- package/dist/.setup/{probe-B_Ax1vS1.mjs → probe-DANukR3O.mjs} +66 -36
- package/dist/.setup/{question-delivery-D3qAIwuv.mjs → question-delivery-CWC7sRhH.mjs} +3 -2
- package/dist/.setup/{relay-source-a8jodKuO.mjs → relay-source-DoyOlTbK.mjs} +4 -3
- package/dist/.setup/{replies-Bq7n0gfM.mjs → replies-BcmUKord.mjs} +10 -8
- package/dist/.setup/{reply-blocks-DyYYRrP_.mjs → reply-blocks-BzsXUUUL.mjs} +7 -4
- package/dist/.setup/{resolve-channels-CF2JME9q.mjs → resolve-channels-XDPgnesf.mjs} +5 -4
- package/dist/.setup/{resolve-users-DDcCAjH1.mjs → resolve-users-aDAv24U2.mjs} +5 -4
- package/dist/.setup/{rolldown-runtime-nwUcYXjP.mjs → rolldown-runtime-B4FMCO8f.mjs} +2 -1
- package/dist/.setup/{runtime-C6HKn7Av.mjs → runtime-JSVZSWAj.mjs} +2 -1
- package/dist/.setup/runtime-setter-api-Cx_PV-xu.mjs +2 -0
- package/dist/.setup/{scopes-CzHC_dwV.mjs → scopes-BocHwImV.mjs} +4 -3
- package/dist/.setup/{secret-contract-api-DaCXZ47j.mjs → secret-contract-api-BlLz88mj.mjs} +1 -1
- package/dist/.setup/{secret-contract-CqVqR7MP.mjs → secret-contract-uiQtoNlu.mjs} +3 -2
- package/dist/.setup/{security-audit-C3hXCfDt.mjs → security-audit-DFGiFLqd.mjs} +3 -2
- package/dist/.setup/{send-results-Bm6V1ekL.mjs → send-results-BGxlroJ-.mjs} +2 -1
- package/dist/.setup/{send-WJZ73VSf.mjs → send-yK6_-px6.mjs} +19 -13
- package/dist/.setup/setup-plugin-api-Cfz58xoh.mjs +2 -0
- package/dist/.setup/{setup-surface-uIqP2B0Y.mjs → setup-surface-C0KRtyqa.mjs} +7 -6
- package/dist/.setup/{slash-dispatch.runtime-Cwuwv7FL.mjs → slash-dispatch.runtime-CyVC3bYx.mjs} +1 -1
- package/dist/.setup/{target-parsing-DwYAP3ts.mjs → target-parsing-Bx2UZniD.mjs} +2 -1
- package/dist/.setup/{targets-eeOxA_b_.mjs → targets-D-ASeWHy.mjs} +3 -2
- package/dist/.setup/{thread-ts-47Au2-Yn.mjs → thread-ts-Cvt7WD6B.mjs} +2 -1
- package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -1
- package/dist/account-inspect-api.js +3 -2
- package/dist/api.js +16 -16
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-entry.js +2 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +3 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +2 -1
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +10 -10
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +5 -4
- package/dist/setup-plugin-api.js +1 -1
- package/node_modules/@slack/bolt/node_modules/body-parser/README.md +17 -13
- package/node_modules/@slack/bolt/node_modules/body-parser/lib/read.js +74 -57
- package/node_modules/@slack/bolt/node_modules/body-parser/lib/types/json.js +11 -11
- package/node_modules/@slack/bolt/node_modules/body-parser/lib/types/urlencoded.js +5 -5
- package/node_modules/@slack/bolt/node_modules/body-parser/lib/utils.js +0 -15
- package/node_modules/@slack/bolt/node_modules/body-parser/package.json +7 -12
- package/package.json +4 -4
- package/dist/.setup/action-runtime.runtime-CpZktret.mjs +0 -1
- package/dist/.setup/runtime-setter-api-DrXr965r.mjs +0 -2
- package/dist/.setup/setup-plugin-api-DJXIB8CF.mjs +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { r as isSlackPluginAccountConfigured } from "./account-configured-
|
|
3
|
-
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, i as listSlackAccountIds, m as formatSlackBotTokenIdentityWarning, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-
|
|
4
|
-
import { a as parseSlackTarget, n as formatSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-
|
|
5
|
-
import { t as slackContextTargetsMatch } from "./targets-
|
|
6
|
-
import { _ as createSlackProbeDispatcher, i as createSlackReadClient } from "./cursor-pages-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { r as isSlackPluginAccountConfigured } from "./account-configured-zcR9TJJN.mjs";
|
|
3
|
+
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, i as listSlackAccountIds, m as formatSlackBotTokenIdentityWarning, o as resolveDefaultSlackAccountId, s as resolveSlackAccount } from "./accounts-CGJScKtk.mjs";
|
|
4
|
+
import { a as parseSlackTarget, n as formatSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-Bx2UZniD.mjs";
|
|
5
|
+
import { t as slackContextTargetsMatch } from "./targets-D-ASeWHy.mjs";
|
|
6
|
+
import { _ as createSlackProbeDispatcher, i as createSlackReadClient } from "./cursor-pages-CATAzbTT.mjs";
|
|
7
7
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
8
8
|
import { asOptionalRecord, isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringifiedOptionalString, readNonBlankString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
9
|
import { normalizeMessageChannel, resolveAgentRoute } from "openclaw/plugin-sdk/routing";
|
|
@@ -31,7 +31,7 @@ import { inspectRuntimeConversationBindingRoute, resolveConfiguredBindingRoute,
|
|
|
31
31
|
import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
|
|
32
32
|
import { resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
|
|
33
33
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
34
|
-
|
|
34
|
+
//#region extensions/slack/src/action-threading.ts
|
|
35
35
|
const SLACK_PRIVATE_ACTION_DELIVERY_RESULT = Symbol("slack.action.delivery-result");
|
|
36
36
|
function resolveSlackAutoThreadId(params) {
|
|
37
37
|
const context = params.toolContext;
|
|
@@ -55,7 +55,8 @@ function resolveSlackThreadTsFromContext(explicitThreadTs, targetChannel, contex
|
|
|
55
55
|
if (isSingleUseReplyToMode(context?.replyToMode ?? "off") && !context?.hasRepliedRef) return;
|
|
56
56
|
return threadTs;
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region extensions/slack/src/approval-plugin-policy.ts
|
|
59
60
|
/** Returns undefined only when Slack plugin approvals retain legacy account authorization. */
|
|
60
61
|
function resolvePluginApprovalSlackApprovers(cfg, request) {
|
|
61
62
|
const policy = cfg.approvals?.plugin?.slack;
|
|
@@ -72,7 +73,8 @@ function resolvePluginApprovalSlackApprovers(cfg, request) {
|
|
|
72
73
|
}
|
|
73
74
|
return plugin?.approvers ?? policy.approvers;
|
|
74
75
|
}
|
|
75
|
-
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region extensions/slack/src/exec-approvals.ts
|
|
76
78
|
function normalizeSlackUserLikeId(value) {
|
|
77
79
|
const upper = value.toUpperCase();
|
|
78
80
|
return /^[UW][A-Z0-9]+$/.test(upper) ? upper : void 0;
|
|
@@ -119,7 +121,8 @@ const isSlackExecApprovalClientEnabled = slackExecApprovalProfile.isClientEnable
|
|
|
119
121
|
const isSlackExecApprovalAuthorizedSender = slackExecApprovalProfile.isAuthorizedSender;
|
|
120
122
|
const resolveSlackExecApprovalTarget = slackExecApprovalProfile.resolveTarget;
|
|
121
123
|
const shouldSuppressLocalSlackExecApprovalPrompt = slackExecApprovalProfile.shouldSuppressLocalPrompt;
|
|
122
|
-
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region extensions/slack/src/installation-identity-state.ts
|
|
123
126
|
const slackInstallationStates = resolveGlobalMap(Symbol.for("openclaw.slack.installation-identities"), "close-and-restart");
|
|
124
127
|
function registerSlackInstallationState(accountId, kind, teamId) {
|
|
125
128
|
const normalizedAccountId = normalizeAccountId(accountId);
|
|
@@ -152,7 +155,8 @@ function getSlackInstallationTeamId(accountId) {
|
|
|
152
155
|
function isSlackWorkspaceInstallation(accountId) {
|
|
153
156
|
return getSlackInstallationKind(accountId) === "workspace";
|
|
154
157
|
}
|
|
155
|
-
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region extensions/slack/src/monitor/allow-list.ts
|
|
156
160
|
const SLACK_SLUG_CACHE_MAX = 512;
|
|
157
161
|
const SLACK_STABLE_USER_ID_RE = /^[ubw][a-z0-9]+$/;
|
|
158
162
|
const slackSlugCache = /* @__PURE__ */ new Map();
|
|
@@ -249,7 +253,8 @@ function resolveSlackUserAllowListForTeam(params) {
|
|
|
249
253
|
}
|
|
250
254
|
});
|
|
251
255
|
}
|
|
252
|
-
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region extensions/slack/src/approval-auth.ts
|
|
253
258
|
function resolveSlackApprovalInputs(params) {
|
|
254
259
|
const account = resolveSlackAccount(params).config;
|
|
255
260
|
return {
|
|
@@ -316,7 +321,8 @@ function getSlackApprovalApproversForTeam(params) {
|
|
|
316
321
|
function resolveSlackApprovalTeamId(params) {
|
|
317
322
|
return getSlackInstallationTeamId(resolveSlackAccount(params).accountId) ?? resolveSlackApprovalOriginTeamId(params.request);
|
|
318
323
|
}
|
|
319
|
-
|
|
324
|
+
//#endregion
|
|
325
|
+
//#region extensions/slack/src/approval-native-gates.ts
|
|
320
326
|
function isSlackPluginApprovalRequest(request) {
|
|
321
327
|
return resolveApprovalKind(request) === "plugin";
|
|
322
328
|
}
|
|
@@ -527,11 +533,13 @@ async function shouldHandleSlackNativeApprovalRequest(params) {
|
|
|
527
533
|
approvalKind: "exec"
|
|
528
534
|
});
|
|
529
535
|
}
|
|
530
|
-
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region extensions/slack/src/monitor/mrkdwn.ts
|
|
531
538
|
function escapeSlackMrkdwn(value) {
|
|
532
539
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">");
|
|
533
540
|
}
|
|
534
|
-
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region extensions/slack/src/format.ts
|
|
535
543
|
const SLACK_ANGLE_TOKEN_RE = /<[^>\n]+>/g;
|
|
536
544
|
function isAllowedSlackAngleToken(token) {
|
|
537
545
|
const inner = token.slice(1, -1);
|
|
@@ -861,12 +869,14 @@ function markdownToSlackMrkdwnChunks(markdown, limit, options = {}) {
|
|
|
861
869
|
measureRendered: (rendered) => rendered.length
|
|
862
870
|
}).map(({ rendered }) => rendered.length > normalizedLimit ? protectSlackAssistantTranscriptRoleHeaders(rendered) : rendered);
|
|
863
871
|
}
|
|
864
|
-
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region extensions/slack/src/limits.ts
|
|
865
874
|
const SLACK_TEXT_LIMIT = 8e3;
|
|
866
875
|
const SLACK_MESSAGE_TEXT_RECOMMENDED_LIMIT = 4e3;
|
|
867
876
|
const SLACK_EDIT_TEXT_MAX_BYTES = 4e3;
|
|
868
877
|
const SLACK_MESSAGE_TEXT_HARD_LIMIT = 4e4;
|
|
869
|
-
|
|
878
|
+
//#endregion
|
|
879
|
+
//#region extensions/slack/src/presentation-fallback.ts
|
|
870
880
|
const SLACK_UNCOPYABLE_COMMAND_WARNING = "not copyable: contains backtick";
|
|
871
881
|
function escapeSlackPresentationFallbackBlock(block) {
|
|
872
882
|
if (block.type === "chart") return {
|
|
@@ -951,7 +961,8 @@ const SLACK_PRESENTATION_CAPABILITIES = {
|
|
|
951
961
|
}
|
|
952
962
|
}
|
|
953
963
|
};
|
|
954
|
-
|
|
964
|
+
//#endregion
|
|
965
|
+
//#region extensions/slack/src/rich-text.ts
|
|
955
966
|
const RICH_TEXT_CONTAINER_TYPES = /* @__PURE__ */ new Set([
|
|
956
967
|
"rich_text_section",
|
|
957
968
|
"rich_text_preformatted",
|
|
@@ -998,7 +1009,8 @@ function renderSlackRichText(value, mode, separator = "") {
|
|
|
998
1009
|
}
|
|
999
1010
|
}).filter(Boolean).join(separator);
|
|
1000
1011
|
}
|
|
1001
|
-
|
|
1012
|
+
//#endregion
|
|
1013
|
+
//#region extensions/slack/src/data-table.ts
|
|
1002
1014
|
const SLACK_DATA_TABLE_COLUMNS_MAX = 20;
|
|
1003
1015
|
const SLACK_DATA_TABLE_ROWS_MAX = 100;
|
|
1004
1016
|
const SLACK_DATA_TABLE_AGGREGATE_CELL_CHARACTERS_MAX = 1e4;
|
|
@@ -1138,7 +1150,8 @@ function renderSlackDataTableCompactPlainTextFallback(value) {
|
|
|
1138
1150
|
...table.rows.map((row) => row.map(escapeCompactFallbackCell).join(" "))
|
|
1139
1151
|
].join("\n"));
|
|
1140
1152
|
}
|
|
1141
|
-
|
|
1153
|
+
//#endregion
|
|
1154
|
+
//#region extensions/slack/src/data-visualization.ts
|
|
1142
1155
|
const SLACK_CHART_TITLE_MAX = 50;
|
|
1143
1156
|
const SLACK_CHART_LABEL_MAX = 20;
|
|
1144
1157
|
const SLACK_CHART_AXIS_LABEL_MAX = 50;
|
|
@@ -1249,7 +1262,8 @@ function renderSlackDataVisualizationFallbackText(value, mrkdwnSafe = false) {
|
|
|
1249
1262
|
const title = typeof block.title === "string" ? block.title.trim() : "";
|
|
1250
1263
|
return title ? mrkdwnSafe ? escapeSlackMrkdwn(title) : title : void 0;
|
|
1251
1264
|
}
|
|
1252
|
-
|
|
1265
|
+
//#endregion
|
|
1266
|
+
//#region extensions/slack/src/blocks-fallback.ts
|
|
1253
1267
|
const SLACK_SELECT_ELEMENT_TYPES = /* @__PURE__ */ new Set([
|
|
1254
1268
|
"static_select",
|
|
1255
1269
|
"multi_static_select",
|
|
@@ -1325,7 +1339,8 @@ function buildSlackBlocksFallbackText(blocks) {
|
|
|
1325
1339
|
function buildSlackCompleteBlocksFallbackText(blocks, options = {}) {
|
|
1326
1340
|
return blocks.map((block) => renderSlackBlockFallbackText(block, options)).filter(Boolean).join("\n\n").trim() || buildSlackBlocksFallbackText(blocks);
|
|
1327
1341
|
}
|
|
1328
|
-
|
|
1342
|
+
//#endregion
|
|
1343
|
+
//#region extensions/slack/src/blocks-input.ts
|
|
1329
1344
|
const SLACK_MAX_BLOCKS = 50;
|
|
1330
1345
|
function parseBlocksJson(raw) {
|
|
1331
1346
|
try {
|
|
@@ -1349,7 +1364,8 @@ function parseSlackBlocksInput(raw) {
|
|
|
1349
1364
|
if (raw == null) return;
|
|
1350
1365
|
return validateSlackBlocksArray(typeof raw === "string" ? parseBlocksJson(raw) : raw);
|
|
1351
1366
|
}
|
|
1352
|
-
|
|
1367
|
+
//#endregion
|
|
1368
|
+
//#region extensions/slack/src/approval-actions.ts
|
|
1353
1369
|
const SLACK_APPROVAL_VALUE_PREFIX = "openclaw:approval:v1:";
|
|
1354
1370
|
const SLACK_APPROVAL_HEADER_BLOCK_ID = "openclaw_approval_header";
|
|
1355
1371
|
function isApprovalDecision(value) {
|
|
@@ -1386,7 +1402,8 @@ function decodeSlackApprovalAction(value) {
|
|
|
1386
1402
|
return null;
|
|
1387
1403
|
}
|
|
1388
1404
|
}
|
|
1389
|
-
|
|
1405
|
+
//#endregion
|
|
1406
|
+
//#region extensions/slack/src/question-actions.ts
|
|
1390
1407
|
const SLACK_QUESTION_VALUE_PREFIX = "slq1:";
|
|
1391
1408
|
const QUESTION_RECORD_ID_PATTERN = /^ask_[a-f0-9]{32}$/u;
|
|
1392
1409
|
function encodeSlackQuestionAction(action) {
|
|
@@ -1417,7 +1434,8 @@ async function resolveSlackQuestionAction(params) {
|
|
|
1417
1434
|
}
|
|
1418
1435
|
await params.respond(result.status === "answered" ? "Answer submitted." : "This question was already answered.").catch(() => {});
|
|
1419
1436
|
}
|
|
1420
|
-
|
|
1437
|
+
//#endregion
|
|
1438
|
+
//#region extensions/slack/src/reply-action-ids.ts
|
|
1421
1439
|
const SLACK_REPLY_BUTTON_ACTION_ID = "openclaw:reply_button";
|
|
1422
1440
|
const SLACK_REPLY_LINK_ACTION_ID = "openclaw:reply_link";
|
|
1423
1441
|
const SLACK_SESSION_LINK_ACTION_ID = "openclaw:session_link";
|
|
@@ -1451,7 +1469,8 @@ function resolveSlackQuestionActionIds(blocks, questionId) {
|
|
|
1451
1469
|
return (block.elements ?? []).flatMap((element) => element.action_id && (questionId ? isSlackQuestionActionForQuestion(element, questionId) : isSlackQuestionActionId(element.action_id)) ? [element.action_id] : []);
|
|
1452
1470
|
});
|
|
1453
1471
|
}
|
|
1454
|
-
|
|
1472
|
+
//#endregion
|
|
1473
|
+
//#region extensions/slack/src/truncate.ts
|
|
1455
1474
|
function truncateSlackText(value, max, whitespace = "trim") {
|
|
1456
1475
|
const text = whitespace === "preserve" ? value : value.trim();
|
|
1457
1476
|
if (text.length <= max) return text;
|
|
@@ -1476,7 +1495,8 @@ function truncateSlackTextByUtf8Bytes(value, maxBytes) {
|
|
|
1476
1495
|
const prefix = truncateUtf8Prefix(trimmed, prefixBudget);
|
|
1477
1496
|
return maxBytes >= suffixBytes ? `${prefix}${suffix}` : prefix;
|
|
1478
1497
|
}
|
|
1479
|
-
|
|
1498
|
+
//#endregion
|
|
1499
|
+
//#region extensions/slack/src/native-data-blocks.ts
|
|
1480
1500
|
const SLACK_MALFORMED_NATIVE_DATA_FALLBACK = "Slack could not render this chart or table data.";
|
|
1481
1501
|
const SLACK_RESPONSE_URL_BODY_LIMIT_BYTES = 16384;
|
|
1482
1502
|
const SLACK_RESPONSE_URL_BODY_TIMEOUT_MS = 3e4;
|
|
@@ -1579,12 +1599,14 @@ function appendSlackNativeDataFallbackText(text, blocks) {
|
|
|
1579
1599
|
function appendSlackNativeDataPlainTextFallback(text, blocks) {
|
|
1580
1600
|
return appendSlackBlockFallback(text.trim(), blocks, renderSlackNativeDataPlainTextBlock);
|
|
1581
1601
|
}
|
|
1582
|
-
|
|
1602
|
+
//#endregion
|
|
1603
|
+
//#region extensions/slack/src/detached-target-admission.ts
|
|
1583
1604
|
function assertSlackDetachedTargetAllowed(accountId, teamId) {
|
|
1584
1605
|
const installationKind = getSlackInstallationKind(accountId);
|
|
1585
1606
|
if (installationKind && installationKind !== "workspace" && !teamId) throw new Error("unsupported_enterprise_slack_delivery: detached Slack operations require team:<team-id>:channel:<channel-id> or team:<team-id>:user:<user-id> until a workspace install is authenticated");
|
|
1586
1607
|
}
|
|
1587
|
-
|
|
1608
|
+
//#endregion
|
|
1609
|
+
//#region extensions/slack/src/conversation-binding-route.ts
|
|
1588
1610
|
const slackRouteBindingConfigCache = /* @__PURE__ */ new WeakMap();
|
|
1589
1611
|
function normalizeSlackRouteBindingPeer(peer) {
|
|
1590
1612
|
const rawId = peer.id.trim();
|
|
@@ -1721,7 +1743,8 @@ function applySlackConfiguredBindingRoute(params, runtimeRoute) {
|
|
|
1721
1743
|
route: runtimeRoute.boundSessionKey ? runtimeRoute.route : configuredRoute?.route ?? runtimeRoute.route
|
|
1722
1744
|
};
|
|
1723
1745
|
}
|
|
1724
|
-
|
|
1746
|
+
//#endregion
|
|
1747
|
+
//#region extensions/slack/src/monitor/workspace-routing.ts
|
|
1725
1748
|
function resolveSlackAgentRoute(params) {
|
|
1726
1749
|
const route = resolveAgentRoute({
|
|
1727
1750
|
cfg: params.cfg,
|
|
@@ -1755,7 +1778,8 @@ function qualifySlackRoutePeerId(params) {
|
|
|
1755
1778
|
function qualifySlackConversationId(conversationId, eventScope) {
|
|
1756
1779
|
return eventScope ? `team:${encodeURIComponent(eventScope.teamId)}:${conversationId}` : conversationId;
|
|
1757
1780
|
}
|
|
1758
|
-
|
|
1781
|
+
//#endregion
|
|
1782
|
+
//#region extensions/slack/src/errors.ts
|
|
1759
1783
|
const NO_ERROR_DETAIL = "no error detail";
|
|
1760
1784
|
const MAX_ERROR_CAUSE_DEPTH = 32;
|
|
1761
1785
|
function getSlackWebApiErrorData(error) {
|
|
@@ -1862,7 +1886,8 @@ function formatSlackErrorWithCauses(error, fallback, seen) {
|
|
|
1862
1886
|
function formatSlackError(error, fallback = NO_ERROR_DETAIL) {
|
|
1863
1887
|
return formatSlackErrorWithCauses(error, fallback, /* @__PURE__ */ new Set());
|
|
1864
1888
|
}
|
|
1865
|
-
|
|
1889
|
+
//#endregion
|
|
1890
|
+
//#region extensions/slack/src/channel-policy-state.ts
|
|
1866
1891
|
const slackChannelPolicyBindings = resolveGlobalMap(Symbol.for("openclaw.slack.channel-policy-bindings"), "close-and-restart");
|
|
1867
1892
|
function setSlackChannelPolicyBindings(accountId, bindings) {
|
|
1868
1893
|
slackChannelPolicyBindings.set(normalizeAccountId(accountId), new Map([...bindings].map(([key, id]) => [key, id.toUpperCase()])));
|
|
@@ -1872,7 +1897,8 @@ function getSlackChannelPolicyKeys(accountId, channelId) {
|
|
|
1872
1897
|
if (!id) return [];
|
|
1873
1898
|
return [...slackChannelPolicyBindings.get(normalizeAccountId(accountId)) ?? []].filter(([, resolvedId]) => resolvedId === id).map(([key]) => key);
|
|
1874
1899
|
}
|
|
1875
|
-
|
|
1900
|
+
//#endregion
|
|
1901
|
+
//#region extensions/slack/src/group-policy.ts
|
|
1876
1902
|
function hasPotentialSlackNamedPolicy(params) {
|
|
1877
1903
|
if (params.allowNameMatching !== true) return false;
|
|
1878
1904
|
return Object.entries(params.channels ?? {}).some(([key, entry]) => {
|
|
@@ -1933,7 +1959,8 @@ function resolveSlackGroupToolPolicy(params) {
|
|
|
1933
1959
|
senderE164: params.senderE164
|
|
1934
1960
|
});
|
|
1935
1961
|
}
|
|
1936
|
-
|
|
1962
|
+
//#endregion
|
|
1963
|
+
//#region extensions/slack/src/monitor/ingress-identity.ts
|
|
1937
1964
|
const SLACK_USER_NAME_KIND = "plugin:slack-user-name";
|
|
1938
1965
|
const SLACK_WORKSPACE_USER_ID_KIND = "plugin:slack-workspace-user-id";
|
|
1939
1966
|
function normalizeSlackUserId(raw) {
|
|
@@ -2030,7 +2057,8 @@ function createSlackIngressSubject(params) {
|
|
|
2030
2057
|
}
|
|
2031
2058
|
};
|
|
2032
2059
|
}
|
|
2033
|
-
|
|
2060
|
+
//#endregion
|
|
2061
|
+
//#region extensions/slack/src/session-status.ts
|
|
2034
2062
|
const MISSING_STOP_SUBSCRIPTION = "missing_agent_session_stopped_event_subscription";
|
|
2035
2063
|
let warnedMissingStopSubscription = false;
|
|
2036
2064
|
async function setSlackSessionStatus(params) {
|
|
@@ -2071,7 +2099,8 @@ async function renameSlackSession(params) {
|
|
|
2071
2099
|
return false;
|
|
2072
2100
|
}
|
|
2073
2101
|
}
|
|
2074
|
-
|
|
2102
|
+
//#endregion
|
|
2103
|
+
//#region extensions/slack/src/probe.ts
|
|
2075
2104
|
var probe_exports = /* @__PURE__ */ __exportAll({ probeSlack: () => probeSlack });
|
|
2076
2105
|
async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
2077
2106
|
const dispatcher = createSlackProbeDispatcher(timeoutMs);
|
|
@@ -2131,4 +2160,5 @@ async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
|
2131
2160
|
await dispatcher.destroy().catch(() => void 0);
|
|
2132
2161
|
}
|
|
2133
2162
|
}
|
|
2163
|
+
//#endregion
|
|
2134
2164
|
export { decodeSlackApprovalAction as $, resolveSlackExecApprovalTarget as $t, isSlackInvalidBlocksResponse as A, resolveSessionSlackOriginTarget as At, SLACK_REPLY_LINK_ACTION_ID as B, allowListMatches as Bt, SLACK_MALFORMED_NATIVE_DATA_FALLBACK as C, markdownToSlackMrkdwnChunks as Ct, createSlackNativeDataBaseTextConsumer as D, isSlackPluginApprovalRequest as Dt, buildSlackNativeDataAccessibilityText as E, isSlackAnyNativeApprovalClientEnabled as Et, truncateSlackText as F, shouldHandleSlackPluginViaForwardingSession as Ft, isSlackCallbackActionId as G, resolveSlackUserAllowed as Gt, SLACK_SELECT_ACTION_IDS as H, normalizeSlackSlug as Ht, truncateSlackTextByUtf8Bytes as I, slackTargetsMatch as It, resolveSlackQuestionActionIds as J, registerSlackInstallationState as Jt, isSlackQuestionActionForQuestion as K, getSlackInstallationKind as Kt, SLACK_BUTTON_ACTION_IDS as L, getSlackApprovalApproversForTeam as Lt, renderSlackNativeDataPlainTextBlock as M, resolveSlackFallbackOriginTarget as Mt, stripSlackNativeDataBlocks as N, resolveTurnSourceSlackOriginTarget as Nt, hasSlackNativeDataBlock as O, normalizeSlackForwardTarget as Ot, countSlackTextUtf8Bytes as P, shouldHandleSlackNativeApprovalRequest as Pt, SLACK_APPROVAL_HEADER_BLOCK_ID as Q, normalizeSlackApproverId as Qt, SLACK_QUESTION_FINALIZATION_BLOCKS as R, isSlackPluginApprovalAuthorizedSender as Rt, assertSlackDetachedTargetAllowed as S, chunkSlackMrkdwnText as St, appendSlackNativeDataPlainTextFallback as T, escapeSlackMrkdwn as Tt, SLACK_SESSION_LINK_ACTION_ID as U, resolveSlackAllowListMatch as Ut, SLACK_REPLY_SELECT_ACTION_ID as V, normalizeSlackAllowOwnerEntry as Vt, isSlackApprovalActionId as W, resolveSlackUserAllowListForTeam as Wt, encodeSlackQuestionAction as X, isSlackExecApprovalAuthorizedSender as Xt, decodeSlackQuestionAction as Y, getSlackExecApprovalApprovers as Yt, resolveSlackQuestionAction as Z, isSlackExecApprovalClientEnabled as Zt, qualifySlackRoutePeerId as _, renderSlackMessagePresentationFallbackText as _t, SLACK_USER_NAME_KIND as a, buildSlackCompleteBlocksFallbackText as at, resolveSlackConversationBindingRoute as b, SLACK_MESSAGE_TEXT_RECOMMENDED_LIMIT as bt, buildSlackChannelIdCandidates as c, hasSlackDataVisualizationBlock as ct, resolveSlackGroupRequireMention as d, countSlackDataTableBlocksCellCharacters as dt, shouldSuppressLocalSlackExecApprovalPrompt as en, encodeSlackApprovalAction as et, resolveSlackGroupToolPolicy as f, countSlackDataTableCellCharacters as ft, qualifySlackConversationId as g, renderSlackMessagePresentationChartFallbackText as gt, getSlackWebApiErrorData as h, SLACK_SECTION_TEXT_MAX as ht, setSlackSessionStatus as i, resolveSlackThreadTsFromContext as in, buildSlackBlocksFallbackText as it, isSlackNativeResponseUrlRejection as j, resolveSlackApproverDmTargets as jt, isSlackInvalidBlocksError as k, normalizeSlackOriginTarget as kt, buildSlackChannelPolicyScope as l, SLACK_DATA_TABLE_AGGREGATE_CELL_CHARACTERS_MAX as lt, formatSlackError as m, SLACK_PRESENTATION_CAPABILITIES as mt, probe_exports as n, SLACK_PRIVATE_ACTION_DELIVERY_RESULT as nn, parseSlackBlocksInput as nt, createSlackIngressSubject as o, renderSlackBlockFallbackText as ot, setSlackChannelPolicyBindings as p, SLACK_BUTTON_VALUE_MAX as pt, isSlackQuestionActionId as q, isSlackWorkspaceInstallation as qt, renameSlackSession as r, resolveSlackAutoThreadId as rn, validateSlackBlocksArray as rt, slackIngressIdentity as s, buildSlackDataVisualizationBlock as st, probeSlack as t, resolvePluginApprovalSlackApprovers as tn, SLACK_MAX_BLOCKS as tt, hasPotentialSlackNamedPolicy as u, buildSlackDataTableBlock as ut, resolveSlackAgentRoute as v, SLACK_EDIT_TEXT_MAX_BYTES as vt, appendSlackNativeDataFallbackText as w, normalizeSlackOutboundText as wt, resolveSlackConversationBindingRouteAsync as x, SLACK_TEXT_LIMIT as xt, normalizeSlackRouteBindingConfig as y, SLACK_MESSAGE_TEXT_HARD_LIMIT as yt, SLACK_REPLY_BUTTON_ACTION_ID as z, resolveSlackApprovalTeamId as zt };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { J as resolveSlackQuestionActionIds, K as isSlackQuestionActionForQuestion, R as SLACK_QUESTION_FINALIZATION_BLOCKS, Tt as escapeSlackMrkdwn, at as buildSlackCompleteBlocksFallbackText } from "./probe-
|
|
1
|
+
import { J as resolveSlackQuestionActionIds, K as isSlackQuestionActionForQuestion, R as SLACK_QUESTION_FINALIZATION_BLOCKS, Tt as escapeSlackMrkdwn, at as buildSlackCompleteBlocksFallbackText } from "./probe-DANukR3O.mjs";
|
|
2
2
|
import { questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
|
|
3
|
-
|
|
3
|
+
//#region extensions/slack/src/question-delivery.ts
|
|
4
4
|
function registerSlackQuestionDelivery(params) {
|
|
5
5
|
const blocks = params.result.meta?.[SLACK_QUESTION_FINALIZATION_BLOCKS];
|
|
6
6
|
if (!blocks || resolveSlackQuestionActionIds(blocks, params.questionId).length === 0) return;
|
|
@@ -35,4 +35,5 @@ function registerSlackQuestionDelivery(params) {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
+
//#endregion
|
|
38
39
|
export { registerSlackQuestionDelivery as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { m as formatSlackError } from "./probe-
|
|
2
|
-
import { d as parseSlackMessageEvent, f as requireSlackMessageEvent, x as SLACK_SOCKET_RECONNECT_POLICY } from "./monitor-
|
|
1
|
+
import { m as formatSlackError } from "./probe-DANukR3O.mjs";
|
|
2
|
+
import { d as parseSlackMessageEvent, f as requireSlackMessageEvent, x as SLACK_SOCKET_RECONNECT_POLICY } from "./monitor-Cm1TuqxN.mjs";
|
|
3
3
|
import { asOptionalRecord, normalizeOptionalString, readStringValue } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { computeBackoff, sleepWithAbort, warn } from "openclaw/plugin-sdk/runtime-env";
|
|
5
5
|
import { createNodeProxyAgent } from "openclaw/plugin-sdk/fetch-runtime";
|
|
6
6
|
import { isIP } from "node:net";
|
|
7
7
|
import { rawDataToString } from "openclaw/plugin-sdk/webhook-ingress";
|
|
8
8
|
import { WebSocket, startWebSocketKeepalive } from "openclaw/plugin-sdk/websocket-runtime";
|
|
9
|
-
|
|
9
|
+
//#region extensions/slack/src/monitor/relay-source.ts
|
|
10
10
|
const SLACK_RELAY_ROUTE_KINDS = /* @__PURE__ */ new Set([
|
|
11
11
|
"user_group",
|
|
12
12
|
"thread_affinity",
|
|
@@ -253,4 +253,5 @@ function formatRelayClose(code, reason) {
|
|
|
253
253
|
const text = reason.toString("utf8");
|
|
254
254
|
return text ? `Slack relay websocket closed (${code} ${text})` : `Slack relay websocket closed (${code})`;
|
|
255
255
|
}
|
|
256
|
+
//#endregion
|
|
256
257
|
export { SLACK_RELAY_MAX_PAYLOAD_BYTES, SlackRelayMalformedFrameError, buildRelayWebSocketOptions, buildRelayWebSocketUrl, monitorSlackRelaySource, parseRelayFrame, requireSlackMessageEvent };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as isSlackInvalidBlocksResponse, Ct as markdownToSlackMrkdwnChunks, O as hasSlackNativeDataBlock, j as isSlackNativeResponseUrlRejection, xt as SLACK_TEXT_LIMIT } from "./probe-
|
|
2
|
-
import { n as resolveSlackReplyThreadTs } from "./thread-ts-
|
|
3
|
-
import { a as resolveSlackReplyBlockResolution, n as iterateSlackReplyDeliveryMessages, t as hasSlackReplyStructuredContent } from "./reply-blocks-
|
|
4
|
-
import { g as chunkSlackTextAtHardLimit, h as buildSlackNativeDataDeliveryPlan, i as updateMessageSlack, t as sendMessageSlack } from "./send-
|
|
5
|
-
import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./monitor-
|
|
6
|
-
import { t as registerSlackQuestionDelivery } from "./question-delivery-
|
|
1
|
+
import { A as isSlackInvalidBlocksResponse, Ct as markdownToSlackMrkdwnChunks, O as hasSlackNativeDataBlock, j as isSlackNativeResponseUrlRejection, xt as SLACK_TEXT_LIMIT } from "./probe-DANukR3O.mjs";
|
|
2
|
+
import { n as resolveSlackReplyThreadTs } from "./thread-ts-Cvt7WD6B.mjs";
|
|
3
|
+
import { a as resolveSlackReplyBlockResolution, n as iterateSlackReplyDeliveryMessages, t as hasSlackReplyStructuredContent } from "./reply-blocks-BzsXUUUL.mjs";
|
|
4
|
+
import { g as chunkSlackTextAtHardLimit, h as buildSlackNativeDataDeliveryPlan, i as updateMessageSlack, t as sendMessageSlack } from "./send-yK6_-px6.mjs";
|
|
5
|
+
import { a as createSlackResponseUrlBudget, i as SlackResponseAlreadyReportedError } from "./monitor-Cm1TuqxN.mjs";
|
|
6
|
+
import { t as registerSlackQuestionDelivery } from "./question-delivery-CWC7sRhH.mjs";
|
|
7
7
|
import { sanitizeAssistantVisibleText } from "openclaw/plugin-sdk/text-chunking";
|
|
8
8
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
9
9
|
import { deliverTextOrMediaReply, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -14,7 +14,7 @@ import { chunkMarkdownTextWithMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
|
14
14
|
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
15
15
|
import { createAcceptedChannelDeliveryResult, createChannelPartialDeliveryError, getGroupThreadDeliverySession } from "openclaw/plugin-sdk/channel-inbound";
|
|
16
16
|
import { buildCanonicalSentMessageHookContext, createInternalHookEvent, fireAndForgetHook, toInternalMessageSentContext, toPluginMessageContext, toPluginMessageSentEvent, triggerInternalHook } from "openclaw/plugin-sdk/hook-runtime";
|
|
17
|
-
|
|
17
|
+
//#region extensions/slack/src/message-sent-hook.ts
|
|
18
18
|
function emitSlackMessageSentHooks(params) {
|
|
19
19
|
const hookRunner = getGlobalHookRunner();
|
|
20
20
|
const enabled = hookRunner?.hasHooks("message_sent") ?? false;
|
|
@@ -35,7 +35,8 @@ function emitSlackMessageSentHooks(params) {
|
|
|
35
35
|
if (enabled) fireAndForgetHook(Promise.resolve(hookRunner.runMessageSent(toPluginMessageSentEvent(canonical), toPluginMessageContext(canonical))), "slack: message_sent plugin hook failed");
|
|
36
36
|
if (params.sessionKeyForInternalHooks) fireAndForgetHook(triggerInternalHook(createInternalHookEvent("message", "sent", params.sessionKeyForInternalHooks, toInternalMessageSentContext(canonical))), "slack: message:sent internal hook failed");
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region extensions/slack/src/monitor/replies.ts
|
|
39
40
|
function compactSlackResponseUrlFallback(messages) {
|
|
40
41
|
if (messages.length <= 1) return [...messages];
|
|
41
42
|
if (messages.every((message) => !message.blocks?.length)) return chunkSlackTextAtHardLimit(messages.map((message) => message.text).join("")).map((text) => ({
|
|
@@ -435,4 +436,5 @@ async function deliverSlackSlashReplies(params) {
|
|
|
435
436
|
});
|
|
436
437
|
}
|
|
437
438
|
}
|
|
439
|
+
//#endregion
|
|
438
440
|
export { emitSlackMessageSentHooks as a, sanitizeSlackMonitorReplyPayload as i, deliverReplies as n, deliverSlackSlashReplies as r, createSlackReplyDeliveryPlan as t };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Ct as markdownToSlackMrkdwnChunks, E as buildSlackNativeDataAccessibilityText, F as truncateSlackText, H as SLACK_SELECT_ACTION_IDS, L as SLACK_BUTTON_ACTION_IDS, O as hasSlackNativeDataBlock, St as chunkSlackMrkdwnText, Tt as escapeSlackMrkdwn, X as encodeSlackQuestionAction, at as buildSlackCompleteBlocksFallbackText, ct as hasSlackDataVisualizationBlock, dt as countSlackDataTableBlocksCellCharacters, et as encodeSlackApprovalAction, ft as countSlackDataTableCellCharacters, gt as renderSlackMessagePresentationChartFallbackText, ht as SLACK_SECTION_TEXT_MAX, it as buildSlackBlocksFallbackText, nt as parseSlackBlocksInput, ot as renderSlackBlockFallbackText, st as buildSlackDataVisualizationBlock, ut as buildSlackDataTableBlock, w as appendSlackNativeDataFallbackText } from "./probe-
|
|
1
|
+
import { Ct as markdownToSlackMrkdwnChunks, E as buildSlackNativeDataAccessibilityText, F as truncateSlackText, H as SLACK_SELECT_ACTION_IDS, L as SLACK_BUTTON_ACTION_IDS, O as hasSlackNativeDataBlock, St as chunkSlackMrkdwnText, Tt as escapeSlackMrkdwn, X as encodeSlackQuestionAction, at as buildSlackCompleteBlocksFallbackText, ct as hasSlackDataVisualizationBlock, dt as countSlackDataTableBlocksCellCharacters, et as encodeSlackApprovalAction, ft as countSlackDataTableCellCharacters, gt as renderSlackMessagePresentationChartFallbackText, ht as SLACK_SECTION_TEXT_MAX, it as buildSlackBlocksFallbackText, nt as parseSlackBlocksInput, ot as renderSlackBlockFallbackText, st as buildSlackDataVisualizationBlock, ut as buildSlackDataTableBlock, w as appendSlackNativeDataFallbackText } from "./probe-DANukR3O.mjs";
|
|
2
2
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
4
4
|
import { legacyInteractiveReplyToPresentation, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveMessagePresentationButtonAction, resolveMessagePresentationOptionAction } from "openclaw/plugin-sdk/interactive-runtime";
|
|
5
5
|
import { resolveAskUserQuestionOptionIndex, resolveAskUserQuestionOptionIndices, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
6
6
|
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
7
|
-
|
|
7
|
+
//#region extensions/slack/src/authored-text.ts
|
|
8
8
|
function isSlackAuthoredTextRepresentedInFragments(plan, fragments) {
|
|
9
9
|
if (plan.length === 0) return false;
|
|
10
10
|
if (fragments.some((_, start) => plan.every((text, index) => text === fragments[start + index]))) return true;
|
|
@@ -30,7 +30,8 @@ function resolveSlackAuthoredTextPlacement(params) {
|
|
|
30
30
|
const fragments = (params.renderedTextFragments ?? params.interactive?.blocks.flatMap((block) => block.type === "text" ? [block.text] : []) ?? []).map((fragment) => fragment?.trim() ?? null).filter((fragment) => fragment !== "");
|
|
31
31
|
return isSlackAuthoredTextRepresentedInFragments((params.authoredChunks ?? [text]).map((fragment) => fragment.trim()).filter(Boolean), fragments) ? "blocks" : "outside-blocks";
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region extensions/slack/src/blocks-render.ts
|
|
34
35
|
const SLACK_BUTTON_URL_MAX = 3e3;
|
|
35
36
|
function buildSlackPlainText(text, maxLength) {
|
|
36
37
|
return {
|
|
@@ -284,7 +285,8 @@ function compileSlackPresentationBlocks(presentation, options, requireComplete)
|
|
|
284
285
|
}
|
|
285
286
|
return blocks;
|
|
286
287
|
}
|
|
287
|
-
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region extensions/slack/src/reply-blocks.ts
|
|
288
290
|
function normalizeSlackReplyPayload(payload) {
|
|
289
291
|
const previousSlackData = asOptionalRecord(payload.channelData?.slack) ?? {};
|
|
290
292
|
const { authoredPresentationText: _authoredPresentationText, ...slackData } = previousSlackData;
|
|
@@ -640,4 +642,5 @@ function resolveSlackReplyBlocks(payload) {
|
|
|
640
642
|
const segments = compileSlackReplyBlockSegments(payload, readSlackChannelBlocks(payload), normalizeMessagePresentation(payload.presentation));
|
|
641
643
|
return segments.length === 1 && segments[0]?.kind === "blocks" ? segments[0].blocks : void 0;
|
|
642
644
|
}
|
|
645
|
+
//#endregion
|
|
643
646
|
export { resolveSlackReplyBlockResolution as a, resolveSlackReplyRenderPlan as c, resolveSlackAuthoredTextPlacement as d, prepareSlackReply as i, buildSlackInteractiveBlocks as l, iterateSlackReplyDeliveryMessages as n, resolveSlackReplyBlocks as o, normalizeSlackReplyPayload as r, resolveSlackReplyDeliveryMessages as s, hasSlackReplyStructuredContent as t, buildSlackPresentationBlocks as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-
|
|
3
|
-
import { n as fetchSlackChannelListPage, r as createSlackLookupClient, t as collectSlackCursorPages } from "./cursor-pages-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-Bx2UZniD.mjs";
|
|
3
|
+
import { n as fetchSlackChannelListPage, r as createSlackLookupClient, t as collectSlackCursorPages } from "./cursor-pages-CATAzbTT.mjs";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/slack/src/resolve-channels.ts
|
|
6
6
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveSlackChannelAllowlist: () => resolveSlackChannelAllowlist });
|
|
7
7
|
function parseSlackChannelMention(raw) {
|
|
8
8
|
const trimmed = raw.trim();
|
|
@@ -64,4 +64,5 @@ async function resolveSlackChannelAllowlist(params) {
|
|
|
64
64
|
};
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
|
+
//#endregion
|
|
67
68
|
export { resolve_channels_exports as n, resolveSlackChannelAllowlist as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-
|
|
3
|
-
import { r as createSlackLookupClient, t as collectSlackCursorPages } from "./cursor-pages-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-Bx2UZniD.mjs";
|
|
3
|
+
import { r as createSlackLookupClient, t as collectSlackCursorPages } from "./cursor-pages-CATAzbTT.mjs";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/slack/src/resolve-users.ts
|
|
6
6
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveSlackUserAllowlist: () => resolveSlackUserAllowlist });
|
|
7
7
|
function parseSlackUserInput(raw) {
|
|
8
8
|
const trimmed = raw.trim();
|
|
@@ -73,4 +73,5 @@ async function resolveSlackUserAllowlist(params) {
|
|
|
73
73
|
return result;
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
+
//#endregion
|
|
76
77
|
export { resolve_users_exports as n, resolveSlackUserAllowlist as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -24,4 +24,5 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
24
|
return to;
|
|
25
25
|
};
|
|
26
26
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
27
|
+
//#endregion
|
|
27
28
|
export { __reExport as n, __exportAll as t };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
//#region extensions/slack/src/runtime.ts
|
|
3
3
|
const { setRuntime: setSlackRuntime, tryGetRuntime: getOptionalSlackRuntime, getRuntime: getSlackRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "slack",
|
|
5
5
|
errorMessage: "Slack runtime not initialized"
|
|
6
6
|
});
|
|
7
|
+
//#endregion
|
|
7
8
|
export { getSlackRuntime as n, setSlackRuntime as r, getOptionalSlackRuntime as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as formatSlackError } from "./probe-
|
|
2
|
-
import { i as createSlackReadClient } from "./cursor-pages-
|
|
1
|
+
import { m as formatSlackError } from "./probe-DANukR3O.mjs";
|
|
2
|
+
import { i as createSlackReadClient } from "./cursor-pages-CATAzbTT.mjs";
|
|
3
3
|
import { isRecord, normalizeOptionalString, normalizeTrimmedStringList, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
-
|
|
4
|
+
//#region extensions/slack/src/scopes.ts
|
|
5
5
|
function collectScopes(value, into) {
|
|
6
6
|
if (Array.isArray(value) || typeof value === "string") {
|
|
7
7
|
for (const scope of normalizeTrimmedStringList(typeof value === "string" ? value.split(/[,\s]+/) : value)) into.push(scope);
|
|
@@ -59,4 +59,5 @@ async function fetchSlackScopes(token, timeoutMs) {
|
|
|
59
59
|
error: errors.length > 0 ? errors.join(" | ") : "no scopes returned"
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
//#endregion
|
|
62
63
|
export { fetchSlackScopes };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { t as channelSecrets, n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-
|
|
1
|
+
export { t as channelSecrets, n as collectRuntimeConfigAssignments, r as secretTargetRegistryEntries } from "./secret-contract-uiQtoNlu.mjs";
|
|
2
2
|
import "../secret-contract-api.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as hasSlackAccountCredentialsFromConfig } from "./account-configured-
|
|
1
|
+
import { n as hasSlackAccountCredentialsFromConfig } from "./account-configured-zcR9TJJN.mjs";
|
|
2
2
|
import { collectConditionalChannelFieldAssignments, collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, createChannelSecretContract, hasOwnProperty, isRecord } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
3
|
-
|
|
3
|
+
//#region extensions/slack/src/secret-contract.ts
|
|
4
4
|
const channelSecrets = createChannelSecretContract({
|
|
5
5
|
channelKey: "slack",
|
|
6
6
|
account: [
|
|
@@ -63,4 +63,5 @@ const channelSecrets = createChannelSecretContract({
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
const { secretTargetRegistryEntries, collectRuntimeConfigAssignments } = channelSecrets;
|
|
66
|
+
//#endregion
|
|
66
67
|
export { collectRuntimeConfigAssignments as n, secretTargetRegistryEntries as r, channelSecrets as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
2
|
import { coerceNativeSetting, normalizeAllowFromList } from "openclaw/plugin-sdk/channel-policy";
|
|
3
3
|
import { readChannelAllowFromStore } from "openclaw/plugin-sdk/conversation-runtime";
|
|
4
4
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
|
|
5
|
-
|
|
5
|
+
//#region extensions/slack/src/security-audit.ts
|
|
6
6
|
var security_audit_exports = /* @__PURE__ */ __exportAll({ collectSlackSecurityAuditFindings: () => collectSlackSecurityAuditFindings });
|
|
7
7
|
async function collectSlackSecurityAuditFindings(params) {
|
|
8
8
|
const findings = [];
|
|
@@ -37,4 +37,5 @@ async function collectSlackSecurityAuditFindings(params) {
|
|
|
37
37
|
});
|
|
38
38
|
return findings;
|
|
39
39
|
}
|
|
40
|
+
//#endregion
|
|
40
41
|
export { security_audit_exports as n, collectSlackSecurityAuditFindings as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
2
|
-
|
|
2
|
+
//#region extensions/slack/src/send-results.ts
|
|
3
3
|
function mergeSlackSendResults(results) {
|
|
4
4
|
const lastResult = results.at(-1);
|
|
5
5
|
if (!lastResult) throw new Error("Slack send plan produced no delivery.");
|
|
@@ -18,4 +18,5 @@ function mergeSlackSendResults(results) {
|
|
|
18
18
|
} } : {}
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
+
//#endregion
|
|
21
22
|
export { mergeSlackSendResults as t };
|