@openclaw/slack 2026.9.1-beta.1 → 2026.9.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/{account-inspect-CN2hBsim.js → account-inspect-C3sePHWa.js} +3 -3
- package/dist/account-inspect-api.js +1 -1
- package/dist/{action-runtime-BoSeX09X.js → action-runtime-DftQWpI4.js} +84 -66
- package/dist/action-runtime.runtime-rHI3UAh4.js +2 -0
- package/dist/{actions-XdQyjG_p.js → actions-CFkvEv1d.js} +198 -54
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-DxXfGX_Z.js → approval-handler.runtime-BeILKdw4.js} +47 -25
- package/dist/{channel-C_vnTgxo.js → channel-CmOuxbOD.js} +76 -133
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-j-2lalcC.js → channel-type-BWt2CRaI.js} +2 -2
- package/dist/{channel.setup-aal8tokM.js → channel.setup-D5z1ReaT.js} +29 -23
- package/dist/{config-schema-CN3XZRX5.js → config-schema-JDx_f9Zb.js} +26 -17
- package/dist/{cursor-pages-eX7p8Wwt.js → cursor-pages-ByFwo-Py.js} +7 -1
- package/dist/{directory-config-DqfQ42OV.js → directory-config-Bmw4ykSy.js} +4 -3
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-lC6X_Ru-.js → directory-live-BuBPHmju.js} +3 -8
- package/dist/{doctor-contract-BAy7-EUQ.js → doctor-contract-BNjw9bxb.js} +5 -4
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{message-tool-api-CWosHSi5.js → message-tool-api-uNEfQYGY.js} +19 -2
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-DrNCGneD.js → monitor-DI07pfJl.js} +3 -3
- package/dist/{outbound-adapter-DkT2vUE9.js → outbound-adapter-B5QyTRpJ.js} +96 -91
- package/dist/{pipeline.runtime-CRRng_Nw.js → pipeline.runtime-BdIwZgm4.js} +596 -920
- package/dist/{policy-BoP6t88v.js → policy-Bh5TOqII.js} +7 -4
- package/dist/{probe-4_aHtVT3.js → probe-Biy--yhL.js} +251 -12
- package/dist/{provider-D4nDgxCh.js → provider-DoaUvAM4.js} +5621 -4944
- package/dist/{relay-source-CEmze11m.js → relay-source-D4uecp68.js} +6 -4
- package/dist/{replies-D9XMM_S0.js → replies-DENuTcPO.js} +21 -16
- package/dist/reply-blocks-PRkhyAN7.js +790 -0
- package/dist/{resolve-channels-DSamDgVs.js → resolve-channels-DQGV2VrE.js} +6 -10
- package/dist/{resolve-users-CIzwbaJR.js → resolve-users-DRGt_Q4I.js} +5 -4
- package/dist/runtime-api.js +10 -10
- package/dist/{scopes-BBrUzpBH.js → scopes-CZzeGdWV.js} +1 -1
- package/dist/{send-DtjEnlLh.js → send-DElUcgIs.js} +32 -24
- package/dist/send-results-eeOu_HYm.js +23 -0
- package/dist/{send.runtime-DQeNKa2J.js → send.runtime-C8D6cKGm.js} +1 -1
- package/dist/{group-policy-CU1tEGpS.js → session-status-BynwcZSO.js} +284 -1013
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-CsBCM4rP.js → setup-surface-B1_gpGBl.js} +5 -5
- package/dist/{shared-D9GeeR9K.js → shared-CNQsWJT7.js} +7 -5
- package/dist/{slash-dispatch.runtime-Chr3YHnT.js → slash-dispatch.runtime-DhsXavSY.js} +2 -2
- package/dist/{target-parsing-BnMD2ZqZ.js → target-parsing-PbxGDbr9.js} +11 -6
- package/dist/{targets-Cx5W_n3W.js → targets-7FexXJ62.js} +1 -1
- package/dist/{thread-ts-DUGhaYKq.js → thread-ts-CukseRVL.js} +5 -1
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/accept.js +54 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/charset.js +10 -34
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/encoding.js +9 -30
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/language.js +15 -36
- package/node_modules/@slack/bolt/node_modules/negotiator/lib/mediaType.js +16 -134
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +22 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +71 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +46 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +176 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +52 -0
- package/node_modules/@slack/bolt/node_modules/negotiator/package.json +16 -10
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +4 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +12 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +70 -14
- package/node_modules/undici/lib/dispatcher/client.js +6 -2
- package/node_modules/undici/lib/handler/cache-handler.js +21 -5
- package/node_modules/undici/lib/handler/retry-handler.js +42 -7
- package/node_modules/undici/lib/interceptor/cache.js +20 -1
- package/node_modules/undici/lib/interceptor/decompress.js +146 -14
- package/node_modules/undici/lib/interceptor/dump.js +10 -23
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +245 -150
- package/node_modules/undici/lib/web/websocket/connection.js +1 -1
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +8 -10
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/interceptors.d.ts +2 -0
- package/openclaw.plugin.json +17 -9
- package/package.json +6 -6
- package/skills/_vendor/slack-skills-plugin.LICENSE +21 -0
- package/skills/_vendor/slack-skills-plugin.json +31 -0
- package/skills/block-kit/SKILL.md +37 -0
- package/skills/block-kit/references/official-block-kit.md +257 -0
- package/skills/block-kit/references/official-common-patterns.md +385 -0
- package/skills/slack/SKILL.md +1 -1
- package/dist/action-runtime.runtime-Dpa16J87.js +0 -2
- package/dist/conversation-binding-route-DFVLUdYF.js +0 -115
- package/dist/slack-client-kind-hSfjXyUM.js +0 -94
- package/node_modules/@slack/bolt/node_modules/negotiator/HISTORY.md +0 -114
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
4
|
-
import { t as collectSlackCursorPages } from "./cursor-pages-
|
|
2
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-PbxGDbr9.js";
|
|
3
|
+
import { s as createSlackLookupClient } from "./probe-Biy--yhL.js";
|
|
4
|
+
import { n as fetchSlackChannelListPage, t as collectSlackCursorPages } from "./cursor-pages-ByFwo-Py.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
7
7
|
//#region extensions/slack/src/resolve-channels.ts
|
|
@@ -39,12 +39,7 @@ function parseSlackChannelMention(raw) {
|
|
|
39
39
|
}
|
|
40
40
|
async function listSlackChannels(client) {
|
|
41
41
|
return collectSlackCursorPages({
|
|
42
|
-
fetchPage: (cursor) => client
|
|
43
|
-
types: "public_channel,private_channel",
|
|
44
|
-
exclude_archived: false,
|
|
45
|
-
limit: 1e3,
|
|
46
|
-
cursor
|
|
47
|
-
}),
|
|
42
|
+
fetchPage: (cursor) => fetchSlackChannelListPage(client, cursor),
|
|
48
43
|
collectPageItems: (res) => (res.channels ?? []).map((channel) => {
|
|
49
44
|
const id = channel.id?.trim();
|
|
50
45
|
const name = channel.name?.trim();
|
|
@@ -83,9 +78,10 @@ async function resolveSlackChannelAllowlist(params) {
|
|
|
83
78
|
let resolvedIndex = 0;
|
|
84
79
|
return workspaceResolved.map((entry) => entry ?? resolved[resolvedIndex++]);
|
|
85
80
|
}
|
|
81
|
+
const channels = await listSlackChannels(params.client ?? createSlackLookupClient(params.token));
|
|
86
82
|
const resolved = resolveDirectoryAllowlistEntries({
|
|
87
83
|
entries: lookupEntries,
|
|
88
|
-
lookup:
|
|
84
|
+
lookup: channels,
|
|
89
85
|
parseInput: parseSlackChannelMention,
|
|
90
86
|
findById: (lookup, id) => lookup.find((channel) => channel.id === id),
|
|
91
87
|
buildIdResolved: ({ input, parsed, match }) => ({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
4
|
-
import { t as collectSlackCursorPages } from "./cursor-pages-
|
|
2
|
+
import { a as parseSlackTarget, n as formatSlackTarget } from "./target-parsing-PbxGDbr9.js";
|
|
3
|
+
import { s as createSlackLookupClient } from "./probe-Biy--yhL.js";
|
|
4
|
+
import { t as collectSlackCursorPages } from "./cursor-pages-ByFwo-Py.js";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { resolveDirectoryAllowlistEntries } from "openclaw/plugin-sdk/directory-runtime";
|
|
7
7
|
//#region extensions/slack/src/resolve-users.ts
|
|
@@ -98,9 +98,10 @@ async function resolveSlackUserAllowlist(params) {
|
|
|
98
98
|
const workspaceResolved = params.entries.map(resolveWorkspaceQualifiedUser);
|
|
99
99
|
const lookupEntries = params.entries.filter((_, index) => !workspaceResolved[index]);
|
|
100
100
|
if (lookupEntries.length === 0) return workspaceResolved.filter((entry) => entry !== void 0);
|
|
101
|
+
const users = await listSlackUsers(params.client ?? createSlackLookupClient(params.token));
|
|
101
102
|
const resolved = resolveDirectoryAllowlistEntries({
|
|
102
103
|
entries: lookupEntries,
|
|
103
|
-
lookup:
|
|
104
|
+
lookup: users,
|
|
104
105
|
parseInput: parseSlackUserInput,
|
|
105
106
|
findById: (lookup, id) => lookup.find((user) => user.id === id),
|
|
106
107
|
buildIdResolved: ({ input, parsed, match }) => ({
|
package/dist/runtime-api.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as registerSlackPluginHttpRoutes } from "./plugin-routes-CLp4obpN.js";
|
|
2
2
|
import { a as resolveSlackAccount, d as resolveSlackAppToken, f as resolveSlackBotToken, i as resolveDefaultSlackAccountId, n as listSlackAccountIds, t as listEnabledSlackAccounts } from "./accounts-Dm_H77gH.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as probeSlack } from "./probe-
|
|
3
|
+
import { a as resolveSlackGroupRequireMention, o as resolveSlackGroupToolPolicy } from "./session-status-BynwcZSO.js";
|
|
4
|
+
import { t as probeSlack } from "./probe-Biy--yhL.js";
|
|
5
5
|
import { r as setSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
6
|
-
import { c as listSlackPins, d as reactSlackMessage, f as readSlackMessages, g as unpinSlackMessage, h as sendSlackMessage, i as editSlackMessage, l as listSlackReactions, m as removeSlackReaction, n as deleteSlackMessage, o as getSlackMemberInfo, p as removeOwnSlackReactions, s as listSlackEmojis, u as pinSlackMessage } from "./actions-
|
|
7
|
-
import { r as sendMessageSlack } from "./send-
|
|
8
|
-
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-
|
|
9
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-
|
|
10
|
-
import { t as monitorSlackProvider } from "./provider-
|
|
11
|
-
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-
|
|
12
|
-
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-
|
|
13
|
-
import "./monitor-
|
|
6
|
+
import { c as listSlackPins, d as reactSlackMessage, f as readSlackMessages, g as unpinSlackMessage, h as sendSlackMessage, i as editSlackMessage, l as listSlackReactions, m as removeSlackReaction, n as deleteSlackMessage, o as getSlackMemberInfo, p as removeOwnSlackReactions, s as listSlackEmojis, u as pinSlackMessage } from "./actions-CFkvEv1d.js";
|
|
7
|
+
import { r as sendMessageSlack } from "./send-DElUcgIs.js";
|
|
8
|
+
import { t as resolveSlackChannelAllowlist } from "./resolve-channels-DQGV2VrE.js";
|
|
9
|
+
import { t as resolveSlackUserAllowlist } from "./resolve-users-DRGt_Q4I.js";
|
|
10
|
+
import { t as monitorSlackProvider } from "./provider-DoaUvAM4.js";
|
|
11
|
+
import { n as slackActionRuntime, t as handleSlackAction } from "./action-runtime-DftQWpI4.js";
|
|
12
|
+
import { n as listSlackDirectoryGroupsLive, r as listSlackDirectoryPeersLive } from "./directory-live-BuBPHmju.js";
|
|
13
|
+
import "./monitor-DI07pfJl.js";
|
|
14
14
|
export { deleteSlackMessage, editSlackMessage, getSlackMemberInfo, handleSlackAction, listEnabledSlackAccounts, listSlackAccountIds, listSlackDirectoryGroupsLive, listSlackDirectoryPeersLive, listSlackEmojis, listSlackPins, listSlackReactions, monitorSlackProvider, pinSlackMessage, probeSlack, reactSlackMessage, readSlackMessages, registerSlackPluginHttpRoutes, removeOwnSlackReactions, removeSlackReaction, resolveDefaultSlackAccountId, resolveSlackAccount, resolveSlackAppToken, resolveSlackBotToken, resolveSlackChannelAllowlist, resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy, resolveSlackUserAllowlist, sendMessageSlack, sendSlackMessage, setSlackRuntime, slackActionRuntime, unpinSlackMessage };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as createSlackReadClient, o as formatSlackError } from "./probe-Biy--yhL.js";
|
|
2
2
|
import { isRecord, normalizeOptionalString, normalizeStringEntries, sortUniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/slack/src/scopes.ts
|
|
4
4
|
function collectScopes(value, into) {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { a as resolveSlackAccount, l as resolveSlackOperationToken } from "./accounts-Dm_H77gH.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { D as SLACK_MESSAGE_TEXT_HARD_LIMIT, E as SLACK_EDIT_TEXT_MAX_BYTES, J as markdownToSlackMrkdwnChunks, K as resolveSlackQuestionActionIds, M as truncateSlackTextByUtf8Bytes, O as SLACK_MESSAGE_TEXT_RECOMMENDED_LIMIT, R as SLACK_QUESTION_FINALIZATION_BLOCKS, S as stripSlackNativeDataBlocks, T as renderSlackBlockFallbackText, _ as createSlackNativeDataBaseTextConsumer, ct as validateSlackBlocksArray, f as assertSlackDetachedTargetAllowed, g as buildSlackNativeDataAccessibilityText, h as appendSlackNativeDataPlainTextFallback, j as truncateSlackText, k as SLACK_TEXT_LIMIT, q as chunkSlackMrkdwnText, v as hasSlackNativeDataBlock, w as buildSlackCompleteBlocksFallbackText, y as isSlackInvalidBlocksError } from "./session-status-BynwcZSO.js";
|
|
3
|
+
import { a as parseSlackTarget, t as canonicalizeSlackApiTargetId } from "./target-parsing-PbxGDbr9.js";
|
|
4
|
+
import { c as createSlackReadClient, m as getSlackWriteClient, o as formatSlackError, u as createSlackTokenCacheKey } from "./probe-Biy--yhL.js";
|
|
5
|
+
import { r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-CukseRVL.js";
|
|
6
6
|
import { t as getOptionalSlackRuntime } from "./runtime-JSVZSWAj.js";
|
|
7
7
|
import { isRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
9
9
|
import { logVerbose, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
10
10
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
11
11
|
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
12
|
+
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
13
|
+
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
|
12
14
|
import { sliceUtf16Safe, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
13
15
|
import { createHash, createHmac } from "node:crypto";
|
|
14
16
|
import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
|
|
17
|
+
import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
15
18
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
16
19
|
import { PlatformMessageNotDispatchedError, extractErrorCode, readErrorName } from "openclaw/plugin-sdk/error-runtime";
|
|
17
20
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
18
|
-
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
19
21
|
import { chunkMarkdownTextWithMode, resolveChunkMode, resolveTextChunkLimit } from "openclaw/plugin-sdk/reply-chunking";
|
|
20
|
-
import { resolveTextChunksWithFallback } from "openclaw/plugin-sdk/reply-payload";
|
|
21
22
|
import { safeEqualSecret } from "openclaw/plugin-sdk/security-runtime";
|
|
22
23
|
import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
23
24
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
24
25
|
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
25
|
-
import { retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
26
26
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
27
27
|
import { createPersistentDedupeCache } from "openclaw/plugin-sdk/dedupe-runtime";
|
|
28
28
|
import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
|
|
@@ -135,7 +135,8 @@ function isSlackCustomizeScopeError(err) {
|
|
|
135
135
|
}
|
|
136
136
|
function isSlackCustomIdentityRejectedError(err) {
|
|
137
137
|
if (isSlackCustomizeScopeError(err)) return true;
|
|
138
|
-
const
|
|
138
|
+
const data = getSlackWebApiErrorData$1(err);
|
|
139
|
+
const code = normalizeLowercaseStringOrEmpty(normalizeOptionalString(data?.error));
|
|
139
140
|
return code === "invalid_arguments" || code === "invalid_arg_name";
|
|
140
141
|
}
|
|
141
142
|
function hasCustomIdentity$1(identity) {
|
|
@@ -422,7 +423,8 @@ async function uploadSlackFile(params) {
|
|
|
422
423
|
await release();
|
|
423
424
|
}
|
|
424
425
|
} catch (error) {
|
|
425
|
-
|
|
426
|
+
const outcome = uploadTimeoutSignal?.aborted ? "timed out" : "failed";
|
|
427
|
+
throw new PlatformMessageNotDispatchedError(`Slack external upload ${outcome} before completion dispatch`, { cause: buildSlackUploadFailureCause(error) });
|
|
426
428
|
} finally {
|
|
427
429
|
cleanupUploadTimeout();
|
|
428
430
|
}
|
|
@@ -531,7 +533,7 @@ const SLACK_DELIVERY_METADATA_PART_INDEX_KEY = "openclaw_delivery_part_index";
|
|
|
531
533
|
const SLACK_DELIVERY_METADATA_PART_COUNT_KEY = "openclaw_delivery_part_count";
|
|
532
534
|
const SLACK_DELIVERY_METADATA_SIGNATURE_KEY = "openclaw_delivery_signature";
|
|
533
535
|
const SLACK_RECONCILE_LOOKBACK_MS = 3e4;
|
|
534
|
-
const SLACK_RECONCILE_CLOCK_SKEW_MS =
|
|
536
|
+
const SLACK_RECONCILE_CLOCK_SKEW_MS = 3e5;
|
|
535
537
|
const SLACK_RECONCILE_LIMIT = 100;
|
|
536
538
|
const SLACK_RECONCILE_MAX_PAGES = 10;
|
|
537
539
|
const SLACK_ENTERPRISE_LISTENER_QUEUE_CREDENTIAL = "listener-scoped-enterprise";
|
|
@@ -600,16 +602,18 @@ function resolvePostedMessageThreadTs(response) {
|
|
|
600
602
|
return typeof threadTs === "string" ? normalizeSlackThreadTsCandidate(threadTs) : void 0;
|
|
601
603
|
}
|
|
602
604
|
async function updateMessageSlack(params) {
|
|
605
|
+
const cfg = requireRuntimeConfig(params.cfg, "Slack update");
|
|
603
606
|
const account = resolveSlackAccount({
|
|
604
|
-
cfg
|
|
607
|
+
cfg,
|
|
605
608
|
accountId: params.accountId
|
|
606
609
|
});
|
|
607
610
|
assertSlackDetachedTargetAllowed(account.accountId, params.teamId);
|
|
608
|
-
|
|
611
|
+
const token = resolveToken({
|
|
609
612
|
accountId: account.accountId,
|
|
610
613
|
fallbackToken: account.botToken,
|
|
611
614
|
fallbackSource: account.botTokenSource
|
|
612
|
-
})
|
|
615
|
+
});
|
|
616
|
+
await getSlackWriteClient(token, { teamId: params.teamId }).chat.update({
|
|
613
617
|
channel: params.channelId,
|
|
614
618
|
ts: params.messageTs,
|
|
615
619
|
text: truncateSlackTextByUtf8Bytes(params.text, SLACK_EDIT_TEXT_MAX_BYTES),
|
|
@@ -617,8 +621,9 @@ async function updateMessageSlack(params) {
|
|
|
617
621
|
});
|
|
618
622
|
}
|
|
619
623
|
function createSlackSendReceipt(params) {
|
|
624
|
+
const platformMessageIds = params.platformMessageIds.map((messageId) => messageId.trim()).filter((messageId) => messageId && messageId !== "unknown");
|
|
620
625
|
return createMessageReceiptFromOutboundResults({
|
|
621
|
-
results:
|
|
626
|
+
results: platformMessageIds.map((messageId) => {
|
|
622
627
|
const result = {
|
|
623
628
|
channel: "slack",
|
|
624
629
|
messageId
|
|
@@ -677,18 +682,18 @@ function resolveSlackSendEventScope(params) {
|
|
|
677
682
|
}
|
|
678
683
|
function resolveSlackDelivery(params) {
|
|
679
684
|
if (params.eventScope) {
|
|
680
|
-
if (
|
|
685
|
+
if (!params.eventScope.writeClient) throw new Error("missing_enterprise_slack_write_client");
|
|
681
686
|
return Object.freeze({
|
|
682
|
-
client: params.eventScope.
|
|
687
|
+
client: params.eventScope.writeClient,
|
|
683
688
|
credential: SLACK_ENTERPRISE_LISTENER_QUEUE_CREDENTIAL,
|
|
684
689
|
identity: normalizeSlackSendIdentity(params.opts.identity),
|
|
685
690
|
recipient: params.recipient,
|
|
686
691
|
teamId: params.eventScope.teamId,
|
|
687
692
|
unfurl: { unfurlMedia: params.account.config.unfurlMedia },
|
|
688
|
-
|
|
689
|
-
|
|
693
|
+
upload: Object.freeze({
|
|
694
|
+
client: params.eventScope.client,
|
|
690
695
|
auditContext: "slack-enterprise-immediate-upload"
|
|
691
|
-
})
|
|
696
|
+
})
|
|
692
697
|
});
|
|
693
698
|
}
|
|
694
699
|
const credential = resolveToken({
|
|
@@ -736,7 +741,8 @@ function resolveSlackTextChunks(params) {
|
|
|
736
741
|
...params.accountId ? { accountId: params.accountId } : {}
|
|
737
742
|
});
|
|
738
743
|
const chunkMode = resolveChunkMode(params.cfg, "slack", params.accountId);
|
|
739
|
-
|
|
744
|
+
const chunks = (chunkMode === "newline" ? chunkMarkdownTextWithMode(text, chunkLimit, chunkMode) : [text]).flatMap((markdown) => markdownToSlackMrkdwnChunks(markdown, chunkLimit, { tableMode }));
|
|
745
|
+
return resolveTextChunksWithFallback(text, chunks);
|
|
740
746
|
}
|
|
741
747
|
function createSlackSendQueueKey(params) {
|
|
742
748
|
const recipientKey = `${params.recipient.kind}:${params.recipient.id}`;
|
|
@@ -985,8 +991,9 @@ async function scanSlackConversationForDelivery(params) {
|
|
|
985
991
|
};
|
|
986
992
|
}
|
|
987
993
|
async function reconcileSlackUnknownSend(ctx) {
|
|
994
|
+
const cfg = requireRuntimeConfig(ctx.cfg, "Slack delivery reconciliation");
|
|
988
995
|
const account = resolveSlackAccount({
|
|
989
|
-
cfg
|
|
996
|
+
cfg,
|
|
990
997
|
accountId: ctx.accountId ?? void 0
|
|
991
998
|
});
|
|
992
999
|
const deliveryId = createSlackDeliveryMetadataId(ctx.queueId);
|
|
@@ -1021,8 +1028,9 @@ async function reconcileSlackUnknownSend(ctx) {
|
|
|
1021
1028
|
const readClient = createSlackReadClient(readToken, { teamId: recipient.teamId });
|
|
1022
1029
|
const writeClient = writeToken ? getSlackWriteClient(writeToken, { teamId: recipient.teamId }) : void 0;
|
|
1023
1030
|
const payloadReplyToId = ctx.payloads[0]?.replyToId;
|
|
1031
|
+
const effectiveReplyToId = Object.hasOwn(ctx, "effectiveReplyToId") ? normalizeOptionalString(ctx.effectiveReplyToId) : payloadReplyToId != null ? normalizeOptionalString(payloadReplyToId) : ctx.replyToMode === "off" ? void 0 : normalizeOptionalString(ctx.replyToId);
|
|
1024
1032
|
const threadTs = resolveSlackThreadTsValue({
|
|
1025
|
-
replyToId:
|
|
1033
|
+
replyToId: effectiveReplyToId,
|
|
1026
1034
|
threadId: ctx.threadId
|
|
1027
1035
|
});
|
|
1028
1036
|
const searchStartedAt = ctx.platformSendStartedAt ?? ctx.enqueuedAt;
|
|
@@ -1283,8 +1291,8 @@ async function sendMessageSlackQueuedInner(params) {
|
|
|
1283
1291
|
if (opts.mediaUrl) {
|
|
1284
1292
|
const [firstChunk, ...rest] = resolvedChunks;
|
|
1285
1293
|
lastMessageId = await uploadSlackFile({
|
|
1286
|
-
client,
|
|
1287
|
-
|
|
1294
|
+
client: delivery.upload?.client ?? client,
|
|
1295
|
+
completionClient: client,
|
|
1288
1296
|
channelId,
|
|
1289
1297
|
mediaUrl: opts.mediaUrl,
|
|
1290
1298
|
mediaAccess: opts.mediaAccess,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
2
|
+
//#region extensions/slack/src/send-results.ts
|
|
3
|
+
function mergeSlackSendResults(results) {
|
|
4
|
+
const lastResult = results.at(-1);
|
|
5
|
+
if (!lastResult) throw new Error("Slack send plan produced no delivery.");
|
|
6
|
+
if (results.length === 1) return lastResult;
|
|
7
|
+
const receipt = createMessageReceiptFromOutboundResults({ results });
|
|
8
|
+
receipt.parts = receipt.parts.map((part, index) => ({
|
|
9
|
+
...part,
|
|
10
|
+
index
|
|
11
|
+
}));
|
|
12
|
+
const questionResult = results.find((result) => result.meta?.slackQuestionActionIds.length);
|
|
13
|
+
return {
|
|
14
|
+
...lastResult,
|
|
15
|
+
receipt,
|
|
16
|
+
...questionResult?.meta ? { meta: {
|
|
17
|
+
...questionResult.meta,
|
|
18
|
+
slackQuestionMessageId: questionResult.meta.slackQuestionMessageId ?? questionResult.messageId
|
|
19
|
+
} } : {}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { mergeSlackSendResults as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as updateMessageSlack, n as resolveSlackDmChannelId, r as sendMessageSlack, t as reconcileSlackUnknownSend } from "./send-
|
|
1
|
+
import { a as updateMessageSlack, n as resolveSlackDmChannelId, r as sendMessageSlack, t as reconcileSlackUnknownSend } from "./send-DElUcgIs.js";
|
|
2
2
|
export { reconcileSlackUnknownSend, resolveSlackDmChannelId, sendMessageSlack, updateMessageSlack };
|