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,95 +1,97 @@
|
|
|
1
1
|
import { _ as expandHomePrefix, g as resolveStateDir, i as isNixMode, l as resolveGatewayLockDir, o as resolveConfigPath, r as STATE_DIR, t as CONFIG_PATH, u as resolveGatewayPort } from "./paths-DVBShlw6.js";
|
|
2
|
-
import { B as getLogger, C as getActivePluginRegistry, I as colorize, L as isRich, M as setVerbose, R as theme, V as getResolvedLoggerSettings, a as setConsoleTimestampPrefix, c as defaultRuntime, h as DEFAULT_CHAT_CHANNEL, i as setConsoleSubsystemFilter, n as runtimeForLogger, p as CHANNEL_IDS, t as createSubsystemLogger, z as getChildLogger } from "./subsystem-
|
|
3
|
-
import { C as shortenHomePath, D as truncateUtf16Safe, b as resolveUserPath, c as ensureDir, d as isPlainObject, r as clamp, t as CONFIG_DIR } from "./utils-
|
|
4
|
-
import {
|
|
5
|
-
import { $ as inferLegacyName, $n as isTtsEnabled, $t as getSkillsSnapshotVersion, An as runSubagentAnnounceFlow, Ar as
|
|
2
|
+
import { B as getLogger, C as getActivePluginRegistry, I as colorize, L as isRich, M as setVerbose, R as theme, V as getResolvedLoggerSettings, a as setConsoleTimestampPrefix, c as defaultRuntime, h as DEFAULT_CHAT_CHANNEL, i as setConsoleSubsystemFilter, n as runtimeForLogger, p as CHANNEL_IDS, t as createSubsystemLogger, z as getChildLogger } from "./subsystem-BoExtIHo.js";
|
|
3
|
+
import { C as shortenHomePath, D as truncateUtf16Safe, b as resolveUserPath, c as ensureDir, d as isPlainObject, r as clamp, t as CONFIG_DIR } from "./utils-Cd9QdCHh.js";
|
|
4
|
+
import { G as normalizeUsageDisplay, H as normalizeElevatedLevel, J as supportsXHighThinking, K as normalizeVerboseLevel, R as formatThinkingLevels, U as normalizeReasoningLevel, W as normalizeThinkLevel, z as formatXHighModelHint } from "./pi-embedded-helpers-CMKLjW6X.js";
|
|
5
|
+
import { $ as inferLegacyName, $n as isTtsEnabled, $t as getSkillsSnapshotVersion, An as runSubagentAnnounceFlow, Ar as DEFAULT_INPUT_FILE_MAX_BYTES, B as consumeGatewaySigusr1RestartAuthorization, Br as extractFileContentFromSource, Bt as getRemoteSkillEligibility, C as readSessionMessages, Dn as isAbortTrigger, Dr as enqueueSystemEvent, E as stripEnvelopeFromMessages, En as formatZonedTimestamp, Er as parseVerboseOverride, F as resetDirectoryCache, Fn as onAgentEvent, Fr as DEFAULT_INPUT_MAX_REDIRECTS, G as formatDoctorNonInteractiveHint, Gn as resolveUserTimezone, Gt as setSkillsRemoteRegistry, H as scheduleGatewaySigusr1Restart, Hn as resolveMemoryBackendConfig, Hr as normalizeMimeList, Ht as recordRemoteNodeInfo, In as registerAgentRunContext, Ir as DEFAULT_INPUT_PDF_MAX_PAGES, It as CONTROL_UI_AVATAR_PREFIX, J as summarizeRestartSentinel, Jn as registerInternalHook, Jt as rejectNodePairing, K as formatRestartSentinelMessage, Kn as clearInternalHooks, Kt as approveNodePairing, L as runWithModelFallback, Lr as DEFAULT_INPUT_PDF_MAX_PIXELS, Lt as buildControlUiAvatarUrl, M as resolveOutboundTarget, Mn as clearAgentRunContext, Mr as DEFAULT_INPUT_FILE_MIMES, N as resolveSessionDeliveryTarget, Nn as emitAgentEvent, Nr as DEFAULT_INPUT_IMAGE_MAX_BYTES, O as ensureOutboundSessionEntry, On as stopSubagentsForRequester, Or as isSystemEventContextChanged, Pn as getAgentRunContext, Pr as DEFAULT_INPUT_IMAGE_MIMES, Q as normalizeCronJobPatch, Qn as getTtsProvider, Qt as verifyNodeToken, Rn as normalizePollInput, Rr as DEFAULT_INPUT_PDF_MIN_TEXT_CHARS, Rt as normalizeControlUiBasePath, S as capArrayByJsonBytes, Sr as lookupContextTokens, T as resolveSessionTranscriptCandidates, Tn as createReplyDispatcher, Tr as applyVerboseOverride, Tt as handleReset, U as setGatewaySigusr1RestartPolicy, Un as resolveAgentIdentity, Ur as resolveAgentTimeoutMs, Ut as refreshRemoteBinsForConnectedNodes, V as isGatewaySigusr1RestartExternallyAllowed, Vn as getMemorySearchManager, Vr as extractImageContentFromSource, Vt as primeRemoteSkillsCache, W as consumeRestartSentinel, Wt as refreshRemoteNodeBins, X as writeRestartSentinel, Xn as OPENAI_TTS_MODELS, Xt as requestNodePairing, Yn as triggerInternalHook, Yt as renamePairedNode, Z as normalizeCronJobCreate, Zn as OPENAI_TTS_VOICES, Zt as updatePairedNodeMetadata, _ as loadCombinedSessionStoreForGateway, _r as DEFAULT_HEARTBEAT_ACK_MAX_CHARS, ar as resolveTtsProviderOrder, b as resolveSessionModelRef, c as clearSessionQueues, cn as createReplyPrefixOptions, cr as textToSpeech, d as waitForEmbeddedPiRunEnd, dn as buildHistoryContextFromEntries, dr as setCommandLaneConcurrency, dt as loadProviderUsageSummary, en as registerSkillsChangeListener, er as isTtsProviderConfigured, et as normalizeOptionalAgentId, fn as resolveHeartbeatVisibility, fr as waitForActiveTasks, g as listSessionsFromStore, gr as isDiagnosticsEnabled, gt as handleSlackHttpRequest, h as listAgentsForGateway, hn as onHeartbeatEvent, hr as stopDiagnosticHeartbeat, i as runCliAgent, in as isExternalHookSession, ir as resolveTtsPrefsPath, it as migrateLegacyCronPayload, jr as DEFAULT_INPUT_FILE_MAX_CHARS, k as resolveOutboundSessionRoute, kn as initSubagentRegistry, l as runEmbeddedPiAgent, ln as normalizeGroupActivation, lr as getActiveTaskCount, lt as getPluginToolMeta, m as resolveAnnounceTargetFromKey, mn as getLastHeartbeatEvent, mr as startDiagnosticHeartbeat, n as getCliSessionId, nn as detectSuspiciousPatterns, nr as resolveTtsAutoMode, nt as normalizePayloadToSystemText, o as normalizeSendPolicy, or as setTtsEnabled, p as createOpenClawTools, pr as CommandLane, qn as createInternalHookEvent, qt as listNodePairing, r as setCliSessionId, rn as getHookType, rr as resolveTtsConfig, rt as normalizeRequiredName, s as resolveSendPolicy, sr as setTtsProvider, st as requestHeartbeatNow, tn as buildSafeExternalPrompt, tr as resolveTtsApiKey, tt as normalizeOptionalText, u as abortEmbeddedPiRun, ut as loadOpenClawPlugins, v as loadSessionEntry, vn as resolveCronStyleNow, w as readSessionPreviewItemsFromTranscript, wn as dispatchInboundMessage, wr as applyModelOverrideToSessionEntry, x as archiveFileOnDisk, xn as getChannelActivity, xr as stripHeartbeatToken, y as resolveGatewaySessionStoreTarget, z as authorizeGatewaySigusr1Restart, zr as DEFAULT_INPUT_TIMEOUT_MS, zt as resolveAssistantAvatarUrl } from "./reply-DICXkh_C.js";
|
|
6
6
|
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-BWxPj0z_.js";
|
|
7
|
-
import { a as logDebug, c as logWarn, n as runExec, t as runCommandWithTimeout } from "./exec-
|
|
8
|
-
import { t as resolveOpenClawPackageRoot } from "./openclaw-root-
|
|
9
|
-
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-
|
|
10
|
-
import { Dt as DEFAULT_MODEL, Et as DEFAULT_CONTEXT_TOKENS, Ot as DEFAULT_PROVIDER, St as normalizeSecretInput, a as isCliProvider, d as resolveConfiguredModelRef, f as resolveDefaultModelForAgent, h as resolveThinkingDefault, i as getModelRefStatus, l as resolveAllowedModelRef, p as resolveHooksGmailModel } from "./model-selection-
|
|
7
|
+
import { a as logDebug, c as logWarn, n as runExec, t as runCommandWithTimeout } from "./exec-YIosokWE.js";
|
|
8
|
+
import { t as resolveOpenClawPackageRoot } from "./openclaw-root-1VeFrph_.js";
|
|
9
|
+
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-CQCus0rI.js";
|
|
10
|
+
import { Dt as DEFAULT_MODEL, Et as DEFAULT_CONTEXT_TOKENS, Ot as DEFAULT_PROVIDER, St as normalizeSecretInput, a as isCliProvider, d as resolveConfiguredModelRef, f as resolveDefaultModelForAgent, h as resolveThinkingDefault, i as getModelRefStatus, l as resolveAllowedModelRef, p as resolveHooksGmailModel } from "./model-selection-BLuqsGVB.js";
|
|
11
11
|
import "./github-copilot-token-BW-SEg7E.js";
|
|
12
12
|
import { t as formatCliCommand } from "./command-format-ChfKqObn.js";
|
|
13
13
|
import "./boolean-BgXe2hyu.js";
|
|
14
|
-
import { n as logAcceptedEnvOption, t as isTruthyEnvValue } from "./env-
|
|
15
|
-
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
|
|
16
|
-
import {
|
|
17
|
-
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-
|
|
18
|
-
import { B as snapshotSessionOrigin, F as resolveAgentMainSessionKey, I as resolveExplicitAgentSessionKey, L as resolveMainSessionKey, R as resolveMainSessionKeyFromConfig, S as mergeDeliveryContext, at as normalizeToolName, b as deliveryContextFromSession, d as loadSessionStore, g as updateSessionStore, nt as collectExplicitAllowlist, ot as resolveToolProfilePolicy, rt as expandPolicyWithPluginGroups, st as stripPluginOnlyAllowlist, tt as buildPluginToolGroups, w as normalizeSessionDeliveryFields } from "./sandbox-
|
|
19
|
-
import "./
|
|
20
|
-
import "./
|
|
21
|
-
import
|
|
22
|
-
import { d as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { n as
|
|
26
|
-
import { n as
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import "./
|
|
30
|
-
import "./
|
|
31
|
-
import
|
|
32
|
-
import "./
|
|
33
|
-
import "./
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import "./
|
|
37
|
-
import "./
|
|
38
|
-
import "./
|
|
39
|
-
import
|
|
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 { n as
|
|
53
|
-
import {
|
|
54
|
-
import { n as
|
|
55
|
-
import
|
|
56
|
-
import {
|
|
57
|
-
import { t as
|
|
58
|
-
import "./
|
|
59
|
-
import {
|
|
60
|
-
import { t as
|
|
61
|
-
import "./
|
|
62
|
-
import "./
|
|
63
|
-
import { t as
|
|
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 "./service
|
|
80
|
-
import "./
|
|
81
|
-
import "./
|
|
82
|
-
import "./
|
|
83
|
-
import
|
|
84
|
-
import
|
|
85
|
-
import {
|
|
86
|
-
import "./
|
|
87
|
-
import {
|
|
88
|
-
import "./
|
|
89
|
-
import {
|
|
90
|
-
import
|
|
91
|
-
import { i as
|
|
92
|
-
import {
|
|
14
|
+
import { n as logAcceptedEnvOption, t as isTruthyEnvValue } from "./env-ONzUVAG2.js";
|
|
15
|
+
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-aFQssWKX.js";
|
|
16
|
+
import { c as isTestDefaultMemorySlotDisabled } from "./manifest-registry-CQhdnDBZ.js";
|
|
17
|
+
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-X7d_tfTE.js";
|
|
18
|
+
import { B as snapshotSessionOrigin, F as resolveAgentMainSessionKey, I as resolveExplicitAgentSessionKey, L as resolveMainSessionKey, R as resolveMainSessionKeyFromConfig, S as mergeDeliveryContext, at as normalizeToolName, b as deliveryContextFromSession, d as loadSessionStore, g as updateSessionStore, nt as collectExplicitAllowlist, ot as resolveToolProfilePolicy, rt as expandPolicyWithPluginGroups, st as stripPluginOnlyAllowlist, tt as buildPluginToolGroups, w as normalizeSessionDeliveryFields } from "./sandbox-Bhjnh1Xg.js";
|
|
19
|
+
import { f as registerUnhandledRejectionHandler, s as loadModelCatalog } from "./runner-D_dujMod.js";
|
|
20
|
+
import "./image-C4Nn2p3e.js";
|
|
21
|
+
import "./pi-model-discovery-EwKVHlZB.js";
|
|
22
|
+
import { d as inspectPortUsage, l as ensurePortAvailable, p as formatPortDiagnostics } from "./chrome-Cvr-57lg.js";
|
|
23
|
+
import { i as loadWorkspaceSkillEntries, m as hasBinary, r as buildWorkspaceSkillSnapshot } from "./skills-DprQj9X2.js";
|
|
24
|
+
import { c as saveMediaBuffer, l as detectMime } from "./routes-CmOI1hIH.js";
|
|
25
|
+
import { a as isErrno, n as formatErrorMessage } from "./errors-Bv81hF2P.js";
|
|
26
|
+
import { n as movePathToTrash } from "./server-context-Cl0U0vE3.js";
|
|
27
|
+
import { n as pickPrimaryTailnetIPv6, t as pickPrimaryTailnetIPv4 } from "./tailnet-DATIFSsY.js";
|
|
28
|
+
import { c as resolveGatewayBindHost, i as isTrustedProxyAddress, l as resolveGatewayClientIp, n as isLoopbackAddress, r as isLoopbackHost, t as rawDataToString, u as resolveGatewayListenHosts } from "./ws-CHCQHs0F.js";
|
|
29
|
+
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-BLi2a6Yw.js";
|
|
30
|
+
import "./logging-fywhKCmE.js";
|
|
31
|
+
import "./accounts-DeqIQjo1.js";
|
|
32
|
+
import { n as resolveSessionFilePath, o as resolveSessionTranscriptsDirForAgent, r as resolveSessionTranscriptPath, s as resolveStorePath } from "./paths-B49s6UZQ.js";
|
|
33
|
+
import "./redact-BRsnXqwD.js";
|
|
34
|
+
import "./tool-display-CZRIDMRm.js";
|
|
35
|
+
import "./fetch-DmiOpALK.js";
|
|
36
|
+
import { G as getGlobalHookRunner, o as normalizeReplyPayloadsForDelivery, t as deliverOutboundPayloads } from "./deliver-LsxKETro.js";
|
|
37
|
+
import { i as getMachineDisplayName, t as createBrowserRouteDispatcher } from "./dispatcher-DY51b-Zc.js";
|
|
38
|
+
import "./manager-DkqF1GiK.js";
|
|
39
|
+
import "./sqlite-D4w5TejA.js";
|
|
40
|
+
import "./tui-formatters-CNySEfJN.js";
|
|
41
|
+
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-BrYfyoDK.js";
|
|
42
|
+
import { n as callGateway, o as loadGatewayTlsRuntime$1 } from "./call-SolyGS1r.js";
|
|
43
|
+
import "./login-qr-B6ZgAuIf.js";
|
|
44
|
+
import "./pairing-store-CmlRVqOz.js";
|
|
45
|
+
import { t as formatDocsLink } from "./links-Eax1UO3w.js";
|
|
46
|
+
import { n as runCommandWithRuntime } from "./cli-utils-CRhVAaLV.js";
|
|
47
|
+
import { n as withProgress } from "./progress-C9kngsTD.js";
|
|
48
|
+
import { a as resolveSubagentToolPolicy, i as resolveGroupToolPolicy, r as resolveEffectiveToolPolicy, t as filterToolsByPolicy } from "./pi-tools.policy-BpsROZbz.js";
|
|
49
|
+
import "./prompt-style-CIbmaxSa.js";
|
|
50
|
+
import "./pairing-labels-B6CN0SNH.js";
|
|
51
|
+
import { i as loadSessionUsageTimeSeries, l as deriveSessionTotalTokens, n as loadCostUsageSummary, r as loadSessionCostSummary, t as discoverAllSessions, u as hasNonzeroUsage } from "./session-cost-usage-D7HuoSSD.js";
|
|
52
|
+
import { n as formatTokenCount, r as formatUsd } from "./usage-format-CpORtVCG.js";
|
|
53
|
+
import { c as normalizeExecApprovals, g as saveExecApprovals, l as readExecApprovalsSnapshot, m as resolveExecApprovalsSocketPath, r as ensureExecApprovals } from "./exec-approvals-Cb4ZLukq.js";
|
|
54
|
+
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-CQNl_IaI.js";
|
|
55
|
+
import "./control-auth-DBCu3qyv.js";
|
|
56
|
+
import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-B5KnPqGP.js";
|
|
57
|
+
import { t as parseAbsoluteTimeMs } from "./parse-Bw0oH-rT.js";
|
|
58
|
+
import { n as resolveMessageChannelSelection } from "./channel-selection-MZAHm4U8.js";
|
|
59
|
+
import { n as createOutboundSendDeps, t as createDefaultDeps } from "./deps-lAAA2zYI.js";
|
|
60
|
+
import { t as ensureOpenClawCliOnPath } from "./path-env-CaYUVIML.js";
|
|
61
|
+
import "./daemon-runtime-Bsjeut6m.js";
|
|
62
|
+
import { c as loadAgentIdentity, d as loadAgentIdentityFromWorkspace, i as applyAgentConfig, l as pruneAgentConfig, o as findAgentEntryIndex, p as forceFreePortAndWait, r as getStatusSummary, s as listAgentEntries, t as runOnboardingWizard } from "./onboarding-CN-EDLjd.js";
|
|
63
|
+
import { t as resolveChannelDefaultAccountId } from "./helpers-HyeZXsnu.js";
|
|
64
|
+
import "./logging-BAyPwvdH.js";
|
|
65
|
+
import "./note-BhRSeNeu.js";
|
|
66
|
+
import { t as WizardCancelledError } from "./prompts-Bg96reub.js";
|
|
67
|
+
import { i as discoverGatewayBeacons, n as installSkill } from "./onboard-skills-rlBHcu3Q.js";
|
|
68
|
+
import "./github-copilot-auth-D7ewvpMd.js";
|
|
69
|
+
import "./onboard-channels-Dxzroasd.js";
|
|
70
|
+
import { r as buildChannelUiCatalog, t as applyPluginAutoEnable } from "./plugin-auto-enable-PW76g_PJ.js";
|
|
71
|
+
import "./archive-beaSfAzA.js";
|
|
72
|
+
import "./skill-scanner-CucvxYhu.js";
|
|
73
|
+
import "./installs-DscWb9b9.js";
|
|
74
|
+
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-KGPokKJH.js";
|
|
75
|
+
import { S as normalizeUpdateChannel, _ as resolveNpmChannelTag, h as compareSemverStrings, m as checkUpdateStatus, t as runGatewayUpdate, y as DEFAULT_PACKAGE_CHANNEL } from "./update-runner-7Qa1T9y6.js";
|
|
76
|
+
import { i as probeGateway } from "./audit-Dmww_503.js";
|
|
77
|
+
import "./table-B8dx3v4v.js";
|
|
78
|
+
import { t as buildWorkspaceSkillStatus } from "./skills-status-5U3P3YfJ.js";
|
|
79
|
+
import "./service--nPk7DvT.js";
|
|
80
|
+
import "./systemd-DrmBtJ5T.js";
|
|
81
|
+
import "./service-audit-DnLmRGQt.js";
|
|
82
|
+
import "./node-service-C8DTHTMg.js";
|
|
83
|
+
import "./channels-status-issues-DDAWeT-6.js";
|
|
84
|
+
import "./completion-cli-DnjpxAag.js";
|
|
85
|
+
import { a as createOutboundSendDeps$1, i as resolveAgentOutboundTarget, r as resolveAgentDeliveryPlan, t as agentCommand } from "./agent-BvNJF5QL.js";
|
|
86
|
+
import { n as resolveWideAreaDiscoveryDomain, r as writeWideAreaGatewayZone } from "./widearea-dns-DzuRdwk5.js";
|
|
87
|
+
import { i as shouldIncludeHook, n as loadWorkspaceHookEntries, r as resolveHookConfig } from "./hooks-status-D9MhwHRp.js";
|
|
88
|
+
import "./tui-CVTQn-dC.js";
|
|
89
|
+
import { t as buildChannelAccountSnapshot } from "./status-BRZfQbJ2.js";
|
|
90
|
+
import "./shared-DRohONn_.js";
|
|
91
|
+
import { a as runDaemonStop, i as runDaemonStart, n as runDaemonStatus, o as runDaemonUninstall, r as runDaemonRestart, s as runDaemonInstall } from "./daemon-cli-BDkU2ocb.js";
|
|
92
|
+
import { a as toOptionString, i as parsePort$1, n as extractGatewayMiskeys, r as maybeExplainGatewayServiceStop, t as describeUnknownError } from "./shared-Bs4vduG4.js";
|
|
93
|
+
import { i as setGatewayWsLogStyle, n as logWs, r as summarizeAgentEventForWsLog, t as formatForLog } from "./ws-log-DcQFZByi.js";
|
|
94
|
+
import { T as resolveGmailHookRuntimeConfig, _ as buildGogWatchServeArgs, i as ensureTailscaleEndpoint, v as buildGogWatchStartArgs } from "./gmail-setup-utils-Cfns8TQx.js";
|
|
93
95
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
94
96
|
import * as fsSync from "node:fs";
|
|
95
97
|
import fs, { constants } from "node:fs";
|
|
@@ -1205,6 +1207,10 @@ const BASE_RELOAD_RULES = [
|
|
|
1205
1207
|
}
|
|
1206
1208
|
];
|
|
1207
1209
|
const BASE_RELOAD_RULES_TAIL = [
|
|
1210
|
+
{
|
|
1211
|
+
prefix: "meta",
|
|
1212
|
+
kind: "none"
|
|
1213
|
+
},
|
|
1208
1214
|
{
|
|
1209
1215
|
prefix: "identity",
|
|
1210
1216
|
kind: "none"
|
|
@@ -2548,6 +2554,8 @@ function resolveCronSession(params) {
|
|
|
2548
2554
|
thinkingLevel: entry?.thinkingLevel,
|
|
2549
2555
|
verboseLevel: entry?.verboseLevel,
|
|
2550
2556
|
model: entry?.model,
|
|
2557
|
+
modelOverride: entry?.modelOverride,
|
|
2558
|
+
providerOverride: entry?.providerOverride,
|
|
2551
2559
|
contextTokens: entry?.contextTokens,
|
|
2552
2560
|
sendPolicy: entry?.sendPolicy,
|
|
2553
2561
|
lastChannel: entry?.lastChannel,
|
|
@@ -2581,9 +2589,8 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2581
2589
|
const defaultAgentId = resolveDefaultAgentId(params.cfg);
|
|
2582
2590
|
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;
|
|
2583
2591
|
const normalizedRequested = requestedAgentId ? normalizeAgentId(requestedAgentId) : void 0;
|
|
2584
|
-
const
|
|
2585
|
-
const
|
|
2586
|
-
const agentId = agentConfigOverride ? normalizedRequested ?? defaultAgentId : defaultAgentId;
|
|
2592
|
+
const { model: overrideModel, ...agentOverrideRest } = (normalizedRequested ? resolveAgentConfig(params.cfg, normalizedRequested) : void 0) ?? {};
|
|
2593
|
+
const agentId = normalizedRequested ?? defaultAgentId;
|
|
2587
2594
|
const agentCfg = Object.assign({}, params.cfg.agents?.defaults, agentOverrideRest);
|
|
2588
2595
|
if (typeof overrideModel === "string") agentCfg.model = { primary: overrideModel };
|
|
2589
2596
|
else if (overrideModel) agentCfg.model = overrideModel;
|
|
@@ -2615,6 +2622,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2615
2622
|
return catalog;
|
|
2616
2623
|
};
|
|
2617
2624
|
const isGmailHook = baseSessionKey.startsWith("hook:gmail:");
|
|
2625
|
+
let hooksGmailModelApplied = false;
|
|
2618
2626
|
const hooksGmailModelRef = isGmailHook ? resolveHooksGmailModel({
|
|
2619
2627
|
cfg: params.cfg,
|
|
2620
2628
|
defaultProvider: DEFAULT_PROVIDER
|
|
@@ -2629,6 +2637,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2629
2637
|
}).allowed) {
|
|
2630
2638
|
provider = hooksGmailModelRef.provider;
|
|
2631
2639
|
model = hooksGmailModelRef.model;
|
|
2640
|
+
hooksGmailModelApplied = true;
|
|
2632
2641
|
}
|
|
2633
2642
|
}
|
|
2634
2643
|
const modelOverrideRaw = params.job.payload.kind === "agentTurn" ? params.job.payload.model : void 0;
|
|
@@ -2674,6 +2683,23 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2674
2683
|
const labelSuffix = typeof params.job.name === "string" && params.job.name.trim() ? params.job.name.trim() : params.job.id;
|
|
2675
2684
|
cronSession.sessionEntry.label = `Cron: ${labelSuffix}`;
|
|
2676
2685
|
}
|
|
2686
|
+
if (!modelOverride && !hooksGmailModelApplied) {
|
|
2687
|
+
const sessionModelOverride = cronSession.sessionEntry.modelOverride?.trim();
|
|
2688
|
+
if (sessionModelOverride) {
|
|
2689
|
+
const sessionProviderOverride = cronSession.sessionEntry.providerOverride?.trim() || resolvedDefault.provider;
|
|
2690
|
+
const resolvedSessionOverride = resolveAllowedModelRef({
|
|
2691
|
+
cfg: cfgWithAgentDefaults,
|
|
2692
|
+
catalog: await loadCatalog(),
|
|
2693
|
+
raw: `${sessionProviderOverride}/${sessionModelOverride}`,
|
|
2694
|
+
defaultProvider: resolvedDefault.provider,
|
|
2695
|
+
defaultModel: resolvedDefault.model
|
|
2696
|
+
});
|
|
2697
|
+
if (!("error" in resolvedSessionOverride)) {
|
|
2698
|
+
provider = resolvedSessionOverride.ref.provider;
|
|
2699
|
+
model = resolvedSessionOverride.ref.model;
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2677
2703
|
const hooksGmailThinking = isGmailHook ? normalizeThinkLevel(params.cfg.hooks?.gmail?.thinking) : void 0;
|
|
2678
2704
|
const thinkOverride = normalizeThinkLevel(agentCfg?.thinkingDefault);
|
|
2679
2705
|
let thinkLevel = normalizeThinkLevel((params.job.payload.kind === "agentTurn" ? params.job.payload.thinking : void 0) ?? void 0) ?? hooksGmailThinking ?? thinkOverride;
|
|
@@ -2811,6 +2837,7 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2811
2837
|
const payloads = runResult.payloads ?? [];
|
|
2812
2838
|
{
|
|
2813
2839
|
const usage = runResult.meta.agentMeta?.usage;
|
|
2840
|
+
const promptTokens = runResult.meta.agentMeta?.promptTokens;
|
|
2814
2841
|
const modelUsed = runResult.meta.agentMeta?.model ?? fallbackModel ?? model;
|
|
2815
2842
|
const providerUsed = runResult.meta.agentMeta?.provider ?? fallbackProvider ?? provider;
|
|
2816
2843
|
const contextTokens = agentCfg?.contextTokens ?? lookupContextTokens(modelUsed) ?? DEFAULT_CONTEXT_TOKENS;
|
|
@@ -2828,7 +2855,8 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2828
2855
|
cronSession.sessionEntry.outputTokens = output;
|
|
2829
2856
|
cronSession.sessionEntry.totalTokens = deriveSessionTotalTokens({
|
|
2830
2857
|
usage,
|
|
2831
|
-
contextTokens
|
|
2858
|
+
contextTokens,
|
|
2859
|
+
promptTokens
|
|
2832
2860
|
}) ?? input;
|
|
2833
2861
|
}
|
|
2834
2862
|
await persistSessionEntry();
|
|
@@ -3046,10 +3074,10 @@ function computeNextRunAtMs(schedule, nowMs) {
|
|
|
3046
3074
|
catch: false
|
|
3047
3075
|
});
|
|
3048
3076
|
const nowSecondMs = Math.floor(nowMs / 1e3) * 1e3;
|
|
3049
|
-
const next = cron.nextRun(
|
|
3077
|
+
const next = cron.nextRun(new Date(nowSecondMs));
|
|
3050
3078
|
if (!next) return;
|
|
3051
3079
|
const nextMs = next.getTime();
|
|
3052
|
-
return Number.isFinite(nextMs) && nextMs
|
|
3080
|
+
return Number.isFinite(nextMs) && nextMs > nowSecondMs ? nextMs : void 0;
|
|
3053
3081
|
}
|
|
3054
3082
|
|
|
3055
3083
|
//#endregion
|
|
@@ -3092,6 +3120,8 @@ function computeJobNextRunAtMs(job, nowMs) {
|
|
|
3092
3120
|
}
|
|
3093
3121
|
return computeNextRunAtMs(job.schedule, nowMs);
|
|
3094
3122
|
}
|
|
3123
|
+
/** Maximum consecutive schedule errors before auto-disabling a job. */
|
|
3124
|
+
const MAX_SCHEDULE_ERRORS = 3;
|
|
3095
3125
|
function recomputeNextRuns(state) {
|
|
3096
3126
|
if (!state.store) return false;
|
|
3097
3127
|
let changed = false;
|
|
@@ -3122,12 +3152,82 @@ function recomputeNextRuns(state) {
|
|
|
3122
3152
|
changed = true;
|
|
3123
3153
|
}
|
|
3124
3154
|
const nextRun = job.state.nextRunAtMs;
|
|
3125
|
-
if (nextRun === void 0 || now >= nextRun) {
|
|
3155
|
+
if (nextRun === void 0 || now >= nextRun) try {
|
|
3126
3156
|
const newNext = computeJobNextRunAtMs(job, now);
|
|
3127
3157
|
if (job.state.nextRunAtMs !== newNext) {
|
|
3128
3158
|
job.state.nextRunAtMs = newNext;
|
|
3129
3159
|
changed = true;
|
|
3130
3160
|
}
|
|
3161
|
+
if (job.state.scheduleErrorCount) {
|
|
3162
|
+
job.state.scheduleErrorCount = void 0;
|
|
3163
|
+
changed = true;
|
|
3164
|
+
}
|
|
3165
|
+
} catch (err) {
|
|
3166
|
+
const errorCount = (job.state.scheduleErrorCount ?? 0) + 1;
|
|
3167
|
+
job.state.scheduleErrorCount = errorCount;
|
|
3168
|
+
job.state.nextRunAtMs = void 0;
|
|
3169
|
+
job.state.lastError = `schedule error: ${String(err)}`;
|
|
3170
|
+
changed = true;
|
|
3171
|
+
if (errorCount >= MAX_SCHEDULE_ERRORS) {
|
|
3172
|
+
job.enabled = false;
|
|
3173
|
+
state.deps.log.error({
|
|
3174
|
+
jobId: job.id,
|
|
3175
|
+
name: job.name,
|
|
3176
|
+
errorCount,
|
|
3177
|
+
err: String(err)
|
|
3178
|
+
}, "cron: auto-disabled job after repeated schedule errors");
|
|
3179
|
+
} else state.deps.log.warn({
|
|
3180
|
+
jobId: job.id,
|
|
3181
|
+
name: job.name,
|
|
3182
|
+
errorCount,
|
|
3183
|
+
err: String(err)
|
|
3184
|
+
}, "cron: failed to compute next run for job (skipping)");
|
|
3185
|
+
}
|
|
3186
|
+
}
|
|
3187
|
+
return changed;
|
|
3188
|
+
}
|
|
3189
|
+
/**
|
|
3190
|
+
* Maintenance-only version of recomputeNextRuns that handles disabled jobs
|
|
3191
|
+
* and stuck markers, but does NOT recompute nextRunAtMs for enabled jobs
|
|
3192
|
+
* with existing values. Used during timer ticks when no due jobs were found
|
|
3193
|
+
* to prevent silently advancing past-due nextRunAtMs values without execution
|
|
3194
|
+
* (see #13992).
|
|
3195
|
+
*/
|
|
3196
|
+
function recomputeNextRunsForMaintenance(state) {
|
|
3197
|
+
if (!state.store) return false;
|
|
3198
|
+
let changed = false;
|
|
3199
|
+
const now = state.deps.nowMs();
|
|
3200
|
+
for (const job of state.store.jobs) {
|
|
3201
|
+
if (!job.state) {
|
|
3202
|
+
job.state = {};
|
|
3203
|
+
changed = true;
|
|
3204
|
+
}
|
|
3205
|
+
if (!job.enabled) {
|
|
3206
|
+
if (job.state.nextRunAtMs !== void 0) {
|
|
3207
|
+
job.state.nextRunAtMs = void 0;
|
|
3208
|
+
changed = true;
|
|
3209
|
+
}
|
|
3210
|
+
if (job.state.runningAtMs !== void 0) {
|
|
3211
|
+
job.state.runningAtMs = void 0;
|
|
3212
|
+
changed = true;
|
|
3213
|
+
}
|
|
3214
|
+
continue;
|
|
3215
|
+
}
|
|
3216
|
+
const runningAt = job.state.runningAtMs;
|
|
3217
|
+
if (typeof runningAt === "number" && now - runningAt > STUCK_RUN_MS) {
|
|
3218
|
+
state.deps.log.warn({
|
|
3219
|
+
jobId: job.id,
|
|
3220
|
+
runningAtMs: runningAt
|
|
3221
|
+
}, "cron: clearing stuck running marker");
|
|
3222
|
+
job.state.runningAtMs = void 0;
|
|
3223
|
+
changed = true;
|
|
3224
|
+
}
|
|
3225
|
+
if (job.state.nextRunAtMs === void 0) {
|
|
3226
|
+
const newNext = computeJobNextRunAtMs(job, now);
|
|
3227
|
+
if (newNext !== void 0) {
|
|
3228
|
+
job.state.nextRunAtMs = newNext;
|
|
3229
|
+
changed = true;
|
|
3230
|
+
}
|
|
3131
3231
|
}
|
|
3132
3232
|
}
|
|
3133
3233
|
return changed;
|
|
@@ -3787,7 +3887,7 @@ function applyJobResult(state, job, result) {
|
|
|
3787
3887
|
job.updatedAtMs = result.endedAt;
|
|
3788
3888
|
if (result.status === "error") job.state.consecutiveErrors = (job.state.consecutiveErrors ?? 0) + 1;
|
|
3789
3889
|
else job.state.consecutiveErrors = 0;
|
|
3790
|
-
const shouldDelete = job.schedule.kind === "at" &&
|
|
3890
|
+
const shouldDelete = job.schedule.kind === "at" && job.deleteAfterRun === true && result.status === "ok";
|
|
3791
3891
|
if (!shouldDelete) if (job.schedule.kind === "at") {
|
|
3792
3892
|
job.enabled = false;
|
|
3793
3893
|
job.state.nextRunAtMs = void 0;
|
|
@@ -3848,7 +3948,17 @@ function armTimer(state) {
|
|
|
3848
3948
|
}, "cron: timer armed");
|
|
3849
3949
|
}
|
|
3850
3950
|
async function onTimer(state) {
|
|
3851
|
-
if (state.running)
|
|
3951
|
+
if (state.running) {
|
|
3952
|
+
if (state.timer) clearTimeout(state.timer);
|
|
3953
|
+
state.timer = setTimeout(async () => {
|
|
3954
|
+
try {
|
|
3955
|
+
await onTimer(state);
|
|
3956
|
+
} catch (err) {
|
|
3957
|
+
state.deps.log.error({ err: String(err) }, "cron: timer tick failed");
|
|
3958
|
+
}
|
|
3959
|
+
}, MAX_TIMER_DELAY_MS);
|
|
3960
|
+
return;
|
|
3961
|
+
}
|
|
3852
3962
|
state.running = true;
|
|
3853
3963
|
try {
|
|
3854
3964
|
const dueJobs = await locked(state, async () => {
|
|
@@ -3858,7 +3968,7 @@ async function onTimer(state) {
|
|
|
3858
3968
|
});
|
|
3859
3969
|
const due = findDueJobs(state);
|
|
3860
3970
|
if (due.length === 0) {
|
|
3861
|
-
if (
|
|
3971
|
+
if (recomputeNextRunsForMaintenance(state)) await persist(state);
|
|
3862
3972
|
return [];
|
|
3863
3973
|
}
|
|
3864
3974
|
const now = state.deps.nowMs();
|
|
@@ -3994,7 +4104,7 @@ async function runMissedJobs(state) {
|
|
|
3994
4104
|
if (!j.enabled) return false;
|
|
3995
4105
|
if (typeof j.state.runningAtMs === "number") return false;
|
|
3996
4106
|
const next = j.state.nextRunAtMs;
|
|
3997
|
-
if (j.schedule.kind === "at" && j.state.lastStatus
|
|
4107
|
+
if (j.schedule.kind === "at" && j.state.lastStatus) return false;
|
|
3998
4108
|
return typeof next === "number" && now >= next;
|
|
3999
4109
|
});
|
|
4000
4110
|
if (missed.length > 0) {
|
|
@@ -4020,7 +4130,10 @@ async function executeJobCore(state, job) {
|
|
|
4020
4130
|
const waitStartedAt = state.deps.nowMs();
|
|
4021
4131
|
let heartbeatResult;
|
|
4022
4132
|
for (;;) {
|
|
4023
|
-
heartbeatResult = await state.deps.runHeartbeatOnce({
|
|
4133
|
+
heartbeatResult = await state.deps.runHeartbeatOnce({
|
|
4134
|
+
reason,
|
|
4135
|
+
agentId: job.agentId
|
|
4136
|
+
});
|
|
4024
4137
|
if (heartbeatResult.status !== "skipped" || heartbeatResult.reason !== "requests-in-flight") break;
|
|
4025
4138
|
if (state.deps.nowMs() - waitStartedAt > maxWaitMs) {
|
|
4026
4139
|
state.deps.requestHeartbeatNow({ reason });
|
|
@@ -4399,9 +4512,12 @@ function buildGatewayCronService(params) {
|
|
|
4399
4512
|
},
|
|
4400
4513
|
requestHeartbeatNow,
|
|
4401
4514
|
runHeartbeatOnce: async (opts) => {
|
|
4515
|
+
const runtimeConfig = loadConfig();
|
|
4516
|
+
const agentId = opts?.agentId ? resolveCronAgent(opts.agentId).agentId : void 0;
|
|
4402
4517
|
return await runHeartbeatOnce({
|
|
4403
|
-
cfg:
|
|
4518
|
+
cfg: runtimeConfig,
|
|
4404
4519
|
reason: opts?.reason,
|
|
4520
|
+
agentId,
|
|
4405
4521
|
deps: {
|
|
4406
4522
|
...params.deps,
|
|
4407
4523
|
runtime: defaultRuntime
|
|
@@ -4782,8 +4898,8 @@ function abortChatRunsForSessionKey(ops, params) {
|
|
|
4782
4898
|
|
|
4783
4899
|
//#endregion
|
|
4784
4900
|
//#region src/gateway/server-constants.ts
|
|
4785
|
-
const MAX_PAYLOAD_BYTES =
|
|
4786
|
-
const MAX_BUFFERED_BYTES =
|
|
4901
|
+
const MAX_PAYLOAD_BYTES = 8 * 1024 * 1024;
|
|
4902
|
+
const MAX_BUFFERED_BYTES = 16 * 1024 * 1024;
|
|
4787
4903
|
const DEFAULT_MAX_CHAT_HISTORY_MESSAGES_BYTES = 6 * 1024 * 1024;
|
|
4788
4904
|
let maxChatHistoryMessagesBytes = DEFAULT_MAX_CHAT_HISTORY_MESSAGES_BYTES;
|
|
4789
4905
|
const getMaxChatHistoryMessagesBytes = () => maxChatHistoryMessagesBytes;
|
|
@@ -5496,7 +5612,7 @@ function ensureAgentRunListener() {
|
|
|
5496
5612
|
agentRunStarts.delete(evt.runId);
|
|
5497
5613
|
recordAgentRunSnapshot({
|
|
5498
5614
|
runId: evt.runId,
|
|
5499
|
-
status: phase === "error" ? "error" : "ok",
|
|
5615
|
+
status: phase === "error" ? "error" : evt.data?.aborted ? "timeout" : "ok",
|
|
5500
5616
|
startedAt,
|
|
5501
5617
|
endedAt,
|
|
5502
5618
|
error,
|
|
@@ -5538,7 +5654,7 @@ async function waitForAgentJob(params) {
|
|
|
5538
5654
|
const error = typeof evt.data?.error === "string" ? evt.data.error : void 0;
|
|
5539
5655
|
const snapshot = {
|
|
5540
5656
|
runId: evt.runId,
|
|
5541
|
-
status: phase === "error" ? "error" : "ok",
|
|
5657
|
+
status: phase === "error" ? "error" : evt.data?.aborted ? "timeout" : "ok",
|
|
5542
5658
|
startedAt,
|
|
5543
5659
|
endedAt,
|
|
5544
5660
|
error,
|
|
@@ -5623,6 +5739,7 @@ const agentHandlers = {
|
|
|
5623
5739
|
let resolvedGroupChannel = groupChannelRaw || void 0;
|
|
5624
5740
|
let resolvedGroupSpace = groupSpaceRaw || void 0;
|
|
5625
5741
|
let spawnedByValue = typeof request.spawnedBy === "string" ? request.spawnedBy.trim() : void 0;
|
|
5742
|
+
const inputProvenance = normalizeInputProvenance(request.inputProvenance);
|
|
5626
5743
|
const cached = context.dedupe.get(`agent:${idem}`);
|
|
5627
5744
|
if (cached) {
|
|
5628
5745
|
respond(cached.ok, cached.payload, cached.error, { cached: true });
|
|
@@ -5829,7 +5946,8 @@ const agentHandlers = {
|
|
|
5829
5946
|
messageChannel: resolvedChannel,
|
|
5830
5947
|
runId,
|
|
5831
5948
|
lane: request.lane,
|
|
5832
|
-
extraSystemPrompt: request.extraSystemPrompt
|
|
5949
|
+
extraSystemPrompt: request.extraSystemPrompt,
|
|
5950
|
+
inputProvenance
|
|
5833
5951
|
}, defaultRuntime, context.deps).then((result) => {
|
|
5834
5952
|
const payload = {
|
|
5835
5953
|
runId,
|
|
@@ -6750,9 +6868,13 @@ const channelsHandlers = {
|
|
|
6750
6868
|
//#region src/gateway/server-methods/chat.ts
|
|
6751
6869
|
function resolveTranscriptPath(params) {
|
|
6752
6870
|
const { sessionId, storePath, sessionFile } = params;
|
|
6753
|
-
if (sessionFile) return
|
|
6754
|
-
|
|
6755
|
-
|
|
6871
|
+
if (!storePath && !sessionFile) return null;
|
|
6872
|
+
try {
|
|
6873
|
+
const sessionsDir = storePath ? path.dirname(storePath) : void 0;
|
|
6874
|
+
return resolveSessionFilePath(sessionId, sessionFile ? { sessionFile } : void 0, sessionsDir ? { sessionsDir } : void 0);
|
|
6875
|
+
} catch {
|
|
6876
|
+
return null;
|
|
6877
|
+
}
|
|
6756
6878
|
}
|
|
6757
6879
|
function ensureTranscriptFile(params) {
|
|
6758
6880
|
if (fs.existsSync(params.transcriptPath)) return { ok: true };
|
|
@@ -7281,16 +7403,32 @@ function applyMergePatch(base, patch) {
|
|
|
7281
7403
|
*/
|
|
7282
7404
|
const REDACTED_SENTINEL = "__OPENCLAW_REDACTED__";
|
|
7283
7405
|
/**
|
|
7406
|
+
* Non-sensitive field names that happen to match sensitive patterns.
|
|
7407
|
+
* These are explicitly excluded from redaction.
|
|
7408
|
+
*/
|
|
7409
|
+
const SENSITIVE_KEY_WHITELIST = new Set([
|
|
7410
|
+
"maxtokens",
|
|
7411
|
+
"maxoutputtokens",
|
|
7412
|
+
"maxinputtokens",
|
|
7413
|
+
"maxcompletiontokens",
|
|
7414
|
+
"contexttokens",
|
|
7415
|
+
"totaltokens",
|
|
7416
|
+
"tokencount",
|
|
7417
|
+
"tokenlimit",
|
|
7418
|
+
"tokenbudget"
|
|
7419
|
+
]);
|
|
7420
|
+
/**
|
|
7284
7421
|
* Patterns that identify sensitive config field names.
|
|
7285
7422
|
* Aligned with the UI-hint logic in schema.ts.
|
|
7286
7423
|
*/
|
|
7287
7424
|
const SENSITIVE_KEY_PATTERNS = [
|
|
7288
|
-
/token
|
|
7425
|
+
/token$/i,
|
|
7289
7426
|
/password/i,
|
|
7290
7427
|
/secret/i,
|
|
7291
7428
|
/api.?key/i
|
|
7292
7429
|
];
|
|
7293
7430
|
function isSensitiveKey(key) {
|
|
7431
|
+
if (SENSITIVE_KEY_WHITELIST.has(key.toLowerCase())) return false;
|
|
7294
7432
|
return SENSITIVE_KEY_PATTERNS.some((pattern) => pattern.test(key));
|
|
7295
7433
|
}
|
|
7296
7434
|
/**
|
|
@@ -8000,7 +8138,7 @@ const FIELD_PLACEHOLDERS = {
|
|
|
8000
8138
|
"agents.list[].identity.avatar": "avatars/openclaw.png"
|
|
8001
8139
|
};
|
|
8002
8140
|
const SENSITIVE_PATTERNS = [
|
|
8003
|
-
/token
|
|
8141
|
+
/token$/i,
|
|
8004
8142
|
/password/i,
|
|
8005
8143
|
/secret/i,
|
|
8006
8144
|
/api.?key/i
|
|
@@ -8932,7 +9070,7 @@ async function verifyDeviceToken(params) {
|
|
|
8932
9070
|
ok: false,
|
|
8933
9071
|
reason: "token-revoked"
|
|
8934
9072
|
};
|
|
8935
|
-
if (
|
|
9073
|
+
if (!safeEqualSecret(params.token, entry.token)) return {
|
|
8936
9074
|
ok: false,
|
|
8937
9075
|
reason: "token-mismatch"
|
|
8938
9076
|
};
|
|
@@ -9784,7 +9922,7 @@ const nodeHandlers = {
|
|
|
9784
9922
|
const p = params;
|
|
9785
9923
|
const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
|
|
9786
9924
|
await respondUnavailableOnThrow(respond, async () => {
|
|
9787
|
-
const { handleNodeEvent } = await import("./server-node-events-
|
|
9925
|
+
const { handleNodeEvent } = await import("./server-node-events-CBfTbiTA.js");
|
|
9788
9926
|
const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
|
|
9789
9927
|
await handleNodeEvent({
|
|
9790
9928
|
deps: context.deps,
|
|
@@ -9852,8 +9990,13 @@ const sendHandlers = {
|
|
|
9852
9990
|
return;
|
|
9853
9991
|
}
|
|
9854
9992
|
const to = request.to.trim();
|
|
9855
|
-
const message = request.message.trim();
|
|
9856
|
-
const
|
|
9993
|
+
const message = typeof request.message === "string" ? request.message.trim() : "";
|
|
9994
|
+
const mediaUrl = typeof request.mediaUrl === "string" && request.mediaUrl.trim().length > 0 ? request.mediaUrl.trim() : void 0;
|
|
9995
|
+
const mediaUrls = Array.isArray(request.mediaUrls) ? request.mediaUrls.map((entry) => typeof entry === "string" ? entry.trim() : "").filter((entry) => entry.length > 0) : void 0;
|
|
9996
|
+
if (!message && !mediaUrl && (mediaUrls?.length ?? 0) === 0) {
|
|
9997
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid send params: text or media is required"));
|
|
9998
|
+
return;
|
|
9999
|
+
}
|
|
9857
10000
|
const channelInput = typeof request.channel === "string" ? request.channel : void 0;
|
|
9858
10001
|
const normalizedChannel = channelInput ? normalizeChannelId(channelInput) : null;
|
|
9859
10002
|
if (channelInput && !normalizedChannel) {
|
|
@@ -9885,7 +10028,7 @@ const sendHandlers = {
|
|
|
9885
10028
|
const outboundDeps = context.deps ? createOutboundSendDeps(context.deps) : void 0;
|
|
9886
10029
|
const mirrorPayloads = normalizeReplyPayloadsForDelivery([{
|
|
9887
10030
|
text: message,
|
|
9888
|
-
mediaUrl
|
|
10031
|
+
mediaUrl,
|
|
9889
10032
|
mediaUrls
|
|
9890
10033
|
}]);
|
|
9891
10034
|
const mirrorText = mirrorPayloads.map((payload) => payload.text).filter(Boolean).join("\n");
|
|
@@ -9913,7 +10056,7 @@ const sendHandlers = {
|
|
|
9913
10056
|
accountId,
|
|
9914
10057
|
payloads: [{
|
|
9915
10058
|
text: message,
|
|
9916
|
-
mediaUrl
|
|
10059
|
+
mediaUrl,
|
|
9917
10060
|
mediaUrls
|
|
9918
10061
|
}],
|
|
9919
10062
|
gifPlayback: request.gifPlayback,
|
|
@@ -11284,7 +11427,7 @@ const usageHandlers = {
|
|
|
11284
11427
|
const limit = typeof p.limit === "number" && Number.isFinite(p.limit) ? p.limit : 50;
|
|
11285
11428
|
const includeContextWeight = p.includeContextWeight ?? false;
|
|
11286
11429
|
const specificKey = typeof p.key === "string" ? p.key.trim() : null;
|
|
11287
|
-
const { store } = loadCombinedSessionStoreForGateway(config);
|
|
11430
|
+
const { storePath, store } = loadCombinedSessionStoreForGateway(config);
|
|
11288
11431
|
const now = Date.now();
|
|
11289
11432
|
const mergedEntries = [];
|
|
11290
11433
|
if (specificKey) {
|
|
@@ -11304,7 +11447,13 @@ const usageHandlers = {
|
|
|
11304
11447
|
const resolvedStoreKey = storeMatch?.key ?? storeByIdMatch?.key ?? specificKey;
|
|
11305
11448
|
const storeEntry = storeMatch?.entry ?? storeByIdMatch?.entry;
|
|
11306
11449
|
const sessionId = storeEntry?.sessionId ?? keyRest;
|
|
11307
|
-
|
|
11450
|
+
let sessionFile;
|
|
11451
|
+
try {
|
|
11452
|
+
sessionFile = resolveSessionFilePath(sessionId, storeEntry, storePath && storePath !== "(multiple)" ? { sessionsDir: path.dirname(storePath) } : { agentId: agentIdFromKey });
|
|
11453
|
+
} catch {
|
|
11454
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `Invalid session reference: ${specificKey}`));
|
|
11455
|
+
return;
|
|
11456
|
+
}
|
|
11308
11457
|
try {
|
|
11309
11458
|
const stats = fs.statSync(sessionFile);
|
|
11310
11459
|
if (stats.isFile()) mergedEntries.push({
|
|
@@ -11630,14 +11779,22 @@ const usageHandlers = {
|
|
|
11630
11779
|
return;
|
|
11631
11780
|
}
|
|
11632
11781
|
const config = loadConfig();
|
|
11633
|
-
const { entry } = loadSessionEntry(key);
|
|
11782
|
+
const { entry, storePath } = loadSessionEntry(key);
|
|
11634
11783
|
const parsed = parseAgentSessionKey(key);
|
|
11635
11784
|
const agentId = parsed?.agentId;
|
|
11636
11785
|
const rawSessionId = parsed?.rest ?? key;
|
|
11786
|
+
const sessionId = entry?.sessionId ?? rawSessionId;
|
|
11787
|
+
let sessionFile;
|
|
11788
|
+
try {
|
|
11789
|
+
sessionFile = resolveSessionFilePath(sessionId, entry, storePath ? { sessionsDir: path.dirname(storePath) } : { agentId });
|
|
11790
|
+
} catch {
|
|
11791
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `Invalid session key: ${key}`));
|
|
11792
|
+
return;
|
|
11793
|
+
}
|
|
11637
11794
|
const timeseries = await loadSessionUsageTimeSeries({
|
|
11638
|
-
sessionId
|
|
11795
|
+
sessionId,
|
|
11639
11796
|
sessionEntry: entry,
|
|
11640
|
-
sessionFile
|
|
11797
|
+
sessionFile,
|
|
11641
11798
|
config,
|
|
11642
11799
|
maxPoints: 200
|
|
11643
11800
|
});
|
|
@@ -11655,13 +11812,19 @@ const usageHandlers = {
|
|
|
11655
11812
|
}
|
|
11656
11813
|
const limit = typeof params?.limit === "number" && Number.isFinite(params.limit) ? Math.min(params.limit, 1e3) : 200;
|
|
11657
11814
|
const config = loadConfig();
|
|
11658
|
-
const { entry } = loadSessionEntry(key);
|
|
11815
|
+
const { entry, storePath } = loadSessionEntry(key);
|
|
11659
11816
|
const parsed = parseAgentSessionKey(key);
|
|
11660
11817
|
const agentId = parsed?.agentId;
|
|
11661
11818
|
const rawSessionId = parsed?.rest ?? key;
|
|
11662
11819
|
const sessionId = entry?.sessionId ?? rawSessionId;
|
|
11663
|
-
|
|
11664
|
-
|
|
11820
|
+
let sessionFile;
|
|
11821
|
+
try {
|
|
11822
|
+
sessionFile = resolveSessionFilePath(sessionId, entry, storePath ? { sessionsDir: path.dirname(storePath) } : { agentId });
|
|
11823
|
+
} catch {
|
|
11824
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `Invalid session key: ${key}`));
|
|
11825
|
+
return;
|
|
11826
|
+
}
|
|
11827
|
+
const { loadSessionLogs } = await import("./session-cost-usage-D7HuoSSD.js").then((n) => n.a);
|
|
11665
11828
|
respond(true, { logs: await loadSessionLogs({
|
|
11666
11829
|
sessionId,
|
|
11667
11830
|
sessionEntry: entry,
|
|
@@ -12667,6 +12830,12 @@ function resolveHooksConfig(cfg) {
|
|
|
12667
12830
|
const maxBodyBytes = cfg.hooks?.maxBodyBytes && cfg.hooks.maxBodyBytes > 0 ? cfg.hooks.maxBodyBytes : DEFAULT_HOOKS_MAX_BODY_BYTES;
|
|
12668
12831
|
const mappings = resolveHookMappings(cfg.hooks);
|
|
12669
12832
|
const defaultAgentId = resolveDefaultAgentId(cfg);
|
|
12833
|
+
const knownAgentIds = resolveKnownAgentIds(cfg, defaultAgentId);
|
|
12834
|
+
const allowedAgentIds = resolveAllowedAgentIds(cfg.hooks?.allowedAgentIds);
|
|
12835
|
+
const defaultSessionKey = resolveSessionKey$1(cfg.hooks?.defaultSessionKey);
|
|
12836
|
+
const allowedSessionKeyPrefixes = resolveAllowedSessionKeyPrefixes(cfg.hooks?.allowedSessionKeyPrefixes);
|
|
12837
|
+
if (defaultSessionKey && allowedSessionKeyPrefixes && !isSessionKeyAllowedByPrefix(defaultSessionKey, allowedSessionKeyPrefixes)) throw new Error("hooks.defaultSessionKey must match hooks.allowedSessionKeyPrefixes");
|
|
12838
|
+
if (!defaultSessionKey && allowedSessionKeyPrefixes && !isSessionKeyAllowedByPrefix("hook:example", allowedSessionKeyPrefixes)) throw new Error("hooks.allowedSessionKeyPrefixes must include 'hook:' when hooks.defaultSessionKey is unset");
|
|
12670
12839
|
return {
|
|
12671
12840
|
basePath: trimmed,
|
|
12672
12841
|
token,
|
|
@@ -12674,8 +12843,13 @@ function resolveHooksConfig(cfg) {
|
|
|
12674
12843
|
mappings,
|
|
12675
12844
|
agentPolicy: {
|
|
12676
12845
|
defaultAgentId,
|
|
12677
|
-
knownAgentIds
|
|
12678
|
-
allowedAgentIds
|
|
12846
|
+
knownAgentIds,
|
|
12847
|
+
allowedAgentIds
|
|
12848
|
+
},
|
|
12849
|
+
sessionPolicy: {
|
|
12850
|
+
defaultSessionKey,
|
|
12851
|
+
allowRequestSessionKey: cfg.hooks?.allowRequestSessionKey === true,
|
|
12852
|
+
allowedSessionKeyPrefixes
|
|
12679
12853
|
}
|
|
12680
12854
|
};
|
|
12681
12855
|
}
|
|
@@ -12700,6 +12874,29 @@ function resolveAllowedAgentIds(raw) {
|
|
|
12700
12874
|
if (hasWildcard) return;
|
|
12701
12875
|
return allowed;
|
|
12702
12876
|
}
|
|
12877
|
+
function resolveSessionKey$1(raw) {
|
|
12878
|
+
const value = raw?.trim();
|
|
12879
|
+
return value ? value : void 0;
|
|
12880
|
+
}
|
|
12881
|
+
function normalizeSessionKeyPrefix(raw) {
|
|
12882
|
+
const value = raw.trim().toLowerCase();
|
|
12883
|
+
return value ? value : void 0;
|
|
12884
|
+
}
|
|
12885
|
+
function resolveAllowedSessionKeyPrefixes(raw) {
|
|
12886
|
+
if (!Array.isArray(raw)) return;
|
|
12887
|
+
const set = /* @__PURE__ */ new Set();
|
|
12888
|
+
for (const prefix of raw) {
|
|
12889
|
+
const normalized = normalizeSessionKeyPrefix(prefix);
|
|
12890
|
+
if (!normalized) continue;
|
|
12891
|
+
set.add(normalized);
|
|
12892
|
+
}
|
|
12893
|
+
return set.size > 0 ? Array.from(set) : void 0;
|
|
12894
|
+
}
|
|
12895
|
+
function isSessionKeyAllowedByPrefix(sessionKey, prefixes) {
|
|
12896
|
+
const normalized = sessionKey.trim().toLowerCase();
|
|
12897
|
+
if (!normalized) return false;
|
|
12898
|
+
return prefixes.some((prefix) => normalized.startsWith(prefix));
|
|
12899
|
+
}
|
|
12703
12900
|
function extractHookToken(req) {
|
|
12704
12901
|
const auth = typeof req.headers.authorization === "string" ? req.headers.authorization.trim() : "";
|
|
12705
12902
|
if (auth.toLowerCase().startsWith("bearer ")) {
|
|
@@ -12810,7 +13007,42 @@ function isHookAgentAllowed(hooksConfig, agentId) {
|
|
|
12810
13007
|
return resolved ? allowed.has(resolved) : false;
|
|
12811
13008
|
}
|
|
12812
13009
|
const getHookAgentPolicyError = () => "agentId is not allowed by hooks.allowedAgentIds";
|
|
12813
|
-
|
|
13010
|
+
const getHookSessionKeyRequestPolicyError = () => "sessionKey is disabled for external /hooks/agent payloads; set hooks.allowRequestSessionKey=true to enable";
|
|
13011
|
+
const getHookSessionKeyPrefixError = (prefixes) => `sessionKey must start with one of: ${prefixes.join(", ")}`;
|
|
13012
|
+
function resolveHookSessionKey(params) {
|
|
13013
|
+
const requested = resolveSessionKey$1(params.sessionKey);
|
|
13014
|
+
if (requested) {
|
|
13015
|
+
if (params.source === "request" && !params.hooksConfig.sessionPolicy.allowRequestSessionKey) return {
|
|
13016
|
+
ok: false,
|
|
13017
|
+
error: getHookSessionKeyRequestPolicyError()
|
|
13018
|
+
};
|
|
13019
|
+
const allowedPrefixes = params.hooksConfig.sessionPolicy.allowedSessionKeyPrefixes;
|
|
13020
|
+
if (allowedPrefixes && !isSessionKeyAllowedByPrefix(requested, allowedPrefixes)) return {
|
|
13021
|
+
ok: false,
|
|
13022
|
+
error: getHookSessionKeyPrefixError(allowedPrefixes)
|
|
13023
|
+
};
|
|
13024
|
+
return {
|
|
13025
|
+
ok: true,
|
|
13026
|
+
value: requested
|
|
13027
|
+
};
|
|
13028
|
+
}
|
|
13029
|
+
const defaultSessionKey = params.hooksConfig.sessionPolicy.defaultSessionKey;
|
|
13030
|
+
if (defaultSessionKey) return {
|
|
13031
|
+
ok: true,
|
|
13032
|
+
value: defaultSessionKey
|
|
13033
|
+
};
|
|
13034
|
+
const generated = `hook:${(params.idFactory ?? randomUUID)()}`;
|
|
13035
|
+
const allowedPrefixes = params.hooksConfig.sessionPolicy.allowedSessionKeyPrefixes;
|
|
13036
|
+
if (allowedPrefixes && !isSessionKeyAllowedByPrefix(generated, allowedPrefixes)) return {
|
|
13037
|
+
ok: false,
|
|
13038
|
+
error: getHookSessionKeyPrefixError(allowedPrefixes)
|
|
13039
|
+
};
|
|
13040
|
+
return {
|
|
13041
|
+
ok: true,
|
|
13042
|
+
value: generated
|
|
13043
|
+
};
|
|
13044
|
+
}
|
|
13045
|
+
function normalizeAgentPayload(payload) {
|
|
12814
13046
|
const message = typeof payload.message === "string" ? payload.message.trim() : "";
|
|
12815
13047
|
if (!message) return {
|
|
12816
13048
|
ok: false,
|
|
@@ -12822,8 +13054,7 @@ function normalizeAgentPayload(payload, opts) {
|
|
|
12822
13054
|
const agentId = typeof agentIdRaw === "string" && agentIdRaw.trim() ? agentIdRaw.trim() : void 0;
|
|
12823
13055
|
const wakeMode = payload.wakeMode === "next-heartbeat" ? "next-heartbeat" : "now";
|
|
12824
13056
|
const sessionKeyRaw = payload.sessionKey;
|
|
12825
|
-
const
|
|
12826
|
-
const sessionKey = typeof sessionKeyRaw === "string" && sessionKeyRaw.trim() ? sessionKeyRaw.trim() : `hook:${idFactory()}`;
|
|
13057
|
+
const sessionKey = typeof sessionKeyRaw === "string" && sessionKeyRaw.trim() ? sessionKeyRaw.trim() : void 0;
|
|
12827
13058
|
const channel = resolveHookChannel(payload.channel);
|
|
12828
13059
|
if (!channel) return {
|
|
12829
13060
|
ok: false,
|
|
@@ -12864,7 +13095,7 @@ function normalizeAgentPayload(payload, opts) {
|
|
|
12864
13095
|
async function startBrowserControlServerIfEnabled() {
|
|
12865
13096
|
if (isTruthyEnvValue(process.env.OPENCLAW_SKIP_BROWSER_CONTROL_SERVER)) return null;
|
|
12866
13097
|
const override = process.env.OPENCLAW_BROWSER_CONTROL_MODULE?.trim();
|
|
12867
|
-
const mod = override ? await import(override) : await import("./control-service-
|
|
13098
|
+
const mod = override ? await import(override) : await import("./control-service-B5KnPqGP.js").then((n) => n.t);
|
|
12868
13099
|
const start = typeof mod.startBrowserControlServiceFromConfig === "function" ? mod.startBrowserControlServiceFromConfig : mod.startBrowserControlServerFromConfig;
|
|
12869
13100
|
const stop = typeof mod.stopBrowserControlService === "function" ? mod.stopBrowserControlService : mod.stopBrowserControlServer;
|
|
12870
13101
|
if (!start) return null;
|
|
@@ -14515,6 +14746,7 @@ const OutputTextDoneEventSchema = z.object({
|
|
|
14515
14746
|
//#endregion
|
|
14516
14747
|
//#region src/gateway/openresponses-http.ts
|
|
14517
14748
|
const DEFAULT_BODY_BYTES$1 = 20 * 1024 * 1024;
|
|
14749
|
+
const DEFAULT_MAX_URL_PARTS = 8;
|
|
14518
14750
|
function writeSseEvent(res, event) {
|
|
14519
14751
|
res.write(`event: ${event.type}\n`);
|
|
14520
14752
|
res.write(`data: ${JSON.stringify(event)}\n\n`);
|
|
@@ -14527,13 +14759,20 @@ function extractTextContent(content) {
|
|
|
14527
14759
|
return "";
|
|
14528
14760
|
}).filter(Boolean).join("\n");
|
|
14529
14761
|
}
|
|
14762
|
+
function normalizeHostnameAllowlist(values) {
|
|
14763
|
+
if (!values || values.length === 0) return;
|
|
14764
|
+
const normalized = values.map((value) => value.trim()).filter((value) => value.length > 0);
|
|
14765
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
14766
|
+
}
|
|
14530
14767
|
function resolveResponsesLimits(config) {
|
|
14531
14768
|
const files = config?.files;
|
|
14532
14769
|
const images = config?.images;
|
|
14533
14770
|
return {
|
|
14534
14771
|
maxBodyBytes: config?.maxBodyBytes ?? DEFAULT_BODY_BYTES$1,
|
|
14772
|
+
maxUrlParts: typeof config?.maxUrlParts === "number" ? Math.max(0, Math.floor(config.maxUrlParts)) : DEFAULT_MAX_URL_PARTS,
|
|
14535
14773
|
files: {
|
|
14536
14774
|
allowUrl: files?.allowUrl ?? true,
|
|
14775
|
+
urlAllowlist: normalizeHostnameAllowlist(files?.urlAllowlist),
|
|
14537
14776
|
allowedMimes: normalizeMimeList(files?.allowedMimes, DEFAULT_INPUT_FILE_MIMES),
|
|
14538
14777
|
maxBytes: files?.maxBytes ?? DEFAULT_INPUT_FILE_MAX_BYTES,
|
|
14539
14778
|
maxChars: files?.maxChars ?? DEFAULT_INPUT_FILE_MAX_CHARS,
|
|
@@ -14547,6 +14786,7 @@ function resolveResponsesLimits(config) {
|
|
|
14547
14786
|
},
|
|
14548
14787
|
images: {
|
|
14549
14788
|
allowUrl: images?.allowUrl ?? true,
|
|
14789
|
+
urlAllowlist: normalizeHostnameAllowlist(images?.urlAllowlist),
|
|
14550
14790
|
allowedMimes: normalizeMimeList(images?.allowedMimes, DEFAULT_INPUT_IMAGE_MIMES),
|
|
14551
14791
|
maxBytes: images?.maxBytes ?? DEFAULT_INPUT_IMAGE_MAX_BYTES,
|
|
14552
14792
|
maxRedirects: images?.maxRedirects ?? DEFAULT_INPUT_MAX_REDIRECTS,
|
|
@@ -14728,6 +14968,11 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14728
14968
|
const user = payload.user;
|
|
14729
14969
|
let images = [];
|
|
14730
14970
|
let fileContexts = [];
|
|
14971
|
+
let urlParts = 0;
|
|
14972
|
+
const markUrlPart = () => {
|
|
14973
|
+
urlParts += 1;
|
|
14974
|
+
if (urlParts > limits.maxUrlParts) throw new Error(`Too many URL-based input sources: ${urlParts} (limit: ${limits.maxUrlParts})`);
|
|
14975
|
+
};
|
|
14731
14976
|
try {
|
|
14732
14977
|
if (Array.isArray(payload.input)) {
|
|
14733
14978
|
for (const item of payload.input) if (item.type === "message" && typeof item.content !== "string") for (const part of item.content) {
|
|
@@ -14735,6 +14980,7 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14735
14980
|
const source = part.source;
|
|
14736
14981
|
const sourceType = source.type === "base64" || source.type === "url" ? source.type : void 0;
|
|
14737
14982
|
if (!sourceType) throw new Error("input_image must have 'source.url' or 'source.data'");
|
|
14983
|
+
if (sourceType === "url") markUrlPart();
|
|
14738
14984
|
const image = await extractImageContentFromSource({
|
|
14739
14985
|
type: sourceType,
|
|
14740
14986
|
url: source.url,
|
|
@@ -14748,6 +14994,7 @@ async function handleOpenResponsesHttpRequest(req, res, opts) {
|
|
|
14748
14994
|
const source = part.source;
|
|
14749
14995
|
const sourceType = source.type === "base64" || source.type === "url" ? source.type : void 0;
|
|
14750
14996
|
if (!sourceType) throw new Error("input_file must have 'source.url' or 'source.data'");
|
|
14997
|
+
if (sourceType === "url") markUrlPart();
|
|
14751
14998
|
const file = await extractFileContentFromSource({
|
|
14752
14999
|
source: {
|
|
14753
15000
|
type: sourceType,
|
|
@@ -15311,6 +15558,9 @@ async function handleToolsInvokeHttpRequest(req, res, opts) {
|
|
|
15311
15558
|
|
|
15312
15559
|
//#endregion
|
|
15313
15560
|
//#region src/gateway/server-http.ts
|
|
15561
|
+
const HOOK_AUTH_FAILURE_LIMIT = 20;
|
|
15562
|
+
const HOOK_AUTH_FAILURE_WINDOW_MS = 6e4;
|
|
15563
|
+
const HOOK_AUTH_FAILURE_TRACK_MAX = 2048;
|
|
15314
15564
|
function sendJson(res, status, body) {
|
|
15315
15565
|
res.statusCode = status;
|
|
15316
15566
|
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
@@ -15352,6 +15602,31 @@ async function authorizeCanvasRequest(params) {
|
|
|
15352
15602
|
}
|
|
15353
15603
|
function createHooksRequestHandler(opts) {
|
|
15354
15604
|
const { getHooksConfig, bindHost, port, logHooks, dispatchAgentHook, dispatchWakeHook } = opts;
|
|
15605
|
+
const hookAuthFailures = /* @__PURE__ */ new Map();
|
|
15606
|
+
const resolveHookClientKey = (req) => {
|
|
15607
|
+
return req.socket?.remoteAddress?.trim() || "unknown";
|
|
15608
|
+
};
|
|
15609
|
+
const recordHookAuthFailure = (clientKey, nowMs) => {
|
|
15610
|
+
if (!hookAuthFailures.has(clientKey) && hookAuthFailures.size >= HOOK_AUTH_FAILURE_TRACK_MAX) hookAuthFailures.clear();
|
|
15611
|
+
const current = hookAuthFailures.get(clientKey);
|
|
15612
|
+
const next = !current || nowMs - current.windowStartedAtMs >= HOOK_AUTH_FAILURE_WINDOW_MS ? {
|
|
15613
|
+
count: 1,
|
|
15614
|
+
windowStartedAtMs: nowMs
|
|
15615
|
+
} : {
|
|
15616
|
+
count: current.count + 1,
|
|
15617
|
+
windowStartedAtMs: current.windowStartedAtMs
|
|
15618
|
+
};
|
|
15619
|
+
hookAuthFailures.set(clientKey, next);
|
|
15620
|
+
if (next.count <= HOOK_AUTH_FAILURE_LIMIT) return { throttled: false };
|
|
15621
|
+
const retryAfterMs = Math.max(1, next.windowStartedAtMs + HOOK_AUTH_FAILURE_WINDOW_MS - nowMs);
|
|
15622
|
+
return {
|
|
15623
|
+
throttled: true,
|
|
15624
|
+
retryAfterSeconds: Math.ceil(retryAfterMs / 1e3)
|
|
15625
|
+
};
|
|
15626
|
+
};
|
|
15627
|
+
const clearHookAuthFailure = (clientKey) => {
|
|
15628
|
+
hookAuthFailures.delete(clientKey);
|
|
15629
|
+
};
|
|
15355
15630
|
return async (req, res) => {
|
|
15356
15631
|
const hooksConfig = getHooksConfig();
|
|
15357
15632
|
if (!hooksConfig) return false;
|
|
@@ -15365,12 +15640,24 @@ function createHooksRequestHandler(opts) {
|
|
|
15365
15640
|
return true;
|
|
15366
15641
|
}
|
|
15367
15642
|
const token = extractHookToken(req);
|
|
15368
|
-
|
|
15643
|
+
const clientKey = resolveHookClientKey(req);
|
|
15644
|
+
if (!safeEqualSecret(token, hooksConfig.token)) {
|
|
15645
|
+
const throttle = recordHookAuthFailure(clientKey, Date.now());
|
|
15646
|
+
if (throttle.throttled) {
|
|
15647
|
+
const retryAfter = throttle.retryAfterSeconds ?? 1;
|
|
15648
|
+
res.statusCode = 429;
|
|
15649
|
+
res.setHeader("Retry-After", String(retryAfter));
|
|
15650
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
15651
|
+
res.end("Too Many Requests");
|
|
15652
|
+
logHooks.warn(`hook auth throttled for ${clientKey}; retry-after=${retryAfter}s`);
|
|
15653
|
+
return true;
|
|
15654
|
+
}
|
|
15369
15655
|
res.statusCode = 401;
|
|
15370
15656
|
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
15371
15657
|
res.end("Unauthorized");
|
|
15372
15658
|
return true;
|
|
15373
15659
|
}
|
|
15660
|
+
clearHookAuthFailure(clientKey);
|
|
15374
15661
|
if (req.method !== "POST") {
|
|
15375
15662
|
res.statusCode = 405;
|
|
15376
15663
|
res.setHeader("Allow", "POST");
|
|
@@ -15427,10 +15714,23 @@ function createHooksRequestHandler(opts) {
|
|
|
15427
15714
|
});
|
|
15428
15715
|
return true;
|
|
15429
15716
|
}
|
|
15717
|
+
const sessionKey = resolveHookSessionKey({
|
|
15718
|
+
hooksConfig,
|
|
15719
|
+
source: "request",
|
|
15720
|
+
sessionKey: normalized.value.sessionKey
|
|
15721
|
+
});
|
|
15722
|
+
if (!sessionKey.ok) {
|
|
15723
|
+
sendJson(res, 400, {
|
|
15724
|
+
ok: false,
|
|
15725
|
+
error: sessionKey.error
|
|
15726
|
+
});
|
|
15727
|
+
return true;
|
|
15728
|
+
}
|
|
15430
15729
|
sendJson(res, 202, {
|
|
15431
15730
|
ok: true,
|
|
15432
15731
|
runId: dispatchAgentHook({
|
|
15433
15732
|
...normalized.value,
|
|
15733
|
+
sessionKey: sessionKey.value,
|
|
15434
15734
|
agentId: resolveHookTargetAgentId(hooksConfig, normalized.value.agentId)
|
|
15435
15735
|
})
|
|
15436
15736
|
});
|
|
@@ -15482,6 +15782,18 @@ function createHooksRequestHandler(opts) {
|
|
|
15482
15782
|
});
|
|
15483
15783
|
return true;
|
|
15484
15784
|
}
|
|
15785
|
+
const sessionKey = resolveHookSessionKey({
|
|
15786
|
+
hooksConfig,
|
|
15787
|
+
source: "mapping",
|
|
15788
|
+
sessionKey: mapped.action.sessionKey
|
|
15789
|
+
});
|
|
15790
|
+
if (!sessionKey.ok) {
|
|
15791
|
+
sendJson(res, 400, {
|
|
15792
|
+
ok: false,
|
|
15793
|
+
error: sessionKey.error
|
|
15794
|
+
});
|
|
15795
|
+
return true;
|
|
15796
|
+
}
|
|
15485
15797
|
sendJson(res, 202, {
|
|
15486
15798
|
ok: true,
|
|
15487
15799
|
runId: dispatchAgentHook({
|
|
@@ -15489,7 +15801,7 @@ function createHooksRequestHandler(opts) {
|
|
|
15489
15801
|
name: mapped.action.name ?? "Hook",
|
|
15490
15802
|
agentId: resolveHookTargetAgentId(hooksConfig, mapped.action.agentId),
|
|
15491
15803
|
wakeMode: mapped.action.wakeMode,
|
|
15492
|
-
sessionKey:
|
|
15804
|
+
sessionKey: sessionKey.value,
|
|
15493
15805
|
deliver: resolveHookDeliver(mapped.action.deliver),
|
|
15494
15806
|
channel,
|
|
15495
15807
|
to: mapped.action.to,
|
|
@@ -15527,13 +15839,31 @@ function createGatewayHttpServer(opts) {
|
|
|
15527
15839
|
try {
|
|
15528
15840
|
const configSnapshot = loadConfig();
|
|
15529
15841
|
const trustedProxies = configSnapshot.gateway?.trustedProxies ?? [];
|
|
15842
|
+
const requestPath = new URL(req.url ?? "/", "http://localhost").pathname;
|
|
15530
15843
|
if (await handleHooksRequest(req, res)) return;
|
|
15531
15844
|
if (await handleToolsInvokeHttpRequest(req, res, {
|
|
15532
15845
|
auth: resolvedAuth,
|
|
15533
15846
|
trustedProxies
|
|
15534
15847
|
})) return;
|
|
15535
15848
|
if (await handleSlackHttpRequest(req, res)) return;
|
|
15536
|
-
if (handlePluginRequest
|
|
15849
|
+
if (handlePluginRequest) {
|
|
15850
|
+
if (requestPath.startsWith("/api/channels/")) {
|
|
15851
|
+
const token = getBearerToken(req);
|
|
15852
|
+
if (!(await authorizeGatewayConnect({
|
|
15853
|
+
auth: resolvedAuth,
|
|
15854
|
+
connectAuth: token ? {
|
|
15855
|
+
token,
|
|
15856
|
+
password: token
|
|
15857
|
+
} : null,
|
|
15858
|
+
req,
|
|
15859
|
+
trustedProxies
|
|
15860
|
+
})).ok) {
|
|
15861
|
+
sendUnauthorized(res);
|
|
15862
|
+
return;
|
|
15863
|
+
}
|
|
15864
|
+
}
|
|
15865
|
+
if (await handlePluginRequest(req, res)) return;
|
|
15866
|
+
}
|
|
15537
15867
|
if (openResponsesEnabled) {
|
|
15538
15868
|
if (await handleOpenResponsesHttpRequest(req, res, {
|
|
15539
15869
|
auth: resolvedAuth,
|
|
@@ -15548,7 +15878,7 @@ function createGatewayHttpServer(opts) {
|
|
|
15548
15878
|
})) return;
|
|
15549
15879
|
}
|
|
15550
15880
|
if (canvasHost) {
|
|
15551
|
-
if (isCanvasPath(
|
|
15881
|
+
if (isCanvasPath(requestPath)) {
|
|
15552
15882
|
if (!await authorizeCanvasRequest({
|
|
15553
15883
|
req,
|
|
15554
15884
|
auth: resolvedAuth,
|
|
@@ -15622,7 +15952,7 @@ function createGatewayHooksRequestHandler(params) {
|
|
|
15622
15952
|
if (value.mode === "now") requestHeartbeatNow({ reason: "hook:wake" });
|
|
15623
15953
|
};
|
|
15624
15954
|
const dispatchAgentHook = (value) => {
|
|
15625
|
-
const sessionKey = value.sessionKey.trim()
|
|
15955
|
+
const sessionKey = value.sessionKey.trim();
|
|
15626
15956
|
const mainSessionKey = resolveMainSessionKeyFromConfig();
|
|
15627
15957
|
const jobId = randomUUID();
|
|
15628
15958
|
const now = Date.now();
|
|
@@ -16614,8 +16944,7 @@ function attachGatewayWsMessageHandler(params) {
|
|
|
16614
16944
|
close(1008, "invalid role");
|
|
16615
16945
|
return;
|
|
16616
16946
|
}
|
|
16617
|
-
const
|
|
16618
|
-
const scopes = requestedScopes.length > 0 ? requestedScopes : role === "operator" ? ["operator.admin"] : [];
|
|
16947
|
+
const scopes = Array.isArray(connectParams.scopes) ? connectParams.scopes : [];
|
|
16619
16948
|
connectParams.role = role;
|
|
16620
16949
|
connectParams.scopes = scopes;
|
|
16621
16950
|
const isControlUi = connectParams.client.id === GATEWAY_CLIENT_IDS.CONTROL_UI;
|
|
@@ -16819,7 +17148,7 @@ function attachGatewayWsMessageHandler(params) {
|
|
|
16819
17148
|
clientId: connectParams.client.id,
|
|
16820
17149
|
clientMode: connectParams.client.mode,
|
|
16821
17150
|
role,
|
|
16822
|
-
scopes
|
|
17151
|
+
scopes,
|
|
16823
17152
|
signedAtMs: signedAt,
|
|
16824
17153
|
token: connectParams.auth?.token ?? null,
|
|
16825
17154
|
nonce: providedNonce || void 0,
|
|
@@ -16832,7 +17161,7 @@ function attachGatewayWsMessageHandler(params) {
|
|
|
16832
17161
|
clientId: connectParams.client.id,
|
|
16833
17162
|
clientMode: connectParams.client.mode,
|
|
16834
17163
|
role,
|
|
16835
|
-
scopes
|
|
17164
|
+
scopes,
|
|
16836
17165
|
signedAtMs: signedAt,
|
|
16837
17166
|
token: connectParams.auth?.token ?? null,
|
|
16838
17167
|
version: "v1"
|
|
@@ -17681,6 +18010,12 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
17681
18010
|
logChannels,
|
|
17682
18011
|
logBrowser
|
|
17683
18012
|
}));
|
|
18013
|
+
{
|
|
18014
|
+
const hookRunner = getGlobalHookRunner();
|
|
18015
|
+
if (hookRunner?.hasHooks("gateway_start")) hookRunner.runGatewayStart({ port }, { port }).catch((err) => {
|
|
18016
|
+
log.warn(`gateway_start hook failed: ${String(err)}`);
|
|
18017
|
+
});
|
|
18018
|
+
}
|
|
17684
18019
|
const { applyHotReload, requestGatewayRestart } = createGatewayReloadHandlers({
|
|
17685
18020
|
deps,
|
|
17686
18021
|
broadcast,
|
|
@@ -17743,6 +18078,14 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
17743
18078
|
httpServers
|
|
17744
18079
|
});
|
|
17745
18080
|
return { close: async (opts) => {
|
|
18081
|
+
{
|
|
18082
|
+
const hookRunner = getGlobalHookRunner();
|
|
18083
|
+
if (hookRunner?.hasHooks("gateway_stop")) try {
|
|
18084
|
+
await hookRunner.runGatewayStop({ reason: opts?.reason ?? "gateway stopping" }, { port });
|
|
18085
|
+
} catch (err) {
|
|
18086
|
+
log.warn(`gateway_stop hook failed: ${String(err)}`);
|
|
18087
|
+
}
|
|
18088
|
+
}
|
|
17746
18089
|
if (diagnosticsEnabled) stopDiagnosticHeartbeat();
|
|
17747
18090
|
if (skillsRefreshTimer) {
|
|
17748
18091
|
clearTimeout(skillsRefreshTimer);
|
|
@@ -17848,6 +18191,8 @@ async function runGatewayLoop(params) {
|
|
|
17848
18191
|
process.removeListener("SIGINT", onSigint);
|
|
17849
18192
|
process.removeListener("SIGUSR1", onSigusr1);
|
|
17850
18193
|
};
|
|
18194
|
+
const DRAIN_TIMEOUT_MS = 3e4;
|
|
18195
|
+
const SHUTDOWN_TIMEOUT_MS = 5e3;
|
|
17851
18196
|
const request = (action, signal) => {
|
|
17852
18197
|
if (shuttingDown) {
|
|
17853
18198
|
gatewayLog$1.info(`received ${signal} during shutdown; ignoring`);
|
|
@@ -17856,13 +18201,23 @@ async function runGatewayLoop(params) {
|
|
|
17856
18201
|
shuttingDown = true;
|
|
17857
18202
|
const isRestart = action === "restart";
|
|
17858
18203
|
gatewayLog$1.info(`received ${signal}; ${isRestart ? "restarting" : "shutting down"}`);
|
|
18204
|
+
const forceExitMs = isRestart ? DRAIN_TIMEOUT_MS + SHUTDOWN_TIMEOUT_MS : SHUTDOWN_TIMEOUT_MS;
|
|
17859
18205
|
const forceExitTimer = setTimeout(() => {
|
|
17860
18206
|
gatewayLog$1.error("shutdown timed out; exiting without full cleanup");
|
|
17861
18207
|
cleanupSignals();
|
|
17862
18208
|
params.runtime.exit(0);
|
|
17863
|
-
},
|
|
18209
|
+
}, forceExitMs);
|
|
17864
18210
|
(async () => {
|
|
17865
18211
|
try {
|
|
18212
|
+
if (isRestart) {
|
|
18213
|
+
const activeTasks = getActiveTaskCount();
|
|
18214
|
+
if (activeTasks > 0) {
|
|
18215
|
+
gatewayLog$1.info(`draining ${activeTasks} active task(s) before restart (timeout ${DRAIN_TIMEOUT_MS}ms)`);
|
|
18216
|
+
const { drained } = await waitForActiveTasks(DRAIN_TIMEOUT_MS);
|
|
18217
|
+
if (drained) gatewayLog$1.info("all active tasks drained");
|
|
18218
|
+
else gatewayLog$1.warn("drain timeout reached; proceeding with restart");
|
|
18219
|
+
}
|
|
18220
|
+
}
|
|
17866
18221
|
await server?.close({
|
|
17867
18222
|
reason: isRestart ? "gateway restarting" : "gateway stopping",
|
|
17868
18223
|
restartExpectedMs: isRestart ? 1500 : null
|