@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,9 +1,10 @@
|
|
|
1
|
-
import { d as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-
|
|
2
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
4
|
-
import { c as resolveSlackReplyDeliveryMessages, i as parseSlackReplyBlockSegments, o as resolveSlackReplyBlockResolution, r as normalizeSlackReplyPayload, u as resolveSlackAuthoredTextPlacement } from "./reply-blocks-Ca-raz2z.mjs";
|
|
1
|
+
import { d as resolveSlackMarkdownOptions, f as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-CGJScKtk.mjs";
|
|
2
|
+
import { a as parseSlackTarget } from "./target-parsing-Bx2UZniD.mjs";
|
|
3
|
+
import { J as resolveSlackQuestionActionIds, S as assertSlackDetachedTargetAllowed, mt as SLACK_PRESENTATION_CAPABILITIES, xt as SLACK_TEXT_LIMIT } from "./probe-DANukR3O.mjs";
|
|
5
4
|
import { r as resolveSlackThreadTsValue } from "./thread-ts-Cvt7WD6B.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { a as resolveSlackReplyBlockResolution, d as resolveSlackAuthoredTextPlacement, r as normalizeSlackReplyPayload, s as resolveSlackReplyDeliveryMessages } from "./reply-blocks-BzsXUUUL.mjs";
|
|
6
|
+
import { t as mergeSlackSendResults } from "./send-results-BGxlroJ-.mjs";
|
|
7
|
+
import { t as registerSlackQuestionDelivery } from "./question-delivery-CWC7sRhH.mjs";
|
|
7
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
9
|
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
|
|
9
10
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
@@ -32,8 +33,8 @@ function readSlackRenderedPresentation(slackData) {
|
|
|
32
33
|
const provenance = slackData?.renderedPresentationProvenance;
|
|
33
34
|
if (typeof provenance !== "string") return;
|
|
34
35
|
try {
|
|
35
|
-
const segments =
|
|
36
|
-
const authoredTextPlacement =
|
|
36
|
+
const segments = slackData?.renderedPresentationSegments;
|
|
37
|
+
const authoredTextPlacement = slackData?.authoredTextPlacement;
|
|
37
38
|
if (!segments || !authoredTextPlacement) return;
|
|
38
39
|
const resolution = {
|
|
39
40
|
authoredTextPlacement,
|
|
@@ -44,7 +45,7 @@ function readSlackRenderedPresentation(slackData) {
|
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
48
|
+
const loadSlackSendRuntime = createLazyRuntimeModule(() => import("./send-yK6_-px6.mjs").then((n) => n.n));
|
|
48
49
|
function resolveSlackSendIdentity(identity) {
|
|
49
50
|
if (!identity) return;
|
|
50
51
|
const username = normalizeOptionalString(identity.name);
|
|
@@ -58,14 +59,17 @@ function resolveSlackSendIdentity(identity) {
|
|
|
58
59
|
iconEmoji
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
|
-
function resolveSlackOutboundBlockResolution(payload) {
|
|
62
|
+
function resolveSlackOutboundBlockResolution(payload, options) {
|
|
62
63
|
const slackData = payload.channelData?.slack;
|
|
63
64
|
const presentation = normalizeMessagePresentation(payload.presentation);
|
|
64
65
|
if (!Boolean(slackData?.blocks !== void 0 || presentation || payload.interactive?.blocks.length)) return {
|
|
65
66
|
authoredTextPlacement: resolveSlackAuthoredTextPlacement(payload),
|
|
66
67
|
segments: []
|
|
67
68
|
};
|
|
68
|
-
return resolveSlackReplyBlockResolution(payload, {
|
|
69
|
+
return resolveSlackReplyBlockResolution(payload, {
|
|
70
|
+
...options,
|
|
71
|
+
materializeAuthoredText: true
|
|
72
|
+
});
|
|
69
73
|
}
|
|
70
74
|
function withSlackRenderedPresentation(payload, slackData, resolution) {
|
|
71
75
|
const { authoredPresentationText: _authoredPresentationText, authoredTextPlacement: _authoredTextPlacement, blocks: _blocks, renderedPresentationProvenance: _renderedPresentationProvenance, renderedPresentationSegments: _renderedPresentationSegments, ...preservedSlackData } = slackData ?? {};
|
|
@@ -82,9 +86,6 @@ function withSlackRenderedPresentation(payload, slackData, resolution) {
|
|
|
82
86
|
}
|
|
83
87
|
};
|
|
84
88
|
}
|
|
85
|
-
function readSlackAuthoredTextPlacement(value) {
|
|
86
|
-
return value === "none" || value === "blocks" || value === "outside-blocks" ? value : void 0;
|
|
87
|
-
}
|
|
88
89
|
async function prepareSlackOutboundSend(ctx) {
|
|
89
90
|
const account = resolveSlackAccount({
|
|
90
91
|
cfg: ctx.cfg,
|
|
@@ -132,13 +133,13 @@ const slackOutbound = {
|
|
|
132
133
|
textChunkLimit: SLACK_TEXT_LIMIT,
|
|
133
134
|
presentationCapabilities: SLACK_PRESENTATION_CAPABILITIES,
|
|
134
135
|
normalizePayload: ({ payload }) => normalizeSlackReplyPayload(payload),
|
|
135
|
-
renderPresentation: ({ payload }) => {
|
|
136
|
+
renderPresentation: ({ payload, ctx }) => {
|
|
136
137
|
const slackData = payload.channelData?.slack;
|
|
137
138
|
const renderPayload = payload.presentationTextMode === "fallback" ? {
|
|
138
139
|
...payload,
|
|
139
140
|
text: payload.text ?? slackData?.authoredPresentationText
|
|
140
141
|
} : payload;
|
|
141
|
-
const resolution = resolveSlackOutboundBlockResolution(renderPayload);
|
|
142
|
+
const resolution = resolveSlackOutboundBlockResolution(renderPayload, resolveSlackMarkdownOptions(ctx));
|
|
142
143
|
return resolution.segments.length > 0 ? withSlackRenderedPresentation(renderPayload, slackData, resolution) : null;
|
|
143
144
|
},
|
|
144
145
|
sendPayload: async (ctx) => {
|
|
@@ -158,7 +159,7 @@ const slackOutbound = {
|
|
|
158
159
|
}) ?? ""
|
|
159
160
|
};
|
|
160
161
|
const slackData = payload.channelData?.slack;
|
|
161
|
-
const resolution = readSlackRenderedPresentation(slackData) ?? resolveSlackOutboundBlockResolution(payload);
|
|
162
|
+
const resolution = readSlackRenderedPresentation(slackData) ?? resolveSlackOutboundBlockResolution(payload, resolveSlackMarkdownOptions(ctx));
|
|
162
163
|
if (resolution.segments.length === 0) {
|
|
163
164
|
const sendPart = async (part) => toSlackOutboundResult(await send(part));
|
|
164
165
|
return await sendTextMediaPayload({
|
|
@@ -210,36 +211,29 @@ const slackOutbound = {
|
|
|
210
211
|
authoredTextPlacement: resolution.authoredTextPlacement,
|
|
211
212
|
segments: resolution.segments,
|
|
212
213
|
text: payload.text
|
|
213
|
-
}).find((message) => resolveSlackQuestionActionIds(message.blocks).length > 0);
|
|
214
|
-
const questionActionIds = resolveSlackQuestionActionIds(deliveryMessage?.blocks);
|
|
214
|
+
}).find((message) => resolveSlackQuestionActionIds(message.blocks, questionId).length > 0);
|
|
215
|
+
const questionActionIds = resolveSlackQuestionActionIds(deliveryMessage?.blocks, questionId);
|
|
215
216
|
const result = results.find(({ channel, meta }) => channel === "slack" && Array.isArray(meta?.slackQuestionActionIds) && meta.slackQuestionActionIds.some((actionId) => typeof actionId === "string" && questionActionIds.includes(actionId)));
|
|
216
|
-
|
|
217
|
-
if (!deliveryMessage || !deliveredDisplayBlocks || !result?.messageId) return;
|
|
217
|
+
if (!deliveryMessage || !result?.messageId) return;
|
|
218
218
|
const channelId = result.target?.kind === "channel" ? result.target.id : void 0;
|
|
219
219
|
if (!channelId) return;
|
|
220
220
|
const teamId = parseSlackTarget(target.to, { defaultKind: "channel" })?.teamId;
|
|
221
|
-
|
|
222
|
-
questionGatewayRuntime.registerChannelDelivery({
|
|
221
|
+
registerSlackQuestionDelivery({
|
|
223
222
|
questionId,
|
|
224
|
-
|
|
225
|
-
|
|
223
|
+
accountId: target.accountId ?? void 0,
|
|
224
|
+
result: {
|
|
225
|
+
...result,
|
|
226
|
+
channelId,
|
|
227
|
+
meta: result.meta
|
|
228
|
+
},
|
|
229
|
+
text: deliveryMessage.text,
|
|
230
|
+
update: async (message) => {
|
|
226
231
|
const { updateMessageSlack } = await loadSlackSendRuntime();
|
|
227
|
-
const escapedStatusLine = escapeSlackMrkdwn(statusLine);
|
|
228
|
-
const blocks = [...deliveredDisplayBlocks, {
|
|
229
|
-
type: "context",
|
|
230
|
-
elements: [{
|
|
231
|
-
type: "mrkdwn",
|
|
232
|
-
text: escapedStatusLine
|
|
233
|
-
}]
|
|
234
|
-
}];
|
|
235
232
|
await updateMessageSlack({
|
|
236
233
|
cfg,
|
|
237
234
|
accountId: target.accountId ?? void 0,
|
|
238
|
-
channelId,
|
|
239
235
|
teamId,
|
|
240
|
-
|
|
241
|
-
text: `${deliveryMessage.text}\n\n${escapedStatusLine}`,
|
|
242
|
-
blocks
|
|
236
|
+
...message
|
|
243
237
|
});
|
|
244
238
|
}
|
|
245
239
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region extensions/slack/src/http/paths.ts
|
|
2
|
+
function normalizeSlackWebhookPath(path) {
|
|
3
|
+
const trimmed = path?.trim();
|
|
4
|
+
if (!trimmed) return "/slack/events";
|
|
5
|
+
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { normalizeSlackWebhookPath as t };
|