@fased/fased 0.1.41 → 0.1.43
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/brand.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/cli/daemon-cli/restart-health.js +49 -13
- package/dist/cli/plugins-cli.js +6 -103
- package/dist/cli/plugins-doctor-cli.js +45 -0
- package/dist/cli/plugins-info-cli.js +50 -0
- package/dist/cli/plugins-status-cli.js +4 -0
- package/dist/cli/program/routes.js +38 -0
- package/dist/cli/update-cli/shared.js +1 -29
- package/dist/cli/update-cli/update-command.js +87 -28
- package/dist/config/legacy.migrations.part-3.js +25 -0
- package/dist/gateway/server-plugins.js +12 -0
- package/dist/infra/hosted-runtime-artifact.js +40 -1
- package/dist/infra/update-global.js +1 -0
- package/dist/infra/update-runner.js +318 -38
- package/dist/light-plugin-doctor.js +1 -0
- package/dist/light-plugin-info.js +2 -0
- package/dist/light-update-precheck.js +1 -0
- package/dist/light-update-status.js +12 -0
- package/dist/plugin-sdk/account-id.d.ts +2 -1
- package/dist/plugin-sdk/account-id.js +1 -32
- package/dist/plugin-sdk/accounts-Bz_2QZSt.js +305 -0
- package/dist/plugin-sdk/accounts-CuqIKU8X.js +84 -0
- package/dist/plugin-sdk/accounts-RHZyaB73.js +63 -0
- package/dist/plugin-sdk/actions-CysoQjk1.js +150 -0
- package/dist/plugin-sdk/active-listener-C5ALSs7Y.js +37 -0
- package/dist/plugin-sdk/agent-scope-BbgPlhtw.js +1372 -0
- package/dist/plugin-sdk/allow-list-yqasgPpz.js +479 -0
- package/dist/plugin-sdk/audio-preflight-CzG6BjAn.js +107 -0
- package/dist/plugin-sdk/audit-BFnu5TVB.js +90 -0
- package/dist/plugin-sdk/blocks-input-DdQwSVtP.js +30 -0
- package/dist/plugin-sdk/channel-access-BiWxa3LR.js +68 -0
- package/dist/plugin-sdk/channel-access-configure-gJvqbbXB.js +28 -0
- package/dist/plugin-sdk/channel-adapters.discord-g8Do3f5N.js +35 -0
- package/dist/plugin-sdk/channel-core-CMPoGCik.js +1 -0
- package/dist/plugin-sdk/channel-plugin-common.d.ts +5 -1
- package/dist/plugin-sdk/channel-plugin-common.js +18 -1014
- package/dist/plugin-sdk/chat-type-CK5stkc4.d.ts +4 -0
- package/dist/plugin-sdk/chunk-CuJIMshx.js +341 -0
- package/dist/plugin-sdk/chunk-items-CxRDAM7m.js +34 -0
- package/dist/plugin-sdk/command-status.d.ts +20 -1
- package/dist/plugin-sdk/command-status.js +58 -47
- package/dist/plugin-sdk/commands-registry-DwQIFJmL.js +1337 -0
- package/dist/plugin-sdk/common-C90EHP1w.js +440 -0
- package/dist/plugin-sdk/config-DKNrb8oT.js +23271 -0
- package/dist/plugin-sdk/device-pair.d.ts +3 -1
- package/dist/plugin-sdk/device-pair.js +8 -840
- package/dist/plugin-sdk/device-pairing-J1IH1jFl.js +156 -0
- package/dist/plugin-sdk/diagnostic-C16gioN6.js +282 -0
- package/dist/plugin-sdk/directory-live-DK_83362.js +105 -0
- package/dist/plugin-sdk/directory-live-G7AN8y8N.js +88 -0
- package/dist/plugin-sdk/discord.d.ts +91 -1
- package/dist/plugin-sdk/discord.js +71 -3287
- package/dist/plugin-sdk/draft-stream-controls-DGYBMJYc.js +323 -0
- package/dist/plugin-sdk/exec-DQ8j4Fm3.js +230 -0
- package/dist/plugin-sdk/fetch-RV7QDF43.js +68 -0
- package/dist/plugin-sdk/fetch-guard-CxXvFYq5.js +168 -0
- package/dist/plugin-sdk/filesystem-manager-CeSmCA_A.js +188 -0
- package/dist/plugin-sdk/fs-safe-DztQeyQe.js +192 -0
- package/dist/plugin-sdk/group-mentions-DLOOve8d.d.ts +108 -0
- package/dist/plugin-sdk/guilds-n7MMnX1c.js +13 -0
- package/dist/plugin-sdk/handle-action-DkfMckah.js +1450 -0
- package/dist/plugin-sdk/helpers-C1pcZJsv.js +439 -0
- package/dist/plugin-sdk/image-ops-BSQmb-17.js +510 -0
- package/dist/plugin-sdk/index.d.ts +2575 -1
- package/dist/plugin-sdk/index.js +63 -783
- package/dist/plugin-sdk/ip-BkeyFRJr.js +181 -0
- package/dist/plugin-sdk/links-D5ecKoG9.js +74 -0
- package/dist/plugin-sdk/logger-BbFvCoKk.js +48 -0
- package/dist/plugin-sdk/login-YbYyMkkE.js +61 -0
- package/dist/plugin-sdk/login-qr-DvJw8_2g.js +326 -0
- package/dist/plugin-sdk/manager-DQ1dH8OM.js +3792 -0
- package/dist/plugin-sdk/markdown-tables-DrB-IM8r.js +29 -0
- package/dist/plugin-sdk/media-D8pWjqEt.js +1137 -0
- package/dist/plugin-sdk/memory-search-DHSeU4pJ.js +242 -0
- package/dist/plugin-sdk/monitor-B1PUtkd6.js +4539 -0
- package/dist/plugin-sdk/monitor-BrxWsb7H.js +7739 -0
- package/dist/plugin-sdk/openresponses-http-DJ2lfMja.js +923 -0
- package/dist/plugin-sdk/optional-runtime-dependency-Bt_3Yigu.js +41 -0
- package/dist/plugin-sdk/outbound-B5ukMdUv.js +224 -0
- package/dist/plugin-sdk/outbound-attachment-C9oadpUP.js +95 -0
- package/dist/plugin-sdk/pairing-message-B787pcJI.js +293 -0
- package/dist/plugin-sdk/pairing-message-DWXHX-jt.d.ts +46 -0
- package/dist/plugin-sdk/pairing-store-BdOcH_GA.js +437 -0
- package/dist/plugin-sdk/pairing-token-HQpaqod5.js +91 -0
- package/dist/plugin-sdk/path-alias-guards-BlIJ0AmG.js +43 -0
- package/dist/plugin-sdk/pi-embedded-runner-DMfkIj60.js +95517 -0
- package/dist/plugin-sdk/pi-model-discovery-DQdXL_-F.js +134 -0
- package/dist/plugin-sdk/pi-model-discovery-runtime-IwiWDCQ3.js +14 -0
- package/dist/plugin-sdk/probe-CJ6lN-jD.js +41 -0
- package/dist/plugin-sdk/probe-CvXWxzag.js +68 -0
- package/dist/plugin-sdk/probe-DO4M1Qd1.js +109 -0
- package/dist/plugin-sdk/probe-DbhD54Aw.js +89 -0
- package/dist/plugin-sdk/provider-web-search-config-contract.d.ts +42 -1
- package/dist/plugin-sdk/pw-ai-BgsJH_P8.js +1931 -0
- package/dist/plugin-sdk/qmd-manager-D2LMB27z.js +1335 -0
- package/dist/plugin-sdk/query-expansion-BM7lmqaP.js +769 -0
- package/dist/plugin-sdk/replies-BPFt4O-j.js +107 -0
- package/dist/plugin-sdk/reply-prefix-CbPHNXlm.js +171 -0
- package/dist/plugin-sdk/resolve-channels-B-dUtZYa.js +4 -0
- package/dist/plugin-sdk/resolve-channels-sscr14hU.js +208 -0
- package/dist/plugin-sdk/resolve-outbound-target-BP_JscKT.js +40 -0
- package/dist/plugin-sdk/resolve-route-wp5xq4Ws.js +249 -0
- package/dist/plugin-sdk/resolve-users-B63RqPIO.js +118 -0
- package/dist/plugin-sdk/resolve-users-C1sjzEsV.js +125 -0
- package/dist/plugin-sdk/retry-policy-BTH89onl.js +70 -0
- package/dist/plugin-sdk/run-command-i_W6EFb1.d.ts +99 -0
- package/dist/plugin-sdk/runtime-BUpqjZNM.js +6821 -0
- package/dist/plugin-sdk/runtime-dependency-pUwxUAJp.js +2110 -0
- package/dist/plugin-sdk/sandbox-paths-fc-HFGJr.js +158 -0
- package/dist/plugin-sdk/sat-runtime.d.ts +932 -1
- package/dist/plugin-sdk/sat-runtime.js +23 -11815
- package/dist/plugin-sdk/send-CRI83FPV.js +1353 -0
- package/dist/plugin-sdk/send-DGUAXb2b.js +518 -0
- package/dist/plugin-sdk/send-DUp9GIX8.js +329 -0
- package/dist/plugin-sdk/send-DWB5HFdb.js +547 -0
- package/dist/plugin-sdk/send-zn5KBXIN.js +2250 -0
- package/dist/plugin-sdk/session-BLyxz03u.js +175 -0
- package/dist/plugin-sdk/session-key--_1zVBRB.d.ts +17 -0
- package/dist/plugin-sdk/shared-V35XNAbz.js +37 -0
- package/dist/plugin-sdk/skill-commands-DCnCOVR_.js +1514 -0
- package/dist/plugin-sdk/slack-B6lIY1Jk.js +3742 -0
- package/dist/plugin-sdk/slack-actions-Dwy-8Zg7.js +254 -0
- package/dist/plugin-sdk/slack.d.ts +73 -1
- package/dist/plugin-sdk/slack.js +28 -2568
- package/dist/plugin-sdk/ssrf-D_4q0mKh.js +209 -0
- package/dist/plugin-sdk/sticker-cache-D4Ljzv1P.js +170 -0
- package/dist/plugin-sdk/tables-DX84FwPB.js +55 -0
- package/dist/plugin-sdk/tailscale-status-BGBRraZW.js +104 -0
- package/dist/plugin-sdk/targets-BgSHco9b.js +101 -0
- package/dist/plugin-sdk/targets-CuTZl1mO.js +79 -0
- package/dist/plugin-sdk/telegram-actions-tOhBd6st.js +319 -0
- package/dist/plugin-sdk/telegram.d.ts +39 -1
- package/dist/plugin-sdk/telegram.js +26 -2530
- package/dist/plugin-sdk/thread-bindings.lifecycle-DjpMLjhY.js +823 -0
- package/dist/plugin-sdk/thread-bindings.state-DYYR9qeT.js +643 -0
- package/dist/plugin-sdk/tmp-fased-dir-Be1wBhVz.d.ts +77 -0
- package/dist/plugin-sdk/tokens-Do_JU4Rh.js +21 -0
- package/dist/plugin-sdk/types-CBCtqtMn.d.ts +54 -0
- package/dist/plugin-sdk/types-CJGVZX6j.d.ts +1795 -0
- package/dist/plugin-sdk/types-CXLEOrJX.d.ts +3359 -0
- package/dist/plugin-sdk/types.plugin-CvUiB3Kh.d.ts +4959 -0
- package/dist/plugin-sdk/ui-KGr1WRXC.js +33 -0
- package/dist/plugin-sdk/wallet-status-CdxTkLWz.js +11880 -0
- package/dist/plugin-sdk/web-CX12Rpz1.js +2238 -0
- package/dist/plugin-sdk/whatsapp-actions-DISRDbu1.js +92 -0
- package/dist/plugin-sdk/whatsapp-heartbeat-KM3lYpt-.js +70 -0
- package/dist/plugin-sdk/whatsapp.d.ts +239 -1
- package/dist/plugin-sdk/whatsapp.js +29 -2474
- package/dist/plugin-sdk/ws-CxmRDbD9.js +114 -0
- package/dist/plugin-sdk/wsl-Cw-xOsqF.js +554 -0
- package/dist/plugin-sdk/zod-schema.providers-core-BEbNizPe.d.ts +1773 -0
- package/dist/plugins/status-cache.js +112 -0
- package/dist/plugins/status-manifest.js +61 -0
- package/dist/plugins/status.js +23 -2
- package/dist/wizard/onboarding.gateway-config.js +0 -21
- package/extensions/acpx/package.json +1 -1
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/fased-federation/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- package/extensions/matrix/package.json +1 -1
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +2 -2
- package/extensions/memory-lancedb/package.json +1 -1
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +1 -1
- package/extensions/open-prose/package.json +1 -1
- package/extensions/sat-mining/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/synology-chat/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/fased.mjs +29 -1
- package/package.json +6 -4
- package/dist/plugin-sdk/account-helpers-CMvQP0I-.js +0 -38
- package/dist/plugin-sdk/accounts-BJFheJNv.js +0 -62
- package/dist/plugin-sdk/accounts-BRbbLNW_.js +0 -76
- package/dist/plugin-sdk/accounts-BwkH5bTD.js +0 -304
- package/dist/plugin-sdk/accounts-COY-15zJ.js +0 -231
- package/dist/plugin-sdk/accounts-D7_p-Ivb.js +0 -62
- package/dist/plugin-sdk/accounts-DTdM1xcj.js +0 -76
- package/dist/plugin-sdk/accounts-RT6y7n3H.js +0 -304
- package/dist/plugin-sdk/actions-BrU_JMqM.js +0 -149
- package/dist/plugin-sdk/actions-CUdVHzeJ.js +0 -149
- package/dist/plugin-sdk/active-listener-CE8t5g6l.js +0 -37
- package/dist/plugin-sdk/active-listener-Dx1SEGDn.js +0 -37
- package/dist/plugin-sdk/agent-scope-BuTbywla.js +0 -1641
- package/dist/plugin-sdk/agent-scope-kIJqg5PA.js +0 -1641
- package/dist/plugin-sdk/allow-list-C9N6FKeC.js +0 -479
- package/dist/plugin-sdk/allow-list-CBtbuDI8.js +0 -473
- package/dist/plugin-sdk/allow-list-Cgjx0Mc-.js +0 -215
- package/dist/plugin-sdk/audio-preflight-Chxqjwxe.js +0 -96
- package/dist/plugin-sdk/audio-preflight-aupYKWfa.js +0 -96
- package/dist/plugin-sdk/audit-DxB2Kml5.js +0 -78
- package/dist/plugin-sdk/audit-sSeRDwJb.js +0 -78
- package/dist/plugin-sdk/channel-adapters.discord-Chc31YZN.js +0 -35
- package/dist/plugin-sdk/channel-adapters.discord-DXVW1q8n.js +0 -35
- package/dist/plugin-sdk/chat-type-CH3W-zKy.js +0 -11
- package/dist/plugin-sdk/chunk-KCxbJLsV.js +0 -341
- package/dist/plugin-sdk/chunk-M2d7r-Zt.js +0 -341
- package/dist/plugin-sdk/chunk-items-BDhRe_xU.js +0 -34
- package/dist/plugin-sdk/client-DP_eXDIO.js +0 -22
- package/dist/plugin-sdk/client-Dn_01zRN.js +0 -28
- package/dist/plugin-sdk/command-poll-backoff-q0xAK3nQ.js +0 -65
- package/dist/plugin-sdk/commands-registry-CdT-nl7v.js +0 -1337
- package/dist/plugin-sdk/commands-registry-DoWdYAJd.js +0 -1337
- package/dist/plugin-sdk/common-Cpw-vuuM.js +0 -440
- package/dist/plugin-sdk/common-DJWrErdE.js +0 -440
- package/dist/plugin-sdk/config-B6SjJFp-.js +0 -20435
- package/dist/plugin-sdk/config-BULEb5QB.js +0 -19698
- package/dist/plugin-sdk/config-C0qggNKQ.js +0 -20423
- package/dist/plugin-sdk/config-CgwTaper.js +0 -22905
- package/dist/plugin-sdk/config-DLVjQxOu.js +0 -20435
- package/dist/plugin-sdk/config-DgD5T-Ui.js +0 -20656
- package/dist/plugin-sdk/config-DtqAN2L3.js +0 -23249
- package/dist/plugin-sdk/conversation-label-CDH4rKMG.js +0 -36
- package/dist/plugin-sdk/date-time-BtRPVcm7.js +0 -120
- package/dist/plugin-sdk/diagnostic-CuhHqubd.js +0 -282
- package/dist/plugin-sdk/diagnostic-DpyvOvs2.js +0 -275
- package/dist/plugin-sdk/diagnostic-session-state-Zw87xFym.js +0 -59
- package/dist/plugin-sdk/directory-live-8umGGN7a.js +0 -88
- package/dist/plugin-sdk/directory-live-BC7oHcsY.js +0 -105
- package/dist/plugin-sdk/directory-live-BJgud06p.js +0 -105
- package/dist/plugin-sdk/directory-live-BxSH0XXX.js +0 -88
- package/dist/plugin-sdk/draft-stream-controls-Bfbhumzv.js +0 -323
- package/dist/plugin-sdk/draft-stream-controls-v_5gdUYG.js +0 -323
- package/dist/plugin-sdk/draft-stream-loop-B3uUPmuU.js +0 -81
- package/dist/plugin-sdk/extensions/sat-mining/src/config.d.ts +0 -117
- package/dist/plugin-sdk/extensions/sat-mining/src/hash-spec.d.ts +0 -58
- package/dist/plugin-sdk/extensions/sat-mining/src/rpc-read.d.ts +0 -648
- package/dist/plugin-sdk/extensions/sat-mining/src/sat-bond-layout.d.ts +0 -110
- package/dist/plugin-sdk/extensions/sat-mining/src/solana-submit.d.ts +0 -297
- package/dist/plugin-sdk/fetch-D70syO9t.js +0 -68
- package/dist/plugin-sdk/fetch-guard-BLdujDnt.js +0 -163
- package/dist/plugin-sdk/fetch-guard-DTKgMN9f.js +0 -163
- package/dist/plugin-sdk/fetch-headers-my7hgV2G.js +0 -26
- package/dist/plugin-sdk/fetch-timeout-l_6RdoMw.js +0 -43
- package/dist/plugin-sdk/fetch-xfeOsibm.js +0 -68
- package/dist/plugin-sdk/filesystem-manager-BEd8NKL9.js +0 -186
- package/dist/plugin-sdk/filesystem-manager-D-4lQ3Af.js +0 -186
- package/dist/plugin-sdk/fs-safe-BDnJzutp.js +0 -192
- package/dist/plugin-sdk/fs-safe-BPYS6-j1.js +0 -192
- package/dist/plugin-sdk/gateway-registry-w_Z-PHGf.js +0 -58
- package/dist/plugin-sdk/github-copilot-token-Djqpy66R.js +0 -127
- package/dist/plugin-sdk/globals-BtKmaIS3.js +0 -439
- package/dist/plugin-sdk/guilds-BdkvRFue.js +0 -13
- package/dist/plugin-sdk/guilds-DmzO7n0X.js +0 -13
- package/dist/plugin-sdk/guilds-iTYlgBat.js +0 -13
- package/dist/plugin-sdk/handle-action-B61D85yo.js +0 -1445
- package/dist/plugin-sdk/handle-action-CjcxGzQD.js +0 -1445
- package/dist/plugin-sdk/inbound-context-CeJDjLk-.js +0 -68
- package/dist/plugin-sdk/internal-DMTDEiDF.js +0 -247
- package/dist/plugin-sdk/ip-Ddk9SPR-.js +0 -47
- package/dist/plugin-sdk/login-CB_nCjX3.js +0 -61
- package/dist/plugin-sdk/login-CzUuDd1v.js +0 -61
- package/dist/plugin-sdk/login-YveoqEvH.js +0 -268
- package/dist/plugin-sdk/login-qr-D7MEpFza.js +0 -324
- package/dist/plugin-sdk/login-qr-DgxfBFVN.js +0 -324
- package/dist/plugin-sdk/manager-9see0IX5.js +0 -3792
- package/dist/plugin-sdk/manager-D2kZ0Cps.js +0 -3792
- package/dist/plugin-sdk/markdown-tables-CCSD52rA.js +0 -29
- package/dist/plugin-sdk/markdown-tables-DWUNvLrc.js +0 -29
- package/dist/plugin-sdk/media-C7YT4DeU.js +0 -1641
- package/dist/plugin-sdk/media-Cxw-xLGU.js +0 -1641
- package/dist/plugin-sdk/memory-search-B-0Fwnrp.js +0 -242
- package/dist/plugin-sdk/memory-search-J6AYuENR.js +0 -242
- package/dist/plugin-sdk/monitor-38DGeIwS.js +0 -4528
- package/dist/plugin-sdk/monitor-CYCSEVee.js +0 -7743
- package/dist/plugin-sdk/monitor-Ceu-Wayc.js +0 -4528
- package/dist/plugin-sdk/monitor-DCyBaUCs.js +0 -7728
- package/dist/plugin-sdk/openresponses-http-CCfimy89.js +0 -912
- package/dist/plugin-sdk/openresponses-http-DAL_9jE-.js +0 -912
- package/dist/plugin-sdk/optional-runtime-dependency-szS49voX.js +0 -426
- package/dist/plugin-sdk/outbound-BCxOxdi-.js +0 -224
- package/dist/plugin-sdk/outbound-JIwQbpRY.js +0 -224
- package/dist/plugin-sdk/outbound-attachment-C-jSFaEB.js +0 -94
- package/dist/plugin-sdk/outbound-attachment-D6tj5Y5H.js +0 -78
- package/dist/plugin-sdk/path-alias-guards-C76pC928.js +0 -43
- package/dist/plugin-sdk/path-alias-guards-CcQroDXQ.js +0 -43
- package/dist/plugin-sdk/paths-DTurNPnO.js +0 -158
- package/dist/plugin-sdk/paths-GdhK5mV_.js +0 -191
- package/dist/plugin-sdk/pi-embedded-runner-Dum71Tdo.js +0 -107134
- package/dist/plugin-sdk/pi-model-discovery-DadlvsZW.js +0 -134
- package/dist/plugin-sdk/pi-model-discovery-G2L8gMcs.js +0 -22703
- package/dist/plugin-sdk/pi-model-discovery-runtime-BpR1pe7K.js +0 -3
- package/dist/plugin-sdk/pi-model-discovery-runtime-C5ssE6EW.js +0 -127
- package/dist/plugin-sdk/pi-model-discovery-runtime-CQOauapl.js +0 -127
- package/dist/plugin-sdk/pi-model-discovery-runtime-DAaOPt64.js +0 -12
- package/dist/plugin-sdk/pi-model-discovery-runtime-DYfUuqPN.js +0 -127
- package/dist/plugin-sdk/pi-model-discovery-runtime-DyOIGBor.js +0 -127
- package/dist/plugin-sdk/pi-model-discovery-runtime-gd77b0UF.js +0 -12
- package/dist/plugin-sdk/pi-model-discovery-runtime-w4DRRv53.js +0 -128
- package/dist/plugin-sdk/pi-model-discovery-yifTIDIn.js +0 -134
- package/dist/plugin-sdk/polls-D0YNJBfc.js +0 -33
- package/dist/plugin-sdk/probe-0Xt6fbw2.js +0 -109
- package/dist/plugin-sdk/probe-1paqsAk5.js +0 -89
- package/dist/plugin-sdk/probe-BPYqD-cg.js +0 -68
- package/dist/plugin-sdk/probe-Ba4KG8Vi.js +0 -41
- package/dist/plugin-sdk/probe-BfzwvkxZ.js +0 -68
- package/dist/plugin-sdk/probe-CsFmvxbr.js +0 -89
- package/dist/plugin-sdk/probe-Dqx0N4uk.js +0 -109
- package/dist/plugin-sdk/probe-DrTulmwQ.js +0 -41
- package/dist/plugin-sdk/proxy-CV9uL4Wi.js +0 -16
- package/dist/plugin-sdk/pw-ai-SNCI9UXT.js +0 -1926
- package/dist/plugin-sdk/pw-ai-sH1Pi-Fh.js +0 -1926
- package/dist/plugin-sdk/qmd-manager-BfJXNhlO.js +0 -1333
- package/dist/plugin-sdk/qmd-manager-QNVr__Z6.js +0 -1333
- package/dist/plugin-sdk/qmd-scope-Cei2-7Q5.js +0 -78
- package/dist/plugin-sdk/query-expansion-DjJAUtDU.js +0 -769
- package/dist/plugin-sdk/query-expansion-VePrajug.js +0 -769
- package/dist/plugin-sdk/redact-Ck-wgswc.js +0 -188
- package/dist/plugin-sdk/redact-identifier-DdQO7P4_.js +0 -15
- package/dist/plugin-sdk/registry-DNkJsNsz.js +0 -6463
- package/dist/plugin-sdk/replies-fvzN5wnU.js +0 -107
- package/dist/plugin-sdk/replies-zebgZCHX.js +0 -107
- package/dist/plugin-sdk/reply-prefix-DqlCqHXT.js +0 -171
- package/dist/plugin-sdk/reply-prefix-Y14LY6Rn.js +0 -171
- package/dist/plugin-sdk/reply-reference-mUSl_ExV.js +0 -35
- package/dist/plugin-sdk/resolve-channels-CGCkchAo.js +0 -208
- package/dist/plugin-sdk/resolve-channels-CHkzoB7d.js +0 -4
- package/dist/plugin-sdk/resolve-channels-CIoMOUEH.js +0 -88
- package/dist/plugin-sdk/resolve-channels-CU3vZXOG.js +0 -4
- package/dist/plugin-sdk/resolve-channels-J5m_-ZOk.js +0 -208
- package/dist/plugin-sdk/resolve-channels-gIpOj1wt.js +0 -206
- package/dist/plugin-sdk/resolve-route-CNhTJG_2.js +0 -248
- package/dist/plugin-sdk/resolve-route-DO0WR4nB.js +0 -248
- package/dist/plugin-sdk/resolve-users-Bm78yvE3.js +0 -123
- package/dist/plugin-sdk/resolve-users-C0F3LQs2.js +0 -118
- package/dist/plugin-sdk/resolve-users-CTKaESmf.js +0 -116
- package/dist/plugin-sdk/resolve-users-Ct0fO5kP.js +0 -125
- package/dist/plugin-sdk/resolve-users-DlpsBzVS.js +0 -118
- package/dist/plugin-sdk/resolve-users-sv9og6yh.js +0 -125
- package/dist/plugin-sdk/resolve-utils-r6ef8mj8.js +0 -147
- package/dist/plugin-sdk/retry-CB29XXbz.js +0 -780
- package/dist/plugin-sdk/retry-Cq65ROXv.js +0 -77
- package/dist/plugin-sdk/retry-policy-BLYEgIwP.js +0 -70
- package/dist/plugin-sdk/retry-policy-sM01QZT2.js +0 -70
- package/dist/plugin-sdk/run-with-concurrency-CavAFhML.js +0 -42
- package/dist/plugin-sdk/runtime-BPyuAmka.js +0 -6577
- package/dist/plugin-sdk/runtime-dependency-B-1u41Ph.js +0 -2217
- package/dist/plugin-sdk/runtime-dependency-Csswyv5r.js +0 -2217
- package/dist/plugin-sdk/sandbox-paths-CkTERCrj.js +0 -158
- package/dist/plugin-sdk/sandbox-paths-DMnFyOaA.js +0 -158
- package/dist/plugin-sdk/secure-random-DLpYiUzR.js +0 -12
- package/dist/plugin-sdk/send-B09HRfHN.js +0 -1351
- package/dist/plugin-sdk/send-BBYcgXA4.js +0 -546
- package/dist/plugin-sdk/send-BQXQA81e.js +0 -2249
- package/dist/plugin-sdk/send-BzFdvD_i.js +0 -1351
- package/dist/plugin-sdk/send-C3u-F_8s.js +0 -2249
- package/dist/plugin-sdk/send-D3836_UN.js +0 -505
- package/dist/plugin-sdk/send-D7tr-EsH.js +0 -546
- package/dist/plugin-sdk/send-DRGzRdI3.js +0 -518
- package/dist/plugin-sdk/send-DfkPKz_0.js +0 -356
- package/dist/plugin-sdk/send-DsxFXrCO.js +0 -356
- package/dist/plugin-sdk/session-DG_bYisw.js +0 -175
- package/dist/plugin-sdk/session-EIStzK0E.js +0 -175
- package/dist/plugin-sdk/session-key-Bp3qq3bm.js +0 -228
- package/dist/plugin-sdk/skill-commands-CkgGmWBS.js +0 -1600
- package/dist/plugin-sdk/skill-commands-hyZA0LE3.js +0 -1571
- package/dist/plugin-sdk/slack-B0dLDyHM.js +0 -3731
- package/dist/plugin-sdk/slack-Dv4zCw-x.js +0 -3730
- package/dist/plugin-sdk/slack-actions-BQawWGTJ.js +0 -248
- package/dist/plugin-sdk/slack-actions-DDMszx56.js +0 -248
- package/dist/plugin-sdk/src/acp/acpx-mutating-wrapper-policy.d.ts +0 -35
- package/dist/plugin-sdk/src/acp/acpx-push-test-approval-contract.d.ts +0 -62
- package/dist/plugin-sdk/src/acp/acpx-push-test-execution-adapter.d.ts +0 -44
- package/dist/plugin-sdk/src/acp/control-plane/manager.core.d.ts +0 -74
- package/dist/plugin-sdk/src/acp/control-plane/manager.d.ts +0 -7
- package/dist/plugin-sdk/src/acp/control-plane/manager.identity-reconcile.d.ts +0 -23
- package/dist/plugin-sdk/src/acp/control-plane/manager.runtime-controls.d.ts +0 -14
- package/dist/plugin-sdk/src/acp/control-plane/manager.types.d.ts +0 -103
- package/dist/plugin-sdk/src/acp/control-plane/manager.utils.d.ts +0 -14
- package/dist/plugin-sdk/src/acp/control-plane/runtime-cache.d.ts +0 -38
- package/dist/plugin-sdk/src/acp/control-plane/runtime-options.d.ts +0 -23
- package/dist/plugin-sdk/src/acp/control-plane/session-actor-queue.d.ts +0 -8
- package/dist/plugin-sdk/src/acp/control-plane/spawn.d.ts +0 -25
- package/dist/plugin-sdk/src/acp/policy.d.ts +0 -10
- package/dist/plugin-sdk/src/acp/runtime/error-text.d.ts +0 -7
- package/dist/plugin-sdk/src/acp/runtime/errors.d.ts +0 -20
- package/dist/plugin-sdk/src/acp/runtime/registry.d.ts +0 -18
- package/dist/plugin-sdk/src/acp/runtime/session-identifiers.d.ts +0 -17
- package/dist/plugin-sdk/src/acp/runtime/session-identity.d.ts +0 -23
- package/dist/plugin-sdk/src/acp/runtime/session-meta.d.ts +0 -30
- package/dist/plugin-sdk/src/acp/runtime/types.d.ts +0 -102
- package/dist/plugin-sdk/src/acp/status-snapshot.d.ts +0 -54
- package/dist/plugin-sdk/src/agents/acp-spawn-parent-stream.d.ts +0 -20
- package/dist/plugin-sdk/src/agents/acp-spawn.d.ts +0 -39
- package/dist/plugin-sdk/src/agents/agent-model-providers.d.ts +0 -47
- package/dist/plugin-sdk/src/agents/agent-paths.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/agent-scope.d.ts +0 -71
- package/dist/plugin-sdk/src/agents/announce-idempotency.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/anthropic-payload-log.d.ts +0 -20
- package/dist/plugin-sdk/src/agents/api-key-rotation.d.ts +0 -22
- package/dist/plugin-sdk/src/agents/apply-patch-update.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/apply-patch.d.ts +0 -35
- package/dist/plugin-sdk/src/agents/auth-health.d.ts +0 -40
- package/dist/plugin-sdk/src/agents/auth-profiles/constants.d.ts +0 -19
- package/dist/plugin-sdk/src/agents/auth-profiles/display.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/auth-profiles/doctor.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/auth-profiles/external-cli-sync.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/auth-profiles/oauth.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/auth-profiles/order.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/auth-profiles/paths.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/auth-profiles/profiles.d.ts +0 -25
- package/dist/plugin-sdk/src/agents/auth-profiles/repair.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/auth-profiles/session-override.d.ts +0 -19
- package/dist/plugin-sdk/src/agents/auth-profiles/store.d.ts +0 -24
- package/dist/plugin-sdk/src/agents/auth-profiles/types.d.ts +0 -65
- package/dist/plugin-sdk/src/agents/auth-profiles/usage.d.ts +0 -85
- package/dist/plugin-sdk/src/agents/auth-profiles.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/bash-process-registry.d.ts +0 -72
- package/dist/plugin-sdk/src/agents/bash-tools.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/bash-tools.exec-approval-followup.d.ts +0 -12
- package/dist/plugin-sdk/src/agents/bash-tools.exec-approval-request.d.ts +0 -70
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-gateway.d.ts +0 -34
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-node.d.ts +0 -26
- package/dist/plugin-sdk/src/agents/bash-tools.exec-host-shared.d.ts +0 -155
- package/dist/plugin-sdk/src/agents/bash-tools.exec-runtime.d.ts +0 -116
- package/dist/plugin-sdk/src/agents/bash-tools.exec-types.d.ts +0 -76
- package/dist/plugin-sdk/src/agents/bash-tools.exec.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/bash-tools.process.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/bash-tools.shared.d.ts +0 -56
- package/dist/plugin-sdk/src/agents/bootstrap-budget.d.ts +0 -87
- package/dist/plugin-sdk/src/agents/bootstrap-cache.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/bootstrap-files.d.ts +0 -32
- package/dist/plugin-sdk/src/agents/bootstrap-hooks.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/byteplus-models.d.ts +0 -128
- package/dist/plugin-sdk/src/agents/cache-trace.d.ts +0 -49
- package/dist/plugin-sdk/src/agents/channel-tools.d.ts +0 -30
- package/dist/plugin-sdk/src/agents/chutes-models.d.ts +0 -25
- package/dist/plugin-sdk/src/agents/chutes-oauth.d.ts +0 -46
- package/dist/plugin-sdk/src/agents/cli-backends.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/cli-credentials.d.ts +0 -72
- package/dist/plugin-sdk/src/agents/cli-runner/helpers.d.ts +0 -72
- package/dist/plugin-sdk/src/agents/cli-runner/reliability.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/cli-runner.d.ts +0 -42
- package/dist/plugin-sdk/src/agents/cli-session.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/cli-watchdog-defaults.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/cloudflare-ai-gateway.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/command-poll-backoff.d.ts +0 -28
- package/dist/plugin-sdk/src/agents/compaction.d.ts +0 -72
- package/dist/plugin-sdk/src/agents/content-blocks.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/context-window-guard.d.ts +0 -25
- package/dist/plugin-sdk/src/agents/context.d.ts +0 -38
- package/dist/plugin-sdk/src/agents/current-model-catalog.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/current-time.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/date-time.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/defaults.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/docs-path.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/doubao-models.d.ts +0 -128
- package/dist/plugin-sdk/src/agents/embedded-pi-mcp.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/exec-approval-result.d.ts +0 -21
- package/dist/plugin-sdk/src/agents/failover-error.d.ts +0 -33
- package/dist/plugin-sdk/src/agents/fased-tools.d.ts +0 -58
- package/dist/plugin-sdk/src/agents/glob-pattern.d.ts +0 -18
- package/dist/plugin-sdk/src/agents/huggingface-models.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/identity-avatar.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/identity-file.d.ts +0 -12
- package/dist/plugin-sdk/src/agents/identity.d.ts +0 -28
- package/dist/plugin-sdk/src/agents/image-sanitization.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/lanes.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/live-auth-keys.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/mcp-config-shared.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/mcp-http.d.ts +0 -19
- package/dist/plugin-sdk/src/agents/mcp-stdio.d.ts +0 -16
- package/dist/plugin-sdk/src/agents/mcp-transport-config.d.ts +0 -23
- package/dist/plugin-sdk/src/agents/mcp-transport.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/memory-search.d.ts +0 -80
- package/dist/plugin-sdk/src/agents/minimax-vlm.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/model-alias-lines.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/model-auth-label.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/model-auth.d.ts +0 -37
- package/dist/plugin-sdk/src/agents/model-catalog-access.d.ts +0 -30
- package/dist/plugin-sdk/src/agents/model-catalog-normalized.d.ts +0 -27
- package/dist/plugin-sdk/src/agents/model-catalog-source.d.ts +0 -41
- package/dist/plugin-sdk/src/agents/model-catalog-status.d.ts +0 -92
- package/dist/plugin-sdk/src/agents/model-catalog.d.ts +0 -35
- package/dist/plugin-sdk/src/agents/model-compat.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/model-fallback.d.ts +0 -54
- package/dist/plugin-sdk/src/agents/model-forward-compat.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/model-metadata.d.ts +0 -49
- package/dist/plugin-sdk/src/agents/model-ref-profile.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/model-selection.d.ts +0 -130
- package/dist/plugin-sdk/src/agents/models-config.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/models-config.providers.d.ts +0 -40
- package/dist/plugin-sdk/src/agents/opencode-zen-models.d.ts +0 -46
- package/dist/plugin-sdk/src/agents/owner-display.d.ts +0 -19
- package/dist/plugin-sdk/src/agents/payload-redaction.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/pi-auth-credentials.d.ts +0 -16
- package/dist/plugin-sdk/src/agents/pi-bundle-mcp-materialize.d.ts +0 -12
- package/dist/plugin-sdk/src/agents/pi-bundle-mcp-names.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/pi-bundle-mcp-runtime.d.ts +0 -21
- package/dist/plugin-sdk/src/agents/pi-bundle-mcp-tools.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/pi-bundle-mcp-types.d.ts +0 -52
- package/dist/plugin-sdk/src/agents/pi-embedded-block-chunker.d.ts +0 -19
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/bootstrap.d.ts +0 -33
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/errors.d.ts +0 -70
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/google.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/images.d.ts +0 -22
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/messaging-dedupe.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/openai.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/thinking.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/turns.d.ts +0 -21
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers/types.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/pi-embedded-helpers.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/pi-embedded-messaging.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/pi-embedded-payloads.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/abort.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/cache-ttl.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compact.d.ts +0 -57
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/compaction-safety-timeout.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/extensions.d.ts +0 -12
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/extra-params.d.ts +0 -76
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/google.d.ts +0 -42
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/history.d.ts +0 -18
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/lanes.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/logger.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/model.d.ts +0 -30
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/attempt.d.ts +0 -30
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/compaction-timeout.d.ts +0 -20
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/history-image-prune.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/images.d.ts +0 -83
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/llm-idle-timeout.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/params.d.ts +0 -128
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/payloads.d.ts +0 -42
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run/types.d.ts +0 -67
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/run.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/runs.d.ts +0 -32
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/sandbox-info.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/session-manager-cache.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/session-manager-init.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/system-prompt.d.ts +0 -55
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/thinking.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-name-allowlist.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-result-context-guard.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-result-truncation.d.ts +0 -79
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/tool-split.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/types.d.ts +0 -95
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/utils.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/wait-for-idle-before-flush.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/pi-embedded-runner.d.ts +0 -12
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.d.ts +0 -34
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.compaction.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.lifecycle.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.messages.d.ts +0 -16
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.tools.d.ts +0 -18
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.handlers.types.d.ts +0 -152
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.raw-stream.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.tools.d.ts +0 -20
- package/dist/plugin-sdk/src/agents/pi-embedded-subscribe.types.d.ts +0 -45
- package/dist/plugin-sdk/src/agents/pi-embedded-utils.d.ts +0 -42
- package/dist/plugin-sdk/src/agents/pi-embedded.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/pi-extensions/compaction-safeguard-runtime.d.ts +0 -16
- package/dist/plugin-sdk/src/agents/pi-extensions/compaction-safeguard.d.ts +0 -22
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/extension.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/pruner.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/runtime.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/settings.d.ts +0 -44
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning/tools.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/pi-extensions/context-pruning.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/pi-extensions/session-manager-runtime-registry.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/pi-model-discovery-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/pi-model-discovery.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/pi-project-settings.d.ts +0 -28
- package/dist/plugin-sdk/src/agents/pi-settings.d.ts +0 -45
- package/dist/plugin-sdk/src/agents/pi-tool-definition-adapter.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/pi-tools.abort.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/pi-tools.before-tool-call.d.ts +0 -31
- package/dist/plugin-sdk/src/agents/pi-tools.d.ts +0 -84
- package/dist/plugin-sdk/src/agents/pi-tools.policy.d.ts +0 -38
- package/dist/plugin-sdk/src/agents/pi-tools.read.d.ts +0 -61
- package/dist/plugin-sdk/src/agents/pi-tools.schema.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/pi-tools.types.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/prompt-cache-stability.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/provider-attribution.d.ts +0 -70
- package/dist/plugin-sdk/src/agents/provider-auth-aliases.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/provider-extension-catalog-index.d.ts +0 -37
- package/dist/plugin-sdk/src/agents/provider-extension-catalog-manifest.d.ts +0 -29
- package/dist/plugin-sdk/src/agents/provider-id.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/provider-request-config.d.ts +0 -194
- package/dist/plugin-sdk/src/agents/pty-dsr.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/pty-keys.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/queued-file-writer.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/sandbox/backend.d.ts +0 -29
- package/dist/plugin-sdk/src/agents/sandbox/bind-spec.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/sandbox/browser-bridges.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/sandbox/browser.d.ts +0 -12
- package/dist/plugin-sdk/src/agents/sandbox/config-hash.d.ts +0 -18
- package/dist/plugin-sdk/src/agents/sandbox/config.d.ts +0 -32
- package/dist/plugin-sdk/src/agents/sandbox/constants.d.ts +0 -21
- package/dist/plugin-sdk/src/agents/sandbox/context.d.ts +0 -20
- package/dist/plugin-sdk/src/agents/sandbox/docker.d.ts +0 -48
- package/dist/plugin-sdk/src/agents/sandbox/fs-bridge.d.ts +0 -56
- package/dist/plugin-sdk/src/agents/sandbox/fs-paths.d.ts +0 -28
- package/dist/plugin-sdk/src/agents/sandbox/hash.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/sandbox/host-paths.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/sandbox/manage.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/sandbox/network-mode.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/sandbox/novnc-auth.d.ts +0 -15
- package/dist/plugin-sdk/src/agents/sandbox/path-utils.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/sandbox/prune.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/sandbox/registry.d.ts +0 -31
- package/dist/plugin-sdk/src/agents/sandbox/runtime-status.d.ts +0 -18
- package/dist/plugin-sdk/src/agents/sandbox/sanitize-env-vars.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/sandbox/shared.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/sandbox/tool-policy.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/sandbox/types.d.ts +0 -91
- package/dist/plugin-sdk/src/agents/sandbox/types.docker.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/sandbox/validate-sandbox-security.d.ts +0 -68
- package/dist/plugin-sdk/src/agents/sandbox/workspace.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/sandbox-media-paths.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/sandbox-paths.d.ts +0 -24
- package/dist/plugin-sdk/src/agents/sandbox-tool-policy.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/sandbox.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/sanitize-for-prompt.d.ts +0 -21
- package/dist/plugin-sdk/src/agents/schema/clean-for-gemini.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/schema/typebox.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/session-dirs.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/session-file-repair.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/session-slug.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/session-tool-result-guard-wrapper.d.ts +0 -19
- package/dist/plugin-sdk/src/agents/session-tool-result-guard.d.ts +0 -40
- package/dist/plugin-sdk/src/agents/session-transcript-repair.d.ts +0 -34
- package/dist/plugin-sdk/src/agents/session-write-lock.d.ts +0 -54
- package/dist/plugin-sdk/src/agents/shell-utils.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/skills/agent-filter.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/skills/bundled-context.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/skills/bundled-dir.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/skills/config.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/skills/env-overrides.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/skills/filter.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/skills/frontmatter.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/skills/local-loader.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/skills/plugin-skills.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/skills/refresh-state.d.ts +0 -15
- package/dist/plugin-sdk/src/agents/skills/refresh.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/skills/serialize.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/skills/skill-contract.d.ts +0 -27
- package/dist/plugin-sdk/src/agents/skills/source.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/skills/types.d.ts +0 -105
- package/dist/plugin-sdk/src/agents/skills/workspace.d.ts +0 -54
- package/dist/plugin-sdk/src/agents/skills-clawhub.d.ts +0 -150
- package/dist/plugin-sdk/src/agents/skills-install-plan.d.ts +0 -25
- package/dist/plugin-sdk/src/agents/skills-install-trust.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/skills-marketplace-policy.d.ts +0 -29
- package/dist/plugin-sdk/src/agents/skills-marketplace-scan.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/skills-status.d.ts +0 -65
- package/dist/plugin-sdk/src/agents/skills.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/spawned-context.d.ts +0 -30
- package/dist/plugin-sdk/src/agents/stable-stringify.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/subagent-announce-dispatch.d.ts +0 -22
- package/dist/plugin-sdk/src/agents/subagent-announce-output.d.ts +0 -97
- package/dist/plugin-sdk/src/agents/subagent-announce-queue.d.ts +0 -24
- package/dist/plugin-sdk/src/agents/subagent-announce.d.ts +0 -51
- package/dist/plugin-sdk/src/agents/subagent-announce.runtime.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/subagent-depth.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/subagent-lifecycle-events.d.ts +0 -18
- package/dist/plugin-sdk/src/agents/subagent-registry-cleanup.d.ts +0 -25
- package/dist/plugin-sdk/src/agents/subagent-registry-completion.d.ts +0 -15
- package/dist/plugin-sdk/src/agents/subagent-registry-queries.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/subagent-registry-state.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/subagent-registry.d.ts +0 -67
- package/dist/plugin-sdk/src/agents/subagent-registry.store.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/subagent-registry.types.d.ts +0 -62
- package/dist/plugin-sdk/src/agents/subagent-spawn.d.ts +0 -49
- package/dist/plugin-sdk/src/agents/synthetic-models.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/system-prompt-cache-boundary.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/system-prompt-params.d.ts +0 -30
- package/dist/plugin-sdk/src/agents/system-prompt-report.d.ts +0 -22
- package/dist/plugin-sdk/src/agents/system-prompt.d.ts +0 -77
- package/dist/plugin-sdk/src/agents/timeout.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/together-models.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/tool-call-id.d.ts +0 -29
- package/dist/plugin-sdk/src/agents/tool-catalog.d.ts +0 -35
- package/dist/plugin-sdk/src/agents/tool-description-presets.d.ts +0 -15
- package/dist/plugin-sdk/src/agents/tool-description-summary.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/tool-display-common.d.ts +0 -70
- package/dist/plugin-sdk/src/agents/tool-display-config.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/tool-display-exec-shell.d.ts +0 -17
- package/dist/plugin-sdk/src/agents/tool-display-exec.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/tool-display.d.ts +0 -15
- package/dist/plugin-sdk/src/agents/tool-fs-policy.d.ts +0 -21
- package/dist/plugin-sdk/src/agents/tool-images.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/tool-loop-detection.d.ts +0 -55
- package/dist/plugin-sdk/src/agents/tool-mutation.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/tool-policy-match.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/tool-policy-pipeline.d.ts +0 -32
- package/dist/plugin-sdk/src/agents/tool-policy-shared.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/tool-policy.d.ts +0 -35
- package/dist/plugin-sdk/src/agents/tool-summaries.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/tools/agent-step.d.ts +0 -23
- package/dist/plugin-sdk/src/agents/tools/agents-list-tool.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/tools/browser-tool.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/tools/browser-tool.schema.d.ts +0 -50
- package/dist/plugin-sdk/src/agents/tools/canvas-tool.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/tools/common.d.ts +0 -86
- package/dist/plugin-sdk/src/agents/tools/cron-tool.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/tools/diff-view-tool.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/tools/discord-actions-guild.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/tools/discord-actions-messaging.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/tools/discord-actions-moderation-shared.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/tools/discord-actions-moderation.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/tools/discord-actions-presence.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/tools/discord-actions.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/tools/gateway-tool.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/tools/gateway.d.ts +0 -20
- package/dist/plugin-sdk/src/agents/tools/image-tool.d.ts +0 -37
- package/dist/plugin-sdk/src/agents/tools/image-tool.helpers.d.ts +0 -21
- package/dist/plugin-sdk/src/agents/tools/marketplace-offer-draft-tool.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/tools/memory-tool.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/tools/message-tool.d.ts +0 -26
- package/dist/plugin-sdk/src/agents/tools/mining-tool.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/tools/nodes-tool.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/tools/nodes-utils.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/tools/session-status-tool.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/tools/sessions-access.d.ts +0 -42
- package/dist/plugin-sdk/src/agents/tools/sessions-announce-target.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/tools/sessions-helpers.d.ts +0 -54
- package/dist/plugin-sdk/src/agents/tools/sessions-history-tool.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/tools/sessions-list-tool.d.ts +0 -11
- package/dist/plugin-sdk/src/agents/tools/sessions-resolution.d.ts +0 -67
- package/dist/plugin-sdk/src/agents/tools/sessions-send-helpers.d.ts +0 -34
- package/dist/plugin-sdk/src/agents/tools/sessions-send-tool.a2a.d.ts +0 -20
- package/dist/plugin-sdk/src/agents/tools/sessions-send-tool.d.ts +0 -13
- package/dist/plugin-sdk/src/agents/tools/sessions-spawn-tool.d.ts +0 -16
- package/dist/plugin-sdk/src/agents/tools/slack-actions.d.ts +0 -15
- package/dist/plugin-sdk/src/agents/tools/subagents-tool.d.ts +0 -4
- package/dist/plugin-sdk/src/agents/tools/telegram-actions.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/tools/tts-tool.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/tools/wallet-action-tool.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/tools/wallet-skill-policy.d.ts +0 -39
- package/dist/plugin-sdk/src/agents/tools/wallet-tool.d.ts +0 -9
- package/dist/plugin-sdk/src/agents/tools/web-fetch-utils.d.ts +0 -18
- package/dist/plugin-sdk/src/agents/tools/web-fetch-visibility.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/tools/web-fetch.d.ts +0 -25
- package/dist/plugin-sdk/src/agents/tools/web-guarded-fetch.d.ts +0 -12
- package/dist/plugin-sdk/src/agents/tools/web-search.d.ts +0 -148
- package/dist/plugin-sdk/src/agents/tools/web-shared.d.ts +0 -24
- package/dist/plugin-sdk/src/agents/tools/web-tools.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/tools/whatsapp-actions.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/tools/whatsapp-target-auth.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/tools-effective-inventory.d.ts +0 -49
- package/dist/plugin-sdk/src/agents/trace-base.d.ts +0 -10
- package/dist/plugin-sdk/src/agents/transcript-policy.d.ts +0 -25
- package/dist/plugin-sdk/src/agents/usage.d.ts +0 -65
- package/dist/plugin-sdk/src/agents/venice-models.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/volc-models.shared.d.ts +0 -90
- package/dist/plugin-sdk/src/agents/workspace-dir.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/workspace-dirs.d.ts +0 -2
- package/dist/plugin-sdk/src/agents/workspace-run.d.ts +0 -18
- package/dist/plugin-sdk/src/agents/workspace-templates.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/workspace.d.ts +0 -45
- package/dist/plugin-sdk/src/auto-reply/chunk.d.ts +0 -45
- package/dist/plugin-sdk/src/auto-reply/command-auth.d.ts +0 -17
- package/dist/plugin-sdk/src/auto-reply/command-detection.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/commands-args.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/commands-registry.d.ts +0 -55
- package/dist/plugin-sdk/src/auto-reply/commands-registry.data.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/commands-registry.types.d.ts +0 -66
- package/dist/plugin-sdk/src/auto-reply/dispatch.d.ts +0 -32
- package/dist/plugin-sdk/src/auto-reply/envelope.d.ts +0 -58
- package/dist/plugin-sdk/src/auto-reply/fallback-state.d.ts +0 -55
- package/dist/plugin-sdk/src/auto-reply/group-activation.d.ts +0 -6
- package/dist/plugin-sdk/src/auto-reply/heartbeat-reply-payload.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/heartbeat.d.ts +0 -26
- package/dist/plugin-sdk/src/auto-reply/inbound-debounce.d.ts +0 -17
- package/dist/plugin-sdk/src/auto-reply/media-note.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/model-runtime.d.ts +0 -17
- package/dist/plugin-sdk/src/auto-reply/model.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/abort-cutoff.d.ts +0 -28
- package/dist/plugin-sdk/src/auto-reply/reply/abort.d.ts +0 -33
- package/dist/plugin-sdk/src/auto-reply/reply/acp-projector.d.ts +0 -15
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-execution.d.ts +0 -59
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-helpers.d.ts +0 -15
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-memory.d.ts +0 -20
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-payloads.d.ts +0 -27
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-utils.d.ts +0 -148
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner.d.ts +0 -38
- package/dist/plugin-sdk/src/auto-reply/reply/bash-command.d.ts +0 -19
- package/dist/plugin-sdk/src/auto-reply/reply/block-reply-coalescer.d.ts +0 -15
- package/dist/plugin-sdk/src/auto-reply/reply/block-reply-pipeline.d.ts +0 -31
- package/dist/plugin-sdk/src/auto-reply/reply/block-streaming.d.ts +0 -36
- package/dist/plugin-sdk/src/auto-reply/reply/body.d.ts +0 -10
- package/dist/plugin-sdk/src/auto-reply/reply/command-gates.d.ts +0 -18
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/context.d.ts +0 -12
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/diagnostics.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/lifecycle.d.ts +0 -5
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/runtime-options.d.ts +0 -9
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/shared.d.ts +0 -97
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp/targets.d.ts +0 -12
- package/dist/plugin-sdk/src/auto-reply/reply/commands-acp.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/commands-allowlist.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/commands-approve.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/commands-bash.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/commands-compact.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/commands-config.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-context-report.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-context.d.ts +0 -12
- package/dist/plugin-sdk/src/auto-reply/reply/commands-control.d.ts +0 -5
- package/dist/plugin-sdk/src/auto-reply/reply/commands-core.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/commands-export-session.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-info.d.ts +0 -11
- package/dist/plugin-sdk/src/auto-reply/reply/commands-models.d.ts +0 -36
- package/dist/plugin-sdk/src/auto-reply/reply/commands-plugin.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session-abort.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session-store.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/commands-session.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/commands-setunset-standard.d.ts +0 -10
- package/dist/plugin-sdk/src/auto-reply/reply/commands-setunset.d.ts +0 -34
- package/dist/plugin-sdk/src/auto-reply/reply/commands-slash-parse.d.ts +0 -24
- package/dist/plugin-sdk/src/auto-reply/reply/commands-status.d.ts +0 -26
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-agents.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-focus.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-help.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-info.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-kill.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-list.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-log.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-send.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-spawn.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/action-unfocus.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents/shared.d.ts +0 -81
- package/dist/plugin-sdk/src/auto-reply/reply/commands-subagents.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/reply/commands-system-prompt.d.ts +0 -14
- package/dist/plugin-sdk/src/auto-reply/reply/commands-tts.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/commands-types.d.ts +0 -63
- package/dist/plugin-sdk/src/auto-reply/reply/commands.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/reply/config-commands.d.ts +0 -15
- package/dist/plugin-sdk/src/auto-reply/reply/config-value.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/reply/debug-commands.d.ts +0 -16
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.auth.d.ts +0 -19
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.d.ts +0 -6
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.fast-lane.d.ts +0 -7
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.impl.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.levels.d.ts +0 -20
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.model-picker.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.model.d.ts +0 -44
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.params.d.ts +0 -51
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.parse.d.ts +0 -62
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.persist.d.ts +0 -37
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.queue-validation.d.ts +0 -10
- package/dist/plugin-sdk/src/auto-reply/reply/directive-handling.shared.d.ts +0 -28
- package/dist/plugin-sdk/src/auto-reply/reply/directive-parsing.d.ts +0 -5
- package/dist/plugin-sdk/src/auto-reply/reply/directives.d.ts +0 -38
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-acp.d.ts +0 -30
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-from-config.d.ts +0 -16
- package/dist/plugin-sdk/src/auto-reply/reply/dispatcher-registry.d.ts +0 -24
- package/dist/plugin-sdk/src/auto-reply/reply/elevated-allowlist-matcher.d.ts +0 -20
- package/dist/plugin-sdk/src/auto-reply/reply/elevated-unavailable.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/exec/directive.d.ts +0 -20
- package/dist/plugin-sdk/src/auto-reply/reply/exec.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/followup-runner.d.ts +0 -16
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives-apply.d.ts +0 -64
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives-utils.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-directives.d.ts +0 -92
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-inline-actions.d.ts +0 -59
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-run.d.ts +0 -69
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/reply/groups.d.ts +0 -26
- package/dist/plugin-sdk/src/auto-reply/reply/history.d.ts +0 -72
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-context.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-dedupe.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-meta.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-text.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/line-directives.d.ts +0 -22
- package/dist/plugin-sdk/src/auto-reply/reply/memory-flush.d.ts +0 -28
- package/dist/plugin-sdk/src/auto-reply/reply/mentions.d.ts +0 -19
- package/dist/plugin-sdk/src/auto-reply/reply/model-selection.d.ts +0 -67
- package/dist/plugin-sdk/src/auto-reply/reply/normalize-reply.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/origin-routing.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/post-compaction-audit.d.ts +0 -26
- package/dist/plugin-sdk/src/auto-reply/reply/post-compaction-context.d.ts +0 -12
- package/dist/plugin-sdk/src/auto-reply/reply/provider-dispatcher.d.ts +0 -19
- package/dist/plugin-sdk/src/auto-reply/reply/queue/cleanup.d.ts +0 -11
- package/dist/plugin-sdk/src/auto-reply/reply/queue/directive.d.ts +0 -15
- package/dist/plugin-sdk/src/auto-reply/reply/queue/drain.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/queue/enqueue.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/queue/normalize.d.ts +0 -3
- package/dist/plugin-sdk/src/auto-reply/reply/queue/settings.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/queue/state.d.ts +0 -20
- package/dist/plugin-sdk/src/auto-reply/reply/queue/types.d.ts +0 -85
- package/dist/plugin-sdk/src/auto-reply/reply/queue-policy.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/queue.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/reply-delivery.d.ts +0 -27
- package/dist/plugin-sdk/src/auto-reply/reply/reply-directives.d.ts +0 -14
- package/dist/plugin-sdk/src/auto-reply/reply/reply-dispatcher.d.ts +0 -54
- package/dist/plugin-sdk/src/auto-reply/reply/reply-elevated.d.ts +0 -16
- package/dist/plugin-sdk/src/auto-reply/reply/reply-inline.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/reply-payloads.d.ts +0 -27
- package/dist/plugin-sdk/src/auto-reply/reply/reply-reference.d.ts +0 -22
- package/dist/plugin-sdk/src/auto-reply/reply/reply-tags.d.ts +0 -6
- package/dist/plugin-sdk/src/auto-reply/reply/reply-threading.d.ts +0 -9
- package/dist/plugin-sdk/src/auto-reply/reply/response-prefix-template.d.ts +0 -51
- package/dist/plugin-sdk/src/auto-reply/reply/route-reply.d.ts +0 -56
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-model.d.ts +0 -24
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-prompt.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/session-run-accounting.d.ts +0 -12
- package/dist/plugin-sdk/src/auto-reply/reply/session-updates.d.ts +0 -34
- package/dist/plugin-sdk/src/auto-reply/reply/session-usage.d.ts +0 -21
- package/dist/plugin-sdk/src/auto-reply/reply/session.d.ts +0 -26
- package/dist/plugin-sdk/src/auto-reply/reply/stage-sandbox-media.d.ts +0 -9
- package/dist/plugin-sdk/src/auto-reply/reply/streaming-directives.d.ts +0 -10
- package/dist/plugin-sdk/src/auto-reply/reply/strip-inbound-meta.d.ts +0 -27
- package/dist/plugin-sdk/src/auto-reply/reply/subagents-utils.d.ts +0 -27
- package/dist/plugin-sdk/src/auto-reply/reply/typing-mode.d.ts +0 -30
- package/dist/plugin-sdk/src/auto-reply/reply/typing-policy.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/typing.d.ts +0 -18
- package/dist/plugin-sdk/src/auto-reply/reply/untrusted-context.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply.d.ts +0 -6
- package/dist/plugin-sdk/src/auto-reply/send-policy.d.ts +0 -6
- package/dist/plugin-sdk/src/auto-reply/skill-commands.d.ts +0 -19
- package/dist/plugin-sdk/src/auto-reply/status.d.ts +0 -60
- package/dist/plugin-sdk/src/auto-reply/templating.d.ts +0 -161
- package/dist/plugin-sdk/src/auto-reply/thinking.d.ts +0 -16
- package/dist/plugin-sdk/src/auto-reply/tokens.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/tool-meta.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/types.d.ts +0 -85
- package/dist/plugin-sdk/src/brand.d.ts +0 -6
- package/dist/plugin-sdk/src/browser/bridge-auth-registry.d.ts +0 -8
- package/dist/plugin-sdk/src/browser/bridge-server.d.ts +0 -19
- package/dist/plugin-sdk/src/browser/cdp.d.ts +0 -125
- package/dist/plugin-sdk/src/browser/cdp.helpers.d.ts +0 -13
- package/dist/plugin-sdk/src/browser/chrome.d.ts +0 -20
- package/dist/plugin-sdk/src/browser/chrome.executables.d.ts +0 -9
- package/dist/plugin-sdk/src/browser/chrome.profile-decoration.d.ts +0 -10
- package/dist/plugin-sdk/src/browser/client-actions-core.d.ts +0 -142
- package/dist/plugin-sdk/src/browser/client-actions-observe.d.ts +0 -68
- package/dist/plugin-sdk/src/browser/client-actions-state.d.ts +0 -90
- package/dist/plugin-sdk/src/browser/client-actions-types.d.ts +0 -18
- package/dist/plugin-sdk/src/browser/client-actions-url.d.ts +0 -2
- package/dist/plugin-sdk/src/browser/client-actions.d.ts +0 -4
- package/dist/plugin-sdk/src/browser/client-fetch.d.ts +0 -20
- package/dist/plugin-sdk/src/browser/client.d.ts +0 -147
- package/dist/plugin-sdk/src/browser/config.d.ts +0 -43
- package/dist/plugin-sdk/src/browser/constants.d.ts +0 -8
- package/dist/plugin-sdk/src/browser/control-auth.d.ts +0 -13
- package/dist/plugin-sdk/src/browser/control-service.d.ts +0 -5
- package/dist/plugin-sdk/src/browser/csrf.d.ts +0 -8
- package/dist/plugin-sdk/src/browser/extension-relay-auth.d.ts +0 -8
- package/dist/plugin-sdk/src/browser/extension-relay.d.ts +0 -15
- package/dist/plugin-sdk/src/browser/form-fields.d.ts +0 -8
- package/dist/plugin-sdk/src/browser/http-auth.d.ts +0 -5
- package/dist/plugin-sdk/src/browser/navigation-guard.d.ts +0 -21
- package/dist/plugin-sdk/src/browser/paths.d.ts +0 -61
- package/dist/plugin-sdk/src/browser/profiles-service.d.ts +0 -25
- package/dist/plugin-sdk/src/browser/profiles.d.ts +0 -30
- package/dist/plugin-sdk/src/browser/proxy-files.d.ts +0 -7
- package/dist/plugin-sdk/src/browser/pw-ai-module.d.ts +0 -6
- package/dist/plugin-sdk/src/browser/pw-ai-state.d.ts +0 -2
- package/dist/plugin-sdk/src/browser/pw-ai.d.ts +0 -2
- package/dist/plugin-sdk/src/browser/pw-role-snapshot.d.ts +0 -35
- package/dist/plugin-sdk/src/browser/pw-session.d.ts +0 -162
- package/dist/plugin-sdk/src/browser/pw-tools-core.activity.d.ts +0 -21
- package/dist/plugin-sdk/src/browser/pw-tools-core.d.ts +0 -8
- package/dist/plugin-sdk/src/browser/pw-tools-core.downloads.d.ts +0 -34
- package/dist/plugin-sdk/src/browser/pw-tools-core.interactions.d.ts +0 -114
- package/dist/plugin-sdk/src/browser/pw-tools-core.responses.d.ts +0 -13
- package/dist/plugin-sdk/src/browser/pw-tools-core.shared.d.ts +0 -6
- package/dist/plugin-sdk/src/browser/pw-tools-core.snapshot.d.ts +0 -66
- package/dist/plugin-sdk/src/browser/pw-tools-core.state.d.ts +0 -46
- package/dist/plugin-sdk/src/browser/pw-tools-core.storage.d.ts +0 -47
- package/dist/plugin-sdk/src/browser/pw-tools-core.trace.d.ts +0 -12
- package/dist/plugin-sdk/src/browser/resolved-config-refresh.d.ts +0 -12
- package/dist/plugin-sdk/src/browser/routes/agent.act.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/agent.act.download.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/agent.act.hooks.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/agent.act.shared.d.ts +0 -10
- package/dist/plugin-sdk/src/browser/routes/agent.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/agent.debug.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/agent.shared.d.ts +0 -37
- package/dist/plugin-sdk/src/browser/routes/agent.snapshot.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/agent.storage.d.ts +0 -14
- package/dist/plugin-sdk/src/browser/routes/basic.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/dispatcher.d.ts +0 -16
- package/dist/plugin-sdk/src/browser/routes/index.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/output-paths.d.ts +0 -10
- package/dist/plugin-sdk/src/browser/routes/path-output.d.ts +0 -1
- package/dist/plugin-sdk/src/browser/routes/tabs.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/routes/types.d.ts +0 -20
- package/dist/plugin-sdk/src/browser/routes/utils.d.ts +0 -15
- package/dist/plugin-sdk/src/browser/runtime-dependency.d.ts +0 -3
- package/dist/plugin-sdk/src/browser/screenshot.d.ts +0 -9
- package/dist/plugin-sdk/src/browser/server-context.d.ts +0 -4
- package/dist/plugin-sdk/src/browser/server-context.types.d.ts +0 -65
- package/dist/plugin-sdk/src/browser/server-lifecycle.d.ts +0 -10
- package/dist/plugin-sdk/src/browser/server-middleware.d.ts +0 -6
- package/dist/plugin-sdk/src/browser/target-id.d.ts +0 -11
- package/dist/plugin-sdk/src/browser/trash.d.ts +0 -1
- package/dist/plugin-sdk/src/canvas-host/a2ui.d.ts +0 -6
- package/dist/plugin-sdk/src/canvas-host/file-resolver.d.ts +0 -3
- package/dist/plugin-sdk/src/canvas-host/server.d.ts +0 -36
- package/dist/plugin-sdk/src/channel-web.d.ts +0 -6
- package/dist/plugin-sdk/src/channels/account-snapshot-fields.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/account-summary.d.ts +0 -17
- package/dist/plugin-sdk/src/channels/ack-reactions.d.ts +0 -29
- package/dist/plugin-sdk/src/channels/allow-from.d.ts +0 -16
- package/dist/plugin-sdk/src/channels/allowlist-match.d.ts +0 -16
- package/dist/plugin-sdk/src/channels/allowlists/resolve-utils.d.ts +0 -33
- package/dist/plugin-sdk/src/channels/channel-config.d.ts +0 -39
- package/dist/plugin-sdk/src/channels/chat-type.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/command-gating.d.ts +0 -20
- package/dist/plugin-sdk/src/channels/conversation-label.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/dock.d.ts +0 -25
- package/dist/plugin-sdk/src/channels/draft-stream-controls.d.ts +0 -54
- package/dist/plugin-sdk/src/channels/draft-stream-loop.d.ts +0 -13
- package/dist/plugin-sdk/src/channels/ids.d.ts +0 -9
- package/dist/plugin-sdk/src/channels/location.d.ts +0 -21
- package/dist/plugin-sdk/src/channels/logging.d.ts +0 -20
- package/dist/plugin-sdk/src/channels/mention-gating.d.ts +0 -27
- package/dist/plugin-sdk/src/channels/model-overrides.d.ts +0 -18
- package/dist/plugin-sdk/src/channels/plugins/account-action-gate.d.ts +0 -5
- package/dist/plugin-sdk/src/channels/plugins/account-helpers.d.ts +0 -6
- package/dist/plugin-sdk/src/channels/plugins/actions/discord/handle-action.d.ts +0 -3
- package/dist/plugin-sdk/src/channels/plugins/actions/discord/handle-action.guild-admin.d.ts +0 -9
- package/dist/plugin-sdk/src/channels/plugins/actions/discord.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/actions/shared.d.ts +0 -7
- package/dist/plugin-sdk/src/channels/plugins/actions/signal.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/actions/telegram.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/agent-tools/whatsapp-login.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/allowlist-match.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/bluebubbles-actions.d.ts +0 -48
- package/dist/plugin-sdk/src/channels/plugins/catalog.d.ts +0 -50
- package/dist/plugin-sdk/src/channels/plugins/channel-config.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/config-helpers.d.ts +0 -14
- package/dist/plugin-sdk/src/channels/plugins/config-schema.d.ts +0 -3
- package/dist/plugin-sdk/src/channels/plugins/config-writes.d.ts +0 -7
- package/dist/plugin-sdk/src/channels/plugins/directory-config.d.ts +0 -16
- package/dist/plugin-sdk/src/channels/plugins/group-mentions.d.ts +0 -18
- package/dist/plugin-sdk/src/channels/plugins/helpers.d.ts +0 -8
- package/dist/plugin-sdk/src/channels/plugins/index.d.ts +0 -8
- package/dist/plugin-sdk/src/channels/plugins/media-limits.d.ts +0 -9
- package/dist/plugin-sdk/src/channels/plugins/media-payload.d.ts +0 -15
- package/dist/plugin-sdk/src/channels/plugins/message-action-names.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/message-actions.d.ts +0 -15
- package/dist/plugin-sdk/src/channels/plugins/normalize/discord.d.ts +0 -14
- package/dist/plugin-sdk/src/channels/plugins/normalize/imessage.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/normalize/shared.d.ts +0 -6
- package/dist/plugin-sdk/src/channels/plugins/normalize/signal.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/normalize/slack.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/normalize/telegram.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/normalize/whatsapp.d.ts +0 -3
- package/dist/plugin-sdk/src/channels/plugins/onboarding/channel-access-configure.d.ts +0 -21
- package/dist/plugin-sdk/src/channels/plugins/onboarding/channel-access.d.ts +0 -31
- package/dist/plugin-sdk/src/channels/plugins/onboarding/discord.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/onboarding/helpers.d.ts +0 -177
- package/dist/plugin-sdk/src/channels/plugins/onboarding/imessage.d.ts +0 -6
- package/dist/plugin-sdk/src/channels/plugins/onboarding/signal.d.ts +0 -7
- package/dist/plugin-sdk/src/channels/plugins/onboarding/slack.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/onboarding/telegram.d.ts +0 -4
- package/dist/plugin-sdk/src/channels/plugins/onboarding/whatsapp.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/onboarding-types.d.ts +0 -149
- package/dist/plugin-sdk/src/channels/plugins/outbound/load.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/pairing-message.d.ts +0 -1
- package/dist/plugin-sdk/src/channels/plugins/pairing.d.ts +0 -16
- package/dist/plugin-sdk/src/channels/plugins/registry-loader.d.ts +0 -5
- package/dist/plugin-sdk/src/channels/plugins/setup-helpers.d.ts +0 -21
- package/dist/plugin-sdk/src/channels/plugins/status-issues/bluebubbles.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/status-issues/discord.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/status-issues/shared.d.ts +0 -29
- package/dist/plugin-sdk/src/channels/plugins/status-issues/telegram.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/status-issues/whatsapp.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/types.adapters.d.ts +0 -294
- package/dist/plugin-sdk/src/channels/plugins/types.core.d.ts +0 -357
- package/dist/plugin-sdk/src/channels/plugins/types.d.ts +0 -6
- package/dist/plugin-sdk/src/channels/plugins/types.plugin.d.ts +0 -54
- package/dist/plugin-sdk/src/channels/plugins/whatsapp-heartbeat.d.ts +0 -11
- package/dist/plugin-sdk/src/channels/plugins/whatsapp-shared.d.ts +0 -5
- package/dist/plugin-sdk/src/channels/registry.d.ts +0 -12
- package/dist/plugin-sdk/src/channels/reply-prefix.d.ts +0 -24
- package/dist/plugin-sdk/src/channels/sender-label.d.ts +0 -9
- package/dist/plugin-sdk/src/channels/session.d.ts +0 -18
- package/dist/plugin-sdk/src/channels/status-reactions.d.ts +0 -62
- package/dist/plugin-sdk/src/channels/targets.d.ts +0 -42
- package/dist/plugin-sdk/src/channels/telegram/allow-from.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/telegram/api.d.ts +0 -5
- package/dist/plugin-sdk/src/channels/thread-bindings-messages.d.ts +0 -19
- package/dist/plugin-sdk/src/channels/thread-bindings-policy.d.ts +0 -68
- package/dist/plugin-sdk/src/channels/typing-lifecycle.d.ts +0 -12
- package/dist/plugin-sdk/src/channels/typing-start-guard.d.ts +0 -13
- package/dist/plugin-sdk/src/channels/typing.d.ts +0 -18
- package/dist/plugin-sdk/src/channels/web/index.d.ts +0 -1
- package/dist/plugin-sdk/src/cli/argv.d.ts +0 -17
- package/dist/plugin-sdk/src/cli/banner.d.ts +0 -11
- package/dist/plugin-sdk/src/cli/cli-name.d.ts +0 -3
- package/dist/plugin-sdk/src/cli/cli-utils.d.ts +0 -19
- package/dist/plugin-sdk/src/cli/command-format.d.ts +0 -1
- package/dist/plugin-sdk/src/cli/deps.d.ts +0 -18
- package/dist/plugin-sdk/src/cli/help-format.d.ts +0 -5
- package/dist/plugin-sdk/src/cli/memory-cli.d.ts +0 -21
- package/dist/plugin-sdk/src/cli/nodes-camera.d.ts +0 -38
- package/dist/plugin-sdk/src/cli/nodes-canvas.d.ts +0 -10
- package/dist/plugin-sdk/src/cli/nodes-media-utils.d.ts +0 -13
- package/dist/plugin-sdk/src/cli/nodes-run.d.ts +0 -3
- package/dist/plugin-sdk/src/cli/nodes-screen.d.ts +0 -18
- package/dist/plugin-sdk/src/cli/outbound-send-deps.d.ts +0 -4
- package/dist/plugin-sdk/src/cli/outbound-send-mapping.d.ts +0 -10
- package/dist/plugin-sdk/src/cli/parse-bytes.d.ts +0 -4
- package/dist/plugin-sdk/src/cli/parse-duration.d.ts +0 -4
- package/dist/plugin-sdk/src/cli/parse-timeout.d.ts +0 -1
- package/dist/plugin-sdk/src/cli/profile-utils.d.ts +0 -2
- package/dist/plugin-sdk/src/cli/progress.d.ts +0 -24
- package/dist/plugin-sdk/src/cli/prompt.d.ts +0 -1
- package/dist/plugin-sdk/src/cli/wait.d.ts +0 -1
- package/dist/plugin-sdk/src/commands/agent/attempt.d.ts +0 -39
- package/dist/plugin-sdk/src/commands/agent/delivery.d.ts +0 -21
- package/dist/plugin-sdk/src/commands/agent/lifecycle.d.ts +0 -17
- package/dist/plugin-sdk/src/commands/agent/run-context.d.ts +0 -2
- package/dist/plugin-sdk/src/commands/agent/session-store.d.ts +0 -17
- package/dist/plugin-sdk/src/commands/agent/session.d.ts +0 -33
- package/dist/plugin-sdk/src/commands/agent/strict-agentic-contract.d.ts +0 -44
- package/dist/plugin-sdk/src/commands/agent/types.d.ts +0 -77
- package/dist/plugin-sdk/src/commands/agent.d.ts +0 -7
- package/dist/plugin-sdk/src/commands/agents.config.d.ts +0 -42
- package/dist/plugin-sdk/src/commands/channel-account-context.d.ts +0 -10
- package/dist/plugin-sdk/src/commands/cleanup-utils.d.ts +0 -37
- package/dist/plugin-sdk/src/commands/daemon-runtime.d.ts +0 -8
- package/dist/plugin-sdk/src/commands/gateway-presence.d.ts +0 -7
- package/dist/plugin-sdk/src/commands/health.d.ts +0 -74
- package/dist/plugin-sdk/src/commands/hosted-dashboard-probe.d.ts +0 -40
- package/dist/plugin-sdk/src/commands/oauth-flow.d.ts +0 -21
- package/dist/plugin-sdk/src/commands/onboard-helpers.d.ts +0 -84
- package/dist/plugin-sdk/src/commands/onboard-types.d.ts +0 -119
- package/dist/plugin-sdk/src/commands/signal-install.d.ts +0 -30
- package/dist/plugin-sdk/src/commands/status-all/agents.d.ts +0 -16
- package/dist/plugin-sdk/src/commands/status-all/channels.d.ts +0 -19
- package/dist/plugin-sdk/src/commands/status-all/diagnosis.d.ts +0 -62
- package/dist/plugin-sdk/src/commands/status-all/format.d.ts +0 -7
- package/dist/plugin-sdk/src/commands/status-all/gateway.d.ts +0 -5
- package/dist/plugin-sdk/src/commands/status-all/report-lines.d.ts +0 -44
- package/dist/plugin-sdk/src/commands/status-all.d.ts +0 -4
- package/dist/plugin-sdk/src/commands/status.acpx-bridge.d.ts +0 -19
- package/dist/plugin-sdk/src/commands/status.agent-local.d.ts +0 -16
- package/dist/plugin-sdk/src/commands/status.command.d.ts +0 -9
- package/dist/plugin-sdk/src/commands/status.d.ts +0 -3
- package/dist/plugin-sdk/src/commands/status.daemon.d.ts +0 -9
- package/dist/plugin-sdk/src/commands/status.format.d.ts +0 -12
- package/dist/plugin-sdk/src/commands/status.gateway-probe.d.ts +0 -6
- package/dist/plugin-sdk/src/commands/status.link-channel.d.ts +0 -10
- package/dist/plugin-sdk/src/commands/status.scan.d.ts +0 -46
- package/dist/plugin-sdk/src/commands/status.strict-agentic.d.ts +0 -18
- package/dist/plugin-sdk/src/commands/status.summary.d.ts +0 -5
- package/dist/plugin-sdk/src/commands/status.types.d.ts +0 -67
- package/dist/plugin-sdk/src/commands/status.update.d.ts +0 -23
- package/dist/plugin-sdk/src/commands/text-format.d.ts +0 -1
- package/dist/plugin-sdk/src/commands/wallet.d.ts +0 -300
- package/dist/plugin-sdk/src/commands/xai-oauth.d.ts +0 -17
- package/dist/plugin-sdk/src/config/agent-dirs.d.ts +0 -14
- package/dist/plugin-sdk/src/config/agent-limits.d.ts +0 -6
- package/dist/plugin-sdk/src/config/backup-rotation.d.ts +0 -5
- package/dist/plugin-sdk/src/config/cache-utils.d.ts +0 -6
- package/dist/plugin-sdk/src/config/channel-capabilities.d.ts +0 -6
- package/dist/plugin-sdk/src/config/commands.d.ts +0 -25
- package/dist/plugin-sdk/src/config/config-paths.d.ts +0 -10
- package/dist/plugin-sdk/src/config/config.d.ts +0 -7
- package/dist/plugin-sdk/src/config/dangerous-name-matching.d.ts +0 -12
- package/dist/plugin-sdk/src/config/defaults.d.ts +0 -19
- package/dist/plugin-sdk/src/config/discord-preview-streaming.d.ts +0 -25
- package/dist/plugin-sdk/src/config/env-preserve.d.ts +0 -10
- package/dist/plugin-sdk/src/config/env-substitution.d.ts +0 -36
- package/dist/plugin-sdk/src/config/env-vars.d.ts +0 -6
- package/dist/plugin-sdk/src/config/group-policy.d.ts +0 -49
- package/dist/plugin-sdk/src/config/includes-scan.d.ts +0 -4
- package/dist/plugin-sdk/src/config/includes.d.ts +0 -43
- package/dist/plugin-sdk/src/config/io.d.ts +0 -63
- package/dist/plugin-sdk/src/config/legacy-migrate.d.ts +0 -5
- package/dist/plugin-sdk/src/config/legacy.d.ts +0 -6
- package/dist/plugin-sdk/src/config/legacy.migrations.d.ts +0 -1
- package/dist/plugin-sdk/src/config/legacy.migrations.part-1.d.ts +0 -2
- package/dist/plugin-sdk/src/config/legacy.migrations.part-2.d.ts +0 -2
- package/dist/plugin-sdk/src/config/legacy.migrations.part-3.d.ts +0 -2
- package/dist/plugin-sdk/src/config/legacy.rules.d.ts +0 -2
- package/dist/plugin-sdk/src/config/legacy.shared.d.ts +0 -19
- package/dist/plugin-sdk/src/config/markdown-tables.d.ts +0 -7
- package/dist/plugin-sdk/src/config/merge-config.d.ts +0 -7
- package/dist/plugin-sdk/src/config/merge-patch.d.ts +0 -5
- package/dist/plugin-sdk/src/config/model-input.d.ts +0 -11
- package/dist/plugin-sdk/src/config/normalize-exec-safe-bin.d.ts +0 -2
- package/dist/plugin-sdk/src/config/normalize-paths.d.ts +0 -8
- package/dist/plugin-sdk/src/config/paths.d.ts +0 -57
- package/dist/plugin-sdk/src/config/plugin-auto-enable.d.ts +0 -15
- package/dist/plugin-sdk/src/config/plugins-allowlist.d.ts +0 -12
- package/dist/plugin-sdk/src/config/port-defaults.d.ts +0 -13
- package/dist/plugin-sdk/src/config/prototype-keys.d.ts +0 -1
- package/dist/plugin-sdk/src/config/runtime-group-policy.d.ts +0 -56
- package/dist/plugin-sdk/src/config/runtime-overrides.d.ts +0 -15
- package/dist/plugin-sdk/src/config/sat-runtime-ids.d.ts +0 -23
- package/dist/plugin-sdk/src/config/sessions/artifacts.d.ts +0 -6
- package/dist/plugin-sdk/src/config/sessions/delivery-info.d.ts +0 -16
- package/dist/plugin-sdk/src/config/sessions/disk-budget.d.ts +0 -28
- package/dist/plugin-sdk/src/config/sessions/group.d.ts +0 -11
- package/dist/plugin-sdk/src/config/sessions/main-session.d.ts +0 -43
- package/dist/plugin-sdk/src/config/sessions/metadata.d.ts +0 -16
- package/dist/plugin-sdk/src/config/sessions/paths.d.ts +0 -21
- package/dist/plugin-sdk/src/config/sessions/reset.d.ts +0 -43
- package/dist/plugin-sdk/src/config/sessions/session-file.d.ts +0 -15
- package/dist/plugin-sdk/src/config/sessions/session-key.d.ts +0 -8
- package/dist/plugin-sdk/src/config/sessions/store.d.ts +0 -124
- package/dist/plugin-sdk/src/config/sessions/transcript.d.ts +0 -32
- package/dist/plugin-sdk/src/config/sessions/types.d.ts +0 -273
- package/dist/plugin-sdk/src/config/sessions.d.ts +0 -13
- package/dist/plugin-sdk/src/config/talk.d.ts +0 -22
- package/dist/plugin-sdk/src/config/telegram-custom-commands.d.ts +0 -24
- package/dist/plugin-sdk/src/config/types.acp.d.ts +0 -28
- package/dist/plugin-sdk/src/config/types.agent-defaults.d.ts +0 -322
- package/dist/plugin-sdk/src/config/types.agents-shared.d.ts +0 -53
- package/dist/plugin-sdk/src/config/types.agents.d.ts +0 -71
- package/dist/plugin-sdk/src/config/types.approvals.d.ts +0 -26
- package/dist/plugin-sdk/src/config/types.auth.d.ts +0 -34
- package/dist/plugin-sdk/src/config/types.base.d.ts +0 -227
- package/dist/plugin-sdk/src/config/types.browser.d.ts +0 -65
- package/dist/plugin-sdk/src/config/types.channel-messaging-common.d.ts +0 -44
- package/dist/plugin-sdk/src/config/types.channels.d.ts +0 -53
- package/dist/plugin-sdk/src/config/types.cron.d.ts +0 -26
- package/dist/plugin-sdk/src/config/types.d.ts +0 -35
- package/dist/plugin-sdk/src/config/types.discord.d.ts +0 -283
- package/dist/plugin-sdk/src/config/types.fased.d.ts +0 -134
- package/dist/plugin-sdk/src/config/types.federation.d.ts +0 -319
- package/dist/plugin-sdk/src/config/types.gateway.d.ts +0 -313
- package/dist/plugin-sdk/src/config/types.googlechat.d.ts +0 -110
- package/dist/plugin-sdk/src/config/types.hooks.d.ts +0 -141
- package/dist/plugin-sdk/src/config/types.imessage.d.ts +0 -77
- package/dist/plugin-sdk/src/config/types.installs.d.ts +0 -36
- package/dist/plugin-sdk/src/config/types.irc.d.ts +0 -54
- package/dist/plugin-sdk/src/config/types.mcp.d.ts +0 -5
- package/dist/plugin-sdk/src/config/types.memory.d.ts +0 -59
- package/dist/plugin-sdk/src/config/types.messages.d.ts +0 -151
- package/dist/plugin-sdk/src/config/types.models.d.ts +0 -70
- package/dist/plugin-sdk/src/config/types.msteams.d.ts +0 -110
- package/dist/plugin-sdk/src/config/types.node-host.d.ts +0 -10
- package/dist/plugin-sdk/src/config/types.plugins.d.ts +0 -48
- package/dist/plugin-sdk/src/config/types.queue.d.ts +0 -14
- package/dist/plugin-sdk/src/config/types.sandbox.d.ts +0 -97
- package/dist/plugin-sdk/src/config/types.secrets.d.ts +0 -67
- package/dist/plugin-sdk/src/config/types.signal.d.ts +0 -46
- package/dist/plugin-sdk/src/config/types.skills.d.ts +0 -47
- package/dist/plugin-sdk/src/config/types.slack.d.ts +0 -181
- package/dist/plugin-sdk/src/config/types.telegram.d.ts +0 -199
- package/dist/plugin-sdk/src/config/types.tools.d.ts +0 -637
- package/dist/plugin-sdk/src/config/types.tts.d.ts +0 -78
- package/dist/plugin-sdk/src/config/types.wallet.d.ts +0 -88
- package/dist/plugin-sdk/src/config/types.whatsapp.d.ts +0 -101
- package/dist/plugin-sdk/src/config/validation.d.ts +0 -37
- package/dist/plugin-sdk/src/config/version.d.ts +0 -9
- package/dist/plugin-sdk/src/config/zod-schema.agent-defaults.d.ts +0 -308
- package/dist/plugin-sdk/src/config/zod-schema.agent-model.d.ts +0 -24
- package/dist/plugin-sdk/src/config/zod-schema.agent-runtime.d.ts +0 -1439
- package/dist/plugin-sdk/src/config/zod-schema.agents.d.ts +0 -621
- package/dist/plugin-sdk/src/config/zod-schema.allowdeny.d.ts +0 -13
- package/dist/plugin-sdk/src/config/zod-schema.approvals.d.ts +0 -15
- package/dist/plugin-sdk/src/config/zod-schema.channels.d.ts +0 -6
- package/dist/plugin-sdk/src/config/zod-schema.core.d.ts +0 -926
- package/dist/plugin-sdk/src/config/zod-schema.d.ts +0 -4763
- package/dist/plugin-sdk/src/config/zod-schema.hooks.d.ts +0 -83
- package/dist/plugin-sdk/src/config/zod-schema.installs.d.ts +0 -38
- package/dist/plugin-sdk/src/config/zod-schema.providers-core.d.ts +0 -3785
- package/dist/plugin-sdk/src/config/zod-schema.providers-whatsapp.d.ts +0 -235
- package/dist/plugin-sdk/src/config/zod-schema.providers.d.ts +0 -2261
- package/dist/plugin-sdk/src/config/zod-schema.sensitive.d.ts +0 -2
- package/dist/plugin-sdk/src/config/zod-schema.session.d.ts +0 -237
- package/dist/plugin-sdk/src/context-engine/types.d.ts +0 -6
- package/dist/plugin-sdk/src/cron/access-block.d.ts +0 -22
- package/dist/plugin-sdk/src/cron/delivery.d.ts +0 -10
- package/dist/plugin-sdk/src/cron/graph-context.d.ts +0 -45
- package/dist/plugin-sdk/src/cron/legacy-delivery.d.ts +0 -3
- package/dist/plugin-sdk/src/cron/normalize.d.ts +0 -9
- package/dist/plugin-sdk/src/cron/parse.d.ts +0 -1
- package/dist/plugin-sdk/src/cron/payload-migration.d.ts +0 -3
- package/dist/plugin-sdk/src/cron/run-detail-format.d.ts +0 -28
- package/dist/plugin-sdk/src/cron/run-detail.d.ts +0 -95
- package/dist/plugin-sdk/src/cron/run-log.d.ts +0 -65
- package/dist/plugin-sdk/src/cron/schedule.d.ts +0 -2
- package/dist/plugin-sdk/src/cron/service/jobs.d.ts +0 -23
- package/dist/plugin-sdk/src/cron/service/locked.d.ts +0 -2
- package/dist/plugin-sdk/src/cron/service/normalize.d.ts +0 -18
- package/dist/plugin-sdk/src/cron/service/ops.d.ts +0 -152
- package/dist/plugin-sdk/src/cron/service/run-lease.d.ts +0 -15
- package/dist/plugin-sdk/src/cron/service/state.d.ts +0 -154
- package/dist/plugin-sdk/src/cron/service/store.d.ts +0 -9
- package/dist/plugin-sdk/src/cron/service/timeout-policy.d.ts +0 -13
- package/dist/plugin-sdk/src/cron/service/timer.d.ts +0 -80
- package/dist/plugin-sdk/src/cron/service.d.ts +0 -122
- package/dist/plugin-sdk/src/cron/session-reaper.d.ts +0 -35
- package/dist/plugin-sdk/src/cron/stagger.d.ts +0 -8
- package/dist/plugin-sdk/src/cron/store.d.ts +0 -6
- package/dist/plugin-sdk/src/cron/task-adaptive-routing.d.ts +0 -21
- package/dist/plugin-sdk/src/cron/task-evaluator.d.ts +0 -28
- package/dist/plugin-sdk/src/cron/task-model-roles.d.ts +0 -21
- package/dist/plugin-sdk/src/cron/task-planner.d.ts +0 -37
- package/dist/plugin-sdk/src/cron/task-run-queue.d.ts +0 -270
- package/dist/plugin-sdk/src/cron/trusted-sources.d.ts +0 -28
- package/dist/plugin-sdk/src/cron/types.d.ts +0 -673
- package/dist/plugin-sdk/src/cron/webhook-url.d.ts +0 -1
- package/dist/plugin-sdk/src/daemon/arg-split.d.ts +0 -4
- package/dist/plugin-sdk/src/daemon/cmd-argv.d.ts +0 -3
- package/dist/plugin-sdk/src/daemon/cmd-set.d.ts +0 -7
- package/dist/plugin-sdk/src/daemon/constants.d.ts +0 -63
- package/dist/plugin-sdk/src/daemon/diagnostics.d.ts +0 -1
- package/dist/plugin-sdk/src/daemon/exec-file.d.ts +0 -7
- package/dist/plugin-sdk/src/daemon/launchd-plist.d.ts +0 -15
- package/dist/plugin-sdk/src/daemon/launchd.d.ts +0 -49
- package/dist/plugin-sdk/src/daemon/node-service.d.ts +0 -2
- package/dist/plugin-sdk/src/daemon/output.d.ts +0 -8
- package/dist/plugin-sdk/src/daemon/paths.d.ts +0 -3
- package/dist/plugin-sdk/src/daemon/runtime-binary.d.ts +0 -2
- package/dist/plugin-sdk/src/daemon/runtime-parse.d.ts +0 -1
- package/dist/plugin-sdk/src/daemon/schtasks-exec.d.ts +0 -5
- package/dist/plugin-sdk/src/daemon/schtasks.d.ts +0 -18
- package/dist/plugin-sdk/src/daemon/service-runtime.d.ts +0 -13
- package/dist/plugin-sdk/src/daemon/service-types.d.ts +0 -32
- package/dist/plugin-sdk/src/daemon/service.d.ts +0 -16
- package/dist/plugin-sdk/src/daemon/systemd-linger.d.ts +0 -15
- package/dist/plugin-sdk/src/daemon/systemd-system.d.ts +0 -28
- package/dist/plugin-sdk/src/daemon/systemd-unit.d.ts +0 -7
- package/dist/plugin-sdk/src/daemon/systemd.d.ts +0 -32
- package/dist/plugin-sdk/src/discord/accounts.d.ts +0 -21
- package/dist/plugin-sdk/src/discord/api.d.ts +0 -11
- package/dist/plugin-sdk/src/discord/audit.d.ts +0 -29
- package/dist/plugin-sdk/src/discord/chunk.d.ts +0 -20
- package/dist/plugin-sdk/src/discord/client.d.ts +0 -21
- package/dist/plugin-sdk/src/discord/components-registry.d.ts +0 -16
- package/dist/plugin-sdk/src/discord/components.d.ts +0 -196
- package/dist/plugin-sdk/src/discord/directory-live.d.ts +0 -4
- package/dist/plugin-sdk/src/discord/draft-chunking.d.ts +0 -6
- package/dist/plugin-sdk/src/discord/draft-stream.d.ts +0 -21
- package/dist/plugin-sdk/src/discord/gateway-logging.d.ts +0 -8
- package/dist/plugin-sdk/src/discord/guilds.d.ts +0 -6
- package/dist/plugin-sdk/src/discord/monitor/agent-components.d.ts +0 -55
- package/dist/plugin-sdk/src/discord/monitor/allow-list.d.ts +0 -176
- package/dist/plugin-sdk/src/discord/monitor/commands.d.ts +0 -2
- package/dist/plugin-sdk/src/discord/monitor/exec-approvals.d.ts +0 -55
- package/dist/plugin-sdk/src/discord/monitor/format.d.ts +0 -13
- package/dist/plugin-sdk/src/discord/monitor/gateway-error-guard.d.ts +0 -6
- package/dist/plugin-sdk/src/discord/monitor/gateway-plugin.d.ts +0 -8
- package/dist/plugin-sdk/src/discord/monitor/gateway-registry.d.ts +0 -9
- package/dist/plugin-sdk/src/discord/monitor/listeners.d.ts +0 -50
- package/dist/plugin-sdk/src/discord/monitor/message-handler.d.ts +0 -5
- package/dist/plugin-sdk/src/discord/monitor/message-handler.preflight.d.ts +0 -14
- package/dist/plugin-sdk/src/discord/monitor/message-handler.preflight.types.d.ts +0 -96
- package/dist/plugin-sdk/src/discord/monitor/message-handler.process.d.ts +0 -2
- package/dist/plugin-sdk/src/discord/monitor/message-utils.d.ts +0 -44
- package/dist/plugin-sdk/src/discord/monitor/model-picker-preferences.d.ts +0 -18
- package/dist/plugin-sdk/src/discord/monitor/model-picker.d.ts +0 -117
- package/dist/plugin-sdk/src/discord/monitor/native-command.d.ts +0 -26
- package/dist/plugin-sdk/src/discord/monitor/presence-cache.d.ts +0 -9
- package/dist/plugin-sdk/src/discord/monitor/presence.d.ts +0 -5
- package/dist/plugin-sdk/src/discord/monitor/provider.allowlist.d.ts +0 -14
- package/dist/plugin-sdk/src/discord/monitor/provider.d.ts +0 -34
- package/dist/plugin-sdk/src/discord/monitor/provider.lifecycle.d.ts +0 -28
- package/dist/plugin-sdk/src/discord/monitor/reply-context.d.ts +0 -17
- package/dist/plugin-sdk/src/discord/monitor/reply-delivery.d.ts +0 -37
- package/dist/plugin-sdk/src/discord/monitor/rest-fetch.d.ts +0 -2
- package/dist/plugin-sdk/src/discord/monitor/sender-identity.d.ts +0 -31
- package/dist/plugin-sdk/src/discord/monitor/system-events.d.ts +0 -2
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.config.d.ts +0 -11
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.d.ts +0 -8
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.discord-api.d.ts +0 -36
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.lifecycle.d.ts +0 -46
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.manager.d.ts +0 -18
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.messages.d.ts +0 -1
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.persona.d.ts +0 -6
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.state.d.ts +0 -80
- package/dist/plugin-sdk/src/discord/monitor/thread-bindings.types.d.ts +0 -77
- package/dist/plugin-sdk/src/discord/monitor/threading.d.ts +0 -106
- package/dist/plugin-sdk/src/discord/monitor/typing.d.ts +0 -5
- package/dist/plugin-sdk/src/discord/monitor.d.ts +0 -10
- package/dist/plugin-sdk/src/discord/monitor.gateway.d.ts +0 -12
- package/dist/plugin-sdk/src/discord/pluralkit.d.ts +0 -26
- package/dist/plugin-sdk/src/discord/probe.d.ts +0 -28
- package/dist/plugin-sdk/src/discord/resolve-channels.d.ts +0 -15
- package/dist/plugin-sdk/src/discord/resolve-users.d.ts +0 -14
- package/dist/plugin-sdk/src/discord/send.channels.d.ts +0 -17
- package/dist/plugin-sdk/src/discord/send.components.d.ts +0 -17
- package/dist/plugin-sdk/src/discord/send.d.ts +0 -10
- package/dist/plugin-sdk/src/discord/send.emojis-stickers.d.ts +0 -4
- package/dist/plugin-sdk/src/discord/send.guild.d.ts +0 -24
- package/dist/plugin-sdk/src/discord/send.messages.d.ts +0 -20
- package/dist/plugin-sdk/src/discord/send.outbound.d.ts +0 -57
- package/dist/plugin-sdk/src/discord/send.permissions.d.ts +0 -20
- package/dist/plugin-sdk/src/discord/send.reactions.d.ts +0 -15
- package/dist/plugin-sdk/src/discord/send.shared.d.ts +0 -85
- package/dist/plugin-sdk/src/discord/send.types.d.ts +0 -144
- package/dist/plugin-sdk/src/discord/targets.d.ts +0 -18
- package/dist/plugin-sdk/src/discord/token.d.ts +0 -11
- package/dist/plugin-sdk/src/discord/ui.d.ts +0 -19
- package/dist/plugin-sdk/src/discord/voice/command.d.ts +0 -15
- package/dist/plugin-sdk/src/discord/voice/manager.d.ts +0 -52
- package/dist/plugin-sdk/src/discord/voice-message.d.ts +0 -50
- package/dist/plugin-sdk/src/federation/access-token.d.ts +0 -34
- package/dist/plugin-sdk/src/federation/attestation.d.ts +0 -37
- package/dist/plugin-sdk/src/federation/auto-connect.d.ts +0 -103
- package/dist/plugin-sdk/src/federation/marketplace-capability-adapter.d.ts +0 -31
- package/dist/plugin-sdk/src/federation/marketplace-chat-command.d.ts +0 -13
- package/dist/plugin-sdk/src/federation/marketplace-delivery.d.ts +0 -61
- package/dist/plugin-sdk/src/federation/marketplace-direct-payment.d.ts +0 -36
- package/dist/plugin-sdk/src/federation/marketplace-escrow.d.ts +0 -58
- package/dist/plugin-sdk/src/federation/marketplace-service-kinds.d.ts +0 -23
- package/dist/plugin-sdk/src/federation/marketplace-task-ledger.d.ts +0 -12
- package/dist/plugin-sdk/src/federation/offers.d.ts +0 -258
- package/dist/plugin-sdk/src/federation/runtime.d.ts +0 -14
- package/dist/plugin-sdk/src/federation/settlement-evidence.d.ts +0 -27
- package/dist/plugin-sdk/src/gateway/a2a-http.d.ts +0 -25
- package/dist/plugin-sdk/src/gateway/a2a-settlement.d.ts +0 -36
- package/dist/plugin-sdk/src/gateway/agent-event-assistant-text.d.ts +0 -2
- package/dist/plugin-sdk/src/gateway/agent-prompt.d.ts +0 -6
- package/dist/plugin-sdk/src/gateway/assistant-identity.d.ts +0 -13
- package/dist/plugin-sdk/src/gateway/auth-rate-limit.d.ts +0 -67
- package/dist/plugin-sdk/src/gateway/auth.d.ts +0 -63
- package/dist/plugin-sdk/src/gateway/call.d.ts +0 -82
- package/dist/plugin-sdk/src/gateway/canvas-capability.d.ts +0 -14
- package/dist/plugin-sdk/src/gateway/chat-abort.d.ts +0 -70
- package/dist/plugin-sdk/src/gateway/chat-sanitize.d.ts +0 -4
- package/dist/plugin-sdk/src/gateway/client.d.ts +0 -66
- package/dist/plugin-sdk/src/gateway/control-plane-audit.d.ts +0 -10
- package/dist/plugin-sdk/src/gateway/control-ui-boot-check.d.ts +0 -22
- package/dist/plugin-sdk/src/gateway/control-ui-contract.d.ts +0 -7
- package/dist/plugin-sdk/src/gateway/control-ui-csp.d.ts +0 -1
- package/dist/plugin-sdk/src/gateway/control-ui-login.d.ts +0 -115
- package/dist/plugin-sdk/src/gateway/control-ui-shared.d.ts +0 -9
- package/dist/plugin-sdk/src/gateway/control-ui.d.ts +0 -36
- package/dist/plugin-sdk/src/gateway/credentials.d.ts +0 -34
- package/dist/plugin-sdk/src/gateway/device-auth.d.ts +0 -17
- package/dist/plugin-sdk/src/gateway/exec-approval-manager.d.ts +0 -38
- package/dist/plugin-sdk/src/gateway/federation-http.d.ts +0 -7
- package/dist/plugin-sdk/src/gateway/federation-marketplace.d.ts +0 -90
- package/dist/plugin-sdk/src/gateway/fedify-http.d.ts +0 -5
- package/dist/plugin-sdk/src/gateway/gateway-identity.d.ts +0 -5
- package/dist/plugin-sdk/src/gateway/hooks-mapping.d.ts +0 -80
- package/dist/plugin-sdk/src/gateway/hooks.d.ts +0 -102
- package/dist/plugin-sdk/src/gateway/http-auth-helpers.d.ts +0 -11
- package/dist/plugin-sdk/src/gateway/http-common.d.ts +0 -21
- package/dist/plugin-sdk/src/gateway/http-endpoint-helpers.d.ts +0 -13
- package/dist/plugin-sdk/src/gateway/http-utils.d.ts +0 -15
- package/dist/plugin-sdk/src/gateway/internal-call-auth.d.ts +0 -3
- package/dist/plugin-sdk/src/gateway/method-scopes.d.ts +0 -22
- package/dist/plugin-sdk/src/gateway/mutating-admin-rpc-rate-limit.d.ts +0 -29
- package/dist/plugin-sdk/src/gateway/net.d.ts +0 -83
- package/dist/plugin-sdk/src/gateway/node-command-policy.d.ts +0 -14
- package/dist/plugin-sdk/src/gateway/node-registry.d.ts +0 -60
- package/dist/plugin-sdk/src/gateway/open-responses.schema.d.ts +0 -765
- package/dist/plugin-sdk/src/gateway/openai-http.d.ts +0 -12
- package/dist/plugin-sdk/src/gateway/openresponses-http.d.ts +0 -21
- package/dist/plugin-sdk/src/gateway/openresponses-prompt.d.ts +0 -5
- package/dist/plugin-sdk/src/gateway/probe-auth.d.ts +0 -9
- package/dist/plugin-sdk/src/gateway/probe.d.ts +0 -26
- package/dist/plugin-sdk/src/gateway/protocol/client-info.d.ts +0 -58
- package/dist/plugin-sdk/src/gateway/protocol/index.d.ts +0 -1048
- package/dist/plugin-sdk/src/gateway/protocol/schema/agent.d.ts +0 -91
- package/dist/plugin-sdk/src/gateway/protocol/schema/agents-models-skills.d.ts +0 -1400
- package/dist/plugin-sdk/src/gateway/protocol/schema/channels.d.ts +0 -158
- package/dist/plugin-sdk/src/gateway/protocol/schema/commands.d.ts +0 -68
- package/dist/plugin-sdk/src/gateway/protocol/schema/config.d.ts +0 -115
- package/dist/plugin-sdk/src/gateway/protocol/schema/cron.d.ts +0 -1551
- package/dist/plugin-sdk/src/gateway/protocol/schema/devices.d.ts +0 -42
- package/dist/plugin-sdk/src/gateway/protocol/schema/error-codes.d.ts +0 -15
- package/dist/plugin-sdk/src/gateway/protocol/schema/exec-approvals.d.ts +0 -182
- package/dist/plugin-sdk/src/gateway/protocol/schema/frames.d.ts +0 -168
- package/dist/plugin-sdk/src/gateway/protocol/schema/logs-chat.d.ts +0 -45
- package/dist/plugin-sdk/src/gateway/protocol/schema/nodes.d.ts +0 -85
- package/dist/plugin-sdk/src/gateway/protocol/schema/primitives.d.ts +0 -4
- package/dist/plugin-sdk/src/gateway/protocol/schema/protocol-schemas.d.ts +0 -3
- package/dist/plugin-sdk/src/gateway/protocol/schema/push.d.ts +0 -15
- package/dist/plugin-sdk/src/gateway/protocol/schema/sessions.d.ts +0 -134
- package/dist/plugin-sdk/src/gateway/protocol/schema/snapshot.d.ts +0 -69
- package/dist/plugin-sdk/src/gateway/protocol/schema/types.d.ts +0 -245
- package/dist/plugin-sdk/src/gateway/protocol/schema/wizard.d.ts +0 -86
- package/dist/plugin-sdk/src/gateway/protocol/schema.d.ts +0 -18
- package/dist/plugin-sdk/src/gateway/security-path.d.ts +0 -15
- package/dist/plugin-sdk/src/gateway/server/readiness.d.ts +0 -6
- package/dist/plugin-sdk/src/gateway/server/ws-types.d.ts +0 -12
- package/dist/plugin-sdk/src/gateway/server-broadcast.d.ts +0 -17
- package/dist/plugin-sdk/src/gateway/server-channels.d.ts +0 -26
- package/dist/plugin-sdk/src/gateway/server-constants.d.ts +0 -10
- package/dist/plugin-sdk/src/gateway/server-http.d.ts +0 -131
- package/dist/plugin-sdk/src/gateway/server-methods/commands.d.ts +0 -11
- package/dist/plugin-sdk/src/gateway/server-methods/mutating-admin-rpc-audit.d.ts +0 -41
- package/dist/plugin-sdk/src/gateway/server-methods/nodes.helpers.d.ts +0 -20
- package/dist/plugin-sdk/src/gateway/server-methods/push.d.ts +0 -2
- package/dist/plugin-sdk/src/gateway/server-methods/types.d.ts +0 -106
- package/dist/plugin-sdk/src/gateway/server-model-catalog.d.ts +0 -17
- package/dist/plugin-sdk/src/gateway/server-shared.d.ts +0 -7
- package/dist/plugin-sdk/src/gateway/server-startup-readiness.d.ts +0 -21
- package/dist/plugin-sdk/src/gateway/server-startup-trace.d.ts +0 -29
- package/dist/plugin-sdk/src/gateway/session-compaction-checkpoints.d.ts +0 -24
- package/dist/plugin-sdk/src/gateway/session-utils.d.ts +0 -80
- package/dist/plugin-sdk/src/gateway/session-utils.fs.d.ts +0 -48
- package/dist/plugin-sdk/src/gateway/session-utils.types.d.ts +0 -106
- package/dist/plugin-sdk/src/gateway/tools-invoke-http.d.ts +0 -10
- package/dist/plugin-sdk/src/gateway/update-status.d.ts +0 -27
- package/dist/plugin-sdk/src/gateway/ws-log.d.ts +0 -5
- package/dist/plugin-sdk/src/gateway/ws-logging.d.ts +0 -4
- package/dist/plugin-sdk/src/globals.d.ts +0 -11
- package/dist/plugin-sdk/src/hooks/config.d.ts +0 -11
- package/dist/plugin-sdk/src/hooks/frontmatter.d.ts +0 -5
- package/dist/plugin-sdk/src/hooks/internal-hooks.d.ts +0 -155
- package/dist/plugin-sdk/src/hooks/module-loader.d.ts +0 -18
- package/dist/plugin-sdk/src/hooks/types.d.ts +0 -62
- package/dist/plugin-sdk/src/image-generation/types.d.ts +0 -74
- package/dist/plugin-sdk/src/imessage/accounts.d.ts +0 -16
- package/dist/plugin-sdk/src/imessage/client.d.ts +0 -46
- package/dist/plugin-sdk/src/imessage/constants.d.ts +0 -2
- package/dist/plugin-sdk/src/imessage/monitor/abort-handler.d.ts +0 -9
- package/dist/plugin-sdk/src/imessage/monitor/deliver.d.ts +0 -14
- package/dist/plugin-sdk/src/imessage/monitor/echo-cache.d.ts +0 -9
- package/dist/plugin-sdk/src/imessage/monitor/inbound-processing.d.ts +0 -96
- package/dist/plugin-sdk/src/imessage/monitor/monitor-provider.d.ts +0 -7
- package/dist/plugin-sdk/src/imessage/monitor/parse-notification.d.ts +0 -2
- package/dist/plugin-sdk/src/imessage/monitor/runtime.d.ts +0 -4
- package/dist/plugin-sdk/src/imessage/monitor/types.d.ts +0 -37
- package/dist/plugin-sdk/src/imessage/monitor.d.ts +0 -2
- package/dist/plugin-sdk/src/imessage/probe.d.ts +0 -17
- package/dist/plugin-sdk/src/imessage/send.d.ts +0 -34
- package/dist/plugin-sdk/src/imessage/target-parsing-helpers.d.ts +0 -45
- package/dist/plugin-sdk/src/imessage/targets.d.ts +0 -40
- package/dist/plugin-sdk/src/infra/abort-signal.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/agent-events.d.ts +0 -24
- package/dist/plugin-sdk/src/infra/archive-path.d.ts +0 -12
- package/dist/plugin-sdk/src/infra/archive.d.ts +0 -46
- package/dist/plugin-sdk/src/infra/backoff.d.ts +0 -8
- package/dist/plugin-sdk/src/infra/binaries.d.ts +0 -3
- package/dist/plugin-sdk/src/infra/boundary-file-read.d.ts +0 -33
- package/dist/plugin-sdk/src/infra/boundary-path.d.ts +0 -38
- package/dist/plugin-sdk/src/infra/brew.d.ts +0 -8
- package/dist/plugin-sdk/src/infra/channel-activity.d.ts +0 -18
- package/dist/plugin-sdk/src/infra/channel-summary.d.ts +0 -6
- package/dist/plugin-sdk/src/infra/channels-status-issues.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/clawhub.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/control-ui-assets.d.ts +0 -32
- package/dist/plugin-sdk/src/infra/dedupe.d.ts +0 -12
- package/dist/plugin-sdk/src/infra/detect-package-manager.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/device-auth-store.d.ts +0 -19
- package/dist/plugin-sdk/src/infra/device-identity.d.ts +0 -13
- package/dist/plugin-sdk/src/infra/device-pairing.d.ts +0 -103
- package/dist/plugin-sdk/src/infra/diagnostic-events.d.ts +0 -140
- package/dist/plugin-sdk/src/infra/diagnostic-flags.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/dotenv.d.ts +0 -13
- package/dist/plugin-sdk/src/infra/env.d.ts +0 -11
- package/dist/plugin-sdk/src/infra/errors.d.ts +0 -11
- package/dist/plugin-sdk/src/infra/exec-approval-reply.d.ts +0 -11
- package/dist/plugin-sdk/src/infra/exec-approval-surface.d.ts +0 -38
- package/dist/plugin-sdk/src/infra/exec-approvals-allowlist.d.ts +0 -69
- package/dist/plugin-sdk/src/infra/exec-approvals-analysis.d.ts +0 -78
- package/dist/plugin-sdk/src/infra/exec-approvals.d.ts +0 -147
- package/dist/plugin-sdk/src/infra/exec-command-resolution.d.ts +0 -45
- package/dist/plugin-sdk/src/infra/exec-obfuscation-detect.d.ts +0 -12
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy-profiles.d.ts +0 -24
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy-validator.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/exec-safe-bin-policy.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/exec-safe-bin-runtime-policy.d.ts +0 -25
- package/dist/plugin-sdk/src/infra/exec-safe-bin-trust.d.ts +0 -23
- package/dist/plugin-sdk/src/infra/exec-safety.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/exec-wrapper-resolution.d.ts +0 -48
- package/dist/plugin-sdk/src/infra/fased-exec-env.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/fased-root.d.ts +0 -10
- package/dist/plugin-sdk/src/infra/fasedhub.d.ts +0 -114
- package/dist/plugin-sdk/src/infra/fetch-headers.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/fetch.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/file-identity.d.ts +0 -5
- package/dist/plugin-sdk/src/infra/file-lock.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/format-time/format-datetime.d.ts +0 -35
- package/dist/plugin-sdk/src/infra/format-time/format-duration.d.ts +0 -23
- package/dist/plugin-sdk/src/infra/format-time/format-relative.d.ts +0 -39
- package/dist/plugin-sdk/src/infra/fs-safe.d.ts +0 -43
- package/dist/plugin-sdk/src/infra/gemini-auth.d.ts +0 -16
- package/dist/plugin-sdk/src/infra/git-commit.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/git-root.d.ts +0 -7
- package/dist/plugin-sdk/src/infra/hardlink-guards.d.ts +0 -6
- package/dist/plugin-sdk/src/infra/heartbeat-active-hours.d.ts +0 -5
- package/dist/plugin-sdk/src/infra/heartbeat-events-filter.d.ts +0 -8
- package/dist/plugin-sdk/src/infra/heartbeat-events.d.ts +0 -21
- package/dist/plugin-sdk/src/infra/heartbeat-reason.d.ts +0 -5
- package/dist/plugin-sdk/src/infra/heartbeat-runner.d.ts +0 -46
- package/dist/plugin-sdk/src/infra/heartbeat-visibility.d.ts +0 -17
- package/dist/plugin-sdk/src/infra/heartbeat-wake.d.ts +0 -32
- package/dist/plugin-sdk/src/infra/home-dir.d.ts +0 -7
- package/dist/plugin-sdk/src/infra/host-env-security.d.ts +0 -26
- package/dist/plugin-sdk/src/infra/http-body.d.ts +0 -46
- package/dist/plugin-sdk/src/infra/install-flow.d.ts +0 -24
- package/dist/plugin-sdk/src/infra/install-mode-options.d.ts +0 -20
- package/dist/plugin-sdk/src/infra/install-package-dir.d.ts +0 -19
- package/dist/plugin-sdk/src/infra/install-safe-path.d.ts +0 -14
- package/dist/plugin-sdk/src/infra/install-source-utils.d.ts +0 -32
- package/dist/plugin-sdk/src/infra/json-file.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/json-files.d.ts +0 -5
- package/dist/plugin-sdk/src/infra/jsonl-socket.d.ts +0 -6
- package/dist/plugin-sdk/src/infra/machine-name.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/map-size.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/net/fetch-guard.d.ts +0 -28
- package/dist/plugin-sdk/src/infra/net/hostname.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/net/ssrf.d.ts +0 -35
- package/dist/plugin-sdk/src/infra/node-commands.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/node-pairing.d.ts +0 -65
- package/dist/plugin-sdk/src/infra/node-shell.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/npm-integrity.d.ts +0 -38
- package/dist/plugin-sdk/src/infra/npm-pack-install.d.ts +0 -56
- package/dist/plugin-sdk/src/infra/npm-registry-spec.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/optional-runtime-dependency.d.ts +0 -6
- package/dist/plugin-sdk/src/infra/os-summary.d.ts +0 -7
- package/dist/plugin-sdk/src/infra/outbound/abort.d.ts +0 -8
- package/dist/plugin-sdk/src/infra/outbound/agent-delivery.d.ts +0 -46
- package/dist/plugin-sdk/src/infra/outbound/best-effort-delivery.d.ts +0 -13
- package/dist/plugin-sdk/src/infra/outbound/bound-delivery-router.d.ts +0 -16
- package/dist/plugin-sdk/src/infra/outbound/channel-adapters.d.ts +0 -15
- package/dist/plugin-sdk/src/infra/outbound/channel-adapters.discord.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/outbound/channel-resolution.d.ts +0 -8
- package/dist/plugin-sdk/src/infra/outbound/channel-selection.d.ts +0 -11
- package/dist/plugin-sdk/src/infra/outbound/channel-target.d.ts +0 -6
- package/dist/plugin-sdk/src/infra/outbound/conversation-id.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/outbound/deliver.d.ts +0 -80
- package/dist/plugin-sdk/src/infra/outbound/delivery-queue.d.ts +0 -85
- package/dist/plugin-sdk/src/infra/outbound/directory-cache.d.ts +0 -24
- package/dist/plugin-sdk/src/infra/outbound/envelope.d.ts +0 -16
- package/dist/plugin-sdk/src/infra/outbound/format.d.ts +0 -41
- package/dist/plugin-sdk/src/infra/outbound/identity.d.ts +0 -8
- package/dist/plugin-sdk/src/infra/outbound/message-action-params.d.ts +0 -54
- package/dist/plugin-sdk/src/infra/outbound/message-action-runner.d.ts +0 -81
- package/dist/plugin-sdk/src/infra/outbound/message-action-spec.d.ts +0 -5
- package/dist/plugin-sdk/src/infra/outbound/message.d.ts +0 -87
- package/dist/plugin-sdk/src/infra/outbound/outbound-policy.d.ts +0 -32
- package/dist/plugin-sdk/src/infra/outbound/outbound-send-service.d.ts +0 -74
- package/dist/plugin-sdk/src/infra/outbound/outbound-session.d.ts +0 -31
- package/dist/plugin-sdk/src/infra/outbound/payloads.d.ts +0 -18
- package/dist/plugin-sdk/src/infra/outbound/session-binding-service.d.ts +0 -89
- package/dist/plugin-sdk/src/infra/outbound/session-context.d.ts +0 -12
- package/dist/plugin-sdk/src/infra/outbound/target-errors.d.ts +0 -6
- package/dist/plugin-sdk/src/infra/outbound/target-normalization.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/outbound/target-resolver.d.ts +0 -53
- package/dist/plugin-sdk/src/infra/outbound/targets.d.ts +0 -87
- package/dist/plugin-sdk/src/infra/outbound/tool-payload.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/pairing-files.d.ts +0 -23
- package/dist/plugin-sdk/src/infra/pairing-pending.d.ts +0 -13
- package/dist/plugin-sdk/src/infra/pairing-token.d.ts +0 -3
- package/dist/plugin-sdk/src/infra/path-alias-guards.d.ts +0 -18
- package/dist/plugin-sdk/src/infra/path-guards.d.ts +0 -5
- package/dist/plugin-sdk/src/infra/path-prepend.d.ts +0 -6
- package/dist/plugin-sdk/src/infra/path-safety.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/plain-object.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/ports-format.d.ts +0 -5
- package/dist/plugin-sdk/src/infra/ports-inspect.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/ports-lsof.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/ports-probe.d.ts +0 -5
- package/dist/plugin-sdk/src/infra/ports-types.d.ts +0 -18
- package/dist/plugin-sdk/src/infra/ports.d.ts +0 -14
- package/dist/plugin-sdk/src/infra/prototype-keys.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/provider-usage.auth.d.ts +0 -11
- package/dist/plugin-sdk/src/infra/provider-usage.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.claude.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.codex.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.copilot.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.d.ts +0 -6
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.gemini.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.minimax.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.shared.d.ts +0 -12
- package/dist/plugin-sdk/src/infra/provider-usage.fetch.zai.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/provider-usage.format.d.ts +0 -13
- package/dist/plugin-sdk/src/infra/provider-usage.load.d.ts +0 -12
- package/dist/plugin-sdk/src/infra/provider-usage.shared.d.ts +0 -8
- package/dist/plugin-sdk/src/infra/provider-usage.types.d.ts +0 -17
- package/dist/plugin-sdk/src/infra/push-apns.d.ts +0 -83
- package/dist/plugin-sdk/src/infra/restart-sentinel.d.ts +0 -50
- package/dist/plugin-sdk/src/infra/restart-stale-pids.d.ts +0 -13
- package/dist/plugin-sdk/src/infra/restart.d.ts +0 -72
- package/dist/plugin-sdk/src/infra/retry-policy.d.ts +0 -25
- package/dist/plugin-sdk/src/infra/retry.d.ts +0 -21
- package/dist/plugin-sdk/src/infra/runtime-guard.d.ts +0 -21
- package/dist/plugin-sdk/src/infra/runtime-status.d.ts +0 -8
- package/dist/plugin-sdk/src/infra/safe-open-sync.d.ts +0 -23
- package/dist/plugin-sdk/src/infra/scp-host.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/secure-random.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/session-cost-usage.d.ts +0 -45
- package/dist/plugin-sdk/src/infra/session-cost-usage.types.d.ts +0 -153
- package/dist/plugin-sdk/src/infra/session-maintenance-warning.d.ts +0 -10
- package/dist/plugin-sdk/src/infra/shell-env.d.ts +0 -34
- package/dist/plugin-sdk/src/infra/skills-remote.d.ts +0 -25
- package/dist/plugin-sdk/src/infra/system-events.d.ts +0 -20
- package/dist/plugin-sdk/src/infra/system-message.d.ts +0 -3
- package/dist/plugin-sdk/src/infra/system-presence.d.ts +0 -45
- package/dist/plugin-sdk/src/infra/system-run-command.d.ts +0 -30
- package/dist/plugin-sdk/src/infra/tailnet.d.ts +0 -7
- package/dist/plugin-sdk/src/infra/tailscale.d.ts +0 -34
- package/dist/plugin-sdk/src/infra/tls/fingerprint.d.ts +0 -1
- package/dist/plugin-sdk/src/infra/tls/gateway.d.ts +0 -16
- package/dist/plugin-sdk/src/infra/tmp-fased-dir.d.ts +0 -20
- package/dist/plugin-sdk/src/infra/transport-ready.d.ts +0 -16
- package/dist/plugin-sdk/src/infra/unhandled-rejections.d.ts +0 -15
- package/dist/plugin-sdk/src/infra/update-channels.d.ts +0 -36
- package/dist/plugin-sdk/src/infra/update-check.d.ts +0 -69
- package/dist/plugin-sdk/src/infra/update-global.d.ts +0 -29
- package/dist/plugin-sdk/src/infra/warning-filter.d.ts +0 -7
- package/dist/plugin-sdk/src/infra/ws.d.ts +0 -2
- package/dist/plugin-sdk/src/infra/wsl.d.ts +0 -11
- package/dist/plugin-sdk/src/line/accounts.d.ts +0 -10
- package/dist/plugin-sdk/src/line/actions.d.ts +0 -22
- package/dist/plugin-sdk/src/line/auto-reply-delivery.d.ts +0 -38
- package/dist/plugin-sdk/src/line/bot-access.d.ts +0 -17
- package/dist/plugin-sdk/src/line/bot-handlers.d.ts +0 -13
- package/dist/plugin-sdk/src/line/bot-message-context.d.ts +0 -118
- package/dist/plugin-sdk/src/line/bot.d.ts +0 -24
- package/dist/plugin-sdk/src/line/channel-access-token.d.ts +0 -4
- package/dist/plugin-sdk/src/line/config-schema.d.ts +0 -64
- package/dist/plugin-sdk/src/line/download.d.ts +0 -7
- package/dist/plugin-sdk/src/line/flex-templates/basic-cards.d.ts +0 -46
- package/dist/plugin-sdk/src/line/flex-templates/common.d.ts +0 -2
- package/dist/plugin-sdk/src/line/flex-templates/media-control-cards.d.ts +0 -73
- package/dist/plugin-sdk/src/line/flex-templates/message.d.ts +0 -6
- package/dist/plugin-sdk/src/line/flex-templates/schedule-cards.d.ts +0 -55
- package/dist/plugin-sdk/src/line/flex-templates/types.d.ts +0 -19
- package/dist/plugin-sdk/src/line/flex-templates.d.ts +0 -5
- package/dist/plugin-sdk/src/line/logging.d.ts +0 -2
- package/dist/plugin-sdk/src/line/markdown-to-line.d.ts +0 -72
- package/dist/plugin-sdk/src/line/monitor.d.ts +0 -28
- package/dist/plugin-sdk/src/line/probe.d.ts +0 -2
- package/dist/plugin-sdk/src/line/reply-chunks.d.ts +0 -24
- package/dist/plugin-sdk/src/line/send.d.ts +0 -91
- package/dist/plugin-sdk/src/line/signature.d.ts +0 -1
- package/dist/plugin-sdk/src/line/template-messages.d.ts +0 -100
- package/dist/plugin-sdk/src/line/types.d.ts +0 -113
- package/dist/plugin-sdk/src/line/webhook-node.d.ts +0 -15
- package/dist/plugin-sdk/src/line/webhook-utils.d.ts +0 -3
- package/dist/plugin-sdk/src/line/webhook.d.ts +0 -19
- package/dist/plugin-sdk/src/link-understanding/apply.d.ts +0 -10
- package/dist/plugin-sdk/src/link-understanding/defaults.d.ts +0 -2
- package/dist/plugin-sdk/src/link-understanding/detect.d.ts +0 -3
- package/dist/plugin-sdk/src/link-understanding/format.d.ts +0 -4
- package/dist/plugin-sdk/src/link-understanding/runner.d.ts +0 -13
- package/dist/plugin-sdk/src/logger.d.ts +0 -6
- package/dist/plugin-sdk/src/logging/config.d.ts +0 -4
- package/dist/plugin-sdk/src/logging/console.d.ts +0 -23
- package/dist/plugin-sdk/src/logging/diagnostic-session-state.d.ts +0 -30
- package/dist/plugin-sdk/src/logging/diagnostic-stability.d.ts +0 -85
- package/dist/plugin-sdk/src/logging/diagnostic.d.ts +0 -65
- package/dist/plugin-sdk/src/logging/env-log-level.d.ts +0 -2
- package/dist/plugin-sdk/src/logging/levels.d.ts +0 -5
- package/dist/plugin-sdk/src/logging/logger.d.ts +0 -44
- package/dist/plugin-sdk/src/logging/node-require.d.ts +0 -1
- package/dist/plugin-sdk/src/logging/redact-identifier.d.ts +0 -4
- package/dist/plugin-sdk/src/logging/redact.d.ts +0 -9
- package/dist/plugin-sdk/src/logging/state.d.ts +0 -19
- package/dist/plugin-sdk/src/logging/subsystem.d.ts +0 -18
- package/dist/plugin-sdk/src/logging/timestamps.d.ts +0 -1
- package/dist/plugin-sdk/src/logging.d.ts +0 -10
- package/dist/plugin-sdk/src/managed/federation.d.ts +0 -16
- package/dist/plugin-sdk/src/markdown/code-spans.d.ts +0 -10
- package/dist/plugin-sdk/src/markdown/fences.d.ts +0 -10
- package/dist/plugin-sdk/src/markdown/frontmatter.d.ts +0 -2
- package/dist/plugin-sdk/src/markdown/ir.d.ts +0 -32
- package/dist/plugin-sdk/src/markdown/render.d.ts +0 -18
- package/dist/plugin-sdk/src/markdown/tables.d.ts +0 -2
- package/dist/plugin-sdk/src/markdown/whatsapp.d.ts +0 -14
- package/dist/plugin-sdk/src/media/audio-tags.d.ts +0 -10
- package/dist/plugin-sdk/src/media/audio.d.ts +0 -19
- package/dist/plugin-sdk/src/media/base64.d.ts +0 -6
- package/dist/plugin-sdk/src/media/constants.d.ts +0 -7
- package/dist/plugin-sdk/src/media/fetch.d.ts +0 -24
- package/dist/plugin-sdk/src/media/image-ops.d.ts +0 -41
- package/dist/plugin-sdk/src/media/inbound-path-policy.d.ts +0 -18
- package/dist/plugin-sdk/src/media/input-files.d.ts +0 -95
- package/dist/plugin-sdk/src/media/local-roots.d.ts +0 -3
- package/dist/plugin-sdk/src/media/mime.d.ts +0 -16
- package/dist/plugin-sdk/src/media/outbound-attachment.d.ts +0 -6
- package/dist/plugin-sdk/src/media/parse.d.ts +0 -8
- package/dist/plugin-sdk/src/media/png-encode.d.ts +0 -8
- package/dist/plugin-sdk/src/media/read-response-with-limit.d.ts +0 -7
- package/dist/plugin-sdk/src/media/sniff-mime-from-base64.d.ts +0 -1
- package/dist/plugin-sdk/src/media/store.d.ts +0 -33
- package/dist/plugin-sdk/src/media-understanding/apply.d.ts +0 -19
- package/dist/plugin-sdk/src/media-understanding/attachments.d.ts +0 -49
- package/dist/plugin-sdk/src/media-understanding/audio-preflight.d.ts +0 -16
- package/dist/plugin-sdk/src/media-understanding/concurrency.d.ts +0 -1
- package/dist/plugin-sdk/src/media-understanding/defaults.d.ts +0 -14
- package/dist/plugin-sdk/src/media-understanding/errors.d.ts +0 -6
- package/dist/plugin-sdk/src/media-understanding/format.d.ts +0 -7
- package/dist/plugin-sdk/src/media-understanding/fs.d.ts +0 -1
- package/dist/plugin-sdk/src/media-understanding/output-extract.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/anthropic/index.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/deepgram/audio.d.ts +0 -4
- package/dist/plugin-sdk/src/media-understanding/providers/deepgram/index.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/google/audio.d.ts +0 -3
- package/dist/plugin-sdk/src/media-understanding/providers/google/index.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/google/inline-data.d.ts +0 -20
- package/dist/plugin-sdk/src/media-understanding/providers/google/video.d.ts +0 -3
- package/dist/plugin-sdk/src/media-understanding/providers/groq/index.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/image.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/index.d.ts +0 -4
- package/dist/plugin-sdk/src/media-understanding/providers/minimax/index.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/mistral/index.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/moonshot/index.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/providers/moonshot/video.d.ts +0 -3
- package/dist/plugin-sdk/src/media-understanding/providers/openai/audio.d.ts +0 -3
- package/dist/plugin-sdk/src/media-understanding/providers/openai/index.d.ts +0 -3
- package/dist/plugin-sdk/src/media-understanding/providers/shared.d.ts +0 -20
- package/dist/plugin-sdk/src/media-understanding/providers/zai/index.d.ts +0 -2
- package/dist/plugin-sdk/src/media-understanding/resolve.d.ts +0 -44
- package/dist/plugin-sdk/src/media-understanding/runner.d.ts +0 -39
- package/dist/plugin-sdk/src/media-understanding/runner.entries.d.ts +0 -33
- package/dist/plugin-sdk/src/media-understanding/scope.d.ts +0 -9
- package/dist/plugin-sdk/src/media-understanding/types.d.ts +0 -93
- package/dist/plugin-sdk/src/media-understanding/video.d.ts +0 -2
- package/dist/plugin-sdk/src/memory/backend-config.d.ts +0 -55
- package/dist/plugin-sdk/src/memory/batch-error-utils.d.ts +0 -15
- package/dist/plugin-sdk/src/memory/batch-gemini.d.ts +0 -51
- package/dist/plugin-sdk/src/memory/batch-http.d.ts +0 -8
- package/dist/plugin-sdk/src/memory/batch-openai.d.ts +0 -20
- package/dist/plugin-sdk/src/memory/batch-output.d.ts +0 -23
- package/dist/plugin-sdk/src/memory/batch-provider-common.d.ts +0 -9
- package/dist/plugin-sdk/src/memory/batch-runner.d.ts +0 -38
- package/dist/plugin-sdk/src/memory/batch-upload.d.ts +0 -6
- package/dist/plugin-sdk/src/memory/batch-utils.d.ts +0 -11
- package/dist/plugin-sdk/src/memory/batch-voyage.d.ts +0 -21
- package/dist/plugin-sdk/src/memory/embedding-chunk-limits.d.ts +0 -3
- package/dist/plugin-sdk/src/memory/embedding-input-limits.d.ts +0 -2
- package/dist/plugin-sdk/src/memory/embedding-model-limits.d.ts +0 -2
- package/dist/plugin-sdk/src/memory/embeddings-debug.d.ts +0 -1
- package/dist/plugin-sdk/src/memory/embeddings-gemini.d.ts +0 -16
- package/dist/plugin-sdk/src/memory/embeddings-mistral.d.ts +0 -15
- package/dist/plugin-sdk/src/memory/embeddings-openai.d.ts +0 -15
- package/dist/plugin-sdk/src/memory/embeddings-remote-client.d.ts +0 -12
- package/dist/plugin-sdk/src/memory/embeddings-remote-fetch.d.ts +0 -8
- package/dist/plugin-sdk/src/memory/embeddings-remote-provider.d.ts +0 -21
- package/dist/plugin-sdk/src/memory/embeddings-voyage.d.ts +0 -15
- package/dist/plugin-sdk/src/memory/embeddings.d.ts +0 -48
- package/dist/plugin-sdk/src/memory/filesystem-manager.d.ts +0 -38
- package/dist/plugin-sdk/src/memory/fs-utils.d.ts +0 -11
- package/dist/plugin-sdk/src/memory/hybrid.d.ts +0 -45
- package/dist/plugin-sdk/src/memory/index.d.ts +0 -4
- package/dist/plugin-sdk/src/memory/internal.d.ts +0 -38
- package/dist/plugin-sdk/src/memory/inventory.d.ts +0 -150
- package/dist/plugin-sdk/src/memory/manager-embedding-ops.d.ts +0 -42
- package/dist/plugin-sdk/src/memory/manager-search.d.ts +0 -60
- package/dist/plugin-sdk/src/memory/manager-sync-ops.d.ts +0 -137
- package/dist/plugin-sdk/src/memory/manager.d.ts +0 -111
- package/dist/plugin-sdk/src/memory/memory-schema.d.ts +0 -10
- package/dist/plugin-sdk/src/memory/mmr.d.ts +0 -62
- package/dist/plugin-sdk/src/memory/node-llama.d.ts +0 -8
- package/dist/plugin-sdk/src/memory/post-json.d.ts +0 -10
- package/dist/plugin-sdk/src/memory/qmd-manager.d.ts +0 -134
- package/dist/plugin-sdk/src/memory/qmd-query-parser.d.ts +0 -9
- package/dist/plugin-sdk/src/memory/qmd-scope.d.ts +0 -5
- package/dist/plugin-sdk/src/memory/query-expansion.d.ts +0 -40
- package/dist/plugin-sdk/src/memory/remote-http.d.ts +0 -9
- package/dist/plugin-sdk/src/memory/repair-audit-plan.d.ts +0 -68
- package/dist/plugin-sdk/src/memory/repair-cli-preview-contract.d.ts +0 -22
- package/dist/plugin-sdk/src/memory/repair-contracts.d.ts +0 -80
- package/dist/plugin-sdk/src/memory/repair-dashboard-preview-contract.d.ts +0 -65
- package/dist/plugin-sdk/src/memory/repair-execution-policy.d.ts +0 -36
- package/dist/plugin-sdk/src/memory/repair-execution-request-contract.d.ts +0 -43
- package/dist/plugin-sdk/src/memory/repair-executor-fs-safety-contract.d.ts +0 -33
- package/dist/plugin-sdk/src/memory/repair-executor-gate.d.ts +0 -27
- package/dist/plugin-sdk/src/memory/repair-executor-lock-contract.d.ts +0 -40
- package/dist/plugin-sdk/src/memory/repair-executor-result-contract.d.ts +0 -72
- package/dist/plugin-sdk/src/memory/repair-executor.d.ts +0 -60
- package/dist/plugin-sdk/src/memory/repair-preflight-cli-preview-contract.d.ts +0 -15
- package/dist/plugin-sdk/src/memory/repair-preflight-dashboard-preview-contract.d.ts +0 -50
- package/dist/plugin-sdk/src/memory/repair-preflight-pipeline-contract.d.ts +0 -35
- package/dist/plugin-sdk/src/memory/search-manager.d.ts +0 -11
- package/dist/plugin-sdk/src/memory/session-files.d.ts +0 -14
- package/dist/plugin-sdk/src/memory/sqlite-vec.d.ts +0 -9
- package/dist/plugin-sdk/src/memory/sqlite.d.ts +0 -1
- package/dist/plugin-sdk/src/memory/status-format.d.ts +0 -28
- package/dist/plugin-sdk/src/memory/temporal-decay.d.ts +0 -25
- package/dist/plugin-sdk/src/memory/types.d.ts +0 -94
- package/dist/plugin-sdk/src/mining/chat-command.d.ts +0 -19
- package/dist/plugin-sdk/src/mining/mainnet-sync.d.ts +0 -32
- package/dist/plugin-sdk/src/pairing/pairing-challenge.d.ts +0 -32
- package/dist/plugin-sdk/src/pairing/pairing-labels.d.ts +0 -2
- package/dist/plugin-sdk/src/pairing/pairing-messages.d.ts +0 -6
- package/dist/plugin-sdk/src/pairing/pairing-store.d.ts +0 -50
- package/dist/plugin-sdk/src/plugin-sdk/account-id.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/agent-media-payload.d.ts +0 -12
- package/dist/plugin-sdk/src/plugin-sdk/allow-from.d.ts +0 -32
- package/dist/plugin-sdk/src/plugin-sdk/channel-core.d.ts +0 -18
- package/dist/plugin-sdk/src/plugin-sdk/command-auth.d.ts +0 -27
- package/dist/plugin-sdk/src/plugin-sdk/config-paths.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/device-pair.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/discord.d.ts +0 -10
- package/dist/plugin-sdk/src/plugin-sdk/fetch-auth.d.ts +0 -13
- package/dist/plugin-sdk/src/plugin-sdk/file-lock.d.ts +0 -16
- package/dist/plugin-sdk/src/plugin-sdk/group-access.d.ts +0 -16
- package/dist/plugin-sdk/src/plugin-sdk/image-generation.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/index.d.ts +0 -163
- package/dist/plugin-sdk/src/plugin-sdk/json-store.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/onboarding.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/pairing-access.d.ts +0 -18
- package/dist/plugin-sdk/src/plugin-sdk/persistent-dedupe.d.ts +0 -20
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-result.d.ts +0 -14
- package/dist/plugin-sdk/src/plugin-sdk/realtime-transcription.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/realtime-voice.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/reply-payload.d.ts +0 -22
- package/dist/plugin-sdk/src/plugin-sdk/run-command.d.ts +0 -12
- package/dist/plugin-sdk/src/plugin-sdk/runtime.d.ts +0 -10
- package/dist/plugin-sdk/src/plugin-sdk/sat-runtime.d.ts +0 -32
- package/dist/plugin-sdk/src/plugin-sdk/slack-message-actions.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/slack.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/ssrf-policy.d.ts +0 -12
- package/dist/plugin-sdk/src/plugin-sdk/status-helpers.d.ts +0 -88
- package/dist/plugin-sdk/src/plugin-sdk/telegram.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/temp-path.d.ts +0 -12
- package/dist/plugin-sdk/src/plugin-sdk/text-chunking.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/tool-send.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/video-generation.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/webhook-path.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/webhook-targets.d.ts +0 -23
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp.d.ts +0 -11
- package/dist/plugin-sdk/src/plugins/bundled-dir.d.ts +0 -7
- package/dist/plugin-sdk/src/plugins/capability-provider-runtime.d.ts +0 -9
- package/dist/plugin-sdk/src/plugins/commands.d.ts +0 -85
- package/dist/plugin-sdk/src/plugins/config-schema.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/config-state.d.ts +0 -86
- package/dist/plugin-sdk/src/plugins/discovery.d.ts +0 -25
- package/dist/plugin-sdk/src/plugins/hook-runner-global.d.ts +0 -37
- package/dist/plugin-sdk/src/plugins/hooks.d.ts +0 -55
- package/dist/plugin-sdk/src/plugins/http-path.d.ts +0 -1
- package/dist/plugin-sdk/src/plugins/http-registry.d.ts +0 -13
- package/dist/plugin-sdk/src/plugins/install.d.ts +0 -93
- package/dist/plugin-sdk/src/plugins/loader.d.ts +0 -35
- package/dist/plugin-sdk/src/plugins/logger.d.ts +0 -9
- package/dist/plugin-sdk/src/plugins/manifest-registry.d.ts +0 -53
- package/dist/plugin-sdk/src/plugins/manifest.d.ts +0 -136
- package/dist/plugin-sdk/src/plugins/memory-embedding-providers.d.ts +0 -15
- package/dist/plugin-sdk/src/plugins/min-host-version.d.ts +0 -28
- package/dist/plugin-sdk/src/plugins/package-extensions.d.ts +0 -23
- package/dist/plugin-sdk/src/plugins/path-safety.d.ts +0 -5
- package/dist/plugin-sdk/src/plugins/provider-discovery.d.ts +0 -13
- package/dist/plugin-sdk/src/plugins/provider-runtime.runtime.d.ts +0 -8
- package/dist/plugin-sdk/src/plugins/providers.d.ts +0 -28
- package/dist/plugin-sdk/src/plugins/registry.d.ts +0 -171
- package/dist/plugin-sdk/src/plugins/runtime/admin-rpc-helper.d.ts +0 -71
- package/dist/plugin-sdk/src/plugins/runtime/index.d.ts +0 -4
- package/dist/plugin-sdk/src/plugins/runtime/native-deps.d.ts +0 -8
- package/dist/plugin-sdk/src/plugins/runtime/scoped.d.ts +0 -6
- package/dist/plugin-sdk/src/plugins/runtime/session-read-helper.d.ts +0 -115
- package/dist/plugin-sdk/src/plugins/runtime/types.d.ts +0 -370
- package/dist/plugin-sdk/src/plugins/runtime.d.ts +0 -6
- package/dist/plugin-sdk/src/plugins/schema-validator.d.ts +0 -10
- package/dist/plugin-sdk/src/plugins/slots.d.ts +0 -24
- package/dist/plugin-sdk/src/plugins/tools.d.ts +0 -14
- package/dist/plugin-sdk/src/plugins/types.d.ts +0 -684
- package/dist/plugin-sdk/src/plugins/uninstall.d.ts +0 -45
- package/dist/plugin-sdk/src/polls.d.ts +0 -31
- package/dist/plugin-sdk/src/process/command-queue.d.ts +0 -63
- package/dist/plugin-sdk/src/process/exec.d.ts +0 -31
- package/dist/plugin-sdk/src/process/kill-tree.d.ts +0 -12
- package/dist/plugin-sdk/src/process/lanes.d.ts +0 -6
- package/dist/plugin-sdk/src/process/spawn-utils.d.ts +0 -26
- package/dist/plugin-sdk/src/process/supervisor/adapters/child.d.ts +0 -10
- package/dist/plugin-sdk/src/process/supervisor/adapters/env.d.ts +0 -1
- package/dist/plugin-sdk/src/process/supervisor/adapters/pty.d.ts +0 -11
- package/dist/plugin-sdk/src/process/supervisor/index.d.ts +0 -4
- package/dist/plugin-sdk/src/process/supervisor/registry.d.ts +0 -21
- package/dist/plugin-sdk/src/process/supervisor/supervisor.d.ts +0 -2
- package/dist/plugin-sdk/src/process/supervisor/types.d.ts +0 -92
- package/dist/plugin-sdk/src/project.d.ts +0 -3
- package/dist/plugin-sdk/src/providers/cloudflare-ai-gateway-shared.d.ts +0 -84
- package/dist/plugin-sdk/src/providers/github-copilot-models.d.ts +0 -5
- package/dist/plugin-sdk/src/providers/github-copilot-token.d.ts +0 -22
- package/dist/plugin-sdk/src/providers/health.d.ts +0 -15
- package/dist/plugin-sdk/src/providers/huggingface-models.d.ts +0 -47
- package/dist/plugin-sdk/src/providers/litellm-models.d.ts +0 -30
- package/dist/plugin-sdk/src/providers/opencode-zen-shared.d.ts +0 -7
- package/dist/plugin-sdk/src/providers/refreshed-model-capabilities.d.ts +0 -14
- package/dist/plugin-sdk/src/providers/registry.d.ts +0 -204
- package/dist/plugin-sdk/src/providers/synthetic-models.d.ts +0 -31
- package/dist/plugin-sdk/src/providers/together-models.d.ts +0 -38
- package/dist/plugin-sdk/src/providers/venice-models.d.ts +0 -175
- package/dist/plugin-sdk/src/providers/vercel-ai-gateway-models.d.ts +0 -113
- package/dist/plugin-sdk/src/providers/xiaomi-models.d.ts +0 -21
- package/dist/plugin-sdk/src/realtime-transcription/provider-registry.d.ts +0 -7
- package/dist/plugin-sdk/src/realtime-transcription/provider-types.d.ts +0 -26
- package/dist/plugin-sdk/src/realtime-voice/provider-registry.d.ts +0 -7
- package/dist/plugin-sdk/src/realtime-voice/provider-types.d.ts +0 -55
- package/dist/plugin-sdk/src/routing/account-id.d.ts +0 -3
- package/dist/plugin-sdk/src/routing/account-lookup.d.ts +0 -1
- package/dist/plugin-sdk/src/routing/bindings.d.ts +0 -11
- package/dist/plugin-sdk/src/routing/resolve-route.d.ts +0 -42
- package/dist/plugin-sdk/src/routing/session-key.d.ts +0 -48
- package/dist/plugin-sdk/src/runtime.d.ts +0 -7
- package/dist/plugin-sdk/src/secrets/json-pointer.d.ts +0 -6
- package/dist/plugin-sdk/src/secrets/ref-contract.d.ts +0 -19
- package/dist/plugin-sdk/src/secrets/resolve.d.ts +0 -15
- package/dist/plugin-sdk/src/secrets/runtime-web-tools.types.d.ts +0 -26
- package/dist/plugin-sdk/src/secrets/shared.d.ts +0 -7
- package/dist/plugin-sdk/src/security/audit-channel.d.ts +0 -7
- package/dist/plugin-sdk/src/security/audit-extra.async.d.ts +0 -47
- package/dist/plugin-sdk/src/security/audit-extra.d.ts +0 -10
- package/dist/plugin-sdk/src/security/audit-extra.sync.d.ts +0 -25
- package/dist/plugin-sdk/src/security/audit-fs.d.ts +0 -44
- package/dist/plugin-sdk/src/security/audit-tool-policy.d.ts +0 -1
- package/dist/plugin-sdk/src/security/audit.d.ts +0 -57
- package/dist/plugin-sdk/src/security/channel-metadata.d.ts +0 -6
- package/dist/plugin-sdk/src/security/dangerous-config-flags.d.ts +0 -2
- package/dist/plugin-sdk/src/security/dangerous-tools.d.ts +0 -12
- package/dist/plugin-sdk/src/security/dm-policy-shared.d.ts +0 -93
- package/dist/plugin-sdk/src/security/external-content.d.ts +0 -58
- package/dist/plugin-sdk/src/security/mutable-allowlist-detectors.d.ts +0 -6
- package/dist/plugin-sdk/src/security/safe-regex.d.ts +0 -2
- package/dist/plugin-sdk/src/security/scan-paths.d.ts +0 -5
- package/dist/plugin-sdk/src/security/secret-equal.d.ts +0 -1
- package/dist/plugin-sdk/src/security/skill-scanner.d.ts +0 -25
- package/dist/plugin-sdk/src/security/windows-acl.d.ts +0 -37
- package/dist/plugin-sdk/src/sessions/input-provenance.d.ts +0 -16
- package/dist/plugin-sdk/src/sessions/level-overrides.d.ts +0 -10
- package/dist/plugin-sdk/src/sessions/model-overrides.d.ts +0 -16
- package/dist/plugin-sdk/src/sessions/send-policy.d.ts +0 -11
- package/dist/plugin-sdk/src/sessions/session-key-utils.d.ts +0 -20
- package/dist/plugin-sdk/src/sessions/session-label.d.ts +0 -9
- package/dist/plugin-sdk/src/sessions/transcript-events.d.ts +0 -9
- package/dist/plugin-sdk/src/shared/avatar-policy.d.ts +0 -16
- package/dist/plugin-sdk/src/shared/chat-content.d.ts +0 -5
- package/dist/plugin-sdk/src/shared/chat-envelope.d.ts +0 -2
- package/dist/plugin-sdk/src/shared/config-eval.d.ts +0 -27
- package/dist/plugin-sdk/src/shared/device-auth.d.ts +0 -13
- package/dist/plugin-sdk/src/shared/entry-metadata.d.ts +0 -15
- package/dist/plugin-sdk/src/shared/entry-status.d.ts +0 -47
- package/dist/plugin-sdk/src/shared/frontmatter.d.ts +0 -24
- package/dist/plugin-sdk/src/shared/gateway-bind-url.d.ts +0 -14
- package/dist/plugin-sdk/src/shared/gateway-method-policy.d.ts +0 -8
- package/dist/plugin-sdk/src/shared/model-param-b.d.ts +0 -1
- package/dist/plugin-sdk/src/shared/model-thinking.d.ts +0 -31
- package/dist/plugin-sdk/src/shared/net/ip.d.ts +0 -20
- package/dist/plugin-sdk/src/shared/net/redact-sensitive-url.d.ts +0 -2
- package/dist/plugin-sdk/src/shared/node-list-parse.d.ts +0 -3
- package/dist/plugin-sdk/src/shared/node-list-types.d.ts +0 -48
- package/dist/plugin-sdk/src/shared/node-match.d.ts +0 -9
- package/dist/plugin-sdk/src/shared/operator-scope-compat.d.ts +0 -5
- package/dist/plugin-sdk/src/shared/pid-alive.d.ts +0 -1
- package/dist/plugin-sdk/src/shared/process-scoped-map.d.ts +0 -1
- package/dist/plugin-sdk/src/shared/requirements.d.ts +0 -80
- package/dist/plugin-sdk/src/shared/string-normalization.d.ts +0 -4
- package/dist/plugin-sdk/src/shared/subagents-format.d.ts +0 -15
- package/dist/plugin-sdk/src/shared/tailscale-status.d.ts +0 -8
- package/dist/plugin-sdk/src/shared/text/code-regions.d.ts +0 -6
- package/dist/plugin-sdk/src/shared/text/reasoning-tags.d.ts +0 -6
- package/dist/plugin-sdk/src/shared/text-chunking.d.ts +0 -1
- package/dist/plugin-sdk/src/signal/accounts.d.ts +0 -17
- package/dist/plugin-sdk/src/signal/client.d.ts +0 -32
- package/dist/plugin-sdk/src/signal/daemon.d.ts +0 -26
- package/dist/plugin-sdk/src/signal/format.d.ts +0 -17
- package/dist/plugin-sdk/src/signal/identity.d.ts +0 -24
- package/dist/plugin-sdk/src/signal/index.d.ts +0 -5
- package/dist/plugin-sdk/src/signal/monitor/access-policy.d.ts +0 -40
- package/dist/plugin-sdk/src/signal/monitor/event-handler.d.ts +0 -5
- package/dist/plugin-sdk/src/signal/monitor/event-handler.types.d.ts +0 -125
- package/dist/plugin-sdk/src/signal/monitor/mentions.d.ts +0 -2
- package/dist/plugin-sdk/src/signal/monitor.d.ts +0 -25
- package/dist/plugin-sdk/src/signal/probe.d.ts +0 -7
- package/dist/plugin-sdk/src/signal/reaction-level.d.ts +0 -17
- package/dist/plugin-sdk/src/signal/rpc-context.d.ts +0 -9
- package/dist/plugin-sdk/src/signal/send-reactions.d.ts +0 -32
- package/dist/plugin-sdk/src/signal/send.d.ts +0 -25
- package/dist/plugin-sdk/src/signal/sse-reconnect.d.ts +0 -13
- package/dist/plugin-sdk/src/slack/accounts.d.ts +0 -32
- package/dist/plugin-sdk/src/slack/actions.d.ts +0 -56
- package/dist/plugin-sdk/src/slack/blocks-fallback.d.ts +0 -2
- package/dist/plugin-sdk/src/slack/blocks-input.d.ts +0 -3
- package/dist/plugin-sdk/src/slack/channel-migration.d.ts +0 -20
- package/dist/plugin-sdk/src/slack/client.d.ts +0 -4
- package/dist/plugin-sdk/src/slack/directory-live.d.ts +0 -4
- package/dist/plugin-sdk/src/slack/draft-stream.d.ts +0 -25
- package/dist/plugin-sdk/src/slack/format.d.ts +0 -7
- package/dist/plugin-sdk/src/slack/http/index.d.ts +0 -1
- package/dist/plugin-sdk/src/slack/http/registry.d.ts +0 -12
- package/dist/plugin-sdk/src/slack/index.d.ts +0 -6
- package/dist/plugin-sdk/src/slack/message-actions.d.ts +0 -4
- package/dist/plugin-sdk/src/slack/modal-metadata.d.ts +0 -8
- package/dist/plugin-sdk/src/slack/monitor/allow-list.d.ts +0 -23
- package/dist/plugin-sdk/src/slack/monitor/auth.d.ts +0 -26
- package/dist/plugin-sdk/src/slack/monitor/channel-config.d.ts +0 -43
- package/dist/plugin-sdk/src/slack/monitor/commands.d.ts +0 -9
- package/dist/plugin-sdk/src/slack/monitor/context.d.ts +0 -104
- package/dist/plugin-sdk/src/slack/monitor/dm-auth.d.ts +0 -17
- package/dist/plugin-sdk/src/slack/monitor/events/channels.d.ts +0 -4
- package/dist/plugin-sdk/src/slack/monitor/events/interactions.d.ts +0 -4
- package/dist/plugin-sdk/src/slack/monitor/events/members.d.ts +0 -4
- package/dist/plugin-sdk/src/slack/monitor/events/messages.d.ts +0 -6
- package/dist/plugin-sdk/src/slack/monitor/events/pins.d.ts +0 -4
- package/dist/plugin-sdk/src/slack/monitor/events/reactions.d.ts +0 -4
- package/dist/plugin-sdk/src/slack/monitor/events/system-event-context.d.ts +0 -12
- package/dist/plugin-sdk/src/slack/monitor/events.d.ts +0 -8
- package/dist/plugin-sdk/src/slack/monitor/external-arg-menu-store.d.ts +0 -18
- package/dist/plugin-sdk/src/slack/monitor/media.d.ts +0 -66
- package/dist/plugin-sdk/src/slack/monitor/message-handler/dispatch.d.ts +0 -12
- package/dist/plugin-sdk/src/slack/monitor/message-handler/prepare.d.ts +0 -13
- package/dist/plugin-sdk/src/slack/monitor/message-handler/types.d.ts +0 -22
- package/dist/plugin-sdk/src/slack/monitor/message-handler.d.ts +0 -11
- package/dist/plugin-sdk/src/slack/monitor/mrkdwn.d.ts +0 -1
- package/dist/plugin-sdk/src/slack/monitor/policy.d.ts +0 -5
- package/dist/plugin-sdk/src/slack/monitor/provider.d.ts +0 -7
- package/dist/plugin-sdk/src/slack/monitor/replies.d.ts +0 -54
- package/dist/plugin-sdk/src/slack/monitor/room-context.d.ts +0 -14
- package/dist/plugin-sdk/src/slack/monitor/slash.d.ts +0 -6
- package/dist/plugin-sdk/src/slack/monitor/thread-resolution.d.ts +0 -12
- package/dist/plugin-sdk/src/slack/monitor/types.d.ts +0 -109
- package/dist/plugin-sdk/src/slack/monitor.d.ts +0 -5
- package/dist/plugin-sdk/src/slack/probe.d.ts +0 -14
- package/dist/plugin-sdk/src/slack/resolve-channels.d.ts +0 -19
- package/dist/plugin-sdk/src/slack/resolve-users.d.ts +0 -26
- package/dist/plugin-sdk/src/slack/send.d.ts +0 -22
- package/dist/plugin-sdk/src/slack/stream-mode.d.ts +0 -23
- package/dist/plugin-sdk/src/slack/streaming.d.ts +0 -72
- package/dist/plugin-sdk/src/slack/targets.d.ts +0 -7
- package/dist/plugin-sdk/src/slack/threading-tool-context.d.ts +0 -10
- package/dist/plugin-sdk/src/slack/threading.d.ts +0 -29
- package/dist/plugin-sdk/src/slack/token.d.ts +0 -3
- package/dist/plugin-sdk/src/slack/types.d.ts +0 -58
- package/dist/plugin-sdk/src/tasks/channel-task-ledger.d.ts +0 -9
- package/dist/plugin-sdk/src/tasks/task-executor.d.ts +0 -86
- package/dist/plugin-sdk/src/tasks/task-owner-access.d.ts +0 -12
- package/dist/plugin-sdk/src/tasks/task-registry.d.ts +0 -35
- package/dist/plugin-sdk/src/tasks/task-registry.types.d.ts +0 -114
- package/dist/plugin-sdk/src/tasks/task-status.d.ts +0 -11
- package/dist/plugin-sdk/src/telegram/accounts.d.ts +0 -21
- package/dist/plugin-sdk/src/telegram/allowed-updates.d.ts +0 -4
- package/dist/plugin-sdk/src/telegram/api-logging.d.ts +0 -11
- package/dist/plugin-sdk/src/telegram/audit.d.ts +0 -29
- package/dist/plugin-sdk/src/telegram/bot/delivery.d.ts +0 -35
- package/dist/plugin-sdk/src/telegram/bot/helpers.d.ts +0 -127
- package/dist/plugin-sdk/src/telegram/bot/types.d.ts +0 -28
- package/dist/plugin-sdk/src/telegram/bot-access.d.ts +0 -26
- package/dist/plugin-sdk/src/telegram/bot-handlers.d.ts +0 -2
- package/dist/plugin-sdk/src/telegram/bot-message-context.d.ts +0 -149
- package/dist/plugin-sdk/src/telegram/bot-message-dispatch.d.ts +0 -29
- package/dist/plugin-sdk/src/telegram/bot-message.d.ts +0 -20
- package/dist/plugin-sdk/src/telegram/bot-native-command-menu.d.ts +0 -33
- package/dist/plugin-sdk/src/telegram/bot-native-commands.d.ts +0 -58
- package/dist/plugin-sdk/src/telegram/bot-updates.d.ts +0 -31
- package/dist/plugin-sdk/src/telegram/bot.d.ts +0 -62
- package/dist/plugin-sdk/src/telegram/button-types.d.ts +0 -7
- package/dist/plugin-sdk/src/telegram/caption.d.ts +0 -5
- package/dist/plugin-sdk/src/telegram/dm-access.d.ts +0 -18
- package/dist/plugin-sdk/src/telegram/draft-stream.d.ts +0 -37
- package/dist/plugin-sdk/src/telegram/fetch.d.ts +0 -5
- package/dist/plugin-sdk/src/telegram/format.d.ts +0 -18
- package/dist/plugin-sdk/src/telegram/group-access.d.ts +0 -54
- package/dist/plugin-sdk/src/telegram/group-config-helpers.d.ts +0 -8
- package/dist/plugin-sdk/src/telegram/group-migration.d.ts +0 -20
- package/dist/plugin-sdk/src/telegram/inline-buttons.d.ts +0 -11
- package/dist/plugin-sdk/src/telegram/lane-delivery.d.ts +0 -56
- package/dist/plugin-sdk/src/telegram/model-buttons.d.ts +0 -63
- package/dist/plugin-sdk/src/telegram/monitor.d.ts +0 -19
- package/dist/plugin-sdk/src/telegram/network-config.d.ts +0 -33
- package/dist/plugin-sdk/src/telegram/network-errors.d.ts +0 -5
- package/dist/plugin-sdk/src/telegram/outbound-params.d.ts +0 -2
- package/dist/plugin-sdk/src/telegram/probe.d.ts +0 -17
- package/dist/plugin-sdk/src/telegram/proxy.d.ts +0 -1
- package/dist/plugin-sdk/src/telegram/reaction-level.d.ts +0 -11
- package/dist/plugin-sdk/src/telegram/reasoning-lane-coordinator.d.ts +0 -18
- package/dist/plugin-sdk/src/telegram/send.d.ts +0 -153
- package/dist/plugin-sdk/src/telegram/sendchataction-401-backoff.d.ts +0 -28
- package/dist/plugin-sdk/src/telegram/sent-message-cache.d.ts +0 -16
- package/dist/plugin-sdk/src/telegram/status-reaction-variants.d.ts +0 -21
- package/dist/plugin-sdk/src/telegram/sticker-cache.d.ts +0 -46
- package/dist/plugin-sdk/src/telegram/target-writeback.d.ts +0 -7
- package/dist/plugin-sdk/src/telegram/targets.d.ts +0 -11
- package/dist/plugin-sdk/src/telegram/token.d.ts +0 -13
- package/dist/plugin-sdk/src/telegram/update-offset-store.d.ts +0 -15
- package/dist/plugin-sdk/src/telegram/voice.d.ts +0 -16
- package/dist/plugin-sdk/src/telegram/webhook.d.ts +0 -20
- package/dist/plugin-sdk/src/terminal/ansi.d.ts +0 -2
- package/dist/plugin-sdk/src/terminal/health-style.d.ts +0 -1
- package/dist/plugin-sdk/src/terminal/links.d.ts +0 -6
- package/dist/plugin-sdk/src/terminal/palette.d.ts +0 -10
- package/dist/plugin-sdk/src/terminal/progress-line.d.ts +0 -3
- package/dist/plugin-sdk/src/terminal/prompt-style.d.ts +0 -6
- package/dist/plugin-sdk/src/terminal/restore.d.ts +0 -17
- package/dist/plugin-sdk/src/terminal/table.d.ts +0 -18
- package/dist/plugin-sdk/src/terminal/theme.d.ts +0 -18
- package/dist/plugin-sdk/src/tts/tts-core.d.ts +0 -52
- package/dist/plugin-sdk/src/tts/tts.d.ts +0 -194
- package/dist/plugin-sdk/src/utils/account-id.d.ts +0 -1
- package/dist/plugin-sdk/src/utils/boolean.d.ts +0 -5
- package/dist/plugin-sdk/src/utils/chunk-items.d.ts +0 -1
- package/dist/plugin-sdk/src/utils/delivery-context.d.ts +0 -29
- package/dist/plugin-sdk/src/utils/directive-tags.d.ts +0 -29
- package/dist/plugin-sdk/src/utils/fetch-timeout.d.ts +0 -13
- package/dist/plugin-sdk/src/utils/mask-api-key.d.ts +0 -1
- package/dist/plugin-sdk/src/utils/message-channel.d.ts +0 -27
- package/dist/plugin-sdk/src/utils/normalize-secret-input.d.ts +0 -11
- package/dist/plugin-sdk/src/utils/private-network-url.d.ts +0 -1
- package/dist/plugin-sdk/src/utils/provider-utils.d.ts +0 -9
- package/dist/plugin-sdk/src/utils/queue-helpers.d.ts +0 -80
- package/dist/plugin-sdk/src/utils/reaction-level.d.ts +0 -15
- package/dist/plugin-sdk/src/utils/run-with-concurrency.d.ts +0 -11
- package/dist/plugin-sdk/src/utils/safe-json.d.ts +0 -1
- package/dist/plugin-sdk/src/utils/shell-argv.d.ts +0 -1
- package/dist/plugin-sdk/src/utils/transcript-tools.d.ts +0 -8
- package/dist/plugin-sdk/src/utils/usage-format.d.ts +0 -26
- package/dist/plugin-sdk/src/utils/with-timeout.d.ts +0 -1
- package/dist/plugin-sdk/src/utils.d.ts +0 -63
- package/dist/plugin-sdk/src/version.d.ts +0 -8
- package/dist/plugin-sdk/src/video-generation/dashscope-compatible.d.ts +0 -45
- package/dist/plugin-sdk/src/video-generation/types.d.ts +0 -79
- package/dist/plugin-sdk/src/wallet/chat-command.d.ts +0 -17
- package/dist/plugin-sdk/src/wallet/local-socket-signer-broker.d.ts +0 -13
- package/dist/plugin-sdk/src/wallet/local-socket-signer-custody.d.ts +0 -35
- package/dist/plugin-sdk/src/wallet/local-socket-signer-protocol.d.ts +0 -191
- package/dist/plugin-sdk/src/wallet/providers/alchemy-adapter.d.ts +0 -29
- package/dist/plugin-sdk/src/wallet/providers/embedded-keystore-adapter.d.ts +0 -37
- package/dist/plugin-sdk/src/wallet/providers/local-socket-signer-adapter.d.ts +0 -44
- package/dist/plugin-sdk/src/wallet/providers/privy-adapter.d.ts +0 -31
- package/dist/plugin-sdk/src/wallet/providers/turnkey-adapter.d.ts +0 -33
- package/dist/plugin-sdk/src/wallet/solana-address.d.ts +0 -2
- package/dist/plugin-sdk/src/wallet/solana-assets.d.ts +0 -80
- package/dist/plugin-sdk/src/wallet/solana-bond-signing.d.ts +0 -20
- package/dist/plugin-sdk/src/wallet/solana-spl-transfer.d.ts +0 -33
- package/dist/plugin-sdk/src/wallet/solana-swap.d.ts +0 -93
- package/dist/plugin-sdk/src/wallet/solana-token-resolver.d.ts +0 -36
- package/dist/plugin-sdk/src/wallet/solana-transaction-inspection.d.ts +0 -16
- package/dist/plugin-sdk/src/wallet/solana-trigger.d.ts +0 -74
- package/dist/plugin-sdk/src/wallet/trade-chat-command.d.ts +0 -18
- package/dist/plugin-sdk/src/wallet/wallet-agent-selection.d.ts +0 -43
- package/dist/plugin-sdk/src/wallet/wallet-approval-auth.d.ts +0 -212
- package/dist/plugin-sdk/src/wallet/wallet-audit-log.d.ts +0 -18
- package/dist/plugin-sdk/src/wallet/wallet-canary.d.ts +0 -47
- package/dist/plugin-sdk/src/wallet/wallet-custody.d.ts +0 -313
- package/dist/plugin-sdk/src/wallet/wallet-inbound-events.d.ts +0 -88
- package/dist/plugin-sdk/src/wallet/wallet-observability.d.ts +0 -16
- package/dist/plugin-sdk/src/wallet/wallet-policy-simulation.d.ts +0 -61
- package/dist/plugin-sdk/src/wallet/wallet-policy.d.ts +0 -144
- package/dist/plugin-sdk/src/wallet/wallet-provider-adapter.d.ts +0 -111
- package/dist/plugin-sdk/src/wallet/wallet-provider-capabilities.d.ts +0 -51
- package/dist/plugin-sdk/src/wallet/wallet-provider-registry.d.ts +0 -128
- package/dist/plugin-sdk/src/wallet/wallet-provider-resolver.d.ts +0 -17
- package/dist/plugin-sdk/src/wallet/wallet-redaction.d.ts +0 -3
- package/dist/plugin-sdk/src/wallet/wallet-runtime-config.d.ts +0 -93
- package/dist/plugin-sdk/src/wallet/wallet-secrets-store.d.ts +0 -63
- package/dist/plugin-sdk/src/wallet/wallet-send-approvals.d.ts +0 -165
- package/dist/plugin-sdk/src/wallet/wallet-settlement-links.d.ts +0 -57
- package/dist/plugin-sdk/src/wallet/wallet-status.d.ts +0 -106
- package/dist/plugin-sdk/src/wallet/wallet-task-ledger.d.ts +0 -7
- package/dist/plugin-sdk/src/web/accounts.d.ts +0 -39
- package/dist/plugin-sdk/src/web/active-listener.d.ts +0 -26
- package/dist/plugin-sdk/src/web/auth-store.d.ts +0 -26
- package/dist/plugin-sdk/src/web/auto-reply/constants.d.ts +0 -1
- package/dist/plugin-sdk/src/web/auto-reply/deliver-reply.d.ts +0 -19
- package/dist/plugin-sdk/src/web/auto-reply/heartbeat-runner.d.ts +0 -20
- package/dist/plugin-sdk/src/web/auto-reply/loggers.d.ts +0 -4
- package/dist/plugin-sdk/src/web/auto-reply/mentions.d.ts +0 -19
- package/dist/plugin-sdk/src/web/auto-reply/monitor/ack-reaction.d.ts +0 -13
- package/dist/plugin-sdk/src/web/auto-reply/monitor/broadcast.d.ts +0 -16
- package/dist/plugin-sdk/src/web/auto-reply/monitor/commands.d.ts +0 -2
- package/dist/plugin-sdk/src/web/auto-reply/monitor/echo.d.ts +0 -17
- package/dist/plugin-sdk/src/web/auto-reply/monitor/group-activation.d.ts +0 -9
- package/dist/plugin-sdk/src/web/auto-reply/monitor/group-gating.d.ts +0 -33
- package/dist/plugin-sdk/src/web/auto-reply/monitor/group-members.d.ts +0 -6
- package/dist/plugin-sdk/src/web/auto-reply/monitor/last-route.d.ts +0 -15
- package/dist/plugin-sdk/src/web/auto-reply/monitor/message-line.d.ts +0 -11
- package/dist/plugin-sdk/src/web/auto-reply/monitor/on-message.d.ts +0 -24
- package/dist/plugin-sdk/src/web/auto-reply/monitor/peer.d.ts +0 -2
- package/dist/plugin-sdk/src/web/auto-reply/monitor/process-message.d.ts +0 -40
- package/dist/plugin-sdk/src/web/auto-reply/monitor.d.ts +0 -5
- package/dist/plugin-sdk/src/web/auto-reply/session-snapshot.d.ts +0 -17
- package/dist/plugin-sdk/src/web/auto-reply/types.d.ts +0 -30
- package/dist/plugin-sdk/src/web/auto-reply/util.d.ts +0 -2
- package/dist/plugin-sdk/src/web/auto-reply.d.ts +0 -1
- package/dist/plugin-sdk/src/web/auto-reply.impl.d.ts +0 -6
- package/dist/plugin-sdk/src/web/inbound/access-control.d.ts +0 -36
- package/dist/plugin-sdk/src/web/inbound/dedupe.d.ts +0 -2
- package/dist/plugin-sdk/src/web/inbound/extract.d.ts +0 -13
- package/dist/plugin-sdk/src/web/inbound/media.d.ts +0 -7
- package/dist/plugin-sdk/src/web/inbound/monitor.d.ts +0 -30
- package/dist/plugin-sdk/src/web/inbound/send-api.d.ts +0 -22
- package/dist/plugin-sdk/src/web/inbound/types.d.ts +0 -41
- package/dist/plugin-sdk/src/web/inbound.d.ts +0 -4
- package/dist/plugin-sdk/src/web/login-qr.d.ts +0 -19
- package/dist/plugin-sdk/src/web/login.d.ts +0 -3
- package/dist/plugin-sdk/src/web/media.d.ts +0 -43
- package/dist/plugin-sdk/src/web/outbound.d.ts +0 -25
- package/dist/plugin-sdk/src/web/qr-image.d.ts +0 -4
- package/dist/plugin-sdk/src/web/reconnect.d.ts +0 -12
- package/dist/plugin-sdk/src/web/session.d.ts +0 -14
- package/dist/plugin-sdk/src/web/vcard.d.ts +0 -6
- package/dist/plugin-sdk/src/whatsapp/normalize.d.ts +0 -6
- package/dist/plugin-sdk/src/whatsapp/resolve-outbound-target.d.ts +0 -12
- package/dist/plugin-sdk/src/wizard/onboarding.types.d.ts +0 -31
- package/dist/plugin-sdk/src/wizard/onboarding.wallet.d.ts +0 -45
- package/dist/plugin-sdk/src/wizard/prompts.d.ts +0 -45
- package/dist/plugin-sdk/src/wizard/session.d.ts +0 -42
- package/dist/plugin-sdk/ssrf-Cce6LubA.js +0 -421
- package/dist/plugin-sdk/ssrf-Cg5wg0v3.js +0 -4
- package/dist/plugin-sdk/status-B2vb7zNW.js +0 -106417
- package/dist/plugin-sdk/sticker-cache-C1vOWkzA.js +0 -170
- package/dist/plugin-sdk/sticker-cache-CJDzqowL.js +0 -170
- package/dist/plugin-sdk/subsystem-BmpnSVOu.js +0 -358
- package/dist/plugin-sdk/tables-BD7H5ug-.js +0 -55
- package/dist/plugin-sdk/tables-CJE8kB35.js +0 -55
- package/dist/plugin-sdk/target-errors-kz4lDpCF.js +0 -26
- package/dist/plugin-sdk/targets-4QTk4tTz.js +0 -45
- package/dist/plugin-sdk/targets-DmSpDM4F.js +0 -45
- package/dist/plugin-sdk/targets-cA134MEE.js +0 -101
- package/dist/plugin-sdk/targets-t1hbjHdJ.js +0 -101
- package/dist/plugin-sdk/telegram-actions-BoiC9J7L.js +0 -307
- package/dist/plugin-sdk/telegram-actions-CwAsKaNz.js +0 -307
- package/dist/plugin-sdk/thread-bindings.lifecycle-Djem8FWF.js +0 -737
- package/dist/plugin-sdk/thread-bindings.lifecycle-gmHv3hc7.js +0 -737
- package/dist/plugin-sdk/thread-bindings.state-CNT2vxm3.js +0 -643
- package/dist/plugin-sdk/thread-bindings.state-D8kN2X6H.js +0 -643
- package/dist/plugin-sdk/token-BWZYO8QR.js +0 -36
- package/dist/plugin-sdk/tokens-BK5rrwBB.js +0 -72
- package/dist/plugin-sdk/tokens-CQRTq-NN.js +0 -72
- package/dist/plugin-sdk/tool-loop-detection-Ci_YYA7P.js +0 -352
- package/dist/plugin-sdk/transcript-events-BJQWUdmU.js +0 -24
- package/dist/plugin-sdk/ui-7sxJ-x37.js +0 -33
- package/dist/plugin-sdk/ui-BQ-Vvq_c.js +0 -33
- package/dist/plugin-sdk/utils-LGKVujSU.js +0 -237
- package/dist/plugin-sdk/web-BjV7ROeA.js +0 -2226
- package/dist/plugin-sdk/web-DjTSgU98.js +0 -2226
- package/dist/plugin-sdk/whatsapp-actions-68Mfs2dJ.js +0 -123
- package/dist/plugin-sdk/whatsapp-actions-DRqtzvTO.js +0 -123
- package/dist/plugin-sdk/wsl-DcM2PgSS.js +0 -1016
- package/dist/plugin-sdk/wsl-PXrdWitE.js +0 -1016
- /package/dist/plugin-sdk/{channel-activity-Cf5sKkfd.js → channel-activity-B7MIaDei.js} +0 -0
- /package/dist/plugin-sdk/{client-DWTXscox.js → client-BTUzO_8g.js} +0 -0
- /package/dist/plugin-sdk/{command-poll-backoff-C2vOB38t.js → command-poll-backoff-CBq0jVRw.js} +0 -0
- /package/dist/plugin-sdk/{date-time-Bo5FVB7G.js → date-time-Bbp5JvNw.js} +0 -0
- /package/dist/plugin-sdk/{diagnostic-session-state-CT36_PCE.js → diagnostic-session-state-B-9PL5r7.js} +0 -0
- /package/dist/plugin-sdk/{draft-stream-loop-2KC6-8CG.js → draft-stream-loop-DZ1OAyye.js} +0 -0
- /package/dist/plugin-sdk/{fetch-headers-BTcaUCW6.js → fetch-headers-DvXyXtoI.js} +0 -0
- /package/dist/plugin-sdk/{fetch-timeout-Dyj5Y_Ss.js → fetch-timeout-jOIu9Xud.js} +0 -0
- /package/dist/plugin-sdk/{gateway-registry-CtUjFG3Q.js → gateway-registry-C-MTEdvG.js} +0 -0
- /package/dist/plugin-sdk/{inbound-context-Daf9i2Me.js → inbound-context-BNCTzgjG.js} +0 -0
- /package/dist/plugin-sdk/{internal-DFhCtnuk.js → internal-CC6TMTtc.js} +0 -0
- /package/dist/plugin-sdk/{media-payload-CcW51vQj.js → media-payload-DpYEcV-X.js} +0 -0
- /package/dist/plugin-sdk/{polls-B4cMiwMo.js → polls-Dy1NsYKT.js} +0 -0
- /package/dist/plugin-sdk/{proxy-CKQOQYAl.js → proxy-R5TjOIFS.js} +0 -0
- /package/dist/plugin-sdk/{qmd-scope-ubzoBMhc.js → qmd-scope-C9tRnohc.js} +0 -0
- /package/dist/plugin-sdk/{redact-identifier-BAD7jXcr.js → redact-identifier-CDvAeiFm.js} +0 -0
- /package/dist/plugin-sdk/{redact-sensitive-url-DK8OUExz.js → redact-sensitive-url-B0RJQqO7.js} +0 -0
- /package/dist/plugin-sdk/{render-C9LkRUhd.js → render-K7NwXvVu.js} +0 -0
- /package/dist/plugin-sdk/{reply-reference-DxIu2vr0.js → reply-reference-CWEIswqw.js} +0 -0
- /package/dist/plugin-sdk/{secure-random-CO1VkMEt.js → secure-random-C2EhANj2.js} +0 -0
- /package/dist/plugin-sdk/{target-errors-Dn4aykSV.js → target-errors-C0yNDbGS.js} +0 -0
- /package/dist/plugin-sdk/{tool-loop-detection-D6OX2-I9.js → tool-loop-detection-P5u2k0_f.js} +0 -0
- /package/dist/plugin-sdk/{with-timeout-DqkblR98.js → with-timeout-Dl513q34.js} +0 -0
|
@@ -1,3731 +0,0 @@
|
|
|
1
|
-
import { A as clearHistoryEntriesIfEnabled, Ct as enqueueSystemEvent, E as DEFAULT_GROUP_HISTORY_LIMIT, F as recordInboundSession, Gt as hasControlCommand, H as createInboundDebouncer, I as removeAckReactionAfterReply, J as createReplyDispatcherWithTyping, Jt as buildMentionRegexes, K as resolveEnvelopeFormatOptions, L as shouldAckReaction, N as recordPendingHistoryEntryIfEnabled, O as buildPendingHistoryContextFromMap, Sr as warnMissingProviderGroupPolicyFallbackOnce, Tt as resolveChannelConfigWrites, U as resolveInboundDebounceMs, W as formatInboundEnvelope, Yt as matchesMentionWithExplicit, _r as resolveControlCommandGate, b as logInboundDrop, bn as installRequestBodyLimitGuard, br as resolveDefaultGroupPolicy, cr as pruneMapToMaxSize, d as issuePairingChallenge, dt as normalizeAllowList, f as createTypingCallbacks, fr as readStoreAllowFromForDmPolicy, ft as normalizeAllowListLower, gr as resolveCommandAuthorizedFromAuthorizers, ht as resolveSlackUserAllowed, m as resolveMentionGatingWithBypass, mt as resolveSlackAllowListMatch, pt as normalizeSlackSlug, q as dispatchInboundMessage, sr as createDedupeCache, ut as allowListMatches, x as logTypingFailure, xr as resolveOpenProviderRuntimeGroupPolicy, y as logAckFailure } from "./pi-embedded-runner-Dum71Tdo.js";
|
|
2
|
-
import { K as resolveSessionKey, S as readSessionUpdatedAt, w as updateLastRoute } from "./runtime-BPyuAmka.js";
|
|
3
|
-
import { r as createNonExitingRuntime } from "./subsystem-DBPNbQDQ.js";
|
|
4
|
-
import { i as logVerbose, l as warn, p as getChildLogger, s as shouldLogVerbose, t as danger } from "./globals-B_jjtAje.js";
|
|
5
|
-
import "./paths-BEmvSyOV.js";
|
|
6
|
-
import "./utils-CYk9EKoq.js";
|
|
7
|
-
import { At as resolveSlackStreamingMode, Dt as mapStreamingModeToSlackLegacyDraftStreamMode, kt as resolveSlackNativeStreaming, n as loadConfig, s as writeConfigFile } from "./config-DtqAN2L3.js";
|
|
8
|
-
import "./agent-scope-kIJqg5PA.js";
|
|
9
|
-
import { n as resolveConversationLabel } from "./conversation-label-BoVqak2R.js";
|
|
10
|
-
import { c as normalizeMainKey, p as normalizeAccountId, u as resolveThreadSessionKeys } from "./session-key-HSJ2KQTc.js";
|
|
11
|
-
import "./accounts-D7_p-Ivb.js";
|
|
12
|
-
import { i as resolveSlackBotToken, r as resolveSlackAppToken, t as resolveSlackAccount } from "./accounts-DTdM1xcj.js";
|
|
13
|
-
import "./accounts-RT6y7n3H.js";
|
|
14
|
-
import "./tokens-CQRTq-NN.js";
|
|
15
|
-
import { S as resolveChannelEntryMatchWithFallback, v as applyChannelMatchMeta, y as buildChannelKeyCandidates } from "./allow-list-C9N6FKeC.js";
|
|
16
|
-
import { a as patchAllowlistUsersInConfigEntries, c as formatAllowlistMatchMeta, i as mergeAllowlist, n as buildAllowlistResolutionSummary, o as summarizeMapping, s as isDangerousNameMatchingEnabled, t as addAllowlistUserEntriesFromConfigEntry } from "./resolve-utils-DrvLA82C.js";
|
|
17
|
-
import "./redact-CwCz68Mi.js";
|
|
18
|
-
import "./github-copilot-token-Dgug856m.js";
|
|
19
|
-
import "./retry-DycQ4ymF.js";
|
|
20
|
-
import { l as resolveStorePath } from "./paths-B88DQEK8.js";
|
|
21
|
-
import { l as normalizeHostname } from "./optional-runtime-dependency-szS49voX.js";
|
|
22
|
-
import "./fetch-guard-DTKgMN9f.js";
|
|
23
|
-
import "./send-DRGzRdI3.js";
|
|
24
|
-
import { V as upsertChannelPairingRequest } from "./wsl-PXrdWitE.js";
|
|
25
|
-
import { l as resolveTextChunkLimit } from "./chunk-M2d7r-Zt.js";
|
|
26
|
-
import { a as resolveAckReaction, c as resolveHumanDelayConfig, n as createReplyPrefixOptions } from "./reply-prefix-DqlCqHXT.js";
|
|
27
|
-
import "./skill-commands-CkgGmWBS.js";
|
|
28
|
-
import { t as generateSecureToken } from "./secure-random-DLpYiUzR.js";
|
|
29
|
-
import "./diagnostic-CuhHqubd.js";
|
|
30
|
-
import "./diagnostic-session-state-Zw87xFym.js";
|
|
31
|
-
import { l as fetchRemoteMedia } from "./media-Cxw-xLGU.js";
|
|
32
|
-
import "./pi-model-discovery-yifTIDIn.js";
|
|
33
|
-
import "./runtime-dependency-Csswyv5r.js";
|
|
34
|
-
import "./path-alias-guards-CcQroDXQ.js";
|
|
35
|
-
import "./fs-safe-BPYS6-j1.js";
|
|
36
|
-
import "./markdown-tables-CCSD52rA.js";
|
|
37
|
-
import "./send-D7tr-EsH.js";
|
|
38
|
-
import { a as saveMediaBuffer } from "./outbound-attachment-C-jSFaEB.js";
|
|
39
|
-
import "./fetch-D70syO9t.js";
|
|
40
|
-
import "./thread-bindings.state-CNT2vxm3.js";
|
|
41
|
-
import "./memory-search-J6AYuENR.js";
|
|
42
|
-
import "./manager-D2kZ0Cps.js";
|
|
43
|
-
import "./query-expansion-VePrajug.js";
|
|
44
|
-
import "./common-Cpw-vuuM.js";
|
|
45
|
-
import { E as resolveNativeSkillsEnabled, T as resolveNativeCommandsEnabled, g as shouldHandleTextCommands } from "./commands-registry-CdT-nl7v.js";
|
|
46
|
-
import { t as finalizeInboundContext } from "./inbound-context-Daf9i2Me.js";
|
|
47
|
-
import "./directory-live-BxSH0XXX.js";
|
|
48
|
-
import "./targets-cA134MEE.js";
|
|
49
|
-
import "./sandbox-paths-CkTERCrj.js";
|
|
50
|
-
import { n as resolveAgentRoute } from "./resolve-route-CNhTJG_2.js";
|
|
51
|
-
import "./render-C9LkRUhd.js";
|
|
52
|
-
import "./tables-CJE8kB35.js";
|
|
53
|
-
import { t as sendMessageSlack } from "./send-DfkPKz_0.js";
|
|
54
|
-
import { r as resolveSlackWebClientOptions } from "./client-DWTXscox.js";
|
|
55
|
-
import { a as listSlackPins, c as reactSlackMessage, d as removeSlackReaction, f as sendSlackMessage, i as listSlackEmojis, l as readSlackMessages, n as editSlackMessage, o as listSlackReactions, p as unpinSlackMessage, r as getSlackMemberInfo, s as pinSlackMessage, t as deleteSlackMessage, u as removeOwnSlackReactions } from "./actions-BrU_JMqM.js";
|
|
56
|
-
import { n as buildUntrustedChannelMetadata, t as chunkItems } from "./chunk-items-BDhRe_xU.js";
|
|
57
|
-
import { t as createDraftStreamLoop } from "./draft-stream-loop-2KC6-8CG.js";
|
|
58
|
-
import { t as resolveSlackUserAllowlist } from "./resolve-users-sv9og6yh.js";
|
|
59
|
-
import { i as resolveSlackThreadTs, n as deliverReplies, t as createSlackReplyDeliveryPlan } from "./replies-fvzN5wnU.js";
|
|
60
|
-
import { t as resolveSlackChannelAllowlist } from "./probe-CsFmvxbr.js";
|
|
61
|
-
import { t as probeSlack } from "./probe-Ba4KG8Vi.js";
|
|
62
|
-
import SlackBolt from "@slack/bolt";
|
|
63
|
-
|
|
64
|
-
//#region src/slack/http/registry.ts
|
|
65
|
-
const slackHttpRoutes = /* @__PURE__ */ new Map();
|
|
66
|
-
function normalizeSlackWebhookPath(path) {
|
|
67
|
-
const trimmed = path?.trim();
|
|
68
|
-
if (!trimmed) return "/slack/events";
|
|
69
|
-
return trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
|
|
70
|
-
}
|
|
71
|
-
function registerSlackHttpHandler(params) {
|
|
72
|
-
const normalizedPath = normalizeSlackWebhookPath(params.path);
|
|
73
|
-
if (slackHttpRoutes.has(normalizedPath)) {
|
|
74
|
-
const suffix = params.accountId ? ` for account "${params.accountId}"` : "";
|
|
75
|
-
params.log?.(`slack: webhook path ${normalizedPath} already registered${suffix}`);
|
|
76
|
-
return () => {};
|
|
77
|
-
}
|
|
78
|
-
slackHttpRoutes.set(normalizedPath, params.handler);
|
|
79
|
-
return () => {
|
|
80
|
-
slackHttpRoutes.delete(normalizedPath);
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
//#endregion
|
|
85
|
-
//#region src/slack/monitor/commands.ts
|
|
86
|
-
/**
|
|
87
|
-
* Strip Slack mentions (<@U123>, <@U123|name>) so command detection works on
|
|
88
|
-
* normalized text. Use in both prepare and debounce gate for consistency.
|
|
89
|
-
*/
|
|
90
|
-
function stripSlackMentionsForCommandDetection(text) {
|
|
91
|
-
return (text ?? "").replace(/<@[^>]+>/g, " ").replace(/\s+/g, " ").trim();
|
|
92
|
-
}
|
|
93
|
-
function normalizeSlackSlashCommandName(raw) {
|
|
94
|
-
return raw.replace(/^\/+/, "");
|
|
95
|
-
}
|
|
96
|
-
function resolveSlackSlashCommandConfig(raw) {
|
|
97
|
-
const name = normalizeSlackSlashCommandName(raw?.name?.trim() || "fased") || "fased";
|
|
98
|
-
return {
|
|
99
|
-
enabled: raw?.enabled === true,
|
|
100
|
-
name,
|
|
101
|
-
sessionPrefix: raw?.sessionPrefix?.trim() || "slack:slash",
|
|
102
|
-
ephemeral: raw?.ephemeral !== false
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
function buildSlackSlashCommandMatcher(name) {
|
|
106
|
-
const escaped = normalizeSlackSlashCommandName(name).replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
107
|
-
return new RegExp(`^/?${escaped}$`);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
//#endregion
|
|
111
|
-
//#region src/slack/monitor/policy.ts
|
|
112
|
-
function isSlackChannelAllowedByPolicy(params) {
|
|
113
|
-
const { groupPolicy, channelAllowlistConfigured, channelAllowed } = params;
|
|
114
|
-
if (groupPolicy === "disabled") return false;
|
|
115
|
-
if (groupPolicy === "open") return true;
|
|
116
|
-
if (!channelAllowlistConfigured) return false;
|
|
117
|
-
return channelAllowed;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
//#endregion
|
|
121
|
-
//#region src/slack/monitor/channel-config.ts
|
|
122
|
-
function firstDefined(...values) {
|
|
123
|
-
for (const value of values) if (typeof value !== "undefined") return value;
|
|
124
|
-
}
|
|
125
|
-
function resolveSlackChannelLabel(params) {
|
|
126
|
-
const channelName = params.channelName?.trim();
|
|
127
|
-
if (channelName) return `#${normalizeSlackSlug(channelName) || channelName}`;
|
|
128
|
-
const channelId = params.channelId?.trim();
|
|
129
|
-
return channelId ? `#${channelId}` : "unknown channel";
|
|
130
|
-
}
|
|
131
|
-
function resolveSlackChannelConfig(params) {
|
|
132
|
-
const { channelId, channelName, channels, defaultRequireMention } = params;
|
|
133
|
-
const entries = channels ?? {};
|
|
134
|
-
const keys = Object.keys(entries);
|
|
135
|
-
const normalizedName = channelName ? normalizeSlackSlug(channelName) : "";
|
|
136
|
-
const directName = channelName ? channelName.trim() : "";
|
|
137
|
-
const channelIdLower = channelId.toLowerCase();
|
|
138
|
-
const channelIdUpper = channelId.toUpperCase();
|
|
139
|
-
const match = resolveChannelEntryMatchWithFallback({
|
|
140
|
-
entries,
|
|
141
|
-
keys: buildChannelKeyCandidates(channelId, channelIdLower !== channelId ? channelIdLower : void 0, channelIdUpper !== channelId ? channelIdUpper : void 0, channelName ? `#${directName}` : void 0, directName, normalizedName),
|
|
142
|
-
wildcardKey: "*"
|
|
143
|
-
});
|
|
144
|
-
const { entry: matched, wildcardEntry: fallback } = match;
|
|
145
|
-
const requireMentionDefault = defaultRequireMention ?? true;
|
|
146
|
-
if (keys.length === 0) return {
|
|
147
|
-
allowed: true,
|
|
148
|
-
requireMention: requireMentionDefault
|
|
149
|
-
};
|
|
150
|
-
if (!matched && !fallback) return {
|
|
151
|
-
allowed: false,
|
|
152
|
-
requireMention: requireMentionDefault
|
|
153
|
-
};
|
|
154
|
-
const resolved = matched ?? fallback ?? {};
|
|
155
|
-
return applyChannelMatchMeta({
|
|
156
|
-
allowed: firstDefined(resolved.enabled, resolved.allow, fallback?.enabled, fallback?.allow, true) ?? true,
|
|
157
|
-
requireMention: firstDefined(resolved.requireMention, fallback?.requireMention, requireMentionDefault) ?? requireMentionDefault,
|
|
158
|
-
allowBots: firstDefined(resolved.allowBots, fallback?.allowBots),
|
|
159
|
-
users: firstDefined(resolved.users, fallback?.users),
|
|
160
|
-
skills: firstDefined(resolved.skills, fallback?.skills),
|
|
161
|
-
systemPrompt: firstDefined(resolved.systemPrompt, fallback?.systemPrompt)
|
|
162
|
-
}, match);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
//#endregion
|
|
166
|
-
//#region src/slack/monitor/context.ts
|
|
167
|
-
function inferSlackChannelType(channelId) {
|
|
168
|
-
const trimmed = channelId?.trim();
|
|
169
|
-
if (!trimmed) return;
|
|
170
|
-
if (trimmed.startsWith("D")) return "im";
|
|
171
|
-
if (trimmed.startsWith("C")) return "channel";
|
|
172
|
-
if (trimmed.startsWith("G")) return "group";
|
|
173
|
-
}
|
|
174
|
-
function normalizeSlackChannelType(channelType, channelId) {
|
|
175
|
-
const normalized = channelType?.trim().toLowerCase();
|
|
176
|
-
const inferred = inferSlackChannelType(channelId);
|
|
177
|
-
if (normalized === "im" || normalized === "mpim" || normalized === "channel" || normalized === "group") {
|
|
178
|
-
if (inferred === "im" && normalized !== "im") return "im";
|
|
179
|
-
return normalized;
|
|
180
|
-
}
|
|
181
|
-
return inferred ?? "channel";
|
|
182
|
-
}
|
|
183
|
-
function createSlackMonitorContext(params) {
|
|
184
|
-
const channelHistories = /* @__PURE__ */ new Map();
|
|
185
|
-
const logger = getChildLogger({ module: "slack-auto-reply" });
|
|
186
|
-
const channelCache = /* @__PURE__ */ new Map();
|
|
187
|
-
const userCache = /* @__PURE__ */ new Map();
|
|
188
|
-
const seenMessages = createDedupeCache({
|
|
189
|
-
ttlMs: 6e4,
|
|
190
|
-
maxSize: 500
|
|
191
|
-
});
|
|
192
|
-
const allowFrom = normalizeAllowList(params.allowFrom);
|
|
193
|
-
const groupDmChannels = normalizeAllowList(params.groupDmChannels);
|
|
194
|
-
const defaultRequireMention = params.defaultRequireMention ?? true;
|
|
195
|
-
const markMessageSeen = (channelId, ts) => {
|
|
196
|
-
if (!channelId || !ts) return false;
|
|
197
|
-
return seenMessages.check(`${channelId}:${ts}`);
|
|
198
|
-
};
|
|
199
|
-
const resolveSlackSystemEventSessionKey = (p) => {
|
|
200
|
-
const channelId = p.channelId?.trim() ?? "";
|
|
201
|
-
if (!channelId) return params.mainKey;
|
|
202
|
-
const channelType = normalizeSlackChannelType(p.channelType, channelId);
|
|
203
|
-
const isDirectMessage = channelType === "im";
|
|
204
|
-
const isGroup = channelType === "mpim";
|
|
205
|
-
const from = isDirectMessage ? `slack:${channelId}` : isGroup ? `slack:group:${channelId}` : `slack:channel:${channelId}`;
|
|
206
|
-
const chatType = isDirectMessage ? "direct" : isGroup ? "group" : "channel";
|
|
207
|
-
return resolveSessionKey(params.sessionScope, {
|
|
208
|
-
From: from,
|
|
209
|
-
ChatType: chatType,
|
|
210
|
-
Provider: "slack"
|
|
211
|
-
}, params.mainKey);
|
|
212
|
-
};
|
|
213
|
-
const resolveChannelName = async (channelId) => {
|
|
214
|
-
const cached = channelCache.get(channelId);
|
|
215
|
-
if (cached) return cached;
|
|
216
|
-
try {
|
|
217
|
-
const info = await params.app.client.conversations.info({
|
|
218
|
-
token: params.botToken,
|
|
219
|
-
channel: channelId
|
|
220
|
-
});
|
|
221
|
-
const name = info.channel && "name" in info.channel ? info.channel.name : void 0;
|
|
222
|
-
const channel = info.channel ?? void 0;
|
|
223
|
-
const entry = {
|
|
224
|
-
name,
|
|
225
|
-
type: channel?.is_im ? "im" : channel?.is_mpim ? "mpim" : channel?.is_channel ? "channel" : channel?.is_group ? "group" : void 0,
|
|
226
|
-
topic: channel && "topic" in channel ? channel.topic?.value ?? void 0 : void 0,
|
|
227
|
-
purpose: channel && "purpose" in channel ? channel.purpose?.value ?? void 0 : void 0
|
|
228
|
-
};
|
|
229
|
-
channelCache.set(channelId, entry);
|
|
230
|
-
return entry;
|
|
231
|
-
} catch {
|
|
232
|
-
return {};
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
const resolveUserName = async (userId) => {
|
|
236
|
-
const cached = userCache.get(userId);
|
|
237
|
-
if (cached) return cached;
|
|
238
|
-
try {
|
|
239
|
-
const info = await params.app.client.users.info({
|
|
240
|
-
token: params.botToken,
|
|
241
|
-
user: userId
|
|
242
|
-
});
|
|
243
|
-
const profile = info.user?.profile;
|
|
244
|
-
const entry = { name: profile?.display_name || profile?.real_name || info.user?.name || void 0 };
|
|
245
|
-
userCache.set(userId, entry);
|
|
246
|
-
return entry;
|
|
247
|
-
} catch {
|
|
248
|
-
return {};
|
|
249
|
-
}
|
|
250
|
-
};
|
|
251
|
-
const setSlackThreadStatus = async (p) => {
|
|
252
|
-
if (!p.threadTs) return;
|
|
253
|
-
const payload = {
|
|
254
|
-
token: params.botToken,
|
|
255
|
-
channel_id: p.channelId,
|
|
256
|
-
thread_ts: p.threadTs,
|
|
257
|
-
status: p.status
|
|
258
|
-
};
|
|
259
|
-
const client = params.app.client;
|
|
260
|
-
try {
|
|
261
|
-
if (client.assistant?.threads?.setStatus) {
|
|
262
|
-
await client.assistant.threads.setStatus(payload);
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
if (typeof client.apiCall === "function") await client.apiCall("assistant.threads.setStatus", payload);
|
|
266
|
-
} catch (err) {
|
|
267
|
-
logVerbose(`slack status update failed for channel ${p.channelId}: ${String(err)}`);
|
|
268
|
-
}
|
|
269
|
-
};
|
|
270
|
-
const isChannelAllowed = (p) => {
|
|
271
|
-
const channelType = normalizeSlackChannelType(p.channelType, p.channelId);
|
|
272
|
-
const isDirectMessage = channelType === "im";
|
|
273
|
-
const isGroupDm = channelType === "mpim";
|
|
274
|
-
const isRoom = channelType === "channel" || channelType === "group";
|
|
275
|
-
if (isDirectMessage && !params.dmEnabled) return false;
|
|
276
|
-
if (isGroupDm && !params.groupDmEnabled) return false;
|
|
277
|
-
if (isGroupDm && groupDmChannels.length > 0) {
|
|
278
|
-
const allowList = normalizeAllowListLower(groupDmChannels);
|
|
279
|
-
const candidates = [
|
|
280
|
-
p.channelId,
|
|
281
|
-
p.channelName ? `#${p.channelName}` : void 0,
|
|
282
|
-
p.channelName,
|
|
283
|
-
p.channelName ? normalizeSlackSlug(p.channelName) : void 0
|
|
284
|
-
].filter((value) => Boolean(value)).map((value) => value.toLowerCase());
|
|
285
|
-
if (!(allowList.includes("*") || candidates.some((candidate) => allowList.includes(candidate)))) return false;
|
|
286
|
-
}
|
|
287
|
-
if (isRoom && p.channelId) {
|
|
288
|
-
const channelConfig = resolveSlackChannelConfig({
|
|
289
|
-
channelId: p.channelId,
|
|
290
|
-
channelName: p.channelName,
|
|
291
|
-
channels: params.channelsConfig,
|
|
292
|
-
defaultRequireMention
|
|
293
|
-
});
|
|
294
|
-
const channelMatchMeta = formatAllowlistMatchMeta(channelConfig);
|
|
295
|
-
const channelAllowed = channelConfig?.allowed !== false;
|
|
296
|
-
const channelAllowlistConfigured = Boolean(params.channelsConfig) && Object.keys(params.channelsConfig ?? {}).length > 0;
|
|
297
|
-
if (!isSlackChannelAllowedByPolicy({
|
|
298
|
-
groupPolicy: params.groupPolicy,
|
|
299
|
-
channelAllowlistConfigured,
|
|
300
|
-
channelAllowed
|
|
301
|
-
})) {
|
|
302
|
-
logVerbose(`slack: drop channel ${p.channelId} (groupPolicy=${params.groupPolicy}, ${channelMatchMeta})`);
|
|
303
|
-
return false;
|
|
304
|
-
}
|
|
305
|
-
const hasExplicitConfig = Boolean(channelConfig?.matchSource);
|
|
306
|
-
if (!channelAllowed && (params.groupPolicy !== "open" || hasExplicitConfig)) {
|
|
307
|
-
logVerbose(`slack: drop channel ${p.channelId} (${channelMatchMeta})`);
|
|
308
|
-
return false;
|
|
309
|
-
}
|
|
310
|
-
logVerbose(`slack: allow channel ${p.channelId} (${channelMatchMeta})`);
|
|
311
|
-
}
|
|
312
|
-
return true;
|
|
313
|
-
};
|
|
314
|
-
const shouldDropMismatchedSlackEvent = (body) => {
|
|
315
|
-
if (!body || typeof body !== "object") return false;
|
|
316
|
-
const raw = body;
|
|
317
|
-
const incomingApiAppId = typeof raw.api_app_id === "string" ? raw.api_app_id : "";
|
|
318
|
-
const incomingTeamId = typeof raw.team_id === "string" ? raw.team_id : "";
|
|
319
|
-
if (params.apiAppId && incomingApiAppId && incomingApiAppId !== params.apiAppId) {
|
|
320
|
-
logVerbose(`slack: drop event with api_app_id=${incomingApiAppId} (expected ${params.apiAppId})`);
|
|
321
|
-
return true;
|
|
322
|
-
}
|
|
323
|
-
if (params.teamId && incomingTeamId && incomingTeamId !== params.teamId) {
|
|
324
|
-
logVerbose(`slack: drop event with team_id=${incomingTeamId} (expected ${params.teamId})`);
|
|
325
|
-
return true;
|
|
326
|
-
}
|
|
327
|
-
return false;
|
|
328
|
-
};
|
|
329
|
-
return {
|
|
330
|
-
cfg: params.cfg,
|
|
331
|
-
accountId: params.accountId,
|
|
332
|
-
botToken: params.botToken,
|
|
333
|
-
app: params.app,
|
|
334
|
-
runtime: params.runtime,
|
|
335
|
-
botUserId: params.botUserId,
|
|
336
|
-
teamId: params.teamId,
|
|
337
|
-
apiAppId: params.apiAppId,
|
|
338
|
-
historyLimit: params.historyLimit,
|
|
339
|
-
channelHistories,
|
|
340
|
-
sessionScope: params.sessionScope,
|
|
341
|
-
mainKey: params.mainKey,
|
|
342
|
-
dmEnabled: params.dmEnabled,
|
|
343
|
-
dmPolicy: params.dmPolicy,
|
|
344
|
-
allowFrom,
|
|
345
|
-
allowNameMatching: params.allowNameMatching,
|
|
346
|
-
groupDmEnabled: params.groupDmEnabled,
|
|
347
|
-
groupDmChannels,
|
|
348
|
-
defaultRequireMention,
|
|
349
|
-
channelsConfig: params.channelsConfig,
|
|
350
|
-
groupPolicy: params.groupPolicy,
|
|
351
|
-
useAccessGroups: params.useAccessGroups,
|
|
352
|
-
reactionMode: params.reactionMode,
|
|
353
|
-
reactionAllowlist: params.reactionAllowlist,
|
|
354
|
-
replyToMode: params.replyToMode,
|
|
355
|
-
threadHistoryScope: params.threadHistoryScope,
|
|
356
|
-
threadInheritParent: params.threadInheritParent,
|
|
357
|
-
slashCommand: params.slashCommand,
|
|
358
|
-
textLimit: params.textLimit,
|
|
359
|
-
ackReactionScope: params.ackReactionScope,
|
|
360
|
-
mediaMaxBytes: params.mediaMaxBytes,
|
|
361
|
-
removeAckAfterReply: params.removeAckAfterReply,
|
|
362
|
-
logger,
|
|
363
|
-
markMessageSeen,
|
|
364
|
-
shouldDropMismatchedSlackEvent,
|
|
365
|
-
resolveSlackSystemEventSessionKey,
|
|
366
|
-
isChannelAllowed,
|
|
367
|
-
resolveChannelName,
|
|
368
|
-
resolveUserName,
|
|
369
|
-
setSlackThreadStatus
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
//#endregion
|
|
374
|
-
//#region src/slack/channel-migration.ts
|
|
375
|
-
function resolveAccountChannels(cfg, accountId) {
|
|
376
|
-
if (!accountId) return {};
|
|
377
|
-
const normalized = normalizeAccountId(accountId);
|
|
378
|
-
const accounts = cfg.channels?.slack?.accounts;
|
|
379
|
-
if (!accounts || typeof accounts !== "object") return {};
|
|
380
|
-
const exact = accounts[normalized];
|
|
381
|
-
if (exact?.channels) return { channels: exact.channels };
|
|
382
|
-
const matchKey = Object.keys(accounts).find((key) => key.toLowerCase() === normalized.toLowerCase());
|
|
383
|
-
return { channels: matchKey ? accounts[matchKey]?.channels : void 0 };
|
|
384
|
-
}
|
|
385
|
-
function migrateSlackChannelsInPlace(channels, oldChannelId, newChannelId) {
|
|
386
|
-
if (!channels) return {
|
|
387
|
-
migrated: false,
|
|
388
|
-
skippedExisting: false
|
|
389
|
-
};
|
|
390
|
-
if (oldChannelId === newChannelId) return {
|
|
391
|
-
migrated: false,
|
|
392
|
-
skippedExisting: false
|
|
393
|
-
};
|
|
394
|
-
if (!Object.hasOwn(channels, oldChannelId)) return {
|
|
395
|
-
migrated: false,
|
|
396
|
-
skippedExisting: false
|
|
397
|
-
};
|
|
398
|
-
if (Object.hasOwn(channels, newChannelId)) return {
|
|
399
|
-
migrated: false,
|
|
400
|
-
skippedExisting: true
|
|
401
|
-
};
|
|
402
|
-
channels[newChannelId] = channels[oldChannelId];
|
|
403
|
-
delete channels[oldChannelId];
|
|
404
|
-
return {
|
|
405
|
-
migrated: true,
|
|
406
|
-
skippedExisting: false
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
function migrateSlackChannelConfig(params) {
|
|
410
|
-
const scopes = [];
|
|
411
|
-
let migrated = false;
|
|
412
|
-
let skippedExisting = false;
|
|
413
|
-
const accountChannels = resolveAccountChannels(params.cfg, params.accountId).channels;
|
|
414
|
-
if (accountChannels) {
|
|
415
|
-
const result = migrateSlackChannelsInPlace(accountChannels, params.oldChannelId, params.newChannelId);
|
|
416
|
-
if (result.migrated) {
|
|
417
|
-
migrated = true;
|
|
418
|
-
scopes.push("account");
|
|
419
|
-
}
|
|
420
|
-
if (result.skippedExisting) skippedExisting = true;
|
|
421
|
-
}
|
|
422
|
-
const globalChannels = params.cfg.channels?.slack?.channels;
|
|
423
|
-
if (globalChannels) {
|
|
424
|
-
const result = migrateSlackChannelsInPlace(globalChannels, params.oldChannelId, params.newChannelId);
|
|
425
|
-
if (result.migrated) {
|
|
426
|
-
migrated = true;
|
|
427
|
-
scopes.push("global");
|
|
428
|
-
}
|
|
429
|
-
if (result.skippedExisting) skippedExisting = true;
|
|
430
|
-
}
|
|
431
|
-
return {
|
|
432
|
-
migrated,
|
|
433
|
-
skippedExisting,
|
|
434
|
-
scopes
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
//#endregion
|
|
439
|
-
//#region src/slack/monitor/events/channels.ts
|
|
440
|
-
function registerSlackChannelEvents(params) {
|
|
441
|
-
const { ctx } = params;
|
|
442
|
-
const enqueueChannelSystemEvent = (params) => {
|
|
443
|
-
if (!ctx.isChannelAllowed({
|
|
444
|
-
channelId: params.channelId,
|
|
445
|
-
channelName: params.channelName,
|
|
446
|
-
channelType: "channel"
|
|
447
|
-
})) return;
|
|
448
|
-
const label = resolveSlackChannelLabel({
|
|
449
|
-
channelId: params.channelId,
|
|
450
|
-
channelName: params.channelName
|
|
451
|
-
});
|
|
452
|
-
const sessionKey = ctx.resolveSlackSystemEventSessionKey({
|
|
453
|
-
channelId: params.channelId,
|
|
454
|
-
channelType: "channel"
|
|
455
|
-
});
|
|
456
|
-
enqueueSystemEvent(`Slack channel ${params.kind}: ${label}.`, {
|
|
457
|
-
sessionKey,
|
|
458
|
-
contextKey: `slack:channel:${params.kind}:${params.channelId ?? params.channelName ?? "unknown"}`
|
|
459
|
-
});
|
|
460
|
-
};
|
|
461
|
-
ctx.app.event("channel_created", async ({ event, body }) => {
|
|
462
|
-
try {
|
|
463
|
-
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
|
464
|
-
const payload = event;
|
|
465
|
-
const channelId = payload.channel?.id;
|
|
466
|
-
const channelName = payload.channel?.name;
|
|
467
|
-
enqueueChannelSystemEvent({
|
|
468
|
-
kind: "created",
|
|
469
|
-
channelId,
|
|
470
|
-
channelName
|
|
471
|
-
});
|
|
472
|
-
} catch (err) {
|
|
473
|
-
ctx.runtime.error?.(danger(`slack channel created handler failed: ${String(err)}`));
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
ctx.app.event("channel_rename", async ({ event, body }) => {
|
|
477
|
-
try {
|
|
478
|
-
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
|
479
|
-
const payload = event;
|
|
480
|
-
const channelId = payload.channel?.id;
|
|
481
|
-
enqueueChannelSystemEvent({
|
|
482
|
-
kind: "renamed",
|
|
483
|
-
channelId,
|
|
484
|
-
channelName: payload.channel?.name_normalized ?? payload.channel?.name
|
|
485
|
-
});
|
|
486
|
-
} catch (err) {
|
|
487
|
-
ctx.runtime.error?.(danger(`slack channel rename handler failed: ${String(err)}`));
|
|
488
|
-
}
|
|
489
|
-
});
|
|
490
|
-
ctx.app.event("channel_id_changed", async ({ event, body }) => {
|
|
491
|
-
try {
|
|
492
|
-
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
|
493
|
-
const payload = event;
|
|
494
|
-
const oldChannelId = payload.old_channel_id;
|
|
495
|
-
const newChannelId = payload.new_channel_id;
|
|
496
|
-
if (!oldChannelId || !newChannelId) return;
|
|
497
|
-
const label = resolveSlackChannelLabel({
|
|
498
|
-
channelId: newChannelId,
|
|
499
|
-
channelName: (await ctx.resolveChannelName(newChannelId))?.name
|
|
500
|
-
});
|
|
501
|
-
ctx.runtime.log?.(warn(`[slack] Channel ID changed: ${oldChannelId} → ${newChannelId} (${label})`));
|
|
502
|
-
if (!resolveChannelConfigWrites({
|
|
503
|
-
cfg: ctx.cfg,
|
|
504
|
-
channelId: "slack",
|
|
505
|
-
accountId: ctx.accountId
|
|
506
|
-
})) {
|
|
507
|
-
ctx.runtime.log?.(warn("[slack] Config writes disabled; skipping channel config migration."));
|
|
508
|
-
return;
|
|
509
|
-
}
|
|
510
|
-
const currentConfig = loadConfig();
|
|
511
|
-
const migration = migrateSlackChannelConfig({
|
|
512
|
-
cfg: currentConfig,
|
|
513
|
-
accountId: ctx.accountId,
|
|
514
|
-
oldChannelId,
|
|
515
|
-
newChannelId
|
|
516
|
-
});
|
|
517
|
-
if (migration.migrated) {
|
|
518
|
-
migrateSlackChannelConfig({
|
|
519
|
-
cfg: ctx.cfg,
|
|
520
|
-
accountId: ctx.accountId,
|
|
521
|
-
oldChannelId,
|
|
522
|
-
newChannelId
|
|
523
|
-
});
|
|
524
|
-
await writeConfigFile(currentConfig);
|
|
525
|
-
ctx.runtime.log?.(warn("[slack] Channel config migrated and saved successfully."));
|
|
526
|
-
} else if (migration.skippedExisting) ctx.runtime.log?.(warn(`[slack] Channel config already exists for ${newChannelId}; leaving ${oldChannelId} unchanged`));
|
|
527
|
-
else ctx.runtime.log?.(warn(`[slack] No config found for old channel ID ${oldChannelId}; migration logged only`));
|
|
528
|
-
} catch (err) {
|
|
529
|
-
ctx.runtime.error?.(danger(`slack channel_id_changed handler failed: ${String(err)}`));
|
|
530
|
-
}
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
//#endregion
|
|
535
|
-
//#region src/slack/modal-metadata.ts
|
|
536
|
-
function normalizeString(value) {
|
|
537
|
-
return typeof value === "string" && value.trim().length > 0 ? value.trim() : void 0;
|
|
538
|
-
}
|
|
539
|
-
function parseSlackModalPrivateMetadata(raw) {
|
|
540
|
-
if (typeof raw !== "string" || raw.trim().length === 0) return {};
|
|
541
|
-
try {
|
|
542
|
-
const parsed = JSON.parse(raw);
|
|
543
|
-
return {
|
|
544
|
-
sessionKey: normalizeString(parsed.sessionKey),
|
|
545
|
-
channelId: normalizeString(parsed.channelId),
|
|
546
|
-
channelType: normalizeString(parsed.channelType),
|
|
547
|
-
userId: normalizeString(parsed.userId)
|
|
548
|
-
};
|
|
549
|
-
} catch {
|
|
550
|
-
return {};
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
//#endregion
|
|
555
|
-
//#region src/slack/monitor/auth.ts
|
|
556
|
-
async function resolveSlackEffectiveAllowFrom(ctx, options) {
|
|
557
|
-
const storeAllowFrom = options?.includePairingStore === true ? await readStoreAllowFromForDmPolicy({
|
|
558
|
-
provider: "slack",
|
|
559
|
-
accountId: ctx.accountId,
|
|
560
|
-
dmPolicy: ctx.dmPolicy
|
|
561
|
-
}) : [];
|
|
562
|
-
const allowFrom = normalizeAllowList([...ctx.allowFrom, ...storeAllowFrom]);
|
|
563
|
-
return {
|
|
564
|
-
allowFrom,
|
|
565
|
-
allowFromLower: normalizeAllowListLower(allowFrom)
|
|
566
|
-
};
|
|
567
|
-
}
|
|
568
|
-
function isSlackSenderAllowListed(params) {
|
|
569
|
-
const { allowListLower, senderId, senderName, allowNameMatching } = params;
|
|
570
|
-
return allowListLower.length === 0 || allowListMatches({
|
|
571
|
-
allowList: allowListLower,
|
|
572
|
-
id: senderId,
|
|
573
|
-
name: senderName,
|
|
574
|
-
allowNameMatching
|
|
575
|
-
});
|
|
576
|
-
}
|
|
577
|
-
async function authorizeSlackSystemEventSender(params) {
|
|
578
|
-
const senderId = params.senderId?.trim();
|
|
579
|
-
if (!senderId) return {
|
|
580
|
-
allowed: false,
|
|
581
|
-
reason: "missing-sender"
|
|
582
|
-
};
|
|
583
|
-
const expectedSenderId = params.expectedSenderId?.trim();
|
|
584
|
-
if (expectedSenderId && expectedSenderId !== senderId) return {
|
|
585
|
-
allowed: false,
|
|
586
|
-
reason: "sender-mismatch"
|
|
587
|
-
};
|
|
588
|
-
const channelId = params.channelId?.trim();
|
|
589
|
-
let channelType = normalizeSlackChannelType(params.channelType, channelId);
|
|
590
|
-
let channelName;
|
|
591
|
-
if (channelId) {
|
|
592
|
-
const info = await params.ctx.resolveChannelName(channelId).catch(() => ({}));
|
|
593
|
-
channelName = info.name;
|
|
594
|
-
channelType = normalizeSlackChannelType(params.channelType ?? info.type, channelId);
|
|
595
|
-
if (!params.ctx.isChannelAllowed({
|
|
596
|
-
channelId,
|
|
597
|
-
channelName,
|
|
598
|
-
channelType
|
|
599
|
-
})) return {
|
|
600
|
-
allowed: false,
|
|
601
|
-
reason: "channel-not-allowed",
|
|
602
|
-
channelType,
|
|
603
|
-
channelName
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
const senderName = (await params.ctx.resolveUserName(senderId).catch(() => ({}))).name;
|
|
607
|
-
const resolveAllowFromLower = async (includePairingStore = false) => (await resolveSlackEffectiveAllowFrom(params.ctx, { includePairingStore })).allowFromLower;
|
|
608
|
-
if (channelType === "im") {
|
|
609
|
-
if (!params.ctx.dmEnabled || params.ctx.dmPolicy === "disabled") return {
|
|
610
|
-
allowed: false,
|
|
611
|
-
reason: "dm-disabled",
|
|
612
|
-
channelType,
|
|
613
|
-
channelName
|
|
614
|
-
};
|
|
615
|
-
if (params.ctx.dmPolicy !== "open") {
|
|
616
|
-
if (!isSlackSenderAllowListed({
|
|
617
|
-
allowListLower: await resolveAllowFromLower(true),
|
|
618
|
-
senderId,
|
|
619
|
-
senderName,
|
|
620
|
-
allowNameMatching: params.ctx.allowNameMatching
|
|
621
|
-
})) return {
|
|
622
|
-
allowed: false,
|
|
623
|
-
reason: "sender-not-allowlisted",
|
|
624
|
-
channelType,
|
|
625
|
-
channelName
|
|
626
|
-
};
|
|
627
|
-
}
|
|
628
|
-
} else if (!channelId) {
|
|
629
|
-
const allowFromLower = await resolveAllowFromLower(false);
|
|
630
|
-
if (allowFromLower.length > 0) {
|
|
631
|
-
if (!isSlackSenderAllowListed({
|
|
632
|
-
allowListLower: allowFromLower,
|
|
633
|
-
senderId,
|
|
634
|
-
senderName,
|
|
635
|
-
allowNameMatching: params.ctx.allowNameMatching
|
|
636
|
-
})) return {
|
|
637
|
-
allowed: false,
|
|
638
|
-
reason: "sender-not-allowlisted"
|
|
639
|
-
};
|
|
640
|
-
}
|
|
641
|
-
} else {
|
|
642
|
-
const channelConfig = resolveSlackChannelConfig({
|
|
643
|
-
channelId,
|
|
644
|
-
channelName,
|
|
645
|
-
channels: params.ctx.channelsConfig,
|
|
646
|
-
defaultRequireMention: params.ctx.defaultRequireMention
|
|
647
|
-
});
|
|
648
|
-
if (Array.isArray(channelConfig?.users) && channelConfig.users.length > 0) {
|
|
649
|
-
if (!resolveSlackUserAllowed({
|
|
650
|
-
allowList: channelConfig?.users,
|
|
651
|
-
userId: senderId,
|
|
652
|
-
userName: senderName,
|
|
653
|
-
allowNameMatching: params.ctx.allowNameMatching
|
|
654
|
-
})) return {
|
|
655
|
-
allowed: false,
|
|
656
|
-
reason: "sender-not-channel-allowed",
|
|
657
|
-
channelType,
|
|
658
|
-
channelName
|
|
659
|
-
};
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
return {
|
|
663
|
-
allowed: true,
|
|
664
|
-
channelType,
|
|
665
|
-
channelName
|
|
666
|
-
};
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
//#endregion
|
|
670
|
-
//#region src/slack/monitor/mrkdwn.ts
|
|
671
|
-
function escapeSlackMrkdwn(value) {
|
|
672
|
-
return value.replaceAll("\\", "\\\\").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replace(/([*_`~])/g, "\\$1");
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
//#endregion
|
|
676
|
-
//#region src/slack/monitor/events/interactions.ts
|
|
677
|
-
const FASED_ACTION_PREFIX = "fased:";
|
|
678
|
-
function readOptionValues(options) {
|
|
679
|
-
if (!Array.isArray(options)) return;
|
|
680
|
-
const values = options.map((option) => option && typeof option === "object" ? option.value : null).filter((value) => typeof value === "string" && value.trim().length > 0);
|
|
681
|
-
return values.length > 0 ? values : void 0;
|
|
682
|
-
}
|
|
683
|
-
function readOptionLabels(options) {
|
|
684
|
-
if (!Array.isArray(options)) return;
|
|
685
|
-
const labels = options.map((option) => option && typeof option === "object" ? option.text?.text ?? null : null).filter((label) => typeof label === "string" && label.trim().length > 0);
|
|
686
|
-
return labels.length > 0 ? labels : void 0;
|
|
687
|
-
}
|
|
688
|
-
function uniqueNonEmptyStrings(values) {
|
|
689
|
-
const unique = [];
|
|
690
|
-
const seen = /* @__PURE__ */ new Set();
|
|
691
|
-
for (const entry of values) {
|
|
692
|
-
if (typeof entry !== "string") continue;
|
|
693
|
-
const trimmed = entry.trim();
|
|
694
|
-
if (!trimmed || seen.has(trimmed)) continue;
|
|
695
|
-
seen.add(trimmed);
|
|
696
|
-
unique.push(trimmed);
|
|
697
|
-
}
|
|
698
|
-
return unique;
|
|
699
|
-
}
|
|
700
|
-
function collectRichTextFragments(value, out) {
|
|
701
|
-
if (!value || typeof value !== "object") return;
|
|
702
|
-
const typed = value;
|
|
703
|
-
if (typeof typed.text === "string" && typed.text.trim().length > 0) out.push(typed.text.trim());
|
|
704
|
-
if (Array.isArray(typed.elements)) for (const child of typed.elements) collectRichTextFragments(child, out);
|
|
705
|
-
}
|
|
706
|
-
function summarizeRichTextPreview(value) {
|
|
707
|
-
const fragments = [];
|
|
708
|
-
collectRichTextFragments(value, fragments);
|
|
709
|
-
if (fragments.length === 0) return;
|
|
710
|
-
const joined = fragments.join(" ").replace(/\s+/g, " ").trim();
|
|
711
|
-
if (!joined) return;
|
|
712
|
-
const max = 120;
|
|
713
|
-
return joined.length <= max ? joined : `${joined.slice(0, max - 1)}…`;
|
|
714
|
-
}
|
|
715
|
-
function readInteractionAction(raw) {
|
|
716
|
-
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return;
|
|
717
|
-
return raw;
|
|
718
|
-
}
|
|
719
|
-
function summarizeAction(action) {
|
|
720
|
-
const typed = action;
|
|
721
|
-
const actionType = typed.type;
|
|
722
|
-
const selectedUsers = uniqueNonEmptyStrings([...typed.selected_user ? [typed.selected_user] : [], ...Array.isArray(typed.selected_users) ? typed.selected_users : []]);
|
|
723
|
-
const selectedChannels = uniqueNonEmptyStrings([...typed.selected_channel ? [typed.selected_channel] : [], ...Array.isArray(typed.selected_channels) ? typed.selected_channels : []]);
|
|
724
|
-
const selectedConversations = uniqueNonEmptyStrings([...typed.selected_conversation ? [typed.selected_conversation] : [], ...Array.isArray(typed.selected_conversations) ? typed.selected_conversations : []]);
|
|
725
|
-
const selectedValues = uniqueNonEmptyStrings([
|
|
726
|
-
...typed.selected_option?.value ? [typed.selected_option.value] : [],
|
|
727
|
-
...readOptionValues(typed.selected_options) ?? [],
|
|
728
|
-
...selectedUsers,
|
|
729
|
-
...selectedChannels,
|
|
730
|
-
...selectedConversations
|
|
731
|
-
]);
|
|
732
|
-
const selectedLabels = uniqueNonEmptyStrings([...typed.selected_option?.text?.text ? [typed.selected_option.text.text] : [], ...readOptionLabels(typed.selected_options) ?? []]);
|
|
733
|
-
const inputValue = typeof typed.value === "string" ? typed.value : void 0;
|
|
734
|
-
const inputNumber = actionType === "number_input" && inputValue != null ? Number.parseFloat(inputValue) : void 0;
|
|
735
|
-
const parsedNumber = Number.isFinite(inputNumber) ? inputNumber : void 0;
|
|
736
|
-
const inputEmail = actionType === "email_text_input" && inputValue?.includes("@") ? inputValue : void 0;
|
|
737
|
-
let inputUrl;
|
|
738
|
-
if (actionType === "url_text_input" && inputValue) try {
|
|
739
|
-
inputUrl = new URL(inputValue).toString();
|
|
740
|
-
} catch {
|
|
741
|
-
inputUrl = void 0;
|
|
742
|
-
}
|
|
743
|
-
const richTextValue = actionType === "rich_text_input" ? typed.rich_text_value : void 0;
|
|
744
|
-
const richTextPreview = summarizeRichTextPreview(richTextValue);
|
|
745
|
-
return {
|
|
746
|
-
actionType,
|
|
747
|
-
inputKind: actionType === "number_input" ? "number" : actionType === "email_text_input" ? "email" : actionType === "url_text_input" ? "url" : actionType === "rich_text_input" ? "rich_text" : inputValue != null ? "text" : void 0,
|
|
748
|
-
value: typed.value,
|
|
749
|
-
selectedValues: selectedValues.length > 0 ? selectedValues : void 0,
|
|
750
|
-
selectedUsers: selectedUsers.length > 0 ? selectedUsers : void 0,
|
|
751
|
-
selectedChannels: selectedChannels.length > 0 ? selectedChannels : void 0,
|
|
752
|
-
selectedConversations: selectedConversations.length > 0 ? selectedConversations : void 0,
|
|
753
|
-
selectedLabels: selectedLabels.length > 0 ? selectedLabels : void 0,
|
|
754
|
-
selectedDate: typed.selected_date,
|
|
755
|
-
selectedTime: typed.selected_time,
|
|
756
|
-
selectedDateTime: typeof typed.selected_date_time === "number" ? typed.selected_date_time : void 0,
|
|
757
|
-
inputValue,
|
|
758
|
-
inputNumber: parsedNumber,
|
|
759
|
-
inputEmail,
|
|
760
|
-
inputUrl,
|
|
761
|
-
richTextValue,
|
|
762
|
-
richTextPreview,
|
|
763
|
-
workflowTriggerUrl: typed.workflow?.trigger_url,
|
|
764
|
-
workflowId: typed.workflow?.workflow_id
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
function isBulkActionsBlock(block) {
|
|
768
|
-
return block.type === "actions" && Array.isArray(block.elements) && block.elements.length > 0 && block.elements.every((el) => typeof el.action_id === "string" && el.action_id.includes("_all_"));
|
|
769
|
-
}
|
|
770
|
-
function formatInteractionSelectionLabel(params) {
|
|
771
|
-
if (params.summary.actionType === "button" && params.buttonText?.trim()) return params.buttonText.trim();
|
|
772
|
-
if (params.summary.selectedLabels?.length) {
|
|
773
|
-
if (params.summary.selectedLabels.length <= 3) return params.summary.selectedLabels.join(", ");
|
|
774
|
-
return `${params.summary.selectedLabels.slice(0, 3).join(", ")} +${params.summary.selectedLabels.length - 3}`;
|
|
775
|
-
}
|
|
776
|
-
if (params.summary.selectedValues?.length) {
|
|
777
|
-
if (params.summary.selectedValues.length <= 3) return params.summary.selectedValues.join(", ");
|
|
778
|
-
return `${params.summary.selectedValues.slice(0, 3).join(", ")} +${params.summary.selectedValues.length - 3}`;
|
|
779
|
-
}
|
|
780
|
-
if (params.summary.selectedDate) return params.summary.selectedDate;
|
|
781
|
-
if (params.summary.selectedTime) return params.summary.selectedTime;
|
|
782
|
-
if (typeof params.summary.selectedDateTime === "number") return (/* @__PURE__ */ new Date(params.summary.selectedDateTime * 1e3)).toISOString();
|
|
783
|
-
if (params.summary.richTextPreview) return params.summary.richTextPreview;
|
|
784
|
-
if (params.summary.value?.trim()) return params.summary.value.trim();
|
|
785
|
-
return params.actionId;
|
|
786
|
-
}
|
|
787
|
-
function formatInteractionConfirmationText(params) {
|
|
788
|
-
const actor = params.userId?.trim() ? ` by <@${params.userId.trim()}>` : "";
|
|
789
|
-
return `:white_check_mark: *${escapeSlackMrkdwn(params.selectedLabel)}* selected${actor}`;
|
|
790
|
-
}
|
|
791
|
-
function summarizeViewState(values) {
|
|
792
|
-
if (!values || typeof values !== "object") return [];
|
|
793
|
-
const entries = [];
|
|
794
|
-
for (const [blockId, blockValue] of Object.entries(values)) {
|
|
795
|
-
if (!blockValue || typeof blockValue !== "object") continue;
|
|
796
|
-
for (const [actionId, rawAction] of Object.entries(blockValue)) {
|
|
797
|
-
if (!rawAction || typeof rawAction !== "object") continue;
|
|
798
|
-
const actionSummary = summarizeAction(rawAction);
|
|
799
|
-
entries.push({
|
|
800
|
-
blockId,
|
|
801
|
-
actionId,
|
|
802
|
-
...actionSummary
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
return entries;
|
|
807
|
-
}
|
|
808
|
-
function resolveModalSessionRouting(params) {
|
|
809
|
-
const metadata = params.metadata;
|
|
810
|
-
if (metadata.sessionKey) return {
|
|
811
|
-
sessionKey: metadata.sessionKey,
|
|
812
|
-
channelId: metadata.channelId,
|
|
813
|
-
channelType: metadata.channelType
|
|
814
|
-
};
|
|
815
|
-
if (metadata.channelId) return {
|
|
816
|
-
sessionKey: params.ctx.resolveSlackSystemEventSessionKey({
|
|
817
|
-
channelId: metadata.channelId,
|
|
818
|
-
channelType: metadata.channelType
|
|
819
|
-
}),
|
|
820
|
-
channelId: metadata.channelId,
|
|
821
|
-
channelType: metadata.channelType
|
|
822
|
-
};
|
|
823
|
-
return { sessionKey: params.ctx.resolveSlackSystemEventSessionKey({}) };
|
|
824
|
-
}
|
|
825
|
-
function summarizeSlackViewLifecycleContext(view) {
|
|
826
|
-
const rootViewId = view.root_view_id;
|
|
827
|
-
const previousViewId = view.previous_view_id;
|
|
828
|
-
return {
|
|
829
|
-
rootViewId,
|
|
830
|
-
previousViewId,
|
|
831
|
-
externalId: view.external_id,
|
|
832
|
-
viewHash: view.hash,
|
|
833
|
-
isStackedView: Boolean(previousViewId)
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
function resolveSlackModalEventBase(params) {
|
|
837
|
-
const metadata = parseSlackModalPrivateMetadata(params.body.view?.private_metadata);
|
|
838
|
-
const callbackId = params.body.view?.callback_id ?? "unknown";
|
|
839
|
-
const userId = params.body.user?.id ?? "unknown";
|
|
840
|
-
const viewId = params.body.view?.id;
|
|
841
|
-
const inputs = summarizeViewState(params.body.view?.state?.values);
|
|
842
|
-
const sessionRouting = resolveModalSessionRouting({
|
|
843
|
-
ctx: params.ctx,
|
|
844
|
-
metadata
|
|
845
|
-
});
|
|
846
|
-
return {
|
|
847
|
-
callbackId,
|
|
848
|
-
userId,
|
|
849
|
-
expectedUserId: metadata.userId,
|
|
850
|
-
viewId,
|
|
851
|
-
sessionRouting,
|
|
852
|
-
payload: {
|
|
853
|
-
actionId: `view:${callbackId}`,
|
|
854
|
-
callbackId,
|
|
855
|
-
viewId,
|
|
856
|
-
userId,
|
|
857
|
-
teamId: params.body.team?.id,
|
|
858
|
-
...summarizeSlackViewLifecycleContext({
|
|
859
|
-
root_view_id: params.body.view?.root_view_id,
|
|
860
|
-
previous_view_id: params.body.view?.previous_view_id,
|
|
861
|
-
external_id: params.body.view?.external_id,
|
|
862
|
-
hash: params.body.view?.hash
|
|
863
|
-
}),
|
|
864
|
-
privateMetadata: params.body.view?.private_metadata,
|
|
865
|
-
routedChannelId: sessionRouting.channelId,
|
|
866
|
-
routedChannelType: sessionRouting.channelType,
|
|
867
|
-
inputs
|
|
868
|
-
}
|
|
869
|
-
};
|
|
870
|
-
}
|
|
871
|
-
async function emitSlackModalLifecycleEvent(params) {
|
|
872
|
-
const { callbackId, userId, expectedUserId, viewId, sessionRouting, payload } = resolveSlackModalEventBase({
|
|
873
|
-
ctx: params.ctx,
|
|
874
|
-
body: params.body
|
|
875
|
-
});
|
|
876
|
-
const isViewClosed = params.interactionType === "view_closed";
|
|
877
|
-
const isCleared = params.body.is_cleared === true;
|
|
878
|
-
const eventPayload = isViewClosed ? {
|
|
879
|
-
interactionType: params.interactionType,
|
|
880
|
-
...payload,
|
|
881
|
-
isCleared
|
|
882
|
-
} : {
|
|
883
|
-
interactionType: params.interactionType,
|
|
884
|
-
...payload
|
|
885
|
-
};
|
|
886
|
-
if (isViewClosed) params.ctx.runtime.log?.(`slack:interaction view_closed callback=${callbackId} user=${userId} cleared=${isCleared}`);
|
|
887
|
-
else params.ctx.runtime.log?.(`slack:interaction view_submission callback=${callbackId} user=${userId} inputs=${payload.inputs.length}`);
|
|
888
|
-
if (!expectedUserId) {
|
|
889
|
-
params.ctx.runtime.log?.(`slack:interaction drop modal callback=${callbackId} user=${userId} reason=missing-expected-user`);
|
|
890
|
-
return;
|
|
891
|
-
}
|
|
892
|
-
const auth = await authorizeSlackSystemEventSender({
|
|
893
|
-
ctx: params.ctx,
|
|
894
|
-
senderId: userId,
|
|
895
|
-
channelId: sessionRouting.channelId,
|
|
896
|
-
channelType: sessionRouting.channelType,
|
|
897
|
-
expectedSenderId: expectedUserId
|
|
898
|
-
});
|
|
899
|
-
if (!auth.allowed) {
|
|
900
|
-
params.ctx.runtime.log?.(`slack:interaction drop modal callback=${callbackId} user=${userId} reason=${auth.reason ?? "unauthorized"}`);
|
|
901
|
-
return;
|
|
902
|
-
}
|
|
903
|
-
enqueueSystemEvent(`Slack interaction: ${JSON.stringify(eventPayload)}`, {
|
|
904
|
-
sessionKey: sessionRouting.sessionKey,
|
|
905
|
-
contextKey: [
|
|
906
|
-
params.contextPrefix,
|
|
907
|
-
callbackId,
|
|
908
|
-
viewId,
|
|
909
|
-
userId
|
|
910
|
-
].filter(Boolean).join(":")
|
|
911
|
-
});
|
|
912
|
-
}
|
|
913
|
-
function registerModalLifecycleHandler(params) {
|
|
914
|
-
params.register(params.matcher, async ({ ack, body }) => {
|
|
915
|
-
await ack();
|
|
916
|
-
await emitSlackModalLifecycleEvent({
|
|
917
|
-
ctx: params.ctx,
|
|
918
|
-
body,
|
|
919
|
-
interactionType: params.interactionType,
|
|
920
|
-
contextPrefix: params.contextPrefix
|
|
921
|
-
});
|
|
922
|
-
});
|
|
923
|
-
}
|
|
924
|
-
function registerSlackInteractionEvents(params) {
|
|
925
|
-
const { ctx } = params;
|
|
926
|
-
if (typeof ctx.app.action !== "function") return;
|
|
927
|
-
ctx.app.action(new RegExp(`^${FASED_ACTION_PREFIX}`), async (args) => {
|
|
928
|
-
const { ack, body, action, respond } = args;
|
|
929
|
-
const typedBody = body;
|
|
930
|
-
await ack();
|
|
931
|
-
const typedAction = readInteractionAction(action);
|
|
932
|
-
if (!typedAction) {
|
|
933
|
-
ctx.runtime.log?.(`slack:interaction malformed action payload channel=${typedBody.channel?.id ?? typedBody.container?.channel_id ?? "unknown"} user=${typedBody.user?.id ?? "unknown"}`);
|
|
934
|
-
return;
|
|
935
|
-
}
|
|
936
|
-
const typedActionWithText = typedAction;
|
|
937
|
-
const actionId = typeof typedActionWithText.action_id === "string" ? typedActionWithText.action_id : "unknown";
|
|
938
|
-
const blockId = typedActionWithText.block_id;
|
|
939
|
-
const userId = typedBody.user?.id ?? "unknown";
|
|
940
|
-
const channelId = typedBody.channel?.id ?? typedBody.container?.channel_id;
|
|
941
|
-
const messageTs = typedBody.message?.ts ?? typedBody.container?.message_ts;
|
|
942
|
-
const threadTs = typedBody.container?.thread_ts;
|
|
943
|
-
const auth = await authorizeSlackSystemEventSender({
|
|
944
|
-
ctx,
|
|
945
|
-
senderId: userId,
|
|
946
|
-
channelId
|
|
947
|
-
});
|
|
948
|
-
if (!auth.allowed) {
|
|
949
|
-
ctx.runtime.log?.(`slack:interaction drop action=${actionId} user=${userId} channel=${channelId ?? "unknown"} reason=${auth.reason ?? "unauthorized"}`);
|
|
950
|
-
if (respond) try {
|
|
951
|
-
await respond({
|
|
952
|
-
text: "You are not authorized to use this control.",
|
|
953
|
-
response_type: "ephemeral"
|
|
954
|
-
});
|
|
955
|
-
} catch {}
|
|
956
|
-
return;
|
|
957
|
-
}
|
|
958
|
-
const actionSummary = summarizeAction(typedAction);
|
|
959
|
-
const eventPayload = {
|
|
960
|
-
interactionType: "block_action",
|
|
961
|
-
actionId,
|
|
962
|
-
blockId,
|
|
963
|
-
...actionSummary,
|
|
964
|
-
userId,
|
|
965
|
-
teamId: typedBody.team?.id,
|
|
966
|
-
triggerId: typedBody.trigger_id,
|
|
967
|
-
responseUrl: typedBody.response_url,
|
|
968
|
-
channelId,
|
|
969
|
-
messageTs,
|
|
970
|
-
threadTs
|
|
971
|
-
};
|
|
972
|
-
ctx.runtime.log?.(`slack:interaction action=${actionId} type=${actionSummary.actionType ?? "unknown"} user=${userId} channel=${channelId}`);
|
|
973
|
-
const sessionKey = ctx.resolveSlackSystemEventSessionKey({
|
|
974
|
-
channelId,
|
|
975
|
-
channelType: auth.channelType
|
|
976
|
-
});
|
|
977
|
-
const contextKey = [
|
|
978
|
-
"slack:interaction",
|
|
979
|
-
channelId,
|
|
980
|
-
messageTs,
|
|
981
|
-
actionId
|
|
982
|
-
].filter(Boolean).join(":");
|
|
983
|
-
enqueueSystemEvent(`Slack interaction: ${JSON.stringify(eventPayload)}`, {
|
|
984
|
-
sessionKey,
|
|
985
|
-
contextKey
|
|
986
|
-
});
|
|
987
|
-
const originalBlocks = typedBody.message?.blocks;
|
|
988
|
-
if (!Array.isArray(originalBlocks) || !channelId || !messageTs) return;
|
|
989
|
-
if (!blockId) return;
|
|
990
|
-
const selectedLabel = formatInteractionSelectionLabel({
|
|
991
|
-
actionId,
|
|
992
|
-
summary: actionSummary,
|
|
993
|
-
buttonText: typedActionWithText.text?.text
|
|
994
|
-
});
|
|
995
|
-
let updatedBlocks = originalBlocks.map((block) => {
|
|
996
|
-
const typedBlock = block;
|
|
997
|
-
if (typedBlock.type === "actions" && typedBlock.block_id === blockId) return {
|
|
998
|
-
type: "context",
|
|
999
|
-
elements: [{
|
|
1000
|
-
type: "mrkdwn",
|
|
1001
|
-
text: formatInteractionConfirmationText({
|
|
1002
|
-
selectedLabel,
|
|
1003
|
-
userId
|
|
1004
|
-
})
|
|
1005
|
-
}]
|
|
1006
|
-
};
|
|
1007
|
-
return block;
|
|
1008
|
-
});
|
|
1009
|
-
if (!updatedBlocks.some((block) => {
|
|
1010
|
-
const typedBlock = block;
|
|
1011
|
-
return typedBlock.type === "actions" && !isBulkActionsBlock(typedBlock);
|
|
1012
|
-
})) updatedBlocks = updatedBlocks.filter((block, index) => {
|
|
1013
|
-
const typedBlock = block;
|
|
1014
|
-
if (isBulkActionsBlock(typedBlock)) return false;
|
|
1015
|
-
if (typedBlock.type !== "divider") return true;
|
|
1016
|
-
const next = updatedBlocks[index + 1];
|
|
1017
|
-
return !next || !isBulkActionsBlock(next);
|
|
1018
|
-
});
|
|
1019
|
-
try {
|
|
1020
|
-
await ctx.app.client.chat.update({
|
|
1021
|
-
channel: channelId,
|
|
1022
|
-
ts: messageTs,
|
|
1023
|
-
text: typedBody.message?.text ?? "",
|
|
1024
|
-
blocks: updatedBlocks
|
|
1025
|
-
});
|
|
1026
|
-
} catch {
|
|
1027
|
-
if (!respond) return;
|
|
1028
|
-
try {
|
|
1029
|
-
await respond({
|
|
1030
|
-
text: `Button "${actionId}" clicked!`,
|
|
1031
|
-
response_type: "ephemeral"
|
|
1032
|
-
});
|
|
1033
|
-
} catch {}
|
|
1034
|
-
}
|
|
1035
|
-
});
|
|
1036
|
-
if (typeof ctx.app.view !== "function") return;
|
|
1037
|
-
const modalMatcher = new RegExp(`^${FASED_ACTION_PREFIX}`);
|
|
1038
|
-
registerModalLifecycleHandler({
|
|
1039
|
-
register: (matcher, handler) => ctx.app.view(matcher, handler),
|
|
1040
|
-
matcher: modalMatcher,
|
|
1041
|
-
ctx,
|
|
1042
|
-
interactionType: "view_submission",
|
|
1043
|
-
contextPrefix: "slack:interaction:view"
|
|
1044
|
-
});
|
|
1045
|
-
const viewClosed = ctx.app.viewClosed;
|
|
1046
|
-
if (typeof viewClosed !== "function") return;
|
|
1047
|
-
registerModalLifecycleHandler({
|
|
1048
|
-
register: viewClosed,
|
|
1049
|
-
matcher: modalMatcher,
|
|
1050
|
-
ctx,
|
|
1051
|
-
interactionType: "view_closed",
|
|
1052
|
-
contextPrefix: "slack:interaction:view-closed"
|
|
1053
|
-
});
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
|
-
//#endregion
|
|
1057
|
-
//#region src/slack/monitor/events/system-event-context.ts
|
|
1058
|
-
async function authorizeAndResolveSlackSystemEventContext(params) {
|
|
1059
|
-
const { ctx, senderId, channelId, channelType, eventKind } = params;
|
|
1060
|
-
const auth = await authorizeSlackSystemEventSender({
|
|
1061
|
-
ctx,
|
|
1062
|
-
senderId,
|
|
1063
|
-
channelId,
|
|
1064
|
-
channelType
|
|
1065
|
-
});
|
|
1066
|
-
if (!auth.allowed) {
|
|
1067
|
-
logVerbose(`slack: drop ${eventKind} sender ${senderId ?? "unknown"} channel=${channelId ?? "unknown"} reason=${auth.reason ?? "unauthorized"}`);
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
return {
|
|
1071
|
-
channelLabel: resolveSlackChannelLabel({
|
|
1072
|
-
channelId,
|
|
1073
|
-
channelName: auth.channelName
|
|
1074
|
-
}),
|
|
1075
|
-
sessionKey: ctx.resolveSlackSystemEventSessionKey({
|
|
1076
|
-
channelId,
|
|
1077
|
-
channelType: auth.channelType
|
|
1078
|
-
})
|
|
1079
|
-
};
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
|
-
//#endregion
|
|
1083
|
-
//#region src/slack/monitor/events/members.ts
|
|
1084
|
-
function registerSlackMemberEvents(params) {
|
|
1085
|
-
const { ctx } = params;
|
|
1086
|
-
const handleMemberChannelEvent = async (params) => {
|
|
1087
|
-
try {
|
|
1088
|
-
if (ctx.shouldDropMismatchedSlackEvent(params.body)) return;
|
|
1089
|
-
const payload = params.event;
|
|
1090
|
-
const channelId = payload.channel;
|
|
1091
|
-
const channelInfo = channelId ? await ctx.resolveChannelName(channelId) : {};
|
|
1092
|
-
const channelType = payload.channel_type ?? channelInfo?.type;
|
|
1093
|
-
const ingressContext = await authorizeAndResolveSlackSystemEventContext({
|
|
1094
|
-
ctx,
|
|
1095
|
-
senderId: payload.user,
|
|
1096
|
-
channelId,
|
|
1097
|
-
channelType,
|
|
1098
|
-
eventKind: `member-${params.verb}`
|
|
1099
|
-
});
|
|
1100
|
-
if (!ingressContext) return;
|
|
1101
|
-
enqueueSystemEvent(`Slack: ${(payload.user ? await ctx.resolveUserName(payload.user) : {})?.name ?? payload.user ?? "someone"} ${params.verb} ${ingressContext.channelLabel}.`, {
|
|
1102
|
-
sessionKey: ingressContext.sessionKey,
|
|
1103
|
-
contextKey: `slack:member:${params.verb}:${channelId ?? "unknown"}:${payload.user ?? "unknown"}`
|
|
1104
|
-
});
|
|
1105
|
-
} catch (err) {
|
|
1106
|
-
ctx.runtime.error?.(danger(`slack ${params.verb} handler failed: ${String(err)}`));
|
|
1107
|
-
}
|
|
1108
|
-
};
|
|
1109
|
-
ctx.app.event("member_joined_channel", async ({ event, body }) => {
|
|
1110
|
-
await handleMemberChannelEvent({
|
|
1111
|
-
verb: "joined",
|
|
1112
|
-
event,
|
|
1113
|
-
body
|
|
1114
|
-
});
|
|
1115
|
-
});
|
|
1116
|
-
ctx.app.event("member_left_channel", async ({ event, body }) => {
|
|
1117
|
-
await handleMemberChannelEvent({
|
|
1118
|
-
verb: "left",
|
|
1119
|
-
event,
|
|
1120
|
-
body
|
|
1121
|
-
});
|
|
1122
|
-
});
|
|
1123
|
-
}
|
|
1124
|
-
|
|
1125
|
-
//#endregion
|
|
1126
|
-
//#region src/slack/monitor/events/messages.ts
|
|
1127
|
-
function registerSlackMessageEvents(params) {
|
|
1128
|
-
const { ctx, handleSlackMessage } = params;
|
|
1129
|
-
const resolveChangedSenderId = (changed) => changed.message?.user ?? changed.previous_message?.user ?? changed.message?.bot_id ?? changed.previous_message?.bot_id;
|
|
1130
|
-
const resolveDeletedSenderId = (deleted) => deleted.previous_message?.user ?? deleted.previous_message?.bot_id;
|
|
1131
|
-
const resolveThreadBroadcastSenderId = (thread) => thread.user ?? thread.message?.user ?? thread.message?.bot_id;
|
|
1132
|
-
ctx.app.event("message", async ({ event, body }) => {
|
|
1133
|
-
try {
|
|
1134
|
-
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
|
1135
|
-
const message = event;
|
|
1136
|
-
if (message.subtype === "message_changed") {
|
|
1137
|
-
const changed = event;
|
|
1138
|
-
const channelId = changed.channel;
|
|
1139
|
-
const ingressContext = await authorizeAndResolveSlackSystemEventContext({
|
|
1140
|
-
ctx,
|
|
1141
|
-
senderId: resolveChangedSenderId(changed),
|
|
1142
|
-
channelId,
|
|
1143
|
-
eventKind: "message_changed"
|
|
1144
|
-
});
|
|
1145
|
-
if (!ingressContext) return;
|
|
1146
|
-
const messageId = changed.message?.ts ?? changed.previous_message?.ts;
|
|
1147
|
-
enqueueSystemEvent(`Slack message edited in ${ingressContext.channelLabel}.`, {
|
|
1148
|
-
sessionKey: ingressContext.sessionKey,
|
|
1149
|
-
contextKey: `slack:message:changed:${channelId ?? "unknown"}:${messageId ?? changed.event_ts ?? "unknown"}`
|
|
1150
|
-
});
|
|
1151
|
-
return;
|
|
1152
|
-
}
|
|
1153
|
-
if (message.subtype === "message_deleted") {
|
|
1154
|
-
const deleted = event;
|
|
1155
|
-
const channelId = deleted.channel;
|
|
1156
|
-
const ingressContext = await authorizeAndResolveSlackSystemEventContext({
|
|
1157
|
-
ctx,
|
|
1158
|
-
senderId: resolveDeletedSenderId(deleted),
|
|
1159
|
-
channelId,
|
|
1160
|
-
eventKind: "message_deleted"
|
|
1161
|
-
});
|
|
1162
|
-
if (!ingressContext) return;
|
|
1163
|
-
enqueueSystemEvent(`Slack message deleted in ${ingressContext.channelLabel}.`, {
|
|
1164
|
-
sessionKey: ingressContext.sessionKey,
|
|
1165
|
-
contextKey: `slack:message:deleted:${channelId ?? "unknown"}:${deleted.deleted_ts ?? deleted.event_ts ?? "unknown"}`
|
|
1166
|
-
});
|
|
1167
|
-
return;
|
|
1168
|
-
}
|
|
1169
|
-
if (message.subtype === "thread_broadcast") {
|
|
1170
|
-
const thread = event;
|
|
1171
|
-
const channelId = thread.channel;
|
|
1172
|
-
const ingressContext = await authorizeAndResolveSlackSystemEventContext({
|
|
1173
|
-
ctx,
|
|
1174
|
-
senderId: resolveThreadBroadcastSenderId(thread),
|
|
1175
|
-
channelId,
|
|
1176
|
-
eventKind: "thread_broadcast"
|
|
1177
|
-
});
|
|
1178
|
-
if (!ingressContext) return;
|
|
1179
|
-
const messageId = thread.message?.ts ?? thread.event_ts;
|
|
1180
|
-
enqueueSystemEvent(`Slack thread reply broadcast in ${ingressContext.channelLabel}.`, {
|
|
1181
|
-
sessionKey: ingressContext.sessionKey,
|
|
1182
|
-
contextKey: `slack:thread:broadcast:${channelId ?? "unknown"}:${messageId ?? "unknown"}`
|
|
1183
|
-
});
|
|
1184
|
-
return;
|
|
1185
|
-
}
|
|
1186
|
-
await handleSlackMessage(message, { source: "message" });
|
|
1187
|
-
} catch (err) {
|
|
1188
|
-
ctx.runtime.error?.(danger(`slack handler failed: ${String(err)}`));
|
|
1189
|
-
}
|
|
1190
|
-
});
|
|
1191
|
-
ctx.app.event("app_mention", async ({ event, body }) => {
|
|
1192
|
-
try {
|
|
1193
|
-
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
|
1194
|
-
await handleSlackMessage(event, {
|
|
1195
|
-
source: "app_mention",
|
|
1196
|
-
wasMentioned: true
|
|
1197
|
-
});
|
|
1198
|
-
} catch (err) {
|
|
1199
|
-
ctx.runtime.error?.(danger(`slack mention handler failed: ${String(err)}`));
|
|
1200
|
-
}
|
|
1201
|
-
});
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
|
-
//#endregion
|
|
1205
|
-
//#region src/slack/monitor/events/pins.ts
|
|
1206
|
-
async function handleSlackPinEvent(params) {
|
|
1207
|
-
const { ctx, body, event, action, contextKeySuffix, errorLabel } = params;
|
|
1208
|
-
try {
|
|
1209
|
-
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
|
1210
|
-
const payload = event;
|
|
1211
|
-
const channelId = payload.channel_id;
|
|
1212
|
-
const ingressContext = await authorizeAndResolveSlackSystemEventContext({
|
|
1213
|
-
ctx,
|
|
1214
|
-
senderId: payload.user,
|
|
1215
|
-
channelId,
|
|
1216
|
-
eventKind: "pin"
|
|
1217
|
-
});
|
|
1218
|
-
if (!ingressContext) return;
|
|
1219
|
-
const userLabel = (payload.user ? await ctx.resolveUserName(payload.user) : {})?.name ?? payload.user ?? "someone";
|
|
1220
|
-
const itemType = payload.item?.type ?? "item";
|
|
1221
|
-
const messageId = payload.item?.message?.ts ?? payload.event_ts;
|
|
1222
|
-
enqueueSystemEvent(`Slack: ${userLabel} ${action} a ${itemType} in ${ingressContext.channelLabel}.`, {
|
|
1223
|
-
sessionKey: ingressContext.sessionKey,
|
|
1224
|
-
contextKey: `slack:pin:${contextKeySuffix}:${channelId ?? "unknown"}:${messageId ?? "unknown"}`
|
|
1225
|
-
});
|
|
1226
|
-
} catch (err) {
|
|
1227
|
-
ctx.runtime.error?.(danger(`slack ${errorLabel} handler failed: ${String(err)}`));
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
function registerSlackPinEvents(params) {
|
|
1231
|
-
const { ctx } = params;
|
|
1232
|
-
ctx.app.event("pin_added", async ({ event, body }) => {
|
|
1233
|
-
await handleSlackPinEvent({
|
|
1234
|
-
ctx,
|
|
1235
|
-
body,
|
|
1236
|
-
event,
|
|
1237
|
-
action: "pinned",
|
|
1238
|
-
contextKeySuffix: "added",
|
|
1239
|
-
errorLabel: "pin added"
|
|
1240
|
-
});
|
|
1241
|
-
});
|
|
1242
|
-
ctx.app.event("pin_removed", async ({ event, body }) => {
|
|
1243
|
-
await handleSlackPinEvent({
|
|
1244
|
-
ctx,
|
|
1245
|
-
body,
|
|
1246
|
-
event,
|
|
1247
|
-
action: "unpinned",
|
|
1248
|
-
contextKeySuffix: "removed",
|
|
1249
|
-
errorLabel: "pin removed"
|
|
1250
|
-
});
|
|
1251
|
-
});
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1254
|
-
//#endregion
|
|
1255
|
-
//#region src/slack/monitor/events/reactions.ts
|
|
1256
|
-
function registerSlackReactionEvents(params) {
|
|
1257
|
-
const { ctx } = params;
|
|
1258
|
-
const handleReactionEvent = async (event, action) => {
|
|
1259
|
-
try {
|
|
1260
|
-
const item = event.item;
|
|
1261
|
-
if (!item || item.type !== "message") return;
|
|
1262
|
-
const ingressContext = await authorizeAndResolveSlackSystemEventContext({
|
|
1263
|
-
ctx,
|
|
1264
|
-
senderId: event.user,
|
|
1265
|
-
channelId: item.channel,
|
|
1266
|
-
eventKind: "reaction"
|
|
1267
|
-
});
|
|
1268
|
-
if (!ingressContext) return;
|
|
1269
|
-
const actorInfoPromise = event.user ? ctx.resolveUserName(event.user) : Promise.resolve(void 0);
|
|
1270
|
-
const authorInfoPromise = event.item_user ? ctx.resolveUserName(event.item_user) : Promise.resolve(void 0);
|
|
1271
|
-
const [actorInfo, authorInfo] = await Promise.all([actorInfoPromise, authorInfoPromise]);
|
|
1272
|
-
const actorLabel = actorInfo?.name ?? event.user;
|
|
1273
|
-
const emojiLabel = event.reaction ?? "emoji";
|
|
1274
|
-
const authorLabel = authorInfo?.name ?? event.item_user;
|
|
1275
|
-
const baseText = `Slack reaction ${action}: :${emojiLabel}: by ${actorLabel} in ${ingressContext.channelLabel} msg ${item.ts}`;
|
|
1276
|
-
enqueueSystemEvent(authorLabel ? `${baseText} from ${authorLabel}` : baseText, {
|
|
1277
|
-
sessionKey: ingressContext.sessionKey,
|
|
1278
|
-
contextKey: `slack:reaction:${action}:${item.channel}:${item.ts}:${event.user}:${emojiLabel}`
|
|
1279
|
-
});
|
|
1280
|
-
} catch (err) {
|
|
1281
|
-
ctx.runtime.error?.(danger(`slack reaction handler failed: ${String(err)}`));
|
|
1282
|
-
}
|
|
1283
|
-
};
|
|
1284
|
-
ctx.app.event("reaction_added", async ({ event, body }) => {
|
|
1285
|
-
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
|
1286
|
-
await handleReactionEvent(event, "added");
|
|
1287
|
-
});
|
|
1288
|
-
ctx.app.event("reaction_removed", async ({ event, body }) => {
|
|
1289
|
-
if (ctx.shouldDropMismatchedSlackEvent(body)) return;
|
|
1290
|
-
await handleReactionEvent(event, "removed");
|
|
1291
|
-
});
|
|
1292
|
-
}
|
|
1293
|
-
|
|
1294
|
-
//#endregion
|
|
1295
|
-
//#region src/slack/monitor/events.ts
|
|
1296
|
-
function registerSlackMonitorEvents(params) {
|
|
1297
|
-
registerSlackMessageEvents({
|
|
1298
|
-
ctx: params.ctx,
|
|
1299
|
-
handleSlackMessage: params.handleSlackMessage
|
|
1300
|
-
});
|
|
1301
|
-
registerSlackReactionEvents({ ctx: params.ctx });
|
|
1302
|
-
registerSlackMemberEvents({ ctx: params.ctx });
|
|
1303
|
-
registerSlackChannelEvents({ ctx: params.ctx });
|
|
1304
|
-
registerSlackPinEvents({ ctx: params.ctx });
|
|
1305
|
-
registerSlackInteractionEvents({ ctx: params.ctx });
|
|
1306
|
-
}
|
|
1307
|
-
|
|
1308
|
-
//#endregion
|
|
1309
|
-
//#region src/slack/draft-stream.ts
|
|
1310
|
-
const SLACK_STREAM_MAX_CHARS = 4e3;
|
|
1311
|
-
const DEFAULT_THROTTLE_MS = 1e3;
|
|
1312
|
-
function createSlackDraftStream(params) {
|
|
1313
|
-
const maxChars = Math.min(params.maxChars ?? SLACK_STREAM_MAX_CHARS, SLACK_STREAM_MAX_CHARS);
|
|
1314
|
-
const throttleMs = Math.max(250, params.throttleMs ?? DEFAULT_THROTTLE_MS);
|
|
1315
|
-
const send = params.send ?? sendMessageSlack;
|
|
1316
|
-
const edit = params.edit ?? editSlackMessage;
|
|
1317
|
-
const remove = params.remove ?? deleteSlackMessage;
|
|
1318
|
-
let streamMessageId;
|
|
1319
|
-
let streamChannelId;
|
|
1320
|
-
let lastSentText = "";
|
|
1321
|
-
let stopped = false;
|
|
1322
|
-
const sendOrEditStreamMessage = async (text) => {
|
|
1323
|
-
if (stopped) return;
|
|
1324
|
-
const trimmed = text.trimEnd();
|
|
1325
|
-
if (!trimmed) return;
|
|
1326
|
-
if (trimmed.length > maxChars) {
|
|
1327
|
-
stopped = true;
|
|
1328
|
-
params.warn?.(`slack stream preview stopped (text length ${trimmed.length} > ${maxChars})`);
|
|
1329
|
-
return;
|
|
1330
|
-
}
|
|
1331
|
-
if (trimmed === lastSentText) return;
|
|
1332
|
-
lastSentText = trimmed;
|
|
1333
|
-
try {
|
|
1334
|
-
if (streamChannelId && streamMessageId) {
|
|
1335
|
-
await edit(streamChannelId, streamMessageId, trimmed, {
|
|
1336
|
-
token: params.token,
|
|
1337
|
-
accountId: params.accountId
|
|
1338
|
-
});
|
|
1339
|
-
return;
|
|
1340
|
-
}
|
|
1341
|
-
const sent = await send(params.target, trimmed, {
|
|
1342
|
-
token: params.token,
|
|
1343
|
-
accountId: params.accountId,
|
|
1344
|
-
threadTs: params.resolveThreadTs?.()
|
|
1345
|
-
});
|
|
1346
|
-
streamChannelId = sent.channelId || streamChannelId;
|
|
1347
|
-
streamMessageId = sent.messageId || streamMessageId;
|
|
1348
|
-
if (!streamChannelId || !streamMessageId) {
|
|
1349
|
-
stopped = true;
|
|
1350
|
-
params.warn?.("slack stream preview stopped (missing identifiers from sendMessage)");
|
|
1351
|
-
return;
|
|
1352
|
-
}
|
|
1353
|
-
params.onMessageSent?.();
|
|
1354
|
-
} catch (err) {
|
|
1355
|
-
stopped = true;
|
|
1356
|
-
params.warn?.(`slack stream preview failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1357
|
-
}
|
|
1358
|
-
};
|
|
1359
|
-
const loop = createDraftStreamLoop({
|
|
1360
|
-
throttleMs,
|
|
1361
|
-
isStopped: () => stopped,
|
|
1362
|
-
sendOrEditStreamMessage
|
|
1363
|
-
});
|
|
1364
|
-
const stop = () => {
|
|
1365
|
-
stopped = true;
|
|
1366
|
-
loop.stop();
|
|
1367
|
-
};
|
|
1368
|
-
const clear = async () => {
|
|
1369
|
-
stop();
|
|
1370
|
-
await loop.waitForInFlight();
|
|
1371
|
-
const channelId = streamChannelId;
|
|
1372
|
-
const messageId = streamMessageId;
|
|
1373
|
-
streamChannelId = void 0;
|
|
1374
|
-
streamMessageId = void 0;
|
|
1375
|
-
lastSentText = "";
|
|
1376
|
-
if (!channelId || !messageId) return;
|
|
1377
|
-
try {
|
|
1378
|
-
await remove(channelId, messageId, {
|
|
1379
|
-
token: params.token,
|
|
1380
|
-
accountId: params.accountId
|
|
1381
|
-
});
|
|
1382
|
-
} catch (err) {
|
|
1383
|
-
params.warn?.(`slack stream preview cleanup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1384
|
-
}
|
|
1385
|
-
};
|
|
1386
|
-
const forceNewMessage = () => {
|
|
1387
|
-
streamMessageId = void 0;
|
|
1388
|
-
streamChannelId = void 0;
|
|
1389
|
-
lastSentText = "";
|
|
1390
|
-
loop.resetPending();
|
|
1391
|
-
};
|
|
1392
|
-
params.log?.(`slack stream preview ready (maxChars=${maxChars}, throttleMs=${throttleMs})`);
|
|
1393
|
-
return {
|
|
1394
|
-
update: loop.update,
|
|
1395
|
-
flush: loop.flush,
|
|
1396
|
-
clear,
|
|
1397
|
-
stop,
|
|
1398
|
-
forceNewMessage,
|
|
1399
|
-
messageId: () => streamMessageId,
|
|
1400
|
-
channelId: () => streamChannelId
|
|
1401
|
-
};
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
//#endregion
|
|
1405
|
-
//#region src/slack/stream-mode.ts
|
|
1406
|
-
function resolveSlackStreamingConfig(params) {
|
|
1407
|
-
const mode = resolveSlackStreamingMode(params);
|
|
1408
|
-
return {
|
|
1409
|
-
mode,
|
|
1410
|
-
nativeStreaming: resolveSlackNativeStreaming(params),
|
|
1411
|
-
draftMode: mapStreamingModeToSlackLegacyDraftStreamMode(mode)
|
|
1412
|
-
};
|
|
1413
|
-
}
|
|
1414
|
-
function applyAppendOnlyStreamUpdate(params) {
|
|
1415
|
-
const incoming = params.incoming.trimEnd();
|
|
1416
|
-
if (!incoming) return {
|
|
1417
|
-
rendered: params.rendered,
|
|
1418
|
-
source: params.source,
|
|
1419
|
-
changed: false
|
|
1420
|
-
};
|
|
1421
|
-
if (!params.rendered) return {
|
|
1422
|
-
rendered: incoming,
|
|
1423
|
-
source: incoming,
|
|
1424
|
-
changed: true
|
|
1425
|
-
};
|
|
1426
|
-
if (incoming === params.source) return {
|
|
1427
|
-
rendered: params.rendered,
|
|
1428
|
-
source: params.source,
|
|
1429
|
-
changed: false
|
|
1430
|
-
};
|
|
1431
|
-
if (incoming.startsWith(params.source) || incoming.startsWith(params.rendered)) return {
|
|
1432
|
-
rendered: incoming,
|
|
1433
|
-
source: incoming,
|
|
1434
|
-
changed: incoming !== params.rendered
|
|
1435
|
-
};
|
|
1436
|
-
if (params.source.startsWith(incoming)) return {
|
|
1437
|
-
rendered: params.rendered,
|
|
1438
|
-
source: params.source,
|
|
1439
|
-
changed: false
|
|
1440
|
-
};
|
|
1441
|
-
const separator = params.rendered.endsWith("\n") ? "" : "\n";
|
|
1442
|
-
return {
|
|
1443
|
-
rendered: `${params.rendered}${separator}${incoming}`,
|
|
1444
|
-
source: incoming,
|
|
1445
|
-
changed: true
|
|
1446
|
-
};
|
|
1447
|
-
}
|
|
1448
|
-
function buildStatusFinalPreviewText(updateCount) {
|
|
1449
|
-
return `Status: thinking${".".repeat(Math.max(1, updateCount) % 3 + 1)}`;
|
|
1450
|
-
}
|
|
1451
|
-
|
|
1452
|
-
//#endregion
|
|
1453
|
-
//#region src/slack/streaming.ts
|
|
1454
|
-
/**
|
|
1455
|
-
* Start a new Slack text stream.
|
|
1456
|
-
*
|
|
1457
|
-
* Returns a {@link SlackStreamSession} that should be passed to
|
|
1458
|
-
* {@link appendSlackStream} and {@link stopSlackStream}.
|
|
1459
|
-
*
|
|
1460
|
-
* The first chunk of text can optionally be included via `text`.
|
|
1461
|
-
*/
|
|
1462
|
-
async function startSlackStream(params) {
|
|
1463
|
-
const { client, channel, threadTs, text, teamId, userId } = params;
|
|
1464
|
-
logVerbose(`slack-stream: starting stream in ${channel} thread=${threadTs}${teamId ? ` team=${teamId}` : ""}${userId ? ` user=${userId}` : ""}`);
|
|
1465
|
-
const streamer = client.chatStream({
|
|
1466
|
-
channel,
|
|
1467
|
-
thread_ts: threadTs,
|
|
1468
|
-
...teamId ? { recipient_team_id: teamId } : {},
|
|
1469
|
-
...userId ? { recipient_user_id: userId } : {}
|
|
1470
|
-
});
|
|
1471
|
-
const session = {
|
|
1472
|
-
streamer,
|
|
1473
|
-
channel,
|
|
1474
|
-
threadTs,
|
|
1475
|
-
stopped: false
|
|
1476
|
-
};
|
|
1477
|
-
if (text) {
|
|
1478
|
-
await streamer.append({ markdown_text: text });
|
|
1479
|
-
logVerbose(`slack-stream: appended initial text (${text.length} chars)`);
|
|
1480
|
-
}
|
|
1481
|
-
return session;
|
|
1482
|
-
}
|
|
1483
|
-
/**
|
|
1484
|
-
* Append markdown text to an active Slack stream.
|
|
1485
|
-
*/
|
|
1486
|
-
async function appendSlackStream(params) {
|
|
1487
|
-
const { session, text } = params;
|
|
1488
|
-
if (session.stopped) {
|
|
1489
|
-
logVerbose("slack-stream: attempted to append to a stopped stream, ignoring");
|
|
1490
|
-
return;
|
|
1491
|
-
}
|
|
1492
|
-
if (!text) return;
|
|
1493
|
-
await session.streamer.append({ markdown_text: text });
|
|
1494
|
-
logVerbose(`slack-stream: appended ${text.length} chars`);
|
|
1495
|
-
}
|
|
1496
|
-
/**
|
|
1497
|
-
* Stop (finalize) a Slack stream.
|
|
1498
|
-
*
|
|
1499
|
-
* After calling this the stream message becomes a normal Slack message.
|
|
1500
|
-
* Optionally include final text to append before stopping.
|
|
1501
|
-
*/
|
|
1502
|
-
async function stopSlackStream(params) {
|
|
1503
|
-
const { session, text } = params;
|
|
1504
|
-
if (session.stopped) {
|
|
1505
|
-
logVerbose("slack-stream: stream already stopped, ignoring duplicate stop");
|
|
1506
|
-
return;
|
|
1507
|
-
}
|
|
1508
|
-
session.stopped = true;
|
|
1509
|
-
logVerbose(`slack-stream: stopping stream in ${session.channel} thread=${session.threadTs}${text ? ` (final text: ${text.length} chars)` : ""}`);
|
|
1510
|
-
await session.streamer.stop(text ? { markdown_text: text } : void 0);
|
|
1511
|
-
logVerbose("slack-stream: stream stopped");
|
|
1512
|
-
}
|
|
1513
|
-
|
|
1514
|
-
//#endregion
|
|
1515
|
-
//#region src/slack/threading.ts
|
|
1516
|
-
function resolveSlackThreadContext(params) {
|
|
1517
|
-
const incomingThreadTs = params.message.thread_ts;
|
|
1518
|
-
const eventTs = params.message.event_ts;
|
|
1519
|
-
const messageTs = params.message.ts ?? eventTs;
|
|
1520
|
-
const isThreadReply = typeof incomingThreadTs === "string" && incomingThreadTs.length > 0 && (incomingThreadTs !== messageTs || Boolean(params.message.parent_user_id));
|
|
1521
|
-
return {
|
|
1522
|
-
incomingThreadTs,
|
|
1523
|
-
messageTs,
|
|
1524
|
-
isThreadReply,
|
|
1525
|
-
replyToId: incomingThreadTs ?? messageTs,
|
|
1526
|
-
messageThreadId: isThreadReply ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0
|
|
1527
|
-
};
|
|
1528
|
-
}
|
|
1529
|
-
/**
|
|
1530
|
-
* Resolves Slack thread targeting for replies and status indicators.
|
|
1531
|
-
*
|
|
1532
|
-
* @returns replyThreadTs - Thread timestamp for reply messages
|
|
1533
|
-
* @returns statusThreadTs - Thread timestamp for status indicators (typing, etc.)
|
|
1534
|
-
* @returns isThreadReply - true if this is a genuine user reply in a thread,
|
|
1535
|
-
* false if thread_ts comes from a bot status message (e.g. typing indicator)
|
|
1536
|
-
*/
|
|
1537
|
-
function resolveSlackThreadTargets(params) {
|
|
1538
|
-
const { incomingThreadTs, messageTs, isThreadReply } = resolveSlackThreadContext(params);
|
|
1539
|
-
const replyThreadTs = isThreadReply ? incomingThreadTs : params.replyToMode === "all" ? messageTs : void 0;
|
|
1540
|
-
return {
|
|
1541
|
-
replyThreadTs,
|
|
1542
|
-
statusThreadTs: replyThreadTs,
|
|
1543
|
-
isThreadReply
|
|
1544
|
-
};
|
|
1545
|
-
}
|
|
1546
|
-
|
|
1547
|
-
//#endregion
|
|
1548
|
-
//#region src/slack/monitor/message-handler/dispatch.ts
|
|
1549
|
-
function hasMedia(payload) {
|
|
1550
|
-
return Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
|
|
1551
|
-
}
|
|
1552
|
-
function isSlackStreamingEnabled(params) {
|
|
1553
|
-
if (params.mode !== "partial") return false;
|
|
1554
|
-
return params.nativeStreaming;
|
|
1555
|
-
}
|
|
1556
|
-
function resolveSlackStreamingThreadHint(params) {
|
|
1557
|
-
return resolveSlackThreadTs({
|
|
1558
|
-
replyToMode: params.replyToMode,
|
|
1559
|
-
incomingThreadTs: params.incomingThreadTs,
|
|
1560
|
-
messageTs: params.messageTs,
|
|
1561
|
-
hasReplied: false,
|
|
1562
|
-
isThreadReply: params.isThreadReply
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
function shouldUseStreaming(params) {
|
|
1566
|
-
if (!params.streamingEnabled) return false;
|
|
1567
|
-
if (!params.threadTs) {
|
|
1568
|
-
logVerbose("slack-stream: streaming disabled — no reply thread target available");
|
|
1569
|
-
return false;
|
|
1570
|
-
}
|
|
1571
|
-
return true;
|
|
1572
|
-
}
|
|
1573
|
-
async function dispatchPreparedSlackMessage(prepared) {
|
|
1574
|
-
const { ctx, account, message, route } = prepared;
|
|
1575
|
-
const cfg = ctx.cfg;
|
|
1576
|
-
const runtime = ctx.runtime;
|
|
1577
|
-
if (prepared.isDirectMessage) {
|
|
1578
|
-
const sessionCfg = cfg.session;
|
|
1579
|
-
await updateLastRoute({
|
|
1580
|
-
storePath: resolveStorePath(sessionCfg?.store, { agentId: route.agentId }),
|
|
1581
|
-
sessionKey: route.mainSessionKey,
|
|
1582
|
-
deliveryContext: {
|
|
1583
|
-
channel: "slack",
|
|
1584
|
-
to: `user:${message.user}`,
|
|
1585
|
-
accountId: route.accountId,
|
|
1586
|
-
threadId: prepared.ctxPayload.MessageThreadId
|
|
1587
|
-
},
|
|
1588
|
-
ctx: prepared.ctxPayload
|
|
1589
|
-
});
|
|
1590
|
-
}
|
|
1591
|
-
const { statusThreadTs, isThreadReply } = resolveSlackThreadTargets({
|
|
1592
|
-
message,
|
|
1593
|
-
replyToMode: ctx.replyToMode
|
|
1594
|
-
});
|
|
1595
|
-
const messageTs = message.ts ?? message.event_ts;
|
|
1596
|
-
const incomingThreadTs = message.thread_ts;
|
|
1597
|
-
let didSetStatus = false;
|
|
1598
|
-
const hasRepliedRef = { value: false };
|
|
1599
|
-
const replyPlan = createSlackReplyDeliveryPlan({
|
|
1600
|
-
replyToMode: ctx.replyToMode,
|
|
1601
|
-
incomingThreadTs,
|
|
1602
|
-
messageTs,
|
|
1603
|
-
hasRepliedRef,
|
|
1604
|
-
isThreadReply
|
|
1605
|
-
});
|
|
1606
|
-
const typingTarget = statusThreadTs ? `${message.channel}/${statusThreadTs}` : message.channel;
|
|
1607
|
-
const typingCallbacks = createTypingCallbacks({
|
|
1608
|
-
start: async () => {
|
|
1609
|
-
didSetStatus = true;
|
|
1610
|
-
await ctx.setSlackThreadStatus({
|
|
1611
|
-
channelId: message.channel,
|
|
1612
|
-
threadTs: statusThreadTs,
|
|
1613
|
-
status: "is typing..."
|
|
1614
|
-
});
|
|
1615
|
-
},
|
|
1616
|
-
stop: async () => {
|
|
1617
|
-
if (!didSetStatus) return;
|
|
1618
|
-
didSetStatus = false;
|
|
1619
|
-
await ctx.setSlackThreadStatus({
|
|
1620
|
-
channelId: message.channel,
|
|
1621
|
-
threadTs: statusThreadTs,
|
|
1622
|
-
status: ""
|
|
1623
|
-
});
|
|
1624
|
-
},
|
|
1625
|
-
onStartError: (err) => {
|
|
1626
|
-
logTypingFailure({
|
|
1627
|
-
log: (message) => runtime.error?.(danger(message)),
|
|
1628
|
-
channel: "slack",
|
|
1629
|
-
action: "start",
|
|
1630
|
-
target: typingTarget,
|
|
1631
|
-
error: err
|
|
1632
|
-
});
|
|
1633
|
-
},
|
|
1634
|
-
onStopError: (err) => {
|
|
1635
|
-
logTypingFailure({
|
|
1636
|
-
log: (message) => runtime.error?.(danger(message)),
|
|
1637
|
-
channel: "slack",
|
|
1638
|
-
action: "stop",
|
|
1639
|
-
target: typingTarget,
|
|
1640
|
-
error: err
|
|
1641
|
-
});
|
|
1642
|
-
}
|
|
1643
|
-
});
|
|
1644
|
-
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
1645
|
-
cfg,
|
|
1646
|
-
agentId: route.agentId,
|
|
1647
|
-
channel: "slack",
|
|
1648
|
-
accountId: route.accountId
|
|
1649
|
-
});
|
|
1650
|
-
const slackStreaming = resolveSlackStreamingConfig({
|
|
1651
|
-
streaming: account.config.streaming,
|
|
1652
|
-
streamMode: account.config.streamMode,
|
|
1653
|
-
nativeStreaming: account.config.nativeStreaming
|
|
1654
|
-
});
|
|
1655
|
-
const previewStreamingEnabled = slackStreaming.mode !== "off";
|
|
1656
|
-
const useStreaming = shouldUseStreaming({
|
|
1657
|
-
streamingEnabled: isSlackStreamingEnabled({
|
|
1658
|
-
mode: slackStreaming.mode,
|
|
1659
|
-
nativeStreaming: slackStreaming.nativeStreaming
|
|
1660
|
-
}),
|
|
1661
|
-
threadTs: resolveSlackStreamingThreadHint({
|
|
1662
|
-
replyToMode: ctx.replyToMode,
|
|
1663
|
-
incomingThreadTs,
|
|
1664
|
-
messageTs,
|
|
1665
|
-
isThreadReply
|
|
1666
|
-
})
|
|
1667
|
-
});
|
|
1668
|
-
let streamSession = null;
|
|
1669
|
-
let streamFailed = false;
|
|
1670
|
-
const deliverNormally = async (payload, forcedThreadTs) => {
|
|
1671
|
-
const replyThreadTs = forcedThreadTs ?? replyPlan.nextThreadTs();
|
|
1672
|
-
await deliverReplies({
|
|
1673
|
-
replies: [payload],
|
|
1674
|
-
target: prepared.replyTarget,
|
|
1675
|
-
token: ctx.botToken,
|
|
1676
|
-
accountId: account.accountId,
|
|
1677
|
-
runtime,
|
|
1678
|
-
textLimit: ctx.textLimit,
|
|
1679
|
-
replyThreadTs,
|
|
1680
|
-
replyToMode: ctx.replyToMode
|
|
1681
|
-
});
|
|
1682
|
-
replyPlan.markSent();
|
|
1683
|
-
};
|
|
1684
|
-
const deliverWithStreaming = async (payload) => {
|
|
1685
|
-
if (streamFailed || hasMedia(payload) || !payload.text?.trim()) {
|
|
1686
|
-
await deliverNormally(payload, streamSession?.threadTs);
|
|
1687
|
-
return;
|
|
1688
|
-
}
|
|
1689
|
-
const text = payload.text.trim();
|
|
1690
|
-
let plannedThreadTs;
|
|
1691
|
-
try {
|
|
1692
|
-
if (!streamSession) {
|
|
1693
|
-
const streamThreadTs = replyPlan.nextThreadTs();
|
|
1694
|
-
plannedThreadTs = streamThreadTs;
|
|
1695
|
-
if (!streamThreadTs) {
|
|
1696
|
-
logVerbose("slack-stream: no reply thread target for stream start, falling back to normal delivery");
|
|
1697
|
-
streamFailed = true;
|
|
1698
|
-
await deliverNormally(payload);
|
|
1699
|
-
return;
|
|
1700
|
-
}
|
|
1701
|
-
streamSession = await startSlackStream({
|
|
1702
|
-
client: ctx.app.client,
|
|
1703
|
-
channel: message.channel,
|
|
1704
|
-
threadTs: streamThreadTs,
|
|
1705
|
-
text,
|
|
1706
|
-
teamId: ctx.teamId,
|
|
1707
|
-
userId: message.user
|
|
1708
|
-
});
|
|
1709
|
-
replyPlan.markSent();
|
|
1710
|
-
return;
|
|
1711
|
-
}
|
|
1712
|
-
await appendSlackStream({
|
|
1713
|
-
session: streamSession,
|
|
1714
|
-
text: "\n" + text
|
|
1715
|
-
});
|
|
1716
|
-
} catch (err) {
|
|
1717
|
-
runtime.error?.(danger(`slack-stream: streaming API call failed: ${String(err)}, falling back`));
|
|
1718
|
-
streamFailed = true;
|
|
1719
|
-
await deliverNormally(payload, streamSession?.threadTs ?? plannedThreadTs);
|
|
1720
|
-
}
|
|
1721
|
-
};
|
|
1722
|
-
const { dispatcher, replyOptions, markDispatchIdle } = createReplyDispatcherWithTyping({
|
|
1723
|
-
...prefixOptions,
|
|
1724
|
-
humanDelay: resolveHumanDelayConfig(cfg, route.agentId),
|
|
1725
|
-
typingCallbacks,
|
|
1726
|
-
deliver: async (payload) => {
|
|
1727
|
-
if (useStreaming) {
|
|
1728
|
-
await deliverWithStreaming(payload);
|
|
1729
|
-
return;
|
|
1730
|
-
}
|
|
1731
|
-
const mediaCount = payload.mediaUrls?.length ?? (payload.mediaUrl ? 1 : 0);
|
|
1732
|
-
const draftMessageId = draftStream?.messageId();
|
|
1733
|
-
const draftChannelId = draftStream?.channelId();
|
|
1734
|
-
const finalText = payload.text;
|
|
1735
|
-
if (previewStreamingEnabled && streamMode !== "status_final" && mediaCount === 0 && !payload.isError && typeof finalText === "string" && finalText.trim().length > 0 && typeof draftMessageId === "string" && typeof draftChannelId === "string") {
|
|
1736
|
-
draftStream?.stop();
|
|
1737
|
-
try {
|
|
1738
|
-
await ctx.app.client.chat.update({
|
|
1739
|
-
token: ctx.botToken,
|
|
1740
|
-
channel: draftChannelId,
|
|
1741
|
-
ts: draftMessageId,
|
|
1742
|
-
text: finalText.trim()
|
|
1743
|
-
});
|
|
1744
|
-
return;
|
|
1745
|
-
} catch (err) {
|
|
1746
|
-
logVerbose(`slack: preview final edit failed; falling back to standard send (${String(err)})`);
|
|
1747
|
-
}
|
|
1748
|
-
} else if (previewStreamingEnabled && streamMode === "status_final" && hasStreamedMessage) try {
|
|
1749
|
-
const statusChannelId = draftStream?.channelId();
|
|
1750
|
-
const statusMessageId = draftStream?.messageId();
|
|
1751
|
-
if (statusChannelId && statusMessageId) await ctx.app.client.chat.update({
|
|
1752
|
-
token: ctx.botToken,
|
|
1753
|
-
channel: statusChannelId,
|
|
1754
|
-
ts: statusMessageId,
|
|
1755
|
-
text: "Status: complete. Final answer posted below."
|
|
1756
|
-
});
|
|
1757
|
-
} catch (err) {
|
|
1758
|
-
logVerbose(`slack: status_final completion update failed (${String(err)})`);
|
|
1759
|
-
}
|
|
1760
|
-
else if (mediaCount > 0) {
|
|
1761
|
-
await draftStream?.clear();
|
|
1762
|
-
hasStreamedMessage = false;
|
|
1763
|
-
}
|
|
1764
|
-
await deliverNormally(payload);
|
|
1765
|
-
},
|
|
1766
|
-
onError: (err, info) => {
|
|
1767
|
-
runtime.error?.(danger(`slack ${info.kind} reply failed: ${String(err)}`));
|
|
1768
|
-
typingCallbacks.onIdle?.();
|
|
1769
|
-
}
|
|
1770
|
-
});
|
|
1771
|
-
const draftStream = createSlackDraftStream({
|
|
1772
|
-
target: prepared.replyTarget,
|
|
1773
|
-
token: ctx.botToken,
|
|
1774
|
-
accountId: account.accountId,
|
|
1775
|
-
maxChars: Math.min(ctx.textLimit, 4e3),
|
|
1776
|
-
resolveThreadTs: () => replyPlan.peekThreadTs(),
|
|
1777
|
-
log: logVerbose,
|
|
1778
|
-
warn: logVerbose
|
|
1779
|
-
});
|
|
1780
|
-
let hasStreamedMessage = false;
|
|
1781
|
-
const streamMode = slackStreaming.draftMode;
|
|
1782
|
-
let appendRenderedText = "";
|
|
1783
|
-
let appendSourceText = "";
|
|
1784
|
-
let statusUpdateCount = 0;
|
|
1785
|
-
const updateDraftFromPartial = (text) => {
|
|
1786
|
-
const trimmed = text?.trimEnd();
|
|
1787
|
-
if (!trimmed) return;
|
|
1788
|
-
if (streamMode === "append") {
|
|
1789
|
-
const next = applyAppendOnlyStreamUpdate({
|
|
1790
|
-
incoming: trimmed,
|
|
1791
|
-
rendered: appendRenderedText,
|
|
1792
|
-
source: appendSourceText
|
|
1793
|
-
});
|
|
1794
|
-
appendRenderedText = next.rendered;
|
|
1795
|
-
appendSourceText = next.source;
|
|
1796
|
-
if (!next.changed) return;
|
|
1797
|
-
draftStream.update(next.rendered);
|
|
1798
|
-
hasStreamedMessage = true;
|
|
1799
|
-
return;
|
|
1800
|
-
}
|
|
1801
|
-
if (streamMode === "status_final") {
|
|
1802
|
-
statusUpdateCount += 1;
|
|
1803
|
-
if (statusUpdateCount > 1 && statusUpdateCount % 4 !== 0) return;
|
|
1804
|
-
draftStream.update(buildStatusFinalPreviewText(statusUpdateCount));
|
|
1805
|
-
hasStreamedMessage = true;
|
|
1806
|
-
return;
|
|
1807
|
-
}
|
|
1808
|
-
draftStream.update(trimmed);
|
|
1809
|
-
hasStreamedMessage = true;
|
|
1810
|
-
};
|
|
1811
|
-
const onDraftBoundary = useStreaming || !previewStreamingEnabled ? void 0 : async () => {
|
|
1812
|
-
if (hasStreamedMessage) {
|
|
1813
|
-
draftStream.forceNewMessage();
|
|
1814
|
-
hasStreamedMessage = false;
|
|
1815
|
-
appendRenderedText = "";
|
|
1816
|
-
appendSourceText = "";
|
|
1817
|
-
statusUpdateCount = 0;
|
|
1818
|
-
}
|
|
1819
|
-
};
|
|
1820
|
-
const { queuedFinal, counts } = await dispatchInboundMessage({
|
|
1821
|
-
ctx: prepared.ctxPayload,
|
|
1822
|
-
cfg,
|
|
1823
|
-
dispatcher,
|
|
1824
|
-
replyOptions: {
|
|
1825
|
-
...replyOptions,
|
|
1826
|
-
skillFilter: prepared.channelConfig?.skills,
|
|
1827
|
-
hasRepliedRef,
|
|
1828
|
-
disableBlockStreaming: useStreaming ? true : typeof account.config.blockStreaming === "boolean" ? !account.config.blockStreaming : void 0,
|
|
1829
|
-
onModelSelected,
|
|
1830
|
-
onPartialReply: useStreaming ? void 0 : !previewStreamingEnabled ? void 0 : async (payload) => {
|
|
1831
|
-
updateDraftFromPartial(payload.text);
|
|
1832
|
-
},
|
|
1833
|
-
onAssistantMessageStart: onDraftBoundary,
|
|
1834
|
-
onReasoningEnd: onDraftBoundary
|
|
1835
|
-
}
|
|
1836
|
-
});
|
|
1837
|
-
await draftStream.flush();
|
|
1838
|
-
draftStream.stop();
|
|
1839
|
-
markDispatchIdle();
|
|
1840
|
-
const finalStream = streamSession;
|
|
1841
|
-
if (finalStream && !finalStream.stopped) try {
|
|
1842
|
-
await stopSlackStream({ session: finalStream });
|
|
1843
|
-
} catch (err) {
|
|
1844
|
-
runtime.error?.(danger(`slack-stream: failed to stop stream: ${String(err)}`));
|
|
1845
|
-
}
|
|
1846
|
-
if (!(queuedFinal || (counts.block ?? 0) > 0 || (counts.final ?? 0) > 0)) {
|
|
1847
|
-
await draftStream.clear();
|
|
1848
|
-
if (prepared.isRoomish) clearHistoryEntriesIfEnabled({
|
|
1849
|
-
historyMap: ctx.channelHistories,
|
|
1850
|
-
historyKey: prepared.historyKey,
|
|
1851
|
-
limit: ctx.historyLimit
|
|
1852
|
-
});
|
|
1853
|
-
return;
|
|
1854
|
-
}
|
|
1855
|
-
if (shouldLogVerbose()) {
|
|
1856
|
-
const finalCount = counts.final;
|
|
1857
|
-
logVerbose(`slack: delivered ${finalCount} reply${finalCount === 1 ? "" : "ies"} to ${prepared.replyTarget}`);
|
|
1858
|
-
}
|
|
1859
|
-
removeAckReactionAfterReply({
|
|
1860
|
-
removeAfterReply: ctx.removeAckAfterReply,
|
|
1861
|
-
ackReactionPromise: prepared.ackReactionPromise,
|
|
1862
|
-
ackReactionValue: prepared.ackReactionValue,
|
|
1863
|
-
remove: () => removeSlackReaction(message.channel, prepared.ackReactionMessageTs ?? "", prepared.ackReactionValue, {
|
|
1864
|
-
token: ctx.botToken,
|
|
1865
|
-
client: ctx.app.client
|
|
1866
|
-
}),
|
|
1867
|
-
onError: (err) => {
|
|
1868
|
-
logAckFailure({
|
|
1869
|
-
log: logVerbose,
|
|
1870
|
-
channel: "slack",
|
|
1871
|
-
target: `${message.channel}/${message.ts}`,
|
|
1872
|
-
error: err
|
|
1873
|
-
});
|
|
1874
|
-
}
|
|
1875
|
-
});
|
|
1876
|
-
if (prepared.isRoomish) clearHistoryEntriesIfEnabled({
|
|
1877
|
-
historyMap: ctx.channelHistories,
|
|
1878
|
-
historyKey: prepared.historyKey,
|
|
1879
|
-
limit: ctx.historyLimit
|
|
1880
|
-
});
|
|
1881
|
-
}
|
|
1882
|
-
|
|
1883
|
-
//#endregion
|
|
1884
|
-
//#region src/slack/monitor/dm-auth.ts
|
|
1885
|
-
async function authorizeSlackDirectMessage(params) {
|
|
1886
|
-
if (!params.ctx.dmEnabled || params.ctx.dmPolicy === "disabled") {
|
|
1887
|
-
await params.onDisabled();
|
|
1888
|
-
return false;
|
|
1889
|
-
}
|
|
1890
|
-
if (params.ctx.dmPolicy === "open") return true;
|
|
1891
|
-
const senderName = (await params.resolveSenderName(params.senderId))?.name ?? void 0;
|
|
1892
|
-
const allowMatch = resolveSlackAllowListMatch({
|
|
1893
|
-
allowList: params.allowFromLower,
|
|
1894
|
-
id: params.senderId,
|
|
1895
|
-
name: senderName,
|
|
1896
|
-
allowNameMatching: params.ctx.allowNameMatching
|
|
1897
|
-
});
|
|
1898
|
-
const allowMatchMeta = formatAllowlistMatchMeta(allowMatch);
|
|
1899
|
-
if (allowMatch.allowed) return true;
|
|
1900
|
-
if (params.ctx.dmPolicy === "pairing") {
|
|
1901
|
-
await issuePairingChallenge({
|
|
1902
|
-
channel: "slack",
|
|
1903
|
-
senderId: params.senderId,
|
|
1904
|
-
senderIdLine: `Your Slack user id: ${params.senderId}`,
|
|
1905
|
-
meta: { name: senderName },
|
|
1906
|
-
upsertPairingRequest: async ({ id, meta }) => await upsertChannelPairingRequest({
|
|
1907
|
-
channel: "slack",
|
|
1908
|
-
id,
|
|
1909
|
-
accountId: params.accountId,
|
|
1910
|
-
meta
|
|
1911
|
-
}),
|
|
1912
|
-
sendPairingReply: params.sendPairingReply,
|
|
1913
|
-
onCreated: () => {
|
|
1914
|
-
params.log(`slack pairing request sender=${params.senderId} name=${senderName ?? "unknown"} (${allowMatchMeta})`);
|
|
1915
|
-
},
|
|
1916
|
-
onReplyError: (err) => {
|
|
1917
|
-
params.log(`slack pairing reply failed for ${params.senderId}: ${String(err)}`);
|
|
1918
|
-
}
|
|
1919
|
-
});
|
|
1920
|
-
return false;
|
|
1921
|
-
}
|
|
1922
|
-
await params.onUnauthorized({
|
|
1923
|
-
allowMatchMeta,
|
|
1924
|
-
senderName
|
|
1925
|
-
});
|
|
1926
|
-
return false;
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
//#endregion
|
|
1930
|
-
//#region src/slack/monitor/media.ts
|
|
1931
|
-
function isSlackHostname(hostname) {
|
|
1932
|
-
const normalized = normalizeHostname(hostname);
|
|
1933
|
-
if (!normalized) return false;
|
|
1934
|
-
return [
|
|
1935
|
-
"slack.com",
|
|
1936
|
-
"slack-edge.com",
|
|
1937
|
-
"slack-files.com"
|
|
1938
|
-
].some((suffix) => normalized === suffix || normalized.endsWith(`.${suffix}`));
|
|
1939
|
-
}
|
|
1940
|
-
function assertSlackFileUrl(rawUrl) {
|
|
1941
|
-
let parsed;
|
|
1942
|
-
try {
|
|
1943
|
-
parsed = new URL(rawUrl);
|
|
1944
|
-
} catch {
|
|
1945
|
-
throw new Error(`Invalid Slack file URL: ${rawUrl}`);
|
|
1946
|
-
}
|
|
1947
|
-
if (parsed.protocol !== "https:") throw new Error(`Refusing Slack file URL with non-HTTPS protocol: ${parsed.protocol}`);
|
|
1948
|
-
if (!isSlackHostname(parsed.hostname)) throw new Error(`Refusing to send Slack token to non-Slack host "${parsed.hostname}" (url: ${rawUrl})`);
|
|
1949
|
-
return parsed;
|
|
1950
|
-
}
|
|
1951
|
-
function resolveRequestUrl(input) {
|
|
1952
|
-
if (typeof input === "string") return input;
|
|
1953
|
-
if (input instanceof URL) return input.toString();
|
|
1954
|
-
if ("url" in input && typeof input.url === "string") return input.url;
|
|
1955
|
-
throw new Error("Unsupported fetch input: expected string, URL, or Request");
|
|
1956
|
-
}
|
|
1957
|
-
function createSlackMediaFetch(token) {
|
|
1958
|
-
let includeAuth = true;
|
|
1959
|
-
return async (input, init) => {
|
|
1960
|
-
const url = resolveRequestUrl(input);
|
|
1961
|
-
const { headers: initHeaders, redirect: _redirect, ...rest } = init ?? {};
|
|
1962
|
-
const headers = new Headers(initHeaders);
|
|
1963
|
-
if (includeAuth) {
|
|
1964
|
-
includeAuth = false;
|
|
1965
|
-
const parsed = assertSlackFileUrl(url);
|
|
1966
|
-
headers.set("Authorization", `Bearer ${token}`);
|
|
1967
|
-
return fetch(parsed.href, {
|
|
1968
|
-
...rest,
|
|
1969
|
-
headers,
|
|
1970
|
-
redirect: "manual"
|
|
1971
|
-
});
|
|
1972
|
-
}
|
|
1973
|
-
headers.delete("Authorization");
|
|
1974
|
-
return fetch(url, {
|
|
1975
|
-
...rest,
|
|
1976
|
-
headers,
|
|
1977
|
-
redirect: "manual"
|
|
1978
|
-
});
|
|
1979
|
-
};
|
|
1980
|
-
}
|
|
1981
|
-
/**
|
|
1982
|
-
* Slack voice messages (audio clips, huddle recordings) carry a `subtype` of
|
|
1983
|
-
* `"slack_audio"` but are served with a `video/*` MIME type (e.g. `video/mp4`,
|
|
1984
|
-
* `video/webm`). Override the primary type to `audio/` so the
|
|
1985
|
-
* media-understanding pipeline routes them to transcription.
|
|
1986
|
-
*/
|
|
1987
|
-
function resolveSlackMediaMimetype(file, fetchedContentType) {
|
|
1988
|
-
const mime = fetchedContentType ?? file.mimetype;
|
|
1989
|
-
if (file.subtype === "slack_audio" && mime?.startsWith("video/")) return mime.replace("video/", "audio/");
|
|
1990
|
-
return mime;
|
|
1991
|
-
}
|
|
1992
|
-
const MAX_SLACK_MEDIA_FILES = 8;
|
|
1993
|
-
const MAX_SLACK_MEDIA_CONCURRENCY = 3;
|
|
1994
|
-
const MAX_SLACK_FORWARDED_ATTACHMENTS = 8;
|
|
1995
|
-
function isForwardedSlackAttachment(attachment) {
|
|
1996
|
-
return attachment.is_share === true;
|
|
1997
|
-
}
|
|
1998
|
-
function resolveForwardedAttachmentImageUrl(attachment) {
|
|
1999
|
-
const rawUrl = attachment.image_url?.trim();
|
|
2000
|
-
if (!rawUrl) return null;
|
|
2001
|
-
try {
|
|
2002
|
-
const parsed = new URL(rawUrl);
|
|
2003
|
-
if (parsed.protocol !== "https:" || !isSlackHostname(parsed.hostname)) return null;
|
|
2004
|
-
return parsed.toString();
|
|
2005
|
-
} catch {
|
|
2006
|
-
return null;
|
|
2007
|
-
}
|
|
2008
|
-
}
|
|
2009
|
-
async function mapLimit(items, limit, fn) {
|
|
2010
|
-
if (items.length === 0) return [];
|
|
2011
|
-
const results = [];
|
|
2012
|
-
results.length = items.length;
|
|
2013
|
-
let nextIndex = 0;
|
|
2014
|
-
const workerCount = Math.max(1, Math.min(limit, items.length));
|
|
2015
|
-
await Promise.all(Array.from({ length: workerCount }, async () => {
|
|
2016
|
-
while (true) {
|
|
2017
|
-
const idx = nextIndex++;
|
|
2018
|
-
if (idx >= items.length) return;
|
|
2019
|
-
results[idx] = await fn(items[idx]);
|
|
2020
|
-
}
|
|
2021
|
-
}));
|
|
2022
|
-
return results;
|
|
2023
|
-
}
|
|
2024
|
-
/**
|
|
2025
|
-
* Downloads all files attached to a Slack message and returns them as an array.
|
|
2026
|
-
* Returns `null` when no files could be downloaded.
|
|
2027
|
-
*/
|
|
2028
|
-
async function resolveSlackMedia(params) {
|
|
2029
|
-
const files = params.files ?? [];
|
|
2030
|
-
const results = (await mapLimit(files.length > MAX_SLACK_MEDIA_FILES ? files.slice(0, MAX_SLACK_MEDIA_FILES) : files, MAX_SLACK_MEDIA_CONCURRENCY, async (file) => {
|
|
2031
|
-
const url = file.url_private_download ?? file.url_private;
|
|
2032
|
-
if (!url) return null;
|
|
2033
|
-
try {
|
|
2034
|
-
const fetched = await fetchRemoteMedia({
|
|
2035
|
-
url,
|
|
2036
|
-
fetchImpl: createSlackMediaFetch(params.token),
|
|
2037
|
-
filePathHint: file.name,
|
|
2038
|
-
maxBytes: params.maxBytes
|
|
2039
|
-
});
|
|
2040
|
-
if (fetched.buffer.byteLength > params.maxBytes) return null;
|
|
2041
|
-
const effectiveMime = resolveSlackMediaMimetype(file, fetched.contentType);
|
|
2042
|
-
const saved = await saveMediaBuffer(fetched.buffer, effectiveMime, "inbound", params.maxBytes);
|
|
2043
|
-
const label = fetched.fileName ?? file.name;
|
|
2044
|
-
const contentType = effectiveMime ?? saved.contentType;
|
|
2045
|
-
return {
|
|
2046
|
-
path: saved.path,
|
|
2047
|
-
...contentType ? { contentType } : {},
|
|
2048
|
-
placeholder: label ? `[Slack file: ${label}]` : "[Slack file]"
|
|
2049
|
-
};
|
|
2050
|
-
} catch {
|
|
2051
|
-
return null;
|
|
2052
|
-
}
|
|
2053
|
-
})).filter((entry) => Boolean(entry));
|
|
2054
|
-
return results.length > 0 ? results : null;
|
|
2055
|
-
}
|
|
2056
|
-
/** Extracts text and media from forwarded-message attachments. Returns null when empty. */
|
|
2057
|
-
async function resolveSlackAttachmentContent(params) {
|
|
2058
|
-
const attachments = params.attachments;
|
|
2059
|
-
if (!attachments || attachments.length === 0) return null;
|
|
2060
|
-
const forwardedAttachments = attachments.filter((attachment) => isForwardedSlackAttachment(attachment)).slice(0, MAX_SLACK_FORWARDED_ATTACHMENTS);
|
|
2061
|
-
if (forwardedAttachments.length === 0) return null;
|
|
2062
|
-
const textBlocks = [];
|
|
2063
|
-
const allMedia = [];
|
|
2064
|
-
for (const att of forwardedAttachments) {
|
|
2065
|
-
const text = att.text?.trim() || att.fallback?.trim();
|
|
2066
|
-
if (text) {
|
|
2067
|
-
const author = att.author_name;
|
|
2068
|
-
const heading = author ? `[Forwarded message from ${author}]` : "[Forwarded message]";
|
|
2069
|
-
textBlocks.push(`${heading}\n${text}`);
|
|
2070
|
-
}
|
|
2071
|
-
const imageUrl = resolveForwardedAttachmentImageUrl(att);
|
|
2072
|
-
if (imageUrl) try {
|
|
2073
|
-
const fetched = await fetchRemoteMedia({
|
|
2074
|
-
url: imageUrl,
|
|
2075
|
-
maxBytes: params.maxBytes
|
|
2076
|
-
});
|
|
2077
|
-
if (fetched.buffer.byteLength <= params.maxBytes) {
|
|
2078
|
-
const saved = await saveMediaBuffer(fetched.buffer, fetched.contentType, "inbound", params.maxBytes);
|
|
2079
|
-
const label = fetched.fileName ?? "forwarded image";
|
|
2080
|
-
allMedia.push({
|
|
2081
|
-
path: saved.path,
|
|
2082
|
-
contentType: fetched.contentType ?? saved.contentType,
|
|
2083
|
-
placeholder: `[Forwarded image: ${label}]`
|
|
2084
|
-
});
|
|
2085
|
-
}
|
|
2086
|
-
} catch {}
|
|
2087
|
-
if (att.files && att.files.length > 0) {
|
|
2088
|
-
const fileMedia = await resolveSlackMedia({
|
|
2089
|
-
files: att.files,
|
|
2090
|
-
token: params.token,
|
|
2091
|
-
maxBytes: params.maxBytes
|
|
2092
|
-
});
|
|
2093
|
-
if (fileMedia) allMedia.push(...fileMedia);
|
|
2094
|
-
}
|
|
2095
|
-
}
|
|
2096
|
-
const combinedText = textBlocks.join("\n\n");
|
|
2097
|
-
if (!combinedText && allMedia.length === 0) return null;
|
|
2098
|
-
return {
|
|
2099
|
-
text: combinedText,
|
|
2100
|
-
media: allMedia
|
|
2101
|
-
};
|
|
2102
|
-
}
|
|
2103
|
-
const THREAD_STARTER_CACHE = /* @__PURE__ */ new Map();
|
|
2104
|
-
const THREAD_STARTER_CACHE_TTL_MS = 360 * 6e4;
|
|
2105
|
-
const THREAD_STARTER_CACHE_MAX = 2e3;
|
|
2106
|
-
function evictThreadStarterCache() {
|
|
2107
|
-
const now = Date.now();
|
|
2108
|
-
for (const [cacheKey, entry] of THREAD_STARTER_CACHE.entries()) if (now - entry.cachedAt > THREAD_STARTER_CACHE_TTL_MS) THREAD_STARTER_CACHE.delete(cacheKey);
|
|
2109
|
-
if (THREAD_STARTER_CACHE.size <= THREAD_STARTER_CACHE_MAX) return;
|
|
2110
|
-
const excess = THREAD_STARTER_CACHE.size - THREAD_STARTER_CACHE_MAX;
|
|
2111
|
-
let removed = 0;
|
|
2112
|
-
for (const cacheKey of THREAD_STARTER_CACHE.keys()) {
|
|
2113
|
-
THREAD_STARTER_CACHE.delete(cacheKey);
|
|
2114
|
-
removed += 1;
|
|
2115
|
-
if (removed >= excess) break;
|
|
2116
|
-
}
|
|
2117
|
-
}
|
|
2118
|
-
async function resolveSlackThreadStarter(params) {
|
|
2119
|
-
evictThreadStarterCache();
|
|
2120
|
-
const cacheKey = `${params.channelId}:${params.threadTs}`;
|
|
2121
|
-
const cached = THREAD_STARTER_CACHE.get(cacheKey);
|
|
2122
|
-
if (cached && Date.now() - cached.cachedAt <= THREAD_STARTER_CACHE_TTL_MS) return cached.value;
|
|
2123
|
-
if (cached) THREAD_STARTER_CACHE.delete(cacheKey);
|
|
2124
|
-
try {
|
|
2125
|
-
const message = (await params.client.conversations.replies({
|
|
2126
|
-
channel: params.channelId,
|
|
2127
|
-
ts: params.threadTs,
|
|
2128
|
-
limit: 1,
|
|
2129
|
-
inclusive: true
|
|
2130
|
-
}))?.messages?.[0];
|
|
2131
|
-
const text = (message?.text ?? "").trim();
|
|
2132
|
-
if (!message || !text) return null;
|
|
2133
|
-
const starter = {
|
|
2134
|
-
text,
|
|
2135
|
-
userId: message.user,
|
|
2136
|
-
ts: message.ts,
|
|
2137
|
-
files: message.files
|
|
2138
|
-
};
|
|
2139
|
-
if (THREAD_STARTER_CACHE.has(cacheKey)) THREAD_STARTER_CACHE.delete(cacheKey);
|
|
2140
|
-
THREAD_STARTER_CACHE.set(cacheKey, {
|
|
2141
|
-
value: starter,
|
|
2142
|
-
cachedAt: Date.now()
|
|
2143
|
-
});
|
|
2144
|
-
evictThreadStarterCache();
|
|
2145
|
-
return starter;
|
|
2146
|
-
} catch {
|
|
2147
|
-
return null;
|
|
2148
|
-
}
|
|
2149
|
-
}
|
|
2150
|
-
/**
|
|
2151
|
-
* Fetches the most recent messages in a Slack thread (excluding the current message).
|
|
2152
|
-
* Used to populate thread context when a new thread session starts.
|
|
2153
|
-
*
|
|
2154
|
-
* Uses cursor pagination and keeps only the latest N retained messages so long threads
|
|
2155
|
-
* still produce up-to-date context without unbounded memory growth.
|
|
2156
|
-
*/
|
|
2157
|
-
async function resolveSlackThreadHistory(params) {
|
|
2158
|
-
const maxMessages = params.limit ?? 20;
|
|
2159
|
-
if (!Number.isFinite(maxMessages) || maxMessages <= 0) return [];
|
|
2160
|
-
const fetchLimit = 200;
|
|
2161
|
-
const retained = [];
|
|
2162
|
-
let cursor;
|
|
2163
|
-
try {
|
|
2164
|
-
do {
|
|
2165
|
-
const response = await params.client.conversations.replies({
|
|
2166
|
-
channel: params.channelId,
|
|
2167
|
-
ts: params.threadTs,
|
|
2168
|
-
limit: fetchLimit,
|
|
2169
|
-
inclusive: true,
|
|
2170
|
-
...cursor ? { cursor } : {}
|
|
2171
|
-
});
|
|
2172
|
-
for (const msg of response.messages ?? []) {
|
|
2173
|
-
if (!msg.text?.trim() && !msg.files?.length) continue;
|
|
2174
|
-
if (params.currentMessageTs && msg.ts === params.currentMessageTs) continue;
|
|
2175
|
-
retained.push(msg);
|
|
2176
|
-
if (retained.length > maxMessages) retained.shift();
|
|
2177
|
-
}
|
|
2178
|
-
const next = response.response_metadata?.next_cursor;
|
|
2179
|
-
cursor = typeof next === "string" && next.trim().length > 0 ? next.trim() : void 0;
|
|
2180
|
-
} while (cursor);
|
|
2181
|
-
return retained.map((msg) => ({
|
|
2182
|
-
text: msg.text?.trim() ? msg.text : `[attached: ${msg.files?.map((f) => f.name ?? "file").join(", ")}]`,
|
|
2183
|
-
userId: msg.user,
|
|
2184
|
-
botId: msg.bot_id,
|
|
2185
|
-
ts: msg.ts,
|
|
2186
|
-
files: msg.files
|
|
2187
|
-
}));
|
|
2188
|
-
} catch {
|
|
2189
|
-
return [];
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
|
|
2193
|
-
//#endregion
|
|
2194
|
-
//#region src/slack/monitor/room-context.ts
|
|
2195
|
-
function resolveSlackRoomContextHints(params) {
|
|
2196
|
-
if (!params.isRoomish) return {};
|
|
2197
|
-
const untrustedChannelMetadata = buildUntrustedChannelMetadata({
|
|
2198
|
-
source: "slack",
|
|
2199
|
-
label: "Slack channel description",
|
|
2200
|
-
entries: [params.channelInfo?.topic, params.channelInfo?.purpose]
|
|
2201
|
-
});
|
|
2202
|
-
const systemPromptParts = [params.channelConfig?.systemPrompt?.trim() || null].filter((entry) => Boolean(entry));
|
|
2203
|
-
return {
|
|
2204
|
-
untrustedChannelMetadata,
|
|
2205
|
-
groupSystemPrompt: systemPromptParts.length > 0 ? systemPromptParts.join("\n\n") : void 0
|
|
2206
|
-
};
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
//#endregion
|
|
2210
|
-
//#region src/slack/monitor/message-handler/prepare.ts
|
|
2211
|
-
async function prepareSlackMessage(params) {
|
|
2212
|
-
const { ctx, account, message, opts } = params;
|
|
2213
|
-
const cfg = ctx.cfg;
|
|
2214
|
-
let channelInfo = {};
|
|
2215
|
-
let channelType = message.channel_type;
|
|
2216
|
-
if (!channelType || channelType !== "im") {
|
|
2217
|
-
channelInfo = await ctx.resolveChannelName(message.channel);
|
|
2218
|
-
channelType = channelType ?? channelInfo.type;
|
|
2219
|
-
}
|
|
2220
|
-
const channelName = channelInfo?.name;
|
|
2221
|
-
const resolvedChannelType = normalizeSlackChannelType(channelType, message.channel);
|
|
2222
|
-
const isDirectMessage = resolvedChannelType === "im";
|
|
2223
|
-
const isGroupDm = resolvedChannelType === "mpim";
|
|
2224
|
-
const isRoom = resolvedChannelType === "channel" || resolvedChannelType === "group";
|
|
2225
|
-
const isRoomish = isRoom || isGroupDm;
|
|
2226
|
-
const channelConfig = isRoom ? resolveSlackChannelConfig({
|
|
2227
|
-
channelId: message.channel,
|
|
2228
|
-
channelName,
|
|
2229
|
-
channels: ctx.channelsConfig,
|
|
2230
|
-
defaultRequireMention: ctx.defaultRequireMention
|
|
2231
|
-
}) : null;
|
|
2232
|
-
const allowBots = channelConfig?.allowBots ?? account.config?.allowBots ?? cfg.channels?.slack?.allowBots ?? false;
|
|
2233
|
-
const isBotMessage = Boolean(message.bot_id);
|
|
2234
|
-
if (isBotMessage) {
|
|
2235
|
-
if (message.user && ctx.botUserId && message.user === ctx.botUserId) return null;
|
|
2236
|
-
if (!allowBots) {
|
|
2237
|
-
logVerbose(`slack: drop bot message ${message.bot_id ?? "unknown"} (allowBots=false)`);
|
|
2238
|
-
return null;
|
|
2239
|
-
}
|
|
2240
|
-
}
|
|
2241
|
-
if (isDirectMessage && !message.user) {
|
|
2242
|
-
logVerbose("slack: drop dm message (missing user id)");
|
|
2243
|
-
return null;
|
|
2244
|
-
}
|
|
2245
|
-
const senderId = message.user ?? (isBotMessage ? message.bot_id : void 0);
|
|
2246
|
-
if (!senderId) {
|
|
2247
|
-
logVerbose("slack: drop message (missing sender id)");
|
|
2248
|
-
return null;
|
|
2249
|
-
}
|
|
2250
|
-
if (!ctx.isChannelAllowed({
|
|
2251
|
-
channelId: message.channel,
|
|
2252
|
-
channelName,
|
|
2253
|
-
channelType: resolvedChannelType
|
|
2254
|
-
})) {
|
|
2255
|
-
logVerbose("slack: drop message (channel not allowed)");
|
|
2256
|
-
return null;
|
|
2257
|
-
}
|
|
2258
|
-
const { allowFromLower } = await resolveSlackEffectiveAllowFrom(ctx, { includePairingStore: isDirectMessage });
|
|
2259
|
-
if (isDirectMessage) {
|
|
2260
|
-
const directUserId = message.user;
|
|
2261
|
-
if (!directUserId) {
|
|
2262
|
-
logVerbose("slack: drop dm message (missing user id)");
|
|
2263
|
-
return null;
|
|
2264
|
-
}
|
|
2265
|
-
if (!await authorizeSlackDirectMessage({
|
|
2266
|
-
ctx,
|
|
2267
|
-
accountId: account.accountId,
|
|
2268
|
-
senderId: directUserId,
|
|
2269
|
-
allowFromLower,
|
|
2270
|
-
resolveSenderName: ctx.resolveUserName,
|
|
2271
|
-
sendPairingReply: async (text) => {
|
|
2272
|
-
await sendMessageSlack(message.channel, text, {
|
|
2273
|
-
token: ctx.botToken,
|
|
2274
|
-
client: ctx.app.client,
|
|
2275
|
-
accountId: account.accountId
|
|
2276
|
-
});
|
|
2277
|
-
},
|
|
2278
|
-
onDisabled: () => {
|
|
2279
|
-
logVerbose("slack: drop dm (dms disabled)");
|
|
2280
|
-
},
|
|
2281
|
-
onUnauthorized: ({ allowMatchMeta }) => {
|
|
2282
|
-
logVerbose(`Blocked unauthorized slack sender ${message.user} (dmPolicy=${ctx.dmPolicy}, ${allowMatchMeta})`);
|
|
2283
|
-
},
|
|
2284
|
-
log: logVerbose
|
|
2285
|
-
})) return null;
|
|
2286
|
-
}
|
|
2287
|
-
const route = resolveAgentRoute({
|
|
2288
|
-
cfg,
|
|
2289
|
-
channel: "slack",
|
|
2290
|
-
accountId: account.accountId,
|
|
2291
|
-
teamId: ctx.teamId || void 0,
|
|
2292
|
-
peer: {
|
|
2293
|
-
kind: isDirectMessage ? "direct" : isRoom ? "channel" : "group",
|
|
2294
|
-
id: isDirectMessage ? message.user ?? "unknown" : message.channel
|
|
2295
|
-
}
|
|
2296
|
-
});
|
|
2297
|
-
const baseSessionKey = route.sessionKey;
|
|
2298
|
-
const threadContext = resolveSlackThreadContext({
|
|
2299
|
-
message,
|
|
2300
|
-
replyToMode: ctx.replyToMode
|
|
2301
|
-
});
|
|
2302
|
-
const threadTs = threadContext.incomingThreadTs;
|
|
2303
|
-
const isThreadReply = threadContext.isThreadReply;
|
|
2304
|
-
const threadKeys = resolveThreadSessionKeys({
|
|
2305
|
-
baseSessionKey,
|
|
2306
|
-
threadId: isThreadReply ? threadTs : void 0,
|
|
2307
|
-
parentSessionKey: isThreadReply && ctx.threadInheritParent ? baseSessionKey : void 0
|
|
2308
|
-
});
|
|
2309
|
-
const sessionKey = threadKeys.sessionKey;
|
|
2310
|
-
const historyKey = isThreadReply && ctx.threadHistoryScope === "thread" ? sessionKey : message.channel;
|
|
2311
|
-
const mentionRegexes = buildMentionRegexes(cfg, route.agentId);
|
|
2312
|
-
const hasAnyMention = /<@[^>]+>/.test(message.text ?? "");
|
|
2313
|
-
const explicitlyMentioned = Boolean(ctx.botUserId && message.text?.includes(`<@${ctx.botUserId}>`));
|
|
2314
|
-
const wasMentioned = opts.wasMentioned ?? (!isDirectMessage && matchesMentionWithExplicit({
|
|
2315
|
-
text: message.text ?? "",
|
|
2316
|
-
mentionRegexes,
|
|
2317
|
-
explicit: {
|
|
2318
|
-
hasAnyMention,
|
|
2319
|
-
isExplicitlyMentioned: explicitlyMentioned,
|
|
2320
|
-
canResolveExplicit: Boolean(ctx.botUserId)
|
|
2321
|
-
}
|
|
2322
|
-
}));
|
|
2323
|
-
const implicitMention = Boolean(!isDirectMessage && ctx.botUserId && message.thread_ts && message.parent_user_id === ctx.botUserId);
|
|
2324
|
-
const senderName = (message.user ? await ctx.resolveUserName(message.user) : null)?.name ?? message.username?.trim() ?? message.user ?? message.bot_id ?? "unknown";
|
|
2325
|
-
const channelUserAuthorized = isRoom ? resolveSlackUserAllowed({
|
|
2326
|
-
allowList: channelConfig?.users,
|
|
2327
|
-
userId: senderId,
|
|
2328
|
-
userName: senderName,
|
|
2329
|
-
allowNameMatching: ctx.allowNameMatching
|
|
2330
|
-
}) : true;
|
|
2331
|
-
if (isRoom && !channelUserAuthorized) {
|
|
2332
|
-
logVerbose(`Blocked unauthorized slack sender ${senderId} (not in channel users)`);
|
|
2333
|
-
return null;
|
|
2334
|
-
}
|
|
2335
|
-
const allowTextCommands = shouldHandleTextCommands({
|
|
2336
|
-
cfg,
|
|
2337
|
-
surface: "slack"
|
|
2338
|
-
});
|
|
2339
|
-
const hasControlCommandInMessage = hasControlCommand(stripSlackMentionsForCommandDetection(message.text ?? ""), cfg);
|
|
2340
|
-
const ownerAuthorized = resolveSlackAllowListMatch({
|
|
2341
|
-
allowList: allowFromLower,
|
|
2342
|
-
id: senderId,
|
|
2343
|
-
name: senderName,
|
|
2344
|
-
allowNameMatching: ctx.allowNameMatching
|
|
2345
|
-
}).allowed;
|
|
2346
|
-
const channelUsersAllowlistConfigured = isRoom && Array.isArray(channelConfig?.users) && channelConfig.users.length > 0;
|
|
2347
|
-
const channelCommandAuthorized = isRoom && channelUsersAllowlistConfigured ? resolveSlackUserAllowed({
|
|
2348
|
-
allowList: channelConfig?.users,
|
|
2349
|
-
userId: senderId,
|
|
2350
|
-
userName: senderName,
|
|
2351
|
-
allowNameMatching: ctx.allowNameMatching
|
|
2352
|
-
}) : false;
|
|
2353
|
-
const commandGate = resolveControlCommandGate({
|
|
2354
|
-
useAccessGroups: ctx.useAccessGroups,
|
|
2355
|
-
authorizers: [{
|
|
2356
|
-
configured: allowFromLower.length > 0,
|
|
2357
|
-
allowed: ownerAuthorized
|
|
2358
|
-
}, {
|
|
2359
|
-
configured: channelUsersAllowlistConfigured,
|
|
2360
|
-
allowed: channelCommandAuthorized
|
|
2361
|
-
}],
|
|
2362
|
-
allowTextCommands,
|
|
2363
|
-
hasControlCommand: hasControlCommandInMessage
|
|
2364
|
-
});
|
|
2365
|
-
const commandAuthorized = commandGate.commandAuthorized;
|
|
2366
|
-
if (isRoomish && commandGate.shouldBlock) {
|
|
2367
|
-
logInboundDrop({
|
|
2368
|
-
log: logVerbose,
|
|
2369
|
-
channel: "slack",
|
|
2370
|
-
reason: "control command (unauthorized)",
|
|
2371
|
-
target: senderId
|
|
2372
|
-
});
|
|
2373
|
-
return null;
|
|
2374
|
-
}
|
|
2375
|
-
const shouldRequireMention = isRoom ? channelConfig?.requireMention ?? ctx.defaultRequireMention : false;
|
|
2376
|
-
const canDetectMention = Boolean(ctx.botUserId) || mentionRegexes.length > 0;
|
|
2377
|
-
const mentionGate = resolveMentionGatingWithBypass({
|
|
2378
|
-
isGroup: isRoom,
|
|
2379
|
-
requireMention: Boolean(shouldRequireMention),
|
|
2380
|
-
canDetectMention,
|
|
2381
|
-
wasMentioned,
|
|
2382
|
-
implicitMention,
|
|
2383
|
-
hasAnyMention,
|
|
2384
|
-
allowTextCommands,
|
|
2385
|
-
hasControlCommand: hasControlCommandInMessage,
|
|
2386
|
-
commandAuthorized
|
|
2387
|
-
});
|
|
2388
|
-
const effectiveWasMentioned = mentionGate.effectiveWasMentioned;
|
|
2389
|
-
if (isRoom && shouldRequireMention && mentionGate.shouldSkip) {
|
|
2390
|
-
ctx.logger.info({
|
|
2391
|
-
channel: message.channel,
|
|
2392
|
-
reason: "no-mention"
|
|
2393
|
-
}, "skipping channel message");
|
|
2394
|
-
const pendingText = (message.text ?? "").trim();
|
|
2395
|
-
const fallbackFile = message.files?.[0]?.name ? `[Slack file: ${message.files[0].name}]` : message.files?.length ? "[Slack file]" : "";
|
|
2396
|
-
const pendingBody = pendingText || fallbackFile;
|
|
2397
|
-
recordPendingHistoryEntryIfEnabled({
|
|
2398
|
-
historyMap: ctx.channelHistories,
|
|
2399
|
-
historyKey,
|
|
2400
|
-
limit: ctx.historyLimit,
|
|
2401
|
-
entry: pendingBody ? {
|
|
2402
|
-
sender: senderName,
|
|
2403
|
-
body: pendingBody,
|
|
2404
|
-
timestamp: message.ts ? Math.round(Number(message.ts) * 1e3) : void 0,
|
|
2405
|
-
messageId: message.ts
|
|
2406
|
-
} : null
|
|
2407
|
-
});
|
|
2408
|
-
return null;
|
|
2409
|
-
}
|
|
2410
|
-
const media = await resolveSlackMedia({
|
|
2411
|
-
files: message.files,
|
|
2412
|
-
token: ctx.botToken,
|
|
2413
|
-
maxBytes: ctx.mediaMaxBytes
|
|
2414
|
-
});
|
|
2415
|
-
const attachmentContent = await resolveSlackAttachmentContent({
|
|
2416
|
-
attachments: message.attachments,
|
|
2417
|
-
token: ctx.botToken,
|
|
2418
|
-
maxBytes: ctx.mediaMaxBytes
|
|
2419
|
-
});
|
|
2420
|
-
const mergedMedia = [...media ?? [], ...attachmentContent?.media ?? []];
|
|
2421
|
-
const effectiveDirectMedia = mergedMedia.length > 0 ? mergedMedia : null;
|
|
2422
|
-
const mediaPlaceholder = effectiveDirectMedia ? effectiveDirectMedia.map((m) => m.placeholder).join(" ") : void 0;
|
|
2423
|
-
const fileOnlyFallback = !mediaPlaceholder && (message.files?.length ?? 0) > 0 ? message.files.slice(0, MAX_SLACK_MEDIA_FILES).map((f) => f.name?.trim() || "file").join(", ") : void 0;
|
|
2424
|
-
const fileOnlyPlaceholder = fileOnlyFallback ? `[Slack file: ${fileOnlyFallback}]` : void 0;
|
|
2425
|
-
const rawBody = [
|
|
2426
|
-
(message.text ?? "").trim(),
|
|
2427
|
-
attachmentContent?.text,
|
|
2428
|
-
mediaPlaceholder,
|
|
2429
|
-
fileOnlyPlaceholder
|
|
2430
|
-
].filter(Boolean).join("\n") || "";
|
|
2431
|
-
if (!rawBody) return null;
|
|
2432
|
-
const ackReaction = resolveAckReaction(cfg, route.agentId, {
|
|
2433
|
-
channel: "slack",
|
|
2434
|
-
accountId: account.accountId
|
|
2435
|
-
});
|
|
2436
|
-
const ackReactionValue = ackReaction ?? "";
|
|
2437
|
-
const shouldAckReaction$1 = () => Boolean(ackReaction && shouldAckReaction({
|
|
2438
|
-
scope: ctx.ackReactionScope,
|
|
2439
|
-
isDirect: isDirectMessage,
|
|
2440
|
-
isGroup: isRoomish,
|
|
2441
|
-
isMentionableGroup: isRoom,
|
|
2442
|
-
requireMention: Boolean(shouldRequireMention),
|
|
2443
|
-
canDetectMention,
|
|
2444
|
-
effectiveWasMentioned,
|
|
2445
|
-
shouldBypassMention: mentionGate.shouldBypassMention
|
|
2446
|
-
}));
|
|
2447
|
-
const ackReactionMessageTs = message.ts;
|
|
2448
|
-
const ackReactionPromise = shouldAckReaction$1() && ackReactionMessageTs && ackReactionValue ? reactSlackMessage(message.channel, ackReactionMessageTs, ackReactionValue, {
|
|
2449
|
-
token: ctx.botToken,
|
|
2450
|
-
client: ctx.app.client
|
|
2451
|
-
}).then(() => true, (err) => {
|
|
2452
|
-
logVerbose(`slack react failed for channel ${message.channel}: ${String(err)}`);
|
|
2453
|
-
return false;
|
|
2454
|
-
}) : null;
|
|
2455
|
-
const roomLabel = channelName ? `#${channelName}` : `#${message.channel}`;
|
|
2456
|
-
const preview = rawBody.replace(/\s+/g, " ").slice(0, 160);
|
|
2457
|
-
const inboundLabel = isDirectMessage ? `Slack DM from ${senderName}` : `Slack message in ${roomLabel} from ${senderName}`;
|
|
2458
|
-
const slackFrom = isDirectMessage ? `slack:${message.user}` : isRoom ? `slack:channel:${message.channel}` : `slack:group:${message.channel}`;
|
|
2459
|
-
enqueueSystemEvent(`${inboundLabel}: ${preview}`, {
|
|
2460
|
-
sessionKey,
|
|
2461
|
-
contextKey: `slack:message:${message.channel}:${message.ts ?? "unknown"}`
|
|
2462
|
-
});
|
|
2463
|
-
const envelopeFrom = resolveConversationLabel({
|
|
2464
|
-
ChatType: isDirectMessage ? "direct" : "channel",
|
|
2465
|
-
SenderName: senderName,
|
|
2466
|
-
GroupSubject: isRoomish ? roomLabel : void 0,
|
|
2467
|
-
From: slackFrom
|
|
2468
|
-
}) ?? (isDirectMessage ? senderName : roomLabel);
|
|
2469
|
-
const threadInfo = isThreadReply && threadTs ? ` thread_ts: ${threadTs}${message.parent_user_id ? ` parent_user_id: ${message.parent_user_id}` : ""}` : "";
|
|
2470
|
-
const textWithId = `${rawBody}\n[slack message id: ${message.ts} channel: ${message.channel}${threadInfo}]`;
|
|
2471
|
-
const storePath = resolveStorePath(ctx.cfg.session?.store, { agentId: route.agentId });
|
|
2472
|
-
const envelopeOptions = resolveEnvelopeFormatOptions(ctx.cfg);
|
|
2473
|
-
const previousTimestamp = readSessionUpdatedAt({
|
|
2474
|
-
storePath,
|
|
2475
|
-
sessionKey: route.sessionKey
|
|
2476
|
-
});
|
|
2477
|
-
let combinedBody = formatInboundEnvelope({
|
|
2478
|
-
channel: "Slack",
|
|
2479
|
-
from: envelopeFrom,
|
|
2480
|
-
timestamp: message.ts ? Math.round(Number(message.ts) * 1e3) : void 0,
|
|
2481
|
-
body: textWithId,
|
|
2482
|
-
chatType: isDirectMessage ? "direct" : "channel",
|
|
2483
|
-
sender: {
|
|
2484
|
-
name: senderName,
|
|
2485
|
-
id: senderId
|
|
2486
|
-
},
|
|
2487
|
-
previousTimestamp,
|
|
2488
|
-
envelope: envelopeOptions
|
|
2489
|
-
});
|
|
2490
|
-
if (isRoomish && ctx.historyLimit > 0) combinedBody = buildPendingHistoryContextFromMap({
|
|
2491
|
-
historyMap: ctx.channelHistories,
|
|
2492
|
-
historyKey,
|
|
2493
|
-
limit: ctx.historyLimit,
|
|
2494
|
-
currentMessage: combinedBody,
|
|
2495
|
-
formatEntry: (entry) => formatInboundEnvelope({
|
|
2496
|
-
channel: "Slack",
|
|
2497
|
-
from: roomLabel,
|
|
2498
|
-
timestamp: entry.timestamp,
|
|
2499
|
-
body: `${entry.body}${entry.messageId ? ` [id:${entry.messageId} channel:${message.channel}]` : ""}`,
|
|
2500
|
-
chatType: "channel",
|
|
2501
|
-
senderLabel: entry.sender,
|
|
2502
|
-
envelope: envelopeOptions
|
|
2503
|
-
})
|
|
2504
|
-
});
|
|
2505
|
-
const slackTo = isDirectMessage ? `user:${message.user}` : `channel:${message.channel}`;
|
|
2506
|
-
const { untrustedChannelMetadata, groupSystemPrompt } = resolveSlackRoomContextHints({
|
|
2507
|
-
isRoomish,
|
|
2508
|
-
channelInfo,
|
|
2509
|
-
channelConfig
|
|
2510
|
-
});
|
|
2511
|
-
let threadStarterBody;
|
|
2512
|
-
let threadHistoryBody;
|
|
2513
|
-
let threadSessionPreviousTimestamp;
|
|
2514
|
-
let threadLabel;
|
|
2515
|
-
let threadStarterMedia = null;
|
|
2516
|
-
if (isThreadReply && threadTs) {
|
|
2517
|
-
const starter = await resolveSlackThreadStarter({
|
|
2518
|
-
channelId: message.channel,
|
|
2519
|
-
threadTs,
|
|
2520
|
-
client: ctx.app.client
|
|
2521
|
-
});
|
|
2522
|
-
if (starter?.text) {
|
|
2523
|
-
threadStarterBody = starter.text;
|
|
2524
|
-
const snippet = starter.text.replace(/\s+/g, " ").slice(0, 80);
|
|
2525
|
-
threadLabel = `Slack thread ${roomLabel}${snippet ? `: ${snippet}` : ""}`;
|
|
2526
|
-
if (!effectiveDirectMedia && starter.files && starter.files.length > 0) {
|
|
2527
|
-
threadStarterMedia = await resolveSlackMedia({
|
|
2528
|
-
files: starter.files,
|
|
2529
|
-
token: ctx.botToken,
|
|
2530
|
-
maxBytes: ctx.mediaMaxBytes
|
|
2531
|
-
});
|
|
2532
|
-
if (threadStarterMedia) logVerbose(`slack: hydrated thread starter file ${threadStarterMedia.map((m) => m.placeholder).join(", ")} from root message`);
|
|
2533
|
-
}
|
|
2534
|
-
} else threadLabel = `Slack thread ${roomLabel}`;
|
|
2535
|
-
const threadInitialHistoryLimit = account.config?.thread?.initialHistoryLimit ?? 20;
|
|
2536
|
-
threadSessionPreviousTimestamp = readSessionUpdatedAt({
|
|
2537
|
-
storePath,
|
|
2538
|
-
sessionKey
|
|
2539
|
-
});
|
|
2540
|
-
if (threadInitialHistoryLimit > 0) {
|
|
2541
|
-
const threadHistory = await resolveSlackThreadHistory({
|
|
2542
|
-
channelId: message.channel,
|
|
2543
|
-
threadTs,
|
|
2544
|
-
client: ctx.app.client,
|
|
2545
|
-
currentMessageTs: message.ts,
|
|
2546
|
-
limit: threadInitialHistoryLimit
|
|
2547
|
-
});
|
|
2548
|
-
if (threadHistory.length > 0) {
|
|
2549
|
-
const uniqueUserIds = [...new Set(threadHistory.map((m) => m.userId).filter((id) => Boolean(id)))];
|
|
2550
|
-
const userMap = /* @__PURE__ */ new Map();
|
|
2551
|
-
await Promise.all(uniqueUserIds.map(async (id) => {
|
|
2552
|
-
const user = await ctx.resolveUserName(id);
|
|
2553
|
-
if (user) userMap.set(id, user);
|
|
2554
|
-
}));
|
|
2555
|
-
const historyParts = [];
|
|
2556
|
-
for (const historyMsg of threadHistory) {
|
|
2557
|
-
const msgSenderName = (historyMsg.userId ? userMap.get(historyMsg.userId) : null)?.name ?? (historyMsg.botId ? `Bot (${historyMsg.botId})` : "Unknown");
|
|
2558
|
-
const role = Boolean(historyMsg.botId) ? "assistant" : "user";
|
|
2559
|
-
const msgWithId = `${historyMsg.text}\n[slack message id: ${historyMsg.ts ?? "unknown"} channel: ${message.channel}]`;
|
|
2560
|
-
historyParts.push(formatInboundEnvelope({
|
|
2561
|
-
channel: "Slack",
|
|
2562
|
-
from: `${msgSenderName} (${role})`,
|
|
2563
|
-
timestamp: historyMsg.ts ? Math.round(Number(historyMsg.ts) * 1e3) : void 0,
|
|
2564
|
-
body: msgWithId,
|
|
2565
|
-
chatType: "channel",
|
|
2566
|
-
envelope: envelopeOptions
|
|
2567
|
-
}));
|
|
2568
|
-
}
|
|
2569
|
-
threadHistoryBody = historyParts.join("\n\n");
|
|
2570
|
-
logVerbose(`slack: populated thread history with ${threadHistory.length} messages for new session`);
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
}
|
|
2574
|
-
const effectiveMedia = effectiveDirectMedia ?? threadStarterMedia;
|
|
2575
|
-
const firstMedia = effectiveMedia?.[0];
|
|
2576
|
-
const inboundHistory = isRoomish && ctx.historyLimit > 0 ? (ctx.channelHistories.get(historyKey) ?? []).map((entry) => ({
|
|
2577
|
-
sender: entry.sender,
|
|
2578
|
-
body: entry.body,
|
|
2579
|
-
timestamp: entry.timestamp
|
|
2580
|
-
})) : void 0;
|
|
2581
|
-
const ctxPayload = finalizeInboundContext({
|
|
2582
|
-
Body: combinedBody,
|
|
2583
|
-
BodyForAgent: rawBody,
|
|
2584
|
-
InboundHistory: inboundHistory,
|
|
2585
|
-
RawBody: rawBody,
|
|
2586
|
-
CommandBody: rawBody,
|
|
2587
|
-
From: slackFrom,
|
|
2588
|
-
To: slackTo,
|
|
2589
|
-
SessionKey: sessionKey,
|
|
2590
|
-
AccountId: route.accountId,
|
|
2591
|
-
ChatType: isDirectMessage ? "direct" : "channel",
|
|
2592
|
-
ConversationLabel: envelopeFrom,
|
|
2593
|
-
GroupSubject: isRoomish ? roomLabel : void 0,
|
|
2594
|
-
GroupSystemPrompt: isRoomish ? groupSystemPrompt : void 0,
|
|
2595
|
-
UntrustedContext: untrustedChannelMetadata ? [untrustedChannelMetadata] : void 0,
|
|
2596
|
-
SenderName: senderName,
|
|
2597
|
-
SenderId: senderId,
|
|
2598
|
-
Provider: "slack",
|
|
2599
|
-
Surface: "slack",
|
|
2600
|
-
MessageSid: message.ts,
|
|
2601
|
-
ReplyToId: threadContext.replyToId,
|
|
2602
|
-
MessageThreadId: threadContext.messageThreadId,
|
|
2603
|
-
ParentSessionKey: threadKeys.parentSessionKey,
|
|
2604
|
-
ThreadStarterBody: threadStarterBody,
|
|
2605
|
-
ThreadHistoryBody: threadHistoryBody,
|
|
2606
|
-
IsFirstThreadTurn: isThreadReply && threadTs && !threadSessionPreviousTimestamp ? true : void 0,
|
|
2607
|
-
ThreadLabel: threadLabel,
|
|
2608
|
-
Timestamp: message.ts ? Math.round(Number(message.ts) * 1e3) : void 0,
|
|
2609
|
-
WasMentioned: isRoomish ? effectiveWasMentioned : void 0,
|
|
2610
|
-
MediaPath: firstMedia?.path,
|
|
2611
|
-
MediaType: firstMedia?.contentType,
|
|
2612
|
-
MediaUrl: firstMedia?.path,
|
|
2613
|
-
MediaPaths: effectiveMedia && effectiveMedia.length > 0 ? effectiveMedia.map((m) => m.path) : void 0,
|
|
2614
|
-
MediaUrls: effectiveMedia && effectiveMedia.length > 0 ? effectiveMedia.map((m) => m.path) : void 0,
|
|
2615
|
-
MediaTypes: effectiveMedia && effectiveMedia.length > 0 ? effectiveMedia.map((m) => m.contentType ?? "") : void 0,
|
|
2616
|
-
CommandAuthorized: commandAuthorized,
|
|
2617
|
-
OriginatingChannel: "slack",
|
|
2618
|
-
OriginatingTo: slackTo
|
|
2619
|
-
});
|
|
2620
|
-
await recordInboundSession({
|
|
2621
|
-
storePath,
|
|
2622
|
-
sessionKey,
|
|
2623
|
-
ctx: ctxPayload,
|
|
2624
|
-
updateLastRoute: isDirectMessage ? {
|
|
2625
|
-
sessionKey: route.mainSessionKey,
|
|
2626
|
-
channel: "slack",
|
|
2627
|
-
to: `user:${message.user}`,
|
|
2628
|
-
accountId: route.accountId,
|
|
2629
|
-
threadId: threadContext.messageThreadId
|
|
2630
|
-
} : void 0,
|
|
2631
|
-
onRecordError: (err) => {
|
|
2632
|
-
ctx.logger.warn({
|
|
2633
|
-
error: String(err),
|
|
2634
|
-
storePath,
|
|
2635
|
-
sessionKey
|
|
2636
|
-
}, "failed updating session meta");
|
|
2637
|
-
}
|
|
2638
|
-
});
|
|
2639
|
-
const replyTarget = ctxPayload.To ?? void 0;
|
|
2640
|
-
if (!replyTarget) return null;
|
|
2641
|
-
if (shouldLogVerbose()) logVerbose(`slack inbound: channel=${message.channel} from=${slackFrom} preview="${preview}"`);
|
|
2642
|
-
return {
|
|
2643
|
-
ctx,
|
|
2644
|
-
account,
|
|
2645
|
-
message,
|
|
2646
|
-
route,
|
|
2647
|
-
channelConfig,
|
|
2648
|
-
replyTarget,
|
|
2649
|
-
ctxPayload,
|
|
2650
|
-
isDirectMessage,
|
|
2651
|
-
isRoomish,
|
|
2652
|
-
historyKey,
|
|
2653
|
-
preview,
|
|
2654
|
-
ackReactionMessageTs,
|
|
2655
|
-
ackReactionValue,
|
|
2656
|
-
ackReactionPromise
|
|
2657
|
-
};
|
|
2658
|
-
}
|
|
2659
|
-
|
|
2660
|
-
//#endregion
|
|
2661
|
-
//#region src/slack/monitor/thread-resolution.ts
|
|
2662
|
-
const DEFAULT_THREAD_TS_CACHE_TTL_MS = 6e4;
|
|
2663
|
-
const DEFAULT_THREAD_TS_CACHE_MAX = 500;
|
|
2664
|
-
const normalizeThreadTs = (threadTs) => {
|
|
2665
|
-
const trimmed = threadTs?.trim();
|
|
2666
|
-
return trimmed ? trimmed : void 0;
|
|
2667
|
-
};
|
|
2668
|
-
async function resolveThreadTsFromHistory(params) {
|
|
2669
|
-
try {
|
|
2670
|
-
const response = await params.client.conversations.history({
|
|
2671
|
-
channel: params.channelId,
|
|
2672
|
-
latest: params.messageTs,
|
|
2673
|
-
oldest: params.messageTs,
|
|
2674
|
-
inclusive: true,
|
|
2675
|
-
limit: 1
|
|
2676
|
-
});
|
|
2677
|
-
return normalizeThreadTs((response.messages?.find((entry) => entry.ts === params.messageTs) ?? response.messages?.[0])?.thread_ts);
|
|
2678
|
-
} catch (err) {
|
|
2679
|
-
if (shouldLogVerbose()) logVerbose(`slack inbound: failed to resolve thread_ts via conversations.history for channel=${params.channelId} ts=${params.messageTs}: ${String(err)}`);
|
|
2680
|
-
return;
|
|
2681
|
-
}
|
|
2682
|
-
}
|
|
2683
|
-
function createSlackThreadTsResolver(params) {
|
|
2684
|
-
const ttlMs = Math.max(0, params.cacheTtlMs ?? DEFAULT_THREAD_TS_CACHE_TTL_MS);
|
|
2685
|
-
const maxSize = Math.max(0, params.maxSize ?? DEFAULT_THREAD_TS_CACHE_MAX);
|
|
2686
|
-
const cache = /* @__PURE__ */ new Map();
|
|
2687
|
-
const inflight = /* @__PURE__ */ new Map();
|
|
2688
|
-
const getCached = (key, now) => {
|
|
2689
|
-
const entry = cache.get(key);
|
|
2690
|
-
if (!entry) return;
|
|
2691
|
-
if (ttlMs > 0 && now - entry.updatedAt > ttlMs) {
|
|
2692
|
-
cache.delete(key);
|
|
2693
|
-
return;
|
|
2694
|
-
}
|
|
2695
|
-
cache.delete(key);
|
|
2696
|
-
cache.set(key, {
|
|
2697
|
-
...entry,
|
|
2698
|
-
updatedAt: now
|
|
2699
|
-
});
|
|
2700
|
-
return entry.threadTs;
|
|
2701
|
-
};
|
|
2702
|
-
const setCached = (key, threadTs, now) => {
|
|
2703
|
-
cache.delete(key);
|
|
2704
|
-
cache.set(key, {
|
|
2705
|
-
threadTs,
|
|
2706
|
-
updatedAt: now
|
|
2707
|
-
});
|
|
2708
|
-
pruneMapToMaxSize(cache, maxSize);
|
|
2709
|
-
};
|
|
2710
|
-
return { resolve: async (request) => {
|
|
2711
|
-
const { message } = request;
|
|
2712
|
-
if (!message.parent_user_id || message.thread_ts || !message.ts) return message;
|
|
2713
|
-
const cacheKey = `${message.channel}:${message.ts}`;
|
|
2714
|
-
const cached = getCached(cacheKey, Date.now());
|
|
2715
|
-
if (cached !== void 0) return cached ? {
|
|
2716
|
-
...message,
|
|
2717
|
-
thread_ts: cached
|
|
2718
|
-
} : message;
|
|
2719
|
-
if (shouldLogVerbose()) logVerbose(`slack inbound: missing thread_ts for thread reply channel=${message.channel} ts=${message.ts} source=${request.source}`);
|
|
2720
|
-
let pending = inflight.get(cacheKey);
|
|
2721
|
-
if (!pending) {
|
|
2722
|
-
pending = resolveThreadTsFromHistory({
|
|
2723
|
-
client: params.client,
|
|
2724
|
-
channelId: message.channel,
|
|
2725
|
-
messageTs: message.ts
|
|
2726
|
-
});
|
|
2727
|
-
inflight.set(cacheKey, pending);
|
|
2728
|
-
}
|
|
2729
|
-
let resolved;
|
|
2730
|
-
try {
|
|
2731
|
-
resolved = await pending;
|
|
2732
|
-
} finally {
|
|
2733
|
-
inflight.delete(cacheKey);
|
|
2734
|
-
}
|
|
2735
|
-
setCached(cacheKey, resolved ?? null, Date.now());
|
|
2736
|
-
if (resolved) {
|
|
2737
|
-
if (shouldLogVerbose()) logVerbose(`slack inbound: resolved missing thread_ts channel=${message.channel} ts=${message.ts} -> thread_ts=${resolved}`);
|
|
2738
|
-
return {
|
|
2739
|
-
...message,
|
|
2740
|
-
thread_ts: resolved
|
|
2741
|
-
};
|
|
2742
|
-
}
|
|
2743
|
-
if (shouldLogVerbose()) logVerbose(`slack inbound: could not resolve missing thread_ts channel=${message.channel} ts=${message.ts}`);
|
|
2744
|
-
return message;
|
|
2745
|
-
} };
|
|
2746
|
-
}
|
|
2747
|
-
|
|
2748
|
-
//#endregion
|
|
2749
|
-
//#region src/slack/monitor/message-handler.ts
|
|
2750
|
-
function createSlackMessageHandler(params) {
|
|
2751
|
-
const { ctx, account } = params;
|
|
2752
|
-
const debounceMs = resolveInboundDebounceMs({
|
|
2753
|
-
cfg: ctx.cfg,
|
|
2754
|
-
channel: "slack"
|
|
2755
|
-
});
|
|
2756
|
-
const threadTsResolver = createSlackThreadTsResolver({ client: ctx.app.client });
|
|
2757
|
-
const debouncer = createInboundDebouncer({
|
|
2758
|
-
debounceMs,
|
|
2759
|
-
buildKey: (entry) => {
|
|
2760
|
-
const senderId = entry.message.user ?? entry.message.bot_id;
|
|
2761
|
-
if (!senderId) return null;
|
|
2762
|
-
const messageTs = entry.message.ts ?? entry.message.event_ts;
|
|
2763
|
-
const threadKey = entry.message.thread_ts ? `${entry.message.channel}:${entry.message.thread_ts}` : entry.message.parent_user_id && messageTs ? `${entry.message.channel}:maybe-thread:${messageTs}` : entry.message.channel;
|
|
2764
|
-
return `slack:${ctx.accountId}:${threadKey}:${senderId}`;
|
|
2765
|
-
},
|
|
2766
|
-
shouldDebounce: (entry) => {
|
|
2767
|
-
const text = entry.message.text ?? "";
|
|
2768
|
-
if (!text.trim()) return false;
|
|
2769
|
-
if (entry.message.files && entry.message.files.length > 0) return false;
|
|
2770
|
-
return !hasControlCommand(stripSlackMentionsForCommandDetection(text), ctx.cfg);
|
|
2771
|
-
},
|
|
2772
|
-
onFlush: async (entries) => {
|
|
2773
|
-
const last = entries.at(-1);
|
|
2774
|
-
if (!last) return;
|
|
2775
|
-
const combinedText = entries.length === 1 ? last.message.text ?? "" : entries.map((entry) => entry.message.text ?? "").filter(Boolean).join("\n");
|
|
2776
|
-
const combinedMentioned = entries.some((entry) => Boolean(entry.opts.wasMentioned));
|
|
2777
|
-
const prepared = await prepareSlackMessage({
|
|
2778
|
-
ctx,
|
|
2779
|
-
account,
|
|
2780
|
-
message: {
|
|
2781
|
-
...last.message,
|
|
2782
|
-
text: combinedText
|
|
2783
|
-
},
|
|
2784
|
-
opts: {
|
|
2785
|
-
...last.opts,
|
|
2786
|
-
wasMentioned: combinedMentioned || last.opts.wasMentioned
|
|
2787
|
-
}
|
|
2788
|
-
});
|
|
2789
|
-
if (!prepared) return;
|
|
2790
|
-
if (entries.length > 1) {
|
|
2791
|
-
const ids = entries.map((entry) => entry.message.ts).filter(Boolean);
|
|
2792
|
-
if (ids.length > 0) {
|
|
2793
|
-
prepared.ctxPayload.MessageSids = ids;
|
|
2794
|
-
prepared.ctxPayload.MessageSidFirst = ids[0];
|
|
2795
|
-
prepared.ctxPayload.MessageSidLast = ids[ids.length - 1];
|
|
2796
|
-
}
|
|
2797
|
-
}
|
|
2798
|
-
await dispatchPreparedSlackMessage(prepared);
|
|
2799
|
-
},
|
|
2800
|
-
onError: (err) => {
|
|
2801
|
-
ctx.runtime.error?.(`slack inbound debounce flush failed: ${String(err)}`);
|
|
2802
|
-
}
|
|
2803
|
-
});
|
|
2804
|
-
return async (message, opts) => {
|
|
2805
|
-
if (opts.source === "message" && message.type !== "message") return;
|
|
2806
|
-
if (opts.source === "message" && message.subtype && message.subtype !== "file_share" && message.subtype !== "bot_message") return;
|
|
2807
|
-
if (ctx.markMessageSeen(message.channel, message.ts)) return;
|
|
2808
|
-
const resolvedMessage = await threadTsResolver.resolve({
|
|
2809
|
-
message,
|
|
2810
|
-
source: opts.source
|
|
2811
|
-
});
|
|
2812
|
-
await debouncer.enqueue({
|
|
2813
|
-
message: resolvedMessage,
|
|
2814
|
-
opts
|
|
2815
|
-
});
|
|
2816
|
-
};
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
//#endregion
|
|
2820
|
-
//#region src/slack/monitor/external-arg-menu-store.ts
|
|
2821
|
-
const SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES = 18;
|
|
2822
|
-
const SLACK_EXTERNAL_ARG_MENU_TOKEN_LENGTH = Math.ceil(SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES * 8 / 6);
|
|
2823
|
-
const SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN = new RegExp(`^[A-Za-z0-9_-]{${SLACK_EXTERNAL_ARG_MENU_TOKEN_LENGTH}}$`);
|
|
2824
|
-
const SLACK_EXTERNAL_ARG_MENU_TTL_MS = 600 * 1e3;
|
|
2825
|
-
const SLACK_EXTERNAL_ARG_MENU_PREFIX = "fased_cmdarg_ext:";
|
|
2826
|
-
function pruneSlackExternalArgMenuStore(store, now) {
|
|
2827
|
-
for (const [token, entry] of store.entries()) if (entry.expiresAt <= now) store.delete(token);
|
|
2828
|
-
}
|
|
2829
|
-
function createSlackExternalArgMenuToken(store) {
|
|
2830
|
-
let token = "";
|
|
2831
|
-
do
|
|
2832
|
-
token = generateSecureToken(SLACK_EXTERNAL_ARG_MENU_TOKEN_BYTES);
|
|
2833
|
-
while (store.has(token));
|
|
2834
|
-
return token;
|
|
2835
|
-
}
|
|
2836
|
-
function createSlackExternalArgMenuStore() {
|
|
2837
|
-
const store = /* @__PURE__ */ new Map();
|
|
2838
|
-
return {
|
|
2839
|
-
create(params, now = Date.now()) {
|
|
2840
|
-
pruneSlackExternalArgMenuStore(store, now);
|
|
2841
|
-
const token = createSlackExternalArgMenuToken(store);
|
|
2842
|
-
store.set(token, {
|
|
2843
|
-
choices: params.choices,
|
|
2844
|
-
userId: params.userId,
|
|
2845
|
-
expiresAt: now + SLACK_EXTERNAL_ARG_MENU_TTL_MS
|
|
2846
|
-
});
|
|
2847
|
-
return token;
|
|
2848
|
-
},
|
|
2849
|
-
readToken(raw) {
|
|
2850
|
-
if (typeof raw !== "string" || !raw.startsWith(SLACK_EXTERNAL_ARG_MENU_PREFIX)) return;
|
|
2851
|
-
const token = raw.slice(17).trim();
|
|
2852
|
-
return SLACK_EXTERNAL_ARG_MENU_TOKEN_PATTERN.test(token) ? token : void 0;
|
|
2853
|
-
},
|
|
2854
|
-
get(token, now = Date.now()) {
|
|
2855
|
-
pruneSlackExternalArgMenuStore(store, now);
|
|
2856
|
-
return store.get(token);
|
|
2857
|
-
}
|
|
2858
|
-
};
|
|
2859
|
-
}
|
|
2860
|
-
|
|
2861
|
-
//#endregion
|
|
2862
|
-
//#region src/slack/monitor/slash.ts
|
|
2863
|
-
const SLACK_COMMAND_ARG_ACTION_ID = "fased_cmdarg";
|
|
2864
|
-
const SLACK_COMMAND_ARG_VALUE_PREFIX = "cmdarg";
|
|
2865
|
-
const SLACK_COMMAND_ARG_BUTTON_ROW_SIZE = 5;
|
|
2866
|
-
const SLACK_COMMAND_ARG_OVERFLOW_MIN = 3;
|
|
2867
|
-
const SLACK_COMMAND_ARG_OVERFLOW_MAX = 5;
|
|
2868
|
-
const SLACK_COMMAND_ARG_SELECT_OPTIONS_MAX = 100;
|
|
2869
|
-
const SLACK_COMMAND_ARG_SELECT_OPTION_VALUE_MAX = 75;
|
|
2870
|
-
const SLACK_HEADER_TEXT_MAX = 150;
|
|
2871
|
-
const slackExternalArgMenuStore = createSlackExternalArgMenuStore();
|
|
2872
|
-
function truncatePlainText(value, max) {
|
|
2873
|
-
const trimmed = value.trim();
|
|
2874
|
-
if (trimmed.length <= max) return trimmed;
|
|
2875
|
-
if (max <= 1) return trimmed.slice(0, max);
|
|
2876
|
-
return `${trimmed.slice(0, max - 1)}…`;
|
|
2877
|
-
}
|
|
2878
|
-
function buildSlackArgMenuConfirm(params) {
|
|
2879
|
-
return {
|
|
2880
|
-
title: {
|
|
2881
|
-
type: "plain_text",
|
|
2882
|
-
text: "Confirm selection"
|
|
2883
|
-
},
|
|
2884
|
-
text: {
|
|
2885
|
-
type: "mrkdwn",
|
|
2886
|
-
text: `Run */${escapeSlackMrkdwn(params.command)}* with *${escapeSlackMrkdwn(params.arg)}* set to this value?`
|
|
2887
|
-
},
|
|
2888
|
-
confirm: {
|
|
2889
|
-
type: "plain_text",
|
|
2890
|
-
text: "Run command"
|
|
2891
|
-
},
|
|
2892
|
-
deny: {
|
|
2893
|
-
type: "plain_text",
|
|
2894
|
-
text: "Cancel"
|
|
2895
|
-
}
|
|
2896
|
-
};
|
|
2897
|
-
}
|
|
2898
|
-
function storeSlackExternalArgMenu(params) {
|
|
2899
|
-
return slackExternalArgMenuStore.create({
|
|
2900
|
-
choices: params.choices,
|
|
2901
|
-
userId: params.userId
|
|
2902
|
-
});
|
|
2903
|
-
}
|
|
2904
|
-
function readSlackExternalArgMenuToken(raw) {
|
|
2905
|
-
return slackExternalArgMenuStore.readToken(raw);
|
|
2906
|
-
}
|
|
2907
|
-
let commandsRegistry;
|
|
2908
|
-
async function getCommandsRegistry() {
|
|
2909
|
-
if (!commandsRegistry) commandsRegistry = await import("./commands-registry-CdT-nl7v.js").then((n) => n.n);
|
|
2910
|
-
return commandsRegistry;
|
|
2911
|
-
}
|
|
2912
|
-
function encodeSlackCommandArgValue(parts) {
|
|
2913
|
-
return [
|
|
2914
|
-
SLACK_COMMAND_ARG_VALUE_PREFIX,
|
|
2915
|
-
encodeURIComponent(parts.command),
|
|
2916
|
-
encodeURIComponent(parts.arg),
|
|
2917
|
-
encodeURIComponent(parts.value),
|
|
2918
|
-
encodeURIComponent(parts.userId)
|
|
2919
|
-
].join("|");
|
|
2920
|
-
}
|
|
2921
|
-
function parseSlackCommandArgValue(raw) {
|
|
2922
|
-
if (!raw) return null;
|
|
2923
|
-
const parts = raw.split("|");
|
|
2924
|
-
if (parts.length !== 5 || parts[0] !== SLACK_COMMAND_ARG_VALUE_PREFIX) return null;
|
|
2925
|
-
const [, command, arg, value, userId] = parts;
|
|
2926
|
-
if (!command || !arg || !value || !userId) return null;
|
|
2927
|
-
const decode = (text) => {
|
|
2928
|
-
try {
|
|
2929
|
-
return decodeURIComponent(text);
|
|
2930
|
-
} catch {
|
|
2931
|
-
return null;
|
|
2932
|
-
}
|
|
2933
|
-
};
|
|
2934
|
-
const decodedCommand = decode(command);
|
|
2935
|
-
const decodedArg = decode(arg);
|
|
2936
|
-
const decodedValue = decode(value);
|
|
2937
|
-
const decodedUserId = decode(userId);
|
|
2938
|
-
if (!decodedCommand || !decodedArg || !decodedValue || !decodedUserId) return null;
|
|
2939
|
-
return {
|
|
2940
|
-
command: decodedCommand,
|
|
2941
|
-
arg: decodedArg,
|
|
2942
|
-
value: decodedValue,
|
|
2943
|
-
userId: decodedUserId
|
|
2944
|
-
};
|
|
2945
|
-
}
|
|
2946
|
-
function buildSlackArgMenuOptions(choices) {
|
|
2947
|
-
return choices.map((choice) => ({
|
|
2948
|
-
text: {
|
|
2949
|
-
type: "plain_text",
|
|
2950
|
-
text: choice.label.slice(0, 75)
|
|
2951
|
-
},
|
|
2952
|
-
value: choice.value
|
|
2953
|
-
}));
|
|
2954
|
-
}
|
|
2955
|
-
function buildSlackCommandArgMenuBlocks(params) {
|
|
2956
|
-
const encodedChoices = params.choices.map((choice) => ({
|
|
2957
|
-
label: choice.label,
|
|
2958
|
-
value: encodeSlackCommandArgValue({
|
|
2959
|
-
command: params.command,
|
|
2960
|
-
arg: params.arg,
|
|
2961
|
-
value: choice.value,
|
|
2962
|
-
userId: params.userId
|
|
2963
|
-
})
|
|
2964
|
-
}));
|
|
2965
|
-
const canUseStaticSelect = encodedChoices.every((choice) => choice.value.length <= SLACK_COMMAND_ARG_SELECT_OPTION_VALUE_MAX);
|
|
2966
|
-
const canUseOverflow = canUseStaticSelect && encodedChoices.length >= SLACK_COMMAND_ARG_OVERFLOW_MIN && encodedChoices.length <= SLACK_COMMAND_ARG_OVERFLOW_MAX;
|
|
2967
|
-
const canUseExternalSelect = params.supportsExternalSelect && canUseStaticSelect && encodedChoices.length > SLACK_COMMAND_ARG_SELECT_OPTIONS_MAX;
|
|
2968
|
-
const rows = canUseOverflow ? [{
|
|
2969
|
-
type: "actions",
|
|
2970
|
-
elements: [{
|
|
2971
|
-
type: "overflow",
|
|
2972
|
-
action_id: SLACK_COMMAND_ARG_ACTION_ID,
|
|
2973
|
-
confirm: buildSlackArgMenuConfirm({
|
|
2974
|
-
command: params.command,
|
|
2975
|
-
arg: params.arg
|
|
2976
|
-
}),
|
|
2977
|
-
options: buildSlackArgMenuOptions(encodedChoices)
|
|
2978
|
-
}]
|
|
2979
|
-
}] : canUseExternalSelect ? [{
|
|
2980
|
-
type: "actions",
|
|
2981
|
-
block_id: `${SLACK_EXTERNAL_ARG_MENU_PREFIX}${params.createExternalMenuToken(encodedChoices)}`,
|
|
2982
|
-
elements: [{
|
|
2983
|
-
type: "external_select",
|
|
2984
|
-
action_id: SLACK_COMMAND_ARG_ACTION_ID,
|
|
2985
|
-
confirm: buildSlackArgMenuConfirm({
|
|
2986
|
-
command: params.command,
|
|
2987
|
-
arg: params.arg
|
|
2988
|
-
}),
|
|
2989
|
-
min_query_length: 0,
|
|
2990
|
-
placeholder: {
|
|
2991
|
-
type: "plain_text",
|
|
2992
|
-
text: `Search ${params.arg}`
|
|
2993
|
-
}
|
|
2994
|
-
}]
|
|
2995
|
-
}] : encodedChoices.length <= SLACK_COMMAND_ARG_BUTTON_ROW_SIZE || !canUseStaticSelect ? chunkItems(encodedChoices, SLACK_COMMAND_ARG_BUTTON_ROW_SIZE).map((choices) => ({
|
|
2996
|
-
type: "actions",
|
|
2997
|
-
elements: choices.map((choice) => ({
|
|
2998
|
-
type: "button",
|
|
2999
|
-
action_id: SLACK_COMMAND_ARG_ACTION_ID,
|
|
3000
|
-
text: {
|
|
3001
|
-
type: "plain_text",
|
|
3002
|
-
text: choice.label
|
|
3003
|
-
},
|
|
3004
|
-
value: choice.value,
|
|
3005
|
-
confirm: buildSlackArgMenuConfirm({
|
|
3006
|
-
command: params.command,
|
|
3007
|
-
arg: params.arg
|
|
3008
|
-
})
|
|
3009
|
-
}))
|
|
3010
|
-
})) : chunkItems(encodedChoices, SLACK_COMMAND_ARG_SELECT_OPTIONS_MAX).map((choices, index) => ({
|
|
3011
|
-
type: "actions",
|
|
3012
|
-
elements: [{
|
|
3013
|
-
type: "static_select",
|
|
3014
|
-
action_id: SLACK_COMMAND_ARG_ACTION_ID,
|
|
3015
|
-
confirm: buildSlackArgMenuConfirm({
|
|
3016
|
-
command: params.command,
|
|
3017
|
-
arg: params.arg
|
|
3018
|
-
}),
|
|
3019
|
-
placeholder: {
|
|
3020
|
-
type: "plain_text",
|
|
3021
|
-
text: index === 0 ? `Choose ${params.arg}` : `Choose ${params.arg} (${index + 1})`
|
|
3022
|
-
},
|
|
3023
|
-
options: buildSlackArgMenuOptions(choices)
|
|
3024
|
-
}]
|
|
3025
|
-
}));
|
|
3026
|
-
const headerText = truncatePlainText(`/${params.command}: choose ${params.arg}`, SLACK_HEADER_TEXT_MAX);
|
|
3027
|
-
const sectionText = truncatePlainText(params.title, 3e3);
|
|
3028
|
-
const contextText = truncatePlainText(`Select one option to continue /${params.command} (${params.arg})`, 3e3);
|
|
3029
|
-
return [
|
|
3030
|
-
{
|
|
3031
|
-
type: "header",
|
|
3032
|
-
text: {
|
|
3033
|
-
type: "plain_text",
|
|
3034
|
-
text: headerText
|
|
3035
|
-
}
|
|
3036
|
-
},
|
|
3037
|
-
{
|
|
3038
|
-
type: "section",
|
|
3039
|
-
text: {
|
|
3040
|
-
type: "mrkdwn",
|
|
3041
|
-
text: sectionText
|
|
3042
|
-
}
|
|
3043
|
-
},
|
|
3044
|
-
{
|
|
3045
|
-
type: "context",
|
|
3046
|
-
elements: [{
|
|
3047
|
-
type: "mrkdwn",
|
|
3048
|
-
text: contextText
|
|
3049
|
-
}]
|
|
3050
|
-
},
|
|
3051
|
-
...rows
|
|
3052
|
-
];
|
|
3053
|
-
}
|
|
3054
|
-
async function registerSlackMonitorSlashCommands(params) {
|
|
3055
|
-
const { ctx, account } = params;
|
|
3056
|
-
const cfg = ctx.cfg;
|
|
3057
|
-
const runtime = ctx.runtime;
|
|
3058
|
-
const supportsInteractiveArgMenus = typeof ctx.app.action === "function";
|
|
3059
|
-
const supportsExternalArgMenus = typeof ctx.app.options === "function";
|
|
3060
|
-
const slashCommand = resolveSlackSlashCommandConfig(ctx.slashCommand ?? account.config.slashCommand);
|
|
3061
|
-
const handleSlashCommand = async (p) => {
|
|
3062
|
-
const { command, ack, respond, prompt, commandArgs, commandDefinition } = p;
|
|
3063
|
-
try {
|
|
3064
|
-
if (!prompt.trim()) {
|
|
3065
|
-
await ack({
|
|
3066
|
-
text: "Message required.",
|
|
3067
|
-
response_type: "ephemeral"
|
|
3068
|
-
});
|
|
3069
|
-
return;
|
|
3070
|
-
}
|
|
3071
|
-
await ack();
|
|
3072
|
-
if (ctx.botUserId && command.user_id === ctx.botUserId) return;
|
|
3073
|
-
const channelInfo = await ctx.resolveChannelName(command.channel_id);
|
|
3074
|
-
const channelType = normalizeSlackChannelType(channelInfo?.type ?? (command.channel_name === "directmessage" ? "im" : void 0), command.channel_id);
|
|
3075
|
-
const isDirectMessage = channelType === "im";
|
|
3076
|
-
const isGroupDm = channelType === "mpim";
|
|
3077
|
-
const isRoom = channelType === "channel" || channelType === "group";
|
|
3078
|
-
const isRoomish = isRoom || isGroupDm;
|
|
3079
|
-
if (!ctx.isChannelAllowed({
|
|
3080
|
-
channelId: command.channel_id,
|
|
3081
|
-
channelName: channelInfo?.name,
|
|
3082
|
-
channelType
|
|
3083
|
-
})) {
|
|
3084
|
-
await respond({
|
|
3085
|
-
text: "This channel is not allowed.",
|
|
3086
|
-
response_type: "ephemeral"
|
|
3087
|
-
});
|
|
3088
|
-
return;
|
|
3089
|
-
}
|
|
3090
|
-
const { allowFromLower: effectiveAllowFromLower } = await resolveSlackEffectiveAllowFrom(ctx, { includePairingStore: isDirectMessage });
|
|
3091
|
-
let commandAuthorized = false;
|
|
3092
|
-
let channelConfig = null;
|
|
3093
|
-
if (isDirectMessage) {
|
|
3094
|
-
if (!await authorizeSlackDirectMessage({
|
|
3095
|
-
ctx,
|
|
3096
|
-
accountId: ctx.accountId,
|
|
3097
|
-
senderId: command.user_id,
|
|
3098
|
-
allowFromLower: effectiveAllowFromLower,
|
|
3099
|
-
resolveSenderName: ctx.resolveUserName,
|
|
3100
|
-
sendPairingReply: async (text) => {
|
|
3101
|
-
await respond({
|
|
3102
|
-
text,
|
|
3103
|
-
response_type: "ephemeral"
|
|
3104
|
-
});
|
|
3105
|
-
},
|
|
3106
|
-
onDisabled: async () => {
|
|
3107
|
-
await respond({
|
|
3108
|
-
text: "Slack DMs are disabled.",
|
|
3109
|
-
response_type: "ephemeral"
|
|
3110
|
-
});
|
|
3111
|
-
},
|
|
3112
|
-
onUnauthorized: async ({ allowMatchMeta }) => {
|
|
3113
|
-
logVerbose(`slack: blocked slash sender ${command.user_id} (dmPolicy=${ctx.dmPolicy}, ${allowMatchMeta})`);
|
|
3114
|
-
await respond({
|
|
3115
|
-
text: "You are not authorized to use this command.",
|
|
3116
|
-
response_type: "ephemeral"
|
|
3117
|
-
});
|
|
3118
|
-
},
|
|
3119
|
-
log: logVerbose
|
|
3120
|
-
})) return;
|
|
3121
|
-
}
|
|
3122
|
-
if (isRoom) {
|
|
3123
|
-
channelConfig = resolveSlackChannelConfig({
|
|
3124
|
-
channelId: command.channel_id,
|
|
3125
|
-
channelName: channelInfo?.name,
|
|
3126
|
-
channels: ctx.channelsConfig,
|
|
3127
|
-
defaultRequireMention: ctx.defaultRequireMention
|
|
3128
|
-
});
|
|
3129
|
-
if (ctx.useAccessGroups) {
|
|
3130
|
-
const channelAllowlistConfigured = Boolean(ctx.channelsConfig) && Object.keys(ctx.channelsConfig ?? {}).length > 0;
|
|
3131
|
-
const channelAllowed = channelConfig?.allowed !== false;
|
|
3132
|
-
if (!isSlackChannelAllowedByPolicy({
|
|
3133
|
-
groupPolicy: ctx.groupPolicy,
|
|
3134
|
-
channelAllowlistConfigured,
|
|
3135
|
-
channelAllowed
|
|
3136
|
-
})) {
|
|
3137
|
-
await respond({
|
|
3138
|
-
text: "This channel is not allowed.",
|
|
3139
|
-
response_type: "ephemeral"
|
|
3140
|
-
});
|
|
3141
|
-
return;
|
|
3142
|
-
}
|
|
3143
|
-
const hasExplicitConfig = Boolean(channelConfig?.matchSource);
|
|
3144
|
-
if (!channelAllowed && (ctx.groupPolicy !== "open" || hasExplicitConfig)) {
|
|
3145
|
-
await respond({
|
|
3146
|
-
text: "This channel is not allowed.",
|
|
3147
|
-
response_type: "ephemeral"
|
|
3148
|
-
});
|
|
3149
|
-
return;
|
|
3150
|
-
}
|
|
3151
|
-
}
|
|
3152
|
-
}
|
|
3153
|
-
const senderName = (await ctx.resolveUserName(command.user_id))?.name ?? command.user_name ?? command.user_id;
|
|
3154
|
-
const channelUsersAllowlistConfigured = isRoom && Array.isArray(channelConfig?.users) && channelConfig.users.length > 0;
|
|
3155
|
-
const channelUserAllowed = channelUsersAllowlistConfigured ? resolveSlackUserAllowed({
|
|
3156
|
-
allowList: channelConfig?.users,
|
|
3157
|
-
userId: command.user_id,
|
|
3158
|
-
userName: senderName,
|
|
3159
|
-
allowNameMatching: ctx.allowNameMatching
|
|
3160
|
-
}) : false;
|
|
3161
|
-
if (channelUsersAllowlistConfigured && !channelUserAllowed) {
|
|
3162
|
-
await respond({
|
|
3163
|
-
text: "You are not authorized to use this command here.",
|
|
3164
|
-
response_type: "ephemeral"
|
|
3165
|
-
});
|
|
3166
|
-
return;
|
|
3167
|
-
}
|
|
3168
|
-
const ownerAllowed = resolveSlackAllowListMatch({
|
|
3169
|
-
allowList: effectiveAllowFromLower,
|
|
3170
|
-
id: command.user_id,
|
|
3171
|
-
name: senderName,
|
|
3172
|
-
allowNameMatching: ctx.allowNameMatching
|
|
3173
|
-
}).allowed;
|
|
3174
|
-
commandAuthorized = resolveCommandAuthorizedFromAuthorizers({
|
|
3175
|
-
useAccessGroups: ctx.useAccessGroups,
|
|
3176
|
-
authorizers: [{
|
|
3177
|
-
configured: effectiveAllowFromLower.length > 0,
|
|
3178
|
-
allowed: ownerAllowed
|
|
3179
|
-
}],
|
|
3180
|
-
modeWhenAccessGroupsOff: "configured"
|
|
3181
|
-
});
|
|
3182
|
-
if (isRoomish) {
|
|
3183
|
-
commandAuthorized = resolveCommandAuthorizedFromAuthorizers({
|
|
3184
|
-
useAccessGroups: ctx.useAccessGroups,
|
|
3185
|
-
authorizers: [{
|
|
3186
|
-
configured: effectiveAllowFromLower.length > 0,
|
|
3187
|
-
allowed: ownerAllowed
|
|
3188
|
-
}, {
|
|
3189
|
-
configured: channelUsersAllowlistConfigured,
|
|
3190
|
-
allowed: channelUserAllowed
|
|
3191
|
-
}],
|
|
3192
|
-
modeWhenAccessGroupsOff: "configured"
|
|
3193
|
-
});
|
|
3194
|
-
if (ctx.useAccessGroups && !commandAuthorized) {
|
|
3195
|
-
await respond({
|
|
3196
|
-
text: "You are not authorized to use this command.",
|
|
3197
|
-
response_type: "ephemeral"
|
|
3198
|
-
});
|
|
3199
|
-
return;
|
|
3200
|
-
}
|
|
3201
|
-
}
|
|
3202
|
-
if (commandDefinition && supportsInteractiveArgMenus) {
|
|
3203
|
-
const menu = (await getCommandsRegistry()).resolveCommandArgMenu({
|
|
3204
|
-
command: commandDefinition,
|
|
3205
|
-
args: commandArgs,
|
|
3206
|
-
cfg
|
|
3207
|
-
});
|
|
3208
|
-
if (menu) {
|
|
3209
|
-
const commandLabel = commandDefinition.nativeName ?? commandDefinition.key;
|
|
3210
|
-
const title = menu.title ?? `Choose ${menu.arg.description || menu.arg.name} for /${commandLabel}.`;
|
|
3211
|
-
await respond({
|
|
3212
|
-
text: title,
|
|
3213
|
-
blocks: buildSlackCommandArgMenuBlocks({
|
|
3214
|
-
title,
|
|
3215
|
-
command: commandLabel,
|
|
3216
|
-
arg: menu.arg.name,
|
|
3217
|
-
choices: menu.choices,
|
|
3218
|
-
userId: command.user_id,
|
|
3219
|
-
supportsExternalSelect: supportsExternalArgMenus,
|
|
3220
|
-
createExternalMenuToken: (choices) => storeSlackExternalArgMenu({
|
|
3221
|
-
choices,
|
|
3222
|
-
userId: command.user_id
|
|
3223
|
-
})
|
|
3224
|
-
}),
|
|
3225
|
-
response_type: "ephemeral"
|
|
3226
|
-
});
|
|
3227
|
-
return;
|
|
3228
|
-
}
|
|
3229
|
-
}
|
|
3230
|
-
const channelName = channelInfo?.name;
|
|
3231
|
-
const roomLabel = channelName ? `#${channelName}` : `#${command.channel_id}`;
|
|
3232
|
-
const [{ resolveAgentRoute }, { finalizeInboundContext }, { dispatchReplyWithDispatcher }] = await Promise.all([
|
|
3233
|
-
import("./resolve-route-CNhTJG_2.js").then((n) => n.r),
|
|
3234
|
-
import("./inbound-context-Daf9i2Me.js").then((n) => n.n),
|
|
3235
|
-
import("./pi-embedded-runner-Dum71Tdo.js").then((n) => n.V)
|
|
3236
|
-
]);
|
|
3237
|
-
const [{ resolveConversationLabel }, { createReplyPrefixOptions }, { recordSessionMetaFromInbound, resolveStorePath }] = await Promise.all([
|
|
3238
|
-
import("./conversation-label-BoVqak2R.js").then((n) => n.t),
|
|
3239
|
-
import("./reply-prefix-DqlCqHXT.js").then((n) => n.r),
|
|
3240
|
-
import("./runtime-BPyuAmka.js").then((n) => n.m)
|
|
3241
|
-
]);
|
|
3242
|
-
const route = resolveAgentRoute({
|
|
3243
|
-
cfg,
|
|
3244
|
-
channel: "slack",
|
|
3245
|
-
accountId: account.accountId,
|
|
3246
|
-
teamId: ctx.teamId || void 0,
|
|
3247
|
-
peer: {
|
|
3248
|
-
kind: isDirectMessage ? "direct" : isRoom ? "channel" : "group",
|
|
3249
|
-
id: isDirectMessage ? command.user_id : command.channel_id
|
|
3250
|
-
}
|
|
3251
|
-
});
|
|
3252
|
-
const { untrustedChannelMetadata, groupSystemPrompt } = resolveSlackRoomContextHints({
|
|
3253
|
-
isRoomish,
|
|
3254
|
-
channelInfo,
|
|
3255
|
-
channelConfig
|
|
3256
|
-
});
|
|
3257
|
-
const ctxPayload = finalizeInboundContext({
|
|
3258
|
-
Body: prompt,
|
|
3259
|
-
BodyForAgent: prompt,
|
|
3260
|
-
RawBody: prompt,
|
|
3261
|
-
CommandBody: prompt,
|
|
3262
|
-
CommandArgs: commandArgs,
|
|
3263
|
-
From: isDirectMessage ? `slack:${command.user_id}` : isRoom ? `slack:channel:${command.channel_id}` : `slack:group:${command.channel_id}`,
|
|
3264
|
-
To: `slash:${command.user_id}`,
|
|
3265
|
-
ChatType: isDirectMessage ? "direct" : "channel",
|
|
3266
|
-
ConversationLabel: resolveConversationLabel({
|
|
3267
|
-
ChatType: isDirectMessage ? "direct" : "channel",
|
|
3268
|
-
SenderName: senderName,
|
|
3269
|
-
GroupSubject: isRoomish ? roomLabel : void 0,
|
|
3270
|
-
From: isDirectMessage ? `slack:${command.user_id}` : isRoom ? `slack:channel:${command.channel_id}` : `slack:group:${command.channel_id}`
|
|
3271
|
-
}) ?? (isDirectMessage ? senderName : roomLabel),
|
|
3272
|
-
GroupSubject: isRoomish ? roomLabel : void 0,
|
|
3273
|
-
GroupSystemPrompt: isRoomish ? groupSystemPrompt : void 0,
|
|
3274
|
-
UntrustedContext: untrustedChannelMetadata ? [untrustedChannelMetadata] : void 0,
|
|
3275
|
-
SenderName: senderName,
|
|
3276
|
-
SenderId: command.user_id,
|
|
3277
|
-
Provider: "slack",
|
|
3278
|
-
Surface: "slack",
|
|
3279
|
-
WasMentioned: true,
|
|
3280
|
-
MessageSid: command.trigger_id,
|
|
3281
|
-
Timestamp: Date.now(),
|
|
3282
|
-
SessionKey: `agent:${route.agentId}:${slashCommand.sessionPrefix}:${command.user_id}`.toLowerCase(),
|
|
3283
|
-
CommandTargetSessionKey: route.sessionKey,
|
|
3284
|
-
AccountId: route.accountId,
|
|
3285
|
-
CommandSource: "native",
|
|
3286
|
-
CommandAuthorized: commandAuthorized,
|
|
3287
|
-
OriginatingChannel: "slack",
|
|
3288
|
-
OriginatingTo: `user:${command.user_id}`
|
|
3289
|
-
});
|
|
3290
|
-
const storePath = resolveStorePath(cfg.session?.store, { agentId: route.agentId });
|
|
3291
|
-
try {
|
|
3292
|
-
await recordSessionMetaFromInbound({
|
|
3293
|
-
storePath,
|
|
3294
|
-
sessionKey: ctxPayload.SessionKey ?? route.sessionKey,
|
|
3295
|
-
ctx: ctxPayload
|
|
3296
|
-
});
|
|
3297
|
-
} catch (err) {
|
|
3298
|
-
runtime.error?.(danger(`slack slash: failed updating session meta: ${String(err)}`));
|
|
3299
|
-
}
|
|
3300
|
-
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
3301
|
-
cfg,
|
|
3302
|
-
agentId: route.agentId,
|
|
3303
|
-
channel: "slack",
|
|
3304
|
-
accountId: route.accountId
|
|
3305
|
-
});
|
|
3306
|
-
const deliverSlashPayloads = async (replies) => {
|
|
3307
|
-
const [{ deliverSlackSlashReplies }, { resolveChunkMode }, { resolveMarkdownTableMode }] = await Promise.all([
|
|
3308
|
-
import("./replies-fvzN5wnU.js").then((n) => n.r),
|
|
3309
|
-
import("./chunk-M2d7r-Zt.js").then((n) => n.s),
|
|
3310
|
-
import("./markdown-tables-CCSD52rA.js").then((n) => n.t)
|
|
3311
|
-
]);
|
|
3312
|
-
await deliverSlackSlashReplies({
|
|
3313
|
-
replies,
|
|
3314
|
-
respond,
|
|
3315
|
-
ephemeral: slashCommand.ephemeral,
|
|
3316
|
-
textLimit: ctx.textLimit,
|
|
3317
|
-
chunkMode: resolveChunkMode(cfg, "slack", route.accountId),
|
|
3318
|
-
tableMode: resolveMarkdownTableMode({
|
|
3319
|
-
cfg,
|
|
3320
|
-
channel: "slack",
|
|
3321
|
-
accountId: route.accountId
|
|
3322
|
-
})
|
|
3323
|
-
});
|
|
3324
|
-
};
|
|
3325
|
-
const { counts } = await dispatchReplyWithDispatcher({
|
|
3326
|
-
ctx: ctxPayload,
|
|
3327
|
-
cfg,
|
|
3328
|
-
dispatcherOptions: {
|
|
3329
|
-
...prefixOptions,
|
|
3330
|
-
deliver: async (payload) => deliverSlashPayloads([payload]),
|
|
3331
|
-
onError: (err, info) => {
|
|
3332
|
-
runtime.error?.(danger(`slack slash ${info.kind} reply failed: ${String(err)}`));
|
|
3333
|
-
}
|
|
3334
|
-
},
|
|
3335
|
-
replyOptions: {
|
|
3336
|
-
skillFilter: channelConfig?.skills,
|
|
3337
|
-
onModelSelected
|
|
3338
|
-
}
|
|
3339
|
-
});
|
|
3340
|
-
if (counts.final + counts.tool + counts.block === 0) await deliverSlashPayloads([]);
|
|
3341
|
-
} catch (err) {
|
|
3342
|
-
runtime.error?.(danger(`slack slash handler failed: ${String(err)}`));
|
|
3343
|
-
await respond({
|
|
3344
|
-
text: "Sorry, something went wrong handling that command.",
|
|
3345
|
-
response_type: "ephemeral"
|
|
3346
|
-
});
|
|
3347
|
-
}
|
|
3348
|
-
};
|
|
3349
|
-
const nativeEnabled = resolveNativeCommandsEnabled({
|
|
3350
|
-
providerId: "slack",
|
|
3351
|
-
providerSetting: account.config.commands?.native,
|
|
3352
|
-
globalSetting: cfg.commands?.native
|
|
3353
|
-
});
|
|
3354
|
-
const nativeSkillsEnabled = resolveNativeSkillsEnabled({
|
|
3355
|
-
providerId: "slack",
|
|
3356
|
-
providerSetting: account.config.commands?.nativeSkills,
|
|
3357
|
-
globalSetting: cfg.commands?.nativeSkills
|
|
3358
|
-
});
|
|
3359
|
-
let reg;
|
|
3360
|
-
let nativeCommands = [];
|
|
3361
|
-
if (nativeEnabled) {
|
|
3362
|
-
reg = await getCommandsRegistry();
|
|
3363
|
-
const skillCommands = nativeSkillsEnabled ? (await import("./skill-commands-CkgGmWBS.js").then((n) => n.a)).listSkillCommandsForAgents({ cfg }) : [];
|
|
3364
|
-
nativeCommands = reg.listNativeCommandSpecsForConfig(cfg, {
|
|
3365
|
-
skillCommands,
|
|
3366
|
-
provider: "slack"
|
|
3367
|
-
});
|
|
3368
|
-
}
|
|
3369
|
-
if (nativeCommands.length > 0) {
|
|
3370
|
-
const registry = reg;
|
|
3371
|
-
if (!registry) throw new Error("Missing commands registry for native Slack commands.");
|
|
3372
|
-
for (const command of nativeCommands) ctx.app.command(`/${command.name}`, async ({ command: cmd, ack, respond }) => {
|
|
3373
|
-
const commandDefinition = registry.findCommandByNativeName(command.name, "slack");
|
|
3374
|
-
const rawText = cmd.text?.trim() ?? "";
|
|
3375
|
-
const commandArgs = commandDefinition ? registry.parseCommandArgs(commandDefinition, rawText) : rawText ? { raw: rawText } : void 0;
|
|
3376
|
-
await handleSlashCommand({
|
|
3377
|
-
command: cmd,
|
|
3378
|
-
ack,
|
|
3379
|
-
respond,
|
|
3380
|
-
prompt: commandDefinition ? registry.buildCommandTextFromArgs(commandDefinition, commandArgs) : rawText ? `/${command.name} ${rawText}` : `/${command.name}`,
|
|
3381
|
-
commandArgs,
|
|
3382
|
-
commandDefinition: commandDefinition ?? void 0
|
|
3383
|
-
});
|
|
3384
|
-
});
|
|
3385
|
-
} else if (slashCommand.enabled) ctx.app.command(buildSlackSlashCommandMatcher(slashCommand.name), async ({ command, ack, respond }) => {
|
|
3386
|
-
await handleSlashCommand({
|
|
3387
|
-
command,
|
|
3388
|
-
ack,
|
|
3389
|
-
respond,
|
|
3390
|
-
prompt: command.text?.trim() ?? ""
|
|
3391
|
-
});
|
|
3392
|
-
});
|
|
3393
|
-
else logVerbose("slack: slash commands disabled");
|
|
3394
|
-
if (nativeCommands.length === 0 || !supportsInteractiveArgMenus) return;
|
|
3395
|
-
const registerArgOptions = () => {
|
|
3396
|
-
const appWithOptions = ctx.app;
|
|
3397
|
-
if (typeof appWithOptions.options !== "function") return;
|
|
3398
|
-
appWithOptions.options(SLACK_COMMAND_ARG_ACTION_ID, async ({ ack, body }) => {
|
|
3399
|
-
const typedBody = body;
|
|
3400
|
-
const token = readSlackExternalArgMenuToken(typedBody.actions?.[0]?.block_id ?? typedBody.block_id);
|
|
3401
|
-
if (!token) {
|
|
3402
|
-
await ack({ options: [] });
|
|
3403
|
-
return;
|
|
3404
|
-
}
|
|
3405
|
-
const entry = slackExternalArgMenuStore.get(token);
|
|
3406
|
-
if (!entry) {
|
|
3407
|
-
await ack({ options: [] });
|
|
3408
|
-
return;
|
|
3409
|
-
}
|
|
3410
|
-
const requesterUserId = typedBody.user?.id?.trim();
|
|
3411
|
-
if (!requesterUserId || requesterUserId !== entry.userId) {
|
|
3412
|
-
await ack({ options: [] });
|
|
3413
|
-
return;
|
|
3414
|
-
}
|
|
3415
|
-
const query = typedBody.value?.trim().toLowerCase() ?? "";
|
|
3416
|
-
await ack({ options: entry.choices.filter((choice) => !query || choice.label.toLowerCase().includes(query)).slice(0, SLACK_COMMAND_ARG_SELECT_OPTIONS_MAX).map((choice) => ({
|
|
3417
|
-
text: {
|
|
3418
|
-
type: "plain_text",
|
|
3419
|
-
text: choice.label.slice(0, 75)
|
|
3420
|
-
},
|
|
3421
|
-
value: choice.value
|
|
3422
|
-
})) });
|
|
3423
|
-
});
|
|
3424
|
-
};
|
|
3425
|
-
registerArgOptions();
|
|
3426
|
-
const registerArgAction = (actionId) => {
|
|
3427
|
-
ctx.app.action(actionId, async (args) => {
|
|
3428
|
-
const { ack, body, respond } = args;
|
|
3429
|
-
const action = args.action;
|
|
3430
|
-
await ack();
|
|
3431
|
-
const respondFn = respond ?? (async (payload) => {
|
|
3432
|
-
if (!body.channel?.id || !body.user?.id) return;
|
|
3433
|
-
await ctx.app.client.chat.postEphemeral({
|
|
3434
|
-
token: ctx.botToken,
|
|
3435
|
-
channel: body.channel.id,
|
|
3436
|
-
user: body.user.id,
|
|
3437
|
-
text: payload.text,
|
|
3438
|
-
blocks: payload.blocks
|
|
3439
|
-
});
|
|
3440
|
-
});
|
|
3441
|
-
const parsed = parseSlackCommandArgValue(action?.value ?? action?.selected_option?.value);
|
|
3442
|
-
if (!parsed) {
|
|
3443
|
-
await respondFn({
|
|
3444
|
-
text: "Sorry, that button is no longer valid.",
|
|
3445
|
-
response_type: "ephemeral"
|
|
3446
|
-
});
|
|
3447
|
-
return;
|
|
3448
|
-
}
|
|
3449
|
-
if (body.user?.id && parsed.userId !== body.user.id) {
|
|
3450
|
-
await respondFn({
|
|
3451
|
-
text: "That menu is for another user.",
|
|
3452
|
-
response_type: "ephemeral"
|
|
3453
|
-
});
|
|
3454
|
-
return;
|
|
3455
|
-
}
|
|
3456
|
-
const reg = await getCommandsRegistry();
|
|
3457
|
-
const commandDefinition = reg.findCommandByNativeName(parsed.command, "slack");
|
|
3458
|
-
const commandArgs = { values: { [parsed.arg]: parsed.value } };
|
|
3459
|
-
const prompt = commandDefinition ? reg.buildCommandTextFromArgs(commandDefinition, commandArgs) : `/${parsed.command} ${parsed.value}`;
|
|
3460
|
-
const user = body.user;
|
|
3461
|
-
const userName = user && "name" in user && user.name ? user.name : user && "username" in user && user.username ? user.username : user?.id ?? "";
|
|
3462
|
-
const triggerId = "trigger_id" in body ? body.trigger_id : void 0;
|
|
3463
|
-
await handleSlashCommand({
|
|
3464
|
-
command: {
|
|
3465
|
-
user_id: user?.id ?? "",
|
|
3466
|
-
user_name: userName,
|
|
3467
|
-
channel_id: body.channel?.id ?? "",
|
|
3468
|
-
channel_name: body.channel?.name ?? body.channel?.id ?? "",
|
|
3469
|
-
trigger_id: triggerId
|
|
3470
|
-
},
|
|
3471
|
-
ack: async () => {},
|
|
3472
|
-
respond: respondFn,
|
|
3473
|
-
prompt,
|
|
3474
|
-
commandArgs,
|
|
3475
|
-
commandDefinition: commandDefinition ?? void 0
|
|
3476
|
-
});
|
|
3477
|
-
});
|
|
3478
|
-
};
|
|
3479
|
-
registerArgAction(SLACK_COMMAND_ARG_ACTION_ID);
|
|
3480
|
-
}
|
|
3481
|
-
|
|
3482
|
-
//#endregion
|
|
3483
|
-
//#region src/slack/monitor/provider.ts
|
|
3484
|
-
const slackBoltModule = SlackBolt;
|
|
3485
|
-
const { App, HTTPReceiver } = (slackBoltModule.App ? slackBoltModule : slackBoltModule.default) ?? slackBoltModule;
|
|
3486
|
-
const SLACK_WEBHOOK_MAX_BODY_BYTES = 1024 * 1024;
|
|
3487
|
-
const SLACK_WEBHOOK_BODY_TIMEOUT_MS = 3e4;
|
|
3488
|
-
function parseApiAppIdFromAppToken(raw) {
|
|
3489
|
-
const token = raw?.trim();
|
|
3490
|
-
if (!token) return;
|
|
3491
|
-
return /^xapp-\d-([a-z0-9]+)-/i.exec(token)?.[1]?.toUpperCase();
|
|
3492
|
-
}
|
|
3493
|
-
async function monitorSlackProvider(opts = {}) {
|
|
3494
|
-
const cfg = opts.config ?? loadConfig();
|
|
3495
|
-
let account = resolveSlackAccount({
|
|
3496
|
-
cfg,
|
|
3497
|
-
accountId: opts.accountId
|
|
3498
|
-
});
|
|
3499
|
-
const historyLimit = Math.max(0, account.config.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? DEFAULT_GROUP_HISTORY_LIMIT);
|
|
3500
|
-
const sessionCfg = cfg.session;
|
|
3501
|
-
const sessionScope = sessionCfg?.scope ?? "per-sender";
|
|
3502
|
-
const mainKey = normalizeMainKey(sessionCfg?.mainKey);
|
|
3503
|
-
const slackMode = opts.mode ?? account.config.mode ?? "socket";
|
|
3504
|
-
const slackWebhookPath = normalizeSlackWebhookPath(account.config.webhookPath);
|
|
3505
|
-
const signingSecret = account.config.signingSecret?.trim();
|
|
3506
|
-
const botToken = resolveSlackBotToken(opts.botToken ?? account.botToken);
|
|
3507
|
-
const appToken = resolveSlackAppToken(opts.appToken ?? account.appToken);
|
|
3508
|
-
if (!botToken || slackMode !== "http" && !appToken) {
|
|
3509
|
-
const missing = slackMode === "http" ? `Slack bot token missing for account "${account.accountId}" (set channels.slack.accounts.${account.accountId}.botToken or SLACK_BOT_TOKEN for default).` : `Slack bot + app tokens missing for account "${account.accountId}" (set channels.slack.accounts.${account.accountId}.botToken/appToken or SLACK_BOT_TOKEN/SLACK_APP_TOKEN for default).`;
|
|
3510
|
-
throw new Error(missing);
|
|
3511
|
-
}
|
|
3512
|
-
if (slackMode === "http" && !signingSecret) throw new Error(`Slack signing secret missing for account "${account.accountId}" (set channels.slack.signingSecret or channels.slack.accounts.${account.accountId}.signingSecret).`);
|
|
3513
|
-
const runtime = opts.runtime ?? createNonExitingRuntime();
|
|
3514
|
-
const slackCfg = account.config;
|
|
3515
|
-
const dmConfig = slackCfg.dm;
|
|
3516
|
-
const dmEnabled = dmConfig?.enabled ?? true;
|
|
3517
|
-
const dmPolicy = slackCfg.dmPolicy ?? dmConfig?.policy ?? "pairing";
|
|
3518
|
-
let allowFrom = slackCfg.allowFrom ?? dmConfig?.allowFrom;
|
|
3519
|
-
const groupDmEnabled = dmConfig?.groupEnabled ?? false;
|
|
3520
|
-
const groupDmChannels = dmConfig?.groupChannels;
|
|
3521
|
-
let channelsConfig = slackCfg.channels;
|
|
3522
|
-
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
3523
|
-
const { groupPolicy, providerMissingFallbackApplied } = resolveOpenProviderRuntimeGroupPolicy({
|
|
3524
|
-
providerConfigPresent: cfg.channels?.slack !== void 0,
|
|
3525
|
-
groupPolicy: slackCfg.groupPolicy,
|
|
3526
|
-
defaultGroupPolicy
|
|
3527
|
-
});
|
|
3528
|
-
warnMissingProviderGroupPolicyFallbackOnce({
|
|
3529
|
-
providerMissingFallbackApplied,
|
|
3530
|
-
providerKey: "slack",
|
|
3531
|
-
accountId: account.accountId,
|
|
3532
|
-
log: (message) => runtime.log?.(warn(message))
|
|
3533
|
-
});
|
|
3534
|
-
const resolveToken = slackCfg.userToken?.trim() || botToken;
|
|
3535
|
-
const useAccessGroups = cfg.commands?.useAccessGroups !== false;
|
|
3536
|
-
const reactionMode = slackCfg.reactionNotifications ?? "own";
|
|
3537
|
-
const reactionAllowlist = slackCfg.reactionAllowlist ?? [];
|
|
3538
|
-
const replyToMode = slackCfg.replyToMode ?? "off";
|
|
3539
|
-
const threadHistoryScope = slackCfg.thread?.historyScope ?? "thread";
|
|
3540
|
-
const threadInheritParent = slackCfg.thread?.inheritParent ?? false;
|
|
3541
|
-
const slashCommand = resolveSlackSlashCommandConfig(opts.slashCommand ?? slackCfg.slashCommand);
|
|
3542
|
-
const textLimit = resolveTextChunkLimit(cfg, "slack", account.accountId);
|
|
3543
|
-
const ackReactionScope = cfg.messages?.ackReactionScope ?? "group-mentions";
|
|
3544
|
-
const mediaMaxBytes = (opts.mediaMaxMb ?? slackCfg.mediaMaxMb ?? 20) * 1024 * 1024;
|
|
3545
|
-
const removeAckAfterReply = cfg.messages?.removeAckAfterReply ?? false;
|
|
3546
|
-
const receiver = slackMode === "http" ? new HTTPReceiver({
|
|
3547
|
-
signingSecret: signingSecret ?? "",
|
|
3548
|
-
endpoints: slackWebhookPath
|
|
3549
|
-
}) : null;
|
|
3550
|
-
const clientOptions = resolveSlackWebClientOptions();
|
|
3551
|
-
const app = new App(slackMode === "socket" ? {
|
|
3552
|
-
token: botToken,
|
|
3553
|
-
appToken,
|
|
3554
|
-
socketMode: true,
|
|
3555
|
-
clientOptions
|
|
3556
|
-
} : {
|
|
3557
|
-
token: botToken,
|
|
3558
|
-
receiver: receiver ?? void 0,
|
|
3559
|
-
clientOptions
|
|
3560
|
-
});
|
|
3561
|
-
const slackHttpHandler = slackMode === "http" && receiver ? async (req, res) => {
|
|
3562
|
-
const guard = installRequestBodyLimitGuard(req, res, {
|
|
3563
|
-
maxBytes: SLACK_WEBHOOK_MAX_BODY_BYTES,
|
|
3564
|
-
timeoutMs: SLACK_WEBHOOK_BODY_TIMEOUT_MS,
|
|
3565
|
-
responseFormat: "text"
|
|
3566
|
-
});
|
|
3567
|
-
if (guard.isTripped()) return;
|
|
3568
|
-
try {
|
|
3569
|
-
await Promise.resolve(receiver.requestListener(req, res));
|
|
3570
|
-
} catch (err) {
|
|
3571
|
-
if (!guard.isTripped()) throw err;
|
|
3572
|
-
} finally {
|
|
3573
|
-
guard.dispose();
|
|
3574
|
-
}
|
|
3575
|
-
} : null;
|
|
3576
|
-
let unregisterHttpHandler = null;
|
|
3577
|
-
let botUserId = "";
|
|
3578
|
-
let teamId = "";
|
|
3579
|
-
let apiAppId = "";
|
|
3580
|
-
const expectedApiAppIdFromAppToken = parseApiAppIdFromAppToken(appToken);
|
|
3581
|
-
try {
|
|
3582
|
-
const auth = await app.client.auth.test({ token: botToken });
|
|
3583
|
-
botUserId = auth.user_id ?? "";
|
|
3584
|
-
teamId = auth.team_id ?? "";
|
|
3585
|
-
apiAppId = auth.api_app_id ?? "";
|
|
3586
|
-
} catch {}
|
|
3587
|
-
if (apiAppId && expectedApiAppIdFromAppToken && apiAppId !== expectedApiAppIdFromAppToken) runtime.error?.(`slack token mismatch: bot token api_app_id=${apiAppId} but app token looks like api_app_id=${expectedApiAppIdFromAppToken}`);
|
|
3588
|
-
const ctx = createSlackMonitorContext({
|
|
3589
|
-
cfg,
|
|
3590
|
-
accountId: account.accountId,
|
|
3591
|
-
botToken,
|
|
3592
|
-
app,
|
|
3593
|
-
runtime,
|
|
3594
|
-
botUserId,
|
|
3595
|
-
teamId,
|
|
3596
|
-
apiAppId,
|
|
3597
|
-
historyLimit,
|
|
3598
|
-
sessionScope,
|
|
3599
|
-
mainKey,
|
|
3600
|
-
dmEnabled,
|
|
3601
|
-
dmPolicy,
|
|
3602
|
-
allowFrom,
|
|
3603
|
-
allowNameMatching: isDangerousNameMatchingEnabled(slackCfg),
|
|
3604
|
-
groupDmEnabled,
|
|
3605
|
-
groupDmChannels,
|
|
3606
|
-
defaultRequireMention: slackCfg.requireMention,
|
|
3607
|
-
channelsConfig,
|
|
3608
|
-
groupPolicy,
|
|
3609
|
-
useAccessGroups,
|
|
3610
|
-
reactionMode,
|
|
3611
|
-
reactionAllowlist,
|
|
3612
|
-
replyToMode,
|
|
3613
|
-
threadHistoryScope,
|
|
3614
|
-
threadInheritParent,
|
|
3615
|
-
slashCommand,
|
|
3616
|
-
textLimit,
|
|
3617
|
-
ackReactionScope,
|
|
3618
|
-
mediaMaxBytes,
|
|
3619
|
-
removeAckAfterReply
|
|
3620
|
-
});
|
|
3621
|
-
registerSlackMonitorEvents({
|
|
3622
|
-
ctx,
|
|
3623
|
-
account,
|
|
3624
|
-
handleSlackMessage: createSlackMessageHandler({
|
|
3625
|
-
ctx,
|
|
3626
|
-
account
|
|
3627
|
-
})
|
|
3628
|
-
});
|
|
3629
|
-
await registerSlackMonitorSlashCommands({
|
|
3630
|
-
ctx,
|
|
3631
|
-
account
|
|
3632
|
-
});
|
|
3633
|
-
if (slackMode === "http" && slackHttpHandler) unregisterHttpHandler = registerSlackHttpHandler({
|
|
3634
|
-
path: slackWebhookPath,
|
|
3635
|
-
handler: slackHttpHandler,
|
|
3636
|
-
log: runtime.log,
|
|
3637
|
-
accountId: account.accountId
|
|
3638
|
-
});
|
|
3639
|
-
if (resolveToken) (async () => {
|
|
3640
|
-
if (opts.abortSignal?.aborted) return;
|
|
3641
|
-
if (channelsConfig && Object.keys(channelsConfig).length > 0) try {
|
|
3642
|
-
const entries = Object.keys(channelsConfig).filter((key) => key !== "*");
|
|
3643
|
-
if (entries.length > 0) {
|
|
3644
|
-
const resolved = await resolveSlackChannelAllowlist({
|
|
3645
|
-
token: resolveToken,
|
|
3646
|
-
entries
|
|
3647
|
-
});
|
|
3648
|
-
const nextChannels = { ...channelsConfig };
|
|
3649
|
-
const mapping = [];
|
|
3650
|
-
const unresolved = [];
|
|
3651
|
-
for (const entry of resolved) {
|
|
3652
|
-
const source = channelsConfig?.[entry.input];
|
|
3653
|
-
if (!source) continue;
|
|
3654
|
-
if (!entry.resolved || !entry.id) {
|
|
3655
|
-
unresolved.push(entry.input);
|
|
3656
|
-
continue;
|
|
3657
|
-
}
|
|
3658
|
-
mapping.push(`${entry.input}→${entry.id}${entry.archived ? " (archived)" : ""}`);
|
|
3659
|
-
const existing = nextChannels[entry.id] ?? {};
|
|
3660
|
-
nextChannels[entry.id] = {
|
|
3661
|
-
...source,
|
|
3662
|
-
...existing
|
|
3663
|
-
};
|
|
3664
|
-
}
|
|
3665
|
-
channelsConfig = nextChannels;
|
|
3666
|
-
ctx.channelsConfig = nextChannels;
|
|
3667
|
-
summarizeMapping("slack channels", mapping, unresolved, runtime);
|
|
3668
|
-
}
|
|
3669
|
-
} catch (err) {
|
|
3670
|
-
runtime.log?.(`slack channel resolve failed; using config entries. ${String(err)}`);
|
|
3671
|
-
}
|
|
3672
|
-
const allowEntries = allowFrom?.filter((entry) => String(entry).trim() && String(entry).trim() !== "*") ?? [];
|
|
3673
|
-
if (allowEntries.length > 0) try {
|
|
3674
|
-
const { mapping, unresolved, additions } = buildAllowlistResolutionSummary(await resolveSlackUserAllowlist({
|
|
3675
|
-
token: resolveToken,
|
|
3676
|
-
entries: allowEntries.map((entry) => String(entry))
|
|
3677
|
-
}), { formatResolved: (entry) => {
|
|
3678
|
-
const note = entry.note ? ` (${entry.note})` : "";
|
|
3679
|
-
return `${entry.input}→${entry.id}${note}`;
|
|
3680
|
-
} });
|
|
3681
|
-
allowFrom = mergeAllowlist({
|
|
3682
|
-
existing: allowFrom,
|
|
3683
|
-
additions
|
|
3684
|
-
});
|
|
3685
|
-
ctx.allowFrom = normalizeAllowList(allowFrom);
|
|
3686
|
-
summarizeMapping("slack users", mapping, unresolved, runtime);
|
|
3687
|
-
} catch (err) {
|
|
3688
|
-
runtime.log?.(`slack user resolve failed; using config entries. ${String(err)}`);
|
|
3689
|
-
}
|
|
3690
|
-
if (channelsConfig && Object.keys(channelsConfig).length > 0) {
|
|
3691
|
-
const userEntries = /* @__PURE__ */ new Set();
|
|
3692
|
-
for (const channel of Object.values(channelsConfig)) addAllowlistUserEntriesFromConfigEntry(userEntries, channel);
|
|
3693
|
-
if (userEntries.size > 0) try {
|
|
3694
|
-
const { resolvedMap, mapping, unresolved } = buildAllowlistResolutionSummary(await resolveSlackUserAllowlist({
|
|
3695
|
-
token: resolveToken,
|
|
3696
|
-
entries: Array.from(userEntries)
|
|
3697
|
-
}));
|
|
3698
|
-
const nextChannels = patchAllowlistUsersInConfigEntries({
|
|
3699
|
-
entries: channelsConfig,
|
|
3700
|
-
resolvedMap
|
|
3701
|
-
});
|
|
3702
|
-
channelsConfig = nextChannels;
|
|
3703
|
-
ctx.channelsConfig = nextChannels;
|
|
3704
|
-
summarizeMapping("slack channel users", mapping, unresolved, runtime);
|
|
3705
|
-
} catch (err) {
|
|
3706
|
-
runtime.log?.(`slack channel user resolve failed; using config entries. ${String(err)}`);
|
|
3707
|
-
}
|
|
3708
|
-
}
|
|
3709
|
-
})();
|
|
3710
|
-
const stopOnAbort = () => {
|
|
3711
|
-
if (opts.abortSignal?.aborted && slackMode === "socket") app.stop();
|
|
3712
|
-
};
|
|
3713
|
-
opts.abortSignal?.addEventListener("abort", stopOnAbort, { once: true });
|
|
3714
|
-
try {
|
|
3715
|
-
if (slackMode === "socket") {
|
|
3716
|
-
await app.start();
|
|
3717
|
-
runtime.log?.("slack socket mode connected");
|
|
3718
|
-
} else runtime.log?.(`slack http mode listening at ${slackWebhookPath}`);
|
|
3719
|
-
if (opts.abortSignal?.aborted) return;
|
|
3720
|
-
await new Promise((resolve) => {
|
|
3721
|
-
opts.abortSignal?.addEventListener("abort", () => resolve(), { once: true });
|
|
3722
|
-
});
|
|
3723
|
-
} finally {
|
|
3724
|
-
opts.abortSignal?.removeEventListener("abort", stopOnAbort);
|
|
3725
|
-
unregisterHttpHandler?.();
|
|
3726
|
-
await app.stop().catch(() => void 0);
|
|
3727
|
-
}
|
|
3728
|
-
}
|
|
3729
|
-
|
|
3730
|
-
//#endregion
|
|
3731
|
-
export { monitorSlackProvider };
|