@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,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/slack/src/channel-meta.ts
|
|
2
2
|
const SLACK_CHANNEL_META = {
|
|
3
3
|
id: "slack",
|
|
4
4
|
label: "Slack",
|
|
@@ -23,5 +23,4 @@ const DEFAULT_SLACK_SUGGESTED_PROMPTS = [
|
|
|
23
23
|
message: "Help me draft a reply."
|
|
24
24
|
}
|
|
25
25
|
];
|
|
26
|
-
//#endregion
|
|
27
26
|
export { SLACK_CHANNEL_META as n, DEFAULT_SLACK_SUGGESTED_PROMPTS as t };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { f as resolveSlackOperationToken, s as resolveSlackAccount } from "./accounts-EaPP0fFY.mjs";
|
|
3
|
+
import { S as assertSlackDetachedTargetAllowed } from "./probe-B_Ax1vS1.mjs";
|
|
4
|
+
import { i as createSlackReadClient, o as createSlackTokenCacheKey, p as readLruMapEntry, s as createSlackWebClient } from "./cursor-pages-jVn3Vkfi.mjs";
|
|
5
5
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { normalizeStringEntriesLower } from "openclaw/plugin-sdk/string-normalization-runtime";
|
|
7
7
|
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
8
|
-
|
|
9
|
-
//#region extensions/slack/src/channel-type.ts
|
|
8
|
+
// extensions/slack/src/channel-type.ts
|
|
10
9
|
var channel_type_exports = /* @__PURE__ */ __exportAll({
|
|
11
10
|
resolveSlackChannelType: () => resolveSlackChannelType,
|
|
12
11
|
resolveSlackConversationInfo: () => resolveSlackConversationInfo
|
|
@@ -18,9 +17,6 @@ function setCachedSlackConversationInfo(cacheKey, conversationInfo) {
|
|
|
18
17
|
SLACK_CONVERSATION_INFO_CACHE.set(cacheKey, conversationInfo);
|
|
19
18
|
pruneMapToMaxSize(SLACK_CONVERSATION_INFO_CACHE, SLACK_CONVERSATION_INFO_CACHE_MAX_ENTRIES);
|
|
20
19
|
}
|
|
21
|
-
function fingerprintSlackCredential(token) {
|
|
22
|
-
return createHash("sha256").update(token).digest("hex");
|
|
23
|
-
}
|
|
24
20
|
function resolveConfiguredSlackConversationInfo(params) {
|
|
25
21
|
if (/^D/i.test(params.channelId)) return { type: "dm" };
|
|
26
22
|
const channelIdLower = normalizeLowercaseStringOrEmpty(params.channelId);
|
|
@@ -43,7 +39,7 @@ async function resolveSlackConversationInfo(params) {
|
|
|
43
39
|
const token = resolveSlackOperationToken(account, operation);
|
|
44
40
|
const userToken = normalizeOptionalString(account.userToken);
|
|
45
41
|
const credentialRole = token ? token === userToken ? "user" : "bot" : "none";
|
|
46
|
-
const credentialFingerprint = token ?
|
|
42
|
+
const credentialFingerprint = token ? createSlackTokenCacheKey(token) : "none";
|
|
47
43
|
const teamId = normalizeLowercaseStringOrEmpty(params.teamId) || "no-team-id";
|
|
48
44
|
const cacheKey = `${account.accountId}:${teamId}:${operation}:${credentialRole}:${credentialFingerprint}:${channelId}`;
|
|
49
45
|
if (!params.requireFreshName) {
|
|
@@ -94,5 +90,4 @@ async function resolveSlackConversationInfo(params) {
|
|
|
94
90
|
async function resolveSlackChannelType(params) {
|
|
95
91
|
return (await resolveSlackConversationInfo(params)).type;
|
|
96
92
|
}
|
|
97
|
-
//#endregion
|
|
98
93
|
export { resolveSlackChannelType as n, resolveSlackConversationInfo as r, channel_type_exports as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as isSlackSetupAccountConfigured } from "./account-configured-
|
|
2
|
-
import { i as listSlackAccountIds, o as resolveDefaultSlackAccountId, s as resolveSlackAccount, u as resolveSlackConfigAccessorAccount } from "./accounts-
|
|
3
|
-
import { t as inspectSlackAccount } from "./account-inspect-
|
|
4
|
-
import { t as DEFAULT_SLACK_SUGGESTED_PROMPTS } from "./channel-meta-
|
|
5
|
-
import { t as SlackChannelConfigSchema } from "./config-schema-
|
|
1
|
+
import { i as isSlackSetupAccountConfigured } from "./account-configured-35y0-Hso.mjs";
|
|
2
|
+
import { i as listSlackAccountIds, o as resolveDefaultSlackAccountId, s as resolveSlackAccount, u as resolveSlackConfigAccessorAccount } from "./accounts-EaPP0fFY.mjs";
|
|
3
|
+
import { t as inspectSlackAccount } from "./account-inspect-DgQgj0wk.mjs";
|
|
4
|
+
import { t as DEFAULT_SLACK_SUGGESTED_PROMPTS } from "./channel-meta-C5vsCo3a.mjs";
|
|
5
|
+
import { t as SlackChannelConfigSchema } from "./config-schema-Bx1tCZB0.mjs";
|
|
6
6
|
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
|
@@ -13,7 +13,7 @@ import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
|
|
|
13
13
|
import { createChannelDmPolicy } from "openclaw/plugin-sdk/channel-dm-policy";
|
|
14
14
|
import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
|
|
15
15
|
import { patchTopLevelChannelConfigSection } from "openclaw/plugin-sdk/setup";
|
|
16
|
-
|
|
16
|
+
// extensions/slack/src/setup-shared.ts
|
|
17
17
|
const SLACK_CHANNEL = "slack";
|
|
18
18
|
function buildSlackAllowFromPrompt() {
|
|
19
19
|
const t = createSetupTranslator();
|
|
@@ -39,16 +39,15 @@ function buildSlackAllowFromPrompt() {
|
|
|
39
39
|
})
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function buildSlackManifest(
|
|
43
|
-
|
|
44
|
-
const manifest = {
|
|
42
|
+
function buildSlackManifest() {
|
|
43
|
+
return JSON.stringify({
|
|
45
44
|
display_information: {
|
|
46
|
-
name:
|
|
47
|
-
description:
|
|
45
|
+
name: "OpenClaw",
|
|
46
|
+
description: "OpenClaw app for OpenClaw"
|
|
48
47
|
},
|
|
49
48
|
features: {
|
|
50
49
|
bot_user: {
|
|
51
|
-
display_name:
|
|
50
|
+
display_name: "OpenClaw",
|
|
52
51
|
always_online: true
|
|
53
52
|
},
|
|
54
53
|
app_home: {
|
|
@@ -57,7 +56,7 @@ function buildSlackManifest(botName = "OpenClaw") {
|
|
|
57
56
|
messages_tab_read_only_enabled: false
|
|
58
57
|
},
|
|
59
58
|
agent_view: {
|
|
60
|
-
agent_description:
|
|
59
|
+
agent_description: "OpenClaw connects Slack Agent View conversations to OpenClaw agents.",
|
|
61
60
|
suggested_prompts: DEFAULT_SLACK_SUGGESTED_PROMPTS
|
|
62
61
|
},
|
|
63
62
|
slash_commands: [{
|
|
@@ -70,7 +69,9 @@ function buildSlackManifest(botName = "OpenClaw") {
|
|
|
70
69
|
"app_mentions:read",
|
|
71
70
|
"assistant:write",
|
|
72
71
|
"channels:history",
|
|
72
|
+
"channels:manage",
|
|
73
73
|
"channels:read",
|
|
74
|
+
"channels:write.invites",
|
|
74
75
|
"chat:write",
|
|
75
76
|
"commands",
|
|
76
77
|
"emoji:read",
|
|
@@ -112,8 +113,7 @@ function buildSlackManifest(botName = "OpenClaw") {
|
|
|
112
113
|
"reaction_removed"
|
|
113
114
|
] }
|
|
114
115
|
}
|
|
115
|
-
};
|
|
116
|
-
return JSON.stringify(manifest, null, 2);
|
|
116
|
+
}, null, 2);
|
|
117
117
|
}
|
|
118
118
|
function buildSlackSetupLines() {
|
|
119
119
|
return [
|
|
@@ -150,8 +150,7 @@ function describeSlackSetupAccount(account) {
|
|
|
150
150
|
}
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
|
-
|
|
154
|
-
//#region extensions/slack/src/config-adapter.ts
|
|
153
|
+
// extensions/slack/src/config-adapter.ts
|
|
155
154
|
const slackBaseConfigAdapter = createScopedChannelConfigAdapter({
|
|
156
155
|
sectionKey: SLACK_CHANNEL,
|
|
157
156
|
listAccountIds: listSlackAccountIds,
|
|
@@ -169,8 +168,7 @@ const slackBaseConfigAdapter = createScopedChannelConfigAdapter({
|
|
|
169
168
|
formatAllowFrom: (allowFrom) => formatAllowFromLowercase({ allowFrom }),
|
|
170
169
|
resolveDefaultTo: (account) => account.defaultTo
|
|
171
170
|
});
|
|
172
|
-
|
|
173
|
-
//#region extensions/slack/src/setup-core.ts
|
|
171
|
+
// extensions/slack/src/setup-core.ts
|
|
174
172
|
const t = createSetupTranslator();
|
|
175
173
|
function enableSlackAccount(cfg, accountId) {
|
|
176
174
|
return patchChannelConfigForAccount({
|
|
@@ -534,8 +532,7 @@ function createSlackSetupWizardProxy(loadWizard) {
|
|
|
534
532
|
fallbackResolvedGroupAllowlist: (entries) => entries
|
|
535
533
|
});
|
|
536
534
|
}
|
|
537
|
-
|
|
538
|
-
//#region extensions/slack/src/channel.setup.ts
|
|
535
|
+
// extensions/slack/src/channel.setup.ts
|
|
539
536
|
const slackSetupPlugin = {
|
|
540
537
|
id: SLACK_CHANNEL,
|
|
541
538
|
meta: {
|
|
@@ -550,7 +547,7 @@ const slackSetupPlugin = {
|
|
|
550
547
|
markdownCapable: true,
|
|
551
548
|
preferSessionLookupForAnnounceTarget: true
|
|
552
549
|
},
|
|
553
|
-
setupWizard: createSlackSetupWizardProxy(() => import("./setup-surface-
|
|
550
|
+
setupWizard: createSlackSetupWizardProxy(() => import("./setup-surface-uIqP2B0Y.mjs")),
|
|
554
551
|
capabilities: {
|
|
555
552
|
chatTypes: [
|
|
556
553
|
"direct",
|
|
@@ -628,5 +625,4 @@ const slackSetupPlugin = {
|
|
|
628
625
|
},
|
|
629
626
|
setupContract: slackSetupContract
|
|
630
627
|
};
|
|
631
|
-
//#endregion
|
|
632
628
|
export { buildSlackAllowFromPrompt as a, SLACK_CHANNEL as i, createSlackSetupWizardBase as n, slackBaseConfigAdapter as r, slackSetupPlugin as t };
|
|
@@ -2,7 +2,7 @@ import { buildSecretInputSchema, hasConfiguredSecretInput } from "openclaw/plugi
|
|
|
2
2
|
import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
|
|
3
3
|
import { ChannelBotLoopProtectionSchema, ChannelDangerouslyAllowNameMatchingSchema, ChannelImplicitMentionsSchema, ChannelPreviewStreamingConfigSchema, ChannelStreamingProgressSchema, ProviderCommandsSchema, ReplyToModeSchema, buildChannelAccountSchemaParts, buildChannelAllowBotsSchema, buildChannelConfigSchema, buildChannelExecApprovalsSchema, buildChannelReactionShape, buildGroupEntrySchema, refineChannelDmPolicy } from "openclaw/plugin-sdk/channel-config-schema";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
|
|
5
|
+
// extensions/slack/src/config-ui-hints.ts
|
|
6
6
|
const observedGroupHistoryHint = { help: "Automatic observed-message context uses a default of 50 and a maximum of 200 messages; 0 disables automatic injection. The JSON integer maximum selects the 50-message default. Session transcript trimming separately counts user turns, where 0 means no trimming. The observed-message cap does not rewrite saved values." };
|
|
7
7
|
const observedDmHistoryHint = { help: "Automatic observed-DM context uses a default of 0 and a maximum of 200 messages; 0 disables that extra context. The JSON integer maximum selects the 0-message default. Session transcript trimming separately counts user turns, where 0 means no trimming. The observed-message cap does not rewrite saved values." };
|
|
8
8
|
const botThreadMentionHint = {
|
|
@@ -174,8 +174,7 @@ const slackChannelConfigUiHints = {
|
|
|
174
174
|
help: "Maximum number of existing Slack thread messages to fetch when starting a new thread session (default: 20, set to 0 to disable)."
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
|
-
|
|
178
|
-
//#region extensions/slack/src/config-schema.ts
|
|
177
|
+
// extensions/slack/src/config-schema.ts
|
|
179
178
|
const SecretInputSchema = buildSecretInputSchema();
|
|
180
179
|
const SLACK_PRESENCE_EVENT_PROMPT_MAX_CHARS = 2e4;
|
|
181
180
|
const SlackStreamingProgressSchema = ChannelStreamingProgressSchema.extend({
|
|
@@ -186,11 +185,6 @@ const SlackStreamingConfigSchema = ChannelPreviewStreamingConfigSchema.extend({
|
|
|
186
185
|
nativeTransport: z.boolean().optional(),
|
|
187
186
|
progress: SlackStreamingProgressSchema.optional()
|
|
188
187
|
}).strict();
|
|
189
|
-
const SlackDmSchema = z.object({
|
|
190
|
-
enabled: z.boolean().optional(),
|
|
191
|
-
groupEnabled: z.boolean().optional(),
|
|
192
|
-
groupChannels: z.array(z.union([z.string(), z.number()])).optional()
|
|
193
|
-
}).strict();
|
|
194
188
|
const SlackPresenceEventsSchema = z.object({
|
|
195
189
|
mode: z.enum([
|
|
196
190
|
"off",
|
|
@@ -224,7 +218,7 @@ const SlackRelaySchema = z.object({
|
|
|
224
218
|
gatewayId: z.string().optional()
|
|
225
219
|
}).strict();
|
|
226
220
|
const SlackIdentitySchema = z.enum(["bot", "user"]);
|
|
227
|
-
const { accountShape, rootPolicyShape } = buildChannelAccountSchemaParts({
|
|
221
|
+
const { accountShape, rootPolicyShape, groupDmShape } = buildChannelAccountSchemaParts({
|
|
228
222
|
omit: ["groupAllowFrom"],
|
|
229
223
|
streaming: SlackStreamingConfigSchema.optional()
|
|
230
224
|
});
|
|
@@ -270,6 +264,7 @@ const SlackAccountSchema = z.object({
|
|
|
270
264
|
actions: z.object({
|
|
271
265
|
reactions: z.boolean().optional(),
|
|
272
266
|
messages: z.boolean().optional(),
|
|
267
|
+
channels: z.boolean().optional(),
|
|
273
268
|
pins: z.boolean().optional(),
|
|
274
269
|
search: z.boolean().optional(),
|
|
275
270
|
permissions: z.boolean().optional(),
|
|
@@ -283,7 +278,7 @@ const SlackAccountSchema = z.object({
|
|
|
283
278
|
sessionPrefix: z.string().optional(),
|
|
284
279
|
ephemeral: z.boolean().optional()
|
|
285
280
|
}).strict().optional(),
|
|
286
|
-
dm:
|
|
281
|
+
dm: z.strictObject(groupDmShape).optional(),
|
|
287
282
|
channels: z.record(z.string(), SlackChannelSchema.optional()).optional(),
|
|
288
283
|
typingReaction: z.string().optional()
|
|
289
284
|
}).strict();
|
|
@@ -374,5 +369,4 @@ const SlackConfigSchema = SlackAccountSchema.safeExtend({
|
|
|
374
369
|
validateSlackSigningSecretRequirements(value, ctx);
|
|
375
370
|
});
|
|
376
371
|
const SlackChannelConfigSchema = buildChannelConfigSchema(SlackConfigSchema, { uiHints: slackChannelConfigUiHints });
|
|
377
|
-
//#endregion
|
|
378
372
|
export { SlackChannelConfigSchema as t };
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
3
|
+
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
4
|
+
import { hash } from "node:crypto";
|
|
5
|
+
import { WebAPIRateLimitedError, WebClient } from "@slack/web-api";
|
|
6
|
+
import { addActiveManagedProxyTlsOptions, captureChannelReadAuthority, createHttp1EnvHttpProxyAgent, resolveEnvHttpProxyAgentOptions, resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
|
|
7
|
+
import { isDebugProxyGlobalFetchPatchInstalled } from "openclaw/plugin-sdk/proxy-capture";
|
|
8
|
+
import { parseRetryAfterHeaderSeconds, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
9
|
+
import { fetchWithRuntimeDispatcher } from "openclaw/plugin-sdk/runtime-fetch";
|
|
10
|
+
// extensions/slack/src/client-options.ts
|
|
11
|
+
const SLACK_DEFAULT_RETRY_OPTIONS = {
|
|
12
|
+
retries: 2,
|
|
13
|
+
factor: 2,
|
|
14
|
+
minTimeout: 500,
|
|
15
|
+
maxTimeout: 3e3,
|
|
16
|
+
randomize: true
|
|
17
|
+
};
|
|
18
|
+
const SLACK_WRITE_RETRY_OPTIONS = { retries: 0 };
|
|
19
|
+
const SLACK_READ_TIMEOUT_MS = 3e4;
|
|
20
|
+
const SLACK_LOOKUP_RETRY_OPTIONS = { retries: 0 };
|
|
21
|
+
function normalizeSlackFetchInit(init) {
|
|
22
|
+
if (init?.body !== "") return init;
|
|
23
|
+
const { body: _body, ...rest } = init;
|
|
24
|
+
return rest;
|
|
25
|
+
}
|
|
26
|
+
function resolveSlackProxyDispatcher() {
|
|
27
|
+
const options = resolveEnvHttpProxyAgentOptions();
|
|
28
|
+
if (!options) return;
|
|
29
|
+
try {
|
|
30
|
+
return createHttp1EnvHttpProxyAgent(options, void 0, process.env);
|
|
31
|
+
} catch {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
let slackSocketModeUndici;
|
|
36
|
+
/**
|
|
37
|
+
* Load the undici copy that @slack/socket-mode opens its WebSocket with.
|
|
38
|
+
*
|
|
39
|
+
* Socket Mode 3 calls `new undici.WebSocket(url, { dispatcher })` with its own
|
|
40
|
+
* undici. A dispatcher from another undici copy fails the handshake, so we must
|
|
41
|
+
* identify whether Socket Mode can share the runtime dispatcher. The explicit
|
|
42
|
+
* `undici/index.js` subpath keeps Bun's bare-`undici` placeholder out of the
|
|
43
|
+
* dispatcher (the same reason the runtime loads undici this way); under Bun,
|
|
44
|
+
* Socket Mode's bare import gets Bun's WebSocket, which does not consult a
|
|
45
|
+
* dispatcher at all.
|
|
46
|
+
*/
|
|
47
|
+
function loadSlackSocketModeUndici() {
|
|
48
|
+
if (slackSocketModeUndici) return slackSocketModeUndici;
|
|
49
|
+
const requireFromPlugin = createRequire(import.meta.url);
|
|
50
|
+
const requireFromBolt = createRequire(requireFromPlugin.resolve("@slack/bolt/package.json"));
|
|
51
|
+
slackSocketModeUndici = createRequire(requireFromBolt.resolve("@slack/socket-mode/package.json"))("undici/index.js");
|
|
52
|
+
return slackSocketModeUndici;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Build the env-proxy dispatcher for Socket Mode's WebSocket.
|
|
56
|
+
*
|
|
57
|
+
* Reuse the Web API dispatcher when both transports load the same undici copy;
|
|
58
|
+
* its custom proxy routing supports Socket Mode's CONNECT handshake. Otherwise
|
|
59
|
+
* build one from Socket Mode's copy. Without a proxy env, preserve the default
|
|
60
|
+
* direct connection.
|
|
61
|
+
*/
|
|
62
|
+
function resolveSlackSocketModeDispatcher(webApi) {
|
|
63
|
+
const options = resolveEnvHttpProxyAgentOptions();
|
|
64
|
+
if (!options) return;
|
|
65
|
+
const { EnvHttpProxyAgent } = loadSlackSocketModeUndici();
|
|
66
|
+
if (webApi instanceof EnvHttpProxyAgent) return webApi;
|
|
67
|
+
const agentOptions = addActiveManagedProxyTlsOptions(options);
|
|
68
|
+
try {
|
|
69
|
+
return new EnvHttpProxyAgent(agentOptions);
|
|
70
|
+
} catch {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/** Pair each Slack monitor transport with the dispatcher from the undici copy it uses. */
|
|
75
|
+
function resolveSlackMonitorDispatchers(mode) {
|
|
76
|
+
const webApi = resolveSlackProxyDispatcher();
|
|
77
|
+
const socketMode = mode === "socket" ? resolveSlackSocketModeDispatcher(webApi) : void 0;
|
|
78
|
+
return {
|
|
79
|
+
webApi,
|
|
80
|
+
socketMode,
|
|
81
|
+
close: async () => {
|
|
82
|
+
await webApi?.close();
|
|
83
|
+
if (socketMode !== webApi) await socketMode?.close();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const DIRECT_SLACK_DISPATCHER_OPTIONS = {
|
|
88
|
+
httpProxy: "",
|
|
89
|
+
httpsProxy: "",
|
|
90
|
+
noProxy: "*"
|
|
91
|
+
};
|
|
92
|
+
/** Create a probe-owned dispatcher so timeout cleanup can retire every socket. */
|
|
93
|
+
function createSlackProbeDispatcher(timeoutMs) {
|
|
94
|
+
const options = resolveEnvHttpProxyAgentOptions() ?? DIRECT_SLACK_DISPATCHER_OPTIONS;
|
|
95
|
+
try {
|
|
96
|
+
return createHttp1EnvHttpProxyAgent(options, timeoutMs, process.env);
|
|
97
|
+
} catch {
|
|
98
|
+
return createHttp1EnvHttpProxyAgent(DIRECT_SLACK_DISPATCHER_OPTIONS, timeoutMs, {});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function buildSlackFetch(dispatcher) {
|
|
102
|
+
if (!dispatcher || isDebugProxyGlobalFetchPatchInstalled()) {
|
|
103
|
+
const slackFetch = resolveFetch();
|
|
104
|
+
if (!slackFetch) return;
|
|
105
|
+
return ((input, init) => slackFetch(input, normalizeSlackFetchInit(init)));
|
|
106
|
+
}
|
|
107
|
+
return ((input, init) => {
|
|
108
|
+
return fetchWithRuntimeDispatcher(input, {
|
|
109
|
+
...normalizeSlackFetchInit(init),
|
|
110
|
+
dispatcher
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function fenceSlackReadFetch(slackFetch, assertDirectAdapterHandoff) {
|
|
115
|
+
const assertReadAuthority = captureChannelReadAuthority();
|
|
116
|
+
return async (input, init) => {
|
|
117
|
+
assertReadAuthority?.();
|
|
118
|
+
captureChannelReadAuthority()?.();
|
|
119
|
+
assertDirectAdapterHandoff?.();
|
|
120
|
+
return slackFetch(input, init);
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
function resolveSlackClientOptions(input, dispatcher, assertDirectAdapterHandoff) {
|
|
124
|
+
const options = Object.assign({}, input);
|
|
125
|
+
const slackApiUrl = options.slackApiUrl ?? (process.env.SLACK_API_URL?.trim() || void 0);
|
|
126
|
+
const fetch = options.fetch ?? buildSlackFetch(dispatcher);
|
|
127
|
+
if (slackApiUrl !== void 0) options.slackApiUrl = slackApiUrl;
|
|
128
|
+
else delete options.slackApiUrl;
|
|
129
|
+
if (!fetch) {
|
|
130
|
+
if (assertDirectAdapterHandoff) throw new Error("Slack request fetch is unavailable for live authority.");
|
|
131
|
+
} else options.fetch = fenceSlackReadFetch(fetch, assertDirectAdapterHandoff);
|
|
132
|
+
return options;
|
|
133
|
+
}
|
|
134
|
+
function resolveSlackWebClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
135
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
136
|
+
resolved.retryConfig ??= SLACK_DEFAULT_RETRY_OPTIONS;
|
|
137
|
+
return resolved;
|
|
138
|
+
}
|
|
139
|
+
function resolveSlackReadClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
140
|
+
const resolved = resolveSlackWebClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
141
|
+
resolved.timeout ??= SLACK_READ_TIMEOUT_MS;
|
|
142
|
+
return resolved;
|
|
143
|
+
}
|
|
144
|
+
function resolveSlackWriteClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
145
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
146
|
+
resolved.retryConfig ??= SLACK_WRITE_RETRY_OPTIONS;
|
|
147
|
+
if (resolved.rejectRateLimitedCalls !== true && resolved.retryConfig.retries === 0) {
|
|
148
|
+
const slackFetch = resolved.fetch ?? buildSlackFetch(dispatcher);
|
|
149
|
+
if (slackFetch) resolved.fetch = (input, init) => retryAsync(async () => {
|
|
150
|
+
init?.signal?.throwIfAborted();
|
|
151
|
+
const response = await slackFetch(input, init);
|
|
152
|
+
if (response.status !== 429) return response;
|
|
153
|
+
const retryAfter = parseRetryAfterHeaderSeconds(response.headers.get("retry-after"));
|
|
154
|
+
response.body?.cancel().catch(() => void 0);
|
|
155
|
+
init?.signal?.throwIfAborted();
|
|
156
|
+
if (retryAfter === void 0 || retryAfter * 1e3 > 2147e6) return response;
|
|
157
|
+
throw new WebAPIRateLimitedError(retryAfter);
|
|
158
|
+
}, {
|
|
159
|
+
attempts: 3,
|
|
160
|
+
minDelayMs: 0,
|
|
161
|
+
maxDelayMs: 0,
|
|
162
|
+
shouldRetry: (error) => error instanceof WebAPIRateLimitedError,
|
|
163
|
+
retryAfterMs: (error) => error instanceof WebAPIRateLimitedError ? error.retryAfter * 1e3 : void 0,
|
|
164
|
+
sleep: (delayMs) => sleepWithAbort(delayMs, init?.signal)
|
|
165
|
+
});
|
|
166
|
+
resolved.rejectRateLimitedCalls = true;
|
|
167
|
+
}
|
|
168
|
+
return resolved;
|
|
169
|
+
}
|
|
170
|
+
function resolveSlackLookupClientOptions(options = {}, dispatcher = resolveSlackProxyDispatcher(), assertDirectAdapterHandoff) {
|
|
171
|
+
const resolved = resolveSlackClientOptions(options, dispatcher, assertDirectAdapterHandoff);
|
|
172
|
+
resolved.rejectRateLimitedCalls = true;
|
|
173
|
+
resolved.retryConfig = SLACK_LOOKUP_RETRY_OPTIONS;
|
|
174
|
+
resolved.timeout ??= SLACK_READ_TIMEOUT_MS;
|
|
175
|
+
return resolved;
|
|
176
|
+
}
|
|
177
|
+
// extensions/slack/src/monitor/lru-map-cache.ts
|
|
178
|
+
function getOrCreateWeakOwnerMap(owners, owner) {
|
|
179
|
+
let values = owners.get(owner);
|
|
180
|
+
if (!values) {
|
|
181
|
+
values = /* @__PURE__ */ new Map();
|
|
182
|
+
owners.set(owner, values);
|
|
183
|
+
}
|
|
184
|
+
return values;
|
|
185
|
+
}
|
|
186
|
+
/** LRU-touch read: move hit to newest so pruneMapToMaxSize keeps active keys. */
|
|
187
|
+
function readLruMapEntry(cache, cacheKey) {
|
|
188
|
+
const cached = cache.get(cacheKey);
|
|
189
|
+
if (cached) {
|
|
190
|
+
cache.delete(cacheKey);
|
|
191
|
+
cache.set(cacheKey, cached);
|
|
192
|
+
}
|
|
193
|
+
return cached;
|
|
194
|
+
}
|
|
195
|
+
function writeLruMapEntry(cache, cacheKey, entry, maxEntries) {
|
|
196
|
+
cache.delete(cacheKey);
|
|
197
|
+
cache.set(cacheKey, entry);
|
|
198
|
+
pruneMapToMaxSize(cache, maxEntries);
|
|
199
|
+
}
|
|
200
|
+
function pruneExpiredMapEntries(cache, now) {
|
|
201
|
+
for (const [key, entry] of cache) if (entry.expiresAt <= now) cache.delete(key);
|
|
202
|
+
}
|
|
203
|
+
// extensions/slack/src/client.ts
|
|
204
|
+
const SLACK_WRITE_CLIENT_CACHE_MAX = 32;
|
|
205
|
+
const SLACK_STARTUP_AUTH_TIMEOUT_MS = 1e4;
|
|
206
|
+
const SLACK_STARTUP_AUTH_RETRY_BUDGET_MS = 35e3;
|
|
207
|
+
const slackWriteClientCache = /* @__PURE__ */ new Map();
|
|
208
|
+
const slackListenerWriteClientCache = /* @__PURE__ */ new WeakMap();
|
|
209
|
+
function createSlackClientFactory(resolveOptions) {
|
|
210
|
+
return (token, options, assertDirectAdapterHandoff) => new WebClient(token, resolveOptions(options, void 0, assertDirectAdapterHandoff));
|
|
211
|
+
}
|
|
212
|
+
const createSlackWebClient = createSlackClientFactory(resolveSlackWebClientOptions);
|
|
213
|
+
const createSlackLookupClient = createSlackClientFactory(resolveSlackLookupClientOptions);
|
|
214
|
+
const createSlackWriteClient = createSlackClientFactory(resolveSlackWriteClientOptions);
|
|
215
|
+
function createSlackReadClient(token, options = {}, dispatcher, assertDirectAdapterHandoff) {
|
|
216
|
+
return new WebClient(token, resolveSlackReadClientOptions(options, dispatcher, assertDirectAdapterHandoff));
|
|
217
|
+
}
|
|
218
|
+
function createSlackStartupAuthFetch(baseFetch) {
|
|
219
|
+
const deadline = performance.now() + SLACK_STARTUP_AUTH_RETRY_BUDGET_MS;
|
|
220
|
+
return async (input, init) => {
|
|
221
|
+
const response = await baseFetch(input, init);
|
|
222
|
+
if (response.status !== 429) return response;
|
|
223
|
+
const retryAfter = Number.parseInt(response.headers.get("retry-after") ?? "", 10);
|
|
224
|
+
const remainingMs = Math.max(0, deadline - performance.now());
|
|
225
|
+
if (!Number.isFinite(retryAfter) || retryAfter * 1e3 <= remainingMs) return response;
|
|
226
|
+
await new Promise((resolve) => {
|
|
227
|
+
setTimeout(resolve, remainingMs);
|
|
228
|
+
});
|
|
229
|
+
throw new Error("Slack startup auth retry budget exhausted after rate limit");
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function createSlackStartupAuthClient(token, options = {}) {
|
|
233
|
+
const resolvedOptions = resolveSlackWebClientOptions(options);
|
|
234
|
+
const baseFetch = resolvedOptions.fetch;
|
|
235
|
+
if (!baseFetch) throw new Error("Slack startup auth fetch is unavailable");
|
|
236
|
+
return new WebClient(token, {
|
|
237
|
+
...resolvedOptions,
|
|
238
|
+
fetch: createSlackStartupAuthFetch(baseFetch),
|
|
239
|
+
retryConfig: {
|
|
240
|
+
...SLACK_DEFAULT_RETRY_OPTIONS,
|
|
241
|
+
maxRetryTime: SLACK_STARTUP_AUTH_RETRY_BUDGET_MS
|
|
242
|
+
},
|
|
243
|
+
timeout: SLACK_STARTUP_AUTH_TIMEOUT_MS
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
function createSlackTokenCacheKey(token) {
|
|
247
|
+
return `sha256:${hash("sha256", token, "base64url")}`;
|
|
248
|
+
}
|
|
249
|
+
function slackWriteClientCacheKey(token, options) {
|
|
250
|
+
return `${createSlackTokenCacheKey(token)}${options.slackApiUrl ? `:api:${options.slackApiUrl}` : ""}${options.teamId ? `:team:${options.teamId.trim().toLowerCase()}` : ""}`;
|
|
251
|
+
}
|
|
252
|
+
function getSlackWriteClient(token, options = {}) {
|
|
253
|
+
const resolvedOptions = resolveSlackWriteClientOptions(options);
|
|
254
|
+
const tokenKey = slackWriteClientCacheKey(token, resolvedOptions);
|
|
255
|
+
const cached = readLruMapEntry(slackWriteClientCache, tokenKey);
|
|
256
|
+
if (cached) return cached;
|
|
257
|
+
const client = new WebClient(token, resolvedOptions);
|
|
258
|
+
slackWriteClientCache.set(tokenKey, client);
|
|
259
|
+
pruneMapToMaxSize(slackWriteClientCache, SLACK_WRITE_CLIENT_CACHE_MAX);
|
|
260
|
+
return client;
|
|
261
|
+
}
|
|
262
|
+
function getSlackListenerWriteClient(params) {
|
|
263
|
+
const token = params.listenerClient.token?.trim();
|
|
264
|
+
const teamId = params.teamId?.trim().toUpperCase();
|
|
265
|
+
if (!token) return;
|
|
266
|
+
const cached = slackListenerWriteClientCache.get(params.listenerClient);
|
|
267
|
+
if (cached) {
|
|
268
|
+
if (cached.teamId !== teamId) return;
|
|
269
|
+
return cached.client;
|
|
270
|
+
}
|
|
271
|
+
const headers = Object.fromEntries(Object.entries(params.clientOptions?.headers ?? {}).filter(([name]) => name.toLowerCase() !== "authorization"));
|
|
272
|
+
const client = new WebClient(token, resolveSlackWriteClientOptions({
|
|
273
|
+
...params.clientOptions,
|
|
274
|
+
headers,
|
|
275
|
+
slackApiUrl: params.listenerClient.slackApiUrl,
|
|
276
|
+
teamId,
|
|
277
|
+
retryConfig: SLACK_WRITE_RETRY_OPTIONS,
|
|
278
|
+
timeout: 0
|
|
279
|
+
}));
|
|
280
|
+
slackListenerWriteClientCache.set(params.listenerClient, {
|
|
281
|
+
teamId,
|
|
282
|
+
client
|
|
283
|
+
});
|
|
284
|
+
return client;
|
|
285
|
+
}
|
|
286
|
+
// extensions/slack/src/cursor-pages.ts
|
|
287
|
+
const SLACK_CURSOR_PAGE_LIMIT = 1e4;
|
|
288
|
+
const fetchSlackChannelListPage = (client, cursor) => client.conversations.list({
|
|
289
|
+
types: "public_channel,private_channel",
|
|
290
|
+
exclude_archived: false,
|
|
291
|
+
limit: 1e3,
|
|
292
|
+
cursor
|
|
293
|
+
});
|
|
294
|
+
async function collectSlackCursorPages(params) {
|
|
295
|
+
const items = [];
|
|
296
|
+
let cursor;
|
|
297
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
298
|
+
for (let pageCount = 1; pageCount <= SLACK_CURSOR_PAGE_LIMIT; pageCount += 1) {
|
|
299
|
+
const response = await params.fetchPage(cursor);
|
|
300
|
+
items.push(...params.collectPageItems(response));
|
|
301
|
+
const nextCursor = response.response_metadata?.next_cursor?.trim() || void 0;
|
|
302
|
+
if (!nextCursor) return items;
|
|
303
|
+
if (seenCursors.has(nextCursor)) throw new Error(`Slack cursor pagination repeated a cursor after ${pageCount} pages`);
|
|
304
|
+
seenCursors.add(nextCursor);
|
|
305
|
+
cursor = nextCursor;
|
|
306
|
+
}
|
|
307
|
+
throw new Error(`Slack cursor pagination exceeded ${SLACK_CURSOR_PAGE_LIMIT} pages`);
|
|
308
|
+
}
|
|
309
|
+
export { createSlackProbeDispatcher as _, createSlackStartupAuthClient as a, resolveSlackWebClientOptions as b, createSlackWriteClient as c, getOrCreateWeakOwnerMap as d, pruneExpiredMapEntries as f, SLACK_WRITE_RETRY_OPTIONS as g, SLACK_DEFAULT_RETRY_OPTIONS as h, createSlackReadClient as i, getSlackListenerWriteClient as l, writeLruMapEntry as m, fetchSlackChannelListPage as n, createSlackTokenCacheKey as o, readLruMapEntry as p, createSlackLookupClient as r, createSlackWebClient as s, collectSlackCursorPages as t, getSlackWriteClient as u, resolveSlackLookupClientOptions as v, resolveSlackWriteClientOptions as x, resolveSlackMonitorDispatchers as y };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, o as resolveDefaultSlackAccountId } from "./accounts-
|
|
3
|
-
import { a as parseSlackTarget } from "./target-parsing-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { a as mergeSlackAccountConfig, c as resolveSlackAccountAllowFrom, o as resolveDefaultSlackAccountId } from "./accounts-EaPP0fFY.mjs";
|
|
3
|
+
import { a as parseSlackTarget } from "./target-parsing-DwYAP3ts.mjs";
|
|
4
|
+
import "./targets-eeOxA_b_.mjs";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-resolution";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
8
|
-
|
|
8
|
+
// extensions/slack/src/directory-config.ts
|
|
9
9
|
var directory_config_exports = /* @__PURE__ */ __exportAll({
|
|
10
10
|
listSlackDirectoryGroupsFromConfig: () => listSlackDirectoryGroupsFromConfig,
|
|
11
11
|
listSlackDirectoryPeersFromConfig: () => listSlackDirectoryPeersFromConfig
|
|
@@ -48,5 +48,4 @@ const listSlackDirectoryGroupsFromConfig = createResolvedDirectoryEntriesLister(
|
|
|
48
48
|
return normalized?.kind === "channel" ? `channel:${normalizeLowercaseStringOrEmpty(normalized.id)}` : null;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
//#endregion
|
|
52
51
|
export { listSlackDirectoryGroupsFromConfig as n, listSlackDirectoryPeersFromConfig as r, directory_config_exports as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { s as resolveSlackAccount } from "./accounts-
|
|
3
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { s as resolveSlackAccount } from "./accounts-EaPP0fFY.mjs";
|
|
3
|
+
import { n as fetchSlackChannelListPage, 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/directory-live.ts
|
|
6
6
|
var directory_live_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
getSlackDirectorySelfLive: () => getSlackDirectorySelfLive,
|
|
8
8
|
listSlackDirectoryGroupsLive: () => listSlackDirectoryGroupsLive,
|
|
@@ -55,9 +55,9 @@ function createSlackDirectoryLister(options) {
|
|
|
55
55
|
return async (params) => {
|
|
56
56
|
const client = createSlackDirectoryClient(params);
|
|
57
57
|
if (!client) return [];
|
|
58
|
-
const query = normalizeLowercaseStringOrEmpty(params.query);
|
|
58
|
+
const query = normalizeLowercaseStringOrEmpty(params.query).normalize("NFC");
|
|
59
59
|
const rows = (await options.fetchRows(client)).filter((row) => {
|
|
60
|
-
const candidates = options.searchValues(row).map(normalizeOptionalLowercaseString)
|
|
60
|
+
const candidates = options.searchValues(row).map((value) => normalizeOptionalLowercaseString(value)?.normalize("NFC"));
|
|
61
61
|
return !query || candidates.some((candidate) => candidate?.includes(query));
|
|
62
62
|
}).map(options.toEntry).filter((entry) => entry !== null);
|
|
63
63
|
return typeof params.limit === "number" && params.limit > 0 ? rows.slice(0, params.limit) : rows;
|
|
@@ -97,5 +97,4 @@ const listSlackDirectoryGroupsLive = createSlackDirectoryLister({
|
|
|
97
97
|
} : null;
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
|
-
//#endregion
|
|
101
100
|
export { listSlackDirectoryGroupsLive as n, listSlackDirectoryPeersLive as r, directory_live_exports as t };
|