activeclaw 2026.2.11 → 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 +106 -0
- package/dist/{accounts-DbzMEfKN.js → accounts-DCDeFTra.js} +2 -2
- package/dist/{accounts-C2elk6PC.js → accounts-DeqIQjo1.js} +2 -2
- package/dist/{acp-cli-CVFTdsQY.js → acp-cli-CeYI4XRd.js} +15 -16
- package/dist/{acp-cli-BpJwIyLl.js → acp-cli-rNbGXICg.js} +14 -15
- package/dist/{agent-Bz1r5O8q.js → agent-BvNJF5QL.js} +19 -15
- package/dist/{agent-22-R4bNS.js → agent-CyMxTyrG.js} +20 -16
- package/dist/{agent-scope-D8miw9q_.js → agent-scope-BIEhVP4_.js} +172 -4
- package/dist/{agent-scope-CGmuusG9.js → agent-scope-CQCus0rI.js} +3 -3
- package/dist/{agent-scope-DQuy3dwI.js → agent-scope-CsRbLH4l.js} +4 -4
- package/dist/{agent-scope-BEf5crnU.js → agent-scope-DPIFau3f.js} +5 -1
- package/dist/audio-preflight-BU8W7uxc.js +60 -0
- package/dist/audio-preflight-CGsumMzb.js +60 -0
- package/dist/audio-preflight-SLmkJI6-.js +74 -0
- package/dist/audio-preflight-jZc5mFCZ.js +71 -0
- package/dist/{audit-C4wLaF0D.js → audit-Dmww_503.js} +71 -19
- package/dist/{audit-CY-yopxa.js → audit-wPu26VMb.js} +72 -20
- package/dist/{tailscale-DU6DgqVy.js → auth-9x3lqfIY.js} +208 -3
- package/dist/{tailscale-Cu-2HNvU.js → auth-CQNl_IaI.js} +190 -3
- package/dist/{auth-health-BFKUoCwJ.js → auth-health-C4L4FGBA.js} +1 -1
- package/dist/{auth-health-d7BMZlWG.js → auth-health-j6epgQbq.js} +1 -1
- package/dist/{auth-profiles-Bv1AEm-Y.js → auth-profiles-ByNs3eEm.js} +87 -31
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +28 -22
- package/dist/bundled/session-memory/handler.js +33 -22
- package/dist/{call-7yrB6v4I.js → call-DVYCIV8m.js} +5 -5
- package/dist/{call-Bek1xlgk.js → call-SolyGS1r.js} +6 -6
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-3mdYN0C_.js → channel-options-BwC2yQcR.js} +4 -4
- package/dist/{channel-options-DJ0b1m7B.js → channel-options-Cq9BVDkP.js} +12 -7
- package/dist/{channel-selection-RZimme3j.js → channel-selection-D4D6ImhN.js} +2 -2
- package/dist/{channel-selection-B9b7Kuit.js → channel-selection-MZAHm4U8.js} +2 -2
- package/dist/{channels-cli-CYbK2Dku.js → channels-cli-9Dsk9Qm7.js} +57 -53
- package/dist/{channels-cli-BFznbGOs.js → channels-cli-BJUppQll.js} +59 -55
- package/dist/{channels-status-issues-B3KkflfR.js → channels-status-issues-D7GSV1GS.js} +1 -1
- package/dist/{channels-status-issues-DQkRaZts.js → channels-status-issues-DDAWeT-6.js} +1 -1
- package/dist/{chrome-Db7w64LF.js → chrome-BfB6JdKF.js} +4 -4
- package/dist/{chrome-Dm-EgOjJ.js → chrome-Cvr-57lg.js} +6 -5
- package/dist/{chrome-CF16STk9.js → chrome-DL0avO8n.js} +2 -1
- package/dist/{chrome-yIKmOzCO.js → chrome-foEwx3lN.js} +5 -4
- package/dist/{clack-prompter-BCiBkJVr.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-Cl3PdJei.js → cli-ZR9ugUBX.js} +42 -38
- package/dist/cli-miPe4Ujz.js +93 -0
- package/dist/{client-6xKrRC-1.js → client-BrYfyoDK.js} +54 -5
- package/dist/{client-DMloFP_O.js → client-CTwXnRl7.js} +54 -5
- package/dist/{command-format-ayFsmwwz.js → command-format-Bxe0mWee.js} +1 -1
- package/dist/{command-options-BTAzyqqb.js → command-options-BvgxzPbK.js} +9 -4
- package/dist/{commands-CjEGXOZ_.js → commands-BX_OIIVR.js} +4 -4
- package/dist/{completion-cli-DrJGfJGl.js → completion-cli-CR77-jyv.js} +3 -3
- package/dist/{completion-cli-DOec3E2Z.js → completion-cli-DnjpxAag.js} +30 -30
- package/dist/{config-B00lvFac.js → config-Bdhomfei.js} +21 -7
- package/dist/{config-XBdA0ciN.js → config-BvMsmctM.js} +83 -9
- package/dist/{config-BqGVMf1y.js → config-QYrbd7x7.js} +60 -6
- package/dist/{config--NUdpACy.js → config-aFQssWKX.js} +21 -7
- package/dist/{config-guard-4kCO_rnQ.js → config-guard-CljaSxJd.js} +160 -51
- package/dist/{configure-B69emwZv.js → configure-BXLiucXo.js} +28 -25
- package/dist/{configure-sMhpLzFf.js → configure-BYPqXzGZ.js} +28 -25
- package/dist/control-auth-8Cf4WXpR.js +54 -0
- package/dist/control-auth-DBCu3qyv.js +54 -0
- package/dist/{control-service-Db_1V-KY.js → control-service-B5KnPqGP.js} +11 -5
- package/dist/{control-service-IRAmbcbN.js → control-service-DKnttEus.js} +10 -4
- package/dist/control-ui/assets/{index-CnB9IO4a.js → index-B4LPvte9.js} +369 -369
- package/dist/control-ui/assets/index-B4LPvte9.js.map +1 -0
- package/dist/control-ui/index.html +1 -1
- package/dist/{cron-cli-Cum2324v.js → cron-cli-D7BRjDv2.js} +20 -20
- package/dist/{cron-cli-DhUWcYdk.js → cron-cli-z1zk_FXQ.js} +19 -19
- package/dist/{daemon-cli-q7nkEF5-.js → daemon-cli-BDkU2ocb.js} +60 -21
- package/dist/{daemon-cli-CTC2CHci.js → daemon-cli-cNSF93-v.js} +59 -20
- package/dist/{daemon-runtime-c0uXH4Dl.js → daemon-runtime-B0tg_LsX.js} +3 -3
- package/dist/{daemon-runtime-UsK-tOty.js → daemon-runtime-Bsjeut6m.js} +3 -3
- package/dist/{deliver-hf-WKyWd.js → deliver-CIU9Npgs.js} +373 -281
- package/dist/{deliver-CT6KiDqO.js → deliver-DYYCo1G7.js} +369 -278
- package/dist/{deliver-T9d44OpZ.js → deliver-LsxKETro.js} +371 -279
- package/dist/{deliver-CPy8jYj9.js → deliver-xUU3mGHo.js} +369 -277
- package/dist/{deps-Bv1kLtwo.js → deps-QSwGcoNZ.js} +2 -2
- package/dist/{deps-DFQdAWQc.js → deps-lAAA2zYI.js} +2 -2
- package/dist/{devices-cli-Cm7U1py9.js → devices-cli-BG3-2oqt.js} +14 -14
- package/dist/{devices-cli-ZpjlfK-e.js → devices-cli-VIQtOvt_.js} +14 -14
- package/dist/{directory-cli-B14TUSJA.js → directory-cli-BCJwjVC0.js} +16 -16
- package/dist/{directory-cli-67kzd4I5.js → directory-cli-jYzZ02gk.js} +14 -14
- package/dist/{dispatcher-3ElQWGVI.js → dispatcher-DY51b-Zc.js} +2 -2
- package/dist/{dns-cli-CU-xfhTN.js → dns-cli-DHIiMJjS.js} +12 -12
- package/dist/{dns-cli-Dqj7O6Q_.js → dns-cli-pZlv87Ib.js} +11 -11
- package/dist/{docs-cli-CamBqzb5.js → docs-cli-2JDiwfzP.js} +8 -8
- package/dist/{docs-cli-Cj3L5oqB.js → docs-cli-BhkYqoIQ.js} +7 -7
- package/dist/{doctor-BV1kvbMm.js → doctor-Bf8EhNtA.js} +36 -35
- package/dist/{doctor-BJirShBi.js → doctor-sYG5V4Co.js} +34 -33
- package/dist/entry.js +56 -18
- package/dist/{env-BxRc6wWv.js → env-ONzUVAG2.js} +1 -1
- package/dist/{exec-CijMSZd9.js → exec-B8lXct-k.js} +503 -14
- package/dist/{exec-B8JKbXKW.js → exec-CACT5OAW.js} +1 -1
- package/dist/{exec-57A8Rlc8.js → exec-CJFFoM7H.js} +32 -13
- package/dist/{exec-Cv_Ofd1m.js → exec-YIosokWE.js} +1 -1
- package/dist/{exec-approvals-cli-DEzz9Iai.js → exec-approvals-cli-7LH0lwhO.js} +21 -21
- package/dist/{exec-approvals-cli-DhXj3hQX.js → exec-approvals-cli-apGnQbpj.js} +21 -21
- package/dist/extensionAPI.js +7733 -8746
- package/dist/fetch-DmiOpALK.js +274 -0
- package/dist/fetch-timeout-BEtUjM1S.js +274 -0
- package/dist/fetch-timeout-DEoXG_SF.js +274 -0
- package/dist/fetch-timeout-DTK9vxex.js +274 -0
- package/dist/{gateway-cli-D1EdIq8I.js → gateway-cli-DUdYxlZS.js} +491 -136
- package/dist/{gateway-cli-B_xDUDy2.js → gateway-cli-DbvWmE-9.js} +495 -140
- package/dist/{gateway-rpc-3B5y445n.js → gateway-rpc-BByb2Snz.js} +3 -3
- package/dist/{gateway-rpc-BoL2vinh.js → gateway-rpc-wXSCUZXj.js} +3 -3
- package/dist/{github-copilot-auth-Omqrto0J.js → github-copilot-auth-D7ewvpMd.js} +205 -17
- package/dist/{github-copilot-auth-CZxurvdz.js → github-copilot-auth-DDispnyz.js} +205 -17
- package/dist/{github-copilot-token-SLWintYd.js → github-copilot-token-Cfs0Wxr8.js} +1 -1
- package/dist/{gmail-setup-utils-BXQKsLtI.js → gmail-setup-utils-Cfns8TQx.js} +3 -3
- package/dist/{gmail-setup-utils-CHcssBOA.js → gmail-setup-utils-DJb-_5kO.js} +4 -4
- package/dist/{health-format-Dy1caGsq.js → health-format-KGPokKJH.js} +97 -42
- package/dist/{health-format-DrGFg8bx.js → health-format-LZDxu3rv.js} +95 -40
- package/dist/{help-format-DAj7l5uV.js → help-format-C48TXngO.js} +1 -1
- package/dist/{help-format-CUnac_bT.js → help-format-R5fLToDw.js} +1 -1
- package/dist/{hooks-cli-ptEf6TIM.js → hooks-cli-CT8JCRkH.js} +51 -46
- package/dist/{hooks-cli-Bhf5VRp1.js → hooks-cli-S1MKumJO.js} +49 -44
- package/dist/{hooks-status-Br-2bK2G.js → hooks-status-Cw0xD8Lt.js} +3 -3
- package/dist/{hooks-status-DNQJSa4B.js → hooks-status-D9MhwHRp.js} +3 -3
- package/dist/{image-rOFfK3PJ.js → image-Brk1sJbw.js} +10 -7
- package/dist/{image-fUwR7slg.js → image-C4Nn2p3e.js} +10 -7
- package/dist/{image-Ds4NLGPR.js → image-DgtfXMcX.js} +9 -6
- package/dist/{image-Dnnxt82I.js → image-RKwc3fsL.js} +8 -5
- package/dist/index.js +208 -97
- package/dist/{installs-CRSjQxbR.js → installs-CrLcWYHe.js} +8 -7
- package/dist/{installs-89zeUsVn.js → installs-DscWb9b9.js} +8 -7
- package/dist/{links-7M-j83As.js → links-B8LAzWwg.js} +1 -1
- package/dist/{links-C591fM9M.js → links-Eax1UO3w.js} +1 -1
- package/dist/llm-slug-generator.js +18 -19
- package/dist/{loader-wXwp4rZJ.js → loader-KjT074JR.js} +5722 -6888
- package/dist/{logging-MMRGFxGI.js → logging-BAyPwvdH.js} +1 -1
- package/dist/{logging-DuK6YXuK.js → logging-CRq4h04P.js} +2 -2
- package/dist/{login-qr-wM8BnKJh.js → login-qr-B6ZgAuIf.js} +5 -5
- package/dist/{login-qr-CPEsT6dN.js → login-qr-Bua-p0nG.js} +3 -4
- package/dist/{login-qr-CGEu5TU-.js → login-qr-CuvemJj4.js} +6 -6
- package/dist/{login-qr-DH150tTp.js → login-qr-Djr1JfIf.js} +2 -2
- package/dist/{logs-cli-ClgkHnfT.js → logs-cli-9IAV7rWY.js} +38 -22
- package/dist/{logs-cli-CmfINsOj.js → logs-cli-EiKzUFPa.js} +37 -21
- package/dist/{manager-DYo4PlVM.js → manager-BIMh_eSm.js} +7 -8
- package/dist/{manager-D6EbxDV4.js → manager-CwinWQoz.js} +5 -5
- package/dist/{manager-BbnHek5T.js → manager-DkqF1GiK.js} +9 -9
- package/dist/{manager-CcVYv0N5.js → manager-T1XfGchB.js} +8 -8
- package/dist/{manifest-registry-3It8Z8yN.js → manifest-registry-CQhdnDBZ.js} +40 -2
- package/dist/{manifest-registry-D5SiA3xq.js → manifest-registry-u0okVSkU.js} +40 -2
- package/dist/{message-channel-Cu61-7H6.js → message-channel-BLi2a6Yw.js} +1 -1
- package/dist/{message-channel-BlgPSDAh.js → message-channel-C_MmebBt.js} +1 -1
- package/dist/{model-auth-ioeR_zLX.js → model-auth-CabXIF6O.js} +116 -34
- package/dist/{model-selection-BK7DuyH8.js → model-selection-BLuqsGVB.js} +86 -30
- package/dist/{model-selection-CezC36lH.js → model-selection-C1GmkTAV.js} +84 -28
- package/dist/{models-cli-C3uGdOrd.js → models-cli-9jmDv-h3.js} +52 -48
- package/dist/{models-cli-CUIVPgXE.js → models-cli-zS9rtWz8.js} +53 -49
- package/dist/{node-cli-BxBGSuPE.js → node-cli-CrpTxTTs.js} +28 -26
- package/dist/{node-cli-CdYAsuQQ.js → node-cli-wemUMCg-.js} +28 -26
- package/dist/{node-service-u8g85nD3.js → node-service-C8DTHTMg.js} +2 -2
- package/dist/{node-service-CM5vkdIo.js → node-service-WQuEKz6W.js} +2 -2
- package/dist/{nodes-cli-By6yeCTB.js → nodes-cli-BaU2SIFw.js} +20 -20
- package/dist/{nodes-cli-BaVMTAPc.js → nodes-cli-Dx23D72n.js} +20 -20
- package/dist/{nodes-screen-Dvl_ohUY.js → nodes-screen-C0IuBqUL.js} +1 -1
- package/dist/{note-5WqioBRA.js → note-BhRSeNeu.js} +2 -2
- package/dist/{note-Ci08TSbV.js → note-hhtubr2j.js} +1 -1
- package/dist/{onboard-channels-DxXvp8og.js → onboard-channels-C501x8GI.js} +8 -8
- package/dist/{onboard-channels-CXhnVy4E.js → onboard-channels-Dxzroasd.js} +8 -8
- package/dist/{onboard-skills-CBxsRGyf.js → onboard-skills-DV0Qzvjj.js} +440 -136
- package/dist/{onboard-skills-DQwOQ6Ry.js → onboard-skills-rlBHcu3Q.js} +439 -135
- package/dist/{onboarding-Du_7qEng.js → onboarding-CN-EDLjd.js} +38 -38
- package/dist/{openclaw-root-JLDMp6ux.js → openclaw-root-1VeFrph_.js} +4 -0
- package/dist/{openclaw-root-Dw6gumSU.js → openclaw-root-BNlEap4i.js} +4 -0
- package/dist/{pairing-cli-CRQDpj8f.js → pairing-cli-CDHG4xuI.js} +15 -15
- package/dist/{pairing-cli-Cng1KFWw.js → pairing-cli-CQP34Dlx.js} +15 -15
- package/dist/{pairing-labels-Ciu3Zoxj.js → pairing-labels-B6CN0SNH.js} +1 -1
- package/dist/{pairing-labels-CWFEtSc3.js → pairing-labels-CgNHnjzT.js} +1 -1
- package/dist/{pairing-store-c-QQ2u8p.js → pairing-store-CmlRVqOz.js} +2 -2
- package/dist/{pairing-store-CgXR3ZWJ.js → pairing-store-Dp5_JGnG.js} +3 -3
- package/dist/{path-env-CXWUFfFv.js → path-env-CLvYNwtL.js} +1 -1
- package/dist/{path-env-BgLvMbz_.js → path-env-CaYUVIML.js} +2 -2
- package/dist/{paths-MnZaxqPw.js → paths-B0a4ywSO.js} +30 -5
- package/dist/{paths-Bkhd_qY8.js → paths-B49s6UZQ.js} +30 -5
- package/dist/{paths-DL6EIRTw.js → paths-D0O87MfH.js} +30 -5
- package/dist/{paths-IivnSNkP.js → paths-DLINmNFQ.js} +31 -6
- package/dist/{pi-embedded-CgPTEqlB.js → pi-embedded-Ctrt2kz0.js} +8759 -9600
- package/dist/{pi-embedded-helpers-DYH6OWft.js → pi-embedded-helpers-CMKLjW6X.js} +68 -9
- package/dist/{pi-embedded-helpers-y1_Se0yq.js → pi-embedded-helpers-CUzTc1v6.js} +241 -24
- package/dist/{pi-embedded-helpers-Bkpd4fTr.js → pi-embedded-helpers-DfwkwPYD.js} +67 -8
- package/dist/{pi-embedded-helpers-BbWRSUnc.js → pi-embedded-helpers-WDwx99UA.js} +347 -32
- package/dist/{pi-tools.policy-akYsGFiA.js → pi-tools.policy-BpsROZbz.js} +4 -4
- package/dist/{plugin-auto-enable-lZwe2yX5.js → plugin-auto-enable-Bqhc3w5n.js} +5 -5
- package/dist/{plugin-auto-enable-AOSOJ-v1.js → plugin-auto-enable-PW76g_PJ.js} +5 -5
- package/dist/plugin-sdk/agents/bash-process-registry.d.ts +1 -0
- package/dist/plugin-sdk/agents/models-config.providers.d.ts +10 -0
- package/dist/plugin-sdk/agents/pi-embedded-helpers/errors.d.ts +5 -1
- package/dist/plugin-sdk/agents/pi-embedded-helpers.d.ts +1 -1
- package/dist/plugin-sdk/agents/pi-embedded-runner/google.d.ts +1 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/params.d.ts +2 -0
- package/dist/plugin-sdk/agents/pi-embedded-runner/run/payloads.d.ts +1 -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/tools/browser-tool.schema.d.ts +1 -1
- package/dist/plugin-sdk/agents/tools/web-search.d.ts +10 -1
- package/dist/plugin-sdk/agents/usage.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/heartbeat.d.ts +1 -1
- package/dist/plugin-sdk/auto-reply/reply/get-reply-directives.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/mentions.d.ts +1 -0
- package/dist/plugin-sdk/auto-reply/reply/model-selection.d.ts +3 -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/auto-reply/types.d.ts +2 -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/commands/onboard-types.d.ts +7 -1
- 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/types.memory.d.ts +2 -0
- package/dist/plugin-sdk/config/zod-schema.agents.d.ts +1 -0
- package/dist/plugin-sdk/config/zod-schema.d.ts +13 -1
- package/dist/plugin-sdk/config/zod-schema.hooks.d.ts +1 -1
- 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/cron/service/jobs.d.ts +8 -0
- package/dist/plugin-sdk/cron/service/state.d.ts +1 -0
- package/dist/plugin-sdk/cron/types.d.ts +2 -0
- package/dist/plugin-sdk/discord/monitor/allow-list.d.ts +15 -0
- package/dist/plugin-sdk/discord/send.types.d.ts +5 -0
- package/dist/plugin-sdk/gateway/auth.d.ts +36 -0
- package/dist/plugin-sdk/gateway/protocol/index.d.ts +0 -3
- package/dist/plugin-sdk/gateway/protocol/schema/agent.d.ts +7 -1
- package/dist/plugin-sdk/gateway/session-utils.fs.d.ts +3 -1
- package/dist/plugin-sdk/index.js +935 -660
- package/dist/plugin-sdk/infra/binaries.d.ts +3 -0
- package/dist/plugin-sdk/infra/heartbeat-active-hours.d.ts +5 -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/console.d.ts +1 -0
- package/dist/plugin-sdk/logging/logger.d.ts +1 -1
- package/dist/plugin-sdk/logging/state.d.ts +1 -0
- package/dist/plugin-sdk/markdown/ir.d.ts +1 -1
- package/dist/plugin-sdk/markdown/whatsapp.d.ts +14 -0
- package/dist/plugin-sdk/media/input-files.d.ts +5 -0
- package/dist/plugin-sdk/media-understanding/audio-preflight.d.ts +16 -0
- package/dist/plugin-sdk/media-understanding/types.d.ts +1 -0
- package/dist/plugin-sdk/memory/backend-config.d.ts +2 -1
- package/dist/plugin-sdk/memory/qmd-manager.d.ts +2 -0
- package/dist/plugin-sdk/memory/qmd-query-parser.d.ts +8 -0
- package/dist/plugin-sdk/process/command-queue.d.ts +16 -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/plugin-sdk/slack/monitor/commands.d.ts +5 -0
- package/dist/plugin-sdk/telegram/bot-message-context.d.ts +2 -1
- package/dist/plugin-sdk/telegram/send.d.ts +3 -0
- package/dist/plugin-sdk/web/media.d.ts +2 -0
- package/dist/{plugins-Db5BiELK.js → plugins-4Hqd1WGf.js} +3 -3
- package/dist/{plugins-CNaHNND_.js → plugins-X7d_tfTE.js} +4 -4
- package/dist/{plugins-cli-8G-hQPCu.js → plugins-cli-Bgku3EGj.js} +253 -44
- package/dist/{plugins-cli-CDiocaDE.js → plugins-cli-CVToH3if.js} +257 -48
- package/dist/{ports-BeebfNCb.js → ports-qkt29rdC.js} +2 -2
- package/dist/{program-0Cj9YxRN.js → program-Cf7lkBur.js} +82 -80
- package/dist/{progress-DIQJt9Va.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-CjQRlDx4.js → prompt-style-CIbmaxSa.js} +1 -1
- package/dist/{pw-ai-C43wv1ZF.js → pw-ai-8mdv3h-d.js} +7 -6
- package/dist/{pw-ai-COWYvUfG.js → pw-ai-CM1IsSgZ.js} +6 -6
- package/dist/{pw-ai-BxJ-KCIy.js → pw-ai-FGoRVblI.js} +5 -6
- package/dist/{pw-ai-CsvaObGM.js → pw-ai-sS1fRKW_.js} +3 -3
- package/dist/{qmd-manager-CpsjQyaZ.js → qmd-manager-C67Fc8aN.js} +79 -26
- package/dist/{qmd-manager-C9YWFeG6.js → qmd-manager-CXVbfg99.js} +81 -26
- package/dist/{qmd-manager-C02E8ixK.js → qmd-manager-RMRE8Tqt.js} +81 -26
- package/dist/{qmd-manager-BzY2LQTT.js → qmd-manager-pyc_MTIe.js} +78 -23
- package/dist/{register.subclis-DUkirdHn.js → register.subclis-C02e4zuJ.js} +29 -29
- package/dist/{reply--b7BsXGP.js → reply-DICXkh_C.js} +7289 -8455
- package/dist/{routes-DUkEKAc1.js → routes-CmOI1hIH.js} +29 -11
- package/dist/{routes-B4QQiFju.js → routes-DewK5tq2.js} +29 -12
- package/dist/{rpc-CuMtxrRT.js → rpc-DHr30euf.js} +3 -3
- package/dist/{rpc-Blt6MJ4F.js → rpc-T300F8zI.js} +3 -3
- package/dist/{run-main-XZcPA23b.js → run-main-C5wpthq1.js} +84 -82
- package/dist/runner-CY0nmVme.js +1886 -0
- package/dist/runner-Cfm5nTMc.js +1785 -0
- package/dist/runner-D_dujMod.js +1886 -0
- package/dist/runner-DrGYLH5K.js +1785 -0
- package/dist/{sandbox-Aks-9EcZ.js → sandbox-BKYnhYQH.js} +24 -17
- package/dist/{sandbox-DqUO2K83.js → sandbox-Bhjnh1Xg.js} +23 -16
- package/dist/{sandbox-cli-C99Thxi8.js → sandbox-cli-DBsAjZJN.js} +21 -21
- package/dist/{sandbox-cli-CJqRM4V6.js → sandbox-cli-rV9LtFeu.js} +21 -21
- package/dist/{security-cli-iqYLMOz3.js → security-cli-BIwJM_rs.js} +27 -27
- package/dist/{security-cli-DW3lCz-o.js → security-cli-BRjny8Yu.js} +27 -27
- package/dist/{server-context-fX4xiYRh.js → server-context-BGpGs3qd.js} +7 -7
- package/dist/{server-context-8Qt35QdF.js → server-context-Cl0U0vE3.js} +7 -7
- package/dist/{server-node-events-CHWXfb_T.js → server-node-events-CBfTbiTA.js} +48 -44
- package/dist/{server-node-events-BzrEnKLX.js → server-node-events-QCvh8EgI.js} +45 -41
- package/dist/{service-Cd4BxKuo.js → service--nPk7DvT.js} +8 -4
- package/dist/{service-DDPRbf8a.js → service-99RDXwX4.js} +8 -4
- package/dist/{service-audit-CCFxuvKs.js → service-audit-DnLmRGQt.js} +4 -4
- package/dist/{service-audit-x6jCN-6a.js → service-audit-ckBaRCVC.js} +4 -4
- package/dist/{session-cost-usage-CcCEQNuc.js → session-cost-usage-D7HuoSSD.js} +12 -10
- package/dist/{session-cost-usage-PvyVZz-g.js → session-cost-usage-D9hHANWI.js} +12 -10
- package/dist/{shared-ILguacOr.js → shared-Bs4vduG4.js} +3 -3
- package/dist/{shared-CagUDdmp.js → shared-CEY5IkwG.js} +3 -3
- package/dist/{shared-gOyV38rM.js → shared-DRohONn_.js} +4 -4
- package/dist/{shared-BDk_zC9p.js → shared-ICqOZibV.js} +4 -4
- package/dist/{skill-scanner-C_fQzVDu.js → skill-scanner-CucvxYhu.js} +1 -1
- package/dist/{skill-scanner-DrVEHfC6.js → skill-scanner-rHMtUHtP.js} +1 -1
- package/dist/{skills-D5UZZZSY.js → skills-DRjfSQT3.js} +141 -6
- package/dist/{skills-ccAgQ3Ad.js → skills-DprQj9X2.js} +142 -7
- package/dist/{skills-cli-DQilTG3n.js → skills-cli-9WO-C55s.js} +12 -12
- package/dist/{skills-cli-ggyLBtAY.js → skills-cli-B9eej-EW.js} +13 -13
- package/dist/{skills-status-BosMnzIs.js → skills-status-5U3P3YfJ.js} +3 -3
- package/dist/{skills-status-DjtPPMnY.js → skills-status-TDIgVd1K.js} +2 -2
- package/dist/{sqlite-B7FPASCO.js → sqlite-BINzs1U0.js} +2 -2
- package/dist/{sqlite-Btrgi7-j.js → sqlite-D4w5TejA.js} +3 -3
- package/dist/{sqlite-BrQ9tw8B.js → sqlite-DRRHmlug.js} +3 -3
- package/dist/{sqlite-HepBVDoX.js → sqlite-F6PGkEm1.js} +2 -2
- package/dist/{status-BByCntWS.js → status-BKGkKC_v.js} +3 -3
- package/dist/{status-Dt7RE_Yy.js → status-CiHtHdaa.js} +4 -4
- package/dist/{status-zfL4Yej7.js → status-DDWoOpeB.js} +37 -37
- package/dist/{subsystem-Bh1Y_6Uv.js → subsystem-BoExtIHo.js} +52 -17
- package/dist/{system-cli-DwuUkdkH.js → system-cli-B6lr60Io.js} +14 -14
- package/dist/{system-cli-Clqsx8U5.js → system-cli-CprW9G3h.js} +14 -14
- package/dist/{systemd-BEWwfwn0.js → systemd-C0VZriGM.js} +3 -3
- package/dist/{systemd-D6wTPnHi.js → systemd-DrmBtJ5T.js} +3 -3
- package/dist/{systemd-hints-zi4ohCOY.js → systemd-hints-DZtXiVHa.js} +1 -1
- package/dist/{systemd-linger-CDo2UbHM.js → systemd-linger-NC2kl1SC.js} +2 -2
- package/dist/{systemd-linger-BxjTrgoH.js → systemd-linger-xdn3BdPh.js} +2 -2
- package/dist/{table-DEnmtvl5.js → table-B8dx3v4v.js} +2 -2
- package/dist/{table-cCoGqLsk.js → table-CwulTLQp.js} +1 -1
- package/dist/{tool-display-DskiU8Kt.js → tool-display-CZRIDMRm.js} +2 -2
- package/dist/{tool-display-o-dDAlqF.js → tool-display-ClRud3pg.js} +2 -2
- package/dist/{tui-BdJWZdto.js → tui-CVTQn-dC.js} +14 -13
- package/dist/{tui-Bc7XUQGP.js → tui-Lu8FdrlK.js} +13 -14
- package/dist/{tui-cli-BGYh0UL0.js → tui-cli-BLpTj1X9.js} +27 -27
- package/dist/{tui-cli-D3n-O9zB.js → tui-cli-BLx5kL2I.js} +26 -26
- package/dist/{tui-formatters-CA85v4U2.js → tui-formatters-CNySEfJN.js} +6 -6
- package/dist/{tui-formatters-C3NarH24.js → tui-formatters-DePhZK3J.js} +6 -6
- package/dist/{update-JB16aPIY.js → update-DHVxMTpQ.js} +3 -3
- package/dist/{update-Ct9sqJC_.js → update-DU1geolI.js} +3 -3
- package/dist/{update-cli-wWKDS3cm.js → update-cli-C0hUvJWK.js} +89 -71
- package/dist/{update-cli-DDXp_N9B.js → update-cli-Wb1GB3rL.js} +88 -70
- package/dist/{update-runner-ChTf6O6p.js → update-runner--ixK4J3W.js} +11 -11
- package/dist/{update-runner-CmE6cHdn.js → update-runner-7Qa1T9y6.js} +10 -10
- package/dist/{utils-Dk86IbEs.js → utils-BLJAc3ZV.js} +1 -1
- package/dist/{utils-es4ygvQ-.js → utils-Cd9QdCHh.js} +1 -1
- package/dist/{webhooks-cli-CVIE9TtX.js → webhooks-cli-DgcMy7RG.js} +12 -12
- package/dist/{webhooks-cli-BmKSiQQC.js → webhooks-cli-aVzUcJY9.js} +11 -11
- package/dist/{widearea-dns-2ah0bkAj.js → widearea-dns-BaIgNEhY.js} +3 -3
- package/dist/{widearea-dns-CMIG6-74.js → widearea-dns-DzuRdwk5.js} +3 -3
- package/dist/{ws-DtDKpbLR.js → ws-CHCQHs0F.js} +1 -1
- package/dist/{ws-log-BP3z_g6Z.js → ws-log-CIXbLCka.js} +1 -1
- package/dist/{ws-log-D7MkvKhg.js → ws-log-DcQFZByi.js} +2 -2
- package/dist/{wsl-Cwo7X0Un.js → wsl-BUOkxKJu.js} +2 -2
- package/docs/assets/install-script.svg +1 -0
- package/docs/automation/hooks.md +1 -38
- package/docs/automation/webhook.md +43 -2
- package/docs/channels/discord.md +389 -381
- package/docs/channels/imessage.md +229 -218
- package/docs/channels/slack.md +294 -415
- package/docs/channels/telegram.md +401 -505
- package/docs/channels/whatsapp.md +338 -310
- package/docs/ci.md +0 -12
- package/docs/cli/hooks.md +1 -14
- package/docs/cli/index.md +6 -1
- package/docs/cli/logs.md +4 -0
- package/docs/cli/onboard.md +30 -0
- package/docs/cli/plugins.md +20 -1
- package/docs/cli/security.md +1 -0
- package/docs/concepts/memory.md +7 -4
- package/docs/concepts/session-tool.md +1 -0
- package/docs/docs.json +11 -11
- package/docs/gateway/configuration-examples.md +9 -2
- package/docs/gateway/configuration-reference.md +2329 -0
- package/docs/gateway/configuration.md +338 -3304
- package/docs/gateway/index.md +162 -238
- 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/hetzner.md +21 -0
- package/docs/install/installer.md +20 -0
- package/docs/nodes/audio.md +19 -0
- package/docs/platforms/mac/release.md +7 -7
- package/docs/providers/glm.md +3 -3
- package/docs/providers/index.md +1 -0
- package/docs/providers/litellm.md +153 -0
- package/docs/providers/zai.md +2 -2
- package/docs/reference/templates/AGENTS.md +26 -26
- package/docs/reference/templates/HEARTBEAT.md +31 -2
- package/docs/reference/templates/SOUL.md +14 -8
- package/docs/reference/transcript-hygiene.md +18 -0
- package/docs/start/getting-started.md +5 -0
- package/docs/start/wizard-cli-automation.md +17 -0
- package/docs/start/wizard-cli-reference.md +12 -0
- package/docs/tools/browser.md +6 -0
- package/docs/zh-CN/automation/hooks.md +1 -38
- package/docs/zh-CN/cli/hooks.md +1 -14
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/bluebubbles/src/monitor.test.ts +40 -28
- package/extensions/bluebubbles/src/monitor.ts +0 -4
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +10 -10
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/package.json +2 -5
- package/extensions/feishu/src/bot.checkBotMentioned.test.ts +64 -0
- package/extensions/feishu/src/bot.ts +1 -1
- package/extensions/feishu/src/channel.test.ts +48 -0
- package/extensions/feishu/src/channel.ts +1 -3
- package/extensions/feishu/src/config-schema.ts +6 -0
- package/extensions/feishu/src/docx.ts +14 -4
- package/extensions/feishu/src/media.test.ts +151 -0
- package/extensions/feishu/src/media.ts +27 -13
- 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/google-antigravity-auth/package.json +1 -1
- package/extensions/google-gemini-cli-auth/package.json +1 -1
- package/extensions/googlechat/package.json +1 -1
- package/extensions/imessage/package.json +1 -1
- package/extensions/irc/package.json +1 -1
- package/extensions/irc/src/client.ts +1 -1
- package/extensions/line/package.json +1 -1
- package/extensions/llm-task/package.json +1 -1
- package/extensions/lobster/package.json +1 -1
- package/extensions/matrix/CHANGELOG.md +6 -0
- package/extensions/matrix/package.json +2 -2
- package/extensions/mattermost/package.json +1 -1
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/index.ts +6 -2
- package/extensions/memory-lancedb/package.json +2 -2
- package/extensions/minimax-portal-auth/index.ts +7 -5
- package/extensions/minimax-portal-auth/package.json +1 -1
- package/extensions/msteams/CHANGELOG.md +6 -0
- package/extensions/msteams/package.json +1 -1
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +2 -2
- package/extensions/open-prose/package.json +1 -1
- package/extensions/signal/package.json +1 -1
- package/extensions/slack/package.json +1 -1
- package/extensions/telegram/package.json +1 -1
- package/extensions/tlon/package.json +1 -1
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/voice-call/src/media-stream.ts +7 -1
- package/extensions/voice-call/src/providers/twilio.test.ts +5 -3
- package/extensions/voice-call/src/providers/twilio.ts +12 -1
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/package.json +26 -22
- package/dist/auth-BcNHFK-i.js +0 -184
- package/dist/auth-BvIPpm7G.js +0 -184
- package/dist/boolean-M-esQJt6.js +0 -30
- package/dist/bundled/soul-evil/HOOK.md +0 -71
- package/dist/bundled/soul-evil/handler.js +0 -194
- package/dist/cli-DJbWJ9aB.js +0 -89
- package/dist/config-CI7EpvlP.js +0 -15
- package/dist/control-ui/assets/index-CnB9IO4a.js.map +0 -1
- package/dist/date-time-c6HTX6IW.js +0 -187
- package/dist/frontmatter-xwTm0734.js +0 -105
- package/dist/parse-duration-De_tAQSe.js +0 -24
- package/dist/session-key-nXYQSv-a.js +0 -167
- package/dist/utils-dp_OM900.js +0 -476
- package/docs/hooks/soul-evil.md +0 -69
- package/docs/zh-CN/hooks/soul-evil.md +0 -72
- /package/dist/{archive-CXhvR9nU.js → archive-beaSfAzA.js} +0 -0
- /package/dist/{brew-BIrWdDps.js → brew-BUIxHEkn.js} +0 -0
- /package/dist/{brew-B7YK4ZoL.js → brew-ROHf0-Xp.js} +0 -0
- /package/dist/{cli-utils-PlLcDZlM.js → cli-utils-CRhVAaLV.js} +0 -0
- /package/dist/{cli-utils-R-ECs5cY.js → cli-utils-LcHOt63h.js} +0 -0
- /package/dist/{command-format-BUxhT1xL.js → command-format-qUVxzqYm.js} +0 -0
- /package/dist/{constants-CNTiY-ZN.js → constants-BvQ6S8j5.js} +0 -0
- /package/dist/{constants-DuoCkWRh.js → constants-JPeoOZnw.js} +0 -0
- /package/dist/{errors-D3tYRJWG.js → errors-B91HIDPD.js} +0 -0
- /package/dist/{errors-B0eT3jVv.js → errors-Bv81hF2P.js} +0 -0
- /package/dist/{errors-x4NYs-1P.js → errors-DjZBTJJ3.js} +0 -0
- /package/dist/{exec-approvals-DGPTjO0N.js → exec-approvals-Cb4ZLukq.js} +0 -0
- /package/dist/{exec-approvals-DhmKpiIo.js → exec-approvals-DQ8TVVmj.js} +0 -0
- /package/dist/{format-CaxeRcue.js → format-CNU-Zkrz.js} +0 -0
- /package/dist/{format-DLOJPZmo.js → format-DcfK-dwd.js} +0 -0
- /package/dist/{format-duration-Be5Z7JdJ.js → format-duration-84n6_DgO.js} +0 -0
- /package/dist/{format-duration-CEmFWLyX.js → format-duration-Bo9zNKwO.js} +0 -0
- /package/dist/{format-relative-79_Y1n2Y.js → format-relative-CZOlQ2pA.js} +0 -0
- /package/dist/{format-relative-Db7eqEu8.js → format-relative-cegC_FF5.js} +0 -0
- /package/dist/{github-copilot-token-C9IJh2Pn.js → github-copilot-token-DkiRbJdR.js} +0 -0
- /package/dist/{helpers-CQI-5xS9.js → helpers-8O7IVGO-.js} +0 -0
- /package/dist/{helpers-CRzoyyXS.js → helpers-D_jqdWkd.js} +0 -0
- /package/dist/{helpers-C89IG08W.js → helpers-HyeZXsnu.js} +0 -0
- /package/dist/{is-main-WWuz28Ip.js → is-main-BWoXGz7p.js} +0 -0
- /package/dist/{logging-BzvBIA3Y.js → logging-fywhKCmE.js} +0 -0
- /package/dist/{nodes-screen-lykd2cny.js → nodes-screen-CdCWeiwy.js} +0 -0
- /package/dist/{parse-Cjiudy6x.js → parse-Bw0oH-rT.js} +0 -0
- /package/dist/{parse-DqAvJRIf.js → parse-ioZhOtha.js} +0 -0
- /package/dist/{parse-log-line-CUrpqe1w.js → parse-log-line-BoDqomM4.js} +0 -0
- /package/dist/{parse-log-line-D2UGw0wR.js → parse-log-line-DPxH1XZx.js} +0 -0
- /package/dist/{parse-timeout-DFSPLxpY.js → parse-timeout-D1XX_zN_.js} +0 -0
- /package/dist/{parse-timeout-DV8NQQWk.js → parse-timeout-DMW-z4Iz.js} +0 -0
- /package/dist/{pi-model-discovery-CV2V1HHz.js → pi-model-discovery-DqgqUyAv.js} +0 -0
- /package/dist/{pi-model-discovery-DzFOAbQt.js → pi-model-discovery-EwKVHlZB.js} +0 -0
- /package/dist/{prompts--d-6l5Ln.js → prompts-Bg96reub.js} +0 -0
- /package/dist/{redact-DAKeu7PA.js → redact-BRsnXqwD.js} +0 -0
- /package/dist/{redact-DuEEf1p1.js → redact-Br9GfacZ.js} +0 -0
- /package/dist/{redact-BOIof271.js → redact-BrXLgslJ.js} +0 -0
- /package/dist/{status-Cv36yYdi.js → status-BRZfQbJ2.js} +0 -0
- /package/dist/{status-Drziap9H.js → status-CoAy6bEC.js} +0 -0
- /package/dist/{systemd-hints-CH4pbCFD.js → systemd-hints-CXNtLw9Q.js} +0 -0
- /package/dist/{tailnet-DGRSvYuQ.js → tailnet-DATIFSsY.js} +0 -0
- /package/dist/{transcript-events-BlIONGVn.js → transcript-events-BHS7QoRl.js} +0 -0
- /package/dist/{transcript-events-C1hdue6u.js → transcript-events-Bp7fGnwv.js} +0 -0
- /package/dist/{transcript-events-CZ8CG4ht.js → transcript-events-BtNd-j6q.js} +0 -0
- /package/dist/{usage-format-6Uar63S0.js → usage-format-C4JfTbSp.js} +0 -0
- /package/dist/{usage-format-hd37en6b.js → usage-format-CpORtVCG.js} +0 -0
|
@@ -1,19 +1,275 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-Cbj13DAv.js";
|
|
2
|
-
import {
|
|
2
|
+
import { S as logVerbose, T as shouldLogVerbose, lt as getActivePluginRegistry, o as createSubsystemLogger } from "./entry.js";
|
|
3
3
|
import { c as normalizeAccountId$1 } from "./session-key-DVvxnFKg.js";
|
|
4
|
-
import { c as escapeRegExp, y as resolveUserPath } from "./utils-
|
|
5
|
-
import { i as loadConfig } from "./config-
|
|
6
|
-
import { t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-
|
|
7
|
-
import { r as normalizeChannelId, t as getChannelPlugin } from "./plugins-
|
|
8
|
-
import {
|
|
9
|
-
import { i as isMessagingToolDuplicate } from "./pi-embedded-helpers-
|
|
10
|
-
import {
|
|
4
|
+
import { c as escapeRegExp, y as resolveUserPath } from "./utils-BLJAc3ZV.js";
|
|
5
|
+
import { i as loadConfig } from "./config-Bdhomfei.js";
|
|
6
|
+
import { t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-C_MmebBt.js";
|
|
7
|
+
import { r as normalizeChannelId, t as getChannelPlugin } from "./plugins-4Hqd1WGf.js";
|
|
8
|
+
import { S as mediaKindFromMime, c as convertHeicToJpeg, d as optimizeImageToPng, f as resizeToJpeg, m as extensionForMime, p as detectMime, r as saveMediaBuffer, u as hasAlphaChannel, x as maxBytesForKind } from "./routes-DewK5tq2.js";
|
|
9
|
+
import { i as isMessagingToolDuplicate } from "./pi-embedded-helpers-DfwkwPYD.js";
|
|
10
|
+
import { r as fetchRemoteMedia, t as fetchWithTimeout } from "./fetch-timeout-DTK9vxex.js";
|
|
11
|
+
import { l as appendAssistantMessageToSessionTranscript, ot as resolveSignalAccount, rt as getChannelDock, u as resolveMirroredTranscriptText } from "./sandbox-BKYnhYQH.js";
|
|
11
12
|
import path from "node:path";
|
|
13
|
+
import os from "node:os";
|
|
12
14
|
import fs from "node:fs/promises";
|
|
13
15
|
import { fileURLToPath } from "node:url";
|
|
14
16
|
import { randomUUID } from "node:crypto";
|
|
15
17
|
import MarkdownIt from "markdown-it";
|
|
16
18
|
|
|
19
|
+
//#region src/plugins/hooks.ts
|
|
20
|
+
/**
|
|
21
|
+
* Get hooks for a specific hook name, sorted by priority (higher first).
|
|
22
|
+
*/
|
|
23
|
+
function getHooksForName(registry, hookName) {
|
|
24
|
+
return registry.typedHooks.filter((h) => h.hookName === hookName).toSorted((a, b) => (b.priority ?? 0) - (a.priority ?? 0));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a hook runner for a specific registry.
|
|
28
|
+
*/
|
|
29
|
+
function createHookRunner(registry, options = {}) {
|
|
30
|
+
const logger = options.logger;
|
|
31
|
+
const catchErrors = options.catchErrors ?? true;
|
|
32
|
+
/**
|
|
33
|
+
* Run a hook that doesn't return a value (fire-and-forget style).
|
|
34
|
+
* All handlers are executed in parallel for performance.
|
|
35
|
+
*/
|
|
36
|
+
async function runVoidHook(hookName, event, ctx) {
|
|
37
|
+
const hooks = getHooksForName(registry, hookName);
|
|
38
|
+
if (hooks.length === 0) return;
|
|
39
|
+
logger?.debug?.(`[hooks] running ${hookName} (${hooks.length} handlers)`);
|
|
40
|
+
const promises = hooks.map(async (hook) => {
|
|
41
|
+
try {
|
|
42
|
+
await hook.handler(event, ctx);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
const msg = `[hooks] ${hookName} handler from ${hook.pluginId} failed: ${String(err)}`;
|
|
45
|
+
if (catchErrors) logger?.error(msg);
|
|
46
|
+
else throw new Error(msg, { cause: err });
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
await Promise.all(promises);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Run a hook that can return a modifying result.
|
|
53
|
+
* Handlers are executed sequentially in priority order, and results are merged.
|
|
54
|
+
*/
|
|
55
|
+
async function runModifyingHook(hookName, event, ctx, mergeResults) {
|
|
56
|
+
const hooks = getHooksForName(registry, hookName);
|
|
57
|
+
if (hooks.length === 0) return;
|
|
58
|
+
logger?.debug?.(`[hooks] running ${hookName} (${hooks.length} handlers, sequential)`);
|
|
59
|
+
let result;
|
|
60
|
+
for (const hook of hooks) try {
|
|
61
|
+
const handlerResult = await hook.handler(event, ctx);
|
|
62
|
+
if (handlerResult !== void 0 && handlerResult !== null) if (mergeResults && result !== void 0) result = mergeResults(result, handlerResult);
|
|
63
|
+
else result = handlerResult;
|
|
64
|
+
} catch (err) {
|
|
65
|
+
const msg = `[hooks] ${hookName} handler from ${hook.pluginId} failed: ${String(err)}`;
|
|
66
|
+
if (catchErrors) logger?.error(msg);
|
|
67
|
+
else throw new Error(msg, { cause: err });
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Run before_agent_start hook.
|
|
73
|
+
* Allows plugins to inject context into the system prompt.
|
|
74
|
+
* Runs sequentially, merging systemPrompt and prependContext from all handlers.
|
|
75
|
+
*/
|
|
76
|
+
async function runBeforeAgentStart(event, ctx) {
|
|
77
|
+
return runModifyingHook("before_agent_start", event, ctx, (acc, next) => ({
|
|
78
|
+
systemPrompt: next.systemPrompt ?? acc?.systemPrompt,
|
|
79
|
+
prependContext: acc?.prependContext && next.prependContext ? `${acc.prependContext}\n\n${next.prependContext}` : next.prependContext ?? acc?.prependContext
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Run agent_end hook.
|
|
84
|
+
* Allows plugins to analyze completed conversations.
|
|
85
|
+
* Runs in parallel (fire-and-forget).
|
|
86
|
+
*/
|
|
87
|
+
async function runAgentEnd(event, ctx) {
|
|
88
|
+
return runVoidHook("agent_end", event, ctx);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Run before_compaction hook.
|
|
92
|
+
*/
|
|
93
|
+
async function runBeforeCompaction(event, ctx) {
|
|
94
|
+
return runVoidHook("before_compaction", event, ctx);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Run after_compaction hook.
|
|
98
|
+
*/
|
|
99
|
+
async function runAfterCompaction(event, ctx) {
|
|
100
|
+
return runVoidHook("after_compaction", event, ctx);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Run message_received hook.
|
|
104
|
+
* Runs in parallel (fire-and-forget).
|
|
105
|
+
*/
|
|
106
|
+
async function runMessageReceived(event, ctx) {
|
|
107
|
+
return runVoidHook("message_received", event, ctx);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Run message_sending hook.
|
|
111
|
+
* Allows plugins to modify or cancel outgoing messages.
|
|
112
|
+
* Runs sequentially.
|
|
113
|
+
*/
|
|
114
|
+
async function runMessageSending(event, ctx) {
|
|
115
|
+
return runModifyingHook("message_sending", event, ctx, (acc, next) => ({
|
|
116
|
+
content: next.content ?? acc?.content,
|
|
117
|
+
cancel: next.cancel ?? acc?.cancel
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Run message_sent hook.
|
|
122
|
+
* Runs in parallel (fire-and-forget).
|
|
123
|
+
*/
|
|
124
|
+
async function runMessageSent(event, ctx) {
|
|
125
|
+
return runVoidHook("message_sent", event, ctx);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Run before_tool_call hook.
|
|
129
|
+
* Allows plugins to modify or block tool calls.
|
|
130
|
+
* Runs sequentially.
|
|
131
|
+
*/
|
|
132
|
+
async function runBeforeToolCall(event, ctx) {
|
|
133
|
+
return runModifyingHook("before_tool_call", event, ctx, (acc, next) => ({
|
|
134
|
+
params: next.params ?? acc?.params,
|
|
135
|
+
block: next.block ?? acc?.block,
|
|
136
|
+
blockReason: next.blockReason ?? acc?.blockReason
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Run after_tool_call hook.
|
|
141
|
+
* Runs in parallel (fire-and-forget).
|
|
142
|
+
*/
|
|
143
|
+
async function runAfterToolCall(event, ctx) {
|
|
144
|
+
return runVoidHook("after_tool_call", event, ctx);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Run tool_result_persist hook.
|
|
148
|
+
*
|
|
149
|
+
* This hook is intentionally synchronous: it runs in hot paths where session
|
|
150
|
+
* transcripts are appended synchronously.
|
|
151
|
+
*
|
|
152
|
+
* Handlers are executed sequentially in priority order (higher first). Each
|
|
153
|
+
* handler may return `{ message }` to replace the message passed to the next
|
|
154
|
+
* handler.
|
|
155
|
+
*/
|
|
156
|
+
function runToolResultPersist(event, ctx) {
|
|
157
|
+
const hooks = getHooksForName(registry, "tool_result_persist");
|
|
158
|
+
if (hooks.length === 0) return;
|
|
159
|
+
let current = event.message;
|
|
160
|
+
for (const hook of hooks) try {
|
|
161
|
+
const out = hook.handler({
|
|
162
|
+
...event,
|
|
163
|
+
message: current
|
|
164
|
+
}, ctx);
|
|
165
|
+
if (out && typeof out.then === "function") {
|
|
166
|
+
const msg = `[hooks] tool_result_persist handler from ${hook.pluginId} returned a Promise; this hook is synchronous and the result was ignored.`;
|
|
167
|
+
if (catchErrors) {
|
|
168
|
+
logger?.warn?.(msg);
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
throw new Error(msg);
|
|
172
|
+
}
|
|
173
|
+
const next = out?.message;
|
|
174
|
+
if (next) current = next;
|
|
175
|
+
} catch (err) {
|
|
176
|
+
const msg = `[hooks] tool_result_persist handler from ${hook.pluginId} failed: ${String(err)}`;
|
|
177
|
+
if (catchErrors) logger?.error(msg);
|
|
178
|
+
else throw new Error(msg, { cause: err });
|
|
179
|
+
}
|
|
180
|
+
return { message: current };
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Run session_start hook.
|
|
184
|
+
* Runs in parallel (fire-and-forget).
|
|
185
|
+
*/
|
|
186
|
+
async function runSessionStart(event, ctx) {
|
|
187
|
+
return runVoidHook("session_start", event, ctx);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Run session_end hook.
|
|
191
|
+
* Runs in parallel (fire-and-forget).
|
|
192
|
+
*/
|
|
193
|
+
async function runSessionEnd(event, ctx) {
|
|
194
|
+
return runVoidHook("session_end", event, ctx);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Run gateway_start hook.
|
|
198
|
+
* Runs in parallel (fire-and-forget).
|
|
199
|
+
*/
|
|
200
|
+
async function runGatewayStart(event, ctx) {
|
|
201
|
+
return runVoidHook("gateway_start", event, ctx);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Run gateway_stop hook.
|
|
205
|
+
* Runs in parallel (fire-and-forget).
|
|
206
|
+
*/
|
|
207
|
+
async function runGatewayStop(event, ctx) {
|
|
208
|
+
return runVoidHook("gateway_stop", event, ctx);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Check if any hooks are registered for a given hook name.
|
|
212
|
+
*/
|
|
213
|
+
function hasHooks(hookName) {
|
|
214
|
+
return registry.typedHooks.some((h) => h.hookName === hookName);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Get count of registered hooks for a given hook name.
|
|
218
|
+
*/
|
|
219
|
+
function getHookCount(hookName) {
|
|
220
|
+
return registry.typedHooks.filter((h) => h.hookName === hookName).length;
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
runBeforeAgentStart,
|
|
224
|
+
runAgentEnd,
|
|
225
|
+
runBeforeCompaction,
|
|
226
|
+
runAfterCompaction,
|
|
227
|
+
runMessageReceived,
|
|
228
|
+
runMessageSending,
|
|
229
|
+
runMessageSent,
|
|
230
|
+
runBeforeToolCall,
|
|
231
|
+
runAfterToolCall,
|
|
232
|
+
runToolResultPersist,
|
|
233
|
+
runSessionStart,
|
|
234
|
+
runSessionEnd,
|
|
235
|
+
runGatewayStart,
|
|
236
|
+
runGatewayStop,
|
|
237
|
+
hasHooks,
|
|
238
|
+
getHookCount
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/plugins/hook-runner-global.ts
|
|
244
|
+
const log = createSubsystemLogger("plugins");
|
|
245
|
+
let globalHookRunner = null;
|
|
246
|
+
let globalRegistry = null;
|
|
247
|
+
/**
|
|
248
|
+
* Initialize the global hook runner with a plugin registry.
|
|
249
|
+
* Called once when plugins are loaded during gateway startup.
|
|
250
|
+
*/
|
|
251
|
+
function initializeGlobalHookRunner(registry) {
|
|
252
|
+
globalRegistry = registry;
|
|
253
|
+
globalHookRunner = createHookRunner(registry, {
|
|
254
|
+
logger: {
|
|
255
|
+
debug: (msg) => log.debug(msg),
|
|
256
|
+
warn: (msg) => log.warn(msg),
|
|
257
|
+
error: (msg) => log.error(msg)
|
|
258
|
+
},
|
|
259
|
+
catchErrors: true
|
|
260
|
+
});
|
|
261
|
+
const hookCount = registry.hooks.length;
|
|
262
|
+
if (hookCount > 0) log.info(`hook runner initialized with ${hookCount} registered hooks`);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Get the global hook runner.
|
|
266
|
+
* Returns null if plugins haven't been loaded yet.
|
|
267
|
+
*/
|
|
268
|
+
function getGlobalHookRunner() {
|
|
269
|
+
return globalHookRunner;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
//#endregion
|
|
17
273
|
//#region src/markdown/fences.ts
|
|
18
274
|
function parseFenceSpans(buffer) {
|
|
19
275
|
const spans = [];
|
|
@@ -357,250 +613,35 @@ function resolveMarkdownTableMode(params) {
|
|
|
357
613
|
}
|
|
358
614
|
|
|
359
615
|
//#endregion
|
|
360
|
-
//#region src/
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
return
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
signal: void 0,
|
|
369
|
-
cleanup: () => {}
|
|
370
|
-
};
|
|
371
|
-
if (!timeoutMs) return {
|
|
372
|
-
signal,
|
|
373
|
-
cleanup: () => {}
|
|
374
|
-
};
|
|
375
|
-
const controller = new AbortController();
|
|
376
|
-
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
377
|
-
const onAbort = () => controller.abort();
|
|
378
|
-
if (signal) if (signal.aborted) controller.abort();
|
|
379
|
-
else signal.addEventListener("abort", onAbort, { once: true });
|
|
380
|
-
const cleanup = () => {
|
|
381
|
-
clearTimeout(timeoutId);
|
|
382
|
-
if (signal) signal.removeEventListener("abort", onAbort);
|
|
383
|
-
};
|
|
384
|
-
return {
|
|
385
|
-
signal: controller.signal,
|
|
386
|
-
cleanup
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
async function fetchWithSsrFGuard(params) {
|
|
390
|
-
const fetcher = params.fetchImpl ?? globalThis.fetch;
|
|
391
|
-
if (!fetcher) throw new Error("fetch is not available");
|
|
392
|
-
const maxRedirects = typeof params.maxRedirects === "number" && Number.isFinite(params.maxRedirects) ? Math.max(0, Math.floor(params.maxRedirects)) : DEFAULT_MAX_REDIRECTS;
|
|
393
|
-
const { signal, cleanup } = buildAbortSignal({
|
|
394
|
-
timeoutMs: params.timeoutMs,
|
|
395
|
-
signal: params.signal
|
|
396
|
-
});
|
|
397
|
-
let released = false;
|
|
398
|
-
const release = async (dispatcher) => {
|
|
399
|
-
if (released) return;
|
|
400
|
-
released = true;
|
|
401
|
-
cleanup();
|
|
402
|
-
await closeDispatcher(dispatcher ?? void 0);
|
|
403
|
-
};
|
|
404
|
-
const visited = /* @__PURE__ */ new Set();
|
|
405
|
-
let currentUrl = params.url;
|
|
406
|
-
let redirectCount = 0;
|
|
407
|
-
while (true) {
|
|
408
|
-
let parsedUrl;
|
|
409
|
-
try {
|
|
410
|
-
parsedUrl = new URL(currentUrl);
|
|
411
|
-
} catch {
|
|
412
|
-
await release();
|
|
413
|
-
throw new Error("Invalid URL: must be http or https");
|
|
414
|
-
}
|
|
415
|
-
if (!["http:", "https:"].includes(parsedUrl.protocol)) {
|
|
416
|
-
await release();
|
|
417
|
-
throw new Error("Invalid URL: must be http or https");
|
|
418
|
-
}
|
|
419
|
-
let dispatcher = null;
|
|
420
|
-
try {
|
|
421
|
-
const pinned = Boolean(params.policy?.allowPrivateNetwork || params.policy?.allowedHostnames?.length) ? await resolvePinnedHostnameWithPolicy(parsedUrl.hostname, {
|
|
422
|
-
lookupFn: params.lookupFn,
|
|
423
|
-
policy: params.policy
|
|
424
|
-
}) : await resolvePinnedHostname(parsedUrl.hostname, params.lookupFn);
|
|
425
|
-
if (params.pinDns !== false) dispatcher = createPinnedDispatcher(pinned);
|
|
426
|
-
const init = {
|
|
427
|
-
...params.init ? { ...params.init } : {},
|
|
428
|
-
redirect: "manual",
|
|
429
|
-
...dispatcher ? { dispatcher } : {},
|
|
430
|
-
...signal ? { signal } : {}
|
|
431
|
-
};
|
|
432
|
-
const response = await fetcher(parsedUrl.toString(), init);
|
|
433
|
-
if (isRedirectStatus(response.status)) {
|
|
434
|
-
const location = response.headers.get("location");
|
|
435
|
-
if (!location) {
|
|
436
|
-
await release(dispatcher);
|
|
437
|
-
throw new Error(`Redirect missing location header (${response.status})`);
|
|
438
|
-
}
|
|
439
|
-
redirectCount += 1;
|
|
440
|
-
if (redirectCount > maxRedirects) {
|
|
441
|
-
await release(dispatcher);
|
|
442
|
-
throw new Error(`Too many redirects (limit: ${maxRedirects})`);
|
|
443
|
-
}
|
|
444
|
-
const nextUrl = new URL(location, parsedUrl).toString();
|
|
445
|
-
if (visited.has(nextUrl)) {
|
|
446
|
-
await release(dispatcher);
|
|
447
|
-
throw new Error("Redirect loop detected");
|
|
448
|
-
}
|
|
449
|
-
visited.add(nextUrl);
|
|
450
|
-
response.body?.cancel();
|
|
451
|
-
await closeDispatcher(dispatcher);
|
|
452
|
-
currentUrl = nextUrl;
|
|
453
|
-
continue;
|
|
454
|
-
}
|
|
455
|
-
return {
|
|
456
|
-
response,
|
|
457
|
-
finalUrl: currentUrl,
|
|
458
|
-
release: async () => release(dispatcher)
|
|
459
|
-
};
|
|
460
|
-
} catch (err) {
|
|
461
|
-
await release(dispatcher);
|
|
462
|
-
throw err;
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
//#endregion
|
|
468
|
-
//#region src/media/fetch.ts
|
|
469
|
-
var MediaFetchError = class extends Error {
|
|
470
|
-
constructor(code, message) {
|
|
471
|
-
super(message);
|
|
472
|
-
this.code = code;
|
|
473
|
-
this.name = "MediaFetchError";
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
function stripQuotes(value) {
|
|
477
|
-
return value.replace(/^["']|["']$/g, "");
|
|
478
|
-
}
|
|
479
|
-
function parseContentDispositionFileName(header) {
|
|
480
|
-
if (!header) return;
|
|
481
|
-
const starMatch = /filename\*\s*=\s*([^;]+)/i.exec(header);
|
|
482
|
-
if (starMatch?.[1]) {
|
|
483
|
-
const cleaned = stripQuotes(starMatch[1].trim());
|
|
484
|
-
const encoded = cleaned.split("''").slice(1).join("''") || cleaned;
|
|
485
|
-
try {
|
|
486
|
-
return path.basename(decodeURIComponent(encoded));
|
|
487
|
-
} catch {
|
|
488
|
-
return path.basename(encoded);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
const match = /filename\s*=\s*([^;]+)/i.exec(header);
|
|
492
|
-
if (match?.[1]) return path.basename(stripQuotes(match[1].trim()));
|
|
616
|
+
//#region src/web/media.ts
|
|
617
|
+
function getDefaultLocalRoots() {
|
|
618
|
+
const home = os.homedir();
|
|
619
|
+
return [
|
|
620
|
+
os.tmpdir(),
|
|
621
|
+
path.join(home, ".openclaw", "media"),
|
|
622
|
+
path.join(home, ".openclaw", "agents")
|
|
623
|
+
];
|
|
493
624
|
}
|
|
494
|
-
async function
|
|
625
|
+
async function assertLocalMediaAllowed(mediaPath, localRoots) {
|
|
626
|
+
if (localRoots === "any") return;
|
|
627
|
+
const roots = localRoots ?? getDefaultLocalRoots();
|
|
628
|
+
let resolved;
|
|
495
629
|
try {
|
|
496
|
-
|
|
497
|
-
if (!text) return;
|
|
498
|
-
const collapsed = text.replace(/\s+/g, " ").trim();
|
|
499
|
-
if (!collapsed) return;
|
|
500
|
-
if (collapsed.length <= maxChars) return collapsed;
|
|
501
|
-
return `${collapsed.slice(0, maxChars)}…`;
|
|
630
|
+
resolved = await fs.realpath(mediaPath);
|
|
502
631
|
} catch {
|
|
503
|
-
|
|
632
|
+
resolved = path.resolve(mediaPath);
|
|
504
633
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
const { url, fetchImpl, filePathHint, maxBytes, maxRedirects, ssrfPolicy, lookupFn } = options;
|
|
508
|
-
let res;
|
|
509
|
-
let finalUrl = url;
|
|
510
|
-
let release = null;
|
|
511
|
-
try {
|
|
512
|
-
const result = await fetchWithSsrFGuard({
|
|
513
|
-
url,
|
|
514
|
-
fetchImpl,
|
|
515
|
-
maxRedirects,
|
|
516
|
-
policy: ssrfPolicy,
|
|
517
|
-
lookupFn
|
|
518
|
-
});
|
|
519
|
-
res = result.response;
|
|
520
|
-
finalUrl = result.finalUrl;
|
|
521
|
-
release = result.release;
|
|
522
|
-
} catch (err) {
|
|
523
|
-
throw new MediaFetchError("fetch_failed", `Failed to fetch media from ${url}: ${String(err)}`);
|
|
524
|
-
}
|
|
525
|
-
try {
|
|
526
|
-
if (!res.ok) {
|
|
527
|
-
const statusText = res.statusText ? ` ${res.statusText}` : "";
|
|
528
|
-
const redirected = finalUrl !== url ? ` (redirected to ${finalUrl})` : "";
|
|
529
|
-
let detail = `HTTP ${res.status}${statusText}`;
|
|
530
|
-
if (!res.body) detail = `HTTP ${res.status}${statusText}; empty response body`;
|
|
531
|
-
else {
|
|
532
|
-
const snippet = await readErrorBodySnippet(res);
|
|
533
|
-
if (snippet) detail += `; body: ${snippet}`;
|
|
534
|
-
}
|
|
535
|
-
throw new MediaFetchError("http_error", `Failed to fetch media from ${url}${redirected}: ${detail}`);
|
|
536
|
-
}
|
|
537
|
-
const contentLength = res.headers.get("content-length");
|
|
538
|
-
if (maxBytes && contentLength) {
|
|
539
|
-
const length = Number(contentLength);
|
|
540
|
-
if (Number.isFinite(length) && length > maxBytes) throw new MediaFetchError("max_bytes", `Failed to fetch media from ${url}: content length ${length} exceeds maxBytes ${maxBytes}`);
|
|
541
|
-
}
|
|
542
|
-
const buffer = maxBytes ? await readResponseWithLimit(res, maxBytes) : Buffer.from(await res.arrayBuffer());
|
|
543
|
-
let fileNameFromUrl;
|
|
634
|
+
for (const root of roots) {
|
|
635
|
+
let resolvedRoot;
|
|
544
636
|
try {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
const headerFileName = parseContentDispositionFileName(res.headers.get("content-disposition"));
|
|
549
|
-
let fileName = headerFileName || fileNameFromUrl || (filePathHint ? path.basename(filePathHint) : void 0);
|
|
550
|
-
const filePathForMime = headerFileName && path.extname(headerFileName) ? headerFileName : filePathHint ?? finalUrl;
|
|
551
|
-
const contentType = await detectMime({
|
|
552
|
-
buffer,
|
|
553
|
-
headerMime: res.headers.get("content-type"),
|
|
554
|
-
filePath: filePathForMime
|
|
555
|
-
});
|
|
556
|
-
if (fileName && !path.extname(fileName) && contentType) {
|
|
557
|
-
const ext = extensionForMime(contentType);
|
|
558
|
-
if (ext) fileName = `${fileName}${ext}`;
|
|
559
|
-
}
|
|
560
|
-
return {
|
|
561
|
-
buffer,
|
|
562
|
-
contentType: contentType ?? void 0,
|
|
563
|
-
fileName
|
|
564
|
-
};
|
|
565
|
-
} finally {
|
|
566
|
-
if (release) await release();
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
async function readResponseWithLimit(res, maxBytes) {
|
|
570
|
-
const body = res.body;
|
|
571
|
-
if (!body || typeof body.getReader !== "function") {
|
|
572
|
-
const fallback = Buffer.from(await res.arrayBuffer());
|
|
573
|
-
if (fallback.length > maxBytes) throw new MediaFetchError("max_bytes", `Failed to fetch media from ${res.url || "response"}: payload exceeds maxBytes ${maxBytes}`);
|
|
574
|
-
return fallback;
|
|
575
|
-
}
|
|
576
|
-
const reader = body.getReader();
|
|
577
|
-
const chunks = [];
|
|
578
|
-
let total = 0;
|
|
579
|
-
try {
|
|
580
|
-
while (true) {
|
|
581
|
-
const { done, value } = await reader.read();
|
|
582
|
-
if (done) break;
|
|
583
|
-
if (value?.length) {
|
|
584
|
-
total += value.length;
|
|
585
|
-
if (total > maxBytes) {
|
|
586
|
-
try {
|
|
587
|
-
await reader.cancel();
|
|
588
|
-
} catch {}
|
|
589
|
-
throw new MediaFetchError("max_bytes", `Failed to fetch media from ${res.url || "response"}: payload exceeds maxBytes ${maxBytes}`);
|
|
590
|
-
}
|
|
591
|
-
chunks.push(value);
|
|
592
|
-
}
|
|
637
|
+
resolvedRoot = await fs.realpath(root);
|
|
638
|
+
} catch {
|
|
639
|
+
resolvedRoot = path.resolve(root);
|
|
593
640
|
}
|
|
594
|
-
|
|
595
|
-
try {
|
|
596
|
-
reader.releaseLock();
|
|
597
|
-
} catch {}
|
|
641
|
+
if (resolved === resolvedRoot || resolved.startsWith(resolvedRoot + path.sep)) return;
|
|
598
642
|
}
|
|
599
|
-
|
|
643
|
+
throw new Error(`Local media path is not under an allowed directory: ${mediaPath}`);
|
|
600
644
|
}
|
|
601
|
-
|
|
602
|
-
//#endregion
|
|
603
|
-
//#region src/web/media.ts
|
|
604
645
|
const HEIC_MIME_RE = /^image\/hei[cf]$/i;
|
|
605
646
|
const HEIC_EXT_RE = /\.(heic|heif)$/i;
|
|
606
647
|
const MB$1 = 1024 * 1024;
|
|
@@ -659,7 +700,7 @@ async function optimizeImageWithFallback(params) {
|
|
|
659
700
|
};
|
|
660
701
|
}
|
|
661
702
|
async function loadWebMediaInternal(mediaUrl, options = {}) {
|
|
662
|
-
const { maxBytes, optimizeImages = true, ssrfPolicy } = options;
|
|
703
|
+
const { maxBytes, optimizeImages = true, ssrfPolicy, localRoots } = options;
|
|
663
704
|
if (mediaUrl.startsWith("file://")) try {
|
|
664
705
|
mediaUrl = fileURLToPath(mediaUrl);
|
|
665
706
|
} catch {
|
|
@@ -727,6 +768,7 @@ async function loadWebMediaInternal(mediaUrl, options = {}) {
|
|
|
727
768
|
});
|
|
728
769
|
}
|
|
729
770
|
if (mediaUrl.startsWith("~")) mediaUrl = resolveUserPath(mediaUrl);
|
|
771
|
+
await assertLocalMediaAllowed(mediaUrl, localRoots);
|
|
730
772
|
const data = await fs.readFile(mediaUrl);
|
|
731
773
|
const mime = await detectMime({
|
|
732
774
|
buffer: data,
|
|
@@ -749,14 +791,16 @@ async function loadWebMedia(mediaUrl, maxBytes, options) {
|
|
|
749
791
|
return await loadWebMediaInternal(mediaUrl, {
|
|
750
792
|
maxBytes,
|
|
751
793
|
optimizeImages: true,
|
|
752
|
-
ssrfPolicy: options?.ssrfPolicy
|
|
794
|
+
ssrfPolicy: options?.ssrfPolicy,
|
|
795
|
+
localRoots: options?.localRoots
|
|
753
796
|
});
|
|
754
797
|
}
|
|
755
798
|
async function loadWebMediaRaw(mediaUrl, maxBytes, options) {
|
|
756
799
|
return await loadWebMediaInternal(mediaUrl, {
|
|
757
800
|
maxBytes,
|
|
758
801
|
optimizeImages: false,
|
|
759
|
-
ssrfPolicy: options?.ssrfPolicy
|
|
802
|
+
ssrfPolicy: options?.ssrfPolicy,
|
|
803
|
+
localRoots: options?.localRoots
|
|
760
804
|
});
|
|
761
805
|
}
|
|
762
806
|
async function optimizeImageToJpeg(buffer, maxBytes, opts = {}) {
|
|
@@ -1199,8 +1243,10 @@ function renderTokens(tokens, state) {
|
|
|
1199
1243
|
break;
|
|
1200
1244
|
case "blockquote_open":
|
|
1201
1245
|
if (state.blockquotePrefix) state.text += state.blockquotePrefix;
|
|
1246
|
+
openStyle(state, "blockquote");
|
|
1202
1247
|
break;
|
|
1203
1248
|
case "blockquote_close":
|
|
1249
|
+
closeStyle(state, "blockquote");
|
|
1204
1250
|
state.text += "\n";
|
|
1205
1251
|
break;
|
|
1206
1252
|
case "bullet_list_open":
|
|
@@ -1516,12 +1562,20 @@ function normalizeMediaSource(src) {
|
|
|
1516
1562
|
function cleanCandidate(raw) {
|
|
1517
1563
|
return raw.replace(/^[`"'[{(]+/, "").replace(/[`"'\\})\],]+$/, "");
|
|
1518
1564
|
}
|
|
1565
|
+
const WINDOWS_DRIVE_RE = /^[a-zA-Z]:[\\/]/;
|
|
1566
|
+
const SCHEME_RE = /^[a-zA-Z][a-zA-Z0-9+.-]*:/;
|
|
1567
|
+
const HAS_FILE_EXT = /\.\w{1,10}$/;
|
|
1568
|
+
function isLikelyLocalPath(candidate) {
|
|
1569
|
+
return candidate.startsWith("/") || candidate.startsWith("./") || candidate.startsWith("../") || candidate.startsWith("~") || WINDOWS_DRIVE_RE.test(candidate) || candidate.startsWith("\\\\") || !SCHEME_RE.test(candidate) && (candidate.includes("/") || candidate.includes("\\"));
|
|
1570
|
+
}
|
|
1519
1571
|
function isValidMedia(candidate, opts) {
|
|
1520
1572
|
if (!candidate) return false;
|
|
1521
1573
|
if (candidate.length > 4096) return false;
|
|
1522
1574
|
if (!opts?.allowSpaces && /\s/.test(candidate)) return false;
|
|
1523
1575
|
if (/^https?:\/\//i.test(candidate)) return true;
|
|
1524
|
-
|
|
1576
|
+
if (isLikelyLocalPath(candidate)) return true;
|
|
1577
|
+
if (opts?.allowBareFilename && !SCHEME_RE.test(candidate) && HAS_FILE_EXT.test(candidate)) return true;
|
|
1578
|
+
return false;
|
|
1525
1579
|
}
|
|
1526
1580
|
function unwrapQuoted(value) {
|
|
1527
1581
|
const trimmed = value.trim();
|
|
@@ -1583,7 +1637,7 @@ function splitMediaFromOutput(raw) {
|
|
|
1583
1637
|
} else invalidParts.push(part);
|
|
1584
1638
|
}
|
|
1585
1639
|
const trimmedPayload = payloadValue.trim();
|
|
1586
|
-
const looksLikeLocalPath =
|
|
1640
|
+
const looksLikeLocalPath = isLikelyLocalPath(trimmedPayload) || trimmedPayload.startsWith("file://");
|
|
1587
1641
|
if (!unwrapped && validCount === 1 && invalidParts.length > 0 && /\s/.test(payloadValue) && looksLikeLocalPath) {
|
|
1588
1642
|
const fallback = normalizeMediaSource(cleanCandidate(payloadValue));
|
|
1589
1643
|
if (isValidMedia(fallback, { allowSpaces: true })) {
|
|
@@ -1596,7 +1650,10 @@ function splitMediaFromOutput(raw) {
|
|
|
1596
1650
|
}
|
|
1597
1651
|
if (!hasValidMedia) {
|
|
1598
1652
|
const fallback = normalizeMediaSource(cleanCandidate(payloadValue));
|
|
1599
|
-
if (isValidMedia(fallback, {
|
|
1653
|
+
if (isValidMedia(fallback, {
|
|
1654
|
+
allowSpaces: true,
|
|
1655
|
+
allowBareFilename: true
|
|
1656
|
+
})) {
|
|
1600
1657
|
media.push(fallback);
|
|
1601
1658
|
hasValidMedia = true;
|
|
1602
1659
|
foundMediaToken = true;
|
|
@@ -1605,7 +1662,8 @@ function splitMediaFromOutput(raw) {
|
|
|
1605
1662
|
}
|
|
1606
1663
|
if (hasValidMedia) {
|
|
1607
1664
|
if (invalidParts.length > 0) pieces.push(invalidParts.join(" "));
|
|
1608
|
-
} else
|
|
1665
|
+
} else if (looksLikeLocalPath) foundMediaToken = true;
|
|
1666
|
+
else pieces.push(match[0]);
|
|
1609
1667
|
cursor = start + match[0].length;
|
|
1610
1668
|
}
|
|
1611
1669
|
pieces.push(line.slice(cursor));
|
|
@@ -1681,7 +1739,7 @@ function normalizeChannelTargetInput(raw) {
|
|
|
1681
1739
|
function normalizeTargetForProvider(provider, raw) {
|
|
1682
1740
|
if (!raw) return;
|
|
1683
1741
|
const providerId = normalizeChannelId(provider);
|
|
1684
|
-
return ((providerId ? getChannelPlugin(providerId) : void 0)?.messaging?.normalizeTarget?.(raw) ?? (raw.trim()
|
|
1742
|
+
return ((providerId ? getChannelPlugin(providerId) : void 0)?.messaging?.normalizeTarget?.(raw) ?? (raw.trim() || void 0)) || void 0;
|
|
1685
1743
|
}
|
|
1686
1744
|
function buildTargetResolverSignature(channel) {
|
|
1687
1745
|
const resolver = getChannelPlugin(channel)?.messaging?.targetResolver;
|
|
@@ -1928,31 +1986,6 @@ function resolveFetch(fetchImpl) {
|
|
|
1928
1986
|
return wrapFetchWithAbortSignal(resolved);
|
|
1929
1987
|
}
|
|
1930
1988
|
|
|
1931
|
-
//#endregion
|
|
1932
|
-
//#region src/utils/fetch-timeout.ts
|
|
1933
|
-
/**
|
|
1934
|
-
* Fetch wrapper that adds timeout support via AbortController.
|
|
1935
|
-
*
|
|
1936
|
-
* @param url - The URL to fetch
|
|
1937
|
-
* @param init - RequestInit options (headers, method, body, etc.)
|
|
1938
|
-
* @param timeoutMs - Timeout in milliseconds
|
|
1939
|
-
* @param fetchFn - The fetch implementation to use (defaults to global fetch)
|
|
1940
|
-
* @returns The fetch Response
|
|
1941
|
-
* @throws AbortError if the request times out
|
|
1942
|
-
*/
|
|
1943
|
-
async function fetchWithTimeout(url, init, timeoutMs, fetchFn = fetch) {
|
|
1944
|
-
const controller = new AbortController();
|
|
1945
|
-
const timer = setTimeout(() => controller.abort(), Math.max(1, timeoutMs));
|
|
1946
|
-
try {
|
|
1947
|
-
return await fetchFn(url, {
|
|
1948
|
-
...init,
|
|
1949
|
-
signal: controller.signal
|
|
1950
|
-
});
|
|
1951
|
-
} finally {
|
|
1952
|
-
clearTimeout(timer);
|
|
1953
|
-
}
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
1989
|
//#endregion
|
|
1957
1990
|
//#region src/signal/client.ts
|
|
1958
1991
|
const DEFAULT_TIMEOUT_MS = 1e4;
|
|
@@ -2564,23 +2597,80 @@ async function deliverOutboundPayloads(params) {
|
|
|
2564
2597
|
})
|
|
2565
2598
|
};
|
|
2566
2599
|
};
|
|
2567
|
-
const
|
|
2600
|
+
const normalizeWhatsAppPayload = (payload) => {
|
|
2601
|
+
const hasMedia = Boolean(payload.mediaUrl) || (payload.mediaUrls?.length ?? 0) > 0;
|
|
2602
|
+
const normalizedText = (typeof payload.text === "string" ? payload.text : "").replace(/^(?:[ \t]*\r?\n)+/, "");
|
|
2603
|
+
if (!normalizedText.trim()) {
|
|
2604
|
+
if (!hasMedia) return null;
|
|
2605
|
+
return {
|
|
2606
|
+
...payload,
|
|
2607
|
+
text: ""
|
|
2608
|
+
};
|
|
2609
|
+
}
|
|
2610
|
+
return {
|
|
2611
|
+
...payload,
|
|
2612
|
+
text: normalizedText
|
|
2613
|
+
};
|
|
2614
|
+
};
|
|
2615
|
+
const normalizedPayloads = normalizeReplyPayloadsForDelivery(payloads).flatMap((payload) => {
|
|
2616
|
+
if (channel !== "whatsapp") return [payload];
|
|
2617
|
+
const normalized = normalizeWhatsAppPayload(payload);
|
|
2618
|
+
return normalized ? [normalized] : [];
|
|
2619
|
+
});
|
|
2620
|
+
const hookRunner = getGlobalHookRunner();
|
|
2568
2621
|
for (const payload of normalizedPayloads) {
|
|
2569
2622
|
const payloadSummary = {
|
|
2570
2623
|
text: payload.text ?? "",
|
|
2571
2624
|
mediaUrls: payload.mediaUrls ?? (payload.mediaUrl ? [payload.mediaUrl] : []),
|
|
2572
2625
|
channelData: payload.channelData
|
|
2573
2626
|
};
|
|
2627
|
+
const emitMessageSent = (success, error) => {
|
|
2628
|
+
if (!hookRunner?.hasHooks("message_sent")) return;
|
|
2629
|
+
hookRunner.runMessageSent({
|
|
2630
|
+
to,
|
|
2631
|
+
content: payloadSummary.text,
|
|
2632
|
+
success,
|
|
2633
|
+
...error ? { error } : {}
|
|
2634
|
+
}, {
|
|
2635
|
+
channelId: channel,
|
|
2636
|
+
accountId: accountId ?? void 0
|
|
2637
|
+
}).catch(() => {});
|
|
2638
|
+
};
|
|
2574
2639
|
try {
|
|
2575
2640
|
throwIfAborted(abortSignal);
|
|
2641
|
+
let effectivePayload = payload;
|
|
2642
|
+
if (hookRunner?.hasHooks("message_sending")) try {
|
|
2643
|
+
const sendingResult = await hookRunner.runMessageSending({
|
|
2644
|
+
to,
|
|
2645
|
+
content: payloadSummary.text,
|
|
2646
|
+
metadata: {
|
|
2647
|
+
channel,
|
|
2648
|
+
accountId,
|
|
2649
|
+
mediaUrls: payloadSummary.mediaUrls
|
|
2650
|
+
}
|
|
2651
|
+
}, {
|
|
2652
|
+
channelId: channel,
|
|
2653
|
+
accountId: accountId ?? void 0
|
|
2654
|
+
});
|
|
2655
|
+
if (sendingResult?.cancel) continue;
|
|
2656
|
+
if (sendingResult?.content != null) {
|
|
2657
|
+
effectivePayload = {
|
|
2658
|
+
...payload,
|
|
2659
|
+
text: sendingResult.content
|
|
2660
|
+
};
|
|
2661
|
+
payloadSummary.text = sendingResult.content;
|
|
2662
|
+
}
|
|
2663
|
+
} catch {}
|
|
2576
2664
|
params.onPayload?.(payloadSummary);
|
|
2577
|
-
if (handler.sendPayload &&
|
|
2578
|
-
results.push(await handler.sendPayload(
|
|
2665
|
+
if (handler.sendPayload && effectivePayload.channelData) {
|
|
2666
|
+
results.push(await handler.sendPayload(effectivePayload));
|
|
2667
|
+
emitMessageSent(true);
|
|
2579
2668
|
continue;
|
|
2580
2669
|
}
|
|
2581
2670
|
if (payloadSummary.mediaUrls.length === 0) {
|
|
2582
2671
|
if (isSignalChannel) await sendSignalTextChunks(payloadSummary.text);
|
|
2583
2672
|
else await sendTextChunks(payloadSummary.text);
|
|
2673
|
+
emitMessageSent(true);
|
|
2584
2674
|
continue;
|
|
2585
2675
|
}
|
|
2586
2676
|
let first = true;
|
|
@@ -2591,7 +2681,9 @@ async function deliverOutboundPayloads(params) {
|
|
|
2591
2681
|
if (isSignalChannel) results.push(await sendSignalMedia(caption, url));
|
|
2592
2682
|
else results.push(await handler.sendMedia(caption, url));
|
|
2593
2683
|
}
|
|
2684
|
+
emitMessageSent(true);
|
|
2594
2685
|
} catch (err) {
|
|
2686
|
+
emitMessageSent(false, err instanceof Error ? err.message : String(err));
|
|
2595
2687
|
if (!params.bestEffort) throw err;
|
|
2596
2688
|
params.onError?.(err, payloadSummary);
|
|
2597
2689
|
}
|
|
@@ -2611,4 +2703,4 @@ async function deliverOutboundPayloads(params) {
|
|
|
2611
2703
|
}
|
|
2612
2704
|
|
|
2613
2705
|
//#endregion
|
|
2614
|
-
export {
|
|
2706
|
+
export { SILENT_REPLY_TOKEN as A, chunkMarkdownTextWithMode as B, normalizeChannelTargetInput as C, splitMediaFromOutput as D, parseReplyDirectives as E, loadWebMedia as F, findFenceSpanAt as G, chunkTextWithMode as H, loadWebMediaRaw as I, getGlobalHookRunner as J, isSafeFenceBreak as K, resolveMarkdownTableMode as L, chunkMarkdownIR as M, markdownToIR as N, parseInlineDirectives as O, markdownToIRWithMeta as P, chunkByNewline as R, buildTargetResolverSignature as S, throwIfAborted as T, resolveChunkMode as U, chunkText as V, resolveTextChunkLimit as W, initializeGlobalHookRunner as Y, signalCheck as _, normalizeOutboundPayloadsForJson as a, resolveFetch as b, applyReplyThreading as c, shouldSuppressMessagingToolReplies as d, createReplyToModeFilterForChannel as f, sendTypingSignal as g, sendReadReceiptSignal as h, normalizeOutboundPayloads as i, isSilentReplyText as j, HEARTBEAT_TOKEN as k, filterMessagingToolDuplicates as l, sendMessageSignal as m, deliver_exports as n, normalizeReplyPayloadsForDelivery as o, resolveReplyToMode as p, parseFenceSpans as q, formatOutboundPayloadLog as r, applyReplyTagsToPayload as s, deliverOutboundPayloads as t, isRenderablePayload as u, signalRpcRequest as v, normalizeTargetForProvider as w, wrapFetchWithAbortSignal as x, streamSignalEvents as y, chunkMarkdownText as z };
|