stableclaw 2026.5.1 → 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-BQThDjmV.js +0 -813
- package/dist/control-ui/assets/anthropic-DgG8lDlL.js +0 -37
- package/dist/control-ui/assets/azure-openai-responses-CBgrXqWI.js +0 -2
- package/dist/control-ui/assets/channel-config-extras-DNCeHtEf.js +0 -2
- package/dist/control-ui/assets/channels-Dpq8rmYk.js +0 -349
- package/dist/control-ui/assets/cron-Cc7oz4VO.js +0 -928
- package/dist/control-ui/assets/de-DU-XmSEb.js +0 -2
- package/dist/control-ui/assets/debug-CwAvIw7x.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-D-Vqc1qj.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-CUmjeRtH.js +0 -4841
- package/dist/control-ui/assets/index-DOMg2RvO.css +0 -1
- package/dist/control-ui/assets/instances-BwyJkk_4.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-C-PkU019.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-Cr7J2fxH.js +0 -8
- package/dist/control-ui/assets/openai-completions-ZUYR4bUM.js +0 -6
- package/dist/control-ui/assets/openai-responses-D5cbpSni.js +0 -2
- package/dist/control-ui/assets/openai-responses-shared-BzAz6CNs.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-_scr02pD.js +0 -236
- package/dist/control-ui/assets/skills-DCt5NidQ.js +0 -216
- package/dist/control-ui/assets/skills-shared-DJsJP4-4.js +0 -11
- 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,4173 @@
|
|
|
1
|
+
import { r as formatErrorMessage } from "./errors-Bs2h5H8p.js";
|
|
2
|
+
import { i as getChildLogger } from "./logger-MWEZrHUL.js";
|
|
3
|
+
import { n as defaultRuntime } from "./runtime-kS8e4c6-.js";
|
|
4
|
+
import { T as truncateUtf16Safe } from "./utils-CN_F_3Qg.js";
|
|
5
|
+
import "./links-D7o22Ygt.js";
|
|
6
|
+
import { n as DEFAULT_MODEL, r as DEFAULT_PROVIDER } from "./defaults-DAt--D9n.js";
|
|
7
|
+
import { f as normalizeVerboseLevel, u as normalizeThinkLevel } from "./thinking.shared-D6IkoLJU.js";
|
|
8
|
+
import { S as resolveThinkingDefault, _ as resolveHooksGmailModel, a as getModelRefStatus, d as normalizeModelSelection, h as resolveConfiguredModelRef, p as resolveAllowedModelRef, s as isCliProvider } from "./model-selection-w1RJdjfl.js";
|
|
9
|
+
import { S as isCronRunSessionKey, _ as normalizeAccountId$1, c as normalizeAgentId, h as toAgentStoreSessionKey, u as resolveAgentIdFromSessionKey } from "./session-key-Do__tq1E.js";
|
|
10
|
+
import { a as resolveAgentDir, b as matchesSkillFilter, f as resolveAgentSkillsFilter, i as resolveAgentConfig, m as resolveDefaultAgentId, p as resolveAgentWorkspaceDir, u as resolveAgentModelFallbacksOverride } from "./agent-scope-rWWUivuC.js";
|
|
11
|
+
import { a as logWarn, n as logError } from "./logger-DdGvppaE.js";
|
|
12
|
+
import { d as ensureAgentWorkspace } from "./workspace-D5P9nuJd.js";
|
|
13
|
+
import { c as loadConfig } from "./io-8kNEV_ou.js";
|
|
14
|
+
import { t as parseDurationMs } from "./parse-duration-D9q1V0xx.js";
|
|
15
|
+
import "./zod-schema.providers-whatsapp-CanJPkvb.js";
|
|
16
|
+
import "./config-D9-X_LMC.js";
|
|
17
|
+
import { d as updateSessionStore, i as loadSessionStore, t as archiveRemovedSessionTranscripts } from "./store-DJaTq2_f.js";
|
|
18
|
+
import { i as resolveMainSessionKey, n as resolveAgentMainSessionKey, t as canonicalizeMainSessionAlias } from "./main-session-BpIg43E9.js";
|
|
19
|
+
import "./sessions-xeX9HpAZ.js";
|
|
20
|
+
import { a as resolveSessionTranscriptPath, l as resolveStorePath } from "./paths-BJziUb2E.js";
|
|
21
|
+
import { o as setSessionRuntimeModel } from "./types-K4m9JoyJ.js";
|
|
22
|
+
import { r as callGateway } from "./call-D8qr1xFm.js";
|
|
23
|
+
import "./logging-4dhwGOr5.js";
|
|
24
|
+
import "./channel-plugin-common-vQdGQ26B.js";
|
|
25
|
+
import "./tokens-DoLPJv4s.js";
|
|
26
|
+
import { a as stripHeartbeatToken } from "./heartbeat-crshdWTu.js";
|
|
27
|
+
import { Fn as readLatestAssistantReply, Ft as failTaskRunByRunId, Nt as completeTaskRunByRunId, Pt as createRunningTaskRun, Zn as registerAgentRunContext, _r as normalizeOptionalAgentId, br as normalizePayloadToSystemText, dr as runWithModelFallback, fr as LiveSessionModelSwitchError, p as resolveBootstrapWarningSignaturesSeen, pr as normalizeHttpWebhookUrl, t as runEmbeddedPiAgent, tr as resolveNestedAgentLane, vr as normalizeOptionalSessionKey, vt as countActiveDescendantRuns, wt as listDescendantRunsForRequester, xr as normalizeRequiredName, yr as normalizeOptionalText } from "./pi-embedded-T_JLa73v.js";
|
|
28
|
+
import { n as enqueueCommandInLane, u as CommandLane } from "./command-queue-DGwMaQqF.js";
|
|
29
|
+
import { n as resolveAgentTimeoutMs } from "./content-blocks-Bgp1uhV7.js";
|
|
30
|
+
import { i as supportsXHighThinking } from "./thinking-CEPUwkqY.js";
|
|
31
|
+
import "./common-cywhTwSJ.js";
|
|
32
|
+
import { t as SsrFBlockedError } from "./ssrf-QGacif0_.js";
|
|
33
|
+
import { n as fetchWithSsrFGuard } from "./fetch-guard-a7JwFUYT.js";
|
|
34
|
+
import { a as mapHookExternalContentSource, i as isExternalHookSession, n as detectSuspiciousPatterns, o as resolveHookExternalContentSource, t as buildSafeExternalPrompt } from "./external-content-DTZoZlnZ.js";
|
|
35
|
+
import { t as deliverOutboundPayloads } from "./deliver-DTfKSC4Q.js";
|
|
36
|
+
import { S as requestHeartbeatNow } from "./model-runtime-BiWDK2-B.js";
|
|
37
|
+
import { r as enqueueSystemEvent } from "./system-events-Di7LVrMk.js";
|
|
38
|
+
import { p as resolveSendableOutboundReplyParts, s as hasOutboundReplyContent } from "./reply-payload-DPD7eb4b.js";
|
|
39
|
+
import { n as resolveMessageChannelSelection } from "./channel-selection-BdwVgYH4.js";
|
|
40
|
+
import { t as buildOutboundSessionContext } from "./session-context-DvXLSOcy.js";
|
|
41
|
+
import { i as resolveSessionDeliveryTarget, r as resolveOutboundTarget } from "./targets-Bf54gXl-.js";
|
|
42
|
+
import { i as parseAbsoluteTimeMs, n as resolveCronStaggerMs, r as resolveDefaultCronStaggerMs, t as normalizeCronStaggerMs } from "./stagger-C7snJAQl.js";
|
|
43
|
+
import { o as resolveFailoverReasonFromError } from "./failover-error-DRdCzmSn.js";
|
|
44
|
+
import "./web-media-CDBfT8E2.js";
|
|
45
|
+
import { i as loadModelCatalog } from "./model-catalog-sx4GaLTc.js";
|
|
46
|
+
import { t as buildChannelAccountBindings } from "./bindings-BIT9SrYa.js";
|
|
47
|
+
import { r as maybeResolveIdLikeTarget } from "./target-resolver-h0WiZJ2z.js";
|
|
48
|
+
import { C as resolveFastModeState } from "./queue-Ca31F-8a.js";
|
|
49
|
+
import "./session-utils-B6yctVT6.js";
|
|
50
|
+
import { n as sleepWithAbort } from "./backoff-Y3d8DA-r.js";
|
|
51
|
+
import { t as lookupContextTokens } from "./context-DeDQINVq.js";
|
|
52
|
+
import { r as buildWorkspaceSkillSnapshot } from "./skills-CM3EU8vl.js";
|
|
53
|
+
import { c as hasNonzeroUsage, s as deriveSessionTotalTokens } from "./chat-envelope-xeX-vE4I.js";
|
|
54
|
+
import { i as resolveModelCostConfig, t as estimateUsageCost } from "./usage-format-CXDESRWt.js";
|
|
55
|
+
import { i as cleanupArchivedSessionTranscripts } from "./session-transcript-files.fs-D2Mq9mp7.js";
|
|
56
|
+
import { n as resolveCronStyleNow } from "./current-time-bF6j_L8w.js";
|
|
57
|
+
import { o as readChannelAllowFromStoreSync } from "./pairing-store-BZr880dY.js";
|
|
58
|
+
import { n as resolveSessionAuthProfileOverride } from "./session-override-Cd7zBl0i.js";
|
|
59
|
+
import { r as resolveCronSession, t as runHeartbeatOnce } from "./heartbeat-runner-N3rkIDfo.js";
|
|
60
|
+
import { n as resolveCronStorePath, r as saveCronStore, t as loadCronStore } from "./store-Ctwo8nHJ.js";
|
|
61
|
+
import { r as normalizeWhatsAppTarget } from "./whatsapp-targets-DjBJudn8.js";
|
|
62
|
+
import "./whatsapp-DnsDZ_TC.js";
|
|
63
|
+
import "./whatsapp-heartbeat-Bgu6Y7Re.js";
|
|
64
|
+
import { n as resolveAgentOutboundIdentity } from "./identity-Rl0zYy8N.js";
|
|
65
|
+
import { _ as getSkillsSnapshotVersion, t as getRemoteSkillEligibility } from "./skills-remote-D0fT8yCa.js";
|
|
66
|
+
import { i as getCliSessionId, o as setCliSessionId, t as runCliAgent } from "./cli-runner-CNdeXILj.js";
|
|
67
|
+
import { t as createOutboundSendDeps } from "./outbound-send-deps-BK8EJyax.js";
|
|
68
|
+
import "./outbound-media-DPt_PPtU.js";
|
|
69
|
+
import { o as resolveWhatsAppAccount } from "./whatsapp-surface-B703CwBf.js";
|
|
70
|
+
import "./whatsapp-shared-Mr2ko9yj.js";
|
|
71
|
+
import { n as computeNextRunAtMs, r as computePreviousRunAtMs, t as coerceFiniteScheduleNumber } from "./schedule-DfdPkX_R.js";
|
|
72
|
+
import { S as resolveWaWebAuthDir } from "./runtime-whatsapp-boundary-DLjcLkDC.js";
|
|
73
|
+
import { a as resolveCronRunLogPruneOptions, i as resolveCronRunLogPath, t as appendCronRunLog } from "./run-log-ORr-RiRk.js";
|
|
74
|
+
import fsSync from "node:fs";
|
|
75
|
+
import crypto from "node:crypto";
|
|
76
|
+
//#region src/channel-web.ts
|
|
77
|
+
var LazyWhatsAppAuthDir = class {
|
|
78
|
+
#value = null;
|
|
79
|
+
#read() {
|
|
80
|
+
this.#value ??= resolveWaWebAuthDir();
|
|
81
|
+
return this.#value;
|
|
82
|
+
}
|
|
83
|
+
toString() {
|
|
84
|
+
return this.#read();
|
|
85
|
+
}
|
|
86
|
+
valueOf() {
|
|
87
|
+
return this.#read();
|
|
88
|
+
}
|
|
89
|
+
[Symbol.toPrimitive]() {
|
|
90
|
+
return this.#read();
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
new LazyWhatsAppAuthDir();
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/cron/isolated-agent/delivery-target.ts
|
|
96
|
+
async function resolveDeliveryTarget(cfg, agentId, jobPayload) {
|
|
97
|
+
const requestedChannel = typeof jobPayload.channel === "string" ? jobPayload.channel : "last";
|
|
98
|
+
const explicitTo = typeof jobPayload.to === "string" ? jobPayload.to : void 0;
|
|
99
|
+
const allowMismatchedLastTo = requestedChannel === "last";
|
|
100
|
+
const sessionCfg = cfg.session;
|
|
101
|
+
const mainSessionKey = resolveAgentMainSessionKey({
|
|
102
|
+
cfg,
|
|
103
|
+
agentId
|
|
104
|
+
});
|
|
105
|
+
const store = loadSessionStore(resolveStorePath(sessionCfg?.store, { agentId }));
|
|
106
|
+
const threadSessionKey = jobPayload.sessionKey?.trim();
|
|
107
|
+
const main = (threadSessionKey ? store[threadSessionKey] : void 0) ?? store[mainSessionKey];
|
|
108
|
+
const preliminary = resolveSessionDeliveryTarget({
|
|
109
|
+
entry: main,
|
|
110
|
+
requestedChannel,
|
|
111
|
+
explicitTo,
|
|
112
|
+
explicitThreadId: jobPayload.threadId,
|
|
113
|
+
allowMismatchedLastTo
|
|
114
|
+
});
|
|
115
|
+
let fallbackChannel;
|
|
116
|
+
let channelResolutionError;
|
|
117
|
+
if (!preliminary.channel) if (preliminary.lastChannel) fallbackChannel = preliminary.lastChannel;
|
|
118
|
+
else try {
|
|
119
|
+
fallbackChannel = (await resolveMessageChannelSelection({ cfg })).channel;
|
|
120
|
+
} catch (err) {
|
|
121
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
122
|
+
channelResolutionError = /* @__PURE__ */ new Error(`${detail} Set delivery.channel explicitly or use a main session with a previous channel.`);
|
|
123
|
+
}
|
|
124
|
+
const resolved = fallbackChannel ? resolveSessionDeliveryTarget({
|
|
125
|
+
entry: main,
|
|
126
|
+
requestedChannel,
|
|
127
|
+
explicitTo,
|
|
128
|
+
explicitThreadId: jobPayload.threadId,
|
|
129
|
+
fallbackChannel,
|
|
130
|
+
allowMismatchedLastTo,
|
|
131
|
+
mode: preliminary.mode
|
|
132
|
+
}) : preliminary;
|
|
133
|
+
const channel = resolved.channel ?? fallbackChannel;
|
|
134
|
+
const mode = resolved.mode;
|
|
135
|
+
let toCandidate = resolved.to;
|
|
136
|
+
let accountId = (typeof jobPayload.accountId === "string" && jobPayload.accountId.trim() ? jobPayload.accountId.trim() : void 0) ?? resolved.accountId;
|
|
137
|
+
if (!accountId && channel) {
|
|
138
|
+
const boundAccounts = buildChannelAccountBindings(cfg).get(channel)?.get(normalizeAgentId(agentId));
|
|
139
|
+
if (boundAccounts && boundAccounts.length > 0) accountId = boundAccounts[0];
|
|
140
|
+
}
|
|
141
|
+
if (jobPayload.accountId) accountId = jobPayload.accountId;
|
|
142
|
+
const threadId = resolved.threadId && (resolved.threadIdExplicit || resolved.to && resolved.to === resolved.lastTo) ? resolved.threadId : void 0;
|
|
143
|
+
if (!channel) return {
|
|
144
|
+
ok: false,
|
|
145
|
+
channel: void 0,
|
|
146
|
+
to: void 0,
|
|
147
|
+
accountId,
|
|
148
|
+
threadId,
|
|
149
|
+
mode,
|
|
150
|
+
error: channelResolutionError ?? /* @__PURE__ */ new Error("Channel is required when delivery.channel=last has no previous channel.")
|
|
151
|
+
};
|
|
152
|
+
let allowFromOverride;
|
|
153
|
+
if (channel === "whatsapp") {
|
|
154
|
+
const resolvedAccountId = normalizeAccountId$1(accountId);
|
|
155
|
+
const configuredAllowFrom = (resolveWhatsAppAccount({
|
|
156
|
+
cfg,
|
|
157
|
+
accountId: resolvedAccountId
|
|
158
|
+
}).allowFrom ?? []).map((entry) => String(entry).trim()).filter((entry) => entry && entry !== "*").map((entry) => normalizeWhatsAppTarget(entry)).filter((entry) => Boolean(entry));
|
|
159
|
+
const storeAllowFrom = readChannelAllowFromStoreSync("whatsapp", process.env, resolvedAccountId).map((entry) => normalizeWhatsAppTarget(entry)).filter((entry) => Boolean(entry));
|
|
160
|
+
allowFromOverride = [...new Set([...configuredAllowFrom, ...storeAllowFrom])];
|
|
161
|
+
if (toCandidate && mode === "implicit" && allowFromOverride.length > 0) {
|
|
162
|
+
const normalizedCurrentTarget = normalizeWhatsAppTarget(toCandidate);
|
|
163
|
+
if (!normalizedCurrentTarget || !allowFromOverride.includes(normalizedCurrentTarget)) toCandidate = allowFromOverride[0];
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
const docked = resolveOutboundTarget({
|
|
167
|
+
channel,
|
|
168
|
+
to: toCandidate,
|
|
169
|
+
cfg,
|
|
170
|
+
accountId,
|
|
171
|
+
mode,
|
|
172
|
+
allowFrom: allowFromOverride
|
|
173
|
+
});
|
|
174
|
+
if (!docked.ok) return {
|
|
175
|
+
ok: false,
|
|
176
|
+
channel,
|
|
177
|
+
to: void 0,
|
|
178
|
+
accountId,
|
|
179
|
+
threadId,
|
|
180
|
+
mode,
|
|
181
|
+
error: docked.error
|
|
182
|
+
};
|
|
183
|
+
return {
|
|
184
|
+
ok: true,
|
|
185
|
+
channel,
|
|
186
|
+
to: (await maybeResolveIdLikeTarget({
|
|
187
|
+
cfg,
|
|
188
|
+
channel,
|
|
189
|
+
input: docked.to,
|
|
190
|
+
accountId
|
|
191
|
+
}))?.to ?? docked.to,
|
|
192
|
+
accountId,
|
|
193
|
+
threadId,
|
|
194
|
+
mode
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/cron/delivery.ts
|
|
199
|
+
function normalizeChannel(value) {
|
|
200
|
+
if (typeof value !== "string") return;
|
|
201
|
+
const trimmed = value.trim().toLowerCase();
|
|
202
|
+
if (!trimmed) return;
|
|
203
|
+
return trimmed;
|
|
204
|
+
}
|
|
205
|
+
function normalizeTo$1(value) {
|
|
206
|
+
if (typeof value !== "string") return;
|
|
207
|
+
const trimmed = value.trim();
|
|
208
|
+
return trimmed ? trimmed : void 0;
|
|
209
|
+
}
|
|
210
|
+
function normalizeAccountId(value) {
|
|
211
|
+
if (typeof value !== "string") return;
|
|
212
|
+
const trimmed = value.trim();
|
|
213
|
+
return trimmed ? trimmed : void 0;
|
|
214
|
+
}
|
|
215
|
+
function normalizeThreadId(value) {
|
|
216
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
217
|
+
if (typeof value !== "string") return;
|
|
218
|
+
const trimmed = value.trim();
|
|
219
|
+
return trimmed ? trimmed : void 0;
|
|
220
|
+
}
|
|
221
|
+
function resolveCronDeliveryPlan(job) {
|
|
222
|
+
const delivery = job.delivery;
|
|
223
|
+
const hasDelivery = delivery && typeof delivery === "object";
|
|
224
|
+
const rawMode = hasDelivery ? delivery.mode : void 0;
|
|
225
|
+
const normalizedMode = typeof rawMode === "string" ? rawMode.trim().toLowerCase() : rawMode;
|
|
226
|
+
const mode = normalizedMode === "announce" ? "announce" : normalizedMode === "webhook" ? "webhook" : normalizedMode === "none" ? "none" : normalizedMode === "deliver" ? "announce" : void 0;
|
|
227
|
+
const deliveryChannel = normalizeChannel(delivery?.channel);
|
|
228
|
+
const deliveryTo = normalizeTo$1(delivery?.to);
|
|
229
|
+
const deliveryThreadId = normalizeThreadId(delivery?.threadId);
|
|
230
|
+
const channel = deliveryChannel ?? "last";
|
|
231
|
+
const to = deliveryTo;
|
|
232
|
+
const deliveryAccountId = normalizeAccountId(delivery?.accountId);
|
|
233
|
+
if (hasDelivery) {
|
|
234
|
+
const resolvedMode = mode ?? "announce";
|
|
235
|
+
return {
|
|
236
|
+
mode: resolvedMode,
|
|
237
|
+
channel: resolvedMode === "announce" ? channel : void 0,
|
|
238
|
+
to,
|
|
239
|
+
threadId: resolvedMode === "announce" ? deliveryThreadId : void 0,
|
|
240
|
+
accountId: deliveryAccountId,
|
|
241
|
+
source: "delivery",
|
|
242
|
+
requested: resolvedMode === "announce"
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
const resolvedMode = job.payload.kind === "agentTurn" && (job.sessionTarget === "isolated" || job.sessionTarget === "current" || job.sessionTarget.startsWith("session:")) ? "announce" : "none";
|
|
246
|
+
return {
|
|
247
|
+
mode: resolvedMode,
|
|
248
|
+
channel: resolvedMode === "announce" ? "last" : void 0,
|
|
249
|
+
to: void 0,
|
|
250
|
+
threadId: void 0,
|
|
251
|
+
source: "delivery",
|
|
252
|
+
requested: resolvedMode === "announce"
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function normalizeFailureMode(value) {
|
|
256
|
+
if (typeof value !== "string") return;
|
|
257
|
+
const trimmed = value.trim().toLowerCase();
|
|
258
|
+
if (trimmed === "announce" || trimmed === "webhook") return trimmed;
|
|
259
|
+
}
|
|
260
|
+
function resolveFailureDestination(job, globalConfig) {
|
|
261
|
+
const delivery = job.delivery;
|
|
262
|
+
const jobFailureDest = delivery?.failureDestination;
|
|
263
|
+
const hasJobFailureDest = jobFailureDest && typeof jobFailureDest === "object";
|
|
264
|
+
let channel;
|
|
265
|
+
let to;
|
|
266
|
+
let accountId;
|
|
267
|
+
let mode;
|
|
268
|
+
if (globalConfig) {
|
|
269
|
+
channel = normalizeChannel(globalConfig.channel);
|
|
270
|
+
to = normalizeTo$1(globalConfig.to);
|
|
271
|
+
accountId = normalizeAccountId(globalConfig.accountId);
|
|
272
|
+
mode = normalizeFailureMode(globalConfig.mode);
|
|
273
|
+
}
|
|
274
|
+
if (hasJobFailureDest) {
|
|
275
|
+
const jobChannel = normalizeChannel(jobFailureDest.channel);
|
|
276
|
+
const jobTo = normalizeTo$1(jobFailureDest.to);
|
|
277
|
+
const jobAccountId = normalizeAccountId(jobFailureDest.accountId);
|
|
278
|
+
const jobMode = normalizeFailureMode(jobFailureDest.mode);
|
|
279
|
+
const hasJobChannelField = "channel" in jobFailureDest;
|
|
280
|
+
const hasJobToField = "to" in jobFailureDest;
|
|
281
|
+
const hasJobAccountIdField = "accountId" in jobFailureDest;
|
|
282
|
+
const jobToExplicitValue = hasJobToField && jobTo !== void 0;
|
|
283
|
+
if (hasJobChannelField) channel = jobChannel;
|
|
284
|
+
if (hasJobToField) to = jobTo;
|
|
285
|
+
if (hasJobAccountIdField) accountId = jobAccountId;
|
|
286
|
+
if (jobMode !== void 0) {
|
|
287
|
+
const globalMode = globalConfig?.mode ?? "announce";
|
|
288
|
+
if (!jobToExplicitValue && globalMode !== jobMode) to = void 0;
|
|
289
|
+
mode = jobMode;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (!channel && !to && !accountId && !mode) return null;
|
|
293
|
+
const resolvedMode = mode ?? "announce";
|
|
294
|
+
if (resolvedMode === "webhook" && !to) return null;
|
|
295
|
+
const result = {
|
|
296
|
+
mode: resolvedMode,
|
|
297
|
+
channel: resolvedMode === "announce" ? channel ?? "last" : void 0,
|
|
298
|
+
to,
|
|
299
|
+
accountId
|
|
300
|
+
};
|
|
301
|
+
if (delivery && isSameDeliveryTarget(delivery, result)) return null;
|
|
302
|
+
return result;
|
|
303
|
+
}
|
|
304
|
+
function isSameDeliveryTarget(delivery, failurePlan) {
|
|
305
|
+
const primaryMode = delivery.mode ?? "announce";
|
|
306
|
+
if (primaryMode === "none") return false;
|
|
307
|
+
const primaryChannel = delivery.channel;
|
|
308
|
+
const primaryTo = delivery.to;
|
|
309
|
+
const primaryAccountId = delivery.accountId;
|
|
310
|
+
if (failurePlan.mode === "webhook") return primaryMode === "webhook" && primaryTo === failurePlan.to;
|
|
311
|
+
const primaryChannelNormalized = primaryChannel ?? "last";
|
|
312
|
+
return (failurePlan.channel ?? "last") === primaryChannelNormalized && failurePlan.to === primaryTo && failurePlan.accountId === primaryAccountId;
|
|
313
|
+
}
|
|
314
|
+
const FAILURE_NOTIFICATION_TIMEOUT_MS = 3e4;
|
|
315
|
+
const cronDeliveryLogger = getChildLogger({ subsystem: "cron-delivery" });
|
|
316
|
+
async function sendFailureNotificationAnnounce(deps, cfg, agentId, jobId, target, message) {
|
|
317
|
+
const resolvedTarget = await resolveDeliveryTarget(cfg, agentId, {
|
|
318
|
+
channel: target.channel,
|
|
319
|
+
to: target.to,
|
|
320
|
+
accountId: target.accountId
|
|
321
|
+
});
|
|
322
|
+
if (!resolvedTarget.ok) {
|
|
323
|
+
cronDeliveryLogger.warn({ error: resolvedTarget.error.message }, "cron: failed to resolve failure destination target");
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
const identity = resolveAgentOutboundIdentity(cfg, agentId);
|
|
327
|
+
const session = buildOutboundSessionContext({
|
|
328
|
+
cfg,
|
|
329
|
+
agentId,
|
|
330
|
+
sessionKey: `cron:${jobId}:failure`
|
|
331
|
+
});
|
|
332
|
+
const abortController = new AbortController();
|
|
333
|
+
const timeout = setTimeout(() => {
|
|
334
|
+
abortController.abort();
|
|
335
|
+
}, FAILURE_NOTIFICATION_TIMEOUT_MS);
|
|
336
|
+
try {
|
|
337
|
+
await deliverOutboundPayloads({
|
|
338
|
+
cfg,
|
|
339
|
+
channel: resolvedTarget.channel,
|
|
340
|
+
to: resolvedTarget.to,
|
|
341
|
+
accountId: resolvedTarget.accountId,
|
|
342
|
+
threadId: resolvedTarget.threadId,
|
|
343
|
+
payloads: [{ text: message }],
|
|
344
|
+
session,
|
|
345
|
+
identity,
|
|
346
|
+
bestEffort: false,
|
|
347
|
+
deps: createOutboundSendDeps(deps),
|
|
348
|
+
abortSignal: abortController.signal
|
|
349
|
+
});
|
|
350
|
+
} catch (err) {
|
|
351
|
+
cronDeliveryLogger.warn({
|
|
352
|
+
err: formatErrorMessage(err),
|
|
353
|
+
channel: resolvedTarget.channel,
|
|
354
|
+
to: resolvedTarget.to
|
|
355
|
+
}, "cron: failure destination announce failed");
|
|
356
|
+
} finally {
|
|
357
|
+
clearTimeout(timeout);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
//#endregion
|
|
361
|
+
//#region src/cron/heartbeat-policy.ts
|
|
362
|
+
function shouldSkipHeartbeatOnlyDelivery(payloads, ackMaxChars) {
|
|
363
|
+
if (payloads.length === 0) return true;
|
|
364
|
+
if (payloads.some((payload) => resolveSendableOutboundReplyParts(payload).hasMedia)) return false;
|
|
365
|
+
return payloads.some((payload) => {
|
|
366
|
+
return stripHeartbeatToken(payload.text, {
|
|
367
|
+
mode: "heartbeat",
|
|
368
|
+
maxAckChars: ackMaxChars
|
|
369
|
+
}).shouldSkip;
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/cron/isolated-agent/helpers.ts
|
|
374
|
+
function pickSummaryFromOutput(text) {
|
|
375
|
+
const clean = (text ?? "").trim();
|
|
376
|
+
if (!clean) return;
|
|
377
|
+
const limit = 2e3;
|
|
378
|
+
return clean.length > limit ? `${truncateUtf16Safe(clean, limit)}…` : clean;
|
|
379
|
+
}
|
|
380
|
+
function pickSummaryFromPayloads(payloads) {
|
|
381
|
+
for (let i = payloads.length - 1; i >= 0; i--) {
|
|
382
|
+
if (payloads[i]?.isError) continue;
|
|
383
|
+
const summary = pickSummaryFromOutput(payloads[i]?.text);
|
|
384
|
+
if (summary) return summary;
|
|
385
|
+
}
|
|
386
|
+
for (let i = payloads.length - 1; i >= 0; i--) {
|
|
387
|
+
const summary = pickSummaryFromOutput(payloads[i]?.text);
|
|
388
|
+
if (summary) return summary;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function pickLastNonEmptyTextFromPayloads(payloads) {
|
|
392
|
+
for (let i = payloads.length - 1; i >= 0; i--) {
|
|
393
|
+
if (payloads[i]?.isError) continue;
|
|
394
|
+
const clean = (payloads[i]?.text ?? "").trim();
|
|
395
|
+
if (clean) return clean;
|
|
396
|
+
}
|
|
397
|
+
for (let i = payloads.length - 1; i >= 0; i--) {
|
|
398
|
+
const clean = (payloads[i]?.text ?? "").trim();
|
|
399
|
+
if (clean) return clean;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
function isDeliverablePayload(payload) {
|
|
403
|
+
if (!payload) return false;
|
|
404
|
+
const hasInteractive = (payload.interactive?.blocks?.length ?? 0) > 0;
|
|
405
|
+
const hasChannelData = Object.keys(payload.channelData ?? {}).length > 0;
|
|
406
|
+
return hasOutboundReplyContent(payload, { trimText: true }) || hasInteractive || hasChannelData;
|
|
407
|
+
}
|
|
408
|
+
function pickLastDeliverablePayload(payloads) {
|
|
409
|
+
for (let i = payloads.length - 1; i >= 0; i--) {
|
|
410
|
+
if (payloads[i]?.isError) continue;
|
|
411
|
+
if (isDeliverablePayload(payloads[i])) return payloads[i];
|
|
412
|
+
}
|
|
413
|
+
for (let i = payloads.length - 1; i >= 0; i--) if (isDeliverablePayload(payloads[i])) return payloads[i];
|
|
414
|
+
}
|
|
415
|
+
function pickDeliverablePayloads(payloads) {
|
|
416
|
+
const successfulDeliverablePayloads = payloads.filter((payload) => payload != null && payload.isError !== true && isDeliverablePayload(payload));
|
|
417
|
+
if (successfulDeliverablePayloads.length > 0) return successfulDeliverablePayloads;
|
|
418
|
+
const lastDeliverablePayload = pickLastDeliverablePayload(payloads);
|
|
419
|
+
return lastDeliverablePayload ? [lastDeliverablePayload] : [];
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Check if delivery should be skipped because the agent signaled no user-visible update.
|
|
423
|
+
* Returns true when any payload is a heartbeat ack token and no payload contains media.
|
|
424
|
+
*/
|
|
425
|
+
function isHeartbeatOnlyResponse(payloads, ackMaxChars) {
|
|
426
|
+
return shouldSkipHeartbeatOnlyDelivery(payloads, ackMaxChars);
|
|
427
|
+
}
|
|
428
|
+
function resolveHeartbeatAckMaxChars(agentCfg) {
|
|
429
|
+
const raw = agentCfg?.heartbeat?.ackMaxChars ?? 300;
|
|
430
|
+
return Math.max(0, raw);
|
|
431
|
+
}
|
|
432
|
+
function resolveCronPayloadOutcome(params) {
|
|
433
|
+
const firstText = params.payloads[0]?.text ?? "";
|
|
434
|
+
const summary = pickSummaryFromPayloads(params.payloads) ?? pickSummaryFromOutput(firstText);
|
|
435
|
+
const outputText = pickLastNonEmptyTextFromPayloads(params.payloads);
|
|
436
|
+
const synthesizedText = outputText?.trim() || summary?.trim() || void 0;
|
|
437
|
+
const deliveryPayload = pickLastDeliverablePayload(params.payloads);
|
|
438
|
+
const selectedDeliveryPayloads = pickDeliverablePayloads(params.payloads);
|
|
439
|
+
const resolvedDeliveryPayloads = selectedDeliveryPayloads.length > 0 ? selectedDeliveryPayloads : synthesizedText ? [{ text: synthesizedText }] : [];
|
|
440
|
+
const deliveryPayloadHasStructuredContent = deliveryPayload?.mediaUrl !== void 0 || (deliveryPayload?.mediaUrls?.length ?? 0) > 0 || (deliveryPayload?.interactive?.blocks?.length ?? 0) > 0 || Object.keys(deliveryPayload?.channelData ?? {}).length > 0;
|
|
441
|
+
const hasErrorPayload = params.payloads.some((payload) => payload?.isError === true);
|
|
442
|
+
const lastErrorPayloadIndex = params.payloads.findLastIndex((payload) => payload?.isError === true);
|
|
443
|
+
const hasSuccessfulPayloadAfterLastError = !params.runLevelError && lastErrorPayloadIndex >= 0 && params.payloads.slice(lastErrorPayloadIndex + 1).some((payload) => payload?.isError !== true && Boolean(payload?.text?.trim()));
|
|
444
|
+
const hasFatalErrorPayload = hasErrorPayload && !hasSuccessfulPayloadAfterLastError;
|
|
445
|
+
const lastErrorPayloadText = [...params.payloads].toReversed().find((payload) => payload?.isError === true && Boolean(payload?.text?.trim()))?.text?.trim();
|
|
446
|
+
return {
|
|
447
|
+
summary,
|
|
448
|
+
outputText,
|
|
449
|
+
synthesizedText,
|
|
450
|
+
deliveryPayload,
|
|
451
|
+
deliveryPayloads: resolvedDeliveryPayloads,
|
|
452
|
+
deliveryPayloadHasStructuredContent,
|
|
453
|
+
hasFatalErrorPayload,
|
|
454
|
+
embeddedRunError: hasFatalErrorPayload ? lastErrorPayloadText ?? "cron isolated run returned an error payload" : void 0
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
//#endregion
|
|
458
|
+
//#region src/cron/isolated-agent/subagent-followup.ts
|
|
459
|
+
function resolveCronSubagentTimings() {
|
|
460
|
+
const fastTestMode = process.env.OPENCLAW_TEST_FAST === "1";
|
|
461
|
+
return {
|
|
462
|
+
waitMinMs: fastTestMode ? 10 : 3e4,
|
|
463
|
+
finalReplyGraceMs: fastTestMode ? 50 : 5e3,
|
|
464
|
+
gracePollMs: fastTestMode ? 8 : 200
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
const SUBAGENT_FOLLOWUP_HINTS = [
|
|
468
|
+
"subagent spawned",
|
|
469
|
+
"spawned a subagent",
|
|
470
|
+
"auto-announce when done",
|
|
471
|
+
"both subagents are running",
|
|
472
|
+
"wait for them to report back"
|
|
473
|
+
];
|
|
474
|
+
const INTERIM_CRON_HINTS = [
|
|
475
|
+
"on it",
|
|
476
|
+
"pulling everything together",
|
|
477
|
+
"give me a few",
|
|
478
|
+
"give me a few min",
|
|
479
|
+
"few minutes",
|
|
480
|
+
"let me compile",
|
|
481
|
+
"i'll gather",
|
|
482
|
+
"i will gather",
|
|
483
|
+
"working on it",
|
|
484
|
+
"retrying now",
|
|
485
|
+
"should be about",
|
|
486
|
+
"should have your summary",
|
|
487
|
+
"it'll auto-announce when done",
|
|
488
|
+
"it will auto-announce when done",
|
|
489
|
+
...SUBAGENT_FOLLOWUP_HINTS
|
|
490
|
+
];
|
|
491
|
+
function normalizeHintText(value) {
|
|
492
|
+
return value.trim().toLowerCase().replace(/\s+/g, " ");
|
|
493
|
+
}
|
|
494
|
+
function isLikelyInterimCronMessage(value) {
|
|
495
|
+
const normalized = normalizeHintText(value);
|
|
496
|
+
if (!normalized) return false;
|
|
497
|
+
return normalized.split(" ").filter(Boolean).length <= 45 && INTERIM_CRON_HINTS.some((hint) => normalized.includes(hint));
|
|
498
|
+
}
|
|
499
|
+
function expectsSubagentFollowup(value) {
|
|
500
|
+
const normalized = normalizeHintText(value);
|
|
501
|
+
return Boolean(normalized && SUBAGENT_FOLLOWUP_HINTS.some((hint) => normalized.includes(hint)));
|
|
502
|
+
}
|
|
503
|
+
async function readDescendantSubagentFallbackReply(params) {
|
|
504
|
+
const descendants = listDescendantRunsForRequester(params.sessionKey).filter((entry) => typeof entry.endedAt === "number" && entry.endedAt >= params.runStartedAt && entry.childSessionKey.trim().length > 0).toSorted((a, b) => (a.endedAt ?? 0) - (b.endedAt ?? 0));
|
|
505
|
+
if (descendants.length === 0) return;
|
|
506
|
+
const latestByChild = /* @__PURE__ */ new Map();
|
|
507
|
+
for (const entry of descendants) {
|
|
508
|
+
const childKey = entry.childSessionKey.trim();
|
|
509
|
+
if (!childKey) continue;
|
|
510
|
+
const current = latestByChild.get(childKey);
|
|
511
|
+
if (!current || (entry.endedAt ?? 0) >= (current.endedAt ?? 0)) latestByChild.set(childKey, entry);
|
|
512
|
+
}
|
|
513
|
+
const replies = [];
|
|
514
|
+
const latestRuns = [...latestByChild.values()].toSorted((a, b) => (a.endedAt ?? 0) - (b.endedAt ?? 0)).slice(-4);
|
|
515
|
+
for (const entry of latestRuns) {
|
|
516
|
+
let reply = (await readLatestAssistantReply({ sessionKey: entry.childSessionKey }))?.trim();
|
|
517
|
+
if (!reply && typeof entry.frozenResultText === "string" && entry.frozenResultText.trim()) reply = entry.frozenResultText.trim();
|
|
518
|
+
if (!reply || reply.toUpperCase() === "NO_REPLY".toUpperCase()) continue;
|
|
519
|
+
replies.push(reply);
|
|
520
|
+
}
|
|
521
|
+
if (replies.length === 0) return;
|
|
522
|
+
if (replies.length === 1) return replies[0];
|
|
523
|
+
return replies.join("\n\n");
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Waits for descendant subagents to complete using a push-based approach:
|
|
527
|
+
* each active descendant run is awaited via `agent.wait` (gateway RPC) instead
|
|
528
|
+
* of a busy-poll loop. After all active runs settle, a short grace period
|
|
529
|
+
* polls the cron agent's session for a post-orchestration synthesis message.
|
|
530
|
+
*/
|
|
531
|
+
async function waitForDescendantSubagentSummary(params) {
|
|
532
|
+
const timings = resolveCronSubagentTimings();
|
|
533
|
+
const initialReply = params.initialReply?.trim();
|
|
534
|
+
const deadline = Date.now() + Math.max(timings.waitMinMs, Math.floor(params.timeoutMs));
|
|
535
|
+
const getActiveRuns = () => listDescendantRunsForRequester(params.sessionKey).filter((entry) => typeof entry.endedAt !== "number");
|
|
536
|
+
const initialActiveRuns = getActiveRuns();
|
|
537
|
+
if (!(params.observedActiveDescendants === true || initialActiveRuns.length > 0)) return initialReply;
|
|
538
|
+
let pendingRunIds = new Set(initialActiveRuns.map((e) => e.runId));
|
|
539
|
+
while (pendingRunIds.size > 0 && Date.now() < deadline) {
|
|
540
|
+
const remainingMs = Math.max(1, deadline - Date.now());
|
|
541
|
+
await Promise.allSettled([...pendingRunIds].map((runId) => callGateway({
|
|
542
|
+
method: "agent.wait",
|
|
543
|
+
params: {
|
|
544
|
+
runId,
|
|
545
|
+
timeoutMs: remainingMs
|
|
546
|
+
},
|
|
547
|
+
timeoutMs: remainingMs + 2e3
|
|
548
|
+
}).catch(() => void 0)));
|
|
549
|
+
pendingRunIds = new Set(getActiveRuns().map((e) => e.runId));
|
|
550
|
+
}
|
|
551
|
+
const gracePeriodDeadline = Math.min(Date.now() + timings.finalReplyGraceMs, deadline);
|
|
552
|
+
const resolveUsableLatestReply = async () => {
|
|
553
|
+
const latest = (await readLatestAssistantReply({ sessionKey: params.sessionKey }))?.trim();
|
|
554
|
+
if (latest && latest.toUpperCase() !== "NO_REPLY".toUpperCase() && (latest !== initialReply || !isLikelyInterimCronMessage(latest))) return latest;
|
|
555
|
+
};
|
|
556
|
+
while (Date.now() < gracePeriodDeadline) {
|
|
557
|
+
const latest = await resolveUsableLatestReply();
|
|
558
|
+
if (latest) return latest;
|
|
559
|
+
await new Promise((resolve) => setTimeout(resolve, timings.gracePollMs));
|
|
560
|
+
}
|
|
561
|
+
const latest = await resolveUsableLatestReply();
|
|
562
|
+
if (latest) return latest;
|
|
563
|
+
}
|
|
564
|
+
//#endregion
|
|
565
|
+
//#region src/cron/isolated-agent/delivery-dispatch.ts
|
|
566
|
+
function normalizeDeliveryTarget(channel, to) {
|
|
567
|
+
const channelLower = channel.trim().toLowerCase();
|
|
568
|
+
const toTrimmed = to.trim();
|
|
569
|
+
if (channelLower === "feishu" || channelLower === "lark") {
|
|
570
|
+
const lowered = toTrimmed.toLowerCase();
|
|
571
|
+
if (lowered.startsWith("user:")) return toTrimmed.slice(5).trim();
|
|
572
|
+
if (lowered.startsWith("chat:")) return toTrimmed.slice(5).trim();
|
|
573
|
+
}
|
|
574
|
+
return toTrimmed;
|
|
575
|
+
}
|
|
576
|
+
function matchesMessagingToolDeliveryTarget(target, delivery) {
|
|
577
|
+
if (!delivery.channel || !delivery.to || !target.to) return false;
|
|
578
|
+
const channel = delivery.channel.trim().toLowerCase();
|
|
579
|
+
const provider = target.provider?.trim().toLowerCase();
|
|
580
|
+
if (provider && provider !== "message" && provider !== channel) return false;
|
|
581
|
+
if (target.accountId && delivery.accountId && target.accountId !== delivery.accountId) return false;
|
|
582
|
+
return normalizeDeliveryTarget(channel, target.to.replace(/:topic:\d+$/, "")) === normalizeDeliveryTarget(channel, delivery.to);
|
|
583
|
+
}
|
|
584
|
+
function resolveCronDeliveryBestEffort(job) {
|
|
585
|
+
return job.delivery?.bestEffort === true;
|
|
586
|
+
}
|
|
587
|
+
const TRANSIENT_DIRECT_CRON_DELIVERY_ERROR_PATTERNS = [
|
|
588
|
+
/\berrorcode=unavailable\b/i,
|
|
589
|
+
/\bstatus\s*[:=]\s*"?unavailable\b/i,
|
|
590
|
+
/\bUNAVAILABLE\b/,
|
|
591
|
+
/no active .* listener/i,
|
|
592
|
+
/gateway not connected/i,
|
|
593
|
+
/gateway closed \(1006/i,
|
|
594
|
+
/gateway timeout/i,
|
|
595
|
+
/\b(econnreset|econnrefused|etimedout|enotfound|ehostunreach|network error)\b/i
|
|
596
|
+
];
|
|
597
|
+
const PERMANENT_DIRECT_CRON_DELIVERY_ERROR_PATTERNS = [
|
|
598
|
+
/unsupported channel/i,
|
|
599
|
+
/unknown channel/i,
|
|
600
|
+
/chat not found/i,
|
|
601
|
+
/user not found/i,
|
|
602
|
+
/bot.*not.*member/i,
|
|
603
|
+
/bot was blocked by the user/i,
|
|
604
|
+
/forbidden: bot was kicked/i,
|
|
605
|
+
/recipient is not a valid/i,
|
|
606
|
+
/outbound not configured for channel/i
|
|
607
|
+
];
|
|
608
|
+
const STALE_CRON_DELIVERY_MAX_START_DELAY_MS = 180 * 6e4;
|
|
609
|
+
const COMPLETED_DIRECT_CRON_DELIVERIES = /* @__PURE__ */ new Map();
|
|
610
|
+
function cloneDeliveryResults(results) {
|
|
611
|
+
return results.map((result) => ({
|
|
612
|
+
...result,
|
|
613
|
+
...result.meta ? { meta: { ...result.meta } } : {}
|
|
614
|
+
}));
|
|
615
|
+
}
|
|
616
|
+
function pruneCompletedDirectCronDeliveries(now) {
|
|
617
|
+
const ttlMs = process.env.OPENCLAW_TEST_FAST === "1" ? 6e4 : 1440 * 60 * 1e3;
|
|
618
|
+
for (const [key, entry] of COMPLETED_DIRECT_CRON_DELIVERIES) if (now - entry.ts >= ttlMs) COMPLETED_DIRECT_CRON_DELIVERIES.delete(key);
|
|
619
|
+
const maxEntries = 2e3;
|
|
620
|
+
if (COMPLETED_DIRECT_CRON_DELIVERIES.size <= maxEntries) return;
|
|
621
|
+
const entries = [...COMPLETED_DIRECT_CRON_DELIVERIES.entries()].toSorted((a, b) => a[1].ts - b[1].ts);
|
|
622
|
+
const toDelete = COMPLETED_DIRECT_CRON_DELIVERIES.size - maxEntries;
|
|
623
|
+
for (let i = 0; i < toDelete; i += 1) {
|
|
624
|
+
const oldest = entries[i];
|
|
625
|
+
if (!oldest) break;
|
|
626
|
+
COMPLETED_DIRECT_CRON_DELIVERIES.delete(oldest[0]);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
function resolveCronDeliveryScheduledAtMs(params) {
|
|
630
|
+
const scheduledAt = params.job.state?.nextRunAtMs;
|
|
631
|
+
return typeof scheduledAt === "number" && Number.isFinite(scheduledAt) ? scheduledAt : params.runStartedAt;
|
|
632
|
+
}
|
|
633
|
+
function resolveCronDeliveryStartDelayMs(params) {
|
|
634
|
+
return params.runStartedAt - resolveCronDeliveryScheduledAtMs(params);
|
|
635
|
+
}
|
|
636
|
+
function isStaleCronDelivery(params) {
|
|
637
|
+
return resolveCronDeliveryStartDelayMs(params) > STALE_CRON_DELIVERY_MAX_START_DELAY_MS;
|
|
638
|
+
}
|
|
639
|
+
function rememberCompletedDirectCronDelivery(idempotencyKey, results) {
|
|
640
|
+
const now = Date.now();
|
|
641
|
+
COMPLETED_DIRECT_CRON_DELIVERIES.set(idempotencyKey, {
|
|
642
|
+
ts: now,
|
|
643
|
+
results: cloneDeliveryResults(results)
|
|
644
|
+
});
|
|
645
|
+
pruneCompletedDirectCronDeliveries(now);
|
|
646
|
+
}
|
|
647
|
+
function getCompletedDirectCronDelivery(idempotencyKey) {
|
|
648
|
+
pruneCompletedDirectCronDeliveries(Date.now());
|
|
649
|
+
const cached = COMPLETED_DIRECT_CRON_DELIVERIES.get(idempotencyKey);
|
|
650
|
+
if (!cached) return;
|
|
651
|
+
return cloneDeliveryResults(cached.results);
|
|
652
|
+
}
|
|
653
|
+
function buildDirectCronDeliveryIdempotencyKey(params) {
|
|
654
|
+
const threadId = params.delivery.threadId == null || params.delivery.threadId === "" ? "" : String(params.delivery.threadId);
|
|
655
|
+
const accountId = params.delivery.accountId?.trim() ?? "";
|
|
656
|
+
const normalizedTo = normalizeDeliveryTarget(params.delivery.channel, params.delivery.to);
|
|
657
|
+
return `cron-direct-delivery:v1:${params.runSessionId}:${params.delivery.channel}:${accountId}:${normalizedTo}:${threadId}`;
|
|
658
|
+
}
|
|
659
|
+
function shouldQueueCronAwareness(job, deliveryBestEffort) {
|
|
660
|
+
return job.sessionTarget === "isolated" && !deliveryBestEffort;
|
|
661
|
+
}
|
|
662
|
+
function resolveCronAwarenessMainSessionKey(params) {
|
|
663
|
+
return params.cfg.session?.scope === "global" ? resolveMainSessionKey(params.cfg) : resolveAgentMainSessionKey({
|
|
664
|
+
cfg: params.cfg,
|
|
665
|
+
agentId: params.agentId
|
|
666
|
+
});
|
|
667
|
+
}
|
|
668
|
+
function queueCronAwarenessSystemEvent(params) {
|
|
669
|
+
const text = params.outputText?.trim() || params.synthesizedText?.trim() || void 0;
|
|
670
|
+
if (!text) return;
|
|
671
|
+
try {
|
|
672
|
+
enqueueSystemEvent(text, {
|
|
673
|
+
sessionKey: resolveCronAwarenessMainSessionKey({
|
|
674
|
+
cfg: params.cfg,
|
|
675
|
+
agentId: params.agentId
|
|
676
|
+
}),
|
|
677
|
+
contextKey: params.deliveryIdempotencyKey
|
|
678
|
+
});
|
|
679
|
+
} catch (err) {
|
|
680
|
+
logWarn(`[cron:${params.jobId}] failed to queue isolated cron awareness for the main session: ${err instanceof Error ? err.message : String(err)}`);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
function summarizeDirectCronDeliveryError(error) {
|
|
684
|
+
if (error instanceof Error) return error.message || "error";
|
|
685
|
+
if (typeof error === "string") return error;
|
|
686
|
+
try {
|
|
687
|
+
return JSON.stringify(error) || String(error);
|
|
688
|
+
} catch {
|
|
689
|
+
return String(error);
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
function isTransientDirectCronDeliveryError(error) {
|
|
693
|
+
const message = summarizeDirectCronDeliveryError(error);
|
|
694
|
+
if (!message) return false;
|
|
695
|
+
if (PERMANENT_DIRECT_CRON_DELIVERY_ERROR_PATTERNS.some((re) => re.test(message))) return false;
|
|
696
|
+
return TRANSIENT_DIRECT_CRON_DELIVERY_ERROR_PATTERNS.some((re) => re.test(message));
|
|
697
|
+
}
|
|
698
|
+
function resolveDirectCronRetryDelaysMs() {
|
|
699
|
+
return [
|
|
700
|
+
5e3,
|
|
701
|
+
1e4,
|
|
702
|
+
2e4
|
|
703
|
+
];
|
|
704
|
+
}
|
|
705
|
+
async function retryTransientDirectCronDelivery(params) {
|
|
706
|
+
const retryDelaysMs = resolveDirectCronRetryDelaysMs();
|
|
707
|
+
let retryIndex = 0;
|
|
708
|
+
for (;;) {
|
|
709
|
+
if (params.signal?.aborted) throw new Error("cron delivery aborted");
|
|
710
|
+
try {
|
|
711
|
+
return await params.run();
|
|
712
|
+
} catch (err) {
|
|
713
|
+
const delayMs = retryDelaysMs[retryIndex];
|
|
714
|
+
if (delayMs == null || !isTransientDirectCronDeliveryError(err) || params.signal?.aborted) throw err;
|
|
715
|
+
const nextAttempt = retryIndex + 2;
|
|
716
|
+
const maxAttempts = retryDelaysMs.length + 1;
|
|
717
|
+
logWarn(`[cron:${params.jobId}] transient direct announce delivery failure, retrying ${nextAttempt}/${maxAttempts} in ${Math.round(delayMs / 1e3)}s: ${summarizeDirectCronDeliveryError(err)}`);
|
|
718
|
+
retryIndex += 1;
|
|
719
|
+
await sleepWithAbort(delayMs, params.signal);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
async function dispatchCronDelivery(params) {
|
|
724
|
+
const skipMessagingToolDelivery = params.skipMessagingToolDelivery === true;
|
|
725
|
+
let summary = params.summary;
|
|
726
|
+
let outputText = params.outputText;
|
|
727
|
+
let synthesizedText = params.synthesizedText;
|
|
728
|
+
let deliveryPayloads = params.deliveryPayloads;
|
|
729
|
+
let delivered = skipMessagingToolDelivery;
|
|
730
|
+
let deliveryAttempted = skipMessagingToolDelivery;
|
|
731
|
+
const failDeliveryTarget = (error) => params.withRunSession({
|
|
732
|
+
status: "error",
|
|
733
|
+
error,
|
|
734
|
+
errorKind: "delivery-target",
|
|
735
|
+
summary,
|
|
736
|
+
outputText,
|
|
737
|
+
deliveryAttempted,
|
|
738
|
+
...params.telemetry
|
|
739
|
+
});
|
|
740
|
+
const deliverViaDirect = async (delivery, options) => {
|
|
741
|
+
const identity = resolveAgentOutboundIdentity(params.cfgWithAgentDefaults, params.agentId);
|
|
742
|
+
const deliveryIdempotencyKey = buildDirectCronDeliveryIdempotencyKey({
|
|
743
|
+
runSessionId: params.runSessionId,
|
|
744
|
+
delivery
|
|
745
|
+
});
|
|
746
|
+
try {
|
|
747
|
+
const payloadsForDelivery = deliveryPayloads.length > 0 ? deliveryPayloads : synthesizedText ? [{ text: synthesizedText }] : [];
|
|
748
|
+
if (payloadsForDelivery.length === 0) return null;
|
|
749
|
+
if (params.isAborted()) return params.withRunSession({
|
|
750
|
+
status: "error",
|
|
751
|
+
error: params.abortReason(),
|
|
752
|
+
deliveryAttempted,
|
|
753
|
+
...params.telemetry
|
|
754
|
+
});
|
|
755
|
+
if (params.deliveryRequested && isStaleCronDelivery({
|
|
756
|
+
job: params.job,
|
|
757
|
+
runStartedAt: params.runStartedAt
|
|
758
|
+
})) {
|
|
759
|
+
deliveryAttempted = true;
|
|
760
|
+
const nowMs = Date.now();
|
|
761
|
+
const scheduledAtMs = resolveCronDeliveryScheduledAtMs({
|
|
762
|
+
job: params.job,
|
|
763
|
+
runStartedAt: params.runStartedAt
|
|
764
|
+
});
|
|
765
|
+
const startDelayMs = resolveCronDeliveryStartDelayMs({
|
|
766
|
+
job: params.job,
|
|
767
|
+
runStartedAt: params.runStartedAt
|
|
768
|
+
});
|
|
769
|
+
logWarn(`[cron:${params.job.id}] skipping stale delivery scheduled at ${new Date(scheduledAtMs).toISOString()}, started ${Math.round(startDelayMs / 6e4)}m late, current age ${Math.round((nowMs - scheduledAtMs) / 6e4)}m`);
|
|
770
|
+
return params.withRunSession({
|
|
771
|
+
status: "ok",
|
|
772
|
+
summary,
|
|
773
|
+
outputText,
|
|
774
|
+
deliveryAttempted,
|
|
775
|
+
delivered: false,
|
|
776
|
+
...params.telemetry
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
deliveryAttempted = true;
|
|
780
|
+
if (getCompletedDirectCronDelivery(deliveryIdempotencyKey)) {
|
|
781
|
+
delivered = true;
|
|
782
|
+
return null;
|
|
783
|
+
}
|
|
784
|
+
const deliverySession = buildOutboundSessionContext({
|
|
785
|
+
cfg: params.cfgWithAgentDefaults,
|
|
786
|
+
agentId: params.agentId,
|
|
787
|
+
sessionKey: params.agentSessionKey
|
|
788
|
+
});
|
|
789
|
+
let hadPartialFailure = false;
|
|
790
|
+
const onError = params.deliveryBestEffort ? (err, _payload) => {
|
|
791
|
+
hadPartialFailure = true;
|
|
792
|
+
logError(`[cron:${params.job.id}] delivery payload failed (bestEffort): ${err instanceof Error ? err.message : String(err)}`);
|
|
793
|
+
} : void 0;
|
|
794
|
+
const runDelivery = async () => await deliverOutboundPayloads({
|
|
795
|
+
cfg: params.cfgWithAgentDefaults,
|
|
796
|
+
channel: delivery.channel,
|
|
797
|
+
to: delivery.to,
|
|
798
|
+
accountId: delivery.accountId,
|
|
799
|
+
threadId: delivery.threadId,
|
|
800
|
+
payloads: payloadsForDelivery,
|
|
801
|
+
session: deliverySession,
|
|
802
|
+
identity,
|
|
803
|
+
bestEffort: params.deliveryBestEffort,
|
|
804
|
+
deps: createOutboundSendDeps(params.deps),
|
|
805
|
+
abortSignal: params.abortSignal,
|
|
806
|
+
onError,
|
|
807
|
+
skipQueue: true
|
|
808
|
+
});
|
|
809
|
+
const deliveryResults = options?.retryTransient ? await retryTransientDirectCronDelivery({
|
|
810
|
+
jobId: params.job.id,
|
|
811
|
+
signal: params.abortSignal,
|
|
812
|
+
run: runDelivery
|
|
813
|
+
}) : await runDelivery();
|
|
814
|
+
delivered = deliveryResults.length > 0 && !hadPartialFailure;
|
|
815
|
+
if (delivered && shouldQueueCronAwareness(params.job, params.deliveryBestEffort)) queueCronAwarenessSystemEvent({
|
|
816
|
+
cfg: params.cfgWithAgentDefaults,
|
|
817
|
+
jobId: params.job.id,
|
|
818
|
+
agentId: params.agentId,
|
|
819
|
+
deliveryIdempotencyKey,
|
|
820
|
+
outputText,
|
|
821
|
+
synthesizedText
|
|
822
|
+
});
|
|
823
|
+
if (delivered) rememberCompletedDirectCronDelivery(deliveryIdempotencyKey, deliveryResults);
|
|
824
|
+
return null;
|
|
825
|
+
} catch (err) {
|
|
826
|
+
if (!params.deliveryBestEffort) return params.withRunSession({
|
|
827
|
+
status: "error",
|
|
828
|
+
summary,
|
|
829
|
+
outputText,
|
|
830
|
+
error: String(err),
|
|
831
|
+
deliveryAttempted,
|
|
832
|
+
...params.telemetry
|
|
833
|
+
});
|
|
834
|
+
logError(`[cron:${params.job.id}] delivery failed (bestEffort): ${err instanceof Error ? err.message : String(err)}`);
|
|
835
|
+
return null;
|
|
836
|
+
}
|
|
837
|
+
};
|
|
838
|
+
const finalizeTextDelivery = async (delivery) => {
|
|
839
|
+
const cleanupDirectCronSessionIfNeeded = async () => {
|
|
840
|
+
if (!params.job.deleteAfterRun) return;
|
|
841
|
+
try {
|
|
842
|
+
await callGateway({
|
|
843
|
+
method: "sessions.delete",
|
|
844
|
+
params: {
|
|
845
|
+
key: params.agentSessionKey,
|
|
846
|
+
deleteTranscript: true,
|
|
847
|
+
emitLifecycleHooks: false
|
|
848
|
+
},
|
|
849
|
+
timeoutMs: 1e4
|
|
850
|
+
});
|
|
851
|
+
} catch {}
|
|
852
|
+
};
|
|
853
|
+
if (!synthesizedText) return null;
|
|
854
|
+
const initialSynthesizedText = synthesizedText.trim();
|
|
855
|
+
let activeSubagentRuns = countActiveDescendantRuns(params.agentSessionKey);
|
|
856
|
+
const expectedSubagentFollowup = expectsSubagentFollowup(initialSynthesizedText);
|
|
857
|
+
const completedDescendantReply = activeSubagentRuns === 0 && isLikelyInterimCronMessage(initialSynthesizedText) ? await readDescendantSubagentFallbackReply({
|
|
858
|
+
sessionKey: params.agentSessionKey,
|
|
859
|
+
runStartedAt: params.runStartedAt
|
|
860
|
+
}) : void 0;
|
|
861
|
+
const hadDescendants = activeSubagentRuns > 0 || Boolean(completedDescendantReply);
|
|
862
|
+
if (activeSubagentRuns > 0 || expectedSubagentFollowup) {
|
|
863
|
+
let finalReply = await waitForDescendantSubagentSummary({
|
|
864
|
+
sessionKey: params.agentSessionKey,
|
|
865
|
+
initialReply: initialSynthesizedText,
|
|
866
|
+
timeoutMs: params.timeoutMs,
|
|
867
|
+
observedActiveDescendants: activeSubagentRuns > 0 || expectedSubagentFollowup
|
|
868
|
+
});
|
|
869
|
+
activeSubagentRuns = countActiveDescendantRuns(params.agentSessionKey);
|
|
870
|
+
if (!finalReply && activeSubagentRuns === 0) finalReply = await readDescendantSubagentFallbackReply({
|
|
871
|
+
sessionKey: params.agentSessionKey,
|
|
872
|
+
runStartedAt: params.runStartedAt
|
|
873
|
+
});
|
|
874
|
+
if (finalReply && activeSubagentRuns === 0) {
|
|
875
|
+
outputText = finalReply;
|
|
876
|
+
summary = pickSummaryFromOutput(finalReply) ?? summary;
|
|
877
|
+
synthesizedText = finalReply;
|
|
878
|
+
deliveryPayloads = [{ text: finalReply }];
|
|
879
|
+
}
|
|
880
|
+
} else if (completedDescendantReply) {
|
|
881
|
+
outputText = completedDescendantReply;
|
|
882
|
+
summary = pickSummaryFromOutput(completedDescendantReply) ?? summary;
|
|
883
|
+
synthesizedText = completedDescendantReply;
|
|
884
|
+
deliveryPayloads = [{ text: completedDescendantReply }];
|
|
885
|
+
}
|
|
886
|
+
if (activeSubagentRuns > 0) {
|
|
887
|
+
deliveryAttempted = true;
|
|
888
|
+
return params.withRunSession({
|
|
889
|
+
status: "ok",
|
|
890
|
+
summary,
|
|
891
|
+
outputText,
|
|
892
|
+
deliveryAttempted,
|
|
893
|
+
...params.telemetry
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
if (hadDescendants && synthesizedText.trim() === initialSynthesizedText && isLikelyInterimCronMessage(initialSynthesizedText) && initialSynthesizedText.toUpperCase() !== "NO_REPLY".toUpperCase()) {
|
|
897
|
+
deliveryAttempted = true;
|
|
898
|
+
return params.withRunSession({
|
|
899
|
+
status: "ok",
|
|
900
|
+
summary,
|
|
901
|
+
outputText,
|
|
902
|
+
deliveryAttempted,
|
|
903
|
+
...params.telemetry
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
if (synthesizedText.toUpperCase() === "NO_REPLY".toUpperCase()) {
|
|
907
|
+
await cleanupDirectCronSessionIfNeeded();
|
|
908
|
+
return params.withRunSession({
|
|
909
|
+
status: "ok",
|
|
910
|
+
summary,
|
|
911
|
+
outputText,
|
|
912
|
+
delivered: false,
|
|
913
|
+
...params.telemetry
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
if (params.isAborted()) return params.withRunSession({
|
|
917
|
+
status: "error",
|
|
918
|
+
error: params.abortReason(),
|
|
919
|
+
deliveryAttempted,
|
|
920
|
+
...params.telemetry
|
|
921
|
+
});
|
|
922
|
+
try {
|
|
923
|
+
return await deliverViaDirect(delivery, { retryTransient: true });
|
|
924
|
+
} finally {
|
|
925
|
+
await cleanupDirectCronSessionIfNeeded();
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
if (params.deliveryRequested && !params.skipHeartbeatDelivery && !skipMessagingToolDelivery) {
|
|
929
|
+
if (!params.resolvedDelivery.ok) {
|
|
930
|
+
if (!params.deliveryBestEffort) return {
|
|
931
|
+
result: failDeliveryTarget(params.resolvedDelivery.error.message),
|
|
932
|
+
delivered,
|
|
933
|
+
deliveryAttempted,
|
|
934
|
+
summary,
|
|
935
|
+
outputText,
|
|
936
|
+
synthesizedText,
|
|
937
|
+
deliveryPayloads
|
|
938
|
+
};
|
|
939
|
+
logWarn(`[cron:${params.job.id}] ${params.resolvedDelivery.error.message}`);
|
|
940
|
+
return {
|
|
941
|
+
result: params.withRunSession({
|
|
942
|
+
status: "ok",
|
|
943
|
+
summary,
|
|
944
|
+
outputText,
|
|
945
|
+
deliveryAttempted,
|
|
946
|
+
...params.telemetry
|
|
947
|
+
}),
|
|
948
|
+
delivered,
|
|
949
|
+
deliveryAttempted,
|
|
950
|
+
summary,
|
|
951
|
+
outputText,
|
|
952
|
+
synthesizedText,
|
|
953
|
+
deliveryPayloads
|
|
954
|
+
};
|
|
955
|
+
}
|
|
956
|
+
if (params.deliveryPayloadHasStructuredContent || params.resolvedDelivery.threadId != null) {
|
|
957
|
+
const directResult = await deliverViaDirect(params.resolvedDelivery);
|
|
958
|
+
if (directResult) return {
|
|
959
|
+
result: directResult,
|
|
960
|
+
delivered,
|
|
961
|
+
deliveryAttempted,
|
|
962
|
+
summary,
|
|
963
|
+
outputText,
|
|
964
|
+
synthesizedText,
|
|
965
|
+
deliveryPayloads
|
|
966
|
+
};
|
|
967
|
+
} else {
|
|
968
|
+
const finalizedTextResult = await finalizeTextDelivery(params.resolvedDelivery);
|
|
969
|
+
if (finalizedTextResult) return {
|
|
970
|
+
result: finalizedTextResult,
|
|
971
|
+
delivered,
|
|
972
|
+
deliveryAttempted,
|
|
973
|
+
summary,
|
|
974
|
+
outputText,
|
|
975
|
+
synthesizedText,
|
|
976
|
+
deliveryPayloads
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
return {
|
|
981
|
+
delivered,
|
|
982
|
+
deliveryAttempted,
|
|
983
|
+
summary,
|
|
984
|
+
outputText,
|
|
985
|
+
synthesizedText,
|
|
986
|
+
deliveryPayloads
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
//#endregion
|
|
990
|
+
//#region src/cron/isolated-agent/model-selection.ts
|
|
991
|
+
async function resolveCronModelSelection(params) {
|
|
992
|
+
const resolvedDefault = resolveConfiguredModelRef({
|
|
993
|
+
cfg: params.cfgWithAgentDefaults,
|
|
994
|
+
defaultProvider: DEFAULT_PROVIDER,
|
|
995
|
+
defaultModel: DEFAULT_MODEL
|
|
996
|
+
});
|
|
997
|
+
let provider = resolvedDefault.provider;
|
|
998
|
+
let model = resolvedDefault.model;
|
|
999
|
+
let catalog;
|
|
1000
|
+
const loadCatalogOnce = async () => {
|
|
1001
|
+
if (!catalog) catalog = await loadModelCatalog({ config: params.cfgWithAgentDefaults });
|
|
1002
|
+
return catalog;
|
|
1003
|
+
};
|
|
1004
|
+
const subagentModelRaw = normalizeModelSelection(params.agentConfigOverride?.subagents?.model) ?? normalizeModelSelection(params.agentConfigOverride?.model) ?? normalizeModelSelection(params.cfg.agents?.defaults?.subagents?.model);
|
|
1005
|
+
if (subagentModelRaw) {
|
|
1006
|
+
const resolvedSubagent = resolveAllowedModelRef({
|
|
1007
|
+
cfg: params.cfgWithAgentDefaults,
|
|
1008
|
+
catalog: await loadCatalogOnce(),
|
|
1009
|
+
raw: subagentModelRaw,
|
|
1010
|
+
defaultProvider: resolvedDefault.provider,
|
|
1011
|
+
defaultModel: resolvedDefault.model
|
|
1012
|
+
});
|
|
1013
|
+
if (!("error" in resolvedSubagent)) {
|
|
1014
|
+
provider = resolvedSubagent.ref.provider;
|
|
1015
|
+
model = resolvedSubagent.ref.model;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
let hooksGmailModelApplied = false;
|
|
1019
|
+
const hooksGmailModelRef = params.isGmailHook ? resolveHooksGmailModel({
|
|
1020
|
+
cfg: params.cfg,
|
|
1021
|
+
defaultProvider: DEFAULT_PROVIDER
|
|
1022
|
+
}) : null;
|
|
1023
|
+
if (hooksGmailModelRef) {
|
|
1024
|
+
if (getModelRefStatus({
|
|
1025
|
+
cfg: params.cfg,
|
|
1026
|
+
catalog: await loadCatalogOnce(),
|
|
1027
|
+
ref: hooksGmailModelRef,
|
|
1028
|
+
defaultProvider: resolvedDefault.provider,
|
|
1029
|
+
defaultModel: resolvedDefault.model
|
|
1030
|
+
}).allowed) {
|
|
1031
|
+
provider = hooksGmailModelRef.provider;
|
|
1032
|
+
model = hooksGmailModelRef.model;
|
|
1033
|
+
hooksGmailModelApplied = true;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
const modelOverrideRaw = params.payload.kind === "agentTurn" ? params.payload.model : void 0;
|
|
1037
|
+
const modelOverride = typeof modelOverrideRaw === "string" ? modelOverrideRaw.trim() : void 0;
|
|
1038
|
+
if (modelOverride !== void 0 && modelOverride.length > 0) {
|
|
1039
|
+
const resolvedOverride = resolveAllowedModelRef({
|
|
1040
|
+
cfg: params.cfgWithAgentDefaults,
|
|
1041
|
+
catalog: await loadCatalogOnce(),
|
|
1042
|
+
raw: modelOverride,
|
|
1043
|
+
defaultProvider: resolvedDefault.provider,
|
|
1044
|
+
defaultModel: resolvedDefault.model
|
|
1045
|
+
});
|
|
1046
|
+
if ("error" in resolvedOverride) {
|
|
1047
|
+
if (resolvedOverride.error.startsWith("model not allowed:")) return {
|
|
1048
|
+
ok: true,
|
|
1049
|
+
provider,
|
|
1050
|
+
model,
|
|
1051
|
+
warning: `cron: payload.model '${modelOverride}' not allowed, falling back to agent defaults`
|
|
1052
|
+
};
|
|
1053
|
+
return {
|
|
1054
|
+
ok: false,
|
|
1055
|
+
error: resolvedOverride.error
|
|
1056
|
+
};
|
|
1057
|
+
}
|
|
1058
|
+
provider = resolvedOverride.ref.provider;
|
|
1059
|
+
model = resolvedOverride.ref.model;
|
|
1060
|
+
}
|
|
1061
|
+
if (!modelOverride && !hooksGmailModelApplied) {
|
|
1062
|
+
const sessionModelOverride = params.sessionEntry.modelOverride?.trim();
|
|
1063
|
+
if (sessionModelOverride) {
|
|
1064
|
+
const sessionProviderOverride = params.sessionEntry.providerOverride?.trim() || resolvedDefault.provider;
|
|
1065
|
+
const resolvedSessionOverride = resolveAllowedModelRef({
|
|
1066
|
+
cfg: params.cfgWithAgentDefaults,
|
|
1067
|
+
catalog: await loadCatalogOnce(),
|
|
1068
|
+
raw: `${sessionProviderOverride}/${sessionModelOverride}`,
|
|
1069
|
+
defaultProvider: resolvedDefault.provider,
|
|
1070
|
+
defaultModel: resolvedDefault.model
|
|
1071
|
+
});
|
|
1072
|
+
if (!("error" in resolvedSessionOverride)) {
|
|
1073
|
+
provider = resolvedSessionOverride.ref.provider;
|
|
1074
|
+
model = resolvedSessionOverride.ref.model;
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
return {
|
|
1079
|
+
ok: true,
|
|
1080
|
+
provider,
|
|
1081
|
+
model
|
|
1082
|
+
};
|
|
1083
|
+
}
|
|
1084
|
+
//#endregion
|
|
1085
|
+
//#region src/cron/isolated-agent/run-config.ts
|
|
1086
|
+
function extractCronAgentDefaultsOverride(agentConfigOverride) {
|
|
1087
|
+
const { model: overrideModel, sandbox: _agentSandboxOverride, ...agentOverrideRest } = agentConfigOverride ?? {};
|
|
1088
|
+
return {
|
|
1089
|
+
overrideModel,
|
|
1090
|
+
definedOverrides: Object.fromEntries(Object.entries(agentOverrideRest).filter(([, value]) => value !== void 0))
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
function mergeCronAgentModelOverride(params) {
|
|
1094
|
+
const nextDefaults = { ...params.defaults };
|
|
1095
|
+
const existingModel = nextDefaults.model && typeof nextDefaults.model === "object" ? nextDefaults.model : {};
|
|
1096
|
+
if (typeof params.overrideModel === "string") nextDefaults.model = {
|
|
1097
|
+
...existingModel,
|
|
1098
|
+
primary: params.overrideModel
|
|
1099
|
+
};
|
|
1100
|
+
else if (params.overrideModel) nextDefaults.model = {
|
|
1101
|
+
...existingModel,
|
|
1102
|
+
...params.overrideModel
|
|
1103
|
+
};
|
|
1104
|
+
return nextDefaults;
|
|
1105
|
+
}
|
|
1106
|
+
function buildCronAgentDefaultsConfig(params) {
|
|
1107
|
+
const { overrideModel, definedOverrides } = extractCronAgentDefaultsOverride(params.agentConfigOverride);
|
|
1108
|
+
return mergeCronAgentModelOverride({
|
|
1109
|
+
defaults: Object.assign({}, params.defaults, definedOverrides),
|
|
1110
|
+
overrideModel
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
//#endregion
|
|
1114
|
+
//#region src/cron/isolated-agent/session-key.ts
|
|
1115
|
+
function resolveCronAgentSessionKey(params) {
|
|
1116
|
+
const raw = toAgentStoreSessionKey({
|
|
1117
|
+
agentId: params.agentId,
|
|
1118
|
+
requestKey: params.sessionKey.trim(),
|
|
1119
|
+
mainKey: params.mainKey
|
|
1120
|
+
});
|
|
1121
|
+
return canonicalizeMainSessionAlias({
|
|
1122
|
+
cfg: params.cfg,
|
|
1123
|
+
agentId: params.agentId,
|
|
1124
|
+
sessionKey: raw
|
|
1125
|
+
});
|
|
1126
|
+
}
|
|
1127
|
+
//#endregion
|
|
1128
|
+
//#region src/cron/isolated-agent/skills-snapshot.ts
|
|
1129
|
+
function resolveCronSkillsSnapshot(params) {
|
|
1130
|
+
if (params.isFastTestEnv) return params.existingSnapshot ?? {
|
|
1131
|
+
prompt: "",
|
|
1132
|
+
skills: []
|
|
1133
|
+
};
|
|
1134
|
+
const snapshotVersion = getSkillsSnapshotVersion(params.workspaceDir);
|
|
1135
|
+
const skillFilter = resolveAgentSkillsFilter(params.config, params.agentId);
|
|
1136
|
+
const existingSnapshot = params.existingSnapshot;
|
|
1137
|
+
if (!(!existingSnapshot || existingSnapshot.version !== snapshotVersion || !matchesSkillFilter(existingSnapshot.skillFilter, skillFilter))) return existingSnapshot;
|
|
1138
|
+
return buildWorkspaceSkillSnapshot(params.workspaceDir, {
|
|
1139
|
+
config: params.config,
|
|
1140
|
+
skillFilter,
|
|
1141
|
+
eligibility: { remote: getRemoteSkillEligibility() },
|
|
1142
|
+
snapshotVersion
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
//#endregion
|
|
1146
|
+
//#region src/cron/isolated-agent/run.ts
|
|
1147
|
+
function resolveNonNegativeNumber(value) {
|
|
1148
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
1149
|
+
}
|
|
1150
|
+
function resolveCronToolPolicy(params) {
|
|
1151
|
+
return {
|
|
1152
|
+
requireExplicitMessageTarget: params.deliveryRequested && params.resolvedDelivery.ok,
|
|
1153
|
+
disableMessageTool: params.deliveryContract === "cron-owned" ? true : params.deliveryRequested
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
async function resolveCronDeliveryContext(params) {
|
|
1157
|
+
const deliveryPlan = resolveCronDeliveryPlan(params.job);
|
|
1158
|
+
if (!deliveryPlan.requested) {
|
|
1159
|
+
const resolvedDelivery = {
|
|
1160
|
+
ok: false,
|
|
1161
|
+
channel: void 0,
|
|
1162
|
+
to: void 0,
|
|
1163
|
+
accountId: void 0,
|
|
1164
|
+
threadId: void 0,
|
|
1165
|
+
mode: "implicit",
|
|
1166
|
+
error: /* @__PURE__ */ new Error("cron delivery not requested")
|
|
1167
|
+
};
|
|
1168
|
+
return {
|
|
1169
|
+
deliveryPlan,
|
|
1170
|
+
deliveryRequested: false,
|
|
1171
|
+
resolvedDelivery,
|
|
1172
|
+
toolPolicy: resolveCronToolPolicy({
|
|
1173
|
+
deliveryRequested: false,
|
|
1174
|
+
resolvedDelivery,
|
|
1175
|
+
deliveryContract: params.deliveryContract
|
|
1176
|
+
})
|
|
1177
|
+
};
|
|
1178
|
+
}
|
|
1179
|
+
const resolvedDelivery = await resolveDeliveryTarget(params.cfg, params.agentId, {
|
|
1180
|
+
channel: deliveryPlan.channel ?? "last",
|
|
1181
|
+
to: deliveryPlan.to,
|
|
1182
|
+
threadId: deliveryPlan.threadId,
|
|
1183
|
+
accountId: deliveryPlan.accountId,
|
|
1184
|
+
sessionKey: params.job.sessionKey
|
|
1185
|
+
});
|
|
1186
|
+
return {
|
|
1187
|
+
deliveryPlan,
|
|
1188
|
+
deliveryRequested: deliveryPlan.requested,
|
|
1189
|
+
resolvedDelivery,
|
|
1190
|
+
toolPolicy: resolveCronToolPolicy({
|
|
1191
|
+
deliveryRequested: deliveryPlan.requested,
|
|
1192
|
+
resolvedDelivery,
|
|
1193
|
+
deliveryContract: params.deliveryContract
|
|
1194
|
+
})
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
function appendCronDeliveryInstruction(params) {
|
|
1198
|
+
if (!params.deliveryRequested) return params.commandBody;
|
|
1199
|
+
return `${params.commandBody}\n\nReturn your summary as plain text; it will be delivered automatically. If the task explicitly calls for messaging a specific external recipient, note who/where it should go instead of sending it yourself.`.trim();
|
|
1200
|
+
}
|
|
1201
|
+
async function runCronIsolatedAgentTurn(params) {
|
|
1202
|
+
const abortSignal = params.abortSignal ?? params.signal;
|
|
1203
|
+
const isAborted = () => abortSignal?.aborted === true;
|
|
1204
|
+
const abortReason = () => {
|
|
1205
|
+
const reason = abortSignal?.reason;
|
|
1206
|
+
return typeof reason === "string" && reason.trim() ? reason.trim() : "cron: job execution timed out";
|
|
1207
|
+
};
|
|
1208
|
+
const isFastTestEnv = process.env.OPENCLAW_TEST_FAST === "1";
|
|
1209
|
+
const deliveryContract = params.deliveryContract ?? "cron-owned";
|
|
1210
|
+
const defaultAgentId = resolveDefaultAgentId(params.cfg);
|
|
1211
|
+
const requestedAgentId = typeof params.agentId === "string" && params.agentId.trim() ? params.agentId : typeof params.job.agentId === "string" && params.job.agentId.trim() ? params.job.agentId : void 0;
|
|
1212
|
+
const normalizedRequested = requestedAgentId ? normalizeAgentId(requestedAgentId) : void 0;
|
|
1213
|
+
const agentConfigOverride = normalizedRequested ? resolveAgentConfig(params.cfg, normalizedRequested) : void 0;
|
|
1214
|
+
const agentId = normalizedRequested ?? defaultAgentId;
|
|
1215
|
+
const agentCfg = buildCronAgentDefaultsConfig({
|
|
1216
|
+
defaults: params.cfg.agents?.defaults,
|
|
1217
|
+
agentConfigOverride
|
|
1218
|
+
});
|
|
1219
|
+
const cfgWithAgentDefaults = {
|
|
1220
|
+
...params.cfg,
|
|
1221
|
+
agents: Object.assign({}, params.cfg.agents, { defaults: agentCfg })
|
|
1222
|
+
};
|
|
1223
|
+
let catalog;
|
|
1224
|
+
const loadCatalog = async () => {
|
|
1225
|
+
if (!catalog) catalog = await loadModelCatalog({ config: cfgWithAgentDefaults });
|
|
1226
|
+
return catalog;
|
|
1227
|
+
};
|
|
1228
|
+
const baseSessionKey = (params.sessionKey?.trim() || `cron:${params.job.id}`).trim();
|
|
1229
|
+
const agentSessionKey = resolveCronAgentSessionKey({
|
|
1230
|
+
sessionKey: baseSessionKey,
|
|
1231
|
+
agentId,
|
|
1232
|
+
mainKey: params.cfg.session?.mainKey,
|
|
1233
|
+
cfg: params.cfg
|
|
1234
|
+
});
|
|
1235
|
+
const hookExternalContentSource = (params.job.payload.kind === "agentTurn" ? params.job.payload.externalContentSource : void 0) ?? resolveHookExternalContentSource(baseSessionKey);
|
|
1236
|
+
const workspaceDirRaw = resolveAgentWorkspaceDir(params.cfg, agentId);
|
|
1237
|
+
const agentDir = resolveAgentDir(params.cfg, agentId);
|
|
1238
|
+
const workspaceDir = (await ensureAgentWorkspace({
|
|
1239
|
+
dir: workspaceDirRaw,
|
|
1240
|
+
ensureBootstrapFiles: !agentCfg?.skipBootstrap && !isFastTestEnv
|
|
1241
|
+
})).dir;
|
|
1242
|
+
const isGmailHook = hookExternalContentSource === "gmail";
|
|
1243
|
+
const now = Date.now();
|
|
1244
|
+
const cronSession = resolveCronSession({
|
|
1245
|
+
cfg: params.cfg,
|
|
1246
|
+
sessionKey: agentSessionKey,
|
|
1247
|
+
agentId,
|
|
1248
|
+
nowMs: now,
|
|
1249
|
+
forceNew: params.job.sessionTarget === "isolated"
|
|
1250
|
+
});
|
|
1251
|
+
const runSessionId = cronSession.sessionEntry.sessionId;
|
|
1252
|
+
const runSessionKey = baseSessionKey.startsWith("cron:") ? `${agentSessionKey}:run:${runSessionId}` : agentSessionKey;
|
|
1253
|
+
const persistSessionEntry = async () => {
|
|
1254
|
+
if (isFastTestEnv) return;
|
|
1255
|
+
cronSession.store[agentSessionKey] = cronSession.sessionEntry;
|
|
1256
|
+
if (runSessionKey !== agentSessionKey) cronSession.store[runSessionKey] = cronSession.sessionEntry;
|
|
1257
|
+
await updateSessionStore(cronSession.storePath, (store) => {
|
|
1258
|
+
store[agentSessionKey] = cronSession.sessionEntry;
|
|
1259
|
+
if (runSessionKey !== agentSessionKey) store[runSessionKey] = cronSession.sessionEntry;
|
|
1260
|
+
});
|
|
1261
|
+
};
|
|
1262
|
+
const withRunSession = (result) => ({
|
|
1263
|
+
...result,
|
|
1264
|
+
sessionId: runSessionId,
|
|
1265
|
+
sessionKey: runSessionKey
|
|
1266
|
+
});
|
|
1267
|
+
if (!cronSession.sessionEntry.label?.trim() && baseSessionKey.startsWith("cron:")) {
|
|
1268
|
+
const labelSuffix = typeof params.job.name === "string" && params.job.name.trim() ? params.job.name.trim() : params.job.id;
|
|
1269
|
+
cronSession.sessionEntry.label = `Cron: ${labelSuffix}`;
|
|
1270
|
+
}
|
|
1271
|
+
const resolvedModelSelection = await resolveCronModelSelection({
|
|
1272
|
+
cfg: params.cfg,
|
|
1273
|
+
cfgWithAgentDefaults,
|
|
1274
|
+
agentConfigOverride,
|
|
1275
|
+
sessionEntry: cronSession.sessionEntry,
|
|
1276
|
+
payload: params.job.payload,
|
|
1277
|
+
isGmailHook
|
|
1278
|
+
});
|
|
1279
|
+
if (!resolvedModelSelection.ok) return {
|
|
1280
|
+
status: "error",
|
|
1281
|
+
error: resolvedModelSelection.error
|
|
1282
|
+
};
|
|
1283
|
+
let provider = resolvedModelSelection.provider;
|
|
1284
|
+
let model = resolvedModelSelection.model;
|
|
1285
|
+
if (resolvedModelSelection.warning) logWarn(resolvedModelSelection.warning);
|
|
1286
|
+
const hooksGmailThinking = isGmailHook ? normalizeThinkLevel(params.cfg.hooks?.gmail?.thinking) : void 0;
|
|
1287
|
+
let thinkLevel = normalizeThinkLevel((params.job.payload.kind === "agentTurn" ? params.job.payload.thinking : void 0) ?? void 0) ?? hooksGmailThinking;
|
|
1288
|
+
if (!thinkLevel) thinkLevel = resolveThinkingDefault({
|
|
1289
|
+
cfg: cfgWithAgentDefaults,
|
|
1290
|
+
provider,
|
|
1291
|
+
model,
|
|
1292
|
+
catalog: await loadCatalog()
|
|
1293
|
+
});
|
|
1294
|
+
if (thinkLevel === "xhigh" && !supportsXHighThinking(provider, model)) {
|
|
1295
|
+
logWarn(`[cron:${params.job.id}] Thinking level "xhigh" is not supported for ${provider}/${model}; downgrading to "high".`);
|
|
1296
|
+
thinkLevel = "high";
|
|
1297
|
+
}
|
|
1298
|
+
const timeoutMs = resolveAgentTimeoutMs({
|
|
1299
|
+
cfg: cfgWithAgentDefaults,
|
|
1300
|
+
overrideSeconds: params.job.payload.kind === "agentTurn" ? params.job.payload.timeoutSeconds : void 0
|
|
1301
|
+
});
|
|
1302
|
+
const agentPayload = params.job.payload.kind === "agentTurn" ? params.job.payload : null;
|
|
1303
|
+
const { deliveryRequested, resolvedDelivery, toolPolicy } = await resolveCronDeliveryContext({
|
|
1304
|
+
cfg: cfgWithAgentDefaults,
|
|
1305
|
+
job: params.job,
|
|
1306
|
+
agentId,
|
|
1307
|
+
deliveryContract
|
|
1308
|
+
});
|
|
1309
|
+
const { formattedTime, timeLine } = resolveCronStyleNow(params.cfg, now);
|
|
1310
|
+
const base = `[cron:${params.job.id} ${params.job.name}] ${params.message}`.trim();
|
|
1311
|
+
const isExternalHook = hookExternalContentSource !== void 0 || isExternalHookSession(baseSessionKey);
|
|
1312
|
+
const allowUnsafeExternalContent = agentPayload?.allowUnsafeExternalContent === true || isGmailHook && params.cfg.hooks?.gmail?.allowUnsafeExternalContent === true;
|
|
1313
|
+
const shouldWrapExternal = isExternalHook && !allowUnsafeExternalContent;
|
|
1314
|
+
let commandBody;
|
|
1315
|
+
if (isExternalHook) {
|
|
1316
|
+
const suspiciousPatterns = detectSuspiciousPatterns(params.message);
|
|
1317
|
+
if (suspiciousPatterns.length > 0) logWarn(`[security] Suspicious patterns detected in external hook content (session=${baseSessionKey}, patterns=${suspiciousPatterns.length}): ${suspiciousPatterns.slice(0, 3).join(", ")}`);
|
|
1318
|
+
}
|
|
1319
|
+
if (shouldWrapExternal) {
|
|
1320
|
+
const hookType = mapHookExternalContentSource(hookExternalContentSource ?? "webhook");
|
|
1321
|
+
commandBody = `${buildSafeExternalPrompt({
|
|
1322
|
+
content: params.message,
|
|
1323
|
+
source: hookType,
|
|
1324
|
+
jobName: params.job.name,
|
|
1325
|
+
jobId: params.job.id,
|
|
1326
|
+
timestamp: formattedTime
|
|
1327
|
+
})}\n\n${timeLine}`.trim();
|
|
1328
|
+
} else commandBody = `${base}\n${timeLine}`.trim();
|
|
1329
|
+
commandBody = appendCronDeliveryInstruction({
|
|
1330
|
+
commandBody,
|
|
1331
|
+
deliveryRequested
|
|
1332
|
+
});
|
|
1333
|
+
const existingSkillsSnapshot = cronSession.sessionEntry.skillsSnapshot;
|
|
1334
|
+
const skillsSnapshot = resolveCronSkillsSnapshot({
|
|
1335
|
+
workspaceDir,
|
|
1336
|
+
config: cfgWithAgentDefaults,
|
|
1337
|
+
agentId,
|
|
1338
|
+
existingSnapshot: existingSkillsSnapshot,
|
|
1339
|
+
isFastTestEnv
|
|
1340
|
+
});
|
|
1341
|
+
if (!isFastTestEnv && skillsSnapshot !== existingSkillsSnapshot) {
|
|
1342
|
+
cronSession.sessionEntry = {
|
|
1343
|
+
...cronSession.sessionEntry,
|
|
1344
|
+
updatedAt: Date.now(),
|
|
1345
|
+
skillsSnapshot
|
|
1346
|
+
};
|
|
1347
|
+
await persistSessionEntry();
|
|
1348
|
+
}
|
|
1349
|
+
cronSession.sessionEntry.modelProvider = provider;
|
|
1350
|
+
cronSession.sessionEntry.model = model;
|
|
1351
|
+
cronSession.sessionEntry.systemSent = true;
|
|
1352
|
+
try {
|
|
1353
|
+
await persistSessionEntry();
|
|
1354
|
+
} catch (err) {
|
|
1355
|
+
logWarn(`[cron:${params.job.id}] Failed to persist pre-run session entry: ${String(err)}`);
|
|
1356
|
+
}
|
|
1357
|
+
const authProfileId = await resolveSessionAuthProfileOverride({
|
|
1358
|
+
cfg: cfgWithAgentDefaults,
|
|
1359
|
+
provider,
|
|
1360
|
+
agentDir,
|
|
1361
|
+
sessionEntry: cronSession.sessionEntry,
|
|
1362
|
+
sessionStore: cronSession.store,
|
|
1363
|
+
sessionKey: agentSessionKey,
|
|
1364
|
+
storePath: cronSession.storePath,
|
|
1365
|
+
isNewSession: cronSession.isNewSession
|
|
1366
|
+
});
|
|
1367
|
+
let liveSelection = {
|
|
1368
|
+
provider,
|
|
1369
|
+
model,
|
|
1370
|
+
authProfileId,
|
|
1371
|
+
authProfileIdSource: authProfileId ? cronSession.sessionEntry.authProfileOverrideSource : void 0
|
|
1372
|
+
};
|
|
1373
|
+
const syncSessionEntryLiveSelection = () => {
|
|
1374
|
+
cronSession.sessionEntry.modelProvider = liveSelection.provider;
|
|
1375
|
+
cronSession.sessionEntry.model = liveSelection.model;
|
|
1376
|
+
if (liveSelection.authProfileId) {
|
|
1377
|
+
cronSession.sessionEntry.authProfileOverride = liveSelection.authProfileId;
|
|
1378
|
+
cronSession.sessionEntry.authProfileOverrideSource = liveSelection.authProfileIdSource;
|
|
1379
|
+
if (liveSelection.authProfileIdSource === "auto") cronSession.sessionEntry.authProfileOverrideCompactionCount = cronSession.sessionEntry.compactionCount ?? 0;
|
|
1380
|
+
else delete cronSession.sessionEntry.authProfileOverrideCompactionCount;
|
|
1381
|
+
return;
|
|
1382
|
+
}
|
|
1383
|
+
delete cronSession.sessionEntry.authProfileOverride;
|
|
1384
|
+
delete cronSession.sessionEntry.authProfileOverrideSource;
|
|
1385
|
+
delete cronSession.sessionEntry.authProfileOverrideCompactionCount;
|
|
1386
|
+
};
|
|
1387
|
+
let runResult;
|
|
1388
|
+
let fallbackProvider = liveSelection.provider;
|
|
1389
|
+
let fallbackModel = liveSelection.model;
|
|
1390
|
+
const runStartedAt = Date.now();
|
|
1391
|
+
let runEndedAt = runStartedAt;
|
|
1392
|
+
try {
|
|
1393
|
+
const sessionFile = resolveSessionTranscriptPath(cronSession.sessionEntry.sessionId, agentId);
|
|
1394
|
+
const resolvedVerboseLevel = normalizeVerboseLevel(cronSession.sessionEntry.verboseLevel) ?? normalizeVerboseLevel(agentCfg?.verboseDefault) ?? "off";
|
|
1395
|
+
registerAgentRunContext(cronSession.sessionEntry.sessionId, {
|
|
1396
|
+
sessionKey: agentSessionKey,
|
|
1397
|
+
verboseLevel: resolvedVerboseLevel
|
|
1398
|
+
});
|
|
1399
|
+
const messageChannel = resolvedDelivery.channel;
|
|
1400
|
+
const payloadFallbacks = params.job.payload.kind === "agentTurn" && Array.isArray(params.job.payload.fallbacks) ? params.job.payload.fallbacks : void 0;
|
|
1401
|
+
let bootstrapPromptWarningSignaturesSeen = resolveBootstrapWarningSignaturesSeen(cronSession.sessionEntry.systemPromptReport);
|
|
1402
|
+
const runPrompt = async (promptText) => {
|
|
1403
|
+
const fallbackResult = await runWithModelFallback({
|
|
1404
|
+
cfg: cfgWithAgentDefaults,
|
|
1405
|
+
provider: liveSelection.provider,
|
|
1406
|
+
model: liveSelection.model,
|
|
1407
|
+
runId: cronSession.sessionEntry.sessionId,
|
|
1408
|
+
agentDir,
|
|
1409
|
+
fallbacksOverride: payloadFallbacks ?? resolveAgentModelFallbacksOverride(params.cfg, agentId),
|
|
1410
|
+
run: async (providerOverride, modelOverride, runOptions) => {
|
|
1411
|
+
if (abortSignal?.aborted) throw new Error(abortReason());
|
|
1412
|
+
const bootstrapPromptWarningSignature = bootstrapPromptWarningSignaturesSeen[bootstrapPromptWarningSignaturesSeen.length - 1];
|
|
1413
|
+
if (isCliProvider(providerOverride, cfgWithAgentDefaults)) {
|
|
1414
|
+
const cliSessionId = cronSession.isNewSession ? void 0 : getCliSessionId(cronSession.sessionEntry, providerOverride);
|
|
1415
|
+
const result = await runCliAgent({
|
|
1416
|
+
sessionId: cronSession.sessionEntry.sessionId,
|
|
1417
|
+
sessionKey: agentSessionKey,
|
|
1418
|
+
agentId,
|
|
1419
|
+
sessionFile,
|
|
1420
|
+
workspaceDir,
|
|
1421
|
+
config: cfgWithAgentDefaults,
|
|
1422
|
+
prompt: promptText,
|
|
1423
|
+
provider: providerOverride,
|
|
1424
|
+
model: modelOverride,
|
|
1425
|
+
thinkLevel,
|
|
1426
|
+
timeoutMs,
|
|
1427
|
+
runId: cronSession.sessionEntry.sessionId,
|
|
1428
|
+
cliSessionId,
|
|
1429
|
+
bootstrapPromptWarningSignaturesSeen,
|
|
1430
|
+
bootstrapPromptWarningSignature
|
|
1431
|
+
});
|
|
1432
|
+
bootstrapPromptWarningSignaturesSeen = resolveBootstrapWarningSignaturesSeen(result.meta?.systemPromptReport);
|
|
1433
|
+
return result;
|
|
1434
|
+
}
|
|
1435
|
+
const result = await runEmbeddedPiAgent({
|
|
1436
|
+
sessionId: cronSession.sessionEntry.sessionId,
|
|
1437
|
+
sessionKey: agentSessionKey,
|
|
1438
|
+
agentId,
|
|
1439
|
+
trigger: "cron",
|
|
1440
|
+
allowGatewaySubagentBinding: true,
|
|
1441
|
+
senderIsOwner: true,
|
|
1442
|
+
messageChannel,
|
|
1443
|
+
agentAccountId: resolvedDelivery.accountId,
|
|
1444
|
+
sessionFile,
|
|
1445
|
+
agentDir,
|
|
1446
|
+
workspaceDir,
|
|
1447
|
+
config: cfgWithAgentDefaults,
|
|
1448
|
+
skillsSnapshot,
|
|
1449
|
+
prompt: promptText,
|
|
1450
|
+
lane: resolveNestedAgentLane(params.lane),
|
|
1451
|
+
provider: providerOverride,
|
|
1452
|
+
model: modelOverride,
|
|
1453
|
+
authProfileId: liveSelection.authProfileId,
|
|
1454
|
+
authProfileIdSource: liveSelection.authProfileId ? liveSelection.authProfileIdSource : void 0,
|
|
1455
|
+
thinkLevel,
|
|
1456
|
+
fastMode: resolveFastModeState({
|
|
1457
|
+
cfg: cfgWithAgentDefaults,
|
|
1458
|
+
provider: providerOverride,
|
|
1459
|
+
model: modelOverride,
|
|
1460
|
+
agentId,
|
|
1461
|
+
sessionEntry: cronSession.sessionEntry
|
|
1462
|
+
}).enabled,
|
|
1463
|
+
verboseLevel: resolvedVerboseLevel,
|
|
1464
|
+
timeoutMs,
|
|
1465
|
+
bootstrapContextMode: agentPayload?.lightContext ? "lightweight" : void 0,
|
|
1466
|
+
bootstrapContextRunKind: "cron",
|
|
1467
|
+
toolsAllow: agentPayload?.toolsAllow,
|
|
1468
|
+
runId: cronSession.sessionEntry.sessionId,
|
|
1469
|
+
requireExplicitMessageTarget: toolPolicy.requireExplicitMessageTarget,
|
|
1470
|
+
disableMessageTool: toolPolicy.disableMessageTool,
|
|
1471
|
+
allowTransientCooldownProbe: runOptions?.allowTransientCooldownProbe,
|
|
1472
|
+
abortSignal,
|
|
1473
|
+
bootstrapPromptWarningSignaturesSeen,
|
|
1474
|
+
bootstrapPromptWarningSignature
|
|
1475
|
+
});
|
|
1476
|
+
bootstrapPromptWarningSignaturesSeen = resolveBootstrapWarningSignaturesSeen(result.meta?.systemPromptReport);
|
|
1477
|
+
return result;
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
runResult = fallbackResult.result;
|
|
1481
|
+
fallbackProvider = fallbackResult.provider;
|
|
1482
|
+
fallbackModel = fallbackResult.model;
|
|
1483
|
+
liveSelection.provider = fallbackResult.provider;
|
|
1484
|
+
liveSelection.model = fallbackResult.model;
|
|
1485
|
+
runEndedAt = Date.now();
|
|
1486
|
+
};
|
|
1487
|
+
const MAX_MODEL_SWITCH_RETRIES = 2;
|
|
1488
|
+
let modelSwitchRetries = 0;
|
|
1489
|
+
while (true) try {
|
|
1490
|
+
await runPrompt(commandBody);
|
|
1491
|
+
break;
|
|
1492
|
+
} catch (err) {
|
|
1493
|
+
if (err instanceof LiveSessionModelSwitchError) {
|
|
1494
|
+
modelSwitchRetries += 1;
|
|
1495
|
+
if (modelSwitchRetries > MAX_MODEL_SWITCH_RETRIES) {
|
|
1496
|
+
logWarn(`[cron:${params.job.id}] LiveSessionModelSwitchError retry limit reached (${MAX_MODEL_SWITCH_RETRIES}); aborting`);
|
|
1497
|
+
throw err;
|
|
1498
|
+
}
|
|
1499
|
+
liveSelection = {
|
|
1500
|
+
provider: err.provider,
|
|
1501
|
+
model: err.model,
|
|
1502
|
+
authProfileId: err.authProfileId,
|
|
1503
|
+
authProfileIdSource: err.authProfileId ? err.authProfileIdSource : void 0
|
|
1504
|
+
};
|
|
1505
|
+
fallbackProvider = err.provider;
|
|
1506
|
+
fallbackModel = err.model;
|
|
1507
|
+
syncSessionEntryLiveSelection();
|
|
1508
|
+
try {
|
|
1509
|
+
await persistSessionEntry();
|
|
1510
|
+
} catch (persistErr) {
|
|
1511
|
+
logWarn(`[cron:${params.job.id}] Failed to persist model switch session entry: ${String(persistErr)}`);
|
|
1512
|
+
}
|
|
1513
|
+
continue;
|
|
1514
|
+
}
|
|
1515
|
+
throw err;
|
|
1516
|
+
}
|
|
1517
|
+
if (!runResult) throw new Error("cron isolated run returned no result");
|
|
1518
|
+
if (!isAborted()) {
|
|
1519
|
+
const interimRunResult = runResult;
|
|
1520
|
+
const interimPayloads = interimRunResult.payloads ?? [];
|
|
1521
|
+
const { deliveryPayloadHasStructuredContent: interimPayloadHasStructuredContent, outputText: interimOutputText } = resolveCronPayloadOutcome({
|
|
1522
|
+
payloads: interimPayloads,
|
|
1523
|
+
runLevelError: interimRunResult.meta?.error
|
|
1524
|
+
});
|
|
1525
|
+
const interimText = interimOutputText?.trim() ?? "";
|
|
1526
|
+
const hasDescendantsSinceRunStart = listDescendantRunsForRequester(agentSessionKey).some((entry) => {
|
|
1527
|
+
const descendantStartedAt = typeof entry.startedAt === "number" ? entry.startedAt : entry.createdAt;
|
|
1528
|
+
return typeof descendantStartedAt === "number" && descendantStartedAt >= runStartedAt;
|
|
1529
|
+
});
|
|
1530
|
+
if (!interimRunResult.meta?.error && !interimRunResult.didSendViaMessagingTool && !interimPayloadHasStructuredContent && !interimPayloads.some((payload) => payload?.isError === true) && countActiveDescendantRuns(agentSessionKey) === 0 && !hasDescendantsSinceRunStart && isLikelyInterimCronMessage(interimText)) await runPrompt([
|
|
1531
|
+
"Your previous response was only an acknowledgement and did not complete this cron task.",
|
|
1532
|
+
"Complete the original task now.",
|
|
1533
|
+
"Do not send a status update like 'on it'.",
|
|
1534
|
+
"Use tools when needed, including sessions_spawn for parallel subtasks, wait for spawned subagents to finish, then return only the final summary."
|
|
1535
|
+
].join(" "));
|
|
1536
|
+
}
|
|
1537
|
+
} catch (err) {
|
|
1538
|
+
return withRunSession({
|
|
1539
|
+
status: "error",
|
|
1540
|
+
error: String(err)
|
|
1541
|
+
});
|
|
1542
|
+
}
|
|
1543
|
+
if (isAborted()) return withRunSession({
|
|
1544
|
+
status: "error",
|
|
1545
|
+
error: abortReason()
|
|
1546
|
+
});
|
|
1547
|
+
if (!runResult) return withRunSession({
|
|
1548
|
+
status: "error",
|
|
1549
|
+
error: "cron isolated run returned no result"
|
|
1550
|
+
});
|
|
1551
|
+
const finalRunResult = runResult;
|
|
1552
|
+
const payloads = finalRunResult.payloads ?? [];
|
|
1553
|
+
let telemetry;
|
|
1554
|
+
{
|
|
1555
|
+
if (finalRunResult.meta?.systemPromptReport) cronSession.sessionEntry.systemPromptReport = finalRunResult.meta.systemPromptReport;
|
|
1556
|
+
const usage = finalRunResult.meta?.agentMeta?.usage;
|
|
1557
|
+
const promptTokens = finalRunResult.meta?.agentMeta?.promptTokens;
|
|
1558
|
+
const modelUsed = finalRunResult.meta?.agentMeta?.model ?? fallbackModel ?? liveSelection.model;
|
|
1559
|
+
const providerUsed = finalRunResult.meta?.agentMeta?.provider ?? fallbackProvider ?? liveSelection.provider;
|
|
1560
|
+
const contextTokens = agentCfg?.contextTokens ?? lookupContextTokens(modelUsed, { allowAsyncLoad: false }) ?? 2e5;
|
|
1561
|
+
setSessionRuntimeModel(cronSession.sessionEntry, {
|
|
1562
|
+
provider: providerUsed,
|
|
1563
|
+
model: modelUsed
|
|
1564
|
+
});
|
|
1565
|
+
cronSession.sessionEntry.contextTokens = contextTokens;
|
|
1566
|
+
if (isCliProvider(providerUsed, cfgWithAgentDefaults)) {
|
|
1567
|
+
const cliSessionId = finalRunResult.meta?.agentMeta?.sessionId?.trim();
|
|
1568
|
+
if (cliSessionId) setCliSessionId(cronSession.sessionEntry, providerUsed, cliSessionId);
|
|
1569
|
+
}
|
|
1570
|
+
if (hasNonzeroUsage(usage)) {
|
|
1571
|
+
const input = usage.input ?? 0;
|
|
1572
|
+
const output = usage.output ?? 0;
|
|
1573
|
+
const totalTokens = deriveSessionTotalTokens({
|
|
1574
|
+
usage,
|
|
1575
|
+
contextTokens,
|
|
1576
|
+
promptTokens
|
|
1577
|
+
});
|
|
1578
|
+
const runEstimatedCostUsd = resolveNonNegativeNumber(estimateUsageCost({
|
|
1579
|
+
usage,
|
|
1580
|
+
cost: resolveModelCostConfig({
|
|
1581
|
+
provider: providerUsed,
|
|
1582
|
+
model: modelUsed,
|
|
1583
|
+
config: cfgWithAgentDefaults
|
|
1584
|
+
})
|
|
1585
|
+
}));
|
|
1586
|
+
cronSession.sessionEntry.inputTokens = input;
|
|
1587
|
+
cronSession.sessionEntry.outputTokens = output;
|
|
1588
|
+
const telemetryUsage = {
|
|
1589
|
+
input_tokens: input,
|
|
1590
|
+
output_tokens: output
|
|
1591
|
+
};
|
|
1592
|
+
if (typeof totalTokens === "number" && Number.isFinite(totalTokens) && totalTokens > 0) {
|
|
1593
|
+
cronSession.sessionEntry.totalTokens = totalTokens;
|
|
1594
|
+
cronSession.sessionEntry.totalTokensFresh = true;
|
|
1595
|
+
telemetryUsage.total_tokens = totalTokens;
|
|
1596
|
+
} else {
|
|
1597
|
+
cronSession.sessionEntry.totalTokens = void 0;
|
|
1598
|
+
cronSession.sessionEntry.totalTokensFresh = false;
|
|
1599
|
+
}
|
|
1600
|
+
cronSession.sessionEntry.cacheRead = usage.cacheRead ?? 0;
|
|
1601
|
+
cronSession.sessionEntry.cacheWrite = usage.cacheWrite ?? 0;
|
|
1602
|
+
if (runEstimatedCostUsd !== void 0) cronSession.sessionEntry.estimatedCostUsd = (resolveNonNegativeNumber(cronSession.sessionEntry.estimatedCostUsd) ?? 0) + runEstimatedCostUsd;
|
|
1603
|
+
telemetry = {
|
|
1604
|
+
model: modelUsed,
|
|
1605
|
+
provider: providerUsed,
|
|
1606
|
+
usage: telemetryUsage
|
|
1607
|
+
};
|
|
1608
|
+
} else telemetry = {
|
|
1609
|
+
model: modelUsed,
|
|
1610
|
+
provider: providerUsed
|
|
1611
|
+
};
|
|
1612
|
+
await persistSessionEntry();
|
|
1613
|
+
}
|
|
1614
|
+
if (isAborted()) return withRunSession({
|
|
1615
|
+
status: "error",
|
|
1616
|
+
error: abortReason(),
|
|
1617
|
+
...telemetry
|
|
1618
|
+
});
|
|
1619
|
+
let { summary, outputText, synthesizedText, deliveryPayloads, deliveryPayloadHasStructuredContent, hasFatalErrorPayload, embeddedRunError } = resolveCronPayloadOutcome({
|
|
1620
|
+
payloads,
|
|
1621
|
+
runLevelError: finalRunResult.meta?.error
|
|
1622
|
+
});
|
|
1623
|
+
const deliveryBestEffort = resolveCronDeliveryBestEffort(params.job);
|
|
1624
|
+
const resolveRunOutcome = (params) => withRunSession({
|
|
1625
|
+
status: hasFatalErrorPayload ? "error" : "ok",
|
|
1626
|
+
...hasFatalErrorPayload ? { error: embeddedRunError ?? "cron isolated run returned an error payload" } : {},
|
|
1627
|
+
summary,
|
|
1628
|
+
outputText,
|
|
1629
|
+
delivered: params?.delivered,
|
|
1630
|
+
deliveryAttempted: params?.deliveryAttempted,
|
|
1631
|
+
...telemetry
|
|
1632
|
+
});
|
|
1633
|
+
const ackMaxChars = resolveHeartbeatAckMaxChars(agentCfg);
|
|
1634
|
+
const skipHeartbeatDelivery = deliveryRequested && isHeartbeatOnlyResponse(payloads, ackMaxChars);
|
|
1635
|
+
const skipMessagingToolDelivery = deliveryContract === "shared" && deliveryRequested && finalRunResult.didSendViaMessagingTool === true && (finalRunResult.messagingToolSentTargets ?? []).some((target) => matchesMessagingToolDeliveryTarget(target, {
|
|
1636
|
+
channel: resolvedDelivery.channel,
|
|
1637
|
+
to: resolvedDelivery.to,
|
|
1638
|
+
accountId: resolvedDelivery.accountId
|
|
1639
|
+
}));
|
|
1640
|
+
const deliveryResult = await dispatchCronDelivery({
|
|
1641
|
+
cfg: params.cfg,
|
|
1642
|
+
cfgWithAgentDefaults,
|
|
1643
|
+
deps: params.deps,
|
|
1644
|
+
job: params.job,
|
|
1645
|
+
agentId,
|
|
1646
|
+
agentSessionKey,
|
|
1647
|
+
runSessionId,
|
|
1648
|
+
runStartedAt,
|
|
1649
|
+
runEndedAt,
|
|
1650
|
+
timeoutMs,
|
|
1651
|
+
resolvedDelivery,
|
|
1652
|
+
deliveryRequested,
|
|
1653
|
+
skipHeartbeatDelivery,
|
|
1654
|
+
skipMessagingToolDelivery,
|
|
1655
|
+
deliveryBestEffort,
|
|
1656
|
+
deliveryPayloadHasStructuredContent,
|
|
1657
|
+
deliveryPayloads,
|
|
1658
|
+
synthesizedText,
|
|
1659
|
+
summary,
|
|
1660
|
+
outputText,
|
|
1661
|
+
telemetry,
|
|
1662
|
+
abortSignal,
|
|
1663
|
+
isAborted,
|
|
1664
|
+
abortReason,
|
|
1665
|
+
withRunSession
|
|
1666
|
+
});
|
|
1667
|
+
if (deliveryResult.result) {
|
|
1668
|
+
const resultWithDeliveryMeta = {
|
|
1669
|
+
...deliveryResult.result,
|
|
1670
|
+
deliveryAttempted: deliveryResult.result.deliveryAttempted ?? deliveryResult.deliveryAttempted
|
|
1671
|
+
};
|
|
1672
|
+
if (!hasFatalErrorPayload || deliveryResult.result.status !== "ok") return resultWithDeliveryMeta;
|
|
1673
|
+
return resolveRunOutcome({
|
|
1674
|
+
delivered: deliveryResult.result.delivered,
|
|
1675
|
+
deliveryAttempted: resultWithDeliveryMeta.deliveryAttempted
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
const delivered = deliveryResult.delivered;
|
|
1679
|
+
const deliveryAttempted = deliveryResult.deliveryAttempted;
|
|
1680
|
+
summary = deliveryResult.summary;
|
|
1681
|
+
outputText = deliveryResult.outputText;
|
|
1682
|
+
return resolveRunOutcome({
|
|
1683
|
+
delivered,
|
|
1684
|
+
deliveryAttempted
|
|
1685
|
+
});
|
|
1686
|
+
}
|
|
1687
|
+
//#endregion
|
|
1688
|
+
//#region src/cron/service/initial-delivery.ts
|
|
1689
|
+
function resolveInitialCronDelivery(input) {
|
|
1690
|
+
if (input.delivery) return input.delivery;
|
|
1691
|
+
if (input.sessionTarget === "isolated" && input.payload.kind === "agentTurn") return { mode: "announce" };
|
|
1692
|
+
}
|
|
1693
|
+
//#endregion
|
|
1694
|
+
//#region src/cron/service/jobs.ts
|
|
1695
|
+
const STUCK_RUN_MS = 7200 * 1e3;
|
|
1696
|
+
const STAGGER_OFFSET_CACHE_MAX = 4096;
|
|
1697
|
+
const staggerOffsetCache = /* @__PURE__ */ new Map();
|
|
1698
|
+
function isFiniteTimestamp(value) {
|
|
1699
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
1700
|
+
}
|
|
1701
|
+
function resolveStableCronOffsetMs(jobId, staggerMs) {
|
|
1702
|
+
if (staggerMs <= 1) return 0;
|
|
1703
|
+
const cacheKey = `${staggerMs}:${jobId}`;
|
|
1704
|
+
const cached = staggerOffsetCache.get(cacheKey);
|
|
1705
|
+
if (cached !== void 0) return cached;
|
|
1706
|
+
const offset = crypto.createHash("sha256").update(jobId).digest().readUInt32BE(0) % staggerMs;
|
|
1707
|
+
if (staggerOffsetCache.size >= STAGGER_OFFSET_CACHE_MAX) {
|
|
1708
|
+
const first = staggerOffsetCache.keys().next();
|
|
1709
|
+
if (!first.done) staggerOffsetCache.delete(first.value);
|
|
1710
|
+
}
|
|
1711
|
+
staggerOffsetCache.set(cacheKey, offset);
|
|
1712
|
+
return offset;
|
|
1713
|
+
}
|
|
1714
|
+
function computeStaggeredCronNextRunAtMs(job, nowMs) {
|
|
1715
|
+
if (job.schedule.kind !== "cron") return computeNextRunAtMs(job.schedule, nowMs);
|
|
1716
|
+
const staggerMs = resolveCronStaggerMs(job.schedule);
|
|
1717
|
+
const offsetMs = resolveStableCronOffsetMs(job.id, staggerMs);
|
|
1718
|
+
if (offsetMs <= 0) return computeNextRunAtMs(job.schedule, nowMs);
|
|
1719
|
+
let cursorMs = Math.max(0, nowMs - offsetMs);
|
|
1720
|
+
for (let attempt = 0; attempt < 4; attempt += 1) {
|
|
1721
|
+
const baseNext = computeNextRunAtMs(job.schedule, cursorMs);
|
|
1722
|
+
if (baseNext === void 0) return;
|
|
1723
|
+
const shifted = baseNext + offsetMs;
|
|
1724
|
+
if (shifted > nowMs) return shifted;
|
|
1725
|
+
cursorMs = Math.max(cursorMs + 1, baseNext + 1e3);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
function computeStaggeredCronPreviousRunAtMs(job, nowMs) {
|
|
1729
|
+
if (job.schedule.kind !== "cron") return;
|
|
1730
|
+
const staggerMs = resolveCronStaggerMs(job.schedule);
|
|
1731
|
+
const offsetMs = resolveStableCronOffsetMs(job.id, staggerMs);
|
|
1732
|
+
if (offsetMs <= 0) return computePreviousRunAtMs(job.schedule, nowMs);
|
|
1733
|
+
let cursorMs = Math.max(0, nowMs - offsetMs);
|
|
1734
|
+
for (let attempt = 0; attempt < 4; attempt += 1) {
|
|
1735
|
+
const basePrevious = computePreviousRunAtMs(job.schedule, cursorMs);
|
|
1736
|
+
if (basePrevious === void 0) return;
|
|
1737
|
+
const shifted = basePrevious + offsetMs;
|
|
1738
|
+
if (shifted <= nowMs) return shifted;
|
|
1739
|
+
cursorMs = Math.max(0, basePrevious - 1e3);
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
function resolveEveryAnchorMs(params) {
|
|
1743
|
+
const coerced = coerceFiniteScheduleNumber(params.schedule.anchorMs);
|
|
1744
|
+
if (coerced !== void 0) return Math.max(0, Math.floor(coerced));
|
|
1745
|
+
if (isFiniteTimestamp(params.fallbackAnchorMs)) return Math.max(0, Math.floor(params.fallbackAnchorMs));
|
|
1746
|
+
return 0;
|
|
1747
|
+
}
|
|
1748
|
+
function assertSupportedJobSpec(job) {
|
|
1749
|
+
const isIsolatedLike = job.sessionTarget === "isolated" || job.sessionTarget === "current" || job.sessionTarget.startsWith("session:");
|
|
1750
|
+
if (job.sessionTarget === "main" && job.payload.kind !== "systemEvent") throw new Error("main cron jobs require payload.kind=\"systemEvent\"");
|
|
1751
|
+
if (isIsolatedLike && job.payload.kind !== "agentTurn") throw new Error("isolated/current/session cron jobs require payload.kind=\"agentTurn\"");
|
|
1752
|
+
}
|
|
1753
|
+
function assertMainSessionAgentId(job, defaultAgentId) {
|
|
1754
|
+
if (job.sessionTarget !== "main") return;
|
|
1755
|
+
if (!job.agentId) return;
|
|
1756
|
+
if (normalizeAgentId(job.agentId) !== normalizeAgentId(defaultAgentId)) throw new Error(`cron: sessionTarget "main" is only valid for the default agent. Use sessionTarget "isolated" with payload.kind "agentTurn" for non-default agents (agentId: ${job.agentId})`);
|
|
1757
|
+
}
|
|
1758
|
+
const TELEGRAM_TME_URL_REGEX = /^https?:\/\/t\.me\/|t\.me\//i;
|
|
1759
|
+
const TELEGRAM_SLASH_TOPIC_REGEX = /^-?\d+\/\d+$/;
|
|
1760
|
+
function validateTelegramDeliveryTarget(to) {
|
|
1761
|
+
if (!to) return;
|
|
1762
|
+
const trimmed = to.trim();
|
|
1763
|
+
if (TELEGRAM_TME_URL_REGEX.test(trimmed)) return;
|
|
1764
|
+
if (TELEGRAM_SLASH_TOPIC_REGEX.test(trimmed)) return `Invalid Telegram delivery target "${to}". Use colon (:) as delimiter for topics, not slash. Valid formats: -1001234567890, -1001234567890:123, -1001234567890:topic:123, @username, https://t.me/username`;
|
|
1765
|
+
}
|
|
1766
|
+
function assertDeliverySupport(job) {
|
|
1767
|
+
if (!job.delivery || job.delivery.mode === "none") return;
|
|
1768
|
+
if (job.delivery.mode === "webhook") {
|
|
1769
|
+
const target = normalizeHttpWebhookUrl(job.delivery.to);
|
|
1770
|
+
if (!target) throw new Error("cron webhook delivery requires delivery.to to be a valid http(s) URL");
|
|
1771
|
+
job.delivery.to = target;
|
|
1772
|
+
return;
|
|
1773
|
+
}
|
|
1774
|
+
if (!(job.sessionTarget === "isolated" || job.sessionTarget === "current" || job.sessionTarget.startsWith("session:"))) throw new Error("cron channel delivery config is only supported for sessionTarget=\"isolated\"");
|
|
1775
|
+
if (job.delivery.channel === "telegram") {
|
|
1776
|
+
const telegramError = validateTelegramDeliveryTarget(job.delivery.to);
|
|
1777
|
+
if (telegramError) throw new Error(telegramError);
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
function assertFailureDestinationSupport(job) {
|
|
1781
|
+
const failureDestination = job.delivery?.failureDestination;
|
|
1782
|
+
if (!failureDestination) return;
|
|
1783
|
+
if (job.sessionTarget === "main" && job.delivery?.mode !== "webhook") throw new Error("cron delivery.failureDestination is only supported for sessionTarget=\"isolated\" unless delivery.mode=\"webhook\"");
|
|
1784
|
+
if (failureDestination.mode === "webhook") {
|
|
1785
|
+
const target = normalizeHttpWebhookUrl(failureDestination.to);
|
|
1786
|
+
if (!target) throw new Error("cron failure destination webhook requires delivery.failureDestination.to to be a valid http(s) URL");
|
|
1787
|
+
failureDestination.to = target;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
function findJobOrThrow(state, id) {
|
|
1791
|
+
const job = state.store?.jobs.find((j) => j.id === id);
|
|
1792
|
+
if (!job) throw new Error(`unknown cron job id: ${id}`);
|
|
1793
|
+
return job;
|
|
1794
|
+
}
|
|
1795
|
+
function isJobEnabled(job) {
|
|
1796
|
+
return job.enabled ?? true;
|
|
1797
|
+
}
|
|
1798
|
+
function computeJobNextRunAtMs(job, nowMs) {
|
|
1799
|
+
if (!isJobEnabled(job)) return;
|
|
1800
|
+
if (job.schedule.kind === "every") {
|
|
1801
|
+
const everyMsRaw = coerceFiniteScheduleNumber(job.schedule.everyMs);
|
|
1802
|
+
if (everyMsRaw === void 0) return;
|
|
1803
|
+
const everyMs = Math.max(1, Math.floor(everyMsRaw));
|
|
1804
|
+
const lastRunAtMs = job.state.lastRunAtMs;
|
|
1805
|
+
if (typeof lastRunAtMs === "number" && Number.isFinite(lastRunAtMs)) {
|
|
1806
|
+
const nextFromLastRun = Math.floor(lastRunAtMs) + everyMs;
|
|
1807
|
+
if (nextFromLastRun > nowMs) return nextFromLastRun;
|
|
1808
|
+
}
|
|
1809
|
+
const fallbackAnchorMs = isFiniteTimestamp(job.createdAtMs) ? job.createdAtMs : nowMs;
|
|
1810
|
+
const anchorMs = resolveEveryAnchorMs({
|
|
1811
|
+
schedule: job.schedule,
|
|
1812
|
+
fallbackAnchorMs
|
|
1813
|
+
});
|
|
1814
|
+
const next = computeNextRunAtMs({
|
|
1815
|
+
...job.schedule,
|
|
1816
|
+
everyMs,
|
|
1817
|
+
anchorMs
|
|
1818
|
+
}, nowMs);
|
|
1819
|
+
return isFiniteTimestamp(next) ? next : void 0;
|
|
1820
|
+
}
|
|
1821
|
+
if (job.schedule.kind === "at") {
|
|
1822
|
+
const schedule = job.schedule;
|
|
1823
|
+
const atMs = typeof schedule.atMs === "number" && Number.isFinite(schedule.atMs) && schedule.atMs > 0 ? schedule.atMs : typeof schedule.atMs === "string" ? parseAbsoluteTimeMs(schedule.atMs) : typeof schedule.at === "string" ? parseAbsoluteTimeMs(schedule.at) : null;
|
|
1824
|
+
if (job.state.lastStatus === "ok" && job.state.lastRunAtMs) {
|
|
1825
|
+
if (atMs !== null && Number.isFinite(atMs) && atMs > job.state.lastRunAtMs) return atMs;
|
|
1826
|
+
return;
|
|
1827
|
+
}
|
|
1828
|
+
return atMs !== null && Number.isFinite(atMs) ? atMs : void 0;
|
|
1829
|
+
}
|
|
1830
|
+
const next = computeStaggeredCronNextRunAtMs(job, nowMs);
|
|
1831
|
+
if (next === void 0 && job.schedule.kind === "cron") return computeStaggeredCronNextRunAtMs(job, Math.floor(nowMs / 1e3) * 1e3 + 1e3);
|
|
1832
|
+
return isFiniteTimestamp(next) ? next : void 0;
|
|
1833
|
+
}
|
|
1834
|
+
function computeJobPreviousRunAtMs(job, nowMs) {
|
|
1835
|
+
if (!isJobEnabled(job) || job.schedule.kind !== "cron") return;
|
|
1836
|
+
const previous = computeStaggeredCronPreviousRunAtMs(job, nowMs);
|
|
1837
|
+
return isFiniteTimestamp(previous) ? previous : void 0;
|
|
1838
|
+
}
|
|
1839
|
+
/** Maximum consecutive schedule errors before auto-disabling a job. */
|
|
1840
|
+
const MAX_SCHEDULE_ERRORS = 3;
|
|
1841
|
+
function recordScheduleComputeError(params) {
|
|
1842
|
+
const { state, job, err } = params;
|
|
1843
|
+
const errorCount = (job.state.scheduleErrorCount ?? 0) + 1;
|
|
1844
|
+
const errText = String(err);
|
|
1845
|
+
job.state.scheduleErrorCount = errorCount;
|
|
1846
|
+
job.state.nextRunAtMs = void 0;
|
|
1847
|
+
job.state.lastError = `schedule error: ${errText}`;
|
|
1848
|
+
if (errorCount >= MAX_SCHEDULE_ERRORS) {
|
|
1849
|
+
job.enabled = false;
|
|
1850
|
+
state.deps.log.error({
|
|
1851
|
+
jobId: job.id,
|
|
1852
|
+
name: job.name,
|
|
1853
|
+
errorCount,
|
|
1854
|
+
err: errText
|
|
1855
|
+
}, "cron: auto-disabled job after repeated schedule errors");
|
|
1856
|
+
const notifyText = `⚠️ Cron job "${job.name}" has been auto-disabled after ${errorCount} consecutive schedule errors. Last error: ${errText}`;
|
|
1857
|
+
state.deps.enqueueSystemEvent(notifyText, {
|
|
1858
|
+
agentId: job.agentId,
|
|
1859
|
+
sessionKey: job.sessionKey,
|
|
1860
|
+
contextKey: `cron:${job.id}:auto-disabled`
|
|
1861
|
+
});
|
|
1862
|
+
state.deps.requestHeartbeatNow({
|
|
1863
|
+
reason: `cron:${job.id}:auto-disabled`,
|
|
1864
|
+
agentId: job.agentId,
|
|
1865
|
+
sessionKey: job.sessionKey
|
|
1866
|
+
});
|
|
1867
|
+
} else state.deps.log.warn({
|
|
1868
|
+
jobId: job.id,
|
|
1869
|
+
name: job.name,
|
|
1870
|
+
errorCount,
|
|
1871
|
+
err: errText
|
|
1872
|
+
}, "cron: failed to compute next run for job (skipping)");
|
|
1873
|
+
return true;
|
|
1874
|
+
}
|
|
1875
|
+
function normalizeJobTickState(params) {
|
|
1876
|
+
const { state, job, nowMs } = params;
|
|
1877
|
+
let changed = false;
|
|
1878
|
+
if (!job.state) {
|
|
1879
|
+
job.state = {};
|
|
1880
|
+
changed = true;
|
|
1881
|
+
}
|
|
1882
|
+
if (job.schedule.kind === "every") {
|
|
1883
|
+
const normalizedAnchorMs = resolveEveryAnchorMs({
|
|
1884
|
+
schedule: job.schedule,
|
|
1885
|
+
fallbackAnchorMs: isFiniteTimestamp(job.createdAtMs) ? job.createdAtMs : nowMs
|
|
1886
|
+
});
|
|
1887
|
+
if (job.schedule.anchorMs !== normalizedAnchorMs) {
|
|
1888
|
+
job.schedule = {
|
|
1889
|
+
...job.schedule,
|
|
1890
|
+
anchorMs: normalizedAnchorMs
|
|
1891
|
+
};
|
|
1892
|
+
changed = true;
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
if (!isJobEnabled(job)) {
|
|
1896
|
+
if (job.state.nextRunAtMs !== void 0) {
|
|
1897
|
+
job.state.nextRunAtMs = void 0;
|
|
1898
|
+
changed = true;
|
|
1899
|
+
}
|
|
1900
|
+
if (job.state.runningAtMs !== void 0) {
|
|
1901
|
+
job.state.runningAtMs = void 0;
|
|
1902
|
+
changed = true;
|
|
1903
|
+
}
|
|
1904
|
+
return {
|
|
1905
|
+
changed,
|
|
1906
|
+
skip: true
|
|
1907
|
+
};
|
|
1908
|
+
}
|
|
1909
|
+
if (!isFiniteTimestamp(job.state.nextRunAtMs) && job.state.nextRunAtMs !== void 0) {
|
|
1910
|
+
job.state.nextRunAtMs = void 0;
|
|
1911
|
+
changed = true;
|
|
1912
|
+
}
|
|
1913
|
+
const runningAt = job.state.runningAtMs;
|
|
1914
|
+
if (typeof runningAt === "number" && nowMs - runningAt > STUCK_RUN_MS) {
|
|
1915
|
+
state.deps.log.warn({
|
|
1916
|
+
jobId: job.id,
|
|
1917
|
+
runningAtMs: runningAt
|
|
1918
|
+
}, "cron: clearing stuck running marker");
|
|
1919
|
+
job.state.runningAtMs = void 0;
|
|
1920
|
+
changed = true;
|
|
1921
|
+
}
|
|
1922
|
+
return {
|
|
1923
|
+
changed,
|
|
1924
|
+
skip: false
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
function walkSchedulableJobs(state, fn, nowMs = state.deps.nowMs()) {
|
|
1928
|
+
if (!state.store) return false;
|
|
1929
|
+
let changed = false;
|
|
1930
|
+
for (const job of state.store.jobs) {
|
|
1931
|
+
const tick = normalizeJobTickState({
|
|
1932
|
+
state,
|
|
1933
|
+
job,
|
|
1934
|
+
nowMs
|
|
1935
|
+
});
|
|
1936
|
+
if (tick.changed) changed = true;
|
|
1937
|
+
if (tick.skip) continue;
|
|
1938
|
+
if (fn({
|
|
1939
|
+
job,
|
|
1940
|
+
nowMs
|
|
1941
|
+
})) changed = true;
|
|
1942
|
+
}
|
|
1943
|
+
return changed;
|
|
1944
|
+
}
|
|
1945
|
+
function recomputeJobNextRunAtMs(params) {
|
|
1946
|
+
let changed = false;
|
|
1947
|
+
try {
|
|
1948
|
+
const newNext = computeJobNextRunAtMs(params.job, params.nowMs);
|
|
1949
|
+
if (params.job.state.nextRunAtMs !== newNext) {
|
|
1950
|
+
params.job.state.nextRunAtMs = newNext;
|
|
1951
|
+
changed = true;
|
|
1952
|
+
}
|
|
1953
|
+
if (params.job.state.scheduleErrorCount) {
|
|
1954
|
+
params.job.state.scheduleErrorCount = void 0;
|
|
1955
|
+
changed = true;
|
|
1956
|
+
}
|
|
1957
|
+
} catch (err) {
|
|
1958
|
+
if (recordScheduleComputeError({
|
|
1959
|
+
state: params.state,
|
|
1960
|
+
job: params.job,
|
|
1961
|
+
err
|
|
1962
|
+
})) changed = true;
|
|
1963
|
+
}
|
|
1964
|
+
return changed;
|
|
1965
|
+
}
|
|
1966
|
+
function recomputeNextRuns(state) {
|
|
1967
|
+
return walkSchedulableJobs(state, ({ job, nowMs: now }) => {
|
|
1968
|
+
let changed = false;
|
|
1969
|
+
const nextRun = job.state.nextRunAtMs;
|
|
1970
|
+
if (!isFiniteTimestamp(nextRun) || now >= nextRun) {
|
|
1971
|
+
if (recomputeJobNextRunAtMs({
|
|
1972
|
+
state,
|
|
1973
|
+
job,
|
|
1974
|
+
nowMs: now
|
|
1975
|
+
})) changed = true;
|
|
1976
|
+
}
|
|
1977
|
+
return changed;
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
/**
|
|
1981
|
+
* Maintenance-only version of recomputeNextRuns that handles disabled jobs
|
|
1982
|
+
* and stuck markers, but does NOT recompute nextRunAtMs for enabled jobs
|
|
1983
|
+
* with existing values. Used during timer ticks when no due jobs were found
|
|
1984
|
+
* to prevent silently advancing past-due nextRunAtMs values without execution
|
|
1985
|
+
* (see #13992).
|
|
1986
|
+
*/
|
|
1987
|
+
function recomputeNextRunsForMaintenance(state, opts) {
|
|
1988
|
+
const recomputeExpired = opts?.recomputeExpired ?? false;
|
|
1989
|
+
return walkSchedulableJobs(state, ({ job, nowMs: now }) => {
|
|
1990
|
+
let changed = false;
|
|
1991
|
+
if (!isFiniteTimestamp(job.state.nextRunAtMs)) {
|
|
1992
|
+
if (recomputeJobNextRunAtMs({
|
|
1993
|
+
state,
|
|
1994
|
+
job,
|
|
1995
|
+
nowMs: now
|
|
1996
|
+
})) changed = true;
|
|
1997
|
+
} else if (recomputeExpired && now >= job.state.nextRunAtMs && typeof job.state.runningAtMs !== "number") {
|
|
1998
|
+
const lastRun = job.state.lastRunAtMs;
|
|
1999
|
+
if (isFiniteTimestamp(lastRun) && lastRun >= job.state.nextRunAtMs) {
|
|
2000
|
+
if (recomputeJobNextRunAtMs({
|
|
2001
|
+
state,
|
|
2002
|
+
job,
|
|
2003
|
+
nowMs: now
|
|
2004
|
+
})) changed = true;
|
|
2005
|
+
}
|
|
2006
|
+
}
|
|
2007
|
+
return changed;
|
|
2008
|
+
}, opts?.nowMs);
|
|
2009
|
+
}
|
|
2010
|
+
function nextWakeAtMs(state) {
|
|
2011
|
+
const enabled = (state.store?.jobs ?? []).filter((j) => j.enabled && isFiniteTimestamp(j.state.nextRunAtMs));
|
|
2012
|
+
if (enabled.length === 0) return;
|
|
2013
|
+
const first = enabled[0]?.state.nextRunAtMs;
|
|
2014
|
+
if (!isFiniteTimestamp(first)) return;
|
|
2015
|
+
return enabled.reduce((min, j) => {
|
|
2016
|
+
const next = j.state.nextRunAtMs;
|
|
2017
|
+
return isFiniteTimestamp(next) ? Math.min(min, next) : min;
|
|
2018
|
+
}, first);
|
|
2019
|
+
}
|
|
2020
|
+
function createJob(state, input) {
|
|
2021
|
+
const now = state.deps.nowMs();
|
|
2022
|
+
const id = crypto.randomUUID();
|
|
2023
|
+
const schedule = input.schedule.kind === "every" ? {
|
|
2024
|
+
...input.schedule,
|
|
2025
|
+
anchorMs: resolveEveryAnchorMs({
|
|
2026
|
+
schedule: input.schedule,
|
|
2027
|
+
fallbackAnchorMs: now
|
|
2028
|
+
})
|
|
2029
|
+
} : input.schedule.kind === "cron" ? (() => {
|
|
2030
|
+
const explicitStaggerMs = normalizeCronStaggerMs(input.schedule.staggerMs);
|
|
2031
|
+
if (explicitStaggerMs !== void 0) return {
|
|
2032
|
+
...input.schedule,
|
|
2033
|
+
staggerMs: explicitStaggerMs
|
|
2034
|
+
};
|
|
2035
|
+
const defaultStaggerMs = resolveDefaultCronStaggerMs(input.schedule.expr);
|
|
2036
|
+
return defaultStaggerMs !== void 0 ? {
|
|
2037
|
+
...input.schedule,
|
|
2038
|
+
staggerMs: defaultStaggerMs
|
|
2039
|
+
} : input.schedule;
|
|
2040
|
+
})() : input.schedule;
|
|
2041
|
+
const deleteAfterRun = typeof input.deleteAfterRun === "boolean" ? input.deleteAfterRun : schedule.kind === "at" ? true : void 0;
|
|
2042
|
+
const enabled = typeof input.enabled === "boolean" ? input.enabled : true;
|
|
2043
|
+
const job = {
|
|
2044
|
+
id,
|
|
2045
|
+
agentId: normalizeOptionalAgentId(input.agentId),
|
|
2046
|
+
sessionKey: normalizeOptionalSessionKey(input.sessionKey),
|
|
2047
|
+
name: normalizeRequiredName(input.name),
|
|
2048
|
+
description: normalizeOptionalText(input.description),
|
|
2049
|
+
enabled,
|
|
2050
|
+
deleteAfterRun,
|
|
2051
|
+
createdAtMs: now,
|
|
2052
|
+
updatedAtMs: now,
|
|
2053
|
+
schedule,
|
|
2054
|
+
sessionTarget: input.sessionTarget,
|
|
2055
|
+
wakeMode: input.wakeMode,
|
|
2056
|
+
payload: input.payload,
|
|
2057
|
+
delivery: resolveInitialCronDelivery(input),
|
|
2058
|
+
failureAlert: input.failureAlert,
|
|
2059
|
+
state: { ...input.state }
|
|
2060
|
+
};
|
|
2061
|
+
assertSupportedJobSpec(job);
|
|
2062
|
+
assertMainSessionAgentId(job, state.deps.defaultAgentId);
|
|
2063
|
+
assertDeliverySupport(job);
|
|
2064
|
+
assertFailureDestinationSupport(job);
|
|
2065
|
+
job.state.nextRunAtMs = computeJobNextRunAtMs(job, now);
|
|
2066
|
+
return job;
|
|
2067
|
+
}
|
|
2068
|
+
function applyJobPatch(job, patch, opts) {
|
|
2069
|
+
if ("name" in patch) job.name = normalizeRequiredName(patch.name);
|
|
2070
|
+
if ("description" in patch) job.description = normalizeOptionalText(patch.description);
|
|
2071
|
+
if (typeof patch.enabled === "boolean") job.enabled = patch.enabled;
|
|
2072
|
+
if (typeof patch.deleteAfterRun === "boolean") job.deleteAfterRun = patch.deleteAfterRun;
|
|
2073
|
+
if (patch.schedule) if (patch.schedule.kind === "cron") {
|
|
2074
|
+
const explicitStaggerMs = normalizeCronStaggerMs(patch.schedule.staggerMs);
|
|
2075
|
+
if (explicitStaggerMs !== void 0) job.schedule = {
|
|
2076
|
+
...patch.schedule,
|
|
2077
|
+
staggerMs: explicitStaggerMs
|
|
2078
|
+
};
|
|
2079
|
+
else if (job.schedule.kind === "cron") job.schedule = {
|
|
2080
|
+
...patch.schedule,
|
|
2081
|
+
staggerMs: job.schedule.staggerMs
|
|
2082
|
+
};
|
|
2083
|
+
else {
|
|
2084
|
+
const defaultStaggerMs = resolveDefaultCronStaggerMs(patch.schedule.expr);
|
|
2085
|
+
job.schedule = defaultStaggerMs !== void 0 ? {
|
|
2086
|
+
...patch.schedule,
|
|
2087
|
+
staggerMs: defaultStaggerMs
|
|
2088
|
+
} : patch.schedule;
|
|
2089
|
+
}
|
|
2090
|
+
} else job.schedule = patch.schedule;
|
|
2091
|
+
if (patch.sessionTarget) job.sessionTarget = patch.sessionTarget;
|
|
2092
|
+
if (patch.wakeMode) job.wakeMode = patch.wakeMode;
|
|
2093
|
+
if (patch.payload) job.payload = mergeCronPayload(job.payload, patch.payload);
|
|
2094
|
+
if (patch.delivery) job.delivery = mergeCronDelivery(job.delivery, patch.delivery);
|
|
2095
|
+
if ("failureAlert" in patch) job.failureAlert = mergeCronFailureAlert(job.failureAlert, patch.failureAlert);
|
|
2096
|
+
if (job.sessionTarget === "main" && job.delivery?.mode !== "webhook" && job.delivery?.failureDestination) throw new Error("cron delivery.failureDestination is only supported for sessionTarget=\"isolated\" unless delivery.mode=\"webhook\"");
|
|
2097
|
+
if (job.sessionTarget === "main" && job.delivery?.mode !== "webhook") job.delivery = void 0;
|
|
2098
|
+
if (patch.state) job.state = {
|
|
2099
|
+
...job.state,
|
|
2100
|
+
...patch.state
|
|
2101
|
+
};
|
|
2102
|
+
if ("agentId" in patch) job.agentId = normalizeOptionalAgentId(patch.agentId);
|
|
2103
|
+
if ("sessionKey" in patch) job.sessionKey = normalizeOptionalSessionKey(patch.sessionKey);
|
|
2104
|
+
assertSupportedJobSpec(job);
|
|
2105
|
+
assertMainSessionAgentId(job, opts?.defaultAgentId);
|
|
2106
|
+
assertDeliverySupport(job);
|
|
2107
|
+
assertFailureDestinationSupport(job);
|
|
2108
|
+
}
|
|
2109
|
+
function mergeCronPayload(existing, patch) {
|
|
2110
|
+
if (patch.kind !== existing.kind) return buildPayloadFromPatch(patch);
|
|
2111
|
+
if (patch.kind === "systemEvent") {
|
|
2112
|
+
if (existing.kind !== "systemEvent") return buildPayloadFromPatch(patch);
|
|
2113
|
+
return {
|
|
2114
|
+
kind: "systemEvent",
|
|
2115
|
+
text: typeof patch.text === "string" ? patch.text : existing.text
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
if (existing.kind !== "agentTurn") return buildPayloadFromPatch(patch);
|
|
2119
|
+
const next = { ...existing };
|
|
2120
|
+
if (typeof patch.message === "string") next.message = patch.message;
|
|
2121
|
+
if (typeof patch.model === "string") next.model = patch.model;
|
|
2122
|
+
if (Array.isArray(patch.fallbacks)) next.fallbacks = patch.fallbacks;
|
|
2123
|
+
if (Array.isArray(patch.toolsAllow)) next.toolsAllow = patch.toolsAllow;
|
|
2124
|
+
else if (patch.toolsAllow === null) delete next.toolsAllow;
|
|
2125
|
+
if (typeof patch.thinking === "string") next.thinking = patch.thinking;
|
|
2126
|
+
if (typeof patch.timeoutSeconds === "number") next.timeoutSeconds = patch.timeoutSeconds;
|
|
2127
|
+
if (typeof patch.lightContext === "boolean") next.lightContext = patch.lightContext;
|
|
2128
|
+
if (typeof patch.allowUnsafeExternalContent === "boolean") next.allowUnsafeExternalContent = patch.allowUnsafeExternalContent;
|
|
2129
|
+
return next;
|
|
2130
|
+
}
|
|
2131
|
+
function buildPayloadFromPatch(patch) {
|
|
2132
|
+
if (patch.kind === "systemEvent") {
|
|
2133
|
+
if (typeof patch.text !== "string" || patch.text.length === 0) throw new Error("cron.update payload.kind=\"systemEvent\" requires text");
|
|
2134
|
+
return {
|
|
2135
|
+
kind: "systemEvent",
|
|
2136
|
+
text: patch.text
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
if (typeof patch.message !== "string" || patch.message.length === 0) throw new Error("cron.update payload.kind=\"agentTurn\" requires message");
|
|
2140
|
+
return {
|
|
2141
|
+
kind: "agentTurn",
|
|
2142
|
+
message: patch.message,
|
|
2143
|
+
model: patch.model,
|
|
2144
|
+
fallbacks: patch.fallbacks,
|
|
2145
|
+
toolsAllow: Array.isArray(patch.toolsAllow) ? patch.toolsAllow : void 0,
|
|
2146
|
+
thinking: patch.thinking,
|
|
2147
|
+
timeoutSeconds: patch.timeoutSeconds,
|
|
2148
|
+
lightContext: patch.lightContext,
|
|
2149
|
+
allowUnsafeExternalContent: patch.allowUnsafeExternalContent
|
|
2150
|
+
};
|
|
2151
|
+
}
|
|
2152
|
+
function normalizeOptionalTrimmedString(value) {
|
|
2153
|
+
const trimmed = typeof value === "string" ? value.trim() : "";
|
|
2154
|
+
return trimmed ? trimmed : void 0;
|
|
2155
|
+
}
|
|
2156
|
+
function normalizeOptionalThreadId(value) {
|
|
2157
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
2158
|
+
return normalizeOptionalTrimmedString(value);
|
|
2159
|
+
}
|
|
2160
|
+
function mergeCronDelivery(existing, patch) {
|
|
2161
|
+
const next = {
|
|
2162
|
+
mode: existing?.mode ?? "none",
|
|
2163
|
+
channel: existing?.channel,
|
|
2164
|
+
to: existing?.to,
|
|
2165
|
+
threadId: existing?.threadId,
|
|
2166
|
+
accountId: existing?.accountId,
|
|
2167
|
+
bestEffort: existing?.bestEffort,
|
|
2168
|
+
failureDestination: existing?.failureDestination
|
|
2169
|
+
};
|
|
2170
|
+
if (typeof patch.mode === "string") next.mode = patch.mode === "deliver" ? "announce" : patch.mode;
|
|
2171
|
+
if ("channel" in patch) next.channel = normalizeOptionalTrimmedString(patch.channel);
|
|
2172
|
+
if ("to" in patch) next.to = normalizeOptionalTrimmedString(patch.to);
|
|
2173
|
+
if ("threadId" in patch) next.threadId = normalizeOptionalThreadId(patch.threadId);
|
|
2174
|
+
if ("accountId" in patch) next.accountId = normalizeOptionalTrimmedString(patch.accountId);
|
|
2175
|
+
if (typeof patch.bestEffort === "boolean") next.bestEffort = patch.bestEffort;
|
|
2176
|
+
if ("failureDestination" in patch) if (patch.failureDestination === void 0) next.failureDestination = void 0;
|
|
2177
|
+
else {
|
|
2178
|
+
const existingFd = next.failureDestination;
|
|
2179
|
+
const patchFd = patch.failureDestination;
|
|
2180
|
+
const nextFd = {
|
|
2181
|
+
channel: existingFd?.channel,
|
|
2182
|
+
to: existingFd?.to,
|
|
2183
|
+
accountId: existingFd?.accountId,
|
|
2184
|
+
mode: existingFd?.mode
|
|
2185
|
+
};
|
|
2186
|
+
if (patchFd) {
|
|
2187
|
+
if ("channel" in patchFd) {
|
|
2188
|
+
const channel = typeof patchFd.channel === "string" ? patchFd.channel.trim() : "";
|
|
2189
|
+
nextFd.channel = channel ? channel : void 0;
|
|
2190
|
+
}
|
|
2191
|
+
if ("to" in patchFd) {
|
|
2192
|
+
const to = typeof patchFd.to === "string" ? patchFd.to.trim() : "";
|
|
2193
|
+
nextFd.to = to ? to : void 0;
|
|
2194
|
+
}
|
|
2195
|
+
if ("accountId" in patchFd) {
|
|
2196
|
+
const accountId = typeof patchFd.accountId === "string" ? patchFd.accountId.trim() : "";
|
|
2197
|
+
nextFd.accountId = accountId ? accountId : void 0;
|
|
2198
|
+
}
|
|
2199
|
+
if ("mode" in patchFd) {
|
|
2200
|
+
const mode = typeof patchFd.mode === "string" ? patchFd.mode.trim() : "";
|
|
2201
|
+
nextFd.mode = mode === "announce" || mode === "webhook" ? mode : void 0;
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
next.failureDestination = nextFd;
|
|
2205
|
+
}
|
|
2206
|
+
return next;
|
|
2207
|
+
}
|
|
2208
|
+
function mergeCronFailureAlert(existing, patch) {
|
|
2209
|
+
if (patch === false) return false;
|
|
2210
|
+
if (patch === void 0) return existing;
|
|
2211
|
+
const next = { ...existing === false || existing === void 0 ? {} : existing };
|
|
2212
|
+
if ("after" in patch) {
|
|
2213
|
+
const after = typeof patch.after === "number" && Number.isFinite(patch.after) ? patch.after : 0;
|
|
2214
|
+
next.after = after > 0 ? Math.floor(after) : void 0;
|
|
2215
|
+
}
|
|
2216
|
+
if ("channel" in patch) next.channel = normalizeOptionalTrimmedString(patch.channel);
|
|
2217
|
+
if ("to" in patch) next.to = normalizeOptionalTrimmedString(patch.to);
|
|
2218
|
+
if ("cooldownMs" in patch) {
|
|
2219
|
+
const cooldownMs = typeof patch.cooldownMs === "number" && Number.isFinite(patch.cooldownMs) ? patch.cooldownMs : -1;
|
|
2220
|
+
next.cooldownMs = cooldownMs >= 0 ? Math.floor(cooldownMs) : void 0;
|
|
2221
|
+
}
|
|
2222
|
+
if ("mode" in patch) {
|
|
2223
|
+
const mode = typeof patch.mode === "string" ? patch.mode.trim() : "";
|
|
2224
|
+
next.mode = mode === "announce" || mode === "webhook" ? mode : void 0;
|
|
2225
|
+
}
|
|
2226
|
+
if ("accountId" in patch) {
|
|
2227
|
+
const accountId = typeof patch.accountId === "string" ? patch.accountId.trim() : "";
|
|
2228
|
+
next.accountId = accountId ? accountId : void 0;
|
|
2229
|
+
}
|
|
2230
|
+
return next;
|
|
2231
|
+
}
|
|
2232
|
+
function isJobDue(job, nowMs, opts) {
|
|
2233
|
+
if (!job.state) job.state = {};
|
|
2234
|
+
if (typeof job.state.runningAtMs === "number") return false;
|
|
2235
|
+
if (opts.forced) return true;
|
|
2236
|
+
return isJobEnabled(job) && typeof job.state.nextRunAtMs === "number" && nowMs >= job.state.nextRunAtMs;
|
|
2237
|
+
}
|
|
2238
|
+
function resolveJobPayloadTextForMain(job) {
|
|
2239
|
+
if (job.payload.kind !== "systemEvent") return;
|
|
2240
|
+
const text = normalizePayloadToSystemText(job.payload);
|
|
2241
|
+
return text.trim() ? text : void 0;
|
|
2242
|
+
}
|
|
2243
|
+
//#endregion
|
|
2244
|
+
//#region src/cron/service/locked.ts
|
|
2245
|
+
const storeLocks = /* @__PURE__ */ new Map();
|
|
2246
|
+
const resolveChain = (promise) => promise.then(() => void 0, () => void 0);
|
|
2247
|
+
async function locked(state, fn) {
|
|
2248
|
+
const storePath = state.deps.storePath;
|
|
2249
|
+
const storeOp = storeLocks.get(storePath) ?? Promise.resolve();
|
|
2250
|
+
const next = Promise.all([resolveChain(state.op), resolveChain(storeOp)]).then(fn);
|
|
2251
|
+
const keepAlive = resolveChain(next);
|
|
2252
|
+
state.op = keepAlive;
|
|
2253
|
+
storeLocks.set(storePath, keepAlive);
|
|
2254
|
+
return await next;
|
|
2255
|
+
}
|
|
2256
|
+
//#endregion
|
|
2257
|
+
//#region src/cron/service/store.ts
|
|
2258
|
+
async function getFileMtimeMs(path) {
|
|
2259
|
+
try {
|
|
2260
|
+
return (await fsSync.promises.stat(path)).mtimeMs;
|
|
2261
|
+
} catch {
|
|
2262
|
+
return null;
|
|
2263
|
+
}
|
|
2264
|
+
}
|
|
2265
|
+
async function ensureLoaded(state, opts) {
|
|
2266
|
+
if (state.store && !opts?.forceReload) return;
|
|
2267
|
+
const fileMtimeMs = await getFileMtimeMs(state.deps.storePath);
|
|
2268
|
+
const jobs = (await loadCronStore(state.deps.storePath)).jobs ?? [];
|
|
2269
|
+
for (const job of jobs) if (typeof job.enabled !== "boolean") job.enabled = true;
|
|
2270
|
+
state.store = {
|
|
2271
|
+
version: 1,
|
|
2272
|
+
jobs
|
|
2273
|
+
};
|
|
2274
|
+
state.storeLoadedAtMs = state.deps.nowMs();
|
|
2275
|
+
state.storeFileMtimeMs = fileMtimeMs;
|
|
2276
|
+
if (!opts?.skipRecompute) recomputeNextRuns(state);
|
|
2277
|
+
}
|
|
2278
|
+
function warnIfDisabled(state, action) {
|
|
2279
|
+
if (state.deps.cronEnabled) return;
|
|
2280
|
+
if (state.warnedDisabled) return;
|
|
2281
|
+
state.warnedDisabled = true;
|
|
2282
|
+
state.deps.log.warn({
|
|
2283
|
+
enabled: false,
|
|
2284
|
+
action,
|
|
2285
|
+
storePath: state.deps.storePath
|
|
2286
|
+
}, "cron: scheduler disabled; jobs will not run automatically");
|
|
2287
|
+
}
|
|
2288
|
+
async function persist(state, opts) {
|
|
2289
|
+
if (!state.store) return;
|
|
2290
|
+
await saveCronStore(state.deps.storePath, state.store, opts);
|
|
2291
|
+
state.storeFileMtimeMs = await getFileMtimeMs(state.deps.storePath);
|
|
2292
|
+
}
|
|
2293
|
+
//#endregion
|
|
2294
|
+
//#region src/cron/session-reaper.ts
|
|
2295
|
+
/**
|
|
2296
|
+
* Cron session reaper — prunes completed isolated cron run sessions
|
|
2297
|
+
* from the session store after a configurable retention period.
|
|
2298
|
+
*
|
|
2299
|
+
* Pattern: sessions keyed as `...:cron:<jobId>:run:<uuid>` are ephemeral
|
|
2300
|
+
* run records. The base session (`...:cron:<jobId>`) is kept as-is.
|
|
2301
|
+
*/
|
|
2302
|
+
const DEFAULT_RETENTION_MS = 24 * 36e5;
|
|
2303
|
+
/** Minimum interval between reaper sweeps (avoid running every timer tick). */
|
|
2304
|
+
const MIN_SWEEP_INTERVAL_MS = 5 * 6e4;
|
|
2305
|
+
const lastSweepAtMsByStore = /* @__PURE__ */ new Map();
|
|
2306
|
+
function resolveRetentionMs(cronConfig) {
|
|
2307
|
+
if (cronConfig?.sessionRetention === false) return null;
|
|
2308
|
+
const raw = cronConfig?.sessionRetention;
|
|
2309
|
+
if (typeof raw === "string" && raw.trim()) try {
|
|
2310
|
+
return parseDurationMs(raw.trim(), { defaultUnit: "h" });
|
|
2311
|
+
} catch {
|
|
2312
|
+
return DEFAULT_RETENTION_MS;
|
|
2313
|
+
}
|
|
2314
|
+
return DEFAULT_RETENTION_MS;
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Sweep the session store and prune expired cron run sessions.
|
|
2318
|
+
* Designed to be called from the cron timer tick — self-throttles via
|
|
2319
|
+
* MIN_SWEEP_INTERVAL_MS to avoid excessive I/O.
|
|
2320
|
+
*
|
|
2321
|
+
* Lock ordering: this function acquires the session-store file lock via
|
|
2322
|
+
* `updateSessionStore`. It must be called OUTSIDE of the cron service's
|
|
2323
|
+
* own `locked()` section to avoid lock-order inversions. The cron timer
|
|
2324
|
+
* calls this after all `locked()` sections have been released.
|
|
2325
|
+
*/
|
|
2326
|
+
async function sweepCronRunSessions(params) {
|
|
2327
|
+
const now = params.nowMs ?? Date.now();
|
|
2328
|
+
const storePath = params.sessionStorePath;
|
|
2329
|
+
const lastSweepAtMs = lastSweepAtMsByStore.get(storePath) ?? 0;
|
|
2330
|
+
if (!params.force && now - lastSweepAtMs < MIN_SWEEP_INTERVAL_MS) return {
|
|
2331
|
+
swept: false,
|
|
2332
|
+
pruned: 0
|
|
2333
|
+
};
|
|
2334
|
+
const retentionMs = resolveRetentionMs(params.cronConfig);
|
|
2335
|
+
if (retentionMs === null) {
|
|
2336
|
+
lastSweepAtMsByStore.set(storePath, now);
|
|
2337
|
+
return {
|
|
2338
|
+
swept: false,
|
|
2339
|
+
pruned: 0
|
|
2340
|
+
};
|
|
2341
|
+
}
|
|
2342
|
+
let pruned = 0;
|
|
2343
|
+
const prunedSessions = /* @__PURE__ */ new Map();
|
|
2344
|
+
try {
|
|
2345
|
+
await updateSessionStore(storePath, (store) => {
|
|
2346
|
+
const cutoff = now - retentionMs;
|
|
2347
|
+
for (const key of Object.keys(store)) {
|
|
2348
|
+
if (!isCronRunSessionKey(key)) continue;
|
|
2349
|
+
const entry = store[key];
|
|
2350
|
+
if (!entry) continue;
|
|
2351
|
+
if ((entry.updatedAt ?? 0) < cutoff) {
|
|
2352
|
+
if (!prunedSessions.has(entry.sessionId) || entry.sessionFile) prunedSessions.set(entry.sessionId, entry.sessionFile);
|
|
2353
|
+
delete store[key];
|
|
2354
|
+
pruned++;
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
});
|
|
2358
|
+
} catch (err) {
|
|
2359
|
+
params.log.warn({ err: String(err) }, "cron-reaper: failed to sweep session store");
|
|
2360
|
+
return {
|
|
2361
|
+
swept: false,
|
|
2362
|
+
pruned: 0
|
|
2363
|
+
};
|
|
2364
|
+
}
|
|
2365
|
+
lastSweepAtMsByStore.set(storePath, now);
|
|
2366
|
+
if (prunedSessions.size > 0) try {
|
|
2367
|
+
const store = loadSessionStore(storePath, { skipCache: true });
|
|
2368
|
+
const archivedDirs = await archiveRemovedSessionTranscripts({
|
|
2369
|
+
removedSessionFiles: prunedSessions,
|
|
2370
|
+
referencedSessionIds: new Set(Object.values(store).map((entry) => entry?.sessionId).filter((id) => Boolean(id))),
|
|
2371
|
+
storePath,
|
|
2372
|
+
reason: "deleted",
|
|
2373
|
+
restrictToStoreDir: true
|
|
2374
|
+
});
|
|
2375
|
+
if (archivedDirs.size > 0) await cleanupArchivedSessionTranscripts({
|
|
2376
|
+
directories: [...archivedDirs],
|
|
2377
|
+
olderThanMs: retentionMs,
|
|
2378
|
+
reason: "deleted",
|
|
2379
|
+
nowMs: now
|
|
2380
|
+
});
|
|
2381
|
+
} catch (err) {
|
|
2382
|
+
params.log.warn({ err: String(err) }, "cron-reaper: transcript cleanup failed");
|
|
2383
|
+
}
|
|
2384
|
+
if (pruned > 0) params.log.info({
|
|
2385
|
+
pruned,
|
|
2386
|
+
retentionMs
|
|
2387
|
+
}, `cron-reaper: pruned ${pruned} expired cron run session(s)`);
|
|
2388
|
+
return {
|
|
2389
|
+
swept: true,
|
|
2390
|
+
pruned
|
|
2391
|
+
};
|
|
2392
|
+
}
|
|
2393
|
+
//#endregion
|
|
2394
|
+
//#region src/cron/service/timeout-policy.ts
|
|
2395
|
+
/**
|
|
2396
|
+
* Maximum wall-clock time for a single job execution. Acts as a safety net
|
|
2397
|
+
* on top of per-provider/per-agent timeouts to prevent one stuck job from
|
|
2398
|
+
* wedging the entire cron lane.
|
|
2399
|
+
*/
|
|
2400
|
+
const DEFAULT_JOB_TIMEOUT_MS = 10 * 6e4;
|
|
2401
|
+
/**
|
|
2402
|
+
* Agent turns can legitimately run much longer than generic cron jobs.
|
|
2403
|
+
* Use a larger safety ceiling when no explicit timeout is set.
|
|
2404
|
+
*/
|
|
2405
|
+
const AGENT_TURN_SAFETY_TIMEOUT_MS = 60 * 6e4;
|
|
2406
|
+
function resolveCronJobTimeoutMs(job) {
|
|
2407
|
+
const configuredTimeoutMs = job.payload.kind === "agentTurn" && typeof job.payload.timeoutSeconds === "number" ? Math.floor(job.payload.timeoutSeconds * 1e3) : void 0;
|
|
2408
|
+
if (configuredTimeoutMs === void 0) return job.payload.kind === "agentTurn" ? AGENT_TURN_SAFETY_TIMEOUT_MS : DEFAULT_JOB_TIMEOUT_MS;
|
|
2409
|
+
return configuredTimeoutMs <= 0 ? void 0 : configuredTimeoutMs;
|
|
2410
|
+
}
|
|
2411
|
+
//#endregion
|
|
2412
|
+
//#region src/cron/service/timer.ts
|
|
2413
|
+
const MAX_TIMER_DELAY_MS = 6e4;
|
|
2414
|
+
/**
|
|
2415
|
+
* Minimum gap between consecutive fires of the same cron job. This is a
|
|
2416
|
+
* safety net that prevents spin-loops when `computeJobNextRunAtMs` returns
|
|
2417
|
+
* a value within the same second as the just-completed run. The guard
|
|
2418
|
+
* is intentionally generous (2 s) so it never masks a legitimate schedule
|
|
2419
|
+
* but always breaks an infinite re-trigger cycle. (See #17821)
|
|
2420
|
+
*/
|
|
2421
|
+
const MIN_REFIRE_GAP_MS = 2e3;
|
|
2422
|
+
const DEFAULT_MISSED_JOB_STAGGER_MS = 5e3;
|
|
2423
|
+
const DEFAULT_MAX_MISSED_JOBS_PER_RESTART = 5;
|
|
2424
|
+
const DEFAULT_FAILURE_ALERT_AFTER = 2;
|
|
2425
|
+
const DEFAULT_FAILURE_ALERT_COOLDOWN_MS = 60 * 6e4;
|
|
2426
|
+
function executeJobCoreWithTimeout(state, job) {
|
|
2427
|
+
const jobTimeoutMs = resolveCronJobTimeoutMs(job);
|
|
2428
|
+
if (typeof jobTimeoutMs !== "number") return executeJobCore(state, job);
|
|
2429
|
+
const runAbortController = new AbortController();
|
|
2430
|
+
let timeoutId;
|
|
2431
|
+
try {
|
|
2432
|
+
return Promise.race([executeJobCore(state, job, runAbortController.signal), new Promise((_, reject) => {
|
|
2433
|
+
timeoutId = setTimeout(() => {
|
|
2434
|
+
const taskLabel = job.name || job.id || "unnamed";
|
|
2435
|
+
runAbortController.abort(timeoutErrorMessage(taskLabel));
|
|
2436
|
+
reject(new Error(timeoutErrorMessage(taskLabel)));
|
|
2437
|
+
}, jobTimeoutMs);
|
|
2438
|
+
})]);
|
|
2439
|
+
} finally {
|
|
2440
|
+
if (timeoutId) clearTimeout(timeoutId);
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
function resolveRunConcurrency(state) {
|
|
2444
|
+
const raw = state.deps.cronConfig?.maxConcurrentRuns;
|
|
2445
|
+
if (typeof raw !== "number" || !Number.isFinite(raw)) return 1;
|
|
2446
|
+
return Math.max(1, Math.floor(raw));
|
|
2447
|
+
}
|
|
2448
|
+
function timeoutErrorMessage(taskLabel) {
|
|
2449
|
+
return `cron: job execution timed out${taskLabel ? ` "${taskLabel}"` : ""}`;
|
|
2450
|
+
}
|
|
2451
|
+
function isAbortError(err) {
|
|
2452
|
+
if (!(err instanceof Error)) return false;
|
|
2453
|
+
return err.name === "AbortError" || err.message === timeoutErrorMessage();
|
|
2454
|
+
}
|
|
2455
|
+
function normalizeCronRunErrorText(err) {
|
|
2456
|
+
if (isAbortError(err)) return timeoutErrorMessage();
|
|
2457
|
+
if (typeof err === "string") return err === `Error: ${timeoutErrorMessage()}` ? timeoutErrorMessage() : err;
|
|
2458
|
+
return String(err);
|
|
2459
|
+
}
|
|
2460
|
+
function createCronTaskRunId$1(jobId, startedAt) {
|
|
2461
|
+
return `cron:${jobId}:${startedAt}`;
|
|
2462
|
+
}
|
|
2463
|
+
function tryCreateCronTaskRun(params) {
|
|
2464
|
+
const runId = createCronTaskRunId$1(params.job.id, params.startedAt);
|
|
2465
|
+
try {
|
|
2466
|
+
createRunningTaskRun({
|
|
2467
|
+
runtime: "cron",
|
|
2468
|
+
sourceId: params.job.id,
|
|
2469
|
+
ownerKey: "",
|
|
2470
|
+
scopeKind: "system",
|
|
2471
|
+
childSessionKey: params.job.sessionKey,
|
|
2472
|
+
agentId: params.job.agentId,
|
|
2473
|
+
runId,
|
|
2474
|
+
label: params.job.name,
|
|
2475
|
+
task: params.job.name || params.job.id,
|
|
2476
|
+
deliveryStatus: "not_applicable",
|
|
2477
|
+
notifyPolicy: "silent",
|
|
2478
|
+
startedAt: params.startedAt,
|
|
2479
|
+
lastEventAt: params.startedAt
|
|
2480
|
+
});
|
|
2481
|
+
return runId;
|
|
2482
|
+
} catch (error) {
|
|
2483
|
+
params.state.deps.log.warn({
|
|
2484
|
+
jobId: params.job.id,
|
|
2485
|
+
error
|
|
2486
|
+
}, "cron: failed to create task ledger record");
|
|
2487
|
+
return;
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
function tryFinishCronTaskRun(state, result) {
|
|
2491
|
+
if (!result.taskRunId) return;
|
|
2492
|
+
try {
|
|
2493
|
+
if (result.status === "ok" || result.status === "skipped") {
|
|
2494
|
+
completeTaskRunByRunId({
|
|
2495
|
+
runId: result.taskRunId,
|
|
2496
|
+
runtime: "cron",
|
|
2497
|
+
endedAt: result.endedAt,
|
|
2498
|
+
lastEventAt: result.endedAt,
|
|
2499
|
+
terminalSummary: result.summary ?? void 0
|
|
2500
|
+
});
|
|
2501
|
+
return;
|
|
2502
|
+
}
|
|
2503
|
+
failTaskRunByRunId({
|
|
2504
|
+
runId: result.taskRunId,
|
|
2505
|
+
runtime: "cron",
|
|
2506
|
+
status: normalizeCronRunErrorText(result.error) === timeoutErrorMessage() ? "timed_out" : "failed",
|
|
2507
|
+
endedAt: result.endedAt,
|
|
2508
|
+
lastEventAt: result.endedAt,
|
|
2509
|
+
error: result.status === "error" ? normalizeCronRunErrorText(result.error) : void 0,
|
|
2510
|
+
terminalSummary: result.summary ?? void 0
|
|
2511
|
+
});
|
|
2512
|
+
} catch (error) {
|
|
2513
|
+
state.deps.log.warn({
|
|
2514
|
+
runId: result.taskRunId,
|
|
2515
|
+
jobStatus: result.status,
|
|
2516
|
+
error
|
|
2517
|
+
}, "cron: failed to update task ledger record");
|
|
2518
|
+
}
|
|
2519
|
+
}
|
|
2520
|
+
/**
|
|
2521
|
+
* Exponential backoff delays (in ms) indexed by consecutive error count.
|
|
2522
|
+
* After the last entry the delay stays constant.
|
|
2523
|
+
*/
|
|
2524
|
+
const DEFAULT_BACKOFF_SCHEDULE_MS = [
|
|
2525
|
+
3e4,
|
|
2526
|
+
6e4,
|
|
2527
|
+
5 * 6e4,
|
|
2528
|
+
15 * 6e4,
|
|
2529
|
+
60 * 6e4
|
|
2530
|
+
];
|
|
2531
|
+
function errorBackoffMs(consecutiveErrors, scheduleMs = DEFAULT_BACKOFF_SCHEDULE_MS) {
|
|
2532
|
+
const idx = Math.min(consecutiveErrors - 1, scheduleMs.length - 1);
|
|
2533
|
+
return scheduleMs[Math.max(0, idx)];
|
|
2534
|
+
}
|
|
2535
|
+
/** Default max retries for one-shot jobs on transient errors (#24355). */
|
|
2536
|
+
const DEFAULT_MAX_TRANSIENT_RETRIES = 3;
|
|
2537
|
+
const TRANSIENT_PATTERNS = {
|
|
2538
|
+
rate_limit: /(rate[_ ]limit|too many requests|429|resource has been exhausted|cloudflare|tokens per day)/i,
|
|
2539
|
+
overloaded: /\b529\b|\boverloaded(?:_error)?\b|high demand|temporar(?:ily|y) overloaded|capacity exceeded/i,
|
|
2540
|
+
network: /(network|econnreset|econnrefused|fetch failed|socket)/i,
|
|
2541
|
+
timeout: /(timeout|etimedout)/i,
|
|
2542
|
+
server_error: /\b5\d{2}\b/
|
|
2543
|
+
};
|
|
2544
|
+
function isTransientCronError(error, retryOn) {
|
|
2545
|
+
if (!error || typeof error !== "string") return false;
|
|
2546
|
+
return (retryOn?.length ? retryOn : Object.keys(TRANSIENT_PATTERNS)).some((k) => TRANSIENT_PATTERNS[k]?.test(error));
|
|
2547
|
+
}
|
|
2548
|
+
function resolveRetryConfig(cronConfig) {
|
|
2549
|
+
const retry = cronConfig?.retry;
|
|
2550
|
+
return {
|
|
2551
|
+
maxAttempts: typeof retry?.maxAttempts === "number" ? retry.maxAttempts : DEFAULT_MAX_TRANSIENT_RETRIES,
|
|
2552
|
+
backoffMs: Array.isArray(retry?.backoffMs) && retry.backoffMs.length > 0 ? retry.backoffMs : DEFAULT_BACKOFF_SCHEDULE_MS.slice(0, 3),
|
|
2553
|
+
retryOn: Array.isArray(retry?.retryOn) && retry.retryOn.length > 0 ? retry.retryOn : void 0
|
|
2554
|
+
};
|
|
2555
|
+
}
|
|
2556
|
+
function resolveDeliveryStatus(params) {
|
|
2557
|
+
if (params.delivered === true) return "delivered";
|
|
2558
|
+
if (params.delivered === false) return "not-delivered";
|
|
2559
|
+
return resolveCronDeliveryPlan(params.job).requested ? "unknown" : "not-requested";
|
|
2560
|
+
}
|
|
2561
|
+
function normalizeCronMessageChannel(input) {
|
|
2562
|
+
if (typeof input !== "string") return;
|
|
2563
|
+
const channel = input.trim().toLowerCase();
|
|
2564
|
+
return channel ? channel : void 0;
|
|
2565
|
+
}
|
|
2566
|
+
function normalizeTo(input) {
|
|
2567
|
+
if (typeof input !== "string") return;
|
|
2568
|
+
const to = input.trim();
|
|
2569
|
+
return to ? to : void 0;
|
|
2570
|
+
}
|
|
2571
|
+
function clampPositiveInt(value, fallback) {
|
|
2572
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
|
|
2573
|
+
const floored = Math.floor(value);
|
|
2574
|
+
return floored >= 1 ? floored : fallback;
|
|
2575
|
+
}
|
|
2576
|
+
function clampNonNegativeInt(value, fallback) {
|
|
2577
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return fallback;
|
|
2578
|
+
const floored = Math.floor(value);
|
|
2579
|
+
return floored >= 0 ? floored : fallback;
|
|
2580
|
+
}
|
|
2581
|
+
function resolveFailureAlert(state, job) {
|
|
2582
|
+
const globalConfig = state.deps.cronConfig?.failureAlert;
|
|
2583
|
+
const jobConfig = job.failureAlert === false ? void 0 : job.failureAlert;
|
|
2584
|
+
if (job.failureAlert === false) return null;
|
|
2585
|
+
if (!jobConfig && globalConfig?.enabled !== true) return null;
|
|
2586
|
+
const mode = jobConfig?.mode ?? globalConfig?.mode;
|
|
2587
|
+
const explicitTo = normalizeTo(jobConfig?.to);
|
|
2588
|
+
return {
|
|
2589
|
+
after: clampPositiveInt(jobConfig?.after ?? globalConfig?.after, DEFAULT_FAILURE_ALERT_AFTER),
|
|
2590
|
+
cooldownMs: clampNonNegativeInt(jobConfig?.cooldownMs ?? globalConfig?.cooldownMs, DEFAULT_FAILURE_ALERT_COOLDOWN_MS),
|
|
2591
|
+
channel: normalizeCronMessageChannel(jobConfig?.channel) ?? normalizeCronMessageChannel(job.delivery?.channel) ?? "last",
|
|
2592
|
+
to: mode === "webhook" ? explicitTo : explicitTo ?? normalizeTo(job.delivery?.to),
|
|
2593
|
+
mode,
|
|
2594
|
+
accountId: jobConfig?.accountId ?? globalConfig?.accountId
|
|
2595
|
+
};
|
|
2596
|
+
}
|
|
2597
|
+
function emitFailureAlert(state, params) {
|
|
2598
|
+
const safeJobName = params.job.name || params.job.id;
|
|
2599
|
+
const truncatedError = (params.error?.trim() || "unknown error").slice(0, 200);
|
|
2600
|
+
const text = [`Cron job "${safeJobName}" failed ${params.consecutiveErrors} times`, `Last error: ${truncatedError}`].join("\n");
|
|
2601
|
+
if (state.deps.sendCronFailureAlert) {
|
|
2602
|
+
state.deps.sendCronFailureAlert({
|
|
2603
|
+
job: params.job,
|
|
2604
|
+
text,
|
|
2605
|
+
channel: params.channel,
|
|
2606
|
+
to: params.to,
|
|
2607
|
+
mode: params.mode,
|
|
2608
|
+
accountId: params.accountId
|
|
2609
|
+
}).catch((err) => {
|
|
2610
|
+
state.deps.log.warn({
|
|
2611
|
+
jobId: params.job.id,
|
|
2612
|
+
err: String(err)
|
|
2613
|
+
}, "cron: failure alert delivery failed");
|
|
2614
|
+
});
|
|
2615
|
+
return;
|
|
2616
|
+
}
|
|
2617
|
+
state.deps.enqueueSystemEvent(text, { agentId: params.job.agentId });
|
|
2618
|
+
if (params.job.wakeMode === "now") state.deps.requestHeartbeatNow({ reason: `cron:${params.job.id}:failure-alert` });
|
|
2619
|
+
}
|
|
2620
|
+
/**
|
|
2621
|
+
* Apply the result of a job execution to the job's state.
|
|
2622
|
+
* Handles consecutive error tracking, exponential backoff, one-shot disable,
|
|
2623
|
+
* and nextRunAtMs computation. Returns `true` if the job should be deleted.
|
|
2624
|
+
*/
|
|
2625
|
+
function applyJobResult(state, job, result, opts) {
|
|
2626
|
+
const prevLastRunAtMs = job.state.lastRunAtMs;
|
|
2627
|
+
const computeNextWithPreservedLastRun = (nowMs) => {
|
|
2628
|
+
const saved = job.state.lastRunAtMs;
|
|
2629
|
+
job.state.lastRunAtMs = prevLastRunAtMs;
|
|
2630
|
+
try {
|
|
2631
|
+
return computeJobNextRunAtMs(job, nowMs);
|
|
2632
|
+
} finally {
|
|
2633
|
+
job.state.lastRunAtMs = saved;
|
|
2634
|
+
}
|
|
2635
|
+
};
|
|
2636
|
+
job.state.runningAtMs = void 0;
|
|
2637
|
+
job.state.lastRunAtMs = result.startedAt;
|
|
2638
|
+
job.state.lastRunStatus = result.status;
|
|
2639
|
+
job.state.lastStatus = result.status;
|
|
2640
|
+
job.state.lastDurationMs = Math.max(0, result.endedAt - result.startedAt);
|
|
2641
|
+
job.state.lastError = result.error;
|
|
2642
|
+
job.state.lastErrorReason = result.status === "error" && typeof result.error === "string" ? resolveFailoverReasonFromError(result.error) ?? void 0 : void 0;
|
|
2643
|
+
job.state.lastDelivered = result.delivered;
|
|
2644
|
+
const deliveryStatus = resolveDeliveryStatus({
|
|
2645
|
+
job,
|
|
2646
|
+
delivered: result.delivered
|
|
2647
|
+
});
|
|
2648
|
+
job.state.lastDeliveryStatus = deliveryStatus;
|
|
2649
|
+
job.state.lastDeliveryError = deliveryStatus === "not-delivered" && result.error ? result.error : void 0;
|
|
2650
|
+
job.updatedAtMs = result.endedAt;
|
|
2651
|
+
if (result.status === "error") {
|
|
2652
|
+
job.state.consecutiveErrors = (job.state.consecutiveErrors ?? 0) + 1;
|
|
2653
|
+
const alertConfig = resolveFailureAlert(state, job);
|
|
2654
|
+
if (alertConfig && job.state.consecutiveErrors >= alertConfig.after) {
|
|
2655
|
+
if (!(job.delivery?.bestEffort === true)) {
|
|
2656
|
+
const now = state.deps.nowMs();
|
|
2657
|
+
const lastAlert = job.state.lastFailureAlertAtMs;
|
|
2658
|
+
if (!(typeof lastAlert === "number" && now - lastAlert < Math.max(0, alertConfig.cooldownMs))) {
|
|
2659
|
+
emitFailureAlert(state, {
|
|
2660
|
+
job,
|
|
2661
|
+
error: result.error,
|
|
2662
|
+
consecutiveErrors: job.state.consecutiveErrors,
|
|
2663
|
+
channel: alertConfig.channel,
|
|
2664
|
+
to: alertConfig.to,
|
|
2665
|
+
mode: alertConfig.mode,
|
|
2666
|
+
accountId: alertConfig.accountId
|
|
2667
|
+
});
|
|
2668
|
+
job.state.lastFailureAlertAtMs = now;
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
}
|
|
2672
|
+
} else {
|
|
2673
|
+
job.state.consecutiveErrors = 0;
|
|
2674
|
+
job.state.lastFailureAlertAtMs = void 0;
|
|
2675
|
+
}
|
|
2676
|
+
const shouldDelete = job.schedule.kind === "at" && job.deleteAfterRun === true && result.status === "ok";
|
|
2677
|
+
if (!shouldDelete) if (job.schedule.kind === "at") {
|
|
2678
|
+
if (result.status === "ok" || result.status === "skipped") {
|
|
2679
|
+
job.enabled = false;
|
|
2680
|
+
job.state.nextRunAtMs = void 0;
|
|
2681
|
+
} else if (result.status === "error") {
|
|
2682
|
+
const retryConfig = resolveRetryConfig(state.deps.cronConfig);
|
|
2683
|
+
const transient = isTransientCronError(result.error, retryConfig.retryOn);
|
|
2684
|
+
const consecutive = job.state.consecutiveErrors;
|
|
2685
|
+
if (transient && consecutive <= retryConfig.maxAttempts) {
|
|
2686
|
+
const backoff = errorBackoffMs(consecutive, retryConfig.backoffMs);
|
|
2687
|
+
job.state.nextRunAtMs = result.endedAt + backoff;
|
|
2688
|
+
state.deps.log.info({
|
|
2689
|
+
jobId: job.id,
|
|
2690
|
+
jobName: job.name,
|
|
2691
|
+
consecutiveErrors: consecutive,
|
|
2692
|
+
backoffMs: backoff,
|
|
2693
|
+
nextRunAtMs: job.state.nextRunAtMs
|
|
2694
|
+
}, "cron: scheduling one-shot retry after transient error");
|
|
2695
|
+
} else {
|
|
2696
|
+
job.enabled = false;
|
|
2697
|
+
job.state.nextRunAtMs = void 0;
|
|
2698
|
+
state.deps.log.warn({
|
|
2699
|
+
jobId: job.id,
|
|
2700
|
+
jobName: job.name,
|
|
2701
|
+
consecutiveErrors: consecutive,
|
|
2702
|
+
error: result.error,
|
|
2703
|
+
reason: transient ? "max retries exhausted" : "permanent error"
|
|
2704
|
+
}, "cron: disabling one-shot job after error");
|
|
2705
|
+
}
|
|
2706
|
+
}
|
|
2707
|
+
} else if (result.status === "error" && isJobEnabled(job)) {
|
|
2708
|
+
const backoff = errorBackoffMs(job.state.consecutiveErrors ?? 1);
|
|
2709
|
+
let normalNext;
|
|
2710
|
+
try {
|
|
2711
|
+
normalNext = opts?.preserveSchedule && job.schedule.kind === "every" ? computeNextWithPreservedLastRun(result.endedAt) : computeJobNextRunAtMs(job, result.endedAt);
|
|
2712
|
+
} catch (err) {
|
|
2713
|
+
recordScheduleComputeError({
|
|
2714
|
+
state,
|
|
2715
|
+
job,
|
|
2716
|
+
err
|
|
2717
|
+
});
|
|
2718
|
+
}
|
|
2719
|
+
const backoffNext = result.endedAt + backoff;
|
|
2720
|
+
job.state.nextRunAtMs = normalNext !== void 0 ? Math.max(normalNext, backoffNext) : backoffNext;
|
|
2721
|
+
state.deps.log.info({
|
|
2722
|
+
jobId: job.id,
|
|
2723
|
+
consecutiveErrors: job.state.consecutiveErrors,
|
|
2724
|
+
backoffMs: backoff,
|
|
2725
|
+
nextRunAtMs: job.state.nextRunAtMs
|
|
2726
|
+
}, "cron: applying error backoff");
|
|
2727
|
+
} else if (isJobEnabled(job)) {
|
|
2728
|
+
let naturalNext;
|
|
2729
|
+
try {
|
|
2730
|
+
naturalNext = opts?.preserveSchedule && job.schedule.kind === "every" ? computeNextWithPreservedLastRun(result.endedAt) : computeJobNextRunAtMs(job, result.endedAt);
|
|
2731
|
+
} catch (err) {
|
|
2732
|
+
recordScheduleComputeError({
|
|
2733
|
+
state,
|
|
2734
|
+
job,
|
|
2735
|
+
err
|
|
2736
|
+
});
|
|
2737
|
+
}
|
|
2738
|
+
if (job.schedule.kind === "cron") {
|
|
2739
|
+
const minNext = result.endedAt + MIN_REFIRE_GAP_MS;
|
|
2740
|
+
job.state.nextRunAtMs = naturalNext !== void 0 ? Math.max(naturalNext, minNext) : minNext;
|
|
2741
|
+
} else job.state.nextRunAtMs = naturalNext;
|
|
2742
|
+
} else job.state.nextRunAtMs = void 0;
|
|
2743
|
+
return shouldDelete;
|
|
2744
|
+
}
|
|
2745
|
+
function applyOutcomeToStoredJob(state, result) {
|
|
2746
|
+
tryFinishCronTaskRun(state, result);
|
|
2747
|
+
const store = state.store;
|
|
2748
|
+
if (!store) return;
|
|
2749
|
+
const jobs = store.jobs;
|
|
2750
|
+
const job = jobs.find((entry) => entry.id === result.jobId);
|
|
2751
|
+
if (!job) {
|
|
2752
|
+
state.deps.log.warn({ jobId: result.jobId }, "cron: applyOutcomeToStoredJob — job not found after forceReload, result discarded");
|
|
2753
|
+
return;
|
|
2754
|
+
}
|
|
2755
|
+
const shouldDelete = applyJobResult(state, job, {
|
|
2756
|
+
status: result.status,
|
|
2757
|
+
error: result.error,
|
|
2758
|
+
delivered: result.delivered,
|
|
2759
|
+
startedAt: result.startedAt,
|
|
2760
|
+
endedAt: result.endedAt
|
|
2761
|
+
});
|
|
2762
|
+
emitJobFinished(state, job, result, result.startedAt);
|
|
2763
|
+
if (shouldDelete) {
|
|
2764
|
+
store.jobs = jobs.filter((entry) => entry.id !== job.id);
|
|
2765
|
+
emit(state, {
|
|
2766
|
+
jobId: job.id,
|
|
2767
|
+
action: "removed"
|
|
2768
|
+
});
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
function armTimer(state) {
|
|
2772
|
+
if (state.timer) clearTimeout(state.timer);
|
|
2773
|
+
state.timer = null;
|
|
2774
|
+
if (!state.deps.cronEnabled) {
|
|
2775
|
+
state.deps.log.debug({}, "cron: armTimer skipped - scheduler disabled");
|
|
2776
|
+
return;
|
|
2777
|
+
}
|
|
2778
|
+
const nextAt = nextWakeAtMs(state);
|
|
2779
|
+
if (!nextAt) {
|
|
2780
|
+
const jobCount = state.store?.jobs.length ?? 0;
|
|
2781
|
+
const enabledCount = state.store?.jobs.filter((j) => j.enabled).length ?? 0;
|
|
2782
|
+
const withNextRun = state.store?.jobs.filter((j) => j.enabled && typeof j.state.nextRunAtMs === "number" && Number.isFinite(j.state.nextRunAtMs)).length ?? 0;
|
|
2783
|
+
state.deps.log.debug({
|
|
2784
|
+
jobCount,
|
|
2785
|
+
enabledCount,
|
|
2786
|
+
withNextRun
|
|
2787
|
+
}, "cron: armTimer skipped - no jobs with nextRunAtMs");
|
|
2788
|
+
return;
|
|
2789
|
+
}
|
|
2790
|
+
const now = state.deps.nowMs();
|
|
2791
|
+
const delay = Math.max(nextAt - now, 0);
|
|
2792
|
+
const clampedDelay = Math.min(delay === 0 ? MIN_REFIRE_GAP_MS : delay, MAX_TIMER_DELAY_MS);
|
|
2793
|
+
state.timer = setTimeout(() => {
|
|
2794
|
+
onTimer(state).catch((err) => {
|
|
2795
|
+
state.deps.log.error({ err: String(err) }, "cron: timer tick failed");
|
|
2796
|
+
});
|
|
2797
|
+
}, clampedDelay);
|
|
2798
|
+
state.deps.log.debug({
|
|
2799
|
+
nextAt,
|
|
2800
|
+
delayMs: clampedDelay,
|
|
2801
|
+
clamped: delay > MAX_TIMER_DELAY_MS
|
|
2802
|
+
}, "cron: timer armed");
|
|
2803
|
+
}
|
|
2804
|
+
function armRunningRecheckTimer(state) {
|
|
2805
|
+
if (state.timer) clearTimeout(state.timer);
|
|
2806
|
+
state.timer = setTimeout(() => {
|
|
2807
|
+
onTimer(state).catch((err) => {
|
|
2808
|
+
state.deps.log.error({ err: String(err) }, "cron: timer tick failed");
|
|
2809
|
+
});
|
|
2810
|
+
}, MAX_TIMER_DELAY_MS);
|
|
2811
|
+
}
|
|
2812
|
+
async function onTimer(state) {
|
|
2813
|
+
if (state.running) {
|
|
2814
|
+
armRunningRecheckTimer(state);
|
|
2815
|
+
return;
|
|
2816
|
+
}
|
|
2817
|
+
state.running = true;
|
|
2818
|
+
armRunningRecheckTimer(state);
|
|
2819
|
+
try {
|
|
2820
|
+
const dueJobs = await locked(state, async () => {
|
|
2821
|
+
await ensureLoaded(state, {
|
|
2822
|
+
forceReload: true,
|
|
2823
|
+
skipRecompute: true
|
|
2824
|
+
});
|
|
2825
|
+
const dueCheckNow = state.deps.nowMs();
|
|
2826
|
+
const due = collectRunnableJobs(state, dueCheckNow);
|
|
2827
|
+
if (due.length === 0) {
|
|
2828
|
+
if (recomputeNextRunsForMaintenance(state, {
|
|
2829
|
+
recomputeExpired: true,
|
|
2830
|
+
nowMs: dueCheckNow
|
|
2831
|
+
})) await persist(state);
|
|
2832
|
+
return [];
|
|
2833
|
+
}
|
|
2834
|
+
const now = state.deps.nowMs();
|
|
2835
|
+
for (const job of due) {
|
|
2836
|
+
job.state.runningAtMs = now;
|
|
2837
|
+
job.state.lastError = void 0;
|
|
2838
|
+
}
|
|
2839
|
+
await persist(state);
|
|
2840
|
+
return due.map((j) => ({
|
|
2841
|
+
id: j.id,
|
|
2842
|
+
job: j
|
|
2843
|
+
}));
|
|
2844
|
+
});
|
|
2845
|
+
const runDueJob = async (params) => {
|
|
2846
|
+
const { id, job } = params;
|
|
2847
|
+
const startedAt = state.deps.nowMs();
|
|
2848
|
+
job.state.runningAtMs = startedAt;
|
|
2849
|
+
emit(state, {
|
|
2850
|
+
jobId: job.id,
|
|
2851
|
+
action: "started",
|
|
2852
|
+
runAtMs: startedAt
|
|
2853
|
+
});
|
|
2854
|
+
const jobTimeoutMs = resolveCronJobTimeoutMs(job);
|
|
2855
|
+
const taskRunId = tryCreateCronTaskRun({
|
|
2856
|
+
state,
|
|
2857
|
+
job,
|
|
2858
|
+
startedAt
|
|
2859
|
+
});
|
|
2860
|
+
try {
|
|
2861
|
+
return {
|
|
2862
|
+
jobId: id,
|
|
2863
|
+
taskRunId,
|
|
2864
|
+
...await executeJobCoreWithTimeout(state, job),
|
|
2865
|
+
startedAt,
|
|
2866
|
+
endedAt: state.deps.nowMs()
|
|
2867
|
+
};
|
|
2868
|
+
} catch (err) {
|
|
2869
|
+
const errorText = normalizeCronRunErrorText(err);
|
|
2870
|
+
state.deps.log.warn({
|
|
2871
|
+
jobId: id,
|
|
2872
|
+
jobName: job.name,
|
|
2873
|
+
timeoutMs: jobTimeoutMs ?? null
|
|
2874
|
+
}, `cron: job failed: ${errorText}`);
|
|
2875
|
+
return {
|
|
2876
|
+
jobId: id,
|
|
2877
|
+
taskRunId,
|
|
2878
|
+
status: "error",
|
|
2879
|
+
error: errorText,
|
|
2880
|
+
startedAt,
|
|
2881
|
+
endedAt: state.deps.nowMs()
|
|
2882
|
+
};
|
|
2883
|
+
}
|
|
2884
|
+
};
|
|
2885
|
+
const concurrency = Math.min(resolveRunConcurrency(state), Math.max(1, dueJobs.length));
|
|
2886
|
+
const results = Array.from({ length: dueJobs.length });
|
|
2887
|
+
let cursor = 0;
|
|
2888
|
+
const workers = Array.from({ length: concurrency }, async () => {
|
|
2889
|
+
for (;;) {
|
|
2890
|
+
const index = cursor++;
|
|
2891
|
+
if (index >= dueJobs.length) return;
|
|
2892
|
+
const due = dueJobs[index];
|
|
2893
|
+
if (!due) return;
|
|
2894
|
+
results[index] = await runDueJob(due);
|
|
2895
|
+
}
|
|
2896
|
+
});
|
|
2897
|
+
await Promise.all(workers);
|
|
2898
|
+
const completedResults = results.filter((entry) => entry !== void 0);
|
|
2899
|
+
if (completedResults.length > 0) await locked(state, async () => {
|
|
2900
|
+
await ensureLoaded(state, {
|
|
2901
|
+
forceReload: true,
|
|
2902
|
+
skipRecompute: true
|
|
2903
|
+
});
|
|
2904
|
+
for (const result of completedResults) applyOutcomeToStoredJob(state, result);
|
|
2905
|
+
recomputeNextRunsForMaintenance(state);
|
|
2906
|
+
await persist(state);
|
|
2907
|
+
});
|
|
2908
|
+
} finally {
|
|
2909
|
+
const storePaths = /* @__PURE__ */ new Set();
|
|
2910
|
+
if (state.deps.resolveSessionStorePath) {
|
|
2911
|
+
const defaultAgentId = state.deps.defaultAgentId ?? "main";
|
|
2912
|
+
if (state.store?.jobs?.length) for (const job of state.store.jobs) {
|
|
2913
|
+
const agentId = typeof job.agentId === "string" && job.agentId.trim() ? job.agentId : defaultAgentId;
|
|
2914
|
+
storePaths.add(state.deps.resolveSessionStorePath(agentId));
|
|
2915
|
+
}
|
|
2916
|
+
else storePaths.add(state.deps.resolveSessionStorePath(defaultAgentId));
|
|
2917
|
+
} else if (state.deps.sessionStorePath) storePaths.add(state.deps.sessionStorePath);
|
|
2918
|
+
if (storePaths.size > 0) {
|
|
2919
|
+
const nowMs = state.deps.nowMs();
|
|
2920
|
+
for (const storePath of storePaths) try {
|
|
2921
|
+
await sweepCronRunSessions({
|
|
2922
|
+
cronConfig: state.deps.cronConfig,
|
|
2923
|
+
sessionStorePath: storePath,
|
|
2924
|
+
nowMs,
|
|
2925
|
+
log: state.deps.log
|
|
2926
|
+
});
|
|
2927
|
+
} catch (err) {
|
|
2928
|
+
state.deps.log.warn({
|
|
2929
|
+
err: String(err),
|
|
2930
|
+
storePath
|
|
2931
|
+
}, "cron: session reaper sweep failed");
|
|
2932
|
+
}
|
|
2933
|
+
}
|
|
2934
|
+
state.running = false;
|
|
2935
|
+
armTimer(state);
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
function isRunnableJob(params) {
|
|
2939
|
+
const { job, nowMs } = params;
|
|
2940
|
+
if (!job.state) job.state = {};
|
|
2941
|
+
if (!isJobEnabled(job)) return false;
|
|
2942
|
+
if (params.skipJobIds?.has(job.id)) return false;
|
|
2943
|
+
if (typeof job.state.runningAtMs === "number") return false;
|
|
2944
|
+
if (params.skipAtIfAlreadyRan && job.schedule.kind === "at" && job.state.lastStatus) {
|
|
2945
|
+
const lastRun = job.state.lastRunAtMs;
|
|
2946
|
+
const nextRun = job.state.nextRunAtMs;
|
|
2947
|
+
if (job.state.lastStatus === "error" && isJobEnabled(job) && typeof nextRun === "number" && typeof lastRun === "number" && nextRun > lastRun) return nowMs >= nextRun;
|
|
2948
|
+
return false;
|
|
2949
|
+
}
|
|
2950
|
+
const next = job.state.nextRunAtMs;
|
|
2951
|
+
if (typeof next === "number" && Number.isFinite(next) && nowMs >= next) return true;
|
|
2952
|
+
if (typeof next === "number" && Number.isFinite(next) && next > nowMs && isErrorBackoffPending(job, nowMs)) return false;
|
|
2953
|
+
if (!params.allowCronMissedRunByLastRun || job.schedule.kind !== "cron") return false;
|
|
2954
|
+
let previousRunAtMs;
|
|
2955
|
+
try {
|
|
2956
|
+
previousRunAtMs = computeJobPreviousRunAtMs(job, nowMs);
|
|
2957
|
+
} catch {
|
|
2958
|
+
return false;
|
|
2959
|
+
}
|
|
2960
|
+
if (typeof previousRunAtMs !== "number" || !Number.isFinite(previousRunAtMs)) return false;
|
|
2961
|
+
const lastRunAtMs = job.state.lastRunAtMs;
|
|
2962
|
+
if (typeof lastRunAtMs !== "number" || !Number.isFinite(lastRunAtMs)) return false;
|
|
2963
|
+
return previousRunAtMs > lastRunAtMs;
|
|
2964
|
+
}
|
|
2965
|
+
function isErrorBackoffPending(job, nowMs) {
|
|
2966
|
+
if (job.schedule.kind === "at" || job.state.lastStatus !== "error") return false;
|
|
2967
|
+
const lastRunAtMs = job.state.lastRunAtMs;
|
|
2968
|
+
if (typeof lastRunAtMs !== "number" || !Number.isFinite(lastRunAtMs)) return false;
|
|
2969
|
+
const consecutiveErrorsRaw = job.state.consecutiveErrors;
|
|
2970
|
+
return nowMs < lastRunAtMs + errorBackoffMs(typeof consecutiveErrorsRaw === "number" && Number.isFinite(consecutiveErrorsRaw) ? Math.max(1, Math.floor(consecutiveErrorsRaw)) : 1);
|
|
2971
|
+
}
|
|
2972
|
+
function collectRunnableJobs(state, nowMs, opts) {
|
|
2973
|
+
if (!state.store) return [];
|
|
2974
|
+
return state.store.jobs.filter((job) => isRunnableJob({
|
|
2975
|
+
job,
|
|
2976
|
+
nowMs,
|
|
2977
|
+
skipJobIds: opts?.skipJobIds,
|
|
2978
|
+
skipAtIfAlreadyRan: opts?.skipAtIfAlreadyRan,
|
|
2979
|
+
allowCronMissedRunByLastRun: opts?.allowCronMissedRunByLastRun
|
|
2980
|
+
}));
|
|
2981
|
+
}
|
|
2982
|
+
async function runMissedJobs(state, opts) {
|
|
2983
|
+
const plan = await planStartupCatchup(state, opts);
|
|
2984
|
+
if (plan.candidates.length === 0 && plan.deferredJobIds.length === 0) return;
|
|
2985
|
+
await applyStartupCatchupOutcomes(state, plan, await executeStartupCatchupPlan(state, plan));
|
|
2986
|
+
}
|
|
2987
|
+
async function planStartupCatchup(state, opts) {
|
|
2988
|
+
const maxImmediate = Math.max(0, state.deps.maxMissedJobsPerRestart ?? DEFAULT_MAX_MISSED_JOBS_PER_RESTART);
|
|
2989
|
+
return locked(state, async () => {
|
|
2990
|
+
await ensureLoaded(state, { skipRecompute: true });
|
|
2991
|
+
if (!state.store) return {
|
|
2992
|
+
candidates: [],
|
|
2993
|
+
deferredJobIds: []
|
|
2994
|
+
};
|
|
2995
|
+
const now = state.deps.nowMs();
|
|
2996
|
+
const missed = collectRunnableJobs(state, now, {
|
|
2997
|
+
skipJobIds: opts?.skipJobIds,
|
|
2998
|
+
skipAtIfAlreadyRan: true,
|
|
2999
|
+
allowCronMissedRunByLastRun: true
|
|
3000
|
+
});
|
|
3001
|
+
if (missed.length === 0) return {
|
|
3002
|
+
candidates: [],
|
|
3003
|
+
deferredJobIds: []
|
|
3004
|
+
};
|
|
3005
|
+
const sorted = missed.toSorted((a, b) => (a.state.nextRunAtMs ?? 0) - (b.state.nextRunAtMs ?? 0));
|
|
3006
|
+
const startupCandidates = sorted.slice(0, maxImmediate);
|
|
3007
|
+
const deferred = sorted.slice(maxImmediate);
|
|
3008
|
+
if (deferred.length > 0) state.deps.log.info({
|
|
3009
|
+
immediateCount: startupCandidates.length,
|
|
3010
|
+
deferredCount: deferred.length,
|
|
3011
|
+
totalMissed: missed.length
|
|
3012
|
+
}, "cron: staggering missed jobs to prevent gateway overload");
|
|
3013
|
+
if (startupCandidates.length > 0) state.deps.log.info({
|
|
3014
|
+
count: startupCandidates.length,
|
|
3015
|
+
jobIds: startupCandidates.map((j) => j.id)
|
|
3016
|
+
}, "cron: running missed jobs after restart");
|
|
3017
|
+
for (const job of startupCandidates) {
|
|
3018
|
+
job.state.runningAtMs = now;
|
|
3019
|
+
job.state.lastError = void 0;
|
|
3020
|
+
}
|
|
3021
|
+
await persist(state);
|
|
3022
|
+
return {
|
|
3023
|
+
candidates: startupCandidates.map((job) => ({
|
|
3024
|
+
jobId: job.id,
|
|
3025
|
+
job
|
|
3026
|
+
})),
|
|
3027
|
+
deferredJobIds: deferred.map((job) => job.id)
|
|
3028
|
+
};
|
|
3029
|
+
});
|
|
3030
|
+
}
|
|
3031
|
+
async function executeStartupCatchupPlan(state, plan) {
|
|
3032
|
+
const outcomes = [];
|
|
3033
|
+
for (const candidate of plan.candidates) outcomes.push(await runStartupCatchupCandidate(state, candidate));
|
|
3034
|
+
return outcomes;
|
|
3035
|
+
}
|
|
3036
|
+
async function runStartupCatchupCandidate(state, candidate) {
|
|
3037
|
+
const startedAt = state.deps.nowMs();
|
|
3038
|
+
const taskRunId = tryCreateCronTaskRun({
|
|
3039
|
+
state,
|
|
3040
|
+
job: candidate.job,
|
|
3041
|
+
startedAt
|
|
3042
|
+
});
|
|
3043
|
+
emit(state, {
|
|
3044
|
+
jobId: candidate.job.id,
|
|
3045
|
+
action: "started",
|
|
3046
|
+
runAtMs: startedAt
|
|
3047
|
+
});
|
|
3048
|
+
try {
|
|
3049
|
+
const result = await executeJobCoreWithTimeout(state, candidate.job);
|
|
3050
|
+
return {
|
|
3051
|
+
jobId: candidate.jobId,
|
|
3052
|
+
taskRunId,
|
|
3053
|
+
status: result.status,
|
|
3054
|
+
error: result.error,
|
|
3055
|
+
summary: result.summary,
|
|
3056
|
+
delivered: result.delivered,
|
|
3057
|
+
sessionId: result.sessionId,
|
|
3058
|
+
sessionKey: result.sessionKey,
|
|
3059
|
+
model: result.model,
|
|
3060
|
+
provider: result.provider,
|
|
3061
|
+
usage: result.usage,
|
|
3062
|
+
startedAt,
|
|
3063
|
+
endedAt: state.deps.nowMs()
|
|
3064
|
+
};
|
|
3065
|
+
} catch (err) {
|
|
3066
|
+
return {
|
|
3067
|
+
jobId: candidate.jobId,
|
|
3068
|
+
taskRunId,
|
|
3069
|
+
status: "error",
|
|
3070
|
+
error: normalizeCronRunErrorText(err),
|
|
3071
|
+
startedAt,
|
|
3072
|
+
endedAt: state.deps.nowMs()
|
|
3073
|
+
};
|
|
3074
|
+
}
|
|
3075
|
+
}
|
|
3076
|
+
async function applyStartupCatchupOutcomes(state, plan, outcomes) {
|
|
3077
|
+
const staggerMs = Math.max(0, state.deps.missedJobStaggerMs ?? DEFAULT_MISSED_JOB_STAGGER_MS);
|
|
3078
|
+
await locked(state, async () => {
|
|
3079
|
+
await ensureLoaded(state, { skipRecompute: true });
|
|
3080
|
+
if (!state.store) return;
|
|
3081
|
+
for (const result of outcomes) applyOutcomeToStoredJob(state, result);
|
|
3082
|
+
if (plan.deferredJobIds.length > 0) {
|
|
3083
|
+
const baseNow = state.deps.nowMs();
|
|
3084
|
+
let offset = staggerMs;
|
|
3085
|
+
for (const jobId of plan.deferredJobIds) {
|
|
3086
|
+
const job = state.store.jobs.find((entry) => entry.id === jobId);
|
|
3087
|
+
if (!job || !isJobEnabled(job)) continue;
|
|
3088
|
+
job.state.nextRunAtMs = baseNow + offset;
|
|
3089
|
+
offset += staggerMs;
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
recomputeNextRunsForMaintenance(state);
|
|
3093
|
+
await persist(state);
|
|
3094
|
+
});
|
|
3095
|
+
}
|
|
3096
|
+
async function executeJobCore(state, job, abortSignal) {
|
|
3097
|
+
const resolveAbortError = () => ({
|
|
3098
|
+
status: "error",
|
|
3099
|
+
error: timeoutErrorMessage()
|
|
3100
|
+
});
|
|
3101
|
+
const waitWithAbort = async (ms) => {
|
|
3102
|
+
if (!abortSignal) {
|
|
3103
|
+
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
3104
|
+
return;
|
|
3105
|
+
}
|
|
3106
|
+
if (abortSignal.aborted) return;
|
|
3107
|
+
await new Promise((resolve) => {
|
|
3108
|
+
const timer = setTimeout(() => {
|
|
3109
|
+
abortSignal.removeEventListener("abort", onAbort);
|
|
3110
|
+
resolve();
|
|
3111
|
+
}, ms);
|
|
3112
|
+
const onAbort = () => {
|
|
3113
|
+
clearTimeout(timer);
|
|
3114
|
+
abortSignal.removeEventListener("abort", onAbort);
|
|
3115
|
+
resolve();
|
|
3116
|
+
};
|
|
3117
|
+
abortSignal.addEventListener("abort", onAbort, { once: true });
|
|
3118
|
+
});
|
|
3119
|
+
};
|
|
3120
|
+
if (abortSignal?.aborted) return resolveAbortError();
|
|
3121
|
+
if (job.sessionTarget === "main") return await executeMainSessionCronJob(state, job, abortSignal, waitWithAbort);
|
|
3122
|
+
return await executeDetachedCronJob(state, job, abortSignal, resolveAbortError);
|
|
3123
|
+
}
|
|
3124
|
+
async function executeMainSessionCronJob(state, job, abortSignal, waitWithAbort) {
|
|
3125
|
+
const text = resolveJobPayloadTextForMain(job);
|
|
3126
|
+
if (!text) return {
|
|
3127
|
+
status: "skipped",
|
|
3128
|
+
error: job.payload.kind === "systemEvent" ? "main job requires non-empty systemEvent text" : "main job requires payload.kind=\"systemEvent\""
|
|
3129
|
+
};
|
|
3130
|
+
const targetMainSessionKey = job.sessionKey;
|
|
3131
|
+
state.deps.enqueueSystemEvent(text, {
|
|
3132
|
+
agentId: job.agentId,
|
|
3133
|
+
sessionKey: targetMainSessionKey,
|
|
3134
|
+
contextKey: `cron:${job.id}`
|
|
3135
|
+
});
|
|
3136
|
+
if (job.wakeMode === "now" && state.deps.runHeartbeatOnce) {
|
|
3137
|
+
const reason = `cron:${job.id}`;
|
|
3138
|
+
const isRecurringJob = job.schedule.kind !== "at";
|
|
3139
|
+
const maxWaitMs = state.deps.wakeNowHeartbeatBusyMaxWaitMs ?? 2 * 6e4;
|
|
3140
|
+
const retryDelayMs = state.deps.wakeNowHeartbeatBusyRetryDelayMs ?? 250;
|
|
3141
|
+
const waitStartedAt = state.deps.nowMs();
|
|
3142
|
+
let heartbeatResult;
|
|
3143
|
+
for (;;) {
|
|
3144
|
+
if (abortSignal?.aborted) return {
|
|
3145
|
+
status: "error",
|
|
3146
|
+
error: timeoutErrorMessage()
|
|
3147
|
+
};
|
|
3148
|
+
heartbeatResult = await state.deps.runHeartbeatOnce({
|
|
3149
|
+
reason,
|
|
3150
|
+
agentId: job.agentId,
|
|
3151
|
+
sessionKey: targetMainSessionKey,
|
|
3152
|
+
heartbeat: { target: "last" }
|
|
3153
|
+
});
|
|
3154
|
+
if (heartbeatResult.status !== "skipped" || heartbeatResult.reason !== "requests-in-flight") break;
|
|
3155
|
+
if (isRecurringJob) {
|
|
3156
|
+
state.deps.requestHeartbeatNow({
|
|
3157
|
+
reason,
|
|
3158
|
+
agentId: job.agentId,
|
|
3159
|
+
sessionKey: targetMainSessionKey
|
|
3160
|
+
});
|
|
3161
|
+
return {
|
|
3162
|
+
status: "ok",
|
|
3163
|
+
summary: text
|
|
3164
|
+
};
|
|
3165
|
+
}
|
|
3166
|
+
if (abortSignal?.aborted) return {
|
|
3167
|
+
status: "error",
|
|
3168
|
+
error: timeoutErrorMessage()
|
|
3169
|
+
};
|
|
3170
|
+
if (state.deps.nowMs() - waitStartedAt > maxWaitMs) {
|
|
3171
|
+
if (abortSignal?.aborted) return {
|
|
3172
|
+
status: "error",
|
|
3173
|
+
error: timeoutErrorMessage()
|
|
3174
|
+
};
|
|
3175
|
+
state.deps.requestHeartbeatNow({
|
|
3176
|
+
reason,
|
|
3177
|
+
agentId: job.agentId,
|
|
3178
|
+
sessionKey: targetMainSessionKey
|
|
3179
|
+
});
|
|
3180
|
+
return {
|
|
3181
|
+
status: "ok",
|
|
3182
|
+
summary: text
|
|
3183
|
+
};
|
|
3184
|
+
}
|
|
3185
|
+
await waitWithAbort(retryDelayMs);
|
|
3186
|
+
}
|
|
3187
|
+
if (heartbeatResult.status === "ran") return {
|
|
3188
|
+
status: "ok",
|
|
3189
|
+
summary: text
|
|
3190
|
+
};
|
|
3191
|
+
if (heartbeatResult.status === "skipped") return {
|
|
3192
|
+
status: "skipped",
|
|
3193
|
+
error: heartbeatResult.reason,
|
|
3194
|
+
summary: text
|
|
3195
|
+
};
|
|
3196
|
+
return {
|
|
3197
|
+
status: "error",
|
|
3198
|
+
error: heartbeatResult.reason,
|
|
3199
|
+
summary: text
|
|
3200
|
+
};
|
|
3201
|
+
}
|
|
3202
|
+
if (abortSignal?.aborted) return {
|
|
3203
|
+
status: "error",
|
|
3204
|
+
error: timeoutErrorMessage()
|
|
3205
|
+
};
|
|
3206
|
+
state.deps.requestHeartbeatNow({
|
|
3207
|
+
reason: `cron:${job.id}`,
|
|
3208
|
+
agentId: job.agentId,
|
|
3209
|
+
sessionKey: targetMainSessionKey
|
|
3210
|
+
});
|
|
3211
|
+
return {
|
|
3212
|
+
status: "ok",
|
|
3213
|
+
summary: text
|
|
3214
|
+
};
|
|
3215
|
+
}
|
|
3216
|
+
async function executeDetachedCronJob(state, job, abortSignal, resolveAbortError) {
|
|
3217
|
+
if (job.payload.kind !== "agentTurn") return {
|
|
3218
|
+
status: "skipped",
|
|
3219
|
+
error: "isolated job requires payload.kind=agentTurn"
|
|
3220
|
+
};
|
|
3221
|
+
if (abortSignal?.aborted) return resolveAbortError();
|
|
3222
|
+
const res = await state.deps.runIsolatedAgentJob({
|
|
3223
|
+
job,
|
|
3224
|
+
message: job.payload.message,
|
|
3225
|
+
abortSignal
|
|
3226
|
+
});
|
|
3227
|
+
if (abortSignal?.aborted) return {
|
|
3228
|
+
status: "error",
|
|
3229
|
+
error: timeoutErrorMessage()
|
|
3230
|
+
};
|
|
3231
|
+
return {
|
|
3232
|
+
status: res.status,
|
|
3233
|
+
error: res.error,
|
|
3234
|
+
summary: res.summary,
|
|
3235
|
+
delivered: res.delivered,
|
|
3236
|
+
deliveryAttempted: res.deliveryAttempted,
|
|
3237
|
+
sessionId: res.sessionId,
|
|
3238
|
+
sessionKey: res.sessionKey,
|
|
3239
|
+
model: res.model,
|
|
3240
|
+
provider: res.provider,
|
|
3241
|
+
usage: res.usage
|
|
3242
|
+
};
|
|
3243
|
+
}
|
|
3244
|
+
function emitJobFinished(state, job, result, runAtMs) {
|
|
3245
|
+
emit(state, {
|
|
3246
|
+
jobId: job.id,
|
|
3247
|
+
action: "finished",
|
|
3248
|
+
status: result.status,
|
|
3249
|
+
error: result.error,
|
|
3250
|
+
summary: result.summary,
|
|
3251
|
+
delivered: result.delivered,
|
|
3252
|
+
deliveryStatus: job.state.lastDeliveryStatus,
|
|
3253
|
+
deliveryError: job.state.lastDeliveryError,
|
|
3254
|
+
sessionId: result.sessionId,
|
|
3255
|
+
sessionKey: result.sessionKey,
|
|
3256
|
+
runAtMs,
|
|
3257
|
+
durationMs: job.state.lastDurationMs,
|
|
3258
|
+
nextRunAtMs: job.state.nextRunAtMs,
|
|
3259
|
+
model: result.model,
|
|
3260
|
+
provider: result.provider,
|
|
3261
|
+
usage: result.usage
|
|
3262
|
+
});
|
|
3263
|
+
}
|
|
3264
|
+
function wake(state, opts) {
|
|
3265
|
+
const text = opts.text.trim();
|
|
3266
|
+
if (!text) return { ok: false };
|
|
3267
|
+
state.deps.enqueueSystemEvent(text);
|
|
3268
|
+
if (opts.mode === "now") state.deps.requestHeartbeatNow({ reason: "wake" });
|
|
3269
|
+
return { ok: true };
|
|
3270
|
+
}
|
|
3271
|
+
function stopTimer(state) {
|
|
3272
|
+
if (state.timer) clearTimeout(state.timer);
|
|
3273
|
+
state.timer = null;
|
|
3274
|
+
}
|
|
3275
|
+
function emit(state, evt) {
|
|
3276
|
+
try {
|
|
3277
|
+
state.deps.onEvent?.(evt);
|
|
3278
|
+
} catch {}
|
|
3279
|
+
}
|
|
3280
|
+
//#endregion
|
|
3281
|
+
//#region src/cron/service/ops.ts
|
|
3282
|
+
function mergeManualRunSnapshotAfterReload(params) {
|
|
3283
|
+
if (!params.state.store) return;
|
|
3284
|
+
if (params.removed) {
|
|
3285
|
+
params.state.store.jobs = params.state.store.jobs.filter((job) => job.id !== params.jobId);
|
|
3286
|
+
return;
|
|
3287
|
+
}
|
|
3288
|
+
if (!params.snapshot) return;
|
|
3289
|
+
const reloaded = params.state.store.jobs.find((job) => job.id === params.jobId);
|
|
3290
|
+
if (!reloaded) return;
|
|
3291
|
+
reloaded.enabled = params.snapshot.enabled;
|
|
3292
|
+
reloaded.updatedAtMs = params.snapshot.updatedAtMs;
|
|
3293
|
+
reloaded.state = params.snapshot.state;
|
|
3294
|
+
}
|
|
3295
|
+
async function ensureLoadedForRead(state) {
|
|
3296
|
+
await ensureLoaded(state, { skipRecompute: true });
|
|
3297
|
+
if (!state.store) return;
|
|
3298
|
+
if (recomputeNextRunsForMaintenance(state)) await persist(state);
|
|
3299
|
+
}
|
|
3300
|
+
async function start(state) {
|
|
3301
|
+
if (!state.deps.cronEnabled) {
|
|
3302
|
+
state.deps.log.info({ enabled: false }, "cron: disabled");
|
|
3303
|
+
return;
|
|
3304
|
+
}
|
|
3305
|
+
const startupInterruptedJobIds = /* @__PURE__ */ new Set();
|
|
3306
|
+
await locked(state, async () => {
|
|
3307
|
+
await ensureLoaded(state, { skipRecompute: true });
|
|
3308
|
+
const jobs = state.store?.jobs ?? [];
|
|
3309
|
+
for (const job of jobs) if (typeof job.state.runningAtMs === "number") {
|
|
3310
|
+
state.deps.log.warn({
|
|
3311
|
+
jobId: job.id,
|
|
3312
|
+
runningAtMs: job.state.runningAtMs
|
|
3313
|
+
}, "cron: clearing stale running marker on startup");
|
|
3314
|
+
job.state.runningAtMs = void 0;
|
|
3315
|
+
startupInterruptedJobIds.add(job.id);
|
|
3316
|
+
}
|
|
3317
|
+
if (startupInterruptedJobIds.size > 0) await persist(state);
|
|
3318
|
+
});
|
|
3319
|
+
await runMissedJobs(state, { skipJobIds: startupInterruptedJobIds });
|
|
3320
|
+
await locked(state, async () => {
|
|
3321
|
+
await ensureLoaded(state, { skipRecompute: true });
|
|
3322
|
+
if (recomputeNextRuns(state)) await persist(state);
|
|
3323
|
+
armTimer(state);
|
|
3324
|
+
state.deps.log.info({
|
|
3325
|
+
enabled: true,
|
|
3326
|
+
jobs: state.store?.jobs.length ?? 0,
|
|
3327
|
+
nextWakeAtMs: nextWakeAtMs(state) ?? null
|
|
3328
|
+
}, "cron: started");
|
|
3329
|
+
});
|
|
3330
|
+
}
|
|
3331
|
+
function stop(state) {
|
|
3332
|
+
stopTimer(state);
|
|
3333
|
+
}
|
|
3334
|
+
async function status(state) {
|
|
3335
|
+
return await locked(state, async () => {
|
|
3336
|
+
await ensureLoadedForRead(state);
|
|
3337
|
+
return {
|
|
3338
|
+
enabled: state.deps.cronEnabled,
|
|
3339
|
+
storePath: state.deps.storePath,
|
|
3340
|
+
jobs: state.store?.jobs.length ?? 0,
|
|
3341
|
+
nextWakeAtMs: state.deps.cronEnabled ? nextWakeAtMs(state) ?? null : null
|
|
3342
|
+
};
|
|
3343
|
+
});
|
|
3344
|
+
}
|
|
3345
|
+
async function list(state, opts) {
|
|
3346
|
+
return await locked(state, async () => {
|
|
3347
|
+
await ensureLoadedForRead(state);
|
|
3348
|
+
const includeDisabled = opts?.includeDisabled === true;
|
|
3349
|
+
return (state.store?.jobs ?? []).filter((j) => includeDisabled || isJobEnabled(j)).toSorted((a, b) => (a.state.nextRunAtMs ?? 0) - (b.state.nextRunAtMs ?? 0));
|
|
3350
|
+
});
|
|
3351
|
+
}
|
|
3352
|
+
function resolveEnabledFilter(opts) {
|
|
3353
|
+
if (opts?.enabled === "all" || opts?.enabled === "enabled" || opts?.enabled === "disabled") return opts.enabled;
|
|
3354
|
+
return opts?.includeDisabled ? "all" : "enabled";
|
|
3355
|
+
}
|
|
3356
|
+
function sortJobs(jobs, sortBy, sortDir) {
|
|
3357
|
+
const dir = sortDir === "desc" ? -1 : 1;
|
|
3358
|
+
return jobs.toSorted((a, b) => {
|
|
3359
|
+
let cmp = 0;
|
|
3360
|
+
if (sortBy === "name") {
|
|
3361
|
+
const aName = typeof a.name === "string" ? a.name : "";
|
|
3362
|
+
const bName = typeof b.name === "string" ? b.name : "";
|
|
3363
|
+
cmp = aName.localeCompare(bName, void 0, { sensitivity: "base" });
|
|
3364
|
+
} else if (sortBy === "updatedAtMs") cmp = a.updatedAtMs - b.updatedAtMs;
|
|
3365
|
+
else {
|
|
3366
|
+
const aNext = a.state.nextRunAtMs;
|
|
3367
|
+
const bNext = b.state.nextRunAtMs;
|
|
3368
|
+
if (typeof aNext === "number" && typeof bNext === "number") cmp = aNext - bNext;
|
|
3369
|
+
else if (typeof aNext === "number") cmp = -1;
|
|
3370
|
+
else if (typeof bNext === "number") cmp = 1;
|
|
3371
|
+
else cmp = 0;
|
|
3372
|
+
}
|
|
3373
|
+
if (cmp !== 0) return cmp * dir;
|
|
3374
|
+
const aId = typeof a.id === "string" ? a.id : "";
|
|
3375
|
+
const bId = typeof b.id === "string" ? b.id : "";
|
|
3376
|
+
return aId.localeCompare(bId);
|
|
3377
|
+
});
|
|
3378
|
+
}
|
|
3379
|
+
async function listPage(state, opts) {
|
|
3380
|
+
return await locked(state, async () => {
|
|
3381
|
+
await ensureLoadedForRead(state);
|
|
3382
|
+
const query = opts?.query?.trim().toLowerCase() ?? "";
|
|
3383
|
+
const enabledFilter = resolveEnabledFilter(opts);
|
|
3384
|
+
const sortBy = opts?.sortBy ?? "nextRunAtMs";
|
|
3385
|
+
const sortDir = opts?.sortDir ?? "asc";
|
|
3386
|
+
const sorted = sortJobs((state.store?.jobs ?? []).filter((job) => {
|
|
3387
|
+
if (enabledFilter === "enabled" && !isJobEnabled(job)) return false;
|
|
3388
|
+
if (enabledFilter === "disabled" && isJobEnabled(job)) return false;
|
|
3389
|
+
if (!query) return true;
|
|
3390
|
+
return [
|
|
3391
|
+
job.name,
|
|
3392
|
+
job.description ?? "",
|
|
3393
|
+
job.agentId ?? ""
|
|
3394
|
+
].join(" ").toLowerCase().includes(query);
|
|
3395
|
+
}), sortBy, sortDir);
|
|
3396
|
+
const total = sorted.length;
|
|
3397
|
+
const offset = Math.max(0, Math.min(total, Math.floor(opts?.offset ?? 0)));
|
|
3398
|
+
const defaultLimit = total === 0 ? 50 : total;
|
|
3399
|
+
const limit = Math.max(1, Math.min(200, Math.floor(opts?.limit ?? defaultLimit)));
|
|
3400
|
+
const jobs = sorted.slice(offset, offset + limit);
|
|
3401
|
+
const nextOffset = offset + jobs.length;
|
|
3402
|
+
return {
|
|
3403
|
+
jobs,
|
|
3404
|
+
total,
|
|
3405
|
+
offset,
|
|
3406
|
+
limit,
|
|
3407
|
+
hasMore: nextOffset < total,
|
|
3408
|
+
nextOffset: nextOffset < total ? nextOffset : null
|
|
3409
|
+
};
|
|
3410
|
+
});
|
|
3411
|
+
}
|
|
3412
|
+
async function add(state, input) {
|
|
3413
|
+
return await locked(state, async () => {
|
|
3414
|
+
warnIfDisabled(state, "add");
|
|
3415
|
+
await ensureLoaded(state);
|
|
3416
|
+
const job = createJob(state, input);
|
|
3417
|
+
state.store?.jobs.push(job);
|
|
3418
|
+
recomputeNextRuns(state);
|
|
3419
|
+
await persist(state);
|
|
3420
|
+
armTimer(state);
|
|
3421
|
+
state.deps.log.info({
|
|
3422
|
+
jobId: job.id,
|
|
3423
|
+
jobName: job.name,
|
|
3424
|
+
nextRunAtMs: job.state.nextRunAtMs,
|
|
3425
|
+
schedulerNextWakeAtMs: nextWakeAtMs(state) ?? null,
|
|
3426
|
+
timerArmed: state.timer !== null,
|
|
3427
|
+
cronEnabled: state.deps.cronEnabled
|
|
3428
|
+
}, "cron: job added");
|
|
3429
|
+
emit(state, {
|
|
3430
|
+
jobId: job.id,
|
|
3431
|
+
action: "added",
|
|
3432
|
+
nextRunAtMs: job.state.nextRunAtMs
|
|
3433
|
+
});
|
|
3434
|
+
return job;
|
|
3435
|
+
});
|
|
3436
|
+
}
|
|
3437
|
+
async function update(state, id, patch) {
|
|
3438
|
+
return await locked(state, async () => {
|
|
3439
|
+
warnIfDisabled(state, "update");
|
|
3440
|
+
await ensureLoaded(state, { skipRecompute: true });
|
|
3441
|
+
const job = findJobOrThrow(state, id);
|
|
3442
|
+
const now = state.deps.nowMs();
|
|
3443
|
+
applyJobPatch(job, patch, { defaultAgentId: state.deps.defaultAgentId });
|
|
3444
|
+
if (job.schedule.kind === "every") {
|
|
3445
|
+
const anchor = job.schedule.anchorMs;
|
|
3446
|
+
if (typeof anchor !== "number" || !Number.isFinite(anchor)) {
|
|
3447
|
+
const fallbackAnchorMs = patch.schedule?.kind === "every" ? now : typeof job.createdAtMs === "number" && Number.isFinite(job.createdAtMs) ? job.createdAtMs : now;
|
|
3448
|
+
job.schedule = {
|
|
3449
|
+
...job.schedule,
|
|
3450
|
+
anchorMs: Math.max(0, Math.floor(fallbackAnchorMs))
|
|
3451
|
+
};
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
const scheduleChanged = patch.schedule !== void 0;
|
|
3455
|
+
const enabledChanged = patch.enabled !== void 0;
|
|
3456
|
+
job.updatedAtMs = now;
|
|
3457
|
+
if (scheduleChanged || enabledChanged) if (isJobEnabled(job)) job.state.nextRunAtMs = computeJobNextRunAtMs(job, now);
|
|
3458
|
+
else {
|
|
3459
|
+
job.state.nextRunAtMs = void 0;
|
|
3460
|
+
job.state.runningAtMs = void 0;
|
|
3461
|
+
}
|
|
3462
|
+
else if (isJobEnabled(job)) {
|
|
3463
|
+
const nextRun = job.state.nextRunAtMs;
|
|
3464
|
+
if (typeof nextRun !== "number" || !Number.isFinite(nextRun)) job.state.nextRunAtMs = computeJobNextRunAtMs(job, now);
|
|
3465
|
+
}
|
|
3466
|
+
await persist(state);
|
|
3467
|
+
armTimer(state);
|
|
3468
|
+
emit(state, {
|
|
3469
|
+
jobId: id,
|
|
3470
|
+
action: "updated",
|
|
3471
|
+
nextRunAtMs: job.state.nextRunAtMs
|
|
3472
|
+
});
|
|
3473
|
+
return job;
|
|
3474
|
+
});
|
|
3475
|
+
}
|
|
3476
|
+
async function remove(state, id) {
|
|
3477
|
+
return await locked(state, async () => {
|
|
3478
|
+
warnIfDisabled(state, "remove");
|
|
3479
|
+
await ensureLoaded(state);
|
|
3480
|
+
const before = state.store?.jobs.length ?? 0;
|
|
3481
|
+
if (!state.store) return {
|
|
3482
|
+
ok: false,
|
|
3483
|
+
removed: false
|
|
3484
|
+
};
|
|
3485
|
+
state.store.jobs = state.store.jobs.filter((j) => j.id !== id);
|
|
3486
|
+
const removed = (state.store.jobs.length ?? 0) !== before;
|
|
3487
|
+
await persist(state);
|
|
3488
|
+
armTimer(state);
|
|
3489
|
+
if (removed) emit(state, {
|
|
3490
|
+
jobId: id,
|
|
3491
|
+
action: "removed"
|
|
3492
|
+
});
|
|
3493
|
+
return {
|
|
3494
|
+
ok: true,
|
|
3495
|
+
removed
|
|
3496
|
+
};
|
|
3497
|
+
});
|
|
3498
|
+
}
|
|
3499
|
+
let nextManualRunId = 1;
|
|
3500
|
+
function createCronTaskRunId(jobId, startedAt) {
|
|
3501
|
+
return `cron:${jobId}:${startedAt}`;
|
|
3502
|
+
}
|
|
3503
|
+
function tryCreateManualTaskRun(params) {
|
|
3504
|
+
const runId = createCronTaskRunId(params.job.id, params.startedAt);
|
|
3505
|
+
try {
|
|
3506
|
+
createRunningTaskRun({
|
|
3507
|
+
runtime: "cron",
|
|
3508
|
+
sourceId: params.job.id,
|
|
3509
|
+
ownerKey: "",
|
|
3510
|
+
scopeKind: "system",
|
|
3511
|
+
childSessionKey: params.job.sessionKey,
|
|
3512
|
+
agentId: params.job.agentId,
|
|
3513
|
+
runId,
|
|
3514
|
+
label: params.job.name,
|
|
3515
|
+
task: params.job.name || params.job.id,
|
|
3516
|
+
deliveryStatus: "not_applicable",
|
|
3517
|
+
notifyPolicy: "silent",
|
|
3518
|
+
startedAt: params.startedAt,
|
|
3519
|
+
lastEventAt: params.startedAt
|
|
3520
|
+
});
|
|
3521
|
+
return runId;
|
|
3522
|
+
} catch (error) {
|
|
3523
|
+
params.state.deps.log.warn({
|
|
3524
|
+
jobId: params.job.id,
|
|
3525
|
+
error
|
|
3526
|
+
}, "cron: failed to create task ledger record");
|
|
3527
|
+
return;
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
function tryFinishManualTaskRun(state, params) {
|
|
3531
|
+
if (!params.taskRunId) return;
|
|
3532
|
+
try {
|
|
3533
|
+
if (params.coreResult.status === "ok" || params.coreResult.status === "skipped") {
|
|
3534
|
+
completeTaskRunByRunId({
|
|
3535
|
+
runId: params.taskRunId,
|
|
3536
|
+
runtime: "cron",
|
|
3537
|
+
endedAt: params.endedAt,
|
|
3538
|
+
lastEventAt: params.endedAt,
|
|
3539
|
+
terminalSummary: params.coreResult.summary ?? void 0
|
|
3540
|
+
});
|
|
3541
|
+
return;
|
|
3542
|
+
}
|
|
3543
|
+
failTaskRunByRunId({
|
|
3544
|
+
runId: params.taskRunId,
|
|
3545
|
+
runtime: "cron",
|
|
3546
|
+
status: normalizeCronRunErrorText(params.coreResult.error) === "cron: job execution timed out" ? "timed_out" : "failed",
|
|
3547
|
+
endedAt: params.endedAt,
|
|
3548
|
+
lastEventAt: params.endedAt,
|
|
3549
|
+
error: params.coreResult.status === "error" ? normalizeCronRunErrorText(params.coreResult.error) : void 0,
|
|
3550
|
+
terminalSummary: params.coreResult.summary ?? void 0
|
|
3551
|
+
});
|
|
3552
|
+
} catch (error) {
|
|
3553
|
+
state.deps.log.warn({
|
|
3554
|
+
runId: params.taskRunId,
|
|
3555
|
+
jobStatus: params.coreResult.status,
|
|
3556
|
+
error
|
|
3557
|
+
}, "cron: failed to update task ledger record");
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
async function inspectManualRunPreflight(state, id, mode) {
|
|
3561
|
+
return await locked(state, async () => {
|
|
3562
|
+
warnIfDisabled(state, "run");
|
|
3563
|
+
await ensureLoaded(state, { skipRecompute: true });
|
|
3564
|
+
recomputeNextRunsForMaintenance(state);
|
|
3565
|
+
const job = findJobOrThrow(state, id);
|
|
3566
|
+
if (typeof job.state.runningAtMs === "number") return {
|
|
3567
|
+
ok: true,
|
|
3568
|
+
ran: false,
|
|
3569
|
+
reason: "already-running"
|
|
3570
|
+
};
|
|
3571
|
+
const now = state.deps.nowMs();
|
|
3572
|
+
if (!isJobDue(job, now, { forced: mode === "force" })) return {
|
|
3573
|
+
ok: true,
|
|
3574
|
+
ran: false,
|
|
3575
|
+
reason: "not-due"
|
|
3576
|
+
};
|
|
3577
|
+
return {
|
|
3578
|
+
ok: true,
|
|
3579
|
+
runnable: true,
|
|
3580
|
+
job,
|
|
3581
|
+
now
|
|
3582
|
+
};
|
|
3583
|
+
});
|
|
3584
|
+
}
|
|
3585
|
+
async function inspectManualRunDisposition(state, id, mode) {
|
|
3586
|
+
const result = await inspectManualRunPreflight(state, id, mode);
|
|
3587
|
+
if (!result.ok) return result;
|
|
3588
|
+
if ("reason" in result) return result;
|
|
3589
|
+
return {
|
|
3590
|
+
ok: true,
|
|
3591
|
+
runnable: true
|
|
3592
|
+
};
|
|
3593
|
+
}
|
|
3594
|
+
async function prepareManualRun(state, id, mode) {
|
|
3595
|
+
const preflight = await inspectManualRunPreflight(state, id, mode);
|
|
3596
|
+
if (!preflight.ok) return preflight;
|
|
3597
|
+
if ("reason" in preflight) return {
|
|
3598
|
+
ok: true,
|
|
3599
|
+
ran: false,
|
|
3600
|
+
reason: preflight.reason
|
|
3601
|
+
};
|
|
3602
|
+
return await locked(state, async () => {
|
|
3603
|
+
const job = findJobOrThrow(state, id);
|
|
3604
|
+
if (typeof job.state.runningAtMs === "number") return {
|
|
3605
|
+
ok: true,
|
|
3606
|
+
ran: false,
|
|
3607
|
+
reason: "already-running"
|
|
3608
|
+
};
|
|
3609
|
+
job.state.runningAtMs = preflight.now;
|
|
3610
|
+
job.state.lastError = void 0;
|
|
3611
|
+
await persist(state);
|
|
3612
|
+
emit(state, {
|
|
3613
|
+
jobId: job.id,
|
|
3614
|
+
action: "started",
|
|
3615
|
+
runAtMs: preflight.now
|
|
3616
|
+
});
|
|
3617
|
+
const taskRunId = tryCreateManualTaskRun({
|
|
3618
|
+
state,
|
|
3619
|
+
job,
|
|
3620
|
+
startedAt: preflight.now
|
|
3621
|
+
});
|
|
3622
|
+
const executionJob = JSON.parse(JSON.stringify(job));
|
|
3623
|
+
return {
|
|
3624
|
+
ok: true,
|
|
3625
|
+
ran: true,
|
|
3626
|
+
jobId: job.id,
|
|
3627
|
+
taskRunId,
|
|
3628
|
+
startedAt: preflight.now,
|
|
3629
|
+
executionJob
|
|
3630
|
+
};
|
|
3631
|
+
});
|
|
3632
|
+
}
|
|
3633
|
+
async function finishPreparedManualRun(state, prepared, mode) {
|
|
3634
|
+
const executionJob = prepared.executionJob;
|
|
3635
|
+
const startedAt = prepared.startedAt;
|
|
3636
|
+
const jobId = prepared.jobId;
|
|
3637
|
+
const taskRunId = prepared.taskRunId;
|
|
3638
|
+
let coreResult;
|
|
3639
|
+
try {
|
|
3640
|
+
coreResult = await executeJobCoreWithTimeout(state, executionJob);
|
|
3641
|
+
} catch (err) {
|
|
3642
|
+
coreResult = {
|
|
3643
|
+
status: "error",
|
|
3644
|
+
error: normalizeCronRunErrorText(err)
|
|
3645
|
+
};
|
|
3646
|
+
}
|
|
3647
|
+
const endedAt = state.deps.nowMs();
|
|
3648
|
+
tryFinishManualTaskRun(state, {
|
|
3649
|
+
taskRunId,
|
|
3650
|
+
coreResult,
|
|
3651
|
+
endedAt
|
|
3652
|
+
});
|
|
3653
|
+
await locked(state, async () => {
|
|
3654
|
+
await ensureLoaded(state, { skipRecompute: true });
|
|
3655
|
+
const job = state.store?.jobs.find((entry) => entry.id === jobId);
|
|
3656
|
+
if (!job) return;
|
|
3657
|
+
const shouldDelete = applyJobResult(state, job, {
|
|
3658
|
+
status: coreResult.status,
|
|
3659
|
+
error: coreResult.error,
|
|
3660
|
+
delivered: coreResult.delivered,
|
|
3661
|
+
startedAt,
|
|
3662
|
+
endedAt
|
|
3663
|
+
}, { preserveSchedule: mode === "force" });
|
|
3664
|
+
emit(state, {
|
|
3665
|
+
jobId: job.id,
|
|
3666
|
+
action: "finished",
|
|
3667
|
+
status: coreResult.status,
|
|
3668
|
+
error: coreResult.error,
|
|
3669
|
+
summary: coreResult.summary,
|
|
3670
|
+
delivered: coreResult.delivered,
|
|
3671
|
+
deliveryStatus: job.state.lastDeliveryStatus,
|
|
3672
|
+
deliveryError: job.state.lastDeliveryError,
|
|
3673
|
+
sessionId: coreResult.sessionId,
|
|
3674
|
+
sessionKey: coreResult.sessionKey,
|
|
3675
|
+
runAtMs: startedAt,
|
|
3676
|
+
durationMs: job.state.lastDurationMs,
|
|
3677
|
+
nextRunAtMs: job.state.nextRunAtMs,
|
|
3678
|
+
model: coreResult.model,
|
|
3679
|
+
provider: coreResult.provider,
|
|
3680
|
+
usage: coreResult.usage
|
|
3681
|
+
});
|
|
3682
|
+
if (shouldDelete && state.store) {
|
|
3683
|
+
state.store.jobs = state.store.jobs.filter((entry) => entry.id !== job.id);
|
|
3684
|
+
emit(state, {
|
|
3685
|
+
jobId: job.id,
|
|
3686
|
+
action: "removed"
|
|
3687
|
+
});
|
|
3688
|
+
}
|
|
3689
|
+
const postRunSnapshot = shouldDelete ? null : {
|
|
3690
|
+
enabled: job.enabled,
|
|
3691
|
+
updatedAtMs: job.updatedAtMs,
|
|
3692
|
+
state: structuredClone(job.state)
|
|
3693
|
+
};
|
|
3694
|
+
const postRunRemoved = shouldDelete;
|
|
3695
|
+
await ensureLoaded(state, {
|
|
3696
|
+
forceReload: true,
|
|
3697
|
+
skipRecompute: true
|
|
3698
|
+
});
|
|
3699
|
+
mergeManualRunSnapshotAfterReload({
|
|
3700
|
+
state,
|
|
3701
|
+
jobId,
|
|
3702
|
+
snapshot: postRunSnapshot,
|
|
3703
|
+
removed: postRunRemoved
|
|
3704
|
+
});
|
|
3705
|
+
recomputeNextRunsForMaintenance(state, { recomputeExpired: true });
|
|
3706
|
+
await persist(state);
|
|
3707
|
+
armTimer(state);
|
|
3708
|
+
});
|
|
3709
|
+
}
|
|
3710
|
+
async function run(state, id, mode) {
|
|
3711
|
+
const prepared = await prepareManualRun(state, id, mode);
|
|
3712
|
+
if (!prepared.ok || !prepared.ran) return prepared;
|
|
3713
|
+
await finishPreparedManualRun(state, prepared, mode);
|
|
3714
|
+
return {
|
|
3715
|
+
ok: true,
|
|
3716
|
+
ran: true
|
|
3717
|
+
};
|
|
3718
|
+
}
|
|
3719
|
+
async function enqueueRun(state, id, mode) {
|
|
3720
|
+
const disposition = await inspectManualRunDisposition(state, id, mode);
|
|
3721
|
+
if (!disposition.ok || !("runnable" in disposition && disposition.runnable)) return disposition;
|
|
3722
|
+
const runId = `manual:${id}:${state.deps.nowMs()}:${nextManualRunId++}`;
|
|
3723
|
+
enqueueCommandInLane(CommandLane.Cron, async () => {
|
|
3724
|
+
const result = await run(state, id, mode);
|
|
3725
|
+
if (result.ok && "ran" in result && !result.ran) state.deps.log.info({
|
|
3726
|
+
jobId: id,
|
|
3727
|
+
runId,
|
|
3728
|
+
reason: result.reason
|
|
3729
|
+
}, "cron: queued manual run skipped before execution");
|
|
3730
|
+
return result;
|
|
3731
|
+
}, {
|
|
3732
|
+
warnAfterMs: 5e3,
|
|
3733
|
+
onWait: (waitMs, queuedAhead) => {
|
|
3734
|
+
state.deps.log.warn({
|
|
3735
|
+
jobId: id,
|
|
3736
|
+
runId,
|
|
3737
|
+
waitMs,
|
|
3738
|
+
queuedAhead
|
|
3739
|
+
}, "cron: queued manual run waiting for an execution slot");
|
|
3740
|
+
}
|
|
3741
|
+
}).catch((err) => {
|
|
3742
|
+
state.deps.log.error({
|
|
3743
|
+
jobId: id,
|
|
3744
|
+
runId,
|
|
3745
|
+
err: String(err)
|
|
3746
|
+
}, "cron: queued manual run background execution failed");
|
|
3747
|
+
});
|
|
3748
|
+
return {
|
|
3749
|
+
ok: true,
|
|
3750
|
+
enqueued: true,
|
|
3751
|
+
runId
|
|
3752
|
+
};
|
|
3753
|
+
}
|
|
3754
|
+
function wakeNow(state, opts) {
|
|
3755
|
+
return wake(state, opts);
|
|
3756
|
+
}
|
|
3757
|
+
//#endregion
|
|
3758
|
+
//#region src/cron/service/state.ts
|
|
3759
|
+
function createCronServiceState(deps) {
|
|
3760
|
+
return {
|
|
3761
|
+
deps: {
|
|
3762
|
+
...deps,
|
|
3763
|
+
nowMs: deps.nowMs ?? (() => Date.now())
|
|
3764
|
+
},
|
|
3765
|
+
store: null,
|
|
3766
|
+
timer: null,
|
|
3767
|
+
running: false,
|
|
3768
|
+
op: Promise.resolve(),
|
|
3769
|
+
warnedDisabled: false,
|
|
3770
|
+
storeLoadedAtMs: null,
|
|
3771
|
+
storeFileMtimeMs: null
|
|
3772
|
+
};
|
|
3773
|
+
}
|
|
3774
|
+
//#endregion
|
|
3775
|
+
//#region src/cron/service.ts
|
|
3776
|
+
var CronService = class {
|
|
3777
|
+
constructor(deps) {
|
|
3778
|
+
this.state = createCronServiceState(deps);
|
|
3779
|
+
}
|
|
3780
|
+
async start() {
|
|
3781
|
+
await start(this.state);
|
|
3782
|
+
}
|
|
3783
|
+
stop() {
|
|
3784
|
+
stop(this.state);
|
|
3785
|
+
}
|
|
3786
|
+
async status() {
|
|
3787
|
+
return await status(this.state);
|
|
3788
|
+
}
|
|
3789
|
+
async list(opts) {
|
|
3790
|
+
return await list(this.state, opts);
|
|
3791
|
+
}
|
|
3792
|
+
async listPage(opts) {
|
|
3793
|
+
return await listPage(this.state, opts);
|
|
3794
|
+
}
|
|
3795
|
+
async add(input) {
|
|
3796
|
+
return await add(this.state, input);
|
|
3797
|
+
}
|
|
3798
|
+
async update(id, patch) {
|
|
3799
|
+
return await update(this.state, id, patch);
|
|
3800
|
+
}
|
|
3801
|
+
async remove(id) {
|
|
3802
|
+
return await remove(this.state, id);
|
|
3803
|
+
}
|
|
3804
|
+
async run(id, mode) {
|
|
3805
|
+
return await run(this.state, id, mode);
|
|
3806
|
+
}
|
|
3807
|
+
async enqueueRun(id, mode) {
|
|
3808
|
+
return await enqueueRun(this.state, id, mode);
|
|
3809
|
+
}
|
|
3810
|
+
getJob(id) {
|
|
3811
|
+
return this.state.store?.jobs.find((job) => job.id === id);
|
|
3812
|
+
}
|
|
3813
|
+
wake(opts) {
|
|
3814
|
+
return wakeNow(this.state, opts);
|
|
3815
|
+
}
|
|
3816
|
+
};
|
|
3817
|
+
//#endregion
|
|
3818
|
+
//#region src/gateway/server-cron.ts
|
|
3819
|
+
const CRON_WEBHOOK_TIMEOUT_MS = 1e4;
|
|
3820
|
+
function trimToOptionalString(value) {
|
|
3821
|
+
if (typeof value !== "string") return;
|
|
3822
|
+
const trimmed = value.trim();
|
|
3823
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
3824
|
+
}
|
|
3825
|
+
function redactWebhookUrl(url) {
|
|
3826
|
+
try {
|
|
3827
|
+
const parsed = new URL(url);
|
|
3828
|
+
return `${parsed.origin}${parsed.pathname}`;
|
|
3829
|
+
} catch {
|
|
3830
|
+
return "<invalid-webhook-url>";
|
|
3831
|
+
}
|
|
3832
|
+
}
|
|
3833
|
+
function resolveCronWebhookTarget(params) {
|
|
3834
|
+
if (params.delivery?.mode?.trim().toLowerCase() === "webhook") {
|
|
3835
|
+
const url = normalizeHttpWebhookUrl(params.delivery?.to);
|
|
3836
|
+
return url ? {
|
|
3837
|
+
url,
|
|
3838
|
+
source: "delivery"
|
|
3839
|
+
} : null;
|
|
3840
|
+
}
|
|
3841
|
+
if (params.legacyNotify) {
|
|
3842
|
+
const legacyUrl = normalizeHttpWebhookUrl(params.legacyWebhook);
|
|
3843
|
+
if (legacyUrl) return {
|
|
3844
|
+
url: legacyUrl,
|
|
3845
|
+
source: "legacy"
|
|
3846
|
+
};
|
|
3847
|
+
}
|
|
3848
|
+
return null;
|
|
3849
|
+
}
|
|
3850
|
+
function buildCronWebhookHeaders(webhookToken) {
|
|
3851
|
+
const headers = { "Content-Type": "application/json" };
|
|
3852
|
+
if (webhookToken) headers.Authorization = `Bearer ${webhookToken}`;
|
|
3853
|
+
return headers;
|
|
3854
|
+
}
|
|
3855
|
+
async function postCronWebhook(params) {
|
|
3856
|
+
const abortController = new AbortController();
|
|
3857
|
+
const timeout = setTimeout(() => {
|
|
3858
|
+
abortController.abort();
|
|
3859
|
+
}, CRON_WEBHOOK_TIMEOUT_MS);
|
|
3860
|
+
try {
|
|
3861
|
+
await (await fetchWithSsrFGuard({
|
|
3862
|
+
url: params.webhookUrl,
|
|
3863
|
+
init: {
|
|
3864
|
+
method: "POST",
|
|
3865
|
+
headers: buildCronWebhookHeaders(params.webhookToken),
|
|
3866
|
+
body: JSON.stringify(params.payload),
|
|
3867
|
+
signal: abortController.signal
|
|
3868
|
+
}
|
|
3869
|
+
})).release();
|
|
3870
|
+
} catch (err) {
|
|
3871
|
+
if (err instanceof SsrFBlockedError) params.logger.warn({
|
|
3872
|
+
...params.logContext,
|
|
3873
|
+
reason: formatErrorMessage(err),
|
|
3874
|
+
webhookUrl: redactWebhookUrl(params.webhookUrl)
|
|
3875
|
+
}, params.blockedLog);
|
|
3876
|
+
else params.logger.warn({
|
|
3877
|
+
...params.logContext,
|
|
3878
|
+
err: formatErrorMessage(err),
|
|
3879
|
+
webhookUrl: redactWebhookUrl(params.webhookUrl)
|
|
3880
|
+
}, params.failedLog);
|
|
3881
|
+
} finally {
|
|
3882
|
+
clearTimeout(timeout);
|
|
3883
|
+
}
|
|
3884
|
+
}
|
|
3885
|
+
function buildGatewayCronService(params) {
|
|
3886
|
+
const cronLogger = getChildLogger({ module: "cron" });
|
|
3887
|
+
const storePath = resolveCronStorePath(params.cfg.cron?.store);
|
|
3888
|
+
const cronEnabled = process.env.OPENCLAW_SKIP_CRON !== "1" && params.cfg.cron?.enabled !== false;
|
|
3889
|
+
const resolveCronAgent = (requested) => {
|
|
3890
|
+
const runtimeConfig = loadConfig();
|
|
3891
|
+
const normalized = typeof requested === "string" && requested.trim() ? normalizeAgentId(requested) : void 0;
|
|
3892
|
+
return {
|
|
3893
|
+
agentId: normalized !== void 0 && Array.isArray(runtimeConfig.agents?.list) && runtimeConfig.agents.list.some((entry) => entry && typeof entry.id === "string" && normalizeAgentId(entry.id) === normalized) ? normalized : resolveDefaultAgentId(runtimeConfig),
|
|
3894
|
+
cfg: runtimeConfig
|
|
3895
|
+
};
|
|
3896
|
+
};
|
|
3897
|
+
const resolveCronSessionKey = (params) => {
|
|
3898
|
+
const requested = params.requestedSessionKey?.trim();
|
|
3899
|
+
if (!requested) return resolveAgentMainSessionKey({
|
|
3900
|
+
cfg: params.runtimeConfig,
|
|
3901
|
+
agentId: params.agentId
|
|
3902
|
+
});
|
|
3903
|
+
const candidate = toAgentStoreSessionKey({
|
|
3904
|
+
agentId: params.agentId,
|
|
3905
|
+
requestKey: requested,
|
|
3906
|
+
mainKey: params.runtimeConfig.session?.mainKey
|
|
3907
|
+
});
|
|
3908
|
+
const canonical = canonicalizeMainSessionAlias({
|
|
3909
|
+
cfg: params.runtimeConfig,
|
|
3910
|
+
agentId: params.agentId,
|
|
3911
|
+
sessionKey: candidate
|
|
3912
|
+
});
|
|
3913
|
+
if (canonical !== "global") {
|
|
3914
|
+
if (normalizeAgentId(resolveAgentIdFromSessionKey(canonical)) !== normalizeAgentId(params.agentId)) return resolveAgentMainSessionKey({
|
|
3915
|
+
cfg: params.runtimeConfig,
|
|
3916
|
+
agentId: params.agentId
|
|
3917
|
+
});
|
|
3918
|
+
}
|
|
3919
|
+
return canonical;
|
|
3920
|
+
};
|
|
3921
|
+
const resolveCronWakeTarget = (opts) => {
|
|
3922
|
+
const runtimeConfig = loadConfig();
|
|
3923
|
+
const agentId = ((opts?.agentId ? resolveCronAgent(opts.agentId).agentId : void 0) ?? (opts?.sessionKey ? normalizeAgentId(resolveAgentIdFromSessionKey(opts.sessionKey)) : void 0)) || void 0;
|
|
3924
|
+
return {
|
|
3925
|
+
runtimeConfig,
|
|
3926
|
+
agentId,
|
|
3927
|
+
sessionKey: opts?.sessionKey && agentId ? resolveCronSessionKey({
|
|
3928
|
+
runtimeConfig,
|
|
3929
|
+
agentId,
|
|
3930
|
+
requestedSessionKey: opts.sessionKey
|
|
3931
|
+
}) : void 0
|
|
3932
|
+
};
|
|
3933
|
+
};
|
|
3934
|
+
const defaultAgentId = resolveDefaultAgentId(params.cfg);
|
|
3935
|
+
const runLogPrune = resolveCronRunLogPruneOptions(params.cfg.cron?.runLog);
|
|
3936
|
+
const resolveSessionStorePath = (agentId) => resolveStorePath(params.cfg.session?.store, { agentId: agentId ?? defaultAgentId });
|
|
3937
|
+
const sessionStorePath = resolveSessionStorePath(defaultAgentId);
|
|
3938
|
+
const warnedLegacyWebhookJobs = /* @__PURE__ */ new Set();
|
|
3939
|
+
const cron = new CronService({
|
|
3940
|
+
storePath,
|
|
3941
|
+
cronEnabled,
|
|
3942
|
+
cronConfig: params.cfg.cron,
|
|
3943
|
+
defaultAgentId,
|
|
3944
|
+
resolveSessionStorePath,
|
|
3945
|
+
sessionStorePath,
|
|
3946
|
+
enqueueSystemEvent: (text, opts) => {
|
|
3947
|
+
const { agentId, cfg: runtimeConfig } = resolveCronAgent(opts?.agentId);
|
|
3948
|
+
enqueueSystemEvent(text, {
|
|
3949
|
+
sessionKey: resolveCronSessionKey({
|
|
3950
|
+
runtimeConfig,
|
|
3951
|
+
agentId,
|
|
3952
|
+
requestedSessionKey: opts?.sessionKey
|
|
3953
|
+
}),
|
|
3954
|
+
contextKey: opts?.contextKey
|
|
3955
|
+
});
|
|
3956
|
+
},
|
|
3957
|
+
requestHeartbeatNow: (opts) => {
|
|
3958
|
+
const { agentId, sessionKey } = resolveCronWakeTarget(opts);
|
|
3959
|
+
requestHeartbeatNow({
|
|
3960
|
+
reason: opts?.reason,
|
|
3961
|
+
agentId,
|
|
3962
|
+
sessionKey
|
|
3963
|
+
});
|
|
3964
|
+
},
|
|
3965
|
+
runHeartbeatOnce: async (opts) => {
|
|
3966
|
+
const { runtimeConfig, agentId, sessionKey } = resolveCronWakeTarget(opts);
|
|
3967
|
+
const agentEntry = Array.isArray(runtimeConfig.agents?.list) && runtimeConfig.agents.list.find((entry) => entry && typeof entry.id === "string" && normalizeAgentId(entry.id) === agentId);
|
|
3968
|
+
const agentHeartbeat = agentEntry && typeof agentEntry === "object" ? agentEntry.heartbeat : void 0;
|
|
3969
|
+
const baseHeartbeat = {
|
|
3970
|
+
...runtimeConfig.agents?.defaults?.heartbeat,
|
|
3971
|
+
...agentHeartbeat
|
|
3972
|
+
};
|
|
3973
|
+
const heartbeatOverride = opts?.heartbeat ? {
|
|
3974
|
+
...baseHeartbeat,
|
|
3975
|
+
...opts.heartbeat
|
|
3976
|
+
} : void 0;
|
|
3977
|
+
return await runHeartbeatOnce({
|
|
3978
|
+
cfg: runtimeConfig,
|
|
3979
|
+
reason: opts?.reason,
|
|
3980
|
+
agentId,
|
|
3981
|
+
sessionKey,
|
|
3982
|
+
heartbeat: heartbeatOverride,
|
|
3983
|
+
deps: {
|
|
3984
|
+
...params.deps,
|
|
3985
|
+
runtime: defaultRuntime
|
|
3986
|
+
}
|
|
3987
|
+
});
|
|
3988
|
+
},
|
|
3989
|
+
runIsolatedAgentJob: async ({ job, message, abortSignal }) => {
|
|
3990
|
+
const { agentId, cfg: runtimeConfig } = resolveCronAgent(job.agentId);
|
|
3991
|
+
let sessionKey = `cron:${job.id}`;
|
|
3992
|
+
if (job.sessionTarget.startsWith("session:")) {
|
|
3993
|
+
const customSessionId = job.sessionTarget.slice(8).trim();
|
|
3994
|
+
if (customSessionId) sessionKey = customSessionId;
|
|
3995
|
+
}
|
|
3996
|
+
return await runCronIsolatedAgentTurn({
|
|
3997
|
+
cfg: runtimeConfig,
|
|
3998
|
+
deps: params.deps,
|
|
3999
|
+
job,
|
|
4000
|
+
message,
|
|
4001
|
+
abortSignal,
|
|
4002
|
+
agentId,
|
|
4003
|
+
sessionKey,
|
|
4004
|
+
lane: "cron"
|
|
4005
|
+
});
|
|
4006
|
+
},
|
|
4007
|
+
sendCronFailureAlert: async ({ job, text, channel, to, mode, accountId }) => {
|
|
4008
|
+
const { agentId, cfg: runtimeConfig } = resolveCronAgent(job.agentId);
|
|
4009
|
+
const webhookToken = trimToOptionalString(params.cfg.cron?.webhookToken);
|
|
4010
|
+
if (mode === "webhook" && !to) {
|
|
4011
|
+
cronLogger.warn({ jobId: job.id }, "cron: failure alert webhook mode requires URL, skipping");
|
|
4012
|
+
return;
|
|
4013
|
+
}
|
|
4014
|
+
if (mode === "webhook" && to) {
|
|
4015
|
+
const webhookUrl = normalizeHttpWebhookUrl(to);
|
|
4016
|
+
if (webhookUrl) await postCronWebhook({
|
|
4017
|
+
webhookUrl,
|
|
4018
|
+
webhookToken,
|
|
4019
|
+
payload: {
|
|
4020
|
+
jobId: job.id,
|
|
4021
|
+
jobName: job.name,
|
|
4022
|
+
message: text
|
|
4023
|
+
},
|
|
4024
|
+
logContext: { jobId: job.id },
|
|
4025
|
+
blockedLog: "cron: failure alert webhook blocked by SSRF guard",
|
|
4026
|
+
failedLog: "cron: failure alert webhook failed",
|
|
4027
|
+
logger: cronLogger
|
|
4028
|
+
});
|
|
4029
|
+
else cronLogger.warn({
|
|
4030
|
+
jobId: job.id,
|
|
4031
|
+
webhookUrl: redactWebhookUrl(to)
|
|
4032
|
+
}, "cron: failure alert webhook URL is invalid, skipping");
|
|
4033
|
+
return;
|
|
4034
|
+
}
|
|
4035
|
+
const target = await resolveDeliveryTarget(runtimeConfig, agentId, {
|
|
4036
|
+
channel,
|
|
4037
|
+
to,
|
|
4038
|
+
accountId
|
|
4039
|
+
});
|
|
4040
|
+
if (!target.ok) throw target.error;
|
|
4041
|
+
await deliverOutboundPayloads({
|
|
4042
|
+
cfg: runtimeConfig,
|
|
4043
|
+
channel: target.channel,
|
|
4044
|
+
to: target.to,
|
|
4045
|
+
accountId: target.accountId,
|
|
4046
|
+
threadId: target.threadId,
|
|
4047
|
+
payloads: [{ text }],
|
|
4048
|
+
deps: createOutboundSendDeps(params.deps)
|
|
4049
|
+
});
|
|
4050
|
+
},
|
|
4051
|
+
log: getChildLogger({
|
|
4052
|
+
module: "cron",
|
|
4053
|
+
storePath
|
|
4054
|
+
}),
|
|
4055
|
+
onEvent: (evt) => {
|
|
4056
|
+
params.broadcast("cron", evt, { dropIfSlow: true });
|
|
4057
|
+
if (evt.action === "finished") {
|
|
4058
|
+
const webhookToken = trimToOptionalString(params.cfg.cron?.webhookToken);
|
|
4059
|
+
const legacyWebhook = trimToOptionalString(params.cfg.cron?.webhook);
|
|
4060
|
+
const job = cron.getJob(evt.jobId);
|
|
4061
|
+
const legacyNotify = job?.notify === true;
|
|
4062
|
+
const webhookTarget = resolveCronWebhookTarget({
|
|
4063
|
+
delivery: job?.delivery && typeof job.delivery.mode === "string" ? {
|
|
4064
|
+
mode: job.delivery.mode,
|
|
4065
|
+
to: job.delivery.to
|
|
4066
|
+
} : void 0,
|
|
4067
|
+
legacyNotify,
|
|
4068
|
+
legacyWebhook
|
|
4069
|
+
});
|
|
4070
|
+
if (!webhookTarget && job?.delivery?.mode === "webhook") cronLogger.warn({
|
|
4071
|
+
jobId: evt.jobId,
|
|
4072
|
+
deliveryTo: job.delivery.to
|
|
4073
|
+
}, "cron: skipped webhook delivery, delivery.to must be a valid http(s) URL");
|
|
4074
|
+
if (webhookTarget?.source === "legacy" && !warnedLegacyWebhookJobs.has(evt.jobId)) {
|
|
4075
|
+
warnedLegacyWebhookJobs.add(evt.jobId);
|
|
4076
|
+
cronLogger.warn({
|
|
4077
|
+
jobId: evt.jobId,
|
|
4078
|
+
legacyWebhook: redactWebhookUrl(webhookTarget.url)
|
|
4079
|
+
}, "cron: deprecated notify+cron.webhook fallback in use, migrate to delivery.mode=webhook with delivery.to");
|
|
4080
|
+
}
|
|
4081
|
+
if (webhookTarget && evt.summary) (async () => {
|
|
4082
|
+
await postCronWebhook({
|
|
4083
|
+
webhookUrl: webhookTarget.url,
|
|
4084
|
+
webhookToken,
|
|
4085
|
+
payload: evt,
|
|
4086
|
+
logContext: { jobId: evt.jobId },
|
|
4087
|
+
blockedLog: "cron: webhook delivery blocked by SSRF guard",
|
|
4088
|
+
failedLog: "cron: webhook delivery failed",
|
|
4089
|
+
logger: cronLogger
|
|
4090
|
+
});
|
|
4091
|
+
})();
|
|
4092
|
+
if (evt.status === "error" && job) {
|
|
4093
|
+
const failureDest = resolveFailureDestination(job, params.cfg.cron?.failureDestination);
|
|
4094
|
+
if (failureDest) {
|
|
4095
|
+
if (!(job.delivery?.bestEffort === true)) {
|
|
4096
|
+
const failureMessage = `Cron job "${job.name}" failed: ${evt.error ?? "unknown error"}`;
|
|
4097
|
+
const failurePayload = {
|
|
4098
|
+
jobId: job.id,
|
|
4099
|
+
jobName: job.name,
|
|
4100
|
+
message: failureMessage,
|
|
4101
|
+
status: evt.status,
|
|
4102
|
+
error: evt.error,
|
|
4103
|
+
runAtMs: evt.runAtMs,
|
|
4104
|
+
durationMs: evt.durationMs,
|
|
4105
|
+
nextRunAtMs: evt.nextRunAtMs
|
|
4106
|
+
};
|
|
4107
|
+
if (failureDest.mode === "webhook" && failureDest.to) {
|
|
4108
|
+
const webhookUrl = normalizeHttpWebhookUrl(failureDest.to);
|
|
4109
|
+
if (webhookUrl) (async () => {
|
|
4110
|
+
await postCronWebhook({
|
|
4111
|
+
webhookUrl,
|
|
4112
|
+
webhookToken,
|
|
4113
|
+
payload: failurePayload,
|
|
4114
|
+
logContext: { jobId: evt.jobId },
|
|
4115
|
+
blockedLog: "cron: failure destination webhook blocked by SSRF guard",
|
|
4116
|
+
failedLog: "cron: failure destination webhook failed",
|
|
4117
|
+
logger: cronLogger
|
|
4118
|
+
});
|
|
4119
|
+
})();
|
|
4120
|
+
else cronLogger.warn({
|
|
4121
|
+
jobId: evt.jobId,
|
|
4122
|
+
webhookUrl: redactWebhookUrl(failureDest.to)
|
|
4123
|
+
}, "cron: failure destination webhook URL is invalid, skipping");
|
|
4124
|
+
} else if (failureDest.mode === "announce") {
|
|
4125
|
+
const { agentId, cfg: runtimeConfig } = resolveCronAgent(job.agentId);
|
|
4126
|
+
sendFailureNotificationAnnounce(params.deps, runtimeConfig, agentId, job.id, {
|
|
4127
|
+
channel: failureDest.channel,
|
|
4128
|
+
to: failureDest.to,
|
|
4129
|
+
accountId: failureDest.accountId
|
|
4130
|
+
}, `[Cron Failure] ${failureMessage}`);
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
}
|
|
4134
|
+
}
|
|
4135
|
+
const logPath = resolveCronRunLogPath({
|
|
4136
|
+
storePath,
|
|
4137
|
+
jobId: evt.jobId
|
|
4138
|
+
});
|
|
4139
|
+
appendCronRunLog(logPath, {
|
|
4140
|
+
ts: Date.now(),
|
|
4141
|
+
jobId: evt.jobId,
|
|
4142
|
+
action: "finished",
|
|
4143
|
+
status: evt.status,
|
|
4144
|
+
error: evt.error,
|
|
4145
|
+
summary: evt.summary,
|
|
4146
|
+
delivered: evt.delivered,
|
|
4147
|
+
deliveryStatus: evt.deliveryStatus,
|
|
4148
|
+
deliveryError: evt.deliveryError,
|
|
4149
|
+
sessionId: evt.sessionId,
|
|
4150
|
+
sessionKey: evt.sessionKey,
|
|
4151
|
+
runAtMs: evt.runAtMs,
|
|
4152
|
+
durationMs: evt.durationMs,
|
|
4153
|
+
nextRunAtMs: evt.nextRunAtMs,
|
|
4154
|
+
model: evt.model,
|
|
4155
|
+
provider: evt.provider,
|
|
4156
|
+
usage: evt.usage
|
|
4157
|
+
}, runLogPrune).catch((err) => {
|
|
4158
|
+
cronLogger.warn({
|
|
4159
|
+
err: String(err),
|
|
4160
|
+
logPath
|
|
4161
|
+
}, "cron: run log append failed");
|
|
4162
|
+
});
|
|
4163
|
+
}
|
|
4164
|
+
}
|
|
4165
|
+
});
|
|
4166
|
+
return {
|
|
4167
|
+
cron,
|
|
4168
|
+
storePath,
|
|
4169
|
+
cronEnabled
|
|
4170
|
+
};
|
|
4171
|
+
}
|
|
4172
|
+
//#endregion
|
|
4173
|
+
export { runCronIsolatedAgentTurn as n, buildGatewayCronService as t };
|