@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
|
@@ -0,0 +1,2238 @@
|
|
|
1
|
+
import { C as buildPairingReply, D as buildHistoryContextFromEntries, E as DEFAULT_GROUP_HISTORY_LIMIT, G as resolveEnvelopeFormatOptions, Gn as createDedupeCache, H as resolveInboundDebounceMs, Kt as hasControlCommand, L as shouldAckReactionForWhatsApp, N as recordPendingHistoryEntryIfEnabled, Pt as registerUnhandledRejectionHandler, Qn as resolveDmGroupAccessWithLists, R as dispatchReplyWithBufferedBlockDispatcher, St as formatDurationPrecise, T as sleepWithAbort, U as formatInboundEnvelope, V as createInboundDebouncer, Xn as readStoreAllowFromForDmPolicy, Y as getReplyFromConfig, Yt as buildMentionRegexes, Zn as resolveDmGroupAccessWithCommandGate, Zt as normalizeMentionText, ct as parseActivationCommand, p as resolveMentionGating, qt as shouldComputeCommandAuthorized, st as normalizeGroupActivation, w as computeBackoff, wt as enqueueSystemEvent } from "./pi-embedded-runner-DMfkIj60.js";
|
|
2
|
+
import { C as recordSessionMetaFromInbound, S as readSessionUpdatedAt, _n as resolveChannelGroupRequireMention, bn as resolveGroupSessionKey, gn as resolveChannelGroupPolicy, w as updateLastRoute, x as loadSessionStore } from "./runtime-BUpqjZNM.js";
|
|
3
|
+
import { i as defaultRuntime, t as createSubsystemLogger } from "./subsystem-DBPNbQDQ.js";
|
|
4
|
+
import { i as logVerbose, p as getChildLogger, s as shouldLogVerbose } from "./globals-B_jjtAje.js";
|
|
5
|
+
import "./paths-BEmvSyOV.js";
|
|
6
|
+
import { d as normalizeE164, l as isSelfChatMode, m as resolveJidToE164, n as clamp, u as jidToE164, x as toWhatsappJid, y as sleep } from "./utils-CYk9EKoq.js";
|
|
7
|
+
import { Cr as formatCliCommand, n as loadConfig } from "./config-DKNrb8oT.js";
|
|
8
|
+
import "./agent-scope-BbgPlhtw.js";
|
|
9
|
+
import { a as buildGroupHistoryKey, n as DEFAULT_MAIN_KEY, r as buildAgentMainSessionKey, s as normalizeAgentId } from "./session-key-HSJ2KQTc.js";
|
|
10
|
+
import "./accounts-RHZyaB73.js";
|
|
11
|
+
import "./accounts-CuqIKU8X.js";
|
|
12
|
+
import "./logger-BbFvCoKk.js";
|
|
13
|
+
import "./exec-DQ8j4Fm3.js";
|
|
14
|
+
import { _ as webAuthExists, c as logWebSelfId, d as pickWebChannel, i as resolveWhatsAppAccount, o as WA_WEB_AUTH_DIR, p as readWebSelfId, s as getWebAuthAgeMs } from "./accounts-Bz_2QZSt.js";
|
|
15
|
+
import "./allow-list-yqasgPpz.js";
|
|
16
|
+
import "./redact-CwCz68Mi.js";
|
|
17
|
+
import "./github-copilot-token-Dgug856m.js";
|
|
18
|
+
import "./retry-DycQ4ymF.js";
|
|
19
|
+
import { l as resolveStorePath } from "./paths-B88DQEK8.js";
|
|
20
|
+
import "./ip-BkeyFRJr.js";
|
|
21
|
+
import "./ssrf-D_4q0mKh.js";
|
|
22
|
+
import "./fetch-guard-CxXvFYq5.js";
|
|
23
|
+
import { n as redactSensitiveUrlLikeString } from "./redact-sensitive-url-B0RJQqO7.js";
|
|
24
|
+
import "./send-DGUAXb2b.js";
|
|
25
|
+
import { a as resolveOpenProviderRuntimeGroupPolicy, i as resolveDefaultGroupPolicy, o as warnMissingProviderGroupPolicyFallbackOnce } from "./links-D5ecKoG9.js";
|
|
26
|
+
import { D as formatLocationText, O as toLocationContext } from "./wsl-Cw-xOsqF.js";
|
|
27
|
+
import { a as upsertChannelPairingRequest } from "./pairing-store-BdOcH_GA.js";
|
|
28
|
+
import { c as resolveChunkMode, i as chunkMarkdownTextWithMode, l as resolveTextChunkLimit } from "./chunk-CuJIMshx.js";
|
|
29
|
+
import { l as resolveIdentityNamePrefix, n as createReplyPrefixOptions, u as resolveMessagePrefix } from "./reply-prefix-CbPHNXlm.js";
|
|
30
|
+
import "./tokens-Do_JU4Rh.js";
|
|
31
|
+
import "./device-pairing-J1IH1jFl.js";
|
|
32
|
+
import "./pairing-token-HQpaqod5.js";
|
|
33
|
+
import "./diagnostic-C16gioN6.js";
|
|
34
|
+
import "./diagnostic-session-state-B-9PL5r7.js";
|
|
35
|
+
import { t as redactIdentifier } from "./redact-identifier-CDvAeiFm.js";
|
|
36
|
+
import "./optional-runtime-dependency-Bt_3Yigu.js";
|
|
37
|
+
import "./image-ops-BSQmb-17.js";
|
|
38
|
+
import "./wallet-status-CdxTkLWz.js";
|
|
39
|
+
import "./pi-model-discovery-DQdXL_-F.js";
|
|
40
|
+
import "./runtime-dependency-pUwxUAJp.js";
|
|
41
|
+
import "./ws-CxmRDbD9.js";
|
|
42
|
+
import "./path-alias-guards-BlIJ0AmG.js";
|
|
43
|
+
import "./fs-safe-DztQeyQe.js";
|
|
44
|
+
import { n as resolveMarkdownTableMode } from "./markdown-tables-DrB-IM8r.js";
|
|
45
|
+
import { n as loadWebMedia, u as getAgentScopedMediaLocalRoots } from "./media-D8pWjqEt.js";
|
|
46
|
+
import "./send-DWB5HFdb.js";
|
|
47
|
+
import { a as saveMediaBuffer } from "./outbound-attachment-C9oadpUP.js";
|
|
48
|
+
import "./fetch-RV7QDF43.js";
|
|
49
|
+
import "./thread-bindings.state-DYYR9qeT.js";
|
|
50
|
+
import "./memory-search-DHSeU4pJ.js";
|
|
51
|
+
import "./manager-DQ1dH8OM.js";
|
|
52
|
+
import "./query-expansion-BM7lmqaP.js";
|
|
53
|
+
import "./common-C90EHP1w.js";
|
|
54
|
+
import "./commands-registry-DwQIFJmL.js";
|
|
55
|
+
import "./skill-commands-DCnCOVR_.js";
|
|
56
|
+
import { t as finalizeInboundContext } from "./inbound-context-BNCTzgjG.js";
|
|
57
|
+
import "./directory-live-G7AN8y8N.js";
|
|
58
|
+
import "./targets-BgSHco9b.js";
|
|
59
|
+
import "./sandbox-paths-fc-HFGJr.js";
|
|
60
|
+
import { n as resolveAgentRoute, t as buildAgentSessionKey } from "./resolve-route-wp5xq4Ws.js";
|
|
61
|
+
import "./render-K7NwXvVu.js";
|
|
62
|
+
import { t as convertMarkdownTables } from "./tables-DX84FwPB.js";
|
|
63
|
+
import { n as recordChannelActivity } from "./channel-activity-B7MIaDei.js";
|
|
64
|
+
import { r as setActiveWebListener } from "./active-listener-C5ALSs7Y.js";
|
|
65
|
+
import "./whatsapp-heartbeat-KM3lYpt-.js";
|
|
66
|
+
import { i as markdownToWhatsApp, n as sendMessageWhatsApp, r as sendReactionWhatsApp } from "./outbound-B5ukMdUv.js";
|
|
67
|
+
import { i as waitForWaConnection, n as formatError, r as getStatusCode, t as createWaSocket } from "./session-BLyxz03u.js";
|
|
68
|
+
import { t as loginWeb } from "./login-YbYyMkkE.js";
|
|
69
|
+
import { randomUUID } from "node:crypto";
|
|
70
|
+
import { DisconnectReason, downloadMediaMessage, extractMessageContent, getContentType, isJidGroup, normalizeMessageContent } from "@whiskeysockets/baileys";
|
|
71
|
+
|
|
72
|
+
//#region src/web/auto-reply/constants.ts
|
|
73
|
+
const DEFAULT_WEB_MEDIA_BYTES = 5 * 1024 * 1024;
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/web/reconnect.ts
|
|
77
|
+
const DEFAULT_HEARTBEAT_SECONDS = 60;
|
|
78
|
+
const DEFAULT_RECONNECT_POLICY = {
|
|
79
|
+
initialMs: 2e3,
|
|
80
|
+
maxMs: 3e4,
|
|
81
|
+
factor: 1.8,
|
|
82
|
+
jitter: .25,
|
|
83
|
+
maxAttempts: 12
|
|
84
|
+
};
|
|
85
|
+
function resolveHeartbeatSeconds(cfg, overrideSeconds) {
|
|
86
|
+
const candidate = overrideSeconds ?? cfg.web?.heartbeatSeconds;
|
|
87
|
+
if (typeof candidate === "number" && candidate > 0) return candidate;
|
|
88
|
+
return DEFAULT_HEARTBEAT_SECONDS;
|
|
89
|
+
}
|
|
90
|
+
function resolveReconnectPolicy(cfg, overrides) {
|
|
91
|
+
const reconnectOverrides = cfg.web?.reconnect ?? {};
|
|
92
|
+
const overrideConfig = overrides ?? {};
|
|
93
|
+
const merged = {
|
|
94
|
+
...DEFAULT_RECONNECT_POLICY,
|
|
95
|
+
...reconnectOverrides,
|
|
96
|
+
...overrideConfig
|
|
97
|
+
};
|
|
98
|
+
merged.initialMs = Math.max(250, merged.initialMs);
|
|
99
|
+
merged.maxMs = Math.max(merged.initialMs, merged.maxMs);
|
|
100
|
+
merged.factor = clamp(merged.factor, 1.1, 10);
|
|
101
|
+
merged.jitter = clamp(merged.jitter, 0, 1);
|
|
102
|
+
merged.maxAttempts = Math.max(0, Math.floor(merged.maxAttempts));
|
|
103
|
+
return merged;
|
|
104
|
+
}
|
|
105
|
+
function newConnectionId() {
|
|
106
|
+
return randomUUID();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/web/auto-reply/loggers.ts
|
|
111
|
+
const whatsappLog = createSubsystemLogger("gateway/channels/whatsapp");
|
|
112
|
+
const whatsappInboundLog = whatsappLog.child("inbound");
|
|
113
|
+
const whatsappOutboundLog = whatsappLog.child("outbound");
|
|
114
|
+
const whatsappHeartbeatLog = whatsappLog.child("heartbeat");
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region src/cli/wait.ts
|
|
118
|
+
function waitForever() {
|
|
119
|
+
setInterval(() => {}, 1e6).unref();
|
|
120
|
+
return new Promise(() => {});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/web/inbound/dedupe.ts
|
|
125
|
+
const recentInboundMessages = createDedupeCache({
|
|
126
|
+
ttlMs: 20 * 6e4,
|
|
127
|
+
maxSize: 5e3
|
|
128
|
+
});
|
|
129
|
+
function isRecentInboundMessage(key) {
|
|
130
|
+
return recentInboundMessages.check(key);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/web/vcard.ts
|
|
135
|
+
const ALLOWED_VCARD_KEYS = new Set([
|
|
136
|
+
"FN",
|
|
137
|
+
"N",
|
|
138
|
+
"TEL"
|
|
139
|
+
]);
|
|
140
|
+
function parseVcard(vcard) {
|
|
141
|
+
if (!vcard) return { phones: [] };
|
|
142
|
+
const lines = vcard.split(/\r?\n/);
|
|
143
|
+
let nameFromN;
|
|
144
|
+
let nameFromFn;
|
|
145
|
+
const phones = [];
|
|
146
|
+
for (const rawLine of lines) {
|
|
147
|
+
const line = rawLine.trim();
|
|
148
|
+
if (!line) continue;
|
|
149
|
+
const colonIndex = line.indexOf(":");
|
|
150
|
+
if (colonIndex === -1) continue;
|
|
151
|
+
const key = line.slice(0, colonIndex).toUpperCase();
|
|
152
|
+
const rawValue = line.slice(colonIndex + 1).trim();
|
|
153
|
+
if (!rawValue) continue;
|
|
154
|
+
const baseKey = normalizeVcardKey(key);
|
|
155
|
+
if (!baseKey || !ALLOWED_VCARD_KEYS.has(baseKey)) continue;
|
|
156
|
+
const value = cleanVcardValue(rawValue);
|
|
157
|
+
if (!value) continue;
|
|
158
|
+
if (baseKey === "FN" && !nameFromFn) {
|
|
159
|
+
nameFromFn = normalizeVcardName(value);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
if (baseKey === "N" && !nameFromN) {
|
|
163
|
+
nameFromN = normalizeVcardName(value);
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (baseKey === "TEL") {
|
|
167
|
+
const phone = normalizeVcardPhone(value);
|
|
168
|
+
if (phone) phones.push(phone);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
name: nameFromFn ?? nameFromN,
|
|
173
|
+
phones
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
function normalizeVcardKey(key) {
|
|
177
|
+
const [primary] = key.split(";");
|
|
178
|
+
if (!primary) return;
|
|
179
|
+
const segments = primary.split(".");
|
|
180
|
+
return segments[segments.length - 1] || void 0;
|
|
181
|
+
}
|
|
182
|
+
function cleanVcardValue(value) {
|
|
183
|
+
return value.replace(/\\n/gi, " ").replace(/\\,/g, ",").replace(/\\;/g, ";").trim();
|
|
184
|
+
}
|
|
185
|
+
function normalizeVcardName(value) {
|
|
186
|
+
return value.replace(/;/g, " ").replace(/\s+/g, " ").trim();
|
|
187
|
+
}
|
|
188
|
+
function normalizeVcardPhone(value) {
|
|
189
|
+
const trimmed = value.trim();
|
|
190
|
+
if (!trimmed) return "";
|
|
191
|
+
if (trimmed.toLowerCase().startsWith("tel:")) return trimmed.slice(4).trim();
|
|
192
|
+
return trimmed;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
//#endregion
|
|
196
|
+
//#region src/web/inbound/extract.ts
|
|
197
|
+
function unwrapMessage$1(message) {
|
|
198
|
+
return normalizeMessageContent(message);
|
|
199
|
+
}
|
|
200
|
+
function extractContextInfo(message) {
|
|
201
|
+
if (!message) return;
|
|
202
|
+
const contentType = getContentType(message);
|
|
203
|
+
const candidate = contentType ? message[contentType] : void 0;
|
|
204
|
+
const contextInfo = candidate && typeof candidate === "object" && "contextInfo" in candidate ? candidate.contextInfo : void 0;
|
|
205
|
+
if (contextInfo) return contextInfo;
|
|
206
|
+
const fallback = message.extendedTextMessage?.contextInfo ?? message.imageMessage?.contextInfo ?? message.videoMessage?.contextInfo ?? message.documentMessage?.contextInfo ?? message.audioMessage?.contextInfo ?? message.stickerMessage?.contextInfo ?? message.buttonsResponseMessage?.contextInfo ?? message.listResponseMessage?.contextInfo ?? message.templateButtonReplyMessage?.contextInfo ?? message.interactiveResponseMessage?.contextInfo ?? message.buttonsMessage?.contextInfo ?? message.listMessage?.contextInfo;
|
|
207
|
+
if (fallback) return fallback;
|
|
208
|
+
for (const value of Object.values(message)) {
|
|
209
|
+
if (!value || typeof value !== "object") continue;
|
|
210
|
+
if (!("contextInfo" in value)) continue;
|
|
211
|
+
const candidateContext = value.contextInfo;
|
|
212
|
+
if (candidateContext) return candidateContext;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
function extractMentionedJids(rawMessage) {
|
|
216
|
+
const message = unwrapMessage$1(rawMessage);
|
|
217
|
+
if (!message) return;
|
|
218
|
+
const flattened = [
|
|
219
|
+
message.extendedTextMessage?.contextInfo?.mentionedJid,
|
|
220
|
+
message.extendedTextMessage?.contextInfo?.quotedMessage?.extendedTextMessage?.contextInfo?.mentionedJid,
|
|
221
|
+
message.imageMessage?.contextInfo?.mentionedJid,
|
|
222
|
+
message.videoMessage?.contextInfo?.mentionedJid,
|
|
223
|
+
message.documentMessage?.contextInfo?.mentionedJid,
|
|
224
|
+
message.audioMessage?.contextInfo?.mentionedJid,
|
|
225
|
+
message.stickerMessage?.contextInfo?.mentionedJid,
|
|
226
|
+
message.buttonsResponseMessage?.contextInfo?.mentionedJid,
|
|
227
|
+
message.listResponseMessage?.contextInfo?.mentionedJid
|
|
228
|
+
].flatMap((arr) => arr ?? []).filter(Boolean);
|
|
229
|
+
if (flattened.length === 0) return;
|
|
230
|
+
return Array.from(new Set(flattened));
|
|
231
|
+
}
|
|
232
|
+
function extractText(rawMessage) {
|
|
233
|
+
const message = unwrapMessage$1(rawMessage);
|
|
234
|
+
if (!message) return;
|
|
235
|
+
const extracted = extractMessageContent(message);
|
|
236
|
+
const candidates = [message, extracted && extracted !== message ? extracted : void 0];
|
|
237
|
+
for (const candidate of candidates) {
|
|
238
|
+
if (!candidate) continue;
|
|
239
|
+
if (typeof candidate.conversation === "string" && candidate.conversation.trim()) return candidate.conversation.trim();
|
|
240
|
+
const extended = candidate.extendedTextMessage?.text;
|
|
241
|
+
if (extended?.trim()) return extended.trim();
|
|
242
|
+
const caption = candidate.imageMessage?.caption ?? candidate.videoMessage?.caption ?? candidate.documentMessage?.caption;
|
|
243
|
+
if (caption?.trim()) return caption.trim();
|
|
244
|
+
}
|
|
245
|
+
const contactPlaceholder = extractContactPlaceholder(message) ?? (extracted && extracted !== message ? extractContactPlaceholder(extracted) : void 0);
|
|
246
|
+
if (contactPlaceholder) return contactPlaceholder;
|
|
247
|
+
}
|
|
248
|
+
function extractMediaPlaceholder(rawMessage) {
|
|
249
|
+
const message = unwrapMessage$1(rawMessage);
|
|
250
|
+
if (!message) return;
|
|
251
|
+
if (message.imageMessage) return "<media:image>";
|
|
252
|
+
if (message.videoMessage) return "<media:video>";
|
|
253
|
+
if (message.audioMessage) return "<media:audio>";
|
|
254
|
+
if (message.documentMessage) return "<media:document>";
|
|
255
|
+
if (message.stickerMessage) return "<media:sticker>";
|
|
256
|
+
}
|
|
257
|
+
function extractContactPlaceholder(rawMessage) {
|
|
258
|
+
const message = unwrapMessage$1(rawMessage);
|
|
259
|
+
if (!message) return;
|
|
260
|
+
const contact = message.contactMessage ?? void 0;
|
|
261
|
+
if (contact) {
|
|
262
|
+
const { name, phones } = describeContact({
|
|
263
|
+
displayName: contact.displayName,
|
|
264
|
+
vcard: contact.vcard
|
|
265
|
+
});
|
|
266
|
+
return formatContactPlaceholder(name, phones);
|
|
267
|
+
}
|
|
268
|
+
const contactsArray = message.contactsArrayMessage?.contacts ?? void 0;
|
|
269
|
+
if (!contactsArray || contactsArray.length === 0) return;
|
|
270
|
+
return formatContactsPlaceholder(contactsArray.map((entry) => describeContact({
|
|
271
|
+
displayName: entry.displayName,
|
|
272
|
+
vcard: entry.vcard
|
|
273
|
+
})).map((entry) => formatContactLabel(entry.name, entry.phones)).filter((value) => Boolean(value)), contactsArray.length);
|
|
274
|
+
}
|
|
275
|
+
function describeContact(input) {
|
|
276
|
+
const displayName = (input.displayName ?? "").trim();
|
|
277
|
+
const parsed = parseVcard(input.vcard ?? void 0);
|
|
278
|
+
return {
|
|
279
|
+
name: displayName || parsed.name,
|
|
280
|
+
phones: parsed.phones
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
function formatContactPlaceholder(name, phones) {
|
|
284
|
+
const label = formatContactLabel(name, phones);
|
|
285
|
+
if (!label) return "<contact>";
|
|
286
|
+
return `<contact: ${label}>`;
|
|
287
|
+
}
|
|
288
|
+
function formatContactsPlaceholder(labels, total) {
|
|
289
|
+
const cleaned = labels.map((label) => label.trim()).filter(Boolean);
|
|
290
|
+
if (cleaned.length === 0) return `<contacts: ${total} ${total === 1 ? "contact" : "contacts"}>`;
|
|
291
|
+
const remaining = Math.max(total - cleaned.length, 0);
|
|
292
|
+
const suffix = remaining > 0 ? ` +${remaining} more` : "";
|
|
293
|
+
return `<contacts: ${cleaned.join(", ")}${suffix}>`;
|
|
294
|
+
}
|
|
295
|
+
function formatContactLabel(name, phones) {
|
|
296
|
+
const parts = [name, formatPhoneList(phones)].filter((value) => Boolean(value));
|
|
297
|
+
if (parts.length === 0) return;
|
|
298
|
+
return parts.join(", ");
|
|
299
|
+
}
|
|
300
|
+
function formatPhoneList(phones) {
|
|
301
|
+
const cleaned = phones?.map((phone) => phone.trim()).filter(Boolean) ?? [];
|
|
302
|
+
if (cleaned.length === 0) return;
|
|
303
|
+
const { shown, remaining } = summarizeList(cleaned, cleaned.length, 1);
|
|
304
|
+
const [primary] = shown;
|
|
305
|
+
if (!primary) return;
|
|
306
|
+
if (remaining === 0) return primary;
|
|
307
|
+
return `${primary} (+${remaining} more)`;
|
|
308
|
+
}
|
|
309
|
+
function summarizeList(values, total, maxShown) {
|
|
310
|
+
const shown = values.slice(0, maxShown);
|
|
311
|
+
return {
|
|
312
|
+
shown,
|
|
313
|
+
remaining: Math.max(total - shown.length, 0)
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
function extractLocationData(rawMessage) {
|
|
317
|
+
const message = unwrapMessage$1(rawMessage);
|
|
318
|
+
if (!message) return null;
|
|
319
|
+
const live = message.liveLocationMessage ?? void 0;
|
|
320
|
+
if (live) {
|
|
321
|
+
const latitudeRaw = live.degreesLatitude;
|
|
322
|
+
const longitudeRaw = live.degreesLongitude;
|
|
323
|
+
if (latitudeRaw != null && longitudeRaw != null) {
|
|
324
|
+
const latitude = Number(latitudeRaw);
|
|
325
|
+
const longitude = Number(longitudeRaw);
|
|
326
|
+
if (Number.isFinite(latitude) && Number.isFinite(longitude)) return {
|
|
327
|
+
latitude,
|
|
328
|
+
longitude,
|
|
329
|
+
accuracy: live.accuracyInMeters ?? void 0,
|
|
330
|
+
caption: live.caption ?? void 0,
|
|
331
|
+
source: "live",
|
|
332
|
+
isLive: true
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
const location = message.locationMessage ?? void 0;
|
|
337
|
+
if (location) {
|
|
338
|
+
const latitudeRaw = location.degreesLatitude;
|
|
339
|
+
const longitudeRaw = location.degreesLongitude;
|
|
340
|
+
if (latitudeRaw != null && longitudeRaw != null) {
|
|
341
|
+
const latitude = Number(latitudeRaw);
|
|
342
|
+
const longitude = Number(longitudeRaw);
|
|
343
|
+
if (Number.isFinite(latitude) && Number.isFinite(longitude)) {
|
|
344
|
+
const isLive = Boolean(location.isLive);
|
|
345
|
+
return {
|
|
346
|
+
latitude,
|
|
347
|
+
longitude,
|
|
348
|
+
accuracy: location.accuracyInMeters ?? void 0,
|
|
349
|
+
name: location.name ?? void 0,
|
|
350
|
+
address: location.address ?? void 0,
|
|
351
|
+
caption: location.comment ?? void 0,
|
|
352
|
+
source: isLive ? "live" : location.name || location.address ? "place" : "pin",
|
|
353
|
+
isLive
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return null;
|
|
359
|
+
}
|
|
360
|
+
function describeReplyContext(rawMessage) {
|
|
361
|
+
const message = unwrapMessage$1(rawMessage);
|
|
362
|
+
if (!message) return null;
|
|
363
|
+
const contextInfo = extractContextInfo(message);
|
|
364
|
+
const quoted = normalizeMessageContent(contextInfo?.quotedMessage);
|
|
365
|
+
if (!quoted) return null;
|
|
366
|
+
const location = extractLocationData(quoted);
|
|
367
|
+
const locationText = location ? formatLocationText(location) : void 0;
|
|
368
|
+
let body = [extractText(quoted), locationText].filter(Boolean).join("\n").trim();
|
|
369
|
+
if (!body) body = extractMediaPlaceholder(quoted);
|
|
370
|
+
if (!body) {
|
|
371
|
+
const quotedType = quoted ? getContentType(quoted) : void 0;
|
|
372
|
+
logVerbose(`Quoted message missing extractable body${quotedType ? ` (type ${quotedType})` : ""}`);
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
const senderJid = contextInfo?.participant ?? void 0;
|
|
376
|
+
const senderE164 = senderJid ? jidToE164(senderJid) ?? senderJid : void 0;
|
|
377
|
+
const sender = senderE164 ?? "unknown sender";
|
|
378
|
+
return {
|
|
379
|
+
id: contextInfo?.stanzaId ? String(contextInfo.stanzaId) : void 0,
|
|
380
|
+
body,
|
|
381
|
+
sender,
|
|
382
|
+
senderJid,
|
|
383
|
+
senderE164
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
//#endregion
|
|
388
|
+
//#region src/web/inbound/access-control.ts
|
|
389
|
+
const PAIRING_REPLY_HISTORY_GRACE_MS = 3e4;
|
|
390
|
+
function resolveWhatsAppRuntimeGroupPolicy(params) {
|
|
391
|
+
return resolveOpenProviderRuntimeGroupPolicy({
|
|
392
|
+
providerConfigPresent: params.providerConfigPresent,
|
|
393
|
+
groupPolicy: params.groupPolicy,
|
|
394
|
+
defaultGroupPolicy: params.defaultGroupPolicy
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
async function checkInboundAccessControl(params) {
|
|
398
|
+
const cfg = loadConfig();
|
|
399
|
+
const account = resolveWhatsAppAccount({
|
|
400
|
+
cfg,
|
|
401
|
+
accountId: params.accountId
|
|
402
|
+
});
|
|
403
|
+
const dmPolicy = account.dmPolicy ?? "pairing";
|
|
404
|
+
const configuredAllowFrom = account.allowFrom ?? [];
|
|
405
|
+
const storeAllowFrom = await readStoreAllowFromForDmPolicy({
|
|
406
|
+
provider: "whatsapp",
|
|
407
|
+
accountId: account.accountId,
|
|
408
|
+
dmPolicy
|
|
409
|
+
});
|
|
410
|
+
const defaultAllowFrom = configuredAllowFrom.length === 0 && params.selfE164 ? [params.selfE164] : [];
|
|
411
|
+
const dmAllowFrom = configuredAllowFrom.length > 0 ? configuredAllowFrom : defaultAllowFrom;
|
|
412
|
+
const groupAllowFrom = account.groupAllowFrom ?? (configuredAllowFrom.length > 0 ? configuredAllowFrom : void 0);
|
|
413
|
+
const isSamePhone = params.from === params.selfE164;
|
|
414
|
+
const isSelfChat = account.selfChatMode ?? isSelfChatMode(params.selfE164, configuredAllowFrom);
|
|
415
|
+
const pairingGraceMs = typeof params.pairingGraceMs === "number" && params.pairingGraceMs > 0 ? params.pairingGraceMs : PAIRING_REPLY_HISTORY_GRACE_MS;
|
|
416
|
+
const suppressPairingReply = typeof params.connectedAtMs === "number" && typeof params.messageTimestampMs === "number" && params.messageTimestampMs < params.connectedAtMs - pairingGraceMs;
|
|
417
|
+
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
418
|
+
const { groupPolicy, providerMissingFallbackApplied } = resolveWhatsAppRuntimeGroupPolicy({
|
|
419
|
+
providerConfigPresent: cfg.channels?.whatsapp !== void 0,
|
|
420
|
+
groupPolicy: account.groupPolicy,
|
|
421
|
+
defaultGroupPolicy
|
|
422
|
+
});
|
|
423
|
+
warnMissingProviderGroupPolicyFallbackOnce({
|
|
424
|
+
providerMissingFallbackApplied,
|
|
425
|
+
providerKey: "whatsapp",
|
|
426
|
+
accountId: account.accountId,
|
|
427
|
+
log: (message) => logVerbose(message)
|
|
428
|
+
});
|
|
429
|
+
const normalizedDmSender = normalizeE164(params.from);
|
|
430
|
+
const normalizedGroupSender = typeof params.senderE164 === "string" ? normalizeE164(params.senderE164) : null;
|
|
431
|
+
const access = resolveDmGroupAccessWithLists({
|
|
432
|
+
isGroup: params.group,
|
|
433
|
+
dmPolicy,
|
|
434
|
+
groupPolicy,
|
|
435
|
+
allowFrom: params.group ? configuredAllowFrom : dmAllowFrom,
|
|
436
|
+
groupAllowFrom,
|
|
437
|
+
storeAllowFrom,
|
|
438
|
+
isSenderAllowed: (allowEntries) => {
|
|
439
|
+
if (allowEntries.includes("*")) return true;
|
|
440
|
+
const normalizedEntrySet = new Set(allowEntries.map((entry) => normalizeE164(String(entry))).filter((entry) => Boolean(entry)));
|
|
441
|
+
if (!params.group && isSamePhone) return true;
|
|
442
|
+
return params.group ? Boolean(normalizedGroupSender && normalizedEntrySet.has(normalizedGroupSender)) : normalizedEntrySet.has(normalizedDmSender);
|
|
443
|
+
}
|
|
444
|
+
});
|
|
445
|
+
if (params.group && access.decision !== "allow") {
|
|
446
|
+
if (access.reason === "groupPolicy=disabled") logVerbose("Blocked group message (groupPolicy: disabled)");
|
|
447
|
+
else if (access.reason === "groupPolicy=allowlist (empty allowlist)") logVerbose("Blocked group message (groupPolicy: allowlist, no groupAllowFrom)");
|
|
448
|
+
else logVerbose(`Blocked group message from ${params.senderE164 ? redactIdentifier(params.senderE164) : "unknown sender"} (groupPolicy: allowlist)`);
|
|
449
|
+
return {
|
|
450
|
+
allowed: false,
|
|
451
|
+
shouldMarkRead: false,
|
|
452
|
+
isSelfChat,
|
|
453
|
+
resolvedAccountId: account.accountId
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
if (!params.group) {
|
|
457
|
+
if (params.isFromMe && !isSamePhone) {
|
|
458
|
+
logVerbose("Skipping outbound DM (fromMe); no pairing reply needed.");
|
|
459
|
+
return {
|
|
460
|
+
allowed: false,
|
|
461
|
+
shouldMarkRead: false,
|
|
462
|
+
isSelfChat,
|
|
463
|
+
resolvedAccountId: account.accountId
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
if (access.decision === "block" && access.reason === "dmPolicy=disabled") {
|
|
467
|
+
logVerbose("Blocked dm (dmPolicy: disabled)");
|
|
468
|
+
return {
|
|
469
|
+
allowed: false,
|
|
470
|
+
shouldMarkRead: false,
|
|
471
|
+
isSelfChat,
|
|
472
|
+
resolvedAccountId: account.accountId
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
if (access.decision === "pairing" && !isSamePhone) {
|
|
476
|
+
const candidate = params.from;
|
|
477
|
+
if (suppressPairingReply) logVerbose(`Skipping pairing reply for historical DM from ${candidate}.`);
|
|
478
|
+
else {
|
|
479
|
+
const { code, created } = await upsertChannelPairingRequest({
|
|
480
|
+
channel: "whatsapp",
|
|
481
|
+
id: candidate,
|
|
482
|
+
accountId: account.accountId,
|
|
483
|
+
meta: { name: (params.pushName ?? "").trim() || void 0 }
|
|
484
|
+
});
|
|
485
|
+
if (created) {
|
|
486
|
+
logVerbose(`whatsapp pairing request sender=${redactIdentifier(candidate)} name=${params.pushName ?? "unknown"}`);
|
|
487
|
+
try {
|
|
488
|
+
await params.sock.sendMessage(params.remoteJid, { text: buildPairingReply({
|
|
489
|
+
channel: "whatsapp",
|
|
490
|
+
idLine: `Your WhatsApp phone number: ${candidate}`,
|
|
491
|
+
code
|
|
492
|
+
}) });
|
|
493
|
+
} catch (err) {
|
|
494
|
+
logVerbose(`whatsapp pairing reply failed for ${redactIdentifier(candidate)}: ${formatError(err)}`);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
allowed: false,
|
|
500
|
+
shouldMarkRead: false,
|
|
501
|
+
isSelfChat,
|
|
502
|
+
resolvedAccountId: account.accountId
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
if (access.decision !== "allow") {
|
|
506
|
+
logVerbose(`Blocked unauthorized sender ${redactIdentifier(params.from)} (dmPolicy=${dmPolicy})`);
|
|
507
|
+
return {
|
|
508
|
+
allowed: false,
|
|
509
|
+
shouldMarkRead: false,
|
|
510
|
+
isSelfChat,
|
|
511
|
+
resolvedAccountId: account.accountId
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
return {
|
|
516
|
+
allowed: true,
|
|
517
|
+
shouldMarkRead: true,
|
|
518
|
+
isSelfChat,
|
|
519
|
+
resolvedAccountId: account.accountId
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
//#endregion
|
|
524
|
+
//#region src/web/inbound/media.ts
|
|
525
|
+
function unwrapMessage(message) {
|
|
526
|
+
return normalizeMessageContent(message);
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Resolve the MIME type for an inbound media message.
|
|
530
|
+
* Falls back to WhatsApp's standard formats when Baileys omits the MIME.
|
|
531
|
+
*/
|
|
532
|
+
function resolveMediaMimetype(message) {
|
|
533
|
+
const explicit = message.imageMessage?.mimetype ?? message.videoMessage?.mimetype ?? message.documentMessage?.mimetype ?? message.audioMessage?.mimetype ?? message.stickerMessage?.mimetype ?? void 0;
|
|
534
|
+
if (explicit) return explicit;
|
|
535
|
+
if (message.audioMessage) return "audio/ogg; codecs=opus";
|
|
536
|
+
if (message.imageMessage) return "image/jpeg";
|
|
537
|
+
if (message.videoMessage) return "video/mp4";
|
|
538
|
+
if (message.stickerMessage) return "image/webp";
|
|
539
|
+
}
|
|
540
|
+
async function downloadInboundMedia(msg, sock) {
|
|
541
|
+
const message = unwrapMessage(msg.message);
|
|
542
|
+
if (!message) return;
|
|
543
|
+
const mimetype = resolveMediaMimetype(message);
|
|
544
|
+
const fileName = message.documentMessage?.fileName ?? void 0;
|
|
545
|
+
if (!message.imageMessage && !message.videoMessage && !message.documentMessage && !message.audioMessage && !message.stickerMessage) return;
|
|
546
|
+
try {
|
|
547
|
+
return {
|
|
548
|
+
buffer: await downloadMediaMessage(msg, "buffer", {}, {
|
|
549
|
+
reuploadRequest: sock.updateMediaMessage,
|
|
550
|
+
logger: sock.logger
|
|
551
|
+
}),
|
|
552
|
+
mimetype,
|
|
553
|
+
fileName
|
|
554
|
+
};
|
|
555
|
+
} catch (err) {
|
|
556
|
+
logVerbose(`downloadMediaMessage failed: ${formatError(err)}`);
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region src/web/inbound/send-api.ts
|
|
563
|
+
function recordWhatsAppOutbound(accountId) {
|
|
564
|
+
recordChannelActivity({
|
|
565
|
+
channel: "whatsapp",
|
|
566
|
+
accountId,
|
|
567
|
+
direction: "outbound"
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
function resolveOutboundMessageId(result) {
|
|
571
|
+
return typeof result === "object" && result && "key" in result ? String(result.key?.id ?? "unknown") : "unknown";
|
|
572
|
+
}
|
|
573
|
+
function withReplyContext(payload, jid, replyToId) {
|
|
574
|
+
const stanzaId = replyToId?.trim();
|
|
575
|
+
if (!stanzaId) return payload;
|
|
576
|
+
const existing = typeof payload === "object" && payload && "contextInfo" in payload ? payload.contextInfo : void 0;
|
|
577
|
+
return {
|
|
578
|
+
...payload,
|
|
579
|
+
contextInfo: {
|
|
580
|
+
...existing,
|
|
581
|
+
stanzaId,
|
|
582
|
+
remoteJid: jid
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
}
|
|
586
|
+
function createWebSendApi(params) {
|
|
587
|
+
return {
|
|
588
|
+
sendMessage: async (to, text, mediaBuffer, mediaType, sendOptions) => {
|
|
589
|
+
const jid = toWhatsappJid(to);
|
|
590
|
+
let payload;
|
|
591
|
+
if (mediaBuffer && mediaType) if (mediaType.startsWith("image/")) payload = {
|
|
592
|
+
image: mediaBuffer,
|
|
593
|
+
caption: text || void 0,
|
|
594
|
+
mimetype: mediaType
|
|
595
|
+
};
|
|
596
|
+
else if (mediaType.startsWith("audio/")) payload = {
|
|
597
|
+
audio: mediaBuffer,
|
|
598
|
+
ptt: true,
|
|
599
|
+
mimetype: mediaType
|
|
600
|
+
};
|
|
601
|
+
else if (mediaType.startsWith("video/")) {
|
|
602
|
+
const gifPlayback = sendOptions?.gifPlayback;
|
|
603
|
+
payload = {
|
|
604
|
+
video: mediaBuffer,
|
|
605
|
+
caption: text || void 0,
|
|
606
|
+
mimetype: mediaType,
|
|
607
|
+
...gifPlayback ? { gifPlayback: true } : {}
|
|
608
|
+
};
|
|
609
|
+
} else payload = {
|
|
610
|
+
document: mediaBuffer,
|
|
611
|
+
fileName: sendOptions?.fileName?.trim() || "file",
|
|
612
|
+
caption: text || void 0,
|
|
613
|
+
mimetype: mediaType
|
|
614
|
+
};
|
|
615
|
+
else payload = { text };
|
|
616
|
+
payload = withReplyContext(payload, jid, sendOptions?.replyToId);
|
|
617
|
+
const result = await params.sock.sendMessage(jid, payload);
|
|
618
|
+
recordWhatsAppOutbound(sendOptions?.accountId ?? params.defaultAccountId);
|
|
619
|
+
return { messageId: resolveOutboundMessageId(result) };
|
|
620
|
+
},
|
|
621
|
+
sendPoll: async (to, poll) => {
|
|
622
|
+
const jid = toWhatsappJid(to);
|
|
623
|
+
const result = await params.sock.sendMessage(jid, { poll: {
|
|
624
|
+
name: poll.question,
|
|
625
|
+
values: poll.options,
|
|
626
|
+
selectableCount: poll.maxSelections ?? 1
|
|
627
|
+
} });
|
|
628
|
+
recordWhatsAppOutbound(params.defaultAccountId);
|
|
629
|
+
return { messageId: resolveOutboundMessageId(result) };
|
|
630
|
+
},
|
|
631
|
+
sendReaction: async (chatJid, messageId, emoji, fromMe, participant) => {
|
|
632
|
+
const jid = toWhatsappJid(chatJid);
|
|
633
|
+
await params.sock.sendMessage(jid, { react: {
|
|
634
|
+
text: emoji,
|
|
635
|
+
key: {
|
|
636
|
+
remoteJid: jid,
|
|
637
|
+
id: messageId,
|
|
638
|
+
fromMe,
|
|
639
|
+
participant: participant ? toWhatsappJid(participant) : void 0
|
|
640
|
+
}
|
|
641
|
+
} });
|
|
642
|
+
},
|
|
643
|
+
sendComposingTo: async (to) => {
|
|
644
|
+
const jid = toWhatsappJid(to);
|
|
645
|
+
await params.sock.sendPresenceUpdate("composing", jid);
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
//#endregion
|
|
651
|
+
//#region src/web/inbound/monitor.ts
|
|
652
|
+
function withGroupReplyContext(payload, params) {
|
|
653
|
+
if (!params.group || !params.messageId) return payload;
|
|
654
|
+
const existing = typeof payload === "object" && payload && "contextInfo" in payload ? payload.contextInfo : void 0;
|
|
655
|
+
return {
|
|
656
|
+
...payload,
|
|
657
|
+
contextInfo: {
|
|
658
|
+
...existing,
|
|
659
|
+
stanzaId: params.messageId,
|
|
660
|
+
remoteJid: params.remoteJid,
|
|
661
|
+
...params.participantJid ? { participant: params.participantJid } : {}
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
async function monitorWebInbox(options) {
|
|
666
|
+
const inboundLogger = getChildLogger({ module: "web-inbound" });
|
|
667
|
+
const inboundConsoleLog = createSubsystemLogger("gateway/channels/whatsapp").child("inbound");
|
|
668
|
+
const sock = await createWaSocket(false, options.verbose, { authDir: options.authDir });
|
|
669
|
+
await waitForWaConnection(sock);
|
|
670
|
+
const connectedAtMs = Date.now();
|
|
671
|
+
let onCloseResolve = null;
|
|
672
|
+
const onClose = new Promise((resolve) => {
|
|
673
|
+
onCloseResolve = resolve;
|
|
674
|
+
});
|
|
675
|
+
const resolveClose = (reason) => {
|
|
676
|
+
if (!onCloseResolve) return;
|
|
677
|
+
const resolver = onCloseResolve;
|
|
678
|
+
onCloseResolve = null;
|
|
679
|
+
resolver(reason);
|
|
680
|
+
};
|
|
681
|
+
try {
|
|
682
|
+
await sock.sendPresenceUpdate("available");
|
|
683
|
+
if (shouldLogVerbose()) logVerbose("Sent global 'available' presence on connect");
|
|
684
|
+
} catch (err) {
|
|
685
|
+
logVerbose(`Failed to send 'available' presence on connect: ${formatError(err)}`);
|
|
686
|
+
}
|
|
687
|
+
const selfJid = sock.user?.id;
|
|
688
|
+
const selfE164 = selfJid ? jidToE164(selfJid) : null;
|
|
689
|
+
const debouncer = createInboundDebouncer({
|
|
690
|
+
debounceMs: options.debounceMs ?? 0,
|
|
691
|
+
buildKey: (msg) => {
|
|
692
|
+
const senderKey = msg.chatType === "group" ? msg.senderJid ?? msg.senderE164 ?? msg.senderName ?? msg.from : msg.from;
|
|
693
|
+
if (!senderKey) return null;
|
|
694
|
+
const conversationKey = msg.chatType === "group" ? msg.chatId : msg.from;
|
|
695
|
+
return `${msg.accountId}:${conversationKey}:${senderKey}`;
|
|
696
|
+
},
|
|
697
|
+
shouldDebounce: options.shouldDebounce,
|
|
698
|
+
onFlush: async (entries) => {
|
|
699
|
+
const last = entries.at(-1);
|
|
700
|
+
if (!last) return;
|
|
701
|
+
if (entries.length === 1) {
|
|
702
|
+
await options.onMessage(last);
|
|
703
|
+
return;
|
|
704
|
+
}
|
|
705
|
+
const mentioned = /* @__PURE__ */ new Set();
|
|
706
|
+
for (const entry of entries) for (const jid of entry.mentionedJids ?? []) mentioned.add(jid);
|
|
707
|
+
const combinedBody = entries.map((entry) => entry.body).filter(Boolean).join("\n");
|
|
708
|
+
const combinedMessage = {
|
|
709
|
+
...last,
|
|
710
|
+
body: combinedBody,
|
|
711
|
+
mentionedJids: mentioned.size > 0 ? Array.from(mentioned) : void 0
|
|
712
|
+
};
|
|
713
|
+
await options.onMessage(combinedMessage);
|
|
714
|
+
},
|
|
715
|
+
onError: (err) => {
|
|
716
|
+
const errorText = formatError(err);
|
|
717
|
+
inboundLogger.error({ error: errorText }, "failed handling inbound web message");
|
|
718
|
+
inboundConsoleLog.error(`Failed handling inbound web message: ${errorText}`);
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
const groupMetaCache = /* @__PURE__ */ new Map();
|
|
722
|
+
const GROUP_META_TTL_MS = 300 * 1e3;
|
|
723
|
+
const lidLookup = sock.signalRepository?.lidMapping;
|
|
724
|
+
const resolveInboundJid = async (jid) => resolveJidToE164(jid, {
|
|
725
|
+
authDir: options.authDir,
|
|
726
|
+
lidLookup
|
|
727
|
+
});
|
|
728
|
+
const getGroupMeta = async (jid) => {
|
|
729
|
+
const cached = groupMetaCache.get(jid);
|
|
730
|
+
if (cached && cached.expires > Date.now()) return cached;
|
|
731
|
+
try {
|
|
732
|
+
const meta = await sock.groupMetadata(jid);
|
|
733
|
+
const participants = (await Promise.all(meta.participants?.map(async (p) => {
|
|
734
|
+
return await resolveInboundJid(p.id) ?? p.id;
|
|
735
|
+
}) ?? [])).filter(Boolean) ?? [];
|
|
736
|
+
const entry = {
|
|
737
|
+
subject: meta.subject,
|
|
738
|
+
participants,
|
|
739
|
+
expires: Date.now() + GROUP_META_TTL_MS
|
|
740
|
+
};
|
|
741
|
+
groupMetaCache.set(jid, entry);
|
|
742
|
+
return entry;
|
|
743
|
+
} catch (err) {
|
|
744
|
+
logVerbose(`Failed to fetch group metadata for ${redactIdentifier(jid)}: ${formatError(err)}`);
|
|
745
|
+
return { expires: Date.now() + GROUP_META_TTL_MS };
|
|
746
|
+
}
|
|
747
|
+
};
|
|
748
|
+
const handleMessagesUpsert = async (upsert) => {
|
|
749
|
+
if (upsert.type !== "notify" && upsert.type !== "append") return;
|
|
750
|
+
for (const msg of upsert.messages ?? []) {
|
|
751
|
+
recordChannelActivity({
|
|
752
|
+
channel: "whatsapp",
|
|
753
|
+
accountId: options.accountId,
|
|
754
|
+
direction: "inbound"
|
|
755
|
+
});
|
|
756
|
+
const id = msg.key?.id ?? void 0;
|
|
757
|
+
const remoteJid = msg.key?.remoteJid;
|
|
758
|
+
if (!remoteJid) continue;
|
|
759
|
+
if (remoteJid.endsWith("@status") || remoteJid.endsWith("@broadcast")) continue;
|
|
760
|
+
const group = isJidGroup(remoteJid) === true;
|
|
761
|
+
if (id) {
|
|
762
|
+
if (isRecentInboundMessage(`${options.accountId}:${remoteJid}:${id}`)) continue;
|
|
763
|
+
}
|
|
764
|
+
const participantJid = msg.key?.participant ?? void 0;
|
|
765
|
+
const from = group ? remoteJid : await resolveInboundJid(remoteJid);
|
|
766
|
+
if (!from) continue;
|
|
767
|
+
const senderE164 = group ? participantJid ? await resolveInboundJid(participantJid) : null : from;
|
|
768
|
+
let groupSubject;
|
|
769
|
+
let groupParticipants;
|
|
770
|
+
if (group) {
|
|
771
|
+
const meta = await getGroupMeta(remoteJid);
|
|
772
|
+
groupSubject = meta.subject;
|
|
773
|
+
groupParticipants = meta.participants;
|
|
774
|
+
}
|
|
775
|
+
const messageTimestampMs = msg.messageTimestamp ? Number(msg.messageTimestamp) * 1e3 : void 0;
|
|
776
|
+
const access = await checkInboundAccessControl({
|
|
777
|
+
accountId: options.accountId,
|
|
778
|
+
from,
|
|
779
|
+
selfE164,
|
|
780
|
+
senderE164,
|
|
781
|
+
group,
|
|
782
|
+
pushName: msg.pushName ?? void 0,
|
|
783
|
+
isFromMe: Boolean(msg.key?.fromMe),
|
|
784
|
+
messageTimestampMs,
|
|
785
|
+
connectedAtMs,
|
|
786
|
+
sock: { sendMessage: (jid, content) => sock.sendMessage(jid, content) },
|
|
787
|
+
remoteJid
|
|
788
|
+
});
|
|
789
|
+
if (!access.allowed) continue;
|
|
790
|
+
if (id && !access.isSelfChat && options.sendReadReceipts !== false) {
|
|
791
|
+
const participant = msg.key?.participant;
|
|
792
|
+
try {
|
|
793
|
+
await sock.readMessages([{
|
|
794
|
+
remoteJid,
|
|
795
|
+
id,
|
|
796
|
+
participant,
|
|
797
|
+
fromMe: false
|
|
798
|
+
}]);
|
|
799
|
+
if (shouldLogVerbose()) {
|
|
800
|
+
const suffix = participant ? ` (participant ${redactIdentifier(participant)})` : "";
|
|
801
|
+
logVerbose(`Marked message ${id} as read for ${redactIdentifier(remoteJid)}${suffix}`);
|
|
802
|
+
}
|
|
803
|
+
} catch (err) {
|
|
804
|
+
logVerbose(`Failed to mark message ${id} read: ${formatError(err)}`);
|
|
805
|
+
}
|
|
806
|
+
} else if (id && access.isSelfChat && shouldLogVerbose()) logVerbose(`Self-chat mode: skipping read receipt for ${id}`);
|
|
807
|
+
if (upsert.type === "append") continue;
|
|
808
|
+
const location = extractLocationData(msg.message ?? void 0);
|
|
809
|
+
const locationText = location ? formatLocationText(location) : void 0;
|
|
810
|
+
let body = extractText(msg.message ?? void 0);
|
|
811
|
+
if (locationText) body = [body, locationText].filter(Boolean).join("\n").trim();
|
|
812
|
+
if (!body) {
|
|
813
|
+
body = extractMediaPlaceholder(msg.message ?? void 0);
|
|
814
|
+
if (!body) continue;
|
|
815
|
+
}
|
|
816
|
+
const replyContext = describeReplyContext(msg.message);
|
|
817
|
+
let mediaPath;
|
|
818
|
+
let mediaType;
|
|
819
|
+
let mediaFileName;
|
|
820
|
+
try {
|
|
821
|
+
const inboundMedia = await downloadInboundMedia(msg, sock);
|
|
822
|
+
if (inboundMedia) {
|
|
823
|
+
const maxBytes = (typeof options.mediaMaxMb === "number" && options.mediaMaxMb > 0 ? options.mediaMaxMb : 50) * 1024 * 1024;
|
|
824
|
+
mediaPath = (await saveMediaBuffer(inboundMedia.buffer, inboundMedia.mimetype, "inbound", maxBytes, inboundMedia.fileName)).path;
|
|
825
|
+
mediaType = inboundMedia.mimetype;
|
|
826
|
+
mediaFileName = inboundMedia.fileName;
|
|
827
|
+
}
|
|
828
|
+
} catch (err) {
|
|
829
|
+
logVerbose(`Inbound media download failed: ${formatError(err)}`);
|
|
830
|
+
}
|
|
831
|
+
const chatJid = remoteJid;
|
|
832
|
+
const sendComposing = async () => {
|
|
833
|
+
try {
|
|
834
|
+
await sock.sendPresenceUpdate("composing", chatJid);
|
|
835
|
+
} catch (err) {
|
|
836
|
+
logVerbose(`Presence update failed: ${formatError(err)}`);
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
const reply = async (text) => {
|
|
840
|
+
await sock.sendMessage(chatJid, withGroupReplyContext({ text }, {
|
|
841
|
+
group,
|
|
842
|
+
messageId: id,
|
|
843
|
+
remoteJid,
|
|
844
|
+
participantJid
|
|
845
|
+
}));
|
|
846
|
+
};
|
|
847
|
+
const sendMedia = async (payload) => {
|
|
848
|
+
await sock.sendMessage(chatJid, withGroupReplyContext(payload, {
|
|
849
|
+
group,
|
|
850
|
+
messageId: id,
|
|
851
|
+
remoteJid,
|
|
852
|
+
participantJid
|
|
853
|
+
}));
|
|
854
|
+
};
|
|
855
|
+
const timestamp = messageTimestampMs;
|
|
856
|
+
const mentionedJids = extractMentionedJids(msg.message);
|
|
857
|
+
const senderName = msg.pushName ?? void 0;
|
|
858
|
+
inboundLogger.info({
|
|
859
|
+
from,
|
|
860
|
+
to: selfE164 ?? "me",
|
|
861
|
+
body,
|
|
862
|
+
mediaPath,
|
|
863
|
+
mediaType,
|
|
864
|
+
mediaFileName,
|
|
865
|
+
timestamp
|
|
866
|
+
}, "inbound message");
|
|
867
|
+
const inboundMessage = {
|
|
868
|
+
id,
|
|
869
|
+
from,
|
|
870
|
+
conversationId: from,
|
|
871
|
+
to: selfE164 ?? "me",
|
|
872
|
+
accountId: access.resolvedAccountId,
|
|
873
|
+
body,
|
|
874
|
+
pushName: senderName,
|
|
875
|
+
timestamp,
|
|
876
|
+
chatType: group ? "group" : "direct",
|
|
877
|
+
chatId: remoteJid,
|
|
878
|
+
senderJid: participantJid,
|
|
879
|
+
senderE164: senderE164 ?? void 0,
|
|
880
|
+
senderName,
|
|
881
|
+
replyToId: replyContext?.id,
|
|
882
|
+
replyToBody: replyContext?.body,
|
|
883
|
+
replyToSender: replyContext?.sender,
|
|
884
|
+
replyToSenderJid: replyContext?.senderJid,
|
|
885
|
+
replyToSenderE164: replyContext?.senderE164,
|
|
886
|
+
groupSubject,
|
|
887
|
+
groupParticipants,
|
|
888
|
+
mentionedJids: mentionedJids ?? void 0,
|
|
889
|
+
selfJid,
|
|
890
|
+
selfE164,
|
|
891
|
+
location: location ?? void 0,
|
|
892
|
+
sendComposing,
|
|
893
|
+
reply,
|
|
894
|
+
sendMedia,
|
|
895
|
+
mediaPath,
|
|
896
|
+
mediaType,
|
|
897
|
+
mediaFileName
|
|
898
|
+
};
|
|
899
|
+
try {
|
|
900
|
+
Promise.resolve(debouncer.enqueue(inboundMessage)).catch((err) => {
|
|
901
|
+
const errorText = formatError(err);
|
|
902
|
+
inboundLogger.error({ error: errorText }, "failed handling inbound web message");
|
|
903
|
+
inboundConsoleLog.error(`Failed handling inbound web message: ${errorText}`);
|
|
904
|
+
});
|
|
905
|
+
} catch (err) {
|
|
906
|
+
const errorText = formatError(err);
|
|
907
|
+
inboundLogger.error({ error: errorText }, "failed handling inbound web message");
|
|
908
|
+
inboundConsoleLog.error(`Failed handling inbound web message: ${errorText}`);
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
};
|
|
912
|
+
sock.ev.on("messages.upsert", handleMessagesUpsert);
|
|
913
|
+
const handleConnectionUpdate = (update) => {
|
|
914
|
+
try {
|
|
915
|
+
if (update.connection === "close") {
|
|
916
|
+
const status = getStatusCode(update.lastDisconnect?.error);
|
|
917
|
+
resolveClose({
|
|
918
|
+
status,
|
|
919
|
+
isLoggedOut: status === DisconnectReason.loggedOut,
|
|
920
|
+
error: update.lastDisconnect?.error
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
} catch (err) {
|
|
924
|
+
inboundLogger.error({ error: formatError(err) }, "connection.update handler error");
|
|
925
|
+
resolveClose({
|
|
926
|
+
status: void 0,
|
|
927
|
+
isLoggedOut: false,
|
|
928
|
+
error: err
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
sock.ev.on("connection.update", handleConnectionUpdate);
|
|
933
|
+
return {
|
|
934
|
+
close: async () => {
|
|
935
|
+
try {
|
|
936
|
+
const ev = sock.ev;
|
|
937
|
+
const messagesUpsertHandler = handleMessagesUpsert;
|
|
938
|
+
const connectionUpdateHandler = handleConnectionUpdate;
|
|
939
|
+
if (typeof ev.off === "function") {
|
|
940
|
+
ev.off("messages.upsert", messagesUpsertHandler);
|
|
941
|
+
ev.off("connection.update", connectionUpdateHandler);
|
|
942
|
+
} else if (typeof ev.removeListener === "function") {
|
|
943
|
+
ev.removeListener("messages.upsert", messagesUpsertHandler);
|
|
944
|
+
ev.removeListener("connection.update", connectionUpdateHandler);
|
|
945
|
+
}
|
|
946
|
+
await sock.ws?.close();
|
|
947
|
+
} catch (err) {
|
|
948
|
+
logVerbose(`Socket close failed: ${formatError(err)}`);
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
onClose,
|
|
952
|
+
signalClose: (reason) => {
|
|
953
|
+
resolveClose(reason ?? {
|
|
954
|
+
status: void 0,
|
|
955
|
+
isLoggedOut: false,
|
|
956
|
+
error: "closed"
|
|
957
|
+
});
|
|
958
|
+
},
|
|
959
|
+
...createWebSendApi({
|
|
960
|
+
sock: {
|
|
961
|
+
sendMessage: (jid, content) => sock.sendMessage(jid, content),
|
|
962
|
+
sendPresenceUpdate: (presence, jid) => sock.sendPresenceUpdate(presence, jid)
|
|
963
|
+
},
|
|
964
|
+
defaultAccountId: options.accountId
|
|
965
|
+
})
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region src/web/auto-reply/mentions.ts
|
|
971
|
+
function buildMentionConfig(cfg, agentId) {
|
|
972
|
+
return {
|
|
973
|
+
mentionRegexes: buildMentionRegexes(cfg, agentId),
|
|
974
|
+
allowFrom: cfg.channels?.whatsapp?.allowFrom
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
function resolveMentionTargets(msg, authDir) {
|
|
978
|
+
const jidOptions = authDir ? { authDir } : void 0;
|
|
979
|
+
return {
|
|
980
|
+
normalizedMentions: msg.mentionedJids?.length ? msg.mentionedJids.map((jid) => jidToE164(jid, jidOptions) ?? jid).filter(Boolean) : [],
|
|
981
|
+
selfE164: msg.selfE164 ?? (msg.selfJid ? jidToE164(msg.selfJid, jidOptions) : null),
|
|
982
|
+
selfJid: msg.selfJid ? msg.selfJid.replace(/:\\d+/, "") : null
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
function isBotMentionedFromTargets(msg, mentionCfg, targets) {
|
|
986
|
+
const clean = (text) => normalizeMentionText(text);
|
|
987
|
+
const isSelfChat = isSelfChatMode(targets.selfE164, mentionCfg.allowFrom);
|
|
988
|
+
const hasMentions = (msg.mentionedJids?.length ?? 0) > 0;
|
|
989
|
+
if (hasMentions && !isSelfChat) {
|
|
990
|
+
if (targets.selfE164 && targets.normalizedMentions.includes(targets.selfE164)) return true;
|
|
991
|
+
if (targets.selfJid) {
|
|
992
|
+
if (targets.normalizedMentions.includes(targets.selfJid)) return true;
|
|
993
|
+
}
|
|
994
|
+
return false;
|
|
995
|
+
} else if (hasMentions && isSelfChat) {}
|
|
996
|
+
const bodyClean = clean(msg.body);
|
|
997
|
+
if (mentionCfg.mentionRegexes.some((re) => re.test(bodyClean))) return true;
|
|
998
|
+
if (targets.selfE164) {
|
|
999
|
+
const selfDigits = targets.selfE164.replace(/\D/g, "");
|
|
1000
|
+
if (selfDigits) {
|
|
1001
|
+
if (bodyClean.replace(/[^\d]/g, "").includes(selfDigits)) return true;
|
|
1002
|
+
const bodyNoSpace = msg.body.replace(/[\s-]/g, "");
|
|
1003
|
+
if (new RegExp(`\\+?${selfDigits}`, "i").test(bodyNoSpace)) return true;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
return false;
|
|
1007
|
+
}
|
|
1008
|
+
function debugMention(msg, mentionCfg, authDir) {
|
|
1009
|
+
const mentionTargets = resolveMentionTargets(msg, authDir);
|
|
1010
|
+
return {
|
|
1011
|
+
wasMentioned: isBotMentionedFromTargets(msg, mentionCfg, mentionTargets),
|
|
1012
|
+
details: {
|
|
1013
|
+
from: msg.from,
|
|
1014
|
+
body: msg.body,
|
|
1015
|
+
bodyClean: normalizeMentionText(msg.body),
|
|
1016
|
+
mentionedJids: msg.mentionedJids ?? null,
|
|
1017
|
+
normalizedMentionedJids: mentionTargets.normalizedMentions.length ? mentionTargets.normalizedMentions : null,
|
|
1018
|
+
selfJid: msg.selfJid ?? null,
|
|
1019
|
+
selfJidBare: mentionTargets.selfJid,
|
|
1020
|
+
selfE164: msg.selfE164 ?? null,
|
|
1021
|
+
resolvedSelfE164: mentionTargets.selfE164
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
function resolveOwnerList(mentionCfg, selfE164) {
|
|
1026
|
+
const allowFrom = mentionCfg.allowFrom;
|
|
1027
|
+
return (Array.isArray(allowFrom) && allowFrom.length > 0 ? allowFrom : selfE164 ? [selfE164] : []).filter((entry) => Boolean(entry && entry !== "*")).map((entry) => normalizeE164(entry)).filter((entry) => Boolean(entry));
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
//#endregion
|
|
1031
|
+
//#region src/web/auto-reply/monitor/echo.ts
|
|
1032
|
+
function createEchoTracker(params) {
|
|
1033
|
+
const recentlySent = /* @__PURE__ */ new Set();
|
|
1034
|
+
const maxItems = Math.max(1, params.maxItems ?? 100);
|
|
1035
|
+
const buildCombinedKey = (p) => `combined:${p.sessionKey}:${p.combinedBody}`;
|
|
1036
|
+
const trim = () => {
|
|
1037
|
+
while (recentlySent.size > maxItems) {
|
|
1038
|
+
const firstKey = recentlySent.values().next().value;
|
|
1039
|
+
if (!firstKey) break;
|
|
1040
|
+
recentlySent.delete(firstKey);
|
|
1041
|
+
}
|
|
1042
|
+
};
|
|
1043
|
+
const rememberText = (text, opts) => {
|
|
1044
|
+
if (!text) return;
|
|
1045
|
+
recentlySent.add(text);
|
|
1046
|
+
if (opts.combinedBody && opts.combinedBodySessionKey) recentlySent.add(buildCombinedKey({
|
|
1047
|
+
sessionKey: opts.combinedBodySessionKey,
|
|
1048
|
+
combinedBody: opts.combinedBody
|
|
1049
|
+
}));
|
|
1050
|
+
if (opts.logVerboseMessage) params.logVerbose?.(`Added to echo detection set (size now: ${recentlySent.size}): ${text.substring(0, 50)}...`);
|
|
1051
|
+
trim();
|
|
1052
|
+
};
|
|
1053
|
+
return {
|
|
1054
|
+
rememberText,
|
|
1055
|
+
has: (key) => recentlySent.has(key),
|
|
1056
|
+
forget: (key) => {
|
|
1057
|
+
recentlySent.delete(key);
|
|
1058
|
+
},
|
|
1059
|
+
buildCombinedKey
|
|
1060
|
+
};
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
//#endregion
|
|
1064
|
+
//#region src/web/auto-reply/monitor/broadcast.ts
|
|
1065
|
+
async function maybeBroadcastMessage(params) {
|
|
1066
|
+
const broadcastAgents = params.cfg.broadcast?.[params.peerId];
|
|
1067
|
+
if (!broadcastAgents || !Array.isArray(broadcastAgents)) return false;
|
|
1068
|
+
if (broadcastAgents.length === 0) return false;
|
|
1069
|
+
const strategy = params.cfg.broadcast?.strategy || "parallel";
|
|
1070
|
+
whatsappInboundLog.info(`Broadcasting message to ${broadcastAgents.length} agents (${strategy})`);
|
|
1071
|
+
const agentIds = params.cfg.agents?.list?.map((agent) => normalizeAgentId(agent.id));
|
|
1072
|
+
const hasKnownAgents = (agentIds?.length ?? 0) > 0;
|
|
1073
|
+
const groupHistorySnapshot = params.msg.chatType === "group" ? params.groupHistories.get(params.groupHistoryKey) ?? [] : void 0;
|
|
1074
|
+
const processForAgent = async (agentId) => {
|
|
1075
|
+
const normalizedAgentId = normalizeAgentId(agentId);
|
|
1076
|
+
if (hasKnownAgents && !agentIds?.includes(normalizedAgentId)) {
|
|
1077
|
+
whatsappInboundLog.warn(`Broadcast agent ${agentId} not found in agents.list; skipping`);
|
|
1078
|
+
return false;
|
|
1079
|
+
}
|
|
1080
|
+
const agentRoute = {
|
|
1081
|
+
...params.route,
|
|
1082
|
+
agentId: normalizedAgentId,
|
|
1083
|
+
sessionKey: buildAgentSessionKey({
|
|
1084
|
+
agentId: normalizedAgentId,
|
|
1085
|
+
channel: "whatsapp",
|
|
1086
|
+
accountId: params.route.accountId,
|
|
1087
|
+
peer: {
|
|
1088
|
+
kind: params.msg.chatType === "group" ? "group" : "direct",
|
|
1089
|
+
id: params.peerId
|
|
1090
|
+
},
|
|
1091
|
+
dmScope: params.cfg.session?.dmScope,
|
|
1092
|
+
identityLinks: params.cfg.session?.identityLinks
|
|
1093
|
+
}),
|
|
1094
|
+
mainSessionKey: buildAgentMainSessionKey({
|
|
1095
|
+
agentId: normalizedAgentId,
|
|
1096
|
+
mainKey: DEFAULT_MAIN_KEY
|
|
1097
|
+
})
|
|
1098
|
+
};
|
|
1099
|
+
try {
|
|
1100
|
+
return await params.processMessage(params.msg, agentRoute, params.groupHistoryKey, {
|
|
1101
|
+
groupHistory: groupHistorySnapshot,
|
|
1102
|
+
suppressGroupHistoryClear: true
|
|
1103
|
+
});
|
|
1104
|
+
} catch (err) {
|
|
1105
|
+
whatsappInboundLog.error(`Broadcast agent ${agentId} failed: ${formatError(err)}`);
|
|
1106
|
+
return false;
|
|
1107
|
+
}
|
|
1108
|
+
};
|
|
1109
|
+
if (strategy === "sequential") for (const agentId of broadcastAgents) await processForAgent(agentId);
|
|
1110
|
+
else await Promise.allSettled(broadcastAgents.map(processForAgent));
|
|
1111
|
+
if (params.msg.chatType === "group") params.groupHistories.set(params.groupHistoryKey, []);
|
|
1112
|
+
return true;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
//#endregion
|
|
1116
|
+
//#region src/web/auto-reply/monitor/commands.ts
|
|
1117
|
+
function stripMentionsForCommand(text, mentionRegexes, selfE164) {
|
|
1118
|
+
let result = text;
|
|
1119
|
+
for (const re of mentionRegexes) result = result.replace(re, " ");
|
|
1120
|
+
if (selfE164) {
|
|
1121
|
+
const digits = selfE164.replace(/\D/g, "");
|
|
1122
|
+
if (digits) {
|
|
1123
|
+
const pattern = new RegExp(`\\+?${digits}`, "g");
|
|
1124
|
+
result = result.replace(pattern, " ");
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
return result.replace(/\s+/g, " ").trim();
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region src/web/auto-reply/monitor/group-activation.ts
|
|
1132
|
+
function resolveGroupPolicyFor(cfg, conversationId) {
|
|
1133
|
+
const groupId = resolveGroupSessionKey({
|
|
1134
|
+
From: conversationId,
|
|
1135
|
+
ChatType: "group",
|
|
1136
|
+
Provider: "whatsapp"
|
|
1137
|
+
})?.id;
|
|
1138
|
+
const whatsappCfg = cfg.channels?.whatsapp;
|
|
1139
|
+
const hasGroupAllowFrom = Boolean(whatsappCfg?.groupAllowFrom?.length || whatsappCfg?.allowFrom?.length);
|
|
1140
|
+
return resolveChannelGroupPolicy({
|
|
1141
|
+
cfg,
|
|
1142
|
+
channel: "whatsapp",
|
|
1143
|
+
groupId: groupId ?? conversationId,
|
|
1144
|
+
hasGroupAllowFrom
|
|
1145
|
+
});
|
|
1146
|
+
}
|
|
1147
|
+
function resolveGroupRequireMentionFor(cfg, conversationId) {
|
|
1148
|
+
const groupId = resolveGroupSessionKey({
|
|
1149
|
+
From: conversationId,
|
|
1150
|
+
ChatType: "group",
|
|
1151
|
+
Provider: "whatsapp"
|
|
1152
|
+
})?.id;
|
|
1153
|
+
return resolveChannelGroupRequireMention({
|
|
1154
|
+
cfg,
|
|
1155
|
+
channel: "whatsapp",
|
|
1156
|
+
groupId: groupId ?? conversationId
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
function resolveGroupActivationFor(params) {
|
|
1160
|
+
const entry = loadSessionStore(resolveStorePath(params.cfg.session?.store, { agentId: params.agentId }))[params.sessionKey];
|
|
1161
|
+
const defaultActivation = !resolveGroupRequireMentionFor(params.cfg, params.conversationId) ? "always" : "mention";
|
|
1162
|
+
return normalizeGroupActivation(entry?.groupActivation) ?? defaultActivation;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
//#endregion
|
|
1166
|
+
//#region src/web/auto-reply/monitor/group-members.ts
|
|
1167
|
+
function appendNormalizedUnique(entries, seen, ordered) {
|
|
1168
|
+
for (const entry of entries) {
|
|
1169
|
+
const normalized = normalizeE164(entry) ?? entry;
|
|
1170
|
+
if (!normalized || seen.has(normalized)) continue;
|
|
1171
|
+
seen.add(normalized);
|
|
1172
|
+
ordered.push(normalized);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
function noteGroupMember(groupMemberNames, conversationId, e164, name) {
|
|
1176
|
+
if (!e164 || !name) return;
|
|
1177
|
+
const key = normalizeE164(e164) ?? e164;
|
|
1178
|
+
if (!key) return;
|
|
1179
|
+
let roster = groupMemberNames.get(conversationId);
|
|
1180
|
+
if (!roster) {
|
|
1181
|
+
roster = /* @__PURE__ */ new Map();
|
|
1182
|
+
groupMemberNames.set(conversationId, roster);
|
|
1183
|
+
}
|
|
1184
|
+
roster.set(key, name);
|
|
1185
|
+
}
|
|
1186
|
+
function formatGroupMembers(params) {
|
|
1187
|
+
const { participants, roster, fallbackE164 } = params;
|
|
1188
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1189
|
+
const ordered = [];
|
|
1190
|
+
if (participants?.length) appendNormalizedUnique(participants, seen, ordered);
|
|
1191
|
+
if (roster) appendNormalizedUnique(roster.keys(), seen, ordered);
|
|
1192
|
+
if (ordered.length === 0 && fallbackE164) {
|
|
1193
|
+
const normalized = normalizeE164(fallbackE164) ?? fallbackE164;
|
|
1194
|
+
if (normalized) ordered.push(normalized);
|
|
1195
|
+
}
|
|
1196
|
+
if (ordered.length === 0) return;
|
|
1197
|
+
return ordered.map((entry) => {
|
|
1198
|
+
const name = roster?.get(entry);
|
|
1199
|
+
return name ? `${name} (${entry})` : entry;
|
|
1200
|
+
}).join(", ");
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
//#endregion
|
|
1204
|
+
//#region src/web/auto-reply/monitor/group-gating.ts
|
|
1205
|
+
function isOwnerSender(baseMentionConfig, msg) {
|
|
1206
|
+
const sender = normalizeE164(msg.senderE164 ?? "");
|
|
1207
|
+
if (!sender) return false;
|
|
1208
|
+
return resolveOwnerList(baseMentionConfig, msg.selfE164 ?? void 0).includes(sender);
|
|
1209
|
+
}
|
|
1210
|
+
function recordPendingGroupHistoryEntry(params) {
|
|
1211
|
+
const sender = params.msg.senderName && params.msg.senderE164 ? `${params.msg.senderName} (${params.msg.senderE164})` : params.msg.senderName ?? params.msg.senderE164 ?? "Unknown";
|
|
1212
|
+
recordPendingHistoryEntryIfEnabled({
|
|
1213
|
+
historyMap: params.groupHistories,
|
|
1214
|
+
historyKey: params.groupHistoryKey,
|
|
1215
|
+
limit: params.groupHistoryLimit,
|
|
1216
|
+
entry: {
|
|
1217
|
+
sender,
|
|
1218
|
+
body: params.msg.body,
|
|
1219
|
+
timestamp: params.msg.timestamp,
|
|
1220
|
+
id: params.msg.id,
|
|
1221
|
+
senderJid: params.msg.senderJid
|
|
1222
|
+
}
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
function skipGroupMessageAndStoreHistory(params, verboseMessage) {
|
|
1226
|
+
params.logVerbose(verboseMessage);
|
|
1227
|
+
recordPendingGroupHistoryEntry({
|
|
1228
|
+
msg: params.msg,
|
|
1229
|
+
groupHistories: params.groupHistories,
|
|
1230
|
+
groupHistoryKey: params.groupHistoryKey,
|
|
1231
|
+
groupHistoryLimit: params.groupHistoryLimit
|
|
1232
|
+
});
|
|
1233
|
+
return { shouldProcess: false };
|
|
1234
|
+
}
|
|
1235
|
+
function applyGroupGating(params) {
|
|
1236
|
+
const groupPolicy = resolveGroupPolicyFor(params.cfg, params.conversationId);
|
|
1237
|
+
if (groupPolicy.allowlistEnabled && !groupPolicy.allowed) {
|
|
1238
|
+
params.logVerbose(`Skipping group message ${params.conversationId} (not in allowlist)`);
|
|
1239
|
+
return { shouldProcess: false };
|
|
1240
|
+
}
|
|
1241
|
+
noteGroupMember(params.groupMemberNames, params.groupHistoryKey, params.msg.senderE164, params.msg.senderName);
|
|
1242
|
+
const mentionConfig = buildMentionConfig(params.cfg, params.agentId);
|
|
1243
|
+
const commandBody = stripMentionsForCommand(params.msg.body, mentionConfig.mentionRegexes, params.msg.selfE164);
|
|
1244
|
+
const activationCommand = parseActivationCommand(commandBody);
|
|
1245
|
+
const owner = isOwnerSender(params.baseMentionConfig, params.msg);
|
|
1246
|
+
const shouldBypassMention = owner && hasControlCommand(commandBody, params.cfg);
|
|
1247
|
+
if (activationCommand.hasCommand && !owner) return skipGroupMessageAndStoreHistory(params, `Ignoring /activation from non-owner in group ${params.conversationId}`);
|
|
1248
|
+
const mentionDebug = debugMention(params.msg, mentionConfig, params.authDir);
|
|
1249
|
+
params.replyLogger.debug({
|
|
1250
|
+
conversationId: params.conversationId,
|
|
1251
|
+
wasMentioned: mentionDebug.wasMentioned,
|
|
1252
|
+
...mentionDebug.details
|
|
1253
|
+
}, "group mention debug");
|
|
1254
|
+
const wasMentioned = mentionDebug.wasMentioned;
|
|
1255
|
+
const requireMention = resolveGroupActivationFor({
|
|
1256
|
+
cfg: params.cfg,
|
|
1257
|
+
agentId: params.agentId,
|
|
1258
|
+
sessionKey: params.sessionKey,
|
|
1259
|
+
conversationId: params.conversationId
|
|
1260
|
+
}) !== "always";
|
|
1261
|
+
const selfJid = params.msg.selfJid?.replace(/:\\d+/, "");
|
|
1262
|
+
const replySenderJid = params.msg.replyToSenderJid?.replace(/:\\d+/, "");
|
|
1263
|
+
const selfE164 = params.msg.selfE164 ? normalizeE164(params.msg.selfE164) : null;
|
|
1264
|
+
const replySenderE164 = params.msg.replyToSenderE164 ? normalizeE164(params.msg.replyToSenderE164) : null;
|
|
1265
|
+
const mentionGate = resolveMentionGating({
|
|
1266
|
+
requireMention,
|
|
1267
|
+
canDetectMention: true,
|
|
1268
|
+
wasMentioned,
|
|
1269
|
+
implicitMention: Boolean(selfJid && replySenderJid && selfJid === replySenderJid || selfE164 && replySenderE164 && selfE164 === replySenderE164),
|
|
1270
|
+
shouldBypassMention
|
|
1271
|
+
});
|
|
1272
|
+
params.msg.wasMentioned = mentionGate.effectiveWasMentioned;
|
|
1273
|
+
if (!shouldBypassMention && requireMention && mentionGate.shouldSkip) return skipGroupMessageAndStoreHistory(params, `Group message stored for context (no mention detected) in ${params.conversationId}: ${params.msg.body}`);
|
|
1274
|
+
return { shouldProcess: true };
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
//#endregion
|
|
1278
|
+
//#region src/web/auto-reply/monitor/last-route.ts
|
|
1279
|
+
function trackBackgroundTask(backgroundTasks, task) {
|
|
1280
|
+
backgroundTasks.add(task);
|
|
1281
|
+
task.finally(() => {
|
|
1282
|
+
backgroundTasks.delete(task);
|
|
1283
|
+
});
|
|
1284
|
+
}
|
|
1285
|
+
function updateLastRouteInBackground(params) {
|
|
1286
|
+
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.storeAgentId });
|
|
1287
|
+
const task = updateLastRoute({
|
|
1288
|
+
storePath,
|
|
1289
|
+
sessionKey: params.sessionKey,
|
|
1290
|
+
deliveryContext: {
|
|
1291
|
+
channel: params.channel,
|
|
1292
|
+
to: params.to,
|
|
1293
|
+
accountId: params.accountId
|
|
1294
|
+
},
|
|
1295
|
+
ctx: params.ctx
|
|
1296
|
+
}).catch((err) => {
|
|
1297
|
+
params.warn({
|
|
1298
|
+
error: formatError(err),
|
|
1299
|
+
storePath,
|
|
1300
|
+
sessionKey: params.sessionKey,
|
|
1301
|
+
to: params.to
|
|
1302
|
+
}, "failed updating last route");
|
|
1303
|
+
});
|
|
1304
|
+
trackBackgroundTask(params.backgroundTasks, task);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
//#endregion
|
|
1308
|
+
//#region src/web/auto-reply/monitor/peer.ts
|
|
1309
|
+
function resolvePeerId(msg) {
|
|
1310
|
+
if (msg.chatType === "group") return msg.conversationId ?? msg.from;
|
|
1311
|
+
if (msg.senderE164) return normalizeE164(msg.senderE164) ?? msg.senderE164;
|
|
1312
|
+
if (msg.from.includes("@")) return jidToE164(msg.from) ?? msg.from;
|
|
1313
|
+
return normalizeE164(msg.from) ?? msg.from;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
//#endregion
|
|
1317
|
+
//#region src/web/auto-reply/util.ts
|
|
1318
|
+
function elide(text, limit = 400) {
|
|
1319
|
+
if (!text) return text;
|
|
1320
|
+
if (text.length <= limit) return text;
|
|
1321
|
+
return `${text.slice(0, limit)}… (truncated ${text.length - limit} chars)`;
|
|
1322
|
+
}
|
|
1323
|
+
function isLikelyWhatsAppCryptoError(reason) {
|
|
1324
|
+
const formatReason = (value) => {
|
|
1325
|
+
if (value == null) return "";
|
|
1326
|
+
if (typeof value === "string") return value;
|
|
1327
|
+
if (value instanceof Error) return `${value.message}\n${value.stack ?? ""}`;
|
|
1328
|
+
if (typeof value === "object") try {
|
|
1329
|
+
return JSON.stringify(value);
|
|
1330
|
+
} catch {
|
|
1331
|
+
return Object.prototype.toString.call(value);
|
|
1332
|
+
}
|
|
1333
|
+
if (typeof value === "number") return String(value);
|
|
1334
|
+
if (typeof value === "boolean") return String(value);
|
|
1335
|
+
if (typeof value === "bigint") return String(value);
|
|
1336
|
+
if (typeof value === "symbol") return value.description ?? value.toString();
|
|
1337
|
+
if (typeof value === "function") return value.name ? `[function ${value.name}]` : "[function]";
|
|
1338
|
+
return Object.prototype.toString.call(value);
|
|
1339
|
+
};
|
|
1340
|
+
const haystack = (reason instanceof Error ? `${reason.message}\n${reason.stack ?? ""}` : formatReason(reason)).toLowerCase();
|
|
1341
|
+
if (!(haystack.includes("unsupported state or unable to authenticate data") || haystack.includes("bad mac"))) return false;
|
|
1342
|
+
return haystack.includes("@whiskeysockets/baileys") || haystack.includes("baileys") || haystack.includes("noise-handler") || haystack.includes("aesdecryptgcm");
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
//#endregion
|
|
1346
|
+
//#region src/web/auto-reply/deliver-reply.ts
|
|
1347
|
+
const REASONING_PREFIX = "reasoning:";
|
|
1348
|
+
function shouldSuppressReasoningReply(payload) {
|
|
1349
|
+
if (payload.isReasoning === true) return true;
|
|
1350
|
+
const text = payload.text;
|
|
1351
|
+
if (typeof text !== "string") return false;
|
|
1352
|
+
return text.trimStart().toLowerCase().startsWith(REASONING_PREFIX);
|
|
1353
|
+
}
|
|
1354
|
+
async function deliverWebReply(params) {
|
|
1355
|
+
const { replyResult, msg, maxMediaBytes, textLimit, replyLogger, connectionId, skipLog } = params;
|
|
1356
|
+
const replyStarted = Date.now();
|
|
1357
|
+
const redactedFrom = redactIdentifier(msg.from);
|
|
1358
|
+
if (shouldSuppressReasoningReply(replyResult)) {
|
|
1359
|
+
whatsappOutboundLog.debug(`Suppressed reasoning payload to ${redactedFrom}`);
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
const tableMode = params.tableMode ?? "code";
|
|
1363
|
+
const chunkMode = params.chunkMode ?? "length";
|
|
1364
|
+
const textChunks = chunkMarkdownTextWithMode(markdownToWhatsApp(convertMarkdownTables(replyResult.text || "", tableMode)), textLimit, chunkMode);
|
|
1365
|
+
const mediaList = replyResult.mediaUrls?.length ? replyResult.mediaUrls : replyResult.mediaUrl ? [replyResult.mediaUrl] : [];
|
|
1366
|
+
const sendWithRetry = async (fn, label, maxAttempts = 3) => {
|
|
1367
|
+
let lastErr;
|
|
1368
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) try {
|
|
1369
|
+
return await fn();
|
|
1370
|
+
} catch (err) {
|
|
1371
|
+
lastErr = err;
|
|
1372
|
+
const errText = formatError(err);
|
|
1373
|
+
const isLast = attempt === maxAttempts;
|
|
1374
|
+
if (!/closed|reset|timed\s*out|disconnect/i.test(errText) || isLast) throw err;
|
|
1375
|
+
const backoffMs = 500 * attempt;
|
|
1376
|
+
logVerbose(`Retrying ${label} to ${redactedFrom} after failure (${attempt}/${maxAttempts - 1}) in ${backoffMs}ms: ${errText}`);
|
|
1377
|
+
await sleep(backoffMs);
|
|
1378
|
+
}
|
|
1379
|
+
throw lastErr;
|
|
1380
|
+
};
|
|
1381
|
+
if (mediaList.length === 0 && textChunks.length) {
|
|
1382
|
+
const totalChunks = textChunks.length;
|
|
1383
|
+
for (const [index, chunk] of textChunks.entries()) {
|
|
1384
|
+
const chunkStarted = Date.now();
|
|
1385
|
+
await sendWithRetry(() => msg.reply(chunk), "text");
|
|
1386
|
+
if (!skipLog) {
|
|
1387
|
+
const durationMs = Date.now() - chunkStarted;
|
|
1388
|
+
whatsappOutboundLog.debug(`Sent chunk ${index + 1}/${totalChunks} to ${redactedFrom} (${durationMs.toFixed(0)}ms)`);
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
replyLogger.info({
|
|
1392
|
+
correlationId: msg.id ?? newConnectionId(),
|
|
1393
|
+
connectionId: connectionId ?? null,
|
|
1394
|
+
to: msg.from,
|
|
1395
|
+
from: msg.to,
|
|
1396
|
+
text: elide(replyResult.text, 240),
|
|
1397
|
+
mediaUrl: null,
|
|
1398
|
+
mediaSizeBytes: null,
|
|
1399
|
+
mediaKind: null,
|
|
1400
|
+
durationMs: Date.now() - replyStarted
|
|
1401
|
+
}, "auto-reply sent (text)");
|
|
1402
|
+
return;
|
|
1403
|
+
}
|
|
1404
|
+
const remainingText = [...textChunks];
|
|
1405
|
+
for (const [index, mediaUrl] of mediaList.entries()) {
|
|
1406
|
+
const caption = index === 0 ? remainingText.shift() || void 0 : void 0;
|
|
1407
|
+
const redactedMediaUrl = redactSensitiveUrlLikeString(mediaUrl);
|
|
1408
|
+
try {
|
|
1409
|
+
const media = await loadWebMedia(mediaUrl, {
|
|
1410
|
+
maxBytes: maxMediaBytes,
|
|
1411
|
+
localRoots: params.mediaLocalRoots
|
|
1412
|
+
});
|
|
1413
|
+
if (shouldLogVerbose()) {
|
|
1414
|
+
logVerbose(`Web auto-reply media size: ${(media.buffer.length / (1024 * 1024)).toFixed(2)}MB`);
|
|
1415
|
+
logVerbose(`Web auto-reply media source: ${redactedMediaUrl} (kind ${media.kind})`);
|
|
1416
|
+
}
|
|
1417
|
+
if (media.kind === "image") await sendWithRetry(() => msg.sendMedia({
|
|
1418
|
+
image: media.buffer,
|
|
1419
|
+
caption,
|
|
1420
|
+
mimetype: media.contentType
|
|
1421
|
+
}), "media:image");
|
|
1422
|
+
else if (media.kind === "audio") await sendWithRetry(() => msg.sendMedia({
|
|
1423
|
+
audio: media.buffer,
|
|
1424
|
+
ptt: true,
|
|
1425
|
+
mimetype: media.contentType,
|
|
1426
|
+
caption
|
|
1427
|
+
}), "media:audio");
|
|
1428
|
+
else if (media.kind === "video") await sendWithRetry(() => msg.sendMedia({
|
|
1429
|
+
video: media.buffer,
|
|
1430
|
+
caption,
|
|
1431
|
+
mimetype: media.contentType
|
|
1432
|
+
}), "media:video");
|
|
1433
|
+
else {
|
|
1434
|
+
const fileName = media.fileName ?? mediaUrl.split("/").pop() ?? "file";
|
|
1435
|
+
const mimetype = media.contentType ?? "application/octet-stream";
|
|
1436
|
+
await sendWithRetry(() => msg.sendMedia({
|
|
1437
|
+
document: media.buffer,
|
|
1438
|
+
fileName,
|
|
1439
|
+
caption,
|
|
1440
|
+
mimetype
|
|
1441
|
+
}), "media:document");
|
|
1442
|
+
}
|
|
1443
|
+
whatsappOutboundLog.info(`Sent media reply to ${redactedFrom} (${(media.buffer.length / (1024 * 1024)).toFixed(2)}MB)`);
|
|
1444
|
+
replyLogger.info({
|
|
1445
|
+
correlationId: msg.id ?? newConnectionId(),
|
|
1446
|
+
connectionId: connectionId ?? null,
|
|
1447
|
+
to: msg.from,
|
|
1448
|
+
from: msg.to,
|
|
1449
|
+
text: caption ?? null,
|
|
1450
|
+
mediaUrl: redactedMediaUrl,
|
|
1451
|
+
mediaSizeBytes: media.buffer.length,
|
|
1452
|
+
mediaKind: media.kind,
|
|
1453
|
+
durationMs: Date.now() - replyStarted
|
|
1454
|
+
}, "auto-reply sent (media)");
|
|
1455
|
+
} catch (err) {
|
|
1456
|
+
whatsappOutboundLog.error(`Failed sending web media to ${redactedFrom}: ${formatError(err)}`);
|
|
1457
|
+
replyLogger.warn({
|
|
1458
|
+
err: formatError(err),
|
|
1459
|
+
mediaUrl: redactedMediaUrl
|
|
1460
|
+
}, "failed to send web media reply");
|
|
1461
|
+
if (index === 0) {
|
|
1462
|
+
const warning = `⚠️ Media failed: ${formatError(err)}`;
|
|
1463
|
+
const fallbackText = [remainingText.shift() ?? caption ?? "", warning].filter(Boolean).join("\n");
|
|
1464
|
+
if (fallbackText) {
|
|
1465
|
+
whatsappOutboundLog.warn(`Media skipped; sent text-only to ${redactedFrom}`);
|
|
1466
|
+
await msg.reply(fallbackText);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
for (const chunk of remainingText) await msg.reply(chunk);
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
//#endregion
|
|
1475
|
+
//#region src/web/auto-reply/monitor/ack-reaction.ts
|
|
1476
|
+
function maybeSendAckReaction(params) {
|
|
1477
|
+
if (!params.msg.id) return;
|
|
1478
|
+
const ackConfig = params.cfg.channels?.whatsapp?.ackReaction;
|
|
1479
|
+
const emoji = (ackConfig?.emoji ?? "").trim();
|
|
1480
|
+
const directEnabled = ackConfig?.direct ?? true;
|
|
1481
|
+
const groupMode = ackConfig?.group ?? "mentions";
|
|
1482
|
+
const conversationIdForCheck = params.msg.conversationId ?? params.msg.from;
|
|
1483
|
+
const activation = params.msg.chatType === "group" ? resolveGroupActivationFor({
|
|
1484
|
+
cfg: params.cfg,
|
|
1485
|
+
agentId: params.agentId,
|
|
1486
|
+
sessionKey: params.sessionKey,
|
|
1487
|
+
conversationId: conversationIdForCheck
|
|
1488
|
+
}) : null;
|
|
1489
|
+
const shouldSendReaction = () => shouldAckReactionForWhatsApp({
|
|
1490
|
+
emoji,
|
|
1491
|
+
isDirect: params.msg.chatType === "direct",
|
|
1492
|
+
isGroup: params.msg.chatType === "group",
|
|
1493
|
+
directEnabled,
|
|
1494
|
+
groupMode,
|
|
1495
|
+
wasMentioned: params.msg.wasMentioned === true,
|
|
1496
|
+
groupActivated: activation === "always"
|
|
1497
|
+
});
|
|
1498
|
+
if (!shouldSendReaction()) return;
|
|
1499
|
+
params.info({
|
|
1500
|
+
chatId: params.msg.chatId,
|
|
1501
|
+
messageId: params.msg.id,
|
|
1502
|
+
emoji
|
|
1503
|
+
}, "sending ack reaction");
|
|
1504
|
+
sendReactionWhatsApp(params.msg.chatId, params.msg.id, emoji, {
|
|
1505
|
+
verbose: params.verbose,
|
|
1506
|
+
fromMe: false,
|
|
1507
|
+
participant: params.msg.senderJid,
|
|
1508
|
+
accountId: params.accountId
|
|
1509
|
+
}).catch((err) => {
|
|
1510
|
+
params.warn({
|
|
1511
|
+
error: formatError(err),
|
|
1512
|
+
chatId: params.msg.chatId,
|
|
1513
|
+
messageId: params.msg.id
|
|
1514
|
+
}, "failed to send ack reaction");
|
|
1515
|
+
logVerbose(`WhatsApp ack reaction failed for chat ${params.msg.chatId}: ${formatError(err)}`);
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
//#endregion
|
|
1520
|
+
//#region src/web/auto-reply/monitor/message-line.ts
|
|
1521
|
+
function formatReplyContext(msg) {
|
|
1522
|
+
if (!msg.replyToBody) return null;
|
|
1523
|
+
return `[Replying to ${msg.replyToSender ?? "unknown sender"}${msg.replyToId ? ` id:${msg.replyToId}` : ""}]\n${msg.replyToBody}\n[/Replying]`;
|
|
1524
|
+
}
|
|
1525
|
+
function buildInboundLine(params) {
|
|
1526
|
+
const { cfg, msg, agentId, previousTimestamp, envelope } = params;
|
|
1527
|
+
const messagePrefix = resolveMessagePrefix(cfg, agentId, {
|
|
1528
|
+
configured: cfg.channels?.whatsapp?.messagePrefix,
|
|
1529
|
+
hasAllowFrom: (cfg.channels?.whatsapp?.allowFrom?.length ?? 0) > 0
|
|
1530
|
+
});
|
|
1531
|
+
const prefixStr = messagePrefix ? `${messagePrefix} ` : "";
|
|
1532
|
+
const replyContext = formatReplyContext(msg);
|
|
1533
|
+
const baseLine = `${prefixStr}${msg.body}${replyContext ? `\n\n${replyContext}` : ""}`;
|
|
1534
|
+
return formatInboundEnvelope({
|
|
1535
|
+
channel: "WhatsApp",
|
|
1536
|
+
from: msg.chatType === "group" ? msg.from : msg.from?.replace(/^whatsapp:/, ""),
|
|
1537
|
+
timestamp: msg.timestamp,
|
|
1538
|
+
body: baseLine,
|
|
1539
|
+
chatType: msg.chatType,
|
|
1540
|
+
sender: {
|
|
1541
|
+
name: msg.senderName,
|
|
1542
|
+
e164: msg.senderE164,
|
|
1543
|
+
id: msg.senderJid
|
|
1544
|
+
},
|
|
1545
|
+
previousTimestamp,
|
|
1546
|
+
envelope
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
//#endregion
|
|
1551
|
+
//#region src/web/auto-reply/monitor/process-message.ts
|
|
1552
|
+
async function resolveWhatsAppCommandAuthorized(params) {
|
|
1553
|
+
const useAccessGroups = params.cfg.commands?.useAccessGroups !== false;
|
|
1554
|
+
if (!useAccessGroups) return true;
|
|
1555
|
+
const isGroup = params.msg.chatType === "group";
|
|
1556
|
+
const senderE164 = normalizeE164(isGroup ? params.msg.senderE164 ?? "" : params.msg.senderE164 ?? params.msg.from ?? "");
|
|
1557
|
+
if (!senderE164) return false;
|
|
1558
|
+
const account = resolveWhatsAppAccount({
|
|
1559
|
+
cfg: params.cfg,
|
|
1560
|
+
accountId: params.msg.accountId
|
|
1561
|
+
});
|
|
1562
|
+
const dmPolicy = account.dmPolicy ?? "pairing";
|
|
1563
|
+
const groupPolicy = account.groupPolicy ?? "allowlist";
|
|
1564
|
+
const configuredAllowFrom = account.allowFrom ?? [];
|
|
1565
|
+
const configuredGroupAllowFrom = account.groupAllowFrom ?? (configuredAllowFrom.length > 0 ? configuredAllowFrom : void 0);
|
|
1566
|
+
const storeAllowFrom = isGroup ? [] : await readStoreAllowFromForDmPolicy({
|
|
1567
|
+
provider: "whatsapp",
|
|
1568
|
+
accountId: params.msg.accountId,
|
|
1569
|
+
dmPolicy
|
|
1570
|
+
});
|
|
1571
|
+
return resolveDmGroupAccessWithCommandGate({
|
|
1572
|
+
isGroup,
|
|
1573
|
+
dmPolicy,
|
|
1574
|
+
groupPolicy,
|
|
1575
|
+
allowFrom: configuredAllowFrom.length > 0 ? configuredAllowFrom : params.msg.selfE164 ? [params.msg.selfE164] : [],
|
|
1576
|
+
groupAllowFrom: configuredGroupAllowFrom,
|
|
1577
|
+
storeAllowFrom,
|
|
1578
|
+
isSenderAllowed: (allowEntries) => {
|
|
1579
|
+
if (allowEntries.includes("*")) return true;
|
|
1580
|
+
return allowEntries.map((entry) => normalizeE164(String(entry))).filter((entry) => Boolean(entry)).includes(senderE164);
|
|
1581
|
+
},
|
|
1582
|
+
command: {
|
|
1583
|
+
useAccessGroups,
|
|
1584
|
+
allowTextCommands: true,
|
|
1585
|
+
hasControlCommand: true
|
|
1586
|
+
}
|
|
1587
|
+
}).commandAuthorized;
|
|
1588
|
+
}
|
|
1589
|
+
async function processMessage(params) {
|
|
1590
|
+
const conversationId = params.msg.conversationId ?? params.msg.from;
|
|
1591
|
+
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: params.route.agentId });
|
|
1592
|
+
const envelopeOptions = resolveEnvelopeFormatOptions(params.cfg);
|
|
1593
|
+
const previousTimestamp = readSessionUpdatedAt({
|
|
1594
|
+
storePath,
|
|
1595
|
+
sessionKey: params.route.sessionKey
|
|
1596
|
+
});
|
|
1597
|
+
let combinedBody = buildInboundLine({
|
|
1598
|
+
cfg: params.cfg,
|
|
1599
|
+
msg: params.msg,
|
|
1600
|
+
agentId: params.route.agentId,
|
|
1601
|
+
previousTimestamp,
|
|
1602
|
+
envelope: envelopeOptions
|
|
1603
|
+
});
|
|
1604
|
+
let shouldClearGroupHistory = false;
|
|
1605
|
+
if (params.msg.chatType === "group") {
|
|
1606
|
+
const history = params.groupHistory ?? params.groupHistories.get(params.groupHistoryKey) ?? [];
|
|
1607
|
+
if (history.length > 0) combinedBody = buildHistoryContextFromEntries({
|
|
1608
|
+
entries: history.map((m) => ({
|
|
1609
|
+
sender: m.sender,
|
|
1610
|
+
body: m.body,
|
|
1611
|
+
timestamp: m.timestamp
|
|
1612
|
+
})),
|
|
1613
|
+
currentMessage: combinedBody,
|
|
1614
|
+
excludeLast: false,
|
|
1615
|
+
formatEntry: (entry) => {
|
|
1616
|
+
return formatInboundEnvelope({
|
|
1617
|
+
channel: "WhatsApp",
|
|
1618
|
+
from: conversationId,
|
|
1619
|
+
timestamp: entry.timestamp,
|
|
1620
|
+
body: entry.body,
|
|
1621
|
+
chatType: "group",
|
|
1622
|
+
senderLabel: entry.sender,
|
|
1623
|
+
envelope: envelopeOptions
|
|
1624
|
+
});
|
|
1625
|
+
}
|
|
1626
|
+
});
|
|
1627
|
+
shouldClearGroupHistory = !(params.suppressGroupHistoryClear ?? false);
|
|
1628
|
+
}
|
|
1629
|
+
const combinedEchoKey = params.buildCombinedEchoKey({
|
|
1630
|
+
sessionKey: params.route.sessionKey,
|
|
1631
|
+
combinedBody
|
|
1632
|
+
});
|
|
1633
|
+
if (params.echoHas(combinedEchoKey)) {
|
|
1634
|
+
logVerbose("Skipping auto-reply: detected echo for combined message");
|
|
1635
|
+
params.echoForget(combinedEchoKey);
|
|
1636
|
+
return false;
|
|
1637
|
+
}
|
|
1638
|
+
maybeSendAckReaction({
|
|
1639
|
+
cfg: params.cfg,
|
|
1640
|
+
msg: params.msg,
|
|
1641
|
+
agentId: params.route.agentId,
|
|
1642
|
+
sessionKey: params.route.sessionKey,
|
|
1643
|
+
conversationId,
|
|
1644
|
+
verbose: params.verbose,
|
|
1645
|
+
accountId: params.route.accountId,
|
|
1646
|
+
info: params.replyLogger.info.bind(params.replyLogger),
|
|
1647
|
+
warn: params.replyLogger.warn.bind(params.replyLogger)
|
|
1648
|
+
});
|
|
1649
|
+
const correlationId = params.msg.id ?? newConnectionId();
|
|
1650
|
+
params.replyLogger.info({
|
|
1651
|
+
connectionId: params.connectionId,
|
|
1652
|
+
correlationId,
|
|
1653
|
+
from: params.msg.chatType === "group" ? conversationId : params.msg.from,
|
|
1654
|
+
to: params.msg.to,
|
|
1655
|
+
body: elide(combinedBody, 240),
|
|
1656
|
+
mediaType: params.msg.mediaType ?? null,
|
|
1657
|
+
mediaPath: params.msg.mediaPath ?? null
|
|
1658
|
+
}, "inbound web message");
|
|
1659
|
+
const fromDisplay = params.msg.chatType === "group" ? conversationId : params.msg.from;
|
|
1660
|
+
const kindLabel = params.msg.mediaType ? `, ${params.msg.mediaType}` : "";
|
|
1661
|
+
whatsappInboundLog.info(`Inbound message ${fromDisplay} -> ${params.msg.to} (${params.msg.chatType}${kindLabel}, ${combinedBody.length} chars)`);
|
|
1662
|
+
if (shouldLogVerbose()) whatsappInboundLog.debug(`Inbound body: ${elide(combinedBody, 400)}`);
|
|
1663
|
+
const dmRouteTarget = params.msg.chatType !== "group" ? (() => {
|
|
1664
|
+
if (params.msg.senderE164) return normalizeE164(params.msg.senderE164);
|
|
1665
|
+
if (params.msg.from.includes("@")) return jidToE164(params.msg.from);
|
|
1666
|
+
return normalizeE164(params.msg.from);
|
|
1667
|
+
})() : void 0;
|
|
1668
|
+
const textLimit = params.maxMediaTextChunkLimit ?? resolveTextChunkLimit(params.cfg, "whatsapp");
|
|
1669
|
+
const chunkMode = resolveChunkMode(params.cfg, "whatsapp", params.route.accountId);
|
|
1670
|
+
const tableMode = resolveMarkdownTableMode({
|
|
1671
|
+
cfg: params.cfg,
|
|
1672
|
+
channel: "whatsapp",
|
|
1673
|
+
accountId: params.route.accountId
|
|
1674
|
+
});
|
|
1675
|
+
const mediaLocalRoots = getAgentScopedMediaLocalRoots(params.cfg, params.route.agentId);
|
|
1676
|
+
let didLogHeartbeatStrip = false;
|
|
1677
|
+
let didSendReply = false;
|
|
1678
|
+
const commandAuthorized = shouldComputeCommandAuthorized(params.msg.body, params.cfg) ? await resolveWhatsAppCommandAuthorized({
|
|
1679
|
+
cfg: params.cfg,
|
|
1680
|
+
msg: params.msg
|
|
1681
|
+
}) : void 0;
|
|
1682
|
+
const configuredResponsePrefix = params.cfg.messages?.responsePrefix;
|
|
1683
|
+
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
1684
|
+
cfg: params.cfg,
|
|
1685
|
+
agentId: params.route.agentId,
|
|
1686
|
+
channel: "whatsapp",
|
|
1687
|
+
accountId: params.route.accountId
|
|
1688
|
+
});
|
|
1689
|
+
const isSelfChat = params.msg.chatType !== "group" && Boolean(params.msg.selfE164) && normalizeE164(params.msg.from) === normalizeE164(params.msg.selfE164 ?? "");
|
|
1690
|
+
const responsePrefix = prefixOptions.responsePrefix ?? (configuredResponsePrefix === void 0 && isSelfChat ? resolveIdentityNamePrefix(params.cfg, params.route.agentId) ?? "[fased]" : void 0);
|
|
1691
|
+
const inboundHistory = params.msg.chatType === "group" ? (params.groupHistory ?? params.groupHistories.get(params.groupHistoryKey) ?? []).map((entry) => ({
|
|
1692
|
+
sender: entry.sender,
|
|
1693
|
+
body: entry.body,
|
|
1694
|
+
timestamp: entry.timestamp
|
|
1695
|
+
})) : void 0;
|
|
1696
|
+
const ctxPayload = finalizeInboundContext({
|
|
1697
|
+
Body: combinedBody,
|
|
1698
|
+
BodyForAgent: params.msg.body,
|
|
1699
|
+
InboundHistory: inboundHistory,
|
|
1700
|
+
RawBody: params.msg.body,
|
|
1701
|
+
CommandBody: params.msg.body,
|
|
1702
|
+
From: params.msg.from,
|
|
1703
|
+
To: params.msg.to,
|
|
1704
|
+
SessionKey: params.route.sessionKey,
|
|
1705
|
+
AccountId: params.route.accountId,
|
|
1706
|
+
MessageSid: params.msg.id,
|
|
1707
|
+
ReplyToId: params.msg.replyToId,
|
|
1708
|
+
ReplyToBody: params.msg.replyToBody,
|
|
1709
|
+
ReplyToSender: params.msg.replyToSender,
|
|
1710
|
+
MediaPath: params.msg.mediaPath,
|
|
1711
|
+
MediaUrl: params.msg.mediaUrl,
|
|
1712
|
+
MediaType: params.msg.mediaType,
|
|
1713
|
+
ChatType: params.msg.chatType,
|
|
1714
|
+
ConversationLabel: params.msg.chatType === "group" ? conversationId : params.msg.from,
|
|
1715
|
+
GroupSubject: params.msg.groupSubject,
|
|
1716
|
+
GroupMembers: formatGroupMembers({
|
|
1717
|
+
participants: params.msg.groupParticipants,
|
|
1718
|
+
roster: params.groupMemberNames.get(params.groupHistoryKey),
|
|
1719
|
+
fallbackE164: params.msg.senderE164
|
|
1720
|
+
}),
|
|
1721
|
+
SenderName: params.msg.senderName,
|
|
1722
|
+
SenderId: params.msg.senderJid?.trim() || params.msg.senderE164,
|
|
1723
|
+
SenderE164: params.msg.senderE164,
|
|
1724
|
+
CommandAuthorized: commandAuthorized,
|
|
1725
|
+
WasMentioned: params.msg.wasMentioned,
|
|
1726
|
+
...params.msg.location ? toLocationContext(params.msg.location) : {},
|
|
1727
|
+
Provider: "whatsapp",
|
|
1728
|
+
Surface: "whatsapp",
|
|
1729
|
+
OriginatingChannel: "whatsapp",
|
|
1730
|
+
OriginatingTo: params.msg.from
|
|
1731
|
+
});
|
|
1732
|
+
if (dmRouteTarget && params.route.sessionKey === params.route.mainSessionKey) updateLastRouteInBackground({
|
|
1733
|
+
cfg: params.cfg,
|
|
1734
|
+
backgroundTasks: params.backgroundTasks,
|
|
1735
|
+
storeAgentId: params.route.agentId,
|
|
1736
|
+
sessionKey: params.route.mainSessionKey,
|
|
1737
|
+
channel: "whatsapp",
|
|
1738
|
+
to: dmRouteTarget,
|
|
1739
|
+
accountId: params.route.accountId,
|
|
1740
|
+
ctx: ctxPayload,
|
|
1741
|
+
warn: params.replyLogger.warn.bind(params.replyLogger)
|
|
1742
|
+
});
|
|
1743
|
+
const metaTask = recordSessionMetaFromInbound({
|
|
1744
|
+
storePath,
|
|
1745
|
+
sessionKey: params.route.sessionKey,
|
|
1746
|
+
ctx: ctxPayload
|
|
1747
|
+
}).catch((err) => {
|
|
1748
|
+
params.replyLogger.warn({
|
|
1749
|
+
error: formatError(err),
|
|
1750
|
+
storePath,
|
|
1751
|
+
sessionKey: params.route.sessionKey
|
|
1752
|
+
}, "failed updating session meta");
|
|
1753
|
+
});
|
|
1754
|
+
trackBackgroundTask(params.backgroundTasks, metaTask);
|
|
1755
|
+
const { queuedFinal } = await dispatchReplyWithBufferedBlockDispatcher({
|
|
1756
|
+
ctx: ctxPayload,
|
|
1757
|
+
cfg: params.cfg,
|
|
1758
|
+
replyResolver: params.replyResolver,
|
|
1759
|
+
dispatcherOptions: {
|
|
1760
|
+
...prefixOptions,
|
|
1761
|
+
responsePrefix,
|
|
1762
|
+
onHeartbeatStrip: () => {
|
|
1763
|
+
if (!didLogHeartbeatStrip) {
|
|
1764
|
+
didLogHeartbeatStrip = true;
|
|
1765
|
+
logVerbose("Stripped stray HEARTBEAT_OK token from web reply");
|
|
1766
|
+
}
|
|
1767
|
+
},
|
|
1768
|
+
deliver: async (payload, info) => {
|
|
1769
|
+
if (info.kind !== "final") return;
|
|
1770
|
+
await deliverWebReply({
|
|
1771
|
+
replyResult: payload,
|
|
1772
|
+
msg: params.msg,
|
|
1773
|
+
mediaLocalRoots,
|
|
1774
|
+
maxMediaBytes: params.maxMediaBytes,
|
|
1775
|
+
textLimit,
|
|
1776
|
+
chunkMode,
|
|
1777
|
+
replyLogger: params.replyLogger,
|
|
1778
|
+
connectionId: params.connectionId,
|
|
1779
|
+
skipLog: false,
|
|
1780
|
+
tableMode
|
|
1781
|
+
});
|
|
1782
|
+
didSendReply = true;
|
|
1783
|
+
const shouldLog = payload.text ? true : void 0;
|
|
1784
|
+
params.rememberSentText(payload.text, {
|
|
1785
|
+
combinedBody,
|
|
1786
|
+
combinedBodySessionKey: params.route.sessionKey,
|
|
1787
|
+
logVerboseMessage: shouldLog
|
|
1788
|
+
});
|
|
1789
|
+
const fromDisplay = params.msg.chatType === "group" ? conversationId : params.msg.from ?? "unknown";
|
|
1790
|
+
const hasMedia = Boolean(payload.mediaUrl || payload.mediaUrls?.length);
|
|
1791
|
+
whatsappOutboundLog.info(`Auto-replied to ${fromDisplay}${hasMedia ? " (media)" : ""}`);
|
|
1792
|
+
if (shouldLogVerbose()) {
|
|
1793
|
+
const preview = payload.text != null ? elide(payload.text, 400) : "<media>";
|
|
1794
|
+
whatsappOutboundLog.debug(`Reply body: ${preview}${hasMedia ? " (media)" : ""}`);
|
|
1795
|
+
}
|
|
1796
|
+
},
|
|
1797
|
+
onError: (err, info) => {
|
|
1798
|
+
const label = info.kind === "tool" ? "tool update" : info.kind === "block" ? "block update" : "auto-reply";
|
|
1799
|
+
whatsappOutboundLog.error(`Failed sending web ${label} to ${params.msg.from ?? conversationId}: ${formatError(err)}`);
|
|
1800
|
+
},
|
|
1801
|
+
onReplyStart: params.msg.sendComposing
|
|
1802
|
+
},
|
|
1803
|
+
replyOptions: {
|
|
1804
|
+
disableBlockStreaming: true,
|
|
1805
|
+
onModelSelected
|
|
1806
|
+
}
|
|
1807
|
+
});
|
|
1808
|
+
if (!queuedFinal) {
|
|
1809
|
+
if (shouldClearGroupHistory) params.groupHistories.set(params.groupHistoryKey, []);
|
|
1810
|
+
logVerbose("Skipping auto-reply: silent token or no text/media returned from resolver");
|
|
1811
|
+
return false;
|
|
1812
|
+
}
|
|
1813
|
+
if (shouldClearGroupHistory) params.groupHistories.set(params.groupHistoryKey, []);
|
|
1814
|
+
return didSendReply;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
//#endregion
|
|
1818
|
+
//#region src/web/auto-reply/monitor/on-message.ts
|
|
1819
|
+
function createWebOnMessageHandler(params) {
|
|
1820
|
+
const processForRoute = async (msg, route, groupHistoryKey, opts) => processMessage({
|
|
1821
|
+
cfg: params.cfg,
|
|
1822
|
+
msg,
|
|
1823
|
+
route,
|
|
1824
|
+
groupHistoryKey,
|
|
1825
|
+
groupHistories: params.groupHistories,
|
|
1826
|
+
groupMemberNames: params.groupMemberNames,
|
|
1827
|
+
connectionId: params.connectionId,
|
|
1828
|
+
verbose: params.verbose,
|
|
1829
|
+
maxMediaBytes: params.maxMediaBytes,
|
|
1830
|
+
replyResolver: params.replyResolver,
|
|
1831
|
+
replyLogger: params.replyLogger,
|
|
1832
|
+
backgroundTasks: params.backgroundTasks,
|
|
1833
|
+
rememberSentText: params.echoTracker.rememberText,
|
|
1834
|
+
echoHas: params.echoTracker.has,
|
|
1835
|
+
echoForget: params.echoTracker.forget,
|
|
1836
|
+
buildCombinedEchoKey: params.echoTracker.buildCombinedKey,
|
|
1837
|
+
groupHistory: opts?.groupHistory,
|
|
1838
|
+
suppressGroupHistoryClear: opts?.suppressGroupHistoryClear
|
|
1839
|
+
});
|
|
1840
|
+
return async (msg) => {
|
|
1841
|
+
const conversationId = msg.conversationId ?? msg.from;
|
|
1842
|
+
const peerId = resolvePeerId(msg);
|
|
1843
|
+
const route = resolveAgentRoute({
|
|
1844
|
+
cfg: loadConfig(),
|
|
1845
|
+
channel: "whatsapp",
|
|
1846
|
+
accountId: msg.accountId,
|
|
1847
|
+
peer: {
|
|
1848
|
+
kind: msg.chatType === "group" ? "group" : "direct",
|
|
1849
|
+
id: peerId
|
|
1850
|
+
}
|
|
1851
|
+
});
|
|
1852
|
+
const groupHistoryKey = msg.chatType === "group" ? buildGroupHistoryKey({
|
|
1853
|
+
channel: "whatsapp",
|
|
1854
|
+
accountId: route.accountId,
|
|
1855
|
+
peerKind: "group",
|
|
1856
|
+
peerId
|
|
1857
|
+
}) : route.sessionKey;
|
|
1858
|
+
if (msg.from === msg.to) logVerbose(`📱 Same-phone mode detected (from === to: ${msg.from})`);
|
|
1859
|
+
if (params.echoTracker.has(msg.body)) {
|
|
1860
|
+
logVerbose("Skipping auto-reply: detected echo (message matches recently sent text)");
|
|
1861
|
+
params.echoTracker.forget(msg.body);
|
|
1862
|
+
return;
|
|
1863
|
+
}
|
|
1864
|
+
if (msg.chatType === "group") {
|
|
1865
|
+
const metaCtx = {
|
|
1866
|
+
From: msg.from,
|
|
1867
|
+
To: msg.to,
|
|
1868
|
+
SessionKey: route.sessionKey,
|
|
1869
|
+
AccountId: route.accountId,
|
|
1870
|
+
ChatType: msg.chatType,
|
|
1871
|
+
ConversationLabel: conversationId,
|
|
1872
|
+
GroupSubject: msg.groupSubject,
|
|
1873
|
+
SenderName: msg.senderName,
|
|
1874
|
+
SenderId: msg.senderJid?.trim() || msg.senderE164,
|
|
1875
|
+
SenderE164: msg.senderE164,
|
|
1876
|
+
Provider: "whatsapp",
|
|
1877
|
+
Surface: "whatsapp",
|
|
1878
|
+
OriginatingChannel: "whatsapp",
|
|
1879
|
+
OriginatingTo: conversationId
|
|
1880
|
+
};
|
|
1881
|
+
updateLastRouteInBackground({
|
|
1882
|
+
cfg: params.cfg,
|
|
1883
|
+
backgroundTasks: params.backgroundTasks,
|
|
1884
|
+
storeAgentId: route.agentId,
|
|
1885
|
+
sessionKey: route.sessionKey,
|
|
1886
|
+
channel: "whatsapp",
|
|
1887
|
+
to: conversationId,
|
|
1888
|
+
accountId: route.accountId,
|
|
1889
|
+
ctx: metaCtx,
|
|
1890
|
+
warn: params.replyLogger.warn.bind(params.replyLogger)
|
|
1891
|
+
});
|
|
1892
|
+
if (!applyGroupGating({
|
|
1893
|
+
cfg: params.cfg,
|
|
1894
|
+
msg,
|
|
1895
|
+
conversationId,
|
|
1896
|
+
groupHistoryKey,
|
|
1897
|
+
agentId: route.agentId,
|
|
1898
|
+
sessionKey: route.sessionKey,
|
|
1899
|
+
baseMentionConfig: params.baseMentionConfig,
|
|
1900
|
+
authDir: params.account.authDir,
|
|
1901
|
+
groupHistories: params.groupHistories,
|
|
1902
|
+
groupHistoryLimit: params.groupHistoryLimit,
|
|
1903
|
+
groupMemberNames: params.groupMemberNames,
|
|
1904
|
+
logVerbose,
|
|
1905
|
+
replyLogger: params.replyLogger
|
|
1906
|
+
}).shouldProcess) return;
|
|
1907
|
+
} else if (!msg.senderE164 && peerId && peerId.startsWith("+")) msg.senderE164 = normalizeE164(peerId) ?? msg.senderE164;
|
|
1908
|
+
if (await maybeBroadcastMessage({
|
|
1909
|
+
cfg: params.cfg,
|
|
1910
|
+
msg,
|
|
1911
|
+
peerId,
|
|
1912
|
+
route,
|
|
1913
|
+
groupHistoryKey,
|
|
1914
|
+
groupHistories: params.groupHistories,
|
|
1915
|
+
processMessage: processForRoute
|
|
1916
|
+
})) return;
|
|
1917
|
+
await processForRoute(msg, route, groupHistoryKey);
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
//#endregion
|
|
1922
|
+
//#region src/web/auto-reply/monitor.ts
|
|
1923
|
+
function isNonRetryableWebCloseStatus(statusCode) {
|
|
1924
|
+
return statusCode === 440;
|
|
1925
|
+
}
|
|
1926
|
+
async function monitorWebChannel(verbose, listenerFactory = monitorWebInbox, keepAlive = true, replyResolver = getReplyFromConfig, runtime = defaultRuntime, abortSignal, tuning = {}) {
|
|
1927
|
+
const runId = newConnectionId();
|
|
1928
|
+
const replyLogger = getChildLogger({
|
|
1929
|
+
module: "web-auto-reply",
|
|
1930
|
+
runId
|
|
1931
|
+
});
|
|
1932
|
+
const heartbeatLogger = getChildLogger({
|
|
1933
|
+
module: "web-heartbeat",
|
|
1934
|
+
runId
|
|
1935
|
+
});
|
|
1936
|
+
const reconnectLogger = getChildLogger({
|
|
1937
|
+
module: "web-reconnect",
|
|
1938
|
+
runId
|
|
1939
|
+
});
|
|
1940
|
+
const status = {
|
|
1941
|
+
running: true,
|
|
1942
|
+
connected: false,
|
|
1943
|
+
reconnectAttempts: 0,
|
|
1944
|
+
lastConnectedAt: null,
|
|
1945
|
+
lastDisconnect: null,
|
|
1946
|
+
lastMessageAt: null,
|
|
1947
|
+
lastEventAt: null,
|
|
1948
|
+
lastError: null
|
|
1949
|
+
};
|
|
1950
|
+
const emitStatus = () => {
|
|
1951
|
+
tuning.statusSink?.({
|
|
1952
|
+
...status,
|
|
1953
|
+
lastDisconnect: status.lastDisconnect ? { ...status.lastDisconnect } : null
|
|
1954
|
+
});
|
|
1955
|
+
};
|
|
1956
|
+
emitStatus();
|
|
1957
|
+
const baseCfg = loadConfig();
|
|
1958
|
+
const account = resolveWhatsAppAccount({
|
|
1959
|
+
cfg: baseCfg,
|
|
1960
|
+
accountId: tuning.accountId
|
|
1961
|
+
});
|
|
1962
|
+
const cfg = {
|
|
1963
|
+
...baseCfg,
|
|
1964
|
+
channels: {
|
|
1965
|
+
...baseCfg.channels,
|
|
1966
|
+
whatsapp: {
|
|
1967
|
+
...baseCfg.channels?.whatsapp,
|
|
1968
|
+
ackReaction: account.ackReaction,
|
|
1969
|
+
messagePrefix: account.messagePrefix,
|
|
1970
|
+
allowFrom: account.allowFrom,
|
|
1971
|
+
groupAllowFrom: account.groupAllowFrom,
|
|
1972
|
+
groupPolicy: account.groupPolicy,
|
|
1973
|
+
textChunkLimit: account.textChunkLimit,
|
|
1974
|
+
chunkMode: account.chunkMode,
|
|
1975
|
+
mediaMaxMb: account.mediaMaxMb,
|
|
1976
|
+
blockStreaming: account.blockStreaming,
|
|
1977
|
+
groups: account.groups
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
};
|
|
1981
|
+
const configuredMaxMb = cfg.agents?.defaults?.mediaMaxMb;
|
|
1982
|
+
const maxMediaBytes = typeof configuredMaxMb === "number" && configuredMaxMb > 0 ? configuredMaxMb * 1024 * 1024 : DEFAULT_WEB_MEDIA_BYTES;
|
|
1983
|
+
const heartbeatSeconds = resolveHeartbeatSeconds(cfg, tuning.heartbeatSeconds);
|
|
1984
|
+
const reconnectPolicy = resolveReconnectPolicy(cfg, tuning.reconnect);
|
|
1985
|
+
const baseMentionConfig = buildMentionConfig(cfg);
|
|
1986
|
+
const groupHistoryLimit = cfg.channels?.whatsapp?.accounts?.[tuning.accountId ?? ""]?.historyLimit ?? cfg.channels?.whatsapp?.historyLimit ?? cfg.messages?.groupChat?.historyLimit ?? DEFAULT_GROUP_HISTORY_LIMIT;
|
|
1987
|
+
const groupHistories = /* @__PURE__ */ new Map();
|
|
1988
|
+
const groupMemberNames = /* @__PURE__ */ new Map();
|
|
1989
|
+
const echoTracker = createEchoTracker({
|
|
1990
|
+
maxItems: 100,
|
|
1991
|
+
logVerbose
|
|
1992
|
+
});
|
|
1993
|
+
const sleep = tuning.sleep ?? ((ms, signal) => sleepWithAbort(ms, signal ?? abortSignal));
|
|
1994
|
+
const stopRequested = () => abortSignal?.aborted === true;
|
|
1995
|
+
const abortPromise = abortSignal && new Promise((resolve) => abortSignal.addEventListener("abort", () => resolve("aborted"), { once: true }));
|
|
1996
|
+
const currentMaxListeners = process.getMaxListeners?.() ?? 10;
|
|
1997
|
+
if (process.setMaxListeners && currentMaxListeners < 50) process.setMaxListeners(50);
|
|
1998
|
+
let sigintStop = false;
|
|
1999
|
+
const handleSigint = () => {
|
|
2000
|
+
sigintStop = true;
|
|
2001
|
+
};
|
|
2002
|
+
process.once("SIGINT", handleSigint);
|
|
2003
|
+
let reconnectAttempts = 0;
|
|
2004
|
+
while (true) {
|
|
2005
|
+
if (stopRequested()) break;
|
|
2006
|
+
const connectionId = newConnectionId();
|
|
2007
|
+
const startedAt = Date.now();
|
|
2008
|
+
let heartbeat = null;
|
|
2009
|
+
let watchdogTimer = null;
|
|
2010
|
+
let lastMessageAt = null;
|
|
2011
|
+
let handledMessages = 0;
|
|
2012
|
+
let unregisterUnhandled = null;
|
|
2013
|
+
const MESSAGE_TIMEOUT_MS = tuning.messageTimeoutMs ?? 1800 * 1e3;
|
|
2014
|
+
const WATCHDOG_CHECK_MS = tuning.watchdogCheckMs ?? 60 * 1e3;
|
|
2015
|
+
const backgroundTasks = /* @__PURE__ */ new Set();
|
|
2016
|
+
const onMessage = createWebOnMessageHandler({
|
|
2017
|
+
cfg,
|
|
2018
|
+
verbose,
|
|
2019
|
+
connectionId,
|
|
2020
|
+
maxMediaBytes,
|
|
2021
|
+
groupHistoryLimit,
|
|
2022
|
+
groupHistories,
|
|
2023
|
+
groupMemberNames,
|
|
2024
|
+
echoTracker,
|
|
2025
|
+
backgroundTasks,
|
|
2026
|
+
replyResolver: replyResolver ?? getReplyFromConfig,
|
|
2027
|
+
replyLogger,
|
|
2028
|
+
baseMentionConfig,
|
|
2029
|
+
account
|
|
2030
|
+
});
|
|
2031
|
+
const inboundDebounceMs = resolveInboundDebounceMs({
|
|
2032
|
+
cfg,
|
|
2033
|
+
channel: "whatsapp"
|
|
2034
|
+
});
|
|
2035
|
+
const shouldDebounce = (msg) => {
|
|
2036
|
+
if (msg.mediaPath || msg.mediaType) return false;
|
|
2037
|
+
if (msg.location) return false;
|
|
2038
|
+
if (msg.replyToId || msg.replyToBody) return false;
|
|
2039
|
+
return !hasControlCommand(msg.body, cfg);
|
|
2040
|
+
};
|
|
2041
|
+
const listener = await (listenerFactory ?? monitorWebInbox)({
|
|
2042
|
+
verbose,
|
|
2043
|
+
accountId: account.accountId,
|
|
2044
|
+
authDir: account.authDir,
|
|
2045
|
+
mediaMaxMb: account.mediaMaxMb,
|
|
2046
|
+
sendReadReceipts: account.sendReadReceipts,
|
|
2047
|
+
debounceMs: inboundDebounceMs,
|
|
2048
|
+
shouldDebounce,
|
|
2049
|
+
onMessage: async (msg) => {
|
|
2050
|
+
handledMessages += 1;
|
|
2051
|
+
lastMessageAt = Date.now();
|
|
2052
|
+
status.lastMessageAt = lastMessageAt;
|
|
2053
|
+
status.lastEventAt = lastMessageAt;
|
|
2054
|
+
emitStatus();
|
|
2055
|
+
await onMessage(msg);
|
|
2056
|
+
}
|
|
2057
|
+
});
|
|
2058
|
+
status.connected = true;
|
|
2059
|
+
status.lastConnectedAt = Date.now();
|
|
2060
|
+
status.lastEventAt = status.lastConnectedAt;
|
|
2061
|
+
status.lastError = null;
|
|
2062
|
+
emitStatus();
|
|
2063
|
+
const { e164: selfE164 } = readWebSelfId(account.authDir);
|
|
2064
|
+
const connectRoute = resolveAgentRoute({
|
|
2065
|
+
cfg,
|
|
2066
|
+
channel: "whatsapp",
|
|
2067
|
+
accountId: account.accountId
|
|
2068
|
+
});
|
|
2069
|
+
enqueueSystemEvent(`WhatsApp gateway connected${selfE164 ? ` as ${selfE164}` : ""}.`, { sessionKey: connectRoute.sessionKey });
|
|
2070
|
+
setActiveWebListener(account.accountId, listener);
|
|
2071
|
+
unregisterUnhandled = registerUnhandledRejectionHandler((reason) => {
|
|
2072
|
+
if (!isLikelyWhatsAppCryptoError(reason)) return false;
|
|
2073
|
+
const errorStr = formatError(reason);
|
|
2074
|
+
reconnectLogger.warn({
|
|
2075
|
+
connectionId,
|
|
2076
|
+
error: errorStr
|
|
2077
|
+
}, "web reconnect: unhandled rejection from WhatsApp socket; forcing reconnect");
|
|
2078
|
+
listener.signalClose?.({
|
|
2079
|
+
status: 499,
|
|
2080
|
+
isLoggedOut: false,
|
|
2081
|
+
error: reason
|
|
2082
|
+
});
|
|
2083
|
+
return true;
|
|
2084
|
+
});
|
|
2085
|
+
const closeListener = async () => {
|
|
2086
|
+
setActiveWebListener(account.accountId, null);
|
|
2087
|
+
if (unregisterUnhandled) {
|
|
2088
|
+
unregisterUnhandled();
|
|
2089
|
+
unregisterUnhandled = null;
|
|
2090
|
+
}
|
|
2091
|
+
if (heartbeat) clearInterval(heartbeat);
|
|
2092
|
+
if (watchdogTimer) clearInterval(watchdogTimer);
|
|
2093
|
+
if (backgroundTasks.size > 0) {
|
|
2094
|
+
await Promise.allSettled(backgroundTasks);
|
|
2095
|
+
backgroundTasks.clear();
|
|
2096
|
+
}
|
|
2097
|
+
try {
|
|
2098
|
+
await listener.close();
|
|
2099
|
+
} catch (err) {
|
|
2100
|
+
logVerbose(`Socket close failed: ${formatError(err)}`);
|
|
2101
|
+
}
|
|
2102
|
+
};
|
|
2103
|
+
if (keepAlive) {
|
|
2104
|
+
heartbeat = setInterval(() => {
|
|
2105
|
+
const authAgeMs = getWebAuthAgeMs(account.authDir);
|
|
2106
|
+
const minutesSinceLastMessage = lastMessageAt ? Math.floor((Date.now() - lastMessageAt) / 6e4) : null;
|
|
2107
|
+
const logData = {
|
|
2108
|
+
connectionId,
|
|
2109
|
+
reconnectAttempts,
|
|
2110
|
+
messagesHandled: handledMessages,
|
|
2111
|
+
lastMessageAt,
|
|
2112
|
+
authAgeMs,
|
|
2113
|
+
uptimeMs: Date.now() - startedAt,
|
|
2114
|
+
...minutesSinceLastMessage !== null && minutesSinceLastMessage > 30 ? { minutesSinceLastMessage } : {}
|
|
2115
|
+
};
|
|
2116
|
+
if (minutesSinceLastMessage && minutesSinceLastMessage > 30) heartbeatLogger.warn(logData, "⚠️ web gateway heartbeat - no messages in 30+ minutes");
|
|
2117
|
+
else heartbeatLogger.info(logData, "web gateway heartbeat");
|
|
2118
|
+
}, heartbeatSeconds * 1e3);
|
|
2119
|
+
watchdogTimer = setInterval(() => {
|
|
2120
|
+
if (!lastMessageAt) return;
|
|
2121
|
+
const timeSinceLastMessage = Date.now() - lastMessageAt;
|
|
2122
|
+
if (timeSinceLastMessage <= MESSAGE_TIMEOUT_MS) return;
|
|
2123
|
+
const minutesSinceLastMessage = Math.floor(timeSinceLastMessage / 6e4);
|
|
2124
|
+
heartbeatLogger.warn({
|
|
2125
|
+
connectionId,
|
|
2126
|
+
minutesSinceLastMessage,
|
|
2127
|
+
lastMessageAt: new Date(lastMessageAt),
|
|
2128
|
+
messagesHandled: handledMessages
|
|
2129
|
+
}, "Message timeout detected - forcing reconnect");
|
|
2130
|
+
whatsappHeartbeatLog.warn(`No messages received in ${minutesSinceLastMessage}m - restarting connection`);
|
|
2131
|
+
closeListener().catch((err) => {
|
|
2132
|
+
logVerbose(`Close listener failed: ${formatError(err)}`);
|
|
2133
|
+
});
|
|
2134
|
+
listener.signalClose?.({
|
|
2135
|
+
status: 499,
|
|
2136
|
+
isLoggedOut: false,
|
|
2137
|
+
error: "watchdog-timeout"
|
|
2138
|
+
});
|
|
2139
|
+
}, WATCHDOG_CHECK_MS);
|
|
2140
|
+
}
|
|
2141
|
+
whatsappLog.info("Listening for personal WhatsApp inbound messages.");
|
|
2142
|
+
if (process.stdout.isTTY || process.stderr.isTTY) whatsappLog.raw("Ctrl+C to stop.");
|
|
2143
|
+
if (!keepAlive) {
|
|
2144
|
+
await closeListener();
|
|
2145
|
+
process.removeListener("SIGINT", handleSigint);
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
const reason = await Promise.race([listener.onClose?.catch((err) => {
|
|
2149
|
+
reconnectLogger.error({ error: formatError(err) }, "listener.onClose rejected");
|
|
2150
|
+
return {
|
|
2151
|
+
status: 500,
|
|
2152
|
+
isLoggedOut: false,
|
|
2153
|
+
error: err
|
|
2154
|
+
};
|
|
2155
|
+
}) ?? waitForever(), abortPromise ?? waitForever()]);
|
|
2156
|
+
if (Date.now() - startedAt > heartbeatSeconds * 1e3) reconnectAttempts = 0;
|
|
2157
|
+
status.reconnectAttempts = reconnectAttempts;
|
|
2158
|
+
emitStatus();
|
|
2159
|
+
if (stopRequested() || sigintStop || reason === "aborted") {
|
|
2160
|
+
await closeListener();
|
|
2161
|
+
break;
|
|
2162
|
+
}
|
|
2163
|
+
const statusCode = (typeof reason === "object" && reason && "status" in reason ? reason.status : void 0) ?? "unknown";
|
|
2164
|
+
const loggedOut = typeof reason === "object" && reason && "isLoggedOut" in reason && reason.isLoggedOut;
|
|
2165
|
+
const errorStr = formatError(reason);
|
|
2166
|
+
status.connected = false;
|
|
2167
|
+
status.lastEventAt = Date.now();
|
|
2168
|
+
status.lastDisconnect = {
|
|
2169
|
+
at: status.lastEventAt,
|
|
2170
|
+
status: typeof statusCode === "number" ? statusCode : void 0,
|
|
2171
|
+
error: errorStr,
|
|
2172
|
+
loggedOut: Boolean(loggedOut)
|
|
2173
|
+
};
|
|
2174
|
+
status.lastError = errorStr;
|
|
2175
|
+
status.reconnectAttempts = reconnectAttempts;
|
|
2176
|
+
emitStatus();
|
|
2177
|
+
reconnectLogger.info({
|
|
2178
|
+
connectionId,
|
|
2179
|
+
status: statusCode,
|
|
2180
|
+
loggedOut,
|
|
2181
|
+
reconnectAttempts,
|
|
2182
|
+
error: errorStr
|
|
2183
|
+
}, "web reconnect: connection closed");
|
|
2184
|
+
enqueueSystemEvent(`WhatsApp gateway disconnected (status ${statusCode ?? "unknown"})`, { sessionKey: connectRoute.sessionKey });
|
|
2185
|
+
if (loggedOut) {
|
|
2186
|
+
runtime.error(`WhatsApp session logged out. Run \`${formatCliCommand("fased channels login --channel web")}\` to relink.`);
|
|
2187
|
+
await closeListener();
|
|
2188
|
+
break;
|
|
2189
|
+
}
|
|
2190
|
+
if (isNonRetryableWebCloseStatus(statusCode)) {
|
|
2191
|
+
reconnectLogger.warn({
|
|
2192
|
+
connectionId,
|
|
2193
|
+
status: statusCode,
|
|
2194
|
+
error: errorStr
|
|
2195
|
+
}, "web reconnect: non-retryable close status; stopping monitor");
|
|
2196
|
+
runtime.error(`WhatsApp Web connection closed (status ${statusCode}: session conflict). Resolve conflicting WhatsApp Web sessions, then relink with \`${formatCliCommand("fased channels login --channel web")}\`. Stopping web monitoring.`);
|
|
2197
|
+
await closeListener();
|
|
2198
|
+
break;
|
|
2199
|
+
}
|
|
2200
|
+
reconnectAttempts += 1;
|
|
2201
|
+
status.reconnectAttempts = reconnectAttempts;
|
|
2202
|
+
emitStatus();
|
|
2203
|
+
if (reconnectPolicy.maxAttempts > 0 && reconnectAttempts >= reconnectPolicy.maxAttempts) {
|
|
2204
|
+
reconnectLogger.warn({
|
|
2205
|
+
connectionId,
|
|
2206
|
+
status: statusCode,
|
|
2207
|
+
reconnectAttempts,
|
|
2208
|
+
maxAttempts: reconnectPolicy.maxAttempts
|
|
2209
|
+
}, "web reconnect: max attempts reached; continuing in degraded mode");
|
|
2210
|
+
runtime.error(`WhatsApp Web reconnect: max attempts reached (${reconnectAttempts}/${reconnectPolicy.maxAttempts}). Stopping web monitoring.`);
|
|
2211
|
+
await closeListener();
|
|
2212
|
+
break;
|
|
2213
|
+
}
|
|
2214
|
+
const delay = computeBackoff(reconnectPolicy, reconnectAttempts);
|
|
2215
|
+
reconnectLogger.info({
|
|
2216
|
+
connectionId,
|
|
2217
|
+
status: statusCode,
|
|
2218
|
+
reconnectAttempts,
|
|
2219
|
+
maxAttempts: reconnectPolicy.maxAttempts || "unlimited",
|
|
2220
|
+
delayMs: delay
|
|
2221
|
+
}, "web reconnect: scheduling retry");
|
|
2222
|
+
runtime.error(`WhatsApp Web connection closed (status ${statusCode}). Retry ${reconnectAttempts}/${reconnectPolicy.maxAttempts || "∞"} in ${formatDurationPrecise(delay)}… (${errorStr})`);
|
|
2223
|
+
await closeListener();
|
|
2224
|
+
try {
|
|
2225
|
+
await sleep(delay, abortSignal);
|
|
2226
|
+
} catch {
|
|
2227
|
+
break;
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
status.running = false;
|
|
2231
|
+
status.connected = false;
|
|
2232
|
+
status.lastEventAt = Date.now();
|
|
2233
|
+
emitStatus();
|
|
2234
|
+
process.removeListener("SIGINT", handleSigint);
|
|
2235
|
+
}
|
|
2236
|
+
|
|
2237
|
+
//#endregion
|
|
2238
|
+
export { WA_WEB_AUTH_DIR, createWaSocket, logWebSelfId, loginWeb, monitorWebChannel, monitorWebInbox, pickWebChannel, sendMessageWhatsApp, waitForWaConnection, webAuthExists };
|