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,96 +1,96 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { Ct as DEFAULT_CONTEXT_TOKENS, D as isCliProvider, E as getModelRefStatus, F as resolveHooksGmailModel, L as resolveThinkingDefault, N as resolveConfiguredModelRef, P as resolveDefaultModelForAgent, Tt as DEFAULT_PROVIDER, j as resolveAllowedModelRef, pt as normalizeSecretInput, wt as DEFAULT_MODEL } from "./auth-profiles-
|
|
3
|
-
import { t as formatCliCommand } from "./command-format-
|
|
1
|
+
import { $ as CHANNEL_IDS, A as theme, G as resolveGatewayPort, I as CONFIG_PATH, M as getLogger, N as getResolvedLoggerSettings, O as colorize, R as STATE_DIR, V as resolveConfigPath, W as resolveGatewayLockDir, Z as resolveStateDir, j as getChildLogger, k as isRich, l as setConsoleSubsystemFilter, lt as getActivePluginRegistry, n as isTruthyEnvValue, o as createSubsystemLogger, p as defaultRuntime, pt as expandHomePrefix, r as logAcceptedEnvOption, s as runtimeForLogger, tt as DEFAULT_CHAT_CHANNEL, u as setConsoleTimestampPrefix, w as setVerbose, z as isNixMode } from "./entry.js";
|
|
2
|
+
import { Ct as DEFAULT_CONTEXT_TOKENS, D as isCliProvider, E as getModelRefStatus, F as resolveHooksGmailModel, L as resolveThinkingDefault, N as resolveConfiguredModelRef, P as resolveDefaultModelForAgent, Tt as DEFAULT_PROVIDER, j as resolveAllowedModelRef, pt as normalizeSecretInput, wt as DEFAULT_MODEL } from "./auth-profiles-ByNs3eEm.js";
|
|
3
|
+
import { t as formatCliCommand } from "./command-format-Bxe0mWee.js";
|
|
4
4
|
import { _ as isCronRunSessionKey, d as resolveAgentIdFromSessionKey, i as buildAgentMainSessionKey, l as normalizeAgentId, m as toAgentRequestSessionKey, n as DEFAULT_AGENT_ID, t as DEFAULT_ACCOUNT_ID, u as normalizeMainKey, v as isSubagentSessionKey, y as parseAgentSessionKey } from "./session-key-DVvxnFKg.js";
|
|
5
|
-
import { E as truncateUtf16Safe, S as shortenHomePath, n as clamp, s as ensureDir, t as CONFIG_DIR, u as isPlainObject, y as resolveUserPath } from "./utils-
|
|
6
|
-
import { a as logDebug, c as logWarn, n as runExec, t as runCommandWithTimeout } from "./exec-
|
|
5
|
+
import { E as truncateUtf16Safe, S as shortenHomePath, n as clamp, s as ensureDir, t as CONFIG_DIR, u as isPlainObject, y as resolveUserPath } from "./utils-BLJAc3ZV.js";
|
|
6
|
+
import { a as logDebug, c as logWarn, n as runExec, t as runCommandWithTimeout } from "./exec-CACT5OAW.js";
|
|
7
7
|
import { t as resolveOpenClawPackageRoot } from "./openclaw-root-BNlEap4i.js";
|
|
8
|
-
import { T as resolveWorkspaceTemplateDir, _ as DEFAULT_MEMORY_FILENAME, b as DEFAULT_USER_FILENAME, c as resolveDefaultAgentId, d as DEFAULT_AGENTS_FILENAME, g as DEFAULT_MEMORY_ALT_FILENAME, h as DEFAULT_IDENTITY_FILENAME, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, m as DEFAULT_HEARTBEAT_FILENAME, n as resolveAgentConfig, p as DEFAULT_BOOTSTRAP_FILENAME, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, v as DEFAULT_SOUL_FILENAME, w as resolveDefaultAgentWorkspaceDir, x as ensureAgentWorkspace, y as DEFAULT_TOOLS_FILENAME } from "./agent-scope-
|
|
9
|
-
import "./github-copilot-token-
|
|
8
|
+
import { T as resolveWorkspaceTemplateDir, _ as DEFAULT_MEMORY_FILENAME, b as DEFAULT_USER_FILENAME, c as resolveDefaultAgentId, d as DEFAULT_AGENTS_FILENAME, g as DEFAULT_MEMORY_ALT_FILENAME, h as DEFAULT_IDENTITY_FILENAME, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, m as DEFAULT_HEARTBEAT_FILENAME, n as resolveAgentConfig, p as DEFAULT_BOOTSTRAP_FILENAME, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, v as DEFAULT_SOUL_FILENAME, w as resolveDefaultAgentWorkspaceDir, x as ensureAgentWorkspace, y as DEFAULT_TOOLS_FILENAME } from "./agent-scope-CsRbLH4l.js";
|
|
9
|
+
import "./github-copilot-token-Cfs0Wxr8.js";
|
|
10
10
|
import "./pi-model-discovery-DzEIEgHL.js";
|
|
11
|
-
import { A as resolveAgentMaxConcurrent, E as applyLegacyMigrations, M as VERSION, a as parseConfigJson5, c as writeConfigFile, g as parseDurationMs, i as loadConfig, j as resolveSubagentMaxConcurrent, l as validateConfigObjectWithPlugins, n as migrateLegacyConfig, o as readConfigFileSnapshot, r as createConfigIO, s as resolveConfigSnapshotHash, u as OpenClawSchema } from "./config-
|
|
12
|
-
import { c as isTestDefaultMemorySlotDisabled } from "./manifest-registry-
|
|
13
|
-
import { n as movePathToTrash } from "./server-context-
|
|
11
|
+
import { A as resolveAgentMaxConcurrent, E as applyLegacyMigrations, M as VERSION, a as parseConfigJson5, c as writeConfigFile, g as parseDurationMs, i as loadConfig, j as resolveSubagentMaxConcurrent, l as validateConfigObjectWithPlugins, n as migrateLegacyConfig, o as readConfigFileSnapshot, r as createConfigIO, s as resolveConfigSnapshotHash, u as OpenClawSchema } from "./config-Bdhomfei.js";
|
|
12
|
+
import { c as isTestDefaultMemorySlotDisabled } from "./manifest-registry-u0okVSkU.js";
|
|
13
|
+
import { n as movePathToTrash } from "./server-context-BGpGs3qd.js";
|
|
14
14
|
import { n as pickPrimaryTailnetIPv6, t as pickPrimaryTailnetIPv4 } from "./tailnet-CL5GtL7t.js";
|
|
15
15
|
import { c as resolveGatewayBindHost, i as isTrustedProxyAddress, l as resolveGatewayClientIp, n as isLoopbackAddress, r as isLoopbackHost, t as rawDataToString, u as resolveGatewayListenHosts } from "./ws-C0k_dhCP.js";
|
|
16
|
-
import { c as ensurePortAvailable, d as formatPortDiagnostics, l as inspectPortUsage } from "./chrome-
|
|
17
|
-
import { a as
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { $ as validateNodePairRequestParams, A as validateCronStatusParams, At as parseSessionLabel, B as validateExecApprovalsNodeGetParams, C as validateConfigSetParams, Ct as validateWizardNextParams, D as validateCronRemoveParams, Dt as ErrorCodes, E as validateCronListParams, Et as PROTOCOL_VERSION, F as validateDeviceTokenRevokeParams,
|
|
23
|
-
import { n as callGateway, o as loadGatewayTlsRuntime$1 } from "./call-
|
|
24
|
-
import { f as GATEWAY_CLIENT_CAPS, g as hasGatewayClientCap, h as GATEWAY_CLIENT_NAMES, i as isGatewayMessageChannel, l as normalizeMessageChannel, m as GATEWAY_CLIENT_MODES, n as isDeliverableMessageChannel, p as GATEWAY_CLIENT_IDS, r as isGatewayCliClient, s as isWebchatClient, t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-
|
|
25
|
-
import { t as formatDocsLink } from "./links-
|
|
26
|
-
import { r as buildChannelUiCatalog, t as applyPluginAutoEnable } from "./plugin-auto-enable-
|
|
27
|
-
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-
|
|
16
|
+
import { c as ensurePortAvailable, d as formatPortDiagnostics, l as inspectPortUsage } from "./chrome-foEwx3lN.js";
|
|
17
|
+
import { a as safeEqualSecret, c as enableTailscaleFunnel, d as getTailnetHostname, i as resolveGatewayAuth, l as enableTailscaleServe, n as authorizeGatewayConnect, o as disableTailscaleFunnel, r as isLocalDirectRequest, s as disableTailscaleServe, t as assertGatewayAuthConfigured } from "./auth-9x3lqfIY.js";
|
|
18
|
+
import "./control-auth-8Cf4WXpR.js";
|
|
19
|
+
import { a as isErrno, n as formatErrorMessage } from "./errors-DjZBTJJ3.js";
|
|
20
|
+
import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-DKnttEus.js";
|
|
21
|
+
import { t as ensureOpenClawCliOnPath } from "./path-env-CLvYNwtL.js";
|
|
22
|
+
import { $ as validateNodePairRequestParams, A as validateCronStatusParams, At as parseSessionLabel, B as validateExecApprovalsNodeGetParams, C as validateConfigSetParams, Ct as validateWizardNextParams, D as validateCronRemoveParams, Dt as ErrorCodes, E as validateCronListParams, Et as PROTOCOL_VERSION, F as validateDeviceTokenRevokeParams, G as validateNodeDescribeParams, H as validateExecApprovalsSetParams, I as validateDeviceTokenRotateParams, It as deriveDeviceIdFromPublicKey, J as validateNodeInvokeResultParams, K as validateNodeEventParams, L as validateExecApprovalRequestParams, M as validateDevicePairApproveParams, N as validateDevicePairListParams, Nt as normalizeInputProvenance, O as validateCronRunParams, Ot as errorShape, P as validateDevicePairRejectParams, Pt as buildDeviceAuthPayload, Q as validateNodePairRejectParams, R as validateExecApprovalResolveParams, Rt as normalizeDevicePublicKeyBase64Url, S as validateConfigSchemaParams, St as validateWizardCancelParams, T as validateCronAddParams, Tt as validateWizardStatusParams, U as validateLogsTailParams, V as validateExecApprovalsNodeSetParams, W as validateModelsListParams, X as validateNodePairApproveParams, Y as validateNodeListParams, Z as validateNodePairListParams, _ as validateChatInjectParams, _t as validateTalkModeParams, a as validateAgentWaitParams, at as validateSessionsCompactParams, b as validateConfigGetParams, bt as validateWebLoginStartParams, c as validateAgentsFilesGetParams, ct as validateSessionsPatchParams, d as validateAgentsListParams, dt as validateSessionsResolveParams, et as validateNodePairVerifyParams, f as validateAgentsUpdateParams, ft as validateSessionsUsageParams, g as validateChatHistoryParams, gt as validateSkillsUpdateParams, h as validateChatAbortParams, ht as validateSkillsStatusParams, i as validateAgentParams, it as validateSendParams, j as validateCronUpdateParams, k as validateCronRunsParams, l as validateAgentsFilesListParams, lt as validateSessionsPreviewParams, m as validateChannelsStatusParams, mt as validateSkillsInstallParams, n as formatValidationErrors, nt as validatePollParams, o as validateAgentsCreateParams, ot as validateSessionsDeleteParams, p as validateChannelsLogoutParams, pt as validateSkillsBinsParams, q as validateNodeInvokeParams, r as validateAgentIdentityParams, rt as validateRequestFrame, s as validateAgentsDeleteParams, st as validateSessionsListParams, tt as validateNodeRenameParams, u as validateAgentsFilesSetParams, ut as validateSessionsResetParams, v as validateChatSendParams, vt as validateUpdateRunParams, w as validateConnectParams, wt as validateWizardStartParams, x as validateConfigPatchParams, xt as validateWebLoginWaitParams, y as validateConfigApplyParams, yt as validateWakeParams, z as validateExecApprovalsGetParams, zt as verifyDeviceSignature } from "./client-CTwXnRl7.js";
|
|
23
|
+
import { n as callGateway, o as loadGatewayTlsRuntime$1 } from "./call-DVYCIV8m.js";
|
|
24
|
+
import { f as GATEWAY_CLIENT_CAPS, g as hasGatewayClientCap, h as GATEWAY_CLIENT_NAMES, i as isGatewayMessageChannel, l as normalizeMessageChannel, m as GATEWAY_CLIENT_MODES, n as isDeliverableMessageChannel, p as GATEWAY_CLIENT_IDS, r as isGatewayCliClient, s as isWebchatClient, t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-C_MmebBt.js";
|
|
25
|
+
import { t as formatDocsLink } from "./links-B8LAzWwg.js";
|
|
26
|
+
import { r as buildChannelUiCatalog, t as applyPluginAutoEnable } from "./plugin-auto-enable-Bqhc3w5n.js";
|
|
27
|
+
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-4Hqd1WGf.js";
|
|
28
28
|
import "./logging-CfEk_PnX.js";
|
|
29
|
-
import "./accounts-
|
|
30
|
-
import { $ as refreshRemoteBinsForConnectedNodes, A as resolveHeartbeatVisibility, An as
|
|
31
|
-
import { n as withProgress } from "./progress-
|
|
32
|
-
import "./prompt-style-
|
|
33
|
-
import "./note-
|
|
29
|
+
import "./accounts-DCDeFTra.js";
|
|
30
|
+
import { $ as refreshRemoteBinsForConnectedNodes, $t as loadSessionEntry, A as resolveHeartbeatVisibility, An as consumeRestartSentinel, Ar as normalizePollInput, At as runEmbeddedPiAgent, Bn as normalizeOptionalAgentId, Br as registerInternalHook, Bt as onAgentEvent, C as buildControlUiAvatarUrl, Cn as runWithModelFallback, Cr as isDiagnosticsEnabled, Ct as DEFAULT_INPUT_TIMEOUT_MS, Dn as isGatewaySigusr1RestartExternallyAllowed, Dt as formatZonedTimestamp, En as consumeGatewaySigusr1RestartAuthorization, Et as normalizeMimeList, Fr as resolveMemoryBackendConfig, Ft as initSubagentRegistry, G as setCliSessionId, Gt as applyModelOverrideToSessionEntry, H as createReplyDispatcher, Hn as normalizePayloadToSystemText, Ht as runSubagentAnnounceFlow, I as resolveCronStyleNow, In as writeRestartSentinel, Ir as resolveAgentIdentity, It as resolveAgentTimeoutMs, J as normalizeSendPolicy, Jn as detectSuspiciousPatterns, K as runCliAgent, Kt as loadProviderUsageSummary, Ln as normalizeCronJobCreate, Lt as clearAgentRunContext, M as getLastHeartbeatEvent, Mn as formatRestartSentinelMessage, Mt as waitForEmbeddedPiRunEnd, N as onHeartbeatEvent, O as createReplyPrefixOptions, On as scheduleGatewaySigusr1Restart, Or as stripHeartbeatToken, Ot as isAbortTrigger, Pn as summarizeRestartSentinel, Pr as getMemorySearchManager, Pt as createOpenClawTools, Q as recordRemoteNodeInfo, Qn as isSystemEventContextChanged, Qt as loadCombinedSessionStoreForGateway, Rn as normalizeCronJobPatch, Rr as clearInternalHooks, Rt as emitAgentEvent, S as CONTROL_UI_AVATAR_PREFIX, Sr as stopDiagnosticHeartbeat, St as DEFAULT_INPUT_PDF_MIN_TEXT_CHARS, T as resolveAssistantAvatarUrl, Tn as authorizeGatewaySigusr1Restart, Tt as extractImageContentFromSource, Un as normalizeRequiredName, Ut as resolveAnnounceTargetFromKey, V as dispatchInboundMessage, Vn as normalizeOptionalText, Vr as triggerInternalHook, Vt as registerAgentRunContext, W as getCliSessionId, Wn as migrateLegacyCronPayload, X as getRemoteSkillEligibility, Xn as isExternalHookSession, Xt as listAgentsForGateway, Y as resolveSendPolicy, Yn as getHookType, Z as primeRemoteSkillsCache, Zn as enqueueSystemEvent, Zt as listSessionsFromStore, _t as DEFAULT_INPUT_IMAGE_MAX_BYTES, an as readSessionPreviewItemsFromTranscript, ar as getTtsProvider, at as renamePairedNode, br as CommandLane, bt as DEFAULT_INPUT_PDF_MAX_PAGES, cr as resolveTtsApiKey, ct as verifyNodeToken, d as handleReset, dn as normalizeGroupActivation, dr as resolveTtsPrefsPath, en as resolveGatewaySessionStoreTarget, er as requestHeartbeatNow, et as refreshRemoteNodeBins, fr as resolveTtsProviderOrder, ft as applyVerboseOverride, gr as getActiveTaskCount, gt as DEFAULT_INPUT_FILE_MIMES, hr as textToSpeech, ht as DEFAULT_INPUT_FILE_MAX_CHARS, in as readSessionMessages, ir as OPENAI_TTS_VOICES, it as rejectNodePairing, jn as formatDoctorNonInteractiveHint, jr as resolveUserTimezone, jt as abortEmbeddedPiRun, k as buildHistoryContextFromEntries, kn as setGatewaySigusr1RestartPolicy, kt as stopSubagentsForRequester, ln as lookupContextTokens, lr as resolveTtsAutoMode, lt as getSkillsSnapshotVersion, mn as resolveOutboundSessionRoute, mr as setTtsProvider, mt as DEFAULT_INPUT_FILE_MAX_BYTES, n as handleSlackHttpRequest, nn as archiveFileOnDisk, nr as getPluginToolMeta, nt as approveNodePairing, on as resolveSessionTranscriptCandidates, or as isTtsEnabled, ot as requestNodePairing, pn as ensureOutboundSessionEntry, pr as setTtsEnabled, pt as parseVerboseOverride, qn as buildSafeExternalPrompt, rn as capArrayByJsonBytes, rr as OPENAI_TTS_MODELS, rt as listNodePairing, sn as stripEnvelopeFromMessages, sr as isTtsProviderConfigured, st as updatePairedNodeMetadata, t as loadOpenClawPlugins, tn as resolveSessionModelRef, tt as setSkillsRemoteRegistry, un as clearSessionQueues, ur as resolveTtsConfig, ut as registerSkillsChangeListener, vn as resolveOutboundTarget, vr as setCommandLaneConcurrency, vt as DEFAULT_INPUT_IMAGE_MIMES, w as normalizeControlUiBasePath, wr as DEFAULT_HEARTBEAT_ACK_MAX_CHARS, wt as extractFileContentFromSource, xn as resetDirectoryCache, xr as startDiagnosticHeartbeat, xt as DEFAULT_INPUT_PDF_MAX_PIXELS, yn as resolveSessionDeliveryTarget, yr as waitForActiveTasks, yt as DEFAULT_INPUT_MAX_REDIRECTS, z as getChannelActivity, zn as inferLegacyName, zr as createInternalHookEvent, zt as getAgentRunContext } from "./loader-KjT074JR.js";
|
|
31
|
+
import { n as withProgress } from "./progress-DWqhRakV.js";
|
|
32
|
+
import "./prompt-style-BFH5D5LN.js";
|
|
33
|
+
import "./note-hhtubr2j.js";
|
|
34
34
|
import { t as WizardCancelledError } from "./prompts-CXLLIBwP.js";
|
|
35
35
|
import { t as resolveChannelDefaultAccountId } from "./helpers-DdwqKAAS.js";
|
|
36
|
-
import "./onboard-channels-
|
|
36
|
+
import "./onboard-channels-C501x8GI.js";
|
|
37
37
|
import "./archive-D0z3LZDK.js";
|
|
38
|
-
import "./skill-scanner-
|
|
39
|
-
import "./installs-
|
|
40
|
-
import "./
|
|
41
|
-
import
|
|
42
|
-
import "./
|
|
43
|
-
import "./
|
|
44
|
-
import
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import "./fetch-timeout-
|
|
48
|
-
import { $ as stripPluginOnlyAllowlist, F as resolveExplicitAgentSessionKey, I as resolveMainSessionKey, J as collectExplicitAllowlist, L as resolveMainSessionKeyFromConfig, P as resolveAgentMainSessionKey, Q as resolveToolProfilePolicy, S as mergeDeliveryContext, Y as expandPolicyWithPluginGroups, Z as normalizeToolName, b as deliveryContextFromSession, d as loadSessionStore, g as updateSessionStore, q as buildPluginToolGroups, w as normalizeSessionDeliveryFields, z as snapshotSessionOrigin } from "./sandbox-
|
|
49
|
-
import "./tui-formatters-
|
|
50
|
-
import { i as getMachineDisplayName, r as createBrowserRouteDispatcher } from "./wsl-
|
|
51
|
-
import {
|
|
52
|
-
import "./image-
|
|
38
|
+
import "./skill-scanner-rHMtUHtP.js";
|
|
39
|
+
import "./installs-CrLcWYHe.js";
|
|
40
|
+
import { J as getGlobalHookRunner, o as normalizeReplyPayloadsForDelivery, t as deliverOutboundPayloads } from "./deliver-CIU9Npgs.js";
|
|
41
|
+
import "./manager-T1XfGchB.js";
|
|
42
|
+
import { n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionTranscriptPath, s as resolveStorePath } from "./paths-DLINmNFQ.js";
|
|
43
|
+
import "./sqlite-BINzs1U0.js";
|
|
44
|
+
import "./redact-Br9GfacZ.js";
|
|
45
|
+
import { p as detectMime, r as saveMediaBuffer } from "./routes-DewK5tq2.js";
|
|
46
|
+
import { B as normalizeElevatedLevel, H as normalizeThinkLevel, I as formatThinkingLevels, K as supportsXHighThinking, L as formatXHighModelHint, U as normalizeUsageDisplay, V as normalizeReasoningLevel, W as normalizeVerboseLevel } from "./pi-embedded-helpers-DfwkwPYD.js";
|
|
47
|
+
import "./fetch-timeout-DTK9vxex.js";
|
|
48
|
+
import { $ as stripPluginOnlyAllowlist, F as resolveExplicitAgentSessionKey, I as resolveMainSessionKey, J as collectExplicitAllowlist, L as resolveMainSessionKeyFromConfig, P as resolveAgentMainSessionKey, Q as resolveToolProfilePolicy, S as mergeDeliveryContext, Y as expandPolicyWithPluginGroups, Z as normalizeToolName, b as deliveryContextFromSession, d as loadSessionStore, g as updateSessionStore, q as buildPluginToolGroups, w as normalizeSessionDeliveryFields, z as snapshotSessionOrigin } from "./sandbox-BKYnhYQH.js";
|
|
49
|
+
import "./tui-formatters-DePhZK3J.js";
|
|
50
|
+
import { i as getMachineDisplayName, r as createBrowserRouteDispatcher } from "./wsl-BUOkxKJu.js";
|
|
51
|
+
import { i as loadWorkspaceSkillEntries, m as hasBinary, r as buildWorkspaceSkillSnapshot } from "./skills-DRjfSQT3.js";
|
|
52
|
+
import "./image-DgtfXMcX.js";
|
|
53
53
|
import { c as normalizeExecApprovals, g as saveExecApprovals, l as readExecApprovalsSnapshot, m as resolveExecApprovalsSocketPath, r as ensureExecApprovals } from "./exec-approvals-DQ8TVVmj.js";
|
|
54
|
-
import "./tool-display-
|
|
54
|
+
import "./tool-display-ClRud3pg.js";
|
|
55
55
|
import { t as parseAbsoluteTimeMs } from "./parse-ioZhOtha.js";
|
|
56
|
-
import { n as resolveMessageChannelSelection } from "./channel-selection-
|
|
57
|
-
import { i as loadSessionUsageTimeSeries, l as deriveSessionTotalTokens, n as loadCostUsageSummary, r as loadSessionCostSummary, t as discoverAllSessions, u as hasNonzeroUsage } from "./session-cost-usage-
|
|
56
|
+
import { n as resolveMessageChannelSelection } from "./channel-selection-D4D6ImhN.js";
|
|
57
|
+
import { i as loadSessionUsageTimeSeries, l as deriveSessionTotalTokens, n as loadCostUsageSummary, r as loadSessionCostSummary, t as discoverAllSessions, u as hasNonzeroUsage } from "./session-cost-usage-D9hHANWI.js";
|
|
58
58
|
import { n as formatTokenCount, r as formatUsd } from "./usage-format-C4JfTbSp.js";
|
|
59
|
-
import { _ as loadModelCatalog, h as registerUnhandledRejectionHandler } from "./runner-
|
|
60
|
-
import { c as resolveSubagentToolPolicy, i as filterToolsByPolicy, o as resolveEffectiveToolPolicy, s as resolveGroupToolPolicy } from "./commands-
|
|
61
|
-
import "./pairing-store-
|
|
62
|
-
import "./login-qr-
|
|
59
|
+
import { _ as loadModelCatalog, h as registerUnhandledRejectionHandler } from "./runner-CY0nmVme.js";
|
|
60
|
+
import { c as resolveSubagentToolPolicy, i as filterToolsByPolicy, o as resolveEffectiveToolPolicy, s as resolveGroupToolPolicy } from "./commands-BX_OIIVR.js";
|
|
61
|
+
import "./pairing-store-Dp5_JGnG.js";
|
|
62
|
+
import "./login-qr-CuvemJj4.js";
|
|
63
63
|
import { n as runCommandWithRuntime } from "./cli-utils-LcHOt63h.js";
|
|
64
|
-
import "./pairing-labels-
|
|
64
|
+
import "./pairing-labels-CgNHnjzT.js";
|
|
65
65
|
import { t as buildChannelAccountSnapshot } from "./status-CoAy6bEC.js";
|
|
66
|
-
import "./channels-status-issues-
|
|
67
|
-
import "./register.subclis-
|
|
68
|
-
import "./completion-cli-
|
|
69
|
-
import { n as createOutboundSendDeps, t as createDefaultDeps } from "./deps-
|
|
70
|
-
import "./daemon-runtime-
|
|
71
|
-
import "./service-
|
|
72
|
-
import "./systemd-
|
|
73
|
-
import "./shared-
|
|
74
|
-
import { a as runDaemonStop, i as runDaemonStart, n as runDaemonStatus, o as runDaemonUninstall, r as runDaemonRestart, s as runDaemonInstall } from "./daemon-cli-
|
|
75
|
-
import "./service-audit-
|
|
76
|
-
import "./table-
|
|
77
|
-
import { n as resolveWideAreaDiscoveryDomain, r as writeWideAreaGatewayZone } from "./widearea-dns-
|
|
78
|
-
import { a as toOptionString, i as parsePort$1, n as extractGatewayMiskeys, r as maybeExplainGatewayServiceStop, t as describeUnknownError } from "./shared-
|
|
79
|
-
import { i as probeGateway } from "./audit-
|
|
80
|
-
import { S as discoverGatewayBeacons, n as installSkill } from "./onboard-skills-
|
|
81
|
-
import { a as resolveControlUiRootOverrideSync, c as getHealthSnapshot, d as runHeartbeatOnce, f as setHeartbeatsEnabled, n as ensureControlUiAssetsBuilt, o as resolveControlUiRootSync, p as startHeartbeatRunner, s as formatHealthChannelLines } from "./health-format-
|
|
82
|
-
import { S as normalizeUpdateChannel, _ as resolveNpmChannelTag, h as compareSemverStrings, m as checkUpdateStatus, t as runGatewayUpdate, y as DEFAULT_PACKAGE_CHANNEL } from "./update-runner
|
|
83
|
-
import "./github-copilot-auth-
|
|
84
|
-
import "./logging-
|
|
85
|
-
import { i as shouldIncludeHook, n as loadWorkspaceHookEntries, r as resolveHookConfig } from "./hooks-status-
|
|
86
|
-
import { a as findAgentEntryIndex, c as pruneAgentConfig, f as runOnboardingWizard, n as getStatusSummary, o as listAgentEntries, r as applyAgentConfig, s as loadAgentIdentity, u as loadAgentIdentityFromWorkspace } from "./status-
|
|
87
|
-
import { t as buildWorkspaceSkillStatus } from "./skills-status-
|
|
88
|
-
import "./tui-
|
|
89
|
-
import { i as setGatewayWsLogStyle, n as logWs, r as summarizeAgentEventForWsLog, t as formatForLog } from "./ws-log-
|
|
90
|
-
import { T as resolveGmailHookRuntimeConfig, _ as buildGogWatchServeArgs, i as ensureTailscaleEndpoint, v as buildGogWatchStartArgs } from "./gmail-setup-utils-
|
|
91
|
-
import { a as createOutboundSendDeps$1, i as resolveAgentOutboundTarget, r as resolveAgentDeliveryPlan, t as agentCommand } from "./agent-
|
|
92
|
-
import "./node-service-
|
|
93
|
-
import { n as forceFreePortAndWait } from "./ports-
|
|
66
|
+
import "./channels-status-issues-D7GSV1GS.js";
|
|
67
|
+
import "./register.subclis-C02e4zuJ.js";
|
|
68
|
+
import "./completion-cli-CR77-jyv.js";
|
|
69
|
+
import { n as createOutboundSendDeps, t as createDefaultDeps } from "./deps-QSwGcoNZ.js";
|
|
70
|
+
import "./daemon-runtime-B0tg_LsX.js";
|
|
71
|
+
import "./service-99RDXwX4.js";
|
|
72
|
+
import "./systemd-C0VZriGM.js";
|
|
73
|
+
import "./shared-ICqOZibV.js";
|
|
74
|
+
import { a as runDaemonStop, i as runDaemonStart, n as runDaemonStatus, o as runDaemonUninstall, r as runDaemonRestart, s as runDaemonInstall } from "./daemon-cli-cNSF93-v.js";
|
|
75
|
+
import "./service-audit-ckBaRCVC.js";
|
|
76
|
+
import "./table-CwulTLQp.js";
|
|
77
|
+
import { n as resolveWideAreaDiscoveryDomain, r as writeWideAreaGatewayZone } from "./widearea-dns-BaIgNEhY.js";
|
|
78
|
+
import { a as toOptionString, i as parsePort$1, n as extractGatewayMiskeys, r as maybeExplainGatewayServiceStop, t as describeUnknownError } from "./shared-CEY5IkwG.js";
|
|
79
|
+
import { i as probeGateway } from "./audit-wPu26VMb.js";
|
|
80
|
+
import { S as discoverGatewayBeacons, n as installSkill } from "./onboard-skills-DV0Qzvjj.js";
|
|
81
|
+
import { a as resolveControlUiRootOverrideSync, c as getHealthSnapshot, d as runHeartbeatOnce, f as setHeartbeatsEnabled, n as ensureControlUiAssetsBuilt, o as resolveControlUiRootSync, p as startHeartbeatRunner, s as formatHealthChannelLines } from "./health-format-LZDxu3rv.js";
|
|
82
|
+
import { S as normalizeUpdateChannel, _ as resolveNpmChannelTag, h as compareSemverStrings, m as checkUpdateStatus, t as runGatewayUpdate, y as DEFAULT_PACKAGE_CHANNEL } from "./update-runner--ixK4J3W.js";
|
|
83
|
+
import "./github-copilot-auth-DDispnyz.js";
|
|
84
|
+
import "./logging-CRq4h04P.js";
|
|
85
|
+
import { i as shouldIncludeHook, n as loadWorkspaceHookEntries, r as resolveHookConfig } from "./hooks-status-Cw0xD8Lt.js";
|
|
86
|
+
import { a as findAgentEntryIndex, c as pruneAgentConfig, f as runOnboardingWizard, n as getStatusSummary, o as listAgentEntries, r as applyAgentConfig, s as loadAgentIdentity, u as loadAgentIdentityFromWorkspace } from "./status-DDWoOpeB.js";
|
|
87
|
+
import { t as buildWorkspaceSkillStatus } from "./skills-status-TDIgVd1K.js";
|
|
88
|
+
import "./tui-Lu8FdrlK.js";
|
|
89
|
+
import { i as setGatewayWsLogStyle, n as logWs, r as summarizeAgentEventForWsLog, t as formatForLog } from "./ws-log-CIXbLCka.js";
|
|
90
|
+
import { T as resolveGmailHookRuntimeConfig, _ as buildGogWatchServeArgs, i as ensureTailscaleEndpoint, v as buildGogWatchStartArgs } from "./gmail-setup-utils-DJb-_5kO.js";
|
|
91
|
+
import { a as createOutboundSendDeps$1, i as resolveAgentOutboundTarget, r as resolveAgentDeliveryPlan, t as agentCommand } from "./agent-CyMxTyrG.js";
|
|
92
|
+
import "./node-service-WQuEKz6W.js";
|
|
93
|
+
import { n as forceFreePortAndWait } from "./ports-qkt29rdC.js";
|
|
94
94
|
import { spawn, spawnSync } from "node:child_process";
|
|
95
95
|
import path from "node:path";
|
|
96
96
|
import os from "node:os";
|
|
@@ -2553,6 +2553,8 @@ function resolveCronSession(params) {
|
|
|
2553
2553
|
thinkingLevel: entry?.thinkingLevel,
|
|
2554
2554
|
verboseLevel: entry?.verboseLevel,
|
|
2555
2555
|
model: entry?.model,
|
|
2556
|
+
modelOverride: entry?.modelOverride,
|
|
2557
|
+
providerOverride: entry?.providerOverride,
|
|
2556
2558
|
contextTokens: entry?.contextTokens,
|
|
2557
2559
|
sendPolicy: entry?.sendPolicy,
|
|
2558
2560
|
lastChannel: entry?.lastChannel,
|
|
@@ -2619,6 +2621,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2619
2621
|
return catalog;
|
|
2620
2622
|
};
|
|
2621
2623
|
const isGmailHook = baseSessionKey.startsWith("hook:gmail:");
|
|
2624
|
+
let hooksGmailModelApplied = false;
|
|
2622
2625
|
const hooksGmailModelRef = isGmailHook ? resolveHooksGmailModel({
|
|
2623
2626
|
cfg: params.cfg,
|
|
2624
2627
|
defaultProvider: DEFAULT_PROVIDER
|
|
@@ -2633,6 +2636,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2633
2636
|
}).allowed) {
|
|
2634
2637
|
provider = hooksGmailModelRef.provider;
|
|
2635
2638
|
model = hooksGmailModelRef.model;
|
|
2639
|
+
hooksGmailModelApplied = true;
|
|
2636
2640
|
}
|
|
2637
2641
|
}
|
|
2638
2642
|
const modelOverrideRaw = params.job.payload.kind === "agentTurn" ? params.job.payload.model : void 0;
|
|
@@ -2678,6 +2682,23 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2678
2682
|
const labelSuffix = typeof params.job.name === "string" && params.job.name.trim() ? params.job.name.trim() : params.job.id;
|
|
2679
2683
|
cronSession.sessionEntry.label = `Cron: ${labelSuffix}`;
|
|
2680
2684
|
}
|
|
2685
|
+
if (!modelOverride && !hooksGmailModelApplied) {
|
|
2686
|
+
const sessionModelOverride = cronSession.sessionEntry.modelOverride?.trim();
|
|
2687
|
+
if (sessionModelOverride) {
|
|
2688
|
+
const sessionProviderOverride = cronSession.sessionEntry.providerOverride?.trim() || resolvedDefault.provider;
|
|
2689
|
+
const resolvedSessionOverride = resolveAllowedModelRef({
|
|
2690
|
+
cfg: cfgWithAgentDefaults,
|
|
2691
|
+
catalog: await loadCatalog(),
|
|
2692
|
+
raw: `${sessionProviderOverride}/${sessionModelOverride}`,
|
|
2693
|
+
defaultProvider: resolvedDefault.provider,
|
|
2694
|
+
defaultModel: resolvedDefault.model
|
|
2695
|
+
});
|
|
2696
|
+
if (!("error" in resolvedSessionOverride)) {
|
|
2697
|
+
provider = resolvedSessionOverride.ref.provider;
|
|
2698
|
+
model = resolvedSessionOverride.ref.model;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2681
2702
|
const hooksGmailThinking = isGmailHook ? normalizeThinkLevel(params.cfg.hooks?.gmail?.thinking) : void 0;
|
|
2682
2703
|
const thinkOverride = normalizeThinkLevel(agentCfg?.thinkingDefault);
|
|
2683
2704
|
let thinkLevel = normalizeThinkLevel((params.job.payload.kind === "agentTurn" ? params.job.payload.thinking : void 0) ?? void 0) ?? hooksGmailThinking ?? thinkOverride;
|
|
@@ -2815,6 +2836,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2815
2836
|
const payloads = runResult.payloads ?? [];
|
|
2816
2837
|
{
|
|
2817
2838
|
const usage = runResult.meta.agentMeta?.usage;
|
|
2839
|
+
const promptTokens = runResult.meta.agentMeta?.promptTokens;
|
|
2818
2840
|
const modelUsed = runResult.meta.agentMeta?.model ?? fallbackModel ?? model;
|
|
2819
2841
|
const providerUsed = runResult.meta.agentMeta?.provider ?? fallbackProvider ?? provider;
|
|
2820
2842
|
const contextTokens = agentCfg?.contextTokens ?? lookupContextTokens(modelUsed) ?? DEFAULT_CONTEXT_TOKENS;
|
|
@@ -2832,7 +2854,8 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2832
2854
|
cronSession.sessionEntry.outputTokens = output;
|
|
2833
2855
|
cronSession.sessionEntry.totalTokens = deriveSessionTotalTokens({
|
|
2834
2856
|
usage,
|
|
2835
|
-
contextTokens
|
|
2857
|
+
contextTokens,
|
|
2858
|
+
promptTokens
|
|
2836
2859
|
}) ?? input;
|
|
2837
2860
|
}
|
|
2838
2861
|
await persistSessionEntry();
|
|
@@ -5715,6 +5738,7 @@ const agentHandlers = {
|
|
|
5715
5738
|
let resolvedGroupChannel = groupChannelRaw || void 0;
|
|
5716
5739
|
let resolvedGroupSpace = groupSpaceRaw || void 0;
|
|
5717
5740
|
let spawnedByValue = typeof request.spawnedBy === "string" ? request.spawnedBy.trim() : void 0;
|
|
5741
|
+
const inputProvenance = normalizeInputProvenance(request.inputProvenance);
|
|
5718
5742
|
const cached = context.dedupe.get(`agent:${idem}`);
|
|
5719
5743
|
if (cached) {
|
|
5720
5744
|
respond(cached.ok, cached.payload, cached.error, { cached: true });
|
|
@@ -5921,7 +5945,8 @@ const agentHandlers = {
|
|
|
5921
5945
|
messageChannel: resolvedChannel,
|
|
5922
5946
|
runId,
|
|
5923
5947
|
lane: request.lane,
|
|
5924
|
-
extraSystemPrompt: request.extraSystemPrompt
|
|
5948
|
+
extraSystemPrompt: request.extraSystemPrompt,
|
|
5949
|
+
inputProvenance
|
|
5925
5950
|
}, defaultRuntime, context.deps).then((result) => {
|
|
5926
5951
|
const payload = {
|
|
5927
5952
|
runId,
|
|
@@ -6842,9 +6867,13 @@ const channelsHandlers = {
|
|
|
6842
6867
|
//#region src/gateway/server-methods/chat.ts
|
|
6843
6868
|
function resolveTranscriptPath(params) {
|
|
6844
6869
|
const { sessionId, storePath, sessionFile } = params;
|
|
6845
|
-
if (sessionFile) return
|
|
6846
|
-
|
|
6847
|
-
|
|
6870
|
+
if (!storePath && !sessionFile) return null;
|
|
6871
|
+
try {
|
|
6872
|
+
const sessionsDir = storePath ? path.dirname(storePath) : void 0;
|
|
6873
|
+
return resolveSessionFilePath(sessionId, sessionFile ? { sessionFile } : void 0, sessionsDir ? { sessionsDir } : void 0);
|
|
6874
|
+
} catch {
|
|
6875
|
+
return null;
|
|
6876
|
+
}
|
|
6848
6877
|
}
|
|
6849
6878
|
function ensureTranscriptFile(params) {
|
|
6850
6879
|
if (fs.existsSync(params.transcriptPath)) return { ok: true };
|
|
@@ -9040,7 +9069,7 @@ async function verifyDeviceToken(params) {
|
|
|
9040
9069
|
ok: false,
|
|
9041
9070
|
reason: "token-revoked"
|
|
9042
9071
|
};
|
|
9043
|
-
if (
|
|
9072
|
+
if (!safeEqualSecret(params.token, entry.token)) return {
|
|
9044
9073
|
ok: false,
|
|
9045
9074
|
reason: "token-mismatch"
|
|
9046
9075
|
};
|
|
@@ -9892,7 +9921,7 @@ const nodeHandlers = {
|
|
|
9892
9921
|
const p = params;
|
|
9893
9922
|
const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
|
|
9894
9923
|
await respondUnavailableOnThrow(respond, async () => {
|
|
9895
|
-
const { handleNodeEvent } = await import("./server-node-events-
|
|
9924
|
+
const { handleNodeEvent } = await import("./server-node-events-QCvh8EgI.js");
|
|
9896
9925
|
const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
|
|
9897
9926
|
await handleNodeEvent({
|
|
9898
9927
|
deps: context.deps,
|
|
@@ -11397,7 +11426,7 @@ const usageHandlers = {
|
|
|
11397
11426
|
const limit = typeof p.limit === "number" && Number.isFinite(p.limit) ? p.limit : 50;
|
|
11398
11427
|
const includeContextWeight = p.includeContextWeight ?? false;
|
|
11399
11428
|
const specificKey = typeof p.key === "string" ? p.key.trim() : null;
|
|
11400
|
-
const { store } = loadCombinedSessionStoreForGateway(config);
|
|
11429
|
+
const { storePath, store } = loadCombinedSessionStoreForGateway(config);
|
|
11401
11430
|
const now = Date.now();
|
|
11402
11431
|
const mergedEntries = [];
|
|
11403
11432
|
if (specificKey) {
|
|
@@ -11417,7 +11446,13 @@ const usageHandlers = {
|
|
|
11417
11446
|
const resolvedStoreKey = storeMatch?.key ?? storeByIdMatch?.key ?? specificKey;
|
|
11418
11447
|
const storeEntry = storeMatch?.entry ?? storeByIdMatch?.entry;
|
|
11419
11448
|
const sessionId = storeEntry?.sessionId ?? keyRest;
|
|
11420
|
-
|
|
11449
|
+
let sessionFile;
|
|
11450
|
+
try {
|
|
11451
|
+
sessionFile = resolveSessionFilePath(sessionId, storeEntry, storePath && storePath !== "(multiple)" ? { sessionsDir: path.dirname(storePath) } : { agentId: agentIdFromKey });
|
|
11452
|
+
} catch {
|
|
11453
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `Invalid session reference: ${specificKey}`));
|
|
11454
|
+
return;
|
|
11455
|
+
}
|
|
11421
11456
|
try {
|
|
11422
11457
|
const stats = fs.statSync(sessionFile);
|
|
11423
11458
|
if (stats.isFile()) mergedEntries.push({
|
|
@@ -11743,14 +11778,22 @@ const usageHandlers = {
|
|
|
11743
11778
|
return;
|
|
11744
11779
|
}
|
|
11745
11780
|
const config = loadConfig();
|
|
11746
|
-
const { entry } = loadSessionEntry(key);
|
|
11781
|
+
const { entry, storePath } = loadSessionEntry(key);
|
|
11747
11782
|
const parsed = parseAgentSessionKey(key);
|
|
11748
11783
|
const agentId = parsed?.agentId;
|
|
11749
11784
|
const rawSessionId = parsed?.rest ?? key;
|
|
11785
|
+
const sessionId = entry?.sessionId ?? rawSessionId;
|
|
11786
|
+
let sessionFile;
|
|
11787
|
+
try {
|
|
11788
|
+
sessionFile = resolveSessionFilePath(sessionId, entry, storePath ? { sessionsDir: path.dirname(storePath) } : { agentId });
|
|
11789
|
+
} catch {
|
|
11790
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `Invalid session key: ${key}`));
|
|
11791
|
+
return;
|
|
11792
|
+
}
|
|
11750
11793
|
const timeseries = await loadSessionUsageTimeSeries({
|
|
11751
|
-
sessionId
|
|
11794
|
+
sessionId,
|
|
11752
11795
|
sessionEntry: entry,
|
|
11753
|
-
sessionFile
|
|
11796
|
+
sessionFile,
|
|
11754
11797
|
config,
|
|
11755
11798
|
maxPoints: 200
|
|
11756
11799
|
});
|
|
@@ -11768,13 +11811,19 @@ const usageHandlers = {
|
|
|
11768
11811
|
}
|
|
11769
11812
|
const limit = typeof params?.limit === "number" && Number.isFinite(params.limit) ? Math.min(params.limit, 1e3) : 200;
|
|
11770
11813
|
const config = loadConfig();
|
|
11771
|
-
const { entry } = loadSessionEntry(key);
|
|
11814
|
+
const { entry, storePath } = loadSessionEntry(key);
|
|
11772
11815
|
const parsed = parseAgentSessionKey(key);
|
|
11773
11816
|
const agentId = parsed?.agentId;
|
|
11774
11817
|
const rawSessionId = parsed?.rest ?? key;
|
|
11775
11818
|
const sessionId = entry?.sessionId ?? rawSessionId;
|
|
11776
|
-
|
|
11777
|
-
|
|
11819
|
+
let sessionFile;
|
|
11820
|
+
try {
|
|
11821
|
+
sessionFile = resolveSessionFilePath(sessionId, entry, storePath ? { sessionsDir: path.dirname(storePath) } : { agentId });
|
|
11822
|
+
} catch {
|
|
11823
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `Invalid session key: ${key}`));
|
|
11824
|
+
return;
|
|
11825
|
+
}
|
|
11826
|
+
const { loadSessionLogs } = await import("./session-cost-usage-D9hHANWI.js").then((n) => n.a);
|
|
11778
11827
|
respond(true, { logs: await loadSessionLogs({
|
|
11779
11828
|
sessionId,
|
|
11780
11829
|
sessionEntry: entry,
|
|
@@ -12780,6 +12829,12 @@ function resolveHooksConfig(cfg) {
|
|
|
12780
12829
|
const maxBodyBytes = cfg.hooks?.maxBodyBytes && cfg.hooks.maxBodyBytes > 0 ? cfg.hooks.maxBodyBytes : DEFAULT_HOOKS_MAX_BODY_BYTES;
|
|
12781
12830
|
const mappings = resolveHookMappings(cfg.hooks);
|
|
12782
12831
|
const defaultAgentId = resolveDefaultAgentId(cfg);
|
|
12832
|
+
const knownAgentIds = resolveKnownAgentIds(cfg, defaultAgentId);
|
|
12833
|
+
const allowedAgentIds = resolveAllowedAgentIds(cfg.hooks?.allowedAgentIds);
|
|
12834
|
+
const defaultSessionKey = resolveSessionKey$1(cfg.hooks?.defaultSessionKey);
|
|
12835
|
+
const allowedSessionKeyPrefixes = resolveAllowedSessionKeyPrefixes(cfg.hooks?.allowedSessionKeyPrefixes);
|
|
12836
|
+
if (defaultSessionKey && allowedSessionKeyPrefixes && !isSessionKeyAllowedByPrefix(defaultSessionKey, allowedSessionKeyPrefixes)) throw new Error("hooks.defaultSessionKey must match hooks.allowedSessionKeyPrefixes");
|
|
12837
|
+
if (!defaultSessionKey && allowedSessionKeyPrefixes && !isSessionKeyAllowedByPrefix("hook:example", allowedSessionKeyPrefixes)) throw new Error("hooks.allowedSessionKeyPrefixes must include 'hook:' when hooks.defaultSessionKey is unset");
|
|
12783
12838
|
return {
|
|
12784
12839
|
basePath: trimmed,
|
|
12785
12840
|
token,
|
|
@@ -12787,8 +12842,13 @@ function resolveHooksConfig(cfg) {
|
|
|
12787
12842
|
mappings,
|
|
12788
12843
|
agentPolicy: {
|
|
12789
12844
|
defaultAgentId,
|
|
12790
|
-
knownAgentIds
|
|
12791
|
-
allowedAgentIds
|
|
12845
|
+
knownAgentIds,
|
|
12846
|
+
allowedAgentIds
|
|
12847
|
+
},
|
|
12848
|
+
sessionPolicy: {
|
|
12849
|
+
defaultSessionKey,
|
|
12850
|
+
allowRequestSessionKey: cfg.hooks?.allowRequestSessionKey === true,
|
|
12851
|
+
allowedSessionKeyPrefixes
|
|
12792
12852
|
}
|
|
12793
12853
|
};
|
|
12794
12854
|
}
|
|
@@ -12813,6 +12873,29 @@ function resolveAllowedAgentIds(raw) {
|
|
|
12813
12873
|
if (hasWildcard) return;
|
|
12814
12874
|
return allowed;
|
|
12815
12875
|
}
|
|
12876
|
+
function resolveSessionKey$1(raw) {
|
|
12877
|
+
const value = raw?.trim();
|
|
12878
|
+
return value ? value : void 0;
|
|
12879
|
+
}
|
|
12880
|
+
function normalizeSessionKeyPrefix(raw) {
|
|
12881
|
+
const value = raw.trim().toLowerCase();
|
|
12882
|
+
return value ? value : void 0;
|
|
12883
|
+
}
|
|
12884
|
+
function resolveAllowedSessionKeyPrefixes(raw) {
|
|
12885
|
+
if (!Array.isArray(raw)) return;
|
|
12886
|
+
const set = /* @__PURE__ */ new Set();
|
|
12887
|
+
for (const prefix of raw) {
|
|
12888
|
+
const normalized = normalizeSessionKeyPrefix(prefix);
|
|
12889
|
+
if (!normalized) continue;
|
|
12890
|
+
set.add(normalized);
|
|
12891
|
+
}
|
|
12892
|
+
return set.size > 0 ? Array.from(set) : void 0;
|
|
12893
|
+
}
|
|
12894
|
+
function isSessionKeyAllowedByPrefix(sessionKey, prefixes) {
|
|
12895
|
+
const normalized = sessionKey.trim().toLowerCase();
|
|
12896
|
+
if (!normalized) return false;
|
|
12897
|
+
return prefixes.some((prefix) => normalized.startsWith(prefix));
|
|
12898
|
+
}
|
|
12816
12899
|
function extractHookToken(req) {
|
|
12817
12900
|
const auth = typeof req.headers.authorization === "string" ? req.headers.authorization.trim() : "";
|
|
12818
12901
|
if (auth.toLowerCase().startsWith("bearer ")) {
|
|
@@ -12923,7 +13006,42 @@ function isHookAgentAllowed(hooksConfig, agentId) {
|
|
|
12923
13006
|
return resolved ? allowed.has(resolved) : false;
|
|
12924
13007
|
}
|
|
12925
13008
|
const getHookAgentPolicyError = () => "agentId is not allowed by hooks.allowedAgentIds";
|
|
12926
|
-
|
|
13009
|
+
const getHookSessionKeyRequestPolicyError = () => "sessionKey is disabled for external /hooks/agent payloads; set hooks.allowRequestSessionKey=true to enable";
|
|
13010
|
+
const getHookSessionKeyPrefixError = (prefixes) => `sessionKey must start with one of: ${prefixes.join(", ")}`;
|
|
13011
|
+
function resolveHookSessionKey(params) {
|
|
13012
|
+
const requested = resolveSessionKey$1(params.sessionKey);
|
|
13013
|
+
if (requested) {
|
|
13014
|
+
if (params.source === "request" && !params.hooksConfig.sessionPolicy.allowRequestSessionKey) return {
|
|
13015
|
+
ok: false,
|
|
13016
|
+
error: getHookSessionKeyRequestPolicyError()
|
|
13017
|
+
};
|
|
13018
|
+
const allowedPrefixes = params.hooksConfig.sessionPolicy.allowedSessionKeyPrefixes;
|
|
13019
|
+
if (allowedPrefixes && !isSessionKeyAllowedByPrefix(requested, allowedPrefixes)) return {
|
|
13020
|
+
ok: false,
|
|
13021
|
+
error: getHookSessionKeyPrefixError(allowedPrefixes)
|
|
13022
|
+
};
|
|
13023
|
+
return {
|
|
13024
|
+
ok: true,
|
|
13025
|
+
value: requested
|
|
13026
|
+
};
|
|
13027
|
+
}
|
|
13028
|
+
const defaultSessionKey = params.hooksConfig.sessionPolicy.defaultSessionKey;
|
|
13029
|
+
if (defaultSessionKey) return {
|
|
13030
|
+
ok: true,
|
|
13031
|
+
value: defaultSessionKey
|
|
13032
|
+
};
|
|
13033
|
+
const generated = `hook:${(params.idFactory ?? randomUUID)()}`;
|
|
13034
|
+
const allowedPrefixes = params.hooksConfig.sessionPolicy.allowedSessionKeyPrefixes;
|
|
13035
|
+
if (allowedPrefixes && !isSessionKeyAllowedByPrefix(generated, allowedPrefixes)) return {
|
|
13036
|
+
ok: false,
|
|
13037
|
+
error: getHookSessionKeyPrefixError(allowedPrefixes)
|
|
13038
|
+
};
|
|
13039
|
+
return {
|
|
13040
|
+
ok: true,
|
|
13041
|
+
value: generated
|
|
13042
|
+
};
|
|
13043
|
+
}
|
|
13044
|
+
function normalizeAgentPayload(payload) {
|
|
12927
13045
|
const message = typeof payload.message === "string" ? payload.message.trim() : "";
|
|
12928
13046
|
if (!message) return {
|
|
12929
13047
|
ok: false,
|
|
@@ -12935,8 +13053,7 @@ function normalizeAgentPayload(payload, opts) {
|
|
|
12935
13053
|
const agentId = typeof agentIdRaw === "string" && agentIdRaw.trim() ? agentIdRaw.trim() : void 0;
|
|
12936
13054
|
const wakeMode = payload.wakeMode === "next-heartbeat" ? "next-heartbeat" : "now";
|
|
12937
13055
|
const sessionKeyRaw = payload.sessionKey;
|
|
12938
|
-
const
|
|
12939
|
-
const sessionKey = typeof sessionKeyRaw === "string" && sessionKeyRaw.trim() ? sessionKeyRaw.trim() : `hook:${idFactory()}`;
|
|
13056
|
+
const sessionKey = typeof sessionKeyRaw === "string" && sessionKeyRaw.trim() ? sessionKeyRaw.trim() : void 0;
|
|
12940
13057
|
const channel = resolveHookChannel(payload.channel);
|
|
12941
13058
|
if (!channel) return {
|
|
12942
13059
|
ok: false,
|
|
@@ -12977,7 +13094,7 @@ function normalizeAgentPayload(payload, opts) {
|
|
|
12977
13094
|
async function startBrowserControlServerIfEnabled() {
|
|
12978
13095
|
if (isTruthyEnvValue(process.env.OPENCLAW_SKIP_BROWSER_CONTROL_SERVER)) return null;
|
|
12979
13096
|
const override = process.env.OPENCLAW_BROWSER_CONTROL_MODULE?.trim();
|
|
12980
|
-
const mod = override ? await import(override) : await import("./control-service-
|
|
13097
|
+
const mod = override ? await import(override) : await import("./control-service-DKnttEus.js").then((n) => n.t);
|
|
12981
13098
|
const start = typeof mod.startBrowserControlServiceFromConfig === "function" ? mod.startBrowserControlServiceFromConfig : mod.startBrowserControlServerFromConfig;
|
|
12982
13099
|
const stop = typeof mod.stopBrowserControlService === "function" ? mod.stopBrowserControlService : mod.stopBrowserControlServer;
|
|
12983
13100
|
if (!start) return null;
|
|
@@ -14628,6 +14745,7 @@ const OutputTextDoneEventSchema = z.object({
|
|
|
14628
14745
|
//#endregion
|
|
14629
14746
|
//#region src/gateway/openresponses-http.ts
|
|
14630
14747
|
const DEFAULT_BODY_BYTES$1 = 20 * 1024 * 1024;
|
|
14748
|
+
const DEFAULT_MAX_URL_PARTS = 8;
|
|
14631
14749
|
function writeSseEvent(res, event) {
|
|
14632
14750
|
res.write(`event: ${event.type}\n`);
|
|
14633
14751
|
res.write(`data: ${JSON.stringify(event)}\n\n`);
|
|
@@ -14640,13 +14758,20 @@ function extractTextContent(content) {
|
|
|
14640
14758
|
return "";
|
|
14641
14759
|
}).filter(Boolean).join("\n");
|
|
14642
14760
|
}
|
|
14761
|
+
function normalizeHostnameAllowlist(values) {
|
|
14762
|
+
if (!values || values.length === 0) return;
|
|
14763
|
+
const normalized = values.map((value) => value.trim()).filter((value) => value.length > 0);
|
|
14764
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
14765
|
+
}
|
|
14643
14766
|
function resolveResponsesLimits(config) {
|
|
14644
14767
|
const files = config?.files;
|
|
14645
14768
|
const images = config?.images;
|
|
14646
14769
|
return {
|
|
14647
14770
|
maxBodyBytes: config?.maxBodyBytes ?? DEFAULT_BODY_BYTES$1,
|
|
14771
|
+
maxUrlParts: typeof config?.maxUrlParts === "number" ? Math.max(0, Math.floor(config.maxUrlParts)) : DEFAULT_MAX_URL_PARTS,
|
|
14648
14772
|
files: {
|
|
14649
14773
|
allowUrl: files?.allowUrl ?? true,
|
|
14774
|
+
urlAllowlist: normalizeHostnameAllowlist(files?.urlAllowlist),
|
|
14650
14775
|
allowedMimes: normalizeMimeList(files?.allowedMimes, DEFAULT_INPUT_FILE_MIMES),
|
|
14651
14776
|
maxBytes: files?.maxBytes ?? DEFAULT_INPUT_FILE_MAX_BYTES,
|
|
14652
14777
|
maxChars: files?.maxChars ?? DEFAULT_INPUT_FILE_MAX_CHARS,
|
|
@@ -14660,6 +14785,7 @@ function resolveResponsesLimits(config) {
|
|
|
14660
14785
|
},
|
|
14661
14786
|
images: {
|
|
14662
14787
|
allowUrl: images?.allowUrl ?? true,
|
|
14788
|
+
urlAllowlist: normalizeHostnameAllowlist(images?.urlAllowlist),
|
|
14663
14789
|
allowedMimes: normalizeMimeList(images?.allowedMimes, DEFAULT_INPUT_IMAGE_MIMES),
|
|
14664
14790
|
maxBytes: images?.maxBytes ?? DEFAULT_INPUT_IMAGE_MAX_BYTES,
|
|
14665
14791
|
maxRedirects: images?.maxRedirects ?? DEFAULT_INPUT_MAX_REDIRECTS,
|
|
@@ -14841,6 +14967,11 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14841
14967
|
const user = payload.user;
|
|
14842
14968
|
let images = [];
|
|
14843
14969
|
let fileContexts = [];
|
|
14970
|
+
let urlParts = 0;
|
|
14971
|
+
const markUrlPart = () => {
|
|
14972
|
+
urlParts += 1;
|
|
14973
|
+
if (urlParts > limits.maxUrlParts) throw new Error(`Too many URL-based input sources: ${urlParts} (limit: ${limits.maxUrlParts})`);
|
|
14974
|
+
};
|
|
14844
14975
|
try {
|
|
14845
14976
|
if (Array.isArray(payload.input)) {
|
|
14846
14977
|
for (const item of payload.input) if (item.type === "message" && typeof item.content !== "string") for (const part of item.content) {
|
|
@@ -14848,6 +14979,7 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14848
14979
|
const source = part.source;
|
|
14849
14980
|
const sourceType = source.type === "base64" || source.type === "url" ? source.type : void 0;
|
|
14850
14981
|
if (!sourceType) throw new Error("input_image must have 'source.url' or 'source.data'");
|
|
14982
|
+
if (sourceType === "url") markUrlPart();
|
|
14851
14983
|
const image = await extractImageContentFromSource({
|
|
14852
14984
|
type: sourceType,
|
|
14853
14985
|
url: source.url,
|
|
@@ -14861,6 +14993,7 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14861
14993
|
const source = part.source;
|
|
14862
14994
|
const sourceType = source.type === "base64" || source.type === "url" ? source.type : void 0;
|
|
14863
14995
|
if (!sourceType) throw new Error("input_file must have 'source.url' or 'source.data'");
|
|
14996
|
+
if (sourceType === "url") markUrlPart();
|
|
14864
14997
|
const file = await extractFileContentFromSource({
|
|
14865
14998
|
source: {
|
|
14866
14999
|
type: sourceType,
|
|
@@ -15424,6 +15557,9 @@ async function handleToolsInvokeHttpRequest(req, res, opts) {
|
|
|
15424
15557
|
|
|
15425
15558
|
//#endregion
|
|
15426
15559
|
//#region src/gateway/server-http.ts
|
|
15560
|
+
const HOOK_AUTH_FAILURE_LIMIT = 20;
|
|
15561
|
+
const HOOK_AUTH_FAILURE_WINDOW_MS = 6e4;
|
|
15562
|
+
const HOOK_AUTH_FAILURE_TRACK_MAX = 2048;
|
|
15427
15563
|
function sendJson(res, status, body) {
|
|
15428
15564
|
res.statusCode = status;
|
|
15429
15565
|
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
@@ -15465,6 +15601,31 @@ async function authorizeCanvasRequest(params) {
|
|
|
15465
15601
|
}
|
|
15466
15602
|
function createHooksRequestHandler(opts) {
|
|
15467
15603
|
const { getHooksConfig, bindHost, port, logHooks, dispatchAgentHook, dispatchWakeHook } = opts;
|
|
15604
|
+
const hookAuthFailures = /* @__PURE__ */ new Map();
|
|
15605
|
+
const resolveHookClientKey = (req) => {
|
|
15606
|
+
return req.socket?.remoteAddress?.trim() || "unknown";
|
|
15607
|
+
};
|
|
15608
|
+
const recordHookAuthFailure = (clientKey, nowMs) => {
|
|
15609
|
+
if (!hookAuthFailures.has(clientKey) && hookAuthFailures.size >= HOOK_AUTH_FAILURE_TRACK_MAX) hookAuthFailures.clear();
|
|
15610
|
+
const current = hookAuthFailures.get(clientKey);
|
|
15611
|
+
const next = !current || nowMs - current.windowStartedAtMs >= HOOK_AUTH_FAILURE_WINDOW_MS ? {
|
|
15612
|
+
count: 1,
|
|
15613
|
+
windowStartedAtMs: nowMs
|
|
15614
|
+
} : {
|
|
15615
|
+
count: current.count + 1,
|
|
15616
|
+
windowStartedAtMs: current.windowStartedAtMs
|
|
15617
|
+
};
|
|
15618
|
+
hookAuthFailures.set(clientKey, next);
|
|
15619
|
+
if (next.count <= HOOK_AUTH_FAILURE_LIMIT) return { throttled: false };
|
|
15620
|
+
const retryAfterMs = Math.max(1, next.windowStartedAtMs + HOOK_AUTH_FAILURE_WINDOW_MS - nowMs);
|
|
15621
|
+
return {
|
|
15622
|
+
throttled: true,
|
|
15623
|
+
retryAfterSeconds: Math.ceil(retryAfterMs / 1e3)
|
|
15624
|
+
};
|
|
15625
|
+
};
|
|
15626
|
+
const clearHookAuthFailure = (clientKey) => {
|
|
15627
|
+
hookAuthFailures.delete(clientKey);
|
|
15628
|
+
};
|
|
15468
15629
|
return async (req, res) => {
|
|
15469
15630
|
const hooksConfig = getHooksConfig();
|
|
15470
15631
|
if (!hooksConfig) return false;
|
|
@@ -15478,12 +15639,24 @@ function createHooksRequestHandler(opts) {
|
|
|
15478
15639
|
return true;
|
|
15479
15640
|
}
|
|
15480
15641
|
const token = extractHookToken(req);
|
|
15481
|
-
|
|
15642
|
+
const clientKey = resolveHookClientKey(req);
|
|
15643
|
+
if (!safeEqualSecret(token, hooksConfig.token)) {
|
|
15644
|
+
const throttle = recordHookAuthFailure(clientKey, Date.now());
|
|
15645
|
+
if (throttle.throttled) {
|
|
15646
|
+
const retryAfter = throttle.retryAfterSeconds ?? 1;
|
|
15647
|
+
res.statusCode = 429;
|
|
15648
|
+
res.setHeader("Retry-After", String(retryAfter));
|
|
15649
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
15650
|
+
res.end("Too Many Requests");
|
|
15651
|
+
logHooks.warn(`hook auth throttled for ${clientKey}; retry-after=${retryAfter}s`);
|
|
15652
|
+
return true;
|
|
15653
|
+
}
|
|
15482
15654
|
res.statusCode = 401;
|
|
15483
15655
|
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
15484
15656
|
res.end("Unauthorized");
|
|
15485
15657
|
return true;
|
|
15486
15658
|
}
|
|
15659
|
+
clearHookAuthFailure(clientKey);
|
|
15487
15660
|
if (req.method !== "POST") {
|
|
15488
15661
|
res.statusCode = 405;
|
|
15489
15662
|
res.setHeader("Allow", "POST");
|
|
@@ -15540,10 +15713,23 @@ function createHooksRequestHandler(opts) {
|
|
|
15540
15713
|
});
|
|
15541
15714
|
return true;
|
|
15542
15715
|
}
|
|
15716
|
+
const sessionKey = resolveHookSessionKey({
|
|
15717
|
+
hooksConfig,
|
|
15718
|
+
source: "request",
|
|
15719
|
+
sessionKey: normalized.value.sessionKey
|
|
15720
|
+
});
|
|
15721
|
+
if (!sessionKey.ok) {
|
|
15722
|
+
sendJson(res, 400, {
|
|
15723
|
+
ok: false,
|
|
15724
|
+
error: sessionKey.error
|
|
15725
|
+
});
|
|
15726
|
+
return true;
|
|
15727
|
+
}
|
|
15543
15728
|
sendJson(res, 202, {
|
|
15544
15729
|
ok: true,
|
|
15545
15730
|
runId: dispatchAgentHook({
|
|
15546
15731
|
...normalized.value,
|
|
15732
|
+
sessionKey: sessionKey.value,
|
|
15547
15733
|
agentId: resolveHookTargetAgentId(hooksConfig, normalized.value.agentId)
|
|
15548
15734
|
})
|
|
15549
15735
|
});
|
|
@@ -15595,6 +15781,18 @@ function createHooksRequestHandler(opts) {
|
|
|
15595
15781
|
});
|
|
15596
15782
|
return true;
|
|
15597
15783
|
}
|
|
15784
|
+
const sessionKey = resolveHookSessionKey({
|
|
15785
|
+
hooksConfig,
|
|
15786
|
+
source: "mapping",
|
|
15787
|
+
sessionKey: mapped.action.sessionKey
|
|
15788
|
+
});
|
|
15789
|
+
if (!sessionKey.ok) {
|
|
15790
|
+
sendJson(res, 400, {
|
|
15791
|
+
ok: false,
|
|
15792
|
+
error: sessionKey.error
|
|
15793
|
+
});
|
|
15794
|
+
return true;
|
|
15795
|
+
}
|
|
15598
15796
|
sendJson(res, 202, {
|
|
15599
15797
|
ok: true,
|
|
15600
15798
|
runId: dispatchAgentHook({
|
|
@@ -15602,7 +15800,7 @@ function createHooksRequestHandler(opts) {
|
|
|
15602
15800
|
name: mapped.action.name ?? "Hook",
|
|
15603
15801
|
agentId: resolveHookTargetAgentId(hooksConfig, mapped.action.agentId),
|
|
15604
15802
|
wakeMode: mapped.action.wakeMode,
|
|
15605
|
-
sessionKey:
|
|
15803
|
+
sessionKey: sessionKey.value,
|
|
15606
15804
|
deliver: resolveHookDeliver(mapped.action.deliver),
|
|
15607
15805
|
channel,
|
|
15608
15806
|
to: mapped.action.to,
|
|
@@ -15753,7 +15951,7 @@ function createGatewayHooksRequestHandler(params) {
|
|
|
15753
15951
|
if (value.mode === "now") requestHeartbeatNow({ reason: "hook:wake" });
|
|
15754
15952
|
};
|
|
15755
15953
|
const dispatchAgentHook = (value) => {
|
|
15756
|
-
const sessionKey = value.sessionKey.trim()
|
|
15954
|
+
const sessionKey = value.sessionKey.trim();
|
|
15757
15955
|
const mainSessionKey = resolveMainSessionKeyFromConfig();
|
|
15758
15956
|
const jobId = randomUUID();
|
|
15759
15957
|
const now = Date.now();
|
|
@@ -17811,6 +18009,12 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
17811
18009
|
logChannels,
|
|
17812
18010
|
logBrowser
|
|
17813
18011
|
}));
|
|
18012
|
+
{
|
|
18013
|
+
const hookRunner = getGlobalHookRunner();
|
|
18014
|
+
if (hookRunner?.hasHooks("gateway_start")) hookRunner.runGatewayStart({ port }, { port }).catch((err) => {
|
|
18015
|
+
log.warn(`gateway_start hook failed: ${String(err)}`);
|
|
18016
|
+
});
|
|
18017
|
+
}
|
|
17814
18018
|
const { applyHotReload, requestGatewayRestart } = createGatewayReloadHandlers({
|
|
17815
18019
|
deps,
|
|
17816
18020
|
broadcast,
|
|
@@ -17873,6 +18077,14 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
17873
18077
|
httpServers
|
|
17874
18078
|
});
|
|
17875
18079
|
return { close: async (opts) => {
|
|
18080
|
+
{
|
|
18081
|
+
const hookRunner = getGlobalHookRunner();
|
|
18082
|
+
if (hookRunner?.hasHooks("gateway_stop")) try {
|
|
18083
|
+
await hookRunner.runGatewayStop({ reason: opts?.reason ?? "gateway stopping" }, { port });
|
|
18084
|
+
} catch (err) {
|
|
18085
|
+
log.warn(`gateway_stop hook failed: ${String(err)}`);
|
|
18086
|
+
}
|
|
18087
|
+
}
|
|
17876
18088
|
if (diagnosticsEnabled) stopDiagnosticHeartbeat();
|
|
17877
18089
|
if (skillsRefreshTimer) {
|
|
17878
18090
|
clearTimeout(skillsRefreshTimer);
|