@openclaw/slack 2026.11.3 → 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-inspect-CmkKiSb9.mjs → account-inspect-BLVha-ov.mjs} +11 -8
- package/dist/.setup/{accounts-msihSF3-.mjs → accounts-CGJScKtk.mjs} +10 -1
- package/dist/.setup/{action-runtime-ChRfnnBu.mjs → action-runtime-D01wBhx5.mjs} +38 -45
- package/dist/.setup/action-runtime.runtime-VQGaR6g8.mjs +1 -0
- package/dist/.setup/{actions-By7tvpvv.mjs → actions-D5S6D_BU.mjs} +89 -76
- package/dist/.setup/{approval-handler.runtime-D8ArtDQt.mjs → approval-handler.runtime-Buw5jh2Y.mjs} +26 -30
- package/dist/.setup/{approval-message-updates-DT7XBPbV.mjs → approval-message-updates-pmXcve5E.mjs} +1 -1
- package/dist/.setup/{channel-DLFiMJm2.mjs → channel-C_R98Nbv.mjs} +569 -339
- package/dist/.setup/{channel-type-BEFP2ORi.mjs → channel-type-B5P3w9eA.mjs} +4 -8
- package/dist/.setup/{channel.setup-CzFw73mU.mjs → channel.setup-Lq2OxKkF.mjs} +13 -13
- package/dist/.setup/{config-schema-DNnh6bWU.mjs → config-schema-BWAaa5au.mjs} +3 -7
- package/dist/.setup/cursor-pages-CATAzbTT.mjs +313 -0
- package/dist/.setup/{directory-config-Cjj0N8R0.mjs → directory-config-D-hf9KGQ.mjs} +3 -3
- package/dist/.setup/{directory-live-BIKD-5B_.mjs → directory-live-onKAFI1E.mjs} +4 -4
- package/dist/.setup/{doctor-contract-Cd4-VzIM.mjs → doctor-contract-9-QJRCXk.mjs} +37 -45
- package/dist/.setup/{message-tool-api-BS5ekEA_.mjs → message-tool-api-LGIgVXJf.mjs} +4 -3
- package/dist/.setup/{monitor-CV6Z6FKP.mjs → monitor-Cm1TuqxN.mjs} +3424 -3703
- package/dist/.setup/{outbound-adapter-9dbnYtL1.mjs → outbound-adapter-C-95EWl2.mjs} +30 -36
- package/dist/.setup/paths-B1u59oLK.mjs +8 -0
- package/dist/.setup/{pipeline.runtime-DLIQf1Bo.mjs → pipeline.runtime-DGnV6akc.mjs} +416 -534
- package/dist/.setup/{policy-yhn48xf5.mjs → policy-DxhGRvc2.mjs} +1 -2
- package/dist/.setup/{session-status-Dv8wNBEt.mjs → probe-DANukR3O.mjs} +1206 -839
- package/dist/.setup/question-delivery-CWC7sRhH.mjs +39 -0
- package/dist/.setup/{relay-source-CxDcrn16.mjs → relay-source-DoyOlTbK.mjs} +5 -3
- package/dist/.setup/{replies-MRkrg3rC.mjs → replies-BcmUKord.mjs} +34 -19
- package/dist/.setup/{reply-blocks-Ca-raz2z.mjs → reply-blocks-BzsXUUUL.mjs} +201 -206
- package/dist/.setup/{resolve-channels-DRRhElwz.mjs → resolve-channels-XDPgnesf.mjs} +4 -7
- package/dist/.setup/{resolve-users-Cz8e17ky.mjs → resolve-users-aDAv24U2.mjs} +8 -16
- package/dist/.setup/runtime-setter-api-Cx_PV-xu.mjs +2 -0
- package/dist/.setup/{scopes-DfQVi8Jw.mjs → scopes-BocHwImV.mjs} +2 -1
- package/dist/.setup/secret-contract-api-BlLz88mj.mjs +2 -0
- package/dist/.setup/{secret-contract-vVRMoE1D.mjs → secret-contract-uiQtoNlu.mjs} +2 -2
- package/dist/.setup/{send-results-eeOu_HYm.mjs → send-results-BGxlroJ-.mjs} +3 -4
- package/dist/.setup/{send-C-8wY0lK.mjs → send-yK6_-px6.mjs} +297 -334
- package/dist/.setup/setup-plugin-api-Cfz58xoh.mjs +2 -0
- package/dist/.setup/{setup-surface--n8VsDvV.mjs → setup-surface-C0KRtyqa.mjs} +5 -6
- package/dist/.setup/{slash-dispatch.runtime-D3Wq45ER.mjs → slash-dispatch.runtime-CyVC3bYx.mjs} +2 -2
- package/dist/.setup/{target-parsing-FFE26kOV.mjs → target-parsing-Bx2UZniD.mjs} +1 -2
- package/dist/.setup/{targets-C6LZQL1Q.mjs → targets-D-ASeWHy.mjs} +1 -1
- package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/api.js +16 -17
- package/dist/channel-config-api.js +1 -2
- package/dist/channel-plugin-api.js +1 -2
- package/dist/directory-contract-api.js +1 -2
- package/dist/doctor-contract-api.js +1 -2
- package/dist/index.js +0 -6
- package/dist/message-tool-api.js +1 -2
- package/dist/runtime-api.js +10 -12
- package/dist/runtime-setter-api.js +1 -2
- package/dist/secret-contract-api.js +1 -2
- package/dist/security-contract-api.js +1 -2
- package/dist/setup-entry.js +3 -3
- package/dist/setup-plugin-api.js +1 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/@slack/bolt/node_modules/content-disposition/README.md +105 -35
- package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.d.ts +72 -0
- package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.js +388 -0
- package/node_modules/@slack/bolt/node_modules/content-disposition/dist/index.js.map +1 -0
- package/node_modules/@slack/bolt/node_modules/content-disposition/package.json +31 -19
- package/node_modules/@slack/bolt/node_modules/content-type/README.md +34 -57
- package/node_modules/@slack/bolt/node_modules/content-type/package.json +35 -25
- package/node_modules/@slack/bolt/node_modules/express/Readme.md +15 -9
- package/node_modules/@slack/bolt/node_modules/express/lib/application.js +2 -2
- package/node_modules/@slack/bolt/node_modules/express/lib/request.js +32 -19
- package/node_modules/@slack/bolt/node_modules/express/lib/response.js +27 -30
- package/node_modules/@slack/bolt/node_modules/express/package.json +10 -10
- package/node_modules/@slack/bolt/node_modules/qs/.github/THREAT_MODEL.md +4 -2
- package/node_modules/@slack/bolt/node_modules/qs/CHANGELOG.md +38 -14
- package/node_modules/@slack/bolt/node_modules/qs/README.md +31 -3
- package/node_modules/@slack/bolt/node_modules/qs/dist/qs.js +20 -20
- package/node_modules/@slack/bolt/node_modules/qs/lib/parse.js +94 -4
- package/node_modules/@slack/bolt/node_modules/qs/lib/stringify.js +4 -4
- package/node_modules/@slack/bolt/node_modules/qs/lib/utils.js +130 -6
- package/node_modules/@slack/bolt/node_modules/qs/package.json +4 -4
- package/node_modules/@slack/bolt/node_modules/qs/test/parse.js +174 -0
- package/node_modules/@slack/bolt/node_modules/qs/test/stringify.js +263 -33
- package/node_modules/@slack/bolt/node_modules/qs/test/utils.js +184 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +6 -3
- package/node_modules/typebox/build/format/duration.d.mts +2 -2
- package/node_modules/typebox/build/format/duration.mjs +2 -2
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_email.mjs +1 -0
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_hostname.mjs +1 -1
- package/node_modules/typebox/build/format/ipv4.d.mts +2 -2
- package/node_modules/typebox/build/format/ipv4.mjs +2 -2
- package/node_modules/typebox/build/format/ipv6.d.mts +1 -1
- package/node_modules/typebox/build/format/ipv6.mjs +1 -1
- 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/schema/build.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/_unique.d.mts +4 -2
- package/node_modules/typebox/build/schema/engine/_unique.mjs +7 -3
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.d.mts +0 -3
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +15 -17
- package/node_modules/typebox/build/schema/engine/contains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/index.d.mts +1 -0
- package/node_modules/typebox/build/schema/engine/index.mjs +1 -0
- package/node_modules/typebox/build/schema/engine/items.mjs +7 -4
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/minContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/propertyNames.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedItems.mjs +2 -2
- package/node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs +2 -2
- package/node_modules/typebox/build/system/hashing/hash.mjs +63 -34
- package/node_modules/typebox/build/system/locale/en_US.mjs +2 -1
- package/node_modules/typebox/build/system/memory/assign.d.mts +2 -8
- package/node_modules/typebox/build/system/memory/assign.mjs +13 -6
- package/node_modules/typebox/build/system/memory/clone.d.mts +4 -5
- package/node_modules/typebox/build/system/memory/clone.mjs +8 -96
- package/node_modules/typebox/build/system/memory/create.d.mts +1 -5
- package/node_modules/typebox/build/system/memory/create.mjs +18 -13
- package/node_modules/typebox/build/system/memory/deep.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/deep.mjs +108 -0
- package/node_modules/typebox/build/system/memory/discard.d.mts +1 -1
- package/node_modules/typebox/build/system/memory/discard.mjs +9 -8
- package/node_modules/typebox/build/system/memory/finalize.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/finalize.mjs +30 -0
- package/node_modules/typebox/build/system/memory/keys.d.mts +2 -0
- package/node_modules/typebox/build/system/memory/keys.mjs +8 -0
- package/node_modules/typebox/build/system/memory/update.d.mts +1 -4
- package/node_modules/typebox/build/system/memory/update.mjs +43 -16
- package/node_modules/typebox/build/type/engine/call/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/call/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +2 -24
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +2 -29
- package/node_modules/typebox/build/type/engine/evaluate/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +5 -1
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +6 -1
- package/node_modules/typebox/build/type/engine/evaluate/property.d.mts +30 -0
- package/node_modules/typebox/build/type/engine/evaluate/property.mjs +29 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/object/from_intersect.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +1 -4
- package/node_modules/typebox/build/type/engine/this/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/this/index.mjs +1 -0
- package/node_modules/typebox/build/value/clone/clone.d.mts +4 -3
- package/node_modules/typebox/build/value/clone/clone.mjs +5 -7
- package/node_modules/typebox/build/value/repair/from_cyclic.d.mts +2 -0
- package/node_modules/typebox/build/value/repair/from_cyclic.mjs +6 -0
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +25 -14
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +1 -1
- package/node_modules/undici/docs/docs/api/Interceptors.md +15 -2
- package/node_modules/undici/lib/dispatcher/client-h2.js +78 -3
- package/node_modules/undici/lib/dispatcher/pool-base.js +20 -3
- package/node_modules/undici/package.json +3 -3
- package/node_modules/undici/types/api.d.ts +1 -1
- package/node_modules/undici/types/utility.d.ts +4 -4
- package/node_modules/zod/package.json +1 -1
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +6 -0
- package/node_modules/zod/src/v4/core/compile.ts +9 -0
- package/node_modules/zod/src/v4/core/schemas.ts +35 -1
- package/node_modules/zod/src/v4/core/util.ts +13 -0
- package/node_modules/zod/src/v4/core/versions.ts +1 -1
- package/node_modules/zod/v4/core/compile.cjs +8 -0
- package/node_modules/zod/v4/core/compile.js +8 -0
- package/node_modules/zod/v4/core/schemas.cjs +30 -0
- package/node_modules/zod/v4/core/schemas.d.cts +3 -1
- package/node_modules/zod/v4/core/schemas.d.ts +3 -1
- package/node_modules/zod/v4/core/schemas.js +30 -0
- package/node_modules/zod/v4/core/util.cjs +15 -0
- package/node_modules/zod/v4/core/util.d.cts +2 -0
- package/node_modules/zod/v4/core/util.d.ts +2 -0
- package/node_modules/zod/v4/core/util.js +14 -0
- package/node_modules/zod/v4/core/versions.cjs +1 -1
- package/node_modules/zod/v4/core/versions.js +1 -1
- package/openclaw.plugin.json +6 -30
- package/package.json +7 -7
- package/dist/.setup/action-runtime.runtime-vLxx_7s2.mjs +0 -2
- package/dist/.setup/http-C9sM-FXe.mjs +0 -2
- package/dist/.setup/plugin-routes-D4qozHVn.mjs +0 -22
- package/dist/.setup/probe-IiHogLQN.mjs +0 -694
- package/dist/.setup/registry-DizWcnNp.mjs +0 -36
- package/dist/.setup/runtime-setter-api-CMFvhrAr.mjs +0 -3
- package/dist/.setup/secret-contract-api-DK9gZldc.mjs +0 -3
- package/dist/.setup/setup-plugin-api-BGD1TYnK.mjs +0 -3
- package/dist/.setup/shared-BhJHIZs1.mjs +0 -259
- package/dist/http-routes-api.js +0 -2
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/LICENSE +0 -22
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/README.md +0 -71
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/package.json +0 -52
- package/node_modules/@slack/bolt/node_modules/content-disposition/index.js +0 -536
- package/node_modules/@slack/bolt/node_modules/content-type/HISTORY.md +0 -29
- package/node_modules/@slack/bolt/node_modules/content-type/index.js +0 -225
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/LICENSE +0 -22
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/README.md +0 -71
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.d.ts +0 -46
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js +0 -176
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/dist/index.js.map +0 -1
- package/node_modules/@slack/bolt/node_modules/negotiator/node_modules/content-type/package.json +0 -52
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/LICENSE +0 -22
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/README.md +0 -71
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.d.ts +0 -46
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js +0 -176
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js.map +0 -1
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/package.json +0 -52
- package/node_modules/typebox/build/system/memory/freeze.d.mts +0 -4
- package/node_modules/typebox/build/system/memory/freeze.mjs +0 -6
- /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.d.ts +0 -0
- /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js +0 -0
- /package/node_modules/@slack/bolt/node_modules/{body-parser/node_modules/content-type → content-type}/dist/index.js.map +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { f as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-CGJScKtk.mjs";
|
|
3
|
+
import { S as assertSlackDetachedTargetAllowed } from "./probe-DANukR3O.mjs";
|
|
4
|
+
import { i as createSlackReadClient, o as createSlackTokenCacheKey, p as readLruMapEntry, s as createSlackWebClient } from "./cursor-pages-CATAzbTT.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";
|
|
8
|
-
import { createHash } from "node:crypto";
|
|
9
8
|
//#region extensions/slack/src/channel-type.ts
|
|
10
9
|
var channel_type_exports = /* @__PURE__ */ __exportAll({
|
|
11
10
|
resolveSlackChannelType: () => resolveSlackChannelType,
|
|
@@ -18,9 +17,6 @@ function setCachedSlackConversationInfo(cacheKey, conversationInfo) {
|
|
|
18
17
|
SLACK_CONVERSATION_INFO_CACHE.set(cacheKey, conversationInfo);
|
|
19
18
|
pruneMapToMaxSize(SLACK_CONVERSATION_INFO_CACHE, SLACK_CONVERSATION_INFO_CACHE_MAX_ENTRIES);
|
|
20
19
|
}
|
|
21
|
-
function fingerprintSlackCredential(token) {
|
|
22
|
-
return createHash("sha256").update(token).digest("hex");
|
|
23
|
-
}
|
|
24
20
|
function resolveConfiguredSlackConversationInfo(params) {
|
|
25
21
|
if (/^D/i.test(params.channelId)) return { type: "dm" };
|
|
26
22
|
const channelIdLower = normalizeLowercaseStringOrEmpty(params.channelId);
|
|
@@ -43,7 +39,7 @@ async function resolveSlackConversationInfo(params) {
|
|
|
43
39
|
const token = resolveSlackOperationToken(account, operation);
|
|
44
40
|
const userToken = normalizeOptionalString(account.userToken);
|
|
45
41
|
const credentialRole = token ? token === userToken ? "user" : "bot" : "none";
|
|
46
|
-
const credentialFingerprint = token ?
|
|
42
|
+
const credentialFingerprint = token ? createSlackTokenCacheKey(token) : "none";
|
|
47
43
|
const teamId = normalizeLowercaseStringOrEmpty(params.teamId) || "no-team-id";
|
|
48
44
|
const cacheKey = `${account.accountId}:${teamId}:${operation}:${credentialRole}:${credentialFingerprint}:${channelId}`;
|
|
49
45
|
if (!params.requireFreshName) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as isSlackSetupAccountConfigured } from "./account-configured-zcR9TJJN.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-CGJScKtk.mjs";
|
|
3
|
+
import { t as inspectSlackAccount } from "./account-inspect-BLVha-ov.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-BWAaa5au.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";
|
|
@@ -39,16 +39,15 @@ function buildSlackAllowFromPrompt() {
|
|
|
39
39
|
})
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function buildSlackManifest(
|
|
43
|
-
|
|
44
|
-
const manifest = {
|
|
42
|
+
function buildSlackManifest() {
|
|
43
|
+
return JSON.stringify({
|
|
45
44
|
display_information: {
|
|
46
|
-
name:
|
|
47
|
-
description:
|
|
45
|
+
name: "OpenClaw",
|
|
46
|
+
description: "OpenClaw app for OpenClaw"
|
|
48
47
|
},
|
|
49
48
|
features: {
|
|
50
49
|
bot_user: {
|
|
51
|
-
display_name:
|
|
50
|
+
display_name: "OpenClaw",
|
|
52
51
|
always_online: true
|
|
53
52
|
},
|
|
54
53
|
app_home: {
|
|
@@ -57,7 +56,7 @@ function buildSlackManifest(botName = "OpenClaw") {
|
|
|
57
56
|
messages_tab_read_only_enabled: false
|
|
58
57
|
},
|
|
59
58
|
agent_view: {
|
|
60
|
-
agent_description:
|
|
59
|
+
agent_description: "OpenClaw connects Slack Agent View conversations to OpenClaw agents.",
|
|
61
60
|
suggested_prompts: DEFAULT_SLACK_SUGGESTED_PROMPTS
|
|
62
61
|
},
|
|
63
62
|
slash_commands: [{
|
|
@@ -70,7 +69,9 @@ function buildSlackManifest(botName = "OpenClaw") {
|
|
|
70
69
|
"app_mentions:read",
|
|
71
70
|
"assistant:write",
|
|
72
71
|
"channels:history",
|
|
72
|
+
"channels:manage",
|
|
73
73
|
"channels:read",
|
|
74
|
+
"channels:write.invites",
|
|
74
75
|
"chat:write",
|
|
75
76
|
"commands",
|
|
76
77
|
"emoji:read",
|
|
@@ -112,8 +113,7 @@ function buildSlackManifest(botName = "OpenClaw") {
|
|
|
112
113
|
"reaction_removed"
|
|
113
114
|
] }
|
|
114
115
|
}
|
|
115
|
-
};
|
|
116
|
-
return JSON.stringify(manifest, null, 2);
|
|
116
|
+
}, null, 2);
|
|
117
117
|
}
|
|
118
118
|
function buildSlackSetupLines() {
|
|
119
119
|
return [
|
|
@@ -550,7 +550,7 @@ const slackSetupPlugin = {
|
|
|
550
550
|
markdownCapable: true,
|
|
551
551
|
preferSessionLookupForAnnounceTarget: true
|
|
552
552
|
},
|
|
553
|
-
setupWizard: createSlackSetupWizardProxy(() => import("./setup-surface
|
|
553
|
+
setupWizard: createSlackSetupWizardProxy(() => import("./setup-surface-C0KRtyqa.mjs")),
|
|
554
554
|
capabilities: {
|
|
555
555
|
chatTypes: [
|
|
556
556
|
"direct",
|
|
@@ -186,11 +186,6 @@ const SlackStreamingConfigSchema = ChannelPreviewStreamingConfigSchema.extend({
|
|
|
186
186
|
nativeTransport: z.boolean().optional(),
|
|
187
187
|
progress: SlackStreamingProgressSchema.optional()
|
|
188
188
|
}).strict();
|
|
189
|
-
const SlackDmSchema = z.object({
|
|
190
|
-
enabled: z.boolean().optional(),
|
|
191
|
-
groupEnabled: z.boolean().optional(),
|
|
192
|
-
groupChannels: z.array(z.union([z.string(), z.number()])).optional()
|
|
193
|
-
}).strict();
|
|
194
189
|
const SlackPresenceEventsSchema = z.object({
|
|
195
190
|
mode: z.enum([
|
|
196
191
|
"off",
|
|
@@ -224,7 +219,7 @@ const SlackRelaySchema = z.object({
|
|
|
224
219
|
gatewayId: z.string().optional()
|
|
225
220
|
}).strict();
|
|
226
221
|
const SlackIdentitySchema = z.enum(["bot", "user"]);
|
|
227
|
-
const { accountShape, rootPolicyShape } = buildChannelAccountSchemaParts({
|
|
222
|
+
const { accountShape, rootPolicyShape, groupDmShape } = buildChannelAccountSchemaParts({
|
|
228
223
|
omit: ["groupAllowFrom"],
|
|
229
224
|
streaming: SlackStreamingConfigSchema.optional()
|
|
230
225
|
});
|
|
@@ -270,6 +265,7 @@ const SlackAccountSchema = z.object({
|
|
|
270
265
|
actions: z.object({
|
|
271
266
|
reactions: z.boolean().optional(),
|
|
272
267
|
messages: z.boolean().optional(),
|
|
268
|
+
channels: z.boolean().optional(),
|
|
273
269
|
pins: z.boolean().optional(),
|
|
274
270
|
search: z.boolean().optional(),
|
|
275
271
|
permissions: z.boolean().optional(),
|
|
@@ -283,7 +279,7 @@ const SlackAccountSchema = z.object({
|
|
|
283
279
|
sessionPrefix: z.string().optional(),
|
|
284
280
|
ephemeral: z.boolean().optional()
|
|
285
281
|
}).strict().optional(),
|
|
286
|
-
dm:
|
|
282
|
+
dm: z.strictObject(groupDmShape).optional(),
|
|
287
283
|
channels: z.record(z.string(), SlackChannelSchema.optional()).optional(),
|
|
288
284
|
typingReaction: z.string().optional()
|
|
289
285
|
}).strict();
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
3
|
+
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
4
|
+
import { hash } from "node:crypto";
|
|
5
|
+
import { WebAPIRateLimitedError, WebClient } from "@slack/web-api";
|
|
6
|
+
import { addActiveManagedProxyTlsOptions, captureChannelReadAuthority, createHttp1EnvHttpProxyAgent, resolveEnvHttpProxyAgentOptions, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
7
|
+
import { isDebugProxyGlobalFetchPatchInstalled } from "openclaw/plugin-sdk/proxy-capture";
|
|
8
|
+
import { parseRetryAfterHeaderSeconds, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
9
|
+
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
|
10
|
+
//#region extensions/slack/src/client-options.ts
|
|
11
|
+
const SLACK_DEFAULT_RETRY_OPTIONS = {
|
|
12
|
+
retries: 2,
|
|
13
|
+
factor: 2,
|
|
14
|
+
minTimeout: 500,
|
|
15
|
+
maxTimeout: 3e3,
|
|
16
|
+
randomize: true
|
|
17
|
+
};
|
|
18
|
+
const SLACK_WRITE_RETRY_OPTIONS = { retries: 0 };
|
|
19
|
+
const SLACK_READ_TIMEOUT_MS = 3e4;
|
|
20
|
+
const SLACK_LOOKUP_RETRY_OPTIONS = { retries: 0 };
|
|
21
|
+
function normalizeSlackFetchInit(init) {
|
|
22
|
+
if (init?.body !== "") return init;
|
|
23
|
+
const { body: _body, ...rest } = init;
|
|
24
|
+
return rest;
|
|
25
|
+
}
|
|
26
|
+
function resolveSlackProxyDispatcher() {
|
|
27
|
+
const options = resolveEnvHttpProxyAgentOptions();
|
|
28
|
+
if (!options) return;
|
|
29
|
+
try {
|
|
30
|
+
return createHttp1EnvHttpProxyAgent(options, void 0, process.env);
|
|
31
|
+
} catch {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
let slackSocketModeUndici;
|
|
36
|
+
/**
|
|
37
|
+
* Load the undici copy that @slack/socket-mode opens its WebSocket with.
|
|
38
|
+
*
|
|
39
|
+
* Socket Mode 3 calls `new undici.WebSocket(url, { dispatcher })` with its own
|
|
40
|
+
* undici. A dispatcher from another undici copy fails the handshake, so we must
|
|
41
|
+
* identify whether Socket Mode can share the runtime dispatcher. The explicit
|
|
42
|
+
* `undici/index.js` subpath keeps Bun's bare-`undici` placeholder out of the
|
|
43
|
+
* dispatcher (the same reason the runtime loads undici this way); under Bun,
|
|
44
|
+
* Socket Mode's bare import gets Bun's WebSocket, which does not consult a
|
|
45
|
+
* dispatcher at all.
|
|
46
|
+
*/
|
|
47
|
+
function loadSlackSocketModeUndici() {
|
|
48
|
+
if (slackSocketModeUndici) return slackSocketModeUndici;
|
|
49
|
+
const requireFromPlugin = createRequire(import.meta.url);
|
|
50
|
+
const requireFromBolt = createRequire(requireFromPlugin.resolve("@slack/bolt/package.json"));
|
|
51
|
+
slackSocketModeUndici = createRequire(requireFromBolt.resolve("@slack/socket-mode/package.json"))("undici/index.js");
|
|
52
|
+
return slackSocketModeUndici;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Build the env-proxy dispatcher for Socket Mode's WebSocket.
|
|
56
|
+
*
|
|
57
|
+
* Reuse the Web API dispatcher when both transports load the same undici copy;
|
|
58
|
+
* its custom proxy routing supports Socket Mode's CONNECT handshake. Otherwise
|
|
59
|
+
* build one from Socket Mode's copy. Without a proxy env, preserve the default
|
|
60
|
+
* direct connection.
|
|
61
|
+
*/
|
|
62
|
+
function resolveSlackSocketModeDispatcher(webApi) {
|
|
63
|
+
const options = resolveEnvHttpProxyAgentOptions();
|
|
64
|
+
if (!options) return;
|
|
65
|
+
const { EnvHttpProxyAgent } = loadSlackSocketModeUndici();
|
|
66
|
+
if (webApi instanceof EnvHttpProxyAgent) return webApi;
|
|
67
|
+
const agentOptions = addActiveManagedProxyTlsOptions(options);
|
|
68
|
+
try {
|
|
69
|
+
return new EnvHttpProxyAgent(agentOptions);
|
|
70
|
+
} catch {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** Pair each Slack monitor transport with the dispatcher from the undici copy it uses. */
|
|
75
|
+
function resolveSlackMonitorDispatchers(mode) {
|
|
76
|
+
const webApi = resolveSlackProxyDispatcher();
|
|
77
|
+
const socketMode = mode === "socket" ? resolveSlackSocketModeDispatcher(webApi) : void 0;
|
|
78
|
+
return {
|
|
79
|
+
webApi,
|
|
80
|
+
socketMode,
|
|
81
|
+
close: async () => {
|
|
82
|
+
await webApi?.close();
|
|
83
|
+
if (socketMode !== webApi) await socketMode?.close();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const DIRECT_SLACK_DISPATCHER_OPTIONS = {
|
|
88
|
+
httpProxy: "",
|
|
89
|
+
httpsProxy: "",
|
|
90
|
+
noProxy: "*"
|
|
91
|
+
};
|
|
92
|
+
/** Create a probe-owned dispatcher so timeout cleanup can retire every socket. */
|
|
93
|
+
function createSlackProbeDispatcher(timeoutMs) {
|
|
94
|
+
const options = resolveEnvHttpProxyAgentOptions() ?? DIRECT_SLACK_DISPATCHER_OPTIONS;
|
|
95
|
+
try {
|
|
96
|
+
return createHttp1EnvHttpProxyAgent(options, timeoutMs, process.env);
|
|
97
|
+
} catch {
|
|
98
|
+
return createHttp1EnvHttpProxyAgent(DIRECT_SLACK_DISPATCHER_OPTIONS, timeoutMs, {});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function buildSlackFetch(dispatcher) {
|
|
102
|
+
if (!dispatcher || isDebugProxyGlobalFetchPatchInstalled()) {
|
|
103
|
+
const slackFetch = resolveFetch();
|
|
104
|
+
if (!slackFetch) return;
|
|
105
|
+
return ((input, init) => slackFetch(input, normalizeSlackFetchInit(init)));
|
|
106
|
+
}
|
|
107
|
+
return ((input, init) => {
|
|
108
|
+
return fetchWithRuntimeDispatcher(input, {
|
|
109
|
+
...normalizeSlackFetchInit(init),
|
|
110
|
+
dispatcher
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function fenceSlackReadFetch(slackFetch, assertDirectAdapterHandoff) {
|
|
115
|
+
const assertReadAuthority = captureChannelReadAuthority();
|
|
116
|
+
return async (input, init) => {
|
|
117
|
+
assertReadAuthority?.();
|
|
118
|
+
captureChannelReadAuthority()?.();
|
|
119
|
+
assertDirectAdapterHandoff?.();
|
|
120
|
+
return slackFetch(input, init);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function resolveSlackClientOptions(input, dispatcher, assertDirectAdapterHandoff) {
|
|
124
|
+
const options = Object.assign({}, input);
|
|
125
|
+
const slackApiUrl = options.slackApiUrl ?? (process.env.SLACK_API_URL?.trim() || void 0);
|
|
126
|
+
const fetch = options.fetch ?? buildSlackFetch(dispatcher);
|
|
127
|
+
if (slackApiUrl !== void 0) options.slackApiUrl = slackApiUrl;
|
|
128
|
+
else delete options.slackApiUrl;
|
|
129
|
+
if (!fetch) {
|
|
130
|
+
if (assertDirectAdapterHandoff) throw new Error("Slack request fetch is unavailable for live authority.");
|
|
131
|
+
} else options.fetch = fenceSlackReadFetch(fetch, assertDirectAdapterHandoff);
|
|
132
|
+
return options;
|
|
133
|
+
}
|
|
134
|
+
function resolveSlackWebClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
135
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
136
|
+
resolved.retryConfig ??= SLACK_DEFAULT_RETRY_OPTIONS;
|
|
137
|
+
return resolved;
|
|
138
|
+
}
|
|
139
|
+
function resolveSlackReadClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
140
|
+
const resolved = resolveSlackWebClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
141
|
+
resolved.timeout ??= SLACK_READ_TIMEOUT_MS;
|
|
142
|
+
return resolved;
|
|
143
|
+
}
|
|
144
|
+
function resolveSlackWriteClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
145
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
146
|
+
resolved.retryConfig ??= SLACK_WRITE_RETRY_OPTIONS;
|
|
147
|
+
if (resolved.rejectRateLimitedCalls !== true && resolved.retryConfig.retries === 0) {
|
|
148
|
+
const slackFetch = resolved.fetch ?? buildSlackFetch(dispatcher);
|
|
149
|
+
if (slackFetch) resolved.fetch = (input, init) => retryAsync(async () => {
|
|
150
|
+
init?.signal?.throwIfAborted();
|
|
151
|
+
const response = await slackFetch(input, init);
|
|
152
|
+
if (response.status !== 429) return response;
|
|
153
|
+
const retryAfter = parseRetryAfterHeaderSeconds(response.headers.get("retry-after"));
|
|
154
|
+
response.body?.cancel().catch(() => void 0);
|
|
155
|
+
init?.signal?.throwIfAborted();
|
|
156
|
+
if (retryAfter === void 0 || retryAfter * 1e3 > 2147e6) return response;
|
|
157
|
+
throw new WebAPIRateLimitedError(retryAfter);
|
|
158
|
+
}, {
|
|
159
|
+
attempts: 3,
|
|
160
|
+
minDelayMs: 0,
|
|
161
|
+
maxDelayMs: 0,
|
|
162
|
+
shouldRetry: (error) => error instanceof WebAPIRateLimitedError,
|
|
163
|
+
retryAfterMs: (error) => error instanceof WebAPIRateLimitedError ? error.retryAfter * 1e3 : void 0,
|
|
164
|
+
sleep: (delayMs) => sleepWithAbort(delayMs, init?.signal)
|
|
165
|
+
});
|
|
166
|
+
resolved.rejectRateLimitedCalls = true;
|
|
167
|
+
}
|
|
168
|
+
return resolved;
|
|
169
|
+
}
|
|
170
|
+
function resolveSlackLookupClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
171
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
172
|
+
resolved.rejectRateLimitedCalls = true;
|
|
173
|
+
resolved.retryConfig = SLACK_LOOKUP_RETRY_OPTIONS;
|
|
174
|
+
resolved.timeout ??= SLACK_READ_TIMEOUT_MS;
|
|
175
|
+
return resolved;
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region extensions/slack/src/monitor/lru-map-cache.ts
|
|
179
|
+
function getOrCreateWeakOwnerMap(owners, owner) {
|
|
180
|
+
let values = owners.get(owner);
|
|
181
|
+
if (!values) {
|
|
182
|
+
values = /* @__PURE__ */ new Map();
|
|
183
|
+
owners.set(owner, values);
|
|
184
|
+
}
|
|
185
|
+
return values;
|
|
186
|
+
}
|
|
187
|
+
/** LRU-touch read: move hit to newest so pruneMapToMaxSize keeps active keys. */
|
|
188
|
+
function readLruMapEntry(cache, cacheKey) {
|
|
189
|
+
const cached = cache.get(cacheKey);
|
|
190
|
+
if (cached) {
|
|
191
|
+
cache.delete(cacheKey);
|
|
192
|
+
cache.set(cacheKey, cached);
|
|
193
|
+
}
|
|
194
|
+
return cached;
|
|
195
|
+
}
|
|
196
|
+
function writeLruMapEntry(cache, cacheKey, entry, maxEntries) {
|
|
197
|
+
cache.delete(cacheKey);
|
|
198
|
+
cache.set(cacheKey, entry);
|
|
199
|
+
pruneMapToMaxSize(cache, maxEntries);
|
|
200
|
+
}
|
|
201
|
+
function pruneExpiredMapEntries(cache, now) {
|
|
202
|
+
for (const [key, entry] of cache) if (entry.expiresAt <= now) cache.delete(key);
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region extensions/slack/src/client.ts
|
|
206
|
+
const SLACK_WRITE_CLIENT_CACHE_MAX = 32;
|
|
207
|
+
const SLACK_STARTUP_AUTH_TIMEOUT_MS = 1e4;
|
|
208
|
+
const SLACK_STARTUP_AUTH_RETRY_BUDGET_MS = 35e3;
|
|
209
|
+
const slackWriteClientCache = /* @__PURE__ */ new Map();
|
|
210
|
+
const slackListenerWriteClientCache = /* @__PURE__ */ new WeakMap();
|
|
211
|
+
function createSlackClientFactory(resolveOptions) {
|
|
212
|
+
return (token, options, assertDirectAdapterHandoff) => new WebClient(token, resolveOptions(options, void 0, assertDirectAdapterHandoff));
|
|
213
|
+
}
|
|
214
|
+
const createSlackWebClient = createSlackClientFactory(resolveSlackWebClientOptions);
|
|
215
|
+
const createSlackLookupClient = createSlackClientFactory(resolveSlackLookupClientOptions);
|
|
216
|
+
const createSlackWriteClient = createSlackClientFactory(resolveSlackWriteClientOptions);
|
|
217
|
+
function createSlackReadClient(token, options = {}, dispatcher, assertDirectAdapterHandoff) {
|
|
218
|
+
return new WebClient(token, resolveSlackReadClientOptions(options, dispatcher, assertDirectAdapterHandoff));
|
|
219
|
+
}
|
|
220
|
+
function createSlackStartupAuthFetch(baseFetch) {
|
|
221
|
+
const deadline = performance.now() + SLACK_STARTUP_AUTH_RETRY_BUDGET_MS;
|
|
222
|
+
return async (input, init) => {
|
|
223
|
+
const response = await baseFetch(input, init);
|
|
224
|
+
if (response.status !== 429) return response;
|
|
225
|
+
const retryAfter = Number.parseInt(response.headers.get("retry-after") ?? "", 10);
|
|
226
|
+
const remainingMs = Math.max(0, deadline - performance.now());
|
|
227
|
+
if (!Number.isFinite(retryAfter) || retryAfter * 1e3 <= remainingMs) return response;
|
|
228
|
+
await new Promise((resolve) => {
|
|
229
|
+
setTimeout(resolve, remainingMs);
|
|
230
|
+
});
|
|
231
|
+
throw new Error("Slack startup auth retry budget exhausted after rate limit");
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
function createSlackStartupAuthClient(token, options = {}) {
|
|
235
|
+
const resolvedOptions = resolveSlackWebClientOptions(options);
|
|
236
|
+
const baseFetch = resolvedOptions.fetch;
|
|
237
|
+
if (!baseFetch) throw new Error("Slack startup auth fetch is unavailable");
|
|
238
|
+
return new WebClient(token, {
|
|
239
|
+
...resolvedOptions,
|
|
240
|
+
fetch: createSlackStartupAuthFetch(baseFetch),
|
|
241
|
+
retryConfig: {
|
|
242
|
+
...SLACK_DEFAULT_RETRY_OPTIONS,
|
|
243
|
+
maxRetryTime: SLACK_STARTUP_AUTH_RETRY_BUDGET_MS
|
|
244
|
+
},
|
|
245
|
+
timeout: SLACK_STARTUP_AUTH_TIMEOUT_MS
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
function createSlackTokenCacheKey(token) {
|
|
249
|
+
return `sha256:${hash("sha256", token, "base64url")}`;
|
|
250
|
+
}
|
|
251
|
+
function slackWriteClientCacheKey(token, options) {
|
|
252
|
+
return `${createSlackTokenCacheKey(token)}${options.slackApiUrl ? `:api:${options.slackApiUrl}` : ""}${options.teamId ? `:team:${options.teamId.trim().toLowerCase()}` : ""}`;
|
|
253
|
+
}
|
|
254
|
+
function getSlackWriteClient(token, options = {}) {
|
|
255
|
+
const resolvedOptions = resolveSlackWriteClientOptions(options);
|
|
256
|
+
const tokenKey = slackWriteClientCacheKey(token, resolvedOptions);
|
|
257
|
+
const cached = readLruMapEntry(slackWriteClientCache, tokenKey);
|
|
258
|
+
if (cached) return cached;
|
|
259
|
+
const client = new WebClient(token, resolvedOptions);
|
|
260
|
+
slackWriteClientCache.set(tokenKey, client);
|
|
261
|
+
pruneMapToMaxSize(slackWriteClientCache, SLACK_WRITE_CLIENT_CACHE_MAX);
|
|
262
|
+
return client;
|
|
263
|
+
}
|
|
264
|
+
function getSlackListenerWriteClient(params) {
|
|
265
|
+
const token = params.listenerClient.token?.trim();
|
|
266
|
+
const teamId = params.teamId?.trim().toUpperCase();
|
|
267
|
+
if (!token) return;
|
|
268
|
+
const cached = slackListenerWriteClientCache.get(params.listenerClient);
|
|
269
|
+
if (cached) {
|
|
270
|
+
if (cached.teamId !== teamId) return;
|
|
271
|
+
return cached.client;
|
|
272
|
+
}
|
|
273
|
+
const headers = Object.fromEntries(Object.entries(params.clientOptions?.headers ?? {}).filter(([name]) => name.toLowerCase() !== "authorization"));
|
|
274
|
+
const client = new WebClient(token, resolveSlackWriteClientOptions({
|
|
275
|
+
...params.clientOptions,
|
|
276
|
+
headers,
|
|
277
|
+
slackApiUrl: params.listenerClient.slackApiUrl,
|
|
278
|
+
teamId,
|
|
279
|
+
retryConfig: SLACK_WRITE_RETRY_OPTIONS,
|
|
280
|
+
timeout: 0
|
|
281
|
+
}));
|
|
282
|
+
slackListenerWriteClientCache.set(params.listenerClient, {
|
|
283
|
+
teamId,
|
|
284
|
+
client
|
|
285
|
+
});
|
|
286
|
+
return client;
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region extensions/slack/src/cursor-pages.ts
|
|
290
|
+
const SLACK_CURSOR_PAGE_LIMIT = 1e4;
|
|
291
|
+
const fetchSlackChannelListPage = (client, cursor) => client.conversations.list({
|
|
292
|
+
types: "public_channel,private_channel",
|
|
293
|
+
exclude_archived: false,
|
|
294
|
+
limit: 1e3,
|
|
295
|
+
cursor
|
|
296
|
+
});
|
|
297
|
+
async function collectSlackCursorPages(params) {
|
|
298
|
+
const items = [];
|
|
299
|
+
let cursor;
|
|
300
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
301
|
+
for (let pageCount = 1; pageCount <= SLACK_CURSOR_PAGE_LIMIT; pageCount += 1) {
|
|
302
|
+
const response = await params.fetchPage(cursor);
|
|
303
|
+
items.push(...params.collectPageItems(response));
|
|
304
|
+
const nextCursor = response.response_metadata?.next_cursor?.trim() || void 0;
|
|
305
|
+
if (!nextCursor) return items;
|
|
306
|
+
if (seenCursors.has(nextCursor)) throw new Error(`Slack cursor pagination repeated a cursor after ${pageCount} pages`);
|
|
307
|
+
seenCursors.add(nextCursor);
|
|
308
|
+
cursor = nextCursor;
|
|
309
|
+
}
|
|
310
|
+
throw new Error(`Slack cursor pagination exceeded ${SLACK_CURSOR_PAGE_LIMIT} pages`);
|
|
311
|
+
}
|
|
312
|
+
//#endregion
|
|
313
|
+
export { createSlackProbeDispatcher as _, createSlackStartupAuthClient as a, resolveSlackWebClientOptions as b, createSlackWriteClient as c, getOrCreateWeakOwnerMap as d, pruneExpiredMapEntries as f, SLACK_WRITE_RETRY_OPTIONS as g, SLACK_DEFAULT_RETRY_OPTIONS as h, createSlackReadClient as i, getSlackListenerWriteClient as l, writeLruMapEntry as m, fetchSlackChannelListPage as n, createSlackTokenCacheKey as o, readLruMapEntry as p, createSlackLookupClient as r, createSlackWebClient as s, collectSlackCursorPages as t, getSlackWriteClient as u, resolveSlackLookupClientOptions as v, resolveSlackWriteClientOptions as x, resolveSlackMonitorDispatchers as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, o as resolveDefaultSlackAccountId } from "./accounts-
|
|
3
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
4
|
-
import "./targets-
|
|
2
|
+
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, o as resolveDefaultSlackAccountId } from "./accounts-CGJScKtk.mjs";
|
|
3
|
+
import { a as parseSlackTarget } from "./target-parsing-Bx2UZniD.mjs";
|
|
4
|
+
import "./targets-D-ASeWHy.mjs";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
-
import { s as resolveSlackAccount } from "./accounts-
|
|
3
|
-
import {
|
|
2
|
+
import { s as resolveSlackAccount } from "./accounts-CGJScKtk.mjs";
|
|
3
|
+
import { n as fetchSlackChannelListPage, 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/directory-live.ts
|
|
6
6
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -55,9 +55,9 @@ function createSlackDirectoryLister(options) {
|
|
|
55
55
|
return async (params) => {
|
|
56
56
|
const client = createSlackDirectoryClient(params);
|
|
57
57
|
if (!client) return [];
|
|
58
|
-
const query = normalizeLowercaseStringOrEmpty(params.query);
|
|
58
|
+
const query = normalizeLowercaseStringOrEmpty(params.query).normalize("NFC");
|
|
59
59
|
const rows = (await options.fetchRows(client)).filter((row) => {
|
|
60
|
-
const candidates = options.searchValues(row).map(normalizeOptionalLowercaseString)
|
|
60
|
+
const candidates = options.searchValues(row).map((value) => normalizeOptionalLowercaseString(value)?.normalize("NFC"));
|
|
61
61
|
return !query || candidates.some((candidate) => candidate?.includes(query));
|
|
62
62
|
}).map(options.toEntry).filter((entry) => entry !== null);
|
|
63
63
|
return typeof params.limit === "number" && params.limit > 0 ? rows.slice(0, params.limit) : rows;
|
|
@@ -212,35 +212,6 @@ function hasInteractiveRepliesCapability(value) {
|
|
|
212
212
|
function hasEnterpriseOrgInstall(value) {
|
|
213
213
|
return Object.hasOwn((0, runtime_doctor_migrations_exports.asObjectRecord)(value) ?? {}, "enterpriseOrgInstall");
|
|
214
214
|
}
|
|
215
|
-
function removeInteractiveRepliesCapability(params) {
|
|
216
|
-
const capabilities = params.entry.capabilities;
|
|
217
|
-
let nextCapabilities;
|
|
218
|
-
let removedEmptyObject = false;
|
|
219
|
-
if (Array.isArray(capabilities)) {
|
|
220
|
-
nextCapabilities = capabilities.filter((entry) => !(typeof entry === "string" && entry.trim().toLowerCase() === "interactivereplies"));
|
|
221
|
-
if (nextCapabilities.length === capabilities.length) return {
|
|
222
|
-
entry: params.entry,
|
|
223
|
-
changed: false
|
|
224
|
-
};
|
|
225
|
-
} else {
|
|
226
|
-
const capabilitiesRecord = (0, runtime_doctor_migrations_exports.asObjectRecord)(capabilities);
|
|
227
|
-
if (!capabilitiesRecord || Object.keys(capabilitiesRecord).length > 0 && !Object.hasOwn(capabilitiesRecord, "interactiveReplies")) return {
|
|
228
|
-
entry: params.entry,
|
|
229
|
-
changed: false
|
|
230
|
-
};
|
|
231
|
-
removedEmptyObject = Object.keys(capabilitiesRecord).length === 0;
|
|
232
|
-
const { interactiveReplies: _retired, ...rest } = capabilitiesRecord;
|
|
233
|
-
nextCapabilities = rest;
|
|
234
|
-
}
|
|
235
|
-
const entry = { ...params.entry };
|
|
236
|
-
if (Array.isArray(nextCapabilities) ? nextCapabilities.length === 0 : Object.keys(nextCapabilities).length === 0) delete entry.capabilities;
|
|
237
|
-
else entry.capabilities = nextCapabilities;
|
|
238
|
-
params.changes.push(removedEmptyObject ? `Removed retired empty ${params.pathPrefix}.capabilities object; use typed presentation actions instead.` : `Removed retired ${params.pathPrefix}.capabilities.interactiveReplies; use typed presentation actions instead.`);
|
|
239
|
-
return {
|
|
240
|
-
entry,
|
|
241
|
-
changed: true
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
215
|
const legacyConfigRules = [
|
|
245
216
|
...streamingAliasMigration.legacyConfigRules,
|
|
246
217
|
{
|
|
@@ -303,21 +274,6 @@ const legacyConfigRules = [
|
|
|
303
274
|
match: (value) => (0, runtime_doctor_migrations_exports.hasLegacyAccountStreamingAliases)(value, threadMentionPolicyMigration.hasLegacy)
|
|
304
275
|
}
|
|
305
276
|
];
|
|
306
|
-
function normalizeSlackEntry(params) {
|
|
307
|
-
const retiredInteractiveReplies = removeInteractiveRepliesCapability(params);
|
|
308
|
-
const dm = dmReplyModeMigration.normalize({
|
|
309
|
-
...params,
|
|
310
|
-
entry: retiredInteractiveReplies.entry
|
|
311
|
-
});
|
|
312
|
-
const thread = threadMentionPolicyMigration.normalize({
|
|
313
|
-
...params,
|
|
314
|
-
entry: dm.entry
|
|
315
|
-
});
|
|
316
|
-
return {
|
|
317
|
-
entry: thread.entry,
|
|
318
|
-
changed: retiredInteractiveReplies.changed || dm.changed || thread.changed
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
277
|
function normalizeCompatibilityConfig({ cfg }) {
|
|
322
278
|
const changes = [];
|
|
323
279
|
const retired = (0, runtime_doctor_migrations_exports.stripRetiredChannelKeys)({
|
|
@@ -335,7 +291,43 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
335
291
|
cfg: aliases.config,
|
|
336
292
|
channelId: "slack",
|
|
337
293
|
changes,
|
|
338
|
-
normalizeEntry:
|
|
294
|
+
normalizeEntry: (params) => {
|
|
295
|
+
let { entry } = params;
|
|
296
|
+
let changed = false;
|
|
297
|
+
const capabilities = entry.capabilities;
|
|
298
|
+
let nextCapabilities;
|
|
299
|
+
let removedEmptyObject = false;
|
|
300
|
+
if (Array.isArray(capabilities)) {
|
|
301
|
+
const filtered = capabilities.filter((capability) => !(typeof capability === "string" && capability.trim().toLowerCase() === "interactivereplies"));
|
|
302
|
+
if (filtered.length !== capabilities.length) nextCapabilities = filtered;
|
|
303
|
+
} else {
|
|
304
|
+
const capabilitiesRecord = (0, runtime_doctor_migrations_exports.asObjectRecord)(capabilities);
|
|
305
|
+
if (capabilitiesRecord && (Object.keys(capabilitiesRecord).length === 0 || Object.hasOwn(capabilitiesRecord, "interactiveReplies"))) {
|
|
306
|
+
removedEmptyObject = Object.keys(capabilitiesRecord).length === 0;
|
|
307
|
+
const { interactiveReplies: _retired, ...rest } = capabilitiesRecord;
|
|
308
|
+
nextCapabilities = rest;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (nextCapabilities !== void 0) {
|
|
312
|
+
entry = { ...entry };
|
|
313
|
+
if (Array.isArray(nextCapabilities) ? nextCapabilities.length === 0 : Object.keys(nextCapabilities).length === 0) delete entry.capabilities;
|
|
314
|
+
else entry.capabilities = nextCapabilities;
|
|
315
|
+
params.changes.push(removedEmptyObject ? `Removed retired empty ${params.pathPrefix}.capabilities object; use typed presentation actions instead.` : `Removed retired ${params.pathPrefix}.capabilities.interactiveReplies; use typed presentation actions instead.`);
|
|
316
|
+
changed = true;
|
|
317
|
+
}
|
|
318
|
+
const dm = dmReplyModeMigration.normalize({
|
|
319
|
+
...params,
|
|
320
|
+
entry
|
|
321
|
+
});
|
|
322
|
+
const thread = threadMentionPolicyMigration.normalize({
|
|
323
|
+
...params,
|
|
324
|
+
entry: dm.entry
|
|
325
|
+
});
|
|
326
|
+
return {
|
|
327
|
+
entry: thread.entry,
|
|
328
|
+
changed: changed || dm.changed || thread.changed
|
|
329
|
+
};
|
|
330
|
+
}
|
|
339
331
|
});
|
|
340
332
|
}
|
|
341
333
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as listSlackAccountIds } from "./accounts-
|
|
2
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
1
|
+
import { i as listSlackAccountIds } from "./accounts-CGJScKtk.mjs";
|
|
2
|
+
import { t as inspectSlackAccount } from "./account-inspect-BLVha-ov.mjs";
|
|
3
3
|
import { r as resolveSlackThreadTsValue, t as normalizeSlackThreadTsCandidate } from "./thread-ts-Cvt7WD6B.mjs";
|
|
4
4
|
import { createActionGate } from "openclaw/plugin-sdk/channel-actions";
|
|
5
5
|
import { extractToolSend } from "openclaw/plugin-sdk/tool-send";
|
|
@@ -18,6 +18,7 @@ function listSlackMessageActions(cfg, accountId) {
|
|
|
18
18
|
const actions = ["send"];
|
|
19
19
|
for (const [gate, enabledActions] of [
|
|
20
20
|
["reactions", ["react", "reactions"]],
|
|
21
|
+
["channels", ["channel-create"]],
|
|
21
22
|
["messages", [
|
|
22
23
|
"conversation-open",
|
|
23
24
|
"read",
|
|
@@ -33,7 +34,7 @@ function listSlackMessageActions(cfg, accountId) {
|
|
|
33
34
|
]],
|
|
34
35
|
["memberInfo", ["member-info"]],
|
|
35
36
|
["emojiList", ["emoji-list"]]
|
|
36
|
-
]) if (gates.some((isEnabled) => isEnabled(gate))) actions.push(...enabledActions);
|
|
37
|
+
]) if (gates.some((isEnabled) => isEnabled(gate, gate === "channels" ? false : void 0))) actions.push(...enabledActions);
|
|
37
38
|
return actions;
|
|
38
39
|
}
|
|
39
40
|
function extractSlackToolSend(args) {
|