stableclaw 2026.5.0 → 2026.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.buildstamp +1 -1
- package/dist/abort-DbOWfk1R.js +192 -0
- package/dist/abort-cutoff.runtime-ZDeu_mNv.js +20 -0
- package/dist/abort-cutoff.runtime.js +1 -1
- package/dist/abort.runtime-DzSEcqwd.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/access-control-ChkJvEGP.js +152 -0
- package/dist/account-inspect-DCKRZRny.js +158 -0
- package/dist/accounts-BGTN7cr-.js +102 -0
- package/dist/accounts-CinolZTU.js +107 -0
- package/dist/accounts-CkhyYlS6.js +137 -0
- package/dist/accounts-D219ghr6.js +57 -0
- package/dist/accounts-DrggbKcd.js +2 -0
- package/dist/acp-runtime-_pYPcJEH.js +8 -0
- package/dist/acp-stateful-target-driver-BEIUsg83.js +60 -0
- package/dist/action-runtime-CJhBKfDC.js +318 -0
- package/dist/action-runtime-NLKQbAQA.js +72 -0
- package/dist/action-runtime-api-YzbQ4Qy6.js +1028 -0
- package/dist/actions-BrAcUNm-.js +531 -0
- package/dist/actions.runtime-BwB4CvxW.js +2 -0
- package/dist/actions.runtime-CiYUOMp1.js +18 -0
- package/dist/actions.runtime-SFl3LXbz.js +5 -0
- package/dist/actions.runtime.js +1 -1
- package/dist/agent-CdYMZ9fr.js +2 -0
- package/dist/agent-command-wY0aEiLZ.js +1457 -0
- package/dist/agent-runner.runtime-BJYxz_AG.js +2241 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agent-runtime-Cm6WYH1X.js +142 -0
- package/dist/agent-tools-login-Bd1V75kh.js +57 -0
- package/dist/agents-IbQmK8Yn.js +888 -0
- package/dist/agents-MrSC-Up6.js +5 -0
- package/dist/api-BQHk-t06.js +5 -0
- package/dist/api-Bmx0BK0F.js +5 -0
- package/dist/api-CJIpnZrc.js +10 -0
- package/dist/api-CRhMGxLB.js +6 -0
- package/dist/api-CdYIiak82.js +322 -0
- package/dist/api-DOdPShPk.js +2 -0
- package/dist/api-jI3BtiNB.js +2 -0
- package/dist/apply-Cbt003x7.js +485 -0
- package/dist/apply.runtime-CY47EbzA.js +2 -0
- package/dist/apply.runtime.js +1 -1
- package/dist/approval-native-B4HJRa55.js +79 -0
- package/dist/approval-runtime-B6PXavdQ.js +262 -0
- package/dist/assistant-identity-CeKI09AJ.js +74 -0
- package/dist/attachment-normalize-BZdNI2So.js +921 -0
- package/dist/audit-BLq9P3oA.js +86 -0
- package/dist/audit-DtlsDuaM.js +892 -0
- package/dist/audit-channel.allow-from.runtime.js +1 -1
- package/dist/audit-channel.collect.runtime-CTutyCbl.js +528 -0
- package/dist/audit-channel.collect.runtime.js +1 -1
- package/dist/audit-channel.discord.runtime.js +1 -1
- package/dist/audit-channel.telegram.runtime-DgjqHj_y.js +8 -0
- package/dist/audit-channel.telegram.runtime.js +1 -1
- package/dist/audit-channel.zalouser.runtime.js +1 -1
- package/dist/audit-extra.async-azTwi9Ii.js +820 -0
- package/dist/audit.deep.runtime-DczMVmZl.js +2 -0
- package/dist/audit.deep.runtime.js +1 -1
- package/dist/audit.nondeep.runtime-C0-gevdg.js +831 -0
- package/dist/audit.nondeep.runtime.js +1 -1
- package/dist/audit.runtime-CjmP-IVf.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-D9R9vTdP.js +181 -0
- package/dist/auth-choice-ASVf3uqH.js +3 -0
- package/dist/auth-choice-CUGc7jRT.js +341 -0
- package/dist/auth-choice-TdFpgqf8.js +69 -0
- package/dist/binding-targets-BB736PNg.js +99 -0
- package/dist/bot-i7rkFnoU.js +4268 -0
- package/dist/bot-message-context-NjuZxwNf.js +2 -0
- package/dist/bot-message-context-SFoFcMU0.js +1175 -0
- package/dist/bot-message-context.runtime-BuHjCi1s.js +7 -0
- package/dist/bot-message-context.runtime.js +1 -1
- package/dist/bot-message-context.session.runtime-BOjKvTjg.js +12 -0
- package/dist/bot-message-context.session.runtime.js +1 -1
- package/dist/bot-native-commands.delivery.runtime-CMVcyVfr.js +3 -0
- package/dist/bot-native-commands.delivery.runtime.js +1 -1
- package/dist/bot-native-commands.runtime-DPXiZ-g-.js +11 -0
- package/dist/bot-native-commands.runtime.js +1 -1
- package/dist/bundled/boot-md/handler.js +3 -3
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/channel-6JSPqz3S.js +599 -0
- package/dist/channel-8fxnaoxA.js +1135 -0
- package/dist/channel-BGr4lB_p.js +208 -0
- package/dist/channel-BRZOhpO-.js +1217 -0
- package/dist/channel-BTaI9Vsm.js +454 -0
- package/dist/channel-BuvbHCUl.js +800 -0
- package/dist/channel-C0kxZQ7E.js +883 -0
- package/dist/channel-CJgXhuIs.js +698 -0
- package/dist/channel-DQWDH71E.js +337 -0
- package/dist/channel-DqywfjHt.js +361 -0
- package/dist/channel-inbound-BbIwjinv.js +30 -0
- package/dist/channel-o7dERoVP.js +1129 -0
- package/dist/channel-ouAyZmKb.js +788 -0
- package/dist/channel-pGQXHihG.js +783 -0
- package/dist/channel-plugin-resolution-E1W_efdm.js +144 -0
- package/dist/channel-qw2GU-78.js +1661 -0
- package/dist/channel-shared-DsqgfMVz.js +58 -0
- package/dist/channel-x8EJXY-p.js +4976 -0
- package/dist/channel.runtime-9U-FzlTX.js +22252 -0
- package/dist/channel.runtime-CDRgtalS.js +309 -0
- package/dist/channel.runtime-CrTb-acp.js +373 -0
- package/dist/channel.runtime-CvUJhEWE.js +14 -0
- package/dist/channel.runtime-D86obE0J.js +108 -0
- package/dist/channel.runtime-DR14R1qn.js +125 -0
- package/dist/channel.runtime-DY-t80Mq.js +335 -0
- package/dist/channel.runtime-Db6-JgiT.js +80 -0
- package/dist/channel.setup-5ccX1E-a.js +279 -0
- package/dist/channels-CU1r9oWn.js +1134 -0
- package/dist/channels-cli-H6kLKRCJ.js +246 -0
- package/dist/clawhub-CicQAK3Q.js +163 -0
- package/dist/cli/daemon-cli.js +3 -9
- package/dist/cli-BeJobAfz.js +695 -0
- package/dist/cli-Bw_QTHCD.js +152 -0
- package/dist/cli-migration-DBUl9wOM.js +100 -0
- package/dist/cli-runner-CNdeXILj.js +1014 -0
- package/dist/client-C7KrfnR_.js +5 -0
- package/dist/client-D1IMuN2R.js +7 -0
- package/dist/client-bootstrap-BRL3IJbX.js +2 -0
- package/dist/client-bootstrap-BnU_fgOa.js +121 -0
- package/dist/code-execution-Dy3oNAvz.js +142 -0
- package/dist/command-auth-BoH1IkmW.js +64 -0
- package/dist/command-registry-CFUnlk3Y.js +199 -0
- package/dist/command-registry-Dy7lErHE.js +3 -0
- package/dist/commands-P7L4abaE.js +4 -0
- package/dist/commands-acp-CRBC84-r.js +990 -0
- package/dist/commands-core-DfVd-xq7.js +241 -0
- package/dist/commands-core.runtime-CCF1BiL7.js +2 -0
- package/dist/commands-core.runtime.js +1 -1
- package/dist/commands-handlers.runtime-BWoNwBZE.js +3708 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-info-CSt3aoRZ.js +651 -0
- package/dist/commands-models-FgUB1hGv.js +395 -0
- package/dist/commands-status.runtime-jcqPwtM3.js +2 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands.runtime-CIbt20JL.js +4 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/compact.runtime-DKdAjeMZ.js +7 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-7xXpXxID.js +2 -0
- package/dist/completion-cli-Csbpl09N.js +466 -0
- package/dist/config-BGW2qyLw.js +475 -0
- package/dist/config-cli--4OexF6J.js +945 -0
- package/dist/config-guard-V5IAh_mF.js +113 -0
- package/dist/config-runtime-D208l2BL.js +13 -0
- package/dist/config-secret-input.runtime-BF9IBBeM.js +3 -0
- package/dist/config-secret-input.runtime.js +1 -1
- package/dist/config-update-BBzrkxal.js +127 -0
- package/dist/config-update-DrtP_s0Y.js +3 -0
- package/dist/configure-B5cJf26V.js +2 -0
- package/dist/configure-Ts01pF4g.js +1140 -0
- package/dist/context-DeDQINVq.js +227 -0
- package/dist/control-ui-C9vPgc9L.js +388 -0
- package/dist/conversation-bindings-CwHBn1fl.js +210 -0
- package/dist/conversation-id-BOk-dTsl.js +168 -0
- package/dist/conversation-runtime-DvoDx5Lp.js +85 -0
- package/dist/core-_nKe7lGV.js +195 -0
- package/dist/create-client-BenzpBNt.js +2 -0
- package/dist/create-client-CGt4-gcv.js +58 -0
- package/dist/credentials-7IVnN_TF.js +22 -0
- package/dist/credentials-write.runtime-D1VXZncp.js +9 -0
- package/dist/credentials-write.runtime.js +1 -1
- package/dist/crypto-runtime-Y20cyTTx.js +3495 -0
- package/dist/daemon-cli-DvP7I-Uu.js +383 -0
- package/dist/daemon-install-CVIbxBN5.js +63 -0
- package/dist/delegate-VctUvdru.js +43 -0
- package/dist/deliver-DTfKSC4Q.js +954 -0
- package/dist/deliver-LbQQnhR5.js +3 -0
- package/dist/deliver-reply-18sWD8M4.js +238 -0
- package/dist/deliver-runtime-Qg81IeZu.js +2 -0
- package/dist/delivery-D8E92dmQ.js +834 -0
- package/dist/delivery-info-Cls9iWRl.js +40 -0
- package/dist/direct-dm-Dg-rhCG0.js +139 -0
- package/dist/direct-management-CaI85_dA.js +2 -0
- package/dist/direct-management-DjdwL-F4.js +300 -0
- package/dist/directive-handling.fast-lane-3sGyxlH_.js +64 -0
- package/dist/directive-handling.fast-lane-CKe_S3fo.js +2 -0
- package/dist/directive-handling.impl-C1D-MGbp.js +2 -0
- package/dist/directive-handling.impl-Dk6oRN3H.js +672 -0
- package/dist/directive-handling.parse-ni5LIlSW.js +375 -0
- package/dist/directive-handling.persist-DSyJG2Kq.js +133 -0
- package/dist/directive-handling.persist.runtime-WEeAbhJ8.js +2 -0
- package/dist/directive-handling.persist.runtime.js +1 -1
- package/dist/directive-handling.shared-DPXk9T6l.js +158 -0
- package/dist/directory-cli-CL6UudXS.js +238 -0
- package/dist/directory.static-BX7RI4Aq.js +45 -0
- package/dist/discovery-DhEDepjw.js +171 -0
- package/dist/dispatch-acp.runtime-DHUc4MMQ.js +884 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/dispatch-au2t5HsH.js +858 -0
- package/dist/doctor-completion-fD570xvd.js +90 -0
- package/dist/doctor-config-preflight-B0C_HTWN.js +2 -0
- package/dist/doctor-config-preflight-OMEufm7U.js +148 -0
- package/dist/doctor-state-migrations-BJ5M0r8a.js +2 -0
- package/dist/doctor-state-migrations-CPG_ii-i.js +3 -0
- package/dist/embedding-provider-vb6JoF5D.js +129 -0
- package/dist/encryption-guidance-BRY-GWVy.js +33 -0
- package/dist/entry.js +2 -2
- package/dist/error-text-CM5bR2qT.js +24 -0
- package/dist/exec-approval-session-target-Ci45mXNL.js +159 -0
- package/dist/exec-approvals-D9wFcLn9.js +121 -0
- package/dist/extensionAPI.js +3 -3
- package/dist/extensions/acpx/index.js +3 -3
- package/dist/extensions/acpx/runtime-api.js +2 -2
- package/dist/extensions/amazon-bedrock/api.js +2 -2
- package/dist/extensions/amazon-bedrock/discovery.js +1 -1
- package/dist/extensions/amazon-bedrock/index.js +2 -2
- package/dist/extensions/anthropic/cli-migration.js +1 -1
- package/dist/extensions/anthropic/index.js +5 -5
- package/dist/extensions/anthropic/media-understanding-provider.js +1 -1
- package/dist/extensions/bluebubbles/api.js +2 -2
- package/dist/extensions/bluebubbles/index.js +2 -2
- package/dist/extensions/bluebubbles/setup-entry.js +1 -1
- package/dist/extensions/browser/test-support.js +1 -1
- package/dist/extensions/byteplus/index.js +2 -2
- package/dist/extensions/chutes/index.js +4 -4
- package/dist/extensions/cloudflare-ai-gateway/index.js +1 -1
- package/dist/extensions/deepseek/index.js +1 -1
- package/dist/extensions/device-pair/api.js +2 -2
- package/dist/extensions/device-pair/index.js +3 -3
- package/dist/extensions/device-pair/notify.js +1 -1
- package/dist/extensions/device-pair/qr-image.js +2 -2
- package/dist/extensions/diffs/index.js +1 -1
- package/dist/extensions/discord/action-runtime-api.js +1 -1
- package/dist/extensions/discord/api.js +4 -4
- package/dist/extensions/discord/index.js +9 -9
- package/dist/extensions/discord/runtime-api.js +10 -10
- package/dist/extensions/discord/setup-entry.js +2 -2
- package/dist/extensions/discord/test-api.js +3 -3
- package/dist/extensions/fal/index.js +2 -2
- package/dist/extensions/feishu/api.js +2 -2
- package/dist/extensions/feishu/index.js +7 -7
- package/dist/extensions/feishu/setup-api.js +1 -1
- package/dist/extensions/feishu/setup-entry.js +2 -2
- package/dist/extensions/github-copilot/api.js +1 -1
- package/dist/extensions/github-copilot/index.js +2 -2
- package/dist/extensions/github-copilot/login.js +1 -1
- package/dist/extensions/google/index.js +2 -2
- package/dist/extensions/google/media-understanding-provider.js +2 -2
- package/dist/extensions/googlechat/api.js +1 -1
- package/dist/extensions/googlechat/index.js +2 -2
- package/dist/extensions/googlechat/setup-entry.js +2 -2
- package/dist/extensions/googlechat/test-api.js +1 -1
- package/dist/extensions/groq/index.js +1 -1
- package/dist/extensions/groq/media-understanding-provider.js +1 -1
- package/dist/extensions/huggingface/index.js +2 -2
- package/dist/extensions/imessage/api.js +2 -2
- package/dist/extensions/imessage/index.js +7 -7
- package/dist/extensions/imessage/runtime-api.js +2 -2
- package/dist/extensions/imessage/setup-entry.js +3 -3
- package/dist/extensions/irc/api.js +1 -1
- package/dist/extensions/irc/index.js +2 -2
- package/dist/extensions/irc/setup-entry.js +2 -2
- package/dist/extensions/kilocode/index.js +1 -1
- package/dist/extensions/kimi-coding/index.js +2 -2
- package/dist/extensions/line/api.js +4 -4
- package/dist/extensions/line/index.js +5 -5
- package/dist/extensions/line/runtime-api.js +2 -2
- package/dist/extensions/line/setup-api.js +2 -2
- package/dist/extensions/line/setup-entry.js +3 -3
- package/dist/extensions/litellm/index.js +1 -1
- package/dist/extensions/lobster/index.js +1 -1
- package/dist/extensions/lobster/runtime-api.js +1 -1
- package/dist/extensions/matrix/api.js +3 -3
- package/dist/extensions/matrix/index.js +3 -3
- package/dist/extensions/matrix/plugin-entry.handlers.runtime.js +3 -3
- package/dist/extensions/matrix/setup-entry.js +2 -2
- package/dist/extensions/matrix/test-api.js +1 -1
- package/dist/extensions/mattermost/api.js +1 -1
- package/dist/extensions/mattermost/index.js +2 -2
- package/dist/extensions/mattermost/runtime-api.js +4 -4
- package/dist/extensions/mattermost/setup-entry.js +2 -2
- package/dist/extensions/media-understanding-core/runtime-api.js +2 -2
- package/dist/extensions/microsoft/index.js +1 -1
- package/dist/extensions/microsoft/speech-provider.js +1 -1
- package/dist/extensions/microsoft/test-api.js +1 -1
- package/dist/extensions/microsoft-foundry/auth.js +1 -1
- package/dist/extensions/microsoft-foundry/cli.js +1 -1
- package/dist/extensions/microsoft-foundry/index.js +1 -1
- package/dist/extensions/microsoft-foundry/onboard.js +2 -2
- package/dist/extensions/microsoft-foundry/provider.js +1 -1
- package/dist/extensions/microsoft-foundry/runtime.js +1 -1
- package/dist/extensions/microsoft-foundry/shared-runtime.js +2 -2
- package/dist/extensions/microsoft-foundry/shared.js +1 -1
- package/dist/extensions/minimax/index.js +4 -4
- package/dist/extensions/minimax/media-understanding-provider.js +1 -1
- package/dist/extensions/minimax/oauth.js +1 -1
- package/dist/extensions/minimax/oauth.runtime.js +1 -1
- package/dist/extensions/mistral/index.js +2 -2
- package/dist/extensions/mistral/media-understanding-provider.js +1 -1
- package/dist/extensions/modelstudio/index.js +1 -1
- package/dist/extensions/moonshot/index.js +2 -2
- package/dist/extensions/moonshot/media-understanding-provider.js +1 -1
- package/dist/extensions/msteams/api.js +1 -1
- package/dist/extensions/msteams/index.js +3 -3
- package/dist/extensions/msteams/runtime-api.js +4 -4
- package/dist/extensions/msteams/setup-entry.js +2 -2
- package/dist/extensions/msteams/test-api.js +1 -1
- package/dist/extensions/nextcloud-talk/api.js +1 -1
- package/dist/extensions/nextcloud-talk/index.js +2 -2
- package/dist/extensions/nextcloud-talk/runtime-api.js +2 -2
- package/dist/extensions/nextcloud-talk/setup-entry.js +2 -2
- package/dist/extensions/nostr/api.js +3 -3
- package/dist/extensions/nostr/index.js +4 -4
- package/dist/extensions/nostr/runtime-api.js +3 -3
- package/dist/extensions/nostr/setup-api.js +1 -1
- package/dist/extensions/nostr/setup-entry.js +2 -2
- package/dist/extensions/nostr/test-api.js +1 -1
- package/dist/extensions/nvidia/index.js +1 -1
- package/dist/extensions/ollama/api.js +2 -2
- package/dist/extensions/ollama/index.js +3 -3
- package/dist/extensions/ollama/runtime-api.js +2 -2
- package/dist/extensions/openai/api.js +1 -1
- package/dist/extensions/openai/index.js +3 -3
- package/dist/extensions/openai/media-understanding-provider.js +1 -1
- package/dist/extensions/openai/openai-codex-provider.js +1 -1
- package/dist/extensions/openai/openai-provider.js +1 -1
- package/dist/extensions/openai/test-api.js +1 -1
- package/dist/extensions/opencode/index.js +2 -2
- package/dist/extensions/opencode-go/index.js +2 -2
- package/dist/extensions/openrouter/index.js +3 -3
- package/dist/extensions/openrouter/media-understanding-provider.js +1 -1
- package/dist/extensions/openshell/index.js +1 -1
- package/dist/extensions/qianfan/index.js +1 -1
- package/dist/extensions/qqbot/index.js +2 -2
- package/dist/extensions/qqbot/setup-entry.js +2 -2
- package/dist/extensions/signal/api.js +4 -4
- package/dist/extensions/signal/index.js +9 -9
- package/dist/extensions/signal/reaction-runtime-api.js +1 -1
- package/dist/extensions/signal/runtime-api.js +4 -4
- package/dist/extensions/signal/setup-entry.js +2 -2
- package/dist/extensions/signal/test-api.js +4 -4
- package/dist/extensions/slack/api.js +6 -6
- package/dist/extensions/slack/index.js +2 -2
- package/dist/extensions/slack/runtime-api.js +6 -6
- package/dist/extensions/slack/setup-entry.js +2 -2
- package/dist/extensions/slack/test-api.js +4 -4
- package/dist/extensions/stepfun/index.js +2 -2
- package/dist/extensions/synology-chat/index.js +2 -2
- package/dist/extensions/synology-chat/setup-api.js +1 -1
- package/dist/extensions/synology-chat/setup-entry.js +2 -2
- package/dist/extensions/synthetic/index.js +1 -1
- package/dist/extensions/talk-voice/index.js +1 -1
- package/dist/extensions/telegram/api.js +8 -8
- package/dist/extensions/telegram/index.js +2 -2
- package/dist/extensions/telegram/runtime-api.js +8 -8
- package/dist/extensions/telegram/setup-entry.js +3 -3
- package/dist/extensions/telegram/test-api.js +7 -7
- package/dist/extensions/telegram/test-support.js +4 -4
- package/dist/extensions/tlon/index.js +2 -2
- package/dist/extensions/tlon/setup-entry.js +2 -2
- package/dist/extensions/tlon/test-api.js +1 -1
- package/dist/extensions/together/index.js +1 -1
- package/dist/extensions/twitch/index.js +1 -1
- package/dist/extensions/venice/index.js +1 -1
- package/dist/extensions/vercel-ai-gateway/index.js +1 -1
- package/dist/extensions/volcengine/index.js +2 -2
- package/dist/extensions/whatsapp/action-runtime-api.js +1 -1
- package/dist/extensions/whatsapp/action-runtime.runtime.js +1 -1
- package/dist/extensions/whatsapp/api.js +2 -2
- package/dist/extensions/whatsapp/index.js +2 -2
- package/dist/extensions/whatsapp/light-runtime-api.js +1 -1
- package/dist/extensions/whatsapp/login-qr-api.js +1 -1
- package/dist/extensions/whatsapp/runtime-api.js +13 -13
- package/dist/extensions/whatsapp/setup-entry.js +3 -3
- package/dist/extensions/whatsapp/test-api.js +6 -6
- package/dist/extensions/xai/code-execution.js +1 -1
- package/dist/extensions/xai/index.js +4 -4
- package/dist/extensions/xai/x-search.js +1 -1
- package/dist/extensions/xiaomi/index.js +1 -1
- package/dist/extensions/zai/index.js +2 -2
- package/dist/extensions/zai/media-understanding-provider.js +1 -1
- package/dist/extensions/zalo/api.js +2 -2
- package/dist/extensions/zalo/index.js +2 -2
- package/dist/extensions/zalo/runtime-api.js +2 -2
- package/dist/extensions/zalo/setup-entry.js +2 -2
- package/dist/extensions/zalo/test-api.js +1 -1
- package/dist/extensions/zalouser/api.js +1 -1
- package/dist/extensions/zalouser/index.js +10 -10
- package/dist/extensions/zalouser/runtime-api.js +3 -3
- package/dist/extensions/zalouser/setup-entry.js +3 -3
- package/dist/extensions/zalouser/test-api.js +4 -4
- package/dist/format-BN8tV56q.js +817 -0
- package/dist/gateway-CK0mVyJH.js +2575 -0
- package/dist/gateway-cli-BIGurgdT.js +1596 -0
- package/dist/gateway-install-token-CnLiX_Zd.js +230 -0
- package/dist/get-reply-from-config.runtime-DHVxBB-O.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/gmail-watcher-lifecycle-BOSlI4iv.js +2 -0
- package/dist/graph-users-CceVBSPZ.js +918 -0
- package/dist/group-access-Cwl8gW8B.js +32 -0
- package/dist/group-access-DHoGAQFt.js +119 -0
- package/dist/handle-action-BmBnXGdV.js +500 -0
- package/dist/health-CkL8pqV8.js +2 -0
- package/dist/health-DhHzqohg.js +577 -0
- package/dist/heartbeat-runner-N3rkIDfo.js +995 -0
- package/dist/hooks-cli-LfG_KZSu.js +353 -0
- package/dist/http-client-lTUwUVkV.js +294 -0
- package/dist/image-BZJoriob.js +152 -0
- package/dist/image-runtime-V0FuCGlj.js +7 -0
- package/dist/inbound-reply-dispatch-C8za1uEq.js +73 -0
- package/dist/inbound.runtime-BYJ118rE.js +3 -0
- package/dist/inbound.runtime.js +1 -1
- package/dist/index.js +2 -2
- package/dist/infra-runtime-C9fJenAY.js +22 -0
- package/dist/install-BKR6ckWd.js +590 -0
- package/dist/install-security-scan-BWWG9NEd.js +22 -0
- package/dist/install-security-scan.runtime-CNFIn93M.js +299 -0
- package/dist/install-security-scan.runtime.js +1 -1
- package/dist/install.runtime-BKwzESsg.js +11 -0
- package/dist/install.runtime-DrieSb_M.js +27 -0
- package/dist/install.runtime.js +1 -1
- package/dist/irc-DRWT3CQf.js +14 -0
- package/dist/legacy-crypto-restore-CZycrxha.js +85 -0
- package/dist/library-CVZUhyOq.js +44 -0
- package/dist/llm-slug-generator-B79ECeWZ.js +68 -0
- package/dist/llm-slug-generator.js +1 -1
- package/dist/loader-BJO8z2ig.js +2 -0
- package/dist/login-Cs2tMFcs.js +2332 -0
- package/dist/login-GAWpWfxh.js +108 -0
- package/dist/login-qr-CUosF6JZ.js +211 -0
- package/dist/login-qr-api-W1NF3gA_.js +16 -0
- package/dist/manager.runtime-Dmq8R0mb.js +670 -0
- package/dist/manager.runtime.js +1 -1
- package/dist/matrix-DrH1M_Sr.js +351 -0
- package/dist/matrix-runtime-heavy-C6fkT2VX.js +4 -0
- package/dist/mattermost-B9327zl5.js +18 -0
- package/dist/media-CIdwV3Lu.js +1691 -0
- package/dist/media-runtime-QMgMQ3WZ.js +295 -0
- package/dist/media-understanding-C66pUC4U.js +51 -0
- package/dist/media-understanding-provider-BRzfmJfY.js +86 -0
- package/dist/media-understanding-provider-Bd8aZtsH.js +11 -0
- package/dist/media-understanding-provider-By1hanjB.js +16 -0
- package/dist/media-understanding-provider-C6SiAxyT.js +11 -0
- package/dist/media-understanding-provider-DGKwGu0P.js +16 -0
- package/dist/media-understanding-provider-Jlh0zs2Z.js +17 -0
- package/dist/media-understanding-provider-SRUeyQqG.js +28 -0
- package/dist/media-understanding-provider-wimL3kdC.js +11 -0
- package/dist/media-understanding.runtime-BPtAeqrg.js +7 -0
- package/dist/media-understanding.runtime.js +1 -1
- package/dist/message-CzGnK5F3.js +206 -0
- package/dist/message-action-runner-BZ8x9K7O.js +1330 -0
- package/dist/message-handler-gpYZEW_K.js +1771 -0
- package/dist/messages-Xy50Pa2j.js +270 -0
- package/dist/migration-snapshot.runtime-jCZaBq39.js +3 -0
- package/dist/migration-snapshot.runtime.js +1 -1
- package/dist/model-catalog-sx4GaLTc.js +216 -0
- package/dist/model-catalog.runtime-DDSdoGE4.js +2 -0
- package/dist/model-catalog.runtime.js +1 -1
- package/dist/model-picker-CDs8bq1G.js +3 -0
- package/dist/model-picker-bY3x3ppH.js +439 -0
- package/dist/model-runtime-BiWDK2-B.js +1772 -0
- package/dist/model-selection-rJYfkbE0.js +407 -0
- package/dist/models-D5u4cqP1.js +3 -0
- package/dist/models-Xs8Qafsh.js +2550 -0
- package/dist/models-cli-6McdkNo9.js +197 -0
- package/dist/models-config-CAPHcyO2.js +1106 -0
- package/dist/models-config-DABSjBBO.js +2 -0
- package/dist/models-config.runtime-B4-0SSTG.js +2 -0
- package/dist/models-config.runtime.js +1 -1
- package/dist/models-provider-runtime-C0oxGm-e.js +2 -0
- package/dist/monitor-B1P5ei52.js +3622 -0
- package/dist/monitor-B8Q7rxtC.js +666 -0
- package/dist/monitor-B9o5AegX.js +3660 -0
- package/dist/monitor-BSMPXJ97.js +676 -0
- package/dist/monitor-BgD5Jrad.js +4067 -0
- package/dist/monitor-Bzvaap7m.js +1525 -0
- package/dist/monitor-DOHgeQjB.js +687 -0
- package/dist/monitor-auth-3ZkW5CEr.js +192 -0
- package/dist/monitor-polling.runtime-Bs9-PKyv.js +307 -0
- package/dist/monitor-polling.runtime.js +1 -1
- package/dist/monitor-provider-BhVxiO1J.js +1782 -0
- package/dist/monitor-webhook.runtime-DtF-7o03.js +297 -0
- package/dist/monitor-webhook.runtime.js +1 -1
- package/dist/msteams-BIcHfY4o.js +33 -0
- package/dist/nextcloud-talk-Csx58yBv.js +18 -0
- package/dist/nostr-CMrgscuJ.js +19 -0
- package/dist/notify-DSCFVe6i.js +298 -0
- package/dist/oauth-CthjG7hQ.js +152 -0
- package/dist/onboard-C-jsaHwd.js +307 -0
- package/dist/onboard-channels-I98y7NZ8.js +2 -0
- package/dist/onboard-channels-NS1vMCQr.js +705 -0
- package/dist/onboard-custom-BMQ33xqX.js +2 -0
- package/dist/onboard-custom-Dz1DOCJM.js +646 -0
- package/dist/onboard-helpers-BnxgMgMT.js +228 -0
- package/dist/onboard-helpers-DEn4dg5k.js +4 -0
- package/dist/onboard-oYw6GJEA.js +591 -0
- package/dist/onboard-remote-CMmcPmsN.js +2 -0
- package/dist/onboard-remote-uiiE3QnY.js +193 -0
- package/dist/onboard-skills-CttSUeZa.js +2 -0
- package/dist/onboard-skills-DbUk33Ct.js +134 -0
- package/dist/openai-codex-provider-DZN_1A31.js +254 -0
- package/dist/openai-provider-CxBasM1Z.js +272 -0
- package/dist/openclaw-tools.runtime-nwmrOrNY.js +2 -0
- package/dist/openclaw-tools.runtime.js +1 -1
- package/dist/outbound-adapter-DfYvjhM_.js +183 -0
- package/dist/outbound-session-BTLOycg4.js +41 -0
- package/dist/persistent-bindings.lifecycle-CR9WhqMq.js +159 -0
- package/dist/pi-embedded-T_JLa73v.js +40738 -0
- package/dist/pi-embedded.runtime-Bn2DltTS.js +4 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/plugin-install-BQ6Yfbir.js +230 -0
- package/dist/plugin-install-config-policy-Dr_wjNho.js +93 -0
- package/dist/plugin-install-lmnNJcpj.js +2 -0
- package/dist/plugin-install-plan-BysT2Zgt.js +50 -0
- package/dist/plugin-sdk/acp-runtime.js +2 -2
- package/dist/plugin-sdk/agent-runtime.js +4 -4
- package/dist/plugin-sdk/approval-runtime.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +3 -3
- package/dist/plugin-sdk/command-auth.js +6 -6
- package/dist/plugin-sdk/compat.js +1 -1
- package/dist/plugin-sdk/config-runtime.js +4 -4
- package/dist/plugin-sdk/conversation-runtime.js +3 -3
- package/dist/plugin-sdk/core.js +2 -2
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/infra-runtime.js +2 -2
- package/dist/plugin-sdk/irc.js +2 -2
- package/dist/plugin-sdk/matrix-runtime-heavy.js +3 -3
- package/dist/plugin-sdk/mattermost.js +4 -4
- package/dist/plugin-sdk/media-runtime.js +3 -3
- package/dist/plugin-sdk/media-understanding.js +2 -2
- package/dist/plugin-sdk/models-provider-runtime.js +2 -2
- package/dist/plugin-sdk/msteams.js +3 -3
- package/dist/plugin-sdk/nextcloud-talk.js +2 -2
- package/dist/plugin-sdk/nostr.js +2 -2
- package/dist/plugin-sdk/provider-auth-api-key.js +2 -2
- package/dist/plugin-sdk/provider-auth-login.js +1 -1
- package/dist/plugin-sdk/provider-auth.js +2 -2
- package/dist/plugin-sdk/provider-entry.js +1 -1
- package/dist/plugin-sdk/reply-dispatch-runtime.js +2 -2
- package/dist/plugin-sdk/reply-runtime.js +4 -4
- package/dist/plugin-sdk/session-store-runtime.js +2 -2
- package/dist/plugin-sdk/testing.js +3 -3
- package/dist/plugin-sdk/webhook-path.js +2 -29
- package/dist/plugin-sdk/zalo.js +2 -2
- package/dist/plugin-sdk/zalouser.js +2 -2
- package/dist/plugins/runtime/index.js +1 -1
- package/dist/plugins-cli-QKhcgiO8.js +561 -0
- package/dist/plugins-command-helpers-DhvJn5jI.js +116 -0
- package/dist/plugins-install-persist-Qeas2eSh.js +121 -0
- package/dist/plugins-update-command-BKJEivnf.js +974 -0
- package/dist/policy-Oilx4qmu.js +147 -0
- package/dist/preflight-audio-BmL4gGyL.js +48 -0
- package/dist/preflight-audio.runtime-CAepz41v.js +7 -0
- package/dist/preflight-audio.runtime.js +1 -1
- package/dist/prepare-8M63vDxs.js +1301 -0
- package/dist/probe-Btp49F9p.js +170 -0
- package/dist/probe-CAA_bibg.js +349 -0
- package/dist/probe-CcT1Zjlx.js +431 -0
- package/dist/probe-zQeRFb2K.js +1868 -0
- package/dist/profile-update-P49WNZII.js +67 -0
- package/dist/program-Kb8jcb5x.js +158 -0
- package/dist/prompt-select-styled-G8WwN-L7.js +6434 -0
- package/dist/provider-B2yqefja.js +3685 -0
- package/dist/provider-CzbklD1X.js +70 -0
- package/dist/provider-DIIdFC34.js +18901 -0
- package/dist/provider-api-key-auth-BliP73d_.js +109 -0
- package/dist/provider-api-key-auth.runtime.js +1 -1
- package/dist/provider-auth-DxViiapc.js +43 -0
- package/dist/provider-auth-api-key-BlF9OozZ.js +5 -0
- package/dist/provider-auth-login-DAhr6tMx.js +8 -0
- package/dist/provider-auth-login.runtime.js +1 -1
- package/dist/provider-discovery.runtime.js +1 -1
- package/dist/provider-dispatcher-BEZOvNvI.js +22 -0
- package/dist/provider-entry-CSq-QYSf.js +86 -0
- package/dist/provider-session.runtime-D3rfVYR5.js +7 -0
- package/dist/provider-session.runtime.js +1 -1
- package/dist/provider.runtime-Bbi0dGrm.js +2 -0
- package/dist/provider.runtime.js +1 -1
- package/dist/qr-image-IXoz2Bw3.js +2 -0
- package/dist/queue-Ca31F-8a.js +663 -0
- package/dist/reaction-runtime-api-CZLmJ_WX.js +114 -0
- package/dist/reactions-D-WSon-m.js +258 -0
- package/dist/read-only-account-inspect.telegram-MmNQAAZr.js +202 -0
- package/dist/register.agent-B7D4sSrd.js +240 -0
- package/dist/register.configure-BgQOxerG.js +15 -0
- package/dist/register.maintenance-CiTThGcR.js +449 -0
- package/dist/register.message-CReL6dlw.js +644 -0
- package/dist/register.onboard-DHhhEg9U.js +79 -0
- package/dist/register.setup-COczC1It.js +183 -0
- package/dist/register.status-health-sessions-DRX2aQSL.js +1206 -0
- package/dist/register.subclis-DXBjIEu_.js +3 -0
- package/dist/register.subclis-DokJMw3i.js +295 -0
- package/dist/replies-DuTJPPK4.js +118 -0
- package/dist/reply-CU8qGvKT.js +3192 -0
- package/dist/reply-blocks-BpVJG1en.js +103 -0
- package/dist/reply-dispatch-runtime-DxUm7xv8.js +3 -0
- package/dist/reply-runtime-CvaF7P6-.js +123 -0
- package/dist/reply.runtime-BfN6C1_l.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/resolve-allowlist-C_Y8enFH.js +147 -0
- package/dist/resolve-targets-gk4hti4C.js +280 -0
- package/dist/rooms-Can12aFd.js +325 -0
- package/dist/route-reply-BxhqzhSe.js +133 -0
- package/dist/route-reply.runtime-BuSWcdvc.js +2 -0
- package/dist/route-reply.runtime.js +1 -1
- package/dist/route-resolution-DSj60ZbR.js +461 -0
- package/dist/rpc-context-a4f1uaqq.js +155 -0
- package/dist/run-main-CvRWW8mV.js +425 -0
- package/dist/runner-D_uJ9v3f.js +1479 -0
- package/dist/runtime-8Mw5wFou.js +68 -0
- package/dist/runtime-DQ8O9TLG.js +1175 -0
- package/dist/runtime-api-2l7jjGPw.js +3 -0
- package/dist/runtime-api-3_TNQnpI.js +81 -0
- package/dist/runtime-api-B6vjGOFJ.js +2 -0
- package/dist/runtime-api-BVjd5QC5.js +2 -0
- package/dist/runtime-api-BcMW34og.js +14 -0
- package/dist/runtime-api-Bih0haVa.js +2 -0
- package/dist/runtime-api-CZBqKHRi.js +2 -0
- package/dist/runtime-api-CnP_Jrha.js +2 -0
- package/dist/runtime-api-CnS87iaj.js +2 -0
- package/dist/runtime-api-DOLRVoZD.js +29 -0
- package/dist/runtime-api-R7oPeDFN.js +3676 -0
- package/dist/runtime-api-SP4kFvYZ.js +2 -0
- package/dist/runtime-api-y4jBsmod.js +2 -0
- package/dist/runtime-discord-ops.runtime.js +1 -1
- package/dist/runtime-embedded-pi.runtime-eHP2DunP.js +2 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/runtime-media-understanding.runtime.js +1 -1
- package/dist/runtime-model-auth.runtime.js +1 -1
- package/dist/runtime-slack-ops.runtime.js +1 -1
- package/dist/runtime-tts.runtime.js +1 -1
- package/dist/sandbox-cli-DT2znKIY.js +443 -0
- package/dist/sdk-V8yEikk_.js +1108 -0
- package/dist/security-cli-DYR5zC6Y.js +477 -0
- package/dist/send-B-Z8V4Cq.js +532 -0
- package/dist/send-Bqywq3tg.js +3 -0
- package/dist/send-BxvA6SmF.js +100 -0
- package/dist/send-ChbtrSVp.js +2 -0
- package/dist/send-CzWEW9Zb.js +856 -0
- package/dist/send-DIfvOzDT.js +318 -0
- package/dist/send-DLHztqfo.js +442 -0
- package/dist/send-DYtTIT9n.js +178 -0
- package/dist/send-DiOk2E98.js +1076 -0
- package/dist/send.components-6LOUmhSy.js +2 -0
- package/dist/send.components-D75OT62r.js +942 -0
- package/dist/server-BNNkiKsj.js +9741 -0
- package/dist/server-cron-DuTAwT4O.js +4173 -0
- package/dist/server-cron-dsNWt3Xk.js +2 -0
- package/dist/server-lite-COJ3scXX.js +830 -0
- package/dist/server-maintenance-B1miba9h.js +542 -0
- package/dist/server-maintenance-Bc6xlNTK.js +2 -0
- package/dist/server-node-events-C8B10rlc.js +454 -0
- package/dist/server-node-subscriptions-BbcfGfam.js +2 -0
- package/dist/server-plugins-40fdRywj.js +10354 -0
- package/dist/server-plugins-D2LGejil.js +2 -0
- package/dist/server-startup-memory-BSth6DJB.js +2 -0
- package/dist/server-tailscale-Bwmz6UuQ.js +2 -0
- package/dist/services-CdVUH8cK.js +2 -0
- package/dist/session-DifMNh_t.js +50 -0
- package/dist/session-archive.runtime-EJGWbu-k.js +2 -0
- package/dist/session-archive.runtime.js +1 -1
- package/dist/session-envelope-Cc5bPuvN.js +18 -0
- package/dist/session-file-C6zGg-sn.js +120 -0
- package/dist/session-key-DPKf0dWL.js +52 -0
- package/dist/session-override-Cd7zBl0i.js +100 -0
- package/dist/session-reset-model.runtime-D_iAW4sx.js +119 -0
- package/dist/session-reset-model.runtime.js +1 -1
- package/dist/session-route-USlsJP9v.js +91 -0
- package/dist/session-store-runtime-Bac-IfWa.js +2 -0
- package/dist/session-subagent-reactivation.runtime-BrSBT1dK.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-transcript-files.fs-D2Mq9mp7.js +149 -0
- package/dist/session-updates-RRq3LS7F.js +222 -0
- package/dist/session-updates.runtime-DlCqhR2y.js +2 -0
- package/dist/session-updates.runtime.js +1 -1
- package/dist/session-utils-B6yctVT6.js +1743 -0
- package/dist/sessions-BDZF0KSB.js +224 -0
- package/dist/sessions-Di_GACQe.js +2 -0
- package/dist/sessions-xeX9HpAZ.js +443 -0
- package/dist/setup-Du8OSH3g.js +427 -0
- package/dist/setup-api-ALaLEpZD.js +2 -0
- package/dist/setup-bootstrap-Dzdz67yA.js +54 -0
- package/dist/setup-core-CljP-9Aw.js +256 -0
- package/dist/setup-core-mlfG8i3t.js +146 -0
- package/dist/setup-surface-8NjprfQ4.js +261 -0
- package/dist/setup-surface-BBhpO_bO.js +304 -0
- package/dist/setup-surface-BpJACnBD.js +450 -0
- package/dist/setup-surface-C3-Jx6vF.js +272 -0
- package/dist/setup-surface-CzMh5yAL.js +656 -0
- package/dist/setup-surface-CzzVm3hE.js +353 -0
- package/dist/setup-surface-D6yTgwHY.js +346 -0
- package/dist/setup-surface-DjJE20Ud.js +484 -0
- package/dist/setup-surface-DpqfELkE.js +261 -0
- package/dist/setup-surface-VdCxFOLw.js +237 -0
- package/dist/setup-surface-fuNIOdUY.js +8848 -0
- package/dist/setup-surface-v155bftZ.js +333 -0
- package/dist/setup.finalize-iyzp5VAT.js +458 -0
- package/dist/setup.gateway-config-CU0y8lbT.js +247 -0
- package/dist/shared-Blh_fJTo.js +64 -0
- package/dist/shared-CBnUPRHA.js +180 -0
- package/dist/shared-CM5Gt0l4.js +198 -0
- package/dist/shared-CaqlRGF3.js +160 -0
- package/dist/shared-Cf75swpz.js +144 -0
- package/dist/shared-DL7by7Wd.js +2 -0
- package/dist/shared-DSx0wubR.js +72 -0
- package/dist/shared-DykGaEWS.js +94 -0
- package/dist/shared-azg27y31.js +78 -0
- package/dist/shared-runtime-Bt4waeX3.js +7 -0
- package/dist/skills-install-ByDR1-M6.js +819 -0
- package/dist/slash-commands-DG50c1a2.js +672 -0
- package/dist/slash-commands.runtime-CVcxhZ8u.js +20 -0
- package/dist/slash-commands.runtime.js +1 -1
- package/dist/slash-dispatch.runtime-C_YtFTUx.js +38 -0
- package/dist/slash-dispatch.runtime.js +1 -1
- package/dist/slash-skill-commands.runtime-Bj_cUvfb.js +8 -0
- package/dist/slash-skill-commands.runtime.js +1 -1
- package/dist/speech-provider-CC-UZuqH.js +190 -0
- package/dist/src-CAL53FNb.js +2739 -0
- package/dist/startup-verification-BpSIv6hV.js +131 -0
- package/dist/state-migrations-BZk1lezo.js +845 -0
- package/dist/status-8IelSped.js +650 -0
- package/dist/status-BVcZIA1F.js +3 -0
- package/dist/status-Bf-qPLzv.js +608 -0
- package/dist/status-BviySeE3.js +2 -0
- package/dist/status-all-Cmj7Gw5o.js +798 -0
- package/dist/status-issues--arI8w_g.js +187 -0
- package/dist/status-issues-byw_R8T_.js +336 -0
- package/dist/status-json-CKuOdeh3.js +86 -0
- package/dist/status.command.text-runtime-B3Z2fUDH.js +18 -0
- package/dist/status.scan-boBZeJmL.js +264 -0
- package/dist/status.scan.fast-json-AJppC2D5.js +97 -0
- package/dist/status.scan.fast-json-shj4aBtI.js +2 -0
- package/dist/status.scan.json-core-BpHhaewp.js +254 -0
- package/dist/status.summary-C4itGbbW.js +210 -0
- package/dist/status.summary-zSPMfFai.js +2 -0
- package/dist/sticker-cache-BN_g5-an.js +1573 -0
- package/dist/sticker-vision.runtime-DC2hIjcl.js +16 -0
- package/dist/sticker-vision.runtime.js +1 -1
- package/dist/storage-YrOCuZuJ.js +234 -0
- package/dist/store-DJaTq2_f.js +1343 -0
- package/dist/store.runtime-B05zX98d.js +2 -0
- package/dist/store.runtime.js +1 -1
- package/dist/stream-D5aKuhrW.js +633 -0
- package/dist/subagent-orphan-recovery-vUbckcfb.js +206 -0
- package/dist/subagent-registry-runtime-BE_luJ3B.js +2 -0
- package/dist/supervisor-log.runtime.js +1 -1
- package/dist/targets-BG8dKyny.js +748 -0
- package/dist/task-registry-delivery-runtime-B-oO-IGC.js +2 -0
- package/dist/task-registry.audit-BCghpxrn.js +320 -0
- package/dist/task-registry.maintenance-B55J7Hf8.js +2 -0
- package/dist/telegram/token.js +1 -1
- package/dist/test-api-BBW7IReU.js +47 -0
- package/dist/testing-fkQ9XFkv.js +677 -0
- package/dist/thread-bindings-B0ugWuKq.js +534 -0
- package/dist/thread-bindings-Dx2arldI.js +778 -0
- package/dist/thread-bindings-iFF5pMFx.js +219 -0
- package/dist/thread-bindings-lTuhY3On.js +352 -0
- package/dist/thread-bindings.discord-api-iGyDtjBI.js +487 -0
- package/dist/threading-7EMTgTsu.js +832 -0
- package/dist/threading-BkydE-cL.js +2 -0
- package/dist/threading-tool-context-C3JbrV_5.js +157 -0
- package/dist/token-wT6DwKaB.js +82 -0
- package/dist/tool-actions.runtime-B5mERIej.js +532 -0
- package/dist/tool-actions.runtime.js +1 -1
- package/dist/tools-effective-inventory-DWXkEygO.js +148 -0
- package/dist/tts.runtime.js +1 -1
- package/dist/ui-CC9JMpg4.js +212 -0
- package/dist/update-BjW3w9eI.js +1253 -0
- package/dist/update-cli-B27tZquO.js +1447 -0
- package/dist/update-runner-BMiyTW62.js +1195 -0
- package/dist/verification-C_ZgAv5v.js +130 -0
- package/dist/verification-DCQ1M0pg.js +2 -0
- package/dist/x-search-Btj7UfUg.js +166 -0
- package/dist/zalo-CnU0tzBl.js +13 -0
- package/dist/zalo-js-InpiWFuE.js +1156 -0
- package/dist/zalouser-CuRMbL4r.js +22 -0
- package/package.json +4 -1
- package/dist/abort-CuFxEr2t.js +0 -192
- package/dist/abort-cutoff.runtime-CU97Q3Ef.js +0 -20
- package/dist/abort.runtime-CZflOJv6.js +0 -2
- package/dist/access-control-CLswIHY1.js +0 -152
- package/dist/account-inspect-DiDpXY0-.js +0 -158
- package/dist/accounts-BwSkt2tm.js +0 -57
- package/dist/accounts-C8c90Uek.js +0 -2
- package/dist/accounts-CiFhbmdr.js +0 -107
- package/dist/accounts-D9Qnnbfl.js +0 -102
- package/dist/accounts-DKwfzzAC.js +0 -137
- package/dist/acp-runtime-CwGef6ZP.js +0 -8
- package/dist/acp-stateful-target-driver-p0EDW10u.js +0 -60
- package/dist/action-runtime-BWY3HXxf.js +0 -318
- package/dist/action-runtime-DNi9yizU.js +0 -72
- package/dist/action-runtime-api-BSPlMrO-.js +0 -1028
- package/dist/actions-MNvlds_S.js +0 -531
- package/dist/actions.runtime--mEwSSNe.js +0 -18
- package/dist/actions.runtime-B1HzEE8Z.js +0 -5
- package/dist/actions.runtime-BG6xvov3.js +0 -2
- package/dist/agent-CGwFOztX.js +0 -2
- package/dist/agent-command-IPMBbUVI.js +0 -1457
- package/dist/agent-runner.runtime-Bzf0jJA9.js +0 -2241
- package/dist/agent-runtime-oVxaAl9G.js +0 -142
- package/dist/agent-tools-login-BIEsXGSl.js +0 -57
- package/dist/agents-CYexVjSC.js +0 -888
- package/dist/agents-DpXXlVMm.js +0 -5
- package/dist/api-B5hYfONF2.js +0 -322
- package/dist/api-CWf7SD_r.js +0 -2
- package/dist/api-CoVu8JQC.js +0 -6
- package/dist/api-D1zC-04H.js +0 -2
- package/dist/api-DAJXC6Eh.js +0 -5
- package/dist/api-DIBiOiU5.js +0 -5
- package/dist/api-DNiO8MKu.js +0 -10
- package/dist/apply-T4gGjbIw.js +0 -485
- package/dist/apply.runtime-BIKyTMdb.js +0 -2
- package/dist/approval-native-PdTPYbWz.js +0 -79
- package/dist/approval-runtime-DQds_bzO.js +0 -262
- package/dist/attachment-normalize-KVBm83XJ.js +0 -921
- package/dist/audit-ClUk-eTw.js +0 -892
- package/dist/audit-NQngcqbL.js +0 -86
- package/dist/audit-channel.collect.runtime-BJlZ1Tqv.js +0 -528
- package/dist/audit-channel.telegram.runtime-CoLwvFcv.js +0 -8
- package/dist/audit-extra.async-B3ODYISl.js +0 -820
- package/dist/audit.deep.runtime-BaiMFfPv.js +0 -2
- package/dist/audit.nondeep.runtime-Cvt1jVHR.js +0 -831
- package/dist/audit.runtime-BOuTTKD4.js +0 -7
- package/dist/auth-BuSqMfLL.js +0 -181
- package/dist/auth-choice-B69NsSNK.js +0 -69
- package/dist/auth-choice-C7dAbZYQ.js +0 -3
- package/dist/auth-choice-ChlvsxHZ.js +0 -341
- package/dist/binding-targets-i1Phu9Ml.js +0 -99
- package/dist/bot-DA6nZ125.js +0 -4268
- package/dist/bot-message-context-4RzAPTiL.js +0 -2
- package/dist/bot-message-context-Bd0CyeDw.js +0 -1175
- package/dist/bot-message-context.runtime-CwPXKJUK.js +0 -7
- package/dist/bot-message-context.session.runtime-C9Qk9RJ2.js +0 -12
- package/dist/bot-native-commands.delivery.runtime-DP3bmRQI.js +0 -3
- package/dist/bot-native-commands.runtime-CIprmHSX.js +0 -11
- package/dist/build-info.json +0 -5
- package/dist/bundled/boot-md/HOOK.md +0 -20
- package/dist/bundled/bootstrap-extra-files/HOOK.md +0 -53
- package/dist/bundled/command-logger/HOOK.md +0 -122
- package/dist/bundled/session-memory/HOOK.md +0 -108
- package/dist/bundled/workflow-summary/HOOK.md +0 -123
- package/dist/canvas-host/a2ui/.bundle.hash +0 -1
- package/dist/canvas-host/a2ui/a2ui.bundle.js +0 -14896
- package/dist/canvas-host/a2ui/index.html +0 -307
- package/dist/channel-5dQinNdH.js +0 -783
- package/dist/channel-7CzQF9TT.js +0 -1135
- package/dist/channel-B4fvHRK-.js +0 -698
- package/dist/channel-B_TyijiN.js +0 -454
- package/dist/channel-Bcj7dCz-.js +0 -208
- package/dist/channel-CAPp1zv2.js +0 -599
- package/dist/channel-CSFDlAzr.js +0 -337
- package/dist/channel-CYMfBONo.js +0 -4976
- package/dist/channel-CkvHjmWG.js +0 -883
- package/dist/channel-CoWCft7t.js +0 -1217
- package/dist/channel-DNTrg5rc.js +0 -1661
- package/dist/channel-Dw5L6ZCL.js +0 -1129
- package/dist/channel-DzPVCd5F.js +0 -361
- package/dist/channel-GiLFmQxZ.js +0 -800
- package/dist/channel-XFvR7Dxh.js +0 -788
- package/dist/channel-inbound-bfoCnYI3.js +0 -30
- package/dist/channel-plugin-resolution-BMT07Y4B.js +0 -144
- package/dist/channel-shared-BNnyz1wC.js +0 -58
- package/dist/channel.runtime-B_dMxh1q.js +0 -125
- package/dist/channel.runtime-B_fR3JCp.js +0 -335
- package/dist/channel.runtime-BhQ_73jj.js +0 -14
- package/dist/channel.runtime-CDgrnVP6.js +0 -108
- package/dist/channel.runtime-DPFtjm6K.js +0 -309
- package/dist/channel.runtime-DigoZ45U.js +0 -80
- package/dist/channel.runtime-IHt2hi0h.js +0 -22252
- package/dist/channel.runtime-M3E3w35V.js +0 -373
- package/dist/channel.setup-CQIfV874.js +0 -279
- package/dist/channels-PlRayWHp.js +0 -1134
- package/dist/channels-cli-B4MObWHe.js +0 -246
- package/dist/clawhub-UfARocx9.js +0 -163
- package/dist/cli-B7qV90_y.js +0 -152
- package/dist/cli-DoYOPf2E.js +0 -695
- package/dist/cli-migration-7qu0VuUR.js +0 -100
- package/dist/cli-runner-C1qdQ4P5.js +0 -1014
- package/dist/cli-startup-metadata.json +0 -14
- package/dist/client-bootstrap-Bf-VJF8o.js +0 -2
- package/dist/client-bootstrap-BtDC_ghW.js +0 -121
- package/dist/client-c8NPFdV6.js +0 -7
- package/dist/client-xBBbf9T_.js +0 -5
- package/dist/code-execution-IwkUcM9K.js +0 -142
- package/dist/command-auth-CDvEQqI-.js +0 -64
- package/dist/command-registry-1pRI9W0V.js +0 -3
- package/dist/command-registry-Dr8xswzu.js +0 -199
- package/dist/commands-B7zoPsaq.js +0 -4
- package/dist/commands-acp-_0Jt7bpI.js +0 -990
- package/dist/commands-core-B2PxYebU.js +0 -241
- package/dist/commands-core.runtime-Bk-kMe8I.js +0 -2
- package/dist/commands-handlers.runtime-Dp-fdvyC.js +0 -3708
- package/dist/commands-info-CM-kPvq5.js +0 -651
- package/dist/commands-models-B_KkCnYQ.js +0 -395
- package/dist/commands-status.runtime-B7xG5l06.js +0 -2
- package/dist/commands.runtime-DTcg2ygT.js +0 -4
- package/dist/compact.runtime-C-TOc6On.js +0 -7
- package/dist/completion-cli-DYyVmY2G.js +0 -466
- package/dist/completion-cli-IsVueMzq.js +0 -2
- package/dist/config-DgES7wDO.js +0 -475
- package/dist/config-cli-B-FLvmji.js +0 -945
- package/dist/config-guard-DolG9Hb3.js +0 -113
- package/dist/config-runtime-DOU6nuit.js +0 -13
- package/dist/config-secret-input.runtime-D8uisXyK.js +0 -3
- package/dist/config-update-6NzLhzi0.js +0 -3
- package/dist/config-update-DvNp6OTj.js +0 -127
- package/dist/configure-BMLNn-t4.js +0 -1140
- package/dist/configure-Ce061vUB.js +0 -2
- package/dist/context-B_IskqEg.js +0 -227
- package/dist/control-ui/apple-touch-icon.png +0 -0
- package/dist/control-ui/assets/agents-CouEImnJ.js +0 -813
- package/dist/control-ui/assets/anthropic-D2gWjM8y.js +0 -37
- package/dist/control-ui/assets/azure-openai-responses-rSA0t6IS.js +0 -2
- package/dist/control-ui/assets/channel-config-extras-DNCeHtEf.js +0 -2
- package/dist/control-ui/assets/channels-BgJBIl8z.js +0 -349
- package/dist/control-ui/assets/cron-CESIxOYW.js +0 -928
- package/dist/control-ui/assets/de-DU-XmSEb.js +0 -2
- package/dist/control-ui/assets/debug-BAZT8Cur.js +0 -94
- package/dist/control-ui/assets/directive-C6NBp6xJ.js +0 -2
- package/dist/control-ui/assets/dist-D8DZLmCF.js +0 -18
- package/dist/control-ui/assets/es-Be891ZDf.js +0 -2
- package/dist/control-ui/assets/event-stream-B8X6sYaV.js +0 -2
- package/dist/control-ui/assets/format-nUIQxx1z.js +0 -2
- package/dist/control-ui/assets/github-copilot-headers-CrI0CIJ7.js +0 -2
- package/dist/control-ui/assets/google-B2pGWEiN.js +0 -2
- package/dist/control-ui/assets/google-gemini-cli-BpxbH95Q.js +0 -3
- package/dist/control-ui/assets/google-shared-CbPHVnPr.js +0 -12
- package/dist/control-ui/assets/google-vertex-lQwbjEII.js +0 -2
- package/dist/control-ui/assets/hash-Bt1aVMQ3.js +0 -2
- package/dist/control-ui/assets/index-C0UxQzEn.js +0 -4813
- package/dist/control-ui/assets/index-DOMg2RvO.css +0 -1
- package/dist/control-ui/assets/instances-ClbVvaQy.js +0 -57
- package/dist/control-ui/assets/lit-zdTgzAJI.js +0 -3
- package/dist/control-ui/assets/logs-vVeVJ0CI.js +0 -74
- package/dist/control-ui/assets/mistral-imHzDZ_7.js +0 -8
- package/dist/control-ui/assets/nodes-CeaJKODa.js +0 -430
- package/dist/control-ui/assets/openai-Cn7eGqwa.js +0 -17
- package/dist/control-ui/assets/openai-codex-responses-DRaOkrRO.js +0 -8
- package/dist/control-ui/assets/openai-completions-0yOZERna.js +0 -6
- package/dist/control-ui/assets/openai-responses-8vqADgIw.js +0 -2
- package/dist/control-ui/assets/openai-responses-shared-Q7jopnLp.js +0 -11
- package/dist/control-ui/assets/preload-helper-xBbMyY7u.js +0 -1
- package/dist/control-ui/assets/pt-BR-RqwUvKTB.js +0 -2
- package/dist/control-ui/assets/sessions-CiBN6LBg.js +0 -236
- package/dist/control-ui/assets/skills-shared-DJsJP4-4.js +0 -11
- package/dist/control-ui/assets/skills-yhlO3Ote.js +0 -216
- package/dist/control-ui/assets/transform-messages-XKqwKV3D.js +0 -2
- package/dist/control-ui/assets/zh-CN-CUzhgfRs.js +0 -2
- package/dist/control-ui/assets/zh-TW-CCgwa2eS.js +0 -2
- package/dist/control-ui/favicon-32.png +0 -0
- package/dist/control-ui/favicon.ico +0 -0
- package/dist/control-ui/favicon.svg +0 -66
- package/dist/control-ui/index.html +0 -75
- package/dist/conversation-bindings-BWn8Eq0t.js +0 -210
- package/dist/conversation-id-CIpyn-VD.js +0 -168
- package/dist/conversation-runtime-BpJdJqei.js +0 -85
- package/dist/core-BsdZRsb0.js +0 -195
- package/dist/create-client-HZBJ7-Fl.js +0 -2
- package/dist/create-client-WqOz1ro_.js +0 -58
- package/dist/credentials-5vTiF-oK.js +0 -22
- package/dist/credentials-write.runtime-3bouyp8U.js +0 -9
- package/dist/crypto-runtime-DirRLBDM.js +0 -3495
- package/dist/daemon-cli-AJpZY4sn.js +0 -383
- package/dist/daemon-install-FZTHcBaU.js +0 -63
- package/dist/delegate-BaC3I_I2.js +0 -43
- package/dist/deliver-BaDjGKa4.js +0 -3
- package/dist/deliver-CWBM3uFK.js +0 -954
- package/dist/deliver-reply-B1lULS4T.js +0 -238
- package/dist/deliver-runtime-C9wPhPVo.js +0 -2
- package/dist/delivery-info-UablM7m8.js +0 -40
- package/dist/delivery-jNAx1UXj.js +0 -834
- package/dist/direct-dm-BOWirToy.js +0 -139
- package/dist/direct-management-D7iGx6GI.js +0 -300
- package/dist/direct-management-DmQUf3My.js +0 -2
- package/dist/directive-handling.fast-lane-BgUe6rBZ.js +0 -64
- package/dist/directive-handling.fast-lane-C__EV2OZ.js +0 -2
- package/dist/directive-handling.impl-D466FFH9.js +0 -672
- package/dist/directive-handling.impl-tl3nNkjQ.js +0 -2
- package/dist/directive-handling.parse-H-NqZbGQ.js +0 -375
- package/dist/directive-handling.persist-D-TH7X00.js +0 -133
- package/dist/directive-handling.persist.runtime-CKzh0FFl.js +0 -2
- package/dist/directive-handling.shared-CMdDhj2s.js +0 -158
- package/dist/directory-cli-BkFOqvau.js +0 -238
- package/dist/directory.static-CWHw_6bd.js +0 -45
- package/dist/discovery-CmDmBzyt.js +0 -171
- package/dist/dispatch-5P8XNY-z.js +0 -858
- package/dist/dispatch-acp.runtime-BXLlUo6a.js +0 -884
- package/dist/doctor-completion-C-PtqnX4.js +0 -90
- package/dist/doctor-config-preflight--G_zFI_P.js +0 -148
- package/dist/doctor-config-preflight-Cgmj0J2d.js +0 -2
- package/dist/doctor-state-migrations-B4vgkpe8.js +0 -3
- package/dist/doctor-state-migrations-R3EnGfXE.js +0 -2
- package/dist/embedding-provider-DllEP1OZ.js +0 -129
- package/dist/encryption-guidance-DDwXFxqS.js +0 -33
- package/dist/error-text-C4BdRT0b.js +0 -24
- package/dist/exec-approval-session-target-BpHDdAt6.js +0 -159
- package/dist/exec-approvals-Lpud2QXU.js +0 -121
- package/dist/export-html/template.css +0 -1060
- package/dist/export-html/template.html +0 -88
- package/dist/export-html/template.js +0 -1875
- package/dist/export-html/vendor/highlight.min.js +0 -1213
- package/dist/export-html/vendor/marked.min.js +0 -6
- package/dist/format-CerBTToC.js +0 -817
- package/dist/gateway-BuNsK2ll.js +0 -2575
- package/dist/gateway-cli-WL9O_amN.js +0 -1596
- package/dist/gateway-install-token-DBjV7vuQ.js +0 -230
- package/dist/get-reply-from-config.runtime-Ci2UvY3-.js +0 -2
- package/dist/gmail-watcher-lifecycle-BE_4dMST.js +0 -2
- package/dist/graph-users-CGePGfzI.js +0 -918
- package/dist/group-access-D9zxJ9Eg.js +0 -119
- package/dist/group-access-qaCYNF5W.js +0 -32
- package/dist/handle-action-CqjxOWwH.js +0 -500
- package/dist/health-Ckh-98zt.js +0 -577
- package/dist/health-Dte2hwwy.js +0 -2
- package/dist/heartbeat-runner-BSkqJHkl.js +0 -995
- package/dist/hooks-cli-5qH5guhQ.js +0 -353
- package/dist/http-client-E-AK0hBj.js +0 -294
- package/dist/image-Dflgshq4.js +0 -152
- package/dist/image-runtime-C8N4pHiL.js +0 -7
- package/dist/inbound-reply-dispatch-DnSGPONh.js +0 -73
- package/dist/inbound.runtime-CSV1NzQc.js +0 -3
- package/dist/infra-runtime-B0CHuzrJ.js +0 -22
- package/dist/install-security-scan-pEC-BNIh.js +0 -22
- package/dist/install-security-scan.runtime-KtCBz8Ms.js +0 -299
- package/dist/install-slQpgebI.js +0 -590
- package/dist/install.runtime-BDKuVJIa.js +0 -27
- package/dist/install.runtime-Cdb5F3uW.js +0 -11
- package/dist/irc-CWidrqqa.js +0 -14
- package/dist/legacy-crypto-restore-DrVtd4-4.js +0 -85
- package/dist/library-CmpBsnzV.js +0 -44
- package/dist/llm-slug-generator-5ztca3GP.js +0 -68
- package/dist/loader-BOVnpEv5.js +0 -2
- package/dist/login-I8HWXek2.js +0 -108
- package/dist/login-Xx8YN-Ut.js +0 -2332
- package/dist/login-qr-AEmAM7Qe.js +0 -211
- package/dist/login-qr-api-BSW8Ta-A.js +0 -16
- package/dist/manager.runtime-DpPqh8fu.js +0 -670
- package/dist/matrix-CVj94cvn.js +0 -351
- package/dist/matrix-runtime-heavy-n2o8hviY.js +0 -4
- package/dist/mattermost-D0PPzHDR.js +0 -18
- package/dist/media-CS8BGM6_.js +0 -1691
- package/dist/media-runtime-CzcnSxHP.js +0 -295
- package/dist/media-understanding-6pmWMadX.js +0 -51
- package/dist/media-understanding-provider--2czf2Xl.js +0 -16
- package/dist/media-understanding-provider-1v3aAmph.js +0 -17
- package/dist/media-understanding-provider-Bo02B0WG.js +0 -16
- package/dist/media-understanding-provider-C1e568I5.js +0 -86
- package/dist/media-understanding-provider-DftOn7qM.js +0 -28
- package/dist/media-understanding-provider-JfEcvB6a.js +0 -11
- package/dist/media-understanding-provider-Zvb9Fi0L.js +0 -11
- package/dist/media-understanding-provider-fpeKUYrh.js +0 -11
- package/dist/media-understanding.runtime-CBg9Myvx.js +0 -7
- package/dist/message-DTcLbUjJ.js +0 -206
- package/dist/message-action-runner-Nkrb1psP.js +0 -1330
- package/dist/message-handler-ozmV6rws.js +0 -1771
- package/dist/messages-W3Tl9C55.js +0 -270
- package/dist/migration-snapshot.runtime-CBx6_nXj.js +0 -3
- package/dist/model-catalog-BdRYqKL1.js +0 -216
- package/dist/model-catalog.runtime--yFOIYWV.js +0 -2
- package/dist/model-picker-Cgjw3ytp.js +0 -3
- package/dist/model-picker-jZueDrUL.js +0 -439
- package/dist/model-runtime-51DWArDE.js +0 -1772
- package/dist/model-selection-BohZPMIS.js +0 -407
- package/dist/models-By72Z6_k.js +0 -2550
- package/dist/models-Dgkh71VB.js +0 -3
- package/dist/models-cli-6ZWkpdCu.js +0 -197
- package/dist/models-config-C4DcwiKp.js +0 -2
- package/dist/models-config-CMbP7C_L.js +0 -1106
- package/dist/models-config.runtime-Chha_CyE.js +0 -2
- package/dist/models-provider-runtime-Bu0Agcak.js +0 -2
- package/dist/monitor-B7gDwViK.js +0 -3622
- package/dist/monitor-BE6u7xIu.js +0 -1525
- package/dist/monitor-BRMbIrFT.js +0 -3660
- package/dist/monitor-COLTfgXl.js +0 -676
- package/dist/monitor-CvHGVZmI.js +0 -4067
- package/dist/monitor-DB9RduAn.js +0 -687
- package/dist/monitor-DL7WkrAh.js +0 -666
- package/dist/monitor-auth-EM0izKiw.js +0 -192
- package/dist/monitor-polling.runtime-DFWDyq0r.js +0 -307
- package/dist/monitor-provider-BCduxzuC.js +0 -1782
- package/dist/monitor-webhook.runtime-66MaZoy1.js +0 -297
- package/dist/msteams-DfVsNAAv.js +0 -33
- package/dist/nextcloud-talk-DzdSPp33.js +0 -18
- package/dist/nostr-CA9Nyz3w.js +0 -19
- package/dist/notify-C6g-CT-E.js +0 -298
- package/dist/oauth-0jEycYdH.js +0 -152
- package/dist/onboard-BBY0wtI-.js +0 -591
- package/dist/onboard-BJZUne8W.js +0 -307
- package/dist/onboard-channels-2M_l-yYq.js +0 -705
- package/dist/onboard-channels-B8fOn_J8.js +0 -2
- package/dist/onboard-custom-BQxH-LlD.js +0 -646
- package/dist/onboard-custom-BXJFm5tv.js +0 -2
- package/dist/onboard-helpers-DAmUY5cA.js +0 -228
- package/dist/onboard-helpers-DalDwXjg.js +0 -4
- package/dist/onboard-remote-CAS2F09D.js +0 -2
- package/dist/onboard-remote-nfFOhKzl.js +0 -193
- package/dist/onboard-skills-CH4ZsJr7.js +0 -2
- package/dist/onboard-skills-DSYZC5D0.js +0 -134
- package/dist/openai-codex-provider-B_8TNnmh.js +0 -254
- package/dist/openai-provider-CwnYhA5Q.js +0 -272
- package/dist/openclaw-tools.runtime-1mX4RgUb.js +0 -2
- package/dist/outbound-adapter-DDaf1Qmt.js +0 -183
- package/dist/outbound-session-XCEG44pM.js +0 -41
- package/dist/persistent-bindings.lifecycle-CC1LNlZw.js +0 -159
- package/dist/pi-embedded-B2zIKehU.js +0 -40738
- package/dist/pi-embedded.runtime-tIoF88cE.js +0 -4
- package/dist/plugin-install-CqzqZMog.js +0 -230
- package/dist/plugin-install-P8ACZKV4.js +0 -2
- package/dist/plugin-install-config-policy-CWxlz2Uf.js +0 -93
- package/dist/plugin-install-plan-D2X3sbgg.js +0 -50
- package/dist/plugin-sdk/account-core.d.ts +0 -1
- package/dist/plugin-sdk/account-helpers.d.ts +0 -1
- package/dist/plugin-sdk/account-id.d.ts +0 -1
- package/dist/plugin-sdk/account-resolution.d.ts +0 -1
- package/dist/plugin-sdk/acp-runtime.d.ts +0 -1
- package/dist/plugin-sdk/agent-config-primitives.d.ts +0 -1
- package/dist/plugin-sdk/agent-runtime.d.ts +0 -1
- package/dist/plugin-sdk/allow-from.d.ts +0 -1
- package/dist/plugin-sdk/allowlist-config-edit.d.ts +0 -1
- package/dist/plugin-sdk/amazon-bedrock.d.ts +0 -1
- package/dist/plugin-sdk/anthropic-vertex.d.ts +0 -1
- package/dist/plugin-sdk/approval-runtime.d.ts +0 -1
- package/dist/plugin-sdk/bluebubbles-policy.d.ts +0 -1
- package/dist/plugin-sdk/bluebubbles.d.ts +0 -1
- package/dist/plugin-sdk/boolean-param.d.ts +0 -1
- package/dist/plugin-sdk/browser-runtime.d.ts +0 -1
- package/dist/plugin-sdk/browser-support.d.ts +0 -1
- package/dist/plugin-sdk/browser.d.ts +0 -1
- package/dist/plugin-sdk/byteplus.d.ts +0 -1
- package/dist/plugin-sdk/channel-actions.d.ts +0 -1
- package/dist/plugin-sdk/channel-config-helpers.d.ts +0 -1
- package/dist/plugin-sdk/channel-config-primitives.d.ts +0 -1
- package/dist/plugin-sdk/channel-config-schema.d.ts +0 -1
- package/dist/plugin-sdk/channel-config-writes.d.ts +0 -1
- package/dist/plugin-sdk/channel-contract.d.ts +0 -1
- package/dist/plugin-sdk/channel-feedback.d.ts +0 -1
- package/dist/plugin-sdk/channel-inbound.d.ts +0 -1
- package/dist/plugin-sdk/channel-lifecycle.d.ts +0 -1
- package/dist/plugin-sdk/channel-pairing.d.ts +0 -1
- package/dist/plugin-sdk/channel-policy.d.ts +0 -1
- package/dist/plugin-sdk/channel-reply-pipeline.d.ts +0 -1
- package/dist/plugin-sdk/channel-runtime.d.ts +0 -1
- package/dist/plugin-sdk/channel-send-result.d.ts +0 -1
- package/dist/plugin-sdk/channel-setup.d.ts +0 -1
- package/dist/plugin-sdk/channel-status.d.ts +0 -1
- package/dist/plugin-sdk/channel-targets.d.ts +0 -1
- package/dist/plugin-sdk/chutes.d.ts +0 -1
- package/dist/plugin-sdk/cli-backend.d.ts +0 -1
- package/dist/plugin-sdk/cli-runtime.d.ts +0 -1
- package/dist/plugin-sdk/cloudflare-ai-gateway.d.ts +0 -1
- package/dist/plugin-sdk/collection-runtime.d.ts +0 -1
- package/dist/plugin-sdk/command-auth-native.d.ts +0 -1
- package/dist/plugin-sdk/command-auth.d.ts +0 -1
- package/dist/plugin-sdk/command-detection.d.ts +0 -1
- package/dist/plugin-sdk/command-surface.d.ts +0 -1
- package/dist/plugin-sdk/compat.d.ts +0 -1
- package/dist/plugin-sdk/config-runtime.d.ts +0 -1
- package/dist/plugin-sdk/conversation-runtime.d.ts +0 -1
- package/dist/plugin-sdk/core.d.ts +0 -1
- package/dist/plugin-sdk/dangerous-name-runtime.d.ts +0 -1
- package/dist/plugin-sdk/deepseek.d.ts +0 -1
- package/dist/plugin-sdk/device-bootstrap.d.ts +0 -1
- package/dist/plugin-sdk/diagnostic-runtime.d.ts +0 -1
- package/dist/plugin-sdk/diagnostics-otel.d.ts +0 -1
- package/dist/plugin-sdk/diffs.d.ts +0 -1
- package/dist/plugin-sdk/direct-dm.d.ts +0 -1
- package/dist/plugin-sdk/directory-runtime.d.ts +0 -1
- package/dist/plugin-sdk/discord-account.d.ts +0 -1
- package/dist/plugin-sdk/discord-core.d.ts +0 -1
- package/dist/plugin-sdk/discord-runtime-surface.d.ts +0 -1
- package/dist/plugin-sdk/discord-session-key.d.ts +0 -1
- package/dist/plugin-sdk/discord-surface.d.ts +0 -1
- package/dist/plugin-sdk/discord-thread-bindings.d.ts +0 -1
- package/dist/plugin-sdk/discord-timeouts.d.ts +0 -1
- package/dist/plugin-sdk/discord.d.ts +0 -1
- package/dist/plugin-sdk/error-runtime.d.ts +0 -1
- package/dist/plugin-sdk/extension-shared.d.ts +0 -1
- package/dist/plugin-sdk/extensions/anthropic/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/anthropic/cli-shared.d.ts +0 -8
- package/dist/plugin-sdk/extensions/anthropic/stream-wrappers.d.ts +0 -12
- package/dist/plugin-sdk/extensions/bluebubbles/api.d.ts +0 -5
- package/dist/plugin-sdk/extensions/bluebubbles/src/account-resolve.d.ts +0 -13
- package/dist/plugin-sdk/extensions/bluebubbles/src/accounts.d.ts +0 -17
- package/dist/plugin-sdk/extensions/bluebubbles/src/actions.d.ts +0 -2
- package/dist/plugin-sdk/extensions/bluebubbles/src/actions.runtime.d.ts +0 -19
- package/dist/plugin-sdk/extensions/bluebubbles/src/attachments.d.ts +0 -34
- package/dist/plugin-sdk/extensions/bluebubbles/src/channel-shared.d.ts +0 -49
- package/dist/plugin-sdk/extensions/bluebubbles/src/channel.d.ts +0 -4
- package/dist/plugin-sdk/extensions/bluebubbles/src/channel.runtime.d.ts +0 -13
- package/dist/plugin-sdk/extensions/bluebubbles/src/chat.d.ts +0 -48
- package/dist/plugin-sdk/extensions/bluebubbles/src/config-apply.d.ts +0 -15
- package/dist/plugin-sdk/extensions/bluebubbles/src/config-schema.d.ts +0 -76
- package/dist/plugin-sdk/extensions/bluebubbles/src/config-ui-hints.d.ts +0 -10
- package/dist/plugin-sdk/extensions/bluebubbles/src/conversation-bindings.d.ts +0 -37
- package/dist/plugin-sdk/extensions/bluebubbles/src/conversation-id.d.ts +0 -18
- package/dist/plugin-sdk/extensions/bluebubbles/src/conversation-route.d.ts +0 -12
- package/dist/plugin-sdk/extensions/bluebubbles/src/group-policy.d.ts +0 -14
- package/dist/plugin-sdk/extensions/bluebubbles/src/history.d.ts +0 -40
- package/dist/plugin-sdk/extensions/bluebubbles/src/local-file-access.d.ts +0 -2
- package/dist/plugin-sdk/extensions/bluebubbles/src/media-send.d.ts +0 -14
- package/dist/plugin-sdk/extensions/bluebubbles/src/monitor-debounce.d.ts +0 -22
- package/dist/plugin-sdk/extensions/bluebubbles/src/monitor-normalize.d.ts +0 -77
- package/dist/plugin-sdk/extensions/bluebubbles/src/monitor-processing.d.ts +0 -5
- package/dist/plugin-sdk/extensions/bluebubbles/src/monitor-reply-cache.d.ts +0 -36
- package/dist/plugin-sdk/extensions/bluebubbles/src/monitor-self-chat-cache.d.ts +0 -15
- package/dist/plugin-sdk/extensions/bluebubbles/src/monitor-shared.d.ts +0 -31
- package/dist/plugin-sdk/extensions/bluebubbles/src/monitor.d.ts +0 -8
- package/dist/plugin-sdk/extensions/bluebubbles/src/multipart.d.ts +0 -10
- package/dist/plugin-sdk/extensions/bluebubbles/src/participant-contact-names.d.ts +0 -28
- package/dist/plugin-sdk/extensions/bluebubbles/src/probe.d.ts +0 -53
- package/dist/plugin-sdk/extensions/bluebubbles/src/reactions.d.ts +0 -17
- package/dist/plugin-sdk/extensions/bluebubbles/src/request-url.d.ts +0 -1
- package/dist/plugin-sdk/extensions/bluebubbles/src/runtime-api.d.ts +0 -28
- package/dist/plugin-sdk/extensions/bluebubbles/src/runtime.d.ts +0 -6
- package/dist/plugin-sdk/extensions/bluebubbles/src/secret-input.d.ts +0 -1
- package/dist/plugin-sdk/extensions/bluebubbles/src/send-helpers.d.ts +0 -3
- package/dist/plugin-sdk/extensions/bluebubbles/src/send.d.ts +0 -45
- package/dist/plugin-sdk/extensions/bluebubbles/src/session-route.d.ts +0 -2
- package/dist/plugin-sdk/extensions/bluebubbles/src/setup-core.d.ts +0 -4
- package/dist/plugin-sdk/extensions/bluebubbles/src/setup-surface.d.ts +0 -4
- package/dist/plugin-sdk/extensions/bluebubbles/src/targets.d.ts +0 -45
- package/dist/plugin-sdk/extensions/bluebubbles/src/types.d.ts +0 -121
- package/dist/plugin-sdk/extensions/bluebubbles/src/webhook-shared.d.ts +0 -5
- package/dist/plugin-sdk/extensions/browser/runtime-api.d.ts +0 -7
- package/dist/plugin-sdk/extensions/browser/src/browser/bridge-auth-registry.d.ts +0 -8
- package/dist/plugin-sdk/extensions/browser/src/browser/bridge-server.d.ts +0 -24
- package/dist/plugin-sdk/extensions/browser/src/browser/cdp-proxy-bypass.d.ts +0 -31
- package/dist/plugin-sdk/extensions/browser/src/browser/cdp-timeouts.d.ts +0 -28
- package/dist/plugin-sdk/extensions/browser/src/browser/cdp.d.ts +0 -125
- package/dist/plugin-sdk/extensions/browser/src/browser/cdp.helpers.d.ts +0 -29
- package/dist/plugin-sdk/extensions/browser/src/browser/chrome-mcp.d.ts +0 -127
- package/dist/plugin-sdk/extensions/browser/src/browser/chrome-mcp.snapshot.d.ts +0 -26
- package/dist/plugin-sdk/extensions/browser/src/browser/chrome.d.ts +0 -26
- package/dist/plugin-sdk/extensions/browser/src/browser/chrome.executables.d.ts +0 -15
- package/dist/plugin-sdk/extensions/browser/src/browser/chrome.profile-decoration.d.ts +0 -10
- package/dist/plugin-sdk/extensions/browser/src/browser/client-actions-core.d.ts +0 -159
- package/dist/plugin-sdk/extensions/browser/src/browser/client-actions-observe.d.ts +0 -68
- package/dist/plugin-sdk/extensions/browser/src/browser/client-actions-state.d.ts +0 -93
- package/dist/plugin-sdk/extensions/browser/src/browser/client-actions-types.d.ts +0 -18
- package/dist/plugin-sdk/extensions/browser/src/browser/client-actions-url.d.ts +0 -2
- package/dist/plugin-sdk/extensions/browser/src/browser/client-actions.d.ts +0 -4
- package/dist/plugin-sdk/extensions/browser/src/browser/client-fetch.d.ts +0 -21
- package/dist/plugin-sdk/extensions/browser/src/browser/client.d.ts +0 -157
- package/dist/plugin-sdk/extensions/browser/src/browser/config-refresh-source.d.ts +0 -2
- package/dist/plugin-sdk/extensions/browser/src/browser/config.d.ts +0 -46
- package/dist/plugin-sdk/extensions/browser/src/browser/constants.d.ts +0 -8
- package/dist/plugin-sdk/extensions/browser/src/browser/control-auth.d.ts +0 -13
- package/dist/plugin-sdk/extensions/browser/src/browser/control-service.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/browser/csrf.d.ts +0 -8
- package/dist/plugin-sdk/extensions/browser/src/browser/errors.d.ts +0 -35
- package/dist/plugin-sdk/extensions/browser/src/browser/form-fields.d.ts +0 -8
- package/dist/plugin-sdk/extensions/browser/src/browser/http-auth.d.ts +0 -5
- package/dist/plugin-sdk/extensions/browser/src/browser/navigation-guard.d.ts +0 -30
- package/dist/plugin-sdk/extensions/browser/src/browser/output-atomic.d.ts +0 -5
- package/dist/plugin-sdk/extensions/browser/src/browser/paths.d.ts +0 -61
- package/dist/plugin-sdk/extensions/browser/src/browser/profile-capabilities.d.ts +0 -30
- package/dist/plugin-sdk/extensions/browser/src/browser/profiles-service.d.ts +0 -28
- package/dist/plugin-sdk/extensions/browser/src/browser/profiles.d.ts +0 -30
- package/dist/plugin-sdk/extensions/browser/src/browser/proxy-files.d.ts +0 -7
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-ai-module.d.ts +0 -6
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-ai-state.d.ts +0 -2
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-ai.d.ts +0 -2
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-role-snapshot.d.ts +0 -35
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-session.d.ts +0 -182
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-session.page-cdp.d.ts +0 -9
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.activity.d.ts +0 -21
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.d.ts +0 -8
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.downloads.d.ts +0 -34
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.interactions.d.ts +0 -135
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.responses.d.ts +0 -13
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.shared.d.ts +0 -10
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.snapshot.d.ts +0 -66
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.state.d.ts +0 -46
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.storage.d.ts +0 -47
- package/dist/plugin-sdk/extensions/browser/src/browser/pw-tools-core.trace.d.ts +0 -12
- package/dist/plugin-sdk/extensions/browser/src/browser/request-policy.d.ts +0 -9
- package/dist/plugin-sdk/extensions/browser/src/browser/resolved-config-refresh.d.ts +0 -12
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.act.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.act.download.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.act.hooks.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.act.shared.d.ts +0 -10
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.debug.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.shared.d.ts +0 -37
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.snapshot.d.ts +0 -12
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.snapshot.plan.d.ts +0 -22
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/agent.storage.d.ts +0 -14
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/basic.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/dispatcher.d.ts +0 -16
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/index.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/output-paths.d.ts +0 -10
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/path-output.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/tabs.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/types.d.ts +0 -20
- package/dist/plugin-sdk/extensions/browser/src/browser/routes/utils.d.ts +0 -15
- package/dist/plugin-sdk/extensions/browser/src/browser/runtime-lifecycle.d.ts +0 -15
- package/dist/plugin-sdk/extensions/browser/src/browser/safe-filename.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/browser/screenshot.d.ts +0 -9
- package/dist/plugin-sdk/extensions/browser/src/browser/server-context.availability.d.ts +0 -19
- package/dist/plugin-sdk/extensions/browser/src/browser/server-context.constants.d.ts +0 -7
- package/dist/plugin-sdk/extensions/browser/src/browser/server-context.d.ts +0 -4
- package/dist/plugin-sdk/extensions/browser/src/browser/server-context.reset.d.ts +0 -20
- package/dist/plugin-sdk/extensions/browser/src/browser/server-context.selection.d.ts +0 -16
- package/dist/plugin-sdk/extensions/browser/src/browser/server-context.tab-ops.d.ts +0 -13
- package/dist/plugin-sdk/extensions/browser/src/browser/server-context.types.d.ts +0 -74
- package/dist/plugin-sdk/extensions/browser/src/browser/server-lifecycle.d.ts +0 -10
- package/dist/plugin-sdk/extensions/browser/src/browser/server-middleware.d.ts +0 -6
- package/dist/plugin-sdk/extensions/browser/src/browser/session-tab-registry.d.ts +0 -30
- package/dist/plugin-sdk/extensions/browser/src/browser/snapshot-roles.d.ts +0 -11
- package/dist/plugin-sdk/extensions/browser/src/browser/target-id.d.ts +0 -11
- package/dist/plugin-sdk/extensions/browser/src/browser/trash.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/browser/url-pattern.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/browser-runtime.d.ts +0 -28
- package/dist/plugin-sdk/extensions/browser/src/browser-tool.actions.d.ts +0 -44
- package/dist/plugin-sdk/extensions/browser/src/browser-tool.d.ts +0 -30
- package/dist/plugin-sdk/extensions/browser/src/browser-tool.schema.d.ts +0 -75
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-actions-input/register.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-actions-input/register.element.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-actions-input/register.files-downloads.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-actions-input/register.form-wait-eval.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-actions-input/register.navigation.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-actions-input/shared.d.ts +0 -20
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-actions-input.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-actions-observe.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-debug.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-examples.d.ts +0 -2
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-inspect.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-manage.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-resize.d.ts +0 -10
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-shared.d.ts +0 -24
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-state.cookies-storage.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli-state.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/cli/browser-cli.d.ts +0 -2
- package/dist/plugin-sdk/extensions/browser/src/cli/command-format.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/cli/core-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/config/config.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/config/paths.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/config/port-defaults.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/control-service.d.ts +0 -5
- package/dist/plugin-sdk/extensions/browser/src/core-api.d.ts +0 -4
- package/dist/plugin-sdk/extensions/browser/src/gateway/auth.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/gateway/browser-request.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/gateway/net.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/gateway/startup-auth.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/errors.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/fs-safe.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/net/proxy-env.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/net/ssrf.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/path-guards.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/ports.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/secure-random.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/tmp-openclaw-dir.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/infra/ws.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/logging/redact.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/logging/subsystem.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/media/image-ops.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/media/store.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/node-host/invoke-browser.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/plugin-enabled.d.ts +0 -2
- package/dist/plugin-sdk/extensions/browser/src/plugin-service.d.ts +0 -2
- package/dist/plugin-sdk/extensions/browser/src/process/exec.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/security/secret-equal.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/server.d.ts +0 -3
- package/dist/plugin-sdk/extensions/browser/src/utils/boolean.d.ts +0 -1
- package/dist/plugin-sdk/extensions/browser/src/utils.d.ts +0 -1
- package/dist/plugin-sdk/extensions/byteplus/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/byteplus/models.d.ts +0 -73
- package/dist/plugin-sdk/extensions/byteplus/provider-catalog.d.ts +0 -3
- package/dist/plugin-sdk/extensions/chutes/api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/chutes/models.d.ts +0 -7
- package/dist/plugin-sdk/extensions/chutes/onboard.d.ts +0 -13
- package/dist/plugin-sdk/extensions/chutes/provider-catalog.d.ts +0 -7
- package/dist/plugin-sdk/extensions/cloudflare-ai-gateway/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/cloudflare-ai-gateway/models.d.ts +0 -14
- package/dist/plugin-sdk/extensions/cloudflare-ai-gateway/onboard.d.ts +0 -32
- package/dist/plugin-sdk/extensions/deepseek/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/deepseek/models.d.ts +0 -4
- package/dist/plugin-sdk/extensions/deepseek/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/discord/action-runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/discord/api.d.ts +0 -19
- package/dist/plugin-sdk/extensions/discord/runtime-api.d.ts +0 -18
- package/dist/plugin-sdk/extensions/discord/session-key-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/discord/src/actions/handle-action.d.ts +0 -3
- package/dist/plugin-sdk/extensions/discord/src/actions/handle-action.guild-admin.d.ts +0 -9
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.d.ts +0 -5
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.guild.d.ts +0 -24
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.messaging.d.ts +0 -33
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.moderation-shared.d.ts +0 -13
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.moderation.d.ts +0 -10
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.presence.d.ts +0 -3
- package/dist/plugin-sdk/extensions/discord/src/actions/runtime.shared.d.ts +0 -1
- package/dist/plugin-sdk/extensions/discord/src/approval-native.d.ts +0 -31
- package/dist/plugin-sdk/extensions/discord/src/audit.d.ts +0 -29
- package/dist/plugin-sdk/extensions/discord/src/channel-actions.d.ts +0 -2
- package/dist/plugin-sdk/extensions/discord/src/chunk.d.ts +0 -20
- package/dist/plugin-sdk/extensions/discord/src/client.d.ts +0 -23
- package/dist/plugin-sdk/extensions/discord/src/component-custom-id.d.ts +0 -15
- package/dist/plugin-sdk/extensions/discord/src/components-registry.d.ts +0 -16
- package/dist/plugin-sdk/extensions/discord/src/components.d.ts +0 -195
- package/dist/plugin-sdk/extensions/discord/src/directory-config.d.ts +0 -3
- package/dist/plugin-sdk/extensions/discord/src/draft-chunking.d.ts +0 -6
- package/dist/plugin-sdk/extensions/discord/src/draft-stream.d.ts +0 -21
- package/dist/plugin-sdk/extensions/discord/src/exec-approvals.d.ts +0 -24
- package/dist/plugin-sdk/extensions/discord/src/gateway-logging.d.ts +0 -8
- package/dist/plugin-sdk/extensions/discord/src/group-policy.d.ts +0 -4
- package/dist/plugin-sdk/extensions/discord/src/guilds.d.ts +0 -6
- package/dist/plugin-sdk/extensions/discord/src/mentions.d.ts +0 -8
- package/dist/plugin-sdk/extensions/discord/src/message-tool-schema.d.ts +0 -96
- package/dist/plugin-sdk/extensions/discord/src/monitor/agent-components-helpers.d.ts +0 -160
- package/dist/plugin-sdk/extensions/discord/src/monitor/agent-components.d.ts +0 -28
- package/dist/plugin-sdk/extensions/discord/src/monitor/auto-presence.d.ts +0 -59
- package/dist/plugin-sdk/extensions/discord/src/monitor/commands.d.ts +0 -2
- package/dist/plugin-sdk/extensions/discord/src/monitor/dm-command-auth.d.ts +0 -24
- package/dist/plugin-sdk/extensions/discord/src/monitor/dm-command-decision.d.ts +0 -14
- package/dist/plugin-sdk/extensions/discord/src/monitor/exec-approvals.d.ts +0 -54
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-handle.d.ts +0 -28
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-plugin.d.ts +0 -22
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-registry.d.ts +0 -9
- package/dist/plugin-sdk/extensions/discord/src/monitor/gateway-supervisor.d.ts +0 -25
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-context.d.ts +0 -36
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-job.d.ts +0 -13
- package/dist/plugin-sdk/extensions/discord/src/monitor/inbound-worker.d.ts +0 -22
- package/dist/plugin-sdk/extensions/discord/src/monitor/listeners.d.ts +0 -67
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.d.ts +0 -19
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.preflight.d.ts +0 -14
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.preflight.types.d.ts +0 -88
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-handler.process.d.ts +0 -11
- package/dist/plugin-sdk/extensions/discord/src/monitor/message-utils.d.ts +0 -53
- package/dist/plugin-sdk/extensions/discord/src/monitor/model-picker-preferences.d.ts +0 -18
- package/dist/plugin-sdk/extensions/discord/src/monitor/model-picker.d.ts +0 -117
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command-context.d.ts +0 -68
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command-route.d.ts +0 -28
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command-ui.d.ts +0 -106
- package/dist/plugin-sdk/extensions/discord/src/monitor/native-command.d.ts +0 -28
- package/dist/plugin-sdk/extensions/discord/src/monitor/preflight-audio.d.ts +0 -21
- package/dist/plugin-sdk/extensions/discord/src/monitor/preflight-audio.runtime.d.ts +0 -3
- package/dist/plugin-sdk/extensions/discord/src/monitor/presence.d.ts +0 -5
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider-session.runtime.d.ts +0 -4
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.allowlist.d.ts +0 -14
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.d.ts +0 -61
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.lifecycle.d.ts +0 -27
- package/dist/plugin-sdk/extensions/discord/src/monitor/provider.startup.d.ts +0 -82
- package/dist/plugin-sdk/extensions/discord/src/monitor/reply-context.d.ts +0 -21
- package/dist/plugin-sdk/extensions/discord/src/monitor/reply-delivery.d.ts +0 -40
- package/dist/plugin-sdk/extensions/discord/src/monitor/rest-fetch.d.ts +0 -2
- package/dist/plugin-sdk/extensions/discord/src/monitor/route-resolution.d.ts +0 -40
- package/dist/plugin-sdk/extensions/discord/src/monitor/sender-identity.d.ts +0 -31
- package/dist/plugin-sdk/extensions/discord/src/monitor/startup-status.d.ts +0 -4
- package/dist/plugin-sdk/extensions/discord/src/monitor/status.d.ts +0 -17
- package/dist/plugin-sdk/extensions/discord/src/monitor/system-events.d.ts +0 -2
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.config.d.ts +0 -11
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.d.ts +0 -8
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.discord-api.d.ts +0 -41
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.lifecycle.d.ts +0 -60
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.manager.d.ts +0 -21
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.messages.d.ts +0 -1
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.persona.d.ts +0 -6
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.state.d.ts +0 -79
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-bindings.types.d.ts +0 -79
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-session-close.d.ts +0 -15
- package/dist/plugin-sdk/extensions/discord/src/monitor/thread-title.d.ts +0 -11
- package/dist/plugin-sdk/extensions/discord/src/monitor/threading.d.ts +0 -108
- package/dist/plugin-sdk/extensions/discord/src/monitor/timeouts.d.ts +0 -16
- package/dist/plugin-sdk/extensions/discord/src/monitor/typing.d.ts +0 -5
- package/dist/plugin-sdk/extensions/discord/src/monitor.d.ts +0 -10
- package/dist/plugin-sdk/extensions/discord/src/monitor.gateway.d.ts +0 -12
- package/dist/plugin-sdk/extensions/discord/src/normalize.d.ts +0 -14
- package/dist/plugin-sdk/extensions/discord/src/outbound-adapter.d.ts +0 -3
- package/dist/plugin-sdk/extensions/discord/src/pluralkit.d.ts +0 -26
- package/dist/plugin-sdk/extensions/discord/src/probe.d.ts +0 -37
- package/dist/plugin-sdk/extensions/discord/src/resolve-allowlist-common.d.ts +0 -11
- package/dist/plugin-sdk/extensions/discord/src/resolve-channels.d.ts +0 -15
- package/dist/plugin-sdk/extensions/discord/src/resolve-users.d.ts +0 -14
- package/dist/plugin-sdk/extensions/discord/src/retry.d.ts +0 -12
- package/dist/plugin-sdk/extensions/discord/src/send.channels.d.ts +0 -17
- package/dist/plugin-sdk/extensions/discord/src/send.components.d.ts +0 -29
- package/dist/plugin-sdk/extensions/discord/src/send.d.ts +0 -11
- package/dist/plugin-sdk/extensions/discord/src/send.emojis-stickers.d.ts +0 -4
- package/dist/plugin-sdk/extensions/discord/src/send.guild.d.ts +0 -24
- package/dist/plugin-sdk/extensions/discord/src/send.messages.d.ts +0 -20
- package/dist/plugin-sdk/extensions/discord/src/send.outbound.d.ts +0 -67
- package/dist/plugin-sdk/extensions/discord/src/send.permissions.d.ts +0 -20
- package/dist/plugin-sdk/extensions/discord/src/send.reactions.d.ts +0 -15
- package/dist/plugin-sdk/extensions/discord/src/send.shared.d.ts +0 -86
- package/dist/plugin-sdk/extensions/discord/src/send.types.d.ts +0 -148
- package/dist/plugin-sdk/extensions/discord/src/send.typing.d.ts +0 -5
- package/dist/plugin-sdk/extensions/discord/src/session-key-normalization.d.ts +0 -7
- package/dist/plugin-sdk/extensions/discord/src/shared-interactive.d.ts +0 -3
- package/dist/plugin-sdk/extensions/discord/src/status-issues.d.ts +0 -2
- package/dist/plugin-sdk/extensions/discord/src/ui.d.ts +0 -19
- package/dist/plugin-sdk/extensions/discord/src/voice/access.d.ts +0 -31
- package/dist/plugin-sdk/extensions/discord/src/voice/command.d.ts +0 -15
- package/dist/plugin-sdk/extensions/discord/src/voice/manager.d.ts +0 -59
- package/dist/plugin-sdk/extensions/discord/src/voice/manager.runtime.d.ts +0 -5
- package/dist/plugin-sdk/extensions/discord/src/voice/sdk-runtime.d.ts +0 -3
- package/dist/plugin-sdk/extensions/discord/src/voice-message.d.ts +0 -50
- package/dist/plugin-sdk/extensions/discord/timeouts.d.ts +0 -1
- package/dist/plugin-sdk/extensions/feishu/api.d.ts +0 -6
- package/dist/plugin-sdk/extensions/feishu/runtime-api.d.ts +0 -4
- package/dist/plugin-sdk/extensions/feishu/src/accounts.d.ts +0 -72
- package/dist/plugin-sdk/extensions/feishu/src/async.d.ts +0 -13
- package/dist/plugin-sdk/extensions/feishu/src/bot-content.d.ts +0 -85
- package/dist/plugin-sdk/extensions/feishu/src/bot-sender-name.d.ts +0 -19
- package/dist/plugin-sdk/extensions/feishu/src/bot.d.ts +0 -70
- package/dist/plugin-sdk/extensions/feishu/src/client.d.ts +0 -47
- package/dist/plugin-sdk/extensions/feishu/src/config-schema.d.ts +0 -550
- package/dist/plugin-sdk/extensions/feishu/src/conversation-id.d.ts +0 -19
- package/dist/plugin-sdk/extensions/feishu/src/dedup.d.ts +0 -19
- package/dist/plugin-sdk/extensions/feishu/src/dynamic-agent.d.ts +0 -18
- package/dist/plugin-sdk/extensions/feishu/src/external-keys.d.ts +0 -1
- package/dist/plugin-sdk/extensions/feishu/src/media.d.ts +0 -118
- package/dist/plugin-sdk/extensions/feishu/src/mention.d.ts +0 -52
- package/dist/plugin-sdk/extensions/feishu/src/policy.d.ts +0 -36
- package/dist/plugin-sdk/extensions/feishu/src/post.d.ts +0 -11
- package/dist/plugin-sdk/extensions/feishu/src/probe.d.ts +0 -10
- package/dist/plugin-sdk/extensions/feishu/src/reply-dispatcher.d.ts +0 -35
- package/dist/plugin-sdk/extensions/feishu/src/runtime.d.ts +0 -3
- package/dist/plugin-sdk/extensions/feishu/src/secret-input.d.ts +0 -1
- package/dist/plugin-sdk/extensions/feishu/src/send-result.d.ts +0 -12
- package/dist/plugin-sdk/extensions/feishu/src/send-target.d.ts +0 -10
- package/dist/plugin-sdk/extensions/feishu/src/send.d.ts +0 -131
- package/dist/plugin-sdk/extensions/feishu/src/setup-core.d.ts +0 -3
- package/dist/plugin-sdk/extensions/feishu/src/setup-surface.d.ts +0 -3
- package/dist/plugin-sdk/extensions/feishu/src/streaming-card.d.ts +0 -55
- package/dist/plugin-sdk/extensions/feishu/src/targets.d.ts +0 -6
- package/dist/plugin-sdk/extensions/feishu/src/thread-bindings.d.ts +0 -42
- package/dist/plugin-sdk/extensions/feishu/src/types.d.ts +0 -84
- package/dist/plugin-sdk/extensions/feishu/src/typing.d.ts +0 -57
- package/dist/plugin-sdk/extensions/github-copilot/api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/github-copilot/login.d.ts +0 -5
- package/dist/plugin-sdk/extensions/google/api.d.ts +0 -33
- package/dist/plugin-sdk/extensions/google/model-id.d.ts +0 -2
- package/dist/plugin-sdk/extensions/huggingface/api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/huggingface/models.d.ts +0 -7
- package/dist/plugin-sdk/extensions/huggingface/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/huggingface/provider-catalog.d.ts +0 -3
- package/dist/plugin-sdk/extensions/image-generation-core/api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/image-generation-core/runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/image-generation-core/src/runtime.d.ts +0 -24
- package/dist/plugin-sdk/extensions/irc/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/irc/src/accounts.d.ts +0 -23
- package/dist/plugin-sdk/extensions/irc/src/control-chars.d.ts +0 -3
- package/dist/plugin-sdk/extensions/irc/src/normalize.d.ts +0 -18
- package/dist/plugin-sdk/extensions/irc/src/runtime-api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/irc/src/setup-core.d.ts +0 -10
- package/dist/plugin-sdk/extensions/irc/src/setup-surface.d.ts +0 -4
- package/dist/plugin-sdk/extensions/irc/src/types.d.ts +0 -83
- package/dist/plugin-sdk/extensions/kilocode/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/kilocode/provider-catalog.d.ts +0 -3
- package/dist/plugin-sdk/extensions/kilocode/provider-models.d.ts +0 -18
- package/dist/plugin-sdk/extensions/kimi-coding/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/kimi-coding/onboard.d.ts +0 -5
- package/dist/plugin-sdk/extensions/kimi-coding/provider-catalog.d.ts +0 -10
- package/dist/plugin-sdk/extensions/line/runtime-api.d.ts +0 -36
- package/dist/plugin-sdk/extensions/line/src/accounts.d.ts +0 -10
- package/dist/plugin-sdk/extensions/line/src/actions.d.ts +0 -22
- package/dist/plugin-sdk/extensions/line/src/auto-reply-delivery.d.ts +0 -38
- package/dist/plugin-sdk/extensions/line/src/bot-access.d.ts +0 -17
- package/dist/plugin-sdk/extensions/line/src/bot-handlers.d.ts +0 -23
- package/dist/plugin-sdk/extensions/line/src/bot-message-context.d.ts +0 -129
- package/dist/plugin-sdk/extensions/line/src/bot.d.ts +0 -24
- package/dist/plugin-sdk/extensions/line/src/channel-access-token.d.ts +0 -4
- package/dist/plugin-sdk/extensions/line/src/config-schema.d.ts +0 -80
- package/dist/plugin-sdk/extensions/line/src/download.d.ts +0 -7
- package/dist/plugin-sdk/extensions/line/src/flex-templates/basic-cards.d.ts +0 -46
- package/dist/plugin-sdk/extensions/line/src/flex-templates/common.d.ts +0 -2
- package/dist/plugin-sdk/extensions/line/src/flex-templates/media-control-cards.d.ts +0 -73
- package/dist/plugin-sdk/extensions/line/src/flex-templates/message.d.ts +0 -6
- package/dist/plugin-sdk/extensions/line/src/flex-templates/schedule-cards.d.ts +0 -55
- package/dist/plugin-sdk/extensions/line/src/flex-templates/types.d.ts +0 -19
- package/dist/plugin-sdk/extensions/line/src/flex-templates.d.ts +0 -5
- package/dist/plugin-sdk/extensions/line/src/group-keys.d.ts +0 -17
- package/dist/plugin-sdk/extensions/line/src/markdown-to-line.d.ts +0 -67
- package/dist/plugin-sdk/extensions/line/src/monitor.d.ts +0 -28
- package/dist/plugin-sdk/extensions/line/src/probe.d.ts +0 -2
- package/dist/plugin-sdk/extensions/line/src/reply-chunks.d.ts +0 -24
- package/dist/plugin-sdk/extensions/line/src/rich-menu.d.ts +0 -50
- package/dist/plugin-sdk/extensions/line/src/send.d.ts +0 -73
- package/dist/plugin-sdk/extensions/line/src/signature.d.ts +0 -1
- package/dist/plugin-sdk/extensions/line/src/template-messages.d.ts +0 -100
- package/dist/plugin-sdk/extensions/line/src/types.d.ts +0 -120
- package/dist/plugin-sdk/extensions/line/src/webhook-node.d.ts +0 -16
- package/dist/plugin-sdk/extensions/line/src/webhook-utils.d.ts +0 -3
- package/dist/plugin-sdk/extensions/line/src/webhook.d.ts +0 -19
- package/dist/plugin-sdk/extensions/litellm/api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/litellm/onboard.d.ts +0 -7
- package/dist/plugin-sdk/extensions/matrix/api.d.ts +0 -9
- package/dist/plugin-sdk/extensions/matrix/runtime-api.d.ts +0 -12
- package/dist/plugin-sdk/extensions/matrix/src/account-selection.d.ts +0 -6
- package/dist/plugin-sdk/extensions/matrix/src/auth-precedence.d.ts +0 -11
- package/dist/plugin-sdk/extensions/matrix/src/directory-live.d.ts +0 -10
- package/dist/plugin-sdk/extensions/matrix/src/env-vars.d.ts +0 -10
- package/dist/plugin-sdk/extensions/matrix/src/matrix/account-config.d.ts +0 -10
- package/dist/plugin-sdk/extensions/matrix/src/matrix/accounts.d.ts +0 -23
- package/dist/plugin-sdk/extensions/matrix/src/matrix/actions/client.d.ts +0 -6
- package/dist/plugin-sdk/extensions/matrix/src/matrix/actions/types.d.ts +0 -68
- package/dist/plugin-sdk/extensions/matrix/src/matrix/actions/verification.d.ts +0 -78
- package/dist/plugin-sdk/extensions/matrix/src/matrix/active-client.d.ts +0 -3
- package/dist/plugin-sdk/extensions/matrix/src/matrix/async-lock.d.ts +0 -2
- package/dist/plugin-sdk/extensions/matrix/src/matrix/backup-health.d.ts +0 -19
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/config-runtime-api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/config-secret-input.runtime.d.ts +0 -1
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/config.d.ts +0 -55
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/create-client.d.ts +0 -18
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/env-auth.d.ts +0 -23
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/file-sync-store.d.ts +0 -29
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/logging.d.ts +0 -13
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/migration-snapshot.runtime.d.ts +0 -1
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/private-network-host.d.ts +0 -1
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/runtime.d.ts +0 -1
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/shared.d.ts +0 -24
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/storage.d.ts +0 -30
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client/types.d.ts +0 -47
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client-bootstrap.d.ts +0 -25
- package/dist/plugin-sdk/extensions/matrix/src/matrix/client.d.ts +0 -6
- package/dist/plugin-sdk/extensions/matrix/src/matrix/config-paths.d.ts +0 -4
- package/dist/plugin-sdk/extensions/matrix/src/matrix/config-update.d.ts +0 -24
- package/dist/plugin-sdk/extensions/matrix/src/matrix/credentials-read.d.ts +0 -17
- package/dist/plugin-sdk/extensions/matrix/src/matrix/credentials-write.runtime.d.ts +0 -3
- package/dist/plugin-sdk/extensions/matrix/src/matrix/credentials.d.ts +0 -5
- package/dist/plugin-sdk/extensions/matrix/src/matrix/deps.d.ts +0 -25
- package/dist/plugin-sdk/extensions/matrix/src/matrix/direct-management.d.ts +0 -53
- package/dist/plugin-sdk/extensions/matrix/src/matrix/direct-room.d.ts +0 -27
- package/dist/plugin-sdk/extensions/matrix/src/matrix/encryption-guidance.d.ts +0 -4
- package/dist/plugin-sdk/extensions/matrix/src/matrix/errors.d.ts +0 -1
- package/dist/plugin-sdk/extensions/matrix/src/matrix/format.d.ts +0 -17
- package/dist/plugin-sdk/extensions/matrix/src/matrix/outbound-media-runtime.d.ts +0 -1
- package/dist/plugin-sdk/extensions/matrix/src/matrix/poll-types.d.ts +0 -114
- package/dist/plugin-sdk/extensions/matrix/src/matrix/reaction-common.d.ts +0 -32
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/crypto-bootstrap.d.ts +0 -34
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/crypto-facade.d.ts +0 -67
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/crypto-node.runtime.d.ts +0 -2
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/crypto-runtime.d.ts +0 -10
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/decrypt-bridge.d.ts +0 -45
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/event-helpers.d.ts +0 -10
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/http-client.d.ts +0 -34
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/idb-persistence-lock.d.ts +0 -4
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/idb-persistence.d.ts +0 -5
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/logger.d.ts +0 -25
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/read-response-with-limit.d.ts +0 -11
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/recovery-key-store.d.ts +0 -48
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/transport.d.ts +0 -29
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/types.d.ts +0 -186
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/verification-manager.d.ts +0 -127
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk/verification-status.d.ts +0 -4
- package/dist/plugin-sdk/extensions/matrix/src/matrix/sdk.d.ts +0 -212
- package/dist/plugin-sdk/extensions/matrix/src/matrix/send/client.d.ts +0 -15
- package/dist/plugin-sdk/extensions/matrix/src/matrix/send/formatting.d.ts +0 -25
- package/dist/plugin-sdk/extensions/matrix/src/matrix/send/media.d.ts +0 -42
- package/dist/plugin-sdk/extensions/matrix/src/matrix/send/targets.d.ts +0 -3
- package/dist/plugin-sdk/extensions/matrix/src/matrix/send/types.d.ts +0 -80
- package/dist/plugin-sdk/extensions/matrix/src/matrix/send.d.ts +0 -54
- package/dist/plugin-sdk/extensions/matrix/src/matrix/target-ids.d.ts +0 -19
- package/dist/plugin-sdk/extensions/matrix/src/matrix/thread-bindings-shared.d.ts +0 -77
- package/dist/plugin-sdk/extensions/matrix/src/matrix/thread-bindings.d.ts +0 -15
- package/dist/plugin-sdk/extensions/matrix/src/onboarding.d.ts +0 -2
- package/dist/plugin-sdk/extensions/matrix/src/resolve-targets.d.ts +0 -8
- package/dist/plugin-sdk/extensions/matrix/src/runtime-api.d.ts +0 -11
- package/dist/plugin-sdk/extensions/matrix/src/runtime.d.ts +0 -3
- package/dist/plugin-sdk/extensions/matrix/src/setup-bootstrap.d.ts +0 -20
- package/dist/plugin-sdk/extensions/matrix/src/setup-config.d.ts +0 -12
- package/dist/plugin-sdk/extensions/matrix/src/setup-core.d.ts +0 -2
- package/dist/plugin-sdk/extensions/matrix/src/setup-surface.d.ts +0 -1
- package/dist/plugin-sdk/extensions/matrix/src/storage-paths.d.ts +0 -26
- package/dist/plugin-sdk/extensions/matrix/src/types.d.ts +0 -202
- package/dist/plugin-sdk/extensions/mattermost/api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/mattermost/runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/mattermost/src/mattermost/accounts.d.ts +0 -33
- package/dist/plugin-sdk/extensions/mattermost/src/mattermost/client.d.ts +0 -103
- package/dist/plugin-sdk/extensions/mattermost/src/mattermost/monitor-auth.d.ts +0 -51
- package/dist/plugin-sdk/extensions/mattermost/src/mattermost/runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/mattermost/src/runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/mattermost/src/secret-input.d.ts +0 -2
- package/dist/plugin-sdk/extensions/mattermost/src/types.d.ts +0 -105
- package/dist/plugin-sdk/extensions/media-understanding-core/runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/media-understanding-core/src/runtime.d.ts +0 -54
- package/dist/plugin-sdk/extensions/memory-core/runtime-api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/memory-core/src/memory/embeddings.d.ts +0 -21
- package/dist/plugin-sdk/extensions/memory-core/src/memory/hybrid.d.ts +0 -45
- package/dist/plugin-sdk/extensions/memory-core/src/memory/index.d.ts +0 -3
- package/dist/plugin-sdk/extensions/memory-core/src/memory/manager-embedding-ops.d.ts +0 -47
- package/dist/plugin-sdk/extensions/memory-core/src/memory/manager-runtime.d.ts +0 -1
- package/dist/plugin-sdk/extensions/memory-core/src/memory/manager-search.d.ts +0 -61
- package/dist/plugin-sdk/extensions/memory-core/src/memory/manager-sync-ops.d.ts +0 -142
- package/dist/plugin-sdk/extensions/memory-core/src/memory/manager.d.ts +0 -155
- package/dist/plugin-sdk/extensions/memory-core/src/memory/mmr.d.ts +0 -67
- package/dist/plugin-sdk/extensions/memory-core/src/memory/provider-adapters.d.ts +0 -19
- package/dist/plugin-sdk/extensions/memory-core/src/memory/qmd-manager.d.ts +0 -191
- package/dist/plugin-sdk/extensions/memory-core/src/memory/search-manager.d.ts +0 -12
- package/dist/plugin-sdk/extensions/memory-core/src/memory/temporal-decay.d.ts +0 -25
- package/dist/plugin-sdk/extensions/minimax/api.d.ts +0 -4
- package/dist/plugin-sdk/extensions/minimax/model-definitions.d.ts +0 -35
- package/dist/plugin-sdk/extensions/minimax/onboard.d.ts +0 -5
- package/dist/plugin-sdk/extensions/minimax/provider-catalog.d.ts +0 -3
- package/dist/plugin-sdk/extensions/minimax/provider-models.d.ts +0 -15
- package/dist/plugin-sdk/extensions/mistral/api.d.ts +0 -11
- package/dist/plugin-sdk/extensions/mistral/model-definitions.d.ts +0 -14
- package/dist/plugin-sdk/extensions/mistral/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/mistral/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/modelstudio/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/modelstudio/models.d.ts +0 -27
- package/dist/plugin-sdk/extensions/modelstudio/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/moonshot/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/moonshot/onboard.d.ts +0 -6
- package/dist/plugin-sdk/extensions/moonshot/provider-catalog.d.ts +0 -7
- package/dist/plugin-sdk/extensions/nvidia/api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/nvidia/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/ollama/api.d.ts +0 -4
- package/dist/plugin-sdk/extensions/ollama/runtime-api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/ollama/src/defaults.d.ts +0 -11
- package/dist/plugin-sdk/extensions/ollama/src/embedding-provider.d.ts +0 -37
- package/dist/plugin-sdk/extensions/ollama/src/provider-models.d.ts +0 -31
- package/dist/plugin-sdk/extensions/ollama/src/setup.d.ts +0 -36
- package/dist/plugin-sdk/extensions/ollama/src/stream.d.ts +0 -104
- package/dist/plugin-sdk/extensions/openai/api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/openai/default-models.d.ts +0 -10
- package/dist/plugin-sdk/extensions/openai/openai-codex-catalog.d.ts +0 -3
- package/dist/plugin-sdk/extensions/openai/openai-provider.d.ts +0 -2
- package/dist/plugin-sdk/extensions/openai/shared.d.ts +0 -5
- package/dist/plugin-sdk/extensions/opencode/api.d.ts +0 -6
- package/dist/plugin-sdk/extensions/opencode/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/opencode-go/api.d.ts +0 -5
- package/dist/plugin-sdk/extensions/opencode-go/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/openrouter/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/openrouter/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/openrouter/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/qianfan/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/qianfan/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/qianfan/provider-catalog.d.ts +0 -4
- package/dist/plugin-sdk/extensions/sglang/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/sglang/defaults.d.ts +0 -4
- package/dist/plugin-sdk/extensions/sglang/models.d.ts +0 -8
- package/dist/plugin-sdk/extensions/signal/api.d.ts +0 -11
- package/dist/plugin-sdk/extensions/signal/reaction-runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/signal/src/accounts.d.ts +0 -17
- package/dist/plugin-sdk/extensions/signal/src/client.d.ts +0 -32
- package/dist/plugin-sdk/extensions/signal/src/daemon.d.ts +0 -26
- package/dist/plugin-sdk/extensions/signal/src/format.d.ts +0 -17
- package/dist/plugin-sdk/extensions/signal/src/identity.d.ts +0 -25
- package/dist/plugin-sdk/extensions/signal/src/message-actions.d.ts +0 -2
- package/dist/plugin-sdk/extensions/signal/src/monitor/access-policy.d.ts +0 -40
- package/dist/plugin-sdk/extensions/signal/src/monitor/event-handler.d.ts +0 -5
- package/dist/plugin-sdk/extensions/signal/src/monitor/event-handler.types.d.ts +0 -128
- package/dist/plugin-sdk/extensions/signal/src/monitor/inbound-context.d.ts +0 -17
- package/dist/plugin-sdk/extensions/signal/src/monitor/mentions.d.ts +0 -2
- package/dist/plugin-sdk/extensions/signal/src/monitor.d.ts +0 -26
- package/dist/plugin-sdk/extensions/signal/src/normalize.d.ts +0 -2
- package/dist/plugin-sdk/extensions/signal/src/outbound-session.d.ts +0 -8
- package/dist/plugin-sdk/extensions/signal/src/probe.d.ts +0 -7
- package/dist/plugin-sdk/extensions/signal/src/reaction-level.d.ts +0 -17
- package/dist/plugin-sdk/extensions/signal/src/rpc-context.d.ts +0 -9
- package/dist/plugin-sdk/extensions/signal/src/runtime-api.d.ts +0 -25
- package/dist/plugin-sdk/extensions/signal/src/send-reactions.d.ts +0 -34
- package/dist/plugin-sdk/extensions/signal/src/send.d.ts +0 -32
- package/dist/plugin-sdk/extensions/signal/src/setup-core.d.ts +0 -20
- package/dist/plugin-sdk/extensions/signal/src/sse-reconnect.d.ts +0 -12
- package/dist/plugin-sdk/extensions/slack/api.d.ts +0 -19
- package/dist/plugin-sdk/extensions/slack/runtime-api.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/account-inspect.d.ts +0 -32
- package/dist/plugin-sdk/extensions/slack/src/account-surface-fields.d.ts +0 -14
- package/dist/plugin-sdk/extensions/slack/src/accounts.d.ts +0 -25
- package/dist/plugin-sdk/extensions/slack/src/accounts.runtime.d.ts +0 -1
- package/dist/plugin-sdk/extensions/slack/src/action-runtime.d.ts +0 -38
- package/dist/plugin-sdk/extensions/slack/src/action-threading.d.ts +0 -11
- package/dist/plugin-sdk/extensions/slack/src/actions.d.ts +0 -81
- package/dist/plugin-sdk/extensions/slack/src/actions.runtime.d.ts +0 -1
- package/dist/plugin-sdk/extensions/slack/src/approval-auth.d.ts +0 -25
- package/dist/plugin-sdk/extensions/slack/src/approval-native.d.ts +0 -10
- package/dist/plugin-sdk/extensions/slack/src/blocks-fallback.d.ts +0 -2
- package/dist/plugin-sdk/extensions/slack/src/blocks-input.d.ts +0 -4
- package/dist/plugin-sdk/extensions/slack/src/blocks-render.d.ts +0 -6
- package/dist/plugin-sdk/extensions/slack/src/channel-actions.d.ts +0 -7
- package/dist/plugin-sdk/extensions/slack/src/channel-migration.d.ts +0 -20
- package/dist/plugin-sdk/extensions/slack/src/channel-type.d.ts +0 -6
- package/dist/plugin-sdk/extensions/slack/src/channel.d.ts +0 -4
- package/dist/plugin-sdk/extensions/slack/src/client.d.ts +0 -7
- package/dist/plugin-sdk/extensions/slack/src/config-schema.d.ts +0 -1
- package/dist/plugin-sdk/extensions/slack/src/config-ui-hints.d.ts +0 -98
- package/dist/plugin-sdk/extensions/slack/src/directory-config.d.ts +0 -3
- package/dist/plugin-sdk/extensions/slack/src/directory-live.d.ts +0 -3
- package/dist/plugin-sdk/extensions/slack/src/draft-stream.d.ts +0 -25
- package/dist/plugin-sdk/extensions/slack/src/exec-approvals.d.ts +0 -43
- package/dist/plugin-sdk/extensions/slack/src/format.d.ts +0 -8
- package/dist/plugin-sdk/extensions/slack/src/group-policy.d.ts +0 -4
- package/dist/plugin-sdk/extensions/slack/src/http/index.d.ts +0 -1
- package/dist/plugin-sdk/extensions/slack/src/http/registry.d.ts +0 -12
- package/dist/plugin-sdk/extensions/slack/src/index.d.ts +0 -7
- package/dist/plugin-sdk/extensions/slack/src/interactive-replies.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/limits.d.ts +0 -1
- package/dist/plugin-sdk/extensions/slack/src/message-action-dispatch.d.ts +0 -12
- package/dist/plugin-sdk/extensions/slack/src/message-actions.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/message-tool-schema.d.ts +0 -1
- package/dist/plugin-sdk/extensions/slack/src/modal-metadata.d.ts +0 -8
- package/dist/plugin-sdk/extensions/slack/src/monitor/allow-list.d.ts +0 -24
- package/dist/plugin-sdk/extensions/slack/src/monitor/auth.d.ts +0 -29
- package/dist/plugin-sdk/extensions/slack/src/monitor/channel-config.d.ts +0 -45
- package/dist/plugin-sdk/extensions/slack/src/monitor/channel-type.d.ts +0 -3
- package/dist/plugin-sdk/extensions/slack/src/monitor/commands.d.ts +0 -9
- package/dist/plugin-sdk/extensions/slack/src/monitor/context.d.ts +0 -107
- package/dist/plugin-sdk/extensions/slack/src/monitor/dm-auth.d.ts +0 -17
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/channels.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.block-actions.d.ts +0 -49
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.d.ts +0 -4
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/interactions.modal.d.ts +0 -68
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/members.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/message-subtype-handlers.d.ts +0 -13
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/messages.d.ts +0 -6
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/pins.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/reactions.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/monitor/events/system-event-context.d.ts +0 -12
- package/dist/plugin-sdk/extensions/slack/src/monitor/events.d.ts +0 -10
- package/dist/plugin-sdk/extensions/slack/src/monitor/exec-approvals.d.ts +0 -26
- package/dist/plugin-sdk/extensions/slack/src/monitor/external-arg-menu-store.d.ts +0 -18
- package/dist/plugin-sdk/extensions/slack/src/monitor/media.d.ts +0 -67
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/dispatch.d.ts +0 -21
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare-content.d.ts +0 -14
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare-thread-context.d.ts +0 -28
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare.d.ts +0 -13
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/prepare.test-helpers.d.ts +0 -12
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/preview-finalize.d.ts +0 -44
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler/types.d.ts +0 -23
- package/dist/plugin-sdk/extensions/slack/src/monitor/message-handler.d.ts +0 -22
- package/dist/plugin-sdk/extensions/slack/src/monitor/mrkdwn.d.ts +0 -1
- package/dist/plugin-sdk/extensions/slack/src/monitor/policy.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/monitor/provider.d.ts +0 -33
- package/dist/plugin-sdk/extensions/slack/src/monitor/reconnect-policy.d.ts +0 -25
- package/dist/plugin-sdk/extensions/slack/src/monitor/replies.d.ts +0 -56
- package/dist/plugin-sdk/extensions/slack/src/monitor/room-context.d.ts +0 -14
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-commands.runtime.d.ts +0 -11
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-dispatch.runtime.d.ts +0 -17
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash-skill-commands.runtime.d.ts +0 -3
- package/dist/plugin-sdk/extensions/slack/src/monitor/slash.d.ts +0 -6
- package/dist/plugin-sdk/extensions/slack/src/monitor/thread-resolution.d.ts +0 -12
- package/dist/plugin-sdk/extensions/slack/src/monitor/types.d.ts +0 -113
- package/dist/plugin-sdk/extensions/slack/src/monitor.d.ts +0 -5
- package/dist/plugin-sdk/extensions/slack/src/outbound-adapter.d.ts +0 -2
- package/dist/plugin-sdk/extensions/slack/src/probe.d.ts +0 -14
- package/dist/plugin-sdk/extensions/slack/src/reply-blocks.d.ts +0 -3
- package/dist/plugin-sdk/extensions/slack/src/resolve-allowlist-common.d.ts +0 -29
- package/dist/plugin-sdk/extensions/slack/src/resolve-channels.d.ts +0 -19
- package/dist/plugin-sdk/extensions/slack/src/resolve-users.d.ts +0 -26
- package/dist/plugin-sdk/extensions/slack/src/runtime-api.d.ts +0 -6
- package/dist/plugin-sdk/extensions/slack/src/runtime.d.ts +0 -3
- package/dist/plugin-sdk/extensions/slack/src/scopes.d.ts +0 -7
- package/dist/plugin-sdk/extensions/slack/src/send.d.ts +0 -32
- package/dist/plugin-sdk/extensions/slack/src/sent-thread-cache.d.ts +0 -3
- package/dist/plugin-sdk/extensions/slack/src/setup-core.d.ts +0 -80
- package/dist/plugin-sdk/extensions/slack/src/setup-surface.d.ts +0 -2
- package/dist/plugin-sdk/extensions/slack/src/shared.d.ts +0 -39
- package/dist/plugin-sdk/extensions/slack/src/stream-mode.d.ts +0 -23
- package/dist/plugin-sdk/extensions/slack/src/streaming.d.ts +0 -72
- package/dist/plugin-sdk/extensions/slack/src/targets.d.ts +0 -9
- package/dist/plugin-sdk/extensions/slack/src/threading-tool-context.d.ts +0 -10
- package/dist/plugin-sdk/extensions/slack/src/threading.d.ts +0 -29
- package/dist/plugin-sdk/extensions/slack/src/token.d.ts +0 -4
- package/dist/plugin-sdk/extensions/slack/src/truncate.d.ts +0 -1
- package/dist/plugin-sdk/extensions/slack/src/types.d.ts +0 -58
- package/dist/plugin-sdk/extensions/slack/test-api.d.ts +0 -9
- package/dist/plugin-sdk/extensions/speech-core/api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/speech-core/runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/speech-core/src/tts.d.ts +0 -145
- package/dist/plugin-sdk/extensions/synthetic/api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/synthetic/models.d.ts +0 -160
- package/dist/plugin-sdk/extensions/synthetic/onboard.d.ts +0 -5
- package/dist/plugin-sdk/extensions/synthetic/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/together/api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/together/models.d.ts +0 -4
- package/dist/plugin-sdk/extensions/together/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/together/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/venice/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/venice/models.d.ts +0 -345
- package/dist/plugin-sdk/extensions/venice/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/vercel-ai-gateway/api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/vercel-ai-gateway/models.d.ts +0 -15
- package/dist/plugin-sdk/extensions/vercel-ai-gateway/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/vercel-ai-gateway/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/vllm/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/vllm/defaults.d.ts +0 -4
- package/dist/plugin-sdk/extensions/vllm/models.d.ts +0 -8
- package/dist/plugin-sdk/extensions/volcengine/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/volcengine/models.d.ts +0 -94
- package/dist/plugin-sdk/extensions/volcengine/provider-catalog.d.ts +0 -3
- package/dist/plugin-sdk/extensions/whatsapp/api.d.ts +0 -10
- package/dist/plugin-sdk/extensions/whatsapp/constants.d.ts +0 -1
- package/dist/plugin-sdk/extensions/whatsapp/light-runtime-api.d.ts +0 -4
- package/dist/plugin-sdk/extensions/whatsapp/login-qr-api.d.ts +0 -5
- package/dist/plugin-sdk/extensions/whatsapp/runtime-api.d.ts +0 -14
- package/dist/plugin-sdk/extensions/whatsapp/src/account-config.d.ts +0 -8
- package/dist/plugin-sdk/extensions/whatsapp/src/accounts.d.ts +0 -43
- package/dist/plugin-sdk/extensions/whatsapp/src/action-runtime-target-auth.d.ts +0 -10
- package/dist/plugin-sdk/extensions/whatsapp/src/action-runtime.d.ts +0 -9
- package/dist/plugin-sdk/extensions/whatsapp/src/agent-tools-login.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/auth-store.d.ts +0 -31
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/constants.d.ts +0 -1
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/deliver-reply.d.ts +0 -19
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/heartbeat-runner.d.ts +0 -20
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/loggers.d.ts +0 -4
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/mentions.d.ts +0 -19
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/ack-reaction.d.ts +0 -13
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/broadcast.d.ts +0 -16
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/commands.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/echo.d.ts +0 -17
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-activation.d.ts +0 -9
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-gating.d.ts +0 -33
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/group-members.d.ts +0 -6
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/inbound-context.d.ts +0 -28
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/inbound-dispatch.d.ts +0 -140
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/last-route.d.ts +0 -15
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/message-line.d.ts +0 -11
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/on-message.d.ts +0 -24
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/peer.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/process-message.d.ts +0 -31
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor/runtime-api.d.ts +0 -14
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor-state.d.ts +0 -18
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/monitor.d.ts +0 -5
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/session-snapshot.d.ts +0 -17
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/types.d.ts +0 -33
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply/util.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply.d.ts +0 -1
- package/dist/plugin-sdk/extensions/whatsapp/src/auto-reply.impl.d.ts +0 -6
- package/dist/plugin-sdk/extensions/whatsapp/src/channel.runtime.d.ts +0 -23
- package/dist/plugin-sdk/extensions/whatsapp/src/creds-files.d.ts +0 -3
- package/dist/plugin-sdk/extensions/whatsapp/src/directory-config.d.ts +0 -3
- package/dist/plugin-sdk/extensions/whatsapp/src/group-policy.d.ts +0 -14
- package/dist/plugin-sdk/extensions/whatsapp/src/identity.d.ts +0 -52
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/access-control.d.ts +0 -36
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/dedupe.d.ts +0 -12
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/extract.d.ts +0 -8
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/lifecycle.d.ts +0 -14
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/media.d.ts +0 -7
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/monitor.d.ts +0 -32
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/send-api.d.ts +0 -22
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound/types.d.ts +0 -48
- package/dist/plugin-sdk/extensions/whatsapp/src/inbound.d.ts +0 -4
- package/dist/plugin-sdk/extensions/whatsapp/src/login-qr.d.ts +0 -19
- package/dist/plugin-sdk/extensions/whatsapp/src/login.d.ts +0 -3
- package/dist/plugin-sdk/extensions/whatsapp/src/media.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/normalize-target.d.ts +0 -3
- package/dist/plugin-sdk/extensions/whatsapp/src/normalize.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/qr-image.d.ts +0 -1
- package/dist/plugin-sdk/extensions/whatsapp/src/reaction-level.d.ts +0 -9
- package/dist/plugin-sdk/extensions/whatsapp/src/reconnect.d.ts +0 -11
- package/dist/plugin-sdk/extensions/whatsapp/src/resolve-outbound-target.d.ts +0 -12
- package/dist/plugin-sdk/extensions/whatsapp/src/runtime-api.d.ts +0 -16
- package/dist/plugin-sdk/extensions/whatsapp/src/send.d.ts +0 -32
- package/dist/plugin-sdk/extensions/whatsapp/src/session-errors.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/session.d.ts +0 -17
- package/dist/plugin-sdk/extensions/whatsapp/src/setup-core.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/setup-surface.d.ts +0 -2
- package/dist/plugin-sdk/extensions/whatsapp/src/vcard.d.ts +0 -6
- package/dist/plugin-sdk/extensions/xai/api.d.ts +0 -27
- package/dist/plugin-sdk/extensions/xai/model-definitions.d.ts +0 -13
- package/dist/plugin-sdk/extensions/xai/model-id.d.ts +0 -1
- package/dist/plugin-sdk/extensions/xai/onboard.d.ts +0 -5
- package/dist/plugin-sdk/extensions/xai/provider-catalog.d.ts +0 -2
- package/dist/plugin-sdk/extensions/xai/provider-models.d.ts +0 -6
- package/dist/plugin-sdk/extensions/xiaomi/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/xiaomi/onboard.d.ts +0 -4
- package/dist/plugin-sdk/extensions/xiaomi/provider-catalog.d.ts +0 -3
- package/dist/plugin-sdk/extensions/zai/api.d.ts +0 -2
- package/dist/plugin-sdk/extensions/zai/model-definitions.d.ts +0 -23
- package/dist/plugin-sdk/extensions/zai/onboard.d.ts +0 -10
- package/dist/plugin-sdk/extensions/zalo/api.d.ts +0 -3
- package/dist/plugin-sdk/extensions/zalo/runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/zalo/src/accounts.d.ts +0 -11
- package/dist/plugin-sdk/extensions/zalo/src/group-access.d.ts +0 -17
- package/dist/plugin-sdk/extensions/zalo/src/runtime-api.d.ts +0 -1
- package/dist/plugin-sdk/extensions/zalo/src/secret-input.d.ts +0 -1
- package/dist/plugin-sdk/extensions/zalo/src/setup-core.d.ts +0 -1
- package/dist/plugin-sdk/extensions/zalo/src/setup-surface.d.ts +0 -3
- package/dist/plugin-sdk/extensions/zalo/src/token.d.ts +0 -8
- package/dist/plugin-sdk/extensions/zalo/src/types.d.ts +0 -46
- package/dist/plugin-sdk/feishu-conversation.d.ts +0 -1
- package/dist/plugin-sdk/feishu-setup.d.ts +0 -1
- package/dist/plugin-sdk/feishu.d.ts +0 -1
- package/dist/plugin-sdk/fetch-runtime.d.ts +0 -1
- package/dist/plugin-sdk/file-lock.d.ts +0 -1
- package/dist/plugin-sdk/gateway-runtime.d.ts +0 -1
- package/dist/plugin-sdk/github-copilot-login.d.ts +0 -1
- package/dist/plugin-sdk/github-copilot-token.d.ts +0 -1
- package/dist/plugin-sdk/global-singleton.d.ts +0 -1
- package/dist/plugin-sdk/google.d.ts +0 -1
- package/dist/plugin-sdk/googlechat.d.ts +0 -1
- package/dist/plugin-sdk/group-access.d.ts +0 -1
- package/dist/plugin-sdk/hook-runtime.d.ts +0 -1
- package/dist/plugin-sdk/host-runtime.d.ts +0 -1
- package/dist/plugin-sdk/huggingface.d.ts +0 -1
- package/dist/plugin-sdk/image-generation-core.d.ts +0 -1
- package/dist/plugin-sdk/image-generation.d.ts +0 -1
- package/dist/plugin-sdk/index.d.ts +0 -1
- package/dist/plugin-sdk/infra-runtime.d.ts +0 -1
- package/dist/plugin-sdk/interactive-runtime.d.ts +0 -1
- package/dist/plugin-sdk/irc-surface.d.ts +0 -1
- package/dist/plugin-sdk/irc.d.ts +0 -1
- package/dist/plugin-sdk/json-store.d.ts +0 -1
- package/dist/plugin-sdk/keyed-async-queue.d.ts +0 -1
- package/dist/plugin-sdk/kilocode.d.ts +0 -1
- package/dist/plugin-sdk/kimi-coding.d.ts +0 -1
- package/dist/plugin-sdk/lazy-runtime.d.ts +0 -1
- package/dist/plugin-sdk/line-core.d.ts +0 -1
- package/dist/plugin-sdk/line-runtime.d.ts +0 -1
- package/dist/plugin-sdk/line-surface.d.ts +0 -1
- package/dist/plugin-sdk/line.d.ts +0 -1
- package/dist/plugin-sdk/llm-task.d.ts +0 -1
- package/dist/plugin-sdk/logging-core.d.ts +0 -1
- package/dist/plugin-sdk/markdown-table-runtime.d.ts +0 -1
- package/dist/plugin-sdk/matrix-helper.d.ts +0 -1
- package/dist/plugin-sdk/matrix-runtime-heavy.d.ts +0 -1
- package/dist/plugin-sdk/matrix-runtime-shared.d.ts +0 -1
- package/dist/plugin-sdk/matrix-runtime-surface.d.ts +0 -1
- package/dist/plugin-sdk/matrix-surface.d.ts +0 -1
- package/dist/plugin-sdk/matrix-thread-bindings.d.ts +0 -1
- package/dist/plugin-sdk/matrix.d.ts +0 -1
- package/dist/plugin-sdk/mattermost-policy.d.ts +0 -1
- package/dist/plugin-sdk/mattermost.d.ts +0 -1
- package/dist/plugin-sdk/media-runtime.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding-runtime.d.ts +0 -1
- package/dist/plugin-sdk/media-understanding.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-engine-runtime.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-engine-embeddings.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-engine-foundation.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-engine-qmd.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-engine-storage.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-multimodal.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-query.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-runtime-cli.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-runtime-core.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-runtime-files.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-secret.d.ts +0 -1
- package/dist/plugin-sdk/memory-core-host-status.d.ts +0 -1
- package/dist/plugin-sdk/memory-core.d.ts +0 -1
- package/dist/plugin-sdk/memory-lancedb.d.ts +0 -1
- package/dist/plugin-sdk/minimax.d.ts +0 -1
- package/dist/plugin-sdk/mistral.d.ts +0 -1
- package/dist/plugin-sdk/models-provider-runtime.d.ts +0 -1
- package/dist/plugin-sdk/modelstudio-definitions.d.ts +0 -1
- package/dist/plugin-sdk/modelstudio.d.ts +0 -1
- package/dist/plugin-sdk/moonshot.d.ts +0 -1
- package/dist/plugin-sdk/msteams.d.ts +0 -1
- package/dist/plugin-sdk/native-command-registry.d.ts +0 -1
- package/dist/plugin-sdk/nextcloud-talk.d.ts +0 -1
- package/dist/plugin-sdk/nostr.d.ts +0 -1
- package/dist/plugin-sdk/nvidia.d.ts +0 -1
- package/dist/plugin-sdk/ollama-surface.d.ts +0 -1
- package/dist/plugin-sdk/ollama.d.ts +0 -1
- package/dist/plugin-sdk/openai.d.ts +0 -1
- package/dist/plugin-sdk/opencode-go.d.ts +0 -1
- package/dist/plugin-sdk/opencode.d.ts +0 -1
- package/dist/plugin-sdk/outbound-runtime.d.ts +0 -1
- package/dist/plugin-sdk/packages/memory-host-sdk/src/engine-embeddings.d.ts +0 -16
- package/dist/plugin-sdk/packages/memory-host-sdk/src/engine-foundation.d.ts +0 -20
- package/dist/plugin-sdk/packages/memory-host-sdk/src/engine-qmd.d.ts +0 -5
- package/dist/plugin-sdk/packages/memory-host-sdk/src/engine.d.ts +0 -4
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-embedding-common.d.ts +0 -9
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-error-utils.d.ts +0 -15
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-gemini.d.ts +0 -46
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-http.d.ts +0 -8
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-openai.d.ts +0 -19
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-output.d.ts +0 -23
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-provider-common.d.ts +0 -9
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-runner.d.ts +0 -38
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-status.d.ts +0 -27
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-upload.d.ts +0 -6
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-utils.d.ts +0 -11
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/batch-voyage.d.ts +0 -29
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embedding-chunk-limits.d.ts +0 -3
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embedding-model-limits.d.ts +0 -2
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embedding-vectors.d.ts +0 -1
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-debug.d.ts +0 -1
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-gemini.d.ts +0 -63
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-mistral.d.ts +0 -15
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-model-normalize.d.ts +0 -5
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-ollama.d.ts +0 -2
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-openai.d.ts +0 -15
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-remote-client.d.ts +0 -12
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-remote-fetch.d.ts +0 -8
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-remote-provider.d.ts +0 -21
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings-voyage.d.ts +0 -15
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/embeddings.d.ts +0 -59
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/node-llama.d.ts +0 -8
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/post-json.d.ts +0 -10
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/qmd-process.d.ts +0 -34
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/qmd-query-parser.d.ts +0 -11
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/qmd-scope.d.ts +0 -4
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/remote-http.d.ts +0 -9
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/secret-input.d.ts +0 -5
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/session-files.d.ts +0 -14
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/status-format.d.ts +0 -28
- package/dist/plugin-sdk/packages/memory-host-sdk/src/host/test-helpers/ssrf.d.ts +0 -2
- package/dist/plugin-sdk/packages/memory-host-sdk/src/runtime-cli.d.ts +0 -9
- package/dist/plugin-sdk/packages/memory-host-sdk/src/runtime-core.d.ts +0 -17
- package/dist/plugin-sdk/packages/memory-host-sdk/src/runtime-files.d.ts +0 -4
- package/dist/plugin-sdk/packages/memory-host-sdk/src/runtime.d.ts +0 -3
- package/dist/plugin-sdk/packages/memory-host-sdk/src/secret.d.ts +0 -1
- package/dist/plugin-sdk/packages/memory-host-sdk/src/status.d.ts +0 -1
- package/dist/plugin-sdk/param-readers.d.ts +0 -1
- package/dist/plugin-sdk/plugin-entry.d.ts +0 -1
- package/dist/plugin-sdk/plugin-runtime.d.ts +0 -1
- package/dist/plugin-sdk/process-runtime.d.ts +0 -1
- package/dist/plugin-sdk/provider-auth-api-key.d.ts +0 -1
- package/dist/plugin-sdk/provider-auth-login.d.ts +0 -1
- package/dist/plugin-sdk/provider-auth-result.d.ts +0 -1
- package/dist/plugin-sdk/provider-auth-runtime.d.ts +0 -1
- package/dist/plugin-sdk/provider-auth.d.ts +0 -1
- package/dist/plugin-sdk/provider-catalog-shared.d.ts +0 -1
- package/dist/plugin-sdk/provider-entry.d.ts +0 -1
- package/dist/plugin-sdk/provider-env-vars.d.ts +0 -1
- package/dist/plugin-sdk/provider-http.d.ts +0 -1
- package/dist/plugin-sdk/provider-model-shared.d.ts +0 -1
- package/dist/plugin-sdk/provider-moonshot.d.ts +0 -1
- package/dist/plugin-sdk/provider-onboard.d.ts +0 -1
- package/dist/plugin-sdk/provider-setup.d.ts +0 -1
- package/dist/plugin-sdk/provider-stream.d.ts +0 -1
- package/dist/plugin-sdk/provider-tools.d.ts +0 -1
- package/dist/plugin-sdk/provider-usage.d.ts +0 -1
- package/dist/plugin-sdk/provider-web-fetch.d.ts +0 -1
- package/dist/plugin-sdk/provider-web-search.d.ts +0 -1
- package/dist/plugin-sdk/provider-zai-endpoint.d.ts +0 -1
- package/dist/plugin-sdk/qianfan.d.ts +0 -1
- package/dist/plugin-sdk/reply-chunking.d.ts +0 -1
- package/dist/plugin-sdk/reply-dispatch-runtime.d.ts +0 -1
- package/dist/plugin-sdk/reply-history.d.ts +0 -1
- package/dist/plugin-sdk/reply-payload.d.ts +0 -1
- package/dist/plugin-sdk/reply-runtime.d.ts +0 -1
- package/dist/plugin-sdk/request-url.d.ts +0 -1
- package/dist/plugin-sdk/retry-runtime.d.ts +0 -1
- package/dist/plugin-sdk/routing.d.ts +0 -1
- package/dist/plugin-sdk/runtime-config-snapshot.d.ts +0 -1
- package/dist/plugin-sdk/runtime-env.d.ts +0 -1
- package/dist/plugin-sdk/runtime-group-policy.d.ts +0 -1
- package/dist/plugin-sdk/runtime-store.d.ts +0 -1
- package/dist/plugin-sdk/runtime.d.ts +0 -1
- package/dist/plugin-sdk/sandbox.d.ts +0 -1
- package/dist/plugin-sdk/scripts/lib/plugin-sdk-doc-metadata.d.ts +0 -64
- package/dist/plugin-sdk/secret-input.d.ts +0 -1
- package/dist/plugin-sdk/security-runtime.d.ts +0 -1
- package/dist/plugin-sdk/self-hosted-provider-setup.d.ts +0 -1
- package/dist/plugin-sdk/session-store-runtime.d.ts +0 -1
- package/dist/plugin-sdk/setup-adapter-runtime.d.ts +0 -1
- package/dist/plugin-sdk/setup-runtime.d.ts +0 -1
- package/dist/plugin-sdk/setup-tools.d.ts +0 -1
- package/dist/plugin-sdk/setup.d.ts +0 -1
- package/dist/plugin-sdk/sglang.d.ts +0 -1
- package/dist/plugin-sdk/signal-account.d.ts +0 -1
- package/dist/plugin-sdk/signal-surface.d.ts +0 -1
- package/dist/plugin-sdk/signal.d.ts +0 -1
- package/dist/plugin-sdk/skill-commands-runtime.d.ts +0 -1
- package/dist/plugin-sdk/slack-account.d.ts +0 -1
- package/dist/plugin-sdk/slack-core.d.ts +0 -1
- package/dist/plugin-sdk/slack-runtime-surface.d.ts +0 -1
- package/dist/plugin-sdk/slack-surface.d.ts +0 -1
- package/dist/plugin-sdk/slack-target-parser.d.ts +0 -1
- package/dist/plugin-sdk/slack-targets.d.ts +0 -1
- package/dist/plugin-sdk/slack.d.ts +0 -1
- package/dist/plugin-sdk/speech-core.d.ts +0 -1
- package/dist/plugin-sdk/speech-runtime.d.ts +0 -1
- package/dist/plugin-sdk/speech.d.ts +0 -1
- package/dist/plugin-sdk/src/acp/runtime/adapter-contract.testkit.d.ts +0 -14
- package/dist/plugin-sdk/src/agents/auth-profiles/upsert-with-lock.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/live-test-helpers.d.ts +0 -12
- package/dist/plugin-sdk/src/agents/model-allowlist-ref.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/model-catalog.d.ts +0 -35
- package/dist/plugin-sdk/src/agents/model-suppression.runtime.d.ts +0 -3
- package/dist/plugin-sdk/src/agents/openclaw-tools.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/openrouter-model-capabilities.d.ts +0 -53
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/proxy-stream-wrappers.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/pi-embedded-runner/zai-stream-wrappers.d.ts +0 -7
- package/dist/plugin-sdk/src/agents/pi-embedded.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/agents/sandbox/test-fixtures.d.ts +0 -5
- package/dist/plugin-sdk/src/agents/self-hosted-provider-defaults.d.ts +0 -8
- package/dist/plugin-sdk/src/agents/simple-completion-transport.d.ts +0 -6
- package/dist/plugin-sdk/src/agents/skills.e2e-test-helpers.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/chunk.d.ts +0 -45
- package/dist/plugin-sdk/src/auto-reply/dispatch.d.ts +0 -32
- package/dist/plugin-sdk/src/auto-reply/heartbeat-reply-payload.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/media-note.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/abort-cutoff.runtime.d.ts +0 -7
- package/dist/plugin-sdk/src/auto-reply/reply/abort.d.ts +0 -40
- package/dist/plugin-sdk/src/auto-reply/reply/abort.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/acp-projector.d.ts +0 -21
- package/dist/plugin-sdk/src/auto-reply/reply/acp-stream-settings.d.ts +0 -24
- 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 -42
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-payloads.d.ts +0 -29
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-reminder-guard.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner-usage-line.d.ts +0 -17
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner.d.ts +0 -39
- package/dist/plugin-sdk/src/auto-reply/reply/agent-runner.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/auto-topic-label-config.d.ts +0 -14
- package/dist/plugin-sdk/src/auto-reply/reply/auto-topic-label.d.ts +0 -26
- package/dist/plugin-sdk/src/auto-reply/reply/body.d.ts +0 -10
- package/dist/plugin-sdk/src/auto-reply/reply/commands-core.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/commands-core.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/commands-handlers.runtime.d.ts +0 -2
- 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 -9
- package/dist/plugin-sdk/src/auto-reply/reply/commands-spawn.test-harness.d.ts +0 -3
- 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.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/reply/commands-tasks.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/commands-tts.d.ts +0 -2
- package/dist/plugin-sdk/src/auto-reply/reply/commands.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/reply/commands.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/commands.test-harness.d.ts +0 -6
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-acp-delivery.d.ts +0 -35
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-acp.d.ts +0 -34
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-acp.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/dispatch-from-config.d.ts +0 -17
- 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-from-config.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/get-reply-inline-actions.d.ts +0 -62
- 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/history.d.ts +0 -72
- package/dist/plugin-sdk/src/auto-reply/reply/inbound-meta.d.ts +0 -4
- package/dist/plugin-sdk/src/auto-reply/reply/matrix-context.d.ts +0 -13
- package/dist/plugin-sdk/src/auto-reply/reply/memory-flush.d.ts +0 -48
- package/dist/plugin-sdk/src/auto-reply/reply/message-preprocess-hooks.d.ts +0 -7
- package/dist/plugin-sdk/src/auto-reply/reply/queue-policy.d.ts +0 -8
- package/dist/plugin-sdk/src/auto-reply/reply/reply-payloads-dedupe.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/reply-reference.d.ts +0 -20
- package/dist/plugin-sdk/src/auto-reply/reply/session-delivery.d.ts +0 -30
- package/dist/plugin-sdk/src/auto-reply/reply/session-fork.d.ts +0 -11
- package/dist/plugin-sdk/src/auto-reply/reply/session-fork.runtime.d.ts +0 -9
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-model.d.ts +0 -27
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-model.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/session-reset-prompt.d.ts +0 -9
- package/dist/plugin-sdk/src/auto-reply/reply/session-run-accounting.d.ts +0 -15
- package/dist/plugin-sdk/src/auto-reply/reply/session-updates.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/auto-reply/reply/session-usage.d.ts +0 -25
- 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/stage-sandbox-media.runtime.d.ts +0 -1
- 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/channel-web.d.ts +0 -5
- 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/native-command-session-targets.d.ts +0 -12
- package/dist/plugin-sdk/src/channels/plugins/actions/reaction-message-id.d.ts +0 -8
- package/dist/plugin-sdk/src/channels/plugins/actions/shared.d.ts +0 -7
- package/dist/plugin-sdk/src/channels/plugins/bluebubbles-actions.d.ts +0 -48
- package/dist/plugin-sdk/src/channels/plugins/bundled.d.ts +0 -7
- package/dist/plugin-sdk/src/channels/plugins/contracts/inbound-testkit.d.ts +0 -70
- package/dist/plugin-sdk/src/channels/plugins/contracts/suites.d.ts +0 -129
- package/dist/plugin-sdk/src/channels/plugins/pairing-adapters.d.ts +0 -13
- package/dist/plugin-sdk/src/channels/plugins/setup-registry.d.ts +0 -3
- package/dist/plugin-sdk/src/channels/plugins/status-issues/bluebubbles.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/plugins/types.adapters.d.ts +0 -694
- package/dist/plugin-sdk/src/channels/plugins/types.d.ts +0 -8
- package/dist/plugin-sdk/src/channels/plugins/whatsapp-shared.d.ts +0 -44
- package/dist/plugin-sdk/src/channels/registry.d.ts +0 -13
- package/dist/plugin-sdk/src/channels/run-state-machine.d.ts +0 -19
- package/dist/plugin-sdk/src/channels/sender-identity.d.ts +0 -2
- package/dist/plugin-sdk/src/channels/status-reactions.d.ts +0 -66
- package/dist/plugin-sdk/src/channels/transport/stall-watchdog.d.ts +0 -20
- package/dist/plugin-sdk/src/cli/cli-utils.d.ts +0 -19
- package/dist/plugin-sdk/src/cli/command-options.d.ts +0 -3
- package/dist/plugin-sdk/src/cli/deps.d.ts +0 -10
- package/dist/plugin-sdk/src/cli/gateway-rpc.d.ts +0 -13
- package/dist/plugin-sdk/src/cli/help-format.d.ts +0 -5
- package/dist/plugin-sdk/src/cli/progress.d.ts +0 -24
- package/dist/plugin-sdk/src/cli/send-runtime/discord.d.ts +0 -3
- package/dist/plugin-sdk/src/cli/send-runtime/imessage.d.ts +0 -12
- package/dist/plugin-sdk/src/cli/send-runtime/signal.d.ts +0 -3
- package/dist/plugin-sdk/src/cli/send-runtime/slack.d.ts +0 -3
- package/dist/plugin-sdk/src/cli/send-runtime/telegram.d.ts +0 -16
- package/dist/plugin-sdk/src/cli/send-runtime/whatsapp.d.ts +0 -4
- package/dist/plugin-sdk/src/cli/test-runtime-capture.d.ts +0 -31
- package/dist/plugin-sdk/src/commands/backup-shared.d.ts +0 -32
- package/dist/plugin-sdk/src/commands/channel-setup/registry.d.ts +0 -6
- package/dist/plugin-sdk/src/commands/channel-setup/types.d.ts +0 -1
- package/dist/plugin-sdk/src/commands/channel-test-helpers.d.ts +0 -7
- package/dist/plugin-sdk/src/commands/chutes-oauth.d.ts +0 -21
- package/dist/plugin-sdk/src/commands/cleanup-utils.d.ts +0 -36
- package/dist/plugin-sdk/src/commands/daemon-runtime.d.ts +0 -8
- package/dist/plugin-sdk/src/commands/health.d.ts +0 -63
- package/dist/plugin-sdk/src/commands/onboard-types.d.ts +0 -95
- package/dist/plugin-sdk/src/config/backup-rotation.d.ts +0 -58
- package/dist/plugin-sdk/src/config/config.d.ts +0 -8
- package/dist/plugin-sdk/src/config/env-preserve.d.ts +0 -10
- package/dist/plugin-sdk/src/config/includes.d.ts +0 -43
- package/dist/plugin-sdk/src/config/io.d.ts +0 -93
- package/dist/plugin-sdk/src/config/paths.d.ts +0 -58
- package/dist/plugin-sdk/src/config/types.agent-defaults.d.ts +0 -377
- package/dist/plugin-sdk/src/config/types.channel-messaging-common.d.ts +0 -53
- package/dist/plugin-sdk/src/config/types.d.ts +0 -34
- package/dist/plugin-sdk/src/config/types.googlechat.d.ts +0 -120
- package/dist/plugin-sdk/src/config/types.imessage.d.ts +0 -88
- package/dist/plugin-sdk/src/config/types.irc.d.ts +0 -61
- package/dist/plugin-sdk/src/config/types.msteams.d.ts +0 -132
- package/dist/plugin-sdk/src/config/types.signal.d.ts +0 -65
- package/dist/plugin-sdk/src/context-engine/registry.d.ts +0 -47
- package/dist/plugin-sdk/src/cron/delivery.d.ts +0 -33
- package/dist/plugin-sdk/src/cron/isolated-agent/delivery-target.d.ts +0 -27
- package/dist/plugin-sdk/src/cron/isolated-agent/session.d.ts +0 -15
- package/dist/plugin-sdk/src/cron/schedule.d.ts +0 -6
- package/dist/plugin-sdk/src/cron/service/initial-delivery.d.ts +0 -2
- package/dist/plugin-sdk/src/cron/service/jobs.d.ts +0 -33
- package/dist/plugin-sdk/src/cron/service/locked.d.ts +0 -2
- package/dist/plugin-sdk/src/cron/service/ops.d.ts +0 -84
- package/dist/plugin-sdk/src/cron/service/state.d.ts +0 -158
- package/dist/plugin-sdk/src/cron/service/store.d.ts +0 -11
- package/dist/plugin-sdk/src/cron/service/timeout-policy.d.ts +0 -13
- package/dist/plugin-sdk/src/cron/service/timer.d.ts +0 -46
- package/dist/plugin-sdk/src/cron/service.d.ts +0 -69
- package/dist/plugin-sdk/src/cron/session-reaper.d.ts +0 -35
- package/dist/plugin-sdk/src/gateway/auth-mode-policy.d.ts +0 -4
- package/dist/plugin-sdk/src/gateway/channel-status-patches.d.ts +0 -6
- package/dist/plugin-sdk/src/gateway/chat-abort.d.ts +0 -47
- package/dist/plugin-sdk/src/gateway/exec-approval-manager.d.ts +0 -47
- package/dist/plugin-sdk/src/gateway/node-command-policy.d.ts +0 -18
- package/dist/plugin-sdk/src/gateway/security-path.d.ts +0 -20
- package/dist/plugin-sdk/src/gateway/server-broadcast.d.ts +0 -17
- package/dist/plugin-sdk/src/gateway/server-channels.d.ts +0 -78
- package/dist/plugin-sdk/src/gateway/server-constants.d.ts +0 -9
- package/dist/plugin-sdk/src/gateway/server-methods/nodes.helpers.d.ts +0 -20
- package/dist/plugin-sdk/src/gateway/server-methods/types.d.ts +0 -108
- package/dist/plugin-sdk/src/gateway/server-shared.d.ts +0 -7
- package/dist/plugin-sdk/src/gateway/startup-auth.d.ts +0 -21
- 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/generated/plugin-sdk-facade-type-map.generated.d.ts +0 -769
- package/dist/plugin-sdk/src/hooks/types.d.ts +0 -62
- package/dist/plugin-sdk/src/image-generation/provider-registry.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/backup-create.d.ts +0 -29
- package/dist/plugin-sdk/src/infra/device-bootstrap.d.ts +0 -46
- package/dist/plugin-sdk/src/infra/device-pairing.d.ts +0 -122
- package/dist/plugin-sdk/src/infra/dotenv.d.ts +0 -9
- package/dist/plugin-sdk/src/infra/gemini-auth.d.ts +0 -16
- package/dist/plugin-sdk/src/infra/google-api-base-url.d.ts +0 -2
- 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-runner.d.ts +0 -35
- package/dist/plugin-sdk/src/infra/heartbeat-summary.d.ts +0 -16
- package/dist/plugin-sdk/src/infra/http-body.d.ts +0 -46
- package/dist/plugin-sdk/src/infra/matrix-legacy-crypto.d.ts +0 -41
- package/dist/plugin-sdk/src/infra/matrix-legacy-state.d.ts +0 -30
- package/dist/plugin-sdk/src/infra/matrix-migration-config.d.ts +0 -48
- package/dist/plugin-sdk/src/infra/matrix-migration-snapshot.d.ts +0 -25
- package/dist/plugin-sdk/src/infra/matrix-plugin-helper.d.ts +0 -29
- package/dist/plugin-sdk/src/infra/outbound/deliver.d.ts +0 -50
- package/dist/plugin-sdk/src/infra/outbound/delivery-queue-recovery.d.ts +0 -41
- package/dist/plugin-sdk/src/infra/outbound/delivery-queue-storage.d.ts +0 -50
- package/dist/plugin-sdk/src/infra/outbound/delivery-queue.d.ts +0 -4
- package/dist/plugin-sdk/src/infra/outbound/sanitize-text.d.ts +0 -23
- package/dist/plugin-sdk/src/infra/session-maintenance-warning.d.ts +0 -15
- package/dist/plugin-sdk/src/link-understanding/apply.d.ts +0 -10
- package/dist/plugin-sdk/src/link-understanding/apply.runtime.d.ts +0 -1
- 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 -11
- package/dist/plugin-sdk/src/media/file-context.d.ts +0 -7
- package/dist/plugin-sdk/src/media/input-files.d.ts +0 -99
- package/dist/plugin-sdk/src/media-understanding/apply.d.ts +0 -19
- package/dist/plugin-sdk/src/media-understanding/apply.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/media-understanding/audio.test-helpers.d.ts +0 -27
- package/dist/plugin-sdk/src/media-understanding/concurrency.d.ts +0 -1
- package/dist/plugin-sdk/src/media-understanding/echo-transcript.d.ts +0 -13
- package/dist/plugin-sdk/src/media-understanding/format.d.ts +0 -7
- package/dist/plugin-sdk/src/media-understanding/runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/media-understanding/transcribe-audio.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/account-core.d.ts +0 -20
- package/dist/plugin-sdk/src/plugin-sdk/account-resolution.d.ts +0 -24
- package/dist/plugin-sdk/src/plugin-sdk/acp-runtime.d.ts +0 -16
- package/dist/plugin-sdk/src/plugin-sdk/acpx.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/agent-config-primitives.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/allowlist-config-edit.d.ts +0 -99
- package/dist/plugin-sdk/src/plugin-sdk/amazon-bedrock.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/api-baseline.d.ts +0 -43
- package/dist/plugin-sdk/src/plugin-sdk/bluebubbles-policy.d.ts +0 -7
- package/dist/plugin-sdk/src/plugin-sdk/bluebubbles.d.ts +0 -62
- package/dist/plugin-sdk/src/plugin-sdk/browser-support.d.ts +0 -54
- package/dist/plugin-sdk/src/plugin-sdk/browser.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/byteplus.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/channel-actions.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/channel-config-primitives.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/channel-config-schema.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/channel-config-writes.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/channel-feedback.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/channel-lifecycle.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/channel-pairing.d.ts +0 -24
- package/dist/plugin-sdk/src/plugin-sdk/channel-plugin-common.d.ts +0 -12
- package/dist/plugin-sdk/src/plugin-sdk/channel-setup.d.ts +0 -21
- package/dist/plugin-sdk/src/plugin-sdk/chutes.d.ts +0 -14
- package/dist/plugin-sdk/src/plugin-sdk/cli-backend.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/cloudflare-ai-gateway.d.ts +0 -12
- package/dist/plugin-sdk/src/plugin-sdk/collection-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/command-auth-native.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/command-auth.d.ts +0 -65
- package/dist/plugin-sdk/src/plugin-sdk/command-detection.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/command-surface.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/compat.d.ts +0 -17
- package/dist/plugin-sdk/src/plugin-sdk/config-paths.d.ts +0 -7
- package/dist/plugin-sdk/src/plugin-sdk/copilot-proxy.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/dangerous-name-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/deepseek.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/device-bootstrap.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/diagnostics-otel.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/diffs.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/discord-account.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/discord-runtime-surface.d.ts +0 -61
- package/dist/plugin-sdk/src/plugin-sdk/discord-send.d.ts +0 -36
- package/dist/plugin-sdk/src/plugin-sdk/entrypoints.d.ts +0 -17
- package/dist/plugin-sdk/src/plugin-sdk/extension-shared.d.ts +0 -67
- package/dist/plugin-sdk/src/plugin-sdk/feishu-conversation.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/feishu-setup.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/feishu.d.ts +0 -45
- package/dist/plugin-sdk/src/plugin-sdk/fetch-auth.d.ts +0 -14
- package/dist/plugin-sdk/src/plugin-sdk/gateway-runtime.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/github-copilot-login.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/github-copilot-token.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/global-singleton.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/google.d.ts +0 -18
- package/dist/plugin-sdk/src/plugin-sdk/googlechat.d.ts +0 -49
- package/dist/plugin-sdk/src/plugin-sdk/hook-runtime.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/host-runtime.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/huggingface.d.ts +0 -12
- package/dist/plugin-sdk/src/plugin-sdk/image-generation-core.d.ts +0 -15
- package/dist/plugin-sdk/src/plugin-sdk/image-generation.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/index.d.ts +0 -28
- package/dist/plugin-sdk/src/plugin-sdk/infra-runtime.d.ts +0 -47
- package/dist/plugin-sdk/src/plugin-sdk/irc-surface.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/irc.d.ts +0 -38
- package/dist/plugin-sdk/src/plugin-sdk/kilocode.d.ts +0 -17
- package/dist/plugin-sdk/src/plugin-sdk/kimi-coding.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/lazy-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/line-core.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/line-runtime.d.ts +0 -75
- package/dist/plugin-sdk/src/plugin-sdk/litellm.d.ts +0 -10
- package/dist/plugin-sdk/src/plugin-sdk/llm-task.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/lobster.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/logging-core.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/markdown-table-runtime.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/matrix-helper.d.ts +0 -14
- package/dist/plugin-sdk/src/plugin-sdk/matrix-runtime-heavy.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/matrix-runtime-shared.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/matrix-runtime-surface.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/matrix-surface.d.ts +0 -7
- package/dist/plugin-sdk/src/plugin-sdk/matrix-thread-bindings.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/matrix.d.ts +0 -72
- package/dist/plugin-sdk/src/plugin-sdk/mattermost-policy.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/mattermost.d.ts +0 -50
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-engine-runtime.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-host-engine-embeddings.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-host-engine-foundation.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-host-engine-qmd.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-host-runtime-cli.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-host-runtime-core.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-host-runtime-files.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-host-secret.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/memory-core-host-status.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/memory-core.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/memory-lancedb.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/minimax.d.ts +0 -18
- package/dist/plugin-sdk/src/plugin-sdk/mistral.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/models-provider-runtime.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/modelstudio-definitions.d.ts +0 -13
- package/dist/plugin-sdk/src/plugin-sdk/modelstudio.d.ts +0 -18
- package/dist/plugin-sdk/src/plugin-sdk/moonshot.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/msteams.d.ts +0 -60
- package/dist/plugin-sdk/src/plugin-sdk/native-command-registry.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/nextcloud-talk.d.ts +0 -45
- package/dist/plugin-sdk/src/plugin-sdk/nostr.d.ts +0 -20
- package/dist/plugin-sdk/src/plugin-sdk/nvidia.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/ollama-surface.d.ts +0 -21
- package/dist/plugin-sdk/src/plugin-sdk/open-prose.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/openai.d.ts +0 -15
- package/dist/plugin-sdk/src/plugin-sdk/opencode-go.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/opencode.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/openrouter.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/optional-channel-setup.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/pairing-access.d.ts +0 -19
- package/dist/plugin-sdk/src/plugin-sdk/param-readers.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/persistent-dedupe.d.ts +0 -22
- package/dist/plugin-sdk/src/plugin-sdk/phone-control.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/plugin-runtime.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/process-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-api-key.d.ts +0 -7
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-login.d.ts +0 -27
- package/dist/plugin-sdk/src/plugin-sdk/provider-auth-login.runtime.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/provider-catalog-shared.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/provider-entry.d.ts +0 -38
- package/dist/plugin-sdk/src/plugin-sdk/provider-env-vars.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/provider-moonshot.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/provider-onboard.d.ts +0 -85
- package/dist/plugin-sdk/src/plugin-sdk/provider-reasoning.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/provider-setup.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/provider-stream.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/provider-usage.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/provider-web-fetch.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/provider-zai-endpoint.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/qianfan.d.ts +0 -7
- package/dist/plugin-sdk/src/plugin-sdk/reply-chunking.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/reply-dispatch-runtime.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/reply-history.d.ts +0 -3
- package/dist/plugin-sdk/src/plugin-sdk/reply-runtime.d.ts +0 -21
- package/dist/plugin-sdk/src/plugin-sdk/request-url.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/resolution-notes.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/run-command.d.ts +0 -13
- package/dist/plugin-sdk/src/plugin-sdk/runtime-config-snapshot.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/runtime-group-policy.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/runtime-store.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/runtime.d.ts +0 -39
- package/dist/plugin-sdk/src/plugin-sdk/sandbox.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/secret-input-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/security-runtime.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/self-hosted-provider-setup.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/session-store-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/setup-adapter-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/setup-runtime.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/setup-tools.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/setup.d.ts +0 -22
- package/dist/plugin-sdk/src/plugin-sdk/sglang.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/signal-account.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/signal-core.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/skill-commands-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/slack-account.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/slack-core.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/speech-core.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/speech.d.ts +0 -7
- package/dist/plugin-sdk/src/plugin-sdk/string-normalization-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/synthetic.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/talk-voice.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/telegram-account.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/telegram-allow-from.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/telegram-command-config.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/telegram-surface.d.ts +0 -44
- package/dist/plugin-sdk/src/plugin-sdk/test-utils.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/testing.d.ts +0 -53
- package/dist/plugin-sdk/src/plugin-sdk/text-chunking.d.ts +0 -2
- package/dist/plugin-sdk/src/plugin-sdk/thread-bindings-runtime.d.ts +0 -4
- package/dist/plugin-sdk/src/plugin-sdk/thread-ownership.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/tlon.d.ts +0 -22
- package/dist/plugin-sdk/src/plugin-sdk/together.d.ts +0 -10
- package/dist/plugin-sdk/src/plugin-sdk/tool-send.d.ts +0 -7
- package/dist/plugin-sdk/src/plugin-sdk/twitch.d.ts +0 -18
- package/dist/plugin-sdk/src/plugin-sdk/venice.d.ts +0 -10
- package/dist/plugin-sdk/src/plugin-sdk/vercel-ai-gateway.d.ts +0 -14
- package/dist/plugin-sdk/src/plugin-sdk/vllm.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/voice-call.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/volcengine.d.ts +0 -11
- package/dist/plugin-sdk/src/plugin-sdk/webhook-ingress.d.ts +0 -6
- package/dist/plugin-sdk/src/plugin-sdk/webhook-memory-guards.d.ts +0 -52
- package/dist/plugin-sdk/src/plugin-sdk/webhook-path.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/webhook-request-guards.d.ts +0 -89
- package/dist/plugin-sdk/src/plugin-sdk/webhook-targets.d.ts +0 -97
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-action-runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-core.d.ts +0 -10
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-login-qr.d.ts +0 -1
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-shared.d.ts +0 -5
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp-surface.d.ts +0 -19
- package/dist/plugin-sdk/src/plugin-sdk/whatsapp.d.ts +0 -32
- package/dist/plugin-sdk/src/plugin-sdk/xai.d.ts +0 -21
- package/dist/plugin-sdk/src/plugin-sdk/xiaomi.d.ts +0 -9
- package/dist/plugin-sdk/src/plugin-sdk/zai.d.ts +0 -12
- package/dist/plugin-sdk/src/plugin-sdk/zalo-setup.d.ts +0 -8
- package/dist/plugin-sdk/src/plugin-sdk/zalo.d.ts +0 -47
- package/dist/plugin-sdk/src/plugin-sdk/zalouser.d.ts +0 -39
- package/dist/plugin-sdk/src/plugin-sdk/zod.d.ts +0 -1
- package/dist/plugin-sdk/src/plugins/bundled-compat.d.ts +0 -14
- package/dist/plugin-sdk/src/plugins/http-path.d.ts +0 -1
- package/dist/plugin-sdk/src/plugins/http-registry.d.ts +0 -16
- package/dist/plugin-sdk/src/plugins/http-route-overlap.d.ts +0 -11
- package/dist/plugin-sdk/src/plugins/interactive-dispatch-adapters.d.ts +0 -44
- package/dist/plugin-sdk/src/plugins/interactive.d.ts +0 -60
- package/dist/plugin-sdk/src/plugins/lazy-service-module.d.ts +0 -13
- package/dist/plugin-sdk/src/plugins/loader.d.ts +0 -74
- package/dist/plugin-sdk/src/plugins/plugin-error-handler.d.ts +0 -130
- package/dist/plugin-sdk/src/plugins/provider-auth-choice.runtime.d.ts +0 -7
- package/dist/plugin-sdk/src/plugins/provider-catalog.d.ts +0 -24
- package/dist/plugin-sdk/src/plugins/provider-model-allowlist.d.ts +0 -6
- package/dist/plugin-sdk/src/plugins/provider-model-defaults.d.ts +0 -26
- package/dist/plugin-sdk/src/plugins/provider-oauth-flow.d.ts +0 -20
- package/dist/plugin-sdk/src/plugins/provider-openai-codex-oauth-tls.d.ts +0 -22
- package/dist/plugin-sdk/src/plugins/provider-openai-codex-oauth.d.ts +0 -10
- package/dist/plugin-sdk/src/plugins/provider-runtime.d.ts +0 -271
- package/dist/plugin-sdk/src/plugins/provider-runtime.runtime.d.ts +0 -14
- package/dist/plugin-sdk/src/plugins/provider-self-hosted-setup.d.ts +0 -60
- package/dist/plugin-sdk/src/plugins/provider-validation.d.ts +0 -7
- package/dist/plugin-sdk/src/plugins/provider-wizard.d.ts +0 -45
- package/dist/plugin-sdk/src/plugins/provider-zai-endpoint.d.ts +0 -16
- package/dist/plugin-sdk/src/plugins/providers.d.ts +0 -39
- package/dist/plugin-sdk/src/plugins/registry-empty.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/registry.d.ts +0 -217
- package/dist/plugin-sdk/src/plugins/runtime/gateway-request-scope.d.ts +0 -19
- package/dist/plugin-sdk/src/plugins/runtime/index.d.ts +0 -19
- package/dist/plugin-sdk/src/plugins/runtime/native-deps.d.ts +0 -8
- package/dist/plugin-sdk/src/plugins/runtime/runtime-channel.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/runtime/runtime-config.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/runtime/runtime-events.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/runtime/runtime-logging.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/runtime/runtime-media-understanding.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugins/runtime/runtime-media.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/runtime/runtime-slack-ops.runtime.d.ts +0 -10
- package/dist/plugin-sdk/src/plugins/runtime/runtime-slack.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/runtime/runtime-system.d.ts +0 -2
- package/dist/plugin-sdk/src/plugins/runtime/runtime-tts.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/plugins/runtime/runtime-whatsapp-boundary.d.ts +0 -35
- package/dist/plugin-sdk/src/plugins/runtime/types-channel.d.ts +0 -200
- package/dist/plugin-sdk/src/plugins/runtime/types-core.d.ts +0 -123
- package/dist/plugin-sdk/src/plugins/runtime/types.d.ts +0 -51
- package/dist/plugin-sdk/src/plugins/runtime.d.ts +0 -39
- package/dist/plugin-sdk/src/plugins/slots.d.ts +0 -36
- package/dist/plugin-sdk/src/plugins/types.d.ts +0 -2287
- package/dist/plugin-sdk/src/security/channel-metadata.d.ts +0 -6
- package/dist/plugin-sdk/src/security/context-visibility.d.ts +0 -26
- package/dist/plugin-sdk/src/shared/device-bootstrap-profile.d.ts +0 -10
- package/dist/plugin-sdk/src/terminal/health-style.d.ts +0 -1
- package/dist/plugin-sdk/src/terminal/note.d.ts +0 -5
- package/dist/plugin-sdk/src/test-helpers/http.d.ts +0 -3
- package/dist/plugin-sdk/src/test-helpers/ssrf.d.ts +0 -2
- package/dist/plugin-sdk/src/test-helpers/state-dir-env.d.ts +0 -9
- package/dist/plugin-sdk/src/test-helpers/whatsapp-outbound.d.ts +0 -22
- package/dist/plugin-sdk/src/test-utils/bundled-plugin-public-surface.d.ts +0 -10
- package/dist/plugin-sdk/src/test-utils/channel-plugins.d.ts +0 -40
- package/dist/plugin-sdk/src/test-utils/env.d.ts +0 -10
- package/dist/plugin-sdk/src/test-utils/fetch-mock.d.ts +0 -13
- package/dist/plugin-sdk/src/test-utils/session-state-cleanup.d.ts +0 -10
- package/dist/plugin-sdk/src/test-utils/vitest-mock-fn.d.ts +0 -1
- package/dist/plugin-sdk/src/tts/directives.d.ts +0 -10
- package/dist/plugin-sdk/src/tts/provider-error-utils.d.ts +0 -4
- package/dist/plugin-sdk/src/tts/provider-registry.d.ts +0 -7
- package/dist/plugin-sdk/src/tts/provider-types.d.ts +0 -100
- package/dist/plugin-sdk/src/tts/tts-core.d.ts +0 -32
- package/dist/plugin-sdk/src/tts/tts.runtime.d.ts +0 -1
- package/dist/plugin-sdk/src/utils/message-channel.d.ts +0 -29
- package/dist/plugin-sdk/src/utils.d.ts +0 -58
- package/dist/plugin-sdk/src/wizard/session.d.ts +0 -42
- package/dist/plugin-sdk/ssrf-runtime.d.ts +0 -1
- package/dist/plugin-sdk/state-paths.d.ts +0 -1
- package/dist/plugin-sdk/status-helpers.d.ts +0 -1
- package/dist/plugin-sdk/string-normalization-runtime.d.ts +0 -1
- package/dist/plugin-sdk/synthetic.d.ts +0 -1
- package/dist/plugin-sdk/telegram-account.d.ts +0 -1
- package/dist/plugin-sdk/telegram-allow-from.d.ts +0 -1
- package/dist/plugin-sdk/telegram-command-config.d.ts +0 -1
- package/dist/plugin-sdk/telegram-core.d.ts +0 -1
- package/dist/plugin-sdk/telegram-surface.d.ts +0 -1
- package/dist/plugin-sdk/temp-path.d.ts +0 -1
- package/dist/plugin-sdk/testing.d.ts +0 -1
- package/dist/plugin-sdk/text-runtime.d.ts +0 -1
- package/dist/plugin-sdk/thread-bindings-runtime.d.ts +0 -1
- package/dist/plugin-sdk/thread-ownership.d.ts +0 -1
- package/dist/plugin-sdk/tlon.d.ts +0 -1
- package/dist/plugin-sdk/together.d.ts +0 -1
- package/dist/plugin-sdk/tool-send.d.ts +0 -1
- package/dist/plugin-sdk/twitch.d.ts +0 -1
- package/dist/plugin-sdk/venice.d.ts +0 -1
- package/dist/plugin-sdk/vllm.d.ts +0 -1
- package/dist/plugin-sdk/voice-call.d.ts +0 -1
- package/dist/plugin-sdk/volcengine.d.ts +0 -1
- package/dist/plugin-sdk/web-media.d.ts +0 -1
- package/dist/plugin-sdk/webhook-ingress.d.ts +0 -1
- package/dist/plugin-sdk/webhook-path.d.ts +0 -1
- package/dist/plugin-sdk/webhook-request-guards.d.ts +0 -1
- package/dist/plugin-sdk/whatsapp-auth-presence.d.ts +0 -1
- package/dist/plugin-sdk/whatsapp-core.d.ts +0 -1
- package/dist/plugin-sdk/whatsapp-shared.d.ts +0 -1
- package/dist/plugin-sdk/whatsapp-surface.d.ts +0 -1
- package/dist/plugin-sdk/whatsapp-targets.d.ts +0 -1
- package/dist/plugin-sdk/windows-spawn.d.ts +0 -1
- package/dist/plugin-sdk/xai.d.ts +0 -1
- package/dist/plugin-sdk/zalo-setup.d.ts +0 -1
- package/dist/plugin-sdk/zalo.d.ts +0 -1
- package/dist/plugin-sdk/zalouser.d.ts +0 -1
- package/dist/plugin-sdk/zod.d.ts +0 -1
- package/dist/plugins-cli-BuRzZElZ.js +0 -561
- package/dist/plugins-command-helpers-2uhVdnBb.js +0 -116
- package/dist/plugins-install-persist-BVZkrB2-.js +0 -121
- package/dist/plugins-update-command-CWl-U7Wy.js +0 -974
- package/dist/policy-CBLebx7K.js +0 -147
- package/dist/preflight-audio-RQNk7yfw.js +0 -48
- package/dist/preflight-audio.runtime-BKLaDdXh.js +0 -7
- package/dist/prepare-BdWIhg02.js +0 -1301
- package/dist/probe-7PmWRQdg.js +0 -1868
- package/dist/probe-DBGVRz02.js +0 -170
- package/dist/probe-DtN67E1D.js +0 -349
- package/dist/probe-F0974SeN.js +0 -431
- package/dist/profile-update-B98rJ-pB.js +0 -67
- package/dist/program-CCSYcbNv.js +0 -158
- package/dist/prompt-select-styled-QezSJIFt.js +0 -6434
- package/dist/provider-CvWQLyt5.js +0 -18901
- package/dist/provider-Cvp1QQuM.js +0 -70
- package/dist/provider-IEIXFsBr.js +0 -3685
- package/dist/provider-api-key-auth-BjgG22Cp.js +0 -109
- package/dist/provider-auth-Dlfypk2e.js +0 -43
- package/dist/provider-auth-api-key-DPeAD4Wh.js +0 -5
- package/dist/provider-auth-login-eRYV4NRi.js +0 -8
- package/dist/provider-dispatcher-D2OJ5CNa.js +0 -22
- package/dist/provider-entry-D8rVAPy0.js +0 -86
- package/dist/provider-session.runtime-GQeUwL4B.js +0 -7
- package/dist/provider.runtime-BokN-cp6.js +0 -2
- package/dist/qr-image-CNXmqHBd.js +0 -2
- package/dist/queue-eLL6EbrW.js +0 -663
- package/dist/reaction-runtime-api-DwLFcfeo.js +0 -114
- package/dist/reactions-K9RuCuhE.js +0 -258
- package/dist/read-only-account-inspect.telegram-BoATG5TP.js +0 -202
- package/dist/register.agent-DdFsdgdX.js +0 -240
- package/dist/register.configure-BTVikzNj.js +0 -15
- package/dist/register.maintenance-CDt8_LBs.js +0 -449
- package/dist/register.message-C_Wf261e.js +0 -644
- package/dist/register.onboard-FL6Mny10.js +0 -79
- package/dist/register.setup-BeW8HY0P.js +0 -183
- package/dist/register.status-health-sessions-Bl0-x2Ok.js +0 -1206
- package/dist/register.subclis-DUBZB3bR.js +0 -295
- package/dist/register.subclis-Db9Qegv7.js +0 -3
- package/dist/replies-CWZyv0g5.js +0 -118
- package/dist/reply-DMsC03Iw.js +0 -3192
- package/dist/reply-blocks-DuXsQojy.js +0 -103
- package/dist/reply-dispatch-runtime-D_8J_oEP.js +0 -3
- package/dist/reply-runtime-TZcIYAGQ.js +0 -123
- package/dist/reply.runtime-Bht7FBbJ.js +0 -2
- package/dist/resolve-allowlist-Bnvzjka0.js +0 -147
- package/dist/resolve-targets-D3K5Z5gf.js +0 -280
- package/dist/rooms-mp7F7lsA.js +0 -325
- package/dist/route-reply-DKoNoGml.js +0 -133
- package/dist/route-reply.runtime-ByCsyDjS.js +0 -2
- package/dist/route-resolution-CshIQw9s.js +0 -461
- package/dist/rpc-context-DQ0FBc41.js +0 -155
- package/dist/run-main-BzIbww9g.js +0 -425
- package/dist/runner-IAThb076.js +0 -1479
- package/dist/runtime-C4nQKohR.js +0 -68
- package/dist/runtime-DpQadrfd.js +0 -1175
- package/dist/runtime-api-B-n73E_A.js +0 -2
- package/dist/runtime-api-B0TzzMRA.js +0 -2
- package/dist/runtime-api-B2g4aFI0.js +0 -2
- package/dist/runtime-api-Bjn-vYvi.js +0 -3676
- package/dist/runtime-api-Ckw6TKHu.js +0 -2
- package/dist/runtime-api-CqpkXWTZ.js +0 -14
- package/dist/runtime-api-DLcWBYBn.js +0 -2
- package/dist/runtime-api-DTkksxUA.js +0 -2
- package/dist/runtime-api-Dqjul0s_.js +0 -3
- package/dist/runtime-api-Dt4a5hxH.js +0 -81
- package/dist/runtime-api-exjXBw5x.js +0 -2
- package/dist/runtime-api-iiaetepr.js +0 -29
- package/dist/runtime-api-uq8PFObQ.js +0 -2
- package/dist/runtime-embedded-pi.runtime-C_VTO5Hb.js +0 -2
- package/dist/sandbox-cli-DCBzqdRP.js +0 -443
- package/dist/sdk-xNF3YVy5.js +0 -1108
- package/dist/security-cli-BRQ9l5SH.js +0 -477
- package/dist/send-BR9WsDjK.js +0 -532
- package/dist/send-BYZ6LXaA.js +0 -856
- package/dist/send-C9XFbxrx.js +0 -2
- package/dist/send-CP6xLBgu.js +0 -100
- package/dist/send-CevSHBU3.js +0 -442
- package/dist/send-CiU0wWHJ.js +0 -178
- package/dist/send-CzZHXvb0.js +0 -318
- package/dist/send-D8Q38WQW.js +0 -1076
- package/dist/send-DSrMDTx6.js +0 -3
- package/dist/send.components-CSiMYa_k.js +0 -2
- package/dist/send.components-DuCC5xXW.js +0 -942
- package/dist/server-cron-CnWsiroT.js +0 -2
- package/dist/server-cron-pXTPca6M.js +0 -4173
- package/dist/server-hfFKzOMa.js +0 -10120
- package/dist/server-lite-CpD0TAwt.js +0 -831
- package/dist/server-maintenance-CSzGshfI.js +0 -542
- package/dist/server-maintenance-m-ekNAYN.js +0 -2
- package/dist/server-node-events-o25FUhFi.js +0 -454
- package/dist/server-node-subscriptions-D1cnZtZz.js +0 -2
- package/dist/server-plugins-BYGRllKK.js +0 -10423
- package/dist/server-plugins-D-GLUOyL.js +0 -2
- package/dist/server-startup-memory-CwdtRW65.js +0 -2
- package/dist/server-tailscale-BurW9eR4.js +0 -2
- package/dist/services-B4WpjjQk.js +0 -2
- package/dist/session-BZC_ExXj.js +0 -50
- package/dist/session-archive.runtime-CpJ_-vMn.js +0 -2
- package/dist/session-envelope-D53bqIsw.js +0 -18
- package/dist/session-file-L8H_0oIY.js +0 -120
- package/dist/session-key-DlGku_2P.js +0 -52
- package/dist/session-override-BwLTMvlR.js +0 -100
- package/dist/session-reset-model.runtime-B-f6UyAY.js +0 -119
- package/dist/session-route-CWWuYCWY.js +0 -91
- package/dist/session-store-runtime-DbJ_acdU.js +0 -2
- package/dist/session-subagent-reactivation.runtime-DQP-UkdA.js +0 -2
- package/dist/session-transcript-files.fs-BRLPQRBN.js +0 -149
- package/dist/session-updates-BiofcJQ9.js +0 -222
- package/dist/session-updates.runtime-B5YxiezL.js +0 -2
- package/dist/session-utils-BsLMe4R0.js +0 -1743
- package/dist/sessions-BGky6-U4.js +0 -224
- package/dist/sessions-CizZS4Rb.js +0 -2
- package/dist/sessions-CnolLDg0.js +0 -443
- package/dist/setup-BPkdGC8C.js +0 -427
- package/dist/setup-api-Bd-qaaRg.js +0 -2
- package/dist/setup-bootstrap-BUPymwJl.js +0 -54
- package/dist/setup-core-CE5GuYaV.js +0 -256
- package/dist/setup-core-tvt7DN1q.js +0 -146
- package/dist/setup-surface-BbOvAxU6.js +0 -484
- package/dist/setup-surface-BlIvCltJ.js +0 -450
- package/dist/setup-surface-BoJI-ftG.js +0 -237
- package/dist/setup-surface-C6yPqLIS.js +0 -261
- package/dist/setup-surface-CNFczxjl.js +0 -656
- package/dist/setup-surface-D5hZFXlx.js +0 -8848
- package/dist/setup-surface-DMOex3oo.js +0 -346
- package/dist/setup-surface-DRmn71vw.js +0 -333
- package/dist/setup-surface-DUodX6wM.js +0 -353
- package/dist/setup-surface-DVnka34A.js +0 -272
- package/dist/setup-surface-DrFSCD5A.js +0 -304
- package/dist/setup-surface-WtMan1x2.js +0 -261
- package/dist/setup.finalize-BcpxSMo5.js +0 -458
- package/dist/setup.gateway-config-BHvGYGOD.js +0 -247
- package/dist/shared-1r1qYN6z.js +0 -198
- package/dist/shared-BXz6HKLm.js +0 -180
- package/dist/shared-Bg7yDHOE.js +0 -94
- package/dist/shared-DBX8qPP6.js +0 -144
- package/dist/shared-DHFHItFt.js +0 -160
- package/dist/shared-DJV3Mmv8.js +0 -72
- package/dist/shared-ZeWcr3rG.js +0 -2
- package/dist/shared-nCJ3kgXi.js +0 -78
- package/dist/shared-rKEs-OIg.js +0 -64
- package/dist/shared-runtime-CTD5ywGR.js +0 -7
- package/dist/skills-install-CoUJk9aZ.js +0 -819
- package/dist/slash-commands-CKUKTwMa.js +0 -672
- package/dist/slash-commands.runtime-BrfELsEA.js +0 -20
- package/dist/slash-dispatch.runtime-CfjHhQmx.js +0 -38
- package/dist/slash-skill-commands.runtime-Bxm-652_.js +0 -8
- package/dist/speech-provider-BjDZhOzO.js +0 -190
- package/dist/src-BscJ0OyQ.js +0 -2739
- package/dist/startup-verification-Bwer6SPQ.js +0 -131
- package/dist/state-migrations-Dh5gaxn0.js +0 -845
- package/dist/status-CxiD9-L2.js +0 -2
- package/dist/status-all-CteZuvg_.js +0 -798
- package/dist/status-hLuTMJgT.js +0 -650
- package/dist/status-issues-CZdlgUVQ.js +0 -187
- package/dist/status-issues-Dx4xsUU6.js +0 -336
- package/dist/status-json-CU_sqXwN.js +0 -86
- package/dist/status-l8LyDb-X.js +0 -608
- package/dist/status-mpmZALQx.js +0 -3
- package/dist/status.command.text-runtime-Ck9abrv4.js +0 -18
- package/dist/status.scan-N2AgYo5y.js +0 -264
- package/dist/status.scan.fast-json-B8TmllqQ.js +0 -97
- package/dist/status.scan.fast-json-CiJfPteF.js +0 -2
- package/dist/status.scan.json-core-Bqw5Ethf.js +0 -254
- package/dist/status.summary-CN0kS8iw.js +0 -2
- package/dist/status.summary-joaOukPU.js +0 -210
- package/dist/sticker-cache-DXLBnGCi.js +0 -1573
- package/dist/sticker-vision.runtime-DP1NsaCZ.js +0 -16
- package/dist/storage-BRnLX4P7.js +0 -234
- package/dist/store-BvP1FWCI.js +0 -1343
- package/dist/store.runtime-NoYeZeac.js +0 -2
- package/dist/stream-BJ4HYVwA.js +0 -633
- package/dist/subagent-orphan-recovery-hTBxfwY4.js +0 -206
- package/dist/subagent-registry-runtime-3PIBzuDd.js +0 -2
- package/dist/targets-BAsektUE.js +0 -748
- package/dist/task-registry-delivery-runtime-CkJ71rwb.js +0 -2
- package/dist/task-registry.audit-gdULOiFp.js +0 -320
- package/dist/task-registry.maintenance-DhI_cx5O.js +0 -2
- package/dist/test-api-B4g2UUbw.js +0 -47
- package/dist/testing-DFnq00vr.js +0 -677
- package/dist/thread-bindings-CEuvQ0a5.js +0 -219
- package/dist/thread-bindings-CzFRpuy7.js +0 -534
- package/dist/thread-bindings-D-QA8SBh.js +0 -352
- package/dist/thread-bindings-EP9pAodb.js +0 -778
- package/dist/thread-bindings.discord-api-DKSgmJf_.js +0 -487
- package/dist/threading-CLq9AwSD.js +0 -832
- package/dist/threading-CQM3vrch.js +0 -2
- package/dist/threading-tool-context-DN0TQ-o6.js +0 -157
- package/dist/token-Bs7YIYbI.js +0 -82
- package/dist/tool-actions.runtime-mxezUV4D.js +0 -532
- package/dist/tools-effective-inventory-Dz6tWQxy.js +0 -148
- package/dist/ui-Cmeq4ZXg.js +0 -212
- package/dist/update-CADy3L5e.js +0 -1253
- package/dist/update-cli-B61EQsEl.js +0 -1447
- package/dist/update-runner--BEMGokU.js +0 -1195
- package/dist/verification-C5PYFyB0.js +0 -130
- package/dist/verification-CzP234iv.js +0 -2
- package/dist/x-search-ToCIaz7t.js +0 -166
- package/dist/zalo-BCF4thCG.js +0 -13
- package/dist/zalo-js-C4A7Gxjy.js +0 -1156
- package/dist/zalouser-CO0W9KZf.js +0 -22
- /package/dist/{apply.runtime-DBsSkbq5.js → apply.runtime-eSa-O_F2.js} +0 -0
- /package/dist/{audit-channel.allow-from.runtime-BE3PpHCg.js → audit-channel.allow-from.runtime-DNte8cmH.js} +0 -0
- /package/dist/{audit-channel.discord.runtime-CKQwUTue.js → audit-channel.discord.runtime-BWLuLCE0.js} +0 -0
- /package/dist/{audit-channel.zalouser.runtime-DvOclP53.js → audit-channel.zalouser.runtime-D_nIX7hv.js} +0 -0
- /package/dist/{gaxios-fetch-compat-DSrL7y2X.js → gaxios-fetch-compat-Dsb6Dess.js} +0 -0
- /package/dist/{gmail-watcher-lifecycle-CnbN1EfN.js → gmail-watcher-lifecycle-D6jhzjD2.js} +0 -0
- /package/dist/{hooks-policy-BjyPwwpQ.js → hooks-policy-BS7eSxPm.js} +0 -0
- /package/dist/{install-target-BXHZSfie.js → install-target-DunBxcXd.js} +0 -0
- /package/dist/{loader-_QerU742.js → loader-DrwewZGF.js} +0 -0
- /package/dist/{plugin-error-boundary-Ze95TniC.js → plugin-error-boundary-BkeWnWCG.js} +0 -0
- /package/dist/{plugin-health-checker-BdL9iBvs.js → plugin-health-checker--ObpW5TZ.js} +0 -0
- /package/dist/{plugin-hot-reload-t-fD3k4-.js → plugin-hot-reload-uBgB89Et.js} +0 -0
- /package/dist/{provider-api-key-auth.runtime-PWOshlD_.js → provider-api-key-auth.runtime-s-qWJDKg.js} +0 -0
- /package/dist/{provider-auth-login.runtime-B8ZroIz0.js → provider-auth-login.runtime-BJ3_RYVu.js} +0 -0
- /package/dist/{provider-discovery.runtime-C9i7ZYfW.js → provider-discovery.runtime-hzNrePTv.js} +0 -0
- /package/dist/{runtime-discord-ops.runtime-DD-5fh_t.js → runtime-discord-ops.runtime-DXnkkrxh.js} +0 -0
- /package/dist/{runtime-media-understanding.runtime-BnpKjL7w.js → runtime-media-understanding.runtime-CqkE-xQD.js} +0 -0
- /package/dist/{runtime-model-auth.runtime-BJVutp59.js → runtime-model-auth.runtime-Eceghr0K.js} +0 -0
- /package/dist/{runtime-slack-ops.runtime-BHlRr1Yr.js → runtime-slack-ops.runtime-BiNFnBIK.js} +0 -0
- /package/dist/{runtime-tts.runtime-CraALy-I.js → runtime-tts.runtime-DucSlAZ7.js} +0 -0
- /package/dist/{server-constants-DYaJmd0J.js → server-constants-DygisMJm.js} +0 -0
- /package/dist/{server-node-subscriptions-B0IJt_Ut.js → server-node-subscriptions-k9pzvFjc.js} +0 -0
- /package/dist/{server-startup-memory-DVUV59tb.js → server-startup-memory-BF7b6hV-.js} +0 -0
- /package/dist/{server-tailscale-YNZLPwK0.js → server-tailscale-C4_57iBM.js} +0 -0
- /package/dist/{services-D-LPmYY2.js → services-DGh2Nlk1.js} +0 -0
- /package/dist/{skill-scanner-CiGO-i2b.js → skill-scanner-CQOOKx41.js} +0 -0
- /package/dist/{ssh-config-BeNW3BFI.js → ssh-config-C0OJnSro.js} +0 -0
- /package/dist/{supervisor-log.runtime-C5wGw6pn.js → supervisor-log.runtime-C7jNH-kn.js} +0 -0
- /package/dist/{system-presence-Dllq5OiL.js → system-presence-Ctj0G23x.js} +0 -0
- /package/dist/{tts.runtime-DmgJozN5.js → tts.runtime-BmZyMwz6.js} +0 -0
|
@@ -0,0 +1,3622 @@
|
|
|
1
|
+
import { d as resolveThreadSessionKeys, u as resolveAgentIdFromSessionKey } from "./session-key-Do__tq1E.js";
|
|
2
|
+
import { n as formatAllowlistMatchMeta } from "./allowlist-match-CvP7M2nU.js";
|
|
3
|
+
import { n as writeJsonFileAtomically, t as readJsonFileWithFallback } from "./json-store-6yXxAwtu.js";
|
|
4
|
+
import { r as getSessionBindingService } from "./session-binding-service-B1JT9Vbs.js";
|
|
5
|
+
import { a as warnMissingProviderGroupPolicyFallbackOnce, n as resolveAllowlistProviderRuntimeGroupPolicy, r as resolveDefaultGroupPolicy, t as GROUP_POLICY_BLOCKED_LABEL } from "./runtime-group-policy-5Lr0Ieci.js";
|
|
6
|
+
import { t as resolveAckReaction } from "./identity-BuQIY7DT.js";
|
|
7
|
+
import { a as buildExecApprovalPendingReplyPayload, c as getExecApprovalApproverDmNoticeText } from "./exec-approval-reply-CnW2WZof.js";
|
|
8
|
+
import { r as getAgentScopedMediaLocalRoots } from "./local-roots-DaJ_5SJs.js";
|
|
9
|
+
import { n as deriveLastRoutePolicy } from "./resolve-route-BxAbY_hl.js";
|
|
10
|
+
import { c as resolveThreadBindingIdleTimeoutMsForChannel, d as resolveThreadBindingMaxAgeMsForChannel } from "./thread-bindings-policy-BlyUVG6S.js";
|
|
11
|
+
import "./routing-BKQZI-Y4.js";
|
|
12
|
+
import { n as resolveControlCommandGate } from "./command-gating-HO-bVa6h.js";
|
|
13
|
+
import { a as patchAllowlistUsersInConfigEntries, n as buildAllowlistResolutionSummary, o as summarizeMapping, r as canonicalizeAllowlistWithResolvedIds, t as addAllowlistUserEntriesFromConfigEntry } from "./resolve-utils-lzHLWW1m.js";
|
|
14
|
+
import { o as resolveExecApprovalCommandDisplay } from "./exec-approval-session-target-Ci45mXNL.js";
|
|
15
|
+
import "./approval-runtime-B6PXavdQ.js";
|
|
16
|
+
import { t as createChannelNativeApprovalRuntime } from "./approval-native-runtime-Bw_-auoy.js";
|
|
17
|
+
import { t as resolveChannelContextVisibilityMode } from "./context-visibility-DzjNwztO.js";
|
|
18
|
+
import "./config-runtime-D208l2BL.js";
|
|
19
|
+
import { n as createReplyPrefixOptions } from "./reply-prefix-hexlVI5L.js";
|
|
20
|
+
import { t as createTypingCallbacks } from "./typing-Dp7mlbZi.js";
|
|
21
|
+
import "./infra-runtime-C9fJenAY.js";
|
|
22
|
+
import "./conversation-runtime-DvoDx5Lp.js";
|
|
23
|
+
import { i as resolveConfiguredAcpBindingRecord, t as ensureConfiguredAcpBindingReady } from "./persistent-bindings.lifecycle-CR9WhqMq.js";
|
|
24
|
+
import "./security-runtime-CYsRjgKf.js";
|
|
25
|
+
import { t as evaluateSupplementalContextVisibility } from "./context-visibility-Ct0SprKG.js";
|
|
26
|
+
import { n as logInboundDrop, r as logTypingFailure } from "./logging-DIucOhk1.js";
|
|
27
|
+
import { n as toLocationContext, t as formatLocationText } from "./location-BpF0yH4v.js";
|
|
28
|
+
import "./command-auth-BoH1IkmW.js";
|
|
29
|
+
import { c as createDraftStreamLoop } from "./channel-lifecycle-CobgWzsY.js";
|
|
30
|
+
import { s as resolveMatrixAccountConfig } from "./config-paths-DEdD9CCA.js";
|
|
31
|
+
import { t as getMatrixRuntime } from "./runtime-79-yF-h7.js";
|
|
32
|
+
import { i as resolveMatrixAccount, n as resolveConfiguredMatrixBotUserIds } from "./accounts-DS8Apggf.js";
|
|
33
|
+
import "./runtime-api-DOLRVoZD.js";
|
|
34
|
+
import { a as shouldHandleMatrixExecApprovalRequest, c as normalizeMatrixUserId, i as isMatrixExecApprovalClientEnabled, l as resolveMatrixAllowListMatch, r as matrixNativeApprovalAdapter, s as normalizeMatrixAllowList, t as resolveMatrixRoomConfig } from "./rooms-Can12aFd.js";
|
|
35
|
+
import { a as resolveMatrixTargetIdentity, t as isMatrixQualifiedUserId } from "./target-ids-7eU-pRfm.js";
|
|
36
|
+
import { t as isBunRuntime } from "./runtime-BGnKVfHS.js";
|
|
37
|
+
import { n as resolveMatrixAuth, r as resolveMatrixAuthContext } from "./config-BGW2qyLw.js";
|
|
38
|
+
import { n as resolveMatrixStateFilePath } from "./storage-YrOCuZuJ.js";
|
|
39
|
+
import { n as LogService } from "./logger-C9zPuoXE.js";
|
|
40
|
+
import { i as resolveSharedMatrixClient, n as releaseSharedClientInstance } from "./shared-CBnUPRHA.js";
|
|
41
|
+
import "./client-C7KrfnR_.js";
|
|
42
|
+
import { t as resolveMatrixTargets } from "./resolve-targets-gk4hti4C.js";
|
|
43
|
+
import { a as sendMessageMatrix, c as sendSingleTextMessageMatrix, g as isPollStartType, h as isPollEventType, i as reactMatrixMessage, l as sendTypingMatrix, n as editMessageMatrix, p as formatPollAsText, r as prepareMatrixSingleText, s as sendReadReceiptMatrix, t as chunkMatrixText, v as parsePollStartContent } from "./send-DiOk2E98.js";
|
|
44
|
+
import { c as MATRIX_REACTION_EVENT_TYPE, d as extractMatrixReactionAnnotation, i as repairMatrixDirectRooms, r as promoteMatrixDirectRoomCandidate } from "./direct-management-DjdwL-F4.js";
|
|
45
|
+
import { o as readJoinedMatrixMembers, r as isStrictDirectMembership, t as hasDirectMatrixMemberFlag } from "./direct-room-DZOgpgG5.js";
|
|
46
|
+
import { t as createMatrixThreadBindingManager } from "./thread-bindings-lTuhY3On.js";
|
|
47
|
+
import { i as setActiveMatrixClient } from "./client-bootstrap-BnU_fgOa.js";
|
|
48
|
+
import { t as formatMatrixEncryptedEventDisabledWarning } from "./encryption-guidance-BRY-GWVy.js";
|
|
49
|
+
import { c as formatMatrixMediaUnavailableText, d as resolveMatrixMessageBody, l as formatMatrixMessageText, n as editMatrixMessage, p as fetchMatrixPollSnapshot, t as deleteMatrixMessage, u as resolveMatrixMessageAttachment } from "./messages-Xy50Pa2j.js";
|
|
50
|
+
import { t as isMatrixNotFoundError } from "./errors-qQRO8j2E.js";
|
|
51
|
+
import { t as createAsyncLock } from "./async-lock-DIq3ycXx.js";
|
|
52
|
+
import { format } from "node:util";
|
|
53
|
+
//#region extensions/matrix/src/exec-approvals-handler.ts
|
|
54
|
+
function isHandlerConfigured(params) {
|
|
55
|
+
return isMatrixExecApprovalClientEnabled(params);
|
|
56
|
+
}
|
|
57
|
+
function normalizeThreadId(value) {
|
|
58
|
+
return (value == null ? "" : String(value).trim()) || void 0;
|
|
59
|
+
}
|
|
60
|
+
function buildPendingApprovalText(params) {
|
|
61
|
+
return buildExecApprovalPendingReplyPayload({
|
|
62
|
+
approvalId: params.request.id,
|
|
63
|
+
approvalSlug: params.request.id.slice(0, 8),
|
|
64
|
+
approvalCommandId: params.request.id,
|
|
65
|
+
ask: params.request.request.ask ?? void 0,
|
|
66
|
+
agentId: params.request.request.agentId ?? void 0,
|
|
67
|
+
allowedDecisions: params.request.request.allowedDecisions,
|
|
68
|
+
command: resolveExecApprovalCommandDisplay(params.request.request).commandText,
|
|
69
|
+
cwd: params.request.request.cwd ?? void 0,
|
|
70
|
+
host: params.request.request.host === "node" ? "node" : "gateway",
|
|
71
|
+
nodeId: params.request.request.nodeId ?? void 0,
|
|
72
|
+
sessionKey: params.request.request.sessionKey ?? void 0,
|
|
73
|
+
expiresAtMs: params.request.expiresAtMs,
|
|
74
|
+
nowMs: params.nowMs
|
|
75
|
+
}).text;
|
|
76
|
+
}
|
|
77
|
+
function buildResolvedApprovalText(params) {
|
|
78
|
+
const command = resolveExecApprovalCommandDisplay(params.request.request).commandText;
|
|
79
|
+
return [
|
|
80
|
+
`Exec approval: ${params.resolved.decision === "allow-once" ? "Allowed once" : params.resolved.decision === "allow-always" ? "Allowed always" : "Denied"}`,
|
|
81
|
+
"",
|
|
82
|
+
"Command",
|
|
83
|
+
"```",
|
|
84
|
+
command,
|
|
85
|
+
"```"
|
|
86
|
+
].join("\n");
|
|
87
|
+
}
|
|
88
|
+
var MatrixExecApprovalHandler = class {
|
|
89
|
+
constructor(opts, deps = {}) {
|
|
90
|
+
this.opts = opts;
|
|
91
|
+
this.nowMs = deps.nowMs ?? Date.now;
|
|
92
|
+
this.sendMessage = deps.sendMessage ?? sendMessageMatrix;
|
|
93
|
+
this.editMessage = deps.editMessage ?? editMatrixMessage;
|
|
94
|
+
this.deleteMessage = deps.deleteMessage ?? deleteMatrixMessage;
|
|
95
|
+
this.repairDirectRooms = deps.repairDirectRooms ?? repairMatrixDirectRooms;
|
|
96
|
+
this.runtime = createChannelNativeApprovalRuntime({
|
|
97
|
+
label: "matrix/exec-approvals",
|
|
98
|
+
clientDisplayName: `Matrix Exec Approvals (${this.opts.accountId})`,
|
|
99
|
+
cfg: this.opts.cfg,
|
|
100
|
+
accountId: this.opts.accountId,
|
|
101
|
+
gatewayUrl: this.opts.gatewayUrl,
|
|
102
|
+
eventKinds: ["exec"],
|
|
103
|
+
nowMs: this.nowMs,
|
|
104
|
+
nativeAdapter: matrixNativeApprovalAdapter.native,
|
|
105
|
+
isConfigured: () => isHandlerConfigured({
|
|
106
|
+
cfg: this.opts.cfg,
|
|
107
|
+
accountId: this.opts.accountId
|
|
108
|
+
}),
|
|
109
|
+
shouldHandle: (request) => shouldHandleMatrixExecApprovalRequest({
|
|
110
|
+
cfg: this.opts.cfg,
|
|
111
|
+
accountId: this.opts.accountId,
|
|
112
|
+
request
|
|
113
|
+
}),
|
|
114
|
+
buildPendingContent: ({ request, nowMs }) => buildPendingApprovalText({
|
|
115
|
+
request,
|
|
116
|
+
nowMs
|
|
117
|
+
}),
|
|
118
|
+
sendOriginNotice: async ({ originTarget }) => {
|
|
119
|
+
const preparedTarget = await this.prepareTarget(originTarget);
|
|
120
|
+
if (!preparedTarget) return;
|
|
121
|
+
await this.sendMessage(preparedTarget.to, getExecApprovalApproverDmNoticeText(), {
|
|
122
|
+
cfg: this.opts.cfg,
|
|
123
|
+
accountId: this.opts.accountId,
|
|
124
|
+
client: this.opts.client,
|
|
125
|
+
threadId: preparedTarget.threadId
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
prepareTarget: async ({ plannedTarget }) => {
|
|
129
|
+
const preparedTarget = await this.prepareTarget(plannedTarget.target);
|
|
130
|
+
if (!preparedTarget) return null;
|
|
131
|
+
return {
|
|
132
|
+
dedupeKey: `${preparedTarget.roomId}:${preparedTarget.threadId ?? ""}`,
|
|
133
|
+
target: preparedTarget
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
deliverTarget: async ({ preparedTarget, pendingContent }) => {
|
|
137
|
+
const result = await this.sendMessage(preparedTarget.to, pendingContent, {
|
|
138
|
+
cfg: this.opts.cfg,
|
|
139
|
+
accountId: this.opts.accountId,
|
|
140
|
+
client: this.opts.client,
|
|
141
|
+
threadId: preparedTarget.threadId
|
|
142
|
+
});
|
|
143
|
+
return {
|
|
144
|
+
roomId: result.roomId,
|
|
145
|
+
messageId: result.messageId
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
finalizeResolved: async ({ request, resolved, entries }) => {
|
|
149
|
+
await this.finalizeResolved(request, resolved, entries);
|
|
150
|
+
},
|
|
151
|
+
finalizeExpired: async ({ entries }) => {
|
|
152
|
+
await this.clearPending(entries);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
async start() {
|
|
157
|
+
await this.runtime.start();
|
|
158
|
+
}
|
|
159
|
+
async stop() {
|
|
160
|
+
await this.runtime.stop();
|
|
161
|
+
}
|
|
162
|
+
async handleRequested(request) {
|
|
163
|
+
await this.runtime.handleRequested(request);
|
|
164
|
+
}
|
|
165
|
+
async handleResolved(resolved) {
|
|
166
|
+
await this.runtime.handleResolved(resolved);
|
|
167
|
+
}
|
|
168
|
+
async prepareTarget(rawTarget) {
|
|
169
|
+
const target = resolveMatrixTargetIdentity(rawTarget.to);
|
|
170
|
+
if (!target) return null;
|
|
171
|
+
const threadId = normalizeThreadId(rawTarget.threadId);
|
|
172
|
+
if (target.kind === "user") {
|
|
173
|
+
const account = resolveMatrixAccount({
|
|
174
|
+
cfg: this.opts.cfg,
|
|
175
|
+
accountId: this.opts.accountId
|
|
176
|
+
});
|
|
177
|
+
const repaired = await this.repairDirectRooms({
|
|
178
|
+
client: this.opts.client,
|
|
179
|
+
remoteUserId: target.id,
|
|
180
|
+
encrypted: account.config.encryption === true
|
|
181
|
+
});
|
|
182
|
+
if (!repaired.activeRoomId) return null;
|
|
183
|
+
return {
|
|
184
|
+
to: `room:${repaired.activeRoomId}`,
|
|
185
|
+
roomId: repaired.activeRoomId,
|
|
186
|
+
threadId
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
to: `room:${target.id}`,
|
|
191
|
+
roomId: target.id,
|
|
192
|
+
threadId
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
async finalizeResolved(request, resolved, entries) {
|
|
196
|
+
const text = buildResolvedApprovalText({
|
|
197
|
+
request,
|
|
198
|
+
resolved
|
|
199
|
+
});
|
|
200
|
+
await Promise.allSettled(entries.map(async (entry) => {
|
|
201
|
+
await this.editMessage(entry.roomId, entry.messageId, text, {
|
|
202
|
+
cfg: this.opts.cfg,
|
|
203
|
+
accountId: this.opts.accountId,
|
|
204
|
+
client: this.opts.client
|
|
205
|
+
});
|
|
206
|
+
}));
|
|
207
|
+
}
|
|
208
|
+
async clearPending(entries) {
|
|
209
|
+
await Promise.allSettled(entries.map(async (entry) => {
|
|
210
|
+
await this.deleteMessage(entry.roomId, entry.messageId, {
|
|
211
|
+
cfg: this.opts.cfg,
|
|
212
|
+
accountId: this.opts.accountId,
|
|
213
|
+
client: this.opts.client,
|
|
214
|
+
reason: "approval expired"
|
|
215
|
+
});
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region extensions/matrix/src/matrix/monitor/auto-join.ts
|
|
221
|
+
function registerMatrixAutoJoin(params) {
|
|
222
|
+
const { client, accountConfig, runtime } = params;
|
|
223
|
+
const core = getMatrixRuntime();
|
|
224
|
+
const logVerbose = (message) => {
|
|
225
|
+
if (!core.logging.shouldLogVerbose()) return;
|
|
226
|
+
runtime.log?.(message);
|
|
227
|
+
};
|
|
228
|
+
const autoJoin = accountConfig.autoJoin ?? "off";
|
|
229
|
+
const rawAllowlist = (accountConfig.autoJoinAllowlist ?? []).map((entry) => String(entry).trim()).filter(Boolean);
|
|
230
|
+
const autoJoinAllowlist = new Set(rawAllowlist);
|
|
231
|
+
const allowedRoomIds = new Set(rawAllowlist.filter((entry) => entry.startsWith("!")));
|
|
232
|
+
const allowedAliases = rawAllowlist.filter((entry) => entry.startsWith("#"));
|
|
233
|
+
const resolvedAliasRoomIds = /* @__PURE__ */ new Map();
|
|
234
|
+
if (autoJoin === "off") return;
|
|
235
|
+
if (autoJoin === "always") logVerbose("matrix: auto-join enabled for all invites");
|
|
236
|
+
else logVerbose("matrix: auto-join enabled for allowlist invites");
|
|
237
|
+
const resolveAllowedAliasRoomId = async (alias) => {
|
|
238
|
+
if (resolvedAliasRoomIds.has(alias)) return resolvedAliasRoomIds.get(alias) ?? null;
|
|
239
|
+
const resolved = await params.client.resolveRoom(alias);
|
|
240
|
+
if (resolved) resolvedAliasRoomIds.set(alias, resolved);
|
|
241
|
+
return resolved;
|
|
242
|
+
};
|
|
243
|
+
const resolveAllowedAliasRoomIds = async () => {
|
|
244
|
+
return (await Promise.all(allowedAliases.map(async (alias) => {
|
|
245
|
+
try {
|
|
246
|
+
return await resolveAllowedAliasRoomId(alias);
|
|
247
|
+
} catch (err) {
|
|
248
|
+
runtime.error?.(`matrix: failed resolving allowlisted alias ${alias}: ${String(err)}`);
|
|
249
|
+
return null;
|
|
250
|
+
}
|
|
251
|
+
}))).filter((roomId) => Boolean(roomId));
|
|
252
|
+
};
|
|
253
|
+
client.on("room.invite", async (roomId, _inviteEvent) => {
|
|
254
|
+
if (autoJoin === "allowlist") {
|
|
255
|
+
const allowedAliasRoomIds = await resolveAllowedAliasRoomIds();
|
|
256
|
+
if (!(autoJoinAllowlist.has("*") || allowedRoomIds.has(roomId) || allowedAliasRoomIds.some((resolvedRoomId) => resolvedRoomId === roomId))) {
|
|
257
|
+
logVerbose(`matrix: invite ignored (not in allowlist) room=${roomId}`);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
try {
|
|
262
|
+
await client.joinRoom(roomId);
|
|
263
|
+
logVerbose(`matrix: joined room ${roomId}`);
|
|
264
|
+
} catch (err) {
|
|
265
|
+
runtime.error?.(`matrix: failed to join room ${roomId}: ${String(err)}`);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region extensions/matrix/src/matrix/monitor/config.ts
|
|
271
|
+
function normalizeMatrixUserLookupEntry(raw) {
|
|
272
|
+
return raw.replace(/^matrix:/i, "").replace(/^user:/i, "").trim();
|
|
273
|
+
}
|
|
274
|
+
function normalizeMatrixRoomLookupEntry(raw) {
|
|
275
|
+
return raw.replace(/^matrix:/i, "").replace(/^(room|channel):/i, "").trim();
|
|
276
|
+
}
|
|
277
|
+
function filterResolvedMatrixAllowlistEntries(entries) {
|
|
278
|
+
return entries.filter((entry) => {
|
|
279
|
+
const trimmed = entry.trim();
|
|
280
|
+
if (!trimmed) return false;
|
|
281
|
+
if (trimmed === "*") return true;
|
|
282
|
+
return isMatrixQualifiedUserId(normalizeMatrixUserLookupEntry(trimmed));
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
function sanitizeMatrixRoomUserAllowlists(entries) {
|
|
286
|
+
const nextEntries = { ...entries };
|
|
287
|
+
for (const [roomKey, roomConfig] of Object.entries(entries)) {
|
|
288
|
+
const users = roomConfig?.users;
|
|
289
|
+
if (!Array.isArray(users)) continue;
|
|
290
|
+
nextEntries[roomKey] = {
|
|
291
|
+
...roomConfig,
|
|
292
|
+
users: filterResolvedMatrixAllowlistEntries(users.map(String))
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
return nextEntries;
|
|
296
|
+
}
|
|
297
|
+
async function resolveMatrixMonitorUserEntries(params) {
|
|
298
|
+
const directMatches = [];
|
|
299
|
+
const pending = [];
|
|
300
|
+
for (const entry of params.entries) {
|
|
301
|
+
const input = String(entry).trim();
|
|
302
|
+
if (!input) continue;
|
|
303
|
+
const query = normalizeMatrixUserLookupEntry(input);
|
|
304
|
+
if (!query || query === "*") continue;
|
|
305
|
+
if (isMatrixQualifiedUserId(query)) {
|
|
306
|
+
directMatches.push({
|
|
307
|
+
input,
|
|
308
|
+
resolved: true,
|
|
309
|
+
id: normalizeMatrixUserId(query)
|
|
310
|
+
});
|
|
311
|
+
continue;
|
|
312
|
+
}
|
|
313
|
+
pending.push({
|
|
314
|
+
input,
|
|
315
|
+
query
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
(pending.length === 0 ? [] : await params.resolveTargets({
|
|
319
|
+
cfg: params.cfg,
|
|
320
|
+
accountId: params.accountId,
|
|
321
|
+
inputs: pending.map((entry) => entry.query),
|
|
322
|
+
kind: "user",
|
|
323
|
+
runtime: params.runtime
|
|
324
|
+
})).forEach((entry, index) => {
|
|
325
|
+
const source = pending[index];
|
|
326
|
+
if (!source) return;
|
|
327
|
+
directMatches.push({
|
|
328
|
+
input: source.input,
|
|
329
|
+
resolved: entry.resolved,
|
|
330
|
+
id: entry.id ? normalizeMatrixUserId(entry.id) : void 0
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
return buildAllowlistResolutionSummary(directMatches);
|
|
334
|
+
}
|
|
335
|
+
async function resolveMatrixMonitorUserAllowlist(params) {
|
|
336
|
+
const allowList = (params.list ?? []).map(String);
|
|
337
|
+
if (allowList.length === 0) return allowList;
|
|
338
|
+
const resolution = await resolveMatrixMonitorUserEntries({
|
|
339
|
+
cfg: params.cfg,
|
|
340
|
+
accountId: params.accountId,
|
|
341
|
+
entries: allowList,
|
|
342
|
+
runtime: params.runtime,
|
|
343
|
+
resolveTargets: params.resolveTargets
|
|
344
|
+
});
|
|
345
|
+
const canonicalized = canonicalizeAllowlistWithResolvedIds({
|
|
346
|
+
existing: allowList,
|
|
347
|
+
resolvedMap: resolution.resolvedMap
|
|
348
|
+
});
|
|
349
|
+
summarizeMapping(params.label, resolution.mapping, resolution.unresolved, params.runtime);
|
|
350
|
+
if (resolution.unresolved.length > 0) params.runtime.log?.(`${params.label} entries must be full Matrix IDs (example: @user:server). Unresolved entries are ignored.`);
|
|
351
|
+
return filterResolvedMatrixAllowlistEntries(canonicalized);
|
|
352
|
+
}
|
|
353
|
+
async function resolveMatrixMonitorRoomsConfig(params) {
|
|
354
|
+
const roomsConfig = params.roomsConfig;
|
|
355
|
+
if (!roomsConfig || Object.keys(roomsConfig).length === 0) return roomsConfig;
|
|
356
|
+
const mapping = [];
|
|
357
|
+
const unresolved = [];
|
|
358
|
+
const nextRooms = {};
|
|
359
|
+
if (roomsConfig["*"]) nextRooms["*"] = roomsConfig["*"];
|
|
360
|
+
const pending = [];
|
|
361
|
+
for (const [entry, roomConfig] of Object.entries(roomsConfig)) {
|
|
362
|
+
if (entry === "*") continue;
|
|
363
|
+
const input = entry.trim();
|
|
364
|
+
if (!input) continue;
|
|
365
|
+
const cleaned = normalizeMatrixRoomLookupEntry(input);
|
|
366
|
+
if (!cleaned) {
|
|
367
|
+
unresolved.push(entry);
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
if (cleaned.startsWith("!") && cleaned.includes(":")) {
|
|
371
|
+
if (!nextRooms[cleaned]) nextRooms[cleaned] = roomConfig;
|
|
372
|
+
if (cleaned !== input) mapping.push(`${input}→${cleaned}`);
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
pending.push({
|
|
376
|
+
input,
|
|
377
|
+
query: cleaned,
|
|
378
|
+
config: roomConfig
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
if (pending.length > 0) (await params.resolveTargets({
|
|
382
|
+
cfg: params.cfg,
|
|
383
|
+
accountId: params.accountId,
|
|
384
|
+
inputs: pending.map((entry) => entry.query),
|
|
385
|
+
kind: "group",
|
|
386
|
+
runtime: params.runtime
|
|
387
|
+
})).forEach((entry, index) => {
|
|
388
|
+
const source = pending[index];
|
|
389
|
+
if (!source) return;
|
|
390
|
+
if (entry.resolved && entry.id) {
|
|
391
|
+
const roomKey = normalizeMatrixRoomLookupEntry(entry.id);
|
|
392
|
+
if (!nextRooms[roomKey]) nextRooms[roomKey] = source.config;
|
|
393
|
+
mapping.push(`${source.input}→${roomKey}`);
|
|
394
|
+
} else unresolved.push(source.input);
|
|
395
|
+
});
|
|
396
|
+
summarizeMapping("matrix rooms", mapping, unresolved, params.runtime);
|
|
397
|
+
if (unresolved.length > 0) params.runtime.log?.("matrix rooms must be room IDs or aliases (example: !room:server or #alias:server). Unresolved entries are ignored.");
|
|
398
|
+
const roomUsers = /* @__PURE__ */ new Set();
|
|
399
|
+
for (const roomConfig of Object.values(nextRooms)) addAllowlistUserEntriesFromConfigEntry(roomUsers, roomConfig);
|
|
400
|
+
if (roomUsers.size === 0) return nextRooms;
|
|
401
|
+
const resolution = await resolveMatrixMonitorUserEntries({
|
|
402
|
+
cfg: params.cfg,
|
|
403
|
+
accountId: params.accountId,
|
|
404
|
+
entries: Array.from(roomUsers),
|
|
405
|
+
runtime: params.runtime,
|
|
406
|
+
resolveTargets: params.resolveTargets
|
|
407
|
+
});
|
|
408
|
+
summarizeMapping("matrix room users", resolution.mapping, resolution.unresolved, params.runtime);
|
|
409
|
+
if (resolution.unresolved.length > 0) params.runtime.log?.("matrix room users entries must be full Matrix IDs (example: @user:server). Unresolved entries are ignored.");
|
|
410
|
+
return sanitizeMatrixRoomUserAllowlists(patchAllowlistUsersInConfigEntries({
|
|
411
|
+
entries: nextRooms,
|
|
412
|
+
resolvedMap: resolution.resolvedMap,
|
|
413
|
+
strategy: "canonicalize"
|
|
414
|
+
}));
|
|
415
|
+
}
|
|
416
|
+
async function resolveMatrixMonitorConfig(params) {
|
|
417
|
+
const resolveTargets = params.resolveTargets ?? resolveMatrixTargets;
|
|
418
|
+
const [allowFrom, groupAllowFrom, roomsConfig] = await Promise.all([
|
|
419
|
+
resolveMatrixMonitorUserAllowlist({
|
|
420
|
+
cfg: params.cfg,
|
|
421
|
+
accountId: params.accountId,
|
|
422
|
+
label: "matrix dm allowlist",
|
|
423
|
+
list: params.allowFrom,
|
|
424
|
+
runtime: params.runtime,
|
|
425
|
+
resolveTargets
|
|
426
|
+
}),
|
|
427
|
+
resolveMatrixMonitorUserAllowlist({
|
|
428
|
+
cfg: params.cfg,
|
|
429
|
+
accountId: params.accountId,
|
|
430
|
+
label: "matrix group allowlist",
|
|
431
|
+
list: params.groupAllowFrom,
|
|
432
|
+
runtime: params.runtime,
|
|
433
|
+
resolveTargets
|
|
434
|
+
}),
|
|
435
|
+
resolveMatrixMonitorRoomsConfig({
|
|
436
|
+
cfg: params.cfg,
|
|
437
|
+
accountId: params.accountId,
|
|
438
|
+
roomsConfig: params.roomsConfig,
|
|
439
|
+
runtime: params.runtime,
|
|
440
|
+
resolveTargets
|
|
441
|
+
})
|
|
442
|
+
]);
|
|
443
|
+
return {
|
|
444
|
+
allowFrom,
|
|
445
|
+
groupAllowFrom,
|
|
446
|
+
roomsConfig
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region extensions/matrix/src/matrix/monitor/direct.ts
|
|
451
|
+
const DM_CACHE_TTL_MS = 3e4;
|
|
452
|
+
const RECENT_INVITE_TTL_MS = 3e4;
|
|
453
|
+
const MAX_TRACKED_DM_ROOMS = 1024;
|
|
454
|
+
const MAX_TRACKED_DM_MEMBER_FLAGS = 2048;
|
|
455
|
+
function rememberBounded$1(map, key, value, maxSize = MAX_TRACKED_DM_ROOMS) {
|
|
456
|
+
map.set(key, value);
|
|
457
|
+
if (map.size > maxSize) {
|
|
458
|
+
const oldest = map.keys().next().value;
|
|
459
|
+
if (typeof oldest === "string") map.delete(oldest);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function createDirectRoomTracker(client, opts = {}) {
|
|
463
|
+
const log = opts.log ?? (() => {});
|
|
464
|
+
let lastDmUpdateMs = 0;
|
|
465
|
+
let hasSeededDmCache = false;
|
|
466
|
+
let cachedSelfUserId = null;
|
|
467
|
+
const joinedMembersCache = /* @__PURE__ */ new Map();
|
|
468
|
+
const directMemberFlagCache = /* @__PURE__ */ new Map();
|
|
469
|
+
const recentInviteCandidates = /* @__PURE__ */ new Map();
|
|
470
|
+
const locallyPromotedDirectRooms = /* @__PURE__ */ new Map();
|
|
471
|
+
const ensureSelfUserId = async () => {
|
|
472
|
+
if (cachedSelfUserId) return cachedSelfUserId;
|
|
473
|
+
try {
|
|
474
|
+
cachedSelfUserId = await client.getUserId();
|
|
475
|
+
} catch {
|
|
476
|
+
cachedSelfUserId = null;
|
|
477
|
+
}
|
|
478
|
+
return cachedSelfUserId;
|
|
479
|
+
};
|
|
480
|
+
const refreshDmCache = async () => {
|
|
481
|
+
const now = Date.now();
|
|
482
|
+
if (now - lastDmUpdateMs < DM_CACHE_TTL_MS) return;
|
|
483
|
+
lastDmUpdateMs = now;
|
|
484
|
+
hasSeededDmCache = await client.dms.update() || hasSeededDmCache;
|
|
485
|
+
};
|
|
486
|
+
const resolveJoinedMembers = async (roomId) => {
|
|
487
|
+
const cached = joinedMembersCache.get(roomId);
|
|
488
|
+
const now = Date.now();
|
|
489
|
+
if (cached && now - cached.ts < DM_CACHE_TTL_MS) return cached.members;
|
|
490
|
+
try {
|
|
491
|
+
const normalized = await readJoinedMatrixMembers(client, roomId);
|
|
492
|
+
if (!normalized) throw new Error("membership unavailable");
|
|
493
|
+
rememberBounded$1(joinedMembersCache, roomId, {
|
|
494
|
+
members: normalized,
|
|
495
|
+
ts: now
|
|
496
|
+
});
|
|
497
|
+
return normalized;
|
|
498
|
+
} catch (err) {
|
|
499
|
+
log(`matrix: dm member lookup failed room=${roomId} (${String(err)})`);
|
|
500
|
+
return null;
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
const resolveDirectMemberFlag = async (roomId, userId) => {
|
|
504
|
+
const normalizedUserId = userId?.trim();
|
|
505
|
+
if (!normalizedUserId) return null;
|
|
506
|
+
const cacheKey = `${roomId}\n${normalizedUserId}`;
|
|
507
|
+
const cached = directMemberFlagCache.get(cacheKey);
|
|
508
|
+
const now = Date.now();
|
|
509
|
+
if (cached && now - cached.ts < DM_CACHE_TTL_MS) return cached.isDirect;
|
|
510
|
+
const isDirect = await hasDirectMatrixMemberFlag(client, roomId, normalizedUserId);
|
|
511
|
+
rememberBounded$1(directMemberFlagCache, cacheKey, {
|
|
512
|
+
isDirect,
|
|
513
|
+
ts: now
|
|
514
|
+
}, MAX_TRACKED_DM_MEMBER_FLAGS);
|
|
515
|
+
return isDirect;
|
|
516
|
+
};
|
|
517
|
+
const hasRecentInviteCandidate = (roomId, remoteUserId) => {
|
|
518
|
+
const normalizedRemoteUserId = remoteUserId?.trim();
|
|
519
|
+
if (!normalizedRemoteUserId) return false;
|
|
520
|
+
const cached = recentInviteCandidates.get(roomId);
|
|
521
|
+
if (!cached) return false;
|
|
522
|
+
if (Date.now() - cached.ts >= RECENT_INVITE_TTL_MS) {
|
|
523
|
+
recentInviteCandidates.delete(roomId);
|
|
524
|
+
return false;
|
|
525
|
+
}
|
|
526
|
+
return cached.remoteUserId === normalizedRemoteUserId;
|
|
527
|
+
};
|
|
528
|
+
const canPromoteRecentInvite = async (roomId) => {
|
|
529
|
+
try {
|
|
530
|
+
return await opts.canPromoteRecentInvite?.(roomId) ?? true;
|
|
531
|
+
} catch (err) {
|
|
532
|
+
log(`matrix: recent invite promotion veto failed room=${roomId} (${String(err)})`);
|
|
533
|
+
return false;
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
const shouldKeepLocallyPromotedDirectRoom = async (roomId) => {
|
|
537
|
+
try {
|
|
538
|
+
return await opts.shouldKeepLocallyPromotedDirectRoom?.(roomId);
|
|
539
|
+
} catch (err) {
|
|
540
|
+
log(`matrix: local promotion keep-check failed room=${roomId} (${String(err)})`);
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
const hasLocallyPromotedDirectRoom = (roomId, remoteUserId) => {
|
|
545
|
+
const normalizedRemoteUserId = remoteUserId?.trim();
|
|
546
|
+
if (!normalizedRemoteUserId) return false;
|
|
547
|
+
return locallyPromotedDirectRooms.get(roomId)?.remoteUserId === normalizedRemoteUserId;
|
|
548
|
+
};
|
|
549
|
+
const rememberLocallyPromotedDirectRoom = (roomId, remoteUserId) => {
|
|
550
|
+
const normalizedRemoteUserId = remoteUserId.trim();
|
|
551
|
+
if (!normalizedRemoteUserId) return;
|
|
552
|
+
rememberBounded$1(locallyPromotedDirectRooms, roomId, { remoteUserId: normalizedRemoteUserId });
|
|
553
|
+
};
|
|
554
|
+
return {
|
|
555
|
+
invalidateRoom: (roomId) => {
|
|
556
|
+
joinedMembersCache.delete(roomId);
|
|
557
|
+
for (const key of directMemberFlagCache.keys()) if (key.startsWith(`${roomId}\n`)) directMemberFlagCache.delete(key);
|
|
558
|
+
lastDmUpdateMs = 0;
|
|
559
|
+
log(`matrix: invalidated dm cache room=${roomId}`);
|
|
560
|
+
},
|
|
561
|
+
rememberInvite: (roomId, remoteUserId) => {
|
|
562
|
+
const normalizedRemoteUserId = remoteUserId.trim();
|
|
563
|
+
if (!normalizedRemoteUserId) return;
|
|
564
|
+
rememberBounded$1(recentInviteCandidates, roomId, {
|
|
565
|
+
remoteUserId: normalizedRemoteUserId,
|
|
566
|
+
ts: Date.now()
|
|
567
|
+
});
|
|
568
|
+
log(`matrix: remembered invite candidate room=${roomId} sender=${normalizedRemoteUserId}`);
|
|
569
|
+
},
|
|
570
|
+
isDirectMessage: async (params) => {
|
|
571
|
+
const { roomId, senderId } = params;
|
|
572
|
+
const selfUserId = params.selfUserId ?? await ensureSelfUserId();
|
|
573
|
+
const joinedMembers = await resolveJoinedMembers(roomId);
|
|
574
|
+
const strictDirectMembership = isStrictDirectMembership({
|
|
575
|
+
selfUserId,
|
|
576
|
+
remoteUserId: senderId,
|
|
577
|
+
joinedMembers
|
|
578
|
+
});
|
|
579
|
+
try {
|
|
580
|
+
await refreshDmCache();
|
|
581
|
+
} catch (err) {
|
|
582
|
+
log(`matrix: dm cache refresh failed (${String(err)})`);
|
|
583
|
+
}
|
|
584
|
+
if (client.dms.isDm(roomId)) {
|
|
585
|
+
if (strictDirectMembership) {
|
|
586
|
+
log(`matrix: dm detected via m.direct room=${roomId}`);
|
|
587
|
+
return true;
|
|
588
|
+
}
|
|
589
|
+
log(`matrix: ignoring stale m.direct classification room=${roomId}`);
|
|
590
|
+
}
|
|
591
|
+
if (strictDirectMembership) {
|
|
592
|
+
const directViaSelf = await resolveDirectMemberFlag(roomId, selfUserId);
|
|
593
|
+
if (directViaSelf === true) {
|
|
594
|
+
log(`matrix: dm detected via member state room=${roomId}`);
|
|
595
|
+
return true;
|
|
596
|
+
}
|
|
597
|
+
if (directViaSelf === false) {
|
|
598
|
+
log(`matrix: dm rejected via member state room=${roomId}`);
|
|
599
|
+
return false;
|
|
600
|
+
}
|
|
601
|
+
if (!hasSeededDmCache) {
|
|
602
|
+
log(`matrix: dm detected via exact 2-member fallback before dm cache seed room=${roomId}`);
|
|
603
|
+
return true;
|
|
604
|
+
}
|
|
605
|
+
if (hasLocallyPromotedDirectRoom(roomId, senderId)) {
|
|
606
|
+
if (await shouldKeepLocallyPromotedDirectRoom(roomId) !== false) {
|
|
607
|
+
log(`matrix: dm detected via local promotion room=${roomId}`);
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
locallyPromotedDirectRooms.delete(roomId);
|
|
611
|
+
log(`matrix: local promotion cleared room=${roomId}`);
|
|
612
|
+
}
|
|
613
|
+
if (hasRecentInviteCandidate(roomId, senderId) && await canPromoteRecentInvite(roomId)) {
|
|
614
|
+
const promotion = await promoteMatrixDirectRoomCandidate({
|
|
615
|
+
client,
|
|
616
|
+
remoteUserId: senderId ?? "",
|
|
617
|
+
roomId,
|
|
618
|
+
selfUserId
|
|
619
|
+
});
|
|
620
|
+
if (promotion.classifyAsDirect) {
|
|
621
|
+
rememberLocallyPromotedDirectRoom(roomId, senderId ?? "");
|
|
622
|
+
log(`matrix: dm detected via recent invite room=${roomId} reason=${promotion.reason} repaired=${String(promotion.repaired)}`);
|
|
623
|
+
return true;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
log(`matrix: dm check room=${roomId} result=group members=${joinedMembers?.length ?? "unknown"}`);
|
|
628
|
+
return false;
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
//#endregion
|
|
633
|
+
//#region extensions/matrix/src/matrix/monitor/types.ts
|
|
634
|
+
const EventType = {
|
|
635
|
+
RoomMessage: "m.room.message",
|
|
636
|
+
RoomMessageEncrypted: "m.room.encrypted",
|
|
637
|
+
RoomMember: "m.room.member",
|
|
638
|
+
Location: "m.location",
|
|
639
|
+
Reaction: MATRIX_REACTION_EVENT_TYPE
|
|
640
|
+
};
|
|
641
|
+
const RelationType = {
|
|
642
|
+
Replace: "m.replace",
|
|
643
|
+
Thread: "m.thread"
|
|
644
|
+
};
|
|
645
|
+
//#endregion
|
|
646
|
+
//#region extensions/matrix/src/matrix/monitor/access-state.ts
|
|
647
|
+
function resolveMatrixMonitorAccessState(params) {
|
|
648
|
+
const effectiveAllowFrom = normalizeMatrixAllowList([...params.allowFrom, ...params.storeAllowFrom]);
|
|
649
|
+
const effectiveGroupAllowFrom = normalizeMatrixAllowList(params.groupAllowFrom);
|
|
650
|
+
const effectiveRoomUsers = normalizeMatrixAllowList(params.roomUsers);
|
|
651
|
+
const directAllowMatch = resolveMatrixAllowListMatch({
|
|
652
|
+
allowList: effectiveAllowFrom,
|
|
653
|
+
userId: params.senderId
|
|
654
|
+
});
|
|
655
|
+
const roomUserMatch = params.isRoom && effectiveRoomUsers.length > 0 ? resolveMatrixAllowListMatch({
|
|
656
|
+
allowList: effectiveRoomUsers,
|
|
657
|
+
userId: params.senderId
|
|
658
|
+
}) : null;
|
|
659
|
+
const groupAllowMatch = effectiveGroupAllowFrom.length > 0 ? resolveMatrixAllowListMatch({
|
|
660
|
+
allowList: effectiveGroupAllowFrom,
|
|
661
|
+
userId: params.senderId
|
|
662
|
+
}) : null;
|
|
663
|
+
return {
|
|
664
|
+
effectiveAllowFrom,
|
|
665
|
+
effectiveGroupAllowFrom,
|
|
666
|
+
effectiveRoomUsers,
|
|
667
|
+
groupAllowConfigured: effectiveGroupAllowFrom.length > 0,
|
|
668
|
+
directAllowMatch,
|
|
669
|
+
roomUserMatch,
|
|
670
|
+
groupAllowMatch,
|
|
671
|
+
commandAuthorizers: [
|
|
672
|
+
{
|
|
673
|
+
configured: effectiveAllowFrom.length > 0,
|
|
674
|
+
allowed: directAllowMatch.allowed
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
configured: effectiveRoomUsers.length > 0,
|
|
678
|
+
allowed: roomUserMatch?.allowed ?? false
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
configured: effectiveGroupAllowFrom.length > 0,
|
|
682
|
+
allowed: groupAllowMatch?.allowed ?? false
|
|
683
|
+
}
|
|
684
|
+
]
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
//#endregion
|
|
688
|
+
//#region extensions/matrix/src/matrix/monitor/verification-utils.ts
|
|
689
|
+
const VERIFICATION_EVENT_PREFIX = "m.key.verification.";
|
|
690
|
+
const VERIFICATION_REQUEST_MSGTYPE = "m.key.verification.request";
|
|
691
|
+
const VERIFICATION_NOTICE_PREFIXES = [
|
|
692
|
+
"Matrix verification request received from ",
|
|
693
|
+
"Matrix verification is ready with ",
|
|
694
|
+
"Matrix verification started with ",
|
|
695
|
+
"Matrix verification completed with ",
|
|
696
|
+
"Matrix verification cancelled by ",
|
|
697
|
+
"Matrix verification SAS with "
|
|
698
|
+
];
|
|
699
|
+
function trimMaybeString$1(input) {
|
|
700
|
+
return typeof input === "string" ? input.trim() : "";
|
|
701
|
+
}
|
|
702
|
+
function isMatrixVerificationEventType(type) {
|
|
703
|
+
return trimMaybeString$1(type).startsWith(VERIFICATION_EVENT_PREFIX);
|
|
704
|
+
}
|
|
705
|
+
function isMatrixVerificationRequestMsgType(msgtype) {
|
|
706
|
+
return trimMaybeString$1(msgtype) === VERIFICATION_REQUEST_MSGTYPE;
|
|
707
|
+
}
|
|
708
|
+
function isMatrixVerificationNoticeBody(body) {
|
|
709
|
+
const text = trimMaybeString$1(body);
|
|
710
|
+
return VERIFICATION_NOTICE_PREFIXES.some((prefix) => text.startsWith(prefix));
|
|
711
|
+
}
|
|
712
|
+
function isMatrixVerificationRoomMessage(content) {
|
|
713
|
+
return isMatrixVerificationRequestMsgType(content.msgtype) || trimMaybeString$1(content.msgtype) === "m.notice" && isMatrixVerificationNoticeBody(content.body);
|
|
714
|
+
}
|
|
715
|
+
const matrixVerificationConstants = {
|
|
716
|
+
eventPrefix: VERIFICATION_EVENT_PREFIX,
|
|
717
|
+
requestMsgtype: VERIFICATION_REQUEST_MSGTYPE
|
|
718
|
+
};
|
|
719
|
+
//#endregion
|
|
720
|
+
//#region extensions/matrix/src/matrix/monitor/verification-events.ts
|
|
721
|
+
const MAX_TRACKED_VERIFICATION_EVENTS = 1024;
|
|
722
|
+
const SAS_NOTICE_RETRY_DELAY_MS = 750;
|
|
723
|
+
const VERIFICATION_EVENT_STARTUP_GRACE_MS = 3e4;
|
|
724
|
+
let matrixDirectRoomDepsPromise;
|
|
725
|
+
async function loadMatrixDirectRoomDeps() {
|
|
726
|
+
matrixDirectRoomDepsPromise ??= Promise.all([import("./direct-management-CaI85_dA.js"), import("./direct-room-GeCNSeaQ.js")]).then(([directManagementModule, directRoomModule]) => ({
|
|
727
|
+
inspectMatrixDirectRooms: directManagementModule.inspectMatrixDirectRooms,
|
|
728
|
+
isStrictDirectRoom: directRoomModule.isStrictDirectRoom
|
|
729
|
+
}));
|
|
730
|
+
return await matrixDirectRoomDepsPromise;
|
|
731
|
+
}
|
|
732
|
+
function trimMaybeString(input) {
|
|
733
|
+
if (typeof input !== "string") return null;
|
|
734
|
+
const trimmed = input.trim();
|
|
735
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
736
|
+
}
|
|
737
|
+
function readVerificationSignal(event) {
|
|
738
|
+
const type = trimMaybeString(event?.type) ?? "";
|
|
739
|
+
const content = event?.content ?? {};
|
|
740
|
+
const msgtype = trimMaybeString(content.msgtype) ?? "";
|
|
741
|
+
const relatedEventId = trimMaybeString(content["m.relates_to"]?.event_id);
|
|
742
|
+
const transactionId = trimMaybeString(content.transaction_id);
|
|
743
|
+
if (type === EventType.RoomMessage && isMatrixVerificationRequestMsgType(msgtype)) return {
|
|
744
|
+
stage: "request",
|
|
745
|
+
flowId: trimMaybeString(event.event_id) ?? transactionId ?? relatedEventId
|
|
746
|
+
};
|
|
747
|
+
if (!isMatrixVerificationEventType(type)) return null;
|
|
748
|
+
const flowId = transactionId ?? relatedEventId ?? trimMaybeString(event.event_id);
|
|
749
|
+
if (type === `${matrixVerificationConstants.eventPrefix}request`) return {
|
|
750
|
+
stage: "request",
|
|
751
|
+
flowId
|
|
752
|
+
};
|
|
753
|
+
if (type === `${matrixVerificationConstants.eventPrefix}ready`) return {
|
|
754
|
+
stage: "ready",
|
|
755
|
+
flowId
|
|
756
|
+
};
|
|
757
|
+
if (type === "m.key.verification.start") return {
|
|
758
|
+
stage: "start",
|
|
759
|
+
flowId
|
|
760
|
+
};
|
|
761
|
+
if (type === "m.key.verification.cancel") return {
|
|
762
|
+
stage: "cancel",
|
|
763
|
+
flowId
|
|
764
|
+
};
|
|
765
|
+
if (type === "m.key.verification.done") return {
|
|
766
|
+
stage: "done",
|
|
767
|
+
flowId
|
|
768
|
+
};
|
|
769
|
+
return {
|
|
770
|
+
stage: "other",
|
|
771
|
+
flowId
|
|
772
|
+
};
|
|
773
|
+
}
|
|
774
|
+
function formatVerificationStageNotice(params) {
|
|
775
|
+
const { stage, senderId, event } = params;
|
|
776
|
+
const content = event.content;
|
|
777
|
+
switch (stage) {
|
|
778
|
+
case "request": return `Matrix verification request received from ${senderId}. Open "Verify by emoji" in your Matrix client to continue.`;
|
|
779
|
+
case "ready": return `Matrix verification is ready with ${senderId}. Choose "Verify by emoji" to reveal the emoji sequence.`;
|
|
780
|
+
case "start": return `Matrix verification started with ${senderId}.`;
|
|
781
|
+
case "done": return `Matrix verification completed with ${senderId}.`;
|
|
782
|
+
case "cancel": {
|
|
783
|
+
const code = trimMaybeString(content.code);
|
|
784
|
+
const reason = trimMaybeString(content.reason);
|
|
785
|
+
if (code && reason) return `Matrix verification cancelled by ${senderId} (${code}: ${reason}).`;
|
|
786
|
+
if (reason) return `Matrix verification cancelled by ${senderId} (${reason}).`;
|
|
787
|
+
return `Matrix verification cancelled by ${senderId}.`;
|
|
788
|
+
}
|
|
789
|
+
default: return null;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
function formatVerificationSasNotice(summary) {
|
|
793
|
+
const sas = summary.sas;
|
|
794
|
+
if (!sas) return null;
|
|
795
|
+
const emojiLine = Array.isArray(sas.emoji) && sas.emoji.length > 0 ? `SAS emoji: ${sas.emoji.map(([emoji, name]) => `${trimMaybeString(emoji) ?? "?"} ${trimMaybeString(name) ?? "?"}`).join(" | ")}` : null;
|
|
796
|
+
const decimalLine = Array.isArray(sas.decimal) && sas.decimal.length === 3 ? `SAS decimal: ${sas.decimal.join(" ")}` : null;
|
|
797
|
+
if (!emojiLine && !decimalLine) return null;
|
|
798
|
+
const lines = [`Matrix verification SAS with ${summary.otherUserId}:`];
|
|
799
|
+
if (emojiLine) lines.push(emojiLine);
|
|
800
|
+
if (decimalLine) lines.push(decimalLine);
|
|
801
|
+
lines.push("If both sides match, choose 'They match' in your Matrix app.");
|
|
802
|
+
return lines.join("\n");
|
|
803
|
+
}
|
|
804
|
+
function resolveVerificationFlowCandidates(params) {
|
|
805
|
+
const { event, flowId } = params;
|
|
806
|
+
const content = event.content;
|
|
807
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
808
|
+
const add = (value) => {
|
|
809
|
+
const normalized = trimMaybeString(value);
|
|
810
|
+
if (normalized) candidates.add(normalized);
|
|
811
|
+
};
|
|
812
|
+
add(flowId);
|
|
813
|
+
add(event.event_id);
|
|
814
|
+
add(content.transaction_id);
|
|
815
|
+
add(content["m.relates_to"]?.event_id);
|
|
816
|
+
return Array.from(candidates);
|
|
817
|
+
}
|
|
818
|
+
function resolveSummaryRecency(summary) {
|
|
819
|
+
const ts = Date.parse(summary.updatedAt ?? "");
|
|
820
|
+
return Number.isFinite(ts) ? ts : 0;
|
|
821
|
+
}
|
|
822
|
+
function isActiveVerificationSummary(summary) {
|
|
823
|
+
if (summary.completed === true) return false;
|
|
824
|
+
if (summary.phaseName === "cancelled" || summary.phaseName === "done") return false;
|
|
825
|
+
if (typeof summary.phase === "number" && summary.phase >= 4) return false;
|
|
826
|
+
return true;
|
|
827
|
+
}
|
|
828
|
+
async function resolveVerificationSummaryForSignal(client, params) {
|
|
829
|
+
if (!client.crypto) return null;
|
|
830
|
+
await client.crypto.ensureVerificationDmTracked({
|
|
831
|
+
roomId: params.roomId,
|
|
832
|
+
userId: params.senderId
|
|
833
|
+
}).catch(() => null);
|
|
834
|
+
const list = await client.crypto.listVerifications();
|
|
835
|
+
if (list.length === 0) return null;
|
|
836
|
+
const candidates = resolveVerificationFlowCandidates({
|
|
837
|
+
event: params.event,
|
|
838
|
+
flowId: params.flowId
|
|
839
|
+
});
|
|
840
|
+
const byTransactionId = list.find((entry) => candidates.some((candidate) => entry.transactionId === candidate));
|
|
841
|
+
if (byTransactionId) return byTransactionId;
|
|
842
|
+
const { inspectMatrixDirectRooms, isStrictDirectRoom } = await loadMatrixDirectRoomDeps();
|
|
843
|
+
const activeRoomId = trimMaybeString((await inspectMatrixDirectRooms({
|
|
844
|
+
client,
|
|
845
|
+
remoteUserId: params.senderId
|
|
846
|
+
}).catch(() => null))?.activeRoomId);
|
|
847
|
+
if (activeRoomId) {
|
|
848
|
+
if (activeRoomId !== params.roomId) return null;
|
|
849
|
+
} else if (!await isStrictDirectRoom({
|
|
850
|
+
client,
|
|
851
|
+
roomId: params.roomId,
|
|
852
|
+
remoteUserId: params.senderId
|
|
853
|
+
})) return null;
|
|
854
|
+
const activeByUser = list.filter((entry) => entry.otherUserId === params.senderId && isActiveVerificationSummary(entry)).sort((a, b) => resolveSummaryRecency(b) - resolveSummaryRecency(a));
|
|
855
|
+
const activeInRoom = activeByUser.filter((entry) => {
|
|
856
|
+
return trimMaybeString(entry.roomId) === params.roomId;
|
|
857
|
+
});
|
|
858
|
+
if (activeInRoom.length > 0) return activeInRoom[0] ?? null;
|
|
859
|
+
return activeByUser[0] ?? null;
|
|
860
|
+
}
|
|
861
|
+
async function resolveVerificationSasNoticeForSignal(client, params) {
|
|
862
|
+
const summary = await resolveVerificationSummaryForSignal(client, params);
|
|
863
|
+
const immediateNotice = summary && isActiveVerificationSummary(summary) ? formatVerificationSasNotice(summary) : null;
|
|
864
|
+
if (immediateNotice || params.stage !== "ready" && params.stage !== "start") return {
|
|
865
|
+
summary,
|
|
866
|
+
sasNotice: immediateNotice
|
|
867
|
+
};
|
|
868
|
+
await new Promise((resolve) => setTimeout(resolve, SAS_NOTICE_RETRY_DELAY_MS));
|
|
869
|
+
const retriedSummary = await resolveVerificationSummaryForSignal(client, params);
|
|
870
|
+
return {
|
|
871
|
+
summary: retriedSummary,
|
|
872
|
+
sasNotice: retriedSummary && isActiveVerificationSummary(retriedSummary) ? formatVerificationSasNotice(retriedSummary) : null
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
function trackBounded(set, value) {
|
|
876
|
+
if (!value || set.has(value)) return false;
|
|
877
|
+
set.add(value);
|
|
878
|
+
if (set.size > MAX_TRACKED_VERIFICATION_EVENTS) {
|
|
879
|
+
const oldest = set.values().next().value;
|
|
880
|
+
if (typeof oldest === "string") set.delete(oldest);
|
|
881
|
+
}
|
|
882
|
+
return true;
|
|
883
|
+
}
|
|
884
|
+
async function sendVerificationNotice(params) {
|
|
885
|
+
const roomId = trimMaybeString(params.roomId);
|
|
886
|
+
if (!roomId) return;
|
|
887
|
+
try {
|
|
888
|
+
await params.client.sendMessage(roomId, {
|
|
889
|
+
msgtype: "m.notice",
|
|
890
|
+
body: params.body
|
|
891
|
+
});
|
|
892
|
+
} catch (err) {
|
|
893
|
+
params.logVerboseMessage(`matrix: failed sending verification notice room=${roomId}: ${String(err)}`);
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
async function isVerificationNoticeAuthorized(params) {
|
|
897
|
+
if (!params.dmEnabled || params.dmPolicy === "disabled") {
|
|
898
|
+
params.logVerboseMessage(`matrix: blocked verification sender ${params.senderId} (dmPolicy=${params.dmPolicy}, dmEnabled=${String(params.dmEnabled)})`);
|
|
899
|
+
return false;
|
|
900
|
+
}
|
|
901
|
+
if (params.dmPolicy === "open") return true;
|
|
902
|
+
const storeAllowFrom = await params.readStoreAllowFrom();
|
|
903
|
+
if (resolveMatrixMonitorAccessState({
|
|
904
|
+
allowFrom: params.allowFrom,
|
|
905
|
+
storeAllowFrom,
|
|
906
|
+
groupAllowFrom: [],
|
|
907
|
+
roomUsers: [],
|
|
908
|
+
senderId: params.senderId,
|
|
909
|
+
isRoom: false
|
|
910
|
+
}).directAllowMatch.allowed) return true;
|
|
911
|
+
params.logVerboseMessage(`matrix: blocked verification sender ${params.senderId} (dmPolicy=${params.dmPolicy})`);
|
|
912
|
+
return false;
|
|
913
|
+
}
|
|
914
|
+
function createMatrixVerificationEventRouter(params) {
|
|
915
|
+
const routerStartedAtMs = Date.now();
|
|
916
|
+
const routedVerificationEvents = /* @__PURE__ */ new Set();
|
|
917
|
+
const routedVerificationSasFingerprints = /* @__PURE__ */ new Set();
|
|
918
|
+
const routedVerificationStageNotices = /* @__PURE__ */ new Set();
|
|
919
|
+
const verificationFlowRooms = /* @__PURE__ */ new Map();
|
|
920
|
+
const verificationUserRooms = /* @__PURE__ */ new Map();
|
|
921
|
+
async function resolveActiveDirectRoomId(remoteUserId) {
|
|
922
|
+
const { inspectMatrixDirectRooms } = await loadMatrixDirectRoomDeps();
|
|
923
|
+
return trimMaybeString((await inspectMatrixDirectRooms({
|
|
924
|
+
client: params.client,
|
|
925
|
+
remoteUserId
|
|
926
|
+
}).catch(() => null))?.activeRoomId);
|
|
927
|
+
}
|
|
928
|
+
function shouldEmitVerificationEventNotice(event) {
|
|
929
|
+
const eventTs = typeof event.origin_server_ts === "number" && Number.isFinite(event.origin_server_ts) ? event.origin_server_ts : null;
|
|
930
|
+
if (eventTs === null) return true;
|
|
931
|
+
return eventTs >= routerStartedAtMs - VERIFICATION_EVENT_STARTUP_GRACE_MS;
|
|
932
|
+
}
|
|
933
|
+
function rememberVerificationRoom(roomId, event, flowId) {
|
|
934
|
+
for (const candidate of resolveVerificationFlowCandidates({
|
|
935
|
+
event,
|
|
936
|
+
flowId
|
|
937
|
+
})) {
|
|
938
|
+
verificationFlowRooms.set(candidate, roomId);
|
|
939
|
+
if (verificationFlowRooms.size > MAX_TRACKED_VERIFICATION_EVENTS) {
|
|
940
|
+
const oldest = verificationFlowRooms.keys().next().value;
|
|
941
|
+
if (typeof oldest === "string") verificationFlowRooms.delete(oldest);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
function rememberVerificationUserRoom(remoteUserId, roomId) {
|
|
946
|
+
const normalizedUserId = trimMaybeString(remoteUserId);
|
|
947
|
+
const normalizedRoomId = trimMaybeString(roomId);
|
|
948
|
+
if (!normalizedUserId || !normalizedRoomId) return;
|
|
949
|
+
verificationUserRooms.delete(normalizedUserId);
|
|
950
|
+
verificationUserRooms.set(normalizedUserId, normalizedRoomId);
|
|
951
|
+
if (verificationUserRooms.size > MAX_TRACKED_VERIFICATION_EVENTS) {
|
|
952
|
+
const oldest = verificationUserRooms.keys().next().value;
|
|
953
|
+
if (typeof oldest === "string") verificationUserRooms.delete(oldest);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
async function resolveSummaryRoomId(summary) {
|
|
957
|
+
const mappedRoomId = trimMaybeString(summary.roomId) ?? trimMaybeString(summary.transactionId ? verificationFlowRooms.get(summary.transactionId) : null) ?? trimMaybeString(verificationFlowRooms.get(summary.id));
|
|
958
|
+
if (mappedRoomId) return mappedRoomId;
|
|
959
|
+
const remoteUserId = trimMaybeString(summary.otherUserId);
|
|
960
|
+
if (!remoteUserId) return null;
|
|
961
|
+
const recentRoomId = trimMaybeString(verificationUserRooms.get(remoteUserId));
|
|
962
|
+
const activeRoomId = await resolveActiveDirectRoomId(remoteUserId);
|
|
963
|
+
if (recentRoomId && activeRoomId && recentRoomId === activeRoomId) return recentRoomId;
|
|
964
|
+
if (activeRoomId) return activeRoomId;
|
|
965
|
+
if (recentRoomId && await (await loadMatrixDirectRoomDeps()).isStrictDirectRoom({
|
|
966
|
+
client: params.client,
|
|
967
|
+
roomId: recentRoomId,
|
|
968
|
+
remoteUserId
|
|
969
|
+
})) return recentRoomId;
|
|
970
|
+
return null;
|
|
971
|
+
}
|
|
972
|
+
async function routeVerificationSummary(summary) {
|
|
973
|
+
const roomId = await resolveSummaryRoomId(summary);
|
|
974
|
+
if (!roomId || !isActiveVerificationSummary(summary)) return;
|
|
975
|
+
if (!await (await loadMatrixDirectRoomDeps()).isStrictDirectRoom({
|
|
976
|
+
client: params.client,
|
|
977
|
+
roomId,
|
|
978
|
+
remoteUserId: summary.otherUserId
|
|
979
|
+
})) {
|
|
980
|
+
params.logVerboseMessage(`matrix: ignoring verification summary outside strict DM room=${roomId} sender=${summary.otherUserId}`);
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
if (!await isVerificationNoticeAuthorized({
|
|
984
|
+
senderId: summary.otherUserId,
|
|
985
|
+
allowFrom: params.allowFrom,
|
|
986
|
+
dmEnabled: params.dmEnabled,
|
|
987
|
+
dmPolicy: params.dmPolicy,
|
|
988
|
+
readStoreAllowFrom: params.readStoreAllowFrom,
|
|
989
|
+
logVerboseMessage: params.logVerboseMessage
|
|
990
|
+
})) return;
|
|
991
|
+
const sasNotice = formatVerificationSasNotice(summary);
|
|
992
|
+
if (!sasNotice) return;
|
|
993
|
+
if (!trackBounded(routedVerificationSasFingerprints, `${summary.id}:${JSON.stringify(summary.sas)}`)) return;
|
|
994
|
+
await sendVerificationNotice({
|
|
995
|
+
client: params.client,
|
|
996
|
+
roomId,
|
|
997
|
+
body: sasNotice,
|
|
998
|
+
logVerboseMessage: params.logVerboseMessage
|
|
999
|
+
});
|
|
1000
|
+
}
|
|
1001
|
+
function routeVerificationEvent(roomId, event) {
|
|
1002
|
+
const senderId = trimMaybeString(event?.sender);
|
|
1003
|
+
if (!senderId) return false;
|
|
1004
|
+
const signal = readVerificationSignal(event);
|
|
1005
|
+
if (!signal) return false;
|
|
1006
|
+
rememberVerificationRoom(roomId, event, signal.flowId);
|
|
1007
|
+
(async () => {
|
|
1008
|
+
if (!shouldEmitVerificationEventNotice(event)) {
|
|
1009
|
+
params.logVerboseMessage(`matrix: ignoring historical verification event room=${roomId} id=${event.event_id ?? "unknown"} type=${event.type ?? "unknown"}`);
|
|
1010
|
+
return;
|
|
1011
|
+
}
|
|
1012
|
+
const flowId = signal.flowId;
|
|
1013
|
+
const sourceFingerprint = trimMaybeString(event?.event_id) ?? `${senderId}:${event.type}:${flowId ?? "none"}`;
|
|
1014
|
+
if (!await (await loadMatrixDirectRoomDeps()).isStrictDirectRoom({
|
|
1015
|
+
client: params.client,
|
|
1016
|
+
roomId,
|
|
1017
|
+
remoteUserId: senderId
|
|
1018
|
+
})) {
|
|
1019
|
+
params.logVerboseMessage(`matrix: ignoring verification event outside strict DM room=${roomId} sender=${senderId}`);
|
|
1020
|
+
return;
|
|
1021
|
+
}
|
|
1022
|
+
if (!await isVerificationNoticeAuthorized({
|
|
1023
|
+
senderId,
|
|
1024
|
+
allowFrom: params.allowFrom,
|
|
1025
|
+
dmEnabled: params.dmEnabled,
|
|
1026
|
+
dmPolicy: params.dmPolicy,
|
|
1027
|
+
readStoreAllowFrom: params.readStoreAllowFrom,
|
|
1028
|
+
logVerboseMessage: params.logVerboseMessage
|
|
1029
|
+
})) return;
|
|
1030
|
+
rememberVerificationUserRoom(senderId, roomId);
|
|
1031
|
+
if (!trackBounded(routedVerificationEvents, sourceFingerprint)) return;
|
|
1032
|
+
const stageNotice = formatVerificationStageNotice({
|
|
1033
|
+
stage: signal.stage,
|
|
1034
|
+
senderId,
|
|
1035
|
+
event
|
|
1036
|
+
});
|
|
1037
|
+
const { summary, sasNotice } = await resolveVerificationSasNoticeForSignal(params.client, {
|
|
1038
|
+
roomId,
|
|
1039
|
+
event,
|
|
1040
|
+
senderId,
|
|
1041
|
+
flowId,
|
|
1042
|
+
stage: signal.stage
|
|
1043
|
+
}).catch(() => ({
|
|
1044
|
+
summary: null,
|
|
1045
|
+
sasNotice: null
|
|
1046
|
+
}));
|
|
1047
|
+
const notices = [];
|
|
1048
|
+
if (stageNotice) {
|
|
1049
|
+
if (trackBounded(routedVerificationStageNotices, `${roomId}:${senderId}:${flowId ?? sourceFingerprint}:${signal.stage}`)) notices.push(stageNotice);
|
|
1050
|
+
}
|
|
1051
|
+
if (summary && sasNotice) {
|
|
1052
|
+
if (trackBounded(routedVerificationSasFingerprints, `${summary.id}:${JSON.stringify(summary.sas)}`)) notices.push(sasNotice);
|
|
1053
|
+
}
|
|
1054
|
+
if (notices.length === 0) return;
|
|
1055
|
+
for (const body of notices) await sendVerificationNotice({
|
|
1056
|
+
client: params.client,
|
|
1057
|
+
roomId,
|
|
1058
|
+
body,
|
|
1059
|
+
logVerboseMessage: params.logVerboseMessage
|
|
1060
|
+
});
|
|
1061
|
+
})().catch((err) => {
|
|
1062
|
+
params.logVerboseMessage(`matrix: failed routing verification event: ${String(err)}`);
|
|
1063
|
+
});
|
|
1064
|
+
return true;
|
|
1065
|
+
}
|
|
1066
|
+
return {
|
|
1067
|
+
routeVerificationEvent,
|
|
1068
|
+
routeVerificationSummary
|
|
1069
|
+
};
|
|
1070
|
+
}
|
|
1071
|
+
//#endregion
|
|
1072
|
+
//#region extensions/matrix/src/matrix/monitor/events.ts
|
|
1073
|
+
function formatMatrixSelfDecryptionHint(accountId) {
|
|
1074
|
+
return `matrix: failed to decrypt a message from this same Matrix user. This usually means another Matrix device did not share the room key, or another OpenClaw runtime is using the same account. Check 'openclaw matrix verify status --verbose --account ${accountId}' and 'openclaw matrix devices list --account ${accountId}'.`;
|
|
1075
|
+
}
|
|
1076
|
+
async function resolveMatrixSelfUserId(client, logVerboseMessage) {
|
|
1077
|
+
if (typeof client.getUserId !== "function") return null;
|
|
1078
|
+
try {
|
|
1079
|
+
return await client.getUserId() ?? null;
|
|
1080
|
+
} catch (err) {
|
|
1081
|
+
logVerboseMessage(`matrix: failed resolving self user id for decrypt warning: ${String(err)}`);
|
|
1082
|
+
return null;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
function registerMatrixMonitorEvents(params) {
|
|
1086
|
+
const { cfg, client, auth, allowFrom, dmEnabled, dmPolicy, readStoreAllowFrom, directTracker, logVerboseMessage, warnedEncryptedRooms, warnedCryptoMissingRooms, logger, formatNativeDependencyHint, onRoomMessage } = params;
|
|
1087
|
+
const { routeVerificationEvent, routeVerificationSummary } = createMatrixVerificationEventRouter({
|
|
1088
|
+
client,
|
|
1089
|
+
allowFrom,
|
|
1090
|
+
dmEnabled,
|
|
1091
|
+
dmPolicy,
|
|
1092
|
+
readStoreAllowFrom,
|
|
1093
|
+
logVerboseMessage
|
|
1094
|
+
});
|
|
1095
|
+
client.on("room.message", (roomId, event) => {
|
|
1096
|
+
if (routeVerificationEvent(roomId, event)) return;
|
|
1097
|
+
onRoomMessage(roomId, event);
|
|
1098
|
+
});
|
|
1099
|
+
client.on("room.encrypted_event", (roomId, event) => {
|
|
1100
|
+
const eventId = event?.event_id ?? "unknown";
|
|
1101
|
+
logVerboseMessage(`matrix: encrypted event room=${roomId} type=${event?.type ?? "unknown"} id=${eventId}`);
|
|
1102
|
+
});
|
|
1103
|
+
client.on("room.decrypted_event", (roomId, event) => {
|
|
1104
|
+
const eventId = event?.event_id ?? "unknown";
|
|
1105
|
+
logVerboseMessage(`matrix: decrypted event room=${roomId} type=${event?.type ?? "unknown"} id=${eventId}`);
|
|
1106
|
+
});
|
|
1107
|
+
client.on("room.failed_decryption", async (roomId, event, error) => {
|
|
1108
|
+
const selfUserId = await resolveMatrixSelfUserId(client, logVerboseMessage);
|
|
1109
|
+
const sender = typeof event.sender === "string" ? event.sender : null;
|
|
1110
|
+
const senderMatchesOwnUser = Boolean(selfUserId && sender && selfUserId === sender);
|
|
1111
|
+
logger.warn("Failed to decrypt message", {
|
|
1112
|
+
roomId,
|
|
1113
|
+
eventId: event.event_id,
|
|
1114
|
+
sender,
|
|
1115
|
+
senderMatchesOwnUser,
|
|
1116
|
+
error: error.message
|
|
1117
|
+
});
|
|
1118
|
+
if (senderMatchesOwnUser) logger.warn(formatMatrixSelfDecryptionHint(auth.accountId), {
|
|
1119
|
+
roomId,
|
|
1120
|
+
eventId: event.event_id,
|
|
1121
|
+
sender
|
|
1122
|
+
});
|
|
1123
|
+
logVerboseMessage(`matrix: failed decrypt room=${roomId} id=${event.event_id ?? "unknown"} error=${error.message}`);
|
|
1124
|
+
});
|
|
1125
|
+
client.on("verification.summary", (summary) => {
|
|
1126
|
+
routeVerificationSummary(summary);
|
|
1127
|
+
});
|
|
1128
|
+
client.on("room.invite", (roomId, event) => {
|
|
1129
|
+
directTracker?.invalidateRoom(roomId);
|
|
1130
|
+
const eventId = event?.event_id ?? "unknown";
|
|
1131
|
+
const sender = event?.sender ?? "unknown";
|
|
1132
|
+
const invitee = typeof event?.state_key === "string" ? event.state_key.trim() : "";
|
|
1133
|
+
const senderIsInvitee = typeof event?.sender === "string" && invitee && event.sender.trim() === invitee;
|
|
1134
|
+
const isDirect = (event?.content)?.is_direct === true;
|
|
1135
|
+
if (typeof event?.sender === "string" && event.sender.trim() && !senderIsInvitee) directTracker?.rememberInvite?.(roomId, event.sender);
|
|
1136
|
+
logVerboseMessage(`matrix: invite room=${roomId} sender=${sender} direct=${String(isDirect)} id=${eventId}`);
|
|
1137
|
+
});
|
|
1138
|
+
client.on("room.join", (roomId, event) => {
|
|
1139
|
+
directTracker?.invalidateRoom(roomId);
|
|
1140
|
+
logVerboseMessage(`matrix: join room=${roomId} id=${event?.event_id ?? "unknown"}`);
|
|
1141
|
+
});
|
|
1142
|
+
client.on("room.event", (roomId, event) => {
|
|
1143
|
+
const eventType = event?.type ?? "unknown";
|
|
1144
|
+
if (eventType === EventType.RoomMessageEncrypted) {
|
|
1145
|
+
logVerboseMessage(`matrix: encrypted raw event room=${roomId} id=${event?.event_id ?? "unknown"}`);
|
|
1146
|
+
if (auth.encryption !== true && !warnedEncryptedRooms.has(roomId)) {
|
|
1147
|
+
warnedEncryptedRooms.add(roomId);
|
|
1148
|
+
const warning = formatMatrixEncryptedEventDisabledWarning(cfg, auth.accountId);
|
|
1149
|
+
logger.warn(warning, { roomId });
|
|
1150
|
+
}
|
|
1151
|
+
if (auth.encryption === true && !client.crypto && !warnedCryptoMissingRooms.has(roomId)) {
|
|
1152
|
+
warnedCryptoMissingRooms.add(roomId);
|
|
1153
|
+
const warning = `matrix: encryption enabled but crypto is unavailable; ${formatNativeDependencyHint({
|
|
1154
|
+
packageName: "@matrix-org/matrix-sdk-crypto-nodejs",
|
|
1155
|
+
manager: "pnpm",
|
|
1156
|
+
downloadCommand: "node node_modules/@matrix-org/matrix-sdk-crypto-nodejs/download-lib.js"
|
|
1157
|
+
})}`;
|
|
1158
|
+
logger.warn(warning, { roomId });
|
|
1159
|
+
}
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
if (eventType === EventType.RoomMember) {
|
|
1163
|
+
directTracker?.invalidateRoom(roomId);
|
|
1164
|
+
const membership = (event?.content)?.membership;
|
|
1165
|
+
logVerboseMessage(`matrix: member event room=${roomId} stateKey=${event.state_key ?? ""} membership=${membership ?? "unknown"}`);
|
|
1166
|
+
}
|
|
1167
|
+
if (eventType === EventType.Reaction) {
|
|
1168
|
+
onRoomMessage(roomId, event);
|
|
1169
|
+
return;
|
|
1170
|
+
}
|
|
1171
|
+
routeVerificationEvent(roomId, event);
|
|
1172
|
+
});
|
|
1173
|
+
}
|
|
1174
|
+
//#endregion
|
|
1175
|
+
//#region extensions/matrix/src/matrix/draft-stream.ts
|
|
1176
|
+
const DEFAULT_THROTTLE_MS = 1e3;
|
|
1177
|
+
function createMatrixDraftStream(params) {
|
|
1178
|
+
const { roomId, client, cfg, threadId, accountId, log } = params;
|
|
1179
|
+
let currentEventId;
|
|
1180
|
+
let lastSentText = "";
|
|
1181
|
+
let stopped = false;
|
|
1182
|
+
let sendFailed = false;
|
|
1183
|
+
let finalizeInPlaceBlocked = false;
|
|
1184
|
+
let replyToId = params.replyToId;
|
|
1185
|
+
const sendOrEdit = async (text) => {
|
|
1186
|
+
const trimmed = text.trimEnd();
|
|
1187
|
+
if (!trimmed) return false;
|
|
1188
|
+
const preparedText = prepareMatrixSingleText(trimmed, {
|
|
1189
|
+
cfg,
|
|
1190
|
+
accountId
|
|
1191
|
+
});
|
|
1192
|
+
if (!preparedText.fitsInSingleEvent) {
|
|
1193
|
+
finalizeInPlaceBlocked = true;
|
|
1194
|
+
if (!currentEventId) sendFailed = true;
|
|
1195
|
+
stopped = true;
|
|
1196
|
+
log?.(`draft-stream: preview exceeded single-event limit (${preparedText.convertedText.length} > ${preparedText.singleEventLimit})`);
|
|
1197
|
+
return false;
|
|
1198
|
+
}
|
|
1199
|
+
if (sendFailed) return false;
|
|
1200
|
+
if (preparedText.trimmedText === lastSentText) return true;
|
|
1201
|
+
try {
|
|
1202
|
+
if (!currentEventId) {
|
|
1203
|
+
currentEventId = (await sendSingleTextMessageMatrix(roomId, preparedText.trimmedText, {
|
|
1204
|
+
client,
|
|
1205
|
+
cfg,
|
|
1206
|
+
replyToId,
|
|
1207
|
+
threadId,
|
|
1208
|
+
accountId
|
|
1209
|
+
})).messageId;
|
|
1210
|
+
lastSentText = preparedText.trimmedText;
|
|
1211
|
+
log?.(`draft-stream: created message ${currentEventId}`);
|
|
1212
|
+
} else {
|
|
1213
|
+
await editMessageMatrix(roomId, currentEventId, preparedText.trimmedText, {
|
|
1214
|
+
client,
|
|
1215
|
+
cfg,
|
|
1216
|
+
threadId,
|
|
1217
|
+
accountId
|
|
1218
|
+
});
|
|
1219
|
+
lastSentText = preparedText.trimmedText;
|
|
1220
|
+
}
|
|
1221
|
+
return true;
|
|
1222
|
+
} catch (err) {
|
|
1223
|
+
log?.(`draft-stream: send/edit failed: ${String(err)}`);
|
|
1224
|
+
if (err instanceof Error && err.message.startsWith("Matrix single-message text exceeds limit")) finalizeInPlaceBlocked = true;
|
|
1225
|
+
if (!currentEventId) sendFailed = true;
|
|
1226
|
+
stopped = true;
|
|
1227
|
+
return false;
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
1230
|
+
const loop = createDraftStreamLoop({
|
|
1231
|
+
throttleMs: DEFAULT_THROTTLE_MS,
|
|
1232
|
+
isStopped: () => stopped,
|
|
1233
|
+
sendOrEditStreamMessage: sendOrEdit
|
|
1234
|
+
});
|
|
1235
|
+
log?.(`draft-stream: ready (throttleMs=${DEFAULT_THROTTLE_MS})`);
|
|
1236
|
+
const stop = async () => {
|
|
1237
|
+
await loop.flush();
|
|
1238
|
+
stopped = true;
|
|
1239
|
+
return currentEventId;
|
|
1240
|
+
};
|
|
1241
|
+
const reset = () => {
|
|
1242
|
+
replyToId = params.preserveReplyId ? params.replyToId : void 0;
|
|
1243
|
+
currentEventId = void 0;
|
|
1244
|
+
lastSentText = "";
|
|
1245
|
+
stopped = false;
|
|
1246
|
+
sendFailed = false;
|
|
1247
|
+
finalizeInPlaceBlocked = false;
|
|
1248
|
+
loop.resetPending();
|
|
1249
|
+
loop.resetThrottleWindow();
|
|
1250
|
+
};
|
|
1251
|
+
return {
|
|
1252
|
+
update: (text) => {
|
|
1253
|
+
if (stopped) return;
|
|
1254
|
+
loop.update(text);
|
|
1255
|
+
},
|
|
1256
|
+
flush: loop.flush,
|
|
1257
|
+
stop,
|
|
1258
|
+
reset,
|
|
1259
|
+
eventId: () => currentEventId,
|
|
1260
|
+
lastSentText: () => lastSentText,
|
|
1261
|
+
mustDeliverFinalNormally: () => sendFailed || finalizeInPlaceBlocked
|
|
1262
|
+
};
|
|
1263
|
+
}
|
|
1264
|
+
//#endregion
|
|
1265
|
+
//#region extensions/matrix/src/matrix/monitor/ack-config.ts
|
|
1266
|
+
function resolveMatrixAckReactionConfig(params) {
|
|
1267
|
+
const matrixConfig = params.cfg.channels?.matrix;
|
|
1268
|
+
const accountConfig = resolveMatrixAccountConfig({
|
|
1269
|
+
cfg: params.cfg,
|
|
1270
|
+
accountId: params.accountId
|
|
1271
|
+
});
|
|
1272
|
+
return {
|
|
1273
|
+
ackReaction: resolveAckReaction(params.cfg, params.agentId, {
|
|
1274
|
+
channel: "matrix",
|
|
1275
|
+
accountId: params.accountId ?? void 0
|
|
1276
|
+
}).trim(),
|
|
1277
|
+
ackReactionScope: accountConfig.ackReactionScope ?? matrixConfig?.ackReactionScope ?? params.cfg.messages?.ackReactionScope ?? "group-mentions"
|
|
1278
|
+
};
|
|
1279
|
+
}
|
|
1280
|
+
//#endregion
|
|
1281
|
+
//#region extensions/matrix/src/matrix/monitor/location.ts
|
|
1282
|
+
function parseGeoUri(value) {
|
|
1283
|
+
const trimmed = value.trim();
|
|
1284
|
+
if (!trimmed) return null;
|
|
1285
|
+
if (!trimmed.toLowerCase().startsWith("geo:")) return null;
|
|
1286
|
+
const [coordsPart, ...paramParts] = trimmed.slice(4).split(";");
|
|
1287
|
+
const coords = coordsPart.split(",");
|
|
1288
|
+
if (coords.length < 2) return null;
|
|
1289
|
+
const latitude = Number.parseFloat(coords[0] ?? "");
|
|
1290
|
+
const longitude = Number.parseFloat(coords[1] ?? "");
|
|
1291
|
+
if (!Number.isFinite(latitude) || !Number.isFinite(longitude)) return null;
|
|
1292
|
+
const params = /* @__PURE__ */ new Map();
|
|
1293
|
+
for (const part of paramParts) {
|
|
1294
|
+
const segment = part.trim();
|
|
1295
|
+
if (!segment) continue;
|
|
1296
|
+
const eqIndex = segment.indexOf("=");
|
|
1297
|
+
const rawKey = eqIndex === -1 ? segment : segment.slice(0, eqIndex);
|
|
1298
|
+
const rawValue = eqIndex === -1 ? "" : segment.slice(eqIndex + 1);
|
|
1299
|
+
const key = rawKey.trim().toLowerCase();
|
|
1300
|
+
if (!key) continue;
|
|
1301
|
+
const valuePart = rawValue.trim();
|
|
1302
|
+
params.set(key, valuePart ? decodeURIComponent(valuePart) : "");
|
|
1303
|
+
}
|
|
1304
|
+
const accuracyRaw = params.get("u");
|
|
1305
|
+
const accuracy = accuracyRaw ? Number.parseFloat(accuracyRaw) : void 0;
|
|
1306
|
+
return {
|
|
1307
|
+
latitude,
|
|
1308
|
+
longitude,
|
|
1309
|
+
accuracy: Number.isFinite(accuracy) ? accuracy : void 0
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
function resolveMatrixLocation(params) {
|
|
1313
|
+
const { eventType, content } = params;
|
|
1314
|
+
if (!(eventType === EventType.Location || eventType === EventType.RoomMessage && content.msgtype === EventType.Location)) return null;
|
|
1315
|
+
const geoUri = typeof content.geo_uri === "string" ? content.geo_uri.trim() : "";
|
|
1316
|
+
if (!geoUri) return null;
|
|
1317
|
+
const parsed = parseGeoUri(geoUri);
|
|
1318
|
+
if (!parsed) return null;
|
|
1319
|
+
const caption = typeof content.body === "string" ? content.body.trim() : "";
|
|
1320
|
+
const location = {
|
|
1321
|
+
latitude: parsed.latitude,
|
|
1322
|
+
longitude: parsed.longitude,
|
|
1323
|
+
accuracy: parsed.accuracy,
|
|
1324
|
+
caption: caption || void 0,
|
|
1325
|
+
source: "pin",
|
|
1326
|
+
isLive: false
|
|
1327
|
+
};
|
|
1328
|
+
return {
|
|
1329
|
+
text: formatLocationText(location),
|
|
1330
|
+
context: toLocationContext(location)
|
|
1331
|
+
};
|
|
1332
|
+
}
|
|
1333
|
+
//#endregion
|
|
1334
|
+
//#region extensions/matrix/src/matrix/monitor/media.ts
|
|
1335
|
+
const MATRIX_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS = 3e4;
|
|
1336
|
+
async function fetchMatrixMediaBuffer(params) {
|
|
1337
|
+
try {
|
|
1338
|
+
return { buffer: await params.client.downloadContent(params.mxcUrl, {
|
|
1339
|
+
maxBytes: params.maxBytes,
|
|
1340
|
+
readIdleTimeoutMs: MATRIX_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS
|
|
1341
|
+
}) };
|
|
1342
|
+
} catch (err) {
|
|
1343
|
+
throw new Error(`Matrix media download failed: ${String(err)}`, { cause: err });
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Download and decrypt encrypted media from a Matrix room.
|
|
1348
|
+
* Uses the Matrix crypto adapter's decryptMedia helper.
|
|
1349
|
+
*/
|
|
1350
|
+
async function fetchEncryptedMediaBuffer(params) {
|
|
1351
|
+
if (!params.client.crypto) throw new Error("Cannot decrypt media: crypto not enabled");
|
|
1352
|
+
const decrypted = await params.client.crypto.decryptMedia(params.file, {
|
|
1353
|
+
maxBytes: params.maxBytes,
|
|
1354
|
+
readIdleTimeoutMs: MATRIX_MEDIA_DOWNLOAD_IDLE_TIMEOUT_MS
|
|
1355
|
+
});
|
|
1356
|
+
if (decrypted.byteLength > params.maxBytes) throw new Error("Matrix media exceeds configured size limit");
|
|
1357
|
+
return { buffer: decrypted };
|
|
1358
|
+
}
|
|
1359
|
+
async function downloadMatrixMedia(params) {
|
|
1360
|
+
let fetched;
|
|
1361
|
+
if (typeof params.sizeBytes === "number" && params.sizeBytes > params.maxBytes) throw new Error("Matrix media exceeds configured size limit");
|
|
1362
|
+
if (params.file) fetched = await fetchEncryptedMediaBuffer({
|
|
1363
|
+
client: params.client,
|
|
1364
|
+
file: params.file,
|
|
1365
|
+
maxBytes: params.maxBytes
|
|
1366
|
+
});
|
|
1367
|
+
else fetched = await fetchMatrixMediaBuffer({
|
|
1368
|
+
client: params.client,
|
|
1369
|
+
mxcUrl: params.mxcUrl,
|
|
1370
|
+
maxBytes: params.maxBytes
|
|
1371
|
+
});
|
|
1372
|
+
if (!fetched) return null;
|
|
1373
|
+
const headerType = params.contentType ?? void 0;
|
|
1374
|
+
const saved = await getMatrixRuntime().channel.media.saveMediaBuffer(fetched.buffer, headerType, "inbound", params.maxBytes, params.originalFilename);
|
|
1375
|
+
return {
|
|
1376
|
+
path: saved.path,
|
|
1377
|
+
contentType: saved.contentType,
|
|
1378
|
+
placeholder: "[matrix media]"
|
|
1379
|
+
};
|
|
1380
|
+
}
|
|
1381
|
+
//#endregion
|
|
1382
|
+
//#region extensions/matrix/src/matrix/monitor/mentions.ts
|
|
1383
|
+
const HTML_ENTITY_REPLACEMENTS = {
|
|
1384
|
+
amp: "&",
|
|
1385
|
+
apos: "'",
|
|
1386
|
+
gt: ">",
|
|
1387
|
+
lt: "<",
|
|
1388
|
+
nbsp: " ",
|
|
1389
|
+
quot: "\""
|
|
1390
|
+
};
|
|
1391
|
+
const MAX_UNICODE_SCALAR_VALUE = 1114111;
|
|
1392
|
+
function decodeNumericHtmlEntity(match, rawValue, radix) {
|
|
1393
|
+
const codePoint = Number.parseInt(rawValue, radix);
|
|
1394
|
+
if (!Number.isSafeInteger(codePoint) || codePoint < 0 || codePoint > MAX_UNICODE_SCALAR_VALUE || codePoint >= 55296 && codePoint <= 57343) return match;
|
|
1395
|
+
return String.fromCodePoint(codePoint);
|
|
1396
|
+
}
|
|
1397
|
+
function decodeHtmlEntities(value) {
|
|
1398
|
+
return value.replace(/&(#x?[0-9a-f]+|\w+);/gi, (match, entity) => {
|
|
1399
|
+
const normalized = entity.toLowerCase();
|
|
1400
|
+
if (normalized.startsWith("#x")) return decodeNumericHtmlEntity(match, normalized.slice(2), 16);
|
|
1401
|
+
if (normalized.startsWith("#")) return decodeNumericHtmlEntity(match, normalized.slice(1), 10);
|
|
1402
|
+
return HTML_ENTITY_REPLACEMENTS[normalized] ?? match;
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
function normalizeVisibleMentionText(value) {
|
|
1406
|
+
return decodeHtmlEntities(value.replace(/<[^>]+>/g, " ").replace(/[\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g, "")).replace(/\s+/g, " ").trim().toLowerCase();
|
|
1407
|
+
}
|
|
1408
|
+
function extractVisibleMentionText(value) {
|
|
1409
|
+
return normalizeVisibleMentionText(value ?? "");
|
|
1410
|
+
}
|
|
1411
|
+
function resolveMatrixUserLocalpart(userId) {
|
|
1412
|
+
const trimmed = userId.trim();
|
|
1413
|
+
if (!trimmed.startsWith("@")) return null;
|
|
1414
|
+
const colonIndex = trimmed.indexOf(":");
|
|
1415
|
+
if (colonIndex <= 1) return null;
|
|
1416
|
+
return trimmed.slice(1, colonIndex).trim() || null;
|
|
1417
|
+
}
|
|
1418
|
+
function isVisibleMentionLabel(params) {
|
|
1419
|
+
const cleaned = extractVisibleMentionText(params.text);
|
|
1420
|
+
if (!cleaned) return false;
|
|
1421
|
+
if (params.mentionRegexes.some((pattern) => pattern.test(cleaned))) return true;
|
|
1422
|
+
const localpart = resolveMatrixUserLocalpart(params.userId);
|
|
1423
|
+
return [
|
|
1424
|
+
extractVisibleMentionText(params.userId),
|
|
1425
|
+
localpart ? extractVisibleMentionText(localpart) : null,
|
|
1426
|
+
localpart ? extractVisibleMentionText(`@${localpart}`) : null,
|
|
1427
|
+
params.displayName ? extractVisibleMentionText(params.displayName) : null
|
|
1428
|
+
].filter((value) => Boolean(value)).includes(cleaned);
|
|
1429
|
+
}
|
|
1430
|
+
function hasVisibleRoomMention(value) {
|
|
1431
|
+
const cleaned = extractVisibleMentionText(value);
|
|
1432
|
+
return /(^|[^a-z0-9_])@room\b/i.test(cleaned);
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Check if formatted_body contains a matrix.to link whose visible label still
|
|
1436
|
+
* looks like a real mention for the given user. Do not trust href alone, since
|
|
1437
|
+
* senders can hide arbitrary matrix.to links behind unrelated link text.
|
|
1438
|
+
* Many Matrix clients (including Element) use HTML links in formatted_body instead of
|
|
1439
|
+
* or in addition to the m.mentions field.
|
|
1440
|
+
*/
|
|
1441
|
+
function checkFormattedBodyMention(params) {
|
|
1442
|
+
if (!params.formattedBody || !params.userId) return false;
|
|
1443
|
+
for (const match of params.formattedBody.matchAll(/<a\b[^>]*href=(["'])(https:\/\/matrix\.to\/#[^"']+)\1[^>]*>(.*?)<\/a>/gis)) {
|
|
1444
|
+
const href = match[2];
|
|
1445
|
+
const visibleLabel = match[3] ?? "";
|
|
1446
|
+
if (!href) continue;
|
|
1447
|
+
try {
|
|
1448
|
+
const parsed = new URL(href);
|
|
1449
|
+
if (decodeURIComponent(parsed.hash.replace(/^#\/?/, "").trim()) !== params.userId.trim()) continue;
|
|
1450
|
+
if (isVisibleMentionLabel({
|
|
1451
|
+
text: visibleLabel,
|
|
1452
|
+
userId: params.userId,
|
|
1453
|
+
mentionRegexes: params.mentionRegexes,
|
|
1454
|
+
displayName: params.displayName
|
|
1455
|
+
})) return true;
|
|
1456
|
+
} catch {
|
|
1457
|
+
continue;
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
return false;
|
|
1461
|
+
}
|
|
1462
|
+
function resolveMentions(params) {
|
|
1463
|
+
const mentions = params.content["m.mentions"];
|
|
1464
|
+
const mentionedUsers = Array.isArray(mentions?.user_ids) ? new Set(mentions.user_ids) : /* @__PURE__ */ new Set();
|
|
1465
|
+
const textMentioned = getMatrixRuntime().channel.mentions.matchesMentionPatterns(params.text ?? "", params.mentionRegexes);
|
|
1466
|
+
const visibleRoomMention = hasVisibleRoomMention(params.text) || hasVisibleRoomMention(params.content.formatted_body);
|
|
1467
|
+
const mentionedInFormattedBody = params.userId ? checkFormattedBodyMention({
|
|
1468
|
+
formattedBody: params.content.formatted_body,
|
|
1469
|
+
userId: params.userId,
|
|
1470
|
+
displayName: params.displayName,
|
|
1471
|
+
mentionRegexes: params.mentionRegexes
|
|
1472
|
+
}) : false;
|
|
1473
|
+
const metadataBackedUserMention = Boolean(params.userId && mentionedUsers.has(params.userId) && (mentionedInFormattedBody || textMentioned));
|
|
1474
|
+
const metadataBackedRoomMention = Boolean(mentions?.room) && visibleRoomMention;
|
|
1475
|
+
const explicitMention = mentionedInFormattedBody || metadataBackedUserMention || metadataBackedRoomMention;
|
|
1476
|
+
return {
|
|
1477
|
+
wasMentioned: explicitMention || textMentioned || visibleRoomMention,
|
|
1478
|
+
hasExplicitMention: explicitMention
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
//#endregion
|
|
1482
|
+
//#region extensions/matrix/src/matrix/monitor/threads.ts
|
|
1483
|
+
function resolveMatrixThreadSessionKeys(params) {
|
|
1484
|
+
return resolveThreadSessionKeys({
|
|
1485
|
+
...params,
|
|
1486
|
+
normalizeThreadId: (threadId) => threadId
|
|
1487
|
+
});
|
|
1488
|
+
}
|
|
1489
|
+
function resolveMatrixRelatedReplyToEventId(relates) {
|
|
1490
|
+
if (!relates || typeof relates !== "object") return;
|
|
1491
|
+
if ("m.in_reply_to" in relates && typeof relates["m.in_reply_to"] === "object" && relates["m.in_reply_to"] && "event_id" in relates["m.in_reply_to"] && typeof relates["m.in_reply_to"].event_id === "string") return relates["m.in_reply_to"].event_id;
|
|
1492
|
+
}
|
|
1493
|
+
function resolveMatrixThreadRouting(params) {
|
|
1494
|
+
const effectiveThreadReplies = params.isDirectMessage && params.dmThreadReplies !== void 0 ? params.dmThreadReplies : params.threadReplies;
|
|
1495
|
+
const messageId = params.messageId.trim();
|
|
1496
|
+
const threadRootId = params.threadRootId?.trim();
|
|
1497
|
+
const inboundThreadId = threadRootId && threadRootId !== messageId ? threadRootId : void 0;
|
|
1498
|
+
return { threadId: effectiveThreadReplies === "off" ? void 0 : effectiveThreadReplies === "inbound" ? inboundThreadId : inboundThreadId ?? (messageId || void 0) };
|
|
1499
|
+
}
|
|
1500
|
+
function resolveMatrixThreadRootId(params) {
|
|
1501
|
+
const relates = params.content["m.relates_to"];
|
|
1502
|
+
if (!relates || typeof relates !== "object") return;
|
|
1503
|
+
if ("rel_type" in relates && relates.rel_type === RelationType.Thread) {
|
|
1504
|
+
if ("event_id" in relates && typeof relates.event_id === "string") return relates.event_id;
|
|
1505
|
+
return resolveMatrixRelatedReplyToEventId(relates);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
function resolveMatrixReplyToEventId(content) {
|
|
1509
|
+
return resolveMatrixRelatedReplyToEventId(content["m.relates_to"]);
|
|
1510
|
+
}
|
|
1511
|
+
//#endregion
|
|
1512
|
+
//#region extensions/matrix/src/matrix/monitor/route.ts
|
|
1513
|
+
function resolveMatrixInboundRoute(params) {
|
|
1514
|
+
const baseRoute = params.resolveAgentRoute({
|
|
1515
|
+
cfg: params.cfg,
|
|
1516
|
+
channel: "matrix",
|
|
1517
|
+
accountId: params.accountId,
|
|
1518
|
+
peer: {
|
|
1519
|
+
kind: params.isDirectMessage ? "direct" : "channel",
|
|
1520
|
+
id: params.isDirectMessage ? params.senderId : params.roomId
|
|
1521
|
+
},
|
|
1522
|
+
parentPeer: params.isDirectMessage ? {
|
|
1523
|
+
kind: "channel",
|
|
1524
|
+
id: params.roomId
|
|
1525
|
+
} : void 0
|
|
1526
|
+
});
|
|
1527
|
+
const bindingConversationId = params.threadId ?? params.roomId;
|
|
1528
|
+
const bindingParentConversationId = params.threadId ? params.roomId : void 0;
|
|
1529
|
+
const runtimeBinding = getSessionBindingService().resolveByConversation({
|
|
1530
|
+
channel: "matrix",
|
|
1531
|
+
accountId: params.accountId,
|
|
1532
|
+
conversationId: bindingConversationId,
|
|
1533
|
+
parentConversationId: bindingParentConversationId
|
|
1534
|
+
});
|
|
1535
|
+
const boundSessionKey = runtimeBinding?.targetSessionKey?.trim();
|
|
1536
|
+
if (runtimeBinding && boundSessionKey) return {
|
|
1537
|
+
route: {
|
|
1538
|
+
...baseRoute,
|
|
1539
|
+
sessionKey: boundSessionKey,
|
|
1540
|
+
agentId: resolveAgentIdFromSessionKey(boundSessionKey) || baseRoute.agentId,
|
|
1541
|
+
lastRoutePolicy: deriveLastRoutePolicy({
|
|
1542
|
+
sessionKey: boundSessionKey,
|
|
1543
|
+
mainSessionKey: baseRoute.mainSessionKey
|
|
1544
|
+
}),
|
|
1545
|
+
matchedBy: "binding.channel"
|
|
1546
|
+
},
|
|
1547
|
+
configuredBinding: null,
|
|
1548
|
+
runtimeBindingId: runtimeBinding.bindingId
|
|
1549
|
+
};
|
|
1550
|
+
const configuredBinding = runtimeBinding == null ? resolveConfiguredAcpBindingRecord({
|
|
1551
|
+
cfg: params.cfg,
|
|
1552
|
+
channel: "matrix",
|
|
1553
|
+
accountId: params.accountId,
|
|
1554
|
+
conversationId: bindingConversationId,
|
|
1555
|
+
parentConversationId: bindingParentConversationId
|
|
1556
|
+
}) : null;
|
|
1557
|
+
const configuredSessionKey = configuredBinding?.record.targetSessionKey?.trim();
|
|
1558
|
+
const effectiveRoute = configuredBinding && configuredSessionKey ? {
|
|
1559
|
+
...baseRoute,
|
|
1560
|
+
sessionKey: configuredSessionKey,
|
|
1561
|
+
agentId: resolveAgentIdFromSessionKey(configuredSessionKey) || configuredBinding.spec.agentId || baseRoute.agentId,
|
|
1562
|
+
lastRoutePolicy: deriveLastRoutePolicy({
|
|
1563
|
+
sessionKey: configuredSessionKey,
|
|
1564
|
+
mainSessionKey: baseRoute.mainSessionKey
|
|
1565
|
+
}),
|
|
1566
|
+
matchedBy: "binding.channel"
|
|
1567
|
+
} : baseRoute;
|
|
1568
|
+
if (!configuredBinding && !configuredSessionKey && params.threadId) {
|
|
1569
|
+
const threadKeys = resolveMatrixThreadSessionKeys({
|
|
1570
|
+
baseSessionKey: effectiveRoute.sessionKey,
|
|
1571
|
+
threadId: params.threadId,
|
|
1572
|
+
parentSessionKey: effectiveRoute.sessionKey
|
|
1573
|
+
});
|
|
1574
|
+
return {
|
|
1575
|
+
route: {
|
|
1576
|
+
...effectiveRoute,
|
|
1577
|
+
sessionKey: threadKeys.sessionKey,
|
|
1578
|
+
mainSessionKey: threadKeys.parentSessionKey ?? effectiveRoute.sessionKey,
|
|
1579
|
+
lastRoutePolicy: deriveLastRoutePolicy({
|
|
1580
|
+
sessionKey: threadKeys.sessionKey,
|
|
1581
|
+
mainSessionKey: threadKeys.parentSessionKey ?? effectiveRoute.sessionKey
|
|
1582
|
+
})
|
|
1583
|
+
},
|
|
1584
|
+
configuredBinding,
|
|
1585
|
+
runtimeBindingId: null
|
|
1586
|
+
};
|
|
1587
|
+
}
|
|
1588
|
+
return {
|
|
1589
|
+
route: effectiveRoute,
|
|
1590
|
+
configuredBinding,
|
|
1591
|
+
runtimeBindingId: null
|
|
1592
|
+
};
|
|
1593
|
+
}
|
|
1594
|
+
//#endregion
|
|
1595
|
+
//#region extensions/matrix/src/matrix/monitor/reaction-events.ts
|
|
1596
|
+
function resolveMatrixReactionNotificationMode(params) {
|
|
1597
|
+
const matrixConfig = params.cfg.channels?.matrix;
|
|
1598
|
+
return resolveMatrixAccountConfig({
|
|
1599
|
+
cfg: params.cfg,
|
|
1600
|
+
accountId: params.accountId
|
|
1601
|
+
}).reactionNotifications ?? matrixConfig?.reactionNotifications ?? "own";
|
|
1602
|
+
}
|
|
1603
|
+
async function handleInboundMatrixReaction(params) {
|
|
1604
|
+
const notificationMode = resolveMatrixReactionNotificationMode({
|
|
1605
|
+
cfg: params.cfg,
|
|
1606
|
+
accountId: params.accountId
|
|
1607
|
+
});
|
|
1608
|
+
if (notificationMode === "off") return;
|
|
1609
|
+
const reaction = extractMatrixReactionAnnotation(params.event.content);
|
|
1610
|
+
if (!reaction?.eventId) return;
|
|
1611
|
+
const targetEvent = await params.client.getEvent(params.roomId, reaction.eventId).catch((err) => {
|
|
1612
|
+
params.logVerboseMessage(`matrix: failed resolving reaction target room=${params.roomId} id=${reaction.eventId}: ${String(err)}`);
|
|
1613
|
+
return null;
|
|
1614
|
+
});
|
|
1615
|
+
const targetSender = targetEvent && typeof targetEvent.sender === "string" ? targetEvent.sender.trim() : "";
|
|
1616
|
+
if (!targetSender) return;
|
|
1617
|
+
if (notificationMode === "own" && targetSender !== params.selfUserId) return;
|
|
1618
|
+
const targetContent = targetEvent && targetEvent.content && typeof targetEvent.content === "object" ? targetEvent.content : void 0;
|
|
1619
|
+
const threadRootId = targetContent ? resolveMatrixThreadRootId({
|
|
1620
|
+
event: targetEvent,
|
|
1621
|
+
content: targetContent
|
|
1622
|
+
}) : void 0;
|
|
1623
|
+
const accountConfig = resolveMatrixAccountConfig({
|
|
1624
|
+
cfg: params.cfg,
|
|
1625
|
+
accountId: params.accountId
|
|
1626
|
+
});
|
|
1627
|
+
const thread = resolveMatrixThreadRouting({
|
|
1628
|
+
isDirectMessage: params.isDirectMessage,
|
|
1629
|
+
threadReplies: accountConfig.threadReplies ?? "inbound",
|
|
1630
|
+
dmThreadReplies: accountConfig.dm?.threadReplies,
|
|
1631
|
+
messageId: reaction.eventId,
|
|
1632
|
+
threadRootId
|
|
1633
|
+
});
|
|
1634
|
+
const { route, runtimeBindingId } = resolveMatrixInboundRoute({
|
|
1635
|
+
cfg: params.cfg,
|
|
1636
|
+
accountId: params.accountId,
|
|
1637
|
+
roomId: params.roomId,
|
|
1638
|
+
senderId: params.senderId,
|
|
1639
|
+
isDirectMessage: params.isDirectMessage,
|
|
1640
|
+
threadId: thread.threadId,
|
|
1641
|
+
eventTs: params.event.origin_server_ts,
|
|
1642
|
+
resolveAgentRoute: params.core.channel.routing.resolveAgentRoute
|
|
1643
|
+
});
|
|
1644
|
+
if (runtimeBindingId) getSessionBindingService().touch(runtimeBindingId, params.event.origin_server_ts);
|
|
1645
|
+
const text = `Matrix reaction added: ${reaction.key} by ${params.senderLabel} on msg ${reaction.eventId}`;
|
|
1646
|
+
params.core.system.enqueueSystemEvent(text, {
|
|
1647
|
+
sessionKey: route.sessionKey,
|
|
1648
|
+
contextKey: `matrix:reaction:add:${params.roomId}:${reaction.eventId}:${params.senderId}:${reaction.key}`
|
|
1649
|
+
});
|
|
1650
|
+
params.logVerboseMessage(`matrix: reaction event enqueued room=${params.roomId} target=${reaction.eventId} sender=${params.senderId} emoji=${reaction.key}`);
|
|
1651
|
+
}
|
|
1652
|
+
//#endregion
|
|
1653
|
+
//#region extensions/matrix/src/matrix/monitor/replies.ts
|
|
1654
|
+
const THINKING_TAG_RE = /<\s*\/?\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>/gi;
|
|
1655
|
+
const THINKING_BLOCK_RE = /<\s*(?:think(?:ing)?|thought|antthinking)\b[^<>]*>[\s\S]*?<\s*\/\s*(?:think(?:ing)?|thought|antthinking)\s*>/gi;
|
|
1656
|
+
function shouldSuppressReasoningReplyText(text) {
|
|
1657
|
+
if (typeof text !== "string") return false;
|
|
1658
|
+
const trimmedStart = text.trimStart();
|
|
1659
|
+
if (!trimmedStart) return false;
|
|
1660
|
+
if (trimmedStart.toLowerCase().startsWith("reasoning:")) return true;
|
|
1661
|
+
THINKING_TAG_RE.lastIndex = 0;
|
|
1662
|
+
if (!THINKING_TAG_RE.test(text)) return false;
|
|
1663
|
+
THINKING_BLOCK_RE.lastIndex = 0;
|
|
1664
|
+
const withoutThinkingBlocks = text.replace(THINKING_BLOCK_RE, "");
|
|
1665
|
+
THINKING_TAG_RE.lastIndex = 0;
|
|
1666
|
+
return !withoutThinkingBlocks.replace(THINKING_TAG_RE, "").trim();
|
|
1667
|
+
}
|
|
1668
|
+
async function deliverMatrixReplies(params) {
|
|
1669
|
+
const core = getMatrixRuntime();
|
|
1670
|
+
const tableMode = params.tableMode ?? core.channel.text.resolveMarkdownTableMode({
|
|
1671
|
+
cfg: params.cfg,
|
|
1672
|
+
channel: "matrix",
|
|
1673
|
+
accountId: params.accountId
|
|
1674
|
+
});
|
|
1675
|
+
const logVerbose = (message) => {
|
|
1676
|
+
if (core.logging.shouldLogVerbose()) params.runtime.log?.(message);
|
|
1677
|
+
};
|
|
1678
|
+
let hasReplied = false;
|
|
1679
|
+
for (const reply of params.replies) {
|
|
1680
|
+
if (reply.isReasoning === true || shouldSuppressReasoningReplyText(reply.text)) {
|
|
1681
|
+
logVerbose("matrix reply suppressed as reasoning-only");
|
|
1682
|
+
continue;
|
|
1683
|
+
}
|
|
1684
|
+
const hasMedia = Boolean(reply?.mediaUrl) || (reply?.mediaUrls?.length ?? 0) > 0;
|
|
1685
|
+
if (!reply?.text && !hasMedia) {
|
|
1686
|
+
if (reply?.audioAsVoice) {
|
|
1687
|
+
logVerbose("matrix reply has audioAsVoice without media/text; skipping");
|
|
1688
|
+
continue;
|
|
1689
|
+
}
|
|
1690
|
+
params.runtime.error?.("matrix reply missing text/media");
|
|
1691
|
+
continue;
|
|
1692
|
+
}
|
|
1693
|
+
const replyToIdRaw = reply.replyToId?.trim();
|
|
1694
|
+
const replyToId = params.threadId || params.replyToMode === "off" ? void 0 : replyToIdRaw;
|
|
1695
|
+
const rawText = reply.text ?? "";
|
|
1696
|
+
const mediaList = reply.mediaUrls?.length ? reply.mediaUrls : reply.mediaUrl ? [reply.mediaUrl] : [];
|
|
1697
|
+
const shouldIncludeReply = (id) => Boolean(id) && (params.replyToMode === "all" || !hasReplied);
|
|
1698
|
+
const replyToIdForReply = shouldIncludeReply(replyToId) ? replyToId : void 0;
|
|
1699
|
+
if (mediaList.length === 0) {
|
|
1700
|
+
let sentTextChunk = false;
|
|
1701
|
+
const { chunks } = chunkMatrixText(rawText, {
|
|
1702
|
+
cfg: params.cfg,
|
|
1703
|
+
accountId: params.accountId,
|
|
1704
|
+
tableMode
|
|
1705
|
+
});
|
|
1706
|
+
for (const chunk of chunks) {
|
|
1707
|
+
const trimmed = chunk.trim();
|
|
1708
|
+
if (!trimmed) continue;
|
|
1709
|
+
await sendMessageMatrix(params.roomId, trimmed, {
|
|
1710
|
+
client: params.client,
|
|
1711
|
+
cfg: params.cfg,
|
|
1712
|
+
replyToId: replyToIdForReply,
|
|
1713
|
+
threadId: params.threadId,
|
|
1714
|
+
accountId: params.accountId
|
|
1715
|
+
});
|
|
1716
|
+
sentTextChunk = true;
|
|
1717
|
+
}
|
|
1718
|
+
if (replyToIdForReply && !hasReplied && sentTextChunk) hasReplied = true;
|
|
1719
|
+
continue;
|
|
1720
|
+
}
|
|
1721
|
+
let first = true;
|
|
1722
|
+
for (const mediaUrl of mediaList) {
|
|
1723
|
+
const caption = first ? rawText : "";
|
|
1724
|
+
await sendMessageMatrix(params.roomId, caption, {
|
|
1725
|
+
client: params.client,
|
|
1726
|
+
cfg: params.cfg,
|
|
1727
|
+
mediaUrl,
|
|
1728
|
+
mediaLocalRoots: params.mediaLocalRoots,
|
|
1729
|
+
replyToId: replyToIdForReply,
|
|
1730
|
+
threadId: params.threadId,
|
|
1731
|
+
audioAsVoice: reply.audioAsVoice,
|
|
1732
|
+
accountId: params.accountId
|
|
1733
|
+
});
|
|
1734
|
+
first = false;
|
|
1735
|
+
}
|
|
1736
|
+
if (replyToIdForReply && !hasReplied) hasReplied = true;
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
//#endregion
|
|
1740
|
+
//#region extensions/matrix/src/matrix/monitor/context-summary.ts
|
|
1741
|
+
function trimMatrixMaybeString(value) {
|
|
1742
|
+
if (typeof value !== "string") return;
|
|
1743
|
+
return value.trim() || void 0;
|
|
1744
|
+
}
|
|
1745
|
+
function summarizeMatrixMessageContextEvent(event) {
|
|
1746
|
+
if (isPollStartType(event.type)) {
|
|
1747
|
+
const pollSummary = parsePollStartContent(event.content);
|
|
1748
|
+
if (pollSummary) return formatPollAsText(pollSummary);
|
|
1749
|
+
}
|
|
1750
|
+
const content = event.content;
|
|
1751
|
+
return formatMatrixMessageText({
|
|
1752
|
+
body: resolveMatrixMessageBody({
|
|
1753
|
+
body: trimMatrixMaybeString(content.body),
|
|
1754
|
+
filename: trimMatrixMaybeString(content.filename),
|
|
1755
|
+
msgtype: trimMatrixMaybeString(content.msgtype)
|
|
1756
|
+
}),
|
|
1757
|
+
attachment: resolveMatrixMessageAttachment({
|
|
1758
|
+
body: trimMatrixMaybeString(content.body),
|
|
1759
|
+
filename: trimMatrixMaybeString(content.filename),
|
|
1760
|
+
msgtype: trimMatrixMaybeString(content.msgtype)
|
|
1761
|
+
})
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
//#endregion
|
|
1765
|
+
//#region extensions/matrix/src/matrix/monitor/reply-context.ts
|
|
1766
|
+
const MAX_CACHED_REPLY_CONTEXTS = 256;
|
|
1767
|
+
const MAX_REPLY_BODY_LENGTH = 500;
|
|
1768
|
+
function truncateReplyBody(value) {
|
|
1769
|
+
if (value.length <= MAX_REPLY_BODY_LENGTH) return value;
|
|
1770
|
+
return `${value.slice(0, MAX_REPLY_BODY_LENGTH - 3)}...`;
|
|
1771
|
+
}
|
|
1772
|
+
function summarizeMatrixReplyEvent(event) {
|
|
1773
|
+
const body = summarizeMatrixMessageContextEvent(event);
|
|
1774
|
+
return body ? truncateReplyBody(body) : void 0;
|
|
1775
|
+
}
|
|
1776
|
+
/**
|
|
1777
|
+
* Creates a cached resolver that fetches the body and sender of a replied-to
|
|
1778
|
+
* Matrix event. This allows the agent to see the content of the message being
|
|
1779
|
+
* replied to, not just its event ID.
|
|
1780
|
+
*/
|
|
1781
|
+
function createMatrixReplyContextResolver(params) {
|
|
1782
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1783
|
+
const remember = (key, value) => {
|
|
1784
|
+
cache.set(key, value);
|
|
1785
|
+
if (cache.size > MAX_CACHED_REPLY_CONTEXTS) {
|
|
1786
|
+
const oldest = cache.keys().next().value;
|
|
1787
|
+
if (typeof oldest === "string") cache.delete(oldest);
|
|
1788
|
+
}
|
|
1789
|
+
return value;
|
|
1790
|
+
};
|
|
1791
|
+
return async (input) => {
|
|
1792
|
+
const cacheKey = `${input.roomId}:${input.eventId}`;
|
|
1793
|
+
const cached = cache.get(cacheKey);
|
|
1794
|
+
if (cached) {
|
|
1795
|
+
cache.delete(cacheKey);
|
|
1796
|
+
cache.set(cacheKey, cached);
|
|
1797
|
+
return cached;
|
|
1798
|
+
}
|
|
1799
|
+
const event = await params.client.getEvent(input.roomId, input.eventId).catch((err) => {
|
|
1800
|
+
params.logVerboseMessage(`matrix: failed resolving reply context room=${input.roomId} id=${input.eventId}: ${String(err)}`);
|
|
1801
|
+
return null;
|
|
1802
|
+
});
|
|
1803
|
+
if (!event) return {};
|
|
1804
|
+
const rawEvent = event;
|
|
1805
|
+
if (rawEvent.unsigned?.redacted_because) return remember(cacheKey, {});
|
|
1806
|
+
const replyToBody = summarizeMatrixReplyEvent(rawEvent);
|
|
1807
|
+
if (!replyToBody) return remember(cacheKey, {});
|
|
1808
|
+
const senderId = trimMatrixMaybeString(rawEvent.sender);
|
|
1809
|
+
return remember(cacheKey, {
|
|
1810
|
+
replyToBody,
|
|
1811
|
+
replyToSender: (senderId && await params.getMemberDisplayName(input.roomId, senderId).catch(() => void 0)) ?? senderId,
|
|
1812
|
+
replyToSenderId: senderId
|
|
1813
|
+
});
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
//#endregion
|
|
1817
|
+
//#region extensions/matrix/src/matrix/monitor/room-history.ts
|
|
1818
|
+
/** Maximum entries retained per room (hard cap to bound memory). */
|
|
1819
|
+
const DEFAULT_MAX_QUEUE_SIZE = 200;
|
|
1820
|
+
/** Maximum number of rooms to retain queues for (FIFO eviction beyond this). */
|
|
1821
|
+
const DEFAULT_MAX_ROOM_QUEUES = 1e3;
|
|
1822
|
+
/** Maximum number of (agentId, roomId) watermark entries to retain. */
|
|
1823
|
+
const MAX_WATERMARK_ENTRIES = 5e3;
|
|
1824
|
+
/** Maximum prepared trigger snapshots retained per room for retry reuse. */
|
|
1825
|
+
const MAX_PREPARED_TRIGGER_ENTRIES = 500;
|
|
1826
|
+
function createRoomHistoryTrackerInternal(maxQueueSize = DEFAULT_MAX_QUEUE_SIZE, maxRoomQueues = DEFAULT_MAX_ROOM_QUEUES, maxWatermarkEntries = MAX_WATERMARK_ENTRIES, maxPreparedTriggerEntries = MAX_PREPARED_TRIGGER_ENTRIES) {
|
|
1827
|
+
const roomQueues = /* @__PURE__ */ new Map();
|
|
1828
|
+
/** Maps `${agentId}:${roomId}` → absolute consumed-up-to index */
|
|
1829
|
+
const agentWatermarks = /* @__PURE__ */ new Map();
|
|
1830
|
+
let nextQueueGeneration = 1;
|
|
1831
|
+
function clearRoomWatermarks(roomId) {
|
|
1832
|
+
const roomSuffix = `:${roomId}`;
|
|
1833
|
+
for (const key of agentWatermarks.keys()) if (key.endsWith(roomSuffix)) agentWatermarks.delete(key);
|
|
1834
|
+
}
|
|
1835
|
+
function getOrCreateQueue(roomId) {
|
|
1836
|
+
let queue = roomQueues.get(roomId);
|
|
1837
|
+
if (!queue) {
|
|
1838
|
+
queue = {
|
|
1839
|
+
entries: [],
|
|
1840
|
+
baseIndex: 0,
|
|
1841
|
+
generation: nextQueueGeneration++,
|
|
1842
|
+
preparedTriggers: /* @__PURE__ */ new Map()
|
|
1843
|
+
};
|
|
1844
|
+
roomQueues.set(roomId, queue);
|
|
1845
|
+
if (roomQueues.size > maxRoomQueues) {
|
|
1846
|
+
const oldest = roomQueues.keys().next().value;
|
|
1847
|
+
if (oldest !== void 0) {
|
|
1848
|
+
roomQueues.delete(oldest);
|
|
1849
|
+
clearRoomWatermarks(oldest);
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
}
|
|
1853
|
+
return queue;
|
|
1854
|
+
}
|
|
1855
|
+
function appendToQueue(queue, entry) {
|
|
1856
|
+
queue.entries.push(entry);
|
|
1857
|
+
if (queue.entries.length > maxQueueSize) {
|
|
1858
|
+
const overflow = queue.entries.length - maxQueueSize;
|
|
1859
|
+
queue.entries.splice(0, overflow);
|
|
1860
|
+
queue.baseIndex += overflow;
|
|
1861
|
+
}
|
|
1862
|
+
return {
|
|
1863
|
+
snapshotIdx: queue.baseIndex + queue.entries.length,
|
|
1864
|
+
queueGeneration: queue.generation
|
|
1865
|
+
};
|
|
1866
|
+
}
|
|
1867
|
+
function wmKey(agentId, roomId) {
|
|
1868
|
+
return `${agentId}:${roomId}`;
|
|
1869
|
+
}
|
|
1870
|
+
function preparedTriggerKey(agentId, messageId) {
|
|
1871
|
+
if (!messageId?.trim()) return null;
|
|
1872
|
+
return `${agentId}:${messageId.trim()}`;
|
|
1873
|
+
}
|
|
1874
|
+
function rememberWatermark(key, snapshotIdx) {
|
|
1875
|
+
const nextSnapshotIdx = Math.max(agentWatermarks.get(key) ?? 0, snapshotIdx);
|
|
1876
|
+
if (agentWatermarks.has(key)) agentWatermarks.delete(key);
|
|
1877
|
+
agentWatermarks.set(key, nextSnapshotIdx);
|
|
1878
|
+
if (agentWatermarks.size > maxWatermarkEntries) {
|
|
1879
|
+
const oldest = agentWatermarks.keys().next().value;
|
|
1880
|
+
if (oldest !== void 0) agentWatermarks.delete(oldest);
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
function rememberPreparedTrigger(queue, retryKey, prepared) {
|
|
1884
|
+
if (queue.preparedTriggers.has(retryKey)) queue.preparedTriggers.delete(retryKey);
|
|
1885
|
+
queue.preparedTriggers.set(retryKey, prepared);
|
|
1886
|
+
if (queue.preparedTriggers.size > maxPreparedTriggerEntries) {
|
|
1887
|
+
const oldest = queue.preparedTriggers.keys().next().value;
|
|
1888
|
+
if (oldest !== void 0) queue.preparedTriggers.delete(oldest);
|
|
1889
|
+
}
|
|
1890
|
+
return prepared;
|
|
1891
|
+
}
|
|
1892
|
+
function computePendingHistory(queue, agentId, roomId, limit) {
|
|
1893
|
+
if (limit <= 0 || queue.entries.length === 0) return [];
|
|
1894
|
+
const wm = agentWatermarks.get(wmKey(agentId, roomId)) ?? 0;
|
|
1895
|
+
const startRel = Math.max(wm, queue.baseIndex) - queue.baseIndex;
|
|
1896
|
+
const available = queue.entries.slice(startRel);
|
|
1897
|
+
return available.length > limit ? available.slice(-limit) : available;
|
|
1898
|
+
}
|
|
1899
|
+
return {
|
|
1900
|
+
recordPending(roomId, entry) {
|
|
1901
|
+
appendToQueue(getOrCreateQueue(roomId), entry);
|
|
1902
|
+
},
|
|
1903
|
+
getPendingHistory(agentId, roomId, limit) {
|
|
1904
|
+
const queue = roomQueues.get(roomId);
|
|
1905
|
+
if (!queue) return [];
|
|
1906
|
+
return computePendingHistory(queue, agentId, roomId, limit);
|
|
1907
|
+
},
|
|
1908
|
+
recordTrigger(roomId, entry) {
|
|
1909
|
+
return appendToQueue(getOrCreateQueue(roomId), entry);
|
|
1910
|
+
},
|
|
1911
|
+
prepareTrigger(agentId, roomId, limit, entry) {
|
|
1912
|
+
const queue = getOrCreateQueue(roomId);
|
|
1913
|
+
const retryKey = preparedTriggerKey(agentId, entry.messageId);
|
|
1914
|
+
if (retryKey) {
|
|
1915
|
+
const prepared = queue.preparedTriggers.get(retryKey);
|
|
1916
|
+
if (prepared) return rememberPreparedTrigger(queue, retryKey, prepared);
|
|
1917
|
+
}
|
|
1918
|
+
const prepared = {
|
|
1919
|
+
history: computePendingHistory(queue, agentId, roomId, limit),
|
|
1920
|
+
...appendToQueue(queue, entry)
|
|
1921
|
+
};
|
|
1922
|
+
if (retryKey) return rememberPreparedTrigger(queue, retryKey, prepared);
|
|
1923
|
+
return prepared;
|
|
1924
|
+
},
|
|
1925
|
+
consumeHistory(agentId, roomId, snapshot, messageId) {
|
|
1926
|
+
const key = wmKey(agentId, roomId);
|
|
1927
|
+
const queue = roomQueues.get(roomId);
|
|
1928
|
+
if (!queue) {
|
|
1929
|
+
agentWatermarks.delete(key);
|
|
1930
|
+
return;
|
|
1931
|
+
}
|
|
1932
|
+
if (queue.generation !== snapshot.queueGeneration) return;
|
|
1933
|
+
rememberWatermark(key, snapshot.snapshotIdx);
|
|
1934
|
+
const retryKey = preparedTriggerKey(agentId, messageId);
|
|
1935
|
+
if (queue && retryKey) queue.preparedTriggers.delete(retryKey);
|
|
1936
|
+
}
|
|
1937
|
+
};
|
|
1938
|
+
}
|
|
1939
|
+
function createRoomHistoryTracker(maxQueueSize = DEFAULT_MAX_QUEUE_SIZE, maxRoomQueues = DEFAULT_MAX_ROOM_QUEUES, maxWatermarkEntries = MAX_WATERMARK_ENTRIES, maxPreparedTriggerEntries = MAX_PREPARED_TRIGGER_ENTRIES) {
|
|
1940
|
+
const tracker = createRoomHistoryTrackerInternal(maxQueueSize, maxRoomQueues, maxWatermarkEntries, maxPreparedTriggerEntries);
|
|
1941
|
+
return {
|
|
1942
|
+
recordPending: tracker.recordPending,
|
|
1943
|
+
prepareTrigger: tracker.prepareTrigger,
|
|
1944
|
+
consumeHistory: tracker.consumeHistory
|
|
1945
|
+
};
|
|
1946
|
+
}
|
|
1947
|
+
//#endregion
|
|
1948
|
+
//#region extensions/matrix/src/matrix/monitor/thread-context.ts
|
|
1949
|
+
const MAX_TRACKED_THREAD_STARTERS = 256;
|
|
1950
|
+
const MAX_THREAD_STARTER_BODY_LENGTH = 500;
|
|
1951
|
+
function truncateThreadStarterBody(value) {
|
|
1952
|
+
if (value.length <= MAX_THREAD_STARTER_BODY_LENGTH) return value;
|
|
1953
|
+
return `${value.slice(0, MAX_THREAD_STARTER_BODY_LENGTH - 3)}...`;
|
|
1954
|
+
}
|
|
1955
|
+
function summarizeMatrixThreadStarterEvent(event) {
|
|
1956
|
+
const body = summarizeMatrixMessageContextEvent(event);
|
|
1957
|
+
if (body) return truncateThreadStarterBody(body);
|
|
1958
|
+
const content = event.content;
|
|
1959
|
+
const msgtype = trimMatrixMaybeString(content.msgtype);
|
|
1960
|
+
if (msgtype) return `Matrix ${msgtype} message`;
|
|
1961
|
+
const eventType = trimMatrixMaybeString(event.type);
|
|
1962
|
+
return eventType ? `Matrix ${eventType} event` : void 0;
|
|
1963
|
+
}
|
|
1964
|
+
function formatMatrixThreadStarterBody(params) {
|
|
1965
|
+
const senderLabel = params.senderName ?? params.senderId ?? "unknown sender";
|
|
1966
|
+
const lines = [`Matrix thread root ${params.threadRootId} from ${senderLabel}:`];
|
|
1967
|
+
if (params.summary) lines.push(params.summary);
|
|
1968
|
+
return lines.join("\n");
|
|
1969
|
+
}
|
|
1970
|
+
function createMatrixThreadContextResolver(params) {
|
|
1971
|
+
const cache = /* @__PURE__ */ new Map();
|
|
1972
|
+
const remember = (key, value) => {
|
|
1973
|
+
cache.set(key, value);
|
|
1974
|
+
if (cache.size > MAX_TRACKED_THREAD_STARTERS) {
|
|
1975
|
+
const oldest = cache.keys().next().value;
|
|
1976
|
+
if (typeof oldest === "string") cache.delete(oldest);
|
|
1977
|
+
}
|
|
1978
|
+
return value;
|
|
1979
|
+
};
|
|
1980
|
+
return async (input) => {
|
|
1981
|
+
const cacheKey = `${input.roomId}:${input.threadRootId}`;
|
|
1982
|
+
const cached = cache.get(cacheKey);
|
|
1983
|
+
if (cached) return cached;
|
|
1984
|
+
const rootEvent = await params.client.getEvent(input.roomId, input.threadRootId).catch((err) => {
|
|
1985
|
+
params.logVerboseMessage(`matrix: failed resolving thread root room=${input.roomId} id=${input.threadRootId}: ${String(err)}`);
|
|
1986
|
+
return null;
|
|
1987
|
+
});
|
|
1988
|
+
if (!rootEvent) return { threadStarterBody: `Matrix thread root ${input.threadRootId}` };
|
|
1989
|
+
const rawEvent = rootEvent;
|
|
1990
|
+
const senderId = trimMatrixMaybeString(rawEvent.sender);
|
|
1991
|
+
const senderName = senderId && await params.getMemberDisplayName(input.roomId, senderId).catch(() => void 0);
|
|
1992
|
+
const senderLabel = senderName ?? senderId;
|
|
1993
|
+
const summary = summarizeMatrixThreadStarterEvent(rawEvent);
|
|
1994
|
+
return remember(cacheKey, {
|
|
1995
|
+
threadStarterBody: formatMatrixThreadStarterBody({
|
|
1996
|
+
threadRootId: input.threadRootId,
|
|
1997
|
+
senderId,
|
|
1998
|
+
senderName,
|
|
1999
|
+
summary
|
|
2000
|
+
}),
|
|
2001
|
+
senderId,
|
|
2002
|
+
senderLabel,
|
|
2003
|
+
summary
|
|
2004
|
+
});
|
|
2005
|
+
};
|
|
2006
|
+
}
|
|
2007
|
+
//#endregion
|
|
2008
|
+
//#region extensions/matrix/src/matrix/monitor/handler.ts
|
|
2009
|
+
const ALLOW_FROM_STORE_CACHE_TTL_MS = 3e4;
|
|
2010
|
+
const PAIRING_REPLY_COOLDOWN_MS = 5 * 6e4;
|
|
2011
|
+
const MAX_TRACKED_PAIRING_REPLY_SENDERS = 512;
|
|
2012
|
+
function resolveMatrixMentionPrecheckText(params) {
|
|
2013
|
+
if (params.locationText?.trim()) return params.locationText.trim();
|
|
2014
|
+
if (typeof params.content.body === "string" && params.content.body.trim()) return params.content.body.trim();
|
|
2015
|
+
if (isPollStartType(params.eventType)) {
|
|
2016
|
+
const parsed = parsePollStartContent(params.content);
|
|
2017
|
+
if (parsed) return formatPollAsText(parsed);
|
|
2018
|
+
}
|
|
2019
|
+
return "";
|
|
2020
|
+
}
|
|
2021
|
+
function resolveMatrixInboundBodyText(params) {
|
|
2022
|
+
if (params.mediaPlaceholder) return params.rawBody || params.mediaPlaceholder;
|
|
2023
|
+
if (!params.mediaDownloadFailed || !params.hadMediaUrl) return params.rawBody;
|
|
2024
|
+
return formatMatrixMediaUnavailableText({
|
|
2025
|
+
body: params.rawBody,
|
|
2026
|
+
filename: params.filename,
|
|
2027
|
+
msgtype: params.msgtype
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
function resolveMatrixPendingHistoryText(params) {
|
|
2031
|
+
if (params.mentionPrecheckText) return params.mentionPrecheckText;
|
|
2032
|
+
if (!params.mediaUrl) return "";
|
|
2033
|
+
const body = typeof params.content.body === "string" ? params.content.body.trim() : void 0;
|
|
2034
|
+
const filename = typeof params.content.filename === "string" ? params.content.filename.trim() : void 0;
|
|
2035
|
+
const msgtype = typeof params.content.msgtype === "string" ? params.content.msgtype : void 0;
|
|
2036
|
+
return formatMatrixMessageText({
|
|
2037
|
+
body: resolveMatrixMessageBody({
|
|
2038
|
+
body,
|
|
2039
|
+
filename,
|
|
2040
|
+
msgtype
|
|
2041
|
+
}),
|
|
2042
|
+
attachment: resolveMatrixMessageAttachment({
|
|
2043
|
+
body,
|
|
2044
|
+
filename,
|
|
2045
|
+
msgtype
|
|
2046
|
+
})
|
|
2047
|
+
}) ?? "";
|
|
2048
|
+
}
|
|
2049
|
+
function resolveMatrixAllowBotsMode(value) {
|
|
2050
|
+
if (value === true) return "all";
|
|
2051
|
+
if (value === "mentions") return "mentions";
|
|
2052
|
+
return "off";
|
|
2053
|
+
}
|
|
2054
|
+
function createMatrixRoomMessageHandler(params) {
|
|
2055
|
+
const { client, core, cfg, accountId, runtime, logger, logVerboseMessage, allowFrom, groupAllowFrom = [], roomsConfig, accountAllowBots, configuredBotUserIds = /* @__PURE__ */ new Set(), groupPolicy, replyToMode, threadReplies, dmThreadReplies, streaming, blockStreamingEnabled, dmEnabled, dmPolicy, textLimit, mediaMaxBytes, historyLimit, startupMs, startupGraceMs, dropPreStartupMessages, inboundDeduper, directTracker, getRoomInfo, getMemberDisplayName, needsRoomAliasesForConfig } = params;
|
|
2056
|
+
const contextVisibilityMode = resolveChannelContextVisibilityMode({
|
|
2057
|
+
cfg,
|
|
2058
|
+
channel: "matrix",
|
|
2059
|
+
accountId
|
|
2060
|
+
});
|
|
2061
|
+
let cachedStoreAllowFrom = null;
|
|
2062
|
+
const pairingReplySentAtMsBySender = /* @__PURE__ */ new Map();
|
|
2063
|
+
const resolveThreadContext = createMatrixThreadContextResolver({
|
|
2064
|
+
client,
|
|
2065
|
+
getMemberDisplayName,
|
|
2066
|
+
logVerboseMessage
|
|
2067
|
+
});
|
|
2068
|
+
const resolveReplyContext = createMatrixReplyContextResolver({
|
|
2069
|
+
client,
|
|
2070
|
+
getMemberDisplayName,
|
|
2071
|
+
logVerboseMessage
|
|
2072
|
+
});
|
|
2073
|
+
const roomHistoryTracker = createRoomHistoryTracker();
|
|
2074
|
+
const roomIngressTails = /* @__PURE__ */ new Map();
|
|
2075
|
+
const readStoreAllowFrom = async () => {
|
|
2076
|
+
const now = Date.now();
|
|
2077
|
+
if (cachedStoreAllowFrom && now < cachedStoreAllowFrom.expiresAtMs) return cachedStoreAllowFrom.value;
|
|
2078
|
+
const value = await core.channel.pairing.readAllowFromStore({
|
|
2079
|
+
channel: "matrix",
|
|
2080
|
+
env: process.env,
|
|
2081
|
+
accountId
|
|
2082
|
+
}).catch(() => []);
|
|
2083
|
+
cachedStoreAllowFrom = {
|
|
2084
|
+
value,
|
|
2085
|
+
expiresAtMs: now + ALLOW_FROM_STORE_CACHE_TTL_MS
|
|
2086
|
+
};
|
|
2087
|
+
return value;
|
|
2088
|
+
};
|
|
2089
|
+
const shouldSendPairingReply = (senderId, created) => {
|
|
2090
|
+
const now = Date.now();
|
|
2091
|
+
if (created) {
|
|
2092
|
+
pairingReplySentAtMsBySender.set(senderId, now);
|
|
2093
|
+
return true;
|
|
2094
|
+
}
|
|
2095
|
+
const lastSentAtMs = pairingReplySentAtMsBySender.get(senderId);
|
|
2096
|
+
if (typeof lastSentAtMs === "number" && now - lastSentAtMs < PAIRING_REPLY_COOLDOWN_MS) return false;
|
|
2097
|
+
pairingReplySentAtMsBySender.set(senderId, now);
|
|
2098
|
+
if (pairingReplySentAtMsBySender.size > MAX_TRACKED_PAIRING_REPLY_SENDERS) {
|
|
2099
|
+
const oldestSender = pairingReplySentAtMsBySender.keys().next().value;
|
|
2100
|
+
if (typeof oldestSender === "string") pairingReplySentAtMsBySender.delete(oldestSender);
|
|
2101
|
+
}
|
|
2102
|
+
return true;
|
|
2103
|
+
};
|
|
2104
|
+
const runRoomIngress = async (roomId, task) => {
|
|
2105
|
+
const previous = roomIngressTails.get(roomId) ?? Promise.resolve();
|
|
2106
|
+
let releaseCurrent;
|
|
2107
|
+
const current = new Promise((resolve) => {
|
|
2108
|
+
releaseCurrent = resolve;
|
|
2109
|
+
});
|
|
2110
|
+
const chain = previous.catch(() => {}).then(() => current);
|
|
2111
|
+
roomIngressTails.set(roomId, chain);
|
|
2112
|
+
await previous.catch(() => {});
|
|
2113
|
+
try {
|
|
2114
|
+
return await task();
|
|
2115
|
+
} finally {
|
|
2116
|
+
releaseCurrent();
|
|
2117
|
+
if (roomIngressTails.get(roomId) === chain) roomIngressTails.delete(roomId);
|
|
2118
|
+
}
|
|
2119
|
+
};
|
|
2120
|
+
return async (roomId, event) => {
|
|
2121
|
+
const eventId = typeof event.event_id === "string" ? event.event_id.trim() : "";
|
|
2122
|
+
let claimedInboundEvent = false;
|
|
2123
|
+
let draftStreamRef;
|
|
2124
|
+
try {
|
|
2125
|
+
const eventType = event.type;
|
|
2126
|
+
if (eventType === EventType.RoomMessageEncrypted) return;
|
|
2127
|
+
const isPollEvent = isPollEventType(eventType);
|
|
2128
|
+
const isReactionEvent = eventType === EventType.Reaction;
|
|
2129
|
+
const locationContent = event.content;
|
|
2130
|
+
const isLocationEvent = eventType === EventType.Location || eventType === EventType.RoomMessage && locationContent.msgtype === EventType.Location;
|
|
2131
|
+
if (eventType !== EventType.RoomMessage && !isPollEvent && !isLocationEvent && !isReactionEvent) return;
|
|
2132
|
+
logVerboseMessage(`matrix: inbound event room=${roomId} type=${eventType} id=${event.event_id ?? "unknown"}`);
|
|
2133
|
+
if (event.unsigned?.redacted_because) return;
|
|
2134
|
+
const senderId = event.sender;
|
|
2135
|
+
if (!senderId) return;
|
|
2136
|
+
const eventTs = event.origin_server_ts;
|
|
2137
|
+
const eventAge = event.unsigned?.age;
|
|
2138
|
+
const commitInboundEventIfClaimed = async () => {
|
|
2139
|
+
if (!claimedInboundEvent || !inboundDeduper || !eventId) return;
|
|
2140
|
+
await inboundDeduper.commitEvent({
|
|
2141
|
+
roomId,
|
|
2142
|
+
eventId
|
|
2143
|
+
});
|
|
2144
|
+
claimedInboundEvent = false;
|
|
2145
|
+
};
|
|
2146
|
+
const readIngressPrefix = async () => {
|
|
2147
|
+
const selfUserId = await client.getUserId();
|
|
2148
|
+
if (senderId === selfUserId) return;
|
|
2149
|
+
if (dropPreStartupMessages) {
|
|
2150
|
+
if (typeof eventTs === "number" && eventTs < startupMs - startupGraceMs) return;
|
|
2151
|
+
if (typeof eventTs !== "number" && typeof eventAge === "number" && eventAge > startupGraceMs) return;
|
|
2152
|
+
}
|
|
2153
|
+
let content = event.content;
|
|
2154
|
+
if (eventType === EventType.RoomMessage && isMatrixVerificationRoomMessage({
|
|
2155
|
+
msgtype: content.msgtype,
|
|
2156
|
+
body: content.body
|
|
2157
|
+
})) {
|
|
2158
|
+
logVerboseMessage(`matrix: skip verification/system room message room=${roomId}`);
|
|
2159
|
+
return;
|
|
2160
|
+
}
|
|
2161
|
+
const locationPayload = resolveMatrixLocation({
|
|
2162
|
+
eventType,
|
|
2163
|
+
content
|
|
2164
|
+
});
|
|
2165
|
+
const relates = content["m.relates_to"];
|
|
2166
|
+
if (relates && "rel_type" in relates && relates.rel_type === RelationType.Replace) return;
|
|
2167
|
+
if (eventId && inboundDeduper) {
|
|
2168
|
+
claimedInboundEvent = inboundDeduper.claimEvent({
|
|
2169
|
+
roomId,
|
|
2170
|
+
eventId
|
|
2171
|
+
});
|
|
2172
|
+
if (!claimedInboundEvent) {
|
|
2173
|
+
logVerboseMessage(`matrix: skip duplicate inbound event room=${roomId} id=${eventId}`);
|
|
2174
|
+
return;
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
return {
|
|
2178
|
+
content,
|
|
2179
|
+
isDirectMessage: await directTracker.isDirectMessage({
|
|
2180
|
+
roomId,
|
|
2181
|
+
senderId,
|
|
2182
|
+
selfUserId
|
|
2183
|
+
}),
|
|
2184
|
+
locationPayload,
|
|
2185
|
+
selfUserId
|
|
2186
|
+
};
|
|
2187
|
+
};
|
|
2188
|
+
const continueIngress = async (params) => {
|
|
2189
|
+
let content = params.content;
|
|
2190
|
+
const isDirectMessage = params.isDirectMessage;
|
|
2191
|
+
const isRoom = !isDirectMessage;
|
|
2192
|
+
const { locationPayload, selfUserId } = params;
|
|
2193
|
+
if (isRoom && groupPolicy === "disabled") {
|
|
2194
|
+
await commitInboundEventIfClaimed();
|
|
2195
|
+
return;
|
|
2196
|
+
}
|
|
2197
|
+
const roomInfoForConfig = isRoom && needsRoomAliasesForConfig ? await getRoomInfo(roomId, { includeAliases: true }) : void 0;
|
|
2198
|
+
const roomAliasesForConfig = roomInfoForConfig ? [roomInfoForConfig.canonicalAlias ?? "", ...roomInfoForConfig.altAliases].filter(Boolean) : [];
|
|
2199
|
+
const roomConfigInfo = isRoom ? resolveMatrixRoomConfig({
|
|
2200
|
+
rooms: roomsConfig,
|
|
2201
|
+
roomId,
|
|
2202
|
+
aliases: roomAliasesForConfig
|
|
2203
|
+
}) : void 0;
|
|
2204
|
+
const roomConfig = roomConfigInfo?.config;
|
|
2205
|
+
const allowBotsMode = resolveMatrixAllowBotsMode(roomConfig?.allowBots ?? accountAllowBots);
|
|
2206
|
+
const isConfiguredBotSender = configuredBotUserIds.has(senderId);
|
|
2207
|
+
const roomMatchMeta = roomConfigInfo ? `matchKey=${roomConfigInfo.matchKey ?? "none"} matchSource=${roomConfigInfo.matchSource ?? "none"}` : "matchKey=none matchSource=none";
|
|
2208
|
+
if (isConfiguredBotSender && allowBotsMode === "off") {
|
|
2209
|
+
logVerboseMessage(`matrix: drop configured bot sender=${senderId} (allowBots=false${isDirectMessage ? "" : `, ${roomMatchMeta}`})`);
|
|
2210
|
+
await commitInboundEventIfClaimed();
|
|
2211
|
+
return;
|
|
2212
|
+
}
|
|
2213
|
+
if (isRoom && roomConfig && !roomConfigInfo?.allowed) {
|
|
2214
|
+
logVerboseMessage(`matrix: room disabled room=${roomId} (${roomMatchMeta})`);
|
|
2215
|
+
await commitInboundEventIfClaimed();
|
|
2216
|
+
return;
|
|
2217
|
+
}
|
|
2218
|
+
if (isRoom && groupPolicy === "allowlist") {
|
|
2219
|
+
if (!roomConfigInfo?.allowlistConfigured) {
|
|
2220
|
+
logVerboseMessage(`matrix: drop room message (no allowlist, ${roomMatchMeta})`);
|
|
2221
|
+
await commitInboundEventIfClaimed();
|
|
2222
|
+
return;
|
|
2223
|
+
}
|
|
2224
|
+
if (!roomConfig) {
|
|
2225
|
+
logVerboseMessage(`matrix: drop room message (not in allowlist, ${roomMatchMeta})`);
|
|
2226
|
+
await commitInboundEventIfClaimed();
|
|
2227
|
+
return;
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
let senderNamePromise = null;
|
|
2231
|
+
const getSenderName = async () => {
|
|
2232
|
+
senderNamePromise ??= getMemberDisplayName(roomId, senderId).catch(() => senderId);
|
|
2233
|
+
return await senderNamePromise;
|
|
2234
|
+
};
|
|
2235
|
+
const { effectiveGroupAllowFrom, effectiveRoomUsers, groupAllowConfigured, directAllowMatch, roomUserMatch, groupAllowMatch, commandAuthorizers } = resolveMatrixMonitorAccessState({
|
|
2236
|
+
allowFrom,
|
|
2237
|
+
storeAllowFrom: await readStoreAllowFrom(),
|
|
2238
|
+
groupAllowFrom,
|
|
2239
|
+
roomUsers: roomConfig?.users ?? [],
|
|
2240
|
+
senderId,
|
|
2241
|
+
isRoom
|
|
2242
|
+
});
|
|
2243
|
+
if (isDirectMessage) {
|
|
2244
|
+
if (!dmEnabled || dmPolicy === "disabled") {
|
|
2245
|
+
await commitInboundEventIfClaimed();
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
if (dmPolicy !== "open") {
|
|
2249
|
+
const allowMatchMeta = formatAllowlistMatchMeta(directAllowMatch);
|
|
2250
|
+
if (!directAllowMatch.allowed) {
|
|
2251
|
+
if (!isReactionEvent && dmPolicy === "pairing") {
|
|
2252
|
+
const senderName = await getSenderName();
|
|
2253
|
+
const { code, created } = await core.channel.pairing.upsertPairingRequest({
|
|
2254
|
+
channel: "matrix",
|
|
2255
|
+
id: senderId,
|
|
2256
|
+
accountId,
|
|
2257
|
+
meta: { name: senderName }
|
|
2258
|
+
});
|
|
2259
|
+
if (shouldSendPairingReply(senderId, created)) {
|
|
2260
|
+
const pairingReply = core.channel.pairing.buildPairingReply({
|
|
2261
|
+
channel: "matrix",
|
|
2262
|
+
idLine: `Your Matrix user id: ${senderId}`,
|
|
2263
|
+
code
|
|
2264
|
+
});
|
|
2265
|
+
logVerboseMessage(created ? `matrix pairing request sender=${senderId} name=${senderName ?? "unknown"} (${allowMatchMeta})` : `matrix pairing reminder sender=${senderId} name=${senderName ?? "unknown"} (${allowMatchMeta})`);
|
|
2266
|
+
try {
|
|
2267
|
+
await sendMessageMatrix(`room:${roomId}`, created ? pairingReply : `${pairingReply}\n\nPairing request is still pending approval. Reusing existing code.`, {
|
|
2268
|
+
client,
|
|
2269
|
+
cfg,
|
|
2270
|
+
accountId
|
|
2271
|
+
});
|
|
2272
|
+
await commitInboundEventIfClaimed();
|
|
2273
|
+
} catch (err) {
|
|
2274
|
+
logVerboseMessage(`matrix pairing reply failed for ${senderId}: ${String(err)}`);
|
|
2275
|
+
return;
|
|
2276
|
+
}
|
|
2277
|
+
} else {
|
|
2278
|
+
logVerboseMessage(`matrix pairing reminder suppressed sender=${senderId} (cooldown)`);
|
|
2279
|
+
await commitInboundEventIfClaimed();
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
if (isReactionEvent || dmPolicy !== "pairing") {
|
|
2283
|
+
logVerboseMessage(`matrix: blocked ${isReactionEvent ? "reaction" : "dm"} sender ${senderId} (dmPolicy=${dmPolicy}, ${allowMatchMeta})`);
|
|
2284
|
+
await commitInboundEventIfClaimed();
|
|
2285
|
+
}
|
|
2286
|
+
return;
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
}
|
|
2290
|
+
if (isRoom && roomUserMatch && !roomUserMatch.allowed) {
|
|
2291
|
+
logVerboseMessage(`matrix: blocked sender ${senderId} (room users allowlist, ${roomMatchMeta}, ${formatAllowlistMatchMeta(roomUserMatch)})`);
|
|
2292
|
+
await commitInboundEventIfClaimed();
|
|
2293
|
+
return;
|
|
2294
|
+
}
|
|
2295
|
+
if (isRoom && groupPolicy === "allowlist" && effectiveRoomUsers.length === 0 && groupAllowConfigured && groupAllowMatch && !groupAllowMatch.allowed) {
|
|
2296
|
+
logVerboseMessage(`matrix: blocked sender ${senderId} (groupAllowFrom, ${roomMatchMeta}, ${formatAllowlistMatchMeta(groupAllowMatch)})`);
|
|
2297
|
+
await commitInboundEventIfClaimed();
|
|
2298
|
+
return;
|
|
2299
|
+
}
|
|
2300
|
+
if (isRoom) logVerboseMessage(`matrix: allow room ${roomId} (${roomMatchMeta})`);
|
|
2301
|
+
if (isReactionEvent) {
|
|
2302
|
+
await handleInboundMatrixReaction({
|
|
2303
|
+
client,
|
|
2304
|
+
core,
|
|
2305
|
+
cfg,
|
|
2306
|
+
accountId,
|
|
2307
|
+
roomId,
|
|
2308
|
+
event,
|
|
2309
|
+
senderId,
|
|
2310
|
+
senderLabel: await getSenderName(),
|
|
2311
|
+
selfUserId,
|
|
2312
|
+
isDirectMessage,
|
|
2313
|
+
logVerboseMessage
|
|
2314
|
+
});
|
|
2315
|
+
await commitInboundEventIfClaimed();
|
|
2316
|
+
return;
|
|
2317
|
+
}
|
|
2318
|
+
let pollSnapshotPromise = null;
|
|
2319
|
+
const getPollSnapshot = async () => {
|
|
2320
|
+
if (!isPollEvent) return null;
|
|
2321
|
+
pollSnapshotPromise ??= fetchMatrixPollSnapshot(client, roomId, event).catch((err) => {
|
|
2322
|
+
logVerboseMessage(`matrix: failed resolving poll snapshot room=${roomId} id=${event.event_id ?? "unknown"}: ${String(err)}`);
|
|
2323
|
+
return null;
|
|
2324
|
+
});
|
|
2325
|
+
return await pollSnapshotPromise;
|
|
2326
|
+
};
|
|
2327
|
+
const mentionPrecheckText = resolveMatrixMentionPrecheckText({
|
|
2328
|
+
eventType,
|
|
2329
|
+
content,
|
|
2330
|
+
locationText: locationPayload?.text
|
|
2331
|
+
});
|
|
2332
|
+
const contentUrl = "url" in content && typeof content.url === "string" ? content.url : void 0;
|
|
2333
|
+
const contentFile = "file" in content && content.file && typeof content.file === "object" ? content.file : void 0;
|
|
2334
|
+
const mediaUrl = contentUrl ?? contentFile?.url;
|
|
2335
|
+
const pendingHistoryText = resolveMatrixPendingHistoryText({
|
|
2336
|
+
mentionPrecheckText,
|
|
2337
|
+
content,
|
|
2338
|
+
mediaUrl
|
|
2339
|
+
});
|
|
2340
|
+
const pendingHistoryPollText = !pendingHistoryText && isPollEvent && historyLimit > 0 ? (await getPollSnapshot())?.text : "";
|
|
2341
|
+
if (!mentionPrecheckText && !mediaUrl && !isPollEvent) {
|
|
2342
|
+
await commitInboundEventIfClaimed();
|
|
2343
|
+
return;
|
|
2344
|
+
}
|
|
2345
|
+
const _messageId = event.event_id ?? "";
|
|
2346
|
+
const _threadRootId = resolveMatrixThreadRootId({
|
|
2347
|
+
event,
|
|
2348
|
+
content
|
|
2349
|
+
});
|
|
2350
|
+
const thread = resolveMatrixThreadRouting({
|
|
2351
|
+
isDirectMessage,
|
|
2352
|
+
threadReplies,
|
|
2353
|
+
dmThreadReplies,
|
|
2354
|
+
messageId: _messageId,
|
|
2355
|
+
threadRootId: _threadRootId
|
|
2356
|
+
});
|
|
2357
|
+
const { route: _route, configuredBinding: _configuredBinding, runtimeBindingId: _runtimeBindingId } = resolveMatrixInboundRoute({
|
|
2358
|
+
cfg,
|
|
2359
|
+
accountId,
|
|
2360
|
+
roomId,
|
|
2361
|
+
senderId,
|
|
2362
|
+
isDirectMessage,
|
|
2363
|
+
threadId: thread.threadId,
|
|
2364
|
+
eventTs: eventTs ?? void 0,
|
|
2365
|
+
resolveAgentRoute: core.channel.routing.resolveAgentRoute
|
|
2366
|
+
});
|
|
2367
|
+
const agentMentionRegexes = core.channel.mentions.buildMentionRegexes(cfg, _route.agentId);
|
|
2368
|
+
const selfDisplayName = content.formatted_body ? await getMemberDisplayName(roomId, selfUserId).catch(() => void 0) : void 0;
|
|
2369
|
+
const { wasMentioned, hasExplicitMention } = resolveMentions({
|
|
2370
|
+
content,
|
|
2371
|
+
userId: selfUserId,
|
|
2372
|
+
displayName: selfDisplayName,
|
|
2373
|
+
text: mentionPrecheckText,
|
|
2374
|
+
mentionRegexes: agentMentionRegexes
|
|
2375
|
+
});
|
|
2376
|
+
if (isConfiguredBotSender && allowBotsMode === "mentions" && !isDirectMessage && !wasMentioned) {
|
|
2377
|
+
logVerboseMessage(`matrix: drop configured bot sender=${senderId} (allowBots=mentions, missing mention, ${roomMatchMeta})`);
|
|
2378
|
+
await commitInboundEventIfClaimed();
|
|
2379
|
+
return;
|
|
2380
|
+
}
|
|
2381
|
+
const allowTextCommands = core.channel.commands.shouldHandleTextCommands({
|
|
2382
|
+
cfg,
|
|
2383
|
+
surface: "matrix"
|
|
2384
|
+
});
|
|
2385
|
+
const useAccessGroups = cfg.commands?.useAccessGroups !== false;
|
|
2386
|
+
const hasControlCommandInMessage = core.channel.text.hasControlCommand(mentionPrecheckText, cfg);
|
|
2387
|
+
const commandGate = resolveControlCommandGate({
|
|
2388
|
+
useAccessGroups,
|
|
2389
|
+
authorizers: commandAuthorizers,
|
|
2390
|
+
allowTextCommands,
|
|
2391
|
+
hasControlCommand: hasControlCommandInMessage
|
|
2392
|
+
});
|
|
2393
|
+
const commandAuthorized = commandGate.commandAuthorized;
|
|
2394
|
+
if (isRoom && commandGate.shouldBlock) {
|
|
2395
|
+
logInboundDrop({
|
|
2396
|
+
log: logVerboseMessage,
|
|
2397
|
+
channel: "matrix",
|
|
2398
|
+
reason: "control command (unauthorized)",
|
|
2399
|
+
target: senderId
|
|
2400
|
+
});
|
|
2401
|
+
await commitInboundEventIfClaimed();
|
|
2402
|
+
return;
|
|
2403
|
+
}
|
|
2404
|
+
const shouldRequireMention = isRoom ? roomConfig?.autoReply === true ? false : roomConfig?.autoReply === false ? true : typeof roomConfig?.requireMention === "boolean" ? roomConfig?.requireMention : true : false;
|
|
2405
|
+
const shouldBypassMention = allowTextCommands && isRoom && shouldRequireMention && !wasMentioned && !hasExplicitMention && commandAuthorized && hasControlCommandInMessage;
|
|
2406
|
+
const canDetectMention = agentMentionRegexes.length > 0 || hasExplicitMention;
|
|
2407
|
+
if (isRoom && shouldRequireMention && !wasMentioned && !shouldBypassMention) {
|
|
2408
|
+
const pendingHistoryBody = pendingHistoryText || pendingHistoryPollText;
|
|
2409
|
+
if (historyLimit > 0 && pendingHistoryBody) {
|
|
2410
|
+
const pendingEntry = {
|
|
2411
|
+
sender: senderId,
|
|
2412
|
+
body: pendingHistoryBody,
|
|
2413
|
+
timestamp: eventTs ?? void 0,
|
|
2414
|
+
messageId: _messageId
|
|
2415
|
+
};
|
|
2416
|
+
roomHistoryTracker.recordPending(roomId, pendingEntry);
|
|
2417
|
+
}
|
|
2418
|
+
logger.info("skipping room message", {
|
|
2419
|
+
roomId,
|
|
2420
|
+
reason: "no-mention"
|
|
2421
|
+
});
|
|
2422
|
+
await commitInboundEventIfClaimed();
|
|
2423
|
+
return;
|
|
2424
|
+
}
|
|
2425
|
+
if (isPollEvent) {
|
|
2426
|
+
const pollSnapshot = await getPollSnapshot();
|
|
2427
|
+
if (!pollSnapshot) return;
|
|
2428
|
+
content = {
|
|
2429
|
+
msgtype: "m.text",
|
|
2430
|
+
body: pollSnapshot.text
|
|
2431
|
+
};
|
|
2432
|
+
}
|
|
2433
|
+
let media = null;
|
|
2434
|
+
let mediaDownloadFailed = false;
|
|
2435
|
+
const finalContentUrl = "url" in content && typeof content.url === "string" ? content.url : void 0;
|
|
2436
|
+
const finalContentFile = "file" in content && content.file && typeof content.file === "object" ? content.file : void 0;
|
|
2437
|
+
const finalMediaUrl = finalContentUrl ?? finalContentFile?.url;
|
|
2438
|
+
const contentBody = typeof content.body === "string" ? content.body.trim() : "";
|
|
2439
|
+
const originalFilename = (typeof content.filename === "string" ? content.filename.trim() : "") || contentBody || void 0;
|
|
2440
|
+
const contentInfo = "info" in content && content.info && typeof content.info === "object" ? content.info : void 0;
|
|
2441
|
+
const contentType = contentInfo?.mimetype;
|
|
2442
|
+
const contentSize = typeof contentInfo?.size === "number" ? contentInfo.size : void 0;
|
|
2443
|
+
if (finalMediaUrl?.startsWith("mxc://")) try {
|
|
2444
|
+
media = await downloadMatrixMedia({
|
|
2445
|
+
client,
|
|
2446
|
+
mxcUrl: finalMediaUrl,
|
|
2447
|
+
contentType,
|
|
2448
|
+
sizeBytes: contentSize,
|
|
2449
|
+
maxBytes: mediaMaxBytes,
|
|
2450
|
+
file: finalContentFile,
|
|
2451
|
+
originalFilename
|
|
2452
|
+
});
|
|
2453
|
+
} catch (err) {
|
|
2454
|
+
mediaDownloadFailed = true;
|
|
2455
|
+
const errorText = err instanceof Error ? err.message : String(err);
|
|
2456
|
+
logVerboseMessage(`matrix: media download failed room=${roomId} id=${event.event_id ?? "unknown"} type=${content.msgtype} error=${errorText}`);
|
|
2457
|
+
logger.warn("matrix media download failed", {
|
|
2458
|
+
roomId,
|
|
2459
|
+
eventId: event.event_id,
|
|
2460
|
+
msgtype: content.msgtype,
|
|
2461
|
+
encrypted: Boolean(finalContentFile),
|
|
2462
|
+
error: errorText
|
|
2463
|
+
});
|
|
2464
|
+
}
|
|
2465
|
+
const bodyText = resolveMatrixInboundBodyText({
|
|
2466
|
+
rawBody: locationPayload?.text ?? contentBody,
|
|
2467
|
+
filename: typeof content.filename === "string" ? content.filename : void 0,
|
|
2468
|
+
mediaPlaceholder: media?.placeholder,
|
|
2469
|
+
msgtype: content.msgtype,
|
|
2470
|
+
hadMediaUrl: Boolean(finalMediaUrl),
|
|
2471
|
+
mediaDownloadFailed
|
|
2472
|
+
});
|
|
2473
|
+
if (!bodyText) {
|
|
2474
|
+
await commitInboundEventIfClaimed();
|
|
2475
|
+
return;
|
|
2476
|
+
}
|
|
2477
|
+
const senderName = await getSenderName();
|
|
2478
|
+
if (_configuredBinding) {
|
|
2479
|
+
if (!(await ensureConfiguredAcpBindingReady({
|
|
2480
|
+
cfg,
|
|
2481
|
+
configuredBinding: _configuredBinding
|
|
2482
|
+
})).ok) {
|
|
2483
|
+
logInboundDrop({
|
|
2484
|
+
log: logVerboseMessage,
|
|
2485
|
+
channel: "matrix",
|
|
2486
|
+
reason: "configured ACP binding unavailable",
|
|
2487
|
+
target: _configuredBinding.spec.conversationId
|
|
2488
|
+
});
|
|
2489
|
+
return;
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
if (_runtimeBindingId) getSessionBindingService().touch(_runtimeBindingId, eventTs ?? void 0);
|
|
2493
|
+
const preparedTrigger = isRoom && historyLimit > 0 ? roomHistoryTracker.prepareTrigger(_route.agentId, roomId, historyLimit, {
|
|
2494
|
+
sender: senderName,
|
|
2495
|
+
body: bodyText,
|
|
2496
|
+
timestamp: eventTs ?? void 0,
|
|
2497
|
+
messageId: _messageId
|
|
2498
|
+
}) : void 0;
|
|
2499
|
+
return {
|
|
2500
|
+
route: _route,
|
|
2501
|
+
roomConfig,
|
|
2502
|
+
isDirectMessage,
|
|
2503
|
+
isRoom,
|
|
2504
|
+
shouldRequireMention,
|
|
2505
|
+
wasMentioned,
|
|
2506
|
+
shouldBypassMention,
|
|
2507
|
+
canDetectMention,
|
|
2508
|
+
commandAuthorized,
|
|
2509
|
+
inboundHistory: preparedTrigger?.history,
|
|
2510
|
+
senderName,
|
|
2511
|
+
bodyText,
|
|
2512
|
+
media,
|
|
2513
|
+
locationPayload,
|
|
2514
|
+
messageId: _messageId,
|
|
2515
|
+
triggerSnapshot: preparedTrigger,
|
|
2516
|
+
threadRootId: _threadRootId,
|
|
2517
|
+
thread,
|
|
2518
|
+
effectiveGroupAllowFrom,
|
|
2519
|
+
effectiveRoomUsers
|
|
2520
|
+
};
|
|
2521
|
+
};
|
|
2522
|
+
const ingressResult = historyLimit > 0 ? await runRoomIngress(roomId, async () => {
|
|
2523
|
+
const prefix = await readIngressPrefix();
|
|
2524
|
+
if (!prefix) return;
|
|
2525
|
+
if (prefix.isDirectMessage) return { deferredPrefix: prefix };
|
|
2526
|
+
return { ingressResult: await continueIngress(prefix) };
|
|
2527
|
+
}) : void 0;
|
|
2528
|
+
const resolvedIngressResult = historyLimit > 0 ? ingressResult?.deferredPrefix ? await continueIngress(ingressResult.deferredPrefix) : ingressResult?.ingressResult : await (async () => {
|
|
2529
|
+
const prefix = await readIngressPrefix();
|
|
2530
|
+
if (!prefix) return;
|
|
2531
|
+
return await continueIngress(prefix);
|
|
2532
|
+
})();
|
|
2533
|
+
if (!resolvedIngressResult) return;
|
|
2534
|
+
const { route: _route, roomConfig, isDirectMessage, isRoom, shouldRequireMention, wasMentioned, shouldBypassMention, canDetectMention, commandAuthorized, inboundHistory, senderName, bodyText, media, locationPayload, messageId: _messageId, triggerSnapshot, threadRootId: _threadRootId, thread, effectiveGroupAllowFrom, effectiveRoomUsers } = resolvedIngressResult;
|
|
2535
|
+
const replyToEventId = resolveMatrixReplyToEventId(event.content);
|
|
2536
|
+
const threadTarget = thread.threadId;
|
|
2537
|
+
const isRoomContextSenderAllowed = (contextSenderId) => {
|
|
2538
|
+
if (!isRoom || !contextSenderId) return true;
|
|
2539
|
+
if (effectiveRoomUsers.length > 0) return resolveMatrixAllowListMatch({
|
|
2540
|
+
allowList: effectiveRoomUsers,
|
|
2541
|
+
userId: contextSenderId
|
|
2542
|
+
}).allowed;
|
|
2543
|
+
if (groupPolicy === "allowlist" && effectiveGroupAllowFrom.length > 0) return resolveMatrixAllowListMatch({
|
|
2544
|
+
allowList: effectiveGroupAllowFrom,
|
|
2545
|
+
userId: contextSenderId
|
|
2546
|
+
}).allowed;
|
|
2547
|
+
return true;
|
|
2548
|
+
};
|
|
2549
|
+
const shouldIncludeRoomContextSender = (kind, contextSenderId) => evaluateSupplementalContextVisibility({
|
|
2550
|
+
mode: contextVisibilityMode,
|
|
2551
|
+
kind,
|
|
2552
|
+
senderAllowed: isRoomContextSenderAllowed(contextSenderId)
|
|
2553
|
+
}).include;
|
|
2554
|
+
let threadContext = _threadRootId ? await resolveThreadContext({
|
|
2555
|
+
roomId,
|
|
2556
|
+
threadRootId: _threadRootId
|
|
2557
|
+
}) : void 0;
|
|
2558
|
+
let threadContextBlockedByPolicy = false;
|
|
2559
|
+
if (threadContext?.senderId && !shouldIncludeRoomContextSender("thread", threadContext.senderId)) {
|
|
2560
|
+
logVerboseMessage(`matrix: drop thread root context (mode=${contextVisibilityMode})`);
|
|
2561
|
+
threadContextBlockedByPolicy = true;
|
|
2562
|
+
threadContext = void 0;
|
|
2563
|
+
}
|
|
2564
|
+
let replyContext;
|
|
2565
|
+
if (replyToEventId && replyToEventId === _threadRootId && threadContext?.summary) replyContext = {
|
|
2566
|
+
replyToBody: threadContext.summary,
|
|
2567
|
+
replyToSender: threadContext.senderLabel,
|
|
2568
|
+
replyToSenderId: threadContext.senderId
|
|
2569
|
+
};
|
|
2570
|
+
else if (replyToEventId && replyToEventId === _threadRootId && threadContextBlockedByPolicy) replyContext = await resolveReplyContext({
|
|
2571
|
+
roomId,
|
|
2572
|
+
eventId: replyToEventId
|
|
2573
|
+
});
|
|
2574
|
+
else replyContext = replyToEventId ? await resolveReplyContext({
|
|
2575
|
+
roomId,
|
|
2576
|
+
eventId: replyToEventId
|
|
2577
|
+
}) : void 0;
|
|
2578
|
+
if (replyContext?.replyToSenderId && !shouldIncludeRoomContextSender("quote", replyContext.replyToSenderId)) {
|
|
2579
|
+
logVerboseMessage(`matrix: drop reply context (mode=${contextVisibilityMode})`);
|
|
2580
|
+
replyContext = void 0;
|
|
2581
|
+
}
|
|
2582
|
+
const roomName = (isRoom ? await getRoomInfo(roomId) : void 0)?.name;
|
|
2583
|
+
const envelopeFrom = isDirectMessage ? senderName : roomName ?? roomId;
|
|
2584
|
+
const textWithId = `${bodyText}\n[matrix event id: ${_messageId} room: ${roomId}]`;
|
|
2585
|
+
const storePath = core.channel.session.resolveStorePath(cfg.session?.store, { agentId: _route.agentId });
|
|
2586
|
+
const envelopeOptions = core.channel.reply.resolveEnvelopeFormatOptions(cfg);
|
|
2587
|
+
const previousTimestamp = core.channel.session.readSessionUpdatedAt({
|
|
2588
|
+
storePath,
|
|
2589
|
+
sessionKey: _route.sessionKey
|
|
2590
|
+
});
|
|
2591
|
+
const body = core.channel.reply.formatAgentEnvelope({
|
|
2592
|
+
channel: "Matrix",
|
|
2593
|
+
from: envelopeFrom,
|
|
2594
|
+
timestamp: eventTs ?? void 0,
|
|
2595
|
+
previousTimestamp,
|
|
2596
|
+
envelope: envelopeOptions,
|
|
2597
|
+
body: textWithId
|
|
2598
|
+
});
|
|
2599
|
+
const groupSystemPrompt = roomConfig?.systemPrompt?.trim() || void 0;
|
|
2600
|
+
const ctxPayload = core.channel.reply.finalizeInboundContext({
|
|
2601
|
+
Body: body,
|
|
2602
|
+
RawBody: bodyText,
|
|
2603
|
+
CommandBody: bodyText,
|
|
2604
|
+
InboundHistory: inboundHistory && inboundHistory.length > 0 ? inboundHistory : void 0,
|
|
2605
|
+
From: isDirectMessage ? `matrix:${senderId}` : `matrix:channel:${roomId}`,
|
|
2606
|
+
To: `room:${roomId}`,
|
|
2607
|
+
SessionKey: _route.sessionKey,
|
|
2608
|
+
AccountId: _route.accountId,
|
|
2609
|
+
ChatType: isDirectMessage ? "direct" : "channel",
|
|
2610
|
+
ConversationLabel: envelopeFrom,
|
|
2611
|
+
SenderName: senderName,
|
|
2612
|
+
SenderId: senderId,
|
|
2613
|
+
SenderUsername: senderId.split(":")[0]?.replace(/^@/, ""),
|
|
2614
|
+
GroupSubject: isRoom ? roomName ?? roomId : void 0,
|
|
2615
|
+
GroupId: isRoom ? roomId : void 0,
|
|
2616
|
+
GroupSystemPrompt: isRoom ? groupSystemPrompt : void 0,
|
|
2617
|
+
Provider: "matrix",
|
|
2618
|
+
Surface: "matrix",
|
|
2619
|
+
WasMentioned: isRoom ? wasMentioned : void 0,
|
|
2620
|
+
MessageSid: _messageId,
|
|
2621
|
+
ReplyToId: threadTarget ? void 0 : replyToEventId ?? void 0,
|
|
2622
|
+
ReplyToBody: replyContext?.replyToBody,
|
|
2623
|
+
ReplyToSender: replyContext?.replyToSender,
|
|
2624
|
+
MessageThreadId: threadTarget,
|
|
2625
|
+
ThreadStarterBody: threadContext?.threadStarterBody,
|
|
2626
|
+
Timestamp: eventTs ?? void 0,
|
|
2627
|
+
MediaPath: media?.path,
|
|
2628
|
+
MediaType: media?.contentType,
|
|
2629
|
+
MediaUrl: media?.path,
|
|
2630
|
+
...locationPayload?.context,
|
|
2631
|
+
CommandAuthorized: commandAuthorized,
|
|
2632
|
+
CommandSource: "text",
|
|
2633
|
+
OriginatingChannel: "matrix",
|
|
2634
|
+
OriginatingTo: `room:${roomId}`
|
|
2635
|
+
});
|
|
2636
|
+
await core.channel.session.recordInboundSession({
|
|
2637
|
+
storePath,
|
|
2638
|
+
sessionKey: ctxPayload.SessionKey ?? _route.sessionKey,
|
|
2639
|
+
ctx: ctxPayload,
|
|
2640
|
+
updateLastRoute: isDirectMessage ? {
|
|
2641
|
+
sessionKey: _route.mainSessionKey,
|
|
2642
|
+
channel: "matrix",
|
|
2643
|
+
to: `room:${roomId}`,
|
|
2644
|
+
accountId: _route.accountId
|
|
2645
|
+
} : void 0,
|
|
2646
|
+
onRecordError: (err) => {
|
|
2647
|
+
logger.warn("failed updating session meta", {
|
|
2648
|
+
error: String(err),
|
|
2649
|
+
storePath,
|
|
2650
|
+
sessionKey: ctxPayload.SessionKey ?? _route.sessionKey
|
|
2651
|
+
});
|
|
2652
|
+
}
|
|
2653
|
+
});
|
|
2654
|
+
logVerboseMessage(`matrix inbound: room=${roomId} from=${senderId} preview="${bodyText.slice(0, 200).replace(/\n/g, "\\n")}"`);
|
|
2655
|
+
const replyTarget = ctxPayload.To;
|
|
2656
|
+
if (!replyTarget) {
|
|
2657
|
+
runtime.error?.("matrix: missing reply target");
|
|
2658
|
+
return;
|
|
2659
|
+
}
|
|
2660
|
+
const { ackReaction, ackReactionScope: ackScope } = resolveMatrixAckReactionConfig({
|
|
2661
|
+
cfg,
|
|
2662
|
+
agentId: _route.agentId,
|
|
2663
|
+
accountId
|
|
2664
|
+
});
|
|
2665
|
+
const shouldAckReaction = () => Boolean(ackReaction && core.channel.reactions.shouldAckReaction({
|
|
2666
|
+
scope: ackScope,
|
|
2667
|
+
isDirect: isDirectMessage,
|
|
2668
|
+
isGroup: isRoom,
|
|
2669
|
+
isMentionableGroup: isRoom,
|
|
2670
|
+
requireMention: Boolean(shouldRequireMention),
|
|
2671
|
+
canDetectMention,
|
|
2672
|
+
effectiveWasMentioned: wasMentioned || shouldBypassMention,
|
|
2673
|
+
shouldBypassMention
|
|
2674
|
+
}));
|
|
2675
|
+
if (shouldAckReaction() && _messageId) reactMatrixMessage(roomId, _messageId, ackReaction, client).catch((err) => {
|
|
2676
|
+
logVerboseMessage(`matrix react failed for room ${roomId}: ${String(err)}`);
|
|
2677
|
+
});
|
|
2678
|
+
if (_messageId) sendReadReceiptMatrix(roomId, _messageId, client).catch((err) => {
|
|
2679
|
+
logVerboseMessage(`matrix: read receipt failed room=${roomId} id=${_messageId}: ${String(err)}`);
|
|
2680
|
+
});
|
|
2681
|
+
const tableMode = core.channel.text.resolveMarkdownTableMode({
|
|
2682
|
+
cfg,
|
|
2683
|
+
channel: "matrix",
|
|
2684
|
+
accountId: _route.accountId
|
|
2685
|
+
});
|
|
2686
|
+
const mediaLocalRoots = getAgentScopedMediaLocalRoots(cfg, _route.agentId);
|
|
2687
|
+
let finalReplyDeliveryFailed = false;
|
|
2688
|
+
let nonFinalReplyDeliveryFailed = false;
|
|
2689
|
+
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
2690
|
+
cfg,
|
|
2691
|
+
agentId: _route.agentId,
|
|
2692
|
+
channel: "matrix",
|
|
2693
|
+
accountId: _route.accountId
|
|
2694
|
+
});
|
|
2695
|
+
const typingCallbacks = createTypingCallbacks({
|
|
2696
|
+
start: () => sendTypingMatrix(roomId, true, void 0, client),
|
|
2697
|
+
stop: () => sendTypingMatrix(roomId, false, void 0, client),
|
|
2698
|
+
onStartError: (err) => {
|
|
2699
|
+
logTypingFailure({
|
|
2700
|
+
log: logVerboseMessage,
|
|
2701
|
+
channel: "matrix",
|
|
2702
|
+
action: "start",
|
|
2703
|
+
target: roomId,
|
|
2704
|
+
error: err
|
|
2705
|
+
});
|
|
2706
|
+
},
|
|
2707
|
+
onStopError: (err) => {
|
|
2708
|
+
logTypingFailure({
|
|
2709
|
+
log: logVerboseMessage,
|
|
2710
|
+
channel: "matrix",
|
|
2711
|
+
action: "stop",
|
|
2712
|
+
target: roomId,
|
|
2713
|
+
error: err
|
|
2714
|
+
});
|
|
2715
|
+
}
|
|
2716
|
+
});
|
|
2717
|
+
const draftStreamingEnabled = streaming === "partial";
|
|
2718
|
+
const draftReplyToId = replyToMode !== "off" && !threadTarget ? _messageId : void 0;
|
|
2719
|
+
let currentDraftReplyToId = draftReplyToId;
|
|
2720
|
+
const draftStream = draftStreamingEnabled ? createMatrixDraftStream({
|
|
2721
|
+
roomId,
|
|
2722
|
+
client,
|
|
2723
|
+
cfg,
|
|
2724
|
+
threadId: threadTarget,
|
|
2725
|
+
replyToId: draftReplyToId,
|
|
2726
|
+
preserveReplyId: replyToMode === "all",
|
|
2727
|
+
accountId: _route.accountId,
|
|
2728
|
+
log: logVerboseMessage
|
|
2729
|
+
}) : void 0;
|
|
2730
|
+
draftStreamRef = draftStream;
|
|
2731
|
+
let currentDraftMessageGeneration = 0;
|
|
2732
|
+
let currentDraftBlockOffset = 0;
|
|
2733
|
+
let latestDraftFullText = "";
|
|
2734
|
+
const pendingDraftBoundaries = [];
|
|
2735
|
+
const latestQueuedDraftBoundaryOffsets = /* @__PURE__ */ new Map();
|
|
2736
|
+
let draftConsumed = false;
|
|
2737
|
+
const getDisplayableDraftText = () => {
|
|
2738
|
+
const nextDraftBoundaryOffset = pendingDraftBoundaries.find((boundary) => boundary.messageGeneration === currentDraftMessageGeneration)?.endOffset;
|
|
2739
|
+
if (nextDraftBoundaryOffset === void 0) return latestDraftFullText.slice(currentDraftBlockOffset);
|
|
2740
|
+
return latestDraftFullText.slice(currentDraftBlockOffset, nextDraftBoundaryOffset);
|
|
2741
|
+
};
|
|
2742
|
+
const updateDraftFromLatestFullText = () => {
|
|
2743
|
+
const blockText = getDisplayableDraftText();
|
|
2744
|
+
if (blockText) draftStream?.update(blockText);
|
|
2745
|
+
};
|
|
2746
|
+
const queueDraftBlockBoundary = (payload, context) => {
|
|
2747
|
+
const payloadTextLength = payload.text?.length ?? 0;
|
|
2748
|
+
const messageGeneration = context?.assistantMessageIndex ?? currentDraftMessageGeneration;
|
|
2749
|
+
const nextDraftBoundaryOffset = (latestQueuedDraftBoundaryOffsets.get(messageGeneration) ?? 0) + payloadTextLength;
|
|
2750
|
+
latestQueuedDraftBoundaryOffsets.set(messageGeneration, nextDraftBoundaryOffset);
|
|
2751
|
+
pendingDraftBoundaries.push({
|
|
2752
|
+
messageGeneration,
|
|
2753
|
+
endOffset: nextDraftBoundaryOffset
|
|
2754
|
+
});
|
|
2755
|
+
};
|
|
2756
|
+
const advanceDraftBlockBoundary = (options) => {
|
|
2757
|
+
const completedBoundary = pendingDraftBoundaries.shift();
|
|
2758
|
+
if (completedBoundary) {
|
|
2759
|
+
if (!pendingDraftBoundaries.some((entry) => entry.messageGeneration === completedBoundary.messageGeneration)) latestQueuedDraftBoundaryOffsets.delete(completedBoundary.messageGeneration);
|
|
2760
|
+
if (completedBoundary.messageGeneration === currentDraftMessageGeneration) currentDraftBlockOffset = completedBoundary.endOffset;
|
|
2761
|
+
return;
|
|
2762
|
+
}
|
|
2763
|
+
if (options?.fallbackToLatestEnd) currentDraftBlockOffset = latestDraftFullText.length;
|
|
2764
|
+
};
|
|
2765
|
+
const resetDraftBlockOffsets = () => {
|
|
2766
|
+
currentDraftMessageGeneration += 1;
|
|
2767
|
+
currentDraftBlockOffset = 0;
|
|
2768
|
+
latestDraftFullText = "";
|
|
2769
|
+
};
|
|
2770
|
+
const { dispatcher, replyOptions, markDispatchIdle, markRunComplete } = core.channel.reply.createReplyDispatcherWithTyping({
|
|
2771
|
+
...prefixOptions,
|
|
2772
|
+
humanDelay: core.channel.reply.resolveHumanDelayConfig(cfg, _route.agentId),
|
|
2773
|
+
deliver: async (payload, info) => {
|
|
2774
|
+
if (draftStream && info.kind !== "tool" && !payload.isCompactionNotice) {
|
|
2775
|
+
const hasMedia = Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
|
|
2776
|
+
await draftStream.stop();
|
|
2777
|
+
if (draftConsumed) {
|
|
2778
|
+
await deliverMatrixReplies({
|
|
2779
|
+
cfg,
|
|
2780
|
+
replies: [payload],
|
|
2781
|
+
roomId,
|
|
2782
|
+
client,
|
|
2783
|
+
runtime,
|
|
2784
|
+
textLimit,
|
|
2785
|
+
replyToMode,
|
|
2786
|
+
threadId: threadTarget,
|
|
2787
|
+
accountId: _route.accountId,
|
|
2788
|
+
mediaLocalRoots,
|
|
2789
|
+
tableMode
|
|
2790
|
+
});
|
|
2791
|
+
return;
|
|
2792
|
+
}
|
|
2793
|
+
const draftEventId = draftStream.eventId();
|
|
2794
|
+
const payloadReplyToId = payload.replyToId?.trim() || void 0;
|
|
2795
|
+
const payloadReplyMismatch = replyToMode !== "off" && !threadTarget && payloadReplyToId !== currentDraftReplyToId;
|
|
2796
|
+
const mustDeliverFinalNormally = draftStream.mustDeliverFinalNormally();
|
|
2797
|
+
if (draftEventId && payload.text && !hasMedia && !payloadReplyMismatch && !mustDeliverFinalNormally) {
|
|
2798
|
+
if (payload.text !== draftStream.lastSentText()) try {
|
|
2799
|
+
await editMessageMatrix(roomId, draftEventId, payload.text, {
|
|
2800
|
+
client,
|
|
2801
|
+
cfg,
|
|
2802
|
+
threadId: threadTarget,
|
|
2803
|
+
accountId: _route.accountId
|
|
2804
|
+
});
|
|
2805
|
+
} catch {
|
|
2806
|
+
await client.redactEvent(roomId, draftEventId).catch(() => {});
|
|
2807
|
+
await deliverMatrixReplies({
|
|
2808
|
+
cfg,
|
|
2809
|
+
replies: [payload],
|
|
2810
|
+
roomId,
|
|
2811
|
+
client,
|
|
2812
|
+
runtime,
|
|
2813
|
+
textLimit,
|
|
2814
|
+
replyToMode,
|
|
2815
|
+
threadId: threadTarget,
|
|
2816
|
+
accountId: _route.accountId,
|
|
2817
|
+
mediaLocalRoots,
|
|
2818
|
+
tableMode
|
|
2819
|
+
});
|
|
2820
|
+
}
|
|
2821
|
+
draftConsumed = true;
|
|
2822
|
+
} else if (draftEventId && hasMedia && !payloadReplyMismatch) {
|
|
2823
|
+
let textEditOk = !mustDeliverFinalNormally;
|
|
2824
|
+
if (textEditOk && payload.text && payload.text !== draftStream.lastSentText()) textEditOk = await editMessageMatrix(roomId, draftEventId, payload.text, {
|
|
2825
|
+
client,
|
|
2826
|
+
cfg,
|
|
2827
|
+
threadId: threadTarget,
|
|
2828
|
+
accountId: _route.accountId
|
|
2829
|
+
}).then(() => true, () => false);
|
|
2830
|
+
const reusesDraftAsFinalText = Boolean(payload.text?.trim()) && textEditOk;
|
|
2831
|
+
if (!reusesDraftAsFinalText) await client.redactEvent(roomId, draftEventId).catch(() => {});
|
|
2832
|
+
await deliverMatrixReplies({
|
|
2833
|
+
cfg,
|
|
2834
|
+
replies: [{
|
|
2835
|
+
...payload,
|
|
2836
|
+
text: reusesDraftAsFinalText ? void 0 : payload.text
|
|
2837
|
+
}],
|
|
2838
|
+
roomId,
|
|
2839
|
+
client,
|
|
2840
|
+
runtime,
|
|
2841
|
+
textLimit,
|
|
2842
|
+
replyToMode,
|
|
2843
|
+
threadId: threadTarget,
|
|
2844
|
+
accountId: _route.accountId,
|
|
2845
|
+
mediaLocalRoots,
|
|
2846
|
+
tableMode
|
|
2847
|
+
});
|
|
2848
|
+
draftConsumed = true;
|
|
2849
|
+
} else {
|
|
2850
|
+
if (draftEventId && (payloadReplyMismatch || mustDeliverFinalNormally)) await client.redactEvent(roomId, draftEventId).catch(() => {});
|
|
2851
|
+
await deliverMatrixReplies({
|
|
2852
|
+
cfg,
|
|
2853
|
+
replies: [payload],
|
|
2854
|
+
roomId,
|
|
2855
|
+
client,
|
|
2856
|
+
runtime,
|
|
2857
|
+
textLimit,
|
|
2858
|
+
replyToMode,
|
|
2859
|
+
threadId: threadTarget,
|
|
2860
|
+
accountId: _route.accountId,
|
|
2861
|
+
mediaLocalRoots,
|
|
2862
|
+
tableMode
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2865
|
+
if (info.kind === "block") {
|
|
2866
|
+
draftConsumed = false;
|
|
2867
|
+
advanceDraftBlockBoundary({ fallbackToLatestEnd: true });
|
|
2868
|
+
draftStream.reset();
|
|
2869
|
+
currentDraftReplyToId = replyToMode === "all" ? draftReplyToId : void 0;
|
|
2870
|
+
updateDraftFromLatestFullText();
|
|
2871
|
+
await sendTypingMatrix(roomId, true, void 0, client).catch(() => {});
|
|
2872
|
+
}
|
|
2873
|
+
} else await deliverMatrixReplies({
|
|
2874
|
+
cfg,
|
|
2875
|
+
replies: [payload],
|
|
2876
|
+
roomId,
|
|
2877
|
+
client,
|
|
2878
|
+
runtime,
|
|
2879
|
+
textLimit,
|
|
2880
|
+
replyToMode,
|
|
2881
|
+
threadId: threadTarget,
|
|
2882
|
+
accountId: _route.accountId,
|
|
2883
|
+
mediaLocalRoots,
|
|
2884
|
+
tableMode
|
|
2885
|
+
});
|
|
2886
|
+
},
|
|
2887
|
+
onError: (err, info) => {
|
|
2888
|
+
if (info.kind === "final") finalReplyDeliveryFailed = true;
|
|
2889
|
+
else nonFinalReplyDeliveryFailed = true;
|
|
2890
|
+
if (info.kind === "block") advanceDraftBlockBoundary({ fallbackToLatestEnd: true });
|
|
2891
|
+
runtime.error?.(`matrix ${info.kind} reply failed: ${String(err)}`);
|
|
2892
|
+
},
|
|
2893
|
+
onReplyStart: typingCallbacks.onReplyStart,
|
|
2894
|
+
onIdle: typingCallbacks.onIdle
|
|
2895
|
+
});
|
|
2896
|
+
const { queuedFinal, counts } = await core.channel.reply.withReplyDispatcher({
|
|
2897
|
+
dispatcher,
|
|
2898
|
+
onSettled: () => {
|
|
2899
|
+
markDispatchIdle();
|
|
2900
|
+
},
|
|
2901
|
+
run: async () => {
|
|
2902
|
+
try {
|
|
2903
|
+
return await core.channel.reply.dispatchReplyFromConfig({
|
|
2904
|
+
ctx: ctxPayload,
|
|
2905
|
+
cfg,
|
|
2906
|
+
dispatcher,
|
|
2907
|
+
replyOptions: {
|
|
2908
|
+
...replyOptions,
|
|
2909
|
+
skillFilter: roomConfig?.skills,
|
|
2910
|
+
disableBlockStreaming: !blockStreamingEnabled,
|
|
2911
|
+
onPartialReply: draftStream ? (payload) => {
|
|
2912
|
+
latestDraftFullText = payload.text ?? "";
|
|
2913
|
+
updateDraftFromLatestFullText();
|
|
2914
|
+
} : void 0,
|
|
2915
|
+
onBlockReplyQueued: draftStream ? (payload, context) => {
|
|
2916
|
+
if (payload.isCompactionNotice === true) return;
|
|
2917
|
+
queueDraftBlockBoundary(payload, context);
|
|
2918
|
+
} : void 0,
|
|
2919
|
+
onAssistantMessageStart: draftStream ? () => {
|
|
2920
|
+
resetDraftBlockOffsets();
|
|
2921
|
+
} : void 0,
|
|
2922
|
+
onModelSelected
|
|
2923
|
+
}
|
|
2924
|
+
});
|
|
2925
|
+
} finally {
|
|
2926
|
+
markRunComplete();
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
});
|
|
2930
|
+
if (finalReplyDeliveryFailed) {
|
|
2931
|
+
logVerboseMessage(`matrix: final reply delivery failed room=${roomId} id=${_messageId}; leaving event uncommitted`);
|
|
2932
|
+
return;
|
|
2933
|
+
}
|
|
2934
|
+
if (!queuedFinal && nonFinalReplyDeliveryFailed) {
|
|
2935
|
+
logVerboseMessage(`matrix: non-final reply delivery failed room=${roomId} id=${_messageId}; leaving event uncommitted`);
|
|
2936
|
+
return;
|
|
2937
|
+
}
|
|
2938
|
+
if (isRoom && triggerSnapshot) roomHistoryTracker.consumeHistory(_route.agentId, roomId, triggerSnapshot, _messageId);
|
|
2939
|
+
if (!queuedFinal) {
|
|
2940
|
+
await commitInboundEventIfClaimed();
|
|
2941
|
+
return;
|
|
2942
|
+
}
|
|
2943
|
+
const finalCount = counts.final;
|
|
2944
|
+
logVerboseMessage(`matrix: delivered ${finalCount} reply${finalCount === 1 ? "" : "ies"} to ${replyTarget}`);
|
|
2945
|
+
await commitInboundEventIfClaimed();
|
|
2946
|
+
} catch (err) {
|
|
2947
|
+
runtime.error?.(`matrix handler failed: ${String(err)}`);
|
|
2948
|
+
} finally {
|
|
2949
|
+
if (draftStreamRef) await draftStreamRef.stop().catch(() => {});
|
|
2950
|
+
if (claimedInboundEvent && inboundDeduper && eventId) inboundDeduper.releaseEvent({
|
|
2951
|
+
roomId,
|
|
2952
|
+
eventId
|
|
2953
|
+
});
|
|
2954
|
+
}
|
|
2955
|
+
};
|
|
2956
|
+
}
|
|
2957
|
+
//#endregion
|
|
2958
|
+
//#region extensions/matrix/src/matrix/monitor/inbound-dedupe.ts
|
|
2959
|
+
const INBOUND_DEDUPE_FILENAME = "inbound-dedupe.json";
|
|
2960
|
+
const STORE_VERSION = 1;
|
|
2961
|
+
const DEFAULT_MAX_ENTRIES = 2e4;
|
|
2962
|
+
const DEFAULT_TTL_MS = 720 * 60 * 60 * 1e3;
|
|
2963
|
+
const PERSIST_DEBOUNCE_MS = 250;
|
|
2964
|
+
function normalizeEventPart(value) {
|
|
2965
|
+
return value.trim();
|
|
2966
|
+
}
|
|
2967
|
+
function buildEventKey(params) {
|
|
2968
|
+
const roomId = normalizeEventPart(params.roomId);
|
|
2969
|
+
const eventId = normalizeEventPart(params.eventId);
|
|
2970
|
+
return roomId && eventId ? `${roomId}|${eventId}` : "";
|
|
2971
|
+
}
|
|
2972
|
+
function resolveInboundDedupeStatePath(params) {
|
|
2973
|
+
return resolveMatrixStateFilePath({
|
|
2974
|
+
auth: params.auth,
|
|
2975
|
+
env: params.env,
|
|
2976
|
+
stateDir: params.stateDir,
|
|
2977
|
+
filename: INBOUND_DEDUPE_FILENAME
|
|
2978
|
+
});
|
|
2979
|
+
}
|
|
2980
|
+
function normalizeTimestamp(raw) {
|
|
2981
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return null;
|
|
2982
|
+
return Math.max(0, Math.floor(raw));
|
|
2983
|
+
}
|
|
2984
|
+
function pruneSeenEvents(params) {
|
|
2985
|
+
const { seen, ttlMs, maxEntries, nowMs } = params;
|
|
2986
|
+
if (ttlMs > 0) {
|
|
2987
|
+
const cutoff = nowMs - ttlMs;
|
|
2988
|
+
for (const [key, ts] of seen) if (ts < cutoff) seen.delete(key);
|
|
2989
|
+
}
|
|
2990
|
+
const max = Math.max(0, Math.floor(maxEntries));
|
|
2991
|
+
if (max <= 0) {
|
|
2992
|
+
seen.clear();
|
|
2993
|
+
return;
|
|
2994
|
+
}
|
|
2995
|
+
while (seen.size > max) {
|
|
2996
|
+
const oldestKey = seen.keys().next().value;
|
|
2997
|
+
if (typeof oldestKey !== "string") break;
|
|
2998
|
+
seen.delete(oldestKey);
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
function toStoredState(params) {
|
|
3002
|
+
pruneSeenEvents(params);
|
|
3003
|
+
return {
|
|
3004
|
+
version: STORE_VERSION,
|
|
3005
|
+
entries: Array.from(params.seen.entries()).map(([key, ts]) => ({
|
|
3006
|
+
key,
|
|
3007
|
+
ts
|
|
3008
|
+
}))
|
|
3009
|
+
};
|
|
3010
|
+
}
|
|
3011
|
+
async function readStoredState(storagePath) {
|
|
3012
|
+
const { value } = await readJsonFileWithFallback(storagePath, null);
|
|
3013
|
+
if (value?.version !== STORE_VERSION || !Array.isArray(value.entries)) return null;
|
|
3014
|
+
return value;
|
|
3015
|
+
}
|
|
3016
|
+
async function createMatrixInboundEventDeduper(params) {
|
|
3017
|
+
const nowMs = params.nowMs ?? (() => Date.now());
|
|
3018
|
+
const ttlMs = typeof params.ttlMs === "number" && Number.isFinite(params.ttlMs) ? Math.max(0, Math.floor(params.ttlMs)) : DEFAULT_TTL_MS;
|
|
3019
|
+
const maxEntries = typeof params.maxEntries === "number" && Number.isFinite(params.maxEntries) ? Math.max(0, Math.floor(params.maxEntries)) : DEFAULT_MAX_ENTRIES;
|
|
3020
|
+
const storagePath = params.storagePath ?? resolveInboundDedupeStatePath({
|
|
3021
|
+
auth: params.auth,
|
|
3022
|
+
env: params.env,
|
|
3023
|
+
stateDir: params.stateDir
|
|
3024
|
+
});
|
|
3025
|
+
const seen = /* @__PURE__ */ new Map();
|
|
3026
|
+
const pending = /* @__PURE__ */ new Set();
|
|
3027
|
+
const persistLock = createAsyncLock();
|
|
3028
|
+
try {
|
|
3029
|
+
const stored = await readStoredState(storagePath);
|
|
3030
|
+
for (const entry of stored?.entries ?? []) {
|
|
3031
|
+
if (!entry || typeof entry.key !== "string") continue;
|
|
3032
|
+
const key = entry.key.trim();
|
|
3033
|
+
const ts = normalizeTimestamp(entry.ts);
|
|
3034
|
+
if (!key || ts === null) continue;
|
|
3035
|
+
seen.set(key, ts);
|
|
3036
|
+
}
|
|
3037
|
+
pruneSeenEvents({
|
|
3038
|
+
seen,
|
|
3039
|
+
ttlMs,
|
|
3040
|
+
maxEntries,
|
|
3041
|
+
nowMs: nowMs()
|
|
3042
|
+
});
|
|
3043
|
+
} catch (err) {
|
|
3044
|
+
LogService.warn("MatrixInboundDedupe", "Failed loading Matrix inbound dedupe store:", err);
|
|
3045
|
+
}
|
|
3046
|
+
let dirty = false;
|
|
3047
|
+
let persistTimer = null;
|
|
3048
|
+
let persistPromise = null;
|
|
3049
|
+
const persist = async () => {
|
|
3050
|
+
dirty = false;
|
|
3051
|
+
const payload = toStoredState({
|
|
3052
|
+
seen,
|
|
3053
|
+
ttlMs,
|
|
3054
|
+
maxEntries,
|
|
3055
|
+
nowMs: nowMs()
|
|
3056
|
+
});
|
|
3057
|
+
try {
|
|
3058
|
+
await persistLock(async () => {
|
|
3059
|
+
await writeJsonFileAtomically(storagePath, payload);
|
|
3060
|
+
});
|
|
3061
|
+
} catch (err) {
|
|
3062
|
+
dirty = true;
|
|
3063
|
+
throw err;
|
|
3064
|
+
}
|
|
3065
|
+
};
|
|
3066
|
+
const flush = async () => {
|
|
3067
|
+
if (persistTimer) {
|
|
3068
|
+
clearTimeout(persistTimer);
|
|
3069
|
+
persistTimer = null;
|
|
3070
|
+
}
|
|
3071
|
+
while (dirty || persistPromise) {
|
|
3072
|
+
if (dirty && !persistPromise) persistPromise = persist().finally(() => {
|
|
3073
|
+
persistPromise = null;
|
|
3074
|
+
});
|
|
3075
|
+
await persistPromise;
|
|
3076
|
+
}
|
|
3077
|
+
};
|
|
3078
|
+
const schedulePersist = () => {
|
|
3079
|
+
dirty = true;
|
|
3080
|
+
if (persistTimer) return;
|
|
3081
|
+
persistTimer = setTimeout(() => {
|
|
3082
|
+
persistTimer = null;
|
|
3083
|
+
flush().catch((err) => {
|
|
3084
|
+
LogService.warn("MatrixInboundDedupe", "Failed persisting Matrix inbound dedupe store:", err);
|
|
3085
|
+
});
|
|
3086
|
+
}, PERSIST_DEBOUNCE_MS);
|
|
3087
|
+
persistTimer.unref?.();
|
|
3088
|
+
};
|
|
3089
|
+
return {
|
|
3090
|
+
claimEvent: ({ roomId, eventId }) => {
|
|
3091
|
+
const key = buildEventKey({
|
|
3092
|
+
roomId,
|
|
3093
|
+
eventId
|
|
3094
|
+
});
|
|
3095
|
+
if (!key) return true;
|
|
3096
|
+
pruneSeenEvents({
|
|
3097
|
+
seen,
|
|
3098
|
+
ttlMs,
|
|
3099
|
+
maxEntries,
|
|
3100
|
+
nowMs: nowMs()
|
|
3101
|
+
});
|
|
3102
|
+
if (seen.has(key) || pending.has(key)) return false;
|
|
3103
|
+
pending.add(key);
|
|
3104
|
+
return true;
|
|
3105
|
+
},
|
|
3106
|
+
commitEvent: async ({ roomId, eventId }) => {
|
|
3107
|
+
const key = buildEventKey({
|
|
3108
|
+
roomId,
|
|
3109
|
+
eventId
|
|
3110
|
+
});
|
|
3111
|
+
if (!key) return;
|
|
3112
|
+
pending.delete(key);
|
|
3113
|
+
const ts = nowMs();
|
|
3114
|
+
seen.delete(key);
|
|
3115
|
+
seen.set(key, ts);
|
|
3116
|
+
pruneSeenEvents({
|
|
3117
|
+
seen,
|
|
3118
|
+
ttlMs,
|
|
3119
|
+
maxEntries,
|
|
3120
|
+
nowMs: nowMs()
|
|
3121
|
+
});
|
|
3122
|
+
schedulePersist();
|
|
3123
|
+
},
|
|
3124
|
+
releaseEvent: ({ roomId, eventId }) => {
|
|
3125
|
+
const key = buildEventKey({
|
|
3126
|
+
roomId,
|
|
3127
|
+
eventId
|
|
3128
|
+
});
|
|
3129
|
+
if (!key) return;
|
|
3130
|
+
pending.delete(key);
|
|
3131
|
+
},
|
|
3132
|
+
flush,
|
|
3133
|
+
stop: async () => {
|
|
3134
|
+
try {
|
|
3135
|
+
await flush();
|
|
3136
|
+
} catch (err) {
|
|
3137
|
+
LogService.warn("MatrixInboundDedupe", "Failed to flush Matrix inbound dedupe store during stop():", err);
|
|
3138
|
+
}
|
|
3139
|
+
}
|
|
3140
|
+
};
|
|
3141
|
+
}
|
|
3142
|
+
//#endregion
|
|
3143
|
+
//#region extensions/matrix/src/matrix/monitor/recent-invite.ts
|
|
3144
|
+
function shouldPromoteRecentInviteRoom(params) {
|
|
3145
|
+
if (!params.roomInfo.nameResolved || !params.roomInfo.aliasesResolved) return false;
|
|
3146
|
+
const roomAliases = [params.roomInfo.canonicalAlias ?? "", ...params.roomInfo.altAliases].filter(Boolean);
|
|
3147
|
+
if ((params.roomInfo.name?.trim() ?? "") || roomAliases.length > 0) return false;
|
|
3148
|
+
return resolveMatrixRoomConfig({
|
|
3149
|
+
rooms: params.rooms,
|
|
3150
|
+
roomId: params.roomId,
|
|
3151
|
+
aliases: roomAliases
|
|
3152
|
+
}).matchSource === void 0;
|
|
3153
|
+
}
|
|
3154
|
+
//#endregion
|
|
3155
|
+
//#region extensions/matrix/src/matrix/monitor/room-info.ts
|
|
3156
|
+
const MAX_TRACKED_ROOM_INFO = 1024;
|
|
3157
|
+
const MAX_TRACKED_MEMBER_DISPLAY_NAMES = 4096;
|
|
3158
|
+
function rememberBounded(map, key, value, maxEntries) {
|
|
3159
|
+
map.set(key, value);
|
|
3160
|
+
if (map.size > maxEntries) {
|
|
3161
|
+
const oldest = map.keys().next().value;
|
|
3162
|
+
if (typeof oldest === "string") map.delete(oldest);
|
|
3163
|
+
}
|
|
3164
|
+
}
|
|
3165
|
+
function createMatrixRoomInfoResolver(client) {
|
|
3166
|
+
const roomNameCache = /* @__PURE__ */ new Map();
|
|
3167
|
+
const roomAliasCache = /* @__PURE__ */ new Map();
|
|
3168
|
+
const memberDisplayNameCache = /* @__PURE__ */ new Map();
|
|
3169
|
+
const getRoomName = async (roomId) => {
|
|
3170
|
+
if (roomNameCache.has(roomId)) return roomNameCache.get(roomId) ?? { nameResolved: false };
|
|
3171
|
+
let name;
|
|
3172
|
+
let nameResolved = false;
|
|
3173
|
+
try {
|
|
3174
|
+
const nameState = await client.getRoomStateEvent(roomId, "m.room.name", "");
|
|
3175
|
+
nameResolved = true;
|
|
3176
|
+
if (nameState && typeof nameState.name === "string") name = nameState.name;
|
|
3177
|
+
} catch (err) {
|
|
3178
|
+
if (isMatrixNotFoundError(err)) nameResolved = true;
|
|
3179
|
+
}
|
|
3180
|
+
const info = {
|
|
3181
|
+
name,
|
|
3182
|
+
nameResolved
|
|
3183
|
+
};
|
|
3184
|
+
if (nameResolved) rememberBounded(roomNameCache, roomId, info, MAX_TRACKED_ROOM_INFO);
|
|
3185
|
+
return info;
|
|
3186
|
+
};
|
|
3187
|
+
const getRoomAliases = async (roomId) => {
|
|
3188
|
+
const cached = roomAliasCache.get(roomId);
|
|
3189
|
+
if (cached) return cached;
|
|
3190
|
+
let canonicalAlias;
|
|
3191
|
+
let altAliases = [];
|
|
3192
|
+
let aliasesResolved = false;
|
|
3193
|
+
try {
|
|
3194
|
+
const aliasState = await client.getRoomStateEvent(roomId, "m.room.canonical_alias", "");
|
|
3195
|
+
aliasesResolved = true;
|
|
3196
|
+
if (aliasState && typeof aliasState.alias === "string") canonicalAlias = aliasState.alias;
|
|
3197
|
+
const rawAliases = aliasState?.alt_aliases;
|
|
3198
|
+
if (Array.isArray(rawAliases)) altAliases = rawAliases.filter((entry) => typeof entry === "string");
|
|
3199
|
+
} catch (err) {
|
|
3200
|
+
if (isMatrixNotFoundError(err)) aliasesResolved = true;
|
|
3201
|
+
}
|
|
3202
|
+
const info = {
|
|
3203
|
+
canonicalAlias,
|
|
3204
|
+
altAliases,
|
|
3205
|
+
aliasesResolved
|
|
3206
|
+
};
|
|
3207
|
+
if (aliasesResolved) rememberBounded(roomAliasCache, roomId, info, MAX_TRACKED_ROOM_INFO);
|
|
3208
|
+
return info;
|
|
3209
|
+
};
|
|
3210
|
+
const getRoomInfo = async (roomId, opts = {}) => {
|
|
3211
|
+
const { name, nameResolved } = await getRoomName(roomId);
|
|
3212
|
+
if (!opts.includeAliases) return {
|
|
3213
|
+
name,
|
|
3214
|
+
altAliases: [],
|
|
3215
|
+
nameResolved,
|
|
3216
|
+
aliasesResolved: false
|
|
3217
|
+
};
|
|
3218
|
+
return {
|
|
3219
|
+
name,
|
|
3220
|
+
nameResolved,
|
|
3221
|
+
...await getRoomAliases(roomId)
|
|
3222
|
+
};
|
|
3223
|
+
};
|
|
3224
|
+
const getMemberDisplayName = async (roomId, userId) => {
|
|
3225
|
+
const cacheKey = `${roomId}:${userId}`;
|
|
3226
|
+
if (memberDisplayNameCache.has(cacheKey)) return memberDisplayNameCache.get(cacheKey) ?? userId;
|
|
3227
|
+
const memberState = await client.getRoomStateEvent(roomId, "m.room.member", userId).catch(() => null);
|
|
3228
|
+
const displayName = memberState && typeof memberState.displayname === "string" ? memberState.displayname : userId;
|
|
3229
|
+
rememberBounded(memberDisplayNameCache, cacheKey, displayName, MAX_TRACKED_MEMBER_DISPLAY_NAMES);
|
|
3230
|
+
return displayName;
|
|
3231
|
+
};
|
|
3232
|
+
return {
|
|
3233
|
+
getRoomInfo,
|
|
3234
|
+
getMemberDisplayName
|
|
3235
|
+
};
|
|
3236
|
+
}
|
|
3237
|
+
//#endregion
|
|
3238
|
+
//#region extensions/matrix/src/matrix/monitor/startup.ts
|
|
3239
|
+
let matrixStartupMaintenanceDepsPromise;
|
|
3240
|
+
async function loadMatrixStartupMaintenanceDeps() {
|
|
3241
|
+
matrixStartupMaintenanceDepsPromise ??= Promise.all([
|
|
3242
|
+
import("./config-update-DrtP_s0Y.js"),
|
|
3243
|
+
import("./device-health-hVqelwIF.js"),
|
|
3244
|
+
import("./profile-Ccgn0oIJ.js"),
|
|
3245
|
+
import("./legacy-crypto-restore-CZycrxha.js"),
|
|
3246
|
+
import("./startup-verification-BpSIv6hV.js")
|
|
3247
|
+
]).then(([configUpdateModule, deviceHealthModule, profileModule, legacyCryptoRestoreModule, startupVerificationModule]) => ({
|
|
3248
|
+
updateMatrixAccountConfig: configUpdateModule.updateMatrixAccountConfig,
|
|
3249
|
+
summarizeMatrixDeviceHealth: deviceHealthModule.summarizeMatrixDeviceHealth,
|
|
3250
|
+
syncMatrixOwnProfile: profileModule.syncMatrixOwnProfile,
|
|
3251
|
+
maybeRestoreLegacyMatrixBackup: legacyCryptoRestoreModule.maybeRestoreLegacyMatrixBackup,
|
|
3252
|
+
ensureMatrixStartupVerification: startupVerificationModule.ensureMatrixStartupVerification
|
|
3253
|
+
}));
|
|
3254
|
+
return await matrixStartupMaintenanceDepsPromise;
|
|
3255
|
+
}
|
|
3256
|
+
async function runMatrixStartupMaintenance(params, deps) {
|
|
3257
|
+
const runtimeDeps = deps ?? await loadMatrixStartupMaintenanceDeps();
|
|
3258
|
+
try {
|
|
3259
|
+
const profileSync = await runtimeDeps.syncMatrixOwnProfile({
|
|
3260
|
+
client: params.client,
|
|
3261
|
+
userId: params.auth.userId,
|
|
3262
|
+
displayName: params.accountConfig.name,
|
|
3263
|
+
avatarUrl: params.accountConfig.avatarUrl,
|
|
3264
|
+
loadAvatarFromUrl: async (url, maxBytes) => await params.loadWebMedia(url, maxBytes)
|
|
3265
|
+
});
|
|
3266
|
+
if (profileSync.displayNameUpdated) params.logger.info(`matrix: profile display name updated for ${params.auth.userId}`);
|
|
3267
|
+
if (profileSync.avatarUpdated) params.logger.info(`matrix: profile avatar updated for ${params.auth.userId}`);
|
|
3268
|
+
if (profileSync.convertedAvatarFromHttp && profileSync.resolvedAvatarUrl && params.accountConfig.avatarUrl !== profileSync.resolvedAvatarUrl) {
|
|
3269
|
+
const latestCfg = params.loadConfig();
|
|
3270
|
+
const updatedCfg = runtimeDeps.updateMatrixAccountConfig(latestCfg, params.accountId, { avatarUrl: profileSync.resolvedAvatarUrl });
|
|
3271
|
+
await params.writeConfigFile(updatedCfg);
|
|
3272
|
+
params.logVerboseMessage(`matrix: persisted converted avatar URL for account ${params.accountId} (${profileSync.resolvedAvatarUrl})`);
|
|
3273
|
+
}
|
|
3274
|
+
} catch (err) {
|
|
3275
|
+
params.logger.warn("matrix: failed to sync profile from config", { error: String(err) });
|
|
3276
|
+
}
|
|
3277
|
+
if (!(params.auth.encryption && params.client.crypto)) return;
|
|
3278
|
+
try {
|
|
3279
|
+
const deviceHealth = runtimeDeps.summarizeMatrixDeviceHealth(await params.client.listOwnDevices());
|
|
3280
|
+
if (deviceHealth.staleOpenClawDevices.length > 0) params.logger.warn(`matrix: stale OpenClaw devices detected for ${params.auth.userId}: ${deviceHealth.staleOpenClawDevices.map((device) => device.deviceId).join(", ")}. Run 'openclaw matrix devices prune-stale --account ${params.effectiveAccountId}' to keep encrypted-room trust healthy.`);
|
|
3281
|
+
} catch (err) {
|
|
3282
|
+
params.logger.debug?.("Failed to inspect matrix device hygiene (non-fatal)", { error: String(err) });
|
|
3283
|
+
}
|
|
3284
|
+
try {
|
|
3285
|
+
const startupVerification = await runtimeDeps.ensureMatrixStartupVerification({
|
|
3286
|
+
client: params.client,
|
|
3287
|
+
auth: params.auth,
|
|
3288
|
+
accountConfig: params.accountConfig,
|
|
3289
|
+
env: params.env
|
|
3290
|
+
});
|
|
3291
|
+
if (startupVerification.kind === "verified") params.logger.info("matrix: device is verified by its owner and ready for encrypted rooms");
|
|
3292
|
+
else if (startupVerification.kind === "disabled" || startupVerification.kind === "cooldown" || startupVerification.kind === "pending" || startupVerification.kind === "request-failed") {
|
|
3293
|
+
params.logger.info("matrix: device not verified — run 'openclaw matrix verify device <key>' to enable E2EE");
|
|
3294
|
+
if (startupVerification.kind === "pending") params.logger.info("matrix: startup verification request is already pending; finish it in another Matrix client");
|
|
3295
|
+
else if (startupVerification.kind === "cooldown") params.logVerboseMessage(`matrix: skipped startup verification request due to cooldown (retryAfterMs=${startupVerification.retryAfterMs ?? 0})`);
|
|
3296
|
+
else if (startupVerification.kind === "request-failed") params.logger.debug?.("Matrix startup verification request failed (non-fatal)", { error: startupVerification.error ?? "unknown" });
|
|
3297
|
+
} else if (startupVerification.kind === "requested") params.logger.info("matrix: device not verified — requested verification in another Matrix client");
|
|
3298
|
+
} catch (err) {
|
|
3299
|
+
params.logger.debug?.("Failed to resolve matrix verification status (non-fatal)", { error: String(err) });
|
|
3300
|
+
}
|
|
3301
|
+
try {
|
|
3302
|
+
const legacyCryptoRestore = await runtimeDeps.maybeRestoreLegacyMatrixBackup({
|
|
3303
|
+
client: params.client,
|
|
3304
|
+
auth: params.auth,
|
|
3305
|
+
env: params.env
|
|
3306
|
+
});
|
|
3307
|
+
if (legacyCryptoRestore.kind === "restored") {
|
|
3308
|
+
params.logger.info(`matrix: restored ${legacyCryptoRestore.imported}/${legacyCryptoRestore.total} room key(s) from legacy encrypted-state backup`);
|
|
3309
|
+
if (legacyCryptoRestore.localOnlyKeys > 0) params.logger.warn(`matrix: ${legacyCryptoRestore.localOnlyKeys} legacy local-only room key(s) were never backed up and could not be restored automatically`);
|
|
3310
|
+
} else if (legacyCryptoRestore.kind === "failed") {
|
|
3311
|
+
params.logger.warn(`matrix: failed restoring room keys from legacy encrypted-state backup: ${legacyCryptoRestore.error}`);
|
|
3312
|
+
if (legacyCryptoRestore.localOnlyKeys > 0) params.logger.warn(`matrix: ${legacyCryptoRestore.localOnlyKeys} legacy local-only room key(s) were never backed up and may remain unavailable until manually recovered`);
|
|
3313
|
+
}
|
|
3314
|
+
} catch (err) {
|
|
3315
|
+
params.logger.warn("matrix: failed restoring legacy encrypted-state backup", { error: String(err) });
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
//#endregion
|
|
3319
|
+
//#region extensions/matrix/src/matrix/monitor/index.ts
|
|
3320
|
+
const DEFAULT_MEDIA_MAX_MB = 20;
|
|
3321
|
+
async function monitorMatrixProvider(opts = {}) {
|
|
3322
|
+
if (opts.abortSignal?.aborted) return;
|
|
3323
|
+
if (isBunRuntime()) throw new Error("Matrix provider requires Node (bun runtime not supported)");
|
|
3324
|
+
const core = getMatrixRuntime();
|
|
3325
|
+
let cfg = core.config.loadConfig();
|
|
3326
|
+
if (cfg.channels?.["matrix"]?.enabled === false) return;
|
|
3327
|
+
const logger = core.logging.getChildLogger({ module: "matrix-auto-reply" });
|
|
3328
|
+
const formatRuntimeMessage = (...args) => format(...args);
|
|
3329
|
+
const runtime = opts.runtime ?? {
|
|
3330
|
+
log: (...args) => {
|
|
3331
|
+
logger.info(formatRuntimeMessage(...args));
|
|
3332
|
+
},
|
|
3333
|
+
error: (...args) => {
|
|
3334
|
+
logger.error(formatRuntimeMessage(...args));
|
|
3335
|
+
},
|
|
3336
|
+
exit: (code) => {
|
|
3337
|
+
throw new Error(`exit ${code}`);
|
|
3338
|
+
}
|
|
3339
|
+
};
|
|
3340
|
+
const logVerboseMessage = (message) => {
|
|
3341
|
+
if (!core.logging.shouldLogVerbose()) return;
|
|
3342
|
+
logger.debug?.(message);
|
|
3343
|
+
};
|
|
3344
|
+
const effectiveAccountId = resolveMatrixAuthContext({
|
|
3345
|
+
cfg,
|
|
3346
|
+
accountId: opts.accountId
|
|
3347
|
+
}).accountId;
|
|
3348
|
+
const accountConfig = resolveMatrixAccountConfig({
|
|
3349
|
+
cfg,
|
|
3350
|
+
accountId: effectiveAccountId
|
|
3351
|
+
});
|
|
3352
|
+
const allowlistOnly = accountConfig.allowlistOnly === true;
|
|
3353
|
+
const accountAllowBots = accountConfig.allowBots;
|
|
3354
|
+
let allowFrom = (accountConfig.dm?.allowFrom ?? []).map(String);
|
|
3355
|
+
let groupAllowFrom = (accountConfig.groupAllowFrom ?? []).map(String);
|
|
3356
|
+
let roomsConfig = accountConfig.groups ?? accountConfig.rooms;
|
|
3357
|
+
let needsRoomAliasesForConfig = false;
|
|
3358
|
+
const configuredBotUserIds = resolveConfiguredMatrixBotUserIds({
|
|
3359
|
+
cfg,
|
|
3360
|
+
accountId: effectiveAccountId
|
|
3361
|
+
});
|
|
3362
|
+
({allowFrom, groupAllowFrom, roomsConfig} = await resolveMatrixMonitorConfig({
|
|
3363
|
+
cfg,
|
|
3364
|
+
accountId: effectiveAccountId,
|
|
3365
|
+
allowFrom,
|
|
3366
|
+
groupAllowFrom,
|
|
3367
|
+
roomsConfig,
|
|
3368
|
+
runtime
|
|
3369
|
+
}));
|
|
3370
|
+
needsRoomAliasesForConfig = Boolean(roomsConfig && Object.keys(roomsConfig).some((key) => key.trim().startsWith("#")));
|
|
3371
|
+
cfg = {
|
|
3372
|
+
...cfg,
|
|
3373
|
+
channels: {
|
|
3374
|
+
...cfg.channels,
|
|
3375
|
+
matrix: {
|
|
3376
|
+
...cfg.channels?.["matrix"],
|
|
3377
|
+
dm: {
|
|
3378
|
+
...cfg.channels?.["matrix"]?.dm,
|
|
3379
|
+
allowFrom
|
|
3380
|
+
},
|
|
3381
|
+
groupAllowFrom,
|
|
3382
|
+
...roomsConfig ? { groups: roomsConfig } : {}
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
};
|
|
3386
|
+
const auth = await resolveMatrixAuth({
|
|
3387
|
+
cfg,
|
|
3388
|
+
accountId: effectiveAccountId
|
|
3389
|
+
});
|
|
3390
|
+
const resolvedInitialSyncLimit = typeof opts.initialSyncLimit === "number" ? Math.max(0, Math.floor(opts.initialSyncLimit)) : auth.initialSyncLimit;
|
|
3391
|
+
const authWithLimit = resolvedInitialSyncLimit === auth.initialSyncLimit ? auth : {
|
|
3392
|
+
...auth,
|
|
3393
|
+
initialSyncLimit: resolvedInitialSyncLimit
|
|
3394
|
+
};
|
|
3395
|
+
const client = await resolveSharedMatrixClient({
|
|
3396
|
+
cfg,
|
|
3397
|
+
auth: authWithLimit,
|
|
3398
|
+
startClient: false,
|
|
3399
|
+
accountId: auth.accountId
|
|
3400
|
+
});
|
|
3401
|
+
setActiveMatrixClient(client, auth.accountId);
|
|
3402
|
+
let cleanedUp = false;
|
|
3403
|
+
let threadBindingManager = null;
|
|
3404
|
+
let execApprovalsHandler = null;
|
|
3405
|
+
const inboundDeduper = await createMatrixInboundEventDeduper({
|
|
3406
|
+
auth,
|
|
3407
|
+
env: process.env
|
|
3408
|
+
});
|
|
3409
|
+
const inFlightRoomMessages = /* @__PURE__ */ new Set();
|
|
3410
|
+
const waitForInFlightRoomMessages = async () => {
|
|
3411
|
+
while (inFlightRoomMessages.size > 0) await Promise.allSettled(Array.from(inFlightRoomMessages));
|
|
3412
|
+
};
|
|
3413
|
+
const cleanup = async () => {
|
|
3414
|
+
if (cleanedUp) return;
|
|
3415
|
+
cleanedUp = true;
|
|
3416
|
+
try {
|
|
3417
|
+
client.stopSyncWithoutPersist();
|
|
3418
|
+
await client.drainPendingDecryptions("matrix monitor shutdown");
|
|
3419
|
+
await waitForInFlightRoomMessages();
|
|
3420
|
+
await execApprovalsHandler?.stop();
|
|
3421
|
+
threadBindingManager?.stop();
|
|
3422
|
+
await inboundDeduper.stop();
|
|
3423
|
+
await releaseSharedClientInstance(client, "persist");
|
|
3424
|
+
} finally {
|
|
3425
|
+
setActiveMatrixClient(null, auth.accountId);
|
|
3426
|
+
}
|
|
3427
|
+
};
|
|
3428
|
+
const defaultGroupPolicy = resolveDefaultGroupPolicy(cfg);
|
|
3429
|
+
const { groupPolicy: groupPolicyRaw, providerMissingFallbackApplied } = resolveAllowlistProviderRuntimeGroupPolicy({
|
|
3430
|
+
providerConfigPresent: cfg.channels?.["matrix"] !== void 0,
|
|
3431
|
+
groupPolicy: accountConfig.groupPolicy,
|
|
3432
|
+
defaultGroupPolicy
|
|
3433
|
+
});
|
|
3434
|
+
warnMissingProviderGroupPolicyFallbackOnce({
|
|
3435
|
+
providerMissingFallbackApplied,
|
|
3436
|
+
providerKey: "matrix",
|
|
3437
|
+
accountId: effectiveAccountId,
|
|
3438
|
+
blockedLabel: GROUP_POLICY_BLOCKED_LABEL.room,
|
|
3439
|
+
log: (message) => logVerboseMessage(message)
|
|
3440
|
+
});
|
|
3441
|
+
const groupPolicy = allowlistOnly && groupPolicyRaw === "open" ? "allowlist" : groupPolicyRaw;
|
|
3442
|
+
const replyToMode = opts.replyToMode ?? accountConfig.replyToMode ?? "off";
|
|
3443
|
+
const threadReplies = accountConfig.threadReplies ?? "inbound";
|
|
3444
|
+
const dmThreadReplies = accountConfig.dm?.threadReplies;
|
|
3445
|
+
const threadBindingIdleTimeoutMs = resolveThreadBindingIdleTimeoutMsForChannel({
|
|
3446
|
+
cfg,
|
|
3447
|
+
channel: "matrix",
|
|
3448
|
+
accountId: effectiveAccountId
|
|
3449
|
+
});
|
|
3450
|
+
const threadBindingMaxAgeMs = resolveThreadBindingMaxAgeMsForChannel({
|
|
3451
|
+
cfg,
|
|
3452
|
+
channel: "matrix",
|
|
3453
|
+
accountId: effectiveAccountId
|
|
3454
|
+
});
|
|
3455
|
+
const dmConfig = accountConfig.dm;
|
|
3456
|
+
const dmEnabled = dmConfig?.enabled ?? true;
|
|
3457
|
+
const dmPolicyRaw = dmConfig?.policy ?? "pairing";
|
|
3458
|
+
const dmPolicy = allowlistOnly && dmPolicyRaw !== "disabled" ? "allowlist" : dmPolicyRaw;
|
|
3459
|
+
const textLimit = core.channel.text.resolveTextChunkLimit(cfg, "matrix", effectiveAccountId);
|
|
3460
|
+
const globalGroupChatHistoryLimit = cfg.messages?.groupChat?.historyLimit;
|
|
3461
|
+
const historyLimit = Math.max(0, accountConfig.historyLimit ?? globalGroupChatHistoryLimit ?? 0);
|
|
3462
|
+
const mediaMaxMb = opts.mediaMaxMb ?? accountConfig.mediaMaxMb ?? DEFAULT_MEDIA_MAX_MB;
|
|
3463
|
+
const mediaMaxBytes = Math.max(1, mediaMaxMb) * 1024 * 1024;
|
|
3464
|
+
const streaming = accountConfig.streaming === true || accountConfig.streaming === "partial" ? "partial" : "off";
|
|
3465
|
+
const blockStreamingEnabled = accountConfig.blockStreaming === true;
|
|
3466
|
+
const startupMs = Date.now();
|
|
3467
|
+
const startupGraceMs = 0;
|
|
3468
|
+
const dropPreStartupMessages = !client.hasPersistedSyncState();
|
|
3469
|
+
const { getRoomInfo, getMemberDisplayName } = createMatrixRoomInfoResolver(client);
|
|
3470
|
+
const directTracker = createDirectRoomTracker(client, {
|
|
3471
|
+
log: logVerboseMessage,
|
|
3472
|
+
canPromoteRecentInvite: async (roomId) => shouldPromoteRecentInviteRoom({
|
|
3473
|
+
roomId,
|
|
3474
|
+
roomInfo: await getRoomInfo(roomId, { includeAliases: true }),
|
|
3475
|
+
rooms: roomsConfig
|
|
3476
|
+
}),
|
|
3477
|
+
shouldKeepLocallyPromotedDirectRoom: async (roomId) => {
|
|
3478
|
+
try {
|
|
3479
|
+
const roomInfo = await getRoomInfo(roomId, { includeAliases: true });
|
|
3480
|
+
if (!roomInfo.nameResolved || !roomInfo.aliasesResolved) return;
|
|
3481
|
+
return shouldPromoteRecentInviteRoom({
|
|
3482
|
+
roomId,
|
|
3483
|
+
roomInfo,
|
|
3484
|
+
rooms: roomsConfig
|
|
3485
|
+
});
|
|
3486
|
+
} catch (err) {
|
|
3487
|
+
logVerboseMessage(`matrix: local promotion revalidation failed room=${roomId} (${String(err)})`);
|
|
3488
|
+
return;
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
});
|
|
3492
|
+
registerMatrixAutoJoin({
|
|
3493
|
+
client,
|
|
3494
|
+
accountConfig,
|
|
3495
|
+
runtime
|
|
3496
|
+
});
|
|
3497
|
+
const warnedEncryptedRooms = /* @__PURE__ */ new Set();
|
|
3498
|
+
const warnedCryptoMissingRooms = /* @__PURE__ */ new Set();
|
|
3499
|
+
const handleRoomMessage = createMatrixRoomMessageHandler({
|
|
3500
|
+
client,
|
|
3501
|
+
core,
|
|
3502
|
+
cfg,
|
|
3503
|
+
accountId: effectiveAccountId,
|
|
3504
|
+
runtime,
|
|
3505
|
+
logger,
|
|
3506
|
+
logVerboseMessage,
|
|
3507
|
+
allowFrom,
|
|
3508
|
+
groupAllowFrom,
|
|
3509
|
+
roomsConfig,
|
|
3510
|
+
accountAllowBots,
|
|
3511
|
+
configuredBotUserIds,
|
|
3512
|
+
groupPolicy,
|
|
3513
|
+
replyToMode,
|
|
3514
|
+
threadReplies,
|
|
3515
|
+
dmThreadReplies,
|
|
3516
|
+
streaming,
|
|
3517
|
+
blockStreamingEnabled,
|
|
3518
|
+
dmEnabled,
|
|
3519
|
+
dmPolicy,
|
|
3520
|
+
textLimit,
|
|
3521
|
+
mediaMaxBytes,
|
|
3522
|
+
historyLimit,
|
|
3523
|
+
startupMs,
|
|
3524
|
+
startupGraceMs,
|
|
3525
|
+
dropPreStartupMessages,
|
|
3526
|
+
inboundDeduper,
|
|
3527
|
+
directTracker,
|
|
3528
|
+
getRoomInfo,
|
|
3529
|
+
getMemberDisplayName,
|
|
3530
|
+
needsRoomAliasesForConfig
|
|
3531
|
+
});
|
|
3532
|
+
const trackRoomMessage = (roomId, event) => {
|
|
3533
|
+
const task = Promise.resolve(handleRoomMessage(roomId, event)).finally(() => {
|
|
3534
|
+
inFlightRoomMessages.delete(task);
|
|
3535
|
+
});
|
|
3536
|
+
inFlightRoomMessages.add(task);
|
|
3537
|
+
return task;
|
|
3538
|
+
};
|
|
3539
|
+
try {
|
|
3540
|
+
threadBindingManager = await createMatrixThreadBindingManager({
|
|
3541
|
+
accountId: effectiveAccountId,
|
|
3542
|
+
auth,
|
|
3543
|
+
client,
|
|
3544
|
+
env: process.env,
|
|
3545
|
+
idleTimeoutMs: threadBindingIdleTimeoutMs,
|
|
3546
|
+
maxAgeMs: threadBindingMaxAgeMs,
|
|
3547
|
+
logVerboseMessage
|
|
3548
|
+
});
|
|
3549
|
+
logVerboseMessage(`matrix: thread bindings ready account=${threadBindingManager.accountId} idleMs=${threadBindingIdleTimeoutMs} maxAgeMs=${threadBindingMaxAgeMs}`);
|
|
3550
|
+
registerMatrixMonitorEvents({
|
|
3551
|
+
cfg,
|
|
3552
|
+
client,
|
|
3553
|
+
auth,
|
|
3554
|
+
allowFrom,
|
|
3555
|
+
dmEnabled,
|
|
3556
|
+
dmPolicy,
|
|
3557
|
+
readStoreAllowFrom: async () => await core.channel.pairing.readAllowFromStore({
|
|
3558
|
+
channel: "matrix",
|
|
3559
|
+
env: process.env,
|
|
3560
|
+
accountId: effectiveAccountId
|
|
3561
|
+
}).catch(() => []),
|
|
3562
|
+
directTracker,
|
|
3563
|
+
logVerboseMessage,
|
|
3564
|
+
warnedEncryptedRooms,
|
|
3565
|
+
warnedCryptoMissingRooms,
|
|
3566
|
+
logger,
|
|
3567
|
+
formatNativeDependencyHint: core.system.formatNativeDependencyHint,
|
|
3568
|
+
onRoomMessage: trackRoomMessage
|
|
3569
|
+
});
|
|
3570
|
+
logVerboseMessage("matrix: starting client");
|
|
3571
|
+
await resolveSharedMatrixClient({
|
|
3572
|
+
cfg,
|
|
3573
|
+
auth: authWithLimit,
|
|
3574
|
+
accountId: auth.accountId
|
|
3575
|
+
});
|
|
3576
|
+
logVerboseMessage("matrix: client started");
|
|
3577
|
+
logger.info(`matrix: logged in as ${auth.userId}`);
|
|
3578
|
+
execApprovalsHandler = new MatrixExecApprovalHandler({
|
|
3579
|
+
client,
|
|
3580
|
+
accountId: effectiveAccountId,
|
|
3581
|
+
cfg
|
|
3582
|
+
});
|
|
3583
|
+
await execApprovalsHandler.start();
|
|
3584
|
+
await runMatrixStartupMaintenance({
|
|
3585
|
+
client,
|
|
3586
|
+
auth,
|
|
3587
|
+
accountId: effectiveAccountId,
|
|
3588
|
+
effectiveAccountId,
|
|
3589
|
+
accountConfig,
|
|
3590
|
+
logger,
|
|
3591
|
+
logVerboseMessage,
|
|
3592
|
+
loadConfig: () => core.config.loadConfig(),
|
|
3593
|
+
writeConfigFile: async (nextCfg) => await core.config.writeConfigFile(nextCfg),
|
|
3594
|
+
loadWebMedia: async (url, maxBytes) => await core.media.loadWebMedia(url, maxBytes),
|
|
3595
|
+
env: process.env
|
|
3596
|
+
});
|
|
3597
|
+
await new Promise((resolve) => {
|
|
3598
|
+
const stopAndResolve = async () => {
|
|
3599
|
+
try {
|
|
3600
|
+
logVerboseMessage("matrix: stopping client");
|
|
3601
|
+
await cleanup();
|
|
3602
|
+
} catch (err) {
|
|
3603
|
+
logger.warn("matrix: failed during monitor shutdown cleanup", { error: String(err) });
|
|
3604
|
+
} finally {
|
|
3605
|
+
resolve();
|
|
3606
|
+
}
|
|
3607
|
+
};
|
|
3608
|
+
if (opts.abortSignal?.aborted) {
|
|
3609
|
+
stopAndResolve();
|
|
3610
|
+
return;
|
|
3611
|
+
}
|
|
3612
|
+
opts.abortSignal?.addEventListener("abort", () => {
|
|
3613
|
+
stopAndResolve();
|
|
3614
|
+
}, { once: true });
|
|
3615
|
+
});
|
|
3616
|
+
} catch (err) {
|
|
3617
|
+
await cleanup();
|
|
3618
|
+
throw err;
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
//#endregion
|
|
3622
|
+
export { monitorMatrixProvider };
|