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