activeclaw 2026.2.12 → 2026.2.13
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/CHANGELOG.md +37 -0
- package/dist/{accounts-DbzMEfKN.js → accounts-DCDeFTra.js} +2 -2
- package/dist/{accounts-DimKrt7j.js → accounts-DeqIQjo1.js} +2 -2
- package/dist/{acp-cli-Cs1ai4XO.js → acp-cli-CeYI4XRd.js} +15 -16
- package/dist/{acp-cli-oV2dodPg.js → acp-cli-rNbGXICg.js} +14 -15
- package/dist/{agent-BndgzkUe.js → agent-BvNJF5QL.js} +19 -16
- package/dist/{agent-DZvDwqnd.js → agent-CyMxTyrG.js} +20 -17
- package/dist/{agent-scope-rXQ7WARN.js → agent-scope-BIEhVP4_.js} +1 -1
- package/dist/{agent-scope---6LLHj0.js → agent-scope-CQCus0rI.js} +2 -2
- package/dist/{agent-scope-RCSw6gHy.js → agent-scope-CsRbLH4l.js} +3 -3
- package/dist/{agent-scope-CN8DM4Xb.js → agent-scope-DPIFau3f.js} +1 -1
- package/dist/{audio-preflight-SZRntkxo.js → audio-preflight-BU8W7uxc.js} +10 -10
- package/dist/{audio-preflight-ClVNINDs.js → audio-preflight-CGsumMzb.js} +10 -10
- package/dist/{audio-preflight-txAP3v-C.js → audio-preflight-SLmkJI6-.js} +22 -22
- package/dist/{audio-preflight-BP6s-UPp.js → audio-preflight-jZc5mFCZ.js} +23 -23
- package/dist/{audit-CQzrm61N.js → audit-Dmww_503.js} +70 -18
- package/dist/{audit-DMH3CSXY.js → audit-wPu26VMb.js} +72 -20
- package/dist/{tailscale-DU6DgqVy.js → auth-9x3lqfIY.js} +208 -3
- package/dist/{tailscale-DHfcfRCx.js → auth-CQNl_IaI.js} +190 -3
- package/dist/{auth-health-BB3e3OmN.js → auth-health-C4L4FGBA.js} +1 -1
- package/dist/{auth-health-zZ9dnQGC.js → auth-health-j6epgQbq.js} +1 -1
- package/dist/{auth-profiles-CcJ3hrog.js → auth-profiles-ByNs3eEm.js} +60 -22
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +19 -16
- package/dist/bundled/session-memory/handler.js +16 -15
- package/dist/{call-Yxns4CVq.js → call-DVYCIV8m.js} +5 -5
- package/dist/{call-C9az806y.js → call-SolyGS1r.js} +4 -4
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-CjXPwMWu.js → channel-options-BwC2yQcR.js} +4 -4
- package/dist/{channel-options-CX4iYQfR.js → channel-options-Cq9BVDkP.js} +7 -7
- package/dist/{channel-selection-BoQ7GurB.js → channel-selection-D4D6ImhN.js} +2 -2
- package/dist/{channel-selection-C78IwbD-.js → channel-selection-MZAHm4U8.js} +2 -2
- package/dist/{channels-cli-DUHsmX3q.js → channels-cli-9Dsk9Qm7.js} +53 -51
- package/dist/{channels-cli-BXMQPB4x.js → channels-cli-BJUppQll.js} +52 -50
- package/dist/{channels-status-issues-Ca9--azp.js → channels-status-issues-D7GSV1GS.js} +1 -1
- package/dist/{channels-status-issues-CbULFg2X.js → channels-status-issues-DDAWeT-6.js} +1 -1
- package/dist/{chrome-svgmQ8T_.js → chrome-BfB6JdKF.js} +2 -1
- package/dist/{chrome-juQxt0zf.js → chrome-Cvr-57lg.js} +4 -3
- package/dist/{chrome-BCPPeLQ6.js → chrome-DL0avO8n.js} +2 -1
- package/dist/{chrome-yIKmOzCO.js → chrome-foEwx3lN.js} +5 -4
- package/dist/{clack-prompter-Dmvcu3gn.js → clack-prompter-Bz3Mmcl-.js} +5 -5
- package/dist/{clack-prompter-DuBVnTKy.js → clack-prompter-ChCGXfyt.js} +4 -4
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/{cli-FdxAcu_y.js → cli-ZR9ugUBX.js} +42 -40
- package/dist/{cli-By331Q9f.js → cli-miPe4Ujz.js} +42 -40
- package/dist/{client-B0_GiCjB.js → client-BrYfyoDK.js} +52 -3
- package/dist/{client-D7wrC1Ug.js → client-CTwXnRl7.js} +53 -4
- package/dist/{command-format-ayFsmwwz.js → command-format-Bxe0mWee.js} +1 -1
- package/dist/{command-options-BSDiKuyX.js → command-options-BvgxzPbK.js} +4 -4
- package/dist/{commands-BG25qku5.js → commands-BX_OIIVR.js} +4 -4
- package/dist/{completion-cli-C4zxjkC1.js → completion-cli-CR77-jyv.js} +3 -3
- package/dist/{completion-cli-DECEgBWR.js → completion-cli-DnjpxAag.js} +29 -29
- package/dist/{config-B7sno9eI.js → config-Bdhomfei.js} +15 -6
- package/dist/{config-BuF7vm-v.js → config-BvMsmctM.js} +13 -4
- package/dist/{config-D50SQVar.js → config-QYrbd7x7.js} +13 -4
- package/dist/{config-DH9TLUNc.js → config-aFQssWKX.js} +15 -6
- package/dist/{config-guard-DPxxY1iw.js → config-guard-CljaSxJd.js} +39 -39
- package/dist/{configure-BZQ9uSVX.js → configure-BXLiucXo.js} +19 -19
- package/dist/{configure-Cg5IKSUy.js → configure-BYPqXzGZ.js} +19 -19
- package/dist/control-auth-8Cf4WXpR.js +54 -0
- package/dist/control-auth-DBCu3qyv.js +54 -0
- package/dist/{control-service-CBlMVTRu.js → control-service-B5KnPqGP.js} +11 -5
- package/dist/{control-service-B2er20Ke.js → control-service-DKnttEus.js} +10 -4
- package/dist/{cron-cli-B2Zwhy_r.js → cron-cli-D7BRjDv2.js} +17 -17
- package/dist/{cron-cli-EaRUVd0p.js → cron-cli-z1zk_FXQ.js} +16 -16
- package/dist/{daemon-cli-CVNzObIF.js → daemon-cli-BDkU2ocb.js} +18 -18
- package/dist/{daemon-cli-DF6Rxjy6.js → daemon-cli-cNSF93-v.js} +19 -19
- package/dist/{daemon-runtime-BHF5NjQ7.js → daemon-runtime-B0tg_LsX.js} +2 -2
- package/dist/{daemon-runtime-B05PME1z.js → daemon-runtime-Bsjeut6m.js} +3 -3
- package/dist/{deliver-DzcxEcza.js → deliver-CIU9Npgs.js} +306 -12
- package/dist/{deliver-COf5XFo_.js → deliver-DYYCo1G7.js} +302 -8
- package/dist/{deliver-B1jsU2r7.js → deliver-LsxKETro.js} +306 -12
- package/dist/{deliver-CLwC284e.js → deliver-xUU3mGHo.js} +302 -8
- package/dist/{deps-Cva7QM_t.js → deps-QSwGcoNZ.js} +2 -2
- package/dist/{deps-B6602Wid.js → deps-lAAA2zYI.js} +2 -2
- package/dist/{devices-cli-DPg_4aW8.js → devices-cli-BG3-2oqt.js} +13 -13
- package/dist/{devices-cli-D8K3hZR5.js → devices-cli-VIQtOvt_.js} +13 -13
- package/dist/{directory-cli-OGBSVKAZ.js → directory-cli-BCJwjVC0.js} +15 -15
- package/dist/{directory-cli-Bn47fFX7.js → directory-cli-jYzZ02gk.js} +14 -14
- package/dist/{dispatcher-BHsNwFe-.js → dispatcher-DY51b-Zc.js} +2 -2
- package/dist/{dns-cli-DmTHXgwU.js → dns-cli-DHIiMJjS.js} +11 -11
- package/dist/{dns-cli-kk2rysJh.js → dns-cli-pZlv87Ib.js} +11 -11
- package/dist/{docs-cli-CB77CeM4.js → docs-cli-2JDiwfzP.js} +7 -7
- package/dist/{docs-cli-DUcyw0X0.js → docs-cli-BhkYqoIQ.js} +6 -6
- package/dist/{doctor-DwqdkfPa.js → doctor-Bf8EhNtA.js} +33 -33
- package/dist/{doctor-BZfxDGUg.js → doctor-sYG5V4Co.js} +32 -32
- package/dist/entry.js +36 -14
- package/dist/{env-DE9xvYOL.js → env-ONzUVAG2.js} +1 -1
- package/dist/{exec-4WHuOniw.js → exec-B8lXct-k.js} +31 -13
- package/dist/{exec-B8JKbXKW.js → exec-CACT5OAW.js} +1 -1
- package/dist/{exec-D12IZYtJ.js → exec-CJFFoM7H.js} +31 -13
- package/dist/{exec-DXtR2fhb.js → exec-YIosokWE.js} +1 -1
- package/dist/{exec-approvals-cli-GizapOX5.js → exec-approvals-cli-7LH0lwhO.js} +19 -19
- package/dist/{exec-approvals-cli-BWO0Rs-a.js → exec-approvals-cli-apGnQbpj.js} +19 -19
- package/dist/extensionAPI.js +1108 -661
- package/dist/{fetch-CqZP8jwB.js → fetch-DmiOpALK.js} +5 -3
- package/dist/{fetch-timeout-B2KlHXi3.js → fetch-timeout-BEtUjM1S.js} +5 -3
- package/dist/{fetch-timeout-ohY5QmsW.js → fetch-timeout-DEoXG_SF.js} +5 -3
- package/dist/{fetch-timeout-4UKsdtE1.js → fetch-timeout-DTK9vxex.js} +5 -3
- package/dist/{gateway-cli-Bbd1Xbsc.js → gateway-cli-DUdYxlZS.js} +315 -103
- package/dist/{gateway-cli-PR1S0BTe.js → gateway-cli-DbvWmE-9.js} +314 -102
- package/dist/{gateway-rpc-8gue7Qjt.js → gateway-rpc-BByb2Snz.js} +3 -3
- package/dist/{gateway-rpc-DjuxyOm-.js → gateway-rpc-wXSCUZXj.js} +3 -3
- package/dist/{github-copilot-auth-B3chCDfc.js → github-copilot-auth-D7ewvpMd.js} +16 -8
- package/dist/{github-copilot-auth-Cm2SB8Qf.js → github-copilot-auth-DDispnyz.js} +16 -8
- package/dist/{github-copilot-token-SLWintYd.js → github-copilot-token-Cfs0Wxr8.js} +1 -1
- package/dist/{gmail-setup-utils-Cgh0ptgA.js → gmail-setup-utils-Cfns8TQx.js} +3 -3
- package/dist/{gmail-setup-utils-WDyf1gTU.js → gmail-setup-utils-DJb-_5kO.js} +4 -4
- package/dist/{health-format-C0C_Apce.js → health-format-KGPokKJH.js} +68 -28
- package/dist/{health-format-gLMfE2wf.js → health-format-LZDxu3rv.js} +67 -27
- package/dist/{help-format-5iAL_46a.js → help-format-C48TXngO.js} +1 -1
- package/dist/{help-format-DUy1KRxq.js → help-format-R5fLToDw.js} +1 -1
- package/dist/{hooks-cli-CEN1h1ya.js → hooks-cli-CT8JCRkH.js} +46 -44
- package/dist/{hooks-cli-DrchIqSi.js → hooks-cli-S1MKumJO.js} +47 -45
- package/dist/{hooks-status-Cgy6AtQk.js → hooks-status-Cw0xD8Lt.js} +3 -3
- package/dist/{hooks-status--xVLpAXz.js → hooks-status-D9MhwHRp.js} +3 -3
- package/dist/{image-Dkawt9Kg.js → image-Brk1sJbw.js} +4 -4
- package/dist/{image-DI9s9eEx.js → image-C4Nn2p3e.js} +5 -5
- package/dist/{image-LxFvu0wL.js → image-DgtfXMcX.js} +5 -5
- package/dist/{image-B4mDPdyz.js → image-RKwc3fsL.js} +4 -4
- package/dist/index.js +83 -83
- package/dist/{installs-NS0VMPN7.js → installs-CrLcWYHe.js} +4 -4
- package/dist/{installs-DA-eSN1B.js → installs-DscWb9b9.js} +5 -5
- package/dist/{links-CV4oki2u.js → links-B8LAzWwg.js} +1 -1
- package/dist/{links-7M-j83As.js → links-Eax1UO3w.js} +1 -1
- package/dist/llm-slug-generator.js +15 -15
- package/dist/{loader-Caow9TPA.js → loader-KjT074JR.js} +1105 -762
- package/dist/{logging-CeHn2itV.js → logging-BAyPwvdH.js} +1 -1
- package/dist/{logging-D0MyqUlV.js → logging-CRq4h04P.js} +2 -2
- package/dist/{login-qr-Xx8yJrSc.js → login-qr-B6ZgAuIf.js} +5 -5
- package/dist/{login-qr-CoskdtvN.js → login-qr-Bua-p0nG.js} +2 -2
- package/dist/{login-qr-CAk9D-FM.js → login-qr-CuvemJj4.js} +6 -6
- package/dist/{login-qr-kUyMWXV1.js → login-qr-Djr1JfIf.js} +2 -2
- package/dist/{logs-cli-B476pzJS.js → logs-cli-9IAV7rWY.js} +15 -15
- package/dist/{logs-cli-BQRUI_PO.js → logs-cli-EiKzUFPa.js} +14 -14
- package/dist/{manager-CBApH7eR.js → manager-BIMh_eSm.js} +5 -5
- package/dist/{manager-CyJH6WMg.js → manager-CwinWQoz.js} +5 -5
- package/dist/{manager-DScY_ZTT.js → manager-DkqF1GiK.js} +7 -7
- package/dist/{manager-DseK7RWj.js → manager-T1XfGchB.js} +8 -8
- package/dist/{manifest-registry-DFckk-L8.js → manifest-registry-CQhdnDBZ.js} +2 -2
- package/dist/{manifest-registry-BTgLN_W2.js → manifest-registry-u0okVSkU.js} +2 -2
- package/dist/{message-channel-0717wOz-.js → message-channel-BLi2a6Yw.js} +1 -1
- package/dist/{message-channel-BlgPSDAh.js → message-channel-C_MmebBt.js} +1 -1
- package/dist/{model-auth-CbqRVYRp.js → model-auth-CabXIF6O.js} +57 -19
- package/dist/{model-selection-unMJyUIE.js → model-selection-BLuqsGVB.js} +59 -21
- package/dist/{model-selection-B9Y7dKQd.js → model-selection-C1GmkTAV.js} +57 -19
- package/dist/{models-cli-B1cLGcRz.js → models-cli-9jmDv-h3.js} +50 -48
- package/dist/{models-cli-D7sChCi6.js → models-cli-zS9rtWz8.js} +48 -46
- package/dist/{node-cli-ic2C1xs2.js → node-cli-CrpTxTTs.js} +26 -24
- package/dist/{node-cli-CS3KwBh1.js → node-cli-wemUMCg-.js} +25 -23
- package/dist/{node-service-D_Cdq1JI.js → node-service-C8DTHTMg.js} +2 -2
- package/dist/{node-service-_vgO5xR-.js → node-service-WQuEKz6W.js} +1 -1
- package/dist/{nodes-cli-CipcvVMc.js → nodes-cli-BaU2SIFw.js} +16 -16
- package/dist/{nodes-cli-B1meaW7S.js → nodes-cli-Dx23D72n.js} +16 -16
- package/dist/{nodes-screen-N-4_0VIu.js → nodes-screen-C0IuBqUL.js} +1 -1
- package/dist/{note-CAM9PbSJ.js → note-BhRSeNeu.js} +2 -2
- package/dist/{note-Ci08TSbV.js → note-hhtubr2j.js} +1 -1
- package/dist/{onboard-channels-DMcOT0dj.js → onboard-channels-C501x8GI.js} +8 -8
- package/dist/{onboard-channels-CsT3E4bT.js → onboard-channels-Dxzroasd.js} +8 -8
- package/dist/{onboard-skills-DoxkpnEU.js → onboard-skills-DV0Qzvjj.js} +19 -19
- package/dist/{onboard-skills-D-BrCoRN.js → onboard-skills-rlBHcu3Q.js} +18 -18
- package/dist/{onboarding-B92952fz.js → onboarding-CN-EDLjd.js} +34 -34
- package/dist/{pairing-cli-BDUJ5VoX.js → pairing-cli-CDHG4xuI.js} +15 -15
- package/dist/{pairing-cli-0wbU1u8d.js → pairing-cli-CQP34Dlx.js} +14 -14
- package/dist/{pairing-labels-3o3QO3Qn.js → pairing-labels-B6CN0SNH.js} +1 -1
- package/dist/{pairing-labels-Bin1K7_f.js → pairing-labels-CgNHnjzT.js} +1 -1
- package/dist/{pairing-store-CL4rJ7m7.js → pairing-store-CmlRVqOz.js} +2 -2
- package/dist/{pairing-store-fIWI3pXG.js → pairing-store-Dp5_JGnG.js} +3 -3
- package/dist/{path-env-CXWUFfFv.js → path-env-CLvYNwtL.js} +1 -1
- package/dist/{path-env-C5FR_Eay.js → path-env-CaYUVIML.js} +2 -2
- package/dist/{paths-DwKNqk_S.js → paths-B0a4ywSO.js} +30 -5
- package/dist/{paths-RITJT4UY.js → paths-B49s6UZQ.js} +30 -5
- package/dist/{paths-CB2fqqbX.js → paths-D0O87MfH.js} +30 -5
- package/dist/{paths-IivnSNkP.js → paths-DLINmNFQ.js} +31 -6
- package/dist/{pi-embedded-DhYItk8O.js → pi-embedded-Ctrt2kz0.js} +1109 -662
- package/dist/{pi-embedded-helpers-CmftU5Zj.js → pi-embedded-helpers-CMKLjW6X.js} +8 -5
- package/dist/{pi-embedded-helpers-CfXnSIFx.js → pi-embedded-helpers-CUzTc1v6.js} +170 -19
- package/dist/{pi-embedded-helpers-Uan-3N1T.js → pi-embedded-helpers-DfwkwPYD.js} +7 -4
- package/dist/{pi-embedded-helpers-Bri9tk9g.js → pi-embedded-helpers-WDwx99UA.js} +170 -19
- package/dist/{pi-tools.policy-CJFi1sny.js → pi-tools.policy-BpsROZbz.js} +4 -4
- package/dist/{plugin-auto-enable-BY4CqJbD.js → plugin-auto-enable-Bqhc3w5n.js} +5 -5
- package/dist/{plugin-auto-enable-DbQrtQjL.js → plugin-auto-enable-PW76g_PJ.js} +5 -5
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/types.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/types.d.ts +15 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.tools.d.ts +1 -1
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.handlers.types.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-subscribe.types.d.ts +2 -0
- package/dist/plugin-sdk/agents/session-tool-result-guard-wrapper.d.ts +2 -0
- package/dist/plugin-sdk/agents/session-tool-result-guard.d.ts +4 -0
- package/dist/plugin-sdk/agents/tools/agent-step.d.ts +3 -0
- package/dist/plugin-sdk/agents/usage.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/reply-reference.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/reply/session-run-accounting.d.ts +11 -0
- package/dist/plugin-sdk/auto-reply/reply/session-usage.d.ts +8 -0
- package/dist/plugin-sdk/browser/control-auth.d.ts +13 -0
- package/dist/plugin-sdk/channels/plugins/onboarding/signal.d.ts +1 -0
- package/dist/plugin-sdk/cli/prompt.d.ts +1 -0
- package/dist/plugin-sdk/commands/agent/types.d.ts +2 -0
- package/dist/plugin-sdk/config/sessions/paths.d.ts +7 -2
- package/dist/plugin-sdk/config/types.agents.d.ts +2 -0
- package/dist/plugin-sdk/config/types.discord.d.ts +5 -0
- package/dist/plugin-sdk/config/types.gateway.d.ts +15 -0
- package/dist/plugin-sdk/config/types.hooks.d.ts +15 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +1 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +11 -0
- package/dist/plugin-sdk/config/zod-schema.providers-core.d.ts +9 -0
- package/dist/plugin-sdk/config/zod-schema.providers.d.ts +4 -0
- package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +15 -0
- package/dist/plugin-sdk/discord/send.types.d.ts +3 -0
- package/dist/plugin-sdk/gateway/auth.d.ts +36 -0
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +6 -0
- package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +3 -1
- package/dist/plugin-sdk/index.js +295 -99
- package/dist/plugin-sdk/infra/binaries.d.ts +3 -0
- package/dist/plugin-sdk/infra/heartbeat-runner.d.ts +1 -0
- package/dist/plugin-sdk/infra/net/fetch-guard.d.ts +1 -0
- package/dist/plugin-sdk/infra/net/ssrf.d.ts +1 -0
- package/dist/plugin-sdk/infra/tailscale.d.ts +34 -0
- package/dist/plugin-sdk/infra/tmp-openclaw-dir.d.ts +10 -0
- package/dist/plugin-sdk/logging/logger.d.ts +1 -1
- package/dist/plugin-sdk/media/input-files.d.ts +5 -0
- package/dist/plugin-sdk/routing/resolve-route.d.ts +3 -1
- package/dist/plugin-sdk/security/external-content.d.ts +1 -1
- package/dist/plugin-sdk/security/secret-equal.d.ts +1 -0
- package/dist/plugin-sdk/sessions/input-provenance.d.ts +16 -0
- package/dist/plugin-sdk/signal/monitor/event-handler.types.d.ts +8 -0
- package/dist/plugin-sdk/signal/monitor/mentions.d.ts +2 -0
- package/dist/{plugins-3GyCj5KL.js → plugins-4Hqd1WGf.js} +3 -3
- package/dist/{plugins-BL9lIXSA.js → plugins-X7d_tfTE.js} +4 -4
- package/dist/{plugins-cli-Ce7VsvZh.js → plugins-cli-Bgku3EGj.js} +253 -46
- package/dist/{plugins-cli-e9gUebMd.js → plugins-cli-CVToH3if.js} +254 -47
- package/dist/{ports-DupIRXQ0.js → ports-qkt29rdC.js} +2 -2
- package/dist/{program-u22vbFpH.js → program-Cf7lkBur.js} +82 -82
- package/dist/{progress-g9R--HZD.js → progress-C9kngsTD.js} +1 -1
- package/dist/{progress-Da1ehW-x.js → progress-DWqhRakV.js} +1 -1
- package/dist/{prompt-style-Dc0C5HC9.js → prompt-style-BFH5D5LN.js} +1 -1
- package/dist/{prompt-style-lmJDcgtA.js → prompt-style-CIbmaxSa.js} +1 -1
- package/dist/{pw-ai-C43wv1ZF.js → pw-ai-8mdv3h-d.js} +7 -6
- package/dist/{pw-ai-DTZVjndL.js → pw-ai-CM1IsSgZ.js} +5 -5
- package/dist/{pw-ai-zVebjrSG.js → pw-ai-FGoRVblI.js} +3 -3
- package/dist/{pw-ai-CWrnJ98b.js → pw-ai-sS1fRKW_.js} +3 -3
- package/dist/{qmd-manager-NPD5Yh_4.js → qmd-manager-C67Fc8aN.js} +4 -4
- package/dist/{qmd-manager-ozZ933qc.js → qmd-manager-CXVbfg99.js} +7 -7
- package/dist/{qmd-manager-DBCZ1sio.js → qmd-manager-RMRE8Tqt.js} +6 -6
- package/dist/{qmd-manager-a9Bt0405.js → qmd-manager-pyc_MTIe.js} +4 -4
- package/dist/{register.subclis-BpX3ulH1.js → register.subclis-C02e4zuJ.js} +28 -28
- package/dist/{reply-m467_fOC.js → reply-DICXkh_C.js} +911 -568
- package/dist/{routes-82Ywfho6.js → routes-CmOI1hIH.js} +29 -11
- package/dist/{routes-BqxA3ZYr.js → routes-DewK5tq2.js} +29 -12
- package/dist/{rpc-DcGBG-Fp.js → rpc-DHr30euf.js} +3 -3
- package/dist/{rpc-CfdBHlnp.js → rpc-T300F8zI.js} +3 -3
- package/dist/{run-main-aolvSfj3.js → run-main-C5wpthq1.js} +84 -84
- package/dist/{runner-C1G8RFWl.js → runner-CY0nmVme.js} +9 -9
- package/dist/{runner-BCBs8JKA.js → runner-Cfm5nTMc.js} +6 -6
- package/dist/{runner-CInKPsiP.js → runner-D_dujMod.js} +8 -8
- package/dist/{runner-Cwfn-VOM.js → runner-DrGYLH5K.js} +6 -6
- package/dist/{sandbox-B0K9e6Fw.js → sandbox-BKYnhYQH.js} +23 -15
- package/dist/{sandbox-BW8Xnkw1.js → sandbox-Bhjnh1Xg.js} +21 -13
- package/dist/{sandbox-cli-mKCs2J0i.js → sandbox-cli-DBsAjZJN.js} +20 -20
- package/dist/{sandbox-cli-BD5LkZ0B.js → sandbox-cli-rV9LtFeu.js} +19 -19
- package/dist/{security-cli-kgI4soGy.js → security-cli-BIwJM_rs.js} +27 -27
- package/dist/{security-cli-kz8TiyqU.js → security-cli-BRjny8Yu.js} +26 -26
- package/dist/{server-context-fX4xiYRh.js → server-context-BGpGs3qd.js} +7 -7
- package/dist/{server-context-Lb-eUZG_.js → server-context-Cl0U0vE3.js} +5 -5
- package/dist/{server-node-events-Dx18uVrH.js → server-node-events-CBfTbiTA.js} +45 -43
- package/dist/{server-node-events-KqZMN30F.js → server-node-events-QCvh8EgI.js} +45 -43
- package/dist/{service-DZMXgMra.js → service--nPk7DvT.js} +3 -3
- package/dist/{service-DNcIZ5Kp.js → service-99RDXwX4.js} +2 -2
- package/dist/{service-audit-0WLGnoNT.js → service-audit-DnLmRGQt.js} +4 -4
- package/dist/{service-audit-uhZSlxeb.js → service-audit-ckBaRCVC.js} +3 -3
- package/dist/{session-cost-usage-HU4OeRgw.js → session-cost-usage-D7HuoSSD.js} +10 -8
- package/dist/{session-cost-usage-CL8gnHRN.js → session-cost-usage-D9hHANWI.js} +10 -8
- package/dist/{shared-j4Qtr475.js → shared-Bs4vduG4.js} +3 -3
- package/dist/{shared-BBw6F-YC.js → shared-CEY5IkwG.js} +2 -2
- package/dist/{shared-DOZs2SoH.js → shared-DRohONn_.js} +3 -3
- package/dist/{shared-CtP9K-o2.js → shared-ICqOZibV.js} +3 -3
- package/dist/{skill-scanner-C_fQzVDu.js → skill-scanner-rHMtUHtP.js} +1 -1
- package/dist/{skills-BvPUNjxo.js → skills-DRjfSQT3.js} +128 -4
- package/dist/{skills-aFOsriMP.js → skills-DprQj9X2.js} +129 -5
- package/dist/{skills-cli-oWaTJzZd.js → skills-cli-9WO-C55s.js} +12 -12
- package/dist/{skills-cli-E6shXpdd.js → skills-cli-B9eej-EW.js} +13 -13
- package/dist/{skills-status-D4vbIMnz.js → skills-status-5U3P3YfJ.js} +3 -3
- package/dist/{skills-status-DJDaA2Ur.js → skills-status-TDIgVd1K.js} +2 -2
- package/dist/{sqlite-B7FPASCO.js → sqlite-BINzs1U0.js} +2 -2
- package/dist/{sqlite-B4Z1_Ioc.js → sqlite-D4w5TejA.js} +2 -2
- package/dist/{sqlite-BkYnxkQO.js → sqlite-DRRHmlug.js} +2 -2
- package/dist/{sqlite-EuQPVXvn.js → sqlite-F6PGkEm1.js} +2 -2
- package/dist/{status-B2Yr-2J5.js → status-BKGkKC_v.js} +3 -3
- package/dist/{status-DW7m5xUN.js → status-CiHtHdaa.js} +4 -4
- package/dist/{status-CxhnUa5J.js → status-DDWoOpeB.js} +33 -33
- package/dist/{subsystem-Bv7dGhES.js → subsystem-BoExtIHo.js} +32 -13
- package/dist/{system-cli-0JXhJNWm.js → system-cli-B6lr60Io.js} +14 -14
- package/dist/{system-cli-D-0OaMtH.js → system-cli-CprW9G3h.js} +14 -14
- package/dist/{systemd-CNTodvCO.js → systemd-C0VZriGM.js} +2 -2
- package/dist/{systemd-CUJJHgHa.js → systemd-DrmBtJ5T.js} +3 -3
- package/dist/{systemd-hints-cmHtrXUl.js → systemd-hints-DZtXiVHa.js} +1 -1
- package/dist/{systemd-linger-CArPbmvv.js → systemd-linger-NC2kl1SC.js} +2 -2
- package/dist/{systemd-linger-XvT9Y9sb.js → systemd-linger-xdn3BdPh.js} +2 -2
- package/dist/{table-DzBBIqHO.js → table-B8dx3v4v.js} +2 -2
- package/dist/{table-oJQPTUL6.js → table-CwulTLQp.js} +1 -1
- package/dist/{tool-display-Na-EVL83.js → tool-display-CZRIDMRm.js} +1 -1
- package/dist/{tool-display-sHJa3kRs.js → tool-display-ClRud3pg.js} +2 -2
- package/dist/{tui-nGp8ltQK.js → tui-CVTQn-dC.js} +9 -9
- package/dist/{tui-Biw7aqPj.js → tui-Lu8FdrlK.js} +9 -9
- package/dist/{tui-cli-C9FEfG7C.js → tui-cli-BLpTj1X9.js} +25 -25
- package/dist/{tui-cli-Dxnu5JGl.js → tui-cli-BLx5kL2I.js} +25 -25
- package/dist/{tui-formatters-BiNTNGwg.js → tui-formatters-CNySEfJN.js} +5 -5
- package/dist/{tui-formatters-C_baVYUz.js → tui-formatters-DePhZK3J.js} +5 -5
- package/dist/{update-C4rsLj2F.js → update-DHVxMTpQ.js} +3 -3
- package/dist/{update-uwUWrKFu.js → update-DU1geolI.js} +3 -3
- package/dist/{update-cli-cNd_G9E6.js → update-cli-C0hUvJWK.js} +66 -66
- package/dist/{update-cli-CBXp-c4C.js → update-cli-Wb1GB3rL.js} +68 -68
- package/dist/{update-runner-BLsqC24J.js → update-runner--ixK4J3W.js} +10 -10
- package/dist/{update-runner-C_FDpmA3.js → update-runner-7Qa1T9y6.js} +9 -9
- package/dist/{utils-Dk86IbEs.js → utils-BLJAc3ZV.js} +1 -1
- package/dist/{utils-BHPdZE4h.js → utils-Cd9QdCHh.js} +1 -1
- package/dist/{webhooks-cli-BpBKXL7W.js → webhooks-cli-DgcMy7RG.js} +12 -12
- package/dist/{webhooks-cli-wNfhfKqm.js → webhooks-cli-aVzUcJY9.js} +11 -11
- package/dist/{widearea-dns-WVCWJTEb.js → widearea-dns-BaIgNEhY.js} +1 -1
- package/dist/{widearea-dns-BWYPcfby.js → widearea-dns-DzuRdwk5.js} +1 -1
- package/dist/{ws-log-Cafylho7.js → ws-log-CIXbLCka.js} +1 -1
- package/dist/{ws-log-DTUOUVgR.js → ws-log-DcQFZByi.js} +1 -1
- package/dist/{wsl-B-H6Z5wp.js → wsl-BUOkxKJu.js} +2 -2
- package/docs/automation/webhook.md +43 -2
- package/docs/channels/discord.md +29 -1
- package/docs/cli/plugins.md +20 -1
- package/docs/cli/security.md +1 -0
- package/docs/concepts/session-tool.md +1 -0
- package/docs/gateway/configuration-reference.md +11 -0
- package/docs/gateway/configuration.md +3 -0
- package/docs/gateway/openresponses-http-api.md +15 -0
- package/docs/gateway/security/index.md +3 -0
- package/docs/help/faq.md +9 -0
- package/docs/install/installer.md +20 -0
- package/docs/reference/transcript-hygiene.md +18 -0
- package/docs/tools/browser.md +6 -0
- package/extensions/diagnostics-otel/package.json +9 -9
- package/extensions/feishu/package.json +1 -1
- package/extensions/feishu/src/config-schema.ts +6 -0
- package/extensions/feishu/src/reply-dispatcher.test.ts +116 -0
- package/extensions/feishu/src/reply-dispatcher.ts +124 -67
- package/extensions/feishu/src/streaming-card.ts +223 -0
- package/extensions/feishu/src/targets.test.ts +16 -0
- package/extensions/feishu/src/targets.ts +1 -1
- package/extensions/irc/src/client.ts +1 -1
- package/extensions/minimax-portal-auth/index.ts +7 -5
- package/extensions/nostr/package.json +1 -1
- package/package.json +13 -13
- package/dist/auth-BcNHFK-i.js +0 -184
- package/dist/auth-jrfLXze7.js +0 -184
- /package/dist/{archive-DqNr5i8b.js → archive-beaSfAzA.js} +0 -0
- /package/dist/{brew-BIrWdDps.js → brew-BUIxHEkn.js} +0 -0
- /package/dist/{brew-6UyogeLe.js → brew-ROHf0-Xp.js} +0 -0
- /package/dist/{constants-DuoCkWRh.js → constants-BvQ6S8j5.js} +0 -0
- /package/dist/{errors-x4NYs-1P.js → errors-DjZBTJJ3.js} +0 -0
- /package/dist/{helpers-BDvtkJjw.js → helpers-HyeZXsnu.js} +0 -0
- /package/dist/{is-main-CE1eOBYb.js → is-main-BWoXGz7p.js} +0 -0
- /package/dist/{parse-Cjiudy6x.js → parse-Bw0oH-rT.js} +0 -0
- /package/dist/{parse-timeout-DFSPLxpY.js → parse-timeout-D1XX_zN_.js} +0 -0
- /package/dist/{prompts-BOz5176z.js → prompts-Bg96reub.js} +0 -0
- /package/dist/{redact-DuEEf1p1.js → redact-Br9GfacZ.js} +0 -0
- /package/dist/{skill-scanner-CprFkZib.js → skill-scanner-CucvxYhu.js} +0 -0
- /package/dist/{transcript-events-CZ8CG4ht.js → transcript-events-BtNd-j6q.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import { j as normalizeAccountId$1 } from "./agent-scope-
|
|
3
|
-
import { Y as logVerbose, Z as shouldLogVerbose, k as escapeRegExp, x as getActivePluginRegistry, z as resolveUserPath } from "./exec-
|
|
4
|
-
import {
|
|
5
|
-
import { t as loadConfig } from "./config-
|
|
6
|
-
import { r as fetchRemoteMedia, t as fetchWithTimeout } from "./fetch-timeout-
|
|
2
|
+
import { j as normalizeAccountId$1 } from "./agent-scope-BIEhVP4_.js";
|
|
3
|
+
import { Y as logVerbose, Z as shouldLogVerbose, k as escapeRegExp, l as createSubsystemLogger, x as getActivePluginRegistry, z as resolveUserPath } from "./exec-B8lXct-k.js";
|
|
4
|
+
import { Cn as detectMime, Fn as getChannelPlugin, Ft as resizeToJpeg, J as resolveMirroredTranscriptText, Ln as normalizeChannelId, Lt as saveMediaBuffer, Mn as mediaKindFromMime, Nt as hasAlphaChannel, Pn as resolveSignalAccount, Pt as optimizeImageToPng, dn as INTERNAL_MESSAGE_CHANNEL, jn as maxBytesForKind, jt as convertHeicToJpeg, m as isMessagingToolDuplicate, q as appendAssistantMessageToSessionTranscript, wn as extensionForMime, yt as getChannelDock } from "./pi-embedded-helpers-WDwx99UA.js";
|
|
5
|
+
import { t as loadConfig } from "./config-BvMsmctM.js";
|
|
6
|
+
import { r as fetchRemoteMedia, t as fetchWithTimeout } from "./fetch-timeout-BEtUjM1S.js";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import path from "node:path";
|
|
@@ -21,6 +21,260 @@ function isSilentReplyText(text, token = SILENT_REPLY_TOKEN) {
|
|
|
21
21
|
return new RegExp(`\\b${escaped}\\b\\W*$`).test(text);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/plugins/hooks.ts
|
|
26
|
+
/**
|
|
27
|
+
* Get hooks for a specific hook name, sorted by priority (higher first).
|
|
28
|
+
*/
|
|
29
|
+
function getHooksForName(registry, hookName) {
|
|
30
|
+
return registry.typedHooks.filter((h) => h.hookName === hookName).toSorted((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a hook runner for a specific registry.
|
|
34
|
+
*/
|
|
35
|
+
function createHookRunner(registry, options = {}) {
|
|
36
|
+
const logger = options.logger;
|
|
37
|
+
const catchErrors = options.catchErrors ?? true;
|
|
38
|
+
/**
|
|
39
|
+
* Run a hook that doesn't return a value (fire-and-forget style).
|
|
40
|
+
* All handlers are executed in parallel for performance.
|
|
41
|
+
*/
|
|
42
|
+
async function runVoidHook(hookName, event, ctx) {
|
|
43
|
+
const hooks = getHooksForName(registry, hookName);
|
|
44
|
+
if (hooks.length === 0) return;
|
|
45
|
+
logger?.debug?.(`[hooks] running ${hookName} (${hooks.length} handlers)`);
|
|
46
|
+
const promises = hooks.map(async (hook) => {
|
|
47
|
+
try {
|
|
48
|
+
await hook.handler(event, ctx);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
const msg = `[hooks] ${hookName} handler from ${hook.pluginId} failed: ${String(err)}`;
|
|
51
|
+
if (catchErrors) logger?.error(msg);
|
|
52
|
+
else throw new Error(msg, { cause: err });
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
await Promise.all(promises);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Run a hook that can return a modifying result.
|
|
59
|
+
* Handlers are executed sequentially in priority order, and results are merged.
|
|
60
|
+
*/
|
|
61
|
+
async function runModifyingHook(hookName, event, ctx, mergeResults) {
|
|
62
|
+
const hooks = getHooksForName(registry, hookName);
|
|
63
|
+
if (hooks.length === 0) return;
|
|
64
|
+
logger?.debug?.(`[hooks] running ${hookName} (${hooks.length} handlers, sequential)`);
|
|
65
|
+
let result;
|
|
66
|
+
for (const hook of hooks) try {
|
|
67
|
+
const handlerResult = await hook.handler(event, ctx);
|
|
68
|
+
if (handlerResult !== void 0 && handlerResult !== null) if (mergeResults && result !== void 0) result = mergeResults(result, handlerResult);
|
|
69
|
+
else result = handlerResult;
|
|
70
|
+
} catch (err) {
|
|
71
|
+
const msg = `[hooks] ${hookName} handler from ${hook.pluginId} failed: ${String(err)}`;
|
|
72
|
+
if (catchErrors) logger?.error(msg);
|
|
73
|
+
else throw new Error(msg, { cause: err });
|
|
74
|
+
}
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Run before_agent_start hook.
|
|
79
|
+
* Allows plugins to inject context into the system prompt.
|
|
80
|
+
* Runs sequentially, merging systemPrompt and prependContext from all handlers.
|
|
81
|
+
*/
|
|
82
|
+
async function runBeforeAgentStart(event, ctx) {
|
|
83
|
+
return runModifyingHook("before_agent_start", event, ctx, (acc, next) => ({
|
|
84
|
+
systemPrompt: next.systemPrompt ?? acc?.systemPrompt,
|
|
85
|
+
prependContext: acc?.prependContext && next.prependContext ? `${acc.prependContext}\n\n${next.prependContext}` : next.prependContext ?? acc?.prependContext
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Run agent_end hook.
|
|
90
|
+
* Allows plugins to analyze completed conversations.
|
|
91
|
+
* Runs in parallel (fire-and-forget).
|
|
92
|
+
*/
|
|
93
|
+
async function runAgentEnd(event, ctx) {
|
|
94
|
+
return runVoidHook("agent_end", event, ctx);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Run before_compaction hook.
|
|
98
|
+
*/
|
|
99
|
+
async function runBeforeCompaction(event, ctx) {
|
|
100
|
+
return runVoidHook("before_compaction", event, ctx);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Run after_compaction hook.
|
|
104
|
+
*/
|
|
105
|
+
async function runAfterCompaction(event, ctx) {
|
|
106
|
+
return runVoidHook("after_compaction", event, ctx);
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Run message_received hook.
|
|
110
|
+
* Runs in parallel (fire-and-forget).
|
|
111
|
+
*/
|
|
112
|
+
async function runMessageReceived(event, ctx) {
|
|
113
|
+
return runVoidHook("message_received", event, ctx);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Run message_sending hook.
|
|
117
|
+
* Allows plugins to modify or cancel outgoing messages.
|
|
118
|
+
* Runs sequentially.
|
|
119
|
+
*/
|
|
120
|
+
async function runMessageSending(event, ctx) {
|
|
121
|
+
return runModifyingHook("message_sending", event, ctx, (acc, next) => ({
|
|
122
|
+
content: next.content ?? acc?.content,
|
|
123
|
+
cancel: next.cancel ?? acc?.cancel
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Run message_sent hook.
|
|
128
|
+
* Runs in parallel (fire-and-forget).
|
|
129
|
+
*/
|
|
130
|
+
async function runMessageSent(event, ctx) {
|
|
131
|
+
return runVoidHook("message_sent", event, ctx);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Run before_tool_call hook.
|
|
135
|
+
* Allows plugins to modify or block tool calls.
|
|
136
|
+
* Runs sequentially.
|
|
137
|
+
*/
|
|
138
|
+
async function runBeforeToolCall(event, ctx) {
|
|
139
|
+
return runModifyingHook("before_tool_call", event, ctx, (acc, next) => ({
|
|
140
|
+
params: next.params ?? acc?.params,
|
|
141
|
+
block: next.block ?? acc?.block,
|
|
142
|
+
blockReason: next.blockReason ?? acc?.blockReason
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Run after_tool_call hook.
|
|
147
|
+
* Runs in parallel (fire-and-forget).
|
|
148
|
+
*/
|
|
149
|
+
async function runAfterToolCall(event, ctx) {
|
|
150
|
+
return runVoidHook("after_tool_call", event, ctx);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Run tool_result_persist hook.
|
|
154
|
+
*
|
|
155
|
+
* This hook is intentionally synchronous: it runs in hot paths where session
|
|
156
|
+
* transcripts are appended synchronously.
|
|
157
|
+
*
|
|
158
|
+
* Handlers are executed sequentially in priority order (higher first). Each
|
|
159
|
+
* handler may return `{ message }` to replace the message passed to the next
|
|
160
|
+
* handler.
|
|
161
|
+
*/
|
|
162
|
+
function runToolResultPersist(event, ctx) {
|
|
163
|
+
const hooks = getHooksForName(registry, "tool_result_persist");
|
|
164
|
+
if (hooks.length === 0) return;
|
|
165
|
+
let current = event.message;
|
|
166
|
+
for (const hook of hooks) try {
|
|
167
|
+
const out = hook.handler({
|
|
168
|
+
...event,
|
|
169
|
+
message: current
|
|
170
|
+
}, ctx);
|
|
171
|
+
if (out && typeof out.then === "function") {
|
|
172
|
+
const msg = `[hooks] tool_result_persist handler from ${hook.pluginId} returned a Promise; this hook is synchronous and the result was ignored.`;
|
|
173
|
+
if (catchErrors) {
|
|
174
|
+
logger?.warn?.(msg);
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
throw new Error(msg);
|
|
178
|
+
}
|
|
179
|
+
const next = out?.message;
|
|
180
|
+
if (next) current = next;
|
|
181
|
+
} catch (err) {
|
|
182
|
+
const msg = `[hooks] tool_result_persist handler from ${hook.pluginId} failed: ${String(err)}`;
|
|
183
|
+
if (catchErrors) logger?.error(msg);
|
|
184
|
+
else throw new Error(msg, { cause: err });
|
|
185
|
+
}
|
|
186
|
+
return { message: current };
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Run session_start hook.
|
|
190
|
+
* Runs in parallel (fire-and-forget).
|
|
191
|
+
*/
|
|
192
|
+
async function runSessionStart(event, ctx) {
|
|
193
|
+
return runVoidHook("session_start", event, ctx);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Run session_end hook.
|
|
197
|
+
* Runs in parallel (fire-and-forget).
|
|
198
|
+
*/
|
|
199
|
+
async function runSessionEnd(event, ctx) {
|
|
200
|
+
return runVoidHook("session_end", event, ctx);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Run gateway_start hook.
|
|
204
|
+
* Runs in parallel (fire-and-forget).
|
|
205
|
+
*/
|
|
206
|
+
async function runGatewayStart(event, ctx) {
|
|
207
|
+
return runVoidHook("gateway_start", event, ctx);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Run gateway_stop hook.
|
|
211
|
+
* Runs in parallel (fire-and-forget).
|
|
212
|
+
*/
|
|
213
|
+
async function runGatewayStop(event, ctx) {
|
|
214
|
+
return runVoidHook("gateway_stop", event, ctx);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Check if any hooks are registered for a given hook name.
|
|
218
|
+
*/
|
|
219
|
+
function hasHooks(hookName) {
|
|
220
|
+
return registry.typedHooks.some((h) => h.hookName === hookName);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Get count of registered hooks for a given hook name.
|
|
224
|
+
*/
|
|
225
|
+
function getHookCount(hookName) {
|
|
226
|
+
return registry.typedHooks.filter((h) => h.hookName === hookName).length;
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
runBeforeAgentStart,
|
|
230
|
+
runAgentEnd,
|
|
231
|
+
runBeforeCompaction,
|
|
232
|
+
runAfterCompaction,
|
|
233
|
+
runMessageReceived,
|
|
234
|
+
runMessageSending,
|
|
235
|
+
runMessageSent,
|
|
236
|
+
runBeforeToolCall,
|
|
237
|
+
runAfterToolCall,
|
|
238
|
+
runToolResultPersist,
|
|
239
|
+
runSessionStart,
|
|
240
|
+
runSessionEnd,
|
|
241
|
+
runGatewayStart,
|
|
242
|
+
runGatewayStop,
|
|
243
|
+
hasHooks,
|
|
244
|
+
getHookCount
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/plugins/hook-runner-global.ts
|
|
250
|
+
const log = createSubsystemLogger("plugins");
|
|
251
|
+
let globalHookRunner = null;
|
|
252
|
+
let globalRegistry = null;
|
|
253
|
+
/**
|
|
254
|
+
* Initialize the global hook runner with a plugin registry.
|
|
255
|
+
* Called once when plugins are loaded during gateway startup.
|
|
256
|
+
*/
|
|
257
|
+
function initializeGlobalHookRunner(registry) {
|
|
258
|
+
globalRegistry = registry;
|
|
259
|
+
globalHookRunner = createHookRunner(registry, {
|
|
260
|
+
logger: {
|
|
261
|
+
debug: (msg) => log.debug(msg),
|
|
262
|
+
warn: (msg) => log.warn(msg),
|
|
263
|
+
error: (msg) => log.error(msg)
|
|
264
|
+
},
|
|
265
|
+
catchErrors: true
|
|
266
|
+
});
|
|
267
|
+
const hookCount = registry.hooks.length;
|
|
268
|
+
if (hookCount > 0) log.info(`hook runner initialized with ${hookCount} registered hooks`);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Get the global hook runner.
|
|
272
|
+
* Returns null if plugins haven't been loaded yet.
|
|
273
|
+
*/
|
|
274
|
+
function getGlobalHookRunner() {
|
|
275
|
+
return globalHookRunner;
|
|
276
|
+
}
|
|
277
|
+
|
|
24
278
|
//#endregion
|
|
25
279
|
//#region src/markdown/fences.ts
|
|
26
280
|
function parseFenceSpans(buffer) {
|
|
@@ -2358,22 +2612,60 @@ async function deliverOutboundPayloads(params) {
|
|
|
2358
2612
|
const normalized = normalizeWhatsAppPayload(payload);
|
|
2359
2613
|
return normalized ? [normalized] : [];
|
|
2360
2614
|
});
|
|
2615
|
+
const hookRunner = getGlobalHookRunner();
|
|
2361
2616
|
for (const payload of normalizedPayloads) {
|
|
2362
2617
|
const payloadSummary = {
|
|
2363
2618
|
text: payload.text ?? "",
|
|
2364
2619
|
mediaUrls: payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []),
|
|
2365
2620
|
channelData: payload.channelData
|
|
2366
2621
|
};
|
|
2622
|
+
const emitMessageSent = (success, error) => {
|
|
2623
|
+
if (!hookRunner?.hasHooks("message_sent")) return;
|
|
2624
|
+
hookRunner.runMessageSent({
|
|
2625
|
+
to,
|
|
2626
|
+
content: payloadSummary.text,
|
|
2627
|
+
success,
|
|
2628
|
+
...error ? { error } : {}
|
|
2629
|
+
}, {
|
|
2630
|
+
channelId: channel,
|
|
2631
|
+
accountId: accountId ?? void 0
|
|
2632
|
+
}).catch(() => {});
|
|
2633
|
+
};
|
|
2367
2634
|
try {
|
|
2368
2635
|
throwIfAborted(abortSignal);
|
|
2636
|
+
let effectivePayload = payload;
|
|
2637
|
+
if (hookRunner?.hasHooks("message_sending")) try {
|
|
2638
|
+
const sendingResult = await hookRunner.runMessageSending({
|
|
2639
|
+
to,
|
|
2640
|
+
content: payloadSummary.text,
|
|
2641
|
+
metadata: {
|
|
2642
|
+
channel,
|
|
2643
|
+
accountId,
|
|
2644
|
+
mediaUrls: payloadSummary.mediaUrls
|
|
2645
|
+
}
|
|
2646
|
+
}, {
|
|
2647
|
+
channelId: channel,
|
|
2648
|
+
accountId: accountId ?? void 0
|
|
2649
|
+
});
|
|
2650
|
+
if (sendingResult?.cancel) continue;
|
|
2651
|
+
if (sendingResult?.content != null) {
|
|
2652
|
+
effectivePayload = {
|
|
2653
|
+
...payload,
|
|
2654
|
+
text: sendingResult.content
|
|
2655
|
+
};
|
|
2656
|
+
payloadSummary.text = sendingResult.content;
|
|
2657
|
+
}
|
|
2658
|
+
} catch {}
|
|
2369
2659
|
params.onPayload?.(payloadSummary);
|
|
2370
|
-
if (handler.sendPayload &&
|
|
2371
|
-
results.push(await handler.sendPayload(
|
|
2660
|
+
if (handler.sendPayload && effectivePayload.channelData) {
|
|
2661
|
+
results.push(await handler.sendPayload(effectivePayload));
|
|
2662
|
+
emitMessageSent(true);
|
|
2372
2663
|
continue;
|
|
2373
2664
|
}
|
|
2374
2665
|
if (payloadSummary.mediaUrls.length === 0) {
|
|
2375
2666
|
if (isSignalChannel) await sendSignalTextChunks(payloadSummary.text);
|
|
2376
2667
|
else await sendTextChunks(payloadSummary.text);
|
|
2668
|
+
emitMessageSent(true);
|
|
2377
2669
|
continue;
|
|
2378
2670
|
}
|
|
2379
2671
|
let first = true;
|
|
@@ -2384,7 +2676,9 @@ async function deliverOutboundPayloads(params) {
|
|
|
2384
2676
|
if (isSignalChannel) results.push(await sendSignalMedia(caption, url));
|
|
2385
2677
|
else results.push(await handler.sendMedia(caption, url));
|
|
2386
2678
|
}
|
|
2679
|
+
emitMessageSent(true);
|
|
2387
2680
|
} catch (err) {
|
|
2681
|
+
emitMessageSent(false, err instanceof Error ? err.message : String(err));
|
|
2388
2682
|
if (!params.bestEffort) throw err;
|
|
2389
2683
|
params.onError?.(err, payloadSummary);
|
|
2390
2684
|
}
|
|
@@ -2404,4 +2698,4 @@ async function deliverOutboundPayloads(params) {
|
|
|
2404
2698
|
}
|
|
2405
2699
|
|
|
2406
2700
|
//#endregion
|
|
2407
|
-
export { markdownToIR as A, resolveChunkMode as B, throwIfAborted as C, resolveFetch as D, parseInlineDirectives as E, chunkByNewline as F,
|
|
2701
|
+
export { markdownToIR as A, resolveChunkMode as B, throwIfAborted as C, resolveFetch as D, parseInlineDirectives as E, chunkByNewline as F, getGlobalHookRunner as G, findFenceSpanAt as H, chunkMarkdownText as I, SILENT_REPLY_TOKEN as J, initializeGlobalHookRunner as K, chunkMarkdownTextWithMode as L, loadWebMedia as M, loadWebMediaRaw as N, wrapFetchWithAbortSignal as O, resolveMarkdownTableMode as P, chunkText as R, normalizeTargetForProvider as S, splitMediaFromOutput as T, isSafeFenceBreak as U, resolveTextChunkLimit as V, parseFenceSpans as W, isSilentReplyText as Y, signalCheck as _, normalizeOutboundPayloadsForJson as a, buildTargetResolverSignature as b, applyReplyThreading as c, shouldSuppressMessagingToolReplies as d, createReplyToModeFilterForChannel as f, sendTypingSignal as g, sendReadReceiptSignal as h, normalizeOutboundPayloads as i, markdownToIRWithMeta as j, chunkMarkdownIR as k, filterMessagingToolDuplicates as l, sendMessageSignal as m, deliver_exports as n, normalizeReplyPayloadsForDelivery as o, resolveReplyToMode as p, HEARTBEAT_TOKEN as q, formatOutboundPayloadLog as r, applyReplyTagsToPayload as s, deliverOutboundPayloads as t, isRenderablePayload as u, signalRpcRequest as v, parseReplyDirectives as w, normalizeChannelTargetInput as x, streamSignalEvents as y, chunkTextWithMode as z };
|