@openclaw/slack 2026.7.2-beta.5 → 2026.7.2-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-inspect-DEKpg9Ip.js +89 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/accounts-CHAeNZOX.js +186 -0
- package/dist/accounts.runtime-BHD4Ma2R.js +2 -0
- package/dist/action-runtime-DfuYoMjG.js +561 -0
- package/dist/action-runtime.runtime-DQErZYpz.js +2 -0
- package/dist/actions-D3NuJvva.js +876 -0
- package/dist/actions.runtime-BIRU_G4M.js +2 -0
- package/dist/api.js +12 -12
- package/dist/approval-handler.runtime-BA05P0QT.js +367 -0
- package/dist/block-text-DkHaoGem.js +79 -0
- package/dist/channel-B9fVdW3s.js +1118 -0
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel-type-DXyos1d2.js +108 -0
- package/dist/channel.setup-CLP5oTvh.js +56 -0
- package/dist/config-adapter-CxBQH8fq.js +566 -0
- package/dist/config-schema-SgZT6nXV.js +373 -0
- package/dist/cursor-pages-eX7p8Wwt.js +19 -0
- package/dist/directory-config-CnCIAktf.js +54 -0
- package/dist/directory-contract-api.js +1 -1
- package/dist/directory-live-DKunWh3A.js +131 -0
- package/dist/group-policy-NQZti9t-.js +2442 -0
- package/dist/message-tool-api-DkhFpMoy.js +127 -0
- package/dist/message-tool-api.js +1 -1
- package/dist/monitor-CmKz0wtI.js +13 -0
- package/dist/outbound-adapter-BkuMp2Vs.js +236 -0
- package/dist/pipeline.runtime-DgtmuYCP.js +4360 -0
- package/dist/policy-PRysPn23.js +65 -0
- package/dist/probe-CgDsSops.js +345 -0
- package/dist/provider-DmRizMZt.js +5900 -0
- package/dist/relay-source-Blxj8xb4.js +272 -0
- package/dist/replies-4s_Vq_z9.js +457 -0
- package/dist/resolve-channels-yEqmM-3I.js +92 -0
- package/dist/resolve-users-BOrt5K-5.js +118 -0
- package/dist/runtime-api-QMb-Q5Ko.js +10 -0
- package/dist/runtime-api.js +11 -11
- package/dist/scopes-BJSrkAp6.js +73 -0
- package/dist/send-DsLeZpST.js +1269 -0
- package/dist/send.runtime-gUdK6V3h.js +2 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/setup-surface-BeNzrMrJ.js +148 -0
- package/dist/shared-DgIN3Dcr.js +268 -0
- package/dist/slash-dispatch.runtime-zPkyl7dB.js +33 -0
- package/node_modules/@slack/bolt/node_modules/media-typer/README.md +94 -0
- package/node_modules/@slack/bolt/node_modules/media-typer/index.js +135 -0
- package/node_modules/@slack/bolt/node_modules/media-typer/package.json +37 -0
- package/node_modules/@slack/socket-mode/node_modules/@slack/logger/LICENSE +23 -0
- package/node_modules/@slack/socket-mode/node_modules/@slack/logger/README.md +66 -0
- package/node_modules/@slack/socket-mode/node_modules/@slack/logger/dist/index.d.ts +94 -0
- package/node_modules/@slack/socket-mode/node_modules/@slack/logger/dist/index.d.ts.map +1 -0
- package/node_modules/@slack/socket-mode/node_modules/@slack/logger/dist/index.js +98 -0
- package/node_modules/@slack/socket-mode/node_modules/@slack/logger/dist/index.js.map +1 -0
- package/node_modules/@slack/socket-mode/node_modules/@slack/logger/package.json +42 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/README.md +15 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/assert/strict.d.ts +68 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/assert.d.ts +1077 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/buffer.d.ts +1799 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/child_process.d.ts +1362 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/console.d.ts +93 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/constants.d.ts +14 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/crypto.d.ts +3954 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dgram.d.ts +537 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/dns.d.ts +876 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/domain.d.ts +150 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/events.d.ts +1008 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/fs/promises.d.ts +1481 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/fs.d.ts +4786 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/globals.d.ts +150 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/http.d.ts +2172 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/http2.d.ts +2489 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/https.d.ts +400 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/index.d.ts +115 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/inspector.d.ts +264 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/module.d.ts +726 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/net.d.ts +970 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/os.d.ts +498 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/package.json +155 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/path.d.ts +178 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/perf_hooks.d.ts +604 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/process.d.ts +2217 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/punycode.d.ts +89 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/querystring.d.ts +139 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/quic.d.ts +978 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/readline.d.ts +508 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/repl.d.ts +420 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/sea.d.ts +47 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/sqlite.d.ts +1123 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/stream/iter.d.ts +451 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/stream/web.d.ts +300 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/stream.d.ts +1806 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/test.d.ts +2389 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/timers.d.ts +149 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/tls.d.ts +1193 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/trace_events.d.ts +103 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/ts5.6/index.d.ts +117 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/ts5.7/index.d.ts +117 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/tty.d.ts +225 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/url.d.ts +556 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/util.d.ts +1677 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/v8.d.ts +1062 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/vm.d.ts +1136 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/wasi.d.ts +131 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/worker_threads.d.ts +669 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@slack/socket-mode/node_modules/@types/node/zlib.d.ts +589 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/README.md +6 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/agent.d.ts +30 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/client.d.ts +129 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/connector.d.ts +36 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/cookies.d.ts +30 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/dispatcher.d.ts +253 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/errors.d.ts +177 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/eventsource.d.ts +66 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/fetch.d.ts +231 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/handlers.d.ts +14 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/header.d.ts +165 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/index.d.ts +93 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/interceptors.d.ts +80 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/mock-client.d.ts +27 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/package.json +55 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/patch.d.ts +29 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/pool.d.ts +39 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/readable.d.ts +68 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/webidl.d.ts +346 -0
- package/node_modules/@slack/socket-mode/node_modules/undici-types/websocket.d.ts +188 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/LICENSE +23 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/README.md +66 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/dist/index.d.ts +94 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/dist/index.d.ts.map +1 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/dist/index.js +98 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/dist/index.js.map +1 -0
- package/node_modules/@slack/web-api/node_modules/@slack/logger/package.json +42 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/LICENSE +21 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/README.md +15 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/assert/strict.d.ts +68 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/assert.d.ts +1077 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/async_hooks.d.ts +711 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/buffer.d.ts +1799 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/child_process.d.ts +1362 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/cluster.d.ts +432 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/console.d.ts +93 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/constants.d.ts +14 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/crypto.d.ts +3954 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/dgram.d.ts +537 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/diagnostics_channel.d.ts +794 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/dns/promises.d.ts +497 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/dns.d.ts +876 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/domain.d.ts +150 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/events.d.ts +1008 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/fs/promises.d.ts +1481 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/fs.d.ts +4786 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/globals.d.ts +150 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http.d.ts +2172 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/http2.d.ts +2489 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/https.d.ts +400 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/index.d.ts +115 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector/promises.d.ts +35 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.d.ts +264 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/inspector.generated.d.ts +4406 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/module.d.ts +726 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/net.d.ts +970 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/os.d.ts +498 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/package.json +155 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/path/posix.d.ts +8 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/path/win32.d.ts +8 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/path.d.ts +178 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/perf_hooks.d.ts +604 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/process.d.ts +2217 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/punycode.d.ts +89 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/querystring.d.ts +139 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/quic.d.ts +978 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/readline/promises.d.ts +158 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/readline.d.ts +508 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/repl.d.ts +420 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/sea.d.ts +47 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/sqlite.d.ts +1123 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/consumers.d.ts +114 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/iter.d.ts +451 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/stream/web.d.ts +300 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/stream.d.ts +1806 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/string_decoder.d.ts +27 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/test/reporters.d.ts +59 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/test.d.ts +2389 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/timers.d.ts +149 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/tls.d.ts +1193 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/trace_events.d.ts +103 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.6/index.d.ts +117 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/ts5.7/index.d.ts +117 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/tty.d.ts +225 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/url.d.ts +556 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/util/types.d.ts +558 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/util.d.ts +1677 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/v8.d.ts +1062 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/vm.d.ts +1136 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/wasi.d.ts +131 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/domexception.d.ts +83 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/worker_threads.d.ts +669 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/zlib/iter.d.ts +131 -0
- package/node_modules/@slack/web-api/node_modules/@types/node/zlib.d.ts +589 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/README.md +85 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/dist/eventemitter3.esm.js +355 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/dist/eventemitter3.esm.min.js +1 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/dist/eventemitter3.esm.min.js.map +1 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/dist/eventemitter3.umd.js +363 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/dist/eventemitter3.umd.min.js +1 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/dist/eventemitter3.umd.min.js.map +1 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/index.d.ts +135 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/index.mjs +4 -0
- package/node_modules/@slack/web-api/node_modules/eventemitter3/package.json +62 -0
- package/node_modules/@slack/web-api/node_modules/p-queue/node_modules/eventemitter3/LICENSE +21 -0
- package/node_modules/@slack/web-api/node_modules/p-queue/node_modules/eventemitter3/index.js +336 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/LICENSE +21 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/README.md +6 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/agent.d.ts +30 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/api.d.ts +43 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/cache-interceptor.d.ts +179 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/cache.d.ts +36 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/client-stats.d.ts +15 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/client.d.ts +129 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/connector.d.ts +36 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/content-type.d.ts +21 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/cookies.d.ts +30 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/dispatcher.d.ts +253 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/errors.d.ts +177 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/eventsource.d.ts +66 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/fetch.d.ts +231 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/formdata.d.ts +108 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/global-origin.d.ts +7 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/handlers.d.ts +14 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/header.d.ts +165 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/index.d.ts +93 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/interceptors.d.ts +80 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/mock-client.d.ts +27 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/package.json +55 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/patch.d.ts +29 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/pool.d.ts +39 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/readable.d.ts +68 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/round-robin-pool.d.ts +39 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/snapshot-agent.d.ts +113 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/util.d.ts +18 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/utility.d.ts +7 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/webidl.d.ts +346 -0
- package/node_modules/@slack/web-api/node_modules/undici-types/websocket.d.ts +188 -0
- package/node_modules/get-east-asian-width/index.d.ts +60 -0
- package/node_modules/get-east-asian-width/index.js +30 -0
- package/node_modules/get-east-asian-width/license +9 -0
- package/node_modules/get-east-asian-width/lookup-data.js +21 -0
- package/node_modules/get-east-asian-width/lookup.js +138 -0
- package/node_modules/get-east-asian-width/package.json +71 -0
- package/node_modules/get-east-asian-width/readme.md +65 -0
- package/node_modules/get-east-asian-width/utilities.js +24 -0
- package/node_modules/p-map/index.js +1 -0
- package/node_modules/p-map/package.json +1 -1
- package/openclaw.plugin.json +64 -64
- package/package.json +13 -5
- package/dist/account-inspect-jn1xLaVi.js +0 -86
- package/dist/accounts-BSr252c_.js +0 -188
- package/dist/accounts.runtime-CjULMLTa.js +0 -2
- package/dist/action-runtime-BO3HK_50.js +0 -561
- package/dist/action-runtime.runtime-DbEcqEXC.js +0 -2
- package/dist/actions-BkOaiDSX.js +0 -900
- package/dist/actions.runtime-Do-iOL51.js +0 -2
- package/dist/approval-handler.runtime-BAnGN7w0.js +0 -368
- package/dist/channel-Cnrlie9S.js +0 -1118
- package/dist/channel-type-CPDX8EV-.js +0 -109
- package/dist/channel.setup-DyZdLwUB.js +0 -56
- package/dist/config-adapter-Bb8hn2tM.js +0 -571
- package/dist/config-schema-BajbuJGL.js +0 -422
- package/dist/cursor-pages-DSmTg0su.js +0 -13
- package/dist/directory-config-CeixfVuC.js +0 -54
- package/dist/directory-live-CUwGPX2d.js +0 -131
- package/dist/group-policy-CthIXE2T.js +0 -2332
- package/dist/message-tool-api-CvKoWYYQ.js +0 -123
- package/dist/monitor-Cb5ZsOTY.js +0 -13
- package/dist/outbound-adapter-sGrozuRg.js +0 -215
- package/dist/pipeline.runtime-mFCCSllA.js +0 -4360
- package/dist/policy-DVg6FyMP.js +0 -65
- package/dist/probe-BhQTDVBQ.js +0 -333
- package/dist/provider-PSppCU_K.js +0 -5875
- package/dist/relay-source-D0mb_JBk.js +0 -272
- package/dist/replies-BkPPM2Ri.js +0 -457
- package/dist/resolve-channels-B3RlJKyV.js +0 -92
- package/dist/resolve-users-DTm7PEMa.js +0 -118
- package/dist/runtime-api-jpn3vQ7e.js +0 -10
- package/dist/scopes-B2SqZ--4.js +0 -73
- package/dist/send-2IoDXPeB.js +0 -1269
- package/dist/send.runtime-BKd_PAEw.js +0 -2
- package/dist/setup-surface-Dyam58nO.js +0 -148
- package/dist/shared-g55DV75U.js +0 -273
- package/dist/slash-dispatch.runtime-BRQbvn2e.js +0 -33
- package/node_modules/media-typer/README.md +0 -93
- package/node_modules/media-typer/index.js +0 -143
- package/node_modules/media-typer/package.json +0 -33
- /package/node_modules/@slack/{logger → bolt/node_modules/@slack/logger}/LICENSE +0 -0
- /package/node_modules/@slack/{logger → bolt/node_modules/@slack/logger}/README.md +0 -0
- /package/node_modules/@slack/{logger → bolt/node_modules/@slack/logger}/dist/index.d.ts +0 -0
- /package/node_modules/@slack/{logger → bolt/node_modules/@slack/logger}/dist/index.d.ts.map +0 -0
- /package/node_modules/@slack/{logger → bolt/node_modules/@slack/logger}/dist/index.js +0 -0
- /package/node_modules/@slack/{logger → bolt/node_modules/@slack/logger}/dist/index.js.map +0 -0
- /package/node_modules/@slack/{logger → bolt/node_modules/@slack/logger}/package.json +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/LICENSE +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/README.md +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/authorize-result.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/authorize-result.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/authorize-result.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/authorize-result.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/callback-options.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/callback-options.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/callback-options.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/callback-options.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/default-render-html-for-install-path.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/default-render-html-for-install-path.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/default-render-html-for-install-path.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/default-render-html-for-install-path.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/errors.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/errors.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/errors.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/errors.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/index.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/index.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/index.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/index.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-path-options.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-path-options.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-path-options.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-path-options.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-provider-options.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-provider-options.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-provider-options.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-provider-options.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-provider.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-provider.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-provider.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-provider.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-url-options.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-url-options.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-url-options.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/install-url-options.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-query.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-query.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-query.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-query.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/file-store.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/file-store.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/file-store.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/file-store.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/index.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/index.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/index.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/index.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/interface.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/interface.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/interface.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/interface.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/memory-store.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/memory-store.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/memory-store.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation-stores/memory-store.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/installation.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/logger.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/logger.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/logger.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/logger.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/clear-state-store.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/clear-state-store.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/clear-state-store.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/clear-state-store.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/file-state-store.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/file-state-store.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/file-state-store.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/file-state-store.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/index.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/index.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/index.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/index.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/interface.d.ts +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/interface.d.ts.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/interface.js +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/dist/state-stores/interface.js.map +0 -0
- /package/node_modules/@slack/{oauth → bolt/node_modules/@slack/oauth}/package.json +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/jsonwebtoken/LICENSE +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/jsonwebtoken/README.md +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/jsonwebtoken/index.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/jsonwebtoken/package.json +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/ms/LICENSE +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/ms/README.md +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/ms/index.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/ms/package.json +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/LICENSE +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/README.md +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/assert/strict.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/assert.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/async_hooks.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/buffer.buffer.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/buffer.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/child_process.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/cluster.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/console.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/constants.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/crypto.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/dgram.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/diagnostics_channel.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/dns/promises.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/dns.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/domain.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/events.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/ffi.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/fs/promises.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/fs.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/globals.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/globals.typedarray.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/http.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/http2.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/https.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/index.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/inspector/promises.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/inspector.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/inspector.generated.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/module.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/net.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/os.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/package.json +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/path/posix.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/path/win32.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/path.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/perf_hooks.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/process.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/punycode.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/querystring.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/quic.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/readline/promises.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/readline.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/repl.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/sea.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/sqlite.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/stream/consumers.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/stream/iter.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/stream/promises.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/stream/web.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/stream.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/string_decoder.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/test/reporters.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/test.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/timers/promises.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/timers.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/tls.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/trace_events.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/ts5.6/buffer.buffer.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/ts5.6/compatibility/float16array.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/ts5.6/globals.typedarray.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/ts5.6/index.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/ts5.7/compatibility/float16array.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/ts5.7/index.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/tty.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/url.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/util/types.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/util.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/v8.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/vm.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/wasi.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/abortcontroller.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/blob.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/console.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/crypto.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/domexception.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/encoding.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/events.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/fetch.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/importmeta.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/messaging.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/navigator.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/performance.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/storage.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/streams.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/timers.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/web-globals/url.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/worker_threads.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/zlib/iter.d.ts +0 -0
- /package/node_modules/{@types → @slack/bolt/node_modules/@types}/node/zlib.d.ts +0 -0
- /package/node_modules/{accepts → @slack/bolt/node_modules/accepts}/HISTORY.md +0 -0
- /package/node_modules/{accepts → @slack/bolt/node_modules/accepts}/LICENSE +0 -0
- /package/node_modules/{accepts → @slack/bolt/node_modules/accepts}/README.md +0 -0
- /package/node_modules/{accepts → @slack/bolt/node_modules/accepts}/index.js +0 -0
- /package/node_modules/{accepts → @slack/bolt/node_modules/accepts}/package.json +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/LICENSE +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/README.md +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/index.js +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/lib/read.js +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/lib/types/json.js +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/lib/types/raw.js +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/lib/types/text.js +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/lib/types/urlencoded.js +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/lib/utils.js +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/node_modules/content-type/LICENSE +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/node_modules/content-type/README.md +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/node_modules/content-type/dist/index.d.ts +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/node_modules/content-type/dist/index.js +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/node_modules/content-type/dist/index.js.map +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/node_modules/content-type/package.json +0 -0
- /package/node_modules/{body-parser → @slack/bolt/node_modules/body-parser}/package.json +0 -0
- /package/node_modules/{buffer-equal-constant-time → @slack/bolt/node_modules/buffer-equal-constant-time}/.npmignore +0 -0
- /package/node_modules/{buffer-equal-constant-time → @slack/bolt/node_modules/buffer-equal-constant-time}/.travis.yml +0 -0
- /package/node_modules/{buffer-equal-constant-time → @slack/bolt/node_modules/buffer-equal-constant-time}/LICENSE.txt +0 -0
- /package/node_modules/{buffer-equal-constant-time → @slack/bolt/node_modules/buffer-equal-constant-time}/README.md +0 -0
- /package/node_modules/{buffer-equal-constant-time → @slack/bolt/node_modules/buffer-equal-constant-time}/index.js +0 -0
- /package/node_modules/{buffer-equal-constant-time → @slack/bolt/node_modules/buffer-equal-constant-time}/package.json +0 -0
- /package/node_modules/{buffer-equal-constant-time → @slack/bolt/node_modules/buffer-equal-constant-time}/test.js +0 -0
- /package/node_modules/{bytes → @slack/bolt/node_modules/bytes}/History.md +0 -0
- /package/node_modules/{bytes → @slack/bolt/node_modules/bytes}/LICENSE +0 -0
- /package/node_modules/{bytes → @slack/bolt/node_modules/bytes}/Readme.md +0 -0
- /package/node_modules/{bytes → @slack/bolt/node_modules/bytes}/index.js +0 -0
- /package/node_modules/{bytes → @slack/bolt/node_modules/bytes}/package.json +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/.eslintrc +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/.github/FUNDING.yml +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/.nycrc +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/CHANGELOG.md +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/LICENSE +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/README.md +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/actualApply.d.ts +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/actualApply.js +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/applyBind.d.ts +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/applyBind.js +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/functionApply.d.ts +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/functionApply.js +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/functionCall.d.ts +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/functionCall.js +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/index.d.ts +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/index.js +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/package.json +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/reflectApply.d.ts +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/reflectApply.js +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/test/index.js +0 -0
- /package/node_modules/{call-bind-apply-helpers → @slack/bolt/node_modules/call-bind-apply-helpers}/tsconfig.json +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/.eslintrc +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/.github/FUNDING.yml +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/.nycrc +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/CHANGELOG.md +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/LICENSE +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/README.md +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/index.d.ts +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/index.js +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/package.json +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/test/index.js +0 -0
- /package/node_modules/{call-bound → @slack/bolt/node_modules/call-bound}/tsconfig.json +0 -0
- /package/node_modules/{content-disposition → @slack/bolt/node_modules/content-disposition}/LICENSE +0 -0
- /package/node_modules/{content-disposition → @slack/bolt/node_modules/content-disposition}/README.md +0 -0
- /package/node_modules/{content-disposition → @slack/bolt/node_modules/content-disposition}/index.js +0 -0
- /package/node_modules/{content-disposition → @slack/bolt/node_modules/content-disposition}/package.json +0 -0
- /package/node_modules/{content-type → @slack/bolt/node_modules/content-type}/HISTORY.md +0 -0
- /package/node_modules/{content-type → @slack/bolt/node_modules/content-type}/LICENSE +0 -0
- /package/node_modules/{content-type → @slack/bolt/node_modules/content-type}/README.md +0 -0
- /package/node_modules/{content-type → @slack/bolt/node_modules/content-type}/index.js +0 -0
- /package/node_modules/{content-type → @slack/bolt/node_modules/content-type}/package.json +0 -0
- /package/node_modules/{cookie → @slack/bolt/node_modules/cookie}/LICENSE +0 -0
- /package/node_modules/{cookie → @slack/bolt/node_modules/cookie}/README.md +0 -0
- /package/node_modules/{cookie → @slack/bolt/node_modules/cookie}/SECURITY.md +0 -0
- /package/node_modules/{cookie → @slack/bolt/node_modules/cookie}/index.js +0 -0
- /package/node_modules/{cookie → @slack/bolt/node_modules/cookie}/package.json +0 -0
- /package/node_modules/{cookie-signature → @slack/bolt/node_modules/cookie-signature}/History.md +0 -0
- /package/node_modules/{cookie-signature → @slack/bolt/node_modules/cookie-signature}/LICENSE +0 -0
- /package/node_modules/{cookie-signature → @slack/bolt/node_modules/cookie-signature}/Readme.md +0 -0
- /package/node_modules/{cookie-signature → @slack/bolt/node_modules/cookie-signature}/index.js +0 -0
- /package/node_modules/{cookie-signature → @slack/bolt/node_modules/cookie-signature}/package.json +0 -0
- /package/node_modules/{debug → @slack/bolt/node_modules/debug}/LICENSE +0 -0
- /package/node_modules/{debug → @slack/bolt/node_modules/debug}/README.md +0 -0
- /package/node_modules/{debug → @slack/bolt/node_modules/debug}/package.json +0 -0
- /package/node_modules/{debug → @slack/bolt/node_modules/debug}/src/browser.js +0 -0
- /package/node_modules/{debug → @slack/bolt/node_modules/debug}/src/common.js +0 -0
- /package/node_modules/{debug → @slack/bolt/node_modules/debug}/src/index.js +0 -0
- /package/node_modules/{debug → @slack/bolt/node_modules/debug}/src/node.js +0 -0
- /package/node_modules/{depd → @slack/bolt/node_modules/depd}/History.md +0 -0
- /package/node_modules/{depd → @slack/bolt/node_modules/depd}/LICENSE +0 -0
- /package/node_modules/{depd → @slack/bolt/node_modules/depd}/Readme.md +0 -0
- /package/node_modules/{depd → @slack/bolt/node_modules/depd}/index.js +0 -0
- /package/node_modules/{depd → @slack/bolt/node_modules/depd}/lib/browser/index.js +0 -0
- /package/node_modules/{depd → @slack/bolt/node_modules/depd}/package.json +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/.eslintrc +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/.github/FUNDING.yml +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/.nycrc +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/CHANGELOG.md +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/LICENSE +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/README.md +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/get.d.ts +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/get.js +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/package.json +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/set.d.ts +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/set.js +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/test/get.js +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/test/index.js +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/test/set.js +0 -0
- /package/node_modules/{dunder-proto → @slack/bolt/node_modules/dunder-proto}/tsconfig.json +0 -0
- /package/node_modules/{ecdsa-sig-formatter → @slack/bolt/node_modules/ecdsa-sig-formatter}/CODEOWNERS +0 -0
- /package/node_modules/{ecdsa-sig-formatter → @slack/bolt/node_modules/ecdsa-sig-formatter}/LICENSE +0 -0
- /package/node_modules/{ecdsa-sig-formatter → @slack/bolt/node_modules/ecdsa-sig-formatter}/README.md +0 -0
- /package/node_modules/{ecdsa-sig-formatter → @slack/bolt/node_modules/ecdsa-sig-formatter}/package.json +0 -0
- /package/node_modules/{ecdsa-sig-formatter → @slack/bolt/node_modules/ecdsa-sig-formatter}/src/ecdsa-sig-formatter.d.ts +0 -0
- /package/node_modules/{ecdsa-sig-formatter → @slack/bolt/node_modules/ecdsa-sig-formatter}/src/ecdsa-sig-formatter.js +0 -0
- /package/node_modules/{ecdsa-sig-formatter → @slack/bolt/node_modules/ecdsa-sig-formatter}/src/param-bytes-for-alg.js +0 -0
- /package/node_modules/{ee-first → @slack/bolt/node_modules/ee-first}/LICENSE +0 -0
- /package/node_modules/{ee-first → @slack/bolt/node_modules/ee-first}/README.md +0 -0
- /package/node_modules/{ee-first → @slack/bolt/node_modules/ee-first}/index.js +0 -0
- /package/node_modules/{ee-first → @slack/bolt/node_modules/ee-first}/package.json +0 -0
- /package/node_modules/{encodeurl → @slack/bolt/node_modules/encodeurl}/LICENSE +0 -0
- /package/node_modules/{encodeurl → @slack/bolt/node_modules/encodeurl}/README.md +0 -0
- /package/node_modules/{encodeurl → @slack/bolt/node_modules/encodeurl}/index.js +0 -0
- /package/node_modules/{encodeurl → @slack/bolt/node_modules/encodeurl}/package.json +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/.eslintrc +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/.github/FUNDING.yml +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/.nycrc +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/CHANGELOG.md +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/LICENSE +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/README.md +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/index.d.ts +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/index.js +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/package.json +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/test/index.js +0 -0
- /package/node_modules/{es-define-property → @slack/bolt/node_modules/es-define-property}/tsconfig.json +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/.eslintrc +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/.github/FUNDING.yml +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/CHANGELOG.md +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/LICENSE +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/README.md +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/eval.d.ts +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/eval.js +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/index.d.ts +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/index.js +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/package.json +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/range.d.ts +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/range.js +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/ref.d.ts +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/ref.js +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/syntax.d.ts +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/syntax.js +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/test/index.js +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/tsconfig.json +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/type.d.ts +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/type.js +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/uri.d.ts +0 -0
- /package/node_modules/{es-errors → @slack/bolt/node_modules/es-errors}/uri.js +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/.eslintrc +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/.github/FUNDING.yml +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/CHANGELOG.md +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/LICENSE +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/README.md +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/RequireObjectCoercible.d.ts +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/RequireObjectCoercible.js +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/ToObject.d.ts +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/ToObject.js +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/index.d.ts +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/index.js +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/isObject.d.ts +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/isObject.js +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/package.json +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/test/index.js +0 -0
- /package/node_modules/{es-object-atoms → @slack/bolt/node_modules/es-object-atoms}/tsconfig.json +0 -0
- /package/node_modules/{escape-html → @slack/bolt/node_modules/escape-html}/LICENSE +0 -0
- /package/node_modules/{escape-html → @slack/bolt/node_modules/escape-html}/Readme.md +0 -0
- /package/node_modules/{escape-html → @slack/bolt/node_modules/escape-html}/index.js +0 -0
- /package/node_modules/{escape-html → @slack/bolt/node_modules/escape-html}/package.json +0 -0
- /package/node_modules/{etag → @slack/bolt/node_modules/etag}/HISTORY.md +0 -0
- /package/node_modules/{etag → @slack/bolt/node_modules/etag}/LICENSE +0 -0
- /package/node_modules/{etag → @slack/bolt/node_modules/etag}/README.md +0 -0
- /package/node_modules/{etag → @slack/bolt/node_modules/etag}/index.js +0 -0
- /package/node_modules/{etag → @slack/bolt/node_modules/etag}/package.json +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/LICENSE +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/Readme.md +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/index.js +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/lib/application.js +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/lib/express.js +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/lib/request.js +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/lib/response.js +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/lib/utils.js +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/lib/view.js +0 -0
- /package/node_modules/{express → @slack/bolt/node_modules/express}/package.json +0 -0
- /package/node_modules/{finalhandler → @slack/bolt/node_modules/finalhandler}/HISTORY.md +0 -0
- /package/node_modules/{finalhandler → @slack/bolt/node_modules/finalhandler}/LICENSE +0 -0
- /package/node_modules/{finalhandler → @slack/bolt/node_modules/finalhandler}/README.md +0 -0
- /package/node_modules/{finalhandler → @slack/bolt/node_modules/finalhandler}/index.js +0 -0
- /package/node_modules/{finalhandler → @slack/bolt/node_modules/finalhandler}/package.json +0 -0
- /package/node_modules/{forwarded → @slack/bolt/node_modules/forwarded}/HISTORY.md +0 -0
- /package/node_modules/{forwarded → @slack/bolt/node_modules/forwarded}/LICENSE +0 -0
- /package/node_modules/{forwarded → @slack/bolt/node_modules/forwarded}/README.md +0 -0
- /package/node_modules/{forwarded → @slack/bolt/node_modules/forwarded}/index.js +0 -0
- /package/node_modules/{forwarded → @slack/bolt/node_modules/forwarded}/package.json +0 -0
- /package/node_modules/{fresh → @slack/bolt/node_modules/fresh}/HISTORY.md +0 -0
- /package/node_modules/{fresh → @slack/bolt/node_modules/fresh}/LICENSE +0 -0
- /package/node_modules/{fresh → @slack/bolt/node_modules/fresh}/README.md +0 -0
- /package/node_modules/{fresh → @slack/bolt/node_modules/fresh}/index.js +0 -0
- /package/node_modules/{fresh → @slack/bolt/node_modules/fresh}/package.json +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/.eslintrc +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/.github/FUNDING.yml +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/.github/SECURITY.md +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/.nycrc +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/CHANGELOG.md +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/LICENSE +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/README.md +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/implementation.js +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/index.js +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/package.json +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/test/.eslintrc +0 -0
- /package/node_modules/{function-bind → @slack/bolt/node_modules/function-bind}/test/index.js +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/.eslintrc +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/.github/FUNDING.yml +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/.nycrc +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/CHANGELOG.md +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/LICENSE +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/README.md +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/index.js +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/package.json +0 -0
- /package/node_modules/{get-intrinsic → @slack/bolt/node_modules/get-intrinsic}/test/GetIntrinsic.js +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/.eslintrc +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/.github/FUNDING.yml +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/.nycrc +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/CHANGELOG.md +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/LICENSE +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/Object.getPrototypeOf.d.ts +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/Object.getPrototypeOf.js +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/README.md +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/Reflect.getPrototypeOf.d.ts +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/Reflect.getPrototypeOf.js +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/index.d.ts +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/index.js +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/package.json +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/test/index.js +0 -0
- /package/node_modules/{get-proto → @slack/bolt/node_modules/get-proto}/tsconfig.json +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/.eslintrc +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/.github/FUNDING.yml +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/CHANGELOG.md +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/LICENSE +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/README.md +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/gOPD.d.ts +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/gOPD.js +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/index.d.ts +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/index.js +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/package.json +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/test/index.js +0 -0
- /package/node_modules/{gopd → @slack/bolt/node_modules/gopd}/tsconfig.json +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/.eslintrc +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/.github/FUNDING.yml +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/.nycrc +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/CHANGELOG.md +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/LICENSE +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/README.md +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/index.d.ts +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/index.js +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/package.json +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/shams.d.ts +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/shams.js +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/test/index.js +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/test/shams/core-js.js +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/test/shams/get-own-property-symbols.js +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/test/tests.js +0 -0
- /package/node_modules/{has-symbols → @slack/bolt/node_modules/has-symbols}/tsconfig.json +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/.github/FUNDING.yml +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/.nycrc +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/CHANGELOG.md +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/LICENSE +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/README.md +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/eslint.config.mjs +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/index.d.ts +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/index.js +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/package.json +0 -0
- /package/node_modules/{hasown → @slack/bolt/node_modules/hasown}/tsconfig.json +0 -0
- /package/node_modules/{http-errors → @slack/bolt/node_modules/http-errors}/HISTORY.md +0 -0
- /package/node_modules/{http-errors → @slack/bolt/node_modules/http-errors}/LICENSE +0 -0
- /package/node_modules/{http-errors → @slack/bolt/node_modules/http-errors}/README.md +0 -0
- /package/node_modules/{http-errors → @slack/bolt/node_modules/http-errors}/index.js +0 -0
- /package/node_modules/{http-errors → @slack/bolt/node_modules/http-errors}/package.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/LICENSE +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/README.md +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/dbcs-codec.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/dbcs-data.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/index.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/internal.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/sbcs-codec.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/sbcs-data-generated.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/sbcs-data.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/tables/big5-added.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/tables/cp936.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/tables/cp949.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/tables/cp950.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/tables/eucjp.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/tables/gb18030-ranges.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/tables/gbk-added.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/tables/shiftjis.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/utf16.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/utf32.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/encodings/utf7.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/lib/bom-handling.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/lib/helpers/merge-exports.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/lib/index.d.ts +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/lib/index.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/lib/streams.js +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/package.json +0 -0
- /package/node_modules/{iconv-lite → @slack/bolt/node_modules/iconv-lite}/types/encodings.d.ts +0 -0
- /package/node_modules/{inherits → @slack/bolt/node_modules/inherits}/LICENSE +0 -0
- /package/node_modules/{inherits → @slack/bolt/node_modules/inherits}/README.md +0 -0
- /package/node_modules/{inherits → @slack/bolt/node_modules/inherits}/inherits.js +0 -0
- /package/node_modules/{inherits → @slack/bolt/node_modules/inherits}/inherits_browser.js +0 -0
- /package/node_modules/{inherits → @slack/bolt/node_modules/inherits}/package.json +0 -0
- /package/node_modules/{ipaddr.js → @slack/bolt/node_modules/ipaddr.js}/LICENSE +0 -0
- /package/node_modules/{ipaddr.js → @slack/bolt/node_modules/ipaddr.js}/README.md +0 -0
- /package/node_modules/{ipaddr.js → @slack/bolt/node_modules/ipaddr.js}/ipaddr.min.js +0 -0
- /package/node_modules/{ipaddr.js → @slack/bolt/node_modules/ipaddr.js}/lib/ipaddr.js +0 -0
- /package/node_modules/{ipaddr.js → @slack/bolt/node_modules/ipaddr.js}/lib/ipaddr.js.d.ts +0 -0
- /package/node_modules/{ipaddr.js → @slack/bolt/node_modules/ipaddr.js}/package.json +0 -0
- /package/node_modules/{is-promise → @slack/bolt/node_modules/is-promise}/LICENSE +0 -0
- /package/node_modules/{is-promise → @slack/bolt/node_modules/is-promise}/index.d.ts +0 -0
- /package/node_modules/{is-promise → @slack/bolt/node_modules/is-promise}/index.js +0 -0
- /package/node_modules/{is-promise → @slack/bolt/node_modules/is-promise}/index.mjs +0 -0
- /package/node_modules/{is-promise → @slack/bolt/node_modules/is-promise}/package.json +0 -0
- /package/node_modules/{is-promise → @slack/bolt/node_modules/is-promise}/readme.md +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/LICENSE +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/README.md +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/decode.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/index.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/lib/JsonWebTokenError.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/lib/NotBeforeError.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/lib/TokenExpiredError.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/lib/asymmetricKeyDetailsSupported.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/lib/psSupported.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/lib/rsaPssKeyDetailsSupported.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/lib/timespan.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/lib/validateAsymmetricKey.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/package.json +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/sign.js +0 -0
- /package/node_modules/{jsonwebtoken → @slack/bolt/node_modules/jsonwebtoken}/verify.js +0 -0
- /package/node_modules/{jwa → @slack/bolt/node_modules/jwa}/LICENSE +0 -0
- /package/node_modules/{jwa → @slack/bolt/node_modules/jwa}/README.md +0 -0
- /package/node_modules/{jwa → @slack/bolt/node_modules/jwa}/index.js +0 -0
- /package/node_modules/{jwa → @slack/bolt/node_modules/jwa}/opslevel.yml +0 -0
- /package/node_modules/{jwa → @slack/bolt/node_modules/jwa}/package.json +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/CHANGELOG.md +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/LICENSE +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/index.js +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/lib/data-stream.js +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/lib/sign-stream.js +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/lib/tostring.js +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/lib/verify-stream.js +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/opslevel.yml +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/package.json +0 -0
- /package/node_modules/{jws → @slack/bolt/node_modules/jws}/readme.md +0 -0
- /package/node_modules/{lodash.includes → @slack/bolt/node_modules/lodash.includes}/LICENSE +0 -0
- /package/node_modules/{lodash.includes → @slack/bolt/node_modules/lodash.includes}/README.md +0 -0
- /package/node_modules/{lodash.includes → @slack/bolt/node_modules/lodash.includes}/index.js +0 -0
- /package/node_modules/{lodash.includes → @slack/bolt/node_modules/lodash.includes}/package.json +0 -0
- /package/node_modules/{lodash.isboolean → @slack/bolt/node_modules/lodash.isboolean}/LICENSE +0 -0
- /package/node_modules/{lodash.isboolean → @slack/bolt/node_modules/lodash.isboolean}/README.md +0 -0
- /package/node_modules/{lodash.isboolean → @slack/bolt/node_modules/lodash.isboolean}/index.js +0 -0
- /package/node_modules/{lodash.isboolean → @slack/bolt/node_modules/lodash.isboolean}/package.json +0 -0
- /package/node_modules/{lodash.isinteger → @slack/bolt/node_modules/lodash.isinteger}/LICENSE +0 -0
- /package/node_modules/{lodash.isinteger → @slack/bolt/node_modules/lodash.isinteger}/README.md +0 -0
- /package/node_modules/{lodash.isinteger → @slack/bolt/node_modules/lodash.isinteger}/index.js +0 -0
- /package/node_modules/{lodash.isinteger → @slack/bolt/node_modules/lodash.isinteger}/package.json +0 -0
- /package/node_modules/{lodash.isnumber → @slack/bolt/node_modules/lodash.isnumber}/LICENSE +0 -0
- /package/node_modules/{lodash.isnumber → @slack/bolt/node_modules/lodash.isnumber}/README.md +0 -0
- /package/node_modules/{lodash.isnumber → @slack/bolt/node_modules/lodash.isnumber}/index.js +0 -0
- /package/node_modules/{lodash.isnumber → @slack/bolt/node_modules/lodash.isnumber}/package.json +0 -0
- /package/node_modules/{lodash.isplainobject → @slack/bolt/node_modules/lodash.isplainobject}/LICENSE +0 -0
- /package/node_modules/{lodash.isplainobject → @slack/bolt/node_modules/lodash.isplainobject}/README.md +0 -0
- /package/node_modules/{lodash.isplainobject → @slack/bolt/node_modules/lodash.isplainobject}/index.js +0 -0
- /package/node_modules/{lodash.isplainobject → @slack/bolt/node_modules/lodash.isplainobject}/package.json +0 -0
- /package/node_modules/{lodash.isstring → @slack/bolt/node_modules/lodash.isstring}/LICENSE +0 -0
- /package/node_modules/{lodash.isstring → @slack/bolt/node_modules/lodash.isstring}/README.md +0 -0
- /package/node_modules/{lodash.isstring → @slack/bolt/node_modules/lodash.isstring}/index.js +0 -0
- /package/node_modules/{lodash.isstring → @slack/bolt/node_modules/lodash.isstring}/package.json +0 -0
- /package/node_modules/{lodash.once → @slack/bolt/node_modules/lodash.once}/LICENSE +0 -0
- /package/node_modules/{lodash.once → @slack/bolt/node_modules/lodash.once}/README.md +0 -0
- /package/node_modules/{lodash.once → @slack/bolt/node_modules/lodash.once}/index.js +0 -0
- /package/node_modules/{lodash.once → @slack/bolt/node_modules/lodash.once}/package.json +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/.eslintrc +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/.github/FUNDING.yml +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/CHANGELOG.md +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/LICENSE +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/README.md +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/abs.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/abs.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/constants/maxArrayLength.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/constants/maxArrayLength.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/constants/maxSafeInteger.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/constants/maxSafeInteger.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/constants/maxValue.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/constants/maxValue.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/floor.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/floor.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/isFinite.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/isFinite.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/isInteger.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/isInteger.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/isNaN.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/isNaN.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/isNegativeZero.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/isNegativeZero.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/max.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/max.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/min.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/min.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/mod.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/mod.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/package.json +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/pow.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/pow.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/round.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/round.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/sign.d.ts +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/sign.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/test/index.js +0 -0
- /package/node_modules/{math-intrinsics → @slack/bolt/node_modules/math-intrinsics}/tsconfig.json +0 -0
- /package/node_modules/{media-typer → @slack/bolt/node_modules/media-typer}/HISTORY.md +0 -0
- /package/node_modules/{media-typer → @slack/bolt/node_modules/media-typer}/LICENSE +0 -0
- /package/node_modules/{merge-descriptors → @slack/bolt/node_modules/merge-descriptors}/index.d.ts +0 -0
- /package/node_modules/{merge-descriptors → @slack/bolt/node_modules/merge-descriptors}/index.js +0 -0
- /package/node_modules/{merge-descriptors → @slack/bolt/node_modules/merge-descriptors}/license +0 -0
- /package/node_modules/{merge-descriptors → @slack/bolt/node_modules/merge-descriptors}/package.json +0 -0
- /package/node_modules/{merge-descriptors → @slack/bolt/node_modules/merge-descriptors}/readme.md +0 -0
- /package/node_modules/{mime-db → @slack/bolt/node_modules/mime-db}/HISTORY.md +0 -0
- /package/node_modules/{mime-db → @slack/bolt/node_modules/mime-db}/LICENSE +0 -0
- /package/node_modules/{mime-db → @slack/bolt/node_modules/mime-db}/README.md +0 -0
- /package/node_modules/{mime-db → @slack/bolt/node_modules/mime-db}/db.json +0 -0
- /package/node_modules/{mime-db → @slack/bolt/node_modules/mime-db}/index.js +0 -0
- /package/node_modules/{mime-db → @slack/bolt/node_modules/mime-db}/package.json +0 -0
- /package/node_modules/{mime-types → @slack/bolt/node_modules/mime-types}/HISTORY.md +0 -0
- /package/node_modules/{mime-types → @slack/bolt/node_modules/mime-types}/LICENSE +0 -0
- /package/node_modules/{mime-types → @slack/bolt/node_modules/mime-types}/README.md +0 -0
- /package/node_modules/{mime-types → @slack/bolt/node_modules/mime-types}/index.js +0 -0
- /package/node_modules/{mime-types → @slack/bolt/node_modules/mime-types}/mimeScore.js +0 -0
- /package/node_modules/{mime-types → @slack/bolt/node_modules/mime-types}/package.json +0 -0
- /package/node_modules/{ms → @slack/bolt/node_modules/ms}/index.js +0 -0
- /package/node_modules/{ms → @slack/bolt/node_modules/ms}/license.md +0 -0
- /package/node_modules/{ms → @slack/bolt/node_modules/ms}/package.json +0 -0
- /package/node_modules/{ms → @slack/bolt/node_modules/ms}/readme.md +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/HISTORY.md +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/LICENSE +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/README.md +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/index.js +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/lib/charset.js +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/lib/encoding.js +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/lib/language.js +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/lib/mediaType.js +0 -0
- /package/node_modules/{negotiator → @slack/bolt/node_modules/negotiator}/package.json +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/.eslintrc +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/.github/FUNDING.yml +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/.nycrc +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/CHANGELOG.md +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/LICENSE +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/example/all.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/example/circular.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/example/fn.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/example/inspect.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/index.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/package-support.json +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/package.json +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/readme.markdown +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/bigint.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/browser/dom.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/circular.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/deep.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/element.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/err.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/fakes.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/fn.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/global.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/has.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/holes.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/indent-option.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/inspect.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/lowbyte.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/number.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/quoteStyle.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/toStringTag.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/undef.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test/values.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/test-core-js.js +0 -0
- /package/node_modules/{object-inspect → @slack/bolt/node_modules/object-inspect}/util.inspect.js +0 -0
- /package/node_modules/{on-finished → @slack/bolt/node_modules/on-finished}/HISTORY.md +0 -0
- /package/node_modules/{on-finished → @slack/bolt/node_modules/on-finished}/LICENSE +0 -0
- /package/node_modules/{on-finished → @slack/bolt/node_modules/on-finished}/README.md +0 -0
- /package/node_modules/{on-finished → @slack/bolt/node_modules/on-finished}/index.js +0 -0
- /package/node_modules/{on-finished → @slack/bolt/node_modules/on-finished}/package.json +0 -0
- /package/node_modules/{once → @slack/bolt/node_modules/once}/LICENSE +0 -0
- /package/node_modules/{once → @slack/bolt/node_modules/once}/README.md +0 -0
- /package/node_modules/{once → @slack/bolt/node_modules/once}/once.js +0 -0
- /package/node_modules/{once → @slack/bolt/node_modules/once}/package.json +0 -0
- /package/node_modules/{parseurl → @slack/bolt/node_modules/parseurl}/HISTORY.md +0 -0
- /package/node_modules/{parseurl → @slack/bolt/node_modules/parseurl}/LICENSE +0 -0
- /package/node_modules/{parseurl → @slack/bolt/node_modules/parseurl}/README.md +0 -0
- /package/node_modules/{parseurl → @slack/bolt/node_modules/parseurl}/index.js +0 -0
- /package/node_modules/{parseurl → @slack/bolt/node_modules/parseurl}/package.json +0 -0
- /package/node_modules/{path-to-regexp → @slack/bolt/node_modules/path-to-regexp}/LICENSE +0 -0
- /package/node_modules/{path-to-regexp → @slack/bolt/node_modules/path-to-regexp}/Readme.md +0 -0
- /package/node_modules/{path-to-regexp → @slack/bolt/node_modules/path-to-regexp}/dist/index.d.ts +0 -0
- /package/node_modules/{path-to-regexp → @slack/bolt/node_modules/path-to-regexp}/dist/index.js +0 -0
- /package/node_modules/{path-to-regexp → @slack/bolt/node_modules/path-to-regexp}/dist/index.js.map +0 -0
- /package/node_modules/{path-to-regexp → @slack/bolt/node_modules/path-to-regexp}/package.json +0 -0
- /package/node_modules/{proxy-addr → @slack/bolt/node_modules/proxy-addr}/HISTORY.md +0 -0
- /package/node_modules/{proxy-addr → @slack/bolt/node_modules/proxy-addr}/LICENSE +0 -0
- /package/node_modules/{proxy-addr → @slack/bolt/node_modules/proxy-addr}/README.md +0 -0
- /package/node_modules/{proxy-addr → @slack/bolt/node_modules/proxy-addr}/index.js +0 -0
- /package/node_modules/{proxy-addr → @slack/bolt/node_modules/proxy-addr}/package.json +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/.editorconfig +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/.github/FUNDING.yml +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/.github/SECURITY.md +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/.github/THREAT_MODEL.md +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/.nycrc +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/CHANGELOG.md +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/LICENSE.md +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/README.md +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/dist/qs.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/eslint.config.mjs +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/lib/formats.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/lib/index.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/lib/parse.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/lib/stringify.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/lib/utils.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/package.json +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/test/empty-keys-cases.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/test/parse.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/test/stringify.js +0 -0
- /package/node_modules/{qs → @slack/bolt/node_modules/qs}/test/utils.js +0 -0
- /package/node_modules/{range-parser → @slack/bolt/node_modules/range-parser}/HISTORY.md +0 -0
- /package/node_modules/{range-parser → @slack/bolt/node_modules/range-parser}/LICENSE +0 -0
- /package/node_modules/{range-parser → @slack/bolt/node_modules/range-parser}/README.md +0 -0
- /package/node_modules/{range-parser → @slack/bolt/node_modules/range-parser}/index.js +0 -0
- /package/node_modules/{range-parser → @slack/bolt/node_modules/range-parser}/package.json +0 -0
- /package/node_modules/{raw-body → @slack/bolt/node_modules/raw-body}/LICENSE +0 -0
- /package/node_modules/{raw-body → @slack/bolt/node_modules/raw-body}/README.md +0 -0
- /package/node_modules/{raw-body → @slack/bolt/node_modules/raw-body}/index.d.ts +0 -0
- /package/node_modules/{raw-body → @slack/bolt/node_modules/raw-body}/index.js +0 -0
- /package/node_modules/{raw-body → @slack/bolt/node_modules/raw-body}/package.json +0 -0
- /package/node_modules/{router → @slack/bolt/node_modules/router}/HISTORY.md +0 -0
- /package/node_modules/{router → @slack/bolt/node_modules/router}/LICENSE +0 -0
- /package/node_modules/{router → @slack/bolt/node_modules/router}/README.md +0 -0
- /package/node_modules/{router → @slack/bolt/node_modules/router}/index.js +0 -0
- /package/node_modules/{router → @slack/bolt/node_modules/router}/lib/layer.js +0 -0
- /package/node_modules/{router → @slack/bolt/node_modules/router}/lib/route.js +0 -0
- /package/node_modules/{router → @slack/bolt/node_modules/router}/package.json +0 -0
- /package/node_modules/{safe-buffer → @slack/bolt/node_modules/safe-buffer}/LICENSE +0 -0
- /package/node_modules/{safe-buffer → @slack/bolt/node_modules/safe-buffer}/README.md +0 -0
- /package/node_modules/{safe-buffer → @slack/bolt/node_modules/safe-buffer}/index.d.ts +0 -0
- /package/node_modules/{safe-buffer → @slack/bolt/node_modules/safe-buffer}/index.js +0 -0
- /package/node_modules/{safe-buffer → @slack/bolt/node_modules/safe-buffer}/package.json +0 -0
- /package/node_modules/{safer-buffer → @slack/bolt/node_modules/safer-buffer}/LICENSE +0 -0
- /package/node_modules/{safer-buffer → @slack/bolt/node_modules/safer-buffer}/Porting-Buffer.md +0 -0
- /package/node_modules/{safer-buffer → @slack/bolt/node_modules/safer-buffer}/Readme.md +0 -0
- /package/node_modules/{safer-buffer → @slack/bolt/node_modules/safer-buffer}/dangerous.js +0 -0
- /package/node_modules/{safer-buffer → @slack/bolt/node_modules/safer-buffer}/package.json +0 -0
- /package/node_modules/{safer-buffer → @slack/bolt/node_modules/safer-buffer}/safer.js +0 -0
- /package/node_modules/{safer-buffer → @slack/bolt/node_modules/safer-buffer}/tests.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/LICENSE +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/README.md +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/bin/semver.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/classes/comparator.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/classes/index.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/classes/range.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/classes/semver.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/clean.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/cmp.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/coerce.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/compare-build.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/compare-loose.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/compare.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/diff.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/eq.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/gt.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/gte.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/inc.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/lt.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/lte.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/major.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/minor.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/neq.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/parse.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/patch.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/prerelease.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/rcompare.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/rsort.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/satisfies.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/sort.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/truncate.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/functions/valid.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/index.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/internal/constants.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/internal/debug.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/internal/identifiers.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/internal/lrucache.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/internal/parse-options.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/internal/re.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/package.json +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/preload.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/range.bnf +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/gtr.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/intersects.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/ltr.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/max-satisfying.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/min-satisfying.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/min-version.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/outside.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/simplify.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/subset.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/to-comparators.js +0 -0
- /package/node_modules/{semver → @slack/bolt/node_modules/semver}/ranges/valid.js +0 -0
- /package/node_modules/{send → @slack/bolt/node_modules/send}/LICENSE +0 -0
- /package/node_modules/{send → @slack/bolt/node_modules/send}/README.md +0 -0
- /package/node_modules/{send → @slack/bolt/node_modules/send}/index.js +0 -0
- /package/node_modules/{send → @slack/bolt/node_modules/send}/package.json +0 -0
- /package/node_modules/{serve-static → @slack/bolt/node_modules/serve-static}/LICENSE +0 -0
- /package/node_modules/{serve-static → @slack/bolt/node_modules/serve-static}/README.md +0 -0
- /package/node_modules/{serve-static → @slack/bolt/node_modules/serve-static}/index.js +0 -0
- /package/node_modules/{serve-static → @slack/bolt/node_modules/serve-static}/package.json +0 -0
- /package/node_modules/{setprototypeof → @slack/bolt/node_modules/setprototypeof}/LICENSE +0 -0
- /package/node_modules/{setprototypeof → @slack/bolt/node_modules/setprototypeof}/README.md +0 -0
- /package/node_modules/{setprototypeof → @slack/bolt/node_modules/setprototypeof}/index.d.ts +0 -0
- /package/node_modules/{setprototypeof → @slack/bolt/node_modules/setprototypeof}/index.js +0 -0
- /package/node_modules/{setprototypeof → @slack/bolt/node_modules/setprototypeof}/package.json +0 -0
- /package/node_modules/{setprototypeof → @slack/bolt/node_modules/setprototypeof}/test/index.js +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/.editorconfig +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/.eslintrc +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/.github/FUNDING.yml +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/.nycrc +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/CHANGELOG.md +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/LICENSE +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/README.md +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/index.d.ts +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/index.js +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/package.json +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/test/index.js +0 -0
- /package/node_modules/{side-channel → @slack/bolt/node_modules/side-channel}/tsconfig.json +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/.editorconfig +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/.eslintrc +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/.github/FUNDING.yml +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/.nycrc +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/CHANGELOG.md +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/LICENSE +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/README.md +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/index.d.ts +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/index.js +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/list.d.ts +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/package.json +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/test/index.js +0 -0
- /package/node_modules/{side-channel-list → @slack/bolt/node_modules/side-channel-list}/tsconfig.json +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/.editorconfig +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/.eslintrc +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/.github/FUNDING.yml +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/.nycrc +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/CHANGELOG.md +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/LICENSE +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/README.md +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/index.d.ts +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/index.js +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/package.json +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/test/index.js +0 -0
- /package/node_modules/{side-channel-map → @slack/bolt/node_modules/side-channel-map}/tsconfig.json +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/.editorconfig +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/.eslintrc +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/.github/FUNDING.yml +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/.nycrc +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/CHANGELOG.md +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/LICENSE +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/README.md +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/index.d.ts +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/index.js +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/package.json +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/test/index.js +0 -0
- /package/node_modules/{side-channel-weakmap → @slack/bolt/node_modules/side-channel-weakmap}/tsconfig.json +0 -0
- /package/node_modules/{statuses → @slack/bolt/node_modules/statuses}/HISTORY.md +0 -0
- /package/node_modules/{statuses → @slack/bolt/node_modules/statuses}/LICENSE +0 -0
- /package/node_modules/{statuses → @slack/bolt/node_modules/statuses}/README.md +0 -0
- /package/node_modules/{statuses → @slack/bolt/node_modules/statuses}/codes.json +0 -0
- /package/node_modules/{statuses → @slack/bolt/node_modules/statuses}/index.js +0 -0
- /package/node_modules/{statuses → @slack/bolt/node_modules/statuses}/package.json +0 -0
- /package/node_modules/{toidentifier → @slack/bolt/node_modules/toidentifier}/HISTORY.md +0 -0
- /package/node_modules/{toidentifier → @slack/bolt/node_modules/toidentifier}/LICENSE +0 -0
- /package/node_modules/{toidentifier → @slack/bolt/node_modules/toidentifier}/README.md +0 -0
- /package/node_modules/{toidentifier → @slack/bolt/node_modules/toidentifier}/index.js +0 -0
- /package/node_modules/{toidentifier → @slack/bolt/node_modules/toidentifier}/package.json +0 -0
- /package/node_modules/{tsscmp → @slack/bolt/node_modules/tsscmp}/.travis.yml +0 -0
- /package/node_modules/{tsscmp → @slack/bolt/node_modules/tsscmp}/LICENSE +0 -0
- /package/node_modules/{tsscmp → @slack/bolt/node_modules/tsscmp}/README.md +0 -0
- /package/node_modules/{tsscmp → @slack/bolt/node_modules/tsscmp}/appveyor.yml +0 -0
- /package/node_modules/{tsscmp → @slack/bolt/node_modules/tsscmp}/lib/index.js +0 -0
- /package/node_modules/{tsscmp → @slack/bolt/node_modules/tsscmp}/package.json +0 -0
- /package/node_modules/{tsscmp → @slack/bolt/node_modules/tsscmp}/test/benchmark/index.js +0 -0
- /package/node_modules/{tsscmp → @slack/bolt/node_modules/tsscmp}/test/unit/index.js +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/HISTORY.md +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/LICENSE +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/README.md +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/index.js +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/node_modules/content-type/LICENSE +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/node_modules/content-type/README.md +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/node_modules/content-type/dist/index.d.ts +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/node_modules/content-type/dist/index.js +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/node_modules/content-type/dist/index.js.map +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/node_modules/content-type/package.json +0 -0
- /package/node_modules/{type-is → @slack/bolt/node_modules/type-is}/package.json +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/LICENSE +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/README.md +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/agent.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/api.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/balanced-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/cache-interceptor.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/cache.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/client-stats.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/client.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/connector.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/content-type.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/cookies.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/diagnostics-channel.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/dispatcher.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/dispatcher1-wrapper.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/env-http-proxy-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/errors.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/eventsource.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/fetch.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/formdata.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/global-dispatcher.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/global-origin.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/h2c-client.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/handlers.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/header.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/index.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/interceptors.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/mock-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/mock-call-history.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/mock-client.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/mock-errors.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/mock-interceptor.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/mock-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/package.json +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/patch.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/pool-stats.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/pool.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/proxy-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/readable.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/retry-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/retry-handler.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/round-robin-pool.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/snapshot-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/socks5-proxy-agent.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/util.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/utility.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/webidl.d.ts +0 -0
- /package/node_modules/{undici-types → @slack/bolt/node_modules/undici-types}/websocket.d.ts +0 -0
- /package/node_modules/{unpipe → @slack/bolt/node_modules/unpipe}/HISTORY.md +0 -0
- /package/node_modules/{unpipe → @slack/bolt/node_modules/unpipe}/LICENSE +0 -0
- /package/node_modules/{unpipe → @slack/bolt/node_modules/unpipe}/README.md +0 -0
- /package/node_modules/{unpipe → @slack/bolt/node_modules/unpipe}/index.js +0 -0
- /package/node_modules/{unpipe → @slack/bolt/node_modules/unpipe}/package.json +0 -0
- /package/node_modules/{vary → @slack/bolt/node_modules/vary}/HISTORY.md +0 -0
- /package/node_modules/{vary → @slack/bolt/node_modules/vary}/LICENSE +0 -0
- /package/node_modules/{vary → @slack/bolt/node_modules/vary}/README.md +0 -0
- /package/node_modules/{vary → @slack/bolt/node_modules/vary}/index.js +0 -0
- /package/node_modules/{vary → @slack/bolt/node_modules/vary}/package.json +0 -0
- /package/node_modules/{wrappy → @slack/bolt/node_modules/wrappy}/LICENSE +0 -0
- /package/node_modules/{wrappy → @slack/bolt/node_modules/wrappy}/README.md +0 -0
- /package/node_modules/{wrappy → @slack/bolt/node_modules/wrappy}/package.json +0 -0
- /package/node_modules/{wrappy → @slack/bolt/node_modules/wrappy}/wrappy.js +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/LICENSE +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/README.md +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/dist/eventemitter3.esm.js +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/dist/eventemitter3.esm.min.js +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/dist/eventemitter3.esm.min.js.map +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/dist/eventemitter3.umd.js +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/dist/eventemitter3.umd.min.js +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/dist/eventemitter3.umd.min.js.map +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/index.d.ts +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/index.js +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/index.mjs +0 -0
- /package/node_modules/{eventemitter3 → @slack/socket-mode/node_modules/eventemitter3}/package.json +0 -0
- /package/node_modules/{@types → @slack/web-api/node_modules/@types}/retry/LICENSE +0 -0
- /package/node_modules/{@types → @slack/web-api/node_modules/@types}/retry/README.md +0 -0
- /package/node_modules/{@types → @slack/web-api/node_modules/@types}/retry/index.d.ts +0 -0
- /package/node_modules/{@types → @slack/web-api/node_modules/@types}/retry/package.json +0 -0
- /package/node_modules/{p-queue → @slack/web-api}/node_modules/eventemitter3/LICENSE +0 -0
- /package/node_modules/{p-queue → @slack/web-api}/node_modules/eventemitter3/index.js +0 -0
- /package/node_modules/{p-finally → @slack/web-api/node_modules/p-finally}/index.js +0 -0
- /package/node_modules/{p-finally → @slack/web-api/node_modules/p-finally}/license +0 -0
- /package/node_modules/{p-finally → @slack/web-api/node_modules/p-finally}/package.json +0 -0
- /package/node_modules/{p-finally → @slack/web-api/node_modules/p-finally}/readme.md +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/index.d.ts +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/index.js +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/lower-bound.d.ts +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/lower-bound.js +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/options.d.ts +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/options.js +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/priority-queue.d.ts +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/priority-queue.js +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/queue.d.ts +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/dist/queue.js +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/license +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/node_modules/eventemitter3/README.md +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/node_modules/eventemitter3/index.d.ts +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/node_modules/eventemitter3/package.json +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/node_modules/eventemitter3/umd/eventemitter3.js +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/node_modules/eventemitter3/umd/eventemitter3.min.js +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/node_modules/eventemitter3/umd/eventemitter3.min.js.map +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/package.json +0 -0
- /package/node_modules/{p-queue → @slack/web-api/node_modules/p-queue}/readme.md +0 -0
- /package/node_modules/{p-retry → @slack/web-api/node_modules/p-retry}/index.d.ts +0 -0
- /package/node_modules/{p-retry → @slack/web-api/node_modules/p-retry}/index.js +0 -0
- /package/node_modules/{p-retry → @slack/web-api/node_modules/p-retry}/license +0 -0
- /package/node_modules/{p-retry → @slack/web-api/node_modules/p-retry}/package.json +0 -0
- /package/node_modules/{p-retry → @slack/web-api/node_modules/p-retry}/readme.md +0 -0
- /package/node_modules/{p-timeout → @slack/web-api/node_modules/p-timeout}/index.d.ts +0 -0
- /package/node_modules/{p-timeout → @slack/web-api/node_modules/p-timeout}/index.js +0 -0
- /package/node_modules/{p-timeout → @slack/web-api/node_modules/p-timeout}/license +0 -0
- /package/node_modules/{p-timeout → @slack/web-api/node_modules/p-timeout}/package.json +0 -0
- /package/node_modules/{p-timeout → @slack/web-api/node_modules/p-timeout}/readme.md +0 -0
- /package/node_modules/{retry → @slack/web-api/node_modules/retry}/License +0 -0
- /package/node_modules/{retry → @slack/web-api/node_modules/retry}/README.md +0 -0
- /package/node_modules/{retry → @slack/web-api/node_modules/retry}/example/dns.js +0 -0
- /package/node_modules/{retry → @slack/web-api/node_modules/retry}/example/stop.js +0 -0
- /package/node_modules/{retry → @slack/web-api/node_modules/retry}/index.js +0 -0
- /package/node_modules/{retry → @slack/web-api/node_modules/retry}/lib/retry.js +0 -0
- /package/node_modules/{retry → @slack/web-api/node_modules/retry}/lib/retry_operation.js +0 -0
- /package/node_modules/{retry → @slack/web-api/node_modules/retry}/package.json +0 -0
|
@@ -1,4360 +0,0 @@
|
|
|
1
|
-
import { t as resolveSlackReplyToMode } from "./account-reply-mode-DrUXogvO.js";
|
|
2
|
-
import { i as parseSlackTarget } from "./target-parsing-N6lHogYZ.js";
|
|
3
|
-
import "./targets-KmjP2E8s.js";
|
|
4
|
-
import { A as normalizeSlackOutboundText, C as hasSlackNativeDataBlock, F as SLACK_EDIT_TEXT_LIMIT, L as SLACK_TEXT_LIMIT, V as truncateSlackText, Z as escapeSlackMrkdwn, _ as resolveSlackReplyRenderPlan, c as normalizeSlackAllowOwnerEntry, j as buildSlackBlocksFallbackText, s as normalizeAllowListLower, u as resolveSlackAllowListMatch } from "./group-policy-CthIXE2T.js";
|
|
5
|
-
import { r as formatSlackError } from "./probe-BhQTDVBQ.js";
|
|
6
|
-
import { n as resolveSlackNativeStreaming, r as resolveSlackStreamingMode, t as mapStreamingModeToSlackLegacyDraftStreamMode } from "./streaming-compat-3_X-21wW.js";
|
|
7
|
-
import { S as buildSlackEditTextPayload, _ as resolveSlackThreadHistory, b as resolveSlackBlocksText, f as removeSlackReaction, l as reactSlackMessage, r as editSlackMessage, t as deleteSlackMessage, v as resolveSlackThreadStarter, x as formatSlackFileReference, y as chooseSlackPrimaryText } from "./actions-BkOaiDSX.js";
|
|
8
|
-
import { c as hasSlackThreadParticipationWithPersistence, l as recordSlackThreadParticipation, r as sendMessageSlack, u as buildSlackNativeDataDeliveryPlan } from "./send-2IoDXPeB.js";
|
|
9
|
-
import { C as stripSlackMentionsForCommandDetection, _ as readSessionUpdatedAt, b as resolveStorePath, d as resolveSlackCommandIngress, f as resolveSlackEffectiveAllowFrom, g as resolveSlackChatType, h as normalizeSlackChannelType, l as resolveConversationLabel$1, m as parseSlackAssistantThreadMetadata, o as authorizeSlackDirectMessage, p as buildSlackAssistantThreadMetadata, r as resolveSlackRoomContextHints, u as authorizeSlackBotRoomMessage, v as resolveChannelContextVisibilityMode, x as updateLastRoute, y as resolveChannelResetConfig } from "./provider-PSppCU_K.js";
|
|
10
|
-
import { n as resolveSlackChannelConfig } from "./policy-DVg6FyMP.js";
|
|
11
|
-
import { a as resolveDeliveredSlackReplyThreadTs, i as readSlackReplyBlocks, n as deliverReplies, o as resolveSlackThreadTs, s as emitSlackMessageSentHooks, t as createSlackReplyDeliveryPlan } from "./replies-BkPPM2Ri.js";
|
|
12
|
-
import { asOptionalRecord, normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
13
|
-
import { resolveAgentRoute, resolveInboundLastRouteSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
14
|
-
import { buildChannelProgressDraftLine, buildChannelProgressDraftLineForEntry, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createChannelProgressReceiptTracker, createDraftStreamLoop, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, formatChannelProgressDraftText, formatPlanChecklistLines, isChannelProgressDraftWorkToolName, mergeChannelProgressDraftLine, resolveAgentOutboundIdentity, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelProgressDraftConfig, resolveChannelProgressDraftMaxLineChars, resolveChannelProgressDraftMaxLines, resolveChannelProgressDraftRender, resolveChannelStreamingBlockEnabled, resolveChannelStreamingNativeTransport, resolveChannelStreamingPreviewToolProgress, resolveChannelStreamingSuppressDefaultToolProgressMessages } from "openclaw/plugin-sdk/channel-outbound";
|
|
15
|
-
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
16
|
-
import { danger, logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
17
|
-
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
18
|
-
import { createHash } from "node:crypto";
|
|
19
|
-
import fs from "node:fs/promises";
|
|
20
|
-
import { formatErrorMessage, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
21
|
-
import { asDateTimestampMs, asFiniteNumberInRange, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
22
|
-
import { buildTtsSupplementMediaPayload, getReplyPayloadTtsSupplement, resolveSendableOutboundReplyParts } from "openclaw/plugin-sdk/reply-payload";
|
|
23
|
-
import { filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist, shouldIncludeSupplementalContext } from "openclaw/plugin-sdk/security-runtime";
|
|
24
|
-
import { ensureConfiguredBindingRouteReady, resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-runtime";
|
|
25
|
-
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
26
|
-
import { resolveDefaultAgentId, resolveHumanDelayConfig } from "openclaw/plugin-sdk/agent-runtime";
|
|
27
|
-
import { mergePairLoopGuardConfig } from "openclaw/plugin-sdk/pair-loop-guard-runtime";
|
|
28
|
-
import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
29
|
-
import { resolveChannelImplicitMentions } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
30
|
-
import { buildChannelInboundEventContext, buildMentionRegexes, classifyChannelInboundEvent, dispatchChannelInboundTurn, formatInboundEnvelope, hasVisibleInboundReplyDispatch, implicitMentionKindWhen, logInboundDrop, matchesMentionWithExplicit, recordDroppedChannelInboundHistory, resolveEnvelopeFormatOptions, resolveInboundMentionDecision, resolveInboundSupplementalSenderAllowed, resolveUnmentionedGroupInboundPolicy, toInboundMediaFacts } from "openclaw/plugin-sdk/channel-inbound";
|
|
31
|
-
import { DEFAULT_TIMING, createStatusReactionController, logAckFailure, logTypingFailure, resolveAckReaction, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
|
|
32
|
-
import { hasControlCommand } from "openclaw/plugin-sdk/command-detection";
|
|
33
|
-
import { isAbortRequestText } from "openclaw/plugin-sdk/command-primitives-runtime";
|
|
34
|
-
import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
35
|
-
import { mimeTypeFromFilePath } from "openclaw/plugin-sdk/media-mime";
|
|
36
|
-
import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime";
|
|
37
|
-
//#region extensions/slack/src/streaming.ts
|
|
38
|
-
/**
|
|
39
|
-
* Thrown when Slack definitively rejects a stream flush/finalize while text
|
|
40
|
-
* remains buffered locally by the Slack SDK. Carries the pending text so the
|
|
41
|
-
* caller can deliver it via the normal Slack reply path.
|
|
42
|
-
*/
|
|
43
|
-
var SlackStreamNotDeliveredError = class extends Error {
|
|
44
|
-
constructor(pendingText, slackCode) {
|
|
45
|
-
super(`slack-stream: finalize failed with ${slackCode} before buffered text reached Slack (${pendingText.length} chars pending)`);
|
|
46
|
-
this.name = "SlackStreamNotDeliveredError";
|
|
47
|
-
this.pendingText = pendingText;
|
|
48
|
-
this.slackCode = slackCode;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* Start a new Slack text stream.
|
|
53
|
-
*
|
|
54
|
-
* Returns a {@link SlackStreamSession} that should be passed to
|
|
55
|
-
* {@link appendSlackStream} and {@link stopSlackStream}.
|
|
56
|
-
*
|
|
57
|
-
* The first chunk of text can optionally be included via `text`.
|
|
58
|
-
*/
|
|
59
|
-
async function startSlackStream(params) {
|
|
60
|
-
const { client, channel, threadTs, text, chunks, taskDisplayMode, teamId, userId, identity } = params;
|
|
61
|
-
const identityPayload = identity?.iconUrl ? {
|
|
62
|
-
...identity.username ? { username: identity.username } : {},
|
|
63
|
-
icon_url: identity.iconUrl
|
|
64
|
-
} : identity?.iconEmoji ? {
|
|
65
|
-
...identity.username ? { username: identity.username } : {},
|
|
66
|
-
icon_emoji: identity.iconEmoji
|
|
67
|
-
} : identity?.username ? { username: identity.username } : {};
|
|
68
|
-
logVerbose(`slack-stream: starting stream in ${channel} thread=${threadTs}${teamId ? ` team=${teamId}` : ""}${userId ? ` user=${userId}` : ""}`);
|
|
69
|
-
const streamer = client.chatStream({
|
|
70
|
-
channel,
|
|
71
|
-
thread_ts: threadTs,
|
|
72
|
-
...taskDisplayMode ? { task_display_mode: taskDisplayMode } : {},
|
|
73
|
-
...teamId ? { recipient_team_id: teamId } : {},
|
|
74
|
-
...userId ? { recipient_user_id: userId } : {},
|
|
75
|
-
...identityPayload
|
|
76
|
-
});
|
|
77
|
-
const session = {
|
|
78
|
-
streamer,
|
|
79
|
-
channel,
|
|
80
|
-
threadTs,
|
|
81
|
-
stopped: false,
|
|
82
|
-
delivered: false,
|
|
83
|
-
pendingText: ""
|
|
84
|
-
};
|
|
85
|
-
if (text || chunks?.length) {
|
|
86
|
-
if (text) session.pendingText += text;
|
|
87
|
-
try {
|
|
88
|
-
const result = await streamer.append({
|
|
89
|
-
...text ? { markdown_text: text } : {},
|
|
90
|
-
...chunks?.length ? { chunks } : {}
|
|
91
|
-
});
|
|
92
|
-
if (result) {
|
|
93
|
-
session.delivered = true;
|
|
94
|
-
session.pendingText = "";
|
|
95
|
-
}
|
|
96
|
-
logVerbose(`slack-stream: appended initial payload (${text?.length ?? 0} chars, ${chunks?.length ?? 0} chunks, ${result ? "flushed" : "buffered"})`);
|
|
97
|
-
} catch (err) {
|
|
98
|
-
if (isBenignSlackFinalizeError(err) && session.pendingText) throw new SlackStreamNotDeliveredError(session.pendingText, extractSlackErrorCode(err) ?? "unknown");
|
|
99
|
-
throw err;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return session;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Append markdown text to an active Slack stream.
|
|
106
|
-
*/
|
|
107
|
-
async function appendSlackStream(params) {
|
|
108
|
-
const { session, text, chunks } = params;
|
|
109
|
-
if (session.stopped) {
|
|
110
|
-
logVerbose("slack-stream: attempted to append to a stopped stream, ignoring");
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (!text && !chunks?.length) return;
|
|
114
|
-
if (text) session.pendingText += text;
|
|
115
|
-
try {
|
|
116
|
-
const result = await session.streamer.append({
|
|
117
|
-
...text ? { markdown_text: text } : {},
|
|
118
|
-
...chunks?.length ? { chunks } : {}
|
|
119
|
-
});
|
|
120
|
-
if (result) {
|
|
121
|
-
session.delivered = true;
|
|
122
|
-
session.pendingText = "";
|
|
123
|
-
}
|
|
124
|
-
logVerbose(`slack-stream: appended ${text?.length ?? 0} chars, ${chunks?.length ?? 0} chunks (${result ? "flushed" : "buffered"})`);
|
|
125
|
-
} catch (err) {
|
|
126
|
-
if (isBenignSlackFinalizeError(err) && session.pendingText) throw new SlackStreamNotDeliveredError(session.pendingText, extractSlackErrorCode(err) ?? "unknown");
|
|
127
|
-
throw err;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Stop (finalize) a Slack stream.
|
|
132
|
-
*
|
|
133
|
-
* After calling this the stream message becomes a normal Slack message.
|
|
134
|
-
* Optionally include final text to append before stopping.
|
|
135
|
-
*
|
|
136
|
-
* If Slack's `chat.stopStream` responds with a definitive recipient/channel
|
|
137
|
-
* rejection while text is still buffered locally, this function throws a
|
|
138
|
-
* {@link SlackStreamNotDeliveredError} carrying that pending text so the caller
|
|
139
|
-
* can deliver it through the normal Slack reply path. Ambiguous failures
|
|
140
|
-
* propagate unchanged because Slack may have committed the request.
|
|
141
|
-
*
|
|
142
|
-
* If Slack responds with a known benign finalize error (see
|
|
143
|
-
* {@link BENIGN_SLACK_FINALIZE_ERROR_CODES}) after prior `append` calls already
|
|
144
|
-
* landed, the error is swallowed and the session is marked stopped - the
|
|
145
|
-
* already-delivered text stays visible.
|
|
146
|
-
*
|
|
147
|
-
* Errors without buffered text propagate unchanged.
|
|
148
|
-
*
|
|
149
|
-
* On success, returns the finalized message's Slack `ts` (when reported) so the
|
|
150
|
-
* caller can emit the `message_sent` hook with a populated `messageId`.
|
|
151
|
-
*/
|
|
152
|
-
async function stopSlackStream(params) {
|
|
153
|
-
const { session, text, chunks, metadata } = params;
|
|
154
|
-
if (session.stopped) {
|
|
155
|
-
logVerbose("slack-stream: stream already stopped, ignoring duplicate stop");
|
|
156
|
-
return {};
|
|
157
|
-
}
|
|
158
|
-
session.stopped = true;
|
|
159
|
-
if (text) session.pendingText += text;
|
|
160
|
-
logVerbose(`slack-stream: stopping stream in ${session.channel} thread=${session.threadTs}${text ? ` (final text: ${text.length} chars)` : ""}`);
|
|
161
|
-
try {
|
|
162
|
-
const stopResponse = await session.streamer.stop(text || chunks?.length || metadata ? {
|
|
163
|
-
...text ? { markdown_text: text } : {},
|
|
164
|
-
...chunks?.length ? { chunks } : {},
|
|
165
|
-
...metadata ? { metadata } : {}
|
|
166
|
-
} : void 0);
|
|
167
|
-
session.delivered = true;
|
|
168
|
-
session.pendingText = "";
|
|
169
|
-
logVerbose("slack-stream: stream stopped");
|
|
170
|
-
const messageId = stopResponse?.ts ?? stopResponse?.message?.ts;
|
|
171
|
-
return messageId ? { messageId } : {};
|
|
172
|
-
} catch (err) {
|
|
173
|
-
const code = extractSlackErrorCode(err) ?? "unknown";
|
|
174
|
-
const benignFinalizeError = isBenignSlackFinalizeError(err);
|
|
175
|
-
if (session.pendingText && (benignFinalizeError || code === "missing_scope")) throw new SlackStreamNotDeliveredError(session.pendingText, code);
|
|
176
|
-
if (benignFinalizeError) {
|
|
177
|
-
if (session.delivered) {
|
|
178
|
-
logVerbose(`slack-stream: finalize rejected by Slack (${code}); prior appends delivered, treating stream as stopped`);
|
|
179
|
-
return {};
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
throw err;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Slack API error codes that indicate `chat.stopStream` (or the
|
|
187
|
-
* `chat.startStream` call the SDK issues inside `stop()` when the buffer
|
|
188
|
-
* never flushed) cannot finalize the stream for the current recipient or
|
|
189
|
-
* team. Either the caller falls back to a normal message (see
|
|
190
|
-
* {@link SlackStreamNotDeliveredError}) or, if prior appends already
|
|
191
|
-
* delivered text, the error is logged verbosely and swallowed.
|
|
192
|
-
*/
|
|
193
|
-
const BENIGN_SLACK_FINALIZE_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
194
|
-
"user_not_found",
|
|
195
|
-
"team_not_found",
|
|
196
|
-
"missing_recipient_user_id",
|
|
197
|
-
"method_not_supported_for_channel_type"
|
|
198
|
-
]);
|
|
199
|
-
function isBenignSlackFinalizeError(err) {
|
|
200
|
-
const code = extractSlackErrorCode(err);
|
|
201
|
-
return code !== void 0 && BENIGN_SLACK_FINALIZE_ERROR_CODES.has(code);
|
|
202
|
-
}
|
|
203
|
-
function extractSlackErrorCode(err) {
|
|
204
|
-
if (!err || typeof err !== "object") return;
|
|
205
|
-
const record = err;
|
|
206
|
-
if (record.data && typeof record.data === "object") {
|
|
207
|
-
const inner = record.data.error;
|
|
208
|
-
if (typeof inner === "string") return inner;
|
|
209
|
-
}
|
|
210
|
-
return (typeof record.message === "string" ? record.message : "").match(/An API error occurred:\s*([a-z_][a-z0-9_]*)/i)?.[1];
|
|
211
|
-
}
|
|
212
|
-
function markSlackStreamFallbackDelivered(session) {
|
|
213
|
-
const nativeStreamWasStarted = session.delivered;
|
|
214
|
-
session.pendingText = "";
|
|
215
|
-
session.streamer.buffer = "";
|
|
216
|
-
session.stopped = !nativeStreamWasStarted;
|
|
217
|
-
}
|
|
218
|
-
//#endregion
|
|
219
|
-
//#region extensions/slack/src/monitor/message-handler/timestamp.ts
|
|
220
|
-
const SLACK_TIMESTAMP_RE = /^\d+(?:\.\d+)?$/;
|
|
221
|
-
const MAX_SAFE_SLACK_TIMESTAMP_SECONDS = Number.MAX_SAFE_INTEGER / 1e3;
|
|
222
|
-
function resolveSlackTimestampMs(ts) {
|
|
223
|
-
const trimmed = ts?.trim();
|
|
224
|
-
if (!trimmed || !SLACK_TIMESTAMP_RE.test(trimmed)) return;
|
|
225
|
-
const seconds = asFiniteNumberInRange(parseStrictFiniteNumber(trimmed), {
|
|
226
|
-
min: 0,
|
|
227
|
-
max: MAX_SAFE_SLACK_TIMESTAMP_SECONDS
|
|
228
|
-
});
|
|
229
|
-
return seconds === void 0 ? void 0 : Math.round(seconds * 1e3);
|
|
230
|
-
}
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region extensions/slack/src/monitor/message-handler/dispatch-helpers.ts
|
|
233
|
-
function resolveSlackMessageTimestampMs(message) {
|
|
234
|
-
return resolveSlackTimestampMs(message.event_ts ?? message.ts);
|
|
235
|
-
}
|
|
236
|
-
function resolveSlackBotLoopProtection(prepared) {
|
|
237
|
-
const senderBotId = prepared.message.bot_id;
|
|
238
|
-
if (!senderBotId) return;
|
|
239
|
-
const receiverBotId = prepared.ctx.botId || prepared.ctx.botUserId;
|
|
240
|
-
if (!receiverBotId || senderBotId === prepared.ctx.botId || prepared.message.user === prepared.ctx.botUserId) return;
|
|
241
|
-
return {
|
|
242
|
-
scopeId: prepared.route.accountId,
|
|
243
|
-
conversationId: prepared.message.channel,
|
|
244
|
-
senderId: senderBotId,
|
|
245
|
-
receiverId: receiverBotId,
|
|
246
|
-
config: mergePairLoopGuardConfig(prepared.account.config.botLoopProtection, prepared.channelConfig?.botLoopProtection),
|
|
247
|
-
defaultsConfig: prepared.ctx.cfg.channels?.defaults?.botLoopProtection,
|
|
248
|
-
defaultEnabled: true,
|
|
249
|
-
nowMs: resolveSlackMessageTimestampMs(prepared.message)
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
function isSlackStreamingEnabled(params) {
|
|
253
|
-
if (params.mode === "partial") return params.nativeStreaming;
|
|
254
|
-
if (params.mode === "progress") return params.nativeStreaming && params.nativeProgressTaskCards === true;
|
|
255
|
-
return false;
|
|
256
|
-
}
|
|
257
|
-
function shouldEnableSlackPreviewStreaming(params) {
|
|
258
|
-
return params.mode !== "off";
|
|
259
|
-
}
|
|
260
|
-
function shouldInitializeSlackDraftStream(params) {
|
|
261
|
-
return params.previewStreamingEnabled && !params.useStreaming;
|
|
262
|
-
}
|
|
263
|
-
function resolveSlackDisableBlockStreaming(params) {
|
|
264
|
-
if (params.useStreaming || params.shouldUseDraftStream) return true;
|
|
265
|
-
return typeof params.blockStreamingEnabled === "boolean" ? !params.blockStreamingEnabled : void 0;
|
|
266
|
-
}
|
|
267
|
-
function resolveExplicitSlackProgressTitle(entry) {
|
|
268
|
-
const label = resolveChannelProgressDraftConfig(entry).label;
|
|
269
|
-
if (typeof label !== "string") return;
|
|
270
|
-
const trimmed = label.trim();
|
|
271
|
-
return trimmed && trimmed.toLowerCase() !== "auto" ? trimmed : void 0;
|
|
272
|
-
}
|
|
273
|
-
function resolveSlackNativeProgressTaskCards(entry) {
|
|
274
|
-
const streaming = entry?.streaming;
|
|
275
|
-
if (!streaming || typeof streaming !== "object" || Array.isArray(streaming)) return false;
|
|
276
|
-
const progressConfig = streaming.progress;
|
|
277
|
-
return Boolean(progressConfig) && typeof progressConfig === "object" && !Array.isArray(progressConfig) && progressConfig.nativeTaskCards === true;
|
|
278
|
-
}
|
|
279
|
-
function resolveSlackStreamingThreadHint(params) {
|
|
280
|
-
return resolveSlackThreadTs({
|
|
281
|
-
replyToMode: params.replyToMode,
|
|
282
|
-
incomingThreadTs: params.incomingThreadTs,
|
|
283
|
-
messageTs: params.messageTs,
|
|
284
|
-
hasReplied: false,
|
|
285
|
-
isThreadReply: params.isThreadReply
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
const SLACK_STREAM_RECIPIENT_TEAM_CACHE_MAX = 2e3;
|
|
289
|
-
const slackStreamRecipientTeamCaches = /* @__PURE__ */ new WeakMap();
|
|
290
|
-
function getSlackStreamRecipientTeamCache(client) {
|
|
291
|
-
const existing = slackStreamRecipientTeamCaches.get(client);
|
|
292
|
-
if (existing) return existing;
|
|
293
|
-
const cache = /* @__PURE__ */ new Map();
|
|
294
|
-
slackStreamRecipientTeamCaches.set(client, cache);
|
|
295
|
-
return cache;
|
|
296
|
-
}
|
|
297
|
-
function buildSlackEventDeliveryKey(params) {
|
|
298
|
-
const reply = resolveSendableOutboundReplyParts(params.payload, { text: params.textOverride });
|
|
299
|
-
const renderPlan = resolveSlackReplyRenderPlan(params.payload, params.textOverride ?? params.payload.text);
|
|
300
|
-
const plannedBlocks = renderPlan.mode === "single" ? renderPlan.blocks : renderPlan.blockPart?.blocks;
|
|
301
|
-
const slackBlocks = readSlackReplyBlocks(params.payload) ?? plannedBlocks;
|
|
302
|
-
const renderedText = renderPlan.mode === "single" ? renderPlan.text : renderPlan.fallbackText;
|
|
303
|
-
if (!reply.hasContent && !slackBlocks?.length && !renderedText.trim()) return null;
|
|
304
|
-
return JSON.stringify({
|
|
305
|
-
kind: params.kind,
|
|
306
|
-
threadTs: params.threadTs ?? "",
|
|
307
|
-
replyToId: params.payload.replyToId ?? null,
|
|
308
|
-
text: renderedText || reply.trimmedText,
|
|
309
|
-
mediaUrls: reply.mediaUrls,
|
|
310
|
-
blocks: slackBlocks ?? null
|
|
311
|
-
});
|
|
312
|
-
}
|
|
313
|
-
function readSlackStreamRecipientTeamCache(params) {
|
|
314
|
-
if (!params.fallbackTeamId || !params.userId) return;
|
|
315
|
-
const cacheKey = `${params.fallbackTeamId}:${params.userId}`;
|
|
316
|
-
const cache = getSlackStreamRecipientTeamCache(params.client);
|
|
317
|
-
const cached = cache.get(cacheKey);
|
|
318
|
-
if (!cached) return;
|
|
319
|
-
cache.delete(cacheKey);
|
|
320
|
-
cache.set(cacheKey, cached);
|
|
321
|
-
return cached;
|
|
322
|
-
}
|
|
323
|
-
function rememberSlackStreamRecipientTeam(params) {
|
|
324
|
-
if (!params.fallbackTeamId || !params.userId) return;
|
|
325
|
-
const cacheKey = `${params.fallbackTeamId}:${params.userId}`;
|
|
326
|
-
const cache = getSlackStreamRecipientTeamCache(params.client);
|
|
327
|
-
if (cache.has(cacheKey)) cache.delete(cacheKey);
|
|
328
|
-
cache.set(cacheKey, params.teamId);
|
|
329
|
-
if (cache.size > SLACK_STREAM_RECIPIENT_TEAM_CACHE_MAX) {
|
|
330
|
-
const oldest = cache.keys().next().value;
|
|
331
|
-
if (oldest) cache.delete(oldest);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
function createSlackEventDeliveryTracker() {
|
|
335
|
-
const deliveredKeys = /* @__PURE__ */ new Set();
|
|
336
|
-
return {
|
|
337
|
-
hasDelivered(params) {
|
|
338
|
-
const key = buildSlackEventDeliveryKey(params);
|
|
339
|
-
return key ? deliveredKeys.has(key) : false;
|
|
340
|
-
},
|
|
341
|
-
markDelivered(params) {
|
|
342
|
-
const key = buildSlackEventDeliveryKey(params);
|
|
343
|
-
if (key) deliveredKeys.add(key);
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
function shouldUseStreaming(params) {
|
|
348
|
-
if (!params.streamingEnabled) return false;
|
|
349
|
-
if (!params.threadTs) {
|
|
350
|
-
logVerbose("slack-stream: streaming disabled — no reply thread target available");
|
|
351
|
-
return false;
|
|
352
|
-
}
|
|
353
|
-
return true;
|
|
354
|
-
}
|
|
355
|
-
async function resolveSlackStreamRecipientTeamId(params) {
|
|
356
|
-
const cachedTeamId = readSlackStreamRecipientTeamCache(params);
|
|
357
|
-
if (cachedTeamId) return cachedTeamId;
|
|
358
|
-
if (params.userId) try {
|
|
359
|
-
const info = await params.client.users.info({
|
|
360
|
-
token: params.token,
|
|
361
|
-
user: params.userId
|
|
362
|
-
});
|
|
363
|
-
const teamId = info.user?.team_id ?? info.user?.profile?.team;
|
|
364
|
-
if (teamId) {
|
|
365
|
-
rememberSlackStreamRecipientTeam({
|
|
366
|
-
...params,
|
|
367
|
-
teamId
|
|
368
|
-
});
|
|
369
|
-
return teamId;
|
|
370
|
-
}
|
|
371
|
-
} catch (err) {
|
|
372
|
-
logVerbose(`slack-stream: users.info team lookup failed (${formatErrorMessage(err)})`);
|
|
373
|
-
}
|
|
374
|
-
return params.fallbackTeamId;
|
|
375
|
-
}
|
|
376
|
-
//#endregion
|
|
377
|
-
//#region extensions/slack/src/draft-stream.ts
|
|
378
|
-
const DEFAULT_THROTTLE_MS = 1e3;
|
|
379
|
-
function createSlackDraftStream(params) {
|
|
380
|
-
const maxChars = Math.min(params.maxChars ?? 8e3, SLACK_TEXT_LIMIT);
|
|
381
|
-
const throttleMs = Math.max(250, params.throttleMs ?? DEFAULT_THROTTLE_MS);
|
|
382
|
-
const send = params.send ?? sendMessageSlack;
|
|
383
|
-
const edit = params.edit ?? editSlackMessage;
|
|
384
|
-
const remove = params.remove ?? deleteSlackMessage;
|
|
385
|
-
let streamMessageId;
|
|
386
|
-
let streamChannelId;
|
|
387
|
-
let lastSentKey = "";
|
|
388
|
-
let pendingUpdate;
|
|
389
|
-
let stopped = false;
|
|
390
|
-
const normalizeUpdate = (update) => typeof update === "string" ? { text: update } : update;
|
|
391
|
-
const sendOrEditStreamMessage = async (text) => {
|
|
392
|
-
if (stopped) return;
|
|
393
|
-
const trimmed = text.trimEnd();
|
|
394
|
-
if (!trimmed) return;
|
|
395
|
-
if (trimmed.length > maxChars) {
|
|
396
|
-
stopped = true;
|
|
397
|
-
params.warn?.(`slack stream preview stopped (text length ${trimmed.length} > ${maxChars})`);
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
const update = normalizeUpdate(pendingUpdate ?? text);
|
|
401
|
-
const blocks = update.text === text ? update.blocks : void 0;
|
|
402
|
-
const sentKey = `${trimmed}\n${blocks ? JSON.stringify(blocks) : ""}`;
|
|
403
|
-
if (sentKey === lastSentKey) return;
|
|
404
|
-
lastSentKey = sentKey;
|
|
405
|
-
try {
|
|
406
|
-
if (streamChannelId && streamMessageId) {
|
|
407
|
-
await edit(streamChannelId, streamMessageId, trimmed, {
|
|
408
|
-
cfg: params.cfg,
|
|
409
|
-
token: params.token,
|
|
410
|
-
accountId: params.accountId,
|
|
411
|
-
...params.eventScope ? { client: params.eventScope.client } : {},
|
|
412
|
-
...blocks ? { blocks } : {}
|
|
413
|
-
});
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
const sent = await send(params.target, trimmed, {
|
|
417
|
-
cfg: params.cfg,
|
|
418
|
-
token: params.token,
|
|
419
|
-
accountId: params.accountId,
|
|
420
|
-
threadTs: params.resolveThreadTs?.(),
|
|
421
|
-
identity: params.identity,
|
|
422
|
-
...params.eventScope ? {
|
|
423
|
-
client: params.eventScope.client,
|
|
424
|
-
enterpriseEventScope: params.eventScope
|
|
425
|
-
} : {},
|
|
426
|
-
...params.metadata ? { metadata: params.metadata } : {},
|
|
427
|
-
...blocks ? { blocks } : {}
|
|
428
|
-
});
|
|
429
|
-
streamChannelId = sent.channelId || streamChannelId;
|
|
430
|
-
streamMessageId = sent.messageId || streamMessageId;
|
|
431
|
-
if (!streamChannelId || !streamMessageId) {
|
|
432
|
-
stopped = true;
|
|
433
|
-
params.warn?.("slack stream preview stopped (missing identifiers from sendMessage)");
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
params.onMessageSent?.();
|
|
437
|
-
} catch (err) {
|
|
438
|
-
stopped = true;
|
|
439
|
-
params.warn?.(`slack stream preview failed: ${formatSlackError(err)}`);
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
|
-
const loop = createDraftStreamLoop({
|
|
443
|
-
throttleMs,
|
|
444
|
-
isStopped: () => stopped,
|
|
445
|
-
sendOrEditStreamMessage
|
|
446
|
-
});
|
|
447
|
-
const stop = () => {
|
|
448
|
-
stopped = true;
|
|
449
|
-
loop.stop();
|
|
450
|
-
};
|
|
451
|
-
const discardPending = async () => {
|
|
452
|
-
stop();
|
|
453
|
-
await loop.waitForInFlight();
|
|
454
|
-
};
|
|
455
|
-
const clear = async () => {
|
|
456
|
-
await discardPending();
|
|
457
|
-
const channelId = streamChannelId;
|
|
458
|
-
const messageId = streamMessageId;
|
|
459
|
-
streamChannelId = void 0;
|
|
460
|
-
streamMessageId = void 0;
|
|
461
|
-
lastSentKey = "";
|
|
462
|
-
pendingUpdate = void 0;
|
|
463
|
-
if (!channelId || !messageId) return;
|
|
464
|
-
try {
|
|
465
|
-
await remove(channelId, messageId, {
|
|
466
|
-
token: params.token,
|
|
467
|
-
accountId: params.accountId,
|
|
468
|
-
...params.eventScope ? { client: params.eventScope.client } : {}
|
|
469
|
-
});
|
|
470
|
-
} catch (err) {
|
|
471
|
-
params.warn?.(`slack stream preview cleanup failed: ${formatSlackError(err)}`);
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
const forceNewMessage = () => {
|
|
475
|
-
streamMessageId = void 0;
|
|
476
|
-
streamChannelId = void 0;
|
|
477
|
-
lastSentKey = "";
|
|
478
|
-
pendingUpdate = void 0;
|
|
479
|
-
loop.resetPending();
|
|
480
|
-
};
|
|
481
|
-
params.log?.(`slack stream preview ready (maxChars=${maxChars}, throttleMs=${throttleMs})`);
|
|
482
|
-
return {
|
|
483
|
-
update: (update) => {
|
|
484
|
-
const normalized = normalizeUpdate(update);
|
|
485
|
-
pendingUpdate = update;
|
|
486
|
-
loop.update(normalized.text);
|
|
487
|
-
},
|
|
488
|
-
flush: loop.flush,
|
|
489
|
-
clear,
|
|
490
|
-
discardPending,
|
|
491
|
-
seal: discardPending,
|
|
492
|
-
stop,
|
|
493
|
-
forceNewMessage,
|
|
494
|
-
messageId: () => streamMessageId,
|
|
495
|
-
channelId: () => streamChannelId
|
|
496
|
-
};
|
|
497
|
-
}
|
|
498
|
-
//#endregion
|
|
499
|
-
//#region extensions/slack/src/progress-blocks.ts
|
|
500
|
-
const SLACK_PROGRESS_FIELD_MAX = 1800;
|
|
501
|
-
const DEFAULT_SLACK_PROGRESS_DETAIL_MAX_CHARS = 120;
|
|
502
|
-
const DEFAULT_SLACK_PROGRESS_TASK_DETAIL_MAX_CHARS = 48;
|
|
503
|
-
const SLACK_PROGRESS_CHUNK_TEXT_MAX = 256;
|
|
504
|
-
const SLACK_PROGRESS_TASK_TITLE_MAX = 120;
|
|
505
|
-
const SLACK_PROGRESS_PLAN_FALLBACK_TITLE = "Thinking";
|
|
506
|
-
function field(text) {
|
|
507
|
-
return {
|
|
508
|
-
type: "mrkdwn",
|
|
509
|
-
text: truncateSlackText(text, SLACK_PROGRESS_FIELD_MAX)
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
function resolveMaxLineChars(value, fallback) {
|
|
513
|
-
return value && value > 0 ? Math.floor(value) : fallback;
|
|
514
|
-
}
|
|
515
|
-
function compactDetail(value, maxChars) {
|
|
516
|
-
const normalized = value.replace(/\s+/g, " ").trim();
|
|
517
|
-
const chars = Array.from(normalized);
|
|
518
|
-
if (chars.length <= maxChars) return normalized;
|
|
519
|
-
if (maxChars <= 1) return "…";
|
|
520
|
-
const keepStart = Math.max(1, Math.ceil((maxChars - 1) * .45));
|
|
521
|
-
const keepEnd = Math.max(1, maxChars - keepStart - 1);
|
|
522
|
-
return `${chars.slice(0, keepStart).join("").trimEnd()}…${chars.slice(-keepEnd).join("").trimStart()}`;
|
|
523
|
-
}
|
|
524
|
-
function compactTitle(value) {
|
|
525
|
-
return truncateSlackText(value.replace(/\s+/g, " ").trim(), SLACK_PROGRESS_TASK_TITLE_MAX);
|
|
526
|
-
}
|
|
527
|
-
function compactChunkText(value) {
|
|
528
|
-
return truncateSlackText(value.replace(/\s+/g, " ").trim(), SLACK_PROGRESS_CHUNK_TEXT_MAX);
|
|
529
|
-
}
|
|
530
|
-
function lineDetailParts(line) {
|
|
531
|
-
return [line.detail, line.status && line.status !== "completed" && !line.detail?.includes(line.status) ? line.status : void 0].map((part) => part?.trim()).filter((part) => Boolean(part));
|
|
532
|
-
}
|
|
533
|
-
function legacyLineTitle(line) {
|
|
534
|
-
return `${line.icon ?? "•"} *${escapeSlackMrkdwn(line.label)}*`;
|
|
535
|
-
}
|
|
536
|
-
function legacyLineDetail(line, maxChars) {
|
|
537
|
-
const detail = lineDetailParts(line).join(" · ");
|
|
538
|
-
return detail ? escapeSlackMrkdwn(compactDetail(detail, maxChars)) : "—";
|
|
539
|
-
}
|
|
540
|
-
function lineTaskTitle(line, maxLineChars) {
|
|
541
|
-
const label = line.label.replace(/\s+/g, " ").trim() || line.toolName || line.kind || "Update";
|
|
542
|
-
const detail = lineDetailParts(line).join(" · ") || line.status?.trim();
|
|
543
|
-
const fallback = line.text.replace(/\s+/g, " ").trim();
|
|
544
|
-
if (detail) return compactTitle(`${label} — ${compactDetail(detail, maxLineChars)}`);
|
|
545
|
-
if (fallback && fallback !== label) return compactTitle(fallback);
|
|
546
|
-
return compactTitle(label);
|
|
547
|
-
}
|
|
548
|
-
function lineTaskStatus(line) {
|
|
549
|
-
const normalized = line.status?.replace(/\s+/g, " ").trim().toLowerCase();
|
|
550
|
-
if (!normalized) return "in_progress";
|
|
551
|
-
if (normalized === "complete" || normalized === "completed" || normalized === "done" || normalized === "ok" || normalized === "success" || normalized === "succeeded" || normalized === "successful" || normalized === "exit 0") return "complete";
|
|
552
|
-
if (normalized === "error" || normalized === "failed" || normalized === "failure" || normalized.startsWith("exit ")) return normalized === "exit 0" ? "complete" : "error";
|
|
553
|
-
return "in_progress";
|
|
554
|
-
}
|
|
555
|
-
function slugTaskIdPart(value) {
|
|
556
|
-
return value?.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "") || "task";
|
|
557
|
-
}
|
|
558
|
-
function stableTaskIdPart(value, slugValue = value) {
|
|
559
|
-
const suffix = createHash("sha256").update(value).digest("hex").slice(0, 8);
|
|
560
|
-
return `${slugTaskIdPart(slugValue).slice(0, 48)}_${suffix}`;
|
|
561
|
-
}
|
|
562
|
-
function resolveLineTaskIdentity(line) {
|
|
563
|
-
if (line.id?.trim()) return {
|
|
564
|
-
id: stableTaskIdPart(line.id),
|
|
565
|
-
contentDerived: false
|
|
566
|
-
};
|
|
567
|
-
return {
|
|
568
|
-
id: stableTaskIdPart([
|
|
569
|
-
line.kind,
|
|
570
|
-
line.toolName,
|
|
571
|
-
line.label,
|
|
572
|
-
line.text
|
|
573
|
-
].join("\0"), line.toolName ?? line.kind ?? line.label),
|
|
574
|
-
contentDerived: true
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
function buildPlanTasks(params) {
|
|
578
|
-
if (params.plan) return params.plan.slice(-50).map((entry, index) => ({
|
|
579
|
-
id: `plan_step_${index + 1}`,
|
|
580
|
-
title: compactTitle(entry.step),
|
|
581
|
-
status: entry.status === "completed" ? "complete" : entry.status
|
|
582
|
-
}));
|
|
583
|
-
const maxLineChars = resolveMaxLineChars(params.maxLineChars, DEFAULT_SLACK_PROGRESS_TASK_DETAIL_MAX_CHARS);
|
|
584
|
-
const lines = params.lines.slice(-50);
|
|
585
|
-
const identities = lines.map(resolveLineTaskIdentity);
|
|
586
|
-
const contentIdOccurrences = /* @__PURE__ */ new Map();
|
|
587
|
-
return lines.map((line, index) => {
|
|
588
|
-
const identity = identities[index];
|
|
589
|
-
let id = identity.id;
|
|
590
|
-
if (identity.contentDerived) {
|
|
591
|
-
const occurrence = (contentIdOccurrences.get(id) ?? 0) + 1;
|
|
592
|
-
contentIdOccurrences.set(id, occurrence);
|
|
593
|
-
id = `${id}_${occurrence}`;
|
|
594
|
-
}
|
|
595
|
-
return {
|
|
596
|
-
id,
|
|
597
|
-
title: lineTaskTitle(line, maxLineChars),
|
|
598
|
-
status: lineTaskStatus(line)
|
|
599
|
-
};
|
|
600
|
-
});
|
|
601
|
-
}
|
|
602
|
-
function resolvePlanTitle(params) {
|
|
603
|
-
return compactChunkText(params.title?.trim() || params.label?.trim() || params.tasks.at(-1)?.title || SLACK_PROGRESS_PLAN_FALLBACK_TITLE);
|
|
604
|
-
}
|
|
605
|
-
function buildSlackProgressStreamChunks(params) {
|
|
606
|
-
const tasks = buildPlanTasks({
|
|
607
|
-
lines: params.lines,
|
|
608
|
-
plan: params.plan,
|
|
609
|
-
maxLineChars: params.maxLineChars
|
|
610
|
-
});
|
|
611
|
-
if (tasks.length === 0) {
|
|
612
|
-
const title = params.title?.trim() || params.label?.trim();
|
|
613
|
-
return title ? [{
|
|
614
|
-
type: "plan_update",
|
|
615
|
-
title: compactChunkText(title)
|
|
616
|
-
}] : void 0;
|
|
617
|
-
}
|
|
618
|
-
return [{
|
|
619
|
-
type: "plan_update",
|
|
620
|
-
title: resolvePlanTitle({
|
|
621
|
-
label: params.label,
|
|
622
|
-
title: params.title,
|
|
623
|
-
tasks
|
|
624
|
-
})
|
|
625
|
-
}, ...tasks.map((task) => ({
|
|
626
|
-
type: "task_update",
|
|
627
|
-
id: task.id,
|
|
628
|
-
title: task.title,
|
|
629
|
-
status: task.status === "in_progress" ? params.finalInProgressStatus ?? (params.completeInProgress ? "complete" : task.status) : task.status
|
|
630
|
-
}))];
|
|
631
|
-
}
|
|
632
|
-
function buildSlackProgressDraftBlocks(params) {
|
|
633
|
-
const label = params.label?.trim() || params.title?.trim();
|
|
634
|
-
const maxLineChars = resolveMaxLineChars(params.maxLineChars, DEFAULT_SLACK_PROGRESS_DETAIL_MAX_CHARS);
|
|
635
|
-
const planLines = formatPlanChecklistLines(params.plan ?? [], {
|
|
636
|
-
maxLines: 50,
|
|
637
|
-
maxLineChars
|
|
638
|
-
});
|
|
639
|
-
const narration = params.narration?.replace(/\s+/g, " ").trim();
|
|
640
|
-
const headBlocks = [
|
|
641
|
-
...label ? [{
|
|
642
|
-
type: "section",
|
|
643
|
-
text: field(`*${escapeSlackMrkdwn(label)}*`)
|
|
644
|
-
}] : [],
|
|
645
|
-
...narration ? [{
|
|
646
|
-
type: "section",
|
|
647
|
-
text: field(`_${escapeSlackMrkdwn(narration)}_`)
|
|
648
|
-
}] : [],
|
|
649
|
-
...planLines.length > 0 ? [{
|
|
650
|
-
type: "section",
|
|
651
|
-
text: field(planLines.map((line) => escapeSlackMrkdwn(line)).join("\n"))
|
|
652
|
-
}] : []
|
|
653
|
-
].slice(0, 50);
|
|
654
|
-
const lineBudget = Math.max(0, 50 - headBlocks.length);
|
|
655
|
-
const renderedBlocks = [...headBlocks, ...params.lines.slice(-lineBudget).map((line) => ({
|
|
656
|
-
type: "section",
|
|
657
|
-
fields: [field(legacyLineTitle(line)), field(legacyLineDetail(line, maxLineChars))]
|
|
658
|
-
}))];
|
|
659
|
-
return renderedBlocks.length ? renderedBlocks : void 0;
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* Slack native streams key task rows by persistent id with no removal chunk.
|
|
663
|
-
* When the task source switches representation (tool lines <-> typed plan) or
|
|
664
|
-
* a snapshot drops ids, previously emitted non-terminal rows must receive a
|
|
665
|
-
* final update or they linger in_progress forever.
|
|
666
|
-
*/
|
|
667
|
-
function reconcileSlackNativeTaskChunks(params) {
|
|
668
|
-
const nextTasks = /* @__PURE__ */ new Map();
|
|
669
|
-
for (const chunk of params.chunks ?? []) if (chunk.type === "task_update") nextTasks.set(chunk.id, {
|
|
670
|
-
title: chunk.title,
|
|
671
|
-
status: chunk.status
|
|
672
|
-
});
|
|
673
|
-
const terminalized = [...params.previousTasks].filter(([id, task]) => !nextTasks.has(id) && task.status !== "complete" && task.status !== "error").map(([id, task]) => {
|
|
674
|
-
const entry = {
|
|
675
|
-
title: task.title,
|
|
676
|
-
status: "complete"
|
|
677
|
-
};
|
|
678
|
-
nextTasks.set(id, entry);
|
|
679
|
-
return {
|
|
680
|
-
type: "task_update",
|
|
681
|
-
id,
|
|
682
|
-
title: task.title,
|
|
683
|
-
status: "complete"
|
|
684
|
-
};
|
|
685
|
-
});
|
|
686
|
-
for (const [id, task] of params.previousTasks) if (!nextTasks.has(id)) nextTasks.set(id, task);
|
|
687
|
-
return {
|
|
688
|
-
chunks: params.chunks?.length ? [...params.chunks, ...terminalized] : terminalized.length ? terminalized : params.chunks,
|
|
689
|
-
tasks: nextTasks
|
|
690
|
-
};
|
|
691
|
-
}
|
|
692
|
-
function buildSlackProgressStreamStartChunks(params) {
|
|
693
|
-
return buildSlackProgressStreamChunks(params);
|
|
694
|
-
}
|
|
695
|
-
function buildSlackProgressStreamUpdateChunks(params) {
|
|
696
|
-
return buildSlackProgressStreamChunks(params);
|
|
697
|
-
}
|
|
698
|
-
function buildSlackProgressStreamCompletionChunks(params) {
|
|
699
|
-
return buildSlackProgressStreamChunks({
|
|
700
|
-
...params,
|
|
701
|
-
completeInProgress: true
|
|
702
|
-
});
|
|
703
|
-
}
|
|
704
|
-
//#endregion
|
|
705
|
-
//#region extensions/slack/src/stream-mode.ts
|
|
706
|
-
function resolveSlackStreamingConfig(params) {
|
|
707
|
-
const mode = resolveSlackStreamingMode(params);
|
|
708
|
-
return {
|
|
709
|
-
mode,
|
|
710
|
-
nativeStreaming: resolveSlackNativeStreaming(params),
|
|
711
|
-
draftMode: mapStreamingModeToSlackLegacyDraftStreamMode(mode)
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
function applyAppendOnlyStreamUpdate(params) {
|
|
715
|
-
const incoming = params.incoming.trimEnd();
|
|
716
|
-
if (!incoming) return {
|
|
717
|
-
rendered: params.rendered,
|
|
718
|
-
source: params.source,
|
|
719
|
-
changed: false
|
|
720
|
-
};
|
|
721
|
-
if (!params.rendered) return {
|
|
722
|
-
rendered: incoming,
|
|
723
|
-
source: incoming,
|
|
724
|
-
changed: true
|
|
725
|
-
};
|
|
726
|
-
if (incoming === params.source) return {
|
|
727
|
-
rendered: params.rendered,
|
|
728
|
-
source: params.source,
|
|
729
|
-
changed: false
|
|
730
|
-
};
|
|
731
|
-
if (incoming.startsWith(params.source) || incoming.startsWith(params.rendered)) return {
|
|
732
|
-
rendered: incoming,
|
|
733
|
-
source: incoming,
|
|
734
|
-
changed: incoming !== params.rendered
|
|
735
|
-
};
|
|
736
|
-
if (params.source.startsWith(incoming)) return {
|
|
737
|
-
rendered: params.rendered,
|
|
738
|
-
source: params.source,
|
|
739
|
-
changed: false
|
|
740
|
-
};
|
|
741
|
-
const separator = params.rendered.endsWith("\n") ? "" : "\n";
|
|
742
|
-
return {
|
|
743
|
-
rendered: `${params.rendered}${separator}${incoming}`,
|
|
744
|
-
source: incoming,
|
|
745
|
-
changed: true
|
|
746
|
-
};
|
|
747
|
-
}
|
|
748
|
-
//#endregion
|
|
749
|
-
//#region extensions/slack/src/monitor/message-handler/preview-finalize.ts
|
|
750
|
-
function buildExpectedSlackEditText(params) {
|
|
751
|
-
const trimmedText = params.text.trim();
|
|
752
|
-
if (trimmedText) return normalizeSlackOutboundText(trimmedText);
|
|
753
|
-
if (params.blocks?.length) return normalizeSlackOutboundText(buildSlackBlocksFallbackText(params.blocks));
|
|
754
|
-
return " ";
|
|
755
|
-
}
|
|
756
|
-
function buildAcceptedSlackEditTexts(params) {
|
|
757
|
-
const expected = buildExpectedSlackEditText(params);
|
|
758
|
-
const texts = /* @__PURE__ */ new Set([
|
|
759
|
-
expected,
|
|
760
|
-
normalizeSlackOutboundText(truncateSlackText(expected, SLACK_EDIT_TEXT_LIMIT)),
|
|
761
|
-
normalizeSlackOutboundText(buildSlackEditTextPayload(params.text, params.blocks))
|
|
762
|
-
]);
|
|
763
|
-
if (params.blocks?.length && hasSlackNativeDataBlock(params.blocks)) {
|
|
764
|
-
const fallbackPlan = buildSlackNativeDataDeliveryPlan({
|
|
765
|
-
baseText: params.text,
|
|
766
|
-
blocks: params.blocks
|
|
767
|
-
});
|
|
768
|
-
for (const message of fallbackPlan.fallbackMessages) texts.add(normalizeSlackOutboundText(message.text));
|
|
769
|
-
}
|
|
770
|
-
return texts;
|
|
771
|
-
}
|
|
772
|
-
function blocksMatch(expected, actual) {
|
|
773
|
-
if (!expected?.length) return !actual?.length;
|
|
774
|
-
if (!actual?.length) {
|
|
775
|
-
if (!hasSlackNativeDataBlock(expected)) return false;
|
|
776
|
-
return buildSlackNativeDataDeliveryPlan({ blocks: expected }).fallbackMessages.every((message) => !message.blocks?.length);
|
|
777
|
-
}
|
|
778
|
-
if (JSON.stringify(expected) === JSON.stringify(actual)) return true;
|
|
779
|
-
if (!hasSlackNativeDataBlock(expected)) return false;
|
|
780
|
-
try {
|
|
781
|
-
const fallbackPlan = buildSlackNativeDataDeliveryPlan({ blocks: expected });
|
|
782
|
-
const fallbackBlocks = fallbackPlan.fallbackMessages.flatMap((message) => message.blocks ?? []);
|
|
783
|
-
if (JSON.stringify(fallbackBlocks) === JSON.stringify(actual)) return true;
|
|
784
|
-
const fallbackText = fallbackPlan.fallbackMessages.map((message) => message.text).filter(Boolean).join("\n\n");
|
|
785
|
-
return normalizeSlackOutboundText(buildSlackBlocksFallbackText(actual)) === normalizeSlackOutboundText(fallbackText);
|
|
786
|
-
} catch {
|
|
787
|
-
return false;
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
async function readSlackMessageAfterEditError(params) {
|
|
791
|
-
if (params.threadTs) return ((await params.client.conversations.replies({
|
|
792
|
-
token: params.token,
|
|
793
|
-
channel: params.channelId,
|
|
794
|
-
ts: params.threadTs,
|
|
795
|
-
latest: params.messageId,
|
|
796
|
-
inclusive: true,
|
|
797
|
-
limit: 100
|
|
798
|
-
})).messages ?? []).find((message) => message?.ts === params.messageId) ?? null;
|
|
799
|
-
const message = (await params.client.conversations.history({
|
|
800
|
-
token: params.token,
|
|
801
|
-
channel: params.channelId,
|
|
802
|
-
latest: params.messageId,
|
|
803
|
-
oldest: params.messageId,
|
|
804
|
-
inclusive: true,
|
|
805
|
-
limit: 1
|
|
806
|
-
})).messages?.[0];
|
|
807
|
-
if (!message?.ts || message.ts !== params.messageId) return null;
|
|
808
|
-
return message;
|
|
809
|
-
}
|
|
810
|
-
async function didSlackPreviewEditApplyAfterError(params) {
|
|
811
|
-
const readback = await readSlackMessageAfterEditError(params);
|
|
812
|
-
if (!readback) return false;
|
|
813
|
-
const expectedText = buildExpectedSlackEditText({
|
|
814
|
-
text: params.text,
|
|
815
|
-
blocks: params.blocks
|
|
816
|
-
});
|
|
817
|
-
const acceptedTexts = buildAcceptedSlackEditTexts({
|
|
818
|
-
text: params.text,
|
|
819
|
-
blocks: params.blocks
|
|
820
|
-
});
|
|
821
|
-
const actualText = normalizeSlackOutboundText((readback.text ?? "").trim());
|
|
822
|
-
if (params.blocks?.length) return acceptedTexts.has(actualText) && blocksMatch(params.blocks, readback.blocks);
|
|
823
|
-
return actualText === expectedText;
|
|
824
|
-
}
|
|
825
|
-
async function finalizeSlackPreviewEdit(params) {
|
|
826
|
-
try {
|
|
827
|
-
await editSlackMessage(params.channelId, params.messageId, params.text, {
|
|
828
|
-
token: params.token,
|
|
829
|
-
accountId: params.accountId,
|
|
830
|
-
client: params.client,
|
|
831
|
-
...params.blocks?.length ? { blocks: params.blocks } : {}
|
|
832
|
-
});
|
|
833
|
-
} catch (err) {
|
|
834
|
-
try {
|
|
835
|
-
if (await didSlackPreviewEditApplyAfterError({
|
|
836
|
-
client: params.client,
|
|
837
|
-
token: params.token,
|
|
838
|
-
channelId: params.channelId,
|
|
839
|
-
messageId: params.messageId,
|
|
840
|
-
text: params.text,
|
|
841
|
-
blocks: params.blocks,
|
|
842
|
-
threadTs: params.threadTs
|
|
843
|
-
})) {
|
|
844
|
-
logVerbose(`slack: preview final edit response failed but readback matched message ${params.channelId}/${params.messageId}; suppressing duplicate fallback send`);
|
|
845
|
-
return;
|
|
846
|
-
}
|
|
847
|
-
} catch (readbackErr) {
|
|
848
|
-
logVerbose(`slack: preview final edit readback failed (${String(readbackErr)})`);
|
|
849
|
-
}
|
|
850
|
-
throw err;
|
|
851
|
-
}
|
|
852
|
-
}
|
|
853
|
-
//#endregion
|
|
854
|
-
//#region extensions/slack/src/monitor/message-handler/dispatch-progress-io.ts
|
|
855
|
-
async function collapseSlackProgressReceipt(params) {
|
|
856
|
-
const { account, ctx, slackClient } = params.setup;
|
|
857
|
-
try {
|
|
858
|
-
await finalizeSlackPreviewEdit({
|
|
859
|
-
client: slackClient,
|
|
860
|
-
token: ctx.botToken,
|
|
861
|
-
accountId: account.accountId,
|
|
862
|
-
...params.edit
|
|
863
|
-
});
|
|
864
|
-
return true;
|
|
865
|
-
} catch (err) {
|
|
866
|
-
logVerbose(`slack: progress receipt edit failed (${formatSlackError(err)})`);
|
|
867
|
-
return false;
|
|
868
|
-
}
|
|
869
|
-
}
|
|
870
|
-
//#endregion
|
|
871
|
-
//#region extensions/slack/src/monitor/message-handler/dispatch-progress-render.ts
|
|
872
|
-
function resolveStructuredProgressLines(lines) {
|
|
873
|
-
return lines.map((line) => {
|
|
874
|
-
if (typeof line !== "string") return line;
|
|
875
|
-
const reasoning = line.startsWith("🧠 ");
|
|
876
|
-
const text = line.replace(/^(?:🧠|💬)\s+/u, "").replace(/^_(.*)_$/su, "$1").trim();
|
|
877
|
-
return {
|
|
878
|
-
...reasoning ? { id: "reasoning" } : {},
|
|
879
|
-
kind: "item",
|
|
880
|
-
text,
|
|
881
|
-
label: reasoning ? "Reasoning" : "Update",
|
|
882
|
-
prefix: false
|
|
883
|
-
};
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
function resolveNativeProgressPlan(snapshot) {
|
|
887
|
-
return snapshot.plan?.length ? snapshot.plan : void 0;
|
|
888
|
-
}
|
|
889
|
-
function resolveNativeProgressLines(snapshot) {
|
|
890
|
-
const lines = resolveStructuredProgressLines(snapshot.lines);
|
|
891
|
-
if (snapshot.plan?.length || !snapshot.planExplanation) return lines;
|
|
892
|
-
const explanationLine = buildChannelProgressDraftLine({
|
|
893
|
-
event: "plan",
|
|
894
|
-
phase: "update",
|
|
895
|
-
explanation: snapshot.planExplanation
|
|
896
|
-
});
|
|
897
|
-
return explanationLine ? [...lines, explanationLine] : lines;
|
|
898
|
-
}
|
|
899
|
-
function combineProgressHeadlineAndExplanation(headline, explanation) {
|
|
900
|
-
return headline && explanation && headline !== explanation ? `${headline} — ${explanation}` : headline ?? explanation;
|
|
901
|
-
}
|
|
902
|
-
function buildNativeProgressChunks(params) {
|
|
903
|
-
const input = {
|
|
904
|
-
title: params.title,
|
|
905
|
-
lines: resolveNativeProgressLines(params.snapshot),
|
|
906
|
-
plan: resolveNativeProgressPlan(params.snapshot),
|
|
907
|
-
maxLineChars: params.maxLineChars
|
|
908
|
-
};
|
|
909
|
-
return params.streamStarted ? buildSlackProgressStreamUpdateChunks(input) : buildSlackProgressStreamStartChunks(input);
|
|
910
|
-
}
|
|
911
|
-
//#endregion
|
|
912
|
-
//#region extensions/slack/src/monitor/message-handler/dispatch-progress.ts
|
|
913
|
-
function createSlackProgressRuntime(runtimeParams) {
|
|
914
|
-
const { setup, delivery, resetPreviewDeliveryState } = runtimeParams;
|
|
915
|
-
const { account, cfg, ctx, message, prepared, replyPlan, runtime, slackClient, slackIdentity, slackMessageMetadata, slackStreaming, slackStreamFallbackTeamId, shouldUseDraftStream, useStreaming, previewStreamingEnabled } = setup;
|
|
916
|
-
const draftStream = shouldUseDraftStream ? createSlackDraftStream({
|
|
917
|
-
target: prepared.replyTarget,
|
|
918
|
-
cfg,
|
|
919
|
-
token: ctx.botToken,
|
|
920
|
-
accountId: account.accountId,
|
|
921
|
-
...prepared.eventScope ? { eventScope: prepared.eventScope } : {},
|
|
922
|
-
identity: slackIdentity,
|
|
923
|
-
...slackMessageMetadata ? { metadata: slackMessageMetadata } : {},
|
|
924
|
-
maxChars: Math.min(ctx.textLimit, SLACK_TEXT_LIMIT),
|
|
925
|
-
resolveThreadTs: () => {
|
|
926
|
-
const ts = replyPlan.peekThreadTs();
|
|
927
|
-
if (ts) delivery.usedReplyThreadTs ??= ts;
|
|
928
|
-
return ts;
|
|
929
|
-
},
|
|
930
|
-
log: logVerbose,
|
|
931
|
-
warn: logVerbose
|
|
932
|
-
}) : void 0;
|
|
933
|
-
let hasStreamedMessage = false;
|
|
934
|
-
const streamMode = slackStreaming.draftMode;
|
|
935
|
-
const useNativeProgressStreaming = useStreaming && slackStreaming.mode === "progress";
|
|
936
|
-
const progressDraftActive = Boolean(draftStream) || useNativeProgressStreaming;
|
|
937
|
-
const previewToolProgressEnabled = progressDraftActive && resolveChannelStreamingPreviewToolProgress(account.config);
|
|
938
|
-
let shouldYieldDraftProgress = () => false;
|
|
939
|
-
const suppressDefaultToolProgressMessages = resolveChannelStreamingSuppressDefaultToolProgressMessages(account.config, {
|
|
940
|
-
draftStreamActive: Boolean(draftStream) || useNativeProgressStreaming,
|
|
941
|
-
previewToolProgressEnabled,
|
|
942
|
-
previewStreamingEnabled
|
|
943
|
-
});
|
|
944
|
-
let previewToolProgressSuppressed = false;
|
|
945
|
-
let legacyPreviewToolProgressLines = [];
|
|
946
|
-
let nativeTaskState = /* @__PURE__ */ new Map();
|
|
947
|
-
let appendRenderedText = "";
|
|
948
|
-
let appendSourceText = "";
|
|
949
|
-
let nativeProgressCompletionSent = false;
|
|
950
|
-
let nativeProgressTerminalStatus = "complete";
|
|
951
|
-
let nativeProgressChunkKey;
|
|
952
|
-
const progressReceipt = createChannelProgressReceiptTracker();
|
|
953
|
-
let progressReceiptCollapsed = false;
|
|
954
|
-
let pendingNativeProgressReceipt;
|
|
955
|
-
const progressSeed = `${account.accountId}:${message.channel}`;
|
|
956
|
-
const useRichProgressDraft = streamMode === "status_final" && resolveChannelProgressDraftRender(account.config) === "rich";
|
|
957
|
-
const explicitProgressTitle = resolveExplicitSlackProgressTitle(account.config);
|
|
958
|
-
const progressDraftMaxLineChars = resolveChannelProgressDraftMaxLineChars(account.config);
|
|
959
|
-
const waitForNativeProgressStreamStart = async () => {
|
|
960
|
-
if (delivery.streamSession || !delivery.nativeProgressStreamStartPromise) return true;
|
|
961
|
-
try {
|
|
962
|
-
await delivery.nativeProgressStreamStartPromise;
|
|
963
|
-
} catch {
|
|
964
|
-
delivery.streamFailed = true;
|
|
965
|
-
return false;
|
|
966
|
-
}
|
|
967
|
-
return !delivery.streamFailed;
|
|
968
|
-
};
|
|
969
|
-
const appendNativeProgressCompletion = async (isError) => {
|
|
970
|
-
const session = delivery.streamSession;
|
|
971
|
-
if (isError) nativeProgressTerminalStatus = "error";
|
|
972
|
-
if (!session || nativeProgressCompletionSent) return;
|
|
973
|
-
const chunks = buildNativeProgressCompletionChunks(isError ? "error" : "complete");
|
|
974
|
-
if (!chunks?.length) return;
|
|
975
|
-
try {
|
|
976
|
-
await appendSlackStream({
|
|
977
|
-
session,
|
|
978
|
-
chunks
|
|
979
|
-
});
|
|
980
|
-
nativeProgressCompletionSent = true;
|
|
981
|
-
delivery.observedReplyDelivery ||= session.delivered;
|
|
982
|
-
} catch (err) {
|
|
983
|
-
delivery.streamFailed = true;
|
|
984
|
-
runtime.error?.(danger(`slack-stream: native progress completion failed: ${formatSlackError(err)}`));
|
|
985
|
-
}
|
|
986
|
-
};
|
|
987
|
-
const buildNativeProgressChunks$1 = (snapshot) => buildNativeProgressChunks({
|
|
988
|
-
snapshot,
|
|
989
|
-
streamStarted: Boolean(delivery.streamSession),
|
|
990
|
-
title: combineProgressHeadlineAndExplanation(explicitProgressTitle ?? snapshot.statusHeadline, snapshot.planExplanation),
|
|
991
|
-
maxLineChars: progressDraftMaxLineChars
|
|
992
|
-
});
|
|
993
|
-
const resolveNativeProgressTitle = (snapshot) => combineProgressHeadlineAndExplanation(explicitProgressTitle ?? snapshot.statusHeadline, snapshot.planExplanation);
|
|
994
|
-
const markNativeProgressDelivered = (session, threadTs) => {
|
|
995
|
-
if (session.delivered) delivery.observedReplyDelivery = true;
|
|
996
|
-
if (threadTs) {
|
|
997
|
-
delivery.usedReplyThreadTs ??= threadTs;
|
|
998
|
-
delivery.rememberDeliveredThreadTs("block", threadTs);
|
|
999
|
-
}
|
|
1000
|
-
};
|
|
1001
|
-
const startNativeProgressStream = async (chunks, chunkKey) => {
|
|
1002
|
-
const streamThreadTs = replyPlan.nextThreadTs();
|
|
1003
|
-
if (!streamThreadTs) {
|
|
1004
|
-
logVerbose("slack-stream: no reply thread target for native progress stream start, falling back");
|
|
1005
|
-
delivery.streamFailed = true;
|
|
1006
|
-
return;
|
|
1007
|
-
}
|
|
1008
|
-
delivery.nativeProgressStreamThreadTs = streamThreadTs;
|
|
1009
|
-
const startPromise = (async () => {
|
|
1010
|
-
const session = await startSlackStream({
|
|
1011
|
-
client: slackClient,
|
|
1012
|
-
channel: message.channel,
|
|
1013
|
-
threadTs: streamThreadTs,
|
|
1014
|
-
chunks,
|
|
1015
|
-
taskDisplayMode: "plan",
|
|
1016
|
-
...slackIdentity ? { identity: slackIdentity } : {},
|
|
1017
|
-
teamId: await resolveSlackStreamRecipientTeamId({
|
|
1018
|
-
client: slackClient,
|
|
1019
|
-
token: ctx.botToken,
|
|
1020
|
-
userId: message.user,
|
|
1021
|
-
fallbackTeamId: slackStreamFallbackTeamId
|
|
1022
|
-
}),
|
|
1023
|
-
userId: message.user
|
|
1024
|
-
});
|
|
1025
|
-
delivery.streamSession = session;
|
|
1026
|
-
return session;
|
|
1027
|
-
})();
|
|
1028
|
-
delivery.nativeProgressStreamStartPromise = startPromise;
|
|
1029
|
-
let startedSession;
|
|
1030
|
-
try {
|
|
1031
|
-
startedSession = await startPromise;
|
|
1032
|
-
} finally {
|
|
1033
|
-
if (delivery.nativeProgressStreamStartPromise === startPromise) delivery.nativeProgressStreamStartPromise = null;
|
|
1034
|
-
}
|
|
1035
|
-
if (startedSession) markNativeProgressDelivered(startedSession, streamThreadTs);
|
|
1036
|
-
nativeProgressChunkKey = chunkKey;
|
|
1037
|
-
replyPlan.markSent();
|
|
1038
|
-
};
|
|
1039
|
-
const appendNativeProgressStream = async (chunks, chunkKey) => {
|
|
1040
|
-
if (!delivery.streamSession) return;
|
|
1041
|
-
await appendSlackStream({
|
|
1042
|
-
session: delivery.streamSession,
|
|
1043
|
-
chunks
|
|
1044
|
-
});
|
|
1045
|
-
markNativeProgressDelivered(delivery.streamSession);
|
|
1046
|
-
nativeProgressChunkKey = chunkKey;
|
|
1047
|
-
};
|
|
1048
|
-
const updateNativeProgressStream = async () => {
|
|
1049
|
-
const snapshot = progressDraft.getSnapshot();
|
|
1050
|
-
const progressLines = resolveNativeProgressLines(snapshot);
|
|
1051
|
-
const hasRetirableNativeTasks = [...nativeTaskState.values()].some((task) => task.status !== "complete" && task.status !== "error");
|
|
1052
|
-
if (!useNativeProgressStreaming || delivery.streamFailed || progressLines.length === 0 && !snapshot.plan?.length && !snapshot.statusHeadline && !explicitProgressTitle && !hasRetirableNativeTasks) return;
|
|
1053
|
-
if (!await waitForNativeProgressStreamStart()) return;
|
|
1054
|
-
const reconciled = reconcileSlackNativeTaskChunks({
|
|
1055
|
-
previousTasks: nativeTaskState,
|
|
1056
|
-
chunks: buildNativeProgressChunks$1(snapshot)
|
|
1057
|
-
});
|
|
1058
|
-
const chunks = reconciled.chunks;
|
|
1059
|
-
if (!chunks?.length) return;
|
|
1060
|
-
const chunkKey = JSON.stringify(chunks);
|
|
1061
|
-
if (chunkKey === nativeProgressChunkKey) return;
|
|
1062
|
-
try {
|
|
1063
|
-
if (!delivery.streamSession) await startNativeProgressStream(chunks, chunkKey);
|
|
1064
|
-
else await appendNativeProgressStream(chunks, chunkKey);
|
|
1065
|
-
nativeTaskState = reconciled.tasks;
|
|
1066
|
-
} catch (err) {
|
|
1067
|
-
runtime.error?.(danger(`slack-stream: native progress stream failed: ${formatSlackError(err)}, falling back`));
|
|
1068
|
-
delivery.streamFailed = true;
|
|
1069
|
-
}
|
|
1070
|
-
};
|
|
1071
|
-
const resetProgressTurnState = () => {
|
|
1072
|
-
progressReceipt.reset();
|
|
1073
|
-
progressReceiptCollapsed = false;
|
|
1074
|
-
pendingNativeProgressReceipt = void 0;
|
|
1075
|
-
};
|
|
1076
|
-
const collapseProgressReceipt = async (params) => {
|
|
1077
|
-
progressReceiptCollapsed = await collapseSlackProgressReceipt({
|
|
1078
|
-
setup,
|
|
1079
|
-
edit: params
|
|
1080
|
-
});
|
|
1081
|
-
};
|
|
1082
|
-
const progressDraft = createChannelProgressDraftCompositor({
|
|
1083
|
-
entry: account.config,
|
|
1084
|
-
mode: slackStreaming.mode,
|
|
1085
|
-
active: progressDraftActive && streamMode === "status_final",
|
|
1086
|
-
seed: progressSeed,
|
|
1087
|
-
formatLine: escapeSlackMrkdwn,
|
|
1088
|
-
reasoningLinePrefix: "🧠 ",
|
|
1089
|
-
commentaryLinePrefix: "💬 ",
|
|
1090
|
-
reasoningGate: previewToolProgressEnabled,
|
|
1091
|
-
commentaryItalics: false,
|
|
1092
|
-
updateOnLineChange: useNativeProgressStreaming || useRichProgressDraft,
|
|
1093
|
-
update: async (previewText, options) => {
|
|
1094
|
-
if (useNativeProgressStreaming) {
|
|
1095
|
-
await updateNativeProgressStream();
|
|
1096
|
-
return;
|
|
1097
|
-
}
|
|
1098
|
-
if (!draftStream) return;
|
|
1099
|
-
const snapshot = progressDraft.getSnapshot();
|
|
1100
|
-
const structuredLines = resolveStructuredProgressLines(options?.lines ?? snapshot.lines);
|
|
1101
|
-
const richNarration = combineProgressHeadlineAndExplanation(snapshot.statusHeadline, snapshot.planExplanation);
|
|
1102
|
-
const richProgressBlocks = useRichProgressDraft ? buildSlackProgressDraftBlocks({
|
|
1103
|
-
title: explicitProgressTitle,
|
|
1104
|
-
lines: structuredLines,
|
|
1105
|
-
plan: snapshot.plan,
|
|
1106
|
-
narration: richNarration,
|
|
1107
|
-
maxLineChars: progressDraftMaxLineChars
|
|
1108
|
-
}) : void 0;
|
|
1109
|
-
draftStream.update(useRichProgressDraft && richProgressBlocks ? {
|
|
1110
|
-
text: previewText,
|
|
1111
|
-
blocks: richProgressBlocks
|
|
1112
|
-
} : previewText);
|
|
1113
|
-
hasStreamedMessage = true;
|
|
1114
|
-
if (options?.flush) await draftStream.flush();
|
|
1115
|
-
}
|
|
1116
|
-
});
|
|
1117
|
-
const commentaryProgressEnabled = progressDraft.commentaryProgressEnabled;
|
|
1118
|
-
const buildNativeProgressCompletionChunks = (finalInProgressStatus) => {
|
|
1119
|
-
const snapshot = progressDraft.getSnapshot();
|
|
1120
|
-
const lines = resolveNativeProgressLines(snapshot);
|
|
1121
|
-
const hasRetirableNativeTasks = [...nativeTaskState.values()].some((task) => task.status !== "complete" && task.status !== "error");
|
|
1122
|
-
if (lines.length === 0 && !snapshot.plan?.length && !hasRetirableNativeTasks) return;
|
|
1123
|
-
return reconcileSlackNativeTaskChunks({
|
|
1124
|
-
previousTasks: nativeTaskState,
|
|
1125
|
-
chunks: buildSlackProgressStreamCompletionChunks({
|
|
1126
|
-
title: resolveNativeProgressTitle(snapshot),
|
|
1127
|
-
lines,
|
|
1128
|
-
plan: resolveNativeProgressPlan(snapshot),
|
|
1129
|
-
maxLineChars: progressDraftMaxLineChars,
|
|
1130
|
-
finalInProgressStatus
|
|
1131
|
-
})
|
|
1132
|
-
}).chunks;
|
|
1133
|
-
};
|
|
1134
|
-
const finishNativeProgressTurn = async (completionChunks) => {
|
|
1135
|
-
if (delivery.nativeProgressStreamStartPromise) await delivery.nativeProgressStreamStartPromise.catch(() => null);
|
|
1136
|
-
const session = delivery.streamSession;
|
|
1137
|
-
if (session && !session.stopped) try {
|
|
1138
|
-
if (completionChunks?.length) nativeProgressCompletionSent = true;
|
|
1139
|
-
const stopResult = await stopSlackStream({
|
|
1140
|
-
session,
|
|
1141
|
-
...completionChunks?.length ? { chunks: completionChunks } : {},
|
|
1142
|
-
...slackMessageMetadata ? { metadata: slackMessageMetadata } : {}
|
|
1143
|
-
});
|
|
1144
|
-
delivery.acknowledgeStoppedStreamedDeliveries(session, stopResult?.messageId);
|
|
1145
|
-
if (pendingNativeProgressReceipt && stopResult?.messageId) await collapseProgressReceipt({
|
|
1146
|
-
channelId: session.channel,
|
|
1147
|
-
messageId: stopResult.messageId,
|
|
1148
|
-
text: pendingNativeProgressReceipt,
|
|
1149
|
-
threadTs: session.threadTs
|
|
1150
|
-
});
|
|
1151
|
-
} catch (err) {
|
|
1152
|
-
const error = formatSlackError(err);
|
|
1153
|
-
delivery.emitAcknowledgedStreamedDeliveries();
|
|
1154
|
-
delivery.emitFailedPendingStreamedDeliveries(error);
|
|
1155
|
-
logVerbose(`slack-stream: failed to rotate native progress stream (${error})`);
|
|
1156
|
-
}
|
|
1157
|
-
delivery.streamSession = null;
|
|
1158
|
-
delivery.nativeProgressStreamStartPromise = null;
|
|
1159
|
-
delivery.nativeProgressStreamThreadTs = void 0;
|
|
1160
|
-
delivery.streamFailed = false;
|
|
1161
|
-
};
|
|
1162
|
-
const pushPlanProgress = async (steps, explanation) => {
|
|
1163
|
-
if (streamMode === "status_final") {
|
|
1164
|
-
await progressDraft.pushPlanProgress(steps, { explanation });
|
|
1165
|
-
return;
|
|
1166
|
-
}
|
|
1167
|
-
if (previewToolProgressSuppressed || !draftStream) return;
|
|
1168
|
-
const text = formatChannelProgressDraftText({
|
|
1169
|
-
entry: account.config,
|
|
1170
|
-
lines: legacyPreviewToolProgressLines,
|
|
1171
|
-
seed: progressSeed,
|
|
1172
|
-
formatLine: escapeSlackMrkdwn,
|
|
1173
|
-
narration: explanation,
|
|
1174
|
-
plan: steps
|
|
1175
|
-
});
|
|
1176
|
-
if (text) {
|
|
1177
|
-
draftStream.update(text);
|
|
1178
|
-
hasStreamedMessage = true;
|
|
1179
|
-
}
|
|
1180
|
-
};
|
|
1181
|
-
const pushPreviewProgress = async (line, options) => {
|
|
1182
|
-
if (!draftStream && !useNativeProgressStreaming) return;
|
|
1183
|
-
if (options?.toolName !== void 0 && !isChannelProgressDraftWorkToolName(options.toolName)) return;
|
|
1184
|
-
const normalized = line?.text.replace(/\s+/g, " ").trim();
|
|
1185
|
-
if (streamMode === "status_final") {
|
|
1186
|
-
if (!line || !normalized) {
|
|
1187
|
-
await progressDraft.noteActivity();
|
|
1188
|
-
return;
|
|
1189
|
-
}
|
|
1190
|
-
await progressDraft.pushToolProgress(line, options);
|
|
1191
|
-
return;
|
|
1192
|
-
}
|
|
1193
|
-
if (!line || !normalized || !draftStream || !previewToolProgressEnabled || previewToolProgressSuppressed) return;
|
|
1194
|
-
const nextLines = mergeChannelProgressDraftLine(legacyPreviewToolProgressLines, line, { maxLines: resolveChannelProgressDraftMaxLines(account.config) });
|
|
1195
|
-
if (nextLines === legacyPreviewToolProgressLines) return;
|
|
1196
|
-
legacyPreviewToolProgressLines = nextLines;
|
|
1197
|
-
draftStream.update(formatChannelProgressDraftText({
|
|
1198
|
-
entry: account.config,
|
|
1199
|
-
lines: legacyPreviewToolProgressLines,
|
|
1200
|
-
seed: progressSeed,
|
|
1201
|
-
formatLine: escapeSlackMrkdwn
|
|
1202
|
-
}));
|
|
1203
|
-
hasStreamedMessage = true;
|
|
1204
|
-
};
|
|
1205
|
-
const updateDraftFromPartial = (text) => {
|
|
1206
|
-
const trimmed = text?.trimEnd();
|
|
1207
|
-
if (!trimmed) return;
|
|
1208
|
-
if (streamMode === "append") {
|
|
1209
|
-
previewToolProgressSuppressed = true;
|
|
1210
|
-
legacyPreviewToolProgressLines = [];
|
|
1211
|
-
const next = applyAppendOnlyStreamUpdate({
|
|
1212
|
-
incoming: trimmed,
|
|
1213
|
-
rendered: appendRenderedText,
|
|
1214
|
-
source: appendSourceText
|
|
1215
|
-
});
|
|
1216
|
-
appendRenderedText = next.rendered;
|
|
1217
|
-
appendSourceText = next.source;
|
|
1218
|
-
if (!next.changed) return;
|
|
1219
|
-
draftStream?.update(next.rendered);
|
|
1220
|
-
hasStreamedMessage = true;
|
|
1221
|
-
return;
|
|
1222
|
-
}
|
|
1223
|
-
if (streamMode === "status_final") return;
|
|
1224
|
-
previewToolProgressSuppressed = true;
|
|
1225
|
-
legacyPreviewToolProgressLines = [];
|
|
1226
|
-
draftStream?.update(trimmed);
|
|
1227
|
-
hasStreamedMessage = true;
|
|
1228
|
-
};
|
|
1229
|
-
const pushReasoningProgress = async (payload) => {
|
|
1230
|
-
if (!payload?.text) return;
|
|
1231
|
-
if (streamMode !== "status_final") {
|
|
1232
|
-
const normalized = progressDraft.mergeReasoningProgress(payload.text, { snapshot: payload.isReasoningSnapshot === true }).replace(/^_(.*)_$/su, "$1").trim();
|
|
1233
|
-
if (!normalized) return;
|
|
1234
|
-
await pushPreviewProgress({
|
|
1235
|
-
id: "reasoning",
|
|
1236
|
-
kind: "item",
|
|
1237
|
-
text: normalized,
|
|
1238
|
-
label: "Reasoning"
|
|
1239
|
-
});
|
|
1240
|
-
return;
|
|
1241
|
-
}
|
|
1242
|
-
progressReceipt.noteReasoning();
|
|
1243
|
-
await progressDraft.pushReasoningProgress(payload.text, { snapshot: payload.isReasoningSnapshot === true });
|
|
1244
|
-
};
|
|
1245
|
-
const resetDraftDeliveryState = () => {
|
|
1246
|
-
hasStreamedMessage = false;
|
|
1247
|
-
appendRenderedText = "";
|
|
1248
|
-
appendSourceText = "";
|
|
1249
|
-
};
|
|
1250
|
-
const resetDraftProgressState = () => {
|
|
1251
|
-
progressDraft.resetReasoningProgress();
|
|
1252
|
-
previewToolProgressSuppressed = false;
|
|
1253
|
-
legacyPreviewToolProgressLines = [];
|
|
1254
|
-
};
|
|
1255
|
-
const beginNewProgressTurn = async (options) => {
|
|
1256
|
-
const completionChunks = useNativeProgressStreaming && !nativeProgressCompletionSent ? buildNativeProgressCompletionChunks(nativeProgressTerminalStatus) : void 0;
|
|
1257
|
-
if (!progressDraft.beginNewTurn(options)) return false;
|
|
1258
|
-
if (useNativeProgressStreaming) await finishNativeProgressTurn(completionChunks);
|
|
1259
|
-
else draftStream?.forceNewMessage();
|
|
1260
|
-
resetProgressTurnState();
|
|
1261
|
-
nativeTaskState = /* @__PURE__ */ new Map();
|
|
1262
|
-
nativeProgressCompletionSent = false;
|
|
1263
|
-
nativeProgressTerminalStatus = "complete";
|
|
1264
|
-
nativeProgressChunkKey = void 0;
|
|
1265
|
-
resetPreviewDeliveryState();
|
|
1266
|
-
delivery.resetDeliveryTracker();
|
|
1267
|
-
progressReceiptCollapsed = false;
|
|
1268
|
-
return true;
|
|
1269
|
-
};
|
|
1270
|
-
return {
|
|
1271
|
-
draftStream,
|
|
1272
|
-
streamMode,
|
|
1273
|
-
useNativeProgressStreaming,
|
|
1274
|
-
progressDraftActive,
|
|
1275
|
-
previewToolProgressEnabled,
|
|
1276
|
-
suppressDefaultToolProgressMessages,
|
|
1277
|
-
progressDraft,
|
|
1278
|
-
commentaryProgressEnabled,
|
|
1279
|
-
progressReceipt,
|
|
1280
|
-
get progressReceiptCollapsed() {
|
|
1281
|
-
return progressReceiptCollapsed;
|
|
1282
|
-
},
|
|
1283
|
-
get pendingNativeProgressReceipt() {
|
|
1284
|
-
return pendingNativeProgressReceipt;
|
|
1285
|
-
},
|
|
1286
|
-
set pendingNativeProgressReceipt(value) {
|
|
1287
|
-
pendingNativeProgressReceipt = value;
|
|
1288
|
-
},
|
|
1289
|
-
get nativeProgressCompletionSent() {
|
|
1290
|
-
return nativeProgressCompletionSent;
|
|
1291
|
-
},
|
|
1292
|
-
set nativeProgressCompletionSent(value) {
|
|
1293
|
-
nativeProgressCompletionSent = value;
|
|
1294
|
-
},
|
|
1295
|
-
get nativeProgressTerminalStatus() {
|
|
1296
|
-
return nativeProgressTerminalStatus;
|
|
1297
|
-
},
|
|
1298
|
-
appendNativeProgressCompletion,
|
|
1299
|
-
beginNewProgressTurn,
|
|
1300
|
-
buildNativeProgressCompletionChunks,
|
|
1301
|
-
collapseProgressReceipt,
|
|
1302
|
-
onDraftBoundary: !shouldUseDraftStream && !useNativeProgressStreaming ? void 0 : async () => {
|
|
1303
|
-
if (streamMode === "status_final") {
|
|
1304
|
-
await beginNewProgressTurn();
|
|
1305
|
-
return;
|
|
1306
|
-
}
|
|
1307
|
-
if (hasStreamedMessage) draftStream?.forceNewMessage();
|
|
1308
|
-
resetDraftDeliveryState();
|
|
1309
|
-
resetDraftProgressState();
|
|
1310
|
-
},
|
|
1311
|
-
onQueuedFollowupAdmitted: !shouldUseDraftStream && !useNativeProgressStreaming ? void 0 : async () => {
|
|
1312
|
-
await draftStream?.flush();
|
|
1313
|
-
resetPreviewDeliveryState();
|
|
1314
|
-
if (streamMode === "status_final") await beginNewProgressTurn({ force: true });
|
|
1315
|
-
else draftStream?.forceNewMessage();
|
|
1316
|
-
delivery.resetDeliveryTracker();
|
|
1317
|
-
resetDraftDeliveryState();
|
|
1318
|
-
resetDraftProgressState();
|
|
1319
|
-
},
|
|
1320
|
-
pushPlanProgress,
|
|
1321
|
-
pushPreviewProgress,
|
|
1322
|
-
pushReasoningProgress,
|
|
1323
|
-
updateDraftFromPartial,
|
|
1324
|
-
waitForNativeProgressStreamStart,
|
|
1325
|
-
setShouldYieldDraftProgress: (value) => {
|
|
1326
|
-
shouldYieldDraftProgress = value;
|
|
1327
|
-
},
|
|
1328
|
-
shouldYieldDraftProgress: () => shouldYieldDraftProgress()
|
|
1329
|
-
};
|
|
1330
|
-
}
|
|
1331
|
-
//#endregion
|
|
1332
|
-
//#region extensions/slack/src/threading.ts
|
|
1333
|
-
function resolveSlackThreadContext(params) {
|
|
1334
|
-
const incomingThreadTs = params.message.thread_ts;
|
|
1335
|
-
const eventTs = params.message.event_ts;
|
|
1336
|
-
const messageTs = params.message.ts ?? eventTs;
|
|
1337
|
-
const hasThreadTs = typeof incomingThreadTs === "string" && incomingThreadTs.length > 0;
|
|
1338
|
-
const isThreadReply = hasThreadTs && (incomingThreadTs !== messageTs || Boolean(params.message.parent_user_id));
|
|
1339
|
-
const replyToId = isThreadReply ? incomingThreadTs : void 0;
|
|
1340
|
-
const isAssistantDmThreadRoot = hasThreadTs && !isThreadReply && params.isDirectMessage === true;
|
|
1341
|
-
return {
|
|
1342
|
-
incomingThreadTs,
|
|
1343
|
-
messageTs,
|
|
1344
|
-
isThreadReply,
|
|
1345
|
-
replyToId,
|
|
1346
|
-
messageThreadId: isThreadReply || isAssistantDmThreadRoot ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
1347
|
-
};
|
|
1348
|
-
}
|
|
1349
|
-
/**
|
|
1350
|
-
* Resolves Slack thread targeting for replies and status indicators.
|
|
1351
|
-
*
|
|
1352
|
-
* @returns replyThreadTs - Thread timestamp for reply messages
|
|
1353
|
-
* @returns statusThreadTs - Thread timestamp for status indicators (typing, etc.)
|
|
1354
|
-
* @returns isThreadReply - true if this is a genuine user reply in a thread,
|
|
1355
|
-
* false if thread_ts comes from a bot status message (e.g. typing indicator)
|
|
1356
|
-
*/
|
|
1357
|
-
function resolveSlackThreadTargets(params) {
|
|
1358
|
-
const { incomingThreadTs, messageTs, isThreadReply } = resolveSlackThreadContext(params);
|
|
1359
|
-
const replyThreadTs = isThreadReply ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0;
|
|
1360
|
-
return {
|
|
1361
|
-
replyThreadTs,
|
|
1362
|
-
statusThreadTs: replyThreadTs,
|
|
1363
|
-
isThreadReply
|
|
1364
|
-
};
|
|
1365
|
-
}
|
|
1366
|
-
//#endregion
|
|
1367
|
-
//#region extensions/slack/src/monitor/message-handler/dispatch-setup.ts
|
|
1368
|
-
async function createSlackDispatchSetup(prepared) {
|
|
1369
|
-
const { ctx, account, message, route } = prepared;
|
|
1370
|
-
const slackClient = prepared.eventScope?.client ?? ctx.app.client;
|
|
1371
|
-
const slackStreamFallbackTeamId = prepared.eventScope?.teamId ?? ctx.teamId;
|
|
1372
|
-
const cfg = ctx.cfg;
|
|
1373
|
-
const runtime = ctx.runtime;
|
|
1374
|
-
const outboundIdentity = resolveAgentOutboundIdentity(cfg, route.agentId);
|
|
1375
|
-
const slackIdentity = outboundIdentity ? {
|
|
1376
|
-
username: outboundIdentity.name,
|
|
1377
|
-
iconUrl: outboundIdentity.avatarUrl,
|
|
1378
|
-
iconEmoji: outboundIdentity.emoji
|
|
1379
|
-
} : prepared.relayIdentity;
|
|
1380
|
-
if (prepared.isDirectMessage) {
|
|
1381
|
-
const sessionCfg = cfg.session;
|
|
1382
|
-
const storePath = resolveStorePath(sessionCfg?.store, { agentId: route.agentId });
|
|
1383
|
-
const pinnedMainDmOwner = resolvePinnedMainDmOwnerFromAllowlist({
|
|
1384
|
-
dmScope: cfg.session?.dmScope,
|
|
1385
|
-
allowFrom: ctx.allowFrom,
|
|
1386
|
-
normalizeEntry: normalizeSlackAllowOwnerEntry
|
|
1387
|
-
});
|
|
1388
|
-
const senderRecipient = normalizeOptionalLowercaseString(message.user);
|
|
1389
|
-
const inboundLastRouteSessionKey = resolveInboundLastRouteSessionKey({
|
|
1390
|
-
route,
|
|
1391
|
-
sessionKey: prepared.ctxPayload.SessionKey ?? route.sessionKey
|
|
1392
|
-
});
|
|
1393
|
-
if (inboundLastRouteSessionKey === route.mainSessionKey && pinnedMainDmOwner && senderRecipient && normalizeOptionalLowercaseString(pinnedMainDmOwner) !== senderRecipient) logVerbose(`slack: skip main-session last route for ${senderRecipient} (pinned owner ${pinnedMainDmOwner})`);
|
|
1394
|
-
else await updateLastRoute({
|
|
1395
|
-
storePath,
|
|
1396
|
-
sessionKey: inboundLastRouteSessionKey,
|
|
1397
|
-
deliveryContext: {
|
|
1398
|
-
channel: "slack",
|
|
1399
|
-
to: `user:${message.user}`,
|
|
1400
|
-
accountId: route.accountId,
|
|
1401
|
-
threadId: prepared.ctxPayload.MessageThreadId ?? prepared.ctxPayload.TransportThreadId
|
|
1402
|
-
},
|
|
1403
|
-
ctx: prepared.ctxPayload
|
|
1404
|
-
});
|
|
1405
|
-
}
|
|
1406
|
-
const threadTargets = resolveSlackThreadTargets({
|
|
1407
|
-
message,
|
|
1408
|
-
replyToMode: prepared.replyToMode
|
|
1409
|
-
});
|
|
1410
|
-
const forcedReplyThreadTs = prepared.forcedReplyThreadTs;
|
|
1411
|
-
const slackMessageMetadata = prepared.slackMessageMetadata;
|
|
1412
|
-
const statusThreadTs = forcedReplyThreadTs ?? threadTargets.statusThreadTs;
|
|
1413
|
-
const isThreadReply = threadTargets.isThreadReply;
|
|
1414
|
-
const replyDeliveryMode = forcedReplyThreadTs ? "off" : prepared.replyToMode;
|
|
1415
|
-
const sourceReplyDeliveryMode = resolveChannelMessageSourceReplyDeliveryMode({
|
|
1416
|
-
cfg,
|
|
1417
|
-
ctx: prepared.ctxPayload
|
|
1418
|
-
});
|
|
1419
|
-
const sourceRepliesAreToolOnly = sourceReplyDeliveryMode === "message_tool_only";
|
|
1420
|
-
const suppressRoomEventTyping = prepared.ctxPayload.InboundEventKind === "room_event";
|
|
1421
|
-
const messageSentHookTarget = prepared.ctxPayload.OriginatingTo ?? prepared.ctxPayload.To ?? prepared.replyTarget;
|
|
1422
|
-
const messageSentHookContext = {
|
|
1423
|
-
sessionKeyForInternalHooks: prepared.ctxPayload.SessionKey ?? route.sessionKey,
|
|
1424
|
-
isGroup: prepared.isRoomish,
|
|
1425
|
-
groupId: prepared.isRoomish ? message.channel : void 0
|
|
1426
|
-
};
|
|
1427
|
-
const messageSentDeliveryHookContext = {
|
|
1428
|
-
...messageSentHookContext,
|
|
1429
|
-
messageSentHookTarget
|
|
1430
|
-
};
|
|
1431
|
-
const reactionMessageTs = prepared.ackReactionMessageTs;
|
|
1432
|
-
const messageTs = message.ts ?? message.event_ts;
|
|
1433
|
-
const incomingThreadTs = message.thread_ts;
|
|
1434
|
-
let didSetStatus = false;
|
|
1435
|
-
const statusReactionsEnabled = prepared.ctxPayload.InboundEventKind !== "room_event" && Boolean(prepared.ackReactionPromise) && Boolean(reactionMessageTs) && cfg.messages?.statusReactions?.enabled === true;
|
|
1436
|
-
const statusReactions = createStatusReactionController({
|
|
1437
|
-
enabled: statusReactionsEnabled,
|
|
1438
|
-
adapter: {
|
|
1439
|
-
setReaction: async (emoji) => {
|
|
1440
|
-
await reactSlackMessage(message.channel, reactionMessageTs ?? "", emoji, {
|
|
1441
|
-
token: ctx.botToken,
|
|
1442
|
-
client: slackClient
|
|
1443
|
-
}).catch((err) => {
|
|
1444
|
-
if (formatErrorMessage(err).includes("already_reacted")) return;
|
|
1445
|
-
throw err;
|
|
1446
|
-
});
|
|
1447
|
-
},
|
|
1448
|
-
removeReaction: async (emoji) => {
|
|
1449
|
-
await removeSlackReaction(message.channel, reactionMessageTs ?? "", emoji, {
|
|
1450
|
-
token: ctx.botToken,
|
|
1451
|
-
client: slackClient
|
|
1452
|
-
}).catch((err) => {
|
|
1453
|
-
if (formatErrorMessage(err).includes("no_reaction")) return;
|
|
1454
|
-
throw err;
|
|
1455
|
-
});
|
|
1456
|
-
}
|
|
1457
|
-
},
|
|
1458
|
-
initialEmoji: prepared.ackReactionValue || "eyes",
|
|
1459
|
-
emojis: void 0,
|
|
1460
|
-
timing: DEFAULT_TIMING,
|
|
1461
|
-
onError: (err) => {
|
|
1462
|
-
logAckFailure({
|
|
1463
|
-
log: logVerbose,
|
|
1464
|
-
channel: "slack",
|
|
1465
|
-
target: `${message.channel}/${message.ts}`,
|
|
1466
|
-
error: err
|
|
1467
|
-
});
|
|
1468
|
-
}
|
|
1469
|
-
});
|
|
1470
|
-
if (statusReactionsEnabled) statusReactions.setQueued();
|
|
1471
|
-
const hasRepliedRef = { value: false };
|
|
1472
|
-
const replyPlan = createSlackReplyDeliveryPlan({
|
|
1473
|
-
replyToMode: replyDeliveryMode,
|
|
1474
|
-
incomingThreadTs: forcedReplyThreadTs ?? incomingThreadTs,
|
|
1475
|
-
messageTs,
|
|
1476
|
-
hasRepliedRef,
|
|
1477
|
-
isThreadReply: Boolean(forcedReplyThreadTs) || isThreadReply
|
|
1478
|
-
});
|
|
1479
|
-
const typingTarget = statusThreadTs ? `${message.channel}/${statusThreadTs}` : message.channel;
|
|
1480
|
-
const typingReaction = ctx.typingReaction;
|
|
1481
|
-
const { onModelSelected, ...replyPipeline } = createChannelMessageReplyPipeline({
|
|
1482
|
-
cfg,
|
|
1483
|
-
agentId: route.agentId,
|
|
1484
|
-
channel: "slack",
|
|
1485
|
-
accountId: route.accountId,
|
|
1486
|
-
transformReplyPayload: (payload) => {
|
|
1487
|
-
if (payload.isReasoning === true) return null;
|
|
1488
|
-
return payload;
|
|
1489
|
-
},
|
|
1490
|
-
typing: {
|
|
1491
|
-
start: async () => {
|
|
1492
|
-
didSetStatus = true;
|
|
1493
|
-
await ctx.setSlackThreadStatus({
|
|
1494
|
-
channelId: message.channel,
|
|
1495
|
-
threadTs: statusThreadTs,
|
|
1496
|
-
status: "is typing...",
|
|
1497
|
-
eventScope: prepared.eventScope
|
|
1498
|
-
});
|
|
1499
|
-
if (typingReaction && message.ts) await reactSlackMessage(message.channel, message.ts, typingReaction, {
|
|
1500
|
-
token: ctx.botToken,
|
|
1501
|
-
client: slackClient
|
|
1502
|
-
}).catch((err) => {
|
|
1503
|
-
logVerbose(`slack send: typing reaction failed: ${formatSlackError(err)}`);
|
|
1504
|
-
});
|
|
1505
|
-
},
|
|
1506
|
-
stop: async () => {
|
|
1507
|
-
if (!didSetStatus) return;
|
|
1508
|
-
didSetStatus = false;
|
|
1509
|
-
await ctx.setSlackThreadStatus({
|
|
1510
|
-
channelId: message.channel,
|
|
1511
|
-
threadTs: statusThreadTs,
|
|
1512
|
-
status: "",
|
|
1513
|
-
eventScope: prepared.eventScope
|
|
1514
|
-
});
|
|
1515
|
-
if (typingReaction && message.ts) await removeSlackReaction(message.channel, message.ts, typingReaction, {
|
|
1516
|
-
token: ctx.botToken,
|
|
1517
|
-
client: slackClient
|
|
1518
|
-
}).catch((err) => {
|
|
1519
|
-
logVerbose(`slack send: typing reaction removal failed: ${formatSlackError(err)}`);
|
|
1520
|
-
});
|
|
1521
|
-
},
|
|
1522
|
-
onStartError: (err) => {
|
|
1523
|
-
logTypingFailure({
|
|
1524
|
-
log: (messageValue) => runtime.error?.(danger(messageValue)),
|
|
1525
|
-
channel: "slack",
|
|
1526
|
-
action: "start",
|
|
1527
|
-
target: typingTarget,
|
|
1528
|
-
error: err
|
|
1529
|
-
});
|
|
1530
|
-
},
|
|
1531
|
-
onStopError: (err) => {
|
|
1532
|
-
logTypingFailure({
|
|
1533
|
-
log: (messageLocal) => runtime.error?.(danger(messageLocal)),
|
|
1534
|
-
channel: "slack",
|
|
1535
|
-
action: "stop",
|
|
1536
|
-
target: typingTarget,
|
|
1537
|
-
error: err
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
});
|
|
1542
|
-
const slackStreaming = resolveSlackStreamingConfig({
|
|
1543
|
-
streaming: account.config.streaming,
|
|
1544
|
-
nativeStreaming: resolveChannelStreamingNativeTransport(account.config)
|
|
1545
|
-
});
|
|
1546
|
-
const streamThreadHint = forcedReplyThreadTs ?? resolveSlackStreamingThreadHint({
|
|
1547
|
-
replyToMode: replyDeliveryMode,
|
|
1548
|
-
incomingThreadTs,
|
|
1549
|
-
messageTs,
|
|
1550
|
-
isThreadReply
|
|
1551
|
-
});
|
|
1552
|
-
const previewStreamingEnabled = !sourceRepliesAreToolOnly && shouldEnableSlackPreviewStreaming({ mode: slackStreaming.mode });
|
|
1553
|
-
const hasSlackCustomIdentity = Boolean(slackIdentity?.username || slackIdentity?.iconUrl || slackIdentity?.iconEmoji);
|
|
1554
|
-
const useStreaming = shouldUseStreaming({
|
|
1555
|
-
streamingEnabled: !sourceRepliesAreToolOnly && isSlackStreamingEnabled({
|
|
1556
|
-
mode: slackStreaming.mode,
|
|
1557
|
-
nativeStreaming: slackStreaming.nativeStreaming,
|
|
1558
|
-
nativeProgressTaskCards: resolveSlackNativeProgressTaskCards(account.config)
|
|
1559
|
-
}),
|
|
1560
|
-
threadTs: streamThreadHint
|
|
1561
|
-
});
|
|
1562
|
-
const shouldUseDraftStream = !hasSlackCustomIdentity && shouldInitializeSlackDraftStream({
|
|
1563
|
-
previewStreamingEnabled,
|
|
1564
|
-
useStreaming
|
|
1565
|
-
});
|
|
1566
|
-
const blockStreamingEnabled = resolveChannelStreamingBlockEnabled(account.config);
|
|
1567
|
-
const disableBlockStreaming = sourceRepliesAreToolOnly ? true : resolveSlackDisableBlockStreaming({
|
|
1568
|
-
useStreaming,
|
|
1569
|
-
shouldUseDraftStream,
|
|
1570
|
-
blockStreamingEnabled
|
|
1571
|
-
});
|
|
1572
|
-
const onSlackDeliveryError = (err, info) => {
|
|
1573
|
-
runtime.error?.(danger(`slack ${info.kind} reply failed: ${formatSlackError(err)}`));
|
|
1574
|
-
replyPipeline.typingCallbacks?.onIdle?.();
|
|
1575
|
-
};
|
|
1576
|
-
return {
|
|
1577
|
-
prepared,
|
|
1578
|
-
ctx,
|
|
1579
|
-
account,
|
|
1580
|
-
message,
|
|
1581
|
-
route,
|
|
1582
|
-
slackClient,
|
|
1583
|
-
slackStreamFallbackTeamId,
|
|
1584
|
-
cfg,
|
|
1585
|
-
runtime,
|
|
1586
|
-
slackIdentity,
|
|
1587
|
-
forcedReplyThreadTs,
|
|
1588
|
-
slackMessageMetadata,
|
|
1589
|
-
statusThreadTs,
|
|
1590
|
-
isThreadReply,
|
|
1591
|
-
replyDeliveryMode,
|
|
1592
|
-
sourceReplyDeliveryMode,
|
|
1593
|
-
sourceRepliesAreToolOnly,
|
|
1594
|
-
suppressRoomEventTyping,
|
|
1595
|
-
messageSentHookTarget,
|
|
1596
|
-
messageSentHookContext,
|
|
1597
|
-
messageSentDeliveryHookContext,
|
|
1598
|
-
incomingThreadTs,
|
|
1599
|
-
messageTs,
|
|
1600
|
-
statusReactionsEnabled,
|
|
1601
|
-
statusReactions,
|
|
1602
|
-
hasRepliedRef,
|
|
1603
|
-
replyPlan,
|
|
1604
|
-
onModelSelected,
|
|
1605
|
-
replyPipeline,
|
|
1606
|
-
slackStreaming,
|
|
1607
|
-
streamThreadHint,
|
|
1608
|
-
previewStreamingEnabled,
|
|
1609
|
-
shouldUseDraftStream,
|
|
1610
|
-
disableBlockStreaming,
|
|
1611
|
-
useStreaming,
|
|
1612
|
-
onSlackDeliveryError
|
|
1613
|
-
};
|
|
1614
|
-
}
|
|
1615
|
-
//#endregion
|
|
1616
|
-
//#region extensions/slack/src/monitor/message-handler/dispatch-streaming.ts
|
|
1617
|
-
function createSlackStreamingDeliveryRuntime(setup) {
|
|
1618
|
-
const { account, ctx, forcedReplyThreadTs, isThreadReply, message, messageSentDeliveryHookContext, messageSentHookContext, messageSentHookTarget, prepared, replyDeliveryMode, replyPlan, runtime, slackClient, slackIdentity, slackMessageMetadata, slackStreamFallbackTeamId } = setup;
|
|
1619
|
-
const state = {
|
|
1620
|
-
streamSession: null,
|
|
1621
|
-
nativeProgressStreamStartPromise: null,
|
|
1622
|
-
nativeProgressStreamThreadTs: void 0,
|
|
1623
|
-
streamFailed: false,
|
|
1624
|
-
usedReplyThreadTs: void 0,
|
|
1625
|
-
usedBlockReplyThreadTs: void 0,
|
|
1626
|
-
observedReplyDelivery: false,
|
|
1627
|
-
observedFinalReplyDelivery: false
|
|
1628
|
-
};
|
|
1629
|
-
const streamedDeliveries = [];
|
|
1630
|
-
const streamedFailuresOwnedByDispatcher = {
|
|
1631
|
-
tool: 0,
|
|
1632
|
-
block: 0,
|
|
1633
|
-
final: 0
|
|
1634
|
-
};
|
|
1635
|
-
const refreshStreamedAcknowledgements = (session) => {
|
|
1636
|
-
if (session.pendingText.length === 0) for (const delivery of streamedDeliveries) delivery.acknowledged = true;
|
|
1637
|
-
};
|
|
1638
|
-
const recordStreamedDelivery = (kind, content) => {
|
|
1639
|
-
const delivery = {
|
|
1640
|
-
kind,
|
|
1641
|
-
content,
|
|
1642
|
-
acknowledged: false
|
|
1643
|
-
};
|
|
1644
|
-
streamedDeliveries.push(delivery);
|
|
1645
|
-
return delivery;
|
|
1646
|
-
};
|
|
1647
|
-
const rememberStreamedDelivery = (kind, content, session) => {
|
|
1648
|
-
recordStreamedDelivery(kind, content);
|
|
1649
|
-
refreshStreamedAcknowledgements(session);
|
|
1650
|
-
};
|
|
1651
|
-
const emitAcknowledgedStreamedDeliveries = (messageId) => {
|
|
1652
|
-
for (const delivery of streamedDeliveries) {
|
|
1653
|
-
if (!delivery.acknowledged || delivery.outcome) continue;
|
|
1654
|
-
emitSlackMessageSentHooks({
|
|
1655
|
-
...messageSentHookContext,
|
|
1656
|
-
to: messageSentHookTarget,
|
|
1657
|
-
accountId: account.accountId,
|
|
1658
|
-
content: delivery.content,
|
|
1659
|
-
success: true,
|
|
1660
|
-
...messageId ? { messageId } : {}
|
|
1661
|
-
});
|
|
1662
|
-
delivery.outcome = "success";
|
|
1663
|
-
}
|
|
1664
|
-
};
|
|
1665
|
-
const acknowledgeStoppedStreamedDeliveries = (session, messageId) => {
|
|
1666
|
-
refreshStreamedAcknowledgements(session);
|
|
1667
|
-
for (const delivery of streamedDeliveries) delivery.acknowledged = true;
|
|
1668
|
-
emitAcknowledgedStreamedDeliveries(messageId);
|
|
1669
|
-
};
|
|
1670
|
-
const emitFailedPendingStreamedDeliveries = (error) => {
|
|
1671
|
-
for (const delivery of streamedDeliveries) {
|
|
1672
|
-
if (delivery.acknowledged || delivery.outcome) continue;
|
|
1673
|
-
emitSlackMessageSentHooks({
|
|
1674
|
-
...messageSentHookContext,
|
|
1675
|
-
to: messageSentHookTarget,
|
|
1676
|
-
accountId: account.accountId,
|
|
1677
|
-
content: delivery.content,
|
|
1678
|
-
success: false,
|
|
1679
|
-
error
|
|
1680
|
-
});
|
|
1681
|
-
delivery.outcome = "failure";
|
|
1682
|
-
}
|
|
1683
|
-
};
|
|
1684
|
-
const emitSuccessfulPendingStreamedDeliveries = (messageId) => {
|
|
1685
|
-
for (const delivery of streamedDeliveries) {
|
|
1686
|
-
if (delivery.acknowledged || delivery.outcome) continue;
|
|
1687
|
-
emitSlackMessageSentHooks({
|
|
1688
|
-
...messageSentHookContext,
|
|
1689
|
-
to: messageSentHookTarget,
|
|
1690
|
-
accountId: account.accountId,
|
|
1691
|
-
content: delivery.content,
|
|
1692
|
-
success: true,
|
|
1693
|
-
...messageId ? { messageId } : {}
|
|
1694
|
-
});
|
|
1695
|
-
delivery.outcome = "success";
|
|
1696
|
-
}
|
|
1697
|
-
};
|
|
1698
|
-
let deliveryTracker = createSlackEventDeliveryTracker();
|
|
1699
|
-
const markPreviewPayloadDelivered = (params) => {
|
|
1700
|
-
deliveryTracker.markDelivered(params);
|
|
1701
|
-
const nextThreadTs = replyPlan.peekThreadTs();
|
|
1702
|
-
if (nextThreadTs !== params.threadTs) deliveryTracker.markDelivered({
|
|
1703
|
-
...params,
|
|
1704
|
-
threadTs: nextThreadTs
|
|
1705
|
-
});
|
|
1706
|
-
};
|
|
1707
|
-
const resolveDeliveryThreadTs = (params) => {
|
|
1708
|
-
const plannedThreadTs = params.forcedThreadTs ? void 0 : replyPlan.nextThreadTs();
|
|
1709
|
-
return params.forcedThreadTs ?? plannedThreadTs ?? (params.kind === "block" ? state.usedBlockReplyThreadTs : void 0);
|
|
1710
|
-
};
|
|
1711
|
-
const rememberDeliveredThreadTs = (kind, deliveredThreadTs) => {
|
|
1712
|
-
if (!deliveredThreadTs) return;
|
|
1713
|
-
state.usedReplyThreadTs ??= deliveredThreadTs;
|
|
1714
|
-
if (kind === "block") state.usedBlockReplyThreadTs = deliveredThreadTs;
|
|
1715
|
-
};
|
|
1716
|
-
const deliverPendingStreamFallback = async (session, err) => {
|
|
1717
|
-
let fallbackError = err;
|
|
1718
|
-
if (!session.stopped) try {
|
|
1719
|
-
const stopResult = await stopSlackStream({
|
|
1720
|
-
session,
|
|
1721
|
-
...slackMessageMetadata ? { metadata: slackMessageMetadata } : {}
|
|
1722
|
-
});
|
|
1723
|
-
acknowledgeStoppedStreamedDeliveries(session, stopResult.messageId);
|
|
1724
|
-
state.observedReplyDelivery = true;
|
|
1725
|
-
state.usedReplyThreadTs ??= session.threadTs;
|
|
1726
|
-
return true;
|
|
1727
|
-
} catch (stopErr) {
|
|
1728
|
-
if (stopErr instanceof SlackStreamNotDeliveredError) fallbackError = stopErr;
|
|
1729
|
-
else runtime.error?.(danger(`slack-stream: failed to finalize buffered text before fallback: ${formatSlackError(stopErr)}`));
|
|
1730
|
-
}
|
|
1731
|
-
emitAcknowledgedStreamedDeliveries();
|
|
1732
|
-
const fallbackText = fallbackError.pendingText.trim();
|
|
1733
|
-
if (!fallbackText) return false;
|
|
1734
|
-
try {
|
|
1735
|
-
await deliverReplies({
|
|
1736
|
-
cfg: ctx.cfg,
|
|
1737
|
-
replies: [{ text: fallbackText }],
|
|
1738
|
-
target: prepared.replyTarget,
|
|
1739
|
-
token: ctx.botToken,
|
|
1740
|
-
accountId: account.accountId,
|
|
1741
|
-
runtime,
|
|
1742
|
-
textLimit: ctx.textLimit,
|
|
1743
|
-
mediaMaxBytes: ctx.mediaMaxBytes,
|
|
1744
|
-
replyThreadTs: session.threadTs,
|
|
1745
|
-
replyToMode: replyDeliveryMode,
|
|
1746
|
-
...slackIdentity ? { identity: slackIdentity } : {},
|
|
1747
|
-
...slackMessageMetadata ? { metadata: slackMessageMetadata } : {},
|
|
1748
|
-
...messageSentDeliveryHookContext,
|
|
1749
|
-
deferMessageSentHooks: true,
|
|
1750
|
-
...prepared.eventScope ? { eventScope: prepared.eventScope } : {}
|
|
1751
|
-
});
|
|
1752
|
-
markSlackStreamFallbackDelivered(session);
|
|
1753
|
-
if (!session.stopped) try {
|
|
1754
|
-
await stopSlackStream({
|
|
1755
|
-
session,
|
|
1756
|
-
...slackMessageMetadata ? { metadata: slackMessageMetadata } : {}
|
|
1757
|
-
});
|
|
1758
|
-
} catch (finalizeErr) {
|
|
1759
|
-
runtime.error?.(danger(`slack-stream: failed to finalize native stream after fallback delivery: ${formatSlackError(finalizeErr)}`));
|
|
1760
|
-
}
|
|
1761
|
-
emitSuccessfulPendingStreamedDeliveries();
|
|
1762
|
-
state.observedReplyDelivery = true;
|
|
1763
|
-
state.usedReplyThreadTs ??= session.threadTs;
|
|
1764
|
-
logVerbose(`slack-stream: streamed delivery failed (${fallbackError.slackCode}); delivered ${fallbackText.length} chars via deliverReplies fallback`);
|
|
1765
|
-
return true;
|
|
1766
|
-
} catch (postErr) {
|
|
1767
|
-
emitFailedPendingStreamedDeliveries(formatErrorMessage(postErr));
|
|
1768
|
-
runtime.error?.(danger(`slack-stream: fallback deliverReplies failed after ${fallbackError.slackCode}: ${formatErrorMessage(postErr)}`));
|
|
1769
|
-
return false;
|
|
1770
|
-
}
|
|
1771
|
-
};
|
|
1772
|
-
const deliverNormally = async (params) => {
|
|
1773
|
-
if (params.payload.isReasoning === true) return;
|
|
1774
|
-
const replyThreadTs = resolveDeliveryThreadTs(params);
|
|
1775
|
-
const deliveryReplyThreadTs = replyDeliveryMode === "off" && !forcedReplyThreadTs && !isThreadReply ? void 0 : replyThreadTs;
|
|
1776
|
-
if (deliveryTracker.hasDelivered({
|
|
1777
|
-
kind: params.kind,
|
|
1778
|
-
payload: params.payload,
|
|
1779
|
-
threadTs: deliveryReplyThreadTs
|
|
1780
|
-
})) {
|
|
1781
|
-
logVerbose("slack: suppressed duplicate normal delivery within the same turn");
|
|
1782
|
-
return deliveryReplyThreadTs;
|
|
1783
|
-
}
|
|
1784
|
-
await deliverReplies({
|
|
1785
|
-
cfg: ctx.cfg,
|
|
1786
|
-
replies: [params.payload],
|
|
1787
|
-
target: prepared.replyTarget,
|
|
1788
|
-
token: ctx.botToken,
|
|
1789
|
-
accountId: account.accountId,
|
|
1790
|
-
runtime,
|
|
1791
|
-
textLimit: ctx.textLimit,
|
|
1792
|
-
mediaMaxBytes: ctx.mediaMaxBytes,
|
|
1793
|
-
replyThreadTs: deliveryReplyThreadTs,
|
|
1794
|
-
replyToMode: replyDeliveryMode,
|
|
1795
|
-
...slackIdentity ? { identity: slackIdentity } : {},
|
|
1796
|
-
...slackMessageMetadata ? { metadata: slackMessageMetadata } : {},
|
|
1797
|
-
...messageSentDeliveryHookContext,
|
|
1798
|
-
...prepared.eventScope ? { eventScope: prepared.eventScope } : {}
|
|
1799
|
-
});
|
|
1800
|
-
state.observedReplyDelivery = true;
|
|
1801
|
-
if (params.kind === "final") state.observedFinalReplyDelivery = true;
|
|
1802
|
-
const deliveredThreadTs = resolveDeliveredSlackReplyThreadTs({
|
|
1803
|
-
replyToMode: replyDeliveryMode,
|
|
1804
|
-
payloadReplyToId: params.payload.replyToId,
|
|
1805
|
-
replyThreadTs: deliveryReplyThreadTs
|
|
1806
|
-
});
|
|
1807
|
-
rememberDeliveredThreadTs(params.kind, deliveredThreadTs);
|
|
1808
|
-
replyPlan.markSent();
|
|
1809
|
-
deliveryTracker.markDelivered({
|
|
1810
|
-
kind: params.kind,
|
|
1811
|
-
payload: params.payload,
|
|
1812
|
-
threadTs: deliveryReplyThreadTs
|
|
1813
|
-
});
|
|
1814
|
-
return deliveryReplyThreadTs;
|
|
1815
|
-
};
|
|
1816
|
-
const deliverBufferedStreamFallback = async (params) => {
|
|
1817
|
-
if (!await deliverPendingStreamFallback(params.session, params.err)) {
|
|
1818
|
-
streamedFailuresOwnedByDispatcher[params.kind] += 1;
|
|
1819
|
-
return false;
|
|
1820
|
-
}
|
|
1821
|
-
replyPlan.markSent();
|
|
1822
|
-
if (params.kind === "final") state.observedFinalReplyDelivery = true;
|
|
1823
|
-
deliveryTracker.markDelivered({
|
|
1824
|
-
kind: params.kind,
|
|
1825
|
-
payload: params.payload,
|
|
1826
|
-
threadTs: params.session.threadTs,
|
|
1827
|
-
textOverride: params.textOverride
|
|
1828
|
-
});
|
|
1829
|
-
rememberDeliveredThreadTs(params.kind, params.session.threadTs);
|
|
1830
|
-
return true;
|
|
1831
|
-
};
|
|
1832
|
-
const deliverWithStreaming = async (params) => {
|
|
1833
|
-
if (params.payload.isReasoning === true) return;
|
|
1834
|
-
const reply = resolveSendableOutboundReplyParts(params.payload);
|
|
1835
|
-
const renderPlan = resolveSlackReplyRenderPlan(params.payload);
|
|
1836
|
-
const plannedBlocks = renderPlan.mode === "single" ? renderPlan.blocks : renderPlan.blockPart?.blocks;
|
|
1837
|
-
if (state.streamFailed || reply.hasMedia || renderPlan.mode === "split" || Boolean(plannedBlocks?.length) || readSlackReplyBlocks(params.payload)?.length || !reply.hasText) {
|
|
1838
|
-
await deliverNormally({
|
|
1839
|
-
payload: params.payload,
|
|
1840
|
-
kind: params.kind,
|
|
1841
|
-
forcedThreadTs: state.streamSession?.threadTs ?? state.nativeProgressStreamThreadTs
|
|
1842
|
-
});
|
|
1843
|
-
return;
|
|
1844
|
-
}
|
|
1845
|
-
const text = reply.trimmedText;
|
|
1846
|
-
let plannedThreadTs;
|
|
1847
|
-
try {
|
|
1848
|
-
if (!state.streamSession && state.nativeProgressStreamStartPromise) await state.nativeProgressStreamStartPromise;
|
|
1849
|
-
if (state.streamFailed) {
|
|
1850
|
-
await deliverNormally({
|
|
1851
|
-
payload: params.payload,
|
|
1852
|
-
kind: params.kind,
|
|
1853
|
-
forcedThreadTs: state.streamSession?.threadTs ?? state.nativeProgressStreamThreadTs
|
|
1854
|
-
});
|
|
1855
|
-
return;
|
|
1856
|
-
}
|
|
1857
|
-
if (!state.streamSession) {
|
|
1858
|
-
const streamThreadTs = replyPlan.nextThreadTs();
|
|
1859
|
-
plannedThreadTs = streamThreadTs;
|
|
1860
|
-
if (!streamThreadTs) {
|
|
1861
|
-
logVerbose("slack-stream: no reply thread target for stream start, falling back to normal delivery");
|
|
1862
|
-
state.streamFailed = true;
|
|
1863
|
-
await deliverNormally({
|
|
1864
|
-
payload: params.payload,
|
|
1865
|
-
kind: params.kind
|
|
1866
|
-
});
|
|
1867
|
-
return;
|
|
1868
|
-
}
|
|
1869
|
-
if (deliveryTracker.hasDelivered({
|
|
1870
|
-
kind: params.kind,
|
|
1871
|
-
payload: params.payload,
|
|
1872
|
-
threadTs: streamThreadTs,
|
|
1873
|
-
textOverride: text
|
|
1874
|
-
})) {
|
|
1875
|
-
logVerbose("slack-stream: suppressed duplicate stream start payload");
|
|
1876
|
-
return;
|
|
1877
|
-
}
|
|
1878
|
-
state.streamSession = await startSlackStream({
|
|
1879
|
-
client: slackClient,
|
|
1880
|
-
channel: message.channel,
|
|
1881
|
-
threadTs: streamThreadTs,
|
|
1882
|
-
text,
|
|
1883
|
-
...slackIdentity ? { identity: slackIdentity } : {},
|
|
1884
|
-
teamId: await resolveSlackStreamRecipientTeamId({
|
|
1885
|
-
client: slackClient,
|
|
1886
|
-
token: ctx.botToken,
|
|
1887
|
-
userId: message.user,
|
|
1888
|
-
fallbackTeamId: slackStreamFallbackTeamId
|
|
1889
|
-
}),
|
|
1890
|
-
userId: message.user
|
|
1891
|
-
});
|
|
1892
|
-
refreshStreamedAcknowledgements(state.streamSession);
|
|
1893
|
-
if (state.streamSession.delivered) {
|
|
1894
|
-
state.observedReplyDelivery = true;
|
|
1895
|
-
if (params.kind === "final") state.observedFinalReplyDelivery = true;
|
|
1896
|
-
}
|
|
1897
|
-
if (text) rememberStreamedDelivery(params.kind, text, state.streamSession);
|
|
1898
|
-
rememberDeliveredThreadTs(params.kind, streamThreadTs);
|
|
1899
|
-
replyPlan.markSent();
|
|
1900
|
-
deliveryTracker.markDelivered({
|
|
1901
|
-
kind: params.kind,
|
|
1902
|
-
payload: params.payload,
|
|
1903
|
-
threadTs: streamThreadTs,
|
|
1904
|
-
textOverride: text
|
|
1905
|
-
});
|
|
1906
|
-
return;
|
|
1907
|
-
}
|
|
1908
|
-
if (deliveryTracker.hasDelivered({
|
|
1909
|
-
kind: params.kind,
|
|
1910
|
-
payload: params.payload,
|
|
1911
|
-
threadTs: state.streamSession.threadTs,
|
|
1912
|
-
textOverride: text
|
|
1913
|
-
})) {
|
|
1914
|
-
logVerbose("slack-stream: suppressed duplicate append payload");
|
|
1915
|
-
return;
|
|
1916
|
-
}
|
|
1917
|
-
if (text) recordStreamedDelivery(params.kind, text);
|
|
1918
|
-
await appendSlackStream({
|
|
1919
|
-
session: state.streamSession,
|
|
1920
|
-
text: "\n" + text
|
|
1921
|
-
});
|
|
1922
|
-
refreshStreamedAcknowledgements(state.streamSession);
|
|
1923
|
-
if (state.streamSession.delivered) {
|
|
1924
|
-
state.observedReplyDelivery = true;
|
|
1925
|
-
if (params.kind === "final") state.observedFinalReplyDelivery = true;
|
|
1926
|
-
}
|
|
1927
|
-
deliveryTracker.markDelivered({
|
|
1928
|
-
kind: params.kind,
|
|
1929
|
-
payload: params.payload,
|
|
1930
|
-
threadTs: state.streamSession.threadTs,
|
|
1931
|
-
textOverride: text
|
|
1932
|
-
});
|
|
1933
|
-
} catch (err) {
|
|
1934
|
-
if (err instanceof SlackStreamNotDeliveredError) {
|
|
1935
|
-
state.streamFailed = true;
|
|
1936
|
-
if (state.streamSession) {
|
|
1937
|
-
if (await deliverBufferedStreamFallback({
|
|
1938
|
-
session: state.streamSession,
|
|
1939
|
-
err,
|
|
1940
|
-
payload: params.payload,
|
|
1941
|
-
kind: params.kind,
|
|
1942
|
-
textOverride: text
|
|
1943
|
-
})) return;
|
|
1944
|
-
throw err;
|
|
1945
|
-
}
|
|
1946
|
-
await deliverNormally({
|
|
1947
|
-
payload: params.payload,
|
|
1948
|
-
kind: params.kind,
|
|
1949
|
-
forcedThreadTs: plannedThreadTs
|
|
1950
|
-
});
|
|
1951
|
-
return;
|
|
1952
|
-
}
|
|
1953
|
-
runtime.error?.(danger(`slack-stream: streaming API call failed: ${formatSlackError(err)}, falling back`));
|
|
1954
|
-
state.streamFailed = true;
|
|
1955
|
-
if (state.streamSession && state.streamSession.pendingText) {
|
|
1956
|
-
const bufferedFallbackErr = new SlackStreamNotDeliveredError(state.streamSession.pendingText, "unknown");
|
|
1957
|
-
if (await deliverBufferedStreamFallback({
|
|
1958
|
-
session: state.streamSession,
|
|
1959
|
-
err: bufferedFallbackErr,
|
|
1960
|
-
payload: params.payload,
|
|
1961
|
-
kind: params.kind,
|
|
1962
|
-
textOverride: text
|
|
1963
|
-
})) return;
|
|
1964
|
-
throw err;
|
|
1965
|
-
}
|
|
1966
|
-
await deliverNormally({
|
|
1967
|
-
payload: params.payload,
|
|
1968
|
-
kind: params.kind,
|
|
1969
|
-
forcedThreadTs: state.streamSession?.threadTs ?? state.nativeProgressStreamThreadTs ?? plannedThreadTs
|
|
1970
|
-
});
|
|
1971
|
-
}
|
|
1972
|
-
};
|
|
1973
|
-
const reconcileCounts = (counts) => {
|
|
1974
|
-
const next = { ...counts };
|
|
1975
|
-
let changed = false;
|
|
1976
|
-
for (const kind of [
|
|
1977
|
-
"tool",
|
|
1978
|
-
"block",
|
|
1979
|
-
"final"
|
|
1980
|
-
]) {
|
|
1981
|
-
const failedStreamedCount = streamedDeliveries.filter((delivery) => delivery.kind === kind && delivery.outcome === "failure").length;
|
|
1982
|
-
const additionalFailedStreamed = Math.max(0, failedStreamedCount - streamedFailuresOwnedByDispatcher[kind]);
|
|
1983
|
-
if (additionalFailedStreamed > 0) {
|
|
1984
|
-
next[kind] = Math.max(0, (next[kind] ?? 0) - additionalFailedStreamed);
|
|
1985
|
-
changed = true;
|
|
1986
|
-
}
|
|
1987
|
-
}
|
|
1988
|
-
return changed ? next : counts;
|
|
1989
|
-
};
|
|
1990
|
-
return Object.assign(state, {
|
|
1991
|
-
acknowledgeStoppedStreamedDeliveries,
|
|
1992
|
-
deliverNormally,
|
|
1993
|
-
deliverPendingStreamFallback,
|
|
1994
|
-
deliverWithStreaming,
|
|
1995
|
-
emitAcknowledgedStreamedDeliveries,
|
|
1996
|
-
emitFailedPendingStreamedDeliveries,
|
|
1997
|
-
hasDelivered: (params) => deliveryTracker.hasDelivered(params),
|
|
1998
|
-
markPreviewPayloadDelivered,
|
|
1999
|
-
rememberDeliveredThreadTs,
|
|
2000
|
-
reconcileCounts,
|
|
2001
|
-
resetDeliveryTracker: () => {
|
|
2002
|
-
deliveryTracker = createSlackEventDeliveryTracker();
|
|
2003
|
-
}
|
|
2004
|
-
});
|
|
2005
|
-
}
|
|
2006
|
-
//#endregion
|
|
2007
|
-
//#region extensions/slack/src/monitor/message-handler/dispatch.ts
|
|
2008
|
-
async function dispatchPreparedSlackMessage(prepared) {
|
|
2009
|
-
const setup = await createSlackDispatchSetup(prepared);
|
|
2010
|
-
const { account, cfg, ctx, disableBlockStreaming, hasRepliedRef, message, messageSentHookContext, messageSentHookTarget, onModelSelected, onSlackDeliveryError, previewStreamingEnabled, replyPipeline, replyPlan, route, runtime, slackClient, slackMessageMetadata, slackStreaming, sourceReplyDeliveryMode, statusReactions, statusReactionsEnabled, statusThreadTs, suppressRoomEventTyping, useStreaming } = setup;
|
|
2011
|
-
const delivery = createSlackStreamingDeliveryRuntime(setup);
|
|
2012
|
-
const draftPreviewCommitted = { value: false };
|
|
2013
|
-
const progress = createSlackProgressRuntime({
|
|
2014
|
-
setup,
|
|
2015
|
-
delivery,
|
|
2016
|
-
resetPreviewDeliveryState: () => {
|
|
2017
|
-
draftPreviewCommitted.value = false;
|
|
2018
|
-
delivery.observedFinalReplyDelivery = false;
|
|
2019
|
-
}
|
|
2020
|
-
});
|
|
2021
|
-
const draftStream = progress.draftStream;
|
|
2022
|
-
const deliverSlackPayload = async (payload, info) => {
|
|
2023
|
-
if (payload.isReasoning === true) return { visibleReplySent: false };
|
|
2024
|
-
if (info.kind === "final" && slackStreaming.mode === "progress" && progress.streamMode === "status_final") {
|
|
2025
|
-
const hadProgressDraft = progress.progressDraft.hasStarted;
|
|
2026
|
-
progress.progressDraft.markFinalReplyStarted();
|
|
2027
|
-
if (progress.useNativeProgressStreaming) {
|
|
2028
|
-
await progress.waitForNativeProgressStreamStart();
|
|
2029
|
-
const finalThreadTs = delivery.streamSession?.threadTs ?? delivery.nativeProgressStreamThreadTs;
|
|
2030
|
-
await delivery.deliverNormally({
|
|
2031
|
-
payload,
|
|
2032
|
-
kind: info.kind,
|
|
2033
|
-
forcedThreadTs: finalThreadTs
|
|
2034
|
-
});
|
|
2035
|
-
await progress.appendNativeProgressCompletion(payload.isError === true);
|
|
2036
|
-
progress.progressDraft.markFinalReplyDelivered();
|
|
2037
|
-
if (!payload.isError && hadProgressDraft && delivery.streamSession) progress.pendingNativeProgressReceipt = progress.progressReceipt.buildSummaryLine();
|
|
2038
|
-
return;
|
|
2039
|
-
}
|
|
2040
|
-
if (hadProgressDraft) try {
|
|
2041
|
-
await draftStream?.flush();
|
|
2042
|
-
} catch (err) {
|
|
2043
|
-
logVerbose(`slack: progress draft flush before final failed (${formatSlackError(err)})`);
|
|
2044
|
-
}
|
|
2045
|
-
const receiptChannelId = hadProgressDraft ? draftStream?.channelId() : void 0;
|
|
2046
|
-
const receiptMessageId = hadProgressDraft ? draftStream?.messageId() : void 0;
|
|
2047
|
-
const draftThreadTs = hadProgressDraft ? delivery.usedReplyThreadTs ?? statusThreadTs : void 0;
|
|
2048
|
-
await delivery.deliverNormally({
|
|
2049
|
-
payload,
|
|
2050
|
-
kind: info.kind,
|
|
2051
|
-
...draftThreadTs ? { forcedThreadTs: draftThreadTs } : {}
|
|
2052
|
-
});
|
|
2053
|
-
progress.progressDraft.markFinalReplyDelivered();
|
|
2054
|
-
if (!payload.isError && receiptChannelId && receiptMessageId && !progress.progressReceiptCollapsed) await progress.collapseProgressReceipt({
|
|
2055
|
-
channelId: receiptChannelId,
|
|
2056
|
-
messageId: receiptMessageId,
|
|
2057
|
-
text: progress.progressReceipt.buildSummaryLine(),
|
|
2058
|
-
threadTs: delivery.usedReplyThreadTs ?? statusThreadTs
|
|
2059
|
-
});
|
|
2060
|
-
return;
|
|
2061
|
-
}
|
|
2062
|
-
if (progress.useNativeProgressStreaming) {
|
|
2063
|
-
await delivery.deliverNormally({
|
|
2064
|
-
payload,
|
|
2065
|
-
kind: info.kind,
|
|
2066
|
-
forcedThreadTs: delivery.streamSession?.threadTs ?? delivery.nativeProgressStreamThreadTs
|
|
2067
|
-
});
|
|
2068
|
-
return;
|
|
2069
|
-
}
|
|
2070
|
-
if (useStreaming) {
|
|
2071
|
-
await delivery.deliverWithStreaming({
|
|
2072
|
-
payload,
|
|
2073
|
-
kind: info.kind
|
|
2074
|
-
});
|
|
2075
|
-
return;
|
|
2076
|
-
}
|
|
2077
|
-
const reply = resolveSendableOutboundReplyParts(payload);
|
|
2078
|
-
const ttsSupplement = getReplyPayloadTtsSupplement(payload);
|
|
2079
|
-
const replySourceText = payload.text ?? ttsSupplement?.spokenText;
|
|
2080
|
-
const replyRenderPlan = resolveSlackReplyRenderPlan(payload, replySourceText);
|
|
2081
|
-
const slackBlocks = replyRenderPlan.mode === "single" ? replyRenderPlan.blocks : replyRenderPlan.blockPart?.blocks;
|
|
2082
|
-
const requiresSeparateFallbackDelivery = replyRenderPlan.mode === "split";
|
|
2083
|
-
const trimmedFinalText = replyRenderPlan.mode === "single" ? replyRenderPlan.text.trim() : replyRenderPlan.fallbackText.trim();
|
|
2084
|
-
const previewFinalText = replyRenderPlan.mode === "single" && replyRenderPlan.textIsSlackMrkdwn ? trimmedFinalText : normalizeSlackOutboundText((replySourceText ?? "").trim());
|
|
2085
|
-
const shouldRestoreTtsSupplementTextForPreviewFallback = Boolean(ttsSupplement) && ttsSupplement?.visibleTextAlreadyDelivered !== true && Boolean(draftStream) && !draftPreviewCommitted.value && !delivery.observedFinalReplyDelivery && previewStreamingEnabled && !payload.text?.trim();
|
|
2086
|
-
if (info.kind === "final" && ttsSupplement && draftStream && !draftPreviewCommitted.value && !delivery.observedFinalReplyDelivery && previewStreamingEnabled && !payload.isError && !requiresSeparateFallbackDelivery && trimmedFinalText.length > 0) {
|
|
2087
|
-
const channelId = draftStream.channelId();
|
|
2088
|
-
const messageId = draftStream.messageId();
|
|
2089
|
-
if (channelId && messageId) {
|
|
2090
|
-
const finalThreadTs = delivery.usedReplyThreadTs ?? statusThreadTs;
|
|
2091
|
-
await draftStream.flush();
|
|
2092
|
-
await draftStream.seal();
|
|
2093
|
-
try {
|
|
2094
|
-
await finalizeSlackPreviewEdit({
|
|
2095
|
-
client: slackClient,
|
|
2096
|
-
token: ctx.botToken,
|
|
2097
|
-
accountId: account.accountId,
|
|
2098
|
-
channelId,
|
|
2099
|
-
messageId,
|
|
2100
|
-
text: previewFinalText,
|
|
2101
|
-
...slackBlocks?.length ? { blocks: slackBlocks } : {},
|
|
2102
|
-
threadTs: finalThreadTs
|
|
2103
|
-
});
|
|
2104
|
-
} catch (err) {
|
|
2105
|
-
logVerbose(`slack: preview final edit failed; falling back to standard send (${formatSlackError(err)})`);
|
|
2106
|
-
await draftStream.discardPending();
|
|
2107
|
-
let delivered = false;
|
|
2108
|
-
try {
|
|
2109
|
-
await delivery.deliverNormally({
|
|
2110
|
-
payload: payload.text?.trim() ? payload : {
|
|
2111
|
-
...payload,
|
|
2112
|
-
text: ttsSupplement.spokenText
|
|
2113
|
-
},
|
|
2114
|
-
kind: info.kind,
|
|
2115
|
-
forcedThreadTs: finalThreadTs
|
|
2116
|
-
});
|
|
2117
|
-
delivered = true;
|
|
2118
|
-
} finally {
|
|
2119
|
-
if (delivered) await draftStream.clear();
|
|
2120
|
-
}
|
|
2121
|
-
return;
|
|
2122
|
-
}
|
|
2123
|
-
draftPreviewCommitted.value = true;
|
|
2124
|
-
delivery.observedFinalReplyDelivery = true;
|
|
2125
|
-
delivery.observedReplyDelivery = true;
|
|
2126
|
-
replyPlan.markSent();
|
|
2127
|
-
await delivery.deliverNormally({
|
|
2128
|
-
payload: buildTtsSupplementMediaPayload(payload),
|
|
2129
|
-
kind: info.kind,
|
|
2130
|
-
forcedThreadTs: finalThreadTs
|
|
2131
|
-
});
|
|
2132
|
-
delivery.markPreviewPayloadDelivered({
|
|
2133
|
-
kind: info.kind,
|
|
2134
|
-
payload,
|
|
2135
|
-
threadTs: finalThreadTs
|
|
2136
|
-
});
|
|
2137
|
-
return;
|
|
2138
|
-
}
|
|
2139
|
-
}
|
|
2140
|
-
await deliverWithFinalizableLivePreviewAdapter({
|
|
2141
|
-
kind: info.kind,
|
|
2142
|
-
payload,
|
|
2143
|
-
adapter: defineFinalizableLivePreviewAdapter({
|
|
2144
|
-
draft: draftStream && !draftPreviewCommitted.value && !delivery.observedFinalReplyDelivery ? {
|
|
2145
|
-
flush: draftStream.flush,
|
|
2146
|
-
clear: draftStream.clear,
|
|
2147
|
-
discardPending: draftStream.discardPending,
|
|
2148
|
-
seal: draftStream.seal,
|
|
2149
|
-
id: () => {
|
|
2150
|
-
const channelId = draftStream.channelId();
|
|
2151
|
-
const messageId = draftStream.messageId();
|
|
2152
|
-
return channelId && messageId ? {
|
|
2153
|
-
channelId,
|
|
2154
|
-
messageId
|
|
2155
|
-
} : void 0;
|
|
2156
|
-
}
|
|
2157
|
-
} : void 0,
|
|
2158
|
-
buildFinalEdit: () => {
|
|
2159
|
-
if (!previewStreamingEnabled || reply.hasMedia && !ttsSupplement || payload.isError || requiresSeparateFallbackDelivery || trimmedFinalText.length === 0 && !slackBlocks?.length) return;
|
|
2160
|
-
return {
|
|
2161
|
-
text: previewFinalText,
|
|
2162
|
-
blocks: slackBlocks,
|
|
2163
|
-
threadTs: delivery.usedReplyThreadTs ?? statusThreadTs
|
|
2164
|
-
};
|
|
2165
|
-
},
|
|
2166
|
-
editFinal: async (preview, edit) => {
|
|
2167
|
-
if (delivery.hasDelivered({
|
|
2168
|
-
kind: info.kind,
|
|
2169
|
-
payload,
|
|
2170
|
-
threadTs: edit.threadTs
|
|
2171
|
-
})) return;
|
|
2172
|
-
await finalizeSlackPreviewEdit({
|
|
2173
|
-
client: slackClient,
|
|
2174
|
-
token: ctx.botToken,
|
|
2175
|
-
accountId: account.accountId,
|
|
2176
|
-
channelId: preview.channelId,
|
|
2177
|
-
messageId: preview.messageId,
|
|
2178
|
-
text: edit.text,
|
|
2179
|
-
...edit.blocks?.length ? { blocks: edit.blocks } : {},
|
|
2180
|
-
threadTs: edit.threadTs
|
|
2181
|
-
});
|
|
2182
|
-
if (!ttsSupplement) emitSlackMessageSentHooks({
|
|
2183
|
-
...messageSentHookContext,
|
|
2184
|
-
to: messageSentHookTarget,
|
|
2185
|
-
accountId: account.accountId,
|
|
2186
|
-
content: trimmedFinalText,
|
|
2187
|
-
success: true,
|
|
2188
|
-
messageId: preview.messageId
|
|
2189
|
-
});
|
|
2190
|
-
draftPreviewCommitted.value = true;
|
|
2191
|
-
delivery.observedFinalReplyDelivery = true;
|
|
2192
|
-
},
|
|
2193
|
-
onPreviewFinalized: (_preview) => {
|
|
2194
|
-
draftPreviewCommitted.value = true;
|
|
2195
|
-
delivery.observedFinalReplyDelivery = true;
|
|
2196
|
-
const finalThreadTs = delivery.usedReplyThreadTs ?? statusThreadTs;
|
|
2197
|
-
delivery.observedReplyDelivery = true;
|
|
2198
|
-
replyPlan.markSent();
|
|
2199
|
-
if (!ttsSupplement) delivery.markPreviewPayloadDelivered({
|
|
2200
|
-
kind: info.kind,
|
|
2201
|
-
payload,
|
|
2202
|
-
threadTs: finalThreadTs
|
|
2203
|
-
});
|
|
2204
|
-
},
|
|
2205
|
-
buildSupplementalPayload: () => ttsSupplement ? buildTtsSupplementMediaPayload(payload) : void 0,
|
|
2206
|
-
deliverSupplemental: async (supplementalPayload) => {
|
|
2207
|
-
const previewThreadTs = delivery.usedReplyThreadTs ?? statusThreadTs;
|
|
2208
|
-
const supplementalThreadTs = await delivery.deliverNormally({
|
|
2209
|
-
payload: supplementalPayload,
|
|
2210
|
-
kind: info.kind,
|
|
2211
|
-
forcedThreadTs: previewThreadTs
|
|
2212
|
-
});
|
|
2213
|
-
delivery.markPreviewPayloadDelivered({
|
|
2214
|
-
kind: info.kind,
|
|
2215
|
-
payload,
|
|
2216
|
-
threadTs: supplementalThreadTs
|
|
2217
|
-
});
|
|
2218
|
-
},
|
|
2219
|
-
logPreviewEditFailure: (err) => {
|
|
2220
|
-
logVerbose(`slack: preview final edit failed; falling back to standard send (${formatSlackError(err)})`);
|
|
2221
|
-
}
|
|
2222
|
-
}),
|
|
2223
|
-
deliverNormally: async () => {
|
|
2224
|
-
await delivery.deliverNormally({
|
|
2225
|
-
payload: shouldRestoreTtsSupplementTextForPreviewFallback ? {
|
|
2226
|
-
...payload,
|
|
2227
|
-
text: ttsSupplement?.spokenText
|
|
2228
|
-
} : payload,
|
|
2229
|
-
kind: info.kind
|
|
2230
|
-
});
|
|
2231
|
-
}
|
|
2232
|
-
});
|
|
2233
|
-
};
|
|
2234
|
-
let dispatchError;
|
|
2235
|
-
let queuedFinal = false;
|
|
2236
|
-
let counts = {};
|
|
2237
|
-
try {
|
|
2238
|
-
const turnResult = await dispatchChannelInboundTurn({
|
|
2239
|
-
cfg,
|
|
2240
|
-
channel: "slack",
|
|
2241
|
-
accountId: route.accountId,
|
|
2242
|
-
route: {
|
|
2243
|
-
agentId: route.agentId,
|
|
2244
|
-
sessionKey: route.sessionKey
|
|
2245
|
-
},
|
|
2246
|
-
ctxPayload: prepared.ctxPayload,
|
|
2247
|
-
dispatcherOptions: {
|
|
2248
|
-
...replyPipeline,
|
|
2249
|
-
humanDelay: resolveHumanDelayConfig(cfg, route.agentId)
|
|
2250
|
-
},
|
|
2251
|
-
delivery: {
|
|
2252
|
-
deliver: deliverSlackPayload,
|
|
2253
|
-
onError: onSlackDeliveryError
|
|
2254
|
-
},
|
|
2255
|
-
record: prepared.turn.record,
|
|
2256
|
-
history: prepared.turn.history,
|
|
2257
|
-
botLoopProtection: resolveSlackBotLoopProtection(prepared),
|
|
2258
|
-
replyOptions: {
|
|
2259
|
-
...prepared.turnAdoptionLifecycle ? { turnAdoptionLifecycle: prepared.turnAdoptionLifecycle } : {},
|
|
2260
|
-
skillFilter: prepared.channelConfig?.skills,
|
|
2261
|
-
sourceReplyDeliveryMode,
|
|
2262
|
-
suppressTyping: suppressRoomEventTyping ? true : void 0,
|
|
2263
|
-
hasRepliedRef,
|
|
2264
|
-
disableBlockStreaming,
|
|
2265
|
-
onModelSelected,
|
|
2266
|
-
suppressDefaultToolProgressMessages: progress.suppressDefaultToolProgressMessages ? true : void 0,
|
|
2267
|
-
commentaryProgressEnabled: progress.commentaryProgressEnabled ? true : void 0,
|
|
2268
|
-
progressPreambleEnabled: progress.progressDraftActive && slackStreaming.mode === "progress" ? true : void 0,
|
|
2269
|
-
commentaryPayloadsEnabled: progress.commentaryProgressEnabled ? true : void 0,
|
|
2270
|
-
onVerboseProgressVisibility: progress.commentaryProgressEnabled ? (isActive) => {
|
|
2271
|
-
progress.setShouldYieldDraftProgress(isActive);
|
|
2272
|
-
} : void 0,
|
|
2273
|
-
allowProgressCallbacksWhenSourceDeliverySuppressed: sourceReplyDeliveryMode === "message_tool_only" && statusReactionsEnabled ? true : void 0,
|
|
2274
|
-
allowToolLifecycleWhenProgressHidden: statusReactionsEnabled ? true : void 0,
|
|
2275
|
-
onPartialReply: useStreaming ? void 0 : !previewStreamingEnabled ? void 0 : async (payload) => {
|
|
2276
|
-
progress.updateDraftFromPartial(payload.text);
|
|
2277
|
-
},
|
|
2278
|
-
onAssistantMessageStart: progress.onDraftBoundary,
|
|
2279
|
-
onReasoningEnd: async () => {
|
|
2280
|
-
progress.progressReceipt.closeReasoning();
|
|
2281
|
-
await progress.onDraftBoundary?.();
|
|
2282
|
-
},
|
|
2283
|
-
onQueuedFollowupAdmitted: progress.onQueuedFollowupAdmitted,
|
|
2284
|
-
onReasoningStream: statusReactionsEnabled || progress.previewToolProgressEnabled ? async (payload) => {
|
|
2285
|
-
await progress.pushReasoningProgress(payload);
|
|
2286
|
-
if (!statusReactionsEnabled) return;
|
|
2287
|
-
await statusReactions.setThinking();
|
|
2288
|
-
} : void 0,
|
|
2289
|
-
onToolStart: async (payload) => {
|
|
2290
|
-
if (statusReactionsEnabled) await statusReactions.setTool(payload.name);
|
|
2291
|
-
if (payload.phase === "start") progress.progressReceipt.noteToolCall(payload.name);
|
|
2292
|
-
await progress.pushPreviewProgress(buildChannelProgressDraftLineForEntry(account.config, {
|
|
2293
|
-
event: "tool",
|
|
2294
|
-
itemId: payload.itemId,
|
|
2295
|
-
toolCallId: payload.toolCallId,
|
|
2296
|
-
name: payload.name,
|
|
2297
|
-
phase: payload.phase,
|
|
2298
|
-
args: payload.args
|
|
2299
|
-
}, payload.detailMode ? { detailMode: payload.detailMode } : void 0), { toolName: payload.name });
|
|
2300
|
-
},
|
|
2301
|
-
onItemEvent: async (payload) => {
|
|
2302
|
-
if (progress.streamMode === "status_final" && payload.kind === "preamble") {
|
|
2303
|
-
if (progress.shouldYieldDraftProgress()) return;
|
|
2304
|
-
await progress.progressDraft.pushPreambleHeadline(payload.progressText, { itemId: payload.itemId });
|
|
2305
|
-
if (progress.commentaryProgressEnabled) {
|
|
2306
|
-
if (await progress.progressDraft.pushCommentaryProgress(payload.progressText, { itemId: payload.itemId })) progress.progressReceipt.noteCommentary(payload.itemId, payload.progressText);
|
|
2307
|
-
}
|
|
2308
|
-
return;
|
|
2309
|
-
}
|
|
2310
|
-
await progress.pushPreviewProgress(buildChannelProgressDraftLineForEntry(account.config, {
|
|
2311
|
-
event: "item",
|
|
2312
|
-
itemId: payload.itemId,
|
|
2313
|
-
toolCallId: payload.toolCallId,
|
|
2314
|
-
itemKind: payload.kind,
|
|
2315
|
-
title: payload.title,
|
|
2316
|
-
name: payload.name,
|
|
2317
|
-
phase: payload.phase,
|
|
2318
|
-
status: payload.status,
|
|
2319
|
-
summary: payload.summary,
|
|
2320
|
-
progressText: payload.progressText,
|
|
2321
|
-
meta: payload.meta
|
|
2322
|
-
}));
|
|
2323
|
-
},
|
|
2324
|
-
onPlanUpdate: async (payload) => {
|
|
2325
|
-
if (payload.phase !== "update") return;
|
|
2326
|
-
await progress.pushPlanProgress(payload.steps, payload.explanation);
|
|
2327
|
-
},
|
|
2328
|
-
onApprovalEvent: async (payload) => {
|
|
2329
|
-
if (payload.phase !== "requested") return;
|
|
2330
|
-
await progress.pushPreviewProgress(buildChannelProgressDraftLine({
|
|
2331
|
-
event: "approval",
|
|
2332
|
-
phase: payload.phase,
|
|
2333
|
-
title: payload.title,
|
|
2334
|
-
command: payload.command,
|
|
2335
|
-
reason: payload.reason,
|
|
2336
|
-
message: payload.message
|
|
2337
|
-
}));
|
|
2338
|
-
},
|
|
2339
|
-
onCommandOutput: async (payload) => {
|
|
2340
|
-
if (payload.phase !== "end") return;
|
|
2341
|
-
await progress.pushPreviewProgress(buildChannelProgressDraftLine({
|
|
2342
|
-
event: "command-output",
|
|
2343
|
-
itemId: payload.itemId,
|
|
2344
|
-
toolCallId: payload.toolCallId,
|
|
2345
|
-
phase: payload.phase,
|
|
2346
|
-
title: payload.title,
|
|
2347
|
-
name: payload.name,
|
|
2348
|
-
status: payload.status,
|
|
2349
|
-
exitCode: payload.exitCode
|
|
2350
|
-
}));
|
|
2351
|
-
},
|
|
2352
|
-
onPatchSummary: async (payload) => {
|
|
2353
|
-
if (payload.phase !== "end") return;
|
|
2354
|
-
await progress.pushPreviewProgress(buildChannelProgressDraftLine({
|
|
2355
|
-
event: "patch",
|
|
2356
|
-
itemId: payload.itemId,
|
|
2357
|
-
toolCallId: payload.toolCallId,
|
|
2358
|
-
phase: payload.phase,
|
|
2359
|
-
title: payload.title,
|
|
2360
|
-
name: payload.name,
|
|
2361
|
-
added: payload.added,
|
|
2362
|
-
modified: payload.modified,
|
|
2363
|
-
deleted: payload.deleted,
|
|
2364
|
-
summary: payload.summary
|
|
2365
|
-
}));
|
|
2366
|
-
}
|
|
2367
|
-
}
|
|
2368
|
-
});
|
|
2369
|
-
if (turnResult.dispatched) {
|
|
2370
|
-
const result = turnResult.dispatchResult;
|
|
2371
|
-
queuedFinal = result.queuedFinal;
|
|
2372
|
-
counts = result.counts;
|
|
2373
|
-
}
|
|
2374
|
-
} catch (err) {
|
|
2375
|
-
dispatchError = err;
|
|
2376
|
-
} finally {
|
|
2377
|
-
progress.progressDraft.cancel();
|
|
2378
|
-
await draftStream?.discardPending();
|
|
2379
|
-
}
|
|
2380
|
-
let streamFallbackDelivered = false;
|
|
2381
|
-
const finalStream = delivery.streamSession;
|
|
2382
|
-
if (finalStream && !finalStream.stopped) try {
|
|
2383
|
-
const completionChunks = progress.useNativeProgressStreaming && !progress.nativeProgressCompletionSent ? progress.buildNativeProgressCompletionChunks(dispatchError ? "error" : progress.nativeProgressTerminalStatus) : void 0;
|
|
2384
|
-
if (completionChunks?.length) progress.nativeProgressCompletionSent = true;
|
|
2385
|
-
const stopResult = await stopSlackStream({
|
|
2386
|
-
session: finalStream,
|
|
2387
|
-
...completionChunks?.length ? { chunks: completionChunks } : {},
|
|
2388
|
-
...slackMessageMetadata ? { metadata: slackMessageMetadata } : {}
|
|
2389
|
-
});
|
|
2390
|
-
delivery.acknowledgeStoppedStreamedDeliveries(finalStream, stopResult?.messageId);
|
|
2391
|
-
if (progress.pendingNativeProgressReceipt && stopResult?.messageId && !progress.progressReceiptCollapsed) await progress.collapseProgressReceipt({
|
|
2392
|
-
channelId: finalStream.channel,
|
|
2393
|
-
messageId: stopResult.messageId,
|
|
2394
|
-
text: progress.pendingNativeProgressReceipt,
|
|
2395
|
-
threadTs: finalStream.threadTs
|
|
2396
|
-
});
|
|
2397
|
-
} catch (err) {
|
|
2398
|
-
if (err instanceof SlackStreamNotDeliveredError) {
|
|
2399
|
-
streamFallbackDelivered = await delivery.deliverPendingStreamFallback(finalStream, err);
|
|
2400
|
-
if (!streamFallbackDelivered) dispatchError ??= err;
|
|
2401
|
-
} else {
|
|
2402
|
-
const error = formatSlackError(err);
|
|
2403
|
-
delivery.emitAcknowledgedStreamedDeliveries();
|
|
2404
|
-
delivery.emitFailedPendingStreamedDeliveries(error);
|
|
2405
|
-
runtime.error?.(danger(`slack-stream: failed to stop stream: ${error}`));
|
|
2406
|
-
if (!finalStream.delivered) dispatchError ??= err;
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2409
|
-
counts = delivery.reconcileCounts(counts);
|
|
2410
|
-
queuedFinal = queuedFinal && (counts.final ?? 0) > 0;
|
|
2411
|
-
const anyReplyDelivered = hasVisibleInboundReplyDispatch({
|
|
2412
|
-
queuedFinal,
|
|
2413
|
-
counts
|
|
2414
|
-
}, {
|
|
2415
|
-
observedReplyDelivery: delivery.observedReplyDelivery,
|
|
2416
|
-
fallbackDelivered: streamFallbackDelivered
|
|
2417
|
-
});
|
|
2418
|
-
if (statusReactionsEnabled) if (dispatchError) await statusReactions.setError();
|
|
2419
|
-
else if (anyReplyDelivered) {
|
|
2420
|
-
await statusReactions.setDone();
|
|
2421
|
-
statusReactions.restoreInitial();
|
|
2422
|
-
} else await statusReactions.restoreInitial();
|
|
2423
|
-
const participationThreadTs = delivery.usedReplyThreadTs ?? statusThreadTs;
|
|
2424
|
-
if (anyReplyDelivered && participationThreadTs) recordSlackThreadParticipation(account.accountId, message.channel, participationThreadTs, {
|
|
2425
|
-
agentId: route.agentId,
|
|
2426
|
-
...prepared.eventScope ? { teamId: prepared.eventScope.teamId } : {}
|
|
2427
|
-
});
|
|
2428
|
-
if (dispatchError) throw toErrorObject(dispatchError, "Slack dispatch failed");
|
|
2429
|
-
if (!anyReplyDelivered && !draftPreviewCommitted.value) {
|
|
2430
|
-
await draftStream?.clear();
|
|
2431
|
-
return;
|
|
2432
|
-
}
|
|
2433
|
-
if (shouldLogVerbose()) {
|
|
2434
|
-
const finalCount = counts.final;
|
|
2435
|
-
logVerbose(`slack: delivered ${finalCount} reply${finalCount === 1 ? "" : "ies"} to ${prepared.replyTarget}`);
|
|
2436
|
-
}
|
|
2437
|
-
}
|
|
2438
|
-
//#endregion
|
|
2439
|
-
//#region extensions/slack/src/agent-context.ts
|
|
2440
|
-
function asRecord(value) {
|
|
2441
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
2442
|
-
}
|
|
2443
|
-
function trimmedString(value) {
|
|
2444
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
2445
|
-
}
|
|
2446
|
-
function normalizeEntity(value) {
|
|
2447
|
-
const entity = asRecord(value);
|
|
2448
|
-
const type = trimmedString(entity?.type);
|
|
2449
|
-
if (!entity || !type) return;
|
|
2450
|
-
const teamId = trimmedString(entity.team_id);
|
|
2451
|
-
if (type === "slack#/types/channel_id" || type === "slack#/types/canvas_id" || type === "slack#/types/list_id") {
|
|
2452
|
-
const entityValue = trimmedString(entity.value);
|
|
2453
|
-
return entityValue ? {
|
|
2454
|
-
type,
|
|
2455
|
-
value: entityValue,
|
|
2456
|
-
...teamId ? { team_id: teamId } : {}
|
|
2457
|
-
} : void 0;
|
|
2458
|
-
}
|
|
2459
|
-
if (type !== "slack#/types/message_context") return;
|
|
2460
|
-
const message = asRecord(entity.value);
|
|
2461
|
-
const channelId = trimmedString(message?.channel_id);
|
|
2462
|
-
const messageTs = trimmedString(message?.message_ts);
|
|
2463
|
-
return channelId && messageTs ? {
|
|
2464
|
-
type,
|
|
2465
|
-
value: {
|
|
2466
|
-
channel_id: channelId,
|
|
2467
|
-
message_ts: messageTs
|
|
2468
|
-
},
|
|
2469
|
-
...teamId ? { team_id: teamId } : {}
|
|
2470
|
-
} : void 0;
|
|
2471
|
-
}
|
|
2472
|
-
function isSlackAppContext(value) {
|
|
2473
|
-
return Boolean(asRecord(value));
|
|
2474
|
-
}
|
|
2475
|
-
function normalizeSlackAppContextEntities(value) {
|
|
2476
|
-
const context = asRecord(value);
|
|
2477
|
-
if (!Array.isArray(context?.entities)) return [];
|
|
2478
|
-
return context.entities.flatMap((entity) => {
|
|
2479
|
-
const normalized = normalizeEntity(entity);
|
|
2480
|
-
return normalized ? [normalized] : [];
|
|
2481
|
-
});
|
|
2482
|
-
}
|
|
2483
|
-
//#endregion
|
|
2484
|
-
//#region extensions/slack/src/monitor/message-handler/preflight-audio.ts
|
|
2485
|
-
const SLACK_DEFAULT_ECHO_TRANSCRIPT_FORMAT = "📝 \"{transcript}\"";
|
|
2486
|
-
const loadSlackPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio.runtime-D5Bgags0.js"));
|
|
2487
|
-
function isSlackAudioFile(file) {
|
|
2488
|
-
if (file.subtype === "slack_audio") return true;
|
|
2489
|
-
if ((file.mimetype?.split(";")[0]?.trim().toLowerCase())?.startsWith("audio/")) return true;
|
|
2490
|
-
return Boolean(mimeTypeFromFilePath(file.name)?.startsWith("audio/"));
|
|
2491
|
-
}
|
|
2492
|
-
function findCaptionlessSlackAudioFile(message) {
|
|
2493
|
-
if (message.text?.trim()) return;
|
|
2494
|
-
return message.files?.slice(0, 8).find(isSlackAudioFile);
|
|
2495
|
-
}
|
|
2496
|
-
function formatSlackAudioTranscriptForAgent(params) {
|
|
2497
|
-
return [`[Audio transcript (machine-generated, untrusted)]: ${JSON.stringify(params.transcript)}`, params.rawBody].filter(Boolean).join("\n");
|
|
2498
|
-
}
|
|
2499
|
-
function suppressSlackPreflightAudioEcho(cfg) {
|
|
2500
|
-
const audio = cfg.tools?.media?.audio;
|
|
2501
|
-
if (!audio?.echoTranscript) return cfg;
|
|
2502
|
-
return {
|
|
2503
|
-
...cfg,
|
|
2504
|
-
tools: {
|
|
2505
|
-
...cfg.tools,
|
|
2506
|
-
media: {
|
|
2507
|
-
...cfg.tools?.media,
|
|
2508
|
-
audio: {
|
|
2509
|
-
...audio,
|
|
2510
|
-
echoTranscript: false
|
|
2511
|
-
}
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2514
|
-
};
|
|
2515
|
-
}
|
|
2516
|
-
async function resolveSlackPreflightAudioTranscript(params) {
|
|
2517
|
-
const mediaIndex = params.media.findIndex((entry) => entry.contentType?.toLowerCase().startsWith("audio/"));
|
|
2518
|
-
if (mediaIndex < 0) return null;
|
|
2519
|
-
try {
|
|
2520
|
-
const { transcribeFirstAudio } = await loadSlackPreflightAudioRuntime();
|
|
2521
|
-
const transcript = await transcribeFirstAudio({
|
|
2522
|
-
ctx: {
|
|
2523
|
-
media: [...params.media],
|
|
2524
|
-
Provider: "slack",
|
|
2525
|
-
Surface: "slack",
|
|
2526
|
-
OriginatingChannel: "slack",
|
|
2527
|
-
OriginatingTo: params.originatingTo,
|
|
2528
|
-
AccountId: params.accountId,
|
|
2529
|
-
MessageThreadId: params.messageThreadId,
|
|
2530
|
-
ChatType: "channel",
|
|
2531
|
-
SessionKey: params.sessionKey
|
|
2532
|
-
},
|
|
2533
|
-
cfg: suppressSlackPreflightAudioEcho(params.cfg)
|
|
2534
|
-
});
|
|
2535
|
-
return transcript ? {
|
|
2536
|
-
transcript,
|
|
2537
|
-
mediaIndex
|
|
2538
|
-
} : null;
|
|
2539
|
-
} catch (err) {
|
|
2540
|
-
logVerbose(`slack: audio preflight transcription failed: ${String(err)}`);
|
|
2541
|
-
return null;
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2544
|
-
function formatSlackAudioTranscriptEcho(transcript, format) {
|
|
2545
|
-
return format.replace("{transcript}", () => transcript);
|
|
2546
|
-
}
|
|
2547
|
-
async function sendSlackPreflightAudioTranscriptEcho(params) {
|
|
2548
|
-
const audio = params.cfg.tools?.media?.audio;
|
|
2549
|
-
if (!audio?.echoTranscript) return;
|
|
2550
|
-
const text = formatSlackAudioTranscriptEcho(params.transcript, audio.echoFormat ?? SLACK_DEFAULT_ECHO_TRANSCRIPT_FORMAT);
|
|
2551
|
-
try {
|
|
2552
|
-
const { sendDurableMessageBatch } = await loadSlackPreflightAudioRuntime();
|
|
2553
|
-
const send = await sendDurableMessageBatch({
|
|
2554
|
-
cfg: params.cfg,
|
|
2555
|
-
channel: "slack",
|
|
2556
|
-
to: params.originatingTo,
|
|
2557
|
-
accountId: params.accountId,
|
|
2558
|
-
threadId: params.messageThreadId,
|
|
2559
|
-
payloads: [{ text }],
|
|
2560
|
-
bestEffort: true,
|
|
2561
|
-
durability: "best_effort"
|
|
2562
|
-
});
|
|
2563
|
-
if (send.status === "failed") throw send.error;
|
|
2564
|
-
} catch (err) {
|
|
2565
|
-
logVerbose(`slack: audio transcript echo failed: ${String(err)}`);
|
|
2566
|
-
}
|
|
2567
|
-
}
|
|
2568
|
-
async function discardSlackPreflightMedia(media) {
|
|
2569
|
-
await Promise.allSettled((media ?? []).map((entry) => fs.rm(entry.path, { force: true })));
|
|
2570
|
-
}
|
|
2571
|
-
//#endregion
|
|
2572
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-content.ts
|
|
2573
|
-
const SLACK_MENTION_RESOLUTION_CONCURRENCY = 4;
|
|
2574
|
-
const SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE = 20;
|
|
2575
|
-
const SLACK_USER_MENTION_RE$1 = /<@([A-Z0-9]+)(?:\|[^>]+)?>/gi;
|
|
2576
|
-
const loadSlackMediaModule$1 = createLazyRuntimeModule(() => import("./actions-BkOaiDSX.js").then((n) => n.g));
|
|
2577
|
-
function collectUniqueSlackMentionIds$1(texts) {
|
|
2578
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2579
|
-
const mentionIds = [];
|
|
2580
|
-
for (const text of texts) {
|
|
2581
|
-
if (!text) continue;
|
|
2582
|
-
SLACK_USER_MENTION_RE$1.lastIndex = 0;
|
|
2583
|
-
for (const match of text.matchAll(SLACK_USER_MENTION_RE$1)) {
|
|
2584
|
-
const userId = match[1];
|
|
2585
|
-
if (!userId || seen.has(userId)) continue;
|
|
2586
|
-
seen.add(userId);
|
|
2587
|
-
mentionIds.push(userId);
|
|
2588
|
-
}
|
|
2589
|
-
}
|
|
2590
|
-
return mentionIds;
|
|
2591
|
-
}
|
|
2592
|
-
function renderSlackUserMentions(text, renderedMentions) {
|
|
2593
|
-
if (!text || renderedMentions.size === 0) return text;
|
|
2594
|
-
SLACK_USER_MENTION_RE$1.lastIndex = 0;
|
|
2595
|
-
return text.replace(SLACK_USER_MENTION_RE$1, (full, userId) => {
|
|
2596
|
-
return renderedMentions.get(userId) ?? full;
|
|
2597
|
-
});
|
|
2598
|
-
}
|
|
2599
|
-
function filterInheritedParentFiles(params) {
|
|
2600
|
-
const { files, isThreadReply, threadStarter } = params;
|
|
2601
|
-
if (!isThreadReply || !files?.length) return files;
|
|
2602
|
-
if (!threadStarter?.files?.length) return files;
|
|
2603
|
-
const starterFileIds = new Set(threadStarter.files.map((file) => file.id));
|
|
2604
|
-
const filtered = files.filter((file) => !file.id || !starterFileIds.has(file.id));
|
|
2605
|
-
if (filtered.length < files.length) logVerbose(`slack: filtered ${files.length - filtered.length} inherited parent file(s) from thread reply`);
|
|
2606
|
-
return filtered.length > 0 ? filtered : void 0;
|
|
2607
|
-
}
|
|
2608
|
-
async function resolveSlackMessageContent(params) {
|
|
2609
|
-
const ownFiles = filterInheritedParentFiles({
|
|
2610
|
-
files: params.message.files,
|
|
2611
|
-
isThreadReply: params.isThreadReply,
|
|
2612
|
-
threadStarter: params.threadStarter
|
|
2613
|
-
});
|
|
2614
|
-
const mediaPromise = ownFiles && ownFiles.length > 0 ? loadSlackMediaModule$1().then(({ resolveSlackMedia }) => resolveSlackMedia({
|
|
2615
|
-
files: ownFiles,
|
|
2616
|
-
client: params.client,
|
|
2617
|
-
token: params.botToken,
|
|
2618
|
-
maxBytes: params.mediaMaxBytes,
|
|
2619
|
-
readIdleTimeoutMs: params.mediaReadIdleTimeoutMs,
|
|
2620
|
-
totalTimeoutMs: params.mediaTotalTimeoutMs,
|
|
2621
|
-
abortSignal: params.abortSignal,
|
|
2622
|
-
preloadedMedia: params.preloadedMedia
|
|
2623
|
-
})) : Promise.resolve(null);
|
|
2624
|
-
const attachmentContentPromise = params.message.attachments && params.message.attachments.length > 0 ? loadSlackMediaModule$1().then(({ resolveSlackAttachmentContent }) => resolveSlackAttachmentContent({
|
|
2625
|
-
attachments: params.message.attachments,
|
|
2626
|
-
client: params.client,
|
|
2627
|
-
token: params.botToken,
|
|
2628
|
-
maxBytes: params.mediaMaxBytes,
|
|
2629
|
-
readIdleTimeoutMs: params.mediaReadIdleTimeoutMs,
|
|
2630
|
-
totalTimeoutMs: params.mediaTotalTimeoutMs,
|
|
2631
|
-
abortSignal: params.abortSignal
|
|
2632
|
-
})) : Promise.resolve(null);
|
|
2633
|
-
const [media, attachmentContent] = await Promise.all([mediaPromise, attachmentContentPromise]);
|
|
2634
|
-
const mergedMedia = [...media ?? [], ...attachmentContent?.media ?? []];
|
|
2635
|
-
const effectiveDirectMedia = mergedMedia.length > 0 ? mergedMedia : null;
|
|
2636
|
-
const mediaPlaceholder = effectiveDirectMedia ? effectiveDirectMedia.map((item) => item.placeholder).join(" ") : void 0;
|
|
2637
|
-
const fallbackFiles = ownFiles ?? [];
|
|
2638
|
-
const fileOnlyFallback = !mediaPlaceholder && fallbackFiles.length > 0 ? fallbackFiles.slice(0, 8).map((file) => formatSlackFileReference(file)).join(", ") : void 0;
|
|
2639
|
-
const fileOnlyPlaceholder = fileOnlyFallback ? `[Slack file: ${fileOnlyFallback}]` : void 0;
|
|
2640
|
-
let botAttachmentText;
|
|
2641
|
-
if (params.isBotMessage && !attachmentContent?.text) {
|
|
2642
|
-
const botAttachmentTextParts = [];
|
|
2643
|
-
for (const attachment of params.message.attachments ?? []) {
|
|
2644
|
-
const text = normalizeOptionalString(attachment.text) ?? normalizeOptionalString(attachment.fallback);
|
|
2645
|
-
if (text) botAttachmentTextParts.push(text);
|
|
2646
|
-
}
|
|
2647
|
-
botAttachmentText = botAttachmentTextParts.length > 0 ? botAttachmentTextParts.join("\n") : void 0;
|
|
2648
|
-
}
|
|
2649
|
-
const blocksText = resolveSlackBlocksText(params.message.blocks);
|
|
2650
|
-
const textParts = [
|
|
2651
|
-
chooseSlackPrimaryText({
|
|
2652
|
-
messageText: normalizeOptionalString(params.message.text),
|
|
2653
|
-
blocksText
|
|
2654
|
-
}),
|
|
2655
|
-
attachmentContent?.text,
|
|
2656
|
-
botAttachmentText
|
|
2657
|
-
];
|
|
2658
|
-
const renderedMentions = /* @__PURE__ */ new Map();
|
|
2659
|
-
const resolveUserName = params.resolveUserName;
|
|
2660
|
-
if (resolveUserName) {
|
|
2661
|
-
const mentionIds = collectUniqueSlackMentionIds$1(textParts);
|
|
2662
|
-
const lookupIds = mentionIds.slice(0, SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE);
|
|
2663
|
-
const skippedLookups = mentionIds.length - lookupIds.length;
|
|
2664
|
-
if (skippedLookups > 0) logVerbose(`slack: skipping ${skippedLookups} mention lookup(s) beyond per-message cap (${SLACK_MENTION_RESOLUTION_MAX_LOOKUPS_PER_MESSAGE})`);
|
|
2665
|
-
const { results } = await runTasksWithConcurrency({
|
|
2666
|
-
tasks: lookupIds.map((userId) => async () => {
|
|
2667
|
-
const renderedName = normalizeOptionalString((await resolveUserName(userId))?.name);
|
|
2668
|
-
return {
|
|
2669
|
-
userId,
|
|
2670
|
-
rendered: renderedName ? `<@${userId}> (${renderedName})` : null
|
|
2671
|
-
};
|
|
2672
|
-
}),
|
|
2673
|
-
limit: SLACK_MENTION_RESOLUTION_CONCURRENCY
|
|
2674
|
-
});
|
|
2675
|
-
for (const result of results) {
|
|
2676
|
-
if (!result) continue;
|
|
2677
|
-
renderedMentions.set(result.userId, result.rendered);
|
|
2678
|
-
}
|
|
2679
|
-
}
|
|
2680
|
-
const rawBody = [
|
|
2681
|
-
renderSlackUserMentions(textParts[0], renderedMentions),
|
|
2682
|
-
renderSlackUserMentions(textParts[1], renderedMentions),
|
|
2683
|
-
renderSlackUserMentions(textParts[2], renderedMentions),
|
|
2684
|
-
mediaPlaceholder,
|
|
2685
|
-
fileOnlyPlaceholder
|
|
2686
|
-
].filter(Boolean).join("\n") || "";
|
|
2687
|
-
if (!rawBody) return null;
|
|
2688
|
-
return {
|
|
2689
|
-
rawBody,
|
|
2690
|
-
effectiveDirectMedia
|
|
2691
|
-
};
|
|
2692
|
-
}
|
|
2693
|
-
//#endregion
|
|
2694
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-dm-history.ts
|
|
2695
|
-
function resolveSlackDmHistoryLimit(params) {
|
|
2696
|
-
const override = params.userId && params.account.config.dms?.[params.userId]?.historyLimit !== void 0 ? params.account.config.dms[params.userId]?.historyLimit : void 0;
|
|
2697
|
-
return Math.max(0, override ?? params.defaultLimit);
|
|
2698
|
-
}
|
|
2699
|
-
async function resolveSlackDmHistoryContext(params) {
|
|
2700
|
-
const maxMessages = Math.max(0, Math.floor(params.limit));
|
|
2701
|
-
if (maxMessages <= 0) return {
|
|
2702
|
-
body: void 0,
|
|
2703
|
-
inboundHistory: void 0
|
|
2704
|
-
};
|
|
2705
|
-
try {
|
|
2706
|
-
const messages = ((await (params.eventScope?.client ?? params.ctx.app.client).conversations.history({
|
|
2707
|
-
token: params.ctx.botToken,
|
|
2708
|
-
channel: params.channelId,
|
|
2709
|
-
...params.currentMessageTs ? {
|
|
2710
|
-
latest: params.currentMessageTs,
|
|
2711
|
-
inclusive: true
|
|
2712
|
-
} : {},
|
|
2713
|
-
limit: maxMessages + 1
|
|
2714
|
-
})).messages ?? []).filter((message) => {
|
|
2715
|
-
if (params.currentMessageTs && message.ts === params.currentMessageTs) return false;
|
|
2716
|
-
return Boolean(normalizeOptionalString(message.text));
|
|
2717
|
-
}).slice(0, maxMessages).toReversed();
|
|
2718
|
-
if (messages.length === 0) return {
|
|
2719
|
-
body: void 0,
|
|
2720
|
-
inboundHistory: void 0
|
|
2721
|
-
};
|
|
2722
|
-
const userNames = /* @__PURE__ */ new Map();
|
|
2723
|
-
const resolveUserLabel = async (userId) => {
|
|
2724
|
-
const cached = userNames.get(userId);
|
|
2725
|
-
if (cached) return cached;
|
|
2726
|
-
const label = normalizeOptionalString((await params.ctx.resolveUserName(userId, params.eventScope)).name) ?? userId;
|
|
2727
|
-
userNames.set(userId, label);
|
|
2728
|
-
return label;
|
|
2729
|
-
};
|
|
2730
|
-
const entries = [];
|
|
2731
|
-
const formatted = [];
|
|
2732
|
-
for (const message of messages) {
|
|
2733
|
-
const body = normalizeOptionalString(message.text);
|
|
2734
|
-
if (!body) continue;
|
|
2735
|
-
const isCurrentBot = params.ctx.botUserId && message.user === params.ctx.botUserId || params.ctx.botId && message.bot_id === params.ctx.botId;
|
|
2736
|
-
const role = isCurrentBot || message.bot_id ? "assistant" : "user";
|
|
2737
|
-
const sender = `${isCurrentBot ? "Assistant" : message.user ? await resolveUserLabel(message.user) : normalizeOptionalString(message.username) ?? (message.bot_id ? "Bot" : "Unknown")} (${role})`;
|
|
2738
|
-
const timestamp = resolveSlackTimestampMs(message.ts);
|
|
2739
|
-
entries.push({
|
|
2740
|
-
sender,
|
|
2741
|
-
body,
|
|
2742
|
-
timestamp
|
|
2743
|
-
});
|
|
2744
|
-
formatted.push(formatInboundEnvelope({
|
|
2745
|
-
channel: "Slack",
|
|
2746
|
-
from: sender,
|
|
2747
|
-
timestamp,
|
|
2748
|
-
body: `${body}\n[slack message id: ${message.ts ?? "unknown"} channel: ${params.channelId}]`,
|
|
2749
|
-
chatType: "direct",
|
|
2750
|
-
envelope: params.envelopeOptions
|
|
2751
|
-
}));
|
|
2752
|
-
}
|
|
2753
|
-
return {
|
|
2754
|
-
body: formatted.length > 0 ? formatted.join("\n\n") : void 0,
|
|
2755
|
-
inboundHistory: entries.length > 0 ? entries : void 0
|
|
2756
|
-
};
|
|
2757
|
-
} catch (err) {
|
|
2758
|
-
logVerbose(`slack: failed to fetch DM history for channel ${params.channelId}: ${formatErrorMessage(err)}`);
|
|
2759
|
-
return {
|
|
2760
|
-
body: void 0,
|
|
2761
|
-
inboundHistory: void 0
|
|
2762
|
-
};
|
|
2763
|
-
}
|
|
2764
|
-
}
|
|
2765
|
-
//#endregion
|
|
2766
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-routing.ts
|
|
2767
|
-
const slackRouteBindingConfigCache = /* @__PURE__ */ new WeakMap();
|
|
2768
|
-
function slackTargetDefaultKindForPeer(kind) {
|
|
2769
|
-
return kind === "direct" ? "user" : "channel";
|
|
2770
|
-
}
|
|
2771
|
-
function slackTargetKindMatchesPeer(peerKind, targetKind) {
|
|
2772
|
-
if (targetKind === "user") return peerKind === "direct";
|
|
2773
|
-
return peerKind === "channel" || peerKind === "group";
|
|
2774
|
-
}
|
|
2775
|
-
function normalizeSlackRouteBindingPeer(peer) {
|
|
2776
|
-
const rawId = peer.id.trim();
|
|
2777
|
-
if (!rawId || rawId === "*") return peer;
|
|
2778
|
-
const target = (() => {
|
|
2779
|
-
try {
|
|
2780
|
-
return parseSlackTarget(rawId, { defaultKind: slackTargetDefaultKindForPeer(peer.kind) });
|
|
2781
|
-
} catch {
|
|
2782
|
-
return;
|
|
2783
|
-
}
|
|
2784
|
-
})();
|
|
2785
|
-
if (!target || !slackTargetKindMatchesPeer(peer.kind, target.kind) || target.id === peer.id) return peer;
|
|
2786
|
-
return {
|
|
2787
|
-
...peer,
|
|
2788
|
-
id: target.id
|
|
2789
|
-
};
|
|
2790
|
-
}
|
|
2791
|
-
function normalizeSlackRouteBindingConfig(cfg) {
|
|
2792
|
-
const bindings = cfg.bindings;
|
|
2793
|
-
const cached = slackRouteBindingConfigCache.get(cfg);
|
|
2794
|
-
if (cached && cached.bindingsRef === bindings) return cached.normalizedCfg;
|
|
2795
|
-
if (!Array.isArray(bindings)) return cfg;
|
|
2796
|
-
let changed = false;
|
|
2797
|
-
const normalizedBindings = bindings.map((binding) => {
|
|
2798
|
-
if (binding.type === "acp" || binding.match.channel.trim().toLowerCase() !== "slack") return binding;
|
|
2799
|
-
const peer = binding.match.peer;
|
|
2800
|
-
if (!peer) return binding;
|
|
2801
|
-
const normalizedPeer = normalizeSlackRouteBindingPeer(peer);
|
|
2802
|
-
if (normalizedPeer === peer) return binding;
|
|
2803
|
-
changed = true;
|
|
2804
|
-
return {
|
|
2805
|
-
...binding,
|
|
2806
|
-
match: {
|
|
2807
|
-
...binding.match,
|
|
2808
|
-
peer: normalizedPeer
|
|
2809
|
-
}
|
|
2810
|
-
};
|
|
2811
|
-
});
|
|
2812
|
-
const normalizedCfg = changed ? {
|
|
2813
|
-
...cfg,
|
|
2814
|
-
bindings: normalizedBindings
|
|
2815
|
-
} : cfg;
|
|
2816
|
-
slackRouteBindingConfigCache.set(cfg, {
|
|
2817
|
-
bindingsRef: bindings,
|
|
2818
|
-
normalizedCfg
|
|
2819
|
-
});
|
|
2820
|
-
return normalizedCfg;
|
|
2821
|
-
}
|
|
2822
|
-
function resolveSlackBaseConversationId(params) {
|
|
2823
|
-
const raw = params.isDirectMessage ? `user:${params.message.user ?? "unknown"}` : params.message.channel;
|
|
2824
|
-
return params.eventScope ? `team:${encodeURIComponent(params.eventScope.teamId)}:${raw}` : raw;
|
|
2825
|
-
}
|
|
2826
|
-
function qualifySlackPeerId(params) {
|
|
2827
|
-
if (!params.eventScope) return params.id;
|
|
2828
|
-
return `team:${encodeURIComponent(params.eventScope.teamId)}:${params.kind}:${encodeURIComponent(params.id)}`;
|
|
2829
|
-
}
|
|
2830
|
-
function resolveSlackInitialAgentRoute(params) {
|
|
2831
|
-
const route = resolveAgentRoute({
|
|
2832
|
-
cfg: normalizeSlackRouteBindingConfig(params.ctx.cfg),
|
|
2833
|
-
channel: "slack",
|
|
2834
|
-
accountId: params.account.accountId,
|
|
2835
|
-
teamId: params.eventScope?.teamId || params.ctx.teamId || void 0,
|
|
2836
|
-
peer: {
|
|
2837
|
-
kind: params.isDirectMessage ? "direct" : params.isRoom ? "channel" : "group",
|
|
2838
|
-
id: qualifySlackPeerId({
|
|
2839
|
-
id: params.isDirectMessage ? params.message.user ?? "unknown" : params.message.channel,
|
|
2840
|
-
kind: params.isDirectMessage ? "user" : "channel",
|
|
2841
|
-
eventScope: params.eventScope
|
|
2842
|
-
})
|
|
2843
|
-
}
|
|
2844
|
-
});
|
|
2845
|
-
if (!params.eventScope || !params.isDirectMessage || route.dmScope !== "main") return route;
|
|
2846
|
-
const partition = `account:${encodeURIComponent(params.account.accountId).toLowerCase()}:team:${encodeURIComponent(params.eventScope.teamId).toLowerCase()}`;
|
|
2847
|
-
const sessionKey = `${route.sessionKey}:${partition}`;
|
|
2848
|
-
return {
|
|
2849
|
-
...route,
|
|
2850
|
-
sessionKey,
|
|
2851
|
-
mainSessionKey: sessionKey
|
|
2852
|
-
};
|
|
2853
|
-
}
|
|
2854
|
-
function resolveSlackRoutingContext(params) {
|
|
2855
|
-
const { ctx, account, message, isDirectMessage, isGroupDm, isRoom, isRoomish, channelConfig, seedTopLevelRoomThread, assistantThreadTs, agentViewThreadTs, eventScope } = params;
|
|
2856
|
-
let route = resolveSlackInitialAgentRoute({
|
|
2857
|
-
ctx,
|
|
2858
|
-
account,
|
|
2859
|
-
message,
|
|
2860
|
-
isDirectMessage,
|
|
2861
|
-
isRoom,
|
|
2862
|
-
eventScope
|
|
2863
|
-
});
|
|
2864
|
-
const chatType = isDirectMessage ? "direct" : isGroupDm ? "group" : "channel";
|
|
2865
|
-
const replyToMode = channelConfig?.replyToMode ?? resolveSlackReplyToMode(account, chatType);
|
|
2866
|
-
const threadContext = resolveSlackThreadContext({
|
|
2867
|
-
message,
|
|
2868
|
-
replyToMode,
|
|
2869
|
-
isDirectMessage
|
|
2870
|
-
});
|
|
2871
|
-
const threadTs = threadContext.incomingThreadTs;
|
|
2872
|
-
const isThreadReply = threadContext.isThreadReply;
|
|
2873
|
-
const autoThreadId = !isThreadReply && replyToMode === "all" && threadContext.messageTs ? threadContext.messageTs : void 0;
|
|
2874
|
-
const seedCandidateThreadId = threadContext.incomingThreadTs ?? threadContext.messageTs;
|
|
2875
|
-
const routedThreadId = (isDirectMessage ? assistantThreadTs ?? agentViewThreadTs : isRoomish ? isThreadReply && threadTs ? threadTs : void 0 : isThreadReply ? threadTs : autoThreadId) ?? (isRoomish ? !isThreadReply && isRoom && seedTopLevelRoomThread && replyToMode !== "off" && seedCandidateThreadId ? seedCandidateThreadId : void 0 : void 0);
|
|
2876
|
-
const baseConversationId = resolveSlackBaseConversationId({
|
|
2877
|
-
message,
|
|
2878
|
-
isDirectMessage,
|
|
2879
|
-
eventScope
|
|
2880
|
-
});
|
|
2881
|
-
const runtimeBindingThreadId = routedThreadId ?? (isDirectMessage && isThreadReply ? threadTs : void 0);
|
|
2882
|
-
const boundThreadRoute = !eventScope && runtimeBindingThreadId ? resolveRuntimeConversationBindingRoute({
|
|
2883
|
-
route,
|
|
2884
|
-
conversation: {
|
|
2885
|
-
channel: "slack",
|
|
2886
|
-
accountId: account.accountId,
|
|
2887
|
-
conversationId: runtimeBindingThreadId,
|
|
2888
|
-
parentConversationId: baseConversationId
|
|
2889
|
-
}
|
|
2890
|
-
}) : null;
|
|
2891
|
-
const runtimeRoute = eventScope ? {
|
|
2892
|
-
route,
|
|
2893
|
-
bindingRecord: null,
|
|
2894
|
-
boundSessionKey: void 0
|
|
2895
|
-
} : boundThreadRoute?.boundSessionKey || boundThreadRoute?.bindingRecord ? boundThreadRoute : resolveRuntimeConversationBindingRoute({
|
|
2896
|
-
route,
|
|
2897
|
-
conversation: {
|
|
2898
|
-
channel: "slack",
|
|
2899
|
-
accountId: account.accountId,
|
|
2900
|
-
conversationId: baseConversationId
|
|
2901
|
-
}
|
|
2902
|
-
});
|
|
2903
|
-
let configuredBinding = null;
|
|
2904
|
-
let configuredBindingSessionKey = "";
|
|
2905
|
-
if (runtimeRoute.boundSessionKey || runtimeRoute.bindingRecord) route = runtimeRoute.route;
|
|
2906
|
-
else if (!eventScope) {
|
|
2907
|
-
const configuredRoute = resolveConfiguredBindingRoute({
|
|
2908
|
-
cfg: ctx.cfg,
|
|
2909
|
-
route,
|
|
2910
|
-
conversation: {
|
|
2911
|
-
channel: "slack",
|
|
2912
|
-
accountId: account.accountId,
|
|
2913
|
-
conversationId: baseConversationId
|
|
2914
|
-
}
|
|
2915
|
-
});
|
|
2916
|
-
configuredBinding = configuredRoute.bindingResolution;
|
|
2917
|
-
configuredBindingSessionKey = configuredRoute.boundSessionKey ?? "";
|
|
2918
|
-
route = configuredRoute.route;
|
|
2919
|
-
}
|
|
2920
|
-
const threadKeys = runtimeRoute.boundSessionKey || configuredBindingSessionKey ? {
|
|
2921
|
-
sessionKey: route.sessionKey,
|
|
2922
|
-
parentSessionKey: void 0
|
|
2923
|
-
} : resolveThreadSessionKeys({
|
|
2924
|
-
baseSessionKey: route.sessionKey,
|
|
2925
|
-
threadId: routedThreadId,
|
|
2926
|
-
parentSessionKey: routedThreadId && ctx.threadInheritParent ? route.sessionKey : void 0
|
|
2927
|
-
});
|
|
2928
|
-
const sessionKey = threadKeys.sessionKey;
|
|
2929
|
-
const historyKey = isThreadReply && ctx.threadHistoryScope === "thread" ? sessionKey : eventScope ? `${account.accountId}:${eventScope.teamId}:${message.channel}` : message.channel;
|
|
2930
|
-
return {
|
|
2931
|
-
route,
|
|
2932
|
-
runtimeBinding: runtimeRoute.bindingRecord,
|
|
2933
|
-
runtimeBoundSessionKey: runtimeRoute.boundSessionKey,
|
|
2934
|
-
configuredBinding,
|
|
2935
|
-
configuredBindingSessionKey,
|
|
2936
|
-
chatType,
|
|
2937
|
-
replyToMode,
|
|
2938
|
-
threadContext,
|
|
2939
|
-
threadTs,
|
|
2940
|
-
isThreadReply,
|
|
2941
|
-
threadKeys,
|
|
2942
|
-
sessionKey,
|
|
2943
|
-
historyKey
|
|
2944
|
-
};
|
|
2945
|
-
}
|
|
2946
|
-
//#endregion
|
|
2947
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context-root.ts
|
|
2948
|
-
function isSlackThreadAuthorCurrentBot(params) {
|
|
2949
|
-
const { identity, author } = params;
|
|
2950
|
-
if (identity.botUserId && author.userId && author.userId === identity.botUserId) return true;
|
|
2951
|
-
if (identity.botId && author.botId && author.botId === identity.botId) return true;
|
|
2952
|
-
return false;
|
|
2953
|
-
}
|
|
2954
|
-
function resolveSlackThreadHistoryFilterPolicy(params) {
|
|
2955
|
-
if (!params.includeBotStarterAsRootContext || !params.starterTs) return {};
|
|
2956
|
-
return { retainCurrentBotRootTs: params.starterTs };
|
|
2957
|
-
}
|
|
2958
|
-
function applySlackThreadHistoryFilterPolicy(params) {
|
|
2959
|
-
const kept = [];
|
|
2960
|
-
let omittedCurrentBot = 0;
|
|
2961
|
-
for (const entry of params.history) {
|
|
2962
|
-
if (!isSlackThreadAuthorCurrentBot({
|
|
2963
|
-
identity: params.identity,
|
|
2964
|
-
author: entry
|
|
2965
|
-
})) {
|
|
2966
|
-
kept.push(entry);
|
|
2967
|
-
continue;
|
|
2968
|
-
}
|
|
2969
|
-
if (params.policy.retainCurrentBotRootTs && entry.ts === params.policy.retainCurrentBotRootTs) kept.push(entry);
|
|
2970
|
-
else omittedCurrentBot += 1;
|
|
2971
|
-
}
|
|
2972
|
-
return {
|
|
2973
|
-
kept,
|
|
2974
|
-
omittedCurrentBot
|
|
2975
|
-
};
|
|
2976
|
-
}
|
|
2977
|
-
function shouldIncludeBotThreadStarterContext(params) {
|
|
2978
|
-
if (!params.hasStarterText) return false;
|
|
2979
|
-
return params.starterIsCurrentBot && params.isNewThreadSession;
|
|
2980
|
-
}
|
|
2981
|
-
function ensureSlackThreadHistoryHasBotRoot(params) {
|
|
2982
|
-
if (!params.includeBotStarterAsRootContext || !params.threadStarter?.text) return params.history;
|
|
2983
|
-
if (params.history.some((entry) => entry.ts === params.threadStarter?.ts)) return params.history;
|
|
2984
|
-
return [params.threadStarter, ...params.history];
|
|
2985
|
-
}
|
|
2986
|
-
function formatSlackBotStarterThreadLabel(params) {
|
|
2987
|
-
const base = `Slack thread ${params.roomLabel}`;
|
|
2988
|
-
if (!params.starterText) return base;
|
|
2989
|
-
const snippet = formatSlackThreadLabelSnippet(params.starterText).trim();
|
|
2990
|
-
if (!snippet) return base;
|
|
2991
|
-
return `${base} (assistant root): ${snippet}`;
|
|
2992
|
-
}
|
|
2993
|
-
function formatSlackThreadLabelSnippet(text) {
|
|
2994
|
-
return truncateUtf16Safe(text.replace(/\s+/g, " "), 80);
|
|
2995
|
-
}
|
|
2996
|
-
//#endregion
|
|
2997
|
-
//#region extensions/slack/src/monitor/message-handler/prepare-thread-context.ts
|
|
2998
|
-
const loadSlackMediaModule = createLazyRuntimeModule(() => import("./actions-BkOaiDSX.js").then((n) => n.g));
|
|
2999
|
-
const SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY = 4;
|
|
3000
|
-
function resolveSlackThreadSessionFreshness(params) {
|
|
3001
|
-
return params.ctx.channelRuntime?.session?.resolveEntryResetFreshness?.({
|
|
3002
|
-
defaultAgentId: resolveDefaultAgentId(params.ctx.cfg),
|
|
3003
|
-
storePath: params.storePath,
|
|
3004
|
-
sessionKey: params.sessionKey,
|
|
3005
|
-
sessionCfg: params.ctx.cfg.session,
|
|
3006
|
-
resetType: "thread",
|
|
3007
|
-
resetOverride: resolveChannelResetConfig({
|
|
3008
|
-
sessionCfg: params.ctx.cfg.session,
|
|
3009
|
-
channel: "slack"
|
|
3010
|
-
})
|
|
3011
|
-
});
|
|
3012
|
-
}
|
|
3013
|
-
function isSlackThreadContextSenderAllowed(params) {
|
|
3014
|
-
return resolveInboundSupplementalSenderAllowed({
|
|
3015
|
-
isGroup: true,
|
|
3016
|
-
groupPolicy: params.allowFromLower.length === 0 ? "open" : "allowlist",
|
|
3017
|
-
allowFrom: params.allowFromLower,
|
|
3018
|
-
isSenderAllowed: (allowFrom) => {
|
|
3019
|
-
if (params.botId) return true;
|
|
3020
|
-
if (!params.userId) return false;
|
|
3021
|
-
return resolveSlackAllowListMatch({
|
|
3022
|
-
allowList: allowFrom,
|
|
3023
|
-
id: params.userId,
|
|
3024
|
-
name: params.userName,
|
|
3025
|
-
allowNameMatching: params.allowNameMatching
|
|
3026
|
-
}).allowed;
|
|
3027
|
-
}
|
|
3028
|
-
});
|
|
3029
|
-
}
|
|
3030
|
-
async function resolveSlackThreadUserMap(params) {
|
|
3031
|
-
const uniqueUserIds = [];
|
|
3032
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3033
|
-
for (const item of params.messages) {
|
|
3034
|
-
if (!item.userId || seen.has(item.userId)) continue;
|
|
3035
|
-
seen.add(item.userId);
|
|
3036
|
-
uniqueUserIds.push(item.userId);
|
|
3037
|
-
}
|
|
3038
|
-
const userMap = /* @__PURE__ */ new Map();
|
|
3039
|
-
if (uniqueUserIds.length === 0) return userMap;
|
|
3040
|
-
const { results } = await runTasksWithConcurrency({
|
|
3041
|
-
tasks: uniqueUserIds.map((id) => async () => {
|
|
3042
|
-
const user = await params.ctx.resolveUserName(id, params.eventScope);
|
|
3043
|
-
return user ? {
|
|
3044
|
-
id,
|
|
3045
|
-
user
|
|
3046
|
-
} : null;
|
|
3047
|
-
}),
|
|
3048
|
-
limit: SLACK_THREAD_CONTEXT_USER_LOOKUP_CONCURRENCY
|
|
3049
|
-
});
|
|
3050
|
-
for (const result of results) if (result) userMap.set(result.id, result.user);
|
|
3051
|
-
return userMap;
|
|
3052
|
-
}
|
|
3053
|
-
async function resolveSlackThreadContextData(params) {
|
|
3054
|
-
const botIdentity = {
|
|
3055
|
-
botUserId: params.ctx.botUserId,
|
|
3056
|
-
botId: params.ctx.botId
|
|
3057
|
-
};
|
|
3058
|
-
const isCurrentBotAuthor = (author) => isSlackThreadAuthorCurrentBot({
|
|
3059
|
-
identity: botIdentity,
|
|
3060
|
-
author
|
|
3061
|
-
});
|
|
3062
|
-
let threadStarterBody;
|
|
3063
|
-
let threadHistoryBody;
|
|
3064
|
-
let threadLabel;
|
|
3065
|
-
let threadStarterMedia = null;
|
|
3066
|
-
const threadSessionFreshness = params.isThreadReply && params.threadTs ? resolveSlackThreadSessionFreshness({
|
|
3067
|
-
ctx: params.ctx,
|
|
3068
|
-
storePath: params.storePath,
|
|
3069
|
-
sessionKey: params.sessionKey
|
|
3070
|
-
}) : void 0;
|
|
3071
|
-
const threadSessionPreviousTimestamp = params.isThreadReply && params.threadTs && !threadSessionFreshness ? readSessionUpdatedAt({
|
|
3072
|
-
storePath: params.storePath,
|
|
3073
|
-
sessionKey: params.sessionKey
|
|
3074
|
-
}) : void 0;
|
|
3075
|
-
const shouldSeedInitialThreadContext = Boolean(params.isThreadReply && params.threadTs && (threadSessionFreshness ? threadSessionFreshness.state !== "fresh" : threadSessionPreviousTimestamp === void 0));
|
|
3076
|
-
const shouldLoadInitialThreadHistory = shouldSeedInitialThreadContext || params.forceInitialHistory === true;
|
|
3077
|
-
if (!params.isThreadReply || !params.threadTs) return {
|
|
3078
|
-
threadStarterBody,
|
|
3079
|
-
threadHistoryBody,
|
|
3080
|
-
shouldSeedInitialThreadContext,
|
|
3081
|
-
threadLabel,
|
|
3082
|
-
threadStarterMedia
|
|
3083
|
-
};
|
|
3084
|
-
const starter = params.threadStarter;
|
|
3085
|
-
const starterSenderName = params.allowNameMatching && params.allowFromLower.length > 0 && starter?.userId ? (await params.ctx.resolveUserName(starter.userId, params.eventScope))?.name : void 0;
|
|
3086
|
-
const starterIsCurrentBot = Boolean(starter && isCurrentBotAuthor({
|
|
3087
|
-
userId: starter.userId,
|
|
3088
|
-
botId: starter.botId
|
|
3089
|
-
}));
|
|
3090
|
-
const starterAllowed = !starter || !starterIsCurrentBot && isSlackThreadContextSenderAllowed({
|
|
3091
|
-
allowFromLower: params.allowFromLower,
|
|
3092
|
-
allowNameMatching: params.allowNameMatching,
|
|
3093
|
-
userId: starter.userId,
|
|
3094
|
-
userName: starterSenderName,
|
|
3095
|
-
botId: starter.botId
|
|
3096
|
-
});
|
|
3097
|
-
const includeStarterContext = !starter || !starterIsCurrentBot && shouldIncludeSupplementalContext({
|
|
3098
|
-
mode: params.contextVisibilityMode,
|
|
3099
|
-
kind: "thread",
|
|
3100
|
-
senderAllowed: starterAllowed
|
|
3101
|
-
});
|
|
3102
|
-
if (starter?.text && includeStarterContext) {
|
|
3103
|
-
threadStarterBody = starter.text;
|
|
3104
|
-
const snippet = formatSlackThreadLabelSnippet(starter.text);
|
|
3105
|
-
threadLabel = `Slack thread ${params.roomLabel}${snippet ? `: ${snippet}` : ""}`;
|
|
3106
|
-
if (shouldSeedInitialThreadContext && !params.effectiveDirectMedia && starter.files && starter.files.length > 0) {
|
|
3107
|
-
const { resolveSlackMedia } = await loadSlackMediaModule();
|
|
3108
|
-
threadStarterMedia = await resolveSlackMedia({
|
|
3109
|
-
files: starter.files,
|
|
3110
|
-
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
3111
|
-
token: params.ctx.botToken,
|
|
3112
|
-
maxBytes: params.ctx.mediaMaxBytes
|
|
3113
|
-
});
|
|
3114
|
-
if (threadStarterMedia) logVerbose(`slack: hydrated thread starter file ${threadStarterMedia.map((item) => item.placeholder).join(", ")} from root message`);
|
|
3115
|
-
}
|
|
3116
|
-
} else threadLabel = `Slack thread ${params.roomLabel}`;
|
|
3117
|
-
const includeBotStarterAsRootContext = shouldIncludeBotThreadStarterContext({
|
|
3118
|
-
starterIsCurrentBot,
|
|
3119
|
-
isNewThreadSession: shouldSeedInitialThreadContext,
|
|
3120
|
-
hasStarterText: Boolean(starter?.text)
|
|
3121
|
-
});
|
|
3122
|
-
if (starter?.text && starterIsCurrentBot && !includeBotStarterAsRootContext) logVerbose("slack: omitted current-bot thread starter from context");
|
|
3123
|
-
else if (starter?.text && !includeStarterContext && !starterIsCurrentBot) logVerbose(`slack: omitted thread starter from context (mode=${params.contextVisibilityMode}, sender_allowed=${starterAllowed ? "yes" : "no"})`);
|
|
3124
|
-
else if (includeBotStarterAsRootContext) {
|
|
3125
|
-
threadLabel = formatSlackBotStarterThreadLabel({
|
|
3126
|
-
roomLabel: params.roomLabel,
|
|
3127
|
-
starterText: starter?.text
|
|
3128
|
-
});
|
|
3129
|
-
logVerbose("slack: retained current-bot thread starter as assistant root context");
|
|
3130
|
-
}
|
|
3131
|
-
const threadInitialHistoryLimit = params.account.config?.thread?.initialHistoryLimit ?? 20;
|
|
3132
|
-
if (threadInitialHistoryLimit > 0 && shouldLoadInitialThreadHistory) {
|
|
3133
|
-
const currentBotRootTs = starter?.ts ?? params.threadTs;
|
|
3134
|
-
const threadHistoryWithBotRoot = ensureSlackThreadHistoryHasBotRoot({
|
|
3135
|
-
history: await resolveSlackThreadHistory({
|
|
3136
|
-
channelId: params.message.channel,
|
|
3137
|
-
threadTs: params.threadTs,
|
|
3138
|
-
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
3139
|
-
currentMessageTs: params.message.ts,
|
|
3140
|
-
limit: threadInitialHistoryLimit
|
|
3141
|
-
}),
|
|
3142
|
-
includeBotStarterAsRootContext,
|
|
3143
|
-
threadStarter: starter ? {
|
|
3144
|
-
...starter,
|
|
3145
|
-
ts: currentBotRootTs
|
|
3146
|
-
} : null
|
|
3147
|
-
});
|
|
3148
|
-
if (threadHistoryWithBotRoot.length > 0) {
|
|
3149
|
-
const { kept: threadHistoryWithoutCurrentBot, omittedCurrentBot: omittedCurrentBotHistoryCount } = applySlackThreadHistoryFilterPolicy({
|
|
3150
|
-
history: threadHistoryWithBotRoot,
|
|
3151
|
-
policy: resolveSlackThreadHistoryFilterPolicy({
|
|
3152
|
-
includeBotStarterAsRootContext,
|
|
3153
|
-
starterTs: currentBotRootTs
|
|
3154
|
-
}),
|
|
3155
|
-
identity: botIdentity
|
|
3156
|
-
});
|
|
3157
|
-
const userMapForFilter = params.contextVisibilityMode !== "all" && params.allowNameMatching && params.allowFromLower.length > 0 ? await resolveSlackThreadUserMap({
|
|
3158
|
-
ctx: params.ctx,
|
|
3159
|
-
messages: threadHistoryWithoutCurrentBot,
|
|
3160
|
-
eventScope: params.eventScope
|
|
3161
|
-
}) : /* @__PURE__ */ new Map();
|
|
3162
|
-
const { items: filteredThreadHistory, omitted: omittedHistoryCount } = params.contextVisibilityMode === "all" ? {
|
|
3163
|
-
items: threadHistoryWithoutCurrentBot,
|
|
3164
|
-
omitted: 0
|
|
3165
|
-
} : filterSupplementalContextItems({
|
|
3166
|
-
items: threadHistoryWithoutCurrentBot,
|
|
3167
|
-
mode: params.contextVisibilityMode,
|
|
3168
|
-
kind: "thread",
|
|
3169
|
-
isSenderAllowed: (historyMsg) => {
|
|
3170
|
-
if (isCurrentBotAuthor({
|
|
3171
|
-
userId: historyMsg.userId,
|
|
3172
|
-
botId: historyMsg.botId
|
|
3173
|
-
})) return true;
|
|
3174
|
-
const msgUser = historyMsg.userId ? userMapForFilter.get(historyMsg.userId) : null;
|
|
3175
|
-
return isSlackThreadContextSenderAllowed({
|
|
3176
|
-
allowFromLower: params.allowFromLower,
|
|
3177
|
-
allowNameMatching: params.allowNameMatching,
|
|
3178
|
-
userId: historyMsg.userId,
|
|
3179
|
-
userName: msgUser?.name,
|
|
3180
|
-
botId: historyMsg.botId
|
|
3181
|
-
});
|
|
3182
|
-
}
|
|
3183
|
-
});
|
|
3184
|
-
const userMap = await resolveSlackThreadUserMap({
|
|
3185
|
-
ctx: params.ctx,
|
|
3186
|
-
messages: filteredThreadHistory
|
|
3187
|
-
});
|
|
3188
|
-
if (omittedHistoryCount > 0 || omittedCurrentBotHistoryCount > 0) logVerbose(`slack: omitted ${omittedHistoryCount + omittedCurrentBotHistoryCount} thread message(s) from context (mode=${params.contextVisibilityMode})`);
|
|
3189
|
-
const historyParts = [];
|
|
3190
|
-
for (const historyMsg of filteredThreadHistory) {
|
|
3191
|
-
const msgUser = historyMsg.userId ? userMap.get(historyMsg.userId) : null;
|
|
3192
|
-
const isOtherBot = Boolean(historyMsg.botId) && historyMsg.botId !== params.ctx.botId;
|
|
3193
|
-
const isCurrentBot = isCurrentBotAuthor({
|
|
3194
|
-
userId: historyMsg.userId,
|
|
3195
|
-
botId: historyMsg.botId
|
|
3196
|
-
});
|
|
3197
|
-
const role = isCurrentBot || isOtherBot || Boolean(historyMsg.botId) ? "assistant" : "user";
|
|
3198
|
-
const msgSenderName = isCurrentBot ? "Bot (this assistant)" : msgUser?.name ?? (historyMsg.botId ? `Bot (${historyMsg.botId})` : "Unknown");
|
|
3199
|
-
const msgWithId = `${historyMsg.text}\n[slack message id: ${historyMsg.ts ?? "unknown"} channel: ${params.message.channel}]`;
|
|
3200
|
-
historyParts.push(formatInboundEnvelope({
|
|
3201
|
-
channel: "Slack",
|
|
3202
|
-
from: `${msgSenderName} (${role})`,
|
|
3203
|
-
timestamp: resolveSlackTimestampMs(historyMsg.ts),
|
|
3204
|
-
body: msgWithId,
|
|
3205
|
-
chatType: "channel",
|
|
3206
|
-
envelope: params.envelopeOptions
|
|
3207
|
-
}));
|
|
3208
|
-
}
|
|
3209
|
-
if (historyParts.length > 0) {
|
|
3210
|
-
threadHistoryBody = historyParts.join("\n\n");
|
|
3211
|
-
logVerbose(`slack: populated thread history with ${filteredThreadHistory.length} messages for new session`);
|
|
3212
|
-
}
|
|
3213
|
-
}
|
|
3214
|
-
}
|
|
3215
|
-
return {
|
|
3216
|
-
threadStarterBody,
|
|
3217
|
-
threadHistoryBody,
|
|
3218
|
-
shouldSeedInitialThreadContext,
|
|
3219
|
-
threadLabel,
|
|
3220
|
-
threadStarterMedia
|
|
3221
|
-
};
|
|
3222
|
-
}
|
|
3223
|
-
//#endregion
|
|
3224
|
-
//#region extensions/slack/src/monitor/message-handler/subteam-mentions.ts
|
|
3225
|
-
const SUBTEAM_MENTION_RE = /<!subteam\^([A-Z0-9]+)(?:\|[^>]*)?>/gi;
|
|
3226
|
-
const SUBTEAM_MEMBER_CACHE_TTL_MS = 300 * 1e3;
|
|
3227
|
-
const subteamMemberCache = /* @__PURE__ */ new WeakMap();
|
|
3228
|
-
function normalizeSlackId(value) {
|
|
3229
|
-
return typeof value === "string" && value.trim() ? value.trim().toUpperCase() : void 0;
|
|
3230
|
-
}
|
|
3231
|
-
function extractSlackSubteamMentionIds(text) {
|
|
3232
|
-
if (!text) return [];
|
|
3233
|
-
const ids = /* @__PURE__ */ new Set();
|
|
3234
|
-
for (const match of text.matchAll(SUBTEAM_MENTION_RE)) {
|
|
3235
|
-
const id = normalizeSlackId(match[1]);
|
|
3236
|
-
if (id) ids.add(id);
|
|
3237
|
-
}
|
|
3238
|
-
return [...ids];
|
|
3239
|
-
}
|
|
3240
|
-
async function readSlackSubteamUsers(params) {
|
|
3241
|
-
let bySubteam = subteamMemberCache.get(params.client);
|
|
3242
|
-
if (!bySubteam) {
|
|
3243
|
-
bySubteam = /* @__PURE__ */ new Map();
|
|
3244
|
-
subteamMemberCache.set(params.client, bySubteam);
|
|
3245
|
-
}
|
|
3246
|
-
const cacheKey = `${normalizeSlackId(params.teamId) ?? ""}:${params.subteamId}`;
|
|
3247
|
-
const cached = bySubteam.get(cacheKey);
|
|
3248
|
-
const now = asDateTimestampMs(params.now);
|
|
3249
|
-
if (cached) {
|
|
3250
|
-
if (now !== void 0 && asDateTimestampMs(cached.expiresAt) !== void 0 && cached.expiresAt > now) return cached.users;
|
|
3251
|
-
bySubteam.delete(cacheKey);
|
|
3252
|
-
}
|
|
3253
|
-
try {
|
|
3254
|
-
const response = await params.client.usergroups.users.list({
|
|
3255
|
-
usergroup: params.subteamId,
|
|
3256
|
-
...params.teamId ? { team_id: params.teamId } : {}
|
|
3257
|
-
});
|
|
3258
|
-
if (!response.ok) {
|
|
3259
|
-
params.log?.(`slack: failed to resolve user-group mention ${params.subteamId}: ${response.error ?? "unknown_error"}`);
|
|
3260
|
-
return /* @__PURE__ */ new Set();
|
|
3261
|
-
}
|
|
3262
|
-
const users = new Set((response.users ?? []).map((userId) => normalizeSlackId(userId)).filter(Boolean));
|
|
3263
|
-
const expiresAt = resolveExpiresAtMsFromDurationMs(SUBTEAM_MEMBER_CACHE_TTL_MS, { nowMs: params.now });
|
|
3264
|
-
if (expiresAt !== void 0) bySubteam.set(cacheKey, {
|
|
3265
|
-
expiresAt,
|
|
3266
|
-
users
|
|
3267
|
-
});
|
|
3268
|
-
return users;
|
|
3269
|
-
} catch (err) {
|
|
3270
|
-
params.log?.(`slack: failed to resolve user-group mention ${params.subteamId}: ${formatErrorMessage(err)}`);
|
|
3271
|
-
return /* @__PURE__ */ new Set();
|
|
3272
|
-
}
|
|
3273
|
-
}
|
|
3274
|
-
async function isSlackSubteamMentionForBot(params) {
|
|
3275
|
-
const botUserId = normalizeSlackId(params.botUserId);
|
|
3276
|
-
if (!botUserId) return false;
|
|
3277
|
-
const subteamIds = extractSlackSubteamMentionIds(params.text);
|
|
3278
|
-
if (subteamIds.length === 0) return false;
|
|
3279
|
-
const now = params.now ?? Date.now();
|
|
3280
|
-
for (const subteamId of subteamIds) if ((await readSlackSubteamUsers({
|
|
3281
|
-
client: params.client,
|
|
3282
|
-
subteamId,
|
|
3283
|
-
teamId: normalizeOptionalString(params.teamId),
|
|
3284
|
-
now,
|
|
3285
|
-
log: params.log
|
|
3286
|
-
})).has(botUserId)) return true;
|
|
3287
|
-
return false;
|
|
3288
|
-
}
|
|
3289
|
-
//#endregion
|
|
3290
|
-
//#region extensions/slack/src/monitor/message-handler/prepare.ts
|
|
3291
|
-
const mentionRegexCache = /* @__PURE__ */ new WeakMap();
|
|
3292
|
-
const SLACK_ANY_MENTION_RE = /<@[^>]+>|<!subteam\^[^>]+>/;
|
|
3293
|
-
const SLACK_USER_MENTION_RE = /<@([^>|]+)(?:\|[^>]+)?>/g;
|
|
3294
|
-
const SLACK_SUBTEAM_MENTION_RE = /<!subteam\^([^>|]+)(?:\|[^>]+)?>/g;
|
|
3295
|
-
const SLACK_SUBTEAM_MENTION_MARKER = "<!subteam^";
|
|
3296
|
-
const SLACK_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
|
|
3297
|
-
const SLACK_HISTORY_MEDIA_MAX_BYTES = 10 * 1024 * 1024;
|
|
3298
|
-
const SLACK_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1e3;
|
|
3299
|
-
const SLACK_HISTORY_MEDIA_TOTAL_TIMEOUT_MS = 3e3;
|
|
3300
|
-
function recordString(record, key) {
|
|
3301
|
-
return normalizeOptionalString(record?.[key]);
|
|
3302
|
-
}
|
|
3303
|
-
function recordNullableString(record, key) {
|
|
3304
|
-
if (!record || !(key in record)) return;
|
|
3305
|
-
if (record[key] === null) return null;
|
|
3306
|
-
return normalizeOptionalString(record[key]);
|
|
3307
|
-
}
|
|
3308
|
-
function mergeSlackAssistantThreadContext(primary, fallback) {
|
|
3309
|
-
if (!primary) return fallback;
|
|
3310
|
-
if (!fallback) return primary;
|
|
3311
|
-
return {
|
|
3312
|
-
assistantChannelId: primary.assistantChannelId || fallback.assistantChannelId,
|
|
3313
|
-
threadTs: primary.threadTs || fallback.threadTs,
|
|
3314
|
-
userId: primary.userId ?? fallback.userId,
|
|
3315
|
-
channelId: primary.channelId ?? fallback.channelId,
|
|
3316
|
-
teamId: primary.teamId ?? fallback.teamId,
|
|
3317
|
-
enterpriseId: primary.enterpriseId !== void 0 ? primary.enterpriseId : fallback.enterpriseId
|
|
3318
|
-
};
|
|
3319
|
-
}
|
|
3320
|
-
function hasSlackAssistantThreadMetadata(context) {
|
|
3321
|
-
return Boolean(context?.channelId || context?.teamId || context?.enterpriseId !== void 0);
|
|
3322
|
-
}
|
|
3323
|
-
function resolveSlackMessageAssistantThreadContext(message) {
|
|
3324
|
-
const thread = asOptionalRecord(message.assistant_thread);
|
|
3325
|
-
if (!thread) return;
|
|
3326
|
-
const context = asOptionalRecord(thread.context);
|
|
3327
|
-
const assistantChannelId = recordString(thread, "channel_id") ?? message.channel;
|
|
3328
|
-
const threadTs = recordString(thread, "thread_ts") ?? message.thread_ts ?? message.ts;
|
|
3329
|
-
if (!assistantChannelId || !threadTs) return;
|
|
3330
|
-
return {
|
|
3331
|
-
assistantChannelId,
|
|
3332
|
-
threadTs,
|
|
3333
|
-
userId: recordString(thread, "user_id") ?? message.user,
|
|
3334
|
-
channelId: recordString(context, "channel_id"),
|
|
3335
|
-
teamId: recordString(context, "team_id"),
|
|
3336
|
-
enterpriseId: recordNullableString(context, "enterprise_id")
|
|
3337
|
-
};
|
|
3338
|
-
}
|
|
3339
|
-
async function restoreSlackAssistantThreadContextFromMetadata(params) {
|
|
3340
|
-
const threadTs = params.message.thread_ts;
|
|
3341
|
-
const parentUserId = params.message.parent_user_id?.trim();
|
|
3342
|
-
if (!params.message.channel || !threadTs || !parentUserId || parentUserId !== params.ctx.botUserId && parentUserId !== params.ctx.botId) return;
|
|
3343
|
-
try {
|
|
3344
|
-
const response = await (params.eventScope?.client ?? params.ctx.app.client).conversations.replies({
|
|
3345
|
-
channel: params.message.channel,
|
|
3346
|
-
ts: threadTs,
|
|
3347
|
-
oldest: threadTs,
|
|
3348
|
-
include_all_metadata: true,
|
|
3349
|
-
limit: 4
|
|
3350
|
-
});
|
|
3351
|
-
for (const message of response.messages ?? []) {
|
|
3352
|
-
const context = parseSlackAssistantThreadMetadata(message.metadata);
|
|
3353
|
-
if (!context) continue;
|
|
3354
|
-
return {
|
|
3355
|
-
assistantChannelId: params.message.channel,
|
|
3356
|
-
threadTs,
|
|
3357
|
-
userId: params.message.user,
|
|
3358
|
-
channelId: context.channelId,
|
|
3359
|
-
teamId: context.teamId,
|
|
3360
|
-
enterpriseId: context.enterpriseId
|
|
3361
|
-
};
|
|
3362
|
-
}
|
|
3363
|
-
} catch (err) {
|
|
3364
|
-
logVerbose(`slack assistant context restore failed channel=${params.message.channel} ts=${threadTs}: ${formatErrorMessage(err)}`);
|
|
3365
|
-
}
|
|
3366
|
-
}
|
|
3367
|
-
function resolveCachedMentionRegexes(ctx, agentId, options) {
|
|
3368
|
-
const key = [
|
|
3369
|
-
normalizeOptionalString(agentId) ?? "__default__",
|
|
3370
|
-
normalizeOptionalString(options?.provider),
|
|
3371
|
-
normalizeOptionalString(options?.conversationId ?? void 0),
|
|
3372
|
-
options?.providerPolicy ? JSON.stringify(options.providerPolicy) : ""
|
|
3373
|
-
].join("");
|
|
3374
|
-
let byAgent = mentionRegexCache.get(ctx);
|
|
3375
|
-
if (!byAgent) {
|
|
3376
|
-
byAgent = /* @__PURE__ */ new Map();
|
|
3377
|
-
mentionRegexCache.set(ctx, byAgent);
|
|
3378
|
-
}
|
|
3379
|
-
const cached = byAgent.get(key);
|
|
3380
|
-
if (cached) return cached;
|
|
3381
|
-
const built = buildMentionRegexes(ctx.cfg, agentId, options);
|
|
3382
|
-
byAgent.set(key, built);
|
|
3383
|
-
return built;
|
|
3384
|
-
}
|
|
3385
|
-
function isSlackImageFileCandidate(file) {
|
|
3386
|
-
if ((file.mimetype?.split(";")[0]?.trim().toLowerCase())?.startsWith("image/")) return true;
|
|
3387
|
-
return Boolean(mimeTypeFromFilePath(file.name)?.startsWith("image/"));
|
|
3388
|
-
}
|
|
3389
|
-
function sliceSlackImageFileCandidates(files, limit) {
|
|
3390
|
-
if (limit <= 0 || !files?.length) return [];
|
|
3391
|
-
return files.filter(isSlackImageFileCandidate).slice(0, limit);
|
|
3392
|
-
}
|
|
3393
|
-
function sliceSlackHistoryAttachmentCandidates(attachments, limit) {
|
|
3394
|
-
if (limit <= 0 || !attachments?.length) return [];
|
|
3395
|
-
const out = [];
|
|
3396
|
-
let remaining = limit;
|
|
3397
|
-
for (const attachment of attachments) {
|
|
3398
|
-
if (attachment.is_share !== true) continue;
|
|
3399
|
-
const hasImageUrl = Boolean(normalizeOptionalString(attachment.image_url));
|
|
3400
|
-
const files = sliceSlackImageFileCandidates(attachment.files, remaining - (hasImageUrl ? 1 : 0));
|
|
3401
|
-
if (!hasImageUrl && files.length === 0) continue;
|
|
3402
|
-
out.push({
|
|
3403
|
-
...attachment,
|
|
3404
|
-
files
|
|
3405
|
-
});
|
|
3406
|
-
remaining -= (hasImageUrl ? 1 : 0) + files.length;
|
|
3407
|
-
if (remaining <= 0) break;
|
|
3408
|
-
}
|
|
3409
|
-
return out;
|
|
3410
|
-
}
|
|
3411
|
-
function buildSlackHistoryMediaCandidateMessage(message) {
|
|
3412
|
-
const files = sliceSlackImageFileCandidates(message.files, SLACK_HISTORY_MEDIA_MAX_ATTACHMENTS);
|
|
3413
|
-
const attachments = sliceSlackHistoryAttachmentCandidates(message.attachments, Math.max(0, SLACK_HISTORY_MEDIA_MAX_ATTACHMENTS - files.length));
|
|
3414
|
-
if (files.length === 0 && attachments.length === 0) return null;
|
|
3415
|
-
return {
|
|
3416
|
-
...message,
|
|
3417
|
-
files,
|
|
3418
|
-
attachments
|
|
3419
|
-
};
|
|
3420
|
-
}
|
|
3421
|
-
async function resolveSlackHistoryMediaForPendingRecord(params) {
|
|
3422
|
-
const mediaMessage = buildSlackHistoryMediaCandidateMessage(params.message);
|
|
3423
|
-
if (!mediaMessage) return [];
|
|
3424
|
-
return toInboundMediaFacts((await resolveSlackMessageContent({
|
|
3425
|
-
message: mediaMessage,
|
|
3426
|
-
isThreadReply: params.isThreadReply,
|
|
3427
|
-
threadStarter: params.threadStarter,
|
|
3428
|
-
isBotMessage: params.isBotMessage,
|
|
3429
|
-
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
3430
|
-
botToken: params.ctx.botToken,
|
|
3431
|
-
mediaMaxBytes: Math.min(params.ctx.mediaMaxBytes, SLACK_HISTORY_MEDIA_MAX_BYTES),
|
|
3432
|
-
mediaReadIdleTimeoutMs: SLACK_HISTORY_MEDIA_IDLE_TIMEOUT_MS,
|
|
3433
|
-
mediaTotalTimeoutMs: SLACK_HISTORY_MEDIA_TOTAL_TIMEOUT_MS
|
|
3434
|
-
}))?.effectiveDirectMedia, {
|
|
3435
|
-
kind: "image",
|
|
3436
|
-
messageId: params.message.ts
|
|
3437
|
-
});
|
|
3438
|
-
}
|
|
3439
|
-
function collectUniqueSlackMentionIds(text, regex) {
|
|
3440
|
-
const ids = [];
|
|
3441
|
-
regex.lastIndex = 0;
|
|
3442
|
-
for (const match of text.matchAll(regex)) {
|
|
3443
|
-
const id = normalizeSlackId(match[1]);
|
|
3444
|
-
if (id && !ids.includes(id)) ids.push(id);
|
|
3445
|
-
}
|
|
3446
|
-
return ids;
|
|
3447
|
-
}
|
|
3448
|
-
function collectSlackMentionMetadata(text) {
|
|
3449
|
-
return {
|
|
3450
|
-
mentionedUserIds: collectUniqueSlackMentionIds(text, SLACK_USER_MENTION_RE),
|
|
3451
|
-
mentionedSubteamIds: collectUniqueSlackMentionIds(text, SLACK_SUBTEAM_MENTION_RE),
|
|
3452
|
-
hasAnyMention: SLACK_ANY_MENTION_RE.test(text),
|
|
3453
|
-
hasSubteamMention: text.includes(SLACK_SUBTEAM_MENTION_MARKER)
|
|
3454
|
-
};
|
|
3455
|
-
}
|
|
3456
|
-
async function resolveSlackExplicitMentionState(params) {
|
|
3457
|
-
const normalizedBotUserId = normalizeSlackId(params.ctx.botUserId);
|
|
3458
|
-
const explicitlyMentionedBotUser = Boolean(normalizedBotUserId && params.mentionedUserIds.includes(normalizedBotUserId));
|
|
3459
|
-
const explicitlyMentionedBotSubteam = Boolean(params.ctx.botUserId && params.hasSubteamMention) && await isSlackSubteamMentionForBot({
|
|
3460
|
-
client: params.eventScope?.client ?? params.ctx.app.client,
|
|
3461
|
-
text: params.messageText,
|
|
3462
|
-
botUserId: params.ctx.botUserId,
|
|
3463
|
-
teamId: params.eventScope?.teamId ?? params.ctx.teamId,
|
|
3464
|
-
log: logVerbose
|
|
3465
|
-
});
|
|
3466
|
-
return {
|
|
3467
|
-
explicitlyMentionedBotUser,
|
|
3468
|
-
explicitlyMentionedBotSubteam,
|
|
3469
|
-
explicitlyMentioned: explicitlyMentionedBotUser || explicitlyMentionedBotSubteam || params.source === "app_mention"
|
|
3470
|
-
};
|
|
3471
|
-
}
|
|
3472
|
-
function resolveSlackMentionSource(params) {
|
|
3473
|
-
if (params.explicitBotMention) return "explicit_bot";
|
|
3474
|
-
if (params.explicitSubteamMention) return "subteam";
|
|
3475
|
-
if (params.shouldBypassMention) return "command_bypass";
|
|
3476
|
-
if (params.wasMentioned) return "mention_pattern";
|
|
3477
|
-
if (params.matchedImplicitMentionKinds.length > 0) return "implicit_thread";
|
|
3478
|
-
return "none";
|
|
3479
|
-
}
|
|
3480
|
-
function buildSlackMentionContextPayload(params) {
|
|
3481
|
-
if (!params.isRoomish) return {};
|
|
3482
|
-
return {
|
|
3483
|
-
WasMentioned: params.effectiveWasMentioned,
|
|
3484
|
-
ExplicitlyMentionedBot: params.explicitlyMentioned,
|
|
3485
|
-
MentionedUserIds: params.mentionedUserIds.length > 0 ? [...params.mentionedUserIds] : void 0,
|
|
3486
|
-
MentionedSubteamIds: params.mentionedSubteamIds.length > 0 ? [...params.mentionedSubteamIds] : void 0,
|
|
3487
|
-
ImplicitMentionKinds: params.matchedImplicitMentionKinds.length > 0 ? [...params.matchedImplicitMentionKinds] : void 0,
|
|
3488
|
-
MentionSource: params.mentionSource
|
|
3489
|
-
};
|
|
3490
|
-
}
|
|
3491
|
-
async function resolveSlackConversationContext(params) {
|
|
3492
|
-
const { ctx, account, message } = params;
|
|
3493
|
-
const cfg = ctx.cfg;
|
|
3494
|
-
let channelInfo = {};
|
|
3495
|
-
let resolvedChannelType = normalizeSlackChannelType(message.channel_type, message.channel);
|
|
3496
|
-
if (resolvedChannelType !== "im" && (!message.channel_type || message.channel_type !== "im")) {
|
|
3497
|
-
channelInfo = await ctx.resolveChannelName(message.channel, params.eventScope);
|
|
3498
|
-
resolvedChannelType = normalizeSlackChannelType(message.channel_type ?? channelInfo.type ?? ctx.recallSlackChannelType(message.channel, params.eventScope), message.channel);
|
|
3499
|
-
}
|
|
3500
|
-
const channelName = channelInfo?.name;
|
|
3501
|
-
const isDirectMessage = resolvedChannelType === "im";
|
|
3502
|
-
const isGroupDm = resolvedChannelType === "mpim";
|
|
3503
|
-
const isRoom = resolvedChannelType === "channel" || resolvedChannelType === "group";
|
|
3504
|
-
const isRoomish = isRoom || isGroupDm;
|
|
3505
|
-
const channelConfig = isRoom ? resolveSlackChannelConfig({
|
|
3506
|
-
channelId: message.channel,
|
|
3507
|
-
channelName,
|
|
3508
|
-
channels: ctx.channelsConfig,
|
|
3509
|
-
channelKeys: ctx.channelsConfigKeys,
|
|
3510
|
-
defaultRequireMention: ctx.defaultRequireMention,
|
|
3511
|
-
allowNameMatching: ctx.allowNameMatching
|
|
3512
|
-
}) : null;
|
|
3513
|
-
const allowBotsSetting = channelConfig?.allowBots ?? account.config?.allowBots ?? cfg.channels?.slack?.allowBots ?? false;
|
|
3514
|
-
return {
|
|
3515
|
-
channelInfo,
|
|
3516
|
-
channelName,
|
|
3517
|
-
resolvedChannelType,
|
|
3518
|
-
isDirectMessage,
|
|
3519
|
-
isGroupDm,
|
|
3520
|
-
isRoom,
|
|
3521
|
-
isRoomish,
|
|
3522
|
-
channelConfig,
|
|
3523
|
-
allowBotsMode: allowBotsSetting === "mentions" ? "mentions" : allowBotsSetting ? "all" : "off",
|
|
3524
|
-
isBotMessage: Boolean(message.bot_id)
|
|
3525
|
-
};
|
|
3526
|
-
}
|
|
3527
|
-
async function authorizeSlackInboundMessage(params) {
|
|
3528
|
-
const { ctx, account, message, conversation } = params;
|
|
3529
|
-
const { isDirectMessage, channelName, resolvedChannelType, isBotMessage, allowBotsMode } = conversation;
|
|
3530
|
-
if (isBotMessage) {
|
|
3531
|
-
if (message.user && ctx.botUserId && message.user === ctx.botUserId) return null;
|
|
3532
|
-
if (allowBotsMode === "off") {
|
|
3533
|
-
logVerbose(`slack: drop bot message ${message.bot_id ?? "unknown"} (allowBots=false)`);
|
|
3534
|
-
return null;
|
|
3535
|
-
}
|
|
3536
|
-
}
|
|
3537
|
-
if (isDirectMessage && !message.user) {
|
|
3538
|
-
logVerbose("slack: drop dm message (missing user id)");
|
|
3539
|
-
return null;
|
|
3540
|
-
}
|
|
3541
|
-
const senderId = message.user ?? (isBotMessage ? message.bot_id : void 0);
|
|
3542
|
-
if (!senderId) {
|
|
3543
|
-
logVerbose("slack: drop message (missing sender id)");
|
|
3544
|
-
return null;
|
|
3545
|
-
}
|
|
3546
|
-
if (!ctx.isChannelAllowed({
|
|
3547
|
-
channelId: message.channel,
|
|
3548
|
-
channelName,
|
|
3549
|
-
channelType: resolvedChannelType
|
|
3550
|
-
})) {
|
|
3551
|
-
logVerbose("slack: drop message (channel not allowed)");
|
|
3552
|
-
return null;
|
|
3553
|
-
}
|
|
3554
|
-
const allowFromLower = await resolveSlackEffectiveAllowFrom(ctx, { includePairingStore: isDirectMessage });
|
|
3555
|
-
if (isDirectMessage) {
|
|
3556
|
-
const directUserId = message.user;
|
|
3557
|
-
if (!directUserId) {
|
|
3558
|
-
logVerbose("slack: drop dm message (missing user id)");
|
|
3559
|
-
return null;
|
|
3560
|
-
}
|
|
3561
|
-
if (!await authorizeSlackDirectMessage({
|
|
3562
|
-
ctx,
|
|
3563
|
-
accountId: account.accountId,
|
|
3564
|
-
senderId: directUserId,
|
|
3565
|
-
allowFromLower,
|
|
3566
|
-
resolveSenderName: (userId) => ctx.resolveUserName(userId, params.eventScope),
|
|
3567
|
-
sendPairingReply: async (text) => {
|
|
3568
|
-
await sendMessageSlack(message.channel, text, {
|
|
3569
|
-
cfg: ctx.cfg,
|
|
3570
|
-
token: ctx.botToken,
|
|
3571
|
-
client: params.eventScope?.client ?? ctx.app.client,
|
|
3572
|
-
accountId: account.accountId
|
|
3573
|
-
});
|
|
3574
|
-
},
|
|
3575
|
-
onDisabled: () => {
|
|
3576
|
-
logVerbose("slack: drop dm (dms disabled)");
|
|
3577
|
-
},
|
|
3578
|
-
onUnauthorized: ({ allowMatchMeta }) => {
|
|
3579
|
-
logVerbose(`Blocked unauthorized slack sender ${message.user} (dmPolicy=${ctx.dmPolicy}, ${allowMatchMeta})`);
|
|
3580
|
-
},
|
|
3581
|
-
log: logVerbose
|
|
3582
|
-
})) return null;
|
|
3583
|
-
}
|
|
3584
|
-
return {
|
|
3585
|
-
senderId,
|
|
3586
|
-
allowFromLower
|
|
3587
|
-
};
|
|
3588
|
-
}
|
|
3589
|
-
async function prepareSlackMessage(params) {
|
|
3590
|
-
const { ctx, account, message, opts } = params;
|
|
3591
|
-
const slackClient = opts.eventScope?.client ?? ctx.app.client;
|
|
3592
|
-
const threadStarterWorkspaceScope = opts.eventScope ? {
|
|
3593
|
-
accountId: account.accountId,
|
|
3594
|
-
teamId: opts.eventScope.teamId
|
|
3595
|
-
} : void 0;
|
|
3596
|
-
const cfg = ctx.cfg;
|
|
3597
|
-
const conversation = await resolveSlackConversationContext({
|
|
3598
|
-
ctx,
|
|
3599
|
-
account,
|
|
3600
|
-
message,
|
|
3601
|
-
eventScope: opts.eventScope
|
|
3602
|
-
});
|
|
3603
|
-
const { channelInfo, channelName, isDirectMessage, isGroupDm, isRoom, isRoomish, channelConfig, allowBotsMode, isBotMessage } = conversation;
|
|
3604
|
-
const authorization = await authorizeSlackInboundMessage({
|
|
3605
|
-
ctx,
|
|
3606
|
-
account,
|
|
3607
|
-
message,
|
|
3608
|
-
conversation,
|
|
3609
|
-
eventScope: opts.eventScope
|
|
3610
|
-
});
|
|
3611
|
-
if (!authorization) return null;
|
|
3612
|
-
const { senderId, allowFromLower } = authorization;
|
|
3613
|
-
const messageText = message.text ?? "";
|
|
3614
|
-
let resolvedSenderName = normalizeOptionalString(message.username);
|
|
3615
|
-
const resolveSenderName = async () => {
|
|
3616
|
-
if (resolvedSenderName) return resolvedSenderName;
|
|
3617
|
-
if (message.user) {
|
|
3618
|
-
const normalized = normalizeOptionalString((await ctx.resolveUserName(message.user, opts.eventScope))?.name);
|
|
3619
|
-
if (normalized) {
|
|
3620
|
-
resolvedSenderName = normalized;
|
|
3621
|
-
return resolvedSenderName;
|
|
3622
|
-
}
|
|
3623
|
-
}
|
|
3624
|
-
resolvedSenderName = message.user ?? message.bot_id ?? "unknown";
|
|
3625
|
-
return resolvedSenderName;
|
|
3626
|
-
};
|
|
3627
|
-
const mentionMetadata = collectSlackMentionMetadata(messageText);
|
|
3628
|
-
const { mentionedUserIds, mentionedSubteamIds, hasAnyMention } = mentionMetadata;
|
|
3629
|
-
const messageAssistantThreadContext = resolveSlackMessageAssistantThreadContext(message);
|
|
3630
|
-
const assistantContextLookupChannelId = messageAssistantThreadContext?.assistantChannelId ?? message.channel;
|
|
3631
|
-
const assistantContextLookupThreadTs = messageAssistantThreadContext?.threadTs ?? message.thread_ts ?? message.ts;
|
|
3632
|
-
const cachedAssistantThreadContext = isDirectMessage ? ctx.getSlackAssistantThreadContext(assistantContextLookupChannelId, assistantContextLookupThreadTs, opts.eventScope) : void 0;
|
|
3633
|
-
const restoredAssistantThreadContextPromise = isDirectMessage && !cachedAssistantThreadContext && !hasSlackAssistantThreadMetadata(messageAssistantThreadContext) ? restoreSlackAssistantThreadContextFromMetadata({
|
|
3634
|
-
ctx,
|
|
3635
|
-
message,
|
|
3636
|
-
eventScope: opts.eventScope
|
|
3637
|
-
}) : Promise.resolve(void 0);
|
|
3638
|
-
const { explicitlyMentionedBotUser, explicitlyMentionedBotSubteam, explicitlyMentioned } = await resolveSlackExplicitMentionState({
|
|
3639
|
-
ctx,
|
|
3640
|
-
messageText,
|
|
3641
|
-
mentionedUserIds,
|
|
3642
|
-
hasSubteamMention: mentionMetadata.hasSubteamMention,
|
|
3643
|
-
source: opts.source,
|
|
3644
|
-
eventScope: opts.eventScope
|
|
3645
|
-
});
|
|
3646
|
-
const channelRequireMention = channelConfig?.requireMention ?? ctx.defaultRequireMention ?? true;
|
|
3647
|
-
const channelChatType = isDirectMessage ? "direct" : isGroupDm ? "group" : "channel";
|
|
3648
|
-
const restoredAssistantThreadContext = await restoredAssistantThreadContextPromise;
|
|
3649
|
-
const assistantThreadContext = mergeSlackAssistantThreadContext(messageAssistantThreadContext, cachedAssistantThreadContext ?? restoredAssistantThreadContext);
|
|
3650
|
-
const assistantThreadContextToCache = messageAssistantThreadContext || restoredAssistantThreadContext ? assistantThreadContext : void 0;
|
|
3651
|
-
if (assistantThreadContextToCache) ctx.saveSlackAssistantThreadContext(assistantThreadContextToCache, opts.eventScope);
|
|
3652
|
-
const hasAgentViewMessageSignal = isDirectMessage && !opts.eventScope && !assistantThreadContext && isSlackAppContext(message.app_context);
|
|
3653
|
-
if (hasAgentViewMessageSignal) await ctx.recordSlackAgentView();
|
|
3654
|
-
const managedViewThreadTs = message.thread_ts;
|
|
3655
|
-
const isManagedViewRoot = isDirectMessage && !opts.eventScope && !assistantThreadContext && !message.parent_user_id && Boolean(managedViewThreadTs && message.ts && managedViewThreadTs === message.ts);
|
|
3656
|
-
if (isManagedViewRoot && managedViewThreadTs) await ctx.recordSlackManagedViewThread(message.channel, managedViewThreadTs);
|
|
3657
|
-
const hasManagedViewThread = isDirectMessage && !opts.eventScope && !assistantThreadContext && Boolean(managedViewThreadTs && await ctx.isSlackManagedViewThread(message.channel, managedViewThreadTs));
|
|
3658
|
-
const isAgentViewMessage = isDirectMessage && !opts.eventScope && !assistantThreadContext && (hasAgentViewMessageSignal || isManagedViewRoot || hasManagedViewThread || await ctx.isSlackAgentView());
|
|
3659
|
-
const agentViewThreadTs = isAgentViewMessage ? message.thread_ts ?? message.ts : void 0;
|
|
3660
|
-
const channelReplyToMode = channelConfig?.replyToMode ?? resolveSlackReplyToMode(account, channelChatType);
|
|
3661
|
-
const willImplicitlyThreadReply = isRoom && !channelRequireMention && channelReplyToMode !== "off";
|
|
3662
|
-
const seedTopLevelRoomThreadBySource = opts.source === "app_mention" || opts.wasMentioned === true || explicitlyMentioned || willImplicitlyThreadReply;
|
|
3663
|
-
let routing = resolveSlackRoutingContext({
|
|
3664
|
-
ctx,
|
|
3665
|
-
account,
|
|
3666
|
-
message,
|
|
3667
|
-
isDirectMessage,
|
|
3668
|
-
isGroupDm,
|
|
3669
|
-
isRoom,
|
|
3670
|
-
isRoomish,
|
|
3671
|
-
channelConfig,
|
|
3672
|
-
seedTopLevelRoomThread: seedTopLevelRoomThreadBySource,
|
|
3673
|
-
assistantThreadTs: assistantThreadContext?.threadTs,
|
|
3674
|
-
agentViewThreadTs,
|
|
3675
|
-
eventScope: opts.eventScope
|
|
3676
|
-
});
|
|
3677
|
-
let mentionCheckTranscript;
|
|
3678
|
-
const resolveWasMentioned = (mentionRegexes) => opts.wasMentioned ?? (!isDirectMessage && matchesMentionWithExplicit({
|
|
3679
|
-
text: messageText,
|
|
3680
|
-
mentionRegexes,
|
|
3681
|
-
explicit: {
|
|
3682
|
-
hasAnyMention,
|
|
3683
|
-
isExplicitlyMentioned: explicitlyMentioned,
|
|
3684
|
-
canResolveExplicit: Boolean(ctx.botUserId)
|
|
3685
|
-
},
|
|
3686
|
-
transcript: mentionCheckTranscript
|
|
3687
|
-
}));
|
|
3688
|
-
const buildPolicyMentionRegexes = (agentId) => resolveCachedMentionRegexes(ctx, agentId, {
|
|
3689
|
-
provider: "slack",
|
|
3690
|
-
conversationId: message.channel,
|
|
3691
|
-
providerPolicy: account.config.mentionPatterns
|
|
3692
|
-
});
|
|
3693
|
-
let mentionRegexes = buildPolicyMentionRegexes(routing.route.agentId);
|
|
3694
|
-
let wasMentioned = resolveWasMentioned(mentionRegexes);
|
|
3695
|
-
const hasBoundSession = Boolean(routing.runtimeBoundSessionKey || routing.configuredBindingSessionKey);
|
|
3696
|
-
let { route, runtimeBinding, replyToMode, threadContext, threadTs, isThreadReply, threadKeys, sessionKey, historyKey } = routing;
|
|
3697
|
-
const { configuredBinding, configuredBindingSessionKey } = routing;
|
|
3698
|
-
const isAssistantThreadMessage = Boolean(isDirectMessage && messageAssistantThreadContext);
|
|
3699
|
-
const forcedAssistantReplyThreadTs = Boolean(assistantThreadContext?.threadTs && (isThreadReply || isAssistantThreadMessage || replyToMode !== "off")) ? assistantThreadContext?.threadTs : void 0;
|
|
3700
|
-
const forcedReplyThreadTs = agentViewThreadTs ?? forcedAssistantReplyThreadTs;
|
|
3701
|
-
if (runtimeBinding && shouldLogVerbose()) logVerbose(`slack: routed via bound conversation ${runtimeBinding.conversation.conversationId} -> ${runtimeBinding.targetSessionKey}`);
|
|
3702
|
-
if (configuredBinding) {
|
|
3703
|
-
const ensured = await ensureConfiguredBindingRouteReady({
|
|
3704
|
-
cfg,
|
|
3705
|
-
bindingResolution: configuredBinding
|
|
3706
|
-
});
|
|
3707
|
-
if (ensured.ok) {
|
|
3708
|
-
if (shouldLogVerbose()) logVerbose(`slack: using configured ACP binding for ${configuredBinding.record.conversation.conversationId} -> ${configuredBindingSessionKey}`);
|
|
3709
|
-
} else {
|
|
3710
|
-
if (shouldLogVerbose()) logVerbose(`slack: configured ACP binding unavailable for ${configuredBinding.record.conversation.conversationId}: ${ensured.error}`);
|
|
3711
|
-
logInboundDrop({
|
|
3712
|
-
log: logVerbose,
|
|
3713
|
-
channel: "slack",
|
|
3714
|
-
reason: "configured ACP binding unavailable",
|
|
3715
|
-
target: configuredBinding.record.conversation.conversationId
|
|
3716
|
-
});
|
|
3717
|
-
return null;
|
|
3718
|
-
}
|
|
3719
|
-
}
|
|
3720
|
-
const senderNameForAuthPromise = ctx.allowNameMatching ? resolveSenderName().then((name) => ({
|
|
3721
|
-
ok: true,
|
|
3722
|
-
name
|
|
3723
|
-
}), (error) => ({
|
|
3724
|
-
ok: false,
|
|
3725
|
-
error
|
|
3726
|
-
})) : Promise.resolve({
|
|
3727
|
-
ok: true,
|
|
3728
|
-
name: void 0
|
|
3729
|
-
});
|
|
3730
|
-
let implicitMentionKinds = [];
|
|
3731
|
-
if (!isDirectMessage && ctx.botUserId && message.thread_ts && !wasMentioned) {
|
|
3732
|
-
const replyToBotKinds = implicitMentionKindWhen("reply_to_bot", message.parent_user_id === ctx.botUserId);
|
|
3733
|
-
implicitMentionKinds = replyToBotKinds.length > 0 ? replyToBotKinds : implicitMentionKindWhen("bot_thread_participant", await hasSlackThreadParticipationWithPersistence({
|
|
3734
|
-
accountId: account.accountId,
|
|
3735
|
-
channelId: message.channel,
|
|
3736
|
-
threadTs: message.thread_ts,
|
|
3737
|
-
...opts.eventScope ? { teamId: opts.eventScope.teamId } : {}
|
|
3738
|
-
}));
|
|
3739
|
-
}
|
|
3740
|
-
const recordDroppedHistory = async (reason) => {
|
|
3741
|
-
const pendingText = (message.text ?? "").trim();
|
|
3742
|
-
const historyMediaCandidate = buildSlackHistoryMediaCandidateMessage(message);
|
|
3743
|
-
const fallbackFile = message.files?.length ? `[Slack file: ${formatSlackFileReference(message.files[0])}]` : "";
|
|
3744
|
-
const pendingBody = pendingText || fallbackFile || (!fallbackFile && historyMediaCandidate ? "[Slack media attachment]" : "");
|
|
3745
|
-
const skippedThreadStarter = historyMediaCandidate && isThreadReply && threadTs ? await resolveSlackThreadStarter({
|
|
3746
|
-
channelId: message.channel,
|
|
3747
|
-
threadTs,
|
|
3748
|
-
client: slackClient,
|
|
3749
|
-
workspaceScope: threadStarterWorkspaceScope
|
|
3750
|
-
}) : null;
|
|
3751
|
-
const senderName = pendingBody ? await resolveSenderName() : void 0;
|
|
3752
|
-
await recordDroppedChannelInboundHistory({
|
|
3753
|
-
input: {
|
|
3754
|
-
id: message.ts ?? `${message.channel}:${Date.now()}`,
|
|
3755
|
-
timestamp: resolveSlackTimestampMs(message.ts),
|
|
3756
|
-
rawText: pendingBody,
|
|
3757
|
-
textForAgent: pendingBody,
|
|
3758
|
-
raw: message
|
|
3759
|
-
},
|
|
3760
|
-
admission: {
|
|
3761
|
-
kind: "drop",
|
|
3762
|
-
reason,
|
|
3763
|
-
recordHistory: true
|
|
3764
|
-
},
|
|
3765
|
-
preflight: {
|
|
3766
|
-
message: pendingBody ? {
|
|
3767
|
-
rawBody: pendingBody,
|
|
3768
|
-
body: pendingBody,
|
|
3769
|
-
bodyForAgent: pendingBody,
|
|
3770
|
-
senderLabel: senderName,
|
|
3771
|
-
envelopeFrom: senderName
|
|
3772
|
-
} : void 0,
|
|
3773
|
-
history: {
|
|
3774
|
-
key: historyKey,
|
|
3775
|
-
historyMap: ctx.channelHistories,
|
|
3776
|
-
limit: ctx.historyLimit,
|
|
3777
|
-
recordOnDrop: true,
|
|
3778
|
-
mediaLimit: SLACK_HISTORY_MEDIA_MAX_ATTACHMENTS,
|
|
3779
|
-
shouldRecord: opts.shouldRecordDroppedHistory
|
|
3780
|
-
},
|
|
3781
|
-
media: () => resolveSlackHistoryMediaForPendingRecord({
|
|
3782
|
-
ctx,
|
|
3783
|
-
message,
|
|
3784
|
-
isThreadReply,
|
|
3785
|
-
threadStarter: skippedThreadStarter,
|
|
3786
|
-
isBotMessage,
|
|
3787
|
-
eventScope: opts.eventScope
|
|
3788
|
-
})
|
|
3789
|
-
}
|
|
3790
|
-
});
|
|
3791
|
-
};
|
|
3792
|
-
let threadStarterPromise;
|
|
3793
|
-
const getThreadStarter = () => {
|
|
3794
|
-
threadStarterPromise ??= isThreadReply && threadTs ? resolveSlackThreadStarter({
|
|
3795
|
-
channelId: message.channel,
|
|
3796
|
-
threadTs,
|
|
3797
|
-
client: slackClient,
|
|
3798
|
-
workspaceScope: threadStarterWorkspaceScope
|
|
3799
|
-
}) : Promise.resolve(null);
|
|
3800
|
-
return threadStarterPromise;
|
|
3801
|
-
};
|
|
3802
|
-
const resolveMessageContent = (contentMessage, preloadedMedia) => getThreadStarter().then((threadStarter) => resolveSlackMessageContent({
|
|
3803
|
-
message: contentMessage,
|
|
3804
|
-
isThreadReply,
|
|
3805
|
-
threadStarter,
|
|
3806
|
-
isBotMessage,
|
|
3807
|
-
botToken: ctx.botToken,
|
|
3808
|
-
client: slackClient,
|
|
3809
|
-
mediaMaxBytes: ctx.mediaMaxBytes,
|
|
3810
|
-
resolveUserName: (userId) => ctx.resolveUserName(userId, opts.eventScope),
|
|
3811
|
-
preloadedMedia
|
|
3812
|
-
}));
|
|
3813
|
-
let preloadedDirectMedia;
|
|
3814
|
-
let messageContentPromise;
|
|
3815
|
-
const getMessageContent = () => {
|
|
3816
|
-
messageContentPromise ??= resolveMessageContent(message, preloadedDirectMedia);
|
|
3817
|
-
return messageContentPromise;
|
|
3818
|
-
};
|
|
3819
|
-
const senderNameForAuthResult = await senderNameForAuthPromise;
|
|
3820
|
-
if (!senderNameForAuthResult.ok) throw senderNameForAuthResult.error;
|
|
3821
|
-
const senderNameForAuth = senderNameForAuthResult.name;
|
|
3822
|
-
const allowTextCommands = shouldHandleTextCommands({
|
|
3823
|
-
cfg,
|
|
3824
|
-
surface: "slack"
|
|
3825
|
-
});
|
|
3826
|
-
const shouldRequireMention = isRoom ? channelConfig?.requireMention ?? ctx.defaultRequireMention : false;
|
|
3827
|
-
const implicitMentions = resolveChannelImplicitMentions({
|
|
3828
|
-
cfg,
|
|
3829
|
-
channel: "slack",
|
|
3830
|
-
accountId: account.accountId
|
|
3831
|
-
});
|
|
3832
|
-
if (message["_ambiguousThreadReply"]) {
|
|
3833
|
-
ctx.logger.info({
|
|
3834
|
-
channel: message.channel,
|
|
3835
|
-
ts: message.ts,
|
|
3836
|
-
parentUserId: message.parent_user_id
|
|
3837
|
-
}, "skipping ambiguous slack thread reply");
|
|
3838
|
-
return null;
|
|
3839
|
-
}
|
|
3840
|
-
let canDetectMention = Boolean(ctx.botUserId) || mentionRegexes.length > 0;
|
|
3841
|
-
const textForCommandDetection = stripSlackMentionsForCommandDetection(message.text ?? "");
|
|
3842
|
-
const hasControlCommandInMessage = hasControlCommand(textForCommandDetection, cfg);
|
|
3843
|
-
const hasAbortRequest = isAbortRequestText(textForCommandDetection);
|
|
3844
|
-
const channelUsersAllowlistConfigured = isRoom && Array.isArray(channelConfig?.users) && channelConfig.users.length > 0;
|
|
3845
|
-
const messageIngress = await resolveSlackCommandIngress({
|
|
3846
|
-
ctx,
|
|
3847
|
-
senderId,
|
|
3848
|
-
senderName: senderNameForAuth,
|
|
3849
|
-
channelType: conversation.resolvedChannelType ?? "channel",
|
|
3850
|
-
channelId: message.channel,
|
|
3851
|
-
ownerAllowFromLower: allowFromLower,
|
|
3852
|
-
channelUsers: isRoom ? channelConfig?.users : void 0,
|
|
3853
|
-
allowTextCommands,
|
|
3854
|
-
hasControlCommand: hasControlCommandInMessage,
|
|
3855
|
-
mentionFacts: {
|
|
3856
|
-
canDetectMention,
|
|
3857
|
-
wasMentioned,
|
|
3858
|
-
hasAnyMention,
|
|
3859
|
-
implicitMentionKinds
|
|
3860
|
-
},
|
|
3861
|
-
activation: {
|
|
3862
|
-
requireMention: shouldRequireMention,
|
|
3863
|
-
allowTextCommands,
|
|
3864
|
-
implicitMentions
|
|
3865
|
-
}
|
|
3866
|
-
});
|
|
3867
|
-
const senderGate = messageIngress.senderAccess.gate;
|
|
3868
|
-
if (isRoomish && senderGate?.allowed === false) {
|
|
3869
|
-
logVerbose(`Blocked unauthorized slack sender ${senderId} (not in sender allowlist)`);
|
|
3870
|
-
return null;
|
|
3871
|
-
}
|
|
3872
|
-
if (isRoom && isBotMessage && allowBotsMode !== "off" && !await authorizeSlackBotRoomMessage({
|
|
3873
|
-
ctx,
|
|
3874
|
-
channelId: message.channel,
|
|
3875
|
-
senderId,
|
|
3876
|
-
senderName: senderNameForAuth,
|
|
3877
|
-
channelUsers: channelConfig?.users,
|
|
3878
|
-
allowFromLower,
|
|
3879
|
-
eventScope: opts.eventScope
|
|
3880
|
-
})) return null;
|
|
3881
|
-
const threadContextAllowFromLower = isRoom ? channelUsersAllowlistConfigured ? normalizeAllowListLower(channelConfig?.users) : [] : isDirectMessage ? allowFromLower : [];
|
|
3882
|
-
const contextVisibilityMode = resolveChannelContextVisibilityMode({
|
|
3883
|
-
cfg: ctx.cfg,
|
|
3884
|
-
channel: "slack",
|
|
3885
|
-
accountId: account.accountId
|
|
3886
|
-
});
|
|
3887
|
-
const commandAuthorized = messageIngress.commandAccess.authorized;
|
|
3888
|
-
if (isRoomish && messageIngress.commandAccess.shouldBlockControlCommand) {
|
|
3889
|
-
logInboundDrop({
|
|
3890
|
-
log: logVerbose,
|
|
3891
|
-
channel: "slack",
|
|
3892
|
-
reason: "control command (unauthorized)",
|
|
3893
|
-
target: senderId
|
|
3894
|
-
});
|
|
3895
|
-
return null;
|
|
3896
|
-
}
|
|
3897
|
-
const canSeedMentionedRoomThread = !seedTopLevelRoomThreadBySource && isRoom && !routing.isThreadReply && !hasBoundSession;
|
|
3898
|
-
let seededMentionRouting;
|
|
3899
|
-
const getSeededMentionRouting = () => {
|
|
3900
|
-
seededMentionRouting ??= resolveSlackRoutingContext({
|
|
3901
|
-
ctx,
|
|
3902
|
-
account,
|
|
3903
|
-
message,
|
|
3904
|
-
isDirectMessage,
|
|
3905
|
-
isGroupDm,
|
|
3906
|
-
isRoom,
|
|
3907
|
-
isRoomish,
|
|
3908
|
-
channelConfig,
|
|
3909
|
-
seedTopLevelRoomThread: true,
|
|
3910
|
-
assistantThreadTs: assistantThreadContext?.threadTs,
|
|
3911
|
-
agentViewThreadTs,
|
|
3912
|
-
eventScope: opts.eventScope
|
|
3913
|
-
});
|
|
3914
|
-
return seededMentionRouting;
|
|
3915
|
-
};
|
|
3916
|
-
let preflightAudioTranscript;
|
|
3917
|
-
let preflightAudioMedia;
|
|
3918
|
-
const preflightAudioFile = findCaptionlessSlackAudioFile(message);
|
|
3919
|
-
if (isRoom && !isBotMessage && shouldRequireMention && cfg.tools?.media?.audio?.enabled !== false && messageIngress.activationAccess.shouldSkip && mentionRegexes.length > 0 && Boolean(preflightAudioFile) && preflightAudioFile) {
|
|
3920
|
-
const preflightRouting = canSeedMentionedRoomThread ? getSeededMentionRouting() : routing;
|
|
3921
|
-
const preflightMedia = (await resolveMessageContent({
|
|
3922
|
-
...message,
|
|
3923
|
-
files: [preflightAudioFile],
|
|
3924
|
-
attachments: void 0,
|
|
3925
|
-
blocks: void 0
|
|
3926
|
-
}))?.effectiveDirectMedia;
|
|
3927
|
-
const downloadedAudioMedia = preflightMedia?.[0];
|
|
3928
|
-
if (downloadedAudioMedia) preloadedDirectMedia = /* @__PURE__ */ new Map([[preflightAudioFile, downloadedAudioMedia]]);
|
|
3929
|
-
const preflightResult = preflightMedia ? await resolveSlackPreflightAudioTranscript({
|
|
3930
|
-
media: preflightMedia,
|
|
3931
|
-
cfg,
|
|
3932
|
-
accountId: account.accountId,
|
|
3933
|
-
originatingTo: `channel:${message.channel}`,
|
|
3934
|
-
sessionKey: preflightRouting.sessionKey,
|
|
3935
|
-
messageThreadId: preflightRouting.threadContext.messageThreadId
|
|
3936
|
-
}) : null;
|
|
3937
|
-
if (preflightResult) {
|
|
3938
|
-
mentionCheckTranscript = preflightResult.transcript;
|
|
3939
|
-
wasMentioned = resolveWasMentioned(mentionRegexes);
|
|
3940
|
-
if (wasMentioned) {
|
|
3941
|
-
preflightAudioTranscript = preflightResult.transcript;
|
|
3942
|
-
preflightAudioMedia = preflightMedia?.[preflightResult.mediaIndex];
|
|
3943
|
-
}
|
|
3944
|
-
}
|
|
3945
|
-
if (!preflightAudioTranscript) {
|
|
3946
|
-
await discardSlackPreflightMedia(preflightMedia);
|
|
3947
|
-
preloadedDirectMedia = void 0;
|
|
3948
|
-
}
|
|
3949
|
-
}
|
|
3950
|
-
if (canSeedMentionedRoomThread && wasMentioned) {
|
|
3951
|
-
routing = getSeededMentionRouting();
|
|
3952
|
-
mentionRegexes = buildPolicyMentionRegexes(routing.route.agentId);
|
|
3953
|
-
wasMentioned = resolveWasMentioned(mentionRegexes);
|
|
3954
|
-
({route, runtimeBinding, replyToMode, threadContext, threadTs, isThreadReply, threadKeys, sessionKey, historyKey} = routing);
|
|
3955
|
-
canDetectMention = Boolean(ctx.botUserId) || mentionRegexes.length > 0;
|
|
3956
|
-
}
|
|
3957
|
-
if (preflightAudioTranscript && !wasMentioned) {
|
|
3958
|
-
await discardSlackPreflightMedia(preloadedDirectMedia ? [...preloadedDirectMedia.values()] : void 0);
|
|
3959
|
-
preloadedDirectMedia = void 0;
|
|
3960
|
-
preflightAudioTranscript = void 0;
|
|
3961
|
-
preflightAudioMedia = void 0;
|
|
3962
|
-
}
|
|
3963
|
-
const directThreadRoutedToDmSession = !assistantThreadContext && !agentViewThreadTs && isDirectMessage && isThreadReply && threadTs && runtimeBinding?.conversation.conversationId !== threadTs;
|
|
3964
|
-
const mentionDecision = resolveInboundMentionDecision({
|
|
3965
|
-
facts: {
|
|
3966
|
-
canDetectMention,
|
|
3967
|
-
wasMentioned,
|
|
3968
|
-
hasAnyMention,
|
|
3969
|
-
implicitMentionKinds
|
|
3970
|
-
},
|
|
3971
|
-
policy: {
|
|
3972
|
-
isGroup: isRoom,
|
|
3973
|
-
requireMention: shouldRequireMention,
|
|
3974
|
-
allowTextCommands,
|
|
3975
|
-
hasControlCommand: hasControlCommandInMessage,
|
|
3976
|
-
commandAuthorized,
|
|
3977
|
-
implicitMentions
|
|
3978
|
-
}
|
|
3979
|
-
});
|
|
3980
|
-
const effectiveWasMentioned = mentionDecision.effectiveWasMentioned;
|
|
3981
|
-
const shouldBypassMention = mentionDecision.shouldBypassMention;
|
|
3982
|
-
const matchedImplicitMentionKinds = mentionDecision.matchedImplicitMentionKinds;
|
|
3983
|
-
const mentionSource = resolveSlackMentionSource({
|
|
3984
|
-
explicitBotMention: explicitlyMentionedBotUser || opts.source === "app_mention",
|
|
3985
|
-
explicitSubteamMention: explicitlyMentionedBotSubteam,
|
|
3986
|
-
matchedImplicitMentionKinds,
|
|
3987
|
-
shouldBypassMention,
|
|
3988
|
-
wasMentioned
|
|
3989
|
-
});
|
|
3990
|
-
if (isBotMessage && allowBotsMode === "mentions") {
|
|
3991
|
-
if (!(isDirectMessage || effectiveWasMentioned || shouldBypassMention)) {
|
|
3992
|
-
logVerbose("slack: drop bot message (allowBots=mentions, missing mention)");
|
|
3993
|
-
return null;
|
|
3994
|
-
}
|
|
3995
|
-
}
|
|
3996
|
-
if (isRoom && shouldRequireMention && !canDetectMention && !effectiveWasMentioned) {
|
|
3997
|
-
ctx.logger.info({
|
|
3998
|
-
channel: message.channel,
|
|
3999
|
-
reason: "mention-detection-unavailable"
|
|
4000
|
-
}, "skipping channel message");
|
|
4001
|
-
await recordDroppedHistory("slack-mention-detection-unavailable");
|
|
4002
|
-
return null;
|
|
4003
|
-
}
|
|
4004
|
-
const ignoreOtherMentions = channelConfig?.ignoreOtherMentions ?? false;
|
|
4005
|
-
if (isRoom && ignoreOtherMentions && Boolean(ctx.botUserId) && hasAnyMention && !wasMentioned) {
|
|
4006
|
-
logInboundDrop({
|
|
4007
|
-
log: logVerbose,
|
|
4008
|
-
channel: "slack",
|
|
4009
|
-
reason: "other-mention",
|
|
4010
|
-
target: senderId
|
|
4011
|
-
});
|
|
4012
|
-
await recordDroppedHistory("slack-other-mention");
|
|
4013
|
-
return null;
|
|
4014
|
-
}
|
|
4015
|
-
if (isRoom && shouldRequireMention && mentionDecision.shouldSkip) {
|
|
4016
|
-
ctx.logger.info({
|
|
4017
|
-
channel: message.channel,
|
|
4018
|
-
reason: "no-mention"
|
|
4019
|
-
}, "skipping channel message");
|
|
4020
|
-
await recordDroppedHistory("slack-no-mention");
|
|
4021
|
-
return null;
|
|
4022
|
-
}
|
|
4023
|
-
const chatType = resolveSlackChatType(conversation.resolvedChannelType);
|
|
4024
|
-
const inboundEventKind = classifyChannelInboundEvent({
|
|
4025
|
-
conversation: { kind: chatType },
|
|
4026
|
-
unmentionedGroupPolicy: resolveUnmentionedGroupInboundPolicy({
|
|
4027
|
-
cfg,
|
|
4028
|
-
agentId: route.agentId
|
|
4029
|
-
}),
|
|
4030
|
-
wasMentioned: effectiveWasMentioned,
|
|
4031
|
-
hasControlCommand: hasControlCommandInMessage,
|
|
4032
|
-
hasAbortRequest
|
|
4033
|
-
});
|
|
4034
|
-
const threadStarter = await getThreadStarter();
|
|
4035
|
-
const resolvedMessageContent = await getMessageContent();
|
|
4036
|
-
if (!resolvedMessageContent) return null;
|
|
4037
|
-
const { rawBody, effectiveDirectMedia } = resolvedMessageContent;
|
|
4038
|
-
const bodyForAgent = preflightAudioTranscript ? formatSlackAudioTranscriptForAgent({
|
|
4039
|
-
transcript: preflightAudioTranscript,
|
|
4040
|
-
rawBody
|
|
4041
|
-
}) : rawBody;
|
|
4042
|
-
const ackReaction = resolveAckReaction(cfg, route.agentId, {
|
|
4043
|
-
channel: "slack",
|
|
4044
|
-
accountId: account.accountId
|
|
4045
|
-
});
|
|
4046
|
-
const ackReactionValue = ackReaction ?? "";
|
|
4047
|
-
const sourceRepliesAreToolOnly = resolveChannelMessageSourceReplyDeliveryMode({
|
|
4048
|
-
cfg,
|
|
4049
|
-
ctx: {
|
|
4050
|
-
ChatType: chatType,
|
|
4051
|
-
InboundEventKind: inboundEventKind
|
|
4052
|
-
}
|
|
4053
|
-
}) === "message_tool_only";
|
|
4054
|
-
const statusReactionsExplicitlyEnabled = cfg.messages?.statusReactions?.enabled === true;
|
|
4055
|
-
const isRoomEvent = inboundEventKind === "room_event";
|
|
4056
|
-
const shouldAckReaction$1 = () => Boolean(ackReaction && shouldAckReaction({
|
|
4057
|
-
scope: ctx.ackReactionScope,
|
|
4058
|
-
inboundEventKind,
|
|
4059
|
-
isDirect: isDirectMessage,
|
|
4060
|
-
isGroup: isRoomish,
|
|
4061
|
-
isMentionableGroup: isRoom,
|
|
4062
|
-
requireMention: shouldRequireMention,
|
|
4063
|
-
canDetectMention,
|
|
4064
|
-
effectiveWasMentioned,
|
|
4065
|
-
shouldBypassMention
|
|
4066
|
-
}));
|
|
4067
|
-
const ackReactionMessageTs = message.ts;
|
|
4068
|
-
const allowToolOnlyStatusReaction = statusReactionsExplicitlyEnabled && (effectiveWasMentioned || shouldBypassMention);
|
|
4069
|
-
const shouldSendAckReaction = shouldAckReaction$1() && (!sourceRepliesAreToolOnly || allowToolOnlyStatusReaction || isRoomEvent);
|
|
4070
|
-
const statusReactionsWillHandle = Boolean(ackReactionMessageTs) && !isRoomEvent && statusReactionsExplicitlyEnabled && shouldSendAckReaction;
|
|
4071
|
-
const ackReactionPromise = !statusReactionsWillHandle && shouldSendAckReaction && ackReactionMessageTs && ackReactionValue ? reactSlackMessage(message.channel, ackReactionMessageTs, ackReactionValue, {
|
|
4072
|
-
token: ctx.botToken,
|
|
4073
|
-
client: slackClient
|
|
4074
|
-
}).then(() => true, (err) => {
|
|
4075
|
-
logVerbose(`slack react failed for channel ${message.channel}: ${formatSlackError(err)}`);
|
|
4076
|
-
return false;
|
|
4077
|
-
}) : statusReactionsWillHandle ? Promise.resolve(true) : null;
|
|
4078
|
-
const roomLabel = channelName ? `#${channelName}` : `#${message.channel}`;
|
|
4079
|
-
const senderName = await resolveSenderName();
|
|
4080
|
-
const preview = truncateUtf16Safe(bodyForAgent.replace(/\s+/g, " "), 160);
|
|
4081
|
-
const inboundLabel = isDirectMessage ? `Slack DM from ${senderName}` : `Slack message in ${roomLabel} from ${senderName}`;
|
|
4082
|
-
const slackFrom = isDirectMessage ? `slack:${message.user}` : isRoom ? `slack:channel:${message.channel}` : `slack:group:${message.channel}`;
|
|
4083
|
-
enqueueSystemEvent(inboundLabel, {
|
|
4084
|
-
sessionKey,
|
|
4085
|
-
contextKey: `slack:message:${message.channel}:${message.ts ?? "unknown"}`
|
|
4086
|
-
});
|
|
4087
|
-
const envelopeFrom = resolveConversationLabel$1({
|
|
4088
|
-
ChatType: chatType,
|
|
4089
|
-
SenderName: senderName,
|
|
4090
|
-
GroupSubject: isRoomish ? roomLabel : void 0,
|
|
4091
|
-
From: slackFrom
|
|
4092
|
-
}) ?? (isDirectMessage ? senderName : roomLabel);
|
|
4093
|
-
const threadInfo = isThreadReply && threadTs ? ` thread_ts: ${threadTs}${message.parent_user_id ? ` parent_user_id: ${message.parent_user_id}` : ""}` : "";
|
|
4094
|
-
const textWithId = `${bodyForAgent}\n[slack message id: ${message.ts} channel: ${message.channel}${threadInfo}]`;
|
|
4095
|
-
const storePath = resolveStorePath(ctx.cfg.session?.store, { agentId: route.agentId });
|
|
4096
|
-
const envelopeOptions = resolveEnvelopeFormatOptions(ctx.cfg);
|
|
4097
|
-
const previousTimestamp = readSessionUpdatedAt({
|
|
4098
|
-
storePath,
|
|
4099
|
-
sessionKey
|
|
4100
|
-
});
|
|
4101
|
-
if (opts.source === "app_mention" && !ctx.botUserId && message.ts) {
|
|
4102
|
-
const pendingHistory = ctx.channelHistories.get(historyKey);
|
|
4103
|
-
if (pendingHistory) ctx.channelHistories.set(historyKey, pendingHistory.filter((entry) => entry.messageId !== message.ts));
|
|
4104
|
-
}
|
|
4105
|
-
const channelHistory = createChannelHistoryWindow({ historyMap: ctx.channelHistories });
|
|
4106
|
-
const dmHistoryLimit = isDirectMessage ? resolveSlackDmHistoryLimit({
|
|
4107
|
-
account,
|
|
4108
|
-
userId: message.user,
|
|
4109
|
-
defaultLimit: ctx.dmHistoryLimit
|
|
4110
|
-
}) : 0;
|
|
4111
|
-
let combinedBody = formatInboundEnvelope({
|
|
4112
|
-
channel: "Slack",
|
|
4113
|
-
from: envelopeFrom,
|
|
4114
|
-
timestamp: resolveSlackTimestampMs(message.ts),
|
|
4115
|
-
body: textWithId,
|
|
4116
|
-
chatType,
|
|
4117
|
-
sender: {
|
|
4118
|
-
name: senderName,
|
|
4119
|
-
id: senderId
|
|
4120
|
-
},
|
|
4121
|
-
previousTimestamp,
|
|
4122
|
-
envelope: envelopeOptions
|
|
4123
|
-
});
|
|
4124
|
-
const dmHistoryContext = isDirectMessage && !assistantThreadContext && !agentViewThreadTs && !isThreadReply && dmHistoryLimit > 0 && !previousTimestamp ? await resolveSlackDmHistoryContext({
|
|
4125
|
-
ctx,
|
|
4126
|
-
channelId: message.channel,
|
|
4127
|
-
currentMessageTs: message.ts,
|
|
4128
|
-
limit: dmHistoryLimit,
|
|
4129
|
-
envelopeOptions,
|
|
4130
|
-
eventScope: opts.eventScope
|
|
4131
|
-
}) : {
|
|
4132
|
-
body: void 0,
|
|
4133
|
-
inboundHistory: void 0
|
|
4134
|
-
};
|
|
4135
|
-
if (dmHistoryContext.body) combinedBody = `${dmHistoryContext.body}\n\n${combinedBody}`;
|
|
4136
|
-
if (isRoomish && ctx.historyLimit > 0) combinedBody = channelHistory.buildPendingContext({
|
|
4137
|
-
historyKey,
|
|
4138
|
-
limit: ctx.historyLimit,
|
|
4139
|
-
currentMessage: combinedBody,
|
|
4140
|
-
formatEntry: (entry) => formatInboundEnvelope({
|
|
4141
|
-
channel: "Slack",
|
|
4142
|
-
from: roomLabel,
|
|
4143
|
-
timestamp: entry.timestamp,
|
|
4144
|
-
body: `${entry.body}${entry.messageId ? ` [id:${entry.messageId} channel:${message.channel}]` : ""}`,
|
|
4145
|
-
chatType: "channel",
|
|
4146
|
-
senderLabel: entry.sender,
|
|
4147
|
-
envelope: envelopeOptions
|
|
4148
|
-
})
|
|
4149
|
-
});
|
|
4150
|
-
const slackTo = isDirectMessage ? `user:${message.user}` : `channel:${message.channel}`;
|
|
4151
|
-
const { channelMetadata, groupSystemPrompt } = resolveSlackRoomContextHints({
|
|
4152
|
-
isRoomish,
|
|
4153
|
-
channelInfo,
|
|
4154
|
-
channelConfig
|
|
4155
|
-
});
|
|
4156
|
-
const { threadStarterBody, threadHistoryBody, shouldSeedInitialThreadContext, threadLabel, threadStarterMedia } = await resolveSlackThreadContextData({
|
|
4157
|
-
ctx,
|
|
4158
|
-
account,
|
|
4159
|
-
message,
|
|
4160
|
-
isThreadReply,
|
|
4161
|
-
threadTs,
|
|
4162
|
-
threadStarter,
|
|
4163
|
-
roomLabel,
|
|
4164
|
-
storePath,
|
|
4165
|
-
sessionKey,
|
|
4166
|
-
forceInitialHistory: Boolean(directThreadRoutedToDmSession),
|
|
4167
|
-
allowFromLower: threadContextAllowFromLower,
|
|
4168
|
-
allowNameMatching: ctx.allowNameMatching,
|
|
4169
|
-
contextVisibilityMode,
|
|
4170
|
-
envelopeOptions,
|
|
4171
|
-
effectiveDirectMedia,
|
|
4172
|
-
eventScope: opts.eventScope
|
|
4173
|
-
});
|
|
4174
|
-
const effectiveMedia = effectiveDirectMedia ?? threadStarterMedia;
|
|
4175
|
-
const inboundMedia = toInboundMediaFacts(effectiveMedia, { transcribed: (entry) => effectiveMedia === effectiveDirectMedia && entry === preflightAudioMedia });
|
|
4176
|
-
const inboundHistory = isRoomish && ctx.historyLimit > 0 ? channelHistory.buildInboundHistory({
|
|
4177
|
-
historyKey,
|
|
4178
|
-
limit: ctx.historyLimit
|
|
4179
|
-
}) : dmHistoryContext.inboundHistory;
|
|
4180
|
-
const commandBody = textForCommandDetection.trim();
|
|
4181
|
-
const supplementalThreadHistoryBody = directThreadRoutedToDmSession && !threadHistoryBody ? threadStarterBody : threadHistoryBody;
|
|
4182
|
-
const effectiveMessageThreadId = assistantThreadContext?.threadTs ?? agentViewThreadTs ?? threadContext.messageThreadId;
|
|
4183
|
-
const agentContextEntities = isAgentViewMessage ? normalizeSlackAppContextEntities(message.app_context) : [];
|
|
4184
|
-
const ctxPayload = buildChannelInboundEventContext({
|
|
4185
|
-
channel: "slack",
|
|
4186
|
-
accountId: route.accountId,
|
|
4187
|
-
messageId: threadContext.messageTs,
|
|
4188
|
-
timestamp: resolveSlackTimestampMs(message.ts),
|
|
4189
|
-
from: slackFrom,
|
|
4190
|
-
sender: {
|
|
4191
|
-
id: senderId,
|
|
4192
|
-
name: senderName,
|
|
4193
|
-
displayLabel: senderName,
|
|
4194
|
-
isBot: isBotMessage || void 0
|
|
4195
|
-
},
|
|
4196
|
-
conversation: {
|
|
4197
|
-
kind: chatType,
|
|
4198
|
-
id: message.channel,
|
|
4199
|
-
label: envelopeFrom,
|
|
4200
|
-
spaceId: opts.eventScope?.teamId || ctx.teamId || void 0,
|
|
4201
|
-
threadId: directThreadRoutedToDmSession ? void 0 : effectiveMessageThreadId,
|
|
4202
|
-
nativeChannelId: message.channel
|
|
4203
|
-
},
|
|
4204
|
-
route: {
|
|
4205
|
-
agentId: route.agentId,
|
|
4206
|
-
dmScope: route.dmScope,
|
|
4207
|
-
accountId: route.accountId,
|
|
4208
|
-
routeSessionKey: sessionKey,
|
|
4209
|
-
parentSessionKey: threadKeys.parentSessionKey
|
|
4210
|
-
},
|
|
4211
|
-
reply: {
|
|
4212
|
-
to: slackTo,
|
|
4213
|
-
replyToId: threadContext.replyToId,
|
|
4214
|
-
messageThreadId: directThreadRoutedToDmSession ? void 0 : effectiveMessageThreadId,
|
|
4215
|
-
nativeChannelId: message.channel
|
|
4216
|
-
},
|
|
4217
|
-
message: {
|
|
4218
|
-
inboundEventKind,
|
|
4219
|
-
body: combinedBody,
|
|
4220
|
-
bodyForAgent,
|
|
4221
|
-
rawBody,
|
|
4222
|
-
commandBody,
|
|
4223
|
-
inboundHistory
|
|
4224
|
-
},
|
|
4225
|
-
sessionTranscript: { historyLimit: isRoomish ? ctx.historyLimit : dmHistoryLimit },
|
|
4226
|
-
access: {
|
|
4227
|
-
mentions: {
|
|
4228
|
-
canDetectMention: isRoomish,
|
|
4229
|
-
wasMentioned: effectiveWasMentioned,
|
|
4230
|
-
hasAnyMention: explicitlyMentioned || mentionedSubteamIds.length > 0,
|
|
4231
|
-
implicitMentionKinds: matchedImplicitMentionKinds,
|
|
4232
|
-
requireMention: shouldRequireMention,
|
|
4233
|
-
effectiveWasMentioned
|
|
4234
|
-
},
|
|
4235
|
-
commands: { authorized: commandAuthorized }
|
|
4236
|
-
},
|
|
4237
|
-
media: inboundMedia,
|
|
4238
|
-
supplemental: {
|
|
4239
|
-
thread: {
|
|
4240
|
-
starterBody: !directThreadRoutedToDmSession && shouldSeedInitialThreadContext ? threadStarterBody : void 0,
|
|
4241
|
-
historyBody: supplementalThreadHistoryBody,
|
|
4242
|
-
label: directThreadRoutedToDmSession ? void 0 : threadLabel
|
|
4243
|
-
},
|
|
4244
|
-
groupSystemPrompt
|
|
4245
|
-
},
|
|
4246
|
-
extra: {
|
|
4247
|
-
GroupSubject: isRoomish ? roomLabel : void 0,
|
|
4248
|
-
ChannelPromptContext: channelMetadata ? [channelMetadata] : void 0,
|
|
4249
|
-
ChannelStructuredContext: agentContextEntities.length > 0 ? [{
|
|
4250
|
-
label: "Slack active context",
|
|
4251
|
-
source: "slack",
|
|
4252
|
-
type: "active_view",
|
|
4253
|
-
payload: { entities: agentContextEntities }
|
|
4254
|
-
}] : void 0,
|
|
4255
|
-
TransportThreadId: directThreadRoutedToDmSession ? threadContext.messageThreadId : void 0,
|
|
4256
|
-
SlackAssistantThread: assistantThreadContext ? true : void 0,
|
|
4257
|
-
SlackAgentThread: agentViewThreadTs ? true : void 0,
|
|
4258
|
-
SlackAssistantThreadContextChannelId: assistantThreadContext?.channelId,
|
|
4259
|
-
SlackAssistantThreadContextTeamId: assistantThreadContext?.teamId,
|
|
4260
|
-
SlackAssistantThreadContextEnterpriseId: assistantThreadContext?.enterpriseId ?? void 0,
|
|
4261
|
-
Transcript: preflightAudioTranscript,
|
|
4262
|
-
IsFirstThreadTurn: isThreadReply && threadTs && !directThreadRoutedToDmSession && shouldSeedInitialThreadContext ? true : void 0,
|
|
4263
|
-
...buildSlackMentionContextPayload({
|
|
4264
|
-
isRoomish,
|
|
4265
|
-
effectiveWasMentioned,
|
|
4266
|
-
explicitlyMentioned,
|
|
4267
|
-
mentionedUserIds,
|
|
4268
|
-
mentionedSubteamIds,
|
|
4269
|
-
matchedImplicitMentionKinds,
|
|
4270
|
-
mentionSource
|
|
4271
|
-
})
|
|
4272
|
-
}
|
|
4273
|
-
});
|
|
4274
|
-
ctxPayload.ReplyToMode = replyToMode;
|
|
4275
|
-
if (isRoomish && !shouldRequireMention) channelHistory.record({
|
|
4276
|
-
historyKey,
|
|
4277
|
-
limit: ctx.historyLimit,
|
|
4278
|
-
entry: {
|
|
4279
|
-
sender: senderName,
|
|
4280
|
-
body: rawBody,
|
|
4281
|
-
timestamp: resolveSlackTimestampMs(message.ts),
|
|
4282
|
-
messageId: message.ts
|
|
4283
|
-
}
|
|
4284
|
-
});
|
|
4285
|
-
const pinnedMainDmOwner = isDirectMessage ? resolvePinnedMainDmOwnerFromAllowlist({
|
|
4286
|
-
dmScope: cfg.session?.dmScope,
|
|
4287
|
-
allowFrom: ctx.allowFrom,
|
|
4288
|
-
normalizeEntry: normalizeSlackAllowOwnerEntry
|
|
4289
|
-
}) : null;
|
|
4290
|
-
const replyTarget = isDirectMessage ? `channel:${message.channel}` : ctxPayload.To ?? void 0;
|
|
4291
|
-
if (!replyTarget) return null;
|
|
4292
|
-
if (preflightAudioTranscript) await sendSlackPreflightAudioTranscriptEcho({
|
|
4293
|
-
transcript: preflightAudioTranscript,
|
|
4294
|
-
cfg,
|
|
4295
|
-
accountId: account.accountId,
|
|
4296
|
-
originatingTo: `channel:${message.channel}`,
|
|
4297
|
-
messageThreadId: threadContext.messageThreadId
|
|
4298
|
-
});
|
|
4299
|
-
if (shouldLogVerbose()) logVerbose(`slack inbound: account=${route.accountId} agent=${route.agentId} channel=${message.channel} message_ts=${message.ts ?? "unknown"} thread_ts=${effectiveMessageThreadId ?? "none"} from=${slackFrom} chat=${chatType} chars=${rawBody.length}`);
|
|
4300
|
-
const updateLastRouteSessionKey = resolveInboundLastRouteSessionKey({
|
|
4301
|
-
route,
|
|
4302
|
-
sessionKey
|
|
4303
|
-
});
|
|
4304
|
-
return {
|
|
4305
|
-
ctx,
|
|
4306
|
-
account,
|
|
4307
|
-
message,
|
|
4308
|
-
...opts.relayIdentity ? { relayIdentity: opts.relayIdentity } : {},
|
|
4309
|
-
...opts.eventScope ? { eventScope: opts.eventScope } : {},
|
|
4310
|
-
route,
|
|
4311
|
-
channelConfig,
|
|
4312
|
-
replyTarget,
|
|
4313
|
-
ctxPayload,
|
|
4314
|
-
turn: {
|
|
4315
|
-
storePath,
|
|
4316
|
-
record: {
|
|
4317
|
-
updateLastRoute: isDirectMessage ? {
|
|
4318
|
-
sessionKey: updateLastRouteSessionKey,
|
|
4319
|
-
channel: "slack",
|
|
4320
|
-
to: `user:${message.user}`,
|
|
4321
|
-
accountId: route.accountId,
|
|
4322
|
-
threadId: effectiveMessageThreadId,
|
|
4323
|
-
mainDmOwnerPin: updateLastRouteSessionKey === route.mainSessionKey && pinnedMainDmOwner && message.user ? {
|
|
4324
|
-
ownerRecipient: pinnedMainDmOwner,
|
|
4325
|
-
senderRecipient: normalizeLowercaseStringOrEmpty(message.user),
|
|
4326
|
-
onSkip: ({ ownerRecipient, senderRecipient }) => {
|
|
4327
|
-
logVerbose(`slack: skip main-session last route for ${senderRecipient} (pinned owner ${ownerRecipient})`);
|
|
4328
|
-
}
|
|
4329
|
-
} : void 0
|
|
4330
|
-
} : void 0,
|
|
4331
|
-
onRecordError: (err) => {
|
|
4332
|
-
ctx.logger.warn({
|
|
4333
|
-
error: formatErrorMessage(err),
|
|
4334
|
-
storePath,
|
|
4335
|
-
sessionKey
|
|
4336
|
-
}, "failed updating session meta");
|
|
4337
|
-
}
|
|
4338
|
-
},
|
|
4339
|
-
history: isRoomish && shouldRequireMention ? {
|
|
4340
|
-
isGroup: true,
|
|
4341
|
-
historyKey,
|
|
4342
|
-
historyMap: ctx.channelHistories,
|
|
4343
|
-
limit: ctx.historyLimit
|
|
4344
|
-
} : void 0
|
|
4345
|
-
},
|
|
4346
|
-
replyToMode,
|
|
4347
|
-
...forcedReplyThreadTs ? { forcedReplyThreadTs } : {},
|
|
4348
|
-
...assistantThreadContext ? { slackMessageMetadata: buildSlackAssistantThreadMetadata(assistantThreadContext) } : {},
|
|
4349
|
-
requireMention: shouldRequireMention,
|
|
4350
|
-
isDirectMessage,
|
|
4351
|
-
isRoomish,
|
|
4352
|
-
historyKey,
|
|
4353
|
-
preview,
|
|
4354
|
-
ackReactionMessageTs,
|
|
4355
|
-
ackReactionValue,
|
|
4356
|
-
ackReactionPromise
|
|
4357
|
-
};
|
|
4358
|
-
}
|
|
4359
|
-
//#endregion
|
|
4360
|
-
export { dispatchPreparedSlackMessage, prepareSlackMessage };
|