squidclaw 2026.4.24 → 2026.4.26
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-C3Ip4Pdy.js +201 -0
- package/dist/abort.runtime-QNYdlOpn.js +2 -0
- package/dist/abort.runtime.js +1 -1
- package/dist/access-control-DwlCAZOQ.js +146 -0
- package/dist/accounts-C96LVxAj.js +133 -0
- package/dist/accounts-CBYP10BZ.js +107 -0
- package/dist/accounts-CPDLJugT.js +104 -0
- package/dist/accounts-LbGlovbZ.js +2 -0
- package/dist/acp-binding-runtime-BzT7m6eA.js +2 -0
- package/dist/acp-cli-CPb8l8Kq.js +2194 -0
- package/dist/acp-runtime--wBJVnTK.js +68 -0
- package/dist/acp-stateful-target-driver-BsXqxZs1.js +87 -0
- package/dist/action-agents-fCQzEMVA.js +67 -0
- package/dist/action-focus-C54pZO2i.js +123 -0
- package/dist/action-help-Dls799vg.js +7 -0
- package/dist/action-info-Df7LML-M.js +58 -0
- package/dist/action-kill-CzSrpu4H.js +33 -0
- package/dist/action-list-8B0fqbE1.js +21 -0
- package/dist/action-log-D4Esl7DY.js +30 -0
- package/dist/action-runtime-BQL7ZKYp.js +323 -0
- package/dist/action-runtime-FEfSljLk.js +72 -0
- package/dist/action-runtime-Ih2WV4_Q.js +419 -0
- package/dist/action-runtime-api-SwJP8tC2.js +2 -0
- package/dist/action-runtime.runtime-Dg0EDpD0.js +2 -0
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/action-send-FZEWY7z-.js +39 -0
- package/dist/action-spawn-D9aYmWtU.js +46 -0
- package/dist/action-unfocus-DH_0Sdai.js +28 -0
- package/dist/actions-_4VXA2Mi.js +539 -0
- package/dist/actions.runtime-C0sq1G1X.js +18 -0
- package/dist/actions.runtime-Csmut5JU.js +2 -0
- package/dist/actions.runtime-DK1S2kPA.js +5 -0
- package/dist/actions.runtime.js +1 -1
- package/dist/agent-DDUCovt6.js +2 -0
- package/dist/agent-command-B66ZhH42.js +1453 -0
- package/dist/agent-components.runtime-BKPjyXtT.js +10 -0
- package/dist/agent-components.runtime.js +1 -1
- package/dist/agent-runner.runtime-C9TebV0N.js +2712 -0
- package/dist/agent-runner.runtime.js +1 -1
- package/dist/agent-runtime-t-qKN_UH.js +17 -0
- package/dist/agents-BQS1Y3W6.js +5 -0
- package/dist/agents-_tqZh21O.js +887 -0
- package/dist/api-BHDjzh-P.js +2 -0
- package/dist/api-BhSeyy_T.js +2 -0
- package/dist/api-BhYwA1V2.js +1085 -0
- package/dist/api-CDtkR7PN.js +7 -0
- package/dist/api-CxpdTzFP.js +19032 -0
- package/dist/api-CyiHB3Bg.js +5 -0
- package/dist/api-DLBxNdf6.js +5 -0
- package/dist/api-DyFZaXTD.js +2 -0
- package/dist/api-JpNozfiq.js +7524 -0
- package/dist/api-kcSVTL-D.js +3 -0
- package/dist/approval-gateway-resolver-BrmICL5N.js +58 -0
- package/dist/approval-gateway-runtime-iBiFwmNK.js +2 -0
- package/dist/approval-handler-runtime-6tNhCATs.js +439 -0
- package/dist/approval-handler-runtime-Y6qTvYdd.js +3 -0
- package/dist/approval-handler.runtime-BjSoNi2w.js +245 -0
- package/dist/approval-handler.runtime-CoHzXxnh.js +2 -0
- package/dist/approval-handler.runtime-DUXalSxo.js +389 -0
- package/dist/approval-handler.runtime-SNOyMr7X.js +130 -0
- package/dist/approval-handler.runtime-uqWDos3I.js +285 -0
- package/dist/approval-handler.runtime.js +1 -1
- package/dist/approval-native-ByQ5cAKu.js +156 -0
- package/dist/approval-native-IX9eLH7P.js +130 -0
- package/dist/approval-native-runtime-BvK9OIUS.js +709 -0
- package/dist/approval-runtime-DrDMdWm9.js +9 -0
- package/dist/attachment-normalize-4X-dPdgN.js +1013 -0
- package/dist/audit-C621VOev.js +99 -0
- package/dist/audit-Cgyz5k-s.js +2 -0
- package/dist/audit-I_keYen3.js +885 -0
- package/dist/audit.runtime-LrJ3wwQS.js +7 -0
- package/dist/audit.runtime.js +1 -1
- package/dist/auth-config-utils-T0ZgqKam.js +96 -0
- package/dist/binding-routing-dsu8Ei2E.js +50 -0
- package/dist/binding-targets-DLGZ_Ium.js +99 -0
- package/dist/bot-B_6rj4zN.js +5426 -0
- package/dist/bot-message-context.runtime-DkgJddS4.js +8 -0
- package/dist/bot-message-context.runtime.js +1 -1
- package/dist/bot-message-context.session.runtime-TObgOB7o.js +12 -0
- package/dist/bot-message-context.session.runtime.js +1 -1
- package/dist/bot-native-commands.delivery.runtime-BZtEbhIe.js +3 -0
- package/dist/bot-native-commands.delivery.runtime.js +1 -1
- package/dist/bot-native-commands.runtime-BMD61ysH.js +13 -0
- package/dist/bot-native-commands.runtime.js +1 -1
- package/dist/bridge-server-CS1RLfW4.js +102 -0
- package/dist/browser-cdp-CghSlauS.js +2 -0
- package/dist/browser-cdp-CvTVpSI6.js +2 -0
- package/dist/browser-control-auth-C9pUylzV.js +2 -0
- package/dist/browser-control-auth-nhU4A0DX.js +2 -0
- package/dist/browser-doctor-BOEftV4I.js +78 -0
- package/dist/browser-maintenance-DOcb80F5.js +3 -0
- package/dist/browser-node-runtime-BOCwie8T.js +490 -0
- package/dist/browser-profiles-BOvL9Nd_.js +2 -0
- package/dist/browser-profiles-D7h0J9IB.js +2 -0
- package/dist/browser-setup-tools-CeMAH5u9.js +321 -0
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/call-BPuAN6uk.js +2 -0
- package/dist/call-Stm9npN1.js +527 -0
- package/dist/call.runtime-pNpOyCMV.js +2 -0
- package/dist/call.runtime.js +1 -1
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/capability-cli-DDNbz6qA.js +1350 -0
- package/dist/captured-registration-DiZNTE1j.js +1159 -0
- package/dist/channel-5cqa1fkB.js +482 -0
- package/dist/channel-B2BtCq9W.js +843 -0
- package/dist/channel-B3LQs2NY.js +1146 -0
- package/dist/channel-BpRwK42_.js +816 -0
- package/dist/channel-D37vkLja.js +226 -0
- package/dist/channel-DIhovOIw.js +864 -0
- package/dist/channel-DWq9G6kb.js +1109 -0
- package/dist/channel-Daae0E3T.js +532 -0
- package/dist/channel-DvleEuhM.js +991 -0
- package/dist/channel-actions-BdSOWgd_.js +233 -0
- package/dist/channel-actions.runtime-BqTVWPRH.js +2 -0
- package/dist/channel-actions.runtime.js +1 -1
- package/dist/channel-core-Cv3Q_BxL.js +2 -0
- package/dist/channel-iCTT2rJY.js +1168 -0
- package/dist/channel-inbound-2Azyl-Eq.js +31 -0
- package/dist/channel-plugin-runtime-C0B9dm1c.js +784 -0
- package/dist/channel-react-action-t-Q8EYHs.js +39 -0
- package/dist/channel-runtime-u_0nRFcO.js +427 -0
- package/dist/channel-tcRPznyK.js +368 -0
- package/dist/channel.runtime-B4njrVR-.js +87 -0
- package/dist/channel.runtime-B7f1kmTM.js +131 -0
- package/dist/channel.runtime-Bfpl66UH.js +348 -0
- package/dist/channel.runtime-C7QMwh86.js +399 -0
- package/dist/channel.runtime-Cc3a4FA5.js +2169 -0
- package/dist/channel.runtime-Cch8xmFc.js +35114 -0
- package/dist/channel.runtime-CfoT2NmX.js +109 -0
- package/dist/channel.runtime-DyKO7U-e.js +789 -0
- package/dist/channel.runtime-DydTNcYU.js +4 -0
- package/dist/channel.runtime-nu19ePyh.js +429 -0
- package/dist/channel.runtime.js +1 -1
- package/dist/channel.setup-CUbpzSW3.js +8 -0
- package/dist/channel.setup-D-X7BY4c.js +17 -0
- package/dist/channel.setup-VaEcA2Bw.js +274 -0
- package/dist/channel2.runtime-CLngBuRF.js +2067 -0
- package/dist/channel2.runtime.js +1 -1
- package/dist/channels-cli-BxujBciW.js +246 -0
- package/dist/channels-iGV5z9VU.js +1145 -0
- package/dist/clawbot-cli-Dq5qEzSA.js +9 -0
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-C32Tbry-.js +696 -0
- package/dist/cli-CEXN0k1o.js +79 -0
- package/dist/cli-CGKUU-db.js +64 -0
- package/dist/cli-Cx3rv1vo.js +2 -0
- package/dist/cli-metadata-D6pLr6rq.js +22 -0
- package/dist/cli-startup-metadata.json +1 -1
- package/dist/cli.runtime-CiBfmyfs.js +435 -0
- package/dist/cli.runtime-DEQio5Lw.js +913 -0
- package/dist/cli.runtime.js +1 -1
- package/dist/client-1JAVhCV6.js +5 -0
- package/dist/client-D1lDccJs.js +7 -0
- package/dist/client-Du86RGVU.js +19 -0
- package/dist/client-HlUQWLff.js +138 -0
- package/dist/client-bootstrap-ByVde6Fa.js +28 -0
- package/dist/client-bootstrap-C0Wk4TyE.js +103 -0
- package/dist/client-bootstrap-Dh4UZQOs.js +2 -0
- package/dist/client-fetch-DJ3v5Zqh.js +6329 -0
- package/dist/client-ymH-icZi.js +76 -0
- package/dist/command-auth-D_xf4gCH.js +82 -0
- package/dist/command-config-resolution-BAsIvTx0.js +23 -0
- package/dist/command-config-resolution-CpiepMpe.js +2 -0
- package/dist/command-registry-BIG4I3Tl.js +103 -0
- package/dist/command-registry-C4qTbytp.js +3 -0
- package/dist/command-secret-gateway-CENVpYli.js +528 -0
- package/dist/commands-acp-Cs1u2TMa.js +1016 -0
- package/dist/commands-compact.runtime-BU8kO8vM.js +9 -0
- package/dist/commands-compact.runtime.js +1 -1
- package/dist/commands-handlers.runtime-C2sVgHH3.js +3752 -0
- package/dist/commands-handlers.runtime.js +1 -1
- package/dist/commands-status-Cz9bvbev.js +220 -0
- package/dist/commands-status.runtime-B0oVKqlK.js +2 -0
- package/dist/commands-status.runtime.js +1 -1
- package/dist/commands-subagents-control.runtime-BayeBpt2.js +3 -0
- package/dist/commands-subagents-control.runtime-BrvZHkSL.js +2 -0
- package/dist/commands-subagents-control.runtime.js +1 -1
- package/dist/commands.runtime-CYPSZ2Po.js +103 -0
- package/dist/commands.runtime.js +1 -1
- package/dist/compact.runtime-q-dUs-qg.js +7 -0
- package/dist/compact.runtime.js +1 -1
- package/dist/completion-cli-C9KjcjmD.js +464 -0
- package/dist/completion-cli-h0Jz9_xh.js +2 -0
- package/dist/config-DH9LZzz-.js +555 -0
- package/dist/config-cli-CE2z2XhI.js +946 -0
- package/dist/configure-B1KcWWIQ.js +1157 -0
- package/dist/configure-BFpmOfcM.js +2 -0
- package/dist/connect-options-wUo0syAv.js +702 -0
- package/dist/connection-auth-DALCO1uk.js +30 -0
- package/dist/control-auth-CflplSYR.js +55 -0
- package/dist/conversation-binding-runtime-uoVX8Lm4.js +4 -0
- package/dist/conversation-runtime-WfUMmAAc.js +31 -0
- package/dist/core-BnLEfcOW.js +210 -0
- package/dist/core-api-5mOZyT2k.js +372 -0
- package/dist/create-client-B5apuysv.js +2 -0
- package/dist/create-client-FX-9Y0XK.js +61 -0
- package/dist/credentials-oSecax07.js +57 -0
- package/dist/credentials-write.runtime-BF3qpFqv.js +12 -0
- package/dist/credentials-write.runtime.js +1 -1
- package/dist/cron-cli-CquHRHP9.js +637 -0
- package/dist/crypto-runtime-BaeaJGjJ.js +3510 -0
- package/dist/daemon-cli-C2ygRiWD.js +408 -0
- package/dist/daemon-install-Ba_zQ3ks.js +63 -0
- package/dist/delegate-k0Mpo7Fv.js +59 -0
- package/dist/delivery-BWwkQRrF.js +858 -0
- package/dist/devices-cli-BtB_W8Zn.js +329 -0
- package/dist/direct-dm-BPup4rb6.js +139 -0
- package/dist/directive-handling.fast-lane-D8zsIDMg.js +64 -0
- package/dist/directive-handling.fast-lane-DA2YZPX0.js +2 -0
- package/dist/directive-handling.impl-D7beV5oV.js +659 -0
- package/dist/directive-handling.impl-DukNkNri.js +2 -0
- package/dist/directory-live-Bj4yafmF.js +105 -0
- package/dist/directory-live-D5tvc0Jj.js +2 -0
- package/dist/discovery-B5x1zcdW.js +280 -0
- package/dist/discovery-f3K2E-jQ.js +201 -0
- package/dist/dispatch-BTn7rXKb.js +970 -0
- package/dist/dispatch-acp-Dxchw6dz.js +969 -0
- package/dist/dispatch-acp-manager.runtime-v3DvTQTV.js +3 -0
- package/dist/dispatch-acp-manager.runtime.js +1 -1
- package/dist/dispatch-acp.runtime-BSHeNOOR.js +19 -0
- package/dist/dispatch-acp.runtime.js +1 -1
- package/dist/docker-harness-B8V4pktJ.js +277 -0
- package/dist/doctor-completion-BqOiWnS_.js +90 -0
- package/dist/entry.js +1 -1
- package/dist/env-auth-DXWyTD3f.js +2 -0
- package/dist/exec-approvals-DB9tWYQD.js +272 -0
- package/dist/exec-approvals-cli-BQ44KCYG.js +483 -0
- package/dist/exec-approvals-ymQFSV4S.js +129 -0
- package/dist/extensionAPI.js +1 -1
- package/dist/extensions/acpx/index.js +3 -3
- package/dist/extensions/acpx/register.runtime.js +1 -1
- package/dist/extensions/acpx/runtime-api.js +3 -3
- package/dist/extensions/amazon-bedrock/.squidclaw-runtime-deps-stamp.json +1 -1
- 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 +1 -1
- package/dist/extensions/amazon-bedrock/register.sync.runtime.js +1 -1
- package/dist/extensions/amazon-bedrock/setup-api.js +1 -1
- package/dist/extensions/amazon-bedrock-mantle/.squidclaw-runtime-deps-stamp.json +1 -1
- package/dist/extensions/amazon-bedrock-mantle/api.js +1 -1
- package/dist/extensions/amazon-bedrock-mantle/discovery.js +1 -1
- package/dist/extensions/amazon-bedrock-mantle/index.js +1 -1
- package/dist/extensions/amazon-bedrock-mantle/register.sync.runtime.js +1 -1
- package/dist/extensions/bluebubbles/api.js +6 -6
- package/dist/extensions/browser/browser-bridge.js +1 -1
- package/dist/extensions/browser/browser-cdp.js +2 -2
- package/dist/extensions/browser/browser-config.js +2 -2
- package/dist/extensions/browser/browser-control-auth.js +2 -2
- package/dist/extensions/browser/browser-doctor.js +1 -1
- package/dist/extensions/browser/browser-maintenance.js +3 -3
- package/dist/extensions/browser/browser-profiles.js +2 -2
- package/dist/extensions/browser/browser-runtime-api.js +6 -6
- package/dist/extensions/browser/index.js +1 -1
- package/dist/extensions/browser/plugin-registration.js +1 -1
- package/dist/extensions/browser/register.runtime.js +3 -3
- package/dist/extensions/browser/runtime-api.js +7 -7
- package/dist/extensions/browser/test-support.js +2 -2
- package/dist/extensions/device-pair/api.js +1 -1
- package/dist/extensions/device-pair/index.js +3 -3
- package/dist/extensions/device-pair/notify.js +1 -1
- package/dist/extensions/device-pair/pair-command-approve.js +1 -1
- package/dist/extensions/diffs/.squidclaw-runtime-deps-stamp.json +1 -1
- package/dist/extensions/discord/.squidclaw-runtime-deps-stamp.json +1 -1
- package/dist/extensions/discord/action-runtime-api.js +2 -2
- package/dist/extensions/discord/api.js +7 -7
- package/dist/extensions/discord/channel-plugin-api.js +1 -1
- package/dist/extensions/discord/contract-api.js +2 -2
- package/dist/extensions/discord/runtime-api.js +11 -11
- package/dist/extensions/discord/subagent-hooks-api.js +1 -1
- package/dist/extensions/discord/test-api.js +4 -4
- package/dist/extensions/feishu/.squidclaw-runtime-deps-stamp.json +1 -1
- package/dist/extensions/feishu/api.js +6 -6
- package/dist/extensions/feishu/contract-api.js +1 -1
- package/dist/extensions/feishu/runtime-api.js +1 -1
- package/dist/extensions/google/index.js +1 -1
- package/dist/extensions/google/music-generation-provider.js +1 -1
- package/dist/extensions/googlechat/api.js +1 -1
- package/dist/extensions/googlechat/runtime-api.js +1 -1
- package/dist/extensions/googlechat/test-api.js +2 -2
- package/dist/extensions/imessage/api.js +6 -6
- package/dist/extensions/imessage/runtime-api.js +3 -3
- package/dist/extensions/irc/api.js +2 -2
- package/dist/extensions/irc/channel-plugin-api.js +1 -1
- package/dist/extensions/line/api.js +7 -7
- package/dist/extensions/line/contract-api.js +1 -1
- package/dist/extensions/line/runtime-api.js +4 -4
- package/dist/extensions/line/setup-api.js +1 -1
- package/dist/extensions/llm-task/index.js +2 -2
- package/dist/extensions/lobster/runtime-api.js +1 -1
- package/dist/extensions/matrix/api.js +4 -4
- package/dist/extensions/matrix/channel-plugin-api.js +1 -1
- package/dist/extensions/matrix/cli-metadata.js +1 -1
- package/dist/extensions/matrix/contract-api.js +3 -3
- package/dist/extensions/matrix/index.js +1 -1
- package/dist/extensions/matrix/plugin-entry.handlers.runtime.js +3 -3
- package/dist/extensions/matrix/runtime-heavy-api.js +1 -1
- package/dist/extensions/matrix/test-api.js +1 -1
- package/dist/extensions/mattermost/api.js +1 -1
- package/dist/extensions/mattermost/channel-plugin-api.js +1 -1
- package/dist/extensions/mattermost/channel-plugin-runtime.js +1 -1
- package/dist/extensions/mattermost/policy-api.js +1 -1
- package/dist/extensions/mattermost/runtime-api.js +1 -1
- package/dist/extensions/memory-core/cli-metadata.js +2 -2
- package/dist/extensions/memory-core/index.js +1 -1
- package/dist/extensions/memory-lancedb/cli-metadata.js +1 -1
- package/dist/extensions/minimax/index.js +1 -1
- package/dist/extensions/minimax/music-generation-provider.js +1 -1
- package/dist/extensions/msteams/api.js +1 -1
- package/dist/extensions/msteams/runtime-api.js +3 -3
- package/dist/extensions/msteams/test-api.js +1 -1
- package/dist/extensions/nextcloud-talk/api.js +5 -5
- package/dist/extensions/nextcloud-talk/runtime-api.js +2 -2
- package/dist/extensions/nostr/api.js +5 -5
- package/dist/extensions/nostr/runtime-api.js +3 -3
- package/dist/extensions/nostr/setup-api.js +1 -1
- package/dist/extensions/nostr/test-api.js +1 -1
- package/dist/extensions/openshell/index.js +3 -3
- package/dist/extensions/qa-channel/api.js +3 -3
- package/dist/extensions/qa-channel/runtime-api.js +3 -3
- package/dist/extensions/qa-channel/setup-entry.js +3 -3
- package/dist/extensions/qa-lab/api.js +4 -4
- package/dist/extensions/qa-lab/index.js +2 -2
- package/dist/extensions/qa-lab/runtime-api.js +4 -4
- package/dist/extensions/qqbot/.squidclaw-runtime-deps-stamp.json +1 -1
- package/dist/extensions/qqbot/api.js +1 -1
- package/dist/extensions/signal/api.js +10 -10
- package/dist/extensions/signal/reaction-runtime-api.js +1 -1
- package/dist/extensions/signal/runtime-api.js +7 -7
- package/dist/extensions/slack/.squidclaw-runtime-deps-stamp.json +1 -1
- package/dist/extensions/slack/api.js +9 -9
- package/dist/extensions/slack/channel-plugin-api.js +1 -1
- package/dist/extensions/slack/contract-api.js +3 -3
- package/dist/extensions/slack/runtime-api.js +9 -9
- package/dist/extensions/slack/security-contract-api.js +1 -1
- package/dist/extensions/slack/setup-plugin-api.js +1 -1
- package/dist/extensions/slack/test-api.js +4 -4
- package/dist/extensions/speech-core/runtime-api.js +1 -1
- package/dist/extensions/synology-chat/api.js +2 -2
- package/dist/extensions/telegram/.squidclaw-runtime-deps-stamp.json +1 -1
- package/dist/extensions/telegram/api.js +11 -11
- package/dist/extensions/telegram/channel-plugin-api.js +2 -2
- package/dist/extensions/telegram/contract-api.js +4 -4
- package/dist/extensions/telegram/runtime-api.js +7 -7
- package/dist/extensions/telegram/setup-plugin-api.js +1 -1
- package/dist/extensions/telegram/test-api.js +2 -2
- package/dist/extensions/telegram/test-support.js +3 -3
- package/dist/extensions/tlon/api.js +3 -3
- package/dist/extensions/tlon/runtime-api.js +1 -1
- package/dist/extensions/tlon/test-api.js +1 -1
- package/dist/extensions/twitch/api.js +1 -1
- package/dist/extensions/webhooks/.squidclaw-runtime-deps-stamp.json +1 -1
- package/dist/extensions/webhooks/api.js +1 -1
- package/dist/extensions/webhooks/index.js +1 -1
- 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 +4 -4
- package/dist/extensions/whatsapp/channel-plugin-api.js +1 -1
- package/dist/extensions/whatsapp/contract-api.js +1 -1
- package/dist/extensions/whatsapp/runtime-api.js +7 -7
- package/dist/extensions/whatsapp/setup-plugin-api.js +1 -1
- package/dist/extensions/whatsapp/test-api.js +4 -4
- package/dist/extensions/zalo/api.js +9 -9
- package/dist/extensions/zalo/runtime-api.js +2 -2
- package/dist/extensions/zalo/setup-api.js +2 -2
- package/dist/extensions/zalouser/api.js +1 -1
- package/dist/extensions/zalouser/runtime-api.js +4 -4
- package/dist/extensions/zalouser/test-api.js +1 -1
- package/dist/format-DsACiUPu.js +941 -0
- package/dist/gateway-c-WsPYj4.js +2652 -0
- package/dist/gateway-cli-Bnpc2Voo.js +1510 -0
- package/dist/gateway-install-token-DIOAhXuh.js +213 -0
- package/dist/gateway-rpc-DVaHylV3.js +14 -0
- package/dist/gateway-rpc.runtime-kXdx3hkp.js +23 -0
- package/dist/gateway-rpc.runtime.js +1 -1
- package/dist/gateway-runtime-BhcAFzRw.js +12 -0
- package/dist/get-reply-from-config.runtime-d4te9jQo.js +2 -0
- package/dist/get-reply-from-config.runtime.js +1 -1
- package/dist/graph-users-zs6xFUeS.js +926 -0
- package/dist/group-access-B4ZqqG4N.js +119 -0
- package/dist/handle-action-DeKTbWt6.js +505 -0
- package/dist/health-Dj59Wog_.js +2 -0
- package/dist/health-y_vsJR_i.js +578 -0
- package/dist/heartbeat-runner-DZxpXVmc.js +1060 -0
- package/dist/heartbeat-runner-Do5PsCsd.js +4 -0
- package/dist/heartbeat-runner.runtime-B9A8-a50.js +2 -0
- package/dist/heartbeat-runner.runtime.js +1 -1
- package/dist/http-client-DZ8yqOqh.js +322 -0
- package/dist/inbound-reply-dispatch-CgmaSukn.js +73 -0
- package/dist/index.js +2 -2
- package/dist/infra-runtime-CTXlws25.js +23 -0
- package/dist/inline-buttons-9XyokdjH.js +40 -0
- package/dist/known-users-DpbiKYbd.js +1180 -0
- package/dist/legacy-crypto-restore-C9_FfFfg.js +85 -0
- package/dist/library-BpcEZKWC.js +44 -0
- package/dist/llm-slug-generator-P7hR4Vjw.js +69 -0
- package/dist/llm-slug-generator.js +1 -1
- package/dist/login-Ck0Wi5lt.js +2574 -0
- package/dist/logs-cli-CXtWYpE2.js +264 -0
- package/dist/logs-cli.runtime-aJbUlXPP.js +2 -0
- package/dist/logs-cli.runtime.js +1 -1
- package/dist/manager-398fysIe.js +2048 -0
- package/dist/manager.runtime-BXi2JFi_.js +900 -0
- package/dist/manager.runtime.js +1 -1
- package/dist/markdown-to-line-BAz5cp2N.js +781 -0
- package/dist/matrix-migration.runtime-BJGNsR_f.js +2 -0
- package/dist/matrix-migration.runtime.js +1 -1
- package/dist/mcp-cli-Dak77dd9.js +747 -0
- package/dist/media-text-2gf65U8r.js +146 -0
- package/dist/memory-core-CvBuLWAT.js +7 -0
- package/dist/memory-core-host-runtime-cli-C6YZxF34.js +9 -0
- package/dist/message-DQn4jjjK.js +223 -0
- package/dist/message-action-runner-BXCwnHl-.js +1628 -0
- package/dist/message-action-runner-Bker0uL5.js +2 -0
- package/dist/message-actions-AsXQpb4E.js +143 -0
- package/dist/message-handler-CQ_vnfR8.js +1925 -0
- package/dist/message.gateway.runtime-CJiz4m8j.js +2 -0
- package/dist/message.gateway.runtime.js +1 -1
- package/dist/messages-BY_cfyDr.js +139 -0
- package/dist/method-scopes-D6zsS-pm.js +2803 -0
- package/dist/migration-snapshot.runtime-CuobftaY.js +3 -0
- package/dist/migration-snapshot.runtime.js +1 -1
- package/dist/models-CUbywYoT.js +3 -0
- package/dist/models-Mt05Glx7.js +2565 -0
- package/dist/models-cli-Diu9RWcd.js +197 -0
- package/dist/monitor-BVQ_6q4q.js +1344 -0
- package/dist/monitor-BgZqpzQ4.js +3653 -0
- package/dist/monitor-CRyZeOLA.js +5 -0
- package/dist/monitor-CTeJMQIS.js +1533 -0
- package/dist/monitor-Clsyl6I5.js +1221 -0
- package/dist/monitor-DWmNxlg8.js +2 -0
- package/dist/monitor-Dl93TMoP.js +524 -0
- package/dist/monitor-DulT_zS7.js +673 -0
- package/dist/monitor-DxfN501k.js +288 -0
- package/dist/monitor-auth-BylfDCgP.js +2470 -0
- package/dist/monitor-normalize-8NtJ86WB.js +1018 -0
- package/dist/monitor-polling.runtime-bSalr8n9.js +309 -0
- package/dist/monitor-polling.runtime.js +1 -1
- package/dist/monitor-tQtfAk9w.js +4027 -0
- package/dist/monitor-webhook.runtime-1zpAZts3.js +298 -0
- package/dist/monitor-webhook.runtime.js +1 -1
- package/dist/monitor-wo_dDmjy.js +4 -0
- package/dist/monitor.runtime-BuadcqNG.js +2 -0
- package/dist/monitor.runtime.js +1 -1
- package/dist/monitor.webhook-DWunSb4d.js +152 -0
- package/dist/msteams-YxwMN3QQ.js +35 -0
- package/dist/music-generation-provider-DPY-Y9pn.js +141 -0
- package/dist/music-generation-provider-c5eFh-q4.js +169 -0
- package/dist/nextcloud-talk-YBKgqApH.js +17 -0
- package/dist/node-cli-BzVdkCht.js +2361 -0
- package/dist/nodes-cli-WBuANN5j.js +1046 -0
- package/dist/nostr-BSBIORO6.js +20 -0
- package/dist/notify-Ca3IwAyy.js +301 -0
- package/dist/onboard-CmEE959C.js +620 -0
- package/dist/onboard-helpers-J7K9QCXJ.js +210 -0
- package/dist/onboard-helpers-c55t1Rta.js +5 -0
- package/dist/onboard-remote-BI9k0tWz.js +2 -0
- package/dist/onboard-remote-zMTzPAhZ.js +193 -0
- package/dist/onboard-skills-BahZW5qf.js +134 -0
- package/dist/onboard-skills-C0jpNuK6.js +2 -0
- package/dist/operator-approvals-client-BqmunuEw.js +68 -0
- package/dist/outbound-adapter-CL3PYt0S.js +186 -0
- package/dist/outbound-adapter-Dj9zOahO.js +195 -0
- package/dist/outbound-send-deps-Ch1FX3cp.js +179 -0
- package/dist/outbound.runtime-CLByNIkJ.js +2 -0
- package/dist/outbound.runtime.js +1 -1
- package/dist/pair-command-approve-cbRWZncm.js +34 -0
- package/dist/persistent-bindings.lifecycle-hzcUlmjI.js +94 -0
- package/dist/pi-embedded-1KYWU12i.js +4 -0
- package/dist/pi-embedded-CmMqks-z.js +34664 -0
- package/dist/pi-embedded.runtime-C_FpZUhj.js +4 -0
- package/dist/pi-embedded.runtime.js +1 -1
- package/dist/plugin-registration-BhKSTk3H.js +23 -0
- package/dist/plugin-sdk/.boundary-entry-shims.stamp +1 -1
- package/dist/plugin-sdk/acp-binding-runtime.js +2 -2
- package/dist/plugin-sdk/acp-runtime.js +2 -2
- package/dist/plugin-sdk/agent-runtime.js +2 -2
- package/dist/plugin-sdk/approval-gateway-runtime.js +2 -2
- package/dist/plugin-sdk/approval-handler-runtime.js +3 -3
- package/dist/plugin-sdk/approval-runtime.js +2 -2
- package/dist/plugin-sdk/browser-cdp.js +2 -2
- package/dist/plugin-sdk/browser-config.js +5 -5
- package/dist/plugin-sdk/browser-control-auth.js +2 -2
- package/dist/plugin-sdk/browser-node-runtime.js +3 -3
- package/dist/plugin-sdk/browser-profiles.js +2 -2
- package/dist/plugin-sdk/browser-setup-tools.js +1 -1
- package/dist/plugin-sdk/browser-support.js +4 -4
- package/dist/plugin-sdk/channel-core.js +2 -2
- package/dist/plugin-sdk/channel-inbound.js +2 -2
- package/dist/plugin-sdk/command-auth.js +3 -3
- package/dist/plugin-sdk/compat.js +1 -1
- package/dist/plugin-sdk/conversation-binding-runtime.js +2 -2
- package/dist/plugin-sdk/conversation-runtime.js +3 -3
- package/dist/plugin-sdk/core.js +3 -3
- package/dist/plugin-sdk/direct-dm.js +1 -1
- package/dist/plugin-sdk/gateway-runtime.js +3 -3
- package/dist/plugin-sdk/inbound-reply-dispatch.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.js +1 -1
- package/dist/plugin-sdk/memory-core-host-runtime-cli.js +2 -2
- package/dist/plugin-sdk/memory-core.js +2 -2
- package/dist/plugin-sdk/msteams.js +2 -2
- package/dist/plugin-sdk/nextcloud-talk.js +2 -2
- package/dist/plugin-sdk/nostr.js +2 -2
- package/dist/plugin-sdk/qa-channel.js +3 -3
- package/dist/plugin-sdk/reply-dispatch-runtime.js +2 -2
- package/dist/plugin-sdk/reply-runtime.js +4 -4
- package/dist/plugin-sdk/runtime-secret-resolution.js +1 -1
- package/dist/plugin-sdk/runtime.js +2 -2
- package/dist/plugin-sdk/sandbox.js +2 -2
- package/dist/plugin-sdk/src/agents/tools/call-specialist-tool.d.ts +1 -1
- package/dist/plugin-sdk/testing.js +6 -6
- package/dist/plugin-sdk/tlon.js +1 -1
- package/dist/plugin-sdk/zalo.js +1 -1
- package/dist/plugin-sdk/zalouser.js +1 -1
- package/dist/plugin-service-I5xNfnqu.js +2479 -0
- package/dist/plugins/runtime/index.js +1 -1
- package/dist/policy-BcKwMOuf.js +296 -0
- package/dist/prepare-1JYgpHMp.js +1311 -0
- package/dist/preview-streaming-Dgo51jwq.js +156 -0
- package/dist/probe-BJkY768e.js +45 -0
- package/dist/probe-BO-QxpgT.js +54 -0
- package/dist/probe-CDUK6e0p.js +467 -0
- package/dist/probe-CGYSSS6w.js +2 -0
- package/dist/probe-C_HVcqqJ.js +1951 -0
- package/dist/probe-Dcxae8tq.js +42 -0
- package/dist/probe-KUxarUv8.js +2 -0
- package/dist/probe-auth-CIcA1us7.js +69 -0
- package/dist/probe-auth-DA5iwmzB.js +3 -0
- package/dist/probe-bLlnDSfP.js +473 -0
- package/dist/probe-d-N_Ew21.js +2 -0
- package/dist/probe-hzrJP3l0.js +178 -0
- package/dist/probe.runtime-Ba11Eg_b.js +3 -0
- package/dist/profile-update-PKvx6HDA.js +67 -0
- package/dist/program-B2XUGWf0.js +112 -0
- package/dist/prompt-select-styled-BiuIxyVy.js +5126 -0
- package/dist/provider-BwOrYaSK.js +6962 -0
- package/dist/provider-C7ICmZkE.js +3454 -0
- package/dist/provider-dispatcher-DPiA3qdi.js +22 -0
- package/dist/provider-session.runtime-PrTPFKkk.js +9 -0
- package/dist/provider-session.runtime.js +1 -1
- package/dist/provider.runtime-DHJ3gJ4H.js +2 -0
- package/dist/provider.runtime.js +1 -1
- package/dist/pw-ai-DbNjlJd_.js +2103 -0
- package/dist/qa-channel-DPwx33i_.js +2 -0
- package/dist/qa-cli-BPK0pssJ.js +8 -0
- package/dist/qr-cli-BQZT1W61.js +2 -0
- package/dist/qr-cli-zZCvfEGI.js +358 -0
- package/dist/reaction-level-BKvUgCPf.js +18 -0
- package/dist/reaction-runtime-api-FFve0ASq.js +117 -0
- package/dist/reactions-CP7nQ59C.js +1037 -0
- package/dist/register.agent-B1iIgZcF.js +240 -0
- package/dist/register.configure-CU848AKJ.js +15 -0
- package/dist/register.maintenance-0ixk7nTW.js +437 -0
- package/dist/register.message-DTWlTzQc.js +646 -0
- package/dist/register.onboard-XoYrJne_.js +79 -0
- package/dist/register.runtime-C23P0yPV.js +4738 -0
- package/dist/register.runtime-Dvg8kppp.js +80 -0
- package/dist/register.setup-B0qqtOdc.js +103 -0
- package/dist/register.status-health-sessions-DQg4wT9r.js +1209 -0
- package/dist/register.subclis-C_eAf5_9.js +232 -0
- package/dist/register.subclis-DIE44wj9.js +3 -0
- package/dist/register.sync.runtime-CEwGao3L.js +30 -0
- package/dist/register.sync.runtime-EcmEVX3D.js +111 -0
- package/dist/register.sync.runtime.js +1 -1
- package/dist/replies-Bu1-QtzN.js +120 -0
- package/dist/reply-CUrPTPsP.js +3408 -0
- package/dist/reply-dispatch-runtime-GsI0pwoH.js +3 -0
- package/dist/reply-resolver.runtime-Bqa-hTWi.js +3 -0
- package/dist/reply-resolver.runtime.js +1 -1
- package/dist/reply-runtime-BIkS_Pjw.js +63 -0
- package/dist/reply.runtime-C_R0Cuqw.js +2 -0
- package/dist/reply.runtime.js +1 -1
- package/dist/resolve-channels-BLJSQFnE.js +80 -0
- package/dist/resolve-channels-DUug40p5.js +2 -0
- package/dist/resolve-targets-CnEbbF0_.js +280 -0
- package/dist/resolve-users-CdLN23M6.js +112 -0
- package/dist/resolve-users-CqmyP2em.js +2 -0
- package/dist/restart-health-BZLsoj5O.js +2 -0
- package/dist/restart-health-CyklphHq.js +202 -0
- package/dist/route-resolution-D2WXBq57.js +519 -0
- package/dist/rpc-_BscaFSu.js +61 -0
- package/dist/rpc.runtime-Bx-cycaL.js +21 -0
- package/dist/rpc.runtime.js +1 -1
- package/dist/run-main-C5SoyJvl.js +452 -0
- package/dist/run-wait-BS5Cx7Uv.js +118 -0
- package/dist/runtime-B34RI1S7.js +969 -0
- package/dist/runtime-BvSPxHWR.js +1030 -0
- package/dist/runtime-DWeb-vX-.js +9 -0
- package/dist/runtime-api-9QAFrMbQ.js +3 -0
- package/dist/runtime-api-BLCDEML4.js +2 -0
- package/dist/runtime-api-BLwLTGfK.js +21 -0
- package/dist/runtime-api-BR1M4pnK.js +2 -0
- package/dist/runtime-api-BUroT61_.js +45 -0
- package/dist/runtime-api-CNUiDwYz.js +3 -0
- package/dist/runtime-api-CVt6wzTc.js +6 -0
- package/dist/runtime-api-C_SJ7wfw.js +10 -0
- package/dist/runtime-api-DQzjRmqt.js +12 -0
- package/dist/runtime-api-DqR_YumR.js +17 -0
- package/dist/runtime-api-ZGDNVbl2.js +6 -0
- package/dist/runtime-api-zz8pnymC.js +26 -0
- package/dist/runtime-embedded-pi.runtime-TFyAgOC8.js +2 -0
- package/dist/runtime-embedded-pi.runtime.js +1 -1
- package/dist/runtime-heavy-api-Ba7JNDB8.js +565 -0
- package/dist/runtime-internal-DHjVpw4B.js +2 -0
- package/dist/runtime-plugins-Ry7x-Mvk.js +69 -0
- package/dist/sandbox-BNFwXFuy.js +2587 -0
- package/dist/sandbox-Cpt-E1ww.js +4 -0
- package/dist/sandbox-cli-Dmg_0MaO.js +445 -0
- package/dist/sdk-13NUewAy.js +1124 -0
- package/dist/secrets-cli-DQ7xca44.js +2098 -0
- package/dist/security-audit-Bn7XX3Su.js +51 -0
- package/dist/security-audit-C9BfFv2C.js +108 -0
- package/dist/security-audit-CSzyrJSa.js +120 -0
- package/dist/security-audit.runtime-PgDhyLjV.js +2 -0
- package/dist/security-audit.runtime.js +1 -1
- package/dist/security-cli-CP-6Fnhs.js +485 -0
- package/dist/send-BXh-TZ84.js +2 -0
- package/dist/send-BvPjvO2s.js +1262 -0
- package/dist/send-C9vW8YXC.js +2 -0
- package/dist/send-CEQIm1mt.js +102 -0
- package/dist/send-CpSbfcsb.js +332 -0
- package/dist/send-D1Q3UX5Y.js +981 -0
- package/dist/send-DDGOGQol.js +389 -0
- package/dist/send-Die5cv7L.js +3043 -0
- package/dist/send-DnM5edIc.js +3 -0
- package/dist/send-F1JhwouX.js +416 -0
- package/dist/send.components-DkCGcwf8.js +303 -0
- package/dist/send.runtime-B1QyPCQz.js +2 -0
- package/dist/send.runtime-ChCiy_ft.js +3 -0
- package/dist/send.runtime-Dzgewg8A.js +2 -0
- package/dist/send.runtime.js +1 -1
- package/dist/send.shared-BH6_OGkl.js +1101 -0
- package/dist/sent-thread-cache-CYKgiC-N.js +23 -0
- package/dist/server-BE1J4IRF.js +13 -0
- package/dist/server-DYEi-Vdc.js +68 -0
- package/dist/server-middleware-TYuXgmVe.js +110 -0
- package/dist/server-node-events-DefHBCpw.js +449 -0
- package/dist/server.impl-Dgq1DI9c.js +30112 -0
- package/dist/session-reset-service-DXN9ywpB.js +450 -0
- package/dist/session-route-Crn_ogyn.js +156 -0
- package/dist/session-store-metadata-BQw3zv_y.js +288 -0
- package/dist/session-subagent-reactivation.runtime-DrHo4F4Q.js +2 -0
- package/dist/session-subagent-reactivation.runtime.js +1 -1
- package/dist/session-tab-registry-B3lsDHHR.js +212 -0
- package/dist/sessions.runtime-B0gndd8L.js +2 -0
- package/dist/sessions.runtime.js +1 -1
- package/dist/setup-api-D2RTa9D-.js +30 -0
- package/dist/setup-bootstrap-B4QCZnKl.js +55 -0
- package/dist/setup-contract-B3vGY4y-.js +126 -0
- package/dist/setup-core-BsBfG93o.js +108 -0
- package/dist/setup-core-d8vbI_XJ.js +233 -0
- package/dist/setup-f5XZWfKL.js +434 -0
- package/dist/setup-surface-BNTSscOJ.js +279 -0
- package/dist/setup-surface-BVkx2UYk.js +723 -0
- package/dist/setup-surface-Baom1I4y.js +8861 -0
- package/dist/setup-surface-CSjeONXo.js +286 -0
- package/dist/setup-surface-vf0_-Tdf.js +643 -0
- package/dist/setup.finalize-Ye6qhiW9.js +445 -0
- package/dist/setup.gateway-config-C7d6a9WA.js +246 -0
- package/dist/shared-BKrh9WKJ.js +2 -0
- package/dist/shared-Bj8gSTB2.js +180 -0
- package/dist/shared-CRwVn0c-.js +252 -0
- package/dist/shared-CmQjyXal.js +224 -0
- package/dist/shared-DNiJ0u0-.js +766 -0
- package/dist/slash-commands.runtime-CqKhtjeF.js +20 -0
- package/dist/slash-commands.runtime.js +1 -1
- package/dist/slash-dispatch.runtime-DF3wRtha.js +38 -0
- package/dist/slash-dispatch.runtime.js +1 -1
- package/dist/slash-skill-commands.runtime-C4OqPfgl.js +8 -0
- package/dist/slash-skill-commands.runtime.js +1 -1
- package/dist/squidclaw-tools.runtime-BqDAGn7F.js +2 -0
- package/dist/squidclaw-tools.runtime.js +1 -1
- package/dist/src-02qjl7sX.js +2841 -0
- package/dist/stage-sandbox-media.runtime-CfMI-qzp.js +231 -0
- package/dist/stage-sandbox-media.runtime.js +1 -1
- package/dist/startup-verification-DzypxaGj.js +132 -0
- package/dist/status-B1QTfIMN.js +607 -0
- package/dist/status-B2P6AJxa.js +391 -0
- package/dist/status-BramWBLG.js +3 -0
- package/dist/status-DhbYtDYM.js +478 -0
- package/dist/status-DlBtVbSH.js +2 -0
- package/dist/status-all-cwFWvn6A.js +484 -0
- package/dist/status-json-CWhbU4Da.js +14 -0
- package/dist/status-json-command-CnFFQEwq.js +84 -0
- package/dist/status-runtime-shared-D7doYBdy.js +254 -0
- package/dist/status.command.text-runtime-CPoFJehc.js +15 -0
- package/dist/status.gateway-connection.runtime-GvW1CWN9.js +2 -0
- package/dist/status.gateway-connection.runtime.js +1 -1
- package/dist/status.gateway-probe-CJiq01Bs.js +16 -0
- package/dist/status.scan-1B-9cN63.js +62 -0
- package/dist/status.scan-overview-CSJqbcYh.js +395 -0
- package/dist/status.scan.fast-json-Bmzyemxt.js +128 -0
- package/dist/status.scan.fast-json-D5F9b4ah.js +2 -0
- package/dist/status.summary-BYy9qTUS.js +2 -0
- package/dist/status.summary-CkEEti0D.js +209 -0
- package/dist/sticker-cache-D5r87ZZa.js +184 -0
- package/dist/sticker-vision.runtime-DyLJForL.js +16 -0
- package/dist/sticker-vision.runtime.js +1 -1
- package/dist/storage-CkTymBr-.js +281 -0
- package/dist/subagent-announce.registry.runtime-CcnTQckj.js +3 -0
- package/dist/subagent-announce.registry.runtime.js +1 -1
- package/dist/subagent-followup.runtime-CYde8MYt.js +68 -0
- package/dist/subagent-followup.runtime.js +1 -1
- package/dist/subagent-hooks-BvK9Cxa6.js +101 -0
- package/dist/subagent-list-CpIcW76w.js +167 -0
- package/dist/subagent-orphan-recovery-Ct3UM-Bu.js +213 -0
- package/dist/subagent-registry-runtime-BoYdq2qL.js +2 -0
- package/dist/subagent-registry.runtime-BsPu6xbI.js +3 -0
- package/dist/subagent-registry.runtime.js +1 -1
- package/dist/subagents-format-BCzskH-u.js +715 -0
- package/dist/suite-BmAd-9R0.js +3665 -0
- package/dist/suite-DTBteqgI.js +2 -0
- package/dist/suite-launch.runtime-D7xJStpn.js +7 -0
- package/dist/suite-launch.runtime.js +1 -1
- package/dist/system-cli-BcZJNwur.js +59 -0
- package/dist/targets-1f9UDi71.js +594 -0
- package/dist/targets-BnXEPthE.js +2 -0
- package/dist/task-executor-BCxe9JMQ.js +350 -0
- package/dist/task-owner-access-BPEsf8od.js +48 -0
- package/dist/task-registry-B7FuDS8O.js +2343 -0
- package/dist/task-registry-control.runtime-DWqkdq8U.js +3 -0
- package/dist/task-registry-control.runtime.js +1 -1
- package/dist/task-registry-delivery-runtime-BR8dIB3B.js +3 -0
- package/dist/task-registry-delivery-runtime-Bupw3MKP.js +2 -0
- package/dist/task-registry.audit-DJg4rOz-.js +420 -0
- package/dist/task-registry.maintenance-BroUbQMq.js +2 -0
- package/dist/telegram/token.js +1 -1
- package/dist/testing-C5-NbjQn.js +637 -0
- package/dist/text-report-DwVqspbf.js +587 -0
- package/dist/thread-bindings-BVpVTovQ.js +231 -0
- package/dist/thread-bindings-CIE_SmMk.js +541 -0
- package/dist/thread-bindings-CvgiP7Qb.js +350 -0
- package/dist/thread-bindings-Dbs1VNcN.js +223 -0
- package/dist/thread-bindings.discord-api-Bnm8k-CQ.js +167 -0
- package/dist/thread-bindings.manager-BYftBIxl.js +516 -0
- package/dist/thread-bindings.manager-DFHmeFVn.js +2 -0
- package/dist/token-B3Uvlep3.js +82 -0
- package/dist/tool-actions.runtime-3E6YoP_B.js +534 -0
- package/dist/tool-actions.runtime.js +1 -1
- package/dist/tools-effective-inventory-DvzzKkKx.js +151 -0
- package/dist/tui-cli-CljnRWf3.js +31 -0
- package/dist/tui-vfBwCsDi.js +3941 -0
- package/dist/ui-5bl9Zasq.js +266 -0
- package/dist/update-cli-D0rCj2kZ.js +1484 -0
- package/dist/verification-2ekYWAlm.js +2 -0
- package/dist/verification-CC00TdzU.js +133 -0
- package/dist/webhook-shared-BPFuLVWz.js +49 -0
- package/package.json +1 -1
- package/dist/abort-B3i9M6G2.js +0 -201
- package/dist/abort.runtime-D54SXGb5.js +0 -2
- package/dist/access-control--iowLlYm.js +0 -146
- package/dist/accounts-B5bzTBVz.js +0 -107
- package/dist/accounts-ByeS_9aO.js +0 -104
- package/dist/accounts-D6vf619D.js +0 -133
- package/dist/accounts-Dk1FIo4_.js +0 -2
- package/dist/acp-binding-runtime-ocpCU2-v.js +0 -2
- package/dist/acp-cli-CNDP895U.js +0 -2194
- package/dist/acp-runtime-nbTE1Phc.js +0 -68
- package/dist/acp-stateful-target-driver-ChyAnNgf.js +0 -87
- package/dist/action-agents-Ch0mefPf.js +0 -67
- package/dist/action-focus-D-nzXF6o.js +0 -123
- package/dist/action-help-NAv-aU0d.js +0 -7
- package/dist/action-info-DcMI2-ZK.js +0 -58
- package/dist/action-kill-CXqD-B-0.js +0 -33
- package/dist/action-list-8jjdDY7d.js +0 -21
- package/dist/action-log-6odO06BB.js +0 -30
- package/dist/action-runtime-CVPm9XLV.js +0 -419
- package/dist/action-runtime-CxCmBEj5.js +0 -323
- package/dist/action-runtime-DekcFW0U.js +0 -72
- package/dist/action-runtime-api-cNh_VnnH.js +0 -2
- package/dist/action-runtime.runtime-BbRzrDjs.js +0 -2
- package/dist/action-send-DPyRTIFq.js +0 -39
- package/dist/action-spawn-DpvYcWJG.js +0 -46
- package/dist/action-unfocus-8FI6_QIi.js +0 -28
- package/dist/actions-OPb_3bRj.js +0 -539
- package/dist/actions.runtime-B3rsBUOP.js +0 -5
- package/dist/actions.runtime-CqRkzF2D.js +0 -2
- package/dist/actions.runtime-Ty9XPJXe.js +0 -18
- package/dist/agent-CiRrkRMO.js +0 -2
- package/dist/agent-command-B0QbYo8l.js +0 -1453
- package/dist/agent-components.runtime-BX1TJP_W.js +0 -10
- package/dist/agent-runner.runtime-Bwgzwf26.js +0 -2712
- package/dist/agent-runtime-CfjWN412.js +0 -17
- package/dist/agents-CXAAVAaD.js +0 -887
- package/dist/agents-SPpD0hO8.js +0 -5
- package/dist/api-6NCDe82B.js +0 -5
- package/dist/api-BFXKRqtv.js +0 -2
- package/dist/api-BPRu6VRr.js +0 -19032
- package/dist/api-BkY4N1oM.js +0 -2
- package/dist/api-Cq8p6nS6.js +0 -5
- package/dist/api-D929nvtw.js +0 -2
- package/dist/api-DUI7UM1U.js +0 -7
- package/dist/api-DXIejtfT.js +0 -1085
- package/dist/api-Mz7fQ97u.js +0 -7524
- package/dist/api-pamd3sK4.js +0 -3
- package/dist/approval-gateway-resolver-C0T-euYc.js +0 -58
- package/dist/approval-gateway-runtime-Dr8hhHsY.js +0 -2
- package/dist/approval-handler-runtime-C1vIqhJB.js +0 -3
- package/dist/approval-handler-runtime-CQ1rmZw4.js +0 -439
- package/dist/approval-handler.runtime-BPTqowDG.js +0 -389
- package/dist/approval-handler.runtime-CJIOu270.js +0 -130
- package/dist/approval-handler.runtime-Ch4_Sc9Y.js +0 -245
- package/dist/approval-handler.runtime-DnXfPApY.js +0 -285
- package/dist/approval-handler.runtime-Dy7znaXN.js +0 -2
- package/dist/approval-native-D2UI8gkx.js +0 -130
- package/dist/approval-native-DXmloUbF.js +0 -156
- package/dist/approval-native-runtime-CqdGNulh.js +0 -709
- package/dist/approval-runtime-Dk2t8Zy3.js +0 -9
- package/dist/attachment-normalize-B2YxnMGv.js +0 -1013
- package/dist/audit-BERwKM6w.js +0 -885
- package/dist/audit-BFF7MsuO.js +0 -99
- package/dist/audit-frAokQ0A.js +0 -2
- package/dist/audit.runtime-Bj5X419-.js +0 -7
- package/dist/auth-config-utils-BaAnjhyv.js +0 -96
- package/dist/binding-routing-BpsF-3xv.js +0 -50
- package/dist/binding-targets-Bmj3UJ5-.js +0 -99
- package/dist/bot-Cx-u_7Uj.js +0 -5426
- package/dist/bot-message-context.runtime-B4zpnEwn.js +0 -8
- package/dist/bot-message-context.session.runtime-B1gAkdOu.js +0 -12
- package/dist/bot-native-commands.delivery.runtime-C6xxBBDf.js +0 -3
- package/dist/bot-native-commands.runtime-Dbsr3sHh.js +0 -13
- package/dist/bridge-server-DSGO4m1H.js +0 -102
- package/dist/browser-cdp-BEAWexuM.js +0 -2
- package/dist/browser-cdp-DiIu37Gt.js +0 -2
- package/dist/browser-control-auth-DTOsrJDu.js +0 -2
- package/dist/browser-control-auth-DyC4zA7A.js +0 -2
- package/dist/browser-doctor-uvADu96v.js +0 -78
- package/dist/browser-maintenance-C2Dl-Ve7.js +0 -3
- package/dist/browser-node-runtime-DDBOJvNL.js +0 -490
- package/dist/browser-profiles-CoDIqHLH.js +0 -2
- package/dist/browser-profiles-D7aj7859.js +0 -2
- package/dist/browser-setup-tools-BkzM2E6C.js +0 -321
- package/dist/call-BmlVEj-k.js +0 -2
- package/dist/call-DimnmSfr.js +0 -527
- package/dist/call.runtime-oDicDLP9.js +0 -2
- package/dist/capability-cli-DJ2Awg2a.js +0 -1350
- package/dist/captured-registration-CRRuKs3Z.js +0 -1159
- package/dist/channel-B2trs5PT.js +0 -816
- package/dist/channel-BCn_Tbdt.js +0 -226
- package/dist/channel-BdkYjZav.js +0 -1109
- package/dist/channel-C4Uws9p9.js +0 -482
- package/dist/channel-C5ZzsbiQ.js +0 -1168
- package/dist/channel-CIYg-jK3.js +0 -864
- package/dist/channel-CXg-f8BW.js +0 -843
- package/dist/channel-Cbq6TTk_.js +0 -368
- package/dist/channel-DAhzdj9q.js +0 -532
- package/dist/channel-DXBsiIY7.js +0 -1146
- package/dist/channel-Dzxv0EXV.js +0 -991
- package/dist/channel-actions-ipmwXB0Y.js +0 -233
- package/dist/channel-actions.runtime-CDchfnd5.js +0 -2
- package/dist/channel-core-BVwVtumb.js +0 -2
- package/dist/channel-inbound-Bm88Z7_C.js +0 -31
- package/dist/channel-plugin-runtime-BVG5lRuf.js +0 -784
- package/dist/channel-react-action-BObDobMB.js +0 -39
- package/dist/channel-runtime-CTRgWvAH.js +0 -427
- package/dist/channel.runtime-B7v5wHk8.js +0 -131
- package/dist/channel.runtime-BszJe_s4.js +0 -2169
- package/dist/channel.runtime-CX4_ZCmS.js +0 -429
- package/dist/channel.runtime-CdML78ul.js +0 -109
- package/dist/channel.runtime-CqwrGm86.js +0 -35114
- package/dist/channel.runtime-DP0cjvi3.js +0 -87
- package/dist/channel.runtime-DdnmmpEk.js +0 -4
- package/dist/channel.runtime-ci1kZJFE.js +0 -399
- package/dist/channel.runtime-l_tSS4gp.js +0 -789
- package/dist/channel.runtime-mzNwkaVb.js +0 -348
- package/dist/channel.setup-B9xAr9fC.js +0 -17
- package/dist/channel.setup-BBet-KMT.js +0 -8
- package/dist/channel.setup-BZ1mLMx2.js +0 -274
- package/dist/channel2.runtime-BsiqUwwM.js +0 -2067
- package/dist/channels-DfPjiGw0.js +0 -1145
- package/dist/channels-cli-Dv-7LMMV.js +0 -246
- package/dist/clawbot-cli-nasr9K6D.js +0 -9
- package/dist/cli-BRM7KkAR.js +0 -64
- package/dist/cli-CCR3hjJo.js +0 -2
- package/dist/cli-DU1kVljA.js +0 -79
- package/dist/cli-HYScxqD1.js +0 -696
- package/dist/cli-metadata-Lj0vONDU.js +0 -22
- package/dist/cli.runtime-1fLltFdi.js +0 -913
- package/dist/cli.runtime-CZUqiD5g.js +0 -435
- package/dist/client-BUVaKIpJ.js +0 -5
- package/dist/client-BVTwwUML.js +0 -19
- package/dist/client-BjWLc7Y-.js +0 -76
- package/dist/client-_QKDAQDu.js +0 -138
- package/dist/client-bootstrap-BFbLRz2C.js +0 -103
- package/dist/client-bootstrap-D437UPzx.js +0 -2
- package/dist/client-bootstrap-I7-3XCga.js +0 -28
- package/dist/client-fetch-AnHvj_3J.js +0 -6329
- package/dist/client-hExsWH6o.js +0 -7
- package/dist/command-auth-CRa_J5f9.js +0 -82
- package/dist/command-config-resolution-DJn8yRN0.js +0 -2
- package/dist/command-config-resolution-DfaG_QsG.js +0 -23
- package/dist/command-registry-CR66SMrK.js +0 -3
- package/dist/command-registry-DPmit1JT.js +0 -103
- package/dist/command-secret-gateway-C5wNGlyh.js +0 -528
- package/dist/commands-acp-DSkoKaBx.js +0 -1016
- package/dist/commands-compact.runtime-Cxk_Bim2.js +0 -9
- package/dist/commands-handlers.runtime-7ITzu_F9.js +0 -3752
- package/dist/commands-status-YVlf51av.js +0 -220
- package/dist/commands-status.runtime-yX733sxU.js +0 -2
- package/dist/commands-subagents-control.runtime-CmBQffpY.js +0 -3
- package/dist/commands-subagents-control.runtime-DyfC94wk.js +0 -2
- package/dist/commands.runtime-CF2CvRdC.js +0 -103
- package/dist/compact.runtime-SSFfG-Zn.js +0 -7
- package/dist/completion-cli-DacK0s2a.js +0 -2
- package/dist/completion-cli-e73PL7WW.js +0 -464
- package/dist/config-CNjow647.js +0 -555
- package/dist/config-cli-DHrsraFp.js +0 -946
- package/dist/configure-BAu4acPI.js +0 -1157
- package/dist/configure-CL23G2hb.js +0 -2
- package/dist/connect-options-DWuMnfu8.js +0 -702
- package/dist/connection-auth-C2SmiqJl.js +0 -30
- package/dist/control-auth-CaO1Oeoy.js +0 -55
- package/dist/conversation-binding-runtime-Doi63Jbg.js +0 -4
- package/dist/conversation-runtime-GGcURk7j.js +0 -31
- package/dist/core-CClA2USK.js +0 -210
- package/dist/core-api-C_AvPzRu.js +0 -372
- package/dist/create-client-BhqAwNbb.js +0 -61
- package/dist/create-client-BwsD8tI6.js +0 -2
- package/dist/credentials-DJFu83G8.js +0 -57
- package/dist/credentials-write.runtime-CR5dnqyZ.js +0 -12
- package/dist/cron-cli-Deh3Yeyp.js +0 -637
- package/dist/crypto-runtime-VJhxsLhu.js +0 -3510
- package/dist/daemon-cli-4bc2x0Xy.js +0 -408
- package/dist/daemon-install-1dtUi-ok.js +0 -63
- package/dist/delegate-DxwnpjNF.js +0 -59
- package/dist/delivery-D5D8dXrE.js +0 -858
- package/dist/devices-cli-CCUKlTgc.js +0 -329
- package/dist/direct-dm-CM-FJS3G.js +0 -139
- package/dist/directive-handling.fast-lane-Bj-ZgNCt.js +0 -64
- package/dist/directive-handling.fast-lane-cVtu_YSG.js +0 -2
- package/dist/directive-handling.impl-DXYPXQHD.js +0 -659
- package/dist/directive-handling.impl-Dbjtj5tk.js +0 -2
- package/dist/directory-live-Cl_E8Y0F.js +0 -105
- package/dist/directory-live-eYanrAKt.js +0 -2
- package/dist/discovery-CDcwVlb2.js +0 -201
- package/dist/discovery-toIPU7JM.js +0 -280
- package/dist/dispatch-DQdww2GS.js +0 -970
- package/dist/dispatch-acp-gH6MGir3.js +0 -969
- package/dist/dispatch-acp-manager.runtime-B3868p2b.js +0 -3
- package/dist/dispatch-acp.runtime-GxCOV-g5.js +0 -19
- package/dist/docker-harness-DuqgDAuF.js +0 -277
- package/dist/doctor-completion-CqPBIveI.js +0 -90
- package/dist/env-auth-kvshWd0K.js +0 -2
- package/dist/exec-approvals-3lAYs6Hb.js +0 -272
- package/dist/exec-approvals-DEXYo-hs.js +0 -129
- package/dist/exec-approvals-cli-qJuhPDN7.js +0 -483
- package/dist/format-Bfm1Y34p.js +0 -941
- package/dist/gateway-Coz4zJqF.js +0 -2652
- package/dist/gateway-cli-Tr88ODEI.js +0 -1510
- package/dist/gateway-install-token-DfFqyLMo.js +0 -213
- package/dist/gateway-rpc-BemgYdMc.js +0 -14
- package/dist/gateway-rpc.runtime-qMKQlN4e.js +0 -23
- package/dist/gateway-runtime-BKHVCtA8.js +0 -12
- package/dist/get-reply-from-config.runtime-DvG3QBgw.js +0 -2
- package/dist/graph-users-Dl1OMi8u.js +0 -926
- package/dist/group-access-C4vUaXrm.js +0 -119
- package/dist/handle-action-BZiiHnQe.js +0 -505
- package/dist/health-CS7VN2jf.js +0 -2
- package/dist/health-DZIRhXhz.js +0 -578
- package/dist/heartbeat-runner-BzXA9IWw.js +0 -4
- package/dist/heartbeat-runner-D0A8YGZO.js +0 -1060
- package/dist/heartbeat-runner.runtime-TppNw-oM.js +0 -2
- package/dist/http-client-DkuiEf7A.js +0 -322
- package/dist/inbound-reply-dispatch-DpYv3d5p.js +0 -73
- package/dist/infra-runtime-tt1_oCoq.js +0 -23
- package/dist/inline-buttons-DEuFw3WQ.js +0 -40
- package/dist/known-users-CWwrsFGU.js +0 -1180
- package/dist/legacy-crypto-restore-BOa2DvvY.js +0 -85
- package/dist/library-7cnVS_xi.js +0 -44
- package/dist/llm-slug-generator-323FKQOP.js +0 -69
- package/dist/login-CiHsm606.js +0 -2574
- package/dist/logs-cli-B2cmXZem.js +0 -264
- package/dist/logs-cli.runtime-C-Mcv4Zk.js +0 -2
- package/dist/manager-CwWzbl_D.js +0 -2048
- package/dist/manager.runtime-CqOrg4Qr.js +0 -900
- package/dist/markdown-to-line-CbaWO2jk.js +0 -781
- package/dist/matrix-migration.runtime-GV26JQ2_.js +0 -2
- package/dist/mcp-cli-DGbCa-Cd.js +0 -747
- package/dist/media-text-ZfT38pVI.js +0 -146
- package/dist/memory-core-CBOoleHk.js +0 -7
- package/dist/memory-core-host-runtime-cli-Be-Y3RcN.js +0 -9
- package/dist/message-DM01eAnX.js +0 -223
- package/dist/message-action-runner-BdICMfSy.js +0 -2
- package/dist/message-action-runner-Cb2h2Ijf.js +0 -1628
- package/dist/message-actions-DS7xc40R.js +0 -143
- package/dist/message-handler-D--3XcDZ.js +0 -1925
- package/dist/message.gateway.runtime-IqVan5Ku.js +0 -2
- package/dist/messages-CjRvwckc.js +0 -139
- package/dist/method-scopes-D4g3NSY1.js +0 -2803
- package/dist/migration-snapshot.runtime-BcKQLnnt.js +0 -3
- package/dist/models-DovOrFsL.js +0 -2565
- package/dist/models-cli-BY-ZivSs.js +0 -197
- package/dist/models-ym2zxpHK.js +0 -3
- package/dist/monitor-BRJa82Ur.js +0 -2
- package/dist/monitor-BncOnBd9.js +0 -673
- package/dist/monitor-C1p3x-pX.js +0 -1221
- package/dist/monitor-CIPE_311.js +0 -4027
- package/dist/monitor-CNRewRrD.js +0 -288
- package/dist/monitor-Cj_IFxZv.js +0 -1344
- package/dist/monitor-DVLc8Re0.js +0 -4
- package/dist/monitor-J_BnmDo2.js +0 -5
- package/dist/monitor-Qmqec_Yh.js +0 -3653
- package/dist/monitor-_au10paS.js +0 -1533
- package/dist/monitor-auth-Bscspafh.js +0 -2470
- package/dist/monitor-normalize-DoTVhTYT.js +0 -1018
- package/dist/monitor-polling.runtime-DpDlmIwy.js +0 -309
- package/dist/monitor-webhook.runtime-TlmgbOCr.js +0 -298
- package/dist/monitor-xEYRMU-f.js +0 -524
- package/dist/monitor.runtime-CnJJRTbE.js +0 -2
- package/dist/monitor.webhook-BgwkWhHl.js +0 -152
- package/dist/msteams-BUb-S_EX.js +0 -35
- package/dist/music-generation-provider-D1i_RdU5.js +0 -141
- package/dist/music-generation-provider-kW5YoroF.js +0 -169
- package/dist/nextcloud-talk-w5jy_uDk.js +0 -17
- package/dist/node-cli-0I8EBDmz.js +0 -2361
- package/dist/nodes-cli-DDPXput-.js +0 -1046
- package/dist/nostr-CMmrLIba.js +0 -20
- package/dist/notify-53158hb_.js +0 -301
- package/dist/onboard-gasumsAo.js +0 -620
- package/dist/onboard-helpers-BKqqS4fH.js +0 -5
- package/dist/onboard-helpers-ClO1CzUs.js +0 -210
- package/dist/onboard-remote-C_OS9uG-.js +0 -2
- package/dist/onboard-remote-DZwvXndP.js +0 -193
- package/dist/onboard-skills-C2b6Am6N.js +0 -134
- package/dist/onboard-skills-DoUaMa7Q.js +0 -2
- package/dist/operator-approvals-client-Ba5yI2jW.js +0 -68
- package/dist/outbound-adapter-CHAeBJnA.js +0 -186
- package/dist/outbound-adapter-ckaI045x.js +0 -195
- package/dist/outbound-send-deps-CeS2ISdG.js +0 -179
- package/dist/outbound.runtime-DmENyZWi.js +0 -2
- package/dist/pair-command-approve-Dtj5RT3m.js +0 -34
- package/dist/persistent-bindings.lifecycle-DlRf6UNu.js +0 -94
- package/dist/pi-embedded-BCiN8PJJ.js +0 -4
- package/dist/pi-embedded-D6ymZc3i.js +0 -34664
- package/dist/pi-embedded.runtime-BvHY2Qn8.js +0 -4
- package/dist/plugin-registration-pEUuuPNE.js +0 -23
- package/dist/plugin-service-C727jUS8.js +0 -2479
- package/dist/policy-Cx0vwWl-.js +0 -296
- package/dist/prepare-Cvvm6kSX.js +0 -1311
- package/dist/preview-streaming-VPGtgbrj.js +0 -156
- package/dist/probe-BWxk_D41.js +0 -1951
- package/dist/probe-BZ2k40na.js +0 -467
- package/dist/probe-BdrYBtBm.js +0 -42
- package/dist/probe-Bi1t0jFB.js +0 -473
- package/dist/probe-Bm-LFpXO.js +0 -54
- package/dist/probe-BzM7PkDR.js +0 -178
- package/dist/probe-D3nv35y0.js +0 -45
- package/dist/probe-D44CTR-n.js +0 -2
- package/dist/probe-D9_c8Tac.js +0 -2
- package/dist/probe-auth-CvZT2Jdj.js +0 -69
- package/dist/probe-auth-CvvZaT1c.js +0 -3
- package/dist/probe-wE6FkkZ_.js +0 -2
- package/dist/probe.runtime-DGQmUPe5.js +0 -3
- package/dist/profile-update-DJMFQsky.js +0 -67
- package/dist/program-D0cK7yGW.js +0 -112
- package/dist/prompt-select-styled-DIWZZZG6.js +0 -5126
- package/dist/provider-BKJ08C2Z.js +0 -3454
- package/dist/provider-CPi36wyQ.js +0 -6962
- package/dist/provider-dispatcher-CLwZUymC.js +0 -22
- package/dist/provider-session.runtime-B3S_Yeb3.js +0 -9
- package/dist/provider.runtime-DcEvmtmu.js +0 -2
- package/dist/pw-ai-WAQfyGe_.js +0 -2103
- package/dist/qa-channel-Dqe1KaSx.js +0 -2
- package/dist/qa-cli-4xByjTp-.js +0 -8
- package/dist/qr-cli-9amYg6ZB.js +0 -358
- package/dist/qr-cli-Dvj1k6Ck.js +0 -2
- package/dist/reaction-level-cvYUkHnc.js +0 -18
- package/dist/reaction-runtime-api-C4C7zpkB.js +0 -117
- package/dist/reactions--cuRrgXz.js +0 -1037
- package/dist/register.agent-lPQYPQxl.js +0 -240
- package/dist/register.configure-C1Pqkqku.js +0 -15
- package/dist/register.maintenance-D7_7kFLK.js +0 -437
- package/dist/register.message-DuQfx9tH.js +0 -646
- package/dist/register.onboard-GvvDQg6U.js +0 -79
- package/dist/register.runtime-B_q6h9Rj.js +0 -4738
- package/dist/register.runtime-D1J8J3lS.js +0 -80
- package/dist/register.setup-D4ohrJPJ.js +0 -103
- package/dist/register.status-health-sessions-KTNGJBI0.js +0 -1209
- package/dist/register.subclis-BBWrHZw5.js +0 -3
- package/dist/register.subclis-JFPqv7V4.js +0 -232
- package/dist/register.sync.runtime-CBqckwjj.js +0 -111
- package/dist/register.sync.runtime-DLLDETam.js +0 -30
- package/dist/replies-BJ7V-hO1.js +0 -120
- package/dist/reply-Lp7d3a50.js +0 -3408
- package/dist/reply-dispatch-runtime-Gcl_ugF7.js +0 -3
- package/dist/reply-resolver.runtime-D6AfqIU4.js +0 -3
- package/dist/reply-runtime-w3_WmlVR.js +0 -63
- package/dist/reply.runtime-CEzDecR4.js +0 -2
- package/dist/resolve-channels-BdkK4nw3.js +0 -80
- package/dist/resolve-channels-C3XNE8mX.js +0 -2
- package/dist/resolve-targets-CtIyzvLZ.js +0 -280
- package/dist/resolve-users-BakC_OZx.js +0 -112
- package/dist/resolve-users-Fn03Rhb2.js +0 -2
- package/dist/restart-health-BttIk7CU.js +0 -202
- package/dist/restart-health-CFQhuwOp.js +0 -2
- package/dist/route-resolution-SDBGRkWf.js +0 -519
- package/dist/rpc-C9V_pt31.js +0 -61
- package/dist/rpc.runtime-B0h6ayTJ.js +0 -21
- package/dist/run-main-5wQoA813.js +0 -452
- package/dist/run-wait-B-6gAFUS.js +0 -118
- package/dist/runtime-B09Y1cSR.js +0 -1030
- package/dist/runtime-DYbf5mvD.js +0 -9
- package/dist/runtime-ROpfHrig.js +0 -969
- package/dist/runtime-api-B2LT1fsl.js +0 -21
- package/dist/runtime-api-B2iJXOPK.js +0 -45
- package/dist/runtime-api-BKyYF95h.js +0 -2
- package/dist/runtime-api-BXoNiiea.js +0 -26
- package/dist/runtime-api-BZakyLMI.js +0 -6
- package/dist/runtime-api-BjtBN2Lw.js +0 -3
- package/dist/runtime-api-C1cTYm9P.js +0 -2
- package/dist/runtime-api-CSSJcNsF.js +0 -6
- package/dist/runtime-api-CXnnN_KY.js +0 -17
- package/dist/runtime-api-ChdP-48A.js +0 -3
- package/dist/runtime-api-DlZVV51Z.js +0 -10
- package/dist/runtime-api-VACD9DJo.js +0 -12
- package/dist/runtime-embedded-pi.runtime-Eo0EmYFy.js +0 -2
- package/dist/runtime-heavy-api-C4fiMQ21.js +0 -565
- package/dist/runtime-internal-icjNm5UP.js +0 -2
- package/dist/runtime-plugins-B6R10y_D.js +0 -69
- package/dist/sandbox--rLy3kgS.js +0 -4
- package/dist/sandbox-DuJ1KNDG.js +0 -2587
- package/dist/sandbox-cli-4TTvCzDq.js +0 -445
- package/dist/sdk-BYukfk1k.js +0 -1124
- package/dist/secrets-cli-DEn7dm1N.js +0 -2098
- package/dist/security-audit-Bsy0zSyj.js +0 -108
- package/dist/security-audit-Duv6BTNX.js +0 -120
- package/dist/security-audit-YfOVCyuf.js +0 -51
- package/dist/security-audit.runtime-Cyi0ycOc.js +0 -2
- package/dist/security-cli-BcHPRXOi.js +0 -485
- package/dist/send-BIbyQk5P.js +0 -1262
- package/dist/send-CKsL7RVh.js +0 -3
- package/dist/send-CWQq_n5g.js +0 -389
- package/dist/send-CfV7rSkm.js +0 -981
- package/dist/send-CyQx0TY7.js +0 -2
- package/dist/send-DHgcTLAL.js +0 -2
- package/dist/send-DWOFYyaw.js +0 -102
- package/dist/send-DeI_6pOG.js +0 -3043
- package/dist/send-Z15Qe-G0.js +0 -332
- package/dist/send-kKGGtn3Z.js +0 -416
- package/dist/send.components-Bz73vYn8.js +0 -303
- package/dist/send.runtime-BcZGpddi.js +0 -2
- package/dist/send.runtime-BtXm9WEr.js +0 -3
- package/dist/send.runtime-Cvg0x4v0.js +0 -2
- package/dist/send.shared-DYohWc2i.js +0 -1101
- package/dist/sent-thread-cache-CT2xxwbT.js +0 -23
- package/dist/server-Cd7EHHuw.js +0 -68
- package/dist/server-G26weaSi.js +0 -13
- package/dist/server-middleware-CtTwf3pu.js +0 -110
- package/dist/server-node-events-DKZ_nyrQ.js +0 -449
- package/dist/server.impl-D63YZto5.js +0 -30112
- package/dist/session-reset-service-D1M4pLBA.js +0 -450
- package/dist/session-route-tUMBm5PT.js +0 -156
- package/dist/session-store-metadata-DowmkwmG.js +0 -288
- package/dist/session-subagent-reactivation.runtime-mKpYuC3k.js +0 -2
- package/dist/session-tab-registry-DWFtutnL.js +0 -212
- package/dist/sessions.runtime-Cf7RpCAJ.js +0 -2
- package/dist/setup-BRmL5-Jo.js +0 -434
- package/dist/setup-api-CrfiDHi-.js +0 -30
- package/dist/setup-bootstrap-BJpUNvF_.js +0 -55
- package/dist/setup-contract-D-zxoFOW.js +0 -126
- package/dist/setup-core-CG-E-wxi.js +0 -108
- package/dist/setup-core-rh5n0CBJ.js +0 -233
- package/dist/setup-surface-BeAiBe4W.js +0 -279
- package/dist/setup-surface-By9c_qzk.js +0 -8861
- package/dist/setup-surface-D18aEQat.js +0 -723
- package/dist/setup-surface-DAzhKU-9.js +0 -286
- package/dist/setup-surface-DIawZD7y.js +0 -643
- package/dist/setup.finalize-BMwCLPRK.js +0 -445
- package/dist/setup.gateway-config-Ce9dKFXy.js +0 -246
- package/dist/shared-2BPq74or.js +0 -252
- package/dist/shared-BXTcQtcc.js +0 -180
- package/dist/shared-BtxNEzEa.js +0 -224
- package/dist/shared-DLUal8aD.js +0 -766
- package/dist/shared-Dpt4e-O9.js +0 -2
- package/dist/slash-commands.runtime-BtV5q0pv.js +0 -20
- package/dist/slash-dispatch.runtime-BDhbVtP4.js +0 -38
- package/dist/slash-skill-commands.runtime-C2MFQM29.js +0 -8
- package/dist/squidclaw-tools.runtime-BXCvcJOL.js +0 -2
- package/dist/src-UTq3Vwke.js +0 -2841
- package/dist/stage-sandbox-media.runtime-CgbVMvTX.js +0 -231
- package/dist/startup-verification-Bgxg51QM.js +0 -132
- package/dist/status-C6ejKsXs.js +0 -3
- package/dist/status-Co9vYLDq.js +0 -607
- package/dist/status-Dabi0MUR.js +0 -2
- package/dist/status-DkiiNsd1.js +0 -478
- package/dist/status-E8JIm_wq.js +0 -391
- package/dist/status-all-DqdzD3l2.js +0 -484
- package/dist/status-json-DW4G1ifQ.js +0 -14
- package/dist/status-json-command-C_y4Qnfw.js +0 -84
- package/dist/status-runtime-shared-BjdaMBBy.js +0 -254
- package/dist/status.command.text-runtime-Cezf3w14.js +0 -15
- package/dist/status.gateway-connection.runtime-Fty09fSN.js +0 -2
- package/dist/status.gateway-probe-CtyElUAZ.js +0 -16
- package/dist/status.scan-e2ndyoox.js +0 -62
- package/dist/status.scan-overview-Cfxp5RW1.js +0 -395
- package/dist/status.scan.fast-json-BbmQZHtY.js +0 -2
- package/dist/status.scan.fast-json-pFHFJao2.js +0 -128
- package/dist/status.summary--QblCYpN.js +0 -2
- package/dist/status.summary-rbSkau3S.js +0 -209
- package/dist/sticker-cache-BVjpg6Jr.js +0 -184
- package/dist/sticker-vision.runtime-Brteqqqk.js +0 -16
- package/dist/storage-qK6jOD0a.js +0 -281
- package/dist/subagent-announce.registry.runtime-DjrEtLXy.js +0 -3
- package/dist/subagent-followup.runtime-AgUQMRnV.js +0 -68
- package/dist/subagent-hooks-BIkcskal.js +0 -101
- package/dist/subagent-list-Cjy5X9zr.js +0 -167
- package/dist/subagent-orphan-recovery-DoHcGTmY.js +0 -213
- package/dist/subagent-registry-runtime-BtxCxqDG.js +0 -2
- package/dist/subagent-registry.runtime-Dy6yz9QP.js +0 -3
- package/dist/subagents-format-DhZnQqvz.js +0 -715
- package/dist/suite-Bm6-0z9W.js +0 -2
- package/dist/suite-Dy4_-d5w.js +0 -3665
- package/dist/suite-launch.runtime-CT6ZQXhY.js +0 -7
- package/dist/system-cli-Blr_zAnY.js +0 -59
- package/dist/targets-DSLnS3Ju.js +0 -594
- package/dist/targets-zjDM8sUO.js +0 -2
- package/dist/task-executor-C3f8iqwr.js +0 -350
- package/dist/task-owner-access-B1ZJymnj.js +0 -48
- package/dist/task-registry-DwSuIP5x.js +0 -2343
- package/dist/task-registry-control.runtime-D0aPCpac.js +0 -3
- package/dist/task-registry-delivery-runtime-DW5UnNOu.js +0 -3
- package/dist/task-registry-delivery-runtime-OuMCxMMR.js +0 -2
- package/dist/task-registry.audit-CCvavL7s.js +0 -420
- package/dist/task-registry.maintenance-DuJaYBdY.js +0 -2
- package/dist/testing-3s6ggYUi.js +0 -637
- package/dist/text-report-BMFH2D2f.js +0 -587
- package/dist/thread-bindings-BKPRlJ8r.js +0 -350
- package/dist/thread-bindings-BQIzpYsw.js +0 -231
- package/dist/thread-bindings-BqgRY931.js +0 -223
- package/dist/thread-bindings-_V7u3OBb.js +0 -541
- package/dist/thread-bindings.discord-api-D775Moto.js +0 -167
- package/dist/thread-bindings.manager-Cj6MCnrB.js +0 -516
- package/dist/thread-bindings.manager-NzDRPx4c.js +0 -2
- package/dist/token-CXEUIR3T.js +0 -82
- package/dist/tool-actions.runtime-DCp5s7hQ.js +0 -534
- package/dist/tools-effective-inventory-e3f07-S5.js +0 -151
- package/dist/tui-DiVWeFmm.js +0 -3941
- package/dist/tui-cli-QhUFE67j.js +0 -31
- package/dist/ui-DTD0F-R6.js +0 -266
- package/dist/update-cli-CTz2V8Ez.js +0 -1484
- package/dist/verification-1bD881sU.js +0 -133
- package/dist/verification-CCqBFDKu.js +0 -2
- package/dist/webhook-shared-DJeFHRS7.js +0 -49
|
@@ -0,0 +1,1628 @@
|
|
|
1
|
+
import { r as formatErrorMessage } from "./errors-CGMew-1w.js";
|
|
2
|
+
import { i as normalizeLowercaseStringOrEmpty, o as normalizeOptionalLowercaseString, s as normalizeOptionalString } from "./string-coerce-CIT1-v_a.js";
|
|
3
|
+
import { n as defaultRuntime } from "./runtime-beXCX1Aa.js";
|
|
4
|
+
import { d as normalizeMessageChannel, r as isDeliverableMessageChannel } from "./message-channel-DQjnLsbt.js";
|
|
5
|
+
import { c as normalizeAgentId, u as resolveAgentIdFromSessionKey } from "./session-key-BMb3Kc4r.js";
|
|
6
|
+
import { v as resolveSessionAgentId } from "./agent-scope-1jO5gmIG.js";
|
|
7
|
+
import { t as getChannelPlugin } from "./registry-D8idogHt.js";
|
|
8
|
+
import { a as actionHasTarget, o as actionRequiresTarget, r as applyTargetToParams } from "./channel-target-CDUay8d4.js";
|
|
9
|
+
import "./plugins-9PIyB0Mq.js";
|
|
10
|
+
import { i as recordSessionMetaFromInbound } from "./store-DEwD6Tdb.js";
|
|
11
|
+
import "./sessions-BOtSCSkk.js";
|
|
12
|
+
import { l as resolveStorePath } from "./paths-Dw14DKA5.js";
|
|
13
|
+
import { t as appendAssistantMessageToSessionTranscript } from "./transcript-CrHQeEw4.js";
|
|
14
|
+
import { i as createRootScopedReadFile } from "./fs-safe-Casgxcrs.js";
|
|
15
|
+
import { n as basenameFromMediaSource } from "./local-file-access-VOjhAo0m.js";
|
|
16
|
+
import { a as resolveSandboxedMediaSource, t as assertMediaNotDataUrl } from "./sandbox-paths-CsJrrIUJ.js";
|
|
17
|
+
import { c as throwIfAborted, l as resolveAgentScopedOutboundMediaAccess, o as parseReplyDirectives } from "./deliver-3B39T7RD.js";
|
|
18
|
+
import { n as extensionForMime } from "./mime-CQnQ252G.js";
|
|
19
|
+
import { d as readNumberParam, h as readStringParam, p as readStringArrayParam, y as readSnakeCaseParamRaw } from "./common-BgL25nXe.js";
|
|
20
|
+
import { r as resolvePollMaxSelections } from "./polls-B1z7T0_w.js";
|
|
21
|
+
import { n as resolveOutboundChannelPlugin$1 } from "./channel-resolution-DuA3GoO8.js";
|
|
22
|
+
import { n as resolveMessageChannelSelection, t as listConfiguredMessageChannels } from "./channel-selection-D8VFMv0z.js";
|
|
23
|
+
import { i as hasReplyPayloadContent, t as hasInteractiveReplyBlocks } from "./payload-ZNHtyede.js";
|
|
24
|
+
import { r as getAgentScopedMediaLocalRoots } from "./local-roots-Bo2Y-HEc.js";
|
|
25
|
+
import { a as looksLikeTargetId, c as normalizeTargetForProvider, i as buildTargetResolverSignature, l as resolveNormalizedTargetInput, o as maybeResolvePluginMessagingTarget, s as normalizeChannelTargetInput } from "./reply-payloads-dedupe-DocnNX_f.js";
|
|
26
|
+
import { r as unknownTargetError, t as ambiguousTargetError } from "./target-errors-Dd5ygAn4.js";
|
|
27
|
+
import { n as sendPoll, t as sendMessage } from "./message-DQn4jjjK.js";
|
|
28
|
+
import { t as loadWebMedia } from "./web-media-BQD3doXH.js";
|
|
29
|
+
import { t as buildChannelAccountBindings } from "./bindings-DatYt3mP.js";
|
|
30
|
+
import { n as resolveOutboundMediaAccess, t as buildOutboundMediaLoadOptions } from "./load-options-D5JqNZ4B.js";
|
|
31
|
+
import { t as readBooleanParam$1 } from "./boolean-param-CApHbT_L.js";
|
|
32
|
+
import { t as extractToolPayload } from "./tool-payload-CrKkYqum.js";
|
|
33
|
+
import "./inbound.runtime-Bw8800Cb.js";
|
|
34
|
+
import { t as buildAgentSessionKey } from "./resolve-route-cNUdmSZA.js";
|
|
35
|
+
//#region src/channels/plugins/message-action-dispatch.ts
|
|
36
|
+
function requiresTrustedRequesterSender(ctx) {
|
|
37
|
+
const plugin = getChannelPlugin(ctx.channel);
|
|
38
|
+
return Boolean(plugin?.actions?.requiresTrustedRequesterSender?.({
|
|
39
|
+
action: ctx.action,
|
|
40
|
+
toolContext: ctx.toolContext
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
async function dispatchChannelMessageAction(ctx) {
|
|
44
|
+
if (requiresTrustedRequesterSender(ctx) && !ctx.requesterSenderId?.trim()) throw new Error(`Trusted sender identity is required for ${ctx.channel}:${ctx.action} in tool-driven contexts.`);
|
|
45
|
+
const plugin = getChannelPlugin(ctx.channel);
|
|
46
|
+
if (!plugin?.actions?.handleAction) return null;
|
|
47
|
+
if (plugin.actions.supportsAction && !plugin.actions.supportsAction({ action: ctx.action })) return null;
|
|
48
|
+
return await plugin.actions.handleAction(ctx);
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/poll-params.ts
|
|
52
|
+
const SHARED_POLL_CREATION_PARAM_DEFS = {
|
|
53
|
+
pollQuestion: { kind: "string" },
|
|
54
|
+
pollOption: { kind: "stringArray" },
|
|
55
|
+
pollDurationHours: { kind: "number" },
|
|
56
|
+
pollMulti: { kind: "boolean" }
|
|
57
|
+
};
|
|
58
|
+
const TELEGRAM_POLL_CREATION_PARAM_DEFS = {
|
|
59
|
+
pollDurationSeconds: { kind: "number" },
|
|
60
|
+
pollAnonymous: { kind: "boolean" },
|
|
61
|
+
pollPublic: { kind: "boolean" }
|
|
62
|
+
};
|
|
63
|
+
const POLL_CREATION_PARAM_DEFS = {
|
|
64
|
+
...SHARED_POLL_CREATION_PARAM_DEFS,
|
|
65
|
+
...TELEGRAM_POLL_CREATION_PARAM_DEFS
|
|
66
|
+
};
|
|
67
|
+
const POLL_CREATION_PARAM_NAMES = Object.keys(POLL_CREATION_PARAM_DEFS);
|
|
68
|
+
const SHARED_POLL_CREATION_PARAM_NAMES = Object.keys(SHARED_POLL_CREATION_PARAM_DEFS);
|
|
69
|
+
function readPollParamRaw(params, key) {
|
|
70
|
+
return readSnakeCaseParamRaw(params, key);
|
|
71
|
+
}
|
|
72
|
+
function hasPollCreationParams(params) {
|
|
73
|
+
for (const key of POLL_CREATION_PARAM_NAMES) {
|
|
74
|
+
const def = POLL_CREATION_PARAM_DEFS[key];
|
|
75
|
+
const value = readPollParamRaw(params, key);
|
|
76
|
+
if (def.kind === "string" && typeof value === "string" && value.trim().length > 0) return true;
|
|
77
|
+
if (def.kind === "stringArray") {
|
|
78
|
+
if (Array.isArray(value) && value.some((entry) => typeof entry === "string" && entry.trim())) return true;
|
|
79
|
+
if (typeof value === "string" && value.trim().length > 0) return true;
|
|
80
|
+
}
|
|
81
|
+
if (def.kind === "number") {
|
|
82
|
+
if (typeof value === "number" && Number.isFinite(value) && value !== 0) return true;
|
|
83
|
+
if (typeof value === "string") {
|
|
84
|
+
const trimmed = value.trim();
|
|
85
|
+
const parsed = Number(trimmed);
|
|
86
|
+
if (trimmed.length > 0 && Number.isFinite(parsed) && parsed !== 0) return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (def.kind === "boolean") {
|
|
90
|
+
if (value === true) return true;
|
|
91
|
+
if (typeof value === "string" && normalizeLowercaseStringOrEmpty(value) === "true") return true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/infra/outbound/message-action-normalization.ts
|
|
98
|
+
function normalizeMessageActionInput(params) {
|
|
99
|
+
const normalizedArgs = { ...params.args };
|
|
100
|
+
const { action, toolContext } = params;
|
|
101
|
+
const explicitChannel = normalizeOptionalString(normalizedArgs.channel) ?? "";
|
|
102
|
+
const inferredChannel = explicitChannel || normalizeMessageChannel(toolContext?.currentChannelProvider) || "";
|
|
103
|
+
const explicitTarget = normalizeOptionalString(normalizedArgs.target) ?? "";
|
|
104
|
+
const hasLegacyTargetFields = typeof normalizedArgs.to === "string" || typeof normalizedArgs.channelId === "string";
|
|
105
|
+
const hasLegacyTarget = (normalizeOptionalString(normalizedArgs.to) ?? "").length > 0 || (normalizeOptionalString(normalizedArgs.channelId) ?? "").length > 0;
|
|
106
|
+
if (explicitTarget && hasLegacyTargetFields) {
|
|
107
|
+
delete normalizedArgs.to;
|
|
108
|
+
delete normalizedArgs.channelId;
|
|
109
|
+
}
|
|
110
|
+
if (!explicitTarget && !hasLegacyTarget && actionRequiresTarget(action) && !actionHasTarget(action, normalizedArgs, { channel: inferredChannel })) {
|
|
111
|
+
const inferredTarget = normalizeOptionalString(toolContext?.currentChannelId);
|
|
112
|
+
if (inferredTarget) normalizedArgs.target = inferredTarget;
|
|
113
|
+
}
|
|
114
|
+
if (!explicitTarget && actionRequiresTarget(action) && hasLegacyTarget) {
|
|
115
|
+
const legacyTo = normalizeOptionalString(normalizedArgs.to) ?? "";
|
|
116
|
+
const legacyChannelId = normalizeOptionalString(normalizedArgs.channelId) ?? "";
|
|
117
|
+
const legacyTarget = legacyTo || legacyChannelId;
|
|
118
|
+
if (legacyTarget) {
|
|
119
|
+
normalizedArgs.target = legacyTarget;
|
|
120
|
+
delete normalizedArgs.to;
|
|
121
|
+
delete normalizedArgs.channelId;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if (!explicitChannel) {
|
|
125
|
+
if (inferredChannel && isDeliverableMessageChannel(inferredChannel)) normalizedArgs.channel = inferredChannel;
|
|
126
|
+
}
|
|
127
|
+
applyTargetToParams({
|
|
128
|
+
action,
|
|
129
|
+
args: normalizedArgs
|
|
130
|
+
});
|
|
131
|
+
if (actionRequiresTarget(action) && !actionHasTarget(action, normalizedArgs, { channel: inferredChannel })) throw new Error(`Action ${action} requires a target.`);
|
|
132
|
+
return normalizedArgs;
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/infra/outbound/message-action-params.ts
|
|
136
|
+
const readBooleanParam = readBooleanParam$1;
|
|
137
|
+
const SANDBOX_MEDIA_PARAM_KEYS = [
|
|
138
|
+
"media",
|
|
139
|
+
"path",
|
|
140
|
+
"filePath",
|
|
141
|
+
"mediaUrl",
|
|
142
|
+
"fileUrl"
|
|
143
|
+
];
|
|
144
|
+
function readMediaParam(args, key) {
|
|
145
|
+
return readStringParam(args, key, { trim: false });
|
|
146
|
+
}
|
|
147
|
+
function readAttachmentMediaHint(args) {
|
|
148
|
+
return readMediaParam(args, "media") ?? readMediaParam(args, "mediaUrl");
|
|
149
|
+
}
|
|
150
|
+
function readAttachmentFileHint(args) {
|
|
151
|
+
return readMediaParam(args, "path") ?? readMediaParam(args, "filePath") ?? readMediaParam(args, "fileUrl");
|
|
152
|
+
}
|
|
153
|
+
function resolveAttachmentMaxBytes(params) {
|
|
154
|
+
const accountId = typeof params.accountId === "string" ? params.accountId.trim() : "";
|
|
155
|
+
const channelCfg = params.cfg.channels?.[params.channel];
|
|
156
|
+
const channelObj = channelCfg && typeof channelCfg === "object" ? channelCfg : void 0;
|
|
157
|
+
const channelMediaMax = typeof channelObj?.mediaMaxMb === "number" ? channelObj.mediaMaxMb : void 0;
|
|
158
|
+
const accountsObj = channelObj?.accounts && typeof channelObj.accounts === "object" ? channelObj.accounts : void 0;
|
|
159
|
+
const accountCfg = accountId && accountsObj ? accountsObj[accountId] : void 0;
|
|
160
|
+
const accountMediaMax = accountCfg && typeof accountCfg === "object" ? accountCfg.mediaMaxMb : void 0;
|
|
161
|
+
const limitMb = (typeof accountMediaMax === "number" ? accountMediaMax : void 0) ?? channelMediaMax ?? params.cfg.agents?.defaults?.mediaMaxMb;
|
|
162
|
+
return typeof limitMb === "number" ? limitMb * 1024 * 1024 : void 0;
|
|
163
|
+
}
|
|
164
|
+
function inferAttachmentFilename(params) {
|
|
165
|
+
const mediaHint = params.mediaHint?.trim();
|
|
166
|
+
if (mediaHint) {
|
|
167
|
+
const base = basenameFromMediaSource(mediaHint);
|
|
168
|
+
if (base) return base;
|
|
169
|
+
}
|
|
170
|
+
const ext = params.contentType ? extensionForMime(params.contentType) : void 0;
|
|
171
|
+
return ext ? `attachment${ext}` : "attachment";
|
|
172
|
+
}
|
|
173
|
+
function normalizeBase64Payload(params) {
|
|
174
|
+
if (!params.base64) return {
|
|
175
|
+
base64: params.base64,
|
|
176
|
+
contentType: params.contentType
|
|
177
|
+
};
|
|
178
|
+
const match = /^data:([^;]+);base64,(.*)$/i.exec(params.base64.trim());
|
|
179
|
+
if (!match) return {
|
|
180
|
+
base64: params.base64,
|
|
181
|
+
contentType: params.contentType
|
|
182
|
+
};
|
|
183
|
+
const [, mime, payload] = match;
|
|
184
|
+
return {
|
|
185
|
+
base64: payload,
|
|
186
|
+
contentType: params.contentType ?? mime
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
function resolveAttachmentMediaPolicy(params) {
|
|
190
|
+
const sandboxRoot = params.sandboxRoot?.trim();
|
|
191
|
+
if (sandboxRoot) return {
|
|
192
|
+
mode: "sandbox",
|
|
193
|
+
sandboxRoot
|
|
194
|
+
};
|
|
195
|
+
return {
|
|
196
|
+
mode: "host",
|
|
197
|
+
mediaAccess: resolveOutboundMediaAccess({
|
|
198
|
+
mediaAccess: params.mediaAccess,
|
|
199
|
+
mediaLocalRoots: params.mediaLocalRoots,
|
|
200
|
+
mediaReadFile: params.mediaReadFile
|
|
201
|
+
})
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function buildAttachmentMediaLoadOptions(params) {
|
|
205
|
+
if (params.policy.mode === "sandbox") {
|
|
206
|
+
const readSandboxFile = createRootScopedReadFile({ rootDir: params.policy.sandboxRoot.trim() });
|
|
207
|
+
return {
|
|
208
|
+
maxBytes: params.maxBytes,
|
|
209
|
+
sandboxValidated: true,
|
|
210
|
+
readFile: readSandboxFile
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
return buildOutboundMediaLoadOptions({
|
|
214
|
+
maxBytes: params.maxBytes,
|
|
215
|
+
mediaAccess: params.policy.mediaAccess
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
async function hydrateAttachmentPayload(params) {
|
|
219
|
+
const contentTypeParam = params.contentTypeParam ?? void 0;
|
|
220
|
+
const rawBuffer = readStringParam(params.args, "buffer", { trim: false });
|
|
221
|
+
const normalized = normalizeBase64Payload({
|
|
222
|
+
base64: rawBuffer,
|
|
223
|
+
contentType: contentTypeParam ?? void 0
|
|
224
|
+
});
|
|
225
|
+
if (normalized.base64 !== rawBuffer && normalized.base64) {
|
|
226
|
+
params.args.buffer = normalized.base64;
|
|
227
|
+
if (normalized.contentType && !contentTypeParam) params.args.contentType = normalized.contentType;
|
|
228
|
+
}
|
|
229
|
+
const filename = readStringParam(params.args, "filename");
|
|
230
|
+
const mediaSource = (params.mediaHint ?? void 0) || (params.fileHint ?? void 0);
|
|
231
|
+
if (!params.dryRun && !readStringParam(params.args, "buffer", { trim: false }) && mediaSource) {
|
|
232
|
+
const maxBytes = resolveAttachmentMaxBytes({
|
|
233
|
+
cfg: params.cfg,
|
|
234
|
+
channel: params.channel,
|
|
235
|
+
accountId: params.accountId
|
|
236
|
+
});
|
|
237
|
+
const media = await loadWebMedia(mediaSource, buildAttachmentMediaLoadOptions({
|
|
238
|
+
policy: params.mediaPolicy,
|
|
239
|
+
maxBytes
|
|
240
|
+
}));
|
|
241
|
+
params.args.buffer = media.buffer.toString("base64");
|
|
242
|
+
if (!contentTypeParam && media.contentType) params.args.contentType = media.contentType;
|
|
243
|
+
if (!filename) params.args.filename = inferAttachmentFilename({
|
|
244
|
+
mediaHint: media.fileName ?? mediaSource,
|
|
245
|
+
contentType: media.contentType ?? contentTypeParam ?? void 0
|
|
246
|
+
});
|
|
247
|
+
} else if (!filename) params.args.filename = inferAttachmentFilename({
|
|
248
|
+
mediaHint: mediaSource,
|
|
249
|
+
contentType: contentTypeParam ?? void 0
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
async function normalizeSandboxMediaParams(params) {
|
|
253
|
+
const sandboxRoot = params.mediaPolicy.mode === "sandbox" ? params.mediaPolicy.sandboxRoot.trim() : void 0;
|
|
254
|
+
for (const key of SANDBOX_MEDIA_PARAM_KEYS) {
|
|
255
|
+
const raw = readMediaParam(params.args, key);
|
|
256
|
+
if (!raw) continue;
|
|
257
|
+
assertMediaNotDataUrl(raw);
|
|
258
|
+
if (!sandboxRoot) continue;
|
|
259
|
+
const normalized = await resolveSandboxedMediaSource({
|
|
260
|
+
media: raw,
|
|
261
|
+
sandboxRoot
|
|
262
|
+
});
|
|
263
|
+
if (normalized !== raw) params.args[key] = normalized;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
async function normalizeSandboxMediaList(params) {
|
|
267
|
+
const sandboxRoot = params.sandboxRoot?.trim();
|
|
268
|
+
const normalized = [];
|
|
269
|
+
const seen = /* @__PURE__ */ new Set();
|
|
270
|
+
for (const value of params.values) {
|
|
271
|
+
const raw = value?.trim();
|
|
272
|
+
if (!raw) continue;
|
|
273
|
+
assertMediaNotDataUrl(raw);
|
|
274
|
+
const resolved = sandboxRoot ? await resolveSandboxedMediaSource({
|
|
275
|
+
media: raw,
|
|
276
|
+
sandboxRoot
|
|
277
|
+
}) : raw;
|
|
278
|
+
if (seen.has(resolved)) continue;
|
|
279
|
+
seen.add(resolved);
|
|
280
|
+
normalized.push(resolved);
|
|
281
|
+
}
|
|
282
|
+
return normalized;
|
|
283
|
+
}
|
|
284
|
+
async function hydrateAttachmentActionPayload(params) {
|
|
285
|
+
const mediaHint = readAttachmentMediaHint(params.args);
|
|
286
|
+
const fileHint = readAttachmentFileHint(params.args);
|
|
287
|
+
const contentTypeParam = readStringParam(params.args, "contentType") ?? readStringParam(params.args, "mimeType");
|
|
288
|
+
if (params.allowMessageCaptionFallback) {
|
|
289
|
+
const caption = readStringParam(params.args, "caption", { allowEmpty: true })?.trim();
|
|
290
|
+
const message = readStringParam(params.args, "message", { allowEmpty: true })?.trim();
|
|
291
|
+
if (!caption && message) params.args.caption = message;
|
|
292
|
+
}
|
|
293
|
+
await hydrateAttachmentPayload({
|
|
294
|
+
cfg: params.cfg,
|
|
295
|
+
channel: params.channel,
|
|
296
|
+
accountId: params.accountId,
|
|
297
|
+
args: params.args,
|
|
298
|
+
dryRun: params.dryRun,
|
|
299
|
+
contentTypeParam,
|
|
300
|
+
mediaHint,
|
|
301
|
+
fileHint,
|
|
302
|
+
mediaPolicy: params.mediaPolicy
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
async function hydrateAttachmentParamsForAction(params) {
|
|
306
|
+
const shouldHydrateUploadFile = params.action === "upload-file";
|
|
307
|
+
if (params.action !== "sendAttachment" && params.action !== "setGroupIcon" && !shouldHydrateUploadFile) return;
|
|
308
|
+
await hydrateAttachmentActionPayload({
|
|
309
|
+
cfg: params.cfg,
|
|
310
|
+
channel: params.channel,
|
|
311
|
+
accountId: params.accountId,
|
|
312
|
+
args: params.args,
|
|
313
|
+
dryRun: params.dryRun,
|
|
314
|
+
mediaPolicy: params.mediaPolicy,
|
|
315
|
+
allowMessageCaptionFallback: params.action === "sendAttachment" || shouldHydrateUploadFile
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
function parseButtonsParam(params) {
|
|
319
|
+
const raw = params.buttons;
|
|
320
|
+
if (typeof raw !== "string") return;
|
|
321
|
+
const trimmed = raw.trim();
|
|
322
|
+
if (!trimmed) {
|
|
323
|
+
delete params.buttons;
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
try {
|
|
327
|
+
params.buttons = JSON.parse(trimmed);
|
|
328
|
+
} catch {
|
|
329
|
+
throw new Error("--buttons must be valid JSON");
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function parseCardParam(params) {
|
|
333
|
+
const raw = params.card;
|
|
334
|
+
if (typeof raw !== "string") return;
|
|
335
|
+
const trimmed = raw.trim();
|
|
336
|
+
if (!trimmed) {
|
|
337
|
+
delete params.card;
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
try {
|
|
341
|
+
params.card = JSON.parse(trimmed);
|
|
342
|
+
} catch {
|
|
343
|
+
throw new Error("--card must be valid JSON");
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
function parseComponentsParam(params) {
|
|
347
|
+
const raw = params.components;
|
|
348
|
+
if (typeof raw !== "string") return;
|
|
349
|
+
const trimmed = raw.trim();
|
|
350
|
+
if (!trimmed) {
|
|
351
|
+
delete params.components;
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
try {
|
|
355
|
+
params.components = JSON.parse(trimmed);
|
|
356
|
+
} catch {
|
|
357
|
+
throw new Error("--components must be valid JSON");
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function parseInteractiveParam(params) {
|
|
361
|
+
const raw = params.interactive;
|
|
362
|
+
if (typeof raw !== "string") return;
|
|
363
|
+
const trimmed = raw.trim();
|
|
364
|
+
if (!trimmed) {
|
|
365
|
+
delete params.interactive;
|
|
366
|
+
return;
|
|
367
|
+
}
|
|
368
|
+
try {
|
|
369
|
+
params.interactive = JSON.parse(trimmed);
|
|
370
|
+
} catch {
|
|
371
|
+
throw new Error("--interactive must be valid JSON");
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region src/infra/outbound/message-action-threading.ts
|
|
376
|
+
function resolveAndApplyOutboundThreadId(actionParams, context) {
|
|
377
|
+
const resolved = readStringParam(actionParams, "threadId") ?? context.resolveAutoThreadId?.({
|
|
378
|
+
cfg: context.cfg,
|
|
379
|
+
accountId: context.accountId,
|
|
380
|
+
to: context.to,
|
|
381
|
+
toolContext: context.toolContext,
|
|
382
|
+
replyToId: readStringParam(actionParams, "replyTo")
|
|
383
|
+
});
|
|
384
|
+
if (resolved && !actionParams.threadId) actionParams.threadId = resolved;
|
|
385
|
+
return resolved ?? void 0;
|
|
386
|
+
}
|
|
387
|
+
async function prepareOutboundMirrorRoute(params) {
|
|
388
|
+
const replyToId = readStringParam(params.actionParams, "replyTo");
|
|
389
|
+
const resolvedThreadId = resolveAndApplyOutboundThreadId(params.actionParams, {
|
|
390
|
+
cfg: params.cfg,
|
|
391
|
+
to: params.to,
|
|
392
|
+
accountId: params.accountId,
|
|
393
|
+
toolContext: params.toolContext,
|
|
394
|
+
resolveAutoThreadId: params.resolveAutoThreadId
|
|
395
|
+
});
|
|
396
|
+
const outboundRoute = params.agentId && !params.dryRun ? await params.resolveOutboundSessionRoute({
|
|
397
|
+
cfg: params.cfg,
|
|
398
|
+
channel: params.channel,
|
|
399
|
+
agentId: params.agentId,
|
|
400
|
+
accountId: params.accountId,
|
|
401
|
+
target: params.to,
|
|
402
|
+
currentSessionKey: params.currentSessionKey,
|
|
403
|
+
resolvedTarget: params.resolvedTarget,
|
|
404
|
+
replyToId,
|
|
405
|
+
threadId: resolvedThreadId
|
|
406
|
+
}) : null;
|
|
407
|
+
if (outboundRoute && params.agentId && !params.dryRun) await params.ensureOutboundSessionEntry({
|
|
408
|
+
cfg: params.cfg,
|
|
409
|
+
channel: params.channel,
|
|
410
|
+
accountId: params.accountId,
|
|
411
|
+
route: outboundRoute
|
|
412
|
+
});
|
|
413
|
+
if (outboundRoute && !params.dryRun) params.actionParams.__sessionKey = outboundRoute.sessionKey;
|
|
414
|
+
if (params.agentId) params.actionParams.__agentId = params.agentId;
|
|
415
|
+
return {
|
|
416
|
+
resolvedThreadId,
|
|
417
|
+
outboundRoute
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/infra/outbound/channel-adapters.ts
|
|
422
|
+
const DEFAULT_ADAPTER = { supportsComponentsV2: false };
|
|
423
|
+
function getChannelMessageAdapter(channel) {
|
|
424
|
+
const adapter = getChannelPlugin(channel)?.messaging?.buildCrossContextComponents;
|
|
425
|
+
if (adapter) return {
|
|
426
|
+
supportsComponentsV2: true,
|
|
427
|
+
buildCrossContextComponents: adapter
|
|
428
|
+
};
|
|
429
|
+
return DEFAULT_ADAPTER;
|
|
430
|
+
}
|
|
431
|
+
//#endregion
|
|
432
|
+
//#region src/infra/outbound/directory-cache.ts
|
|
433
|
+
function buildDirectoryCacheKey(key) {
|
|
434
|
+
const signature = key.signature ?? "default";
|
|
435
|
+
return `${key.channel}:${key.accountId ?? "default"}:${key.kind}:${key.source}:${signature}`;
|
|
436
|
+
}
|
|
437
|
+
var DirectoryCache = class {
|
|
438
|
+
constructor(ttlMs, maxSize = 2e3) {
|
|
439
|
+
this.ttlMs = ttlMs;
|
|
440
|
+
this.cache = /* @__PURE__ */ new Map();
|
|
441
|
+
this.lastConfigRef = null;
|
|
442
|
+
this.maxSize = Math.max(1, Math.floor(maxSize));
|
|
443
|
+
}
|
|
444
|
+
get(key, cfg) {
|
|
445
|
+
this.resetIfConfigChanged(cfg);
|
|
446
|
+
this.pruneExpired(Date.now());
|
|
447
|
+
const entry = this.cache.get(key);
|
|
448
|
+
if (!entry) return;
|
|
449
|
+
return entry.value;
|
|
450
|
+
}
|
|
451
|
+
set(key, value, cfg) {
|
|
452
|
+
this.resetIfConfigChanged(cfg);
|
|
453
|
+
const now = Date.now();
|
|
454
|
+
this.pruneExpired(now);
|
|
455
|
+
if (this.cache.has(key)) this.cache.delete(key);
|
|
456
|
+
this.cache.set(key, {
|
|
457
|
+
value,
|
|
458
|
+
fetchedAt: now
|
|
459
|
+
});
|
|
460
|
+
this.evictToMaxSize();
|
|
461
|
+
}
|
|
462
|
+
clearMatching(match) {
|
|
463
|
+
for (const key of this.cache.keys()) if (match(key)) this.cache.delete(key);
|
|
464
|
+
}
|
|
465
|
+
clear(cfg) {
|
|
466
|
+
this.cache.clear();
|
|
467
|
+
if (cfg) this.lastConfigRef = cfg;
|
|
468
|
+
}
|
|
469
|
+
resetIfConfigChanged(cfg) {
|
|
470
|
+
if (this.lastConfigRef && this.lastConfigRef !== cfg) this.cache.clear();
|
|
471
|
+
this.lastConfigRef = cfg;
|
|
472
|
+
}
|
|
473
|
+
pruneExpired(now) {
|
|
474
|
+
if (this.ttlMs <= 0) return;
|
|
475
|
+
for (const [cacheKey, entry] of this.cache.entries()) if (now - entry.fetchedAt > this.ttlMs) this.cache.delete(cacheKey);
|
|
476
|
+
}
|
|
477
|
+
evictToMaxSize() {
|
|
478
|
+
while (this.cache.size > this.maxSize) {
|
|
479
|
+
const oldestKey = this.cache.keys().next().value;
|
|
480
|
+
if (typeof oldestKey !== "string") break;
|
|
481
|
+
this.cache.delete(oldestKey);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
};
|
|
485
|
+
//#endregion
|
|
486
|
+
//#region src/infra/outbound/target-resolver.ts
|
|
487
|
+
function asResolvedMessagingTarget(target) {
|
|
488
|
+
return target;
|
|
489
|
+
}
|
|
490
|
+
async function resolveChannelTarget(params) {
|
|
491
|
+
return resolveMessagingTarget(params);
|
|
492
|
+
}
|
|
493
|
+
async function maybeResolveIdLikeTarget(params) {
|
|
494
|
+
return asResolvedMessagingTarget(await maybeResolvePluginMessagingTarget({
|
|
495
|
+
...params,
|
|
496
|
+
requireIdLike: true
|
|
497
|
+
}));
|
|
498
|
+
}
|
|
499
|
+
const directoryCache = new DirectoryCache(1800 * 1e3);
|
|
500
|
+
function resetDirectoryCache(params) {
|
|
501
|
+
if (!params?.channel) {
|
|
502
|
+
directoryCache.clear();
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
const channelKey = params.channel;
|
|
506
|
+
const accountKey = params.accountId ?? "default";
|
|
507
|
+
directoryCache.clearMatching((key) => {
|
|
508
|
+
if (!key.startsWith(`${channelKey}:`)) return false;
|
|
509
|
+
if (!params.accountId) return true;
|
|
510
|
+
return key.startsWith(`${channelKey}:${accountKey}:`);
|
|
511
|
+
});
|
|
512
|
+
}
|
|
513
|
+
function normalizeQuery(value) {
|
|
514
|
+
return normalizeLowercaseStringOrEmpty(value);
|
|
515
|
+
}
|
|
516
|
+
function stripTargetPrefixes(value) {
|
|
517
|
+
return value.replace(/^(channel|user):/i, "").replace(/^[@#]/, "").trim();
|
|
518
|
+
}
|
|
519
|
+
function formatTargetDisplay(params) {
|
|
520
|
+
const plugin = getChannelPlugin(params.channel);
|
|
521
|
+
if (plugin?.messaging?.formatTargetDisplay) return plugin.messaging.formatTargetDisplay({
|
|
522
|
+
target: params.target,
|
|
523
|
+
display: params.display,
|
|
524
|
+
kind: params.kind
|
|
525
|
+
});
|
|
526
|
+
const trimmedTarget = params.target.trim();
|
|
527
|
+
const lowered = normalizeLowercaseStringOrEmpty(trimmedTarget);
|
|
528
|
+
const display = params.display?.trim();
|
|
529
|
+
const kind = params.kind ?? (lowered.startsWith("user:") ? "user" : lowered.startsWith("channel:") ? "group" : void 0);
|
|
530
|
+
if (display) {
|
|
531
|
+
if (display.startsWith("#") || display.startsWith("@")) return display;
|
|
532
|
+
if (kind === "user") return `@${display}`;
|
|
533
|
+
if (kind === "group" || kind === "channel") return `#${display}`;
|
|
534
|
+
return display;
|
|
535
|
+
}
|
|
536
|
+
if (!trimmedTarget) return trimmedTarget;
|
|
537
|
+
if (trimmedTarget.startsWith("#") || trimmedTarget.startsWith("@")) return trimmedTarget;
|
|
538
|
+
const channelPrefix = `${params.channel}:`;
|
|
539
|
+
const withoutProvider = lowered.startsWith(channelPrefix) ? trimmedTarget.slice(channelPrefix.length) : trimmedTarget;
|
|
540
|
+
if (/^channel:/i.test(withoutProvider)) return `#${withoutProvider.replace(/^channel:/i, "")}`;
|
|
541
|
+
if (/^user:/i.test(withoutProvider)) return `@${withoutProvider.replace(/^user:/i, "")}`;
|
|
542
|
+
return withoutProvider;
|
|
543
|
+
}
|
|
544
|
+
function detectTargetKind(channel, raw, preferred) {
|
|
545
|
+
if (preferred) return preferred;
|
|
546
|
+
const trimmed = raw.trim();
|
|
547
|
+
if (!trimmed) return "group";
|
|
548
|
+
const inferredChatType = getChannelPlugin(channel)?.messaging?.inferTargetChatType?.({ to: raw });
|
|
549
|
+
if (inferredChatType === "direct") return "user";
|
|
550
|
+
if (inferredChatType === "channel") return "channel";
|
|
551
|
+
if (inferredChatType === "group") return "group";
|
|
552
|
+
if (trimmed.startsWith("@") || /^<@!?/.test(trimmed) || /^user:/i.test(trimmed)) return "user";
|
|
553
|
+
if (trimmed.startsWith("#") || /^channel:/i.test(trimmed)) return "group";
|
|
554
|
+
return "group";
|
|
555
|
+
}
|
|
556
|
+
function normalizeDirectoryEntryId(channel, entry) {
|
|
557
|
+
return normalizeTargetForProvider(channel, entry.id) ?? entry.id.trim();
|
|
558
|
+
}
|
|
559
|
+
function matchesDirectoryEntry(params) {
|
|
560
|
+
const query = normalizeQuery(params.query);
|
|
561
|
+
if (!query) return false;
|
|
562
|
+
return [
|
|
563
|
+
stripTargetPrefixes(normalizeDirectoryEntryId(params.channel, params.entry)),
|
|
564
|
+
params.entry.name ? stripTargetPrefixes(params.entry.name) : "",
|
|
565
|
+
params.entry.handle ? stripTargetPrefixes(params.entry.handle) : ""
|
|
566
|
+
].map((value) => normalizeQuery(value)).filter(Boolean).some((value) => value === query || value.includes(query));
|
|
567
|
+
}
|
|
568
|
+
function resolveMatch(params) {
|
|
569
|
+
const matches = params.entries.filter((entry) => matchesDirectoryEntry({
|
|
570
|
+
channel: params.channel,
|
|
571
|
+
entry,
|
|
572
|
+
query: params.query
|
|
573
|
+
}));
|
|
574
|
+
if (matches.length === 0) return { kind: "none" };
|
|
575
|
+
if (matches.length === 1) return {
|
|
576
|
+
kind: "single",
|
|
577
|
+
entry: matches[0]
|
|
578
|
+
};
|
|
579
|
+
return {
|
|
580
|
+
kind: "ambiguous",
|
|
581
|
+
entries: matches
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
async function listDirectoryEntries(params) {
|
|
585
|
+
const directory = getChannelPlugin(params.channel)?.directory;
|
|
586
|
+
if (!directory) return [];
|
|
587
|
+
const runtime = params.runtime ?? defaultRuntime;
|
|
588
|
+
const useLive = params.source === "live";
|
|
589
|
+
const fn = params.kind === "user" ? useLive ? directory.listPeersLive ?? directory.listPeers : directory.listPeers : useLive ? directory.listGroupsLive ?? directory.listGroups : directory.listGroups;
|
|
590
|
+
if (!fn) return [];
|
|
591
|
+
return await fn({
|
|
592
|
+
cfg: params.cfg,
|
|
593
|
+
accountId: params.accountId ?? void 0,
|
|
594
|
+
query: params.query ?? void 0,
|
|
595
|
+
limit: void 0,
|
|
596
|
+
runtime
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
async function getDirectoryEntries(params) {
|
|
600
|
+
const signature = buildTargetResolverSignature(params.channel);
|
|
601
|
+
const listParams = {
|
|
602
|
+
cfg: params.cfg,
|
|
603
|
+
channel: params.channel,
|
|
604
|
+
accountId: params.accountId,
|
|
605
|
+
kind: params.kind,
|
|
606
|
+
query: params.query,
|
|
607
|
+
runtime: params.runtime
|
|
608
|
+
};
|
|
609
|
+
const cacheKey = buildDirectoryCacheKey({
|
|
610
|
+
channel: params.channel,
|
|
611
|
+
accountId: params.accountId,
|
|
612
|
+
kind: params.kind,
|
|
613
|
+
source: "cache",
|
|
614
|
+
signature
|
|
615
|
+
});
|
|
616
|
+
const cached = directoryCache.get(cacheKey, params.cfg);
|
|
617
|
+
if (cached) return cached;
|
|
618
|
+
const entries = await listDirectoryEntries({
|
|
619
|
+
...listParams,
|
|
620
|
+
source: "cache"
|
|
621
|
+
});
|
|
622
|
+
if (entries.length > 0 || !params.preferLiveOnMiss) {
|
|
623
|
+
directoryCache.set(cacheKey, entries, params.cfg);
|
|
624
|
+
return entries;
|
|
625
|
+
}
|
|
626
|
+
const liveKey = buildDirectoryCacheKey({
|
|
627
|
+
channel: params.channel,
|
|
628
|
+
accountId: params.accountId,
|
|
629
|
+
kind: params.kind,
|
|
630
|
+
source: "live",
|
|
631
|
+
signature
|
|
632
|
+
});
|
|
633
|
+
const liveEntries = await listDirectoryEntries({
|
|
634
|
+
...listParams,
|
|
635
|
+
source: "live"
|
|
636
|
+
});
|
|
637
|
+
directoryCache.set(liveKey, liveEntries, params.cfg);
|
|
638
|
+
directoryCache.set(cacheKey, liveEntries, params.cfg);
|
|
639
|
+
return liveEntries;
|
|
640
|
+
}
|
|
641
|
+
function buildNormalizedResolveResult(params) {
|
|
642
|
+
return {
|
|
643
|
+
ok: true,
|
|
644
|
+
target: {
|
|
645
|
+
to: params.normalized,
|
|
646
|
+
kind: params.kind,
|
|
647
|
+
display: stripTargetPrefixes(params.normalized),
|
|
648
|
+
source: "normalized"
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
function pickAmbiguousMatch(entries, mode) {
|
|
653
|
+
if (entries.length === 0) return null;
|
|
654
|
+
if (mode === "first") return entries[0] ?? null;
|
|
655
|
+
const ranked = entries.map((entry) => ({
|
|
656
|
+
entry,
|
|
657
|
+
rank: typeof entry.rank === "number" ? entry.rank : 0
|
|
658
|
+
}));
|
|
659
|
+
const bestRank = Math.max(...ranked.map((item) => item.rank));
|
|
660
|
+
return ranked.find((item) => item.rank === bestRank)?.entry ?? entries[0] ?? null;
|
|
661
|
+
}
|
|
662
|
+
async function resolveMessagingTarget(params) {
|
|
663
|
+
const raw = normalizeChannelTargetInput(params.input);
|
|
664
|
+
if (!raw) return {
|
|
665
|
+
ok: false,
|
|
666
|
+
error: /* @__PURE__ */ new Error("Target is required")
|
|
667
|
+
};
|
|
668
|
+
const plugin = getChannelPlugin(params.channel);
|
|
669
|
+
const providerLabel = plugin?.meta?.label ?? params.channel;
|
|
670
|
+
const hint = plugin?.messaging?.targetResolver?.hint;
|
|
671
|
+
const kind = detectTargetKind(params.channel, raw, params.preferredKind);
|
|
672
|
+
const normalizedInput = resolveNormalizedTargetInput(params.channel, raw);
|
|
673
|
+
const normalized = normalizedInput?.normalized ?? raw;
|
|
674
|
+
if (normalizedInput && looksLikeTargetId({
|
|
675
|
+
channel: params.channel,
|
|
676
|
+
raw: normalizedInput.raw,
|
|
677
|
+
normalized
|
|
678
|
+
})) {
|
|
679
|
+
const resolvedIdLikeTarget = await maybeResolveIdLikeTarget({
|
|
680
|
+
cfg: params.cfg,
|
|
681
|
+
channel: params.channel,
|
|
682
|
+
input: raw,
|
|
683
|
+
accountId: params.accountId,
|
|
684
|
+
preferredKind: params.preferredKind
|
|
685
|
+
});
|
|
686
|
+
if (resolvedIdLikeTarget) return {
|
|
687
|
+
ok: true,
|
|
688
|
+
target: resolvedIdLikeTarget
|
|
689
|
+
};
|
|
690
|
+
return buildNormalizedResolveResult({
|
|
691
|
+
normalized,
|
|
692
|
+
kind
|
|
693
|
+
});
|
|
694
|
+
}
|
|
695
|
+
const query = stripTargetPrefixes(raw);
|
|
696
|
+
const entries = await getDirectoryEntries({
|
|
697
|
+
cfg: params.cfg,
|
|
698
|
+
channel: params.channel,
|
|
699
|
+
accountId: params.accountId,
|
|
700
|
+
kind: kind === "user" ? "user" : "group",
|
|
701
|
+
query,
|
|
702
|
+
runtime: params.runtime,
|
|
703
|
+
preferLiveOnMiss: true
|
|
704
|
+
});
|
|
705
|
+
const match = resolveMatch({
|
|
706
|
+
channel: params.channel,
|
|
707
|
+
entries,
|
|
708
|
+
query
|
|
709
|
+
});
|
|
710
|
+
if (match.kind === "single") {
|
|
711
|
+
const entry = match.entry;
|
|
712
|
+
return {
|
|
713
|
+
ok: true,
|
|
714
|
+
target: {
|
|
715
|
+
to: normalizeDirectoryEntryId(params.channel, entry),
|
|
716
|
+
kind,
|
|
717
|
+
display: entry.name ?? entry.handle ?? stripTargetPrefixes(entry.id),
|
|
718
|
+
source: "directory"
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
if (match.kind === "ambiguous") {
|
|
723
|
+
const mode = params.resolveAmbiguous ?? "error";
|
|
724
|
+
if (mode !== "error") {
|
|
725
|
+
const best = pickAmbiguousMatch(match.entries, mode);
|
|
726
|
+
if (best) return {
|
|
727
|
+
ok: true,
|
|
728
|
+
target: {
|
|
729
|
+
to: normalizeDirectoryEntryId(params.channel, best),
|
|
730
|
+
kind,
|
|
731
|
+
display: best.name ?? best.handle ?? stripTargetPrefixes(best.id),
|
|
732
|
+
source: "directory"
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
return {
|
|
737
|
+
ok: false,
|
|
738
|
+
error: ambiguousTargetError(providerLabel, raw, hint),
|
|
739
|
+
candidates: match.entries
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
const resolvedFallbackTarget = asResolvedMessagingTarget(await maybeResolvePluginMessagingTarget({
|
|
743
|
+
cfg: params.cfg,
|
|
744
|
+
channel: params.channel,
|
|
745
|
+
input: raw,
|
|
746
|
+
accountId: params.accountId,
|
|
747
|
+
preferredKind: params.preferredKind
|
|
748
|
+
}));
|
|
749
|
+
if (resolvedFallbackTarget) return {
|
|
750
|
+
ok: true,
|
|
751
|
+
target: resolvedFallbackTarget
|
|
752
|
+
};
|
|
753
|
+
return {
|
|
754
|
+
ok: false,
|
|
755
|
+
error: unknownTargetError(providerLabel, raw, hint)
|
|
756
|
+
};
|
|
757
|
+
}
|
|
758
|
+
async function lookupDirectoryDisplay(params) {
|
|
759
|
+
const normalized = normalizeTargetForProvider(params.channel, params.targetId) ?? params.targetId;
|
|
760
|
+
const [groups, users] = await Promise.all([getDirectoryEntries({
|
|
761
|
+
cfg: params.cfg,
|
|
762
|
+
channel: params.channel,
|
|
763
|
+
accountId: params.accountId,
|
|
764
|
+
kind: "group",
|
|
765
|
+
runtime: params.runtime,
|
|
766
|
+
preferLiveOnMiss: false
|
|
767
|
+
}), getDirectoryEntries({
|
|
768
|
+
cfg: params.cfg,
|
|
769
|
+
channel: params.channel,
|
|
770
|
+
accountId: params.accountId,
|
|
771
|
+
kind: "user",
|
|
772
|
+
runtime: params.runtime,
|
|
773
|
+
preferLiveOnMiss: false
|
|
774
|
+
})]);
|
|
775
|
+
const findMatch = (candidates) => candidates.find((candidate) => normalizeDirectoryEntryId(params.channel, candidate) === normalized);
|
|
776
|
+
const entry = findMatch(groups) ?? findMatch(users);
|
|
777
|
+
return entry?.name ?? entry?.handle ?? void 0;
|
|
778
|
+
}
|
|
779
|
+
//#endregion
|
|
780
|
+
//#region src/infra/outbound/outbound-policy.ts
|
|
781
|
+
const CONTEXT_GUARDED_ACTIONS = new Set([
|
|
782
|
+
"send",
|
|
783
|
+
"poll",
|
|
784
|
+
"reply",
|
|
785
|
+
"sendWithEffect",
|
|
786
|
+
"sendAttachment",
|
|
787
|
+
"upload-file",
|
|
788
|
+
"thread-create",
|
|
789
|
+
"thread-reply",
|
|
790
|
+
"sticker"
|
|
791
|
+
]);
|
|
792
|
+
const CONTEXT_MARKER_ACTIONS = new Set([
|
|
793
|
+
"send",
|
|
794
|
+
"poll",
|
|
795
|
+
"reply",
|
|
796
|
+
"sendWithEffect",
|
|
797
|
+
"sendAttachment",
|
|
798
|
+
"upload-file",
|
|
799
|
+
"thread-reply",
|
|
800
|
+
"sticker"
|
|
801
|
+
]);
|
|
802
|
+
function resolveContextGuardTarget(action, params) {
|
|
803
|
+
if (!CONTEXT_GUARDED_ACTIONS.has(action)) return;
|
|
804
|
+
if (action === "thread-reply" || action === "thread-create") {
|
|
805
|
+
if (typeof params.channelId === "string") return params.channelId;
|
|
806
|
+
if (typeof params.to === "string") return params.to;
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
809
|
+
if (typeof params.to === "string") return params.to;
|
|
810
|
+
if (typeof params.channelId === "string") return params.channelId;
|
|
811
|
+
}
|
|
812
|
+
function normalizeTarget(channel, raw) {
|
|
813
|
+
return normalizeTargetForProvider(channel, raw) ?? raw.trim();
|
|
814
|
+
}
|
|
815
|
+
function isCrossContextTarget(params) {
|
|
816
|
+
const currentTarget = params.toolContext?.currentChannelId?.trim();
|
|
817
|
+
if (!currentTarget) return false;
|
|
818
|
+
const normalizedTarget = normalizeTarget(params.channel, params.target);
|
|
819
|
+
const normalizedCurrent = normalizeTarget(params.channel, currentTarget);
|
|
820
|
+
if (!normalizedTarget || !normalizedCurrent) return false;
|
|
821
|
+
return normalizedTarget !== normalizedCurrent;
|
|
822
|
+
}
|
|
823
|
+
function enforceCrossContextPolicy(params) {
|
|
824
|
+
const currentTarget = params.toolContext?.currentChannelId?.trim();
|
|
825
|
+
if (!currentTarget) return;
|
|
826
|
+
if (!CONTEXT_GUARDED_ACTIONS.has(params.action)) return;
|
|
827
|
+
if (params.cfg.tools?.message?.allowCrossContextSend) return;
|
|
828
|
+
const currentProvider = params.toolContext?.currentChannelProvider;
|
|
829
|
+
const allowWithinProvider = params.cfg.tools?.message?.crossContext?.allowWithinProvider !== false;
|
|
830
|
+
const allowAcrossProviders = params.cfg.tools?.message?.crossContext?.allowAcrossProviders === true;
|
|
831
|
+
if (currentProvider && currentProvider !== params.channel) {
|
|
832
|
+
if (!allowAcrossProviders) throw new Error(`Cross-context messaging denied: action=${params.action} target provider "${params.channel}" while bound to "${currentProvider}".`);
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
if (allowWithinProvider) return;
|
|
836
|
+
const target = resolveContextGuardTarget(params.action, params.args);
|
|
837
|
+
if (!target) return;
|
|
838
|
+
if (!isCrossContextTarget({
|
|
839
|
+
channel: params.channel,
|
|
840
|
+
target,
|
|
841
|
+
toolContext: params.toolContext
|
|
842
|
+
})) return;
|
|
843
|
+
throw new Error(`Cross-context messaging denied: action=${params.action} target="${target}" while bound to "${currentTarget}" (channel=${params.channel}).`);
|
|
844
|
+
}
|
|
845
|
+
async function buildCrossContextDecoration(params) {
|
|
846
|
+
if (!params.toolContext?.currentChannelId) return null;
|
|
847
|
+
if (params.toolContext.skipCrossContextDecoration) return null;
|
|
848
|
+
if (!isCrossContextTarget(params)) return null;
|
|
849
|
+
const markerConfig = params.cfg.tools?.message?.crossContext?.marker;
|
|
850
|
+
if (markerConfig?.enabled === false) return null;
|
|
851
|
+
const currentName = await lookupDirectoryDisplay({
|
|
852
|
+
cfg: params.cfg,
|
|
853
|
+
channel: params.channel,
|
|
854
|
+
targetId: params.toolContext.currentChannelId,
|
|
855
|
+
accountId: params.accountId ?? void 0
|
|
856
|
+
}) ?? params.toolContext.currentChannelId;
|
|
857
|
+
const originLabel = formatTargetDisplay({
|
|
858
|
+
channel: params.channel,
|
|
859
|
+
target: params.toolContext.currentChannelId,
|
|
860
|
+
display: currentName
|
|
861
|
+
});
|
|
862
|
+
const prefixTemplate = markerConfig?.prefix ?? "[from {channel}] ";
|
|
863
|
+
const suffixTemplate = markerConfig?.suffix ?? "";
|
|
864
|
+
const prefix = prefixTemplate.replaceAll("{channel}", originLabel);
|
|
865
|
+
const suffix = suffixTemplate.replaceAll("{channel}", originLabel);
|
|
866
|
+
const adapter = getChannelMessageAdapter(params.channel);
|
|
867
|
+
return {
|
|
868
|
+
prefix,
|
|
869
|
+
suffix,
|
|
870
|
+
componentsBuilder: adapter.supportsComponentsV2 ? adapter.buildCrossContextComponents ? (message) => adapter.buildCrossContextComponents({
|
|
871
|
+
originLabel,
|
|
872
|
+
message,
|
|
873
|
+
cfg: params.cfg,
|
|
874
|
+
accountId: params.accountId ?? void 0
|
|
875
|
+
}) : void 0 : void 0
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
function shouldApplyCrossContextMarker(action) {
|
|
879
|
+
return CONTEXT_MARKER_ACTIONS.has(action);
|
|
880
|
+
}
|
|
881
|
+
function applyCrossContextDecoration(params) {
|
|
882
|
+
if (params.preferComponents && params.decoration.componentsBuilder) return {
|
|
883
|
+
message: params.message,
|
|
884
|
+
componentsBuilder: params.decoration.componentsBuilder,
|
|
885
|
+
usedComponents: true
|
|
886
|
+
};
|
|
887
|
+
return {
|
|
888
|
+
message: `${params.decoration.prefix}${params.message}${params.decoration.suffix}`,
|
|
889
|
+
usedComponents: false
|
|
890
|
+
};
|
|
891
|
+
}
|
|
892
|
+
//#endregion
|
|
893
|
+
//#region src/infra/outbound/outbound-send-service.ts
|
|
894
|
+
function collectActionMediaSources(params) {
|
|
895
|
+
const sources = [];
|
|
896
|
+
for (const key of [
|
|
897
|
+
"media",
|
|
898
|
+
"mediaUrl",
|
|
899
|
+
"path",
|
|
900
|
+
"filePath",
|
|
901
|
+
"fileUrl"
|
|
902
|
+
]) {
|
|
903
|
+
const value = params[key];
|
|
904
|
+
if (typeof value === "string" && value.trim()) sources.push(value);
|
|
905
|
+
}
|
|
906
|
+
return sources;
|
|
907
|
+
}
|
|
908
|
+
async function tryHandleWithPluginAction(params) {
|
|
909
|
+
if (params.ctx.dryRun) return null;
|
|
910
|
+
const mediaAccess = resolveAgentScopedOutboundMediaAccess({
|
|
911
|
+
cfg: params.ctx.cfg,
|
|
912
|
+
agentId: params.ctx.agentId ?? params.ctx.mirror?.agentId,
|
|
913
|
+
mediaSources: collectActionMediaSources(params.ctx.params),
|
|
914
|
+
mediaAccess: params.ctx.mediaAccess,
|
|
915
|
+
mediaReadFile: params.ctx.mediaReadFile
|
|
916
|
+
});
|
|
917
|
+
const handled = await dispatchChannelMessageAction({
|
|
918
|
+
channel: params.ctx.channel,
|
|
919
|
+
action: params.action,
|
|
920
|
+
cfg: params.ctx.cfg,
|
|
921
|
+
params: params.ctx.params,
|
|
922
|
+
mediaAccess,
|
|
923
|
+
mediaLocalRoots: mediaAccess.localRoots,
|
|
924
|
+
mediaReadFile: mediaAccess.readFile,
|
|
925
|
+
accountId: params.ctx.accountId ?? void 0,
|
|
926
|
+
gateway: params.ctx.gateway,
|
|
927
|
+
toolContext: params.ctx.toolContext,
|
|
928
|
+
dryRun: params.ctx.dryRun
|
|
929
|
+
});
|
|
930
|
+
if (!handled) return null;
|
|
931
|
+
await params.onHandled?.();
|
|
932
|
+
return {
|
|
933
|
+
handledBy: "plugin",
|
|
934
|
+
payload: extractToolPayload(handled),
|
|
935
|
+
toolResult: handled
|
|
936
|
+
};
|
|
937
|
+
}
|
|
938
|
+
async function executeSendAction(params) {
|
|
939
|
+
throwIfAborted(params.ctx.abortSignal);
|
|
940
|
+
const pluginHandled = await tryHandleWithPluginAction({
|
|
941
|
+
ctx: params.ctx,
|
|
942
|
+
action: "send",
|
|
943
|
+
onHandled: async () => {
|
|
944
|
+
if (!params.ctx.mirror) return;
|
|
945
|
+
const mirrorText = params.ctx.mirror.text ?? params.message;
|
|
946
|
+
const mirrorMediaUrls = params.ctx.mirror.mediaUrls ?? params.mediaUrls ?? (params.mediaUrl ? [params.mediaUrl] : void 0);
|
|
947
|
+
await appendAssistantMessageToSessionTranscript({
|
|
948
|
+
agentId: params.ctx.mirror.agentId,
|
|
949
|
+
sessionKey: params.ctx.mirror.sessionKey,
|
|
950
|
+
text: mirrorText,
|
|
951
|
+
mediaUrls: mirrorMediaUrls,
|
|
952
|
+
idempotencyKey: params.ctx.mirror.idempotencyKey
|
|
953
|
+
});
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
if (pluginHandled) return pluginHandled;
|
|
957
|
+
throwIfAborted(params.ctx.abortSignal);
|
|
958
|
+
const result = await sendMessage({
|
|
959
|
+
cfg: params.ctx.cfg,
|
|
960
|
+
to: params.to,
|
|
961
|
+
content: params.message,
|
|
962
|
+
agentId: params.ctx.agentId,
|
|
963
|
+
mediaUrl: params.mediaUrl || void 0,
|
|
964
|
+
mediaUrls: params.mediaUrls,
|
|
965
|
+
channel: params.ctx.channel || void 0,
|
|
966
|
+
accountId: params.ctx.accountId ?? void 0,
|
|
967
|
+
replyToId: params.replyToId,
|
|
968
|
+
threadId: params.threadId,
|
|
969
|
+
gifPlayback: params.gifPlayback,
|
|
970
|
+
forceDocument: params.forceDocument,
|
|
971
|
+
dryRun: params.ctx.dryRun,
|
|
972
|
+
bestEffort: params.bestEffort ?? void 0,
|
|
973
|
+
deps: params.ctx.deps,
|
|
974
|
+
gateway: params.ctx.gateway,
|
|
975
|
+
mirror: params.ctx.mirror,
|
|
976
|
+
abortSignal: params.ctx.abortSignal,
|
|
977
|
+
silent: params.ctx.silent
|
|
978
|
+
});
|
|
979
|
+
return {
|
|
980
|
+
handledBy: "core",
|
|
981
|
+
payload: result,
|
|
982
|
+
sendResult: result
|
|
983
|
+
};
|
|
984
|
+
}
|
|
985
|
+
async function executePollAction(params) {
|
|
986
|
+
const pluginHandled = await tryHandleWithPluginAction({
|
|
987
|
+
ctx: params.ctx,
|
|
988
|
+
action: "poll"
|
|
989
|
+
});
|
|
990
|
+
if (pluginHandled) return pluginHandled;
|
|
991
|
+
const corePoll = params.resolveCorePoll();
|
|
992
|
+
const result = await sendPoll({
|
|
993
|
+
cfg: params.ctx.cfg,
|
|
994
|
+
to: corePoll.to,
|
|
995
|
+
question: corePoll.question,
|
|
996
|
+
options: corePoll.options,
|
|
997
|
+
maxSelections: corePoll.maxSelections,
|
|
998
|
+
durationSeconds: corePoll.durationSeconds ?? void 0,
|
|
999
|
+
durationHours: corePoll.durationHours ?? void 0,
|
|
1000
|
+
channel: params.ctx.channel,
|
|
1001
|
+
accountId: params.ctx.accountId ?? void 0,
|
|
1002
|
+
threadId: corePoll.threadId ?? void 0,
|
|
1003
|
+
silent: params.ctx.silent ?? void 0,
|
|
1004
|
+
isAnonymous: corePoll.isAnonymous ?? void 0,
|
|
1005
|
+
dryRun: params.ctx.dryRun,
|
|
1006
|
+
gateway: params.ctx.gateway
|
|
1007
|
+
});
|
|
1008
|
+
return {
|
|
1009
|
+
handledBy: "core",
|
|
1010
|
+
payload: result,
|
|
1011
|
+
pollResult: result
|
|
1012
|
+
};
|
|
1013
|
+
}
|
|
1014
|
+
//#endregion
|
|
1015
|
+
//#region src/infra/outbound/outbound-session.ts
|
|
1016
|
+
function resolveOutboundChannelPlugin(channel) {
|
|
1017
|
+
return getChannelPlugin(channel);
|
|
1018
|
+
}
|
|
1019
|
+
function stripProviderPrefix(raw, channel) {
|
|
1020
|
+
const trimmed = raw.trim();
|
|
1021
|
+
const lower = normalizeLowercaseStringOrEmpty(trimmed);
|
|
1022
|
+
const prefix = `${normalizeLowercaseStringOrEmpty(channel)}:`;
|
|
1023
|
+
if (lower.startsWith(prefix)) return trimmed.slice(prefix.length).trim();
|
|
1024
|
+
return trimmed;
|
|
1025
|
+
}
|
|
1026
|
+
function stripKindPrefix(raw) {
|
|
1027
|
+
return raw.replace(/^(user|channel|group|conversation|room|dm):/i, "").trim();
|
|
1028
|
+
}
|
|
1029
|
+
function inferPeerKind(params) {
|
|
1030
|
+
const resolvedKind = params.resolvedTarget?.kind;
|
|
1031
|
+
if (resolvedKind === "user") return "direct";
|
|
1032
|
+
if (resolvedKind === "channel") return "channel";
|
|
1033
|
+
if (resolvedKind === "group") {
|
|
1034
|
+
const chatTypes = resolveOutboundChannelPlugin(params.channel)?.capabilities?.chatTypes ?? [];
|
|
1035
|
+
const supportsChannel = chatTypes.includes("channel");
|
|
1036
|
+
const supportsGroup = chatTypes.includes("group");
|
|
1037
|
+
if (supportsChannel && !supportsGroup) return "channel";
|
|
1038
|
+
return "group";
|
|
1039
|
+
}
|
|
1040
|
+
return "direct";
|
|
1041
|
+
}
|
|
1042
|
+
function buildBaseSessionKey(params) {
|
|
1043
|
+
return buildAgentSessionKey({
|
|
1044
|
+
agentId: params.agentId,
|
|
1045
|
+
channel: params.channel,
|
|
1046
|
+
accountId: params.accountId,
|
|
1047
|
+
peer: params.peer,
|
|
1048
|
+
dmScope: params.cfg.session?.dmScope ?? "main",
|
|
1049
|
+
identityLinks: params.cfg.session?.identityLinks
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
function resolveFallbackSession(params) {
|
|
1053
|
+
const trimmed = stripProviderPrefix(params.target, params.channel).trim();
|
|
1054
|
+
if (!trimmed) return null;
|
|
1055
|
+
const peerKind = inferPeerKind({
|
|
1056
|
+
channel: params.channel,
|
|
1057
|
+
resolvedTarget: params.resolvedTarget
|
|
1058
|
+
});
|
|
1059
|
+
const peerId = stripKindPrefix(trimmed);
|
|
1060
|
+
if (!peerId) return null;
|
|
1061
|
+
const peer = {
|
|
1062
|
+
kind: peerKind,
|
|
1063
|
+
id: peerId
|
|
1064
|
+
};
|
|
1065
|
+
const baseSessionKey = buildBaseSessionKey({
|
|
1066
|
+
cfg: params.cfg,
|
|
1067
|
+
agentId: params.agentId,
|
|
1068
|
+
channel: params.channel,
|
|
1069
|
+
accountId: params.accountId,
|
|
1070
|
+
peer
|
|
1071
|
+
});
|
|
1072
|
+
return {
|
|
1073
|
+
sessionKey: baseSessionKey,
|
|
1074
|
+
baseSessionKey,
|
|
1075
|
+
peer,
|
|
1076
|
+
chatType: peerKind === "direct" ? "direct" : peerKind === "channel" ? "channel" : "group",
|
|
1077
|
+
from: peerKind === "direct" ? `${params.channel}:${peerId}` : `${params.channel}:${peerKind}:${peerId}`,
|
|
1078
|
+
to: `${peerKind === "direct" ? "user" : "channel"}:${peerId}`
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
async function resolveOutboundSessionRoute(params) {
|
|
1082
|
+
const target = params.target.trim();
|
|
1083
|
+
if (!target) return null;
|
|
1084
|
+
const nextParams = {
|
|
1085
|
+
...params,
|
|
1086
|
+
target
|
|
1087
|
+
};
|
|
1088
|
+
const resolver = resolveOutboundChannelPlugin(params.channel)?.messaging?.resolveOutboundSessionRoute;
|
|
1089
|
+
if (resolver) return await resolver(nextParams);
|
|
1090
|
+
return resolveFallbackSession(nextParams);
|
|
1091
|
+
}
|
|
1092
|
+
async function ensureOutboundSessionEntry(params) {
|
|
1093
|
+
const storePath = resolveStorePath(params.cfg.session?.store, { agentId: resolveAgentIdFromSessionKey(params.route.sessionKey) });
|
|
1094
|
+
const ctx = {
|
|
1095
|
+
From: params.route.from,
|
|
1096
|
+
To: params.route.to,
|
|
1097
|
+
SessionKey: params.route.sessionKey,
|
|
1098
|
+
AccountId: params.accountId ?? void 0,
|
|
1099
|
+
ChatType: params.route.chatType,
|
|
1100
|
+
Provider: params.channel,
|
|
1101
|
+
Surface: params.channel,
|
|
1102
|
+
MessageThreadId: params.route.threadId,
|
|
1103
|
+
OriginatingChannel: params.channel,
|
|
1104
|
+
OriginatingTo: params.route.to
|
|
1105
|
+
};
|
|
1106
|
+
try {
|
|
1107
|
+
await recordSessionMetaFromInbound({
|
|
1108
|
+
storePath,
|
|
1109
|
+
sessionKey: params.route.sessionKey,
|
|
1110
|
+
ctx
|
|
1111
|
+
});
|
|
1112
|
+
} catch {}
|
|
1113
|
+
}
|
|
1114
|
+
//#endregion
|
|
1115
|
+
//#region src/infra/outbound/message-action-runner.ts
|
|
1116
|
+
function getToolResult(result) {
|
|
1117
|
+
return "toolResult" in result ? result.toolResult : void 0;
|
|
1118
|
+
}
|
|
1119
|
+
function collectActionMediaSourceHints(params) {
|
|
1120
|
+
const sources = [];
|
|
1121
|
+
for (const key of [
|
|
1122
|
+
"media",
|
|
1123
|
+
"mediaUrl",
|
|
1124
|
+
"path",
|
|
1125
|
+
"filePath",
|
|
1126
|
+
"fileUrl"
|
|
1127
|
+
]) {
|
|
1128
|
+
const source = typeof params[key] === "string" ? params[key] : void 0;
|
|
1129
|
+
if (normalizeOptionalString(source) && source) sources.push(source);
|
|
1130
|
+
}
|
|
1131
|
+
return sources;
|
|
1132
|
+
}
|
|
1133
|
+
function applyCrossContextMessageDecoration({ params, message, decoration, preferComponents }) {
|
|
1134
|
+
const applied = applyCrossContextDecoration({
|
|
1135
|
+
message,
|
|
1136
|
+
decoration,
|
|
1137
|
+
preferComponents
|
|
1138
|
+
});
|
|
1139
|
+
params.message = applied.message;
|
|
1140
|
+
if (applied.componentsBuilder) params.components = applied.componentsBuilder;
|
|
1141
|
+
return applied.message;
|
|
1142
|
+
}
|
|
1143
|
+
async function maybeApplyCrossContextMarker(params) {
|
|
1144
|
+
if (!shouldApplyCrossContextMarker(params.action) || !params.toolContext) return params.message;
|
|
1145
|
+
const decoration = await buildCrossContextDecoration({
|
|
1146
|
+
cfg: params.cfg,
|
|
1147
|
+
channel: params.channel,
|
|
1148
|
+
target: params.target,
|
|
1149
|
+
toolContext: params.toolContext,
|
|
1150
|
+
accountId: params.accountId ?? void 0
|
|
1151
|
+
});
|
|
1152
|
+
if (!decoration) return params.message;
|
|
1153
|
+
return applyCrossContextMessageDecoration({
|
|
1154
|
+
params: params.args,
|
|
1155
|
+
message: params.message,
|
|
1156
|
+
decoration,
|
|
1157
|
+
preferComponents: params.preferComponents
|
|
1158
|
+
});
|
|
1159
|
+
}
|
|
1160
|
+
async function resolveChannel(cfg, params, toolContext) {
|
|
1161
|
+
const selection = await resolveMessageChannelSelection({
|
|
1162
|
+
cfg,
|
|
1163
|
+
channel: readStringParam(params, "channel"),
|
|
1164
|
+
fallbackChannel: toolContext?.currentChannelProvider
|
|
1165
|
+
});
|
|
1166
|
+
if (selection.source === "tool-context-fallback") params.channel = selection.channel;
|
|
1167
|
+
return selection.channel;
|
|
1168
|
+
}
|
|
1169
|
+
async function resolveActionTarget(params) {
|
|
1170
|
+
let resolvedTarget;
|
|
1171
|
+
const toRaw = normalizeOptionalString(params.args.to) ?? "";
|
|
1172
|
+
if (toRaw) {
|
|
1173
|
+
const resolved = await resolveResolvedTargetOrThrow({
|
|
1174
|
+
cfg: params.cfg,
|
|
1175
|
+
channel: params.channel,
|
|
1176
|
+
input: toRaw,
|
|
1177
|
+
accountId: params.accountId ?? void 0
|
|
1178
|
+
});
|
|
1179
|
+
params.args.to = resolved.to;
|
|
1180
|
+
resolvedTarget = resolved;
|
|
1181
|
+
}
|
|
1182
|
+
const channelIdRaw = normalizeOptionalString(params.args.channelId) ?? "";
|
|
1183
|
+
if (channelIdRaw) {
|
|
1184
|
+
const resolved = await resolveResolvedTargetOrThrow({
|
|
1185
|
+
cfg: params.cfg,
|
|
1186
|
+
channel: params.channel,
|
|
1187
|
+
input: channelIdRaw,
|
|
1188
|
+
accountId: params.accountId ?? void 0,
|
|
1189
|
+
preferredKind: "group",
|
|
1190
|
+
validateResolvedTarget: (target) => target.kind === "user" ? `Channel id "${channelIdRaw}" resolved to a user target.` : void 0
|
|
1191
|
+
});
|
|
1192
|
+
params.args.channelId = sanitizeGroupTargetId(resolved.to);
|
|
1193
|
+
}
|
|
1194
|
+
return resolvedTarget;
|
|
1195
|
+
}
|
|
1196
|
+
function sanitizeGroupTargetId(target) {
|
|
1197
|
+
return target.replace(/^(channel|group):/i, "");
|
|
1198
|
+
}
|
|
1199
|
+
async function resolveResolvedTargetOrThrow(params) {
|
|
1200
|
+
const resolved = await resolveChannelTarget({
|
|
1201
|
+
cfg: params.cfg,
|
|
1202
|
+
channel: params.channel,
|
|
1203
|
+
input: params.input,
|
|
1204
|
+
accountId: params.accountId,
|
|
1205
|
+
preferredKind: params.preferredKind
|
|
1206
|
+
});
|
|
1207
|
+
if (!resolved.ok) throw resolved.error;
|
|
1208
|
+
const validationError = params.validateResolvedTarget?.(resolved.target);
|
|
1209
|
+
if (validationError) throw new Error(validationError);
|
|
1210
|
+
return resolved.target;
|
|
1211
|
+
}
|
|
1212
|
+
function resolveGateway(input) {
|
|
1213
|
+
if (!input.gateway) return;
|
|
1214
|
+
return {
|
|
1215
|
+
url: input.gateway.url,
|
|
1216
|
+
token: input.gateway.token,
|
|
1217
|
+
timeoutMs: input.gateway.timeoutMs,
|
|
1218
|
+
clientName: input.gateway.clientName,
|
|
1219
|
+
clientDisplayName: input.gateway.clientDisplayName,
|
|
1220
|
+
mode: input.gateway.mode
|
|
1221
|
+
};
|
|
1222
|
+
}
|
|
1223
|
+
async function handleBroadcastAction(input, params) {
|
|
1224
|
+
throwIfAborted(input.abortSignal);
|
|
1225
|
+
if (!(input.cfg.tools?.message?.broadcast?.enabled !== false)) throw new Error("Broadcast is disabled. Set tools.message.broadcast.enabled to true.");
|
|
1226
|
+
const rawTargets = readStringArrayParam(params, "targets", { required: true });
|
|
1227
|
+
if (rawTargets.length === 0) throw new Error("Broadcast requires at least one target in --targets.");
|
|
1228
|
+
const channelHint = readStringParam(params, "channel");
|
|
1229
|
+
const targetChannels = channelHint && normalizeOptionalLowercaseString(channelHint) !== "all" ? [await resolveChannel(input.cfg, { channel: channelHint }, input.toolContext)] : await (async () => {
|
|
1230
|
+
const configured = await listConfiguredMessageChannels(input.cfg);
|
|
1231
|
+
if (configured.length === 0) throw new Error("Broadcast requires at least one configured channel.");
|
|
1232
|
+
return configured;
|
|
1233
|
+
})();
|
|
1234
|
+
const results = [];
|
|
1235
|
+
const isAbortError = (err) => err instanceof Error && err.name === "AbortError";
|
|
1236
|
+
for (const targetChannel of targetChannels) {
|
|
1237
|
+
throwIfAborted(input.abortSignal);
|
|
1238
|
+
for (const target of rawTargets) {
|
|
1239
|
+
throwIfAborted(input.abortSignal);
|
|
1240
|
+
try {
|
|
1241
|
+
const resolved = await resolveResolvedTargetOrThrow({
|
|
1242
|
+
cfg: input.cfg,
|
|
1243
|
+
channel: targetChannel,
|
|
1244
|
+
input: target
|
|
1245
|
+
});
|
|
1246
|
+
const sendResult = await runMessageAction({
|
|
1247
|
+
...input,
|
|
1248
|
+
action: "send",
|
|
1249
|
+
params: {
|
|
1250
|
+
...params,
|
|
1251
|
+
channel: targetChannel,
|
|
1252
|
+
target: resolved.to
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
1255
|
+
results.push({
|
|
1256
|
+
channel: targetChannel,
|
|
1257
|
+
to: resolved.to,
|
|
1258
|
+
ok: true,
|
|
1259
|
+
result: sendResult.kind === "send" ? sendResult.sendResult : void 0
|
|
1260
|
+
});
|
|
1261
|
+
} catch (err) {
|
|
1262
|
+
if (isAbortError(err)) throw err;
|
|
1263
|
+
results.push({
|
|
1264
|
+
channel: targetChannel,
|
|
1265
|
+
to: target,
|
|
1266
|
+
ok: false,
|
|
1267
|
+
error: formatErrorMessage(err)
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
}
|
|
1272
|
+
return {
|
|
1273
|
+
kind: "broadcast",
|
|
1274
|
+
channel: targetChannels[0] ?? normalizeOptionalLowercaseString(channelHint) ?? "unknown",
|
|
1275
|
+
action: "broadcast",
|
|
1276
|
+
handledBy: input.dryRun ? "dry-run" : "core",
|
|
1277
|
+
payload: { results },
|
|
1278
|
+
dryRun: Boolean(input.dryRun)
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
async function handleSendAction(ctx) {
|
|
1282
|
+
const { cfg, params, channel, accountId, dryRun, gateway, input, agentId, resolvedTarget, abortSignal } = ctx;
|
|
1283
|
+
throwIfAborted(abortSignal);
|
|
1284
|
+
const action = "send";
|
|
1285
|
+
const to = readStringParam(params, "to", { required: true });
|
|
1286
|
+
const mediaHint = readStringParam(params, "media", { trim: false }) ?? readStringParam(params, "mediaUrl", { trim: false }) ?? readStringParam(params, "path", { trim: false }) ?? readStringParam(params, "filePath", { trim: false }) ?? readStringParam(params, "fileUrl", { trim: false });
|
|
1287
|
+
const hasButtons = Array.isArray(params.buttons) && params.buttons.length > 0;
|
|
1288
|
+
const hasCard = params.card != null && typeof params.card === "object";
|
|
1289
|
+
const hasComponents = params.components != null && typeof params.components === "object";
|
|
1290
|
+
const hasInteractive = hasInteractiveReplyBlocks(params.interactive);
|
|
1291
|
+
const hasBlocks = Array.isArray(params.blocks) && params.blocks.length > 0 || typeof params.blocks === "string" && params.blocks.trim().length > 0;
|
|
1292
|
+
const caption = readStringParam(params, "caption", { allowEmpty: true }) ?? "";
|
|
1293
|
+
let message = readStringParam(params, "message", {
|
|
1294
|
+
required: !mediaHint && !hasButtons && !hasCard && !hasComponents && !hasInteractive && !hasBlocks,
|
|
1295
|
+
allowEmpty: true
|
|
1296
|
+
}) ?? "";
|
|
1297
|
+
if (message.includes("\\n")) message = message.replaceAll("\\n", "\n");
|
|
1298
|
+
if (!message.trim() && caption.trim()) message = caption;
|
|
1299
|
+
const parsed = parseReplyDirectives(message);
|
|
1300
|
+
const mergedMediaUrls = [];
|
|
1301
|
+
const seenMedia = /* @__PURE__ */ new Set();
|
|
1302
|
+
const pushMedia = (value) => {
|
|
1303
|
+
const trimmed = normalizeOptionalString(value);
|
|
1304
|
+
if (!trimmed) return;
|
|
1305
|
+
if (seenMedia.has(trimmed)) return;
|
|
1306
|
+
seenMedia.add(trimmed);
|
|
1307
|
+
mergedMediaUrls.push(trimmed);
|
|
1308
|
+
};
|
|
1309
|
+
pushMedia(mediaHint);
|
|
1310
|
+
for (const url of parsed.mediaUrls ?? []) pushMedia(url);
|
|
1311
|
+
pushMedia(parsed.mediaUrl);
|
|
1312
|
+
const normalizedMediaUrls = await normalizeSandboxMediaList({
|
|
1313
|
+
values: mergedMediaUrls,
|
|
1314
|
+
sandboxRoot: input.sandboxRoot
|
|
1315
|
+
});
|
|
1316
|
+
mergedMediaUrls.length = 0;
|
|
1317
|
+
mergedMediaUrls.push(...normalizedMediaUrls);
|
|
1318
|
+
message = parsed.text;
|
|
1319
|
+
params.message = message;
|
|
1320
|
+
if (!params.replyTo && parsed.replyToId) params.replyTo = parsed.replyToId;
|
|
1321
|
+
if (!params.media) params.media = mergedMediaUrls[0] || void 0;
|
|
1322
|
+
message = await maybeApplyCrossContextMarker({
|
|
1323
|
+
cfg,
|
|
1324
|
+
channel,
|
|
1325
|
+
action,
|
|
1326
|
+
target: to,
|
|
1327
|
+
toolContext: input.toolContext,
|
|
1328
|
+
accountId,
|
|
1329
|
+
args: params,
|
|
1330
|
+
message,
|
|
1331
|
+
preferComponents: true
|
|
1332
|
+
});
|
|
1333
|
+
const mediaUrl = readStringParam(params, "media", { trim: false });
|
|
1334
|
+
if (!hasReplyPayloadContent({
|
|
1335
|
+
text: message,
|
|
1336
|
+
mediaUrl,
|
|
1337
|
+
mediaUrls: mergedMediaUrls,
|
|
1338
|
+
interactive: params.interactive
|
|
1339
|
+
}, { extraContent: hasButtons || hasCard || hasComponents || hasBlocks })) throw new Error("send requires text or media");
|
|
1340
|
+
params.message = message;
|
|
1341
|
+
const gifPlayback = readBooleanParam(params, "gifPlayback") ?? false;
|
|
1342
|
+
const forceDocument = readBooleanParam(params, "forceDocument") ?? readBooleanParam(params, "asDocument") ?? false;
|
|
1343
|
+
const bestEffort = readBooleanParam(params, "bestEffort");
|
|
1344
|
+
const silent = readBooleanParam(params, "silent");
|
|
1345
|
+
const replyToId = readStringParam(params, "replyTo");
|
|
1346
|
+
const { resolvedThreadId, outboundRoute } = await prepareOutboundMirrorRoute({
|
|
1347
|
+
cfg,
|
|
1348
|
+
channel,
|
|
1349
|
+
to,
|
|
1350
|
+
actionParams: params,
|
|
1351
|
+
accountId,
|
|
1352
|
+
toolContext: input.toolContext,
|
|
1353
|
+
agentId,
|
|
1354
|
+
currentSessionKey: input.sessionKey,
|
|
1355
|
+
dryRun,
|
|
1356
|
+
resolvedTarget,
|
|
1357
|
+
resolveAutoThreadId: getChannelPlugin(channel)?.threading?.resolveAutoThreadId,
|
|
1358
|
+
resolveOutboundSessionRoute,
|
|
1359
|
+
ensureOutboundSessionEntry
|
|
1360
|
+
});
|
|
1361
|
+
const mirrorMediaUrls = mergedMediaUrls.length > 0 ? mergedMediaUrls : mediaUrl ? [mediaUrl] : void 0;
|
|
1362
|
+
throwIfAborted(abortSignal);
|
|
1363
|
+
const send = await executeSendAction({
|
|
1364
|
+
ctx: {
|
|
1365
|
+
cfg,
|
|
1366
|
+
channel,
|
|
1367
|
+
params,
|
|
1368
|
+
agentId,
|
|
1369
|
+
mediaAccess: ctx.mediaAccess,
|
|
1370
|
+
accountId: accountId ?? void 0,
|
|
1371
|
+
gateway,
|
|
1372
|
+
toolContext: input.toolContext,
|
|
1373
|
+
deps: input.deps,
|
|
1374
|
+
dryRun,
|
|
1375
|
+
mirror: outboundRoute && !dryRun ? {
|
|
1376
|
+
sessionKey: outboundRoute.sessionKey,
|
|
1377
|
+
agentId,
|
|
1378
|
+
text: message,
|
|
1379
|
+
mediaUrls: mirrorMediaUrls
|
|
1380
|
+
} : void 0,
|
|
1381
|
+
abortSignal,
|
|
1382
|
+
silent: silent ?? void 0
|
|
1383
|
+
},
|
|
1384
|
+
to,
|
|
1385
|
+
message,
|
|
1386
|
+
mediaUrl: mediaUrl || void 0,
|
|
1387
|
+
mediaUrls: mergedMediaUrls.length ? mergedMediaUrls : void 0,
|
|
1388
|
+
gifPlayback,
|
|
1389
|
+
forceDocument,
|
|
1390
|
+
bestEffort: bestEffort ?? void 0,
|
|
1391
|
+
replyToId: replyToId ?? void 0,
|
|
1392
|
+
threadId: resolvedThreadId ?? void 0
|
|
1393
|
+
});
|
|
1394
|
+
return {
|
|
1395
|
+
kind: "send",
|
|
1396
|
+
channel,
|
|
1397
|
+
action,
|
|
1398
|
+
to,
|
|
1399
|
+
handledBy: send.handledBy,
|
|
1400
|
+
payload: send.payload,
|
|
1401
|
+
toolResult: send.toolResult,
|
|
1402
|
+
sendResult: send.sendResult,
|
|
1403
|
+
dryRun
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
async function handlePollAction(ctx) {
|
|
1407
|
+
const { cfg, params, channel, accountId, dryRun, gateway, input, abortSignal } = ctx;
|
|
1408
|
+
throwIfAborted(abortSignal);
|
|
1409
|
+
const action = "poll";
|
|
1410
|
+
const to = readStringParam(params, "to", { required: true });
|
|
1411
|
+
const silent = readBooleanParam(params, "silent");
|
|
1412
|
+
const resolvedThreadId = resolveAndApplyOutboundThreadId(params, {
|
|
1413
|
+
cfg,
|
|
1414
|
+
to,
|
|
1415
|
+
accountId,
|
|
1416
|
+
toolContext: input.toolContext,
|
|
1417
|
+
resolveAutoThreadId: getChannelPlugin(channel)?.threading?.resolveAutoThreadId
|
|
1418
|
+
});
|
|
1419
|
+
const base = typeof params.message === "string" ? params.message : "";
|
|
1420
|
+
await maybeApplyCrossContextMarker({
|
|
1421
|
+
cfg,
|
|
1422
|
+
channel,
|
|
1423
|
+
action,
|
|
1424
|
+
target: to,
|
|
1425
|
+
toolContext: input.toolContext,
|
|
1426
|
+
accountId,
|
|
1427
|
+
args: params,
|
|
1428
|
+
message: base,
|
|
1429
|
+
preferComponents: false
|
|
1430
|
+
});
|
|
1431
|
+
const poll = await executePollAction({
|
|
1432
|
+
ctx: {
|
|
1433
|
+
cfg,
|
|
1434
|
+
channel,
|
|
1435
|
+
params,
|
|
1436
|
+
accountId: accountId ?? void 0,
|
|
1437
|
+
gateway,
|
|
1438
|
+
toolContext: input.toolContext,
|
|
1439
|
+
dryRun,
|
|
1440
|
+
silent: silent ?? void 0
|
|
1441
|
+
},
|
|
1442
|
+
resolveCorePoll: () => {
|
|
1443
|
+
const question = readStringParam(params, "pollQuestion", { required: true });
|
|
1444
|
+
const options = readStringArrayParam(params, "pollOption", { required: true });
|
|
1445
|
+
if (options.length < 2) throw new Error("pollOption requires at least two values");
|
|
1446
|
+
const allowMultiselect = readBooleanParam(params, "pollMulti") ?? false;
|
|
1447
|
+
const durationHours = readNumberParam(params, "pollDurationHours", {
|
|
1448
|
+
integer: true,
|
|
1449
|
+
strict: true
|
|
1450
|
+
});
|
|
1451
|
+
return {
|
|
1452
|
+
to,
|
|
1453
|
+
question,
|
|
1454
|
+
options,
|
|
1455
|
+
maxSelections: resolvePollMaxSelections(options.length, allowMultiselect),
|
|
1456
|
+
durationHours: durationHours ?? void 0,
|
|
1457
|
+
threadId: resolvedThreadId ?? void 0
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
});
|
|
1461
|
+
return {
|
|
1462
|
+
kind: "poll",
|
|
1463
|
+
channel,
|
|
1464
|
+
action,
|
|
1465
|
+
to,
|
|
1466
|
+
handledBy: poll.handledBy,
|
|
1467
|
+
payload: poll.payload,
|
|
1468
|
+
toolResult: poll.toolResult,
|
|
1469
|
+
pollResult: poll.pollResult,
|
|
1470
|
+
dryRun
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
async function handlePluginAction(ctx) {
|
|
1474
|
+
const { cfg, params, channel, mediaAccess, accountId, dryRun, gateway, input, abortSignal, agentId } = ctx;
|
|
1475
|
+
throwIfAborted(abortSignal);
|
|
1476
|
+
const action = input.action;
|
|
1477
|
+
if (dryRun) return {
|
|
1478
|
+
kind: "action",
|
|
1479
|
+
channel,
|
|
1480
|
+
action,
|
|
1481
|
+
handledBy: "dry-run",
|
|
1482
|
+
payload: {
|
|
1483
|
+
ok: true,
|
|
1484
|
+
dryRun: true,
|
|
1485
|
+
channel,
|
|
1486
|
+
action
|
|
1487
|
+
},
|
|
1488
|
+
dryRun: true
|
|
1489
|
+
};
|
|
1490
|
+
if (!resolveOutboundChannelPlugin$1({
|
|
1491
|
+
channel,
|
|
1492
|
+
cfg
|
|
1493
|
+
})?.actions?.handleAction) throw new Error(`Channel ${channel} is unavailable for message actions (plugin not loaded).`);
|
|
1494
|
+
const handled = await dispatchChannelMessageAction({
|
|
1495
|
+
channel,
|
|
1496
|
+
action,
|
|
1497
|
+
cfg,
|
|
1498
|
+
params,
|
|
1499
|
+
mediaAccess,
|
|
1500
|
+
mediaLocalRoots: mediaAccess.localRoots,
|
|
1501
|
+
mediaReadFile: mediaAccess.readFile,
|
|
1502
|
+
accountId: accountId ?? void 0,
|
|
1503
|
+
requesterSenderId: input.requesterSenderId ?? void 0,
|
|
1504
|
+
sessionKey: input.sessionKey,
|
|
1505
|
+
sessionId: input.sessionId,
|
|
1506
|
+
agentId,
|
|
1507
|
+
gateway,
|
|
1508
|
+
toolContext: input.toolContext,
|
|
1509
|
+
dryRun
|
|
1510
|
+
});
|
|
1511
|
+
if (!handled) throw new Error(`Message action ${action} not supported for channel ${channel}.`);
|
|
1512
|
+
return {
|
|
1513
|
+
kind: "action",
|
|
1514
|
+
channel,
|
|
1515
|
+
action,
|
|
1516
|
+
handledBy: "plugin",
|
|
1517
|
+
payload: extractToolPayload(handled),
|
|
1518
|
+
toolResult: handled,
|
|
1519
|
+
dryRun
|
|
1520
|
+
};
|
|
1521
|
+
}
|
|
1522
|
+
async function runMessageAction(input) {
|
|
1523
|
+
const cfg = input.cfg;
|
|
1524
|
+
let params = { ...input.params };
|
|
1525
|
+
const resolvedAgentId = input.agentId ?? (input.sessionKey ? resolveSessionAgentId({
|
|
1526
|
+
sessionKey: input.sessionKey,
|
|
1527
|
+
config: cfg
|
|
1528
|
+
}) : void 0);
|
|
1529
|
+
parseButtonsParam(params);
|
|
1530
|
+
parseCardParam(params);
|
|
1531
|
+
parseComponentsParam(params);
|
|
1532
|
+
parseInteractiveParam(params);
|
|
1533
|
+
const action = input.action;
|
|
1534
|
+
if (action === "broadcast") return handleBroadcastAction(input, params);
|
|
1535
|
+
params = normalizeMessageActionInput({
|
|
1536
|
+
action,
|
|
1537
|
+
args: params,
|
|
1538
|
+
toolContext: input.toolContext
|
|
1539
|
+
});
|
|
1540
|
+
const channel = await resolveChannel(cfg, params, input.toolContext);
|
|
1541
|
+
let accountId = readStringParam(params, "accountId") ?? input.defaultAccountId;
|
|
1542
|
+
if (!accountId && resolvedAgentId) {
|
|
1543
|
+
const boundAccountIds = buildChannelAccountBindings(cfg).get(channel)?.get(normalizeAgentId(resolvedAgentId));
|
|
1544
|
+
if (boundAccountIds && boundAccountIds.length > 0) accountId = boundAccountIds[0];
|
|
1545
|
+
}
|
|
1546
|
+
if (accountId) params.accountId = accountId;
|
|
1547
|
+
const dryRun = Boolean(input.dryRun ?? readBooleanParam(params, "dryRun"));
|
|
1548
|
+
const normalizationPolicy = resolveAttachmentMediaPolicy({
|
|
1549
|
+
sandboxRoot: input.sandboxRoot,
|
|
1550
|
+
mediaLocalRoots: getAgentScopedMediaLocalRoots(cfg, resolvedAgentId)
|
|
1551
|
+
});
|
|
1552
|
+
await normalizeSandboxMediaParams({
|
|
1553
|
+
args: params,
|
|
1554
|
+
mediaPolicy: normalizationPolicy
|
|
1555
|
+
});
|
|
1556
|
+
const mediaAccess = resolveAgentScopedOutboundMediaAccess({
|
|
1557
|
+
cfg,
|
|
1558
|
+
agentId: resolvedAgentId,
|
|
1559
|
+
mediaSources: collectActionMediaSourceHints(params)
|
|
1560
|
+
});
|
|
1561
|
+
const mediaPolicy = resolveAttachmentMediaPolicy({
|
|
1562
|
+
sandboxRoot: input.sandboxRoot,
|
|
1563
|
+
mediaAccess
|
|
1564
|
+
});
|
|
1565
|
+
await hydrateAttachmentParamsForAction({
|
|
1566
|
+
cfg,
|
|
1567
|
+
channel,
|
|
1568
|
+
accountId,
|
|
1569
|
+
args: params,
|
|
1570
|
+
action,
|
|
1571
|
+
dryRun,
|
|
1572
|
+
mediaPolicy
|
|
1573
|
+
});
|
|
1574
|
+
const resolvedTarget = await resolveActionTarget({
|
|
1575
|
+
cfg,
|
|
1576
|
+
channel,
|
|
1577
|
+
action,
|
|
1578
|
+
args: params,
|
|
1579
|
+
accountId
|
|
1580
|
+
});
|
|
1581
|
+
enforceCrossContextPolicy({
|
|
1582
|
+
channel,
|
|
1583
|
+
action,
|
|
1584
|
+
args: params,
|
|
1585
|
+
toolContext: input.toolContext,
|
|
1586
|
+
cfg
|
|
1587
|
+
});
|
|
1588
|
+
if (action === "send" && hasPollCreationParams(params)) throw new Error("Poll fields require action \"poll\"; use action \"poll\" instead of \"send\".");
|
|
1589
|
+
const gateway = resolveGateway(input);
|
|
1590
|
+
if (action === "send") return handleSendAction({
|
|
1591
|
+
cfg,
|
|
1592
|
+
params,
|
|
1593
|
+
channel,
|
|
1594
|
+
mediaAccess,
|
|
1595
|
+
accountId,
|
|
1596
|
+
dryRun,
|
|
1597
|
+
gateway,
|
|
1598
|
+
input,
|
|
1599
|
+
agentId: resolvedAgentId,
|
|
1600
|
+
resolvedTarget,
|
|
1601
|
+
abortSignal: input.abortSignal
|
|
1602
|
+
});
|
|
1603
|
+
if (action === "poll") return handlePollAction({
|
|
1604
|
+
cfg,
|
|
1605
|
+
params,
|
|
1606
|
+
channel,
|
|
1607
|
+
mediaAccess,
|
|
1608
|
+
accountId,
|
|
1609
|
+
dryRun,
|
|
1610
|
+
gateway,
|
|
1611
|
+
input,
|
|
1612
|
+
abortSignal: input.abortSignal
|
|
1613
|
+
});
|
|
1614
|
+
return handlePluginAction({
|
|
1615
|
+
cfg,
|
|
1616
|
+
params,
|
|
1617
|
+
channel,
|
|
1618
|
+
mediaAccess,
|
|
1619
|
+
accountId,
|
|
1620
|
+
dryRun,
|
|
1621
|
+
gateway,
|
|
1622
|
+
input,
|
|
1623
|
+
agentId: resolvedAgentId,
|
|
1624
|
+
abortSignal: input.abortSignal
|
|
1625
|
+
});
|
|
1626
|
+
}
|
|
1627
|
+
//#endregion
|
|
1628
|
+
export { formatTargetDisplay as a, POLL_CREATION_PARAM_DEFS as c, resolveOutboundSessionRoute as i, SHARED_POLL_CREATION_PARAM_NAMES as l, runMessageAction as n, maybeResolveIdLikeTarget as o, ensureOutboundSessionEntry as r, resetDirectoryCache as s, getToolResult as t };
|