@openclaw/slack 2026.10.10-beta.5 → 2026.11.5-beta.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/.setup/{account-configured-zcR9TJJN.mjs → account-configured-35y0-Hso.mjs} +1 -2
- package/dist/.setup/{account-inspect-CmkKiSb9.mjs → account-inspect-DgQgj0wk.mjs} +13 -11
- package/dist/.setup/{accounts-msihSF3-.mjs → accounts-EaPP0fFY.mjs} +16 -11
- package/dist/.setup/{action-runtime-ChRfnnBu.mjs → action-runtime-CK9QZgQl.mjs} +39 -47
- package/dist/.setup/action-runtime.runtime-CpZktret.mjs +1 -0
- package/dist/.setup/{actions-By7tvpvv.mjs → actions-s3CcFO45.mjs} +98 -93
- package/dist/.setup/{approval-handler.runtime-D8ArtDQt.mjs → approval-handler.runtime-Ch7BecYK.mjs} +27 -32
- package/dist/.setup/{approval-message-updates-DT7XBPbV.mjs → approval-message-updates-CqcRoa28.mjs} +2 -3
- package/dist/.setup/{channel-6YzXl_63.mjs → channel-CAvo_WNZ.mjs} +573 -352
- package/dist/.setup/{channel-meta-C443t-lI.mjs → channel-meta-C5vsCo3a.mjs} +1 -2
- package/dist/.setup/{channel-type-BEFP2ORi.mjs → channel-type-9Lw6yLf2.mjs} +6 -11
- package/dist/.setup/{channel.setup-u6QQdbTa.mjs → channel.setup-BlgXNuCJ.mjs} +19 -23
- package/dist/.setup/{config-schema-DNnh6bWU.mjs → config-schema-Bx1tCZB0.mjs} +5 -11
- package/dist/.setup/cursor-pages-jVn3Vkfi.mjs +309 -0
- package/dist/.setup/{directory-config-Cjj0N8R0.mjs → directory-config-CGvKYg9F.mjs} +5 -6
- package/dist/.setup/{directory-live-BIKD-5B_.mjs → directory-live-DNdw97LA.mjs} +6 -7
- package/dist/.setup/{doctor-contract-Cd4-VzIM.mjs → doctor-contract-BB2KJ9Ni.mjs} +44 -58
- package/dist/.setup/{message-tool-api-BS5ekEA_.mjs → message-tool-api-B38BpEaE.mjs} +7 -8
- package/dist/.setup/{monitor-BFilOuM_.mjs → monitor-BD86SotB.mjs} +3416 -3750
- package/dist/.setup/{outbound-adapter-9dbnYtL1.mjs → outbound-adapter-BH6iPWBj.mjs} +32 -39
- package/dist/.setup/paths-CQZI_5WY.mjs +7 -0
- package/dist/.setup/{pipeline.runtime-BG5swHnj.mjs → pipeline.runtime-C4ELxaRU.mjs} +444 -590
- package/dist/.setup/{policy-yhn48xf5.mjs → policy-C6_DdlSf.mjs} +3 -6
- package/dist/.setup/{session-status-Dv8wNBEt.mjs → probe-B_Ax1vS1.mjs} +1015 -678
- package/dist/.setup/question-delivery-D3qAIwuv.mjs +38 -0
- package/dist/.setup/{relay-source-oY9SbDiX.mjs → relay-source-a8jodKuO.mjs} +12 -6
- package/dist/.setup/{replies-CJwjTqDr.mjs → replies-Bq7n0gfM.mjs} +37 -24
- package/dist/.setup/{reply-blocks-Ca-raz2z.mjs → reply-blocks-DyYYRrP_.mjs} +202 -210
- package/dist/.setup/{resolve-channels-DRRhElwz.mjs → resolve-channels-CF2JME9q.mjs} +6 -10
- package/dist/.setup/{resolve-users-Cz8e17ky.mjs → resolve-users-DDcCAjH1.mjs} +10 -19
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime-JSVZSWAj.mjs → runtime-C6HKn7Av.mjs} +1 -2
- package/dist/.setup/runtime-setter-api-DrXr965r.mjs +2 -0
- package/dist/.setup/{scopes-DfQVi8Jw.mjs → scopes-CzHC_dwV.mjs} +3 -3
- package/dist/.setup/{secret-contract-B-Qm6aQQ.mjs → secret-contract-CqVqR7MP.mjs} +5 -4
- package/dist/.setup/{secret-contract-api-DB6CMdgc.mjs → secret-contract-api-DaCXZ47j.mjs} +1 -1
- package/dist/.setup/{security-audit-DFGiFLqd.mjs → security-audit-C3hXCfDt.mjs} +2 -3
- package/dist/.setup/{send-C-8wY0lK.mjs → send-WJZ73VSf.mjs} +306 -349
- package/dist/.setup/{send-results-eeOu_HYm.mjs → send-results-Bm6V1ekL.mjs} +4 -6
- package/dist/.setup/setup-plugin-api-DJXIB8CF.mjs +2 -0
- package/dist/.setup/{setup-surface-9WVQgYCT.mjs → setup-surface-uIqP2B0Y.mjs} +6 -8
- package/dist/.setup/{slash-dispatch.runtime-v5kQqJPh.mjs → slash-dispatch.runtime-Cwuwv7FL.mjs} +2 -2
- package/dist/.setup/{target-parsing-FFE26kOV.mjs → target-parsing-DwYAP3ts.mjs} +2 -4
- package/dist/.setup/{targets-C6LZQL1Q.mjs → targets-eeOxA_b_.mjs} +2 -3
- package/dist/.setup/{thread-ts-Cvt7WD6B.mjs → thread-ts-47Au2-Yn.mjs} +1 -2
- package/dist/.source-module-urls/c5ffd0957b234c7c12090e7de4eca2482ef339b8561e078da55b734211b0ba58.json +1 -0
- package/dist/account-inspect-api.js +2 -3
- package/dist/api.js +17 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-entry.js +1 -2
- package/dist/channel-plugin-api.js +1 -1
- package/dist/configured-state.js +2 -3
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/index.js +1 -8
- package/dist/message-tool-api.js +1 -1
- package/dist/runtime-api.js +11 -13
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +4 -5
- package/dist/setup-plugin-api.js +1 -1
- 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/README.md +25 -3
- package/node_modules/undici/docs/docs/api/CacheStore.md +24 -9
- package/node_modules/undici/docs/docs/api/Client.md +11 -6
- package/node_modules/undici/docs/docs/api/Dispatcher.md +3 -0
- package/node_modules/undici/docs/docs/api/Errors.md +76 -1
- package/node_modules/undici/docs/docs/api/H2CClient.md +3 -2
- package/node_modules/undici/docs/docs/api/Interceptors.md +28 -8
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +13 -10
- package/node_modules/undici/docs/docs/index.md +12 -12
- package/node_modules/undici/docs/docs/type-map.json +66 -66
- package/node_modules/undici/lib/cache/memory-cache-store.js +48 -13
- package/node_modules/undici/lib/cache/sqlite-cache-store.js +83 -5
- package/node_modules/undici/lib/core/connect.js +10 -4
- package/node_modules/undici/lib/core/constants.js +12 -1
- package/node_modules/undici/lib/core/errors.js +38 -1
- package/node_modules/undici/lib/core/request.js +16 -1
- package/node_modules/undici/lib/core/symbols.js +2 -0
- package/node_modules/undici/lib/core/util.js +26 -1
- package/node_modules/undici/lib/dispatcher/agent.js +6 -2
- package/node_modules/undici/lib/dispatcher/client-h1.js +116 -80
- package/node_modules/undici/lib/dispatcher/client-h2.js +124 -17
- package/node_modules/undici/lib/dispatcher/client.js +4 -1
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +3 -2
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +20 -3
- package/node_modules/undici/lib/dispatcher/parser-h1.js +1064 -0
- package/node_modules/undici/lib/dispatcher/pool-base.js +85 -31
- package/node_modules/undici/lib/dispatcher/pool.js +11 -8
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +18 -8
- package/node_modules/undici/lib/dispatcher/retry-agent.js +10 -0
- package/node_modules/undici/lib/dispatcher/round-robin-pool.js +15 -5
- package/node_modules/undici/lib/handler/cache-handler.js +153 -15
- package/node_modules/undici/lib/handler/deduplication-handler.js +112 -51
- package/node_modules/undici/lib/handler/redirect-handler.js +28 -8
- package/node_modules/undici/lib/handler/retry-handler.js +44 -11
- package/node_modules/undici/lib/interceptor/cache.js +11 -3
- package/node_modules/undici/lib/interceptor/decompress.js +22 -9
- package/node_modules/undici/lib/interceptor/dns.js +11 -0
- package/node_modules/undici/lib/interceptor/response-error.js +72 -28
- package/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/node_modules/undici/lib/milo/simd.js +1002 -0
- package/node_modules/undici/lib/mock/mock-agent.js +11 -0
- package/node_modules/undici/lib/mock/snapshot-recorder.js +3 -2
- package/node_modules/undici/lib/mock/snapshot-utils.js +3 -2
- package/node_modules/undici/lib/util/cache.js +11 -5
- package/node_modules/undici/lib/web/cookies/util.js +19 -2
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +69 -15
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -2
- package/node_modules/undici/lib/web/fetch/body.js +47 -38
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +12 -4
- package/node_modules/undici/lib/web/fetch/headers.js +2 -2
- package/node_modules/undici/lib/web/fetch/index.js +8 -4
- package/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +5 -5
- package/node_modules/undici/lib/web/websocket/receiver.js +25 -4
- package/node_modules/undici/package.json +9 -7
- package/node_modules/undici/types/api.d.ts +1 -1
- package/node_modules/undici/types/cache-interceptor.d.ts +10 -0
- package/node_modules/undici/types/client.d.ts +10 -4
- package/node_modules/undici/types/errors.d.ts +16 -1
- package/node_modules/undici/types/h2c-client.d.ts +1 -1
- package/node_modules/undici/types/interceptors.d.ts +6 -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-Ck_j1YTn.mjs +0 -1
- 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-Cx_PV-xu.mjs +0 -2
- package/dist/.setup/setup-plugin-api-B18kDKtr.mjs +0 -2
- package/dist/.setup/shared-DpHCoKy2.mjs +0 -259
- package/dist/.source-module-urls/562d694877afe9d9dcbb3b32a8883c16974738f2aa892c48d45572cdc9a62529.json +0 -1
- package/dist/http-routes-api.js +0 -1
- 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,10 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as markdownToSlackMrkdwnChunks, E as buildSlackNativeDataAccessibilityText, F as truncateSlackText, H as SLACK_SELECT_ACTION_IDS, L as SLACK_BUTTON_ACTION_IDS, O as hasSlackNativeDataBlock, St as chunkSlackMrkdwnText, Tt as escapeSlackMrkdwn, X as encodeSlackQuestionAction, at as buildSlackCompleteBlocksFallbackText, ct as hasSlackDataVisualizationBlock, dt as countSlackDataTableBlocksCellCharacters, et as encodeSlackApprovalAction, ft as countSlackDataTableCellCharacters, gt as renderSlackMessagePresentationChartFallbackText, ht as SLACK_SECTION_TEXT_MAX, it as buildSlackBlocksFallbackText, nt as parseSlackBlocksInput, ot as renderSlackBlockFallbackText, st as buildSlackDataVisualizationBlock, ut as buildSlackDataTableBlock, w as appendSlackNativeDataFallbackText } from "./probe-B_Ax1vS1.mjs";
|
|
2
2
|
import { asOptionalRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { chunkTextForOutbound } from "openclaw/plugin-sdk/text-chunking";
|
|
4
4
|
import { legacyInteractiveReplyToPresentation, normalizeMessagePresentation, renderMessagePresentationFallbackText, resolveMessagePresentationButtonAction, resolveMessagePresentationOptionAction } from "openclaw/plugin-sdk/interactive-runtime";
|
|
5
|
-
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
6
5
|
import { resolveAskUserQuestionOptionIndex, resolveAskUserQuestionOptionIndices, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
7
|
-
|
|
6
|
+
import { parseExecApprovalCommandText } from "openclaw/plugin-sdk/approval-reply-runtime";
|
|
7
|
+
// extensions/slack/src/authored-text.ts
|
|
8
|
+
function isSlackAuthoredTextRepresentedInFragments(plan, fragments) {
|
|
9
|
+
if (plan.length === 0) return false;
|
|
10
|
+
if (fragments.some((_, start) => plan.every((text, index) => text === fragments[start + index]))) return true;
|
|
11
|
+
const [text] = plan;
|
|
12
|
+
if (plan.length !== 1 || !text || /[*_~`<]/u.test(text)) return false;
|
|
13
|
+
for (let start = 0; start < fragments.length; start += 1) {
|
|
14
|
+
let offset = 0;
|
|
15
|
+
for (let end = start; end < fragments.length; end += 1) {
|
|
16
|
+
const fragment = fragments[end];
|
|
17
|
+
if (typeof fragment !== "string" || !text.startsWith(fragment, offset)) break;
|
|
18
|
+
offset += fragment.length;
|
|
19
|
+
if (offset === text.length) return true;
|
|
20
|
+
if (!/\s/u.test(text[offset] ?? "")) break;
|
|
21
|
+
while (/\s/u.test(text[offset] ?? "")) offset += 1;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
/** Resolve placement from producer facts, before accessibility text changes the payload text. */
|
|
27
|
+
function resolveSlackAuthoredTextPlacement(params) {
|
|
28
|
+
const text = normalizeOptionalString(params.text);
|
|
29
|
+
if (!text) return "none";
|
|
30
|
+
const fragments = (params.renderedTextFragments ?? params.interactive?.blocks.flatMap((block) => block.type === "text" ? [block.text] : []) ?? []).map((fragment) => fragment?.trim() ?? null).filter((fragment) => fragment !== "");
|
|
31
|
+
return isSlackAuthoredTextRepresentedInFragments((params.authoredChunks ?? [text]).map((fragment) => fragment.trim()).filter(Boolean), fragments) ? "blocks" : "outside-blocks";
|
|
32
|
+
}
|
|
33
|
+
// extensions/slack/src/blocks-render.ts
|
|
8
34
|
const SLACK_BUTTON_URL_MAX = 3e3;
|
|
9
35
|
function buildSlackPlainText(text, maxLength) {
|
|
10
36
|
return {
|
|
@@ -13,10 +39,6 @@ function buildSlackPlainText(text, maxLength) {
|
|
|
13
39
|
emoji: true
|
|
14
40
|
};
|
|
15
41
|
}
|
|
16
|
-
function resolveSlackButtonStyle(style) {
|
|
17
|
-
if (style === "primary" || style === "danger") return style;
|
|
18
|
-
if (style === "success") return "primary";
|
|
19
|
-
}
|
|
20
42
|
function resolveSlackActionTarget(action, questionOptionIndices) {
|
|
21
43
|
if (!action) return;
|
|
22
44
|
if (action.type === "approval") return {
|
|
@@ -59,42 +81,10 @@ function resolveSlackActionTarget(action, questionOptionIndices) {
|
|
|
59
81
|
value: command
|
|
60
82
|
} : void 0;
|
|
61
83
|
}
|
|
62
|
-
function resolveSlackButtonTarget(button, questionOptionIndices) {
|
|
63
|
-
if (button.action !== void 0) {
|
|
64
|
-
const action = resolveMessagePresentationButtonAction(button);
|
|
65
|
-
return action ? resolveSlackActionTarget(action, questionOptionIndices) : void 0;
|
|
66
|
-
}
|
|
67
|
-
const legacyUrl = normalizeOptionalString(button.url ?? button.webApp?.url ?? button.web_app?.url);
|
|
68
|
-
if (legacyUrl && legacyUrl.length <= SLACK_BUTTON_URL_MAX) return {
|
|
69
|
-
kind: "link",
|
|
70
|
-
url: legacyUrl
|
|
71
|
-
};
|
|
72
|
-
const legacyValue = normalizeOptionalString(button.value);
|
|
73
|
-
if (legacyValue) return {
|
|
74
|
-
kind: "reply",
|
|
75
|
-
value: legacyValue
|
|
76
|
-
};
|
|
77
|
-
return legacyUrl ? {
|
|
78
|
-
kind: "link",
|
|
79
|
-
url: legacyUrl
|
|
80
|
-
} : void 0;
|
|
81
|
-
}
|
|
82
84
|
function isSlackTextFallbackButton(button) {
|
|
83
85
|
const action = resolveMessagePresentationButtonAction(button);
|
|
84
86
|
return action?.type === "question" && "intent" in action && action.intent === "custom-input";
|
|
85
87
|
}
|
|
86
|
-
function resolveSlackOptionTarget(option) {
|
|
87
|
-
if (option.action !== void 0) {
|
|
88
|
-
const action = resolveMessagePresentationOptionAction(option);
|
|
89
|
-
const target = action ? resolveSlackActionTarget(action) : void 0;
|
|
90
|
-
return target?.kind === "link" || target?.kind === "question" ? void 0 : target;
|
|
91
|
-
}
|
|
92
|
-
const value = normalizeOptionalString(option.value);
|
|
93
|
-
return value ? {
|
|
94
|
-
kind: "reply",
|
|
95
|
-
value
|
|
96
|
-
} : void 0;
|
|
97
|
-
}
|
|
98
88
|
function readSlackOpenClawBlockIndex(blockId, prefix) {
|
|
99
89
|
if (!blockId.startsWith(prefix)) return;
|
|
100
90
|
const value = Number.parseInt(blockId.slice(prefix.length), 10);
|
|
@@ -136,7 +126,18 @@ function buildSlackPresentationBlocksIfComplete(presentation, options = {}) {
|
|
|
136
126
|
function compileSlackPresentationBlocks(presentation, options, requireComplete) {
|
|
137
127
|
if (!presentation) return [];
|
|
138
128
|
if (requireComplete && presentation.title && presentation.title.trim().length > 150) return;
|
|
139
|
-
|
|
129
|
+
let tables = [];
|
|
130
|
+
let cellCharacterCount = options.dataTableCellCharacterCountOffset ?? 0;
|
|
131
|
+
for (const block of presentation.blocks) {
|
|
132
|
+
if (block.type !== "table") continue;
|
|
133
|
+
const table = buildSlackDataTableBlock(block, { cellCharacterCountOffset: cellCharacterCount });
|
|
134
|
+
if (!table) {
|
|
135
|
+
tables = void 0;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
cellCharacterCount += countSlackDataTableCellCharacters(table);
|
|
139
|
+
tables.push(table);
|
|
140
|
+
}
|
|
140
141
|
if (requireComplete && !tables) return;
|
|
141
142
|
const blocks = [];
|
|
142
143
|
if (presentation.title) blocks.push({
|
|
@@ -175,8 +176,79 @@ function compileSlackPresentationBlocks(presentation, options, requireComplete)
|
|
|
175
176
|
}
|
|
176
177
|
if (block.type === "buttons" || block.type === "select") {
|
|
177
178
|
const index = controlIndices[block.type] + 1;
|
|
178
|
-
|
|
179
|
-
if (
|
|
179
|
+
let elements;
|
|
180
|
+
if (block.type === "buttons") {
|
|
181
|
+
let complete = true;
|
|
182
|
+
const buttons = block.buttons.flatMap((button, choiceIndex) => {
|
|
183
|
+
const questionOptionIndices = options.questionOptionIndices;
|
|
184
|
+
let target;
|
|
185
|
+
if (button.action !== void 0) {
|
|
186
|
+
const action = resolveMessagePresentationButtonAction(button);
|
|
187
|
+
target = action ? resolveSlackActionTarget(action, questionOptionIndices) : void 0;
|
|
188
|
+
} else {
|
|
189
|
+
const legacyUrl = normalizeOptionalString(button.url ?? button.webApp?.url ?? button.web_app?.url);
|
|
190
|
+
if (legacyUrl && legacyUrl.length <= SLACK_BUTTON_URL_MAX) target = {
|
|
191
|
+
kind: "link",
|
|
192
|
+
url: legacyUrl
|
|
193
|
+
};
|
|
194
|
+
else {
|
|
195
|
+
const legacyValue = normalizeOptionalString(button.value);
|
|
196
|
+
target = legacyValue ? {
|
|
197
|
+
kind: "reply",
|
|
198
|
+
value: legacyValue
|
|
199
|
+
} : legacyUrl ? {
|
|
200
|
+
kind: "link",
|
|
201
|
+
url: legacyUrl
|
|
202
|
+
} : void 0;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (!target || (target.kind === "link" ? target.url.length > SLACK_BUTTON_URL_MAX : target.value.length > 2e3)) {
|
|
206
|
+
if (requireComplete && !isSlackTextFallbackButton(button)) complete = false;
|
|
207
|
+
return [];
|
|
208
|
+
}
|
|
209
|
+
if (button.label.length > 75) complete = false;
|
|
210
|
+
const style = button.style === "success" ? "primary" : button.style === "primary" || button.style === "danger" ? button.style : void 0;
|
|
211
|
+
return [{
|
|
212
|
+
type: "button",
|
|
213
|
+
action_id: `${SLACK_BUTTON_ACTION_IDS[target.kind]}:${index}:${choiceIndex + 1}`,
|
|
214
|
+
text: buildSlackPlainText(button.label, 75),
|
|
215
|
+
...target.kind === "link" ? { url: target.url } : { value: target.value },
|
|
216
|
+
...style ? { style } : {}
|
|
217
|
+
}];
|
|
218
|
+
});
|
|
219
|
+
if (requireComplete && (!complete || buttons.length > 25)) return;
|
|
220
|
+
elements = buttons.slice(0, 25);
|
|
221
|
+
} else {
|
|
222
|
+
const placeholder = normalizeOptionalString(block.placeholder) ?? "Choose an option";
|
|
223
|
+
const candidates = block.options.map((option) => {
|
|
224
|
+
if (option.action !== void 0) {
|
|
225
|
+
const action = resolveMessagePresentationOptionAction(option);
|
|
226
|
+
const target = action ? resolveSlackActionTarget(action) : void 0;
|
|
227
|
+
return target && target.kind !== "link" && target.kind !== "question" ? {
|
|
228
|
+
label: option.label,
|
|
229
|
+
...target
|
|
230
|
+
} : void 0;
|
|
231
|
+
}
|
|
232
|
+
const value = normalizeOptionalString(option.value);
|
|
233
|
+
return value ? {
|
|
234
|
+
label: option.label,
|
|
235
|
+
kind: "reply",
|
|
236
|
+
value
|
|
237
|
+
} : void 0;
|
|
238
|
+
});
|
|
239
|
+
if (requireComplete && (placeholder.length > 75 || block.options.length > 100 || block.placeholder && block.placeholder.length > 75 || !candidates.every((option) => option && option.label.length <= 75 && option.value.length <= 150) || new Set(candidates.map((option) => option?.kind)).size !== 1)) return;
|
|
240
|
+
const selectOptions = candidates.flatMap((option) => option && option.value.length <= 150 ? [option] : []).slice(0, 100);
|
|
241
|
+
const optionKinds = new Set(selectOptions.map((option) => option.kind));
|
|
242
|
+
elements = selectOptions.length > 0 && optionKinds.size === 1 ? [{
|
|
243
|
+
type: "static_select",
|
|
244
|
+
action_id: `${SLACK_SELECT_ACTION_IDS[selectOptions[0].kind]}:${index}`,
|
|
245
|
+
placeholder: buildSlackPlainText(placeholder, 75),
|
|
246
|
+
options: selectOptions.map((option) => ({
|
|
247
|
+
text: buildSlackPlainText(option.label, 75),
|
|
248
|
+
value: option.value
|
|
249
|
+
}))
|
|
250
|
+
}] : [];
|
|
251
|
+
}
|
|
180
252
|
if (elements.length > 0) {
|
|
181
253
|
controlIndices[block.type] = index;
|
|
182
254
|
blocks.push({
|
|
@@ -212,94 +284,7 @@ function compileSlackPresentationBlocks(presentation, options, requireComplete)
|
|
|
212
284
|
}
|
|
213
285
|
return blocks;
|
|
214
286
|
}
|
|
215
|
-
|
|
216
|
-
let complete = true;
|
|
217
|
-
const elements = block.buttons.flatMap((button, choiceIndex) => {
|
|
218
|
-
const target = resolveSlackButtonTarget(button, questionOptionIndices);
|
|
219
|
-
if (!target || (target.kind === "link" ? target.url.length > SLACK_BUTTON_URL_MAX : target.value.length > 2e3)) {
|
|
220
|
-
if (requireComplete && !isSlackTextFallbackButton(button)) complete = false;
|
|
221
|
-
return [];
|
|
222
|
-
}
|
|
223
|
-
if (button.label.length > 75) complete = false;
|
|
224
|
-
const style = resolveSlackButtonStyle(button.style);
|
|
225
|
-
return [{
|
|
226
|
-
type: "button",
|
|
227
|
-
action_id: `${SLACK_BUTTON_ACTION_IDS[target.kind]}:${buttonIndex}:${choiceIndex + 1}`,
|
|
228
|
-
text: buildSlackPlainText(button.label, 75),
|
|
229
|
-
...target.kind === "link" ? { url: target.url } : { value: target.value },
|
|
230
|
-
...style ? { style } : {}
|
|
231
|
-
}];
|
|
232
|
-
});
|
|
233
|
-
if (requireComplete && (!complete || elements.length > 25)) return;
|
|
234
|
-
return elements.slice(0, 25);
|
|
235
|
-
}
|
|
236
|
-
/** Admit tables together: one invalid or over-budget table keeps every table on the text path. */
|
|
237
|
-
function buildSlackPresentationTables(presentation, options = {}) {
|
|
238
|
-
const tables = [];
|
|
239
|
-
let cellCharacterCount = options.dataTableCellCharacterCountOffset ?? 0;
|
|
240
|
-
for (const block of presentation.blocks) {
|
|
241
|
-
if (block.type !== "table") continue;
|
|
242
|
-
const table = buildSlackDataTableBlock(block, { cellCharacterCountOffset: cellCharacterCount });
|
|
243
|
-
if (!table) return;
|
|
244
|
-
cellCharacterCount += countSlackDataTableCellCharacters(table);
|
|
245
|
-
tables.push(table);
|
|
246
|
-
}
|
|
247
|
-
return tables;
|
|
248
|
-
}
|
|
249
|
-
function buildSlackPresentationSelectElements(block, selectIndex, requireComplete) {
|
|
250
|
-
const placeholder = normalizeOptionalString(block.placeholder) ?? "Choose an option";
|
|
251
|
-
const candidates = block.options.map((option) => {
|
|
252
|
-
const target = resolveSlackOptionTarget(option);
|
|
253
|
-
return target ? {
|
|
254
|
-
label: option.label,
|
|
255
|
-
...target
|
|
256
|
-
} : void 0;
|
|
257
|
-
});
|
|
258
|
-
if (requireComplete && (placeholder.length > 75 || block.options.length > 100 || block.placeholder && block.placeholder.length > 75 || !candidates.every((option) => option && option.label.length <= 75 && option.value.length <= 150) || new Set(candidates.map((option) => option?.kind)).size !== 1)) return;
|
|
259
|
-
const options = candidates.flatMap((option) => option && option.value.length <= 150 ? [option] : []).slice(0, 100);
|
|
260
|
-
const optionKinds = new Set(options.map((option) => option.kind));
|
|
261
|
-
return options.length > 0 && optionKinds.size === 1 ? [{
|
|
262
|
-
type: "static_select",
|
|
263
|
-
action_id: `${SLACK_SELECT_ACTION_IDS[options[0].kind]}:${selectIndex}`,
|
|
264
|
-
placeholder: buildSlackPlainText(placeholder, 75),
|
|
265
|
-
options: options.map((option) => ({
|
|
266
|
-
text: buildSlackPlainText(option.label, 75),
|
|
267
|
-
value: option.value
|
|
268
|
-
}))
|
|
269
|
-
}] : [];
|
|
270
|
-
}
|
|
271
|
-
//#endregion
|
|
272
|
-
//#region extensions/slack/src/authored-text.ts
|
|
273
|
-
function normalizeComparableSlackText(text) {
|
|
274
|
-
return text.trim().replace(/\s+/g, " ");
|
|
275
|
-
}
|
|
276
|
-
function isSlackAuthoredTextRepresentedInFragments(text, rawFragments) {
|
|
277
|
-
const target = normalizeComparableSlackText(text);
|
|
278
|
-
const fragments = rawFragments.map(normalizeComparableSlackText).filter(Boolean);
|
|
279
|
-
let remainingLength = fragments.reduce((length, fragment) => length + fragment.length + 1, -1);
|
|
280
|
-
for (const [start, firstFragment] of fragments.entries()) {
|
|
281
|
-
if (remainingLength < target.length) break;
|
|
282
|
-
remainingLength -= firstFragment.length + 1;
|
|
283
|
-
let offset = 0;
|
|
284
|
-
for (let end = start;; end += 1) {
|
|
285
|
-
const fragment = fragments[end];
|
|
286
|
-
if (fragment === void 0 || !target.startsWith(fragment, offset)) break;
|
|
287
|
-
offset += fragment.length;
|
|
288
|
-
if (offset === target.length) return true;
|
|
289
|
-
if (target[offset] !== " ") break;
|
|
290
|
-
offset += 1;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
return false;
|
|
294
|
-
}
|
|
295
|
-
/** Resolve placement from producer facts, before accessibility text changes the payload text. */
|
|
296
|
-
function resolveSlackAuthoredTextPlacement(params) {
|
|
297
|
-
const text = normalizeOptionalString(params.text);
|
|
298
|
-
if (!text) return "none";
|
|
299
|
-
return params.renderedInBlocks || isSlackAuthoredTextRepresentedInFragments(text, params.renderedTextFragments ?? []) || isSlackAuthoredTextRepresentedInFragments(text, params.interactive?.blocks.flatMap((block) => block.type === "text" ? [block.text] : []) ?? []) ? "blocks" : "outside-blocks";
|
|
300
|
-
}
|
|
301
|
-
//#endregion
|
|
302
|
-
//#region extensions/slack/src/reply-blocks.ts
|
|
287
|
+
// extensions/slack/src/reply-blocks.ts
|
|
303
288
|
function normalizeSlackReplyPayload(payload) {
|
|
304
289
|
const previousSlackData = asOptionalRecord(payload.channelData?.slack) ?? {};
|
|
305
290
|
const { authoredPresentationText: _authoredPresentationText, ...slackData } = previousSlackData;
|
|
@@ -321,27 +306,6 @@ function normalizeSlackReplyPayload(payload) {
|
|
|
321
306
|
}
|
|
322
307
|
};
|
|
323
308
|
}
|
|
324
|
-
function parseSlackReplyBlockSegments(value) {
|
|
325
|
-
if (value === void 0) return;
|
|
326
|
-
if (!Array.isArray(value)) throw new Error("Slack rendered presentation segments must be an array");
|
|
327
|
-
return value.map((raw) => {
|
|
328
|
-
if (!raw || typeof raw !== "object" || Array.isArray(raw)) throw new Error("Slack rendered presentation segment must be an object");
|
|
329
|
-
const segment = raw;
|
|
330
|
-
if (segment.kind === "text" && typeof segment.text === "string" && segment.mrkdwn === false) return {
|
|
331
|
-
kind: "text",
|
|
332
|
-
text: segment.text,
|
|
333
|
-
mrkdwn: false
|
|
334
|
-
};
|
|
335
|
-
if (segment.kind === "blocks") {
|
|
336
|
-
const blocks = parseSlackBlocksInput(segment.blocks);
|
|
337
|
-
if (blocks?.length) return {
|
|
338
|
-
kind: "blocks",
|
|
339
|
-
blocks
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
throw new Error("Slack rendered presentation segment is invalid");
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
309
|
/** Project each segment only when the caller is ready to deliver it. */
|
|
346
310
|
function* iterateSlackReplyDeliveryMessages(params) {
|
|
347
311
|
let outsideText = params.authoredTextPlacement === "outside-blocks" ? params.text?.trim() ?? "" : "";
|
|
@@ -374,35 +338,35 @@ function* iterateSlackReplyDeliveryMessages(params) {
|
|
|
374
338
|
function resolveSlackReplyDeliveryMessages(params) {
|
|
375
339
|
return Array.from(iterateSlackReplyDeliveryMessages(params));
|
|
376
340
|
}
|
|
377
|
-
function resolveSlackReplyRenderPlan(payload, text = payload.text) {
|
|
378
|
-
return prepareSlackReply(payload).resolvePreview(text);
|
|
341
|
+
function resolveSlackReplyRenderPlan(payload, text = payload.text, options = {}) {
|
|
342
|
+
return prepareSlackReply(payload, options).resolvePreview(text);
|
|
379
343
|
}
|
|
380
344
|
/** One attempt owns its authored compilation; media captions retain a separate delivery policy. */
|
|
381
|
-
function prepareSlackReply(payload) {
|
|
345
|
+
function prepareSlackReply(payload, options = {}) {
|
|
382
346
|
const text = payload.text;
|
|
383
|
-
const source = {
|
|
384
|
-
...payload,
|
|
385
|
-
text
|
|
386
|
-
};
|
|
387
347
|
let authoredChunks;
|
|
388
348
|
let structuredContent;
|
|
389
349
|
let materialized;
|
|
390
350
|
let unmaterialized;
|
|
391
351
|
let preview;
|
|
392
|
-
const resolveAuthoredTextChunks = () => authoredChunks ??= markdownToSlackMrkdwnChunks(text?.trim() ?? "", SLACK_SECTION_TEXT_MAX);
|
|
393
|
-
const hasStructuredContent = () => structuredContent ??= hasSlackReplyStructuredContent(
|
|
394
|
-
const resolve = (materializeAuthoredText) => materializeAuthoredText ? materialized ??= resolveSlackReplyBlockResolution(
|
|
352
|
+
const resolveAuthoredTextChunks = () => authoredChunks ??= markdownToSlackMrkdwnChunks(text?.trim() ?? "", SLACK_SECTION_TEXT_MAX, options);
|
|
353
|
+
const hasStructuredContent = () => structuredContent ??= hasSlackReplyStructuredContent(payload);
|
|
354
|
+
const resolve = (materializeAuthoredText) => materializeAuthoredText ? materialized ??= resolveSlackReplyBlockResolution(payload, {
|
|
355
|
+
...options,
|
|
395
356
|
materializeAuthoredText: true,
|
|
396
357
|
resolveAuthoredTextChunks
|
|
397
|
-
}) : unmaterialized ??= resolveSlackReplyBlockResolution(
|
|
358
|
+
}) : unmaterialized ??= resolveSlackReplyBlockResolution(payload, {
|
|
359
|
+
...options,
|
|
360
|
+
resolveAuthoredTextChunks
|
|
361
|
+
});
|
|
398
362
|
return {
|
|
399
363
|
payload,
|
|
400
|
-
resolveDelivery: () => resolve(!resolveSendableOutboundReplyParts(
|
|
364
|
+
resolveDelivery: () => resolve(!resolveSendableOutboundReplyParts(payload).hasMedia && hasStructuredContent()),
|
|
401
365
|
resolvePreview: (override = text) => {
|
|
402
366
|
if (override !== text) return prepareSlackReply({
|
|
403
|
-
...
|
|
367
|
+
...payload,
|
|
404
368
|
text: override
|
|
405
|
-
}).resolvePreview();
|
|
369
|
+
}, options).resolvePreview();
|
|
406
370
|
return preview ??= projectSlackReplyRenderPlan(text, resolve(hasStructuredContent()), resolveAuthoredTextChunks);
|
|
407
371
|
}
|
|
408
372
|
};
|
|
@@ -452,11 +416,52 @@ function readSlackChannelBlocks(payload) {
|
|
|
452
416
|
function hasSlackReplyStructuredContent(payload) {
|
|
453
417
|
return Boolean(readSlackChannelBlocks(payload).length || normalizeMessagePresentation(payload.presentation) || payload.interactive?.blocks.length);
|
|
454
418
|
}
|
|
419
|
+
function literalSlackComparisonText(text) {
|
|
420
|
+
return /[*_~`]/u.test(text) ? null : escapeSlackMrkdwn(text);
|
|
421
|
+
}
|
|
422
|
+
function renderSlackRichTextComparisonFragments(value) {
|
|
423
|
+
if (!Array.isArray(value)) return [null];
|
|
424
|
+
return value.map((raw) => {
|
|
425
|
+
const section = asOptionalRecord(raw);
|
|
426
|
+
if (section?.type !== "rich_text_section" && section?.type !== "rich_text_preformatted" || !Array.isArray(section.elements)) return null;
|
|
427
|
+
let text = "";
|
|
428
|
+
let style;
|
|
429
|
+
for (const rawElement of section.elements) {
|
|
430
|
+
const element = asOptionalRecord(rawElement);
|
|
431
|
+
if (element?.type !== "text" || typeof element.text !== "string") return null;
|
|
432
|
+
const styles = Object.entries(asOptionalRecord(element.style) ?? {}).filter(([, enabled]) => enabled !== false);
|
|
433
|
+
const nextStyle = styles[0]?.[0] ?? "";
|
|
434
|
+
if (styles.length > 1 || styles.some(([key, enabled]) => enabled !== true || ![
|
|
435
|
+
"bold",
|
|
436
|
+
"italic",
|
|
437
|
+
"strike",
|
|
438
|
+
"code"
|
|
439
|
+
].includes(key)) || style !== void 0 && nextStyle !== style) return null;
|
|
440
|
+
style = nextStyle;
|
|
441
|
+
text += element.text;
|
|
442
|
+
}
|
|
443
|
+
if (section.type === "rich_text_preformatted") return style || text.includes("```") ? null : "```\n" + escapeSlackMrkdwn(text) + (text.endsWith("\n") ? "" : "\n") + "```";
|
|
444
|
+
if (style === "code") return /[`\r\n]/u.test(text) ? null : "`" + escapeSlackMrkdwn(text) + "`";
|
|
445
|
+
const literal = literalSlackComparisonText(text);
|
|
446
|
+
if (!style || literal === null) return literal;
|
|
447
|
+
if (text.trim() !== text) return null;
|
|
448
|
+
const marker = style === "bold" ? "*" : style === "italic" ? "_" : "~";
|
|
449
|
+
return marker + literal + marker;
|
|
450
|
+
});
|
|
451
|
+
}
|
|
455
452
|
function renderSlackAuthoredTextFragments(blocks) {
|
|
453
|
+
const readTextObject = (value) => {
|
|
454
|
+
const record = asOptionalRecord(value);
|
|
455
|
+
const text = normalizeOptionalString(record?.text);
|
|
456
|
+
return text === void 0 ? void 0 : record?.type === "mrkdwn" ? text : literalSlackComparisonText(text);
|
|
457
|
+
};
|
|
456
458
|
return blocks.flatMap((block) => {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
return
|
|
459
|
+
const record = asOptionalRecord(block);
|
|
460
|
+
if (block.type === "actions" || block.type === "divider") return [];
|
|
461
|
+
if (block.type === "section" || block.type === "context" || block.type === "header") return (block.type === "context" ? Array.isArray(record?.elements) ? record.elements : [] : [record?.text, ...Array.isArray(record?.fields) ? record.fields : []]).map(readTextObject).filter((text) => text !== void 0);
|
|
462
|
+
if (block.type === "rich_text") return renderSlackRichTextComparisonFragments(record?.elements);
|
|
463
|
+
const text = renderSlackBlockFallbackText(block);
|
|
464
|
+
return text ? [/[*_~`]/u.test(text) ? null : text] : [];
|
|
460
465
|
});
|
|
461
466
|
}
|
|
462
467
|
function buildSlackAuthoredTextBlocks(chunks) {
|
|
@@ -501,8 +506,7 @@ function appendTextSegment(segments, text) {
|
|
|
501
506
|
}
|
|
502
507
|
segments.push({
|
|
503
508
|
kind: "text",
|
|
504
|
-
text: trimmed
|
|
505
|
-
mrkdwn: false
|
|
509
|
+
text: trimmed
|
|
506
510
|
});
|
|
507
511
|
}
|
|
508
512
|
function appendBlockSegment(segments, blocks, startNew = false) {
|
|
@@ -570,37 +574,10 @@ function subtractMirroredSlackControlRows(params) {
|
|
|
570
574
|
return false;
|
|
571
575
|
});
|
|
572
576
|
}
|
|
573
|
-
|
|
574
|
-
* Resolve reply content into transport-order segments. Each blocks segment is
|
|
575
|
-
* one Slack message; text segments carry complete fallback content between it.
|
|
576
|
-
*/
|
|
577
|
-
function resolveSlackReplyBlockResolution(payload, options = {}) {
|
|
577
|
+
function compileSlackReplyBlockSegments(payload, channelBlocks, presentation) {
|
|
578
578
|
const segments = [];
|
|
579
|
-
const presentation = normalizeMessagePresentation(payload.presentation);
|
|
580
579
|
const textIsFallback = presentation && payload.presentationTextMode === "fallback";
|
|
581
|
-
|
|
582
|
-
const channelBlocks = readSlackChannelBlocks(payload);
|
|
583
|
-
let compiledChannelBlocks = channelBlocks;
|
|
584
|
-
let authoredTextKnownInBlocks = false;
|
|
585
|
-
if (options.materializeAuthoredText) {
|
|
586
|
-
const rawTextFragments = renderSlackAuthoredTextFragments(channelBlocks);
|
|
587
|
-
const initialPlacement = resolveSlackAuthoredTextPlacement({
|
|
588
|
-
text: authoredText,
|
|
589
|
-
interactive: payload.interactive,
|
|
590
|
-
renderedTextFragments: rawTextFragments
|
|
591
|
-
});
|
|
592
|
-
authoredTextKnownInBlocks = initialPlacement === "blocks";
|
|
593
|
-
const text = normalizeOptionalString(authoredText);
|
|
594
|
-
if (text && initialPlacement === "outside-blocks") {
|
|
595
|
-
const textBlocks = buildSlackAuthoredTextBlocks(options.resolveAuthoredTextChunks?.() ?? markdownToSlackMrkdwnChunks(text, 3e3));
|
|
596
|
-
if (resolveSlackAuthoredTextPlacement({
|
|
597
|
-
text: renderSlackAuthoredTextFragments(textBlocks).join(" "),
|
|
598
|
-
renderedTextFragments: rawTextFragments
|
|
599
|
-
}) !== "blocks") compiledChannelBlocks = [...channelBlocks, ...textBlocks];
|
|
600
|
-
authoredTextKnownInBlocks = true;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
if (compiledChannelBlocks.length > 0) appendBlockSegment(segments, compiledChannelBlocks);
|
|
580
|
+
if (channelBlocks.length > 0) appendBlockSegment(segments, channelBlocks);
|
|
604
581
|
const questionOptionIndices = resolveAskUserQuestionOptionIndices(payload);
|
|
605
582
|
const presentationBlockOffset = readAllNativeBlocks(segments).length;
|
|
606
583
|
if (presentation?.title) appendPresentationPart(segments, {
|
|
@@ -621,31 +598,46 @@ function resolveSlackReplyBlockResolution(payload, options = {}) {
|
|
|
621
598
|
"rich_text"
|
|
622
599
|
].includes(block.type) && !("accessory" in block && block.accessory))) {
|
|
623
600
|
segments.length = 0;
|
|
624
|
-
appendBlockSegment(segments,
|
|
601
|
+
appendBlockSegment(segments, channelBlocks);
|
|
625
602
|
appendTextSegment(segments, payload.text);
|
|
626
603
|
}
|
|
627
604
|
appendBlockSegment(segments, subtractMirroredSlackControlRows({
|
|
628
605
|
interactiveBlocks,
|
|
629
606
|
presentationBlocks: renderedPresentationBlocks
|
|
630
607
|
}));
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
608
|
+
return segments;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Resolve reply content into transport-order segments. Each blocks segment is
|
|
612
|
+
* one Slack message; text segments carry complete fallback content between it.
|
|
613
|
+
*/
|
|
614
|
+
function resolveSlackReplyBlockResolution(payload, options = {}) {
|
|
615
|
+
const presentation = normalizeMessagePresentation(payload.presentation);
|
|
616
|
+
const authoredText = presentation && payload.presentationTextMode === "fallback" ? void 0 : normalizeOptionalString(payload.text);
|
|
617
|
+
const channelBlocks = readSlackChannelBlocks(payload);
|
|
618
|
+
let segments = compileSlackReplyBlockSegments(payload, channelBlocks, presentation);
|
|
619
|
+
const chunks = authoredText && (segments.length > 0 || options.materializeAuthoredText) ? options.resolveAuthoredTextChunks?.() ?? markdownToSlackMrkdwnChunks(authoredText, 3e3, options) : [];
|
|
620
|
+
let authoredTextPlacement = resolveSlackAuthoredTextPlacement({
|
|
621
|
+
text: authoredText,
|
|
622
|
+
authoredChunks: chunks,
|
|
623
|
+
renderedTextFragments: segments.flatMap((segment) => segment.kind === "text" ? [literalSlackComparisonText(segment.text)] : renderSlackAuthoredTextFragments(segment.blocks))
|
|
634
624
|
});
|
|
635
|
-
|
|
625
|
+
if (authoredTextPlacement === "outside-blocks" && !/[*_~`<[\]\\#>|]/u.test(authoredText ?? "")) authoredTextPlacement = resolveSlackAuthoredTextPlacement({
|
|
636
626
|
text: authoredText,
|
|
637
|
-
|
|
638
|
-
renderedTextFragments
|
|
627
|
+
renderedTextFragments: segments.flatMap((segment) => segment.kind === "text" ? [segment.text] : segment.blocks.map((block) => hasSlackNativeDataBlock([block]) ? renderSlackBlockFallbackText(block, { nativeDataFormat: "plain" }) ?? null : null))
|
|
639
628
|
});
|
|
629
|
+
if (options.materializeAuthoredText && authoredTextPlacement === "outside-blocks") {
|
|
630
|
+
segments = compileSlackReplyBlockSegments(payload, [...channelBlocks, ...buildSlackAuthoredTextBlocks(chunks)], presentation);
|
|
631
|
+
authoredTextPlacement = "blocks";
|
|
632
|
+
}
|
|
640
633
|
return {
|
|
641
|
-
authoredTextPlacement
|
|
634
|
+
authoredTextPlacement,
|
|
642
635
|
segments
|
|
643
636
|
};
|
|
644
637
|
}
|
|
645
638
|
/** Return the single-message native shape when no ordered text fallback is required. */
|
|
646
639
|
function resolveSlackReplyBlocks(payload) {
|
|
647
|
-
const
|
|
640
|
+
const segments = compileSlackReplyBlockSegments(payload, readSlackChannelBlocks(payload), normalizeMessagePresentation(payload.presentation));
|
|
648
641
|
return segments.length === 1 && segments[0]?.kind === "blocks" ? segments[0].blocks : void 0;
|
|
649
642
|
}
|
|
650
|
-
|
|
651
|
-
export { prepareSlackReply as a, resolveSlackReplyDeliveryMessages as c, buildSlackInteractiveBlocks as d, buildSlackPresentationBlocks as f, parseSlackReplyBlockSegments as i, resolveSlackReplyRenderPlan as l, iterateSlackReplyDeliveryMessages as n, resolveSlackReplyBlockResolution as o, buildSlackPresentationBlocksIfComplete as p, normalizeSlackReplyPayload as r, resolveSlackReplyBlocks as s, hasSlackReplyStructuredContent as t, resolveSlackAuthoredTextPlacement as u };
|
|
643
|
+
export { resolveSlackReplyBlockResolution as a, resolveSlackReplyRenderPlan as c, resolveSlackAuthoredTextPlacement as d, prepareSlackReply as i, buildSlackInteractiveBlocks as l, iterateSlackReplyDeliveryMessages as n, resolveSlackReplyBlocks as o, normalizeSlackReplyPayload as r, resolveSlackReplyDeliveryMessages as s, hasSlackReplyStructuredContent as t, buildSlackPresentationBlocks as u };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-DwYAP3ts.mjs";
|
|
3
|
+
import { n as fetchSlackChannelListPage, r as createSlackLookupClient, t as collectSlackCursorPages } from "./cursor-pages-jVn3Vkfi.mjs";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
|
|
5
|
+
// extensions/slack/src/resolve-channels.ts
|
|
6
6
|
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveSlackChannelAllowlist: () => resolveSlackChannelAllowlist });
|
|
7
7
|
function parseSlackChannelMention(raw) {
|
|
8
8
|
const trimmed = raw.trim();
|
|
9
|
-
if (!trimmed) return {};
|
|
10
9
|
const mention = trimmed.match(/^<#([A-Z0-9]+)(?:\|([^>]+))?>$/i);
|
|
11
10
|
if (mention) return {
|
|
12
11
|
id: mention[1]?.toUpperCase(),
|
|
@@ -14,7 +13,7 @@ function parseSlackChannelMention(raw) {
|
|
|
14
13
|
};
|
|
15
14
|
const prefixed = trimmed.replace(/^(slack:|channel:)/i, "");
|
|
16
15
|
if (/^[CG][A-Z0-9]{8,}$/i.test(prefixed)) return { id: prefixed.toUpperCase() };
|
|
17
|
-
const name = prefixed.replace(/^#/, "")
|
|
16
|
+
const name = normalizeLowercaseStringOrEmpty(prefixed.replace(/^#/, ""));
|
|
18
17
|
return name ? { name } : {};
|
|
19
18
|
}
|
|
20
19
|
async function listSlackChannels(client) {
|
|
@@ -34,9 +33,7 @@ async function listSlackChannels(client) {
|
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
35
|
function resolveByName(name, channels) {
|
|
37
|
-
const
|
|
38
|
-
if (!target) return;
|
|
39
|
-
const matches = channels.filter((channel) => normalizeLowercaseStringOrEmpty(channel.name) === target);
|
|
36
|
+
const matches = channels.filter((channel) => normalizeLowercaseStringOrEmpty(channel.name) === name);
|
|
40
37
|
return matches.find((channel) => !channel.archived) ?? matches[0];
|
|
41
38
|
}
|
|
42
39
|
async function resolveSlackChannelAllowlist(params) {
|
|
@@ -67,5 +64,4 @@ async function resolveSlackChannelAllowlist(params) {
|
|
|
67
64
|
};
|
|
68
65
|
});
|
|
69
66
|
}
|
|
70
|
-
//#endregion
|
|
71
67
|
export { resolve_channels_exports as n, resolveSlackChannelAllowlist as t };
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-
|
|
3
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { s as resolveWorkspaceQualifiedSlackTarget } from "./target-parsing-DwYAP3ts.mjs";
|
|
3
|
+
import { r as createSlackLookupClient, t as collectSlackCursorPages } from "./cursor-pages-jVn3Vkfi.mjs";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
|
|
5
|
+
// extensions/slack/src/resolve-users.ts
|
|
6
6
|
var resolve_users_exports = /* @__PURE__ */ __exportAll({ resolveSlackUserAllowlist: () => resolveSlackUserAllowlist });
|
|
7
7
|
function parseSlackUserInput(raw) {
|
|
8
8
|
const trimmed = raw.trim();
|
|
9
|
-
if (!trimmed) return {};
|
|
10
9
|
const mention = trimmed.match(/^<@([A-Z0-9]+)>$/i);
|
|
11
10
|
if (mention) return { id: mention[1]?.toUpperCase() };
|
|
12
11
|
const prefixed = trimmed.replace(/^(slack:|user:)/i, "");
|
|
13
12
|
if (/^[A-Z][A-Z0-9]+$/i.test(prefixed)) return { id: prefixed.toUpperCase() };
|
|
14
13
|
if (trimmed.includes("@") && !trimmed.startsWith("@")) return { email: normalizeLowercaseStringOrEmpty(trimmed) };
|
|
15
|
-
const name = trimmed.replace(/^@/, "")
|
|
14
|
+
const name = normalizeLowercaseStringOrEmpty(trimmed.replace(/^@/, ""));
|
|
16
15
|
return name ? { name } : {};
|
|
17
16
|
}
|
|
18
17
|
async function listSlackUsers(client) {
|
|
@@ -39,17 +38,6 @@ async function listSlackUsers(client) {
|
|
|
39
38
|
}).filter((user) => user !== null)
|
|
40
39
|
});
|
|
41
40
|
}
|
|
42
|
-
function matchesSlackUserName(user, name) {
|
|
43
|
-
const target = normalizeLowercaseStringOrEmpty(name);
|
|
44
|
-
return [
|
|
45
|
-
user.name,
|
|
46
|
-
user.displayName,
|
|
47
|
-
user.realName
|
|
48
|
-
].some((value) => {
|
|
49
|
-
const candidate = normalizeLowercaseStringOrEmpty(value);
|
|
50
|
-
return Boolean(candidate) && candidate === target;
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
41
|
function scoreSlackUser(user) {
|
|
54
42
|
return (user.deleted ? 0 : 3) + (user.isBot || user.isAppUser ? 0 : 2);
|
|
55
43
|
}
|
|
@@ -62,7 +50,11 @@ async function resolveSlackUserAllowlist(params) {
|
|
|
62
50
|
const users = entries.some(({ workspace }) => !workspace) ? await listSlackUsers(params.client ?? createSlackLookupClient(params.token)) : [];
|
|
63
51
|
return entries.map(({ input, workspace, parsed }) => {
|
|
64
52
|
if (workspace) return workspace;
|
|
65
|
-
const matches = users.filter((user) => parsed.id ? user.id === parsed.id : parsed.email ? user.email === parsed.email : parsed.name ?
|
|
53
|
+
const matches = users.filter((user) => parsed.id ? user.id === parsed.id : parsed.email ? user.email === parsed.email : parsed.name ? [
|
|
54
|
+
user.name,
|
|
55
|
+
user.displayName,
|
|
56
|
+
user.realName
|
|
57
|
+
].some((value) => normalizeLowercaseStringOrEmpty(value) === parsed.name) : false);
|
|
66
58
|
const match = parsed.id ? matches[0] : matches.toSorted((a, b) => scoreSlackUser(b) - scoreSlackUser(a))[0];
|
|
67
59
|
if (!parsed.id && !match) return {
|
|
68
60
|
input,
|
|
@@ -81,5 +73,4 @@ async function resolveSlackUserAllowlist(params) {
|
|
|
81
73
|
return result;
|
|
82
74
|
});
|
|
83
75
|
}
|
|
84
|
-
//#endregion
|
|
85
76
|
export { resolve_users_exports as n, resolveSlackUserAllowlist as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -24,5 +24,4 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
24
|
return to;
|
|
25
25
|
};
|
|
26
26
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
27
|
-
//#endregion
|
|
28
27
|
export { __reExport as n, __exportAll as t };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
|
2
|
-
|
|
2
|
+
// extensions/slack/src/runtime.ts
|
|
3
3
|
const { setRuntime: setSlackRuntime, tryGetRuntime: getOptionalSlackRuntime, getRuntime: getSlackRuntime } = createPluginRuntimeStore({
|
|
4
4
|
pluginId: "slack",
|
|
5
5
|
errorMessage: "Slack runtime not initialized"
|
|
6
6
|
});
|
|
7
|
-
//#endregion
|
|
8
7
|
export { getSlackRuntime as n, setSlackRuntime as r, getOptionalSlackRuntime as t };
|