@openclaw/slack 2026.8.1-beta.2 → 2026.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-configured-sUohAxZr.js +33 -0
- package/dist/account-inspect-CN2hBsim.js +87 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-CK4AVI2_.js → accounts-Dm_H77gH.js} +12 -11
- package/dist/{accounts.runtime-Cb7QwWBz.js → accounts.runtime-DRuEK6mL.js} +1 -1
- package/dist/{action-runtime-BkGe7ny_.js → action-runtime-044ldvNL.js} +80 -79
- package/dist/action-runtime.runtime-BL3KzX13.js +2 -0
- package/dist/{actions-BTDXwwE3.js → actions-BI7JkfVm.js} +273 -263
- package/dist/api.js +14 -14
- package/dist/{approval-handler.runtime-CJaNzAq2.js → approval-handler.runtime-DYv0UIZS.js} +53 -174
- package/dist/{channel-D_tovcUL.js → channel-1vIJOzPx.js} +134 -160
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-type-B9MSdoGN.js → channel-type-DlFSKeIZ.js} +3 -7
- package/dist/{channel.setup-Bch9dYmA.js → channel.setup-ofDi3_Pu.js} +34 -49
- package/dist/{config-schema-xto5jFIx.js → config-schema-BVIMyiDN.js} +42 -19
- package/dist/configured-state.js +34 -0
- package/dist/conversation-binding-route-DFVLUdYF.js +115 -0
- package/dist/{directory-config-CNBz8lJa.js → directory-config-DqfQ42OV.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CFKUtW9E.js → directory-live-BPaNHjmP.js} +2 -2
- package/dist/{group-policy-c4RP9bjc.js → group-policy-BdwszjYn.js} +625 -773
- package/dist/{message-tool-api-BykQB4AU.js → message-tool-api-CJ0kjcg5.js} +23 -5
- package/dist/message-tool-api.js +1 -1
- package/dist/{monitor-1nF1NtqT.js → monitor-Dq5Cmrvp.js} +3 -3
- package/dist/{outbound-adapter-S81tsswN.js → outbound-adapter-DYaI8ThX.js} +101 -66
- package/dist/{pipeline.runtime-BvYsM5JO.js → pipeline.runtime-Bd22U0ga.js} +494 -474
- package/dist/{policy-TapwbeaT.js → policy-CtQVbde1.js} +2 -1
- package/dist/{probe-HoEg_WxB.js → probe-0usmAb0i.js} +209 -22
- package/dist/{provider-CDNvBXUi.js → provider-CN_8hFv2.js} +296 -178
- package/dist/{relay-source-C9leF11u.js → relay-source-BNGpsdwV.js} +1 -1
- package/dist/{replies-CeOfv82I.js → replies-BSiRQOJ1.js} +48 -27
- package/dist/{resolve-channels-CNPrxaXY.js → resolve-channels-Czheznc8.js} +1 -1
- package/dist/{resolve-users-Dzomuwnr.js → resolve-users-BAOlNimr.js} +1 -1
- package/dist/runtime-api.js +11 -11
- package/dist/{scopes-cYXKkrRD.js → scopes-COSlmhnH.js} +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/{send-Nor0iBwY.js → send-DS9ICrBI.js} +88 -100
- package/dist/send-results-eeOu_HYm.js +23 -0
- package/dist/{send.runtime-BmgNe6S9.js → send.runtime-D_Bb6IuH.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-CbX1-Knh.js → setup-surface-BGnd2pSe.js} +6 -6
- package/dist/{shared-zdT5AMp-.js → shared-D5B-5hBg.js} +35 -9
- package/dist/{slash-dispatch.runtime-Bnr9GR1S.js → slash-dispatch.runtime-CilDmI0c.js} +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/bolt/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/bolt/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/bolt/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/bolt/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/bolt/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/bolt/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/bolt/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/bolt/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/bolt/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/bolt/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/README.md +2 -0
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/@slack/bolt/node_modules/body-parser/node_modules/content-type/package.json +1 -1
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/README.md +2 -0
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.d.ts +20 -0
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js +20 -14
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/dist/index.js.map +1 -1
- package/node_modules/@slack/bolt/node_modules/type-is/node_modules/content-type/package.json +1 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/socket-mode/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/socket-mode/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/socket-mode/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/socket-mode/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/socket-mode/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/socket-mode/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/socket-mode/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/socket-mode/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +1 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +2 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@slack/web-api/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@slack/web-api/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +57 -7
- package/package.json +9 -9
- package/dist/account-configured-BwfXBo_F.js +0 -14
- package/dist/account-inspect-Drw2gAiN.js +0 -89
- package/dist/account-reply-mode-DrUXogvO.js +0 -14
- package/dist/action-runtime.runtime-D9I6uc0Q.js +0 -2
- package/dist/actions.runtime-DLFyUkvg.js +0 -2
- package/dist/block-text-YtiNkqmx.js +0 -79
- package/dist/runtime-api-Cj9nxBNv.js +0 -10
- package/node_modules/p-map/index.d.ts +0 -155
- package/node_modules/p-map/index.js +0 -285
- package/node_modules/p-map/license +0 -9
- package/node_modules/p-map/package.json +0 -57
- package/node_modules/p-map/readme.md +0 -190
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
- package/dist/{security-audit-DR097212.js → security-audit-B_yKr7MW.js} +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as buildSlackChannelPolicyScope, t as buildSlackChannelIdCandidates } from "./group-policy-BdwszjYn.js";
|
|
2
|
+
import { d as normalizeSlackSlug, p as resolveSlackUserAllowListForTeam } from "./probe-0usmAb0i.js";
|
|
2
3
|
import { applyChannelMatchMeta, buildChannelKeyCandidates } from "openclaw/plugin-sdk/channel-targets";
|
|
3
4
|
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
4
5
|
//#region extensions/slack/src/monitor/channel-config.ts
|
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
-
import { u as formatSlackBotTokenIdentityWarning } from "./accounts-
|
|
3
|
-
import "./target-parsing-BnMD2ZqZ.js";
|
|
2
|
+
import { u as formatSlackBotTokenIdentityWarning } from "./accounts-Dm_H77gH.js";
|
|
3
|
+
import { a as parseSlackTarget } from "./target-parsing-BnMD2ZqZ.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
|
-
import {
|
|
6
|
-
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
+
import { isRecord, normalizeOptionalLowercaseString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
6
|
import { runChannelProbe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
|
-
import { PAIRING_APPROVED_MESSAGE, projectCredentialSnapshotFields, resolveConfiguredFromRequiredCredentialStatuses } from "openclaw/plugin-sdk/channel-status";
|
|
9
7
|
import { createHash } from "node:crypto";
|
|
10
8
|
import { WebClient } from "@slack/web-api";
|
|
11
9
|
import { addActiveManagedProxyTlsOptions, resolveEnvHttpProxyAgentOptions, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
12
10
|
import { isDebugProxyGlobalFetchPatchInstalled } from "openclaw/plugin-sdk/proxy-capture";
|
|
11
|
+
import { compileAllowlist, resolveCompiledAllowlistMatch } from "openclaw/plugin-sdk/allow-from";
|
|
12
|
+
import { normalizeHyphenSlug, normalizeStringEntries as normalizeStringEntries$1, normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
13
13
|
import { redactSensitiveText } from "openclaw/plugin-sdk/logging-core";
|
|
14
|
-
|
|
15
|
-
const SLACK_CHANNEL_META = {
|
|
16
|
-
id: "slack",
|
|
17
|
-
label: "Slack",
|
|
18
|
-
selectionLabel: "Slack",
|
|
19
|
-
docsPath: "/channels/slack",
|
|
20
|
-
docsLabel: "slack",
|
|
21
|
-
blurb: "supports bot + app tokens, channels, threads, and interactive replies.",
|
|
22
|
-
systemImage: "number.square",
|
|
23
|
-
markdownCapable: true
|
|
24
|
-
};
|
|
25
|
-
function getChatChannelMeta(id) {
|
|
26
|
-
if (id !== SLACK_CHANNEL_META.id) throw new Error(`Unsupported Slack channel meta lookup: ${id}`);
|
|
27
|
-
return SLACK_CHANNEL_META;
|
|
28
|
-
}
|
|
29
|
-
//#endregion
|
|
14
|
+
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
30
15
|
//#region extensions/slack/src/client-options.ts
|
|
31
16
|
const requireFromSlackSocketMode = (() => {
|
|
32
17
|
return createRequire(createRequire(import.meta.url).resolve("@slack/socket-mode/package.json"));
|
|
@@ -194,6 +179,113 @@ function getSlackListenerUploadCompletionClient(params) {
|
|
|
194
179
|
return client;
|
|
195
180
|
}
|
|
196
181
|
//#endregion
|
|
182
|
+
//#region extensions/slack/src/monitor/allow-list.ts
|
|
183
|
+
const SLACK_SLUG_CACHE_MAX = 512;
|
|
184
|
+
const SLACK_STABLE_USER_ID_RE = /^[ubw][a-z0-9]+$/;
|
|
185
|
+
const slackSlugCache = /* @__PURE__ */ new Map();
|
|
186
|
+
function normalizeSlackSlug(raw) {
|
|
187
|
+
const key = raw ?? "";
|
|
188
|
+
const cached = slackSlugCache.get(key);
|
|
189
|
+
if (cached !== void 0) return cached;
|
|
190
|
+
const normalized = normalizeHyphenSlug(raw);
|
|
191
|
+
slackSlugCache.set(key, normalized);
|
|
192
|
+
if (slackSlugCache.size > SLACK_SLUG_CACHE_MAX) {
|
|
193
|
+
const oldest = slackSlugCache.keys().next();
|
|
194
|
+
if (!oldest.done) slackSlugCache.delete(oldest.value);
|
|
195
|
+
}
|
|
196
|
+
return normalized;
|
|
197
|
+
}
|
|
198
|
+
function normalizeAllowList(list) {
|
|
199
|
+
return normalizeStringEntries$1(list);
|
|
200
|
+
}
|
|
201
|
+
function normalizeAllowListLower(list) {
|
|
202
|
+
return normalizeStringEntriesLower(list);
|
|
203
|
+
}
|
|
204
|
+
function normalizeSlackAllowOwnerEntry(entry) {
|
|
205
|
+
const trimmed = normalizeOptionalLowercaseString(entry);
|
|
206
|
+
if (!trimmed || trimmed === "*") return;
|
|
207
|
+
try {
|
|
208
|
+
const target = parseSlackTarget(trimmed);
|
|
209
|
+
if (target?.kind === "user" && target.teamId) return target.id.toLowerCase();
|
|
210
|
+
} catch {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const withoutPrefix = trimmed.replace(/^(slack:|user:)/, "");
|
|
214
|
+
return SLACK_STABLE_USER_ID_RE.test(withoutPrefix) ? withoutPrefix : void 0;
|
|
215
|
+
}
|
|
216
|
+
function resolveSlackAllowListMatch(params) {
|
|
217
|
+
const compiledAllowList = compileAllowlist(params.allowList);
|
|
218
|
+
const teamId = normalizeOptionalLowercaseString(params.teamId);
|
|
219
|
+
const id = normalizeOptionalLowercaseString(params.id);
|
|
220
|
+
const name = normalizeOptionalLowercaseString(params.name);
|
|
221
|
+
const slug = normalizeSlackSlug(name);
|
|
222
|
+
const scopedCandidates = [{
|
|
223
|
+
value: teamId && id ? `team:${teamId}:user:${id}` : void 0,
|
|
224
|
+
source: "workspace-id"
|
|
225
|
+
}];
|
|
226
|
+
const unscopedCandidates = [
|
|
227
|
+
{
|
|
228
|
+
value: id,
|
|
229
|
+
source: "id"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
value: id ? `slack:${id}` : void 0,
|
|
233
|
+
source: "prefixed-id"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
value: id ? `user:${id}` : void 0,
|
|
237
|
+
source: "prefixed-user"
|
|
238
|
+
},
|
|
239
|
+
...params.allowNameMatching === true ? [
|
|
240
|
+
{
|
|
241
|
+
value: name,
|
|
242
|
+
source: "name"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
value: name ? `slack:${name}` : void 0,
|
|
246
|
+
source: "prefixed-name"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
value: slug,
|
|
250
|
+
source: "slug"
|
|
251
|
+
}
|
|
252
|
+
] : []
|
|
253
|
+
];
|
|
254
|
+
return resolveCompiledAllowlistMatch({
|
|
255
|
+
compiledAllowlist: compiledAllowList,
|
|
256
|
+
candidates: [...scopedCandidates, ...unscopedCandidates]
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
function allowListMatches(params) {
|
|
260
|
+
return resolveSlackAllowListMatch(params).allowed;
|
|
261
|
+
}
|
|
262
|
+
function resolveSlackUserAllowed(params) {
|
|
263
|
+
const allowList = normalizeAllowListLower(params.allowList);
|
|
264
|
+
if (allowList.length === 0) return true;
|
|
265
|
+
return allowListMatches({
|
|
266
|
+
allowList,
|
|
267
|
+
teamId: params.teamId,
|
|
268
|
+
id: params.userId,
|
|
269
|
+
name: params.userName,
|
|
270
|
+
allowNameMatching: params.allowNameMatching
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
function resolveSlackUserAllowListForTeam(params) {
|
|
274
|
+
const allowList = normalizeAllowListLower(params.allowList);
|
|
275
|
+
const teamId = normalizeOptionalLowercaseString(params.teamId);
|
|
276
|
+
return allowList.flatMap((entry) => {
|
|
277
|
+
if (entry === "*") return [entry];
|
|
278
|
+
if (!entry.startsWith("team:")) return [entry];
|
|
279
|
+
try {
|
|
280
|
+
const target = parseSlackTarget(entry);
|
|
281
|
+
if (target?.kind === "user" && target.teamId?.toLowerCase() === teamId) return [entry];
|
|
282
|
+
return params.preserveUnmatchedScopedEntries ? [entry] : [];
|
|
283
|
+
} catch {
|
|
284
|
+
return params.preserveUnmatchedScopedEntries ? [entry] : [];
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
//#endregion
|
|
197
289
|
//#region extensions/slack/src/errors.ts
|
|
198
290
|
const NO_ERROR_DETAIL = "no error detail";
|
|
199
291
|
function redact(value) {
|
|
@@ -298,6 +390,101 @@ function formatSlackError(error, fallback = NO_ERROR_DETAIL) {
|
|
|
298
390
|
return safeStringify(error) ?? fallback;
|
|
299
391
|
}
|
|
300
392
|
//#endregion
|
|
393
|
+
//#region extensions/slack/src/monitor/ingress-identity.ts
|
|
394
|
+
const SLACK_USER_NAME_KIND = "plugin:slack-user-name";
|
|
395
|
+
const SLACK_WORKSPACE_USER_ID_KIND = "plugin:slack-workspace-user-id";
|
|
396
|
+
function normalizeSlackUserId(raw) {
|
|
397
|
+
const value = (raw ?? "").trim().toLowerCase();
|
|
398
|
+
if (!value) return "";
|
|
399
|
+
const mention = value.match(/^<@([a-z0-9_]+)>$/i);
|
|
400
|
+
if (mention?.[1]) return mention[1];
|
|
401
|
+
return value.replace(/^(slack:|user:)/, "");
|
|
402
|
+
}
|
|
403
|
+
function isSlackStableUserId(value) {
|
|
404
|
+
return /^[ubw][a-z0-9_]+$/i.test(value);
|
|
405
|
+
}
|
|
406
|
+
function normalizeSlackWorkspaceUserEntry(entry) {
|
|
407
|
+
const normalized = entry.trim().toLowerCase();
|
|
408
|
+
if (!normalized) return null;
|
|
409
|
+
try {
|
|
410
|
+
const target = parseSlackTarget(normalized);
|
|
411
|
+
if (target?.kind === "user" && target.teamId) return target.normalized;
|
|
412
|
+
} catch {
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
function normalizeSlackBareUserEntry(entry) {
|
|
418
|
+
const normalized = entry.trim().toLowerCase();
|
|
419
|
+
if (!normalized || normalizeSlackWorkspaceUserEntry(normalized)) return null;
|
|
420
|
+
const userId = normalizeSlackUserId(normalized);
|
|
421
|
+
return isSlackStableUserId(userId) ? userId : null;
|
|
422
|
+
}
|
|
423
|
+
function normalizeSlackStableEntry(entry) {
|
|
424
|
+
return normalizeSlackBareUserEntry(entry) ?? normalizeSlackWorkspaceUserEntry(entry);
|
|
425
|
+
}
|
|
426
|
+
function normalizeSlackNameEntry(entry) {
|
|
427
|
+
const normalized = entry.trim().toLowerCase();
|
|
428
|
+
if (!normalized || normalizeSlackStableEntry(normalized)) return null;
|
|
429
|
+
return normalized.replace(/^slack:/, "") || null;
|
|
430
|
+
}
|
|
431
|
+
function normalizeSlackNameSubject(value) {
|
|
432
|
+
return value.trim().toLowerCase() || null;
|
|
433
|
+
}
|
|
434
|
+
function normalizeSlackNameSlugEntry(entry) {
|
|
435
|
+
const name = normalizeSlackNameEntry(entry);
|
|
436
|
+
if (!name) return null;
|
|
437
|
+
return normalizeSlackSlug(name) || null;
|
|
438
|
+
}
|
|
439
|
+
const slackIngressIdentity = defineStableChannelIngressIdentity({
|
|
440
|
+
resolveParticipant: (subject) => {
|
|
441
|
+
const qualified = subject.aliases?.workspaceSenderId;
|
|
442
|
+
if (typeof qualified !== "string") return;
|
|
443
|
+
const normalized = normalizeSlackWorkspaceUserEntry(qualified);
|
|
444
|
+
const target = normalized ? parseSlackTarget(normalized) : void 0;
|
|
445
|
+
return target?.teamId ? {
|
|
446
|
+
domain: target.teamId,
|
|
447
|
+
idKind: target.id.startsWith("b") ? "bot-id" : "user-id",
|
|
448
|
+
id: target.id
|
|
449
|
+
} : void 0;
|
|
450
|
+
},
|
|
451
|
+
key: "senderId",
|
|
452
|
+
kind: "stable-id",
|
|
453
|
+
authentication: "asserted",
|
|
454
|
+
normalizeEntry: normalizeSlackBareUserEntry,
|
|
455
|
+
normalizeSubject: normalizeSlackUserId,
|
|
456
|
+
sensitivity: "pii",
|
|
457
|
+
aliases: [{
|
|
458
|
+
key: "workspaceSenderId",
|
|
459
|
+
kind: SLACK_WORKSPACE_USER_ID_KIND,
|
|
460
|
+
authentication: "asserted",
|
|
461
|
+
normalizeEntry: normalizeSlackWorkspaceUserEntry,
|
|
462
|
+
normalizeSubject: normalizeSlackWorkspaceUserEntry,
|
|
463
|
+
sensitivity: "pii"
|
|
464
|
+
}, ...[["senderName", normalizeSlackNameEntry], ["senderNameSlug", normalizeSlackNameSlugEntry]].map(([key, normalizeEntry]) => ({
|
|
465
|
+
key,
|
|
466
|
+
kind: SLACK_USER_NAME_KIND,
|
|
467
|
+
normalizeEntry,
|
|
468
|
+
normalizeSubject: normalizeSlackNameSubject,
|
|
469
|
+
authentication: "mutable",
|
|
470
|
+
sensitivity: "pii"
|
|
471
|
+
}))]
|
|
472
|
+
});
|
|
473
|
+
function createSlackIngressSubject(params) {
|
|
474
|
+
const senderId = normalizeSlackUserId(params.senderId);
|
|
475
|
+
const teamId = normalizeOptionalLowercaseString(params.teamId);
|
|
476
|
+
const senderName = params.senderName?.trim().toLowerCase();
|
|
477
|
+
const senderNameSlug = senderName ? normalizeSlackSlug(senderName) : void 0;
|
|
478
|
+
return {
|
|
479
|
+
stableId: senderId,
|
|
480
|
+
aliases: {
|
|
481
|
+
workspaceSenderId: teamId && senderId ? `team:${teamId}:user:${senderId}` : void 0,
|
|
482
|
+
senderName,
|
|
483
|
+
senderNameSlug
|
|
484
|
+
}
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
//#endregion
|
|
301
488
|
//#region extensions/slack/src/probe.ts
|
|
302
489
|
var probe_exports = /* @__PURE__ */ __exportAll({ probeSlack: () => probeSlack });
|
|
303
490
|
async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
@@ -362,4 +549,4 @@ async function probeSlack(token, timeoutMs = 2500, opts) {
|
|
|
362
549
|
}));
|
|
363
550
|
}
|
|
364
551
|
//#endregion
|
|
365
|
-
export {
|
|
552
|
+
export { SLACK_DEFAULT_RETRY_OPTIONS as C, resolveSlackWebClientOptions as D, resolveSlackProxyDispatcher as E, resolveSlackWriteClientOptions as O, getSlackWriteClient as S, resolveSlackLookupClientOptions as T, createSlackStartupAuthClient as _, slackIngressIdentity as a, createSlackWriteClient as b, normalizeAllowList as c, normalizeSlackSlug as d, resolveSlackAllowListMatch as f, createSlackReadClient as g, createSlackLookupClient as h, createSlackIngressSubject as i, normalizeAllowListLower as l, resolveSlackUserAllowed as m, probe_exports as n, formatSlackError as o, resolveSlackUserAllowListForTeam as p, SLACK_USER_NAME_KIND as r, allowListMatches as s, probeSlack as t, normalizeSlackAllowOwnerEntry as u, createSlackTokenCacheKey as v, SLACK_WRITE_RETRY_OPTIONS as w, getSlackListenerUploadCompletionClient as x, createSlackWebClient as y };
|