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,94 +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-
|
|
7
|
-
import { t as resolveOpenClawPackageRoot } from "./openclaw-root-
|
|
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-
|
|
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
|
+
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-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 {
|
|
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, $t 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
|
|
48
|
-
import "./
|
|
49
|
-
import
|
|
50
|
-
import {
|
|
51
|
-
import "./
|
|
52
|
-
import
|
|
53
|
-
import "./
|
|
54
|
-
import
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import { n as
|
|
58
|
-
import {
|
|
59
|
-
import "./
|
|
60
|
-
import "./
|
|
61
|
-
import
|
|
62
|
-
import "./
|
|
63
|
-
import {
|
|
64
|
-
import "./
|
|
65
|
-
import "./
|
|
66
|
-
import "./
|
|
67
|
-
import
|
|
68
|
-
import "./
|
|
69
|
-
import "./
|
|
70
|
-
import "./
|
|
71
|
-
import "./
|
|
72
|
-
import
|
|
73
|
-
import "./
|
|
74
|
-
import "./
|
|
75
|
-
import
|
|
76
|
-
import
|
|
77
|
-
import {
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import { S as
|
|
81
|
-
import "./
|
|
82
|
-
import "./
|
|
83
|
-
import
|
|
84
|
-
import
|
|
85
|
-
import {
|
|
86
|
-
import "./
|
|
87
|
-
import {
|
|
88
|
-
import
|
|
89
|
-
import {
|
|
90
|
-
import "./
|
|
91
|
-
import {
|
|
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
|
+
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-ClRud3pg.js";
|
|
55
|
+
import { t as parseAbsoluteTimeMs } from "./parse-ioZhOtha.js";
|
|
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
|
+
import { n as formatTokenCount, r as formatUsd } from "./usage-format-C4JfTbSp.js";
|
|
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
|
+
import { n as runCommandWithRuntime } from "./cli-utils-LcHOt63h.js";
|
|
64
|
+
import "./pairing-labels-CgNHnjzT.js";
|
|
65
|
+
import { t as buildChannelAccountSnapshot } from "./status-CoAy6bEC.js";
|
|
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";
|
|
92
94
|
import { spawn, spawnSync } from "node:child_process";
|
|
93
95
|
import path from "node:path";
|
|
94
96
|
import os from "node:os";
|
|
@@ -1204,6 +1206,10 @@ const BASE_RELOAD_RULES = [
|
|
|
1204
1206
|
}
|
|
1205
1207
|
];
|
|
1206
1208
|
const BASE_RELOAD_RULES_TAIL = [
|
|
1209
|
+
{
|
|
1210
|
+
prefix: "meta",
|
|
1211
|
+
kind: "none"
|
|
1212
|
+
},
|
|
1207
1213
|
{
|
|
1208
1214
|
prefix: "identity",
|
|
1209
1215
|
kind: "none"
|
|
@@ -2547,6 +2553,8 @@ function resolveCronSession(params) {
|
|
|
2547
2553
|
thinkingLevel: entry?.thinkingLevel,
|
|
2548
2554
|
verboseLevel: entry?.verboseLevel,
|
|
2549
2555
|
model: entry?.model,
|
|
2556
|
+
modelOverride: entry?.modelOverride,
|
|
2557
|
+
providerOverride: entry?.providerOverride,
|
|
2550
2558
|
contextTokens: entry?.contextTokens,
|
|
2551
2559
|
sendPolicy: entry?.sendPolicy,
|
|
2552
2560
|
lastChannel: entry?.lastChannel,
|
|
@@ -2580,9 +2588,8 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2580
2588
|
const defaultAgentId = resolveDefaultAgentId(params.cfg);
|
|
2581
2589
|
const requestedAgentId = typeof params.agentId === "string" && params.agentId.trim() ? params.agentId : typeof params.job.agentId === "string" && params.job.agentId.trim() ? params.job.agentId : void 0;
|
|
2582
2590
|
const normalizedRequested = requestedAgentId ? normalizeAgentId(requestedAgentId) : void 0;
|
|
2583
|
-
const
|
|
2584
|
-
const
|
|
2585
|
-
const agentId = agentConfigOverride ? normalizedRequested ?? defaultAgentId : defaultAgentId;
|
|
2591
|
+
const { model: overrideModel, ...agentOverrideRest } = (normalizedRequested ? resolveAgentConfig(params.cfg, normalizedRequested) : void 0) ?? {};
|
|
2592
|
+
const agentId = normalizedRequested ?? defaultAgentId;
|
|
2586
2593
|
const agentCfg = Object.assign({}, params.cfg.agents?.defaults, agentOverrideRest);
|
|
2587
2594
|
if (typeof overrideModel === "string") agentCfg.model = { primary: overrideModel };
|
|
2588
2595
|
else if (overrideModel) agentCfg.model = overrideModel;
|
|
@@ -2614,6 +2621,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2614
2621
|
return catalog;
|
|
2615
2622
|
};
|
|
2616
2623
|
const isGmailHook = baseSessionKey.startsWith("hook:gmail:");
|
|
2624
|
+
let hooksGmailModelApplied = false;
|
|
2617
2625
|
const hooksGmailModelRef = isGmailHook ? resolveHooksGmailModel({
|
|
2618
2626
|
cfg: params.cfg,
|
|
2619
2627
|
defaultProvider: DEFAULT_PROVIDER
|
|
@@ -2628,6 +2636,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2628
2636
|
}).allowed) {
|
|
2629
2637
|
provider = hooksGmailModelRef.provider;
|
|
2630
2638
|
model = hooksGmailModelRef.model;
|
|
2639
|
+
hooksGmailModelApplied = true;
|
|
2631
2640
|
}
|
|
2632
2641
|
}
|
|
2633
2642
|
const modelOverrideRaw = params.job.payload.kind === "agentTurn" ? params.job.payload.model : void 0;
|
|
@@ -2673,6 +2682,23 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2673
2682
|
const labelSuffix = typeof params.job.name === "string" && params.job.name.trim() ? params.job.name.trim() : params.job.id;
|
|
2674
2683
|
cronSession.sessionEntry.label = `Cron: ${labelSuffix}`;
|
|
2675
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
|
+
}
|
|
2676
2702
|
const hooksGmailThinking = isGmailHook ? normalizeThinkLevel(params.cfg.hooks?.gmail?.thinking) : void 0;
|
|
2677
2703
|
const thinkOverride = normalizeThinkLevel(agentCfg?.thinkingDefault);
|
|
2678
2704
|
let thinkLevel = normalizeThinkLevel((params.job.payload.kind === "agentTurn" ? params.job.payload.thinking : void 0) ?? void 0) ?? hooksGmailThinking ?? thinkOverride;
|
|
@@ -2810,6 +2836,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2810
2836
|
const payloads = runResult.payloads ?? [];
|
|
2811
2837
|
{
|
|
2812
2838
|
const usage = runResult.meta.agentMeta?.usage;
|
|
2839
|
+
const promptTokens = runResult.meta.agentMeta?.promptTokens;
|
|
2813
2840
|
const modelUsed = runResult.meta.agentMeta?.model ?? fallbackModel ?? model;
|
|
2814
2841
|
const providerUsed = runResult.meta.agentMeta?.provider ?? fallbackProvider ?? provider;
|
|
2815
2842
|
const contextTokens = agentCfg?.contextTokens ?? lookupContextTokens(modelUsed) ?? DEFAULT_CONTEXT_TOKENS;
|
|
@@ -2827,7 +2854,8 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2827
2854
|
cronSession.sessionEntry.outputTokens = output;
|
|
2828
2855
|
cronSession.sessionEntry.totalTokens = deriveSessionTotalTokens({
|
|
2829
2856
|
usage,
|
|
2830
|
-
contextTokens
|
|
2857
|
+
contextTokens,
|
|
2858
|
+
promptTokens
|
|
2831
2859
|
}) ?? input;
|
|
2832
2860
|
}
|
|
2833
2861
|
await persistSessionEntry();
|
|
@@ -3045,10 +3073,10 @@ function computeNextRunAtMs(schedule, nowMs) {
|
|
|
3045
3073
|
catch: false
|
|
3046
3074
|
});
|
|
3047
3075
|
const nowSecondMs = Math.floor(nowMs / 1e3) * 1e3;
|
|
3048
|
-
const next = cron.nextRun(
|
|
3076
|
+
const next = cron.nextRun(new Date(nowSecondMs));
|
|
3049
3077
|
if (!next) return;
|
|
3050
3078
|
const nextMs = next.getTime();
|
|
3051
|
-
return Number.isFinite(nextMs) && nextMs
|
|
3079
|
+
return Number.isFinite(nextMs) && nextMs > nowSecondMs ? nextMs : void 0;
|
|
3052
3080
|
}
|
|
3053
3081
|
|
|
3054
3082
|
//#endregion
|
|
@@ -3091,6 +3119,8 @@ function computeJobNextRunAtMs(job, nowMs) {
|
|
|
3091
3119
|
}
|
|
3092
3120
|
return computeNextRunAtMs(job.schedule, nowMs);
|
|
3093
3121
|
}
|
|
3122
|
+
/** Maximum consecutive schedule errors before auto-disabling a job. */
|
|
3123
|
+
const MAX_SCHEDULE_ERRORS = 3;
|
|
3094
3124
|
function recomputeNextRuns(state) {
|
|
3095
3125
|
if (!state.store) return false;
|
|
3096
3126
|
let changed = false;
|
|
@@ -3121,12 +3151,82 @@ function recomputeNextRuns(state) {
|
|
|
3121
3151
|
changed = true;
|
|
3122
3152
|
}
|
|
3123
3153
|
const nextRun = job.state.nextRunAtMs;
|
|
3124
|
-
if (nextRun === void 0 || now >= nextRun) {
|
|
3154
|
+
if (nextRun === void 0 || now >= nextRun) try {
|
|
3125
3155
|
const newNext = computeJobNextRunAtMs(job, now);
|
|
3126
3156
|
if (job.state.nextRunAtMs !== newNext) {
|
|
3127
3157
|
job.state.nextRunAtMs = newNext;
|
|
3128
3158
|
changed = true;
|
|
3129
3159
|
}
|
|
3160
|
+
if (job.state.scheduleErrorCount) {
|
|
3161
|
+
job.state.scheduleErrorCount = void 0;
|
|
3162
|
+
changed = true;
|
|
3163
|
+
}
|
|
3164
|
+
} catch (err) {
|
|
3165
|
+
const errorCount = (job.state.scheduleErrorCount ?? 0) + 1;
|
|
3166
|
+
job.state.scheduleErrorCount = errorCount;
|
|
3167
|
+
job.state.nextRunAtMs = void 0;
|
|
3168
|
+
job.state.lastError = `schedule error: ${String(err)}`;
|
|
3169
|
+
changed = true;
|
|
3170
|
+
if (errorCount >= MAX_SCHEDULE_ERRORS) {
|
|
3171
|
+
job.enabled = false;
|
|
3172
|
+
state.deps.log.error({
|
|
3173
|
+
jobId: job.id,
|
|
3174
|
+
name: job.name,
|
|
3175
|
+
errorCount,
|
|
3176
|
+
err: String(err)
|
|
3177
|
+
}, "cron: auto-disabled job after repeated schedule errors");
|
|
3178
|
+
} else state.deps.log.warn({
|
|
3179
|
+
jobId: job.id,
|
|
3180
|
+
name: job.name,
|
|
3181
|
+
errorCount,
|
|
3182
|
+
err: String(err)
|
|
3183
|
+
}, "cron: failed to compute next run for job (skipping)");
|
|
3184
|
+
}
|
|
3185
|
+
}
|
|
3186
|
+
return changed;
|
|
3187
|
+
}
|
|
3188
|
+
/**
|
|
3189
|
+
* Maintenance-only version of recomputeNextRuns that handles disabled jobs
|
|
3190
|
+
* and stuck markers, but does NOT recompute nextRunAtMs for enabled jobs
|
|
3191
|
+
* with existing values. Used during timer ticks when no due jobs were found
|
|
3192
|
+
* to prevent silently advancing past-due nextRunAtMs values without execution
|
|
3193
|
+
* (see #13992).
|
|
3194
|
+
*/
|
|
3195
|
+
function recomputeNextRunsForMaintenance(state) {
|
|
3196
|
+
if (!state.store) return false;
|
|
3197
|
+
let changed = false;
|
|
3198
|
+
const now = state.deps.nowMs();
|
|
3199
|
+
for (const job of state.store.jobs) {
|
|
3200
|
+
if (!job.state) {
|
|
3201
|
+
job.state = {};
|
|
3202
|
+
changed = true;
|
|
3203
|
+
}
|
|
3204
|
+
if (!job.enabled) {
|
|
3205
|
+
if (job.state.nextRunAtMs !== void 0) {
|
|
3206
|
+
job.state.nextRunAtMs = void 0;
|
|
3207
|
+
changed = true;
|
|
3208
|
+
}
|
|
3209
|
+
if (job.state.runningAtMs !== void 0) {
|
|
3210
|
+
job.state.runningAtMs = void 0;
|
|
3211
|
+
changed = true;
|
|
3212
|
+
}
|
|
3213
|
+
continue;
|
|
3214
|
+
}
|
|
3215
|
+
const runningAt = job.state.runningAtMs;
|
|
3216
|
+
if (typeof runningAt === "number" && now - runningAt > STUCK_RUN_MS) {
|
|
3217
|
+
state.deps.log.warn({
|
|
3218
|
+
jobId: job.id,
|
|
3219
|
+
runningAtMs: runningAt
|
|
3220
|
+
}, "cron: clearing stuck running marker");
|
|
3221
|
+
job.state.runningAtMs = void 0;
|
|
3222
|
+
changed = true;
|
|
3223
|
+
}
|
|
3224
|
+
if (job.state.nextRunAtMs === void 0) {
|
|
3225
|
+
const newNext = computeJobNextRunAtMs(job, now);
|
|
3226
|
+
if (newNext !== void 0) {
|
|
3227
|
+
job.state.nextRunAtMs = newNext;
|
|
3228
|
+
changed = true;
|
|
3229
|
+
}
|
|
3130
3230
|
}
|
|
3131
3231
|
}
|
|
3132
3232
|
return changed;
|
|
@@ -3786,7 +3886,7 @@ function applyJobResult(state, job, result) {
|
|
|
3786
3886
|
job.updatedAtMs = result.endedAt;
|
|
3787
3887
|
if (result.status === "error") job.state.consecutiveErrors = (job.state.consecutiveErrors ?? 0) + 1;
|
|
3788
3888
|
else job.state.consecutiveErrors = 0;
|
|
3789
|
-
const shouldDelete = job.schedule.kind === "at" &&
|
|
3889
|
+
const shouldDelete = job.schedule.kind === "at" && job.deleteAfterRun === true && result.status === "ok";
|
|
3790
3890
|
if (!shouldDelete) if (job.schedule.kind === "at") {
|
|
3791
3891
|
job.enabled = false;
|
|
3792
3892
|
job.state.nextRunAtMs = void 0;
|
|
@@ -3847,7 +3947,17 @@ function armTimer(state) {
|
|
|
3847
3947
|
}, "cron: timer armed");
|
|
3848
3948
|
}
|
|
3849
3949
|
async function onTimer(state) {
|
|
3850
|
-
if (state.running)
|
|
3950
|
+
if (state.running) {
|
|
3951
|
+
if (state.timer) clearTimeout(state.timer);
|
|
3952
|
+
state.timer = setTimeout(async () => {
|
|
3953
|
+
try {
|
|
3954
|
+
await onTimer(state);
|
|
3955
|
+
} catch (err) {
|
|
3956
|
+
state.deps.log.error({ err: String(err) }, "cron: timer tick failed");
|
|
3957
|
+
}
|
|
3958
|
+
}, MAX_TIMER_DELAY_MS);
|
|
3959
|
+
return;
|
|
3960
|
+
}
|
|
3851
3961
|
state.running = true;
|
|
3852
3962
|
try {
|
|
3853
3963
|
const dueJobs = await locked(state, async () => {
|
|
@@ -3857,7 +3967,7 @@ async function onTimer(state) {
|
|
|
3857
3967
|
});
|
|
3858
3968
|
const due = findDueJobs(state);
|
|
3859
3969
|
if (due.length === 0) {
|
|
3860
|
-
if (
|
|
3970
|
+
if (recomputeNextRunsForMaintenance(state)) await persist(state);
|
|
3861
3971
|
return [];
|
|
3862
3972
|
}
|
|
3863
3973
|
const now = state.deps.nowMs();
|
|
@@ -3993,7 +4103,7 @@ async function runMissedJobs(state) {
|
|
|
3993
4103
|
if (!j.enabled) return false;
|
|
3994
4104
|
if (typeof j.state.runningAtMs === "number") return false;
|
|
3995
4105
|
const next = j.state.nextRunAtMs;
|
|
3996
|
-
if (j.schedule.kind === "at" && j.state.lastStatus
|
|
4106
|
+
if (j.schedule.kind === "at" && j.state.lastStatus) return false;
|
|
3997
4107
|
return typeof next === "number" && now >= next;
|
|
3998
4108
|
});
|
|
3999
4109
|
if (missed.length > 0) {
|
|
@@ -4019,7 +4129,10 @@ async function executeJobCore(state, job) {
|
|
|
4019
4129
|
const waitStartedAt = state.deps.nowMs();
|
|
4020
4130
|
let heartbeatResult;
|
|
4021
4131
|
for (;;) {
|
|
4022
|
-
heartbeatResult = await state.deps.runHeartbeatOnce({
|
|
4132
|
+
heartbeatResult = await state.deps.runHeartbeatOnce({
|
|
4133
|
+
reason,
|
|
4134
|
+
agentId: job.agentId
|
|
4135
|
+
});
|
|
4023
4136
|
if (heartbeatResult.status !== "skipped" || heartbeatResult.reason !== "requests-in-flight") break;
|
|
4024
4137
|
if (state.deps.nowMs() - waitStartedAt > maxWaitMs) {
|
|
4025
4138
|
state.deps.requestHeartbeatNow({ reason });
|
|
@@ -4398,9 +4511,12 @@ function buildGatewayCronService(params) {
|
|
|
4398
4511
|
},
|
|
4399
4512
|
requestHeartbeatNow,
|
|
4400
4513
|
runHeartbeatOnce: async (opts) => {
|
|
4514
|
+
const runtimeConfig = loadConfig();
|
|
4515
|
+
const agentId = opts?.agentId ? resolveCronAgent(opts.agentId).agentId : void 0;
|
|
4401
4516
|
return await runHeartbeatOnce({
|
|
4402
|
-
cfg:
|
|
4517
|
+
cfg: runtimeConfig,
|
|
4403
4518
|
reason: opts?.reason,
|
|
4519
|
+
agentId,
|
|
4404
4520
|
deps: {
|
|
4405
4521
|
...params.deps,
|
|
4406
4522
|
runtime: defaultRuntime
|
|
@@ -4781,8 +4897,8 @@ function abortChatRunsForSessionKey(ops, params) {
|
|
|
4781
4897
|
|
|
4782
4898
|
//#endregion
|
|
4783
4899
|
//#region src/gateway/server-constants.ts
|
|
4784
|
-
const MAX_PAYLOAD_BYTES =
|
|
4785
|
-
const MAX_BUFFERED_BYTES =
|
|
4900
|
+
const MAX_PAYLOAD_BYTES = 8 * 1024 * 1024;
|
|
4901
|
+
const MAX_BUFFERED_BYTES = 16 * 1024 * 1024;
|
|
4786
4902
|
const DEFAULT_MAX_CHAT_HISTORY_MESSAGES_BYTES = 6 * 1024 * 1024;
|
|
4787
4903
|
let maxChatHistoryMessagesBytes = DEFAULT_MAX_CHAT_HISTORY_MESSAGES_BYTES;
|
|
4788
4904
|
const getMaxChatHistoryMessagesBytes = () => maxChatHistoryMessagesBytes;
|
|
@@ -5495,7 +5611,7 @@ function ensureAgentRunListener() {
|
|
|
5495
5611
|
agentRunStarts.delete(evt.runId);
|
|
5496
5612
|
recordAgentRunSnapshot({
|
|
5497
5613
|
runId: evt.runId,
|
|
5498
|
-
status: phase === "error" ? "error" : "ok",
|
|
5614
|
+
status: phase === "error" ? "error" : evt.data?.aborted ? "timeout" : "ok",
|
|
5499
5615
|
startedAt,
|
|
5500
5616
|
endedAt,
|
|
5501
5617
|
error,
|
|
@@ -5537,7 +5653,7 @@ async function waitForAgentJob(params) {
|
|
|
5537
5653
|
const error = typeof evt.data?.error === "string" ? evt.data.error : void 0;
|
|
5538
5654
|
const snapshot = {
|
|
5539
5655
|
runId: evt.runId,
|
|
5540
|
-
status: phase === "error" ? "error" : "ok",
|
|
5656
|
+
status: phase === "error" ? "error" : evt.data?.aborted ? "timeout" : "ok",
|
|
5541
5657
|
startedAt,
|
|
5542
5658
|
endedAt,
|
|
5543
5659
|
error,
|
|
@@ -5622,6 +5738,7 @@ const agentHandlers = {
|
|
|
5622
5738
|
let resolvedGroupChannel = groupChannelRaw || void 0;
|
|
5623
5739
|
let resolvedGroupSpace = groupSpaceRaw || void 0;
|
|
5624
5740
|
let spawnedByValue = typeof request.spawnedBy === "string" ? request.spawnedBy.trim() : void 0;
|
|
5741
|
+
const inputProvenance = normalizeInputProvenance(request.inputProvenance);
|
|
5625
5742
|
const cached = context.dedupe.get(`agent:${idem}`);
|
|
5626
5743
|
if (cached) {
|
|
5627
5744
|
respond(cached.ok, cached.payload, cached.error, { cached: true });
|
|
@@ -5828,7 +5945,8 @@ const agentHandlers = {
|
|
|
5828
5945
|
messageChannel: resolvedChannel,
|
|
5829
5946
|
runId,
|
|
5830
5947
|
lane: request.lane,
|
|
5831
|
-
extraSystemPrompt: request.extraSystemPrompt
|
|
5948
|
+
extraSystemPrompt: request.extraSystemPrompt,
|
|
5949
|
+
inputProvenance
|
|
5832
5950
|
}, defaultRuntime, context.deps).then((result) => {
|
|
5833
5951
|
const payload = {
|
|
5834
5952
|
runId,
|
|
@@ -6749,9 +6867,13 @@ const channelsHandlers = {
|
|
|
6749
6867
|
//#region src/gateway/server-methods/chat.ts
|
|
6750
6868
|
function resolveTranscriptPath(params) {
|
|
6751
6869
|
const { sessionId, storePath, sessionFile } = params;
|
|
6752
|
-
if (sessionFile) return
|
|
6753
|
-
|
|
6754
|
-
|
|
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
|
+
}
|
|
6755
6877
|
}
|
|
6756
6878
|
function ensureTranscriptFile(params) {
|
|
6757
6879
|
if (fs.existsSync(params.transcriptPath)) return { ok: true };
|
|
@@ -7280,16 +7402,32 @@ function applyMergePatch(base, patch) {
|
|
|
7280
7402
|
*/
|
|
7281
7403
|
const REDACTED_SENTINEL = "__OPENCLAW_REDACTED__";
|
|
7282
7404
|
/**
|
|
7405
|
+
* Non-sensitive field names that happen to match sensitive patterns.
|
|
7406
|
+
* These are explicitly excluded from redaction.
|
|
7407
|
+
*/
|
|
7408
|
+
const SENSITIVE_KEY_WHITELIST = new Set([
|
|
7409
|
+
"maxtokens",
|
|
7410
|
+
"maxoutputtokens",
|
|
7411
|
+
"maxinputtokens",
|
|
7412
|
+
"maxcompletiontokens",
|
|
7413
|
+
"contexttokens",
|
|
7414
|
+
"totaltokens",
|
|
7415
|
+
"tokencount",
|
|
7416
|
+
"tokenlimit",
|
|
7417
|
+
"tokenbudget"
|
|
7418
|
+
]);
|
|
7419
|
+
/**
|
|
7283
7420
|
* Patterns that identify sensitive config field names.
|
|
7284
7421
|
* Aligned with the UI-hint logic in schema.ts.
|
|
7285
7422
|
*/
|
|
7286
7423
|
const SENSITIVE_KEY_PATTERNS = [
|
|
7287
|
-
/token
|
|
7424
|
+
/token$/i,
|
|
7288
7425
|
/password/i,
|
|
7289
7426
|
/secret/i,
|
|
7290
7427
|
/api.?key/i
|
|
7291
7428
|
];
|
|
7292
7429
|
function isSensitiveKey(key) {
|
|
7430
|
+
if (SENSITIVE_KEY_WHITELIST.has(key.toLowerCase())) return false;
|
|
7293
7431
|
return SENSITIVE_KEY_PATTERNS.some((pattern) => pattern.test(key));
|
|
7294
7432
|
}
|
|
7295
7433
|
/**
|
|
@@ -7999,7 +8137,7 @@ const FIELD_PLACEHOLDERS = {
|
|
|
7999
8137
|
"agents.list[].identity.avatar": "avatars/openclaw.png"
|
|
8000
8138
|
};
|
|
8001
8139
|
const SENSITIVE_PATTERNS = [
|
|
8002
|
-
/token
|
|
8140
|
+
/token$/i,
|
|
8003
8141
|
/password/i,
|
|
8004
8142
|
/secret/i,
|
|
8005
8143
|
/api.?key/i
|
|
@@ -8931,7 +9069,7 @@ async function verifyDeviceToken(params) {
|
|
|
8931
9069
|
ok: false,
|
|
8932
9070
|
reason: "token-revoked"
|
|
8933
9071
|
};
|
|
8934
|
-
if (
|
|
9072
|
+
if (!safeEqualSecret(params.token, entry.token)) return {
|
|
8935
9073
|
ok: false,
|
|
8936
9074
|
reason: "token-mismatch"
|
|
8937
9075
|
};
|
|
@@ -9783,7 +9921,7 @@ const nodeHandlers = {
|
|
|
9783
9921
|
const p = params;
|
|
9784
9922
|
const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
|
|
9785
9923
|
await respondUnavailableOnThrow(respond, async () => {
|
|
9786
|
-
const { handleNodeEvent } = await import("./server-node-events-
|
|
9924
|
+
const { handleNodeEvent } = await import("./server-node-events-QCvh8EgI.js");
|
|
9787
9925
|
const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
|
|
9788
9926
|
await handleNodeEvent({
|
|
9789
9927
|
deps: context.deps,
|
|
@@ -9851,8 +9989,13 @@ const sendHandlers = {
|
|
|
9851
9989
|
return;
|
|
9852
9990
|
}
|
|
9853
9991
|
const to = request.to.trim();
|
|
9854
|
-
const message = request.message.trim();
|
|
9855
|
-
const
|
|
9992
|
+
const message = typeof request.message === "string" ? request.message.trim() : "";
|
|
9993
|
+
const mediaUrl = typeof request.mediaUrl === "string" && request.mediaUrl.trim().length > 0 ? request.mediaUrl.trim() : void 0;
|
|
9994
|
+
const mediaUrls = Array.isArray(request.mediaUrls) ? request.mediaUrls.map((entry) => typeof entry === "string" ? entry.trim() : "").filter((entry) => entry.length > 0) : void 0;
|
|
9995
|
+
if (!message && !mediaUrl && (mediaUrls?.length ?? 0) === 0) {
|
|
9996
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid send params: text or media is required"));
|
|
9997
|
+
return;
|
|
9998
|
+
}
|
|
9856
9999
|
const channelInput = typeof request.channel === "string" ? request.channel : void 0;
|
|
9857
10000
|
const normalizedChannel = channelInput ? normalizeChannelId(channelInput) : null;
|
|
9858
10001
|
if (channelInput && !normalizedChannel) {
|
|
@@ -9884,7 +10027,7 @@ const sendHandlers = {
|
|
|
9884
10027
|
const outboundDeps = context.deps ? createOutboundSendDeps(context.deps) : void 0;
|
|
9885
10028
|
const mirrorPayloads = normalizeReplyPayloadsForDelivery([{
|
|
9886
10029
|
text: message,
|
|
9887
|
-
mediaUrl
|
|
10030
|
+
mediaUrl,
|
|
9888
10031
|
mediaUrls
|
|
9889
10032
|
}]);
|
|
9890
10033
|
const mirrorText = mirrorPayloads.map((payload) => payload.text).filter(Boolean).join("\n");
|
|
@@ -9912,7 +10055,7 @@ const sendHandlers = {
|
|
|
9912
10055
|
accountId,
|
|
9913
10056
|
payloads: [{
|
|
9914
10057
|
text: message,
|
|
9915
|
-
mediaUrl
|
|
10058
|
+
mediaUrl,
|
|
9916
10059
|
mediaUrls
|
|
9917
10060
|
}],
|
|
9918
10061
|
gifPlayback: request.gifPlayback,
|
|
@@ -11283,7 +11426,7 @@ const usageHandlers = {
|
|
|
11283
11426
|
const limit = typeof p.limit === "number" && Number.isFinite(p.limit) ? p.limit : 50;
|
|
11284
11427
|
const includeContextWeight = p.includeContextWeight ?? false;
|
|
11285
11428
|
const specificKey = typeof p.key === "string" ? p.key.trim() : null;
|
|
11286
|
-
const { store } = loadCombinedSessionStoreForGateway(config);
|
|
11429
|
+
const { storePath, store } = loadCombinedSessionStoreForGateway(config);
|
|
11287
11430
|
const now = Date.now();
|
|
11288
11431
|
const mergedEntries = [];
|
|
11289
11432
|
if (specificKey) {
|
|
@@ -11303,7 +11446,13 @@ const usageHandlers = {
|
|
|
11303
11446
|
const resolvedStoreKey = storeMatch?.key ?? storeByIdMatch?.key ?? specificKey;
|
|
11304
11447
|
const storeEntry = storeMatch?.entry ?? storeByIdMatch?.entry;
|
|
11305
11448
|
const sessionId = storeEntry?.sessionId ?? keyRest;
|
|
11306
|
-
|
|
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
|
+
}
|
|
11307
11456
|
try {
|
|
11308
11457
|
const stats = fs.statSync(sessionFile);
|
|
11309
11458
|
if (stats.isFile()) mergedEntries.push({
|
|
@@ -11629,14 +11778,22 @@ const usageHandlers = {
|
|
|
11629
11778
|
return;
|
|
11630
11779
|
}
|
|
11631
11780
|
const config = loadConfig();
|
|
11632
|
-
const { entry } = loadSessionEntry(key);
|
|
11781
|
+
const { entry, storePath } = loadSessionEntry(key);
|
|
11633
11782
|
const parsed = parseAgentSessionKey(key);
|
|
11634
11783
|
const agentId = parsed?.agentId;
|
|
11635
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
|
+
}
|
|
11636
11793
|
const timeseries = await loadSessionUsageTimeSeries({
|
|
11637
|
-
sessionId
|
|
11794
|
+
sessionId,
|
|
11638
11795
|
sessionEntry: entry,
|
|
11639
|
-
sessionFile
|
|
11796
|
+
sessionFile,
|
|
11640
11797
|
config,
|
|
11641
11798
|
maxPoints: 200
|
|
11642
11799
|
});
|
|
@@ -11654,13 +11811,19 @@ const usageHandlers = {
|
|
|
11654
11811
|
}
|
|
11655
11812
|
const limit = typeof params?.limit === "number" && Number.isFinite(params.limit) ? Math.min(params.limit, 1e3) : 200;
|
|
11656
11813
|
const config = loadConfig();
|
|
11657
|
-
const { entry } = loadSessionEntry(key);
|
|
11814
|
+
const { entry, storePath } = loadSessionEntry(key);
|
|
11658
11815
|
const parsed = parseAgentSessionKey(key);
|
|
11659
11816
|
const agentId = parsed?.agentId;
|
|
11660
11817
|
const rawSessionId = parsed?.rest ?? key;
|
|
11661
11818
|
const sessionId = entry?.sessionId ?? rawSessionId;
|
|
11662
|
-
|
|
11663
|
-
|
|
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);
|
|
11664
11827
|
respond(true, { logs: await loadSessionLogs({
|
|
11665
11828
|
sessionId,
|
|
11666
11829
|
sessionEntry: entry,
|
|
@@ -12666,6 +12829,12 @@ function resolveHooksConfig(cfg) {
|
|
|
12666
12829
|
const maxBodyBytes = cfg.hooks?.maxBodyBytes && cfg.hooks.maxBodyBytes > 0 ? cfg.hooks.maxBodyBytes : DEFAULT_HOOKS_MAX_BODY_BYTES;
|
|
12667
12830
|
const mappings = resolveHookMappings(cfg.hooks);
|
|
12668
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");
|
|
12669
12838
|
return {
|
|
12670
12839
|
basePath: trimmed,
|
|
12671
12840
|
token,
|
|
@@ -12673,8 +12842,13 @@ function resolveHooksConfig(cfg) {
|
|
|
12673
12842
|
mappings,
|
|
12674
12843
|
agentPolicy: {
|
|
12675
12844
|
defaultAgentId,
|
|
12676
|
-
knownAgentIds
|
|
12677
|
-
allowedAgentIds
|
|
12845
|
+
knownAgentIds,
|
|
12846
|
+
allowedAgentIds
|
|
12847
|
+
},
|
|
12848
|
+
sessionPolicy: {
|
|
12849
|
+
defaultSessionKey,
|
|
12850
|
+
allowRequestSessionKey: cfg.hooks?.allowRequestSessionKey === true,
|
|
12851
|
+
allowedSessionKeyPrefixes
|
|
12678
12852
|
}
|
|
12679
12853
|
};
|
|
12680
12854
|
}
|
|
@@ -12699,6 +12873,29 @@ function resolveAllowedAgentIds(raw) {
|
|
|
12699
12873
|
if (hasWildcard) return;
|
|
12700
12874
|
return allowed;
|
|
12701
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
|
+
}
|
|
12702
12899
|
function extractHookToken(req) {
|
|
12703
12900
|
const auth = typeof req.headers.authorization === "string" ? req.headers.authorization.trim() : "";
|
|
12704
12901
|
if (auth.toLowerCase().startsWith("bearer ")) {
|
|
@@ -12809,7 +13006,42 @@ function isHookAgentAllowed(hooksConfig, agentId) {
|
|
|
12809
13006
|
return resolved ? allowed.has(resolved) : false;
|
|
12810
13007
|
}
|
|
12811
13008
|
const getHookAgentPolicyError = () => "agentId is not allowed by hooks.allowedAgentIds";
|
|
12812
|
-
|
|
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) {
|
|
12813
13045
|
const message = typeof payload.message === "string" ? payload.message.trim() : "";
|
|
12814
13046
|
if (!message) return {
|
|
12815
13047
|
ok: false,
|
|
@@ -12821,8 +13053,7 @@ function normalizeAgentPayload(payload, opts) {
|
|
|
12821
13053
|
const agentId = typeof agentIdRaw === "string" && agentIdRaw.trim() ? agentIdRaw.trim() : void 0;
|
|
12822
13054
|
const wakeMode = payload.wakeMode === "next-heartbeat" ? "next-heartbeat" : "now";
|
|
12823
13055
|
const sessionKeyRaw = payload.sessionKey;
|
|
12824
|
-
const
|
|
12825
|
-
const sessionKey = typeof sessionKeyRaw === "string" && sessionKeyRaw.trim() ? sessionKeyRaw.trim() : `hook:${idFactory()}`;
|
|
13056
|
+
const sessionKey = typeof sessionKeyRaw === "string" && sessionKeyRaw.trim() ? sessionKeyRaw.trim() : void 0;
|
|
12826
13057
|
const channel = resolveHookChannel(payload.channel);
|
|
12827
13058
|
if (!channel) return {
|
|
12828
13059
|
ok: false,
|
|
@@ -12863,7 +13094,7 @@ function normalizeAgentPayload(payload, opts) {
|
|
|
12863
13094
|
async function startBrowserControlServerIfEnabled() {
|
|
12864
13095
|
if (isTruthyEnvValue(process.env.OPENCLAW_SKIP_BROWSER_CONTROL_SERVER)) return null;
|
|
12865
13096
|
const override = process.env.OPENCLAW_BROWSER_CONTROL_MODULE?.trim();
|
|
12866
|
-
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);
|
|
12867
13098
|
const start = typeof mod.startBrowserControlServiceFromConfig === "function" ? mod.startBrowserControlServiceFromConfig : mod.startBrowserControlServerFromConfig;
|
|
12868
13099
|
const stop = typeof mod.stopBrowserControlService === "function" ? mod.stopBrowserControlService : mod.stopBrowserControlServer;
|
|
12869
13100
|
if (!start) return null;
|
|
@@ -14514,6 +14745,7 @@ const OutputTextDoneEventSchema = z.object({
|
|
|
14514
14745
|
//#endregion
|
|
14515
14746
|
//#region src/gateway/openresponses-http.ts
|
|
14516
14747
|
const DEFAULT_BODY_BYTES$1 = 20 * 1024 * 1024;
|
|
14748
|
+
const DEFAULT_MAX_URL_PARTS = 8;
|
|
14517
14749
|
function writeSseEvent(res, event) {
|
|
14518
14750
|
res.write(`event: ${event.type}\n`);
|
|
14519
14751
|
res.write(`data: ${JSON.stringify(event)}\n\n`);
|
|
@@ -14526,13 +14758,20 @@ function extractTextContent(content) {
|
|
|
14526
14758
|
return "";
|
|
14527
14759
|
}).filter(Boolean).join("\n");
|
|
14528
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
|
+
}
|
|
14529
14766
|
function resolveResponsesLimits(config) {
|
|
14530
14767
|
const files = config?.files;
|
|
14531
14768
|
const images = config?.images;
|
|
14532
14769
|
return {
|
|
14533
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,
|
|
14534
14772
|
files: {
|
|
14535
14773
|
allowUrl: files?.allowUrl ?? true,
|
|
14774
|
+
urlAllowlist: normalizeHostnameAllowlist(files?.urlAllowlist),
|
|
14536
14775
|
allowedMimes: normalizeMimeList(files?.allowedMimes, DEFAULT_INPUT_FILE_MIMES),
|
|
14537
14776
|
maxBytes: files?.maxBytes ?? DEFAULT_INPUT_FILE_MAX_BYTES,
|
|
14538
14777
|
maxChars: files?.maxChars ?? DEFAULT_INPUT_FILE_MAX_CHARS,
|
|
@@ -14546,6 +14785,7 @@ function resolveResponsesLimits(config) {
|
|
|
14546
14785
|
},
|
|
14547
14786
|
images: {
|
|
14548
14787
|
allowUrl: images?.allowUrl ?? true,
|
|
14788
|
+
urlAllowlist: normalizeHostnameAllowlist(images?.urlAllowlist),
|
|
14549
14789
|
allowedMimes: normalizeMimeList(images?.allowedMimes, DEFAULT_INPUT_IMAGE_MIMES),
|
|
14550
14790
|
maxBytes: images?.maxBytes ?? DEFAULT_INPUT_IMAGE_MAX_BYTES,
|
|
14551
14791
|
maxRedirects: images?.maxRedirects ?? DEFAULT_INPUT_MAX_REDIRECTS,
|
|
@@ -14727,6 +14967,11 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14727
14967
|
const user = payload.user;
|
|
14728
14968
|
let images = [];
|
|
14729
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
|
+
};
|
|
14730
14975
|
try {
|
|
14731
14976
|
if (Array.isArray(payload.input)) {
|
|
14732
14977
|
for (const item of payload.input) if (item.type === "message" && typeof item.content !== "string") for (const part of item.content) {
|
|
@@ -14734,6 +14979,7 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14734
14979
|
const source = part.source;
|
|
14735
14980
|
const sourceType = source.type === "base64" || source.type === "url" ? source.type : void 0;
|
|
14736
14981
|
if (!sourceType) throw new Error("input_image must have 'source.url' or 'source.data'");
|
|
14982
|
+
if (sourceType === "url") markUrlPart();
|
|
14737
14983
|
const image = await extractImageContentFromSource({
|
|
14738
14984
|
type: sourceType,
|
|
14739
14985
|
url: source.url,
|
|
@@ -14747,6 +14993,7 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14747
14993
|
const source = part.source;
|
|
14748
14994
|
const sourceType = source.type === "base64" || source.type === "url" ? source.type : void 0;
|
|
14749
14995
|
if (!sourceType) throw new Error("input_file must have 'source.url' or 'source.data'");
|
|
14996
|
+
if (sourceType === "url") markUrlPart();
|
|
14750
14997
|
const file = await extractFileContentFromSource({
|
|
14751
14998
|
source: {
|
|
14752
14999
|
type: sourceType,
|
|
@@ -15310,6 +15557,9 @@ async function handleToolsInvokeHttpRequest(req, res, opts) {
|
|
|
15310
15557
|
|
|
15311
15558
|
//#endregion
|
|
15312
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;
|
|
15313
15563
|
function sendJson(res, status, body) {
|
|
15314
15564
|
res.statusCode = status;
|
|
15315
15565
|
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
@@ -15351,6 +15601,31 @@ async function authorizeCanvasRequest(params) {
|
|
|
15351
15601
|
}
|
|
15352
15602
|
function createHooksRequestHandler(opts) {
|
|
15353
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
|
+
};
|
|
15354
15629
|
return async (req, res) => {
|
|
15355
15630
|
const hooksConfig = getHooksConfig();
|
|
15356
15631
|
if (!hooksConfig) return false;
|
|
@@ -15364,12 +15639,24 @@ function createHooksRequestHandler(opts) {
|
|
|
15364
15639
|
return true;
|
|
15365
15640
|
}
|
|
15366
15641
|
const token = extractHookToken(req);
|
|
15367
|
-
|
|
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
|
+
}
|
|
15368
15654
|
res.statusCode = 401;
|
|
15369
15655
|
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
15370
15656
|
res.end("Unauthorized");
|
|
15371
15657
|
return true;
|
|
15372
15658
|
}
|
|
15659
|
+
clearHookAuthFailure(clientKey);
|
|
15373
15660
|
if (req.method !== "POST") {
|
|
15374
15661
|
res.statusCode = 405;
|
|
15375
15662
|
res.setHeader("Allow", "POST");
|
|
@@ -15426,10 +15713,23 @@ function createHooksRequestHandler(opts) {
|
|
|
15426
15713
|
});
|
|
15427
15714
|
return true;
|
|
15428
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
|
+
}
|
|
15429
15728
|
sendJson(res, 202, {
|
|
15430
15729
|
ok: true,
|
|
15431
15730
|
runId: dispatchAgentHook({
|
|
15432
15731
|
...normalized.value,
|
|
15732
|
+
sessionKey: sessionKey.value,
|
|
15433
15733
|
agentId: resolveHookTargetAgentId(hooksConfig, normalized.value.agentId)
|
|
15434
15734
|
})
|
|
15435
15735
|
});
|
|
@@ -15481,6 +15781,18 @@ function createHooksRequestHandler(opts) {
|
|
|
15481
15781
|
});
|
|
15482
15782
|
return true;
|
|
15483
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
|
+
}
|
|
15484
15796
|
sendJson(res, 202, {
|
|
15485
15797
|
ok: true,
|
|
15486
15798
|
runId: dispatchAgentHook({
|
|
@@ -15488,7 +15800,7 @@ function createHooksRequestHandler(opts) {
|
|
|
15488
15800
|
name: mapped.action.name ?? "Hook",
|
|
15489
15801
|
agentId: resolveHookTargetAgentId(hooksConfig, mapped.action.agentId),
|
|
15490
15802
|
wakeMode: mapped.action.wakeMode,
|
|
15491
|
-
sessionKey:
|
|
15803
|
+
sessionKey: sessionKey.value,
|
|
15492
15804
|
deliver: resolveHookDeliver(mapped.action.deliver),
|
|
15493
15805
|
channel,
|
|
15494
15806
|
to: mapped.action.to,
|
|
@@ -15526,13 +15838,31 @@ function createGatewayHttpServer(opts) {
|
|
|
15526
15838
|
try {
|
|
15527
15839
|
const configSnapshot = loadConfig();
|
|
15528
15840
|
const trustedProxies = configSnapshot.gateway?.trustedProxies ?? [];
|
|
15841
|
+
const requestPath = new URL(req.url ?? "/", "http://localhost").pathname;
|
|
15529
15842
|
if (await handleHooksRequest(req, res)) return;
|
|
15530
15843
|
if (await handleToolsInvokeHttpRequest(req, res, {
|
|
15531
15844
|
auth: resolvedAuth,
|
|
15532
15845
|
trustedProxies
|
|
15533
15846
|
})) return;
|
|
15534
15847
|
if (await handleSlackHttpRequest(req, res)) return;
|
|
15535
|
-
if (handlePluginRequest
|
|
15848
|
+
if (handlePluginRequest) {
|
|
15849
|
+
if (requestPath.startsWith("/api/channels/")) {
|
|
15850
|
+
const token = getBearerToken(req);
|
|
15851
|
+
if (!(await authorizeGatewayConnect({
|
|
15852
|
+
auth: resolvedAuth,
|
|
15853
|
+
connectAuth: token ? {
|
|
15854
|
+
token,
|
|
15855
|
+
password: token
|
|
15856
|
+
} : null,
|
|
15857
|
+
req,
|
|
15858
|
+
trustedProxies
|
|
15859
|
+
})).ok) {
|
|
15860
|
+
sendUnauthorized(res);
|
|
15861
|
+
return;
|
|
15862
|
+
}
|
|
15863
|
+
}
|
|
15864
|
+
if (await handlePluginRequest(req, res)) return;
|
|
15865
|
+
}
|
|
15536
15866
|
if (openResponsesEnabled) {
|
|
15537
15867
|
if (await handleOpenResponsesHttpRequest(req, res, {
|
|
15538
15868
|
auth: resolvedAuth,
|
|
@@ -15547,7 +15877,7 @@ function createGatewayHttpServer(opts) {
|
|
|
15547
15877
|
})) return;
|
|
15548
15878
|
}
|
|
15549
15879
|
if (canvasHost) {
|
|
15550
|
-
if (isCanvasPath(
|
|
15880
|
+
if (isCanvasPath(requestPath)) {
|
|
15551
15881
|
if (!await authorizeCanvasRequest({
|
|
15552
15882
|
req,
|
|
15553
15883
|
auth: resolvedAuth,
|
|
@@ -15621,7 +15951,7 @@ function createGatewayHooksRequestHandler(params) {
|
|
|
15621
15951
|
if (value.mode === "now") requestHeartbeatNow({ reason: "hook:wake" });
|
|
15622
15952
|
};
|
|
15623
15953
|
const dispatchAgentHook = (value) => {
|
|
15624
|
-
const sessionKey = value.sessionKey.trim()
|
|
15954
|
+
const sessionKey = value.sessionKey.trim();
|
|
15625
15955
|
const mainSessionKey = resolveMainSessionKeyFromConfig();
|
|
15626
15956
|
const jobId = randomUUID();
|
|
15627
15957
|
const now = Date.now();
|
|
@@ -16613,8 +16943,7 @@ function attachGatewayWsMessageHandler(params) {
|
|
|
16613
16943
|
close(1008, "invalid role");
|
|
16614
16944
|
return;
|
|
16615
16945
|
}
|
|
16616
|
-
const
|
|
16617
|
-
const scopes = requestedScopes.length > 0 ? requestedScopes : role === "operator" ? ["operator.admin"] : [];
|
|
16946
|
+
const scopes = Array.isArray(connectParams.scopes) ? connectParams.scopes : [];
|
|
16618
16947
|
connectParams.role = role;
|
|
16619
16948
|
connectParams.scopes = scopes;
|
|
16620
16949
|
const isControlUi = connectParams.client.id === GATEWAY_CLIENT_IDS.CONTROL_UI;
|
|
@@ -16818,7 +17147,7 @@ function attachGatewayWsMessageHandler(params) {
|
|
|
16818
17147
|
clientId: connectParams.client.id,
|
|
16819
17148
|
clientMode: connectParams.client.mode,
|
|
16820
17149
|
role,
|
|
16821
|
-
scopes
|
|
17150
|
+
scopes,
|
|
16822
17151
|
signedAtMs: signedAt,
|
|
16823
17152
|
token: connectParams.auth?.token ?? null,
|
|
16824
17153
|
nonce: providedNonce || void 0,
|
|
@@ -16831,7 +17160,7 @@ function attachGatewayWsMessageHandler(params) {
|
|
|
16831
17160
|
clientId: connectParams.client.id,
|
|
16832
17161
|
clientMode: connectParams.client.mode,
|
|
16833
17162
|
role,
|
|
16834
|
-
scopes
|
|
17163
|
+
scopes,
|
|
16835
17164
|
signedAtMs: signedAt,
|
|
16836
17165
|
token: connectParams.auth?.token ?? null,
|
|
16837
17166
|
version: "v1"
|
|
@@ -17680,6 +18009,12 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
17680
18009
|
logChannels,
|
|
17681
18010
|
logBrowser
|
|
17682
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
|
+
}
|
|
17683
18018
|
const { applyHotReload, requestGatewayRestart } = createGatewayReloadHandlers({
|
|
17684
18019
|
deps,
|
|
17685
18020
|
broadcast,
|
|
@@ -17742,6 +18077,14 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
17742
18077
|
httpServers
|
|
17743
18078
|
});
|
|
17744
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
|
+
}
|
|
17745
18088
|
if (diagnosticsEnabled) stopDiagnosticHeartbeat();
|
|
17746
18089
|
if (skillsRefreshTimer) {
|
|
17747
18090
|
clearTimeout(skillsRefreshTimer);
|
|
@@ -17847,6 +18190,8 @@ async function runGatewayLoop(params) {
|
|
|
17847
18190
|
process.removeListener("SIGINT", onSigint);
|
|
17848
18191
|
process.removeListener("SIGUSR1", onSigusr1);
|
|
17849
18192
|
};
|
|
18193
|
+
const DRAIN_TIMEOUT_MS = 3e4;
|
|
18194
|
+
const SHUTDOWN_TIMEOUT_MS = 5e3;
|
|
17850
18195
|
const request = (action, signal) => {
|
|
17851
18196
|
if (shuttingDown) {
|
|
17852
18197
|
gatewayLog$1.info(`received ${signal} during shutdown; ignoring`);
|
|
@@ -17855,13 +18200,23 @@ async function runGatewayLoop(params) {
|
|
|
17855
18200
|
shuttingDown = true;
|
|
17856
18201
|
const isRestart = action === "restart";
|
|
17857
18202
|
gatewayLog$1.info(`received ${signal}; ${isRestart ? "restarting" : "shutting down"}`);
|
|
18203
|
+
const forceExitMs = isRestart ? DRAIN_TIMEOUT_MS + SHUTDOWN_TIMEOUT_MS : SHUTDOWN_TIMEOUT_MS;
|
|
17858
18204
|
const forceExitTimer = setTimeout(() => {
|
|
17859
18205
|
gatewayLog$1.error("shutdown timed out; exiting without full cleanup");
|
|
17860
18206
|
cleanupSignals();
|
|
17861
18207
|
params.runtime.exit(0);
|
|
17862
|
-
},
|
|
18208
|
+
}, forceExitMs);
|
|
17863
18209
|
(async () => {
|
|
17864
18210
|
try {
|
|
18211
|
+
if (isRestart) {
|
|
18212
|
+
const activeTasks = getActiveTaskCount();
|
|
18213
|
+
if (activeTasks > 0) {
|
|
18214
|
+
gatewayLog$1.info(`draining ${activeTasks} active task(s) before restart (timeout ${DRAIN_TIMEOUT_MS}ms)`);
|
|
18215
|
+
const { drained } = await waitForActiveTasks(DRAIN_TIMEOUT_MS);
|
|
18216
|
+
if (drained) gatewayLog$1.info("all active tasks drained");
|
|
18217
|
+
else gatewayLog$1.warn("drain timeout reached; proceeding with restart");
|
|
18218
|
+
}
|
|
18219
|
+
}
|
|
17865
18220
|
await server?.close({
|
|
17866
18221
|
reason: isRestart ? "gateway restarting" : "gateway stopping",
|
|
17867
18222
|
restartExpectedMs: isRestart ? 1500 : null
|