@gguf/claw 2026.2.4 → 2026.2.5
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 +50 -1
- package/LICENSE +1 -1
- package/README.md +50 -43
- package/dist/{accounts-BlHoTziG.js → accounts-BgZmhIm6.js} +4 -4
- package/dist/{accounts-B5QZU96b.js → accounts-Dto4p9zB.js} +2 -2
- package/dist/{acp-cli-DU_cVWbN.js → acp-cli-BOKabdeW.js} +15 -15
- package/dist/{acp-cli-O8LcQigE.js → acp-cli-BwcHtBDk.js} +19 -19
- package/dist/{agent-BBI-UGkN.js → agent-DztWhVCH.js} +20 -13
- package/dist/{agent-DuQt3QDO.js → agent-_H-0rbHV.js} +21 -14
- package/dist/{agent-scope-jm0ZdXwM.js → agent-scope-C9VjJXEK.js} +5 -180
- package/dist/{agent-scope-CrgUOY3f.js → agent-scope-CMs5Y7l-.js} +6 -181
- package/dist/{agent-scope-COnICB_7.js → agent-scope-Csu2B6AM.js} +2 -2
- package/dist/{audit-D-OqdjQu.js → audit-BWbjQmyv.js} +182 -15
- package/dist/{audit-CWGOX7Eh.js → audit-ZY6Dk5Ec.js} +183 -16
- package/dist/{auth-viF_w60n.js → auth-CbhB03Rz.js} +2 -2
- package/dist/{auth-DK3l201_.js → auth-DksjO6WG.js} +2 -2
- package/dist/{auth-health-DcKoxhDo.js → auth-health-C4bElkgf.js} +1 -1
- package/dist/{auth-health-Ba9GTScq.js → auth-health-Ctf-_JFE.js} +1 -1
- package/dist/{auth-profiles-CfFGCDJa.js → auth-profiles-CYBuGiBb.js} +38 -13
- package/dist/build-info.json +2 -2
- package/dist/{call-CfqL-4Nc.js → call-90HgQQ8o.js} +34 -8
- package/dist/{call-CPBhMXxo.js → call-BTbA5OB4.js} +35 -9
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/canvas-host/a2ui/a2ui.bundle.js +29 -44
- package/dist/{channel-options-eRR8_a8h.js → channel-options-DrUmtdd9.js} +3 -3
- package/dist/{channel-options-BCSvD6JM.js → channel-options-uftAnT5P.js} +7 -7
- package/dist/{channel-selection-BAwiO0li.js → channel-selection-CJWYmCLf.js} +2 -2
- package/dist/{channel-selection-BCn8_qun.js → channel-selection-PZuuCvrp.js} +2 -2
- package/dist/{channel-summary-BkqO8zZ9.js → channel-summary-D9nzC5WB.js} +8 -42
- package/dist/{channel-summary-C8GoEKgH.js → channel-summary-DUiKDBLv.js} +9 -43
- package/dist/{channels-cli-CBGINubh.js → channels-cli-PAlqhOZ7.js} +56 -54
- package/dist/{channels-cli-yQo-Rzw6.js → channels-cli-PPk5wwuy.js} +59 -57
- package/dist/{channels-status-issues-C9vMMPG0.js → channels-status-issues-CJ8PJgDc.js} +1 -1
- package/dist/{channels-status-issues-DRXQXvhY.js → channels-status-issues-CrS1r5sr.js} +1 -1
- package/dist/{chrome-DlqPCh1y.js → chrome-B3IuUad-.js} +2 -2
- package/dist/{chrome-D2LUApAY.js → chrome-BNSd7Bie.js} +5 -5
- package/dist/{clack-prompter-OmDa1Hm1.js → clack-prompter-CEKDd_Vg.js} +5 -5
- package/dist/{clack-prompter-BJuVh97L.js → clack-prompter-DuBVnTKy.js} +4 -4
- package/dist/cli/daemon-cli.js +1 -1
- package/dist/cli-DBAccB3n.js +86 -0
- package/dist/cli-DD5dW58-.js +89 -0
- package/dist/{client-zqMhLTAX.js → client-BYVbRnuQ.js} +13 -5
- package/dist/{client-cU7Xg1MO.js → client-CxbkcEZ7.js} +12 -4
- package/dist/{command-options-51bBgSJL.js → command-options-DUUINcz0.js} +3 -3
- package/dist/{commands-DMKDOFmC.js → commands-DAC7XMAT.js} +5 -4
- package/dist/completion-cli-BPIeQDFy.js +773 -0
- package/dist/{completion-cli-BoF86Oeq.js → completion-cli-BbhA_JbG.js} +62 -15
- package/dist/{config-qgIz1lbh.js → config-CAuZ-EkU.js} +93 -31
- package/dist/{config-CGsoho7J.js → config-CG73z4h6.js} +61 -28
- package/dist/{config-DCT1RAo6.js → config-CKLedg5Y.js} +92 -30
- package/dist/{config-guard-CJuPkD5Y.js → config-guard-a5ynrKd-.js} +181 -57
- package/dist/{configure-C1_0rFdQ.js → configure-B47GYdlB.js} +33 -23
- package/dist/{configure-D0OAmW2s.js → configure-ChnTy7Jz.js} +31 -21
- package/dist/{control-service-BW5sW2U1.js → control-service-CS61Road.js} +13 -6
- package/dist/{control-service-Ds9ompnU.js → control-service-D2E9NKqQ.js} +12 -5
- package/dist/control-ui/assets/{index-RwcW4Xl0.css → index-BoXosYY6.css} +1 -1
- package/dist/control-ui/assets/index-Dm6g1E26.js +7553 -0
- package/dist/control-ui/assets/index-Dm6g1E26.js.map +1 -0
- package/dist/control-ui/index.html +2 -2
- package/dist/{cron-cli-Bn_e3WGb.js → cron-cli-CssI71-c.js} +20 -19
- package/dist/{cron-cli-BVARiNrv.js → cron-cli-Ys53MyTg.js} +24 -23
- package/dist/{daemon-cli-fHXAapHL.js → daemon-cli-B6aLZ8OE.js} +28 -23
- package/dist/{daemon-cli-yy_MAYxv.js → daemon-cli-CMKd_D6h.js} +26 -21
- package/dist/{daemon-runtime-vNkYv9tq.js → daemon-runtime-BCn_QIHK.js} +64 -7
- package/dist/{daemon-runtime-ELWW7q0C.js → daemon-runtime-DMd0mgTK.js} +64 -7
- package/dist/{deliver-Bsvrattg.js → deliver-C3bnXkg5.js} +12 -10
- package/dist/{deliver-Dl8TEyHM.js → deliver-CZPhTA7x.js} +7 -5
- package/dist/{deliver-eE21zdeQ.js → deliver-Cau4HL7W.js} +11 -9
- package/dist/{deps-BrcOX0ht.js → deps-BG1LonF6.js} +2 -2
- package/dist/{deps-wXkiMwLZ.js → deps-ytXmI88x.js} +2 -2
- package/dist/{devices-cli-BjlwgE6B.js → devices-cli-Cm0ENrXH.js} +16 -16
- package/dist/{devices-cli-BVc_Ic5O.js → devices-cli-D_rnGkqO.js} +12 -12
- package/dist/{directory-cli-cc9ivzEM.js → directory-cli-CGLolzJC.js} +15 -15
- package/dist/{directory-cli-CULRQACb.js → directory-cli-CTtv_AB7.js} +19 -19
- package/dist/{dispatcher-BNB5aCZ6.js → dispatcher-6oI-H42S.js} +1 -1
- package/dist/{dns-cli-BwDdBlsK.js → dns-cli-BRkJGLqK.js} +15 -15
- package/dist/{dns-cli-B79COhmu.js → dns-cli-CoeI4817.js} +11 -11
- package/dist/{docs-cli-BM55jf4Y.js → docs-cli-BH9bMx3a.js} +7 -7
- package/dist/{docs-cli-t7IEzxr8.js → docs-cli-Bh1Coji2.js} +10 -10
- package/dist/{doctor-CT9JPoCt.js → doctor-CwSrWRCp.js} +43 -38
- package/dist/{doctor-OmfNRlMS.js → doctor-JnMryC_M.js} +40 -35
- package/dist/entry.js +12 -8
- package/dist/{env-DOcCob95.js → env-0_mKbEWW.js} +2 -2
- package/dist/{errors-DdT2Dtkb.js → errors-CZ9opC6L.js} +4 -4
- package/dist/{exec-B7WKla_0.js → exec-BMnoMcZW.js} +1 -1
- package/dist/{exec-CTo4hK94.js → exec-HEWTMJ7j.js} +1 -1
- package/dist/{exec-approvals-WdYFyy5N.js → exec-approvals-BCEFzcbC.js} +19 -2
- package/dist/{exec-approvals-CK-Umdr3.js → exec-approvals-DZixgolZ.js} +19 -2
- package/dist/{exec-approvals-cli-DD_z4fL9.js → exec-approvals-cli-D7aVv5hN.js} +19 -19
- package/dist/{exec-approvals-cli-BK2toX2b.js → exec-approvals-cli-DzLp5G7t.js} +23 -23
- package/dist/extensionAPI.js +1186 -267
- package/dist/{gateway-cli-BCC0T5iY.js → gateway-cli-DHP5DRUH.js} +910 -199
- package/dist/{gateway-cli-BTlr6Uwl.js → gateway-cli-ape0pnBU.js} +912 -202
- package/dist/{gateway-rpc-CMAcradB.js → gateway-rpc-C8rNIC0P.js} +3 -3
- package/dist/{gateway-rpc-SvVB4Fmv.js → gateway-rpc-CWnTaSEY.js} +3 -3
- package/dist/{github-copilot-auth-BHLcQ1sN.js → github-copilot-auth-B_lK1g__.js} +173 -87
- package/dist/{github-copilot-auth-BoRchp_Q.js → github-copilot-auth-C8Uf0Q03.js} +174 -88
- package/dist/{github-copilot-token-BEtihsn6.js → github-copilot-token-B3SA95yo.js} +8 -2
- package/dist/{github-copilot-token-rP-6QdKv.js → github-copilot-token-SLWintYd.js} +7 -1
- package/dist/{github-copilot-token-VZsS4013.js → github-copilot-token-pGSmVaW-.js} +8 -2
- package/dist/{gmail-setup-utils-4czdWNCN.js → gmail-setup-utils-Bi6W14MK.js} +3 -3
- package/dist/{gmail-setup-utils-B1CTmT2V.js → gmail-setup-utils-QpN7TEXS.js} +4 -4
- package/dist/{health-format-B4_A88V3.js → health-format-B3eStY5r.js} +215 -21
- package/dist/{health-format-Ct8J0fwc.js → health-format-ND2rUbQO.js} +213 -19
- package/dist/{help-format-CGcnDM3D.js → help-format-Bozi4K9H.js} +1 -1
- package/dist/{helpers-DfgBr1D5.js → helpers-BIc7L8EF.js} +1 -1
- package/dist/{helpers-Cw9kFCkw.js → helpers-D66_XoIz.js} +1 -1
- package/dist/{hooks-cli-NmkXLKmj.js → hooks-cli-BMu_-4Ru.js} +49 -49
- package/dist/{hooks-cli-B-28F__A.js → hooks-cli-CmeQxEOM.js} +45 -45
- package/dist/{hooks-status-I3Y60zVN.js → hooks-status-CKmUPU-M.js} +3 -3
- package/dist/{hooks-status-XV9oQICf.js → hooks-status-DepPyfBb.js} +4 -4
- package/dist/{image-ClOB6QDJ.js → image-Ca_PtqY7.js} +8 -6
- package/dist/{image-BYmtfVH8.js → image-CgBndiQy.js} +9 -7
- package/dist/{image-CXg7Z0WD.js → image-nRwqkmtf.js} +8 -6
- package/dist/index.js +231 -105
- package/dist/{installs-C5cjVarj.js → installs-BhEjOqPy.js} +43 -6
- package/dist/{installs-W4Pc1LJz.js → installs-DsJkyWfL.js} +43 -6
- package/dist/{links-C9fyAH-V.js → links-B5pRdmo1.js} +1 -1
- package/dist/{links-jGisPfXW.js → links-D0uzJbi6.js} +1 -1
- package/dist/{loader-BYWxo-_j.js → loader-_Pj-TZS2.js} +920 -491
- package/dist/{logging-BnUUuH3y.js → logging-Cc7m6PTv.js} +1 -1
- package/dist/{logging-CLCWl7Iu.js → logging-TXWhN8jG.js} +2 -2
- package/dist/{login-qr-C2H_iQJU.js → login-qr-BIlr0vwe.js} +12 -7
- package/dist/{login-qr-7WOtj6zE.js → login-qr-CcOWO_dR.js} +9 -4
- package/dist/{login-qr-sEcxw1_U.js → login-qr-Cmsf7BGt.js} +11 -6
- package/dist/{logs-cli-C5v4fEDj.js → logs-cli-5L3NxTsc.js} +19 -19
- package/dist/{logs-cli-nVwK5g60.js → logs-cli-DtiFFkZL.js} +15 -15
- package/dist/{manager-rDmdE7O9.js → manager-BXiIQku7.js} +9 -7
- package/dist/{manager-JSP5pLyv.js → manager-C4ILl-d3.js} +10 -8
- package/dist/{manager-BArueSTR.js → manager-LpytrxUw.js} +12 -10
- package/dist/{manifest-registry-tuAcHxrV.js → manifest-registry-C69Z-I4v.js} +1 -1
- package/dist/{manifest-registry-BFpLJJDB.js → manifest-registry-DHaa1SJb.js} +1 -1
- package/dist/{message-channel-CAFcg7mw.js → message-channel-BlgPSDAh.js} +6 -1
- package/dist/{message-channel-CQGWXVL4.js → message-channel-Bpfe5l5f.js} +7 -2
- package/dist/{model-selection-Cp1maz7B.js → model-selection-DMUrNhQP.js} +41 -16
- package/dist/{model-selection-Cs1y6OBv.js → model-selection-mzTqrNoj.js} +38 -14
- package/dist/{models-cli-n9a8pESx.js → models-cli-DHzyyLvp.js} +49 -49
- package/dist/{models-cli-DGnLcr4X.js → models-cli-EhrWjNLH.js} +53 -53
- package/dist/{net-DaJz_a4n.js → net-C8YRVt16.js} +1 -1
- package/dist/{net-DeiCIMU6.js → net-CWMMy37F.js} +1 -1
- package/dist/{node-cli-rtEq-YyU.js → node-cli-2oYmIWJt.js} +30 -30
- package/dist/{node-cli-AOO0HsM1.js → node-cli-DH7Ykym5.js} +26 -26
- package/dist/{node-service-CjtBRyjp.js → node-service-BAYHx0E7.js} +2 -2
- package/dist/{node-service-BW_LhY5w.js → node-service-Lc1LlnFH.js} +2 -2
- package/dist/{nodes-cli-Coxj5hDA.js → nodes-cli-Bc5K-0Lt.js} +22 -22
- package/dist/{nodes-cli-ChBsNXzz.js → nodes-cli-hT8yYD7S.js} +18 -18
- package/dist/{nodes-screen-Ln98EX_f.js → nodes-screen-DGlNPbk4.js} +2 -2
- package/dist/{nodes-screen-DOhGEibx.js → nodes-screen-DT5HvhJV.js} +2 -2
- package/dist/{note-BFpD-42H.js → note-B5HnoeZX.js} +2 -2
- package/dist/{note-CBiVaqG7.js → note-Ci08TSbV.js} +1 -1
- package/dist/{onboard-channels-CF7lTDNu.js → onboard-channels-D-ZQTy5V.js} +9 -8
- package/dist/{onboard-channels-CJCy7TTQ.js → onboard-channels-DKT27PdN.js} +10 -9
- package/dist/{onboard-skills-DdFGj9pt.js → onboard-skills-YobctE-R.js} +259 -194
- package/dist/{onboard-skills-fL84FI8F.js → onboard-skills-s8J5xbUr.js} +259 -194
- package/dist/{onboarding-DcN1avQK.js → onboarding-BP4-5uzE.js} +96 -60
- package/dist/{pairing-cli-DbP9KqPL.js → pairing-cli-C8KHRjaU.js} +15 -15
- package/dist/{pairing-cli-B7RQFp4r.js → pairing-cli-i7wiTmYC.js} +19 -19
- package/dist/{pairing-labels-DK2aLSd2.js → pairing-labels-BbydDT7w.js} +1 -1
- package/dist/{pairing-labels-C6I3dD-m.js → pairing-labels-CtqLxbG6.js} +1 -1
- package/dist/{pairing-store-BnMngoWQ.js → pairing-store-DFq7WtOv.js} +2 -2
- package/dist/{pairing-store-DMex6WWe.js → pairing-store-DTfv_FGA.js} +1 -1
- package/dist/{path-env-CuGC6r1F.js → path-env-DP3DsVge.js} +2 -2
- package/dist/{path-env-CUhrC5DA.js → path-env-h3xp5PqO.js} +1 -1
- package/dist/{paths-xPuk88Yf.js → paths-B4kigINg.js} +2 -2
- package/dist/{paths-50eo6DV6.js → paths-Bb0nwPeu.js} +2 -2
- package/dist/{paths-RvF0P6tQ.js → paths-CTg8F3AE.js} +1 -1
- package/dist/{pi-embedded-helpers-DJgCXZEz.js → pi-embedded-helpers-BB4uACeq.js} +175 -170
- package/dist/{pi-embedded-helpers-DiK8Qn1l.js → pi-embedded-helpers-BxqZh6U7.js} +43 -19
- package/dist/{pi-embedded-helpers-CC00lEFI.js → pi-embedded-helpers-DF8SAHU-.js} +175 -170
- package/dist/{pi-model-discovery-DjGamP_B.js → pi-model-discovery-CV2V1HHz.js} +8 -1
- package/dist/{pi-model-discovery-CnK2Dol8.js → pi-model-discovery-DzEIEgHL.js} +8 -1
- package/dist/{pi-model-discovery-CsRo-xMp.js → pi-model-discovery-EhM2JAQo.js} +8 -1
- package/dist/{pi-tools.policy-DleRi9eC.js → pi-tools.policy-BQ8N5y8a.js} +5 -4
- package/dist/{plugin-auto-enable-JQ63k0Ce.js → plugin-auto-enable-Ci7TBlH2.js} +5 -5
- package/dist/{plugin-auto-enable-CIVp3SAp.js → plugin-auto-enable-DyW8lHTT.js} +4 -4
- package/dist/plugin-sdk/index.d.ts +228 -283
- package/dist/plugin-sdk/index.js +22528 -69091
- package/dist/plugin-sdk/pi-model-discovery-Dw3A6oXH.js +37 -0
- package/dist/{plugins-TrKFfrLt.js → plugins-BUPpq5aS.js} +3 -2
- package/dist/{plugins-D1CxUobm.js → plugins-BYIWo0Cp.js} +5 -4
- package/dist/{plugins-cli-17wYux52.js → plugins-cli-CGfxctIx.js} +50 -49
- package/dist/{plugins-cli-VyQWn_LW.js → plugins-cli-Dr_R2-FY.js} +46 -45
- package/dist/{ports-B27T1uRn.js → ports-0V-Mu4ch.js} +2 -2
- package/dist/{program-BA9_uWfO.js → program-oR55MCAT.js} +84 -81
- package/dist/{progress-uNDQDtGB.js → progress-xpLtQsNY.js} +1 -1
- package/dist/{prompt-style-gfROyHgB.js → prompt-style-vzh0MGHs.js} +1 -1
- package/dist/{pw-ai-BC4dLE7k.js → pw-ai-B7Fvw8DW.js} +4 -4
- package/dist/{pw-ai-DlTBXZjY.js → pw-ai-DYpQO6HI.js} +6 -6
- package/dist/{pw-ai-BEqPnalN.js → pw-ai-tNPuRNn3.js} +4 -4
- package/dist/{qmd-manager-8xWxIGbO.js → qmd-manager-BKkFEEN_.js} +9 -8
- package/dist/{plugin-sdk/qmd-manager-DvkA01DP.js → qmd-manager-CF52nuBg.js} +6 -6
- package/dist/{qmd-manager-BSCOmXYZ.js → qmd-manager-Dub8jfbo.js} +7 -6
- package/dist/{register.subclis-CWWz9WdX.js → register.subclis-BpIR6Iqi.js} +36 -30
- package/dist/{reply-CoztdrN_.js → reply-B8pOiUNN.js} +935 -506
- package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
- package/dist/{routes-yI5QIzeL.js → routes-BSfXf8a5.js} +5 -5
- package/dist/{routes-Ds-tIZFJ.js → routes-DchZU3EK.js} +6 -6
- package/dist/{rpc-HF82_iLh.js → rpc-DqI3QH59.js} +3 -3
- package/dist/{rpc-HdKLb6jx.js → rpc-Vo2ACfn-.js} +3 -3
- package/dist/{run-main-B3krVvc1.js → run-main-DrVUUPHV.js} +84 -84
- package/dist/{sandbox-BXUfp_qv.js → sandbox-CV8VwPij.js} +36 -16
- package/dist/{sandbox-Cnq9TXEn.js → sandbox-DuqLKN5J.js} +34 -14
- package/dist/{sandbox-cli-C7j1V6tb.js → sandbox-cli-C0_Hrk7i.js} +25 -24
- package/dist/{sandbox-cli-CnS9JJlO.js → sandbox-cli-Ces6i3n2.js} +21 -20
- package/dist/{security-cli-Clg7RQT3.js → security-cli-CybLT9XS.js} +32 -30
- package/dist/{security-cli-BGd4NO4l.js → security-cli-T7yrd3lb.js} +28 -26
- package/dist/{server-context-D2cv-pIA.js → server-context-vChIAqjH.js} +6 -6
- package/dist/{server-context-CM_E6wD5.js → server-context-yKyxyxOJ.js} +5 -5
- package/dist/{server-node-events-IMwI538C.js → server-node-events-BR2vHqf6.js} +44 -43
- package/dist/{server-node-events-C5EqDe_U.js → server-node-events-D39FA0NG.js} +48 -47
- package/dist/{service-CAxAjHNB.js → service-BZesBIaG.js} +3 -3
- package/dist/{service-BoDHq_LN.js → service-_JwSmGSn.js} +2 -2
- package/dist/{service-audit-Bf33pqEM.js → service-audit-C-IA4omi.js} +6 -6
- package/dist/{service-audit-DBSAGhm8.js → service-audit-DDX1kO3k.js} +6 -6
- package/dist/session-cost-usage-BTXosU1k.js +692 -0
- package/dist/session-cost-usage-CBP4Hv9D.js +692 -0
- package/dist/session-key-CZkcvAtx.js +177 -0
- package/dist/session-key-Dm2EOhrH.js +177 -0
- package/dist/{shared-ChNOqAzp.js → shared-BmtNKsPq.js} +4 -4
- package/dist/{shared-D42-KbPa.js → shared-C1XLEyB0.js} +3 -3
- package/dist/{shared-xZjRQa6y.js → shared-C8_5pNbb.js} +4 -4
- package/dist/{shared-DBGw227P.js → shared-fnGLWyZ6.js} +3 -3
- package/dist/skill-scanner-BoGjHXUZ.js +255 -0
- package/dist/skill-scanner-Bp1D9gra.js +255 -0
- package/dist/{skills-DtwGIkTI.js → skills-CmU0Q92f.js} +3 -3
- package/dist/{skills-C4b1FA1e.js → skills-D5JDj3TR.js} +5 -5
- package/dist/{skills-cli-BPkuJAz9.js → skills-cli-C1yJvIkL.js} +16 -16
- package/dist/{skills-cli-b0ZmGlmh.js → skills-cli-DBC5zFat.js} +12 -12
- package/dist/{skills-status-CSCMqNZP.js → skills-status-CEvVUD3U.js} +3 -3
- package/dist/{skills-status-CWkBweWW.js → skills-status-DtXrj3fy.js} +2 -2
- package/dist/{status-BIWeu5mN.js → status-BRXuHUsK.js} +94 -58
- package/dist/{status-CcM6W8r4.js → status-BTGXSvZ1.js} +3 -3
- package/dist/{status-PjegR5Cv.js → status-DBZ5Z7ng.js} +4 -4
- package/dist/{subsystem-46MXi6Ip.js → subsystem-CAq3uyo7.js} +1 -1
- package/dist/{system-cli-B4FEIE5d.js → system-cli-Dqnt-b0D.js} +13 -13
- package/dist/{system-cli-BL_QZ1VP.js → system-cli-SJLtqI47.js} +17 -17
- package/dist/{systemd-DAgZTW06.js → systemd-8sIc6isV.js} +2 -2
- package/dist/{systemd-CNYEkRek.js → systemd-B-3NdMmA.js} +3 -3
- package/dist/{systemd-hints-CcgK8AJE.js → systemd-hints-DO88c_nD.js} +1 -1
- package/dist/{systemd-hints-okqOoOug.js → systemd-hints-Wim4Bq6j.js} +1 -1
- package/dist/{systemd-linger-CTe0ZDxD.js → systemd-linger-N-cIaegf.js} +8 -3
- package/dist/{systemd-linger-Cbkoh9qw.js → systemd-linger-SsSOsJST.js} +8 -3
- package/dist/{table-f0EgX-YI.js → table-CJSx0YID.js} +1 -1
- package/dist/{table-DuNe7Qes.js → table-CLtGjVsx.js} +2 -2
- package/dist/{tailscale-BUcKO8Rr.js → tailscale-9MusRvOi.js} +1 -1
- package/dist/{tailscale-Cvk3mQDZ.js → tailscale-BVGD9gSD.js} +2 -2
- package/dist/{tool-display-rIUh61kT.js → tool-display-BxZG0o1b.js} +2 -2
- package/dist/{tool-display-BMYWrp0L.js → tool-display-DmgKs6-V.js} +2 -2
- package/dist/{tui-cV-R-JXi.js → tui-DPorsF4z.js} +203 -75
- package/dist/{tui-DBmFYQTk.js → tui-XH6_v0qC.js} +204 -74
- package/dist/{tui-cli-B_CKOjZ1.js → tui-cli-DRSIBDgZ.js} +30 -29
- package/dist/{tui-cli-CVdJ28TX.js → tui-cli-DV_JAtnq.js} +26 -25
- package/dist/{update-BDyA5Iqy.js → update-DNAVcIQ7.js} +3 -3
- package/dist/{update-BIB5jGcv.js → update-DzMcwy1G.js} +3 -3
- package/dist/{update-cli-p49uMWby.js → update-cli-OAcZiYuA.js} +112 -27
- package/dist/{update-cli-C5vwquH_.js → update-cli-tQcy8mkI.js} +109 -23
- package/dist/{update-runner-8XFxQglY.js → update-runner-2i8_mIG5.js} +254 -17
- package/dist/{update-runner-s8Rs8ex3.js → update-runner-BDdk_K2S.js} +254 -17
- package/dist/usage-format-DvowRSs-.js +36 -0
- package/dist/usage-format-E3bMcUMV.js +36 -0
- package/dist/{utils-Dg0Xbl6w.js → utils-CKSrBNwq.js} +2 -2
- package/dist/{webhooks-cli-DkQGQ2ae.js → webhooks-cli-BztQHEco.js} +11 -11
- package/dist/{webhooks-cli-kRN8qR7B.js → webhooks-cli-ZAn97osC.js} +15 -15
- package/dist/{widearea-dns-BIhjVRG1.js → widearea-dns-CsSylzXH.js} +2 -2
- package/dist/{widearea-dns-D4yoSNNw.js → widearea-dns-D9Al4QRv.js} +2 -2
- package/dist/{ws-log-DQ6nkLys.js → ws-log-B7UNLFLC.js} +3 -3
- package/dist/{ws-log-C4IerKk4.js → ws-log-DJIXahf0.js} +2 -2
- package/dist/{wsl-DASmek7h.js → wsl-ATjkMwMA.js} +1 -1
- package/docs/.i18n/glossary.zh-CN.json +20 -0
- package/docs/assets/macos-onboarding/01-macos-warning.jpeg +0 -0
- package/docs/assets/macos-onboarding/02-local-networks.jpeg +0 -0
- package/docs/assets/macos-onboarding/03-security-notice.png +0 -0
- package/docs/assets/macos-onboarding/04-choose-gateway.png +0 -0
- package/docs/assets/macos-onboarding/05-permissions.png +0 -0
- package/docs/bedrock.md +3 -3
- package/docs/channels/discord.md +2 -1
- package/docs/channels/feishu.md +72 -2
- package/docs/channels/telegram.md +19 -0
- package/docs/cli/devices.md +3 -0
- package/docs/cli/gateway.md +3 -0
- package/docs/cli/index.md +2 -0
- package/docs/cli/onboard.md +16 -2
- package/docs/concepts/features.md +53 -0
- package/docs/concepts/memory.md +1 -1
- package/docs/concepts/messages.md +1 -1
- package/docs/concepts/model-providers.md +11 -11
- package/docs/concepts/models.md +1 -1
- package/docs/concepts/multi-agent.md +2 -2
- package/docs/concepts/session.md +19 -3
- package/docs/docs.json +331 -182
- package/docs/gateway/cli-backends.md +7 -5
- package/docs/gateway/configuration-examples.md +4 -4
- package/docs/gateway/configuration.md +34 -16
- package/docs/gateway/heartbeat.md +61 -1
- package/docs/gateway/local-models.md +3 -3
- package/docs/gateway/network-model.md +17 -0
- package/docs/gateway/remote.md +3 -1
- package/docs/gateway/security/index.md +1 -1
- package/docs/help/faq.md +25 -26
- package/docs/help/submitting-a-pr.md +214 -0
- package/docs/help/submitting-an-issue.md +165 -0
- package/docs/index.md +127 -193
- package/docs/install/docker.md +2 -2
- package/docs/{platforms → install}/exe-dev.md +4 -3
- package/docs/{platforms → install}/fly.md +1 -1
- package/docs/install/index.md +4 -2
- package/docs/nodes/media-understanding.md +2 -2
- package/docs/platforms/digitalocean.md +2 -2
- package/docs/platforms/index.md +4 -4
- package/docs/platforms/linux.md +1 -1
- package/docs/platforms/mac/release.md +7 -7
- package/docs/platforms/oracle.md +1 -1
- package/docs/platforms/raspberry-pi.md +1 -1
- package/docs/providers/anthropic.md +3 -3
- package/docs/providers/index.md +1 -1
- package/docs/providers/minimax.md +3 -3
- package/docs/providers/models.md +1 -1
- package/docs/providers/ollama.md +60 -6
- package/docs/providers/openai.md +2 -2
- package/docs/providers/opencode.md +1 -1
- package/docs/providers/vercel-ai-gateway.md +1 -1
- package/docs/reference/credits.md +27 -0
- package/docs/reference/wizard.md +268 -0
- package/docs/start/bootstrapping.md +41 -0
- package/docs/start/docs-directory.md +64 -0
- package/docs/start/getting-started.md +109 -197
- package/docs/start/hubs.md +12 -0
- package/docs/start/onboarding.md +51 -81
- package/docs/start/openclaw.md +3 -20
- package/docs/start/quickstart.md +22 -0
- package/docs/start/setup.md +14 -1
- package/docs/start/wizard-cli-automation.md +141 -0
- package/docs/start/wizard-cli-reference.md +244 -0
- package/docs/start/wizard.md +48 -289
- package/docs/style.css +3 -0
- package/docs/testing.md +9 -9
- package/docs/token-use.md +2 -2
- package/docs/tools/index.md +3 -0
- package/docs/tools/llm-task.md +1 -1
- package/docs/tools/thinking.md +1 -0
- package/docs/tui.md +3 -0
- package/docs/vps.md +6 -6
- package/docs/web/control-ui.md +2 -0
- package/docs/web/dashboard.md +7 -7
- package/docs/zh-CN/channels/feishu.md +119 -3
- package/docs/zh-CN/concepts/features.md +59 -0
- package/docs/zh-CN/gateway/network-model.md +23 -0
- package/docs/zh-CN/gateway/remote.md +1 -1
- package/docs/zh-CN/help/faq.md +5 -5
- package/docs/zh-CN/index.md +124 -202
- package/docs/zh-CN/install/docker.md +1 -1
- package/docs/zh-CN/platforms/digitalocean.md +2 -2
- package/docs/zh-CN/platforms/index.md +4 -4
- package/docs/zh-CN/platforms/linux.md +1 -1
- package/docs/zh-CN/platforms/oracle.md +1 -1
- package/docs/zh-CN/platforms/raspberry-pi.md +1 -1
- package/docs/zh-CN/providers/ollama.md +1 -1
- package/docs/zh-CN/reference/credits.md +34 -0
- package/docs/zh-CN/start/docs-directory.md +70 -0
- package/docs/zh-CN/start/getting-started.md +1 -1
- package/docs/zh-CN/start/hubs.md +39 -30
- package/docs/zh-CN/start/quickstart.md +88 -0
- package/docs/zh-CN/vps.md +4 -4
- package/extensions/bluebubbles/package.json +1 -1
- package/extensions/bluebubbles/src/monitor.ts +9 -0
- package/extensions/copilot-proxy/index.ts +1 -0
- package/extensions/copilot-proxy/package.json +1 -1
- package/extensions/diagnostics-otel/package.json +1 -1
- package/extensions/discord/package.json +1 -1
- package/extensions/feishu/index.ts +49 -1
- package/extensions/feishu/openclaw.plugin.json +1 -0
- package/extensions/feishu/package.json +9 -5
- package/extensions/feishu/skills/feishu-doc/SKILL.md +105 -0
- package/extensions/feishu/skills/feishu-doc/references/block-types.md +103 -0
- package/extensions/feishu/skills/feishu-drive/SKILL.md +97 -0
- package/extensions/feishu/skills/feishu-perm/SKILL.md +119 -0
- package/extensions/feishu/skills/feishu-wiki/SKILL.md +111 -0
- package/extensions/feishu/src/accounts.ts +144 -0
- package/extensions/feishu/src/bitable.ts +459 -0
- package/extensions/feishu/src/bot.ts +871 -0
- package/extensions/feishu/src/channel.ts +267 -202
- package/extensions/feishu/src/client.ts +118 -0
- package/extensions/feishu/src/config-schema.ts +152 -26
- package/extensions/feishu/src/directory.ts +177 -0
- package/extensions/feishu/src/doc-schema.ts +47 -0
- package/extensions/feishu/src/docx.ts +521 -0
- package/extensions/feishu/src/drive-schema.ts +46 -0
- package/extensions/feishu/src/drive.ts +227 -0
- package/extensions/feishu/src/media.ts +527 -0
- package/extensions/feishu/src/mention.ts +126 -0
- package/extensions/feishu/src/monitor.ts +190 -0
- package/extensions/feishu/src/onboarding.ts +278 -200
- package/extensions/feishu/src/outbound.ts +40 -0
- package/extensions/feishu/src/perm-schema.ts +52 -0
- package/extensions/feishu/src/perm.ts +173 -0
- package/extensions/feishu/src/policy.ts +104 -0
- package/extensions/feishu/src/probe.ts +44 -0
- package/extensions/feishu/src/reactions.ts +160 -0
- package/extensions/feishu/src/reply-dispatcher.ts +184 -0
- package/extensions/feishu/src/runtime.ts +14 -0
- package/extensions/feishu/src/send.ts +358 -0
- package/extensions/feishu/src/targets.ts +78 -0
- package/extensions/feishu/src/tools-config.ts +21 -0
- package/extensions/feishu/src/types.ts +75 -0
- package/extensions/feishu/src/typing.ts +80 -0
- package/extensions/feishu/src/wiki-schema.ts +55 -0
- package/extensions/feishu/src/wiki.ts +232 -0
- 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/googlechat/src/monitor.ts +12 -1
- package/extensions/imessage/package.json +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 +1 -1
- package/extensions/matrix/src/config-schema.ts +1 -0
- package/extensions/matrix/src/matrix/monitor/handler.ts +9 -5
- package/extensions/matrix/src/types.ts +2 -0
- package/extensions/mattermost/package.json +1 -1
- package/extensions/mattermost/src/channel.test.ts +24 -0
- package/extensions/mattermost/src/config-schema.ts +1 -0
- package/extensions/mattermost/src/mattermost/monitor.ts +9 -5
- package/extensions/mattermost/src/types.ts +2 -0
- package/extensions/memory-core/package.json +1 -1
- package/extensions/memory-lancedb/node_modules/.bin/openai +2 -2
- package/extensions/memory-lancedb/node_modules/.bin/openai.CMD +2 -2
- package/extensions/memory-lancedb/node_modules/.bin/openai.ps1 +2 -2
- package/extensions/memory-lancedb/package.json +2 -2
- 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/msteams/src/monitor-handler/message-handler.ts +1 -0
- package/extensions/msteams/src/reply-dispatcher.ts +7 -5
- package/extensions/nextcloud-talk/package.json +1 -1
- package/extensions/nextcloud-talk/src/config-schema.ts +1 -0
- package/extensions/nextcloud-talk/src/inbound.ts +10 -0
- package/extensions/nextcloud-talk/src/send.ts +7 -2
- package/extensions/nextcloud-talk/src/types.ts +2 -0
- package/extensions/nostr/CHANGELOG.md +6 -0
- package/extensions/nostr/package.json +1 -1
- 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/tlon/src/config-schema.ts +2 -0
- package/extensions/tlon/src/monitor/index.ts +41 -14
- package/extensions/tlon/src/monitor/utils.ts +1 -0
- package/extensions/twitch/CHANGELOG.md +6 -0
- package/extensions/twitch/package.json +1 -1
- package/extensions/twitch/src/config-schema.ts +2 -0
- package/extensions/twitch/src/monitor.ts +11 -0
- package/extensions/twitch/src/types.ts +2 -0
- package/extensions/voice-call/CHANGELOG.md +6 -0
- package/extensions/voice-call/package.json +1 -1
- package/extensions/voice-call/src/manager.test.ts +30 -0
- package/extensions/whatsapp/package.json +1 -1
- package/extensions/zalo/CHANGELOG.md +6 -0
- package/extensions/zalo/package.json +1 -1
- package/extensions/zalo/src/config-schema.ts +1 -0
- package/extensions/zalo/src/monitor.ts +11 -0
- package/extensions/zalo/src/types.ts +2 -0
- package/extensions/zalouser/CHANGELOG.md +6 -0
- package/extensions/zalouser/package.json +1 -1
- package/extensions/zalouser/src/config-schema.ts +1 -0
- package/extensions/zalouser/src/monitor.ts +12 -1
- package/extensions/zalouser/src/types.ts +2 -0
- package/package.json +14 -14
- package/dist/auth-profiles-3t9aTwDR.js +0 -11
- package/dist/auth-profiles-BYvLI-zr.js +0 -7
- package/dist/auth-profiles-DswR7tzt.js +0 -7
- package/dist/cli-BxIwNzhi.js +0 -89
- package/dist/cli-wFmvNjpg.js +0 -86
- package/dist/command-format-SkzzRqR1.js +0 -52
- package/dist/completion-cli-vxe-jqwC.js +0 -390
- package/dist/config-BwVg6hhl.js +0 -13
- package/dist/config-jKcyRiMo.js +0 -10
- package/dist/configure-DaecSBSI.js +0 -60
- package/dist/configure-t-7r9i4H.js +0 -64
- package/dist/control-service-Dag9b-dU.js +0 -16
- package/dist/control-service-DsUyuevF.js +0 -12
- package/dist/control-ui/assets/index-ryaCcbyp.js +0 -4584
- package/dist/control-ui/assets/index-ryaCcbyp.js.map +0 -1
- package/dist/daemon-cli-CUkUiGoK.js +0 -53
- package/dist/daemon-cli-D6FF4tmP.js +0 -49
- package/dist/deliver-BGnJ4-vz.js +0 -12
- package/dist/deliver-CXpx7BNb.js +0 -25
- package/dist/deliver-Ds2yqOA3.js +0 -21
- package/dist/doctor-BwqqPqMX.js +0 -58
- package/dist/doctor-DGrfzoKj.js +0 -62
- package/dist/github-copilot-token-B0CUgVkW.js +0 -4
- package/dist/github-copilot-token-B_uWT0Yi.js +0 -4
- package/dist/github-copilot-token-CXUZ9Lrb.js +0 -3
- package/dist/image-CgTMdnmz.js +0 -28
- package/dist/image-D1O-ebQc.js +0 -14
- package/dist/image-njq9Rf6U.js +0 -24
- package/dist/login-qr-BfbIJ1wP.js +0 -12
- package/dist/login-qr-CGWNrSQq.js +0 -9
- package/dist/login-qr-CUV9HZCg.js +0 -16
- package/dist/manager-DKpTd5pc.js +0 -10
- package/dist/manager-Dr_eVHpN.js +0 -10
- package/dist/manager-DtFcs1NT.js +0 -14
- package/dist/pi-model-discovery-BOramrmp.js +0 -3
- package/dist/pi-model-discovery-Bj98Srfa.js +0 -3
- package/dist/pi-model-discovery-DHPwfwKu.js +0 -3
- package/dist/plugin-sdk/agent-scope-qNPdmst1.js +0 -606
- package/dist/plugin-sdk/auth-profiles-D0LhX8iB.js +0 -7
- package/dist/plugin-sdk/chrome-DMuEXuKT.js +0 -1953
- package/dist/plugin-sdk/config-D5CsedNn.js +0 -5623
- package/dist/plugin-sdk/deliver-DOlMKwJ9.js +0 -12
- package/dist/plugin-sdk/deliver-Dl2ednkv.js +0 -2555
- package/dist/plugin-sdk/exec-CjyVHUuE.js +0 -1107
- package/dist/plugin-sdk/github-copilot-token-BoPqI-5_.js +0 -97
- package/dist/plugin-sdk/github-copilot-token-YEH9Bwov.js +0 -4
- package/dist/plugin-sdk/image-B_t0xXCb.js +0 -1419
- package/dist/plugin-sdk/image-DYTdodiR.js +0 -14
- package/dist/plugin-sdk/login-qr-B7ec28AI.js +0 -9
- package/dist/plugin-sdk/login-qr-BVBRxQRt.js +0 -470
- package/dist/plugin-sdk/manager-B-EITu1a.js +0 -10
- package/dist/plugin-sdk/manager-WCGzgWdf.js +0 -2868
- package/dist/plugin-sdk/model-selection-Bo7pocNu.js +0 -2667
- package/dist/plugin-sdk/paths-BFxmmTT5.js +0 -164
- package/dist/plugin-sdk/paths-Bkjq_KcG.js +0 -40
- package/dist/plugin-sdk/pi-embedded-helpers-fm5_Eokw.js +0 -8755
- package/dist/plugin-sdk/pi-model-discovery-CLgDNnGq.js +0 -13
- package/dist/plugin-sdk/pi-model-discovery-P2-pVRmz.js +0 -3
- package/dist/plugin-sdk/pw-ai-BN7Cwl9J.js +0 -1649
- package/dist/qmd-manager-CzArLjr6.js +0 -615
- package/dist/redact-BR0IM00e.js +0 -94
- package/dist/register.subclis-Bo-xmQ-W.js +0 -342
- package/dist/register.subclis-BuT7ZpPf.js +0 -3
- package/dist/restart-sentinel-CdcBcziq.js +0 -65
- package/dist/restart-sentinel-DywisDen.js +0 -65
- package/dist/runtime-guard-BG6JybtL.js +0 -60
- package/dist/runtime-guard-DvBpNsbR.js +0 -60
- package/dist/sqlite-Dz6S6ijV.js +0 -215
- package/dist/status.update-2ZdxeIeT.js +0 -79
- package/dist/status.update-ChwCPLBt.js +0 -79
- package/dist/systemd-linger-BZb1Uwsd.js +0 -7
- package/dist/systemd-linger-DemNCT5l.js +0 -9
- package/dist/transcript-events-fUhPZcB5.js +0 -17
- package/docs/_config.yml +0 -53
- package/docs/_layouts/default.html +0 -145
- package/docs/assets/docs-chat-widget.js +0 -667
- package/docs/assets/markdown.css +0 -179
- package/docs/assets/terminal.css +0 -473
- package/docs/assets/theme.js +0 -55
- package/extensions/feishu/README.md +0 -47
- /package/dist/{archive-BrH5WBhI.js → archive-D0z3LZDK.js} +0 -0
- /package/dist/{archive-mFgwsll-.js → archive-Dy3Ezb-5.js} +0 -0
- /package/dist/{boolean-CE7i9tBR.js → boolean-BgXe2hyu.js} +0 -0
- /package/dist/{brew-0HRgjHZw.js → brew-CAcErcKz.js} +0 -0
- /package/dist/{brew-Qdppmdlx.js → brew-CcZV0dSS.js} +0 -0
- /package/dist/{cli-utils-CukoNm8O.js → cli-utils-BkRQdAoC.js} +0 -0
- /package/dist/{cli-utils-DFbPmfWB.js → cli-utils-ByANh4Sp.js} +0 -0
- /package/dist/{plugin-sdk/command-format-CFzL448l.js → command-format-CFzL448l.js} +0 -0
- /package/dist/{command-format-BQK1OIvH.js → command-format-ChfKqObn.js} +0 -0
- /package/dist/{command-format-3xiXujG0.js → command-format-ayFsmwwz.js} +0 -0
- /package/dist/{constants-3er_81qc.js → constants-D1op9uGI.js} +0 -0
- /package/dist/{constants-CLUi6T-M.js → constants-HPrOsATF.js} +0 -0
- /package/dist/{exec-BIMFe4XS.js → exec-B8JKbXKW.js} +0 -0
- /package/dist/{format-BnjMmWWT.js → format-B7OjpGnt.js} +0 -0
- /package/dist/{format-hyFOmVZc.js → format-CS7EI0xF.js} +0 -0
- /package/dist/{help-format-af1XWYxC.js → help-format-CfZ94KRN.js} +0 -0
- /package/dist/{helpers-HZ-6iA1e.js → helpers-5yebzF4C.js} +0 -0
- /package/dist/{helpers-uGhPZ_kK.js → helpers-EKm3X92T.js} +0 -0
- /package/dist/{is-main-DD0MG3N8.js → is-main-B6kCyqsv.js} +0 -0
- /package/dist/{is-main-DrJg4t1R.js → is-main-qJ675wPV.js} +0 -0
- /package/dist/{logging-BdnOSVPD.js → logging-BWRYHvLp.js} +0 -0
- /package/dist/{logging-fywhKCmE.js → logging-CfEk_PnX.js} +0 -0
- /package/dist/{openclaw-root-Dean7Fp2.js → openclaw-root-9ILYSmJ9.js} +0 -0
- /package/dist/{openclaw-root-CJKDUIBP.js → openclaw-root-Cvotktkd.js} +0 -0
- /package/dist/{parse-BB0Cqon8.js → parse-BZz5lHzQ.js} +0 -0
- /package/dist/{parse-DLFPuO7w.js → parse-gTOGQPH6.js} +0 -0
- /package/dist/{parse-log-line-B3U8Kflp.js → parse-log-line-C6szvNBZ.js} +0 -0
- /package/dist/{parse-log-line-BmyeB3J2.js → parse-log-line-CARp5QyJ.js} +0 -0
- /package/dist/{parse-timeout-BIB19Upi.js → parse-timeout-CbVKLZ4B.js} +0 -0
- /package/dist/{parse-timeout-CmBmmqZZ.js → parse-timeout-Du-wHHNi.js} +0 -0
- /package/dist/{paths-VslOJiD2.js → paths-B1kfl4h5.js} +0 -0
- /package/dist/{paths-BDd7_JUB.js → paths-scjhy7N2.js} +0 -0
- /package/dist/{progress-Dn3kWpaL.js → progress-Da1ehW-x.js} +0 -0
- /package/dist/{prompt-style-D5D7b3cX.js → prompt-style-Dc0C5HC9.js} +0 -0
- /package/dist/{prompts-CIDznuZR.js → prompts-CXLLIBwP.js} +0 -0
- /package/dist/{prompts-CSlE5VZB.js → prompts-FbZThK8w.js} +0 -0
- /package/dist/{redact-BKh-zp-c.js → redact-B8YiFlwn.js} +0 -0
- /package/dist/{plugin-sdk/redact-wH73ib3-.js → redact-BIMJ3ntQ.js} +0 -0
- /package/dist/{redact-CDPAzwi8.js → redact-DJCFY628.js} +0 -0
- /package/dist/{plugin-sdk/sqlite-CqVsQPIl.js → sqlite-BKl1HJFe.js} +0 -0
- /package/dist/{sqlite-C59YNxdL.js → sqlite-Dnmf3LS7.js} +0 -0
- /package/dist/{sqlite-B_L84oiu.js → sqlite-DqUEZnjO.js} +0 -0
- /package/dist/{status-DkW6wMxZ.js → status-CRIEi8Mc.js} +0 -0
- /package/dist/{status-IDW1pkc0.js → status-tCu4RWZH.js} +0 -0
- /package/dist/{tailnet-BijMqkqa.js → tailnet-Byp3obcc.js} +0 -0
- /package/dist/{tailnet-Bk5cGmwE.js → tailnet-DLDGNuH2.js} +0 -0
- /package/dist/{plugin-sdk/transcript-events-DOI14YeV.js → transcript-events-CZ8CG4ht.js} +0 -0
- /package/dist/{transcript-events-Cj85Mq0h.js → transcript-events-ChU6IQwp.js} +0 -0
- /package/dist/{transcript-events-DW_H__a1.js → transcript-events-JLH5W4He.js} +0 -0
- /package/dist/{utils-PmTbZoD1.js → utils-DX85MiPR.js} +0 -0
- /package/dist/{ws-Cxo2p9fH.js → ws-CEcdsnN9.js} +0 -0
- /package/dist/{ws-DlSkA_BG.js → ws-D091yo4M.js} +0 -0
- /package/docs/{platforms → install}/gcp.md +0 -0
- /package/docs/{platforms → install}/hetzner.md +0 -0
- /package/docs/{platforms → install}/macos-vm.md +0 -0
- /package/docs/{northflank.mdx → install/northflank.mdx} +0 -0
- /package/docs/{railway.mdx → install/railway.mdx} +0 -0
- /package/docs/{render.mdx → install/render.mdx} +0 -0
- /package/docs/zh-CN/{platforms → install}/exe-dev.md +0 -0
- /package/docs/zh-CN/{platforms → install}/fly.md +0 -0
- /package/docs/zh-CN/{platforms → install}/gcp.md +0 -0
- /package/docs/zh-CN/{platforms → install}/hetzner.md +0 -0
- /package/docs/zh-CN/{platforms → install}/macos-vm.md +0 -0
- /package/docs/zh-CN/{northflank.mdx → install/northflank.mdx} +0 -0
- /package/docs/zh-CN/{railway.mdx → install/railway.mdx} +0 -0
- /package/docs/zh-CN/{render.mdx → install/render.mdx} +0 -0
|
@@ -1,91 +1,95 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { $n as
|
|
3
|
-
import { 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-
|
|
4
|
-
import {
|
|
5
|
-
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-
|
|
6
|
-
import { _ as shortenHomePath, h as resolveUserPath, s as ensureDir, t as CONFIG_DIR, x as truncateUtf16Safe } from "./utils-
|
|
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 {
|
|
10
|
-
import "./
|
|
11
|
-
import
|
|
12
|
-
import "./
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import { o as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import "./
|
|
19
|
-
import "./
|
|
20
|
-
import
|
|
21
|
-
import { d as
|
|
22
|
-
import {
|
|
23
|
-
import "./
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import "./
|
|
27
|
-
import "./
|
|
28
|
-
import
|
|
29
|
-
import "./
|
|
30
|
-
import "./
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import "./
|
|
34
|
-
import "./
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import { n as
|
|
38
|
-
import {
|
|
39
|
-
import "./
|
|
40
|
-
import "./
|
|
41
|
-
import
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import "./
|
|
46
|
-
import "./
|
|
47
|
-
import
|
|
48
|
-
import { r as
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import { n as
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import { t as
|
|
55
|
-
import {
|
|
56
|
-
import { t as
|
|
57
|
-
import "./
|
|
58
|
-
import { t as
|
|
59
|
-
import {
|
|
60
|
-
import "./
|
|
61
|
-
import "./
|
|
62
|
-
import {
|
|
63
|
-
import "./
|
|
64
|
-
import "./
|
|
65
|
-
import
|
|
66
|
-
import {
|
|
67
|
-
import
|
|
68
|
-
import
|
|
69
|
-
import
|
|
70
|
-
import "./
|
|
71
|
-
import { t as
|
|
72
|
-
import "./
|
|
73
|
-
import "./
|
|
74
|
-
import "./
|
|
75
|
-
import "./
|
|
76
|
-
import "./
|
|
77
|
-
import "./
|
|
78
|
-
import
|
|
79
|
-
import "./
|
|
80
|
-
import
|
|
81
|
-
import
|
|
82
|
-
import "./
|
|
83
|
-
import { t as
|
|
84
|
-
import "./
|
|
85
|
-
import {
|
|
86
|
-
import
|
|
87
|
-
import {
|
|
88
|
-
import
|
|
1
|
+
import { B as normalizeElevatedLevel, H as normalizeThinkLevel, I as formatThinkingLevels, K as supportsXHighThinking, L as formatXHighModelHint, U as normalizeUsageDisplay, V as normalizeReasoningLevel, W as normalizeVerboseLevel } from "./pi-embedded-helpers-BB4uACeq.js";
|
|
2
|
+
import { $n as setTtsEnabled, A as resolveOutboundTarget, An as normalizePollInput, Ar as DEFAULT_INPUT_PDF_MIN_TEXT_CHARS, At as buildControlUiAvatarUrl, B as scheduleGatewaySigusr1Restart, Bn as createInternalHookEvent, Bt as listNodePairing, C as resolveSessionTranscriptCandidates, Cr as DEFAULT_INPUT_FILE_MAX_CHARS, D as resolveOutboundSessionRoute, Dn as onAgentEvent, Dr as DEFAULT_INPUT_MAX_REDIRECTS, E as ensureOutboundSessionEntry, En as getAgentRunContext, Er as DEFAULT_INPUT_IMAGE_MIMES, F as runWithModelFallback, Ft as recordRemoteNodeInfo, Gn as getTtsProvider, Gt as verifyNodeToken, H as consumeRestartSentinel, Hn as triggerInternalHook, Ht as renamePairedNode, In as formatUserTime, Ir as resolveAgentTimeoutMs, It as refreshRemoteBinsForConnectedNodes, J as writeRestartSentinel, Jn as resolveTtsApiKey, Jt as buildSafeExternalPrompt, K as summarizeRestartSentinel, Kn as isTtsEnabled, Kt as getSkillsSnapshotVersion, L as authorizeGatewaySigusr1Restart, Ln as resolveUserTimeFormat, Lt as refreshRemoteNodeBins, Mr as extractFileContentFromSource, Mt as resolveAssistantAvatarUrl, N as resetDirectoryCache, Nr as extractImageContentFromSource, Nt as getRemoteSkillEligibility, On as registerAgentRunContext, Or as DEFAULT_INPUT_PDF_MAX_PAGES, Pn as resolveAgentIdentity, Pr as normalizeMimeList, Pt as primeRemoteSkillsCache, Qn as resolveTtsProviderOrder, R as consumeGatewaySigusr1RestartAuthorization, Rn as resolveUserTimezone, Rt as setSkillsRemoteRegistry, S as readSessionPreviewItemsFromTranscript, Sn as initSubagentRegistry, Sr as DEFAULT_INPUT_FILE_MAX_BYTES, Tn as emitAgentEvent, Tr as DEFAULT_INPUT_IMAGE_MAX_BYTES, U as formatDoctorNonInteractiveHint, Un as OPENAI_TTS_MODELS, Ut as requestNodePairing, V as setGatewaySigusr1RestartPolicy, Vn as registerInternalHook, Vt as rejectNodePairing, W as formatRestartSentinelMessage, Wn as OPENAI_TTS_VOICES, Wt as updatePairedNodeMetadata, X as normalizeCronJobPatch, Xn as resolveTtsConfig, Xt as getHookType, Y as normalizeCronJobCreate, Yn as resolveTtsAutoMode, Yt as detectSuspiciousPatterns, Z as migrateLegacyCronPayload, Zn as resolveTtsPrefsPath, Zt as isExternalHookSession, _ as resolveGatewaySessionStoreTarget, _n as dispatchInboundMessage, _r as parseVerboseOverride, a as normalizeSendPolicy, ar as startDiagnosticHeartbeat, b as capArrayByJsonBytes, bn as isAbortTrigger, c as runEmbeddedPiAgent, cr as DEFAULT_HEARTBEAT_ACK_MAX_CHARS, d as createOpenClawTools, er as setTtsProvider, et as requestHeartbeatNow, f as resolveAnnounceTargetFromKey, fr as stripHeartbeatToken, g as loadSessionEntry, gr as applyVerboseOverride, h as loadCombinedSessionStoreForGateway, hr as applyModelOverrideToSessionEntry, i as runCliAgent, in as registerUnhandledRejectionHandler, ir as CommandLane, it as loadProviderUsageSummary, j as resolveSessionDeliveryTarget, jr as DEFAULT_INPUT_TIMEOUT_MS, jt as normalizeControlUiBasePath, kr as DEFAULT_INPUT_PDF_MAX_PIXELS, kt as CONTROL_UI_AVATAR_PREFIX, l as abortEmbeddedPiRun, ln as getLastHeartbeatEvent, lt as handleSlackHttpRequest, m as listSessionsFromStore, mn as getChannelActivity, n as getCliSessionId, nn as normalizeGroupActivation, nt as getPluginToolMeta, o as resolveSendPolicy, on as buildHistoryContextFromEntries, or as stopDiagnosticHeartbeat, p as listAgentsForGateway, pr as lookupContextTokens, qn as isTtsProviderConfigured, qt as registerSkillsChangeListener, r as setCliSessionId, rr as setCommandLaneConcurrency, rt as loadOpenClawPlugins, s as clearSessionQueues, sn as resolveHeartbeatVisibility, sr as isDiagnosticsEnabled, tn as createReplyPrefixOptions, tr as textToSpeech, u as waitForEmbeddedPiRunEnd, un as onHeartbeatEvent, v as resolveSessionModelRef, vn as createReplyDispatcher, vr as enqueueSystemEvent, vt as handleReset, w as stripEnvelopeFromMessages, wn as clearAgentRunContext, wr as DEFAULT_INPUT_FILE_MIMES, x as readSessionMessages, xn as stopSubagentsForRequester, xr as loadModelCatalog, y as archiveFileOnDisk, yn as formatZonedTimestamp, yr as isSystemEventContextChanged, z as isGatewaySigusr1RestartExternallyAllowed, zn as clearInternalHooks, zt as approveNodePairing } from "./reply-B8pOiUNN.js";
|
|
3
|
+
import { 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-scjhy7N2.js";
|
|
4
|
+
import { _ as parseAgentSessionKey, c as normalizeAgentId, g as isSubagentSessionKey, i as buildAgentMainSessionKey, l as normalizeMainKey, p as toAgentRequestSessionKey, t as DEFAULT_ACCOUNT_ID, u as resolveAgentIdFromSessionKey } from "./session-key-Dm2EOhrH.js";
|
|
5
|
+
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-CAq3uyo7.js";
|
|
6
|
+
import { _ as shortenHomePath, h as resolveUserPath, s as ensureDir, t as CONFIG_DIR, x as truncateUtf16Safe } from "./utils-CKSrBNwq.js";
|
|
7
|
+
import { a as logDebug, c as logWarn, n as runExec, t as runCommandWithTimeout } from "./exec-HEWTMJ7j.js";
|
|
8
|
+
import { t as resolveOpenClawPackageRoot } from "./openclaw-root-Cvotktkd.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-CMs5Y7l-.js";
|
|
10
|
+
import { a as isCliProvider, bt as DEFAULT_PROVIDER, d as resolveConfiguredModelRef, f as resolveDefaultModelForAgent, h as resolveThinkingDefault, i as getModelRefStatus, l as resolveAllowedModelRef, p as resolveHooksGmailModel, vt as DEFAULT_CONTEXT_TOKENS, yt as DEFAULT_MODEL } from "./model-selection-DMUrNhQP.js";
|
|
11
|
+
import "./github-copilot-token-pGSmVaW-.js";
|
|
12
|
+
import { t as formatCliCommand } from "./command-format-ChfKqObn.js";
|
|
13
|
+
import "./boolean-BgXe2hyu.js";
|
|
14
|
+
import { n as logAcceptedEnvOption, t as isTruthyEnvValue } from "./env-0_mKbEWW.js";
|
|
15
|
+
import { A as resolveSubagentMaxConcurrent, T as applyLegacyMigrations, a as parseConfigJson5, c as writeConfigFile, i as loadConfig, j as VERSION, k as resolveAgentMaxConcurrent, l as validateConfigObjectWithPlugins, n as migrateLegacyConfig, o as readConfigFileSnapshot, r as createConfigIO, s as resolveConfigSnapshotHash, u as OpenClawSchema } from "./config-CAuZ-EkU.js";
|
|
16
|
+
import { o as isTestDefaultMemorySlotDisabled } from "./manifest-registry-DHaa1SJb.js";
|
|
17
|
+
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-BYIWo0Cp.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-CV8VwPij.js";
|
|
19
|
+
import "./image-Ca_PtqY7.js";
|
|
20
|
+
import "./pi-model-discovery-CV2V1HHz.js";
|
|
21
|
+
import { T as formatErrorMessage, d as inspectPortUsage, l as ensurePortAvailable, p as formatPortDiagnostics } from "./chrome-BNSd7Bie.js";
|
|
22
|
+
import { d as hasBinary, i as loadWorkspaceSkillEntries, r as buildWorkspaceSkillSnapshot } from "./skills-D5JDj3TR.js";
|
|
23
|
+
import { c as saveMediaBuffer, l as detectMime } from "./routes-DchZU3EK.js";
|
|
24
|
+
import "./server-context-vChIAqjH.js";
|
|
25
|
+
import { t as rawDataToString } from "./ws-CEcdsnN9.js";
|
|
26
|
+
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-Bpfe5l5f.js";
|
|
27
|
+
import "./logging-BWRYHvLp.js";
|
|
28
|
+
import "./accounts-BgZmhIm6.js";
|
|
29
|
+
import { n as resolveSessionFilePath, o as resolveStorePath, r as resolveSessionTranscriptPath } from "./paths-Bb0nwPeu.js";
|
|
30
|
+
import "./redact-DJCFY628.js";
|
|
31
|
+
import "./tool-display-BxZG0o1b.js";
|
|
32
|
+
import { o as normalizeReplyPayloadsForDelivery, t as deliverOutboundPayloads } from "./deliver-C3bnXkg5.js";
|
|
33
|
+
import { i as getMachineDisplayName, t as createBrowserRouteDispatcher } from "./dispatcher-6oI-H42S.js";
|
|
34
|
+
import "./manager-LpytrxUw.js";
|
|
35
|
+
import "./sqlite-BKl1HJFe.js";
|
|
36
|
+
import "./channel-summary-DUiKDBLv.js";
|
|
37
|
+
import { $ as validatePollParams, A as validateDevicePairListParams, At as deriveDeviceIdFromPublicKey, B as validateLogsTailParams, C as validateCronListParams, Ct as PROTOCOL_VERSION, D as validateCronStatusParams, Dt as parseSessionLabel, E as validateCronRunsParams, F as validateExecApprovalResolveParams, G as validateNodeInvokeResultParams, H as validateNodeDescribeParams, I as validateExecApprovalsGetParams, J as validateNodePairListParams, K as validateNodeListParams, L as validateExecApprovalsNodeGetParams, M as validateDeviceTokenRevokeParams, Mt as normalizeDevicePublicKeyBase64Url, N as validateDeviceTokenRotateParams, Nt as verifyDeviceSignature, O as validateCronUpdateParams, Ot as buildDeviceAuthPayload, P as validateExecApprovalRequestParams, Q as validateNodeRenameParams, R as validateExecApprovalsNodeSetParams, S as validateCronAddParams, St as validateWizardStatusParams, T as validateCronRunParams, Tt as errorShape, U as validateNodeEventParams, V as validateModelsListParams, W as validateNodeInvokeParams, X as validateNodePairRequestParams, Y as validateNodePairRejectParams, Z as validateNodePairVerifyParams, _ as validateConfigGetParams, _t as validateWebLoginStartParams, a as validateAgentWaitParams, at as validateSessionsPatchParams, b as validateConfigSetParams, bt as validateWizardNextParams, c as validateAgentsFilesSetParams, ct as validateSessionsResolveParams, d as validateChannelsStatusParams, dt as validateSkillsInstallParams, et as validateRequestFrame, f as validateChatAbortParams, ft as validateSkillsStatusParams, g as validateConfigApplyParams, gt as validateWakeParams, h as validateChatSendParams, ht as validateUpdateRunParams, i as validateAgentParams, it as validateSessionsListParams, j as validateDevicePairRejectParams, k as validateDevicePairApproveParams, l as validateAgentsListParams, lt as validateSessionsUsageParams, m as validateChatInjectParams, mt as validateTalkModeParams, n as formatValidationErrors, nt as validateSessionsCompactParams, o as validateAgentsFilesGetParams, ot as validateSessionsPreviewParams, p as validateChatHistoryParams, pt as validateSkillsUpdateParams, q as validateNodePairApproveParams, r as validateAgentIdentityParams, rt as validateSessionsDeleteParams, s as validateAgentsFilesListParams, st as validateSessionsResetParams, tt as validateSendParams, u as validateChannelsLogoutParams, ut as validateSkillsBinsParams, v as validateConfigPatchParams, vt as validateWebLoginWaitParams, w as validateCronRemoveParams, wt as ErrorCodes, x as validateConnectParams, xt as validateWizardStartParams, y as validateConfigSchemaParams, yt as validateWizardCancelParams, z as validateExecApprovalsSetParams } from "./client-BYVbRnuQ.js";
|
|
38
|
+
import { n as pickPrimaryTailnetIPv6, t as pickPrimaryTailnetIPv4 } from "./tailnet-DLDGNuH2.js";
|
|
39
|
+
import { n as callGateway, o as loadGatewayTlsRuntime$1 } from "./call-BTbA5OB4.js";
|
|
40
|
+
import "./login-qr-BIlr0vwe.js";
|
|
41
|
+
import "./pairing-store-DFq7WtOv.js";
|
|
42
|
+
import { t as formatDocsLink } from "./links-B5pRdmo1.js";
|
|
43
|
+
import { r as runCommandWithRuntime } from "./cli-utils-BkRQdAoC.js";
|
|
44
|
+
import { n as withProgress } from "./progress-xpLtQsNY.js";
|
|
45
|
+
import { a as resolveSubagentToolPolicy, i as resolveGroupToolPolicy, r as resolveEffectiveToolPolicy, t as filterToolsByPolicy } from "./pi-tools.policy-BQ8N5y8a.js";
|
|
46
|
+
import "./prompt-style-vzh0MGHs.js";
|
|
47
|
+
import "./pairing-labels-CtqLxbG6.js";
|
|
48
|
+
import { i as loadSessionUsageTimeSeries, l as hasNonzeroUsage, n as loadCostUsageSummary, r as loadSessionCostSummary, t as discoverAllSessions } from "./session-cost-usage-CBP4Hv9D.js";
|
|
49
|
+
import { n as formatTokenCount, r as formatUsd } from "./usage-format-DvowRSs-.js";
|
|
50
|
+
import { c as normalizeExecApprovals, g as saveExecApprovals, l as readExecApprovalsSnapshot, m as resolveExecApprovalsSocketPath, r as ensureExecApprovals } from "./exec-approvals-DZixgolZ.js";
|
|
51
|
+
import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-CS61Road.js";
|
|
52
|
+
import { t as parseAbsoluteTimeMs } from "./parse-BZz5lHzQ.js";
|
|
53
|
+
import { n as resolveMessageChannelSelection } from "./channel-selection-CJWYmCLf.js";
|
|
54
|
+
import { n as createOutboundSendDeps, t as createDefaultDeps } from "./deps-BG1LonF6.js";
|
|
55
|
+
import { i as enableTailscaleServe, n as disableTailscaleServe, o as getTailnetHostname, r as enableTailscaleFunnel, t as disableTailscaleFunnel } from "./tailscale-BVGD9gSD.js";
|
|
56
|
+
import { t as ensureOpenClawCliOnPath } from "./path-env-DP3DsVge.js";
|
|
57
|
+
import "./daemon-runtime-DMd0mgTK.js";
|
|
58
|
+
import { c as loadAgentIdentity, d as loadAgentIdentityFromWorkspace, p as forceFreePortAndWait, r as getStatusSummary, t as runOnboardingWizard } from "./onboarding-BP4-5uzE.js";
|
|
59
|
+
import { t as resolveChannelDefaultAccountId } from "./helpers-BIc7L8EF.js";
|
|
60
|
+
import "./logging-TXWhN8jG.js";
|
|
61
|
+
import "./note-B5HnoeZX.js";
|
|
62
|
+
import { t as WizardCancelledError } from "./prompts-FbZThK8w.js";
|
|
63
|
+
import { i as discoverGatewayBeacons, n as installSkill } from "./onboard-skills-s8J5xbUr.js";
|
|
64
|
+
import "./github-copilot-auth-C8Uf0Q03.js";
|
|
65
|
+
import "./onboard-channels-DKT27PdN.js";
|
|
66
|
+
import { r as buildChannelUiCatalog, t as applyPluginAutoEnable } from "./plugin-auto-enable-Ci7TBlH2.js";
|
|
67
|
+
import "./archive-Dy3Ezb-5.js";
|
|
68
|
+
import "./skill-scanner-BoGjHXUZ.js";
|
|
69
|
+
import "./installs-BhEjOqPy.js";
|
|
70
|
+
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-B3eStY5r.js";
|
|
71
|
+
import { S as normalizeUpdateChannel, _ as resolveNpmChannelTag, h as compareSemverStrings, m as checkUpdateStatus, t as runGatewayUpdate, y as DEFAULT_PACKAGE_CHANNEL } from "./update-runner-BDdk_K2S.js";
|
|
72
|
+
import { a as resolveGatewayBindHost, n as isLoopbackHost$2, o as resolveGatewayClientIp, r as isTrustedProxyAddress, s as resolveGatewayListenHosts, t as isLoopbackAddress } from "./net-C8YRVt16.js";
|
|
73
|
+
import { i as resolveGatewayAuth, n as authorizeGatewayConnect, r as isLocalDirectRequest, t as assertGatewayAuthConfigured } from "./auth-CbhB03Rz.js";
|
|
74
|
+
import { i as probeGateway } from "./audit-ZY6Dk5Ec.js";
|
|
75
|
+
import "./table-CLtGjVsx.js";
|
|
76
|
+
import { t as buildWorkspaceSkillStatus } from "./skills-status-CEvVUD3U.js";
|
|
77
|
+
import "./service-BZesBIaG.js";
|
|
78
|
+
import "./systemd-B-3NdMmA.js";
|
|
79
|
+
import "./service-audit-C-IA4omi.js";
|
|
80
|
+
import "./node-service-BAYHx0E7.js";
|
|
81
|
+
import "./channels-status-issues-CrS1r5sr.js";
|
|
82
|
+
import "./completion-cli-BPIeQDFy.js";
|
|
83
|
+
import { a as createOutboundSendDeps$1, i as resolveAgentOutboundTarget, r as resolveAgentDeliveryPlan, t as agentCommand } from "./agent-_H-0rbHV.js";
|
|
84
|
+
import { n as resolveWideAreaDiscoveryDomain, r as writeWideAreaGatewayZone } from "./widearea-dns-D9Al4QRv.js";
|
|
85
|
+
import { i as shouldIncludeHook, n as loadWorkspaceHookEntries, r as resolveHookConfig } from "./hooks-status-DepPyfBb.js";
|
|
86
|
+
import "./tui-XH6_v0qC.js";
|
|
87
|
+
import { t as buildChannelAccountSnapshot } from "./status-tCu4RWZH.js";
|
|
88
|
+
import "./shared-BmtNKsPq.js";
|
|
89
|
+
import { a as runDaemonStop, i as runDaemonStart, n as runDaemonStatus, o as runDaemonUninstall, r as runDaemonRestart, s as runDaemonInstall } from "./daemon-cli-B6aLZ8OE.js";
|
|
90
|
+
import { a as toOptionString, i as parsePort$1, n as extractGatewayMiskeys, r as maybeExplainGatewayServiceStop, t as describeUnknownError } from "./shared-C8_5pNbb.js";
|
|
91
|
+
import { i as setGatewayWsLogStyle, n as logWs, r as summarizeAgentEventForWsLog, t as formatForLog } from "./ws-log-B7UNLFLC.js";
|
|
92
|
+
import { T as resolveGmailHookRuntimeConfig, _ as buildGogWatchServeArgs, i as ensureTailscaleEndpoint, v as buildGogWatchStartArgs } from "./gmail-setup-utils-QpN7TEXS.js";
|
|
89
93
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
90
94
|
import os from "node:os";
|
|
91
95
|
import path from "node:path";
|
|
@@ -1964,7 +1968,48 @@ function createChatRunState() {
|
|
|
1964
1968
|
clear
|
|
1965
1969
|
};
|
|
1966
1970
|
}
|
|
1967
|
-
|
|
1971
|
+
const TOOL_EVENT_RECIPIENT_TTL_MS = 600 * 1e3;
|
|
1972
|
+
const TOOL_EVENT_RECIPIENT_FINAL_GRACE_MS = 30 * 1e3;
|
|
1973
|
+
function createToolEventRecipientRegistry() {
|
|
1974
|
+
const recipients = /* @__PURE__ */ new Map();
|
|
1975
|
+
const prune = () => {
|
|
1976
|
+
if (recipients.size === 0) return;
|
|
1977
|
+
const now = Date.now();
|
|
1978
|
+
for (const [runId, entry] of recipients) if (now >= (entry.finalizedAt ? entry.finalizedAt + TOOL_EVENT_RECIPIENT_FINAL_GRACE_MS : entry.updatedAt + TOOL_EVENT_RECIPIENT_TTL_MS)) recipients.delete(runId);
|
|
1979
|
+
};
|
|
1980
|
+
const add = (runId, connId) => {
|
|
1981
|
+
if (!runId || !connId) return;
|
|
1982
|
+
const now = Date.now();
|
|
1983
|
+
const existing = recipients.get(runId);
|
|
1984
|
+
if (existing) {
|
|
1985
|
+
existing.connIds.add(connId);
|
|
1986
|
+
existing.updatedAt = now;
|
|
1987
|
+
} else recipients.set(runId, {
|
|
1988
|
+
connIds: new Set([connId]),
|
|
1989
|
+
updatedAt: now
|
|
1990
|
+
});
|
|
1991
|
+
prune();
|
|
1992
|
+
};
|
|
1993
|
+
const get = (runId) => {
|
|
1994
|
+
const entry = recipients.get(runId);
|
|
1995
|
+
if (!entry) return;
|
|
1996
|
+
entry.updatedAt = Date.now();
|
|
1997
|
+
prune();
|
|
1998
|
+
return entry.connIds;
|
|
1999
|
+
};
|
|
2000
|
+
const markFinal = (runId) => {
|
|
2001
|
+
const entry = recipients.get(runId);
|
|
2002
|
+
if (!entry) return;
|
|
2003
|
+
entry.finalizedAt = Date.now();
|
|
2004
|
+
prune();
|
|
2005
|
+
};
|
|
2006
|
+
return {
|
|
2007
|
+
add,
|
|
2008
|
+
get,
|
|
2009
|
+
markFinal
|
|
2010
|
+
};
|
|
2011
|
+
}
|
|
2012
|
+
function createAgentEventHandler({ broadcast, broadcastToConnIds, nodeSendToSession, agentRunSeq, chatRunState, resolveSessionKeyForRun, clearAgentRunContext, toolEventRecipients }) {
|
|
1968
2013
|
const emitChatDelta = (sessionKey, clientRunId, seq, text) => {
|
|
1969
2014
|
chatRunState.buffers.set(clientRunId, text);
|
|
1970
2015
|
const now = Date.now();
|
|
@@ -2020,17 +2065,17 @@ function createAgentEventHandler({ broadcast, nodeSendToSession, agentRunSeq, ch
|
|
|
2020
2065
|
broadcast("chat", payload);
|
|
2021
2066
|
nodeSendToSession(sessionKey, "chat", payload);
|
|
2022
2067
|
};
|
|
2023
|
-
const
|
|
2068
|
+
const resolveToolVerboseLevel = (runId, sessionKey) => {
|
|
2024
2069
|
const runVerbose = normalizeVerboseLevel(getAgentRunContext(runId)?.verboseLevel);
|
|
2025
|
-
if (runVerbose) return runVerbose
|
|
2026
|
-
if (!sessionKey) return
|
|
2070
|
+
if (runVerbose) return runVerbose;
|
|
2071
|
+
if (!sessionKey) return "off";
|
|
2027
2072
|
try {
|
|
2028
2073
|
const { cfg, entry } = loadSessionEntry(sessionKey);
|
|
2029
2074
|
const sessionVerbose = normalizeVerboseLevel(entry?.verboseLevel);
|
|
2030
|
-
if (sessionVerbose) return sessionVerbose
|
|
2031
|
-
return normalizeVerboseLevel(cfg.agents?.defaults?.verboseDefault)
|
|
2075
|
+
if (sessionVerbose) return sessionVerbose;
|
|
2076
|
+
return normalizeVerboseLevel(cfg.agents?.defaults?.verboseDefault) ?? "off";
|
|
2032
2077
|
} catch {
|
|
2033
|
-
return
|
|
2078
|
+
return "off";
|
|
2034
2079
|
}
|
|
2035
2080
|
};
|
|
2036
2081
|
return (evt) => {
|
|
@@ -2043,10 +2088,25 @@ function createAgentEventHandler({ broadcast, nodeSendToSession, agentRunSeq, ch
|
|
|
2043
2088
|
sessionKey
|
|
2044
2089
|
} : evt;
|
|
2045
2090
|
const last = agentRunSeq.get(evt.runId) ?? 0;
|
|
2046
|
-
|
|
2091
|
+
const isToolEvent = evt.stream === "tool";
|
|
2092
|
+
const toolVerbose = isToolEvent ? resolveToolVerboseLevel(evt.runId, sessionKey) : "off";
|
|
2093
|
+
if (isToolEvent && toolVerbose === "off") {
|
|
2047
2094
|
agentRunSeq.set(evt.runId, evt.seq);
|
|
2048
2095
|
return;
|
|
2049
2096
|
}
|
|
2097
|
+
const toolPayload = isToolEvent && toolVerbose !== "full" ? (() => {
|
|
2098
|
+
const data = evt.data ? { ...evt.data } : {};
|
|
2099
|
+
delete data.result;
|
|
2100
|
+
delete data.partialResult;
|
|
2101
|
+
return sessionKey ? {
|
|
2102
|
+
...evt,
|
|
2103
|
+
sessionKey,
|
|
2104
|
+
data
|
|
2105
|
+
} : {
|
|
2106
|
+
...evt,
|
|
2107
|
+
data
|
|
2108
|
+
};
|
|
2109
|
+
})() : agentPayload;
|
|
2050
2110
|
if (evt.seq !== last + 1) broadcast("agent", {
|
|
2051
2111
|
runId: evt.runId,
|
|
2052
2112
|
stream: "error",
|
|
@@ -2059,10 +2119,13 @@ function createAgentEventHandler({ broadcast, nodeSendToSession, agentRunSeq, ch
|
|
|
2059
2119
|
}
|
|
2060
2120
|
});
|
|
2061
2121
|
agentRunSeq.set(evt.runId, evt.seq);
|
|
2062
|
-
|
|
2122
|
+
if (isToolEvent) {
|
|
2123
|
+
const recipients = toolEventRecipients.get(evt.runId);
|
|
2124
|
+
if (recipients && recipients.size > 0) broadcastToConnIds("agent", toolPayload, recipients);
|
|
2125
|
+
} else broadcast("agent", agentPayload);
|
|
2063
2126
|
const lifecyclePhase = evt.stream === "lifecycle" && typeof evt.data?.phase === "string" ? evt.data.phase : null;
|
|
2064
2127
|
if (sessionKey) {
|
|
2065
|
-
nodeSendToSession(sessionKey, "agent", agentPayload);
|
|
2128
|
+
nodeSendToSession(sessionKey, "agent", isToolEvent ? toolPayload : agentPayload);
|
|
2066
2129
|
if (!isAborted && evt.stream === "assistant" && typeof evt.data?.text === "string") emitChatDelta(sessionKey, clientRunId, evt.seq, evt.data.text);
|
|
2067
2130
|
else if (!isAborted && (lifecyclePhase === "end" || lifecyclePhase === "error")) if (chatLink) {
|
|
2068
2131
|
const finished = chatRunState.registry.shift(evt.runId);
|
|
@@ -2080,7 +2143,10 @@ function createAgentEventHandler({ broadcast, nodeSendToSession, agentRunSeq, ch
|
|
|
2080
2143
|
if (chatLink) chatRunState.registry.remove(evt.runId, clientRunId, sessionKey);
|
|
2081
2144
|
}
|
|
2082
2145
|
}
|
|
2083
|
-
if (lifecyclePhase === "end" || lifecyclePhase === "error")
|
|
2146
|
+
if (lifecyclePhase === "end" || lifecyclePhase === "error") {
|
|
2147
|
+
toolEventRecipients.markFinal(evt.runId);
|
|
2148
|
+
clearAgentRunContext(evt.runId);
|
|
2149
|
+
}
|
|
2084
2150
|
};
|
|
2085
2151
|
}
|
|
2086
2152
|
|
|
@@ -2580,7 +2646,10 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2580
2646
|
model,
|
|
2581
2647
|
catalog: await loadCatalog()
|
|
2582
2648
|
});
|
|
2583
|
-
if (thinkLevel === "xhigh" && !supportsXHighThinking(provider, model))
|
|
2649
|
+
if (thinkLevel === "xhigh" && !supportsXHighThinking(provider, model)) {
|
|
2650
|
+
logWarn(`[cron:${params.job.id}] Thinking level "xhigh" is not supported for ${provider}/${model}; downgrading to "high".`);
|
|
2651
|
+
thinkLevel = "high";
|
|
2652
|
+
}
|
|
2584
2653
|
const timeoutMs = resolveAgentTimeoutMs({
|
|
2585
2654
|
cfg: cfgWithAgentDefaults,
|
|
2586
2655
|
overrideSeconds: params.job.payload.kind === "agentTurn" ? params.job.payload.timeoutSeconds : void 0
|
|
@@ -2857,7 +2926,8 @@ async function readCronRunLogEntries(filePath, opts) {
|
|
|
2857
2926
|
//#region src/cron/schedule.ts
|
|
2858
2927
|
function computeNextRunAtMs(schedule, nowMs) {
|
|
2859
2928
|
if (schedule.kind === "at") {
|
|
2860
|
-
const
|
|
2929
|
+
const sched = schedule;
|
|
2930
|
+
const atMs = typeof sched.atMs === "number" && Number.isFinite(sched.atMs) && sched.atMs > 0 ? sched.atMs : typeof sched.atMs === "string" ? parseAbsoluteTimeMs(sched.atMs) : typeof sched.at === "string" ? parseAbsoluteTimeMs(sched.at) : null;
|
|
2861
2931
|
if (atMs === null) return;
|
|
2862
2932
|
return atMs > nowMs ? atMs : void 0;
|
|
2863
2933
|
}
|
|
@@ -2933,7 +3003,8 @@ function computeJobNextRunAtMs(job, nowMs) {
|
|
|
2933
3003
|
if (!job.enabled) return;
|
|
2934
3004
|
if (job.schedule.kind === "at") {
|
|
2935
3005
|
if (job.state.lastStatus === "ok" && job.state.lastRunAtMs) return;
|
|
2936
|
-
const
|
|
3006
|
+
const schedule = job.schedule;
|
|
3007
|
+
const atMs = typeof schedule.atMs === "number" && Number.isFinite(schedule.atMs) && schedule.atMs > 0 ? schedule.atMs : typeof schedule.atMs === "string" ? parseAbsoluteTimeMs(schedule.atMs) : typeof schedule.at === "string" ? parseAbsoluteTimeMs(schedule.at) : null;
|
|
2937
3008
|
return atMs !== null ? atMs : void 0;
|
|
2938
3009
|
}
|
|
2939
3010
|
return computeNextRunAtMs(job.schedule, nowMs);
|
|
@@ -3253,10 +3324,6 @@ async function getFileMtimeMs(path) {
|
|
|
3253
3324
|
}
|
|
3254
3325
|
async function ensureLoaded(state, opts) {
|
|
3255
3326
|
if (state.store && !opts?.forceReload) return;
|
|
3256
|
-
if (opts?.forceReload && state.store) {
|
|
3257
|
-
const mtime = await getFileMtimeMs(state.deps.storePath);
|
|
3258
|
-
if (mtime !== null && state.storeFileMtimeMs !== null && mtime === state.storeFileMtimeMs) return;
|
|
3259
|
-
}
|
|
3260
3327
|
const fileMtimeMs = await getFileMtimeMs(state.deps.storePath);
|
|
3261
3328
|
const jobs = (await loadCronStore(state.deps.storePath)).jobs ?? [];
|
|
3262
3329
|
let mutated = false;
|
|
@@ -3343,7 +3410,7 @@ async function ensureLoaded(state, opts) {
|
|
|
3343
3410
|
};
|
|
3344
3411
|
state.storeLoadedAtMs = state.deps.nowMs();
|
|
3345
3412
|
state.storeFileMtimeMs = fileMtimeMs;
|
|
3346
|
-
recomputeNextRuns(state);
|
|
3413
|
+
if (!opts?.skipRecompute) recomputeNextRuns(state);
|
|
3347
3414
|
if (mutated) await persist(state);
|
|
3348
3415
|
}
|
|
3349
3416
|
function warnIfDisabled(state, action) {
|
|
@@ -3378,20 +3445,23 @@ function armTimer(state) {
|
|
|
3378
3445
|
state.deps.log.error({ err: String(err) }, "cron: timer tick failed");
|
|
3379
3446
|
});
|
|
3380
3447
|
}, clampedDelay);
|
|
3381
|
-
state.timer.unref?.();
|
|
3382
3448
|
}
|
|
3383
3449
|
async function onTimer(state) {
|
|
3384
3450
|
if (state.running) return;
|
|
3385
3451
|
state.running = true;
|
|
3386
3452
|
try {
|
|
3387
3453
|
await locked(state, async () => {
|
|
3388
|
-
await ensureLoaded(state, {
|
|
3454
|
+
await ensureLoaded(state, {
|
|
3455
|
+
forceReload: true,
|
|
3456
|
+
skipRecompute: true
|
|
3457
|
+
});
|
|
3389
3458
|
await runDueJobs(state);
|
|
3459
|
+
recomputeNextRuns(state);
|
|
3390
3460
|
await persist(state);
|
|
3391
|
-
armTimer(state);
|
|
3392
3461
|
});
|
|
3393
3462
|
} finally {
|
|
3394
3463
|
state.running = false;
|
|
3464
|
+
armTimer(state);
|
|
3395
3465
|
}
|
|
3396
3466
|
}
|
|
3397
3467
|
async function runDueJobs(state) {
|
|
@@ -4934,7 +5004,7 @@ function timestampOptsFromConfig(cfg) {
|
|
|
4934
5004
|
//#endregion
|
|
4935
5005
|
//#region src/gateway/server-methods/agent.ts
|
|
4936
5006
|
const agentHandlers = {
|
|
4937
|
-
agent: async ({ params, respond, context }) => {
|
|
5007
|
+
agent: async ({ params, respond, context, client }) => {
|
|
4938
5008
|
const p = params;
|
|
4939
5009
|
if (!validateAgentParams(p)) {
|
|
4940
5010
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid agent params: ${formatValidationErrors(validateAgentParams.errors)}`));
|
|
@@ -5084,6 +5154,9 @@ const agentHandlers = {
|
|
|
5084
5154
|
registerAgentRunContext(idem, { sessionKey: requestedSessionKey });
|
|
5085
5155
|
}
|
|
5086
5156
|
const runId = idem;
|
|
5157
|
+
const connId = typeof client?.connId === "string" ? client.connId : void 0;
|
|
5158
|
+
const wantsToolEvents = hasGatewayClientCap(client?.connect?.caps, GATEWAY_CLIENT_CAPS.TOOL_EVENTS);
|
|
5159
|
+
if (connId && wantsToolEvents) context.registerToolEventRecipient(runId, connId);
|
|
5087
5160
|
const wantsDelivery = request.deliver === true;
|
|
5088
5161
|
const explicitTo = typeof request.replyTo === "string" && request.replyTo.trim() ? request.replyTo.trim() : typeof request.to === "string" && request.to.trim() ? request.to.trim() : void 0;
|
|
5089
5162
|
const explicitThreadId = typeof request.threadId === "string" && request.threadId.trim() ? request.threadId.trim() : void 0;
|
|
@@ -6038,7 +6111,10 @@ const chatHandlers = {
|
|
|
6038
6111
|
const configured = cfg.agents?.defaults?.thinkingDefault;
|
|
6039
6112
|
if (configured) thinkingLevel = configured;
|
|
6040
6113
|
else {
|
|
6041
|
-
const { provider, model } = resolveSessionModelRef(cfg, entry
|
|
6114
|
+
const { provider, model } = resolveSessionModelRef(cfg, entry, resolveSessionAgentId({
|
|
6115
|
+
sessionKey,
|
|
6116
|
+
config: cfg
|
|
6117
|
+
}));
|
|
6042
6118
|
thinkingLevel = resolveThinkingDefault({
|
|
6043
6119
|
cfg,
|
|
6044
6120
|
provider,
|
|
@@ -6047,11 +6123,13 @@ const chatHandlers = {
|
|
|
6047
6123
|
});
|
|
6048
6124
|
}
|
|
6049
6125
|
}
|
|
6126
|
+
const verboseLevel = entry?.verboseLevel ?? cfg.agents?.defaults?.verboseDefault;
|
|
6050
6127
|
respond(true, {
|
|
6051
6128
|
sessionKey,
|
|
6052
6129
|
sessionId,
|
|
6053
6130
|
messages: capped,
|
|
6054
|
-
thinkingLevel
|
|
6131
|
+
thinkingLevel,
|
|
6132
|
+
verboseLevel
|
|
6055
6133
|
});
|
|
6056
6134
|
},
|
|
6057
6135
|
"chat.abort": ({ params, respond, context }) => {
|
|
@@ -6227,15 +6305,17 @@ const chatHandlers = {
|
|
|
6227
6305
|
SenderUsername: clientInfo?.displayName,
|
|
6228
6306
|
GatewayClientScopes: client?.connect?.scopes
|
|
6229
6307
|
};
|
|
6230
|
-
const
|
|
6231
|
-
|
|
6232
|
-
|
|
6308
|
+
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
6309
|
+
cfg,
|
|
6310
|
+
agentId: resolveSessionAgentId({
|
|
6311
|
+
sessionKey: p.sessionKey,
|
|
6312
|
+
config: cfg
|
|
6313
|
+
}),
|
|
6314
|
+
channel: INTERNAL_MESSAGE_CHANNEL
|
|
6233
6315
|
});
|
|
6234
|
-
let prefixContext = { identityName: resolveIdentityName(cfg, agentId) };
|
|
6235
6316
|
const finalReplyParts = [];
|
|
6236
6317
|
const dispatcher = createReplyDispatcher({
|
|
6237
|
-
|
|
6238
|
-
responsePrefixContextProvider: () => prefixContext,
|
|
6318
|
+
...prefixOptions,
|
|
6239
6319
|
onError: (err) => {
|
|
6240
6320
|
context.logGateway.warn(`webchat dispatch failed: ${formatForLog(err)}`);
|
|
6241
6321
|
},
|
|
@@ -6256,15 +6336,13 @@ const chatHandlers = {
|
|
|
6256
6336
|
abortSignal: abortController.signal,
|
|
6257
6337
|
images: parsedImages.length > 0 ? parsedImages : void 0,
|
|
6258
6338
|
disableBlockStreaming: true,
|
|
6259
|
-
onAgentRunStart: () => {
|
|
6339
|
+
onAgentRunStart: (runId) => {
|
|
6260
6340
|
agentRunStarted = true;
|
|
6341
|
+
const connId = typeof client?.connId === "string" ? client.connId : void 0;
|
|
6342
|
+
const wantsToolEvents = hasGatewayClientCap(client?.connect?.caps, GATEWAY_CLIENT_CAPS.TOOL_EVENTS);
|
|
6343
|
+
if (connId && wantsToolEvents) context.registerToolEventRecipient(runId, connId);
|
|
6261
6344
|
},
|
|
6262
|
-
onModelSelected
|
|
6263
|
-
prefixContext.provider = ctx.provider;
|
|
6264
|
-
prefixContext.model = extractShortModelName(ctx.model);
|
|
6265
|
-
prefixContext.modelFull = `${ctx.provider}/${ctx.model}`;
|
|
6266
|
-
prefixContext.thinkingLevel = ctx.thinkLevel ?? "off";
|
|
6267
|
-
}
|
|
6345
|
+
onModelSelected
|
|
6268
6346
|
}
|
|
6269
6347
|
}).then(() => {
|
|
6270
6348
|
if (!agentRunStarted) {
|
|
@@ -6438,6 +6516,123 @@ function applyMergePatch(base, patch) {
|
|
|
6438
6516
|
return result;
|
|
6439
6517
|
}
|
|
6440
6518
|
|
|
6519
|
+
//#endregion
|
|
6520
|
+
//#region src/config/redact-snapshot.ts
|
|
6521
|
+
/**
|
|
6522
|
+
* Sentinel value used to replace sensitive config fields in gateway responses.
|
|
6523
|
+
* Write-side handlers (config.set, config.apply, config.patch) detect this
|
|
6524
|
+
* sentinel and restore the original value from the on-disk config, so a
|
|
6525
|
+
* round-trip through the Web UI does not corrupt credentials.
|
|
6526
|
+
*/
|
|
6527
|
+
const REDACTED_SENTINEL = "__OPENCLAW_REDACTED__";
|
|
6528
|
+
/**
|
|
6529
|
+
* Patterns that identify sensitive config field names.
|
|
6530
|
+
* Aligned with the UI-hint logic in schema.ts.
|
|
6531
|
+
*/
|
|
6532
|
+
const SENSITIVE_KEY_PATTERNS = [
|
|
6533
|
+
/token/i,
|
|
6534
|
+
/password/i,
|
|
6535
|
+
/secret/i,
|
|
6536
|
+
/api.?key/i
|
|
6537
|
+
];
|
|
6538
|
+
function isSensitiveKey(key) {
|
|
6539
|
+
return SENSITIVE_KEY_PATTERNS.some((pattern) => pattern.test(key));
|
|
6540
|
+
}
|
|
6541
|
+
/**
|
|
6542
|
+
* Deep-walk an object and replace values whose key matches a sensitive pattern
|
|
6543
|
+
* with the redaction sentinel.
|
|
6544
|
+
*/
|
|
6545
|
+
function redactObject(obj) {
|
|
6546
|
+
if (obj === null || obj === void 0) return obj;
|
|
6547
|
+
if (typeof obj !== "object") return obj;
|
|
6548
|
+
if (Array.isArray(obj)) return obj.map(redactObject);
|
|
6549
|
+
const result = {};
|
|
6550
|
+
for (const [key, value] of Object.entries(obj)) if (isSensitiveKey(key) && value !== null && value !== void 0) result[key] = REDACTED_SENTINEL;
|
|
6551
|
+
else if (typeof value === "object" && value !== null) result[key] = redactObject(value);
|
|
6552
|
+
else result[key] = value;
|
|
6553
|
+
return result;
|
|
6554
|
+
}
|
|
6555
|
+
function redactConfigObject(value) {
|
|
6556
|
+
return redactObject(value);
|
|
6557
|
+
}
|
|
6558
|
+
/**
|
|
6559
|
+
* Collect all sensitive string values from a config object.
|
|
6560
|
+
* Used for text-based redaction of the raw JSON5 source.
|
|
6561
|
+
*/
|
|
6562
|
+
function collectSensitiveValues(obj) {
|
|
6563
|
+
const values = [];
|
|
6564
|
+
if (obj === null || obj === void 0 || typeof obj !== "object") return values;
|
|
6565
|
+
if (Array.isArray(obj)) {
|
|
6566
|
+
for (const item of obj) values.push(...collectSensitiveValues(item));
|
|
6567
|
+
return values;
|
|
6568
|
+
}
|
|
6569
|
+
for (const [key, value] of Object.entries(obj)) if (isSensitiveKey(key) && typeof value === "string" && value.length > 0) values.push(value);
|
|
6570
|
+
else if (typeof value === "object" && value !== null) values.push(...collectSensitiveValues(value));
|
|
6571
|
+
return values;
|
|
6572
|
+
}
|
|
6573
|
+
/**
|
|
6574
|
+
* Replace known sensitive values in a raw JSON5 string with the sentinel.
|
|
6575
|
+
* Values are replaced longest-first to avoid partial matches.
|
|
6576
|
+
*/
|
|
6577
|
+
function redactRawText(raw, config) {
|
|
6578
|
+
const sensitiveValues = collectSensitiveValues(config);
|
|
6579
|
+
sensitiveValues.sort((a, b) => b.length - a.length);
|
|
6580
|
+
let result = raw;
|
|
6581
|
+
for (const value of sensitiveValues) {
|
|
6582
|
+
const escaped = value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
6583
|
+
result = result.replace(new RegExp(escaped, "g"), REDACTED_SENTINEL);
|
|
6584
|
+
}
|
|
6585
|
+
result = result.replace(/(^|[{\s,])((["'])([^"']+)\3|([A-Za-z0-9_$.-]+))(\s*:\s*)(["'])([^"']*)\7/g, (match, prefix, keyExpr, _keyQuote, keyQuoted, keyBare, sep, valQuote, val) => {
|
|
6586
|
+
const key = keyQuoted ?? keyBare;
|
|
6587
|
+
if (!key || !isSensitiveKey(key)) return match;
|
|
6588
|
+
if (val === REDACTED_SENTINEL) return match;
|
|
6589
|
+
return `${prefix}${keyExpr}${sep}${valQuote}${REDACTED_SENTINEL}${valQuote}`;
|
|
6590
|
+
});
|
|
6591
|
+
return result;
|
|
6592
|
+
}
|
|
6593
|
+
/**
|
|
6594
|
+
* Returns a copy of the config snapshot with all sensitive fields
|
|
6595
|
+
* replaced by {@link REDACTED_SENTINEL}. The `hash` is preserved
|
|
6596
|
+
* (it tracks config identity, not content).
|
|
6597
|
+
*
|
|
6598
|
+
* Both `config` (the parsed object) and `raw` (the JSON5 source) are scrubbed
|
|
6599
|
+
* so no credential can leak through either path.
|
|
6600
|
+
*/
|
|
6601
|
+
function redactConfigSnapshot(snapshot) {
|
|
6602
|
+
const redactedConfig = redactConfigObject(snapshot.config);
|
|
6603
|
+
const redactedRaw = snapshot.raw ? redactRawText(snapshot.raw, snapshot.config) : null;
|
|
6604
|
+
const redactedParsed = snapshot.parsed ? redactConfigObject(snapshot.parsed) : snapshot.parsed;
|
|
6605
|
+
return {
|
|
6606
|
+
...snapshot,
|
|
6607
|
+
config: redactedConfig,
|
|
6608
|
+
raw: redactedRaw,
|
|
6609
|
+
parsed: redactedParsed
|
|
6610
|
+
};
|
|
6611
|
+
}
|
|
6612
|
+
/**
|
|
6613
|
+
* Deep-walk `incoming` and replace any {@link REDACTED_SENTINEL} values
|
|
6614
|
+
* (on sensitive keys) with the corresponding value from `original`.
|
|
6615
|
+
*
|
|
6616
|
+
* This is called by config.set / config.apply / config.patch before writing,
|
|
6617
|
+
* so that credentials survive a Web UI round-trip unmodified.
|
|
6618
|
+
*/
|
|
6619
|
+
function restoreRedactedValues(incoming, original) {
|
|
6620
|
+
if (incoming === null || incoming === void 0) return incoming;
|
|
6621
|
+
if (typeof incoming !== "object") return incoming;
|
|
6622
|
+
if (Array.isArray(incoming)) {
|
|
6623
|
+
const origArr = Array.isArray(original) ? original : [];
|
|
6624
|
+
return incoming.map((item, i) => restoreRedactedValues(item, origArr[i]));
|
|
6625
|
+
}
|
|
6626
|
+
const orig = original && typeof original === "object" && !Array.isArray(original) ? original : {};
|
|
6627
|
+
const result = {};
|
|
6628
|
+
for (const [key, value] of Object.entries(incoming)) if (isSensitiveKey(key) && value === REDACTED_SENTINEL) {
|
|
6629
|
+
if (!(key in orig)) throw new Error(`config write rejected: "${key}" is redacted; set an explicit value instead of ${REDACTED_SENTINEL}`);
|
|
6630
|
+
result[key] = orig[key];
|
|
6631
|
+
} else if (typeof value === "object" && value !== null) result[key] = restoreRedactedValues(value, orig[key]);
|
|
6632
|
+
else result[key] = value;
|
|
6633
|
+
return result;
|
|
6634
|
+
}
|
|
6635
|
+
|
|
6441
6636
|
//#endregion
|
|
6442
6637
|
//#region src/config/schema.ts
|
|
6443
6638
|
const GROUP_LABELS = {
|
|
@@ -6692,6 +6887,7 @@ const FIELD_LABELS = {
|
|
|
6692
6887
|
"commands.debug": "Allow /debug",
|
|
6693
6888
|
"commands.restart": "Allow Restart",
|
|
6694
6889
|
"commands.useAccessGroups": "Use Access Groups",
|
|
6890
|
+
"commands.ownerAllowFrom": "Command Owners",
|
|
6695
6891
|
"ui.seamColor": "Accent Color",
|
|
6696
6892
|
"ui.assistant.name": "Assistant Name",
|
|
6697
6893
|
"ui.assistant.avatar": "Assistant Avatar",
|
|
@@ -6954,6 +7150,7 @@ const FIELD_HELP = {
|
|
|
6954
7150
|
"commands.debug": "Allow /debug chat command for runtime-only overrides (default: false).",
|
|
6955
7151
|
"commands.restart": "Allow /restart and gateway restart tool actions (default: false).",
|
|
6956
7152
|
"commands.useAccessGroups": "Enforce access-group allowlists/policies for commands.",
|
|
7153
|
+
"commands.ownerAllowFrom": "Explicit owner allowlist for owner-only tools/commands. Use channel-native IDs (optionally prefixed like \"whatsapp:+15551234567\"). '*' is ignored.",
|
|
6957
7154
|
"session.dmScope": "DM session scoping: \"main\" keeps continuity; \"per-peer\", \"per-channel-peer\", or \"per-account-channel-peer\" isolates DM history (recommended for shared inboxes/multi-account).",
|
|
6958
7155
|
"session.identityLinks": "Map canonical identities to provider-prefixed peer IDs for DM session linking (example: telegram:123456).",
|
|
6959
7156
|
"channels.telegram.configWrites": "Allow Telegram to write config in response to channel events/commands (default: true).",
|
|
@@ -7294,7 +7491,7 @@ const configHandlers = {
|
|
|
7294
7491
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid config.get params: ${formatValidationErrors(validateConfigGetParams.errors)}`));
|
|
7295
7492
|
return;
|
|
7296
7493
|
}
|
|
7297
|
-
respond(true, await readConfigFileSnapshot(), void 0);
|
|
7494
|
+
respond(true, redactConfigSnapshot(await readConfigFileSnapshot()), void 0);
|
|
7298
7495
|
},
|
|
7299
7496
|
"config.schema": ({ params, respond }) => {
|
|
7300
7497
|
if (!validateConfigSchemaParams(params)) {
|
|
@@ -7333,7 +7530,8 @@ const configHandlers = {
|
|
|
7333
7530
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid config.set params: ${formatValidationErrors(validateConfigSetParams.errors)}`));
|
|
7334
7531
|
return;
|
|
7335
7532
|
}
|
|
7336
|
-
|
|
7533
|
+
const snapshot = await readConfigFileSnapshot();
|
|
7534
|
+
if (!requireConfigBaseHash(params, snapshot, respond)) return;
|
|
7337
7535
|
const rawValue = params.raw;
|
|
7338
7536
|
if (typeof rawValue !== "string") {
|
|
7339
7537
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config.set params: raw (string) required"));
|
|
@@ -7349,11 +7547,18 @@ const configHandlers = {
|
|
|
7349
7547
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config", { details: { issues: validated.issues } }));
|
|
7350
7548
|
return;
|
|
7351
7549
|
}
|
|
7352
|
-
|
|
7550
|
+
let restored;
|
|
7551
|
+
try {
|
|
7552
|
+
restored = restoreRedactedValues(validated.config, snapshot.config);
|
|
7553
|
+
} catch (err) {
|
|
7554
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, String(err instanceof Error ? err.message : err)));
|
|
7555
|
+
return;
|
|
7556
|
+
}
|
|
7557
|
+
await writeConfigFile(restored);
|
|
7353
7558
|
respond(true, {
|
|
7354
7559
|
ok: true,
|
|
7355
7560
|
path: CONFIG_PATH,
|
|
7356
|
-
config:
|
|
7561
|
+
config: redactConfigObject(restored)
|
|
7357
7562
|
}, void 0);
|
|
7358
7563
|
},
|
|
7359
7564
|
"config.patch": async ({ params, respond }) => {
|
|
@@ -7382,7 +7587,14 @@ const configHandlers = {
|
|
|
7382
7587
|
return;
|
|
7383
7588
|
}
|
|
7384
7589
|
const merged = applyMergePatch(snapshot.config, parsedRes.parsed);
|
|
7385
|
-
|
|
7590
|
+
let restoredMerge;
|
|
7591
|
+
try {
|
|
7592
|
+
restoredMerge = restoreRedactedValues(merged, snapshot.config);
|
|
7593
|
+
} catch (err) {
|
|
7594
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, String(err instanceof Error ? err.message : err)));
|
|
7595
|
+
return;
|
|
7596
|
+
}
|
|
7597
|
+
const validated = validateConfigObjectWithPlugins(applyLegacyMigrations(restoredMerge).next ?? restoredMerge);
|
|
7386
7598
|
if (!validated.ok) {
|
|
7387
7599
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config", { details: { issues: validated.issues } }));
|
|
7388
7600
|
return;
|
|
@@ -7417,7 +7629,7 @@ const configHandlers = {
|
|
|
7417
7629
|
respond(true, {
|
|
7418
7630
|
ok: true,
|
|
7419
7631
|
path: CONFIG_PATH,
|
|
7420
|
-
config: validated.config,
|
|
7632
|
+
config: redactConfigObject(validated.config),
|
|
7421
7633
|
restart,
|
|
7422
7634
|
sentinel: {
|
|
7423
7635
|
path: sentinelPath,
|
|
@@ -7430,7 +7642,8 @@ const configHandlers = {
|
|
|
7430
7642
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid config.apply params: ${formatValidationErrors(validateConfigApplyParams.errors)}`));
|
|
7431
7643
|
return;
|
|
7432
7644
|
}
|
|
7433
|
-
|
|
7645
|
+
const snapshot = await readConfigFileSnapshot();
|
|
7646
|
+
if (!requireConfigBaseHash(params, snapshot, respond)) return;
|
|
7434
7647
|
const rawValue = params.raw;
|
|
7435
7648
|
if (typeof rawValue !== "string") {
|
|
7436
7649
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config.apply params: raw (string) required"));
|
|
@@ -7446,7 +7659,14 @@ const configHandlers = {
|
|
|
7446
7659
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config", { details: { issues: validated.issues } }));
|
|
7447
7660
|
return;
|
|
7448
7661
|
}
|
|
7449
|
-
|
|
7662
|
+
let restoredApply;
|
|
7663
|
+
try {
|
|
7664
|
+
restoredApply = restoreRedactedValues(validated.config, snapshot.config);
|
|
7665
|
+
} catch (err) {
|
|
7666
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, String(err instanceof Error ? err.message : err)));
|
|
7667
|
+
return;
|
|
7668
|
+
}
|
|
7669
|
+
await writeConfigFile(restoredApply);
|
|
7450
7670
|
const sessionKey = typeof params.sessionKey === "string" ? params.sessionKey?.trim() || void 0 : void 0;
|
|
7451
7671
|
const note = typeof params.note === "string" ? params.note?.trim() || void 0 : void 0;
|
|
7452
7672
|
const restartDelayMsRaw = params.restartDelayMs;
|
|
@@ -7476,7 +7696,7 @@ const configHandlers = {
|
|
|
7476
7696
|
respond(true, {
|
|
7477
7697
|
ok: true,
|
|
7478
7698
|
path: CONFIG_PATH,
|
|
7479
|
-
config:
|
|
7699
|
+
config: redactConfigObject(restoredApply),
|
|
7480
7700
|
restart,
|
|
7481
7701
|
sentinel: {
|
|
7482
7702
|
path: sentinelPath,
|
|
@@ -8776,7 +8996,7 @@ const nodeHandlers = {
|
|
|
8776
8996
|
const p = params;
|
|
8777
8997
|
const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
|
|
8778
8998
|
await respondUnavailableOnThrow(respond, async () => {
|
|
8779
|
-
const { handleNodeEvent } = await import("./server-node-events-
|
|
8999
|
+
const { handleNodeEvent } = await import("./server-node-events-D39FA0NG.js");
|
|
8780
9000
|
const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
|
|
8781
9001
|
await handleNodeEvent({
|
|
8782
9002
|
deps: context.deps,
|
|
@@ -9076,6 +9296,10 @@ function normalizeExecAsk(raw) {
|
|
|
9076
9296
|
async function applySessionsPatchToStore(params) {
|
|
9077
9297
|
const { cfg, store, storeKey, patch } = params;
|
|
9078
9298
|
const now = Date.now();
|
|
9299
|
+
const resolvedDefault = resolveDefaultModelForAgent({
|
|
9300
|
+
cfg,
|
|
9301
|
+
agentId: normalizeAgentId(parseAgentSessionKey(storeKey)?.agentId ?? resolveDefaultAgentId(cfg))
|
|
9302
|
+
});
|
|
9079
9303
|
const existing = store[storeKey];
|
|
9080
9304
|
const next = existing ? {
|
|
9081
9305
|
...existing,
|
|
@@ -9114,14 +9338,7 @@ async function applySessionsPatchToStore(params) {
|
|
|
9114
9338
|
if (raw === null) delete next.thinkingLevel;
|
|
9115
9339
|
else if (raw !== void 0) {
|
|
9116
9340
|
const normalized = normalizeThinkLevel(String(raw));
|
|
9117
|
-
if (!normalized) {
|
|
9118
|
-
const resolvedDefault = resolveConfiguredModelRef({
|
|
9119
|
-
cfg,
|
|
9120
|
-
defaultProvider: DEFAULT_PROVIDER,
|
|
9121
|
-
defaultModel: DEFAULT_MODEL
|
|
9122
|
-
});
|
|
9123
|
-
return invalid(`invalid thinkingLevel (use ${formatThinkingLevels(existing?.providerOverride?.trim() || resolvedDefault.provider, existing?.modelOverride?.trim() || resolvedDefault.model, "|")})`);
|
|
9124
|
-
}
|
|
9341
|
+
if (!normalized) return invalid(`invalid thinkingLevel (use ${formatThinkingLevels(existing?.providerOverride?.trim() || resolvedDefault.provider, existing?.modelOverride?.trim() || resolvedDefault.model, "|")})`);
|
|
9125
9342
|
if (normalized === "off") delete next.thinkingLevel;
|
|
9126
9343
|
else next.thinkingLevel = normalized;
|
|
9127
9344
|
}
|
|
@@ -9199,11 +9416,6 @@ async function applySessionsPatchToStore(params) {
|
|
|
9199
9416
|
}
|
|
9200
9417
|
if ("model" in patch) {
|
|
9201
9418
|
const raw = patch.model;
|
|
9202
|
-
const resolvedDefault = resolveConfiguredModelRef({
|
|
9203
|
-
cfg,
|
|
9204
|
-
defaultProvider: DEFAULT_PROVIDER,
|
|
9205
|
-
defaultModel: DEFAULT_MODEL
|
|
9206
|
-
});
|
|
9207
9419
|
if (raw === null) applyModelOverrideToSessionEntry({
|
|
9208
9420
|
entry: next,
|
|
9209
9421
|
selection: {
|
|
@@ -9239,11 +9451,6 @@ async function applySessionsPatchToStore(params) {
|
|
|
9239
9451
|
}
|
|
9240
9452
|
}
|
|
9241
9453
|
if (next.thinkingLevel === "xhigh") {
|
|
9242
|
-
const resolvedDefault = resolveConfiguredModelRef({
|
|
9243
|
-
cfg,
|
|
9244
|
-
defaultProvider: DEFAULT_PROVIDER,
|
|
9245
|
-
defaultModel: DEFAULT_MODEL
|
|
9246
|
-
});
|
|
9247
9454
|
if (!supportsXHighThinking(next.providerOverride ?? resolvedDefault.provider, next.modelOverride ?? resolvedDefault.model)) {
|
|
9248
9455
|
if ("thinkingLevel" in patch) return invalid(`thinkingLevel "xhigh" is only supported for ${formatXHighModelHint()}`);
|
|
9249
9456
|
next.thinkingLevel = "high";
|
|
@@ -9503,11 +9710,17 @@ const sessionsHandlers = {
|
|
|
9503
9710
|
respond(false, void 0, applied.error);
|
|
9504
9711
|
return;
|
|
9505
9712
|
}
|
|
9713
|
+
const agentId = normalizeAgentId(parseAgentSessionKey(target.canonicalKey ?? key)?.agentId ?? resolveDefaultAgentId(cfg));
|
|
9714
|
+
const resolved = resolveSessionModelRef(cfg, applied.entry, agentId);
|
|
9506
9715
|
respond(true, {
|
|
9507
9716
|
ok: true,
|
|
9508
9717
|
path: storePath,
|
|
9509
9718
|
key: target.canonicalKey,
|
|
9510
|
-
entry: applied.entry
|
|
9719
|
+
entry: applied.entry,
|
|
9720
|
+
resolved: {
|
|
9721
|
+
modelProvider: resolved.provider,
|
|
9722
|
+
model: resolved.model
|
|
9723
|
+
}
|
|
9511
9724
|
}, void 0);
|
|
9512
9725
|
},
|
|
9513
9726
|
"sessions.reset": async ({ params, respond }) => {
|
|
@@ -10161,18 +10374,54 @@ const updateHandlers = { "update.run": async ({ params, respond }) => {
|
|
|
10161
10374
|
//#region src/gateway/server-methods/usage.ts
|
|
10162
10375
|
const COST_USAGE_CACHE_TTL_MS = 3e4;
|
|
10163
10376
|
const costUsageCache = /* @__PURE__ */ new Map();
|
|
10377
|
+
/**
|
|
10378
|
+
* Parse a date string (YYYY-MM-DD) to start of day timestamp in UTC.
|
|
10379
|
+
* Returns undefined if invalid.
|
|
10380
|
+
*/
|
|
10381
|
+
const parseDateToMs = (raw) => {
|
|
10382
|
+
if (typeof raw !== "string" || !raw.trim()) return;
|
|
10383
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(raw.trim());
|
|
10384
|
+
if (!match) return;
|
|
10385
|
+
const [, year, month, day] = match;
|
|
10386
|
+
const ms = Date.UTC(parseInt(year), parseInt(month) - 1, parseInt(day));
|
|
10387
|
+
if (Number.isNaN(ms)) return;
|
|
10388
|
+
return ms;
|
|
10389
|
+
};
|
|
10164
10390
|
const parseDays = (raw) => {
|
|
10165
10391
|
if (typeof raw === "number" && Number.isFinite(raw)) return Math.floor(raw);
|
|
10166
10392
|
if (typeof raw === "string" && raw.trim() !== "") {
|
|
10167
10393
|
const parsed = Number(raw);
|
|
10168
10394
|
if (Number.isFinite(parsed)) return Math.floor(parsed);
|
|
10169
10395
|
}
|
|
10170
|
-
|
|
10396
|
+
};
|
|
10397
|
+
/**
|
|
10398
|
+
* Get date range from params (startDate/endDate or days).
|
|
10399
|
+
* Falls back to last 30 days if not provided.
|
|
10400
|
+
*/
|
|
10401
|
+
const parseDateRange = (params) => {
|
|
10402
|
+
const now = /* @__PURE__ */ new Date();
|
|
10403
|
+
const todayStartMs = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate());
|
|
10404
|
+
const todayEndMs = todayStartMs + 1440 * 60 * 1e3 - 1;
|
|
10405
|
+
const startMs = parseDateToMs(params.startDate);
|
|
10406
|
+
const endMs = parseDateToMs(params.endDate);
|
|
10407
|
+
if (startMs !== void 0 && endMs !== void 0) return {
|
|
10408
|
+
startMs,
|
|
10409
|
+
endMs: endMs + 1440 * 60 * 1e3 - 1
|
|
10410
|
+
};
|
|
10411
|
+
const days = parseDays(params.days);
|
|
10412
|
+
if (days !== void 0) return {
|
|
10413
|
+
startMs: todayStartMs - (Math.max(1, days) - 1) * 24 * 60 * 60 * 1e3,
|
|
10414
|
+
endMs: todayEndMs
|
|
10415
|
+
};
|
|
10416
|
+
return {
|
|
10417
|
+
startMs: todayStartMs - 696 * 60 * 60 * 1e3,
|
|
10418
|
+
endMs: todayEndMs
|
|
10419
|
+
};
|
|
10171
10420
|
};
|
|
10172
10421
|
async function loadCostUsageSummaryCached(params) {
|
|
10173
|
-
const
|
|
10422
|
+
const cacheKey = `${params.startMs}-${params.endMs}`;
|
|
10174
10423
|
const now = Date.now();
|
|
10175
|
-
const cached = costUsageCache.get(
|
|
10424
|
+
const cached = costUsageCache.get(cacheKey);
|
|
10176
10425
|
if (cached?.summary && cached.updatedAt && now - cached.updatedAt < COST_USAGE_CACHE_TTL_MS) return cached.summary;
|
|
10177
10426
|
if (cached?.inFlight) {
|
|
10178
10427
|
if (cached.summary) return cached.summary;
|
|
@@ -10180,10 +10429,11 @@ async function loadCostUsageSummaryCached(params) {
|
|
|
10180
10429
|
}
|
|
10181
10430
|
const entry = cached ?? {};
|
|
10182
10431
|
const inFlight = loadCostUsageSummary({
|
|
10183
|
-
|
|
10432
|
+
startMs: params.startMs,
|
|
10433
|
+
endMs: params.endMs,
|
|
10184
10434
|
config: params.config
|
|
10185
10435
|
}).then((summary) => {
|
|
10186
|
-
costUsageCache.set(
|
|
10436
|
+
costUsageCache.set(cacheKey, {
|
|
10187
10437
|
summary,
|
|
10188
10438
|
updatedAt: Date.now()
|
|
10189
10439
|
});
|
|
@@ -10192,14 +10442,14 @@ async function loadCostUsageSummaryCached(params) {
|
|
|
10192
10442
|
if (entry.summary) return entry.summary;
|
|
10193
10443
|
throw err;
|
|
10194
10444
|
}).finally(() => {
|
|
10195
|
-
const current = costUsageCache.get(
|
|
10445
|
+
const current = costUsageCache.get(cacheKey);
|
|
10196
10446
|
if (current?.inFlight === inFlight) {
|
|
10197
10447
|
current.inFlight = void 0;
|
|
10198
|
-
costUsageCache.set(
|
|
10448
|
+
costUsageCache.set(cacheKey, current);
|
|
10199
10449
|
}
|
|
10200
10450
|
});
|
|
10201
10451
|
entry.inFlight = inFlight;
|
|
10202
|
-
costUsageCache.set(
|
|
10452
|
+
costUsageCache.set(cacheKey, entry);
|
|
10203
10453
|
if (entry.summary) return entry.summary;
|
|
10204
10454
|
return await inFlight;
|
|
10205
10455
|
}
|
|
@@ -10209,10 +10459,395 @@ const usageHandlers = {
|
|
|
10209
10459
|
},
|
|
10210
10460
|
"usage.cost": async ({ respond, params }) => {
|
|
10211
10461
|
const config = loadConfig();
|
|
10462
|
+
const { startMs, endMs } = parseDateRange({
|
|
10463
|
+
startDate: params?.startDate,
|
|
10464
|
+
endDate: params?.endDate,
|
|
10465
|
+
days: params?.days
|
|
10466
|
+
});
|
|
10212
10467
|
respond(true, await loadCostUsageSummaryCached({
|
|
10213
|
-
|
|
10468
|
+
startMs,
|
|
10469
|
+
endMs,
|
|
10214
10470
|
config
|
|
10215
10471
|
}), void 0);
|
|
10472
|
+
},
|
|
10473
|
+
"sessions.usage": async ({ respond, params }) => {
|
|
10474
|
+
if (!validateSessionsUsageParams(params)) {
|
|
10475
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid sessions.usage params: ${formatValidationErrors(validateSessionsUsageParams.errors)}`));
|
|
10476
|
+
return;
|
|
10477
|
+
}
|
|
10478
|
+
const p = params;
|
|
10479
|
+
const config = loadConfig();
|
|
10480
|
+
const { startMs, endMs } = parseDateRange({
|
|
10481
|
+
startDate: p.startDate,
|
|
10482
|
+
endDate: p.endDate
|
|
10483
|
+
});
|
|
10484
|
+
const limit = typeof p.limit === "number" && Number.isFinite(p.limit) ? p.limit : 50;
|
|
10485
|
+
const includeContextWeight = p.includeContextWeight ?? false;
|
|
10486
|
+
const specificKey = typeof p.key === "string" ? p.key.trim() : null;
|
|
10487
|
+
const { store } = loadCombinedSessionStoreForGateway(config);
|
|
10488
|
+
const now = Date.now();
|
|
10489
|
+
const mergedEntries = [];
|
|
10490
|
+
if (specificKey) {
|
|
10491
|
+
const storeEntry = store[specificKey];
|
|
10492
|
+
let sessionId = storeEntry?.sessionId ?? specificKey;
|
|
10493
|
+
const sessionFile = resolveSessionFilePath(sessionId, storeEntry);
|
|
10494
|
+
try {
|
|
10495
|
+
const stats = fs.statSync(sessionFile);
|
|
10496
|
+
if (stats.isFile()) mergedEntries.push({
|
|
10497
|
+
key: specificKey,
|
|
10498
|
+
sessionId,
|
|
10499
|
+
sessionFile,
|
|
10500
|
+
label: storeEntry?.label,
|
|
10501
|
+
updatedAt: storeEntry?.updatedAt ?? stats.mtimeMs,
|
|
10502
|
+
storeEntry
|
|
10503
|
+
});
|
|
10504
|
+
} catch {}
|
|
10505
|
+
} else {
|
|
10506
|
+
const discoveredSessions = await discoverAllSessions({
|
|
10507
|
+
startMs,
|
|
10508
|
+
endMs
|
|
10509
|
+
});
|
|
10510
|
+
const storeBySessionId = /* @__PURE__ */ new Map();
|
|
10511
|
+
for (const [key, entry] of Object.entries(store)) if (entry?.sessionId) storeBySessionId.set(entry.sessionId, {
|
|
10512
|
+
key,
|
|
10513
|
+
entry
|
|
10514
|
+
});
|
|
10515
|
+
for (const discovered of discoveredSessions) {
|
|
10516
|
+
const storeMatch = storeBySessionId.get(discovered.sessionId);
|
|
10517
|
+
if (storeMatch) mergedEntries.push({
|
|
10518
|
+
key: storeMatch.key,
|
|
10519
|
+
sessionId: discovered.sessionId,
|
|
10520
|
+
sessionFile: discovered.sessionFile,
|
|
10521
|
+
label: storeMatch.entry.label,
|
|
10522
|
+
updatedAt: storeMatch.entry.updatedAt ?? discovered.mtime,
|
|
10523
|
+
storeEntry: storeMatch.entry
|
|
10524
|
+
});
|
|
10525
|
+
else mergedEntries.push({
|
|
10526
|
+
key: discovered.sessionId,
|
|
10527
|
+
sessionId: discovered.sessionId,
|
|
10528
|
+
sessionFile: discovered.sessionFile,
|
|
10529
|
+
label: void 0,
|
|
10530
|
+
updatedAt: discovered.mtime
|
|
10531
|
+
});
|
|
10532
|
+
}
|
|
10533
|
+
}
|
|
10534
|
+
mergedEntries.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
10535
|
+
const limitedEntries = mergedEntries.slice(0, limit);
|
|
10536
|
+
const sessions = [];
|
|
10537
|
+
const aggregateTotals = {
|
|
10538
|
+
input: 0,
|
|
10539
|
+
output: 0,
|
|
10540
|
+
cacheRead: 0,
|
|
10541
|
+
cacheWrite: 0,
|
|
10542
|
+
totalTokens: 0,
|
|
10543
|
+
totalCost: 0,
|
|
10544
|
+
inputCost: 0,
|
|
10545
|
+
outputCost: 0,
|
|
10546
|
+
cacheReadCost: 0,
|
|
10547
|
+
cacheWriteCost: 0,
|
|
10548
|
+
missingCostEntries: 0
|
|
10549
|
+
};
|
|
10550
|
+
const aggregateMessages = {
|
|
10551
|
+
total: 0,
|
|
10552
|
+
user: 0,
|
|
10553
|
+
assistant: 0,
|
|
10554
|
+
toolCalls: 0,
|
|
10555
|
+
toolResults: 0,
|
|
10556
|
+
errors: 0
|
|
10557
|
+
};
|
|
10558
|
+
const toolAggregateMap = /* @__PURE__ */ new Map();
|
|
10559
|
+
const byModelMap = /* @__PURE__ */ new Map();
|
|
10560
|
+
const byProviderMap = /* @__PURE__ */ new Map();
|
|
10561
|
+
const byAgentMap = /* @__PURE__ */ new Map();
|
|
10562
|
+
const byChannelMap = /* @__PURE__ */ new Map();
|
|
10563
|
+
const dailyAggregateMap = /* @__PURE__ */ new Map();
|
|
10564
|
+
const latencyTotals = {
|
|
10565
|
+
count: 0,
|
|
10566
|
+
sum: 0,
|
|
10567
|
+
min: Number.POSITIVE_INFINITY,
|
|
10568
|
+
max: 0,
|
|
10569
|
+
p95Max: 0
|
|
10570
|
+
};
|
|
10571
|
+
const dailyLatencyMap = /* @__PURE__ */ new Map();
|
|
10572
|
+
const modelDailyMap = /* @__PURE__ */ new Map();
|
|
10573
|
+
const emptyTotals = () => ({
|
|
10574
|
+
input: 0,
|
|
10575
|
+
output: 0,
|
|
10576
|
+
cacheRead: 0,
|
|
10577
|
+
cacheWrite: 0,
|
|
10578
|
+
totalTokens: 0,
|
|
10579
|
+
totalCost: 0,
|
|
10580
|
+
inputCost: 0,
|
|
10581
|
+
outputCost: 0,
|
|
10582
|
+
cacheReadCost: 0,
|
|
10583
|
+
cacheWriteCost: 0,
|
|
10584
|
+
missingCostEntries: 0
|
|
10585
|
+
});
|
|
10586
|
+
const mergeTotals = (target, source) => {
|
|
10587
|
+
target.input += source.input;
|
|
10588
|
+
target.output += source.output;
|
|
10589
|
+
target.cacheRead += source.cacheRead;
|
|
10590
|
+
target.cacheWrite += source.cacheWrite;
|
|
10591
|
+
target.totalTokens += source.totalTokens;
|
|
10592
|
+
target.totalCost += source.totalCost;
|
|
10593
|
+
target.inputCost += source.inputCost;
|
|
10594
|
+
target.outputCost += source.outputCost;
|
|
10595
|
+
target.cacheReadCost += source.cacheReadCost;
|
|
10596
|
+
target.cacheWriteCost += source.cacheWriteCost;
|
|
10597
|
+
target.missingCostEntries += source.missingCostEntries;
|
|
10598
|
+
};
|
|
10599
|
+
for (const merged of limitedEntries) {
|
|
10600
|
+
const usage = await loadSessionCostSummary({
|
|
10601
|
+
sessionId: merged.sessionId,
|
|
10602
|
+
sessionEntry: merged.storeEntry,
|
|
10603
|
+
sessionFile: merged.sessionFile,
|
|
10604
|
+
config,
|
|
10605
|
+
startMs,
|
|
10606
|
+
endMs
|
|
10607
|
+
});
|
|
10608
|
+
if (usage) {
|
|
10609
|
+
aggregateTotals.input += usage.input;
|
|
10610
|
+
aggregateTotals.output += usage.output;
|
|
10611
|
+
aggregateTotals.cacheRead += usage.cacheRead;
|
|
10612
|
+
aggregateTotals.cacheWrite += usage.cacheWrite;
|
|
10613
|
+
aggregateTotals.totalTokens += usage.totalTokens;
|
|
10614
|
+
aggregateTotals.totalCost += usage.totalCost;
|
|
10615
|
+
aggregateTotals.inputCost += usage.inputCost;
|
|
10616
|
+
aggregateTotals.outputCost += usage.outputCost;
|
|
10617
|
+
aggregateTotals.cacheReadCost += usage.cacheReadCost;
|
|
10618
|
+
aggregateTotals.cacheWriteCost += usage.cacheWriteCost;
|
|
10619
|
+
aggregateTotals.missingCostEntries += usage.missingCostEntries;
|
|
10620
|
+
}
|
|
10621
|
+
const agentId = parseAgentSessionKey(merged.key)?.agentId;
|
|
10622
|
+
const channel = merged.storeEntry?.channel ?? merged.storeEntry?.origin?.provider;
|
|
10623
|
+
const chatType = merged.storeEntry?.chatType ?? merged.storeEntry?.origin?.chatType;
|
|
10624
|
+
if (usage) {
|
|
10625
|
+
if (usage.messageCounts) {
|
|
10626
|
+
aggregateMessages.total += usage.messageCounts.total;
|
|
10627
|
+
aggregateMessages.user += usage.messageCounts.user;
|
|
10628
|
+
aggregateMessages.assistant += usage.messageCounts.assistant;
|
|
10629
|
+
aggregateMessages.toolCalls += usage.messageCounts.toolCalls;
|
|
10630
|
+
aggregateMessages.toolResults += usage.messageCounts.toolResults;
|
|
10631
|
+
aggregateMessages.errors += usage.messageCounts.errors;
|
|
10632
|
+
}
|
|
10633
|
+
if (usage.toolUsage) for (const tool of usage.toolUsage.tools) toolAggregateMap.set(tool.name, (toolAggregateMap.get(tool.name) ?? 0) + tool.count);
|
|
10634
|
+
if (usage.modelUsage) for (const entry of usage.modelUsage) {
|
|
10635
|
+
const modelKey = `${entry.provider ?? "unknown"}::${entry.model ?? "unknown"}`;
|
|
10636
|
+
const modelExisting = byModelMap.get(modelKey) ?? {
|
|
10637
|
+
provider: entry.provider,
|
|
10638
|
+
model: entry.model,
|
|
10639
|
+
count: 0,
|
|
10640
|
+
totals: emptyTotals()
|
|
10641
|
+
};
|
|
10642
|
+
modelExisting.count += entry.count;
|
|
10643
|
+
mergeTotals(modelExisting.totals, entry.totals);
|
|
10644
|
+
byModelMap.set(modelKey, modelExisting);
|
|
10645
|
+
const providerKey = entry.provider ?? "unknown";
|
|
10646
|
+
const providerExisting = byProviderMap.get(providerKey) ?? {
|
|
10647
|
+
provider: entry.provider,
|
|
10648
|
+
model: void 0,
|
|
10649
|
+
count: 0,
|
|
10650
|
+
totals: emptyTotals()
|
|
10651
|
+
};
|
|
10652
|
+
providerExisting.count += entry.count;
|
|
10653
|
+
mergeTotals(providerExisting.totals, entry.totals);
|
|
10654
|
+
byProviderMap.set(providerKey, providerExisting);
|
|
10655
|
+
}
|
|
10656
|
+
if (usage.latency) {
|
|
10657
|
+
const { count, avgMs, minMs, maxMs, p95Ms } = usage.latency;
|
|
10658
|
+
if (count > 0) {
|
|
10659
|
+
latencyTotals.count += count;
|
|
10660
|
+
latencyTotals.sum += avgMs * count;
|
|
10661
|
+
latencyTotals.min = Math.min(latencyTotals.min, minMs);
|
|
10662
|
+
latencyTotals.max = Math.max(latencyTotals.max, maxMs);
|
|
10663
|
+
latencyTotals.p95Max = Math.max(latencyTotals.p95Max, p95Ms);
|
|
10664
|
+
}
|
|
10665
|
+
}
|
|
10666
|
+
if (usage.dailyLatency) for (const day of usage.dailyLatency) {
|
|
10667
|
+
const existing = dailyLatencyMap.get(day.date) ?? {
|
|
10668
|
+
date: day.date,
|
|
10669
|
+
count: 0,
|
|
10670
|
+
sum: 0,
|
|
10671
|
+
min: Number.POSITIVE_INFINITY,
|
|
10672
|
+
max: 0,
|
|
10673
|
+
p95Max: 0
|
|
10674
|
+
};
|
|
10675
|
+
existing.count += day.count;
|
|
10676
|
+
existing.sum += day.avgMs * day.count;
|
|
10677
|
+
existing.min = Math.min(existing.min, day.minMs);
|
|
10678
|
+
existing.max = Math.max(existing.max, day.maxMs);
|
|
10679
|
+
existing.p95Max = Math.max(existing.p95Max, day.p95Ms);
|
|
10680
|
+
dailyLatencyMap.set(day.date, existing);
|
|
10681
|
+
}
|
|
10682
|
+
if (usage.dailyModelUsage) for (const entry of usage.dailyModelUsage) {
|
|
10683
|
+
const key = `${entry.date}::${entry.provider ?? "unknown"}::${entry.model ?? "unknown"}`;
|
|
10684
|
+
const existing = modelDailyMap.get(key) ?? {
|
|
10685
|
+
date: entry.date,
|
|
10686
|
+
provider: entry.provider,
|
|
10687
|
+
model: entry.model,
|
|
10688
|
+
tokens: 0,
|
|
10689
|
+
cost: 0,
|
|
10690
|
+
count: 0
|
|
10691
|
+
};
|
|
10692
|
+
existing.tokens += entry.tokens;
|
|
10693
|
+
existing.cost += entry.cost;
|
|
10694
|
+
existing.count += entry.count;
|
|
10695
|
+
modelDailyMap.set(key, existing);
|
|
10696
|
+
}
|
|
10697
|
+
if (agentId) {
|
|
10698
|
+
const agentTotals = byAgentMap.get(agentId) ?? emptyTotals();
|
|
10699
|
+
mergeTotals(agentTotals, usage);
|
|
10700
|
+
byAgentMap.set(agentId, agentTotals);
|
|
10701
|
+
}
|
|
10702
|
+
if (channel) {
|
|
10703
|
+
const channelTotals = byChannelMap.get(channel) ?? emptyTotals();
|
|
10704
|
+
mergeTotals(channelTotals, usage);
|
|
10705
|
+
byChannelMap.set(channel, channelTotals);
|
|
10706
|
+
}
|
|
10707
|
+
if (usage.dailyBreakdown) for (const day of usage.dailyBreakdown) {
|
|
10708
|
+
const daily = dailyAggregateMap.get(day.date) ?? {
|
|
10709
|
+
date: day.date,
|
|
10710
|
+
tokens: 0,
|
|
10711
|
+
cost: 0,
|
|
10712
|
+
messages: 0,
|
|
10713
|
+
toolCalls: 0,
|
|
10714
|
+
errors: 0
|
|
10715
|
+
};
|
|
10716
|
+
daily.tokens += day.tokens;
|
|
10717
|
+
daily.cost += day.cost;
|
|
10718
|
+
dailyAggregateMap.set(day.date, daily);
|
|
10719
|
+
}
|
|
10720
|
+
if (usage.dailyMessageCounts) for (const day of usage.dailyMessageCounts) {
|
|
10721
|
+
const daily = dailyAggregateMap.get(day.date) ?? {
|
|
10722
|
+
date: day.date,
|
|
10723
|
+
tokens: 0,
|
|
10724
|
+
cost: 0,
|
|
10725
|
+
messages: 0,
|
|
10726
|
+
toolCalls: 0,
|
|
10727
|
+
errors: 0
|
|
10728
|
+
};
|
|
10729
|
+
daily.messages += day.total;
|
|
10730
|
+
daily.toolCalls += day.toolCalls;
|
|
10731
|
+
daily.errors += day.errors;
|
|
10732
|
+
dailyAggregateMap.set(day.date, daily);
|
|
10733
|
+
}
|
|
10734
|
+
}
|
|
10735
|
+
sessions.push({
|
|
10736
|
+
key: merged.key,
|
|
10737
|
+
label: merged.label,
|
|
10738
|
+
sessionId: merged.sessionId,
|
|
10739
|
+
updatedAt: merged.updatedAt,
|
|
10740
|
+
agentId,
|
|
10741
|
+
channel,
|
|
10742
|
+
chatType,
|
|
10743
|
+
origin: merged.storeEntry?.origin,
|
|
10744
|
+
modelOverride: merged.storeEntry?.modelOverride,
|
|
10745
|
+
providerOverride: merged.storeEntry?.providerOverride,
|
|
10746
|
+
modelProvider: merged.storeEntry?.modelProvider,
|
|
10747
|
+
model: merged.storeEntry?.model,
|
|
10748
|
+
usage,
|
|
10749
|
+
contextWeight: includeContextWeight ? merged.storeEntry?.systemPromptReport ?? null : void 0
|
|
10750
|
+
});
|
|
10751
|
+
}
|
|
10752
|
+
const formatDateStr = (ms) => {
|
|
10753
|
+
const d = new Date(ms);
|
|
10754
|
+
return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, "0")}-${String(d.getUTCDate()).padStart(2, "0")}`;
|
|
10755
|
+
};
|
|
10756
|
+
const aggregates = {
|
|
10757
|
+
messages: aggregateMessages,
|
|
10758
|
+
tools: {
|
|
10759
|
+
totalCalls: Array.from(toolAggregateMap.values()).reduce((sum, count) => sum + count, 0),
|
|
10760
|
+
uniqueTools: toolAggregateMap.size,
|
|
10761
|
+
tools: Array.from(toolAggregateMap.entries()).map(([name, count]) => ({
|
|
10762
|
+
name,
|
|
10763
|
+
count
|
|
10764
|
+
})).toSorted((a, b) => b.count - a.count)
|
|
10765
|
+
},
|
|
10766
|
+
byModel: Array.from(byModelMap.values()).toSorted((a, b) => {
|
|
10767
|
+
const costDiff = b.totals.totalCost - a.totals.totalCost;
|
|
10768
|
+
if (costDiff !== 0) return costDiff;
|
|
10769
|
+
return b.totals.totalTokens - a.totals.totalTokens;
|
|
10770
|
+
}),
|
|
10771
|
+
byProvider: Array.from(byProviderMap.values()).toSorted((a, b) => {
|
|
10772
|
+
const costDiff = b.totals.totalCost - a.totals.totalCost;
|
|
10773
|
+
if (costDiff !== 0) return costDiff;
|
|
10774
|
+
return b.totals.totalTokens - a.totals.totalTokens;
|
|
10775
|
+
}),
|
|
10776
|
+
byAgent: Array.from(byAgentMap.entries()).map(([id, totals]) => ({
|
|
10777
|
+
agentId: id,
|
|
10778
|
+
totals
|
|
10779
|
+
})).toSorted((a, b) => b.totals.totalCost - a.totals.totalCost),
|
|
10780
|
+
byChannel: Array.from(byChannelMap.entries()).map(([name, totals]) => ({
|
|
10781
|
+
channel: name,
|
|
10782
|
+
totals
|
|
10783
|
+
})).toSorted((a, b) => b.totals.totalCost - a.totals.totalCost),
|
|
10784
|
+
latency: latencyTotals.count > 0 ? {
|
|
10785
|
+
count: latencyTotals.count,
|
|
10786
|
+
avgMs: latencyTotals.sum / latencyTotals.count,
|
|
10787
|
+
minMs: latencyTotals.min === Number.POSITIVE_INFINITY ? 0 : latencyTotals.min,
|
|
10788
|
+
maxMs: latencyTotals.max,
|
|
10789
|
+
p95Ms: latencyTotals.p95Max
|
|
10790
|
+
} : void 0,
|
|
10791
|
+
dailyLatency: Array.from(dailyLatencyMap.values()).map((entry) => ({
|
|
10792
|
+
date: entry.date,
|
|
10793
|
+
count: entry.count,
|
|
10794
|
+
avgMs: entry.count ? entry.sum / entry.count : 0,
|
|
10795
|
+
minMs: entry.min === Number.POSITIVE_INFINITY ? 0 : entry.min,
|
|
10796
|
+
maxMs: entry.max,
|
|
10797
|
+
p95Ms: entry.p95Max
|
|
10798
|
+
})).toSorted((a, b) => a.date.localeCompare(b.date)),
|
|
10799
|
+
modelDaily: Array.from(modelDailyMap.values()).toSorted((a, b) => a.date.localeCompare(b.date) || b.cost - a.cost),
|
|
10800
|
+
daily: Array.from(dailyAggregateMap.values()).toSorted((a, b) => a.date.localeCompare(b.date))
|
|
10801
|
+
};
|
|
10802
|
+
respond(true, {
|
|
10803
|
+
updatedAt: now,
|
|
10804
|
+
startDate: formatDateStr(startMs),
|
|
10805
|
+
endDate: formatDateStr(endMs),
|
|
10806
|
+
sessions,
|
|
10807
|
+
totals: aggregateTotals,
|
|
10808
|
+
aggregates
|
|
10809
|
+
}, void 0);
|
|
10810
|
+
},
|
|
10811
|
+
"sessions.usage.timeseries": async ({ respond, params }) => {
|
|
10812
|
+
const key = typeof params?.key === "string" ? params.key.trim() : null;
|
|
10813
|
+
if (!key) {
|
|
10814
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "key is required for timeseries"));
|
|
10815
|
+
return;
|
|
10816
|
+
}
|
|
10817
|
+
const config = loadConfig();
|
|
10818
|
+
const { entry } = loadSessionEntry(key);
|
|
10819
|
+
const timeseries = await loadSessionUsageTimeSeries({
|
|
10820
|
+
sessionId: entry?.sessionId ?? key,
|
|
10821
|
+
sessionEntry: entry,
|
|
10822
|
+
sessionFile: entry?.sessionFile ?? resolveSessionFilePath(key),
|
|
10823
|
+
config,
|
|
10824
|
+
maxPoints: 200
|
|
10825
|
+
});
|
|
10826
|
+
if (!timeseries) {
|
|
10827
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `No transcript found for session: ${key}`));
|
|
10828
|
+
return;
|
|
10829
|
+
}
|
|
10830
|
+
respond(true, timeseries, void 0);
|
|
10831
|
+
},
|
|
10832
|
+
"sessions.usage.logs": async ({ respond, params }) => {
|
|
10833
|
+
const key = typeof params?.key === "string" ? params.key.trim() : null;
|
|
10834
|
+
if (!key) {
|
|
10835
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "key is required for logs"));
|
|
10836
|
+
return;
|
|
10837
|
+
}
|
|
10838
|
+
const limit = typeof params?.limit === "number" && Number.isFinite(params.limit) ? Math.min(params.limit, 1e3) : 200;
|
|
10839
|
+
const config = loadConfig();
|
|
10840
|
+
const { entry } = loadSessionEntry(key);
|
|
10841
|
+
const sessionId = entry?.sessionId ?? key;
|
|
10842
|
+
const sessionFile = entry?.sessionFile ?? resolveSessionFilePath(key);
|
|
10843
|
+
const { loadSessionLogs } = await import("./session-cost-usage-CBP4Hv9D.js").then((n) => n.a);
|
|
10844
|
+
respond(true, { logs: await loadSessionLogs({
|
|
10845
|
+
sessionId,
|
|
10846
|
+
sessionEntry: entry,
|
|
10847
|
+
sessionFile,
|
|
10848
|
+
config,
|
|
10849
|
+
limit
|
|
10850
|
+
}) ?? [] }, void 0);
|
|
10216
10851
|
}
|
|
10217
10852
|
};
|
|
10218
10853
|
|
|
@@ -11212,29 +11847,14 @@ function resolveHooksConfig(cfg) {
|
|
|
11212
11847
|
mappings: resolveHookMappings(cfg.hooks)
|
|
11213
11848
|
};
|
|
11214
11849
|
}
|
|
11215
|
-
function extractHookToken(req
|
|
11850
|
+
function extractHookToken(req) {
|
|
11216
11851
|
const auth = typeof req.headers.authorization === "string" ? req.headers.authorization.trim() : "";
|
|
11217
11852
|
if (auth.toLowerCase().startsWith("bearer ")) {
|
|
11218
11853
|
const token = auth.slice(7).trim();
|
|
11219
|
-
if (token) return
|
|
11220
|
-
token,
|
|
11221
|
-
fromQuery: false
|
|
11222
|
-
};
|
|
11854
|
+
if (token) return token;
|
|
11223
11855
|
}
|
|
11224
11856
|
const headerToken = typeof req.headers["x-openclaw-token"] === "string" ? req.headers["x-openclaw-token"].trim() : "";
|
|
11225
|
-
if (headerToken) return
|
|
11226
|
-
token: headerToken,
|
|
11227
|
-
fromQuery: false
|
|
11228
|
-
};
|
|
11229
|
-
const queryToken = url.searchParams.get("token");
|
|
11230
|
-
if (queryToken) return {
|
|
11231
|
-
token: queryToken.trim(),
|
|
11232
|
-
fromQuery: true
|
|
11233
|
-
};
|
|
11234
|
-
return {
|
|
11235
|
-
token: void 0,
|
|
11236
|
-
fromQuery: false
|
|
11237
|
-
};
|
|
11857
|
+
if (headerToken) return headerToken;
|
|
11238
11858
|
}
|
|
11239
11859
|
async function readJsonBody(req, maxBytes) {
|
|
11240
11860
|
return await new Promise((resolve) => {
|
|
@@ -11372,7 +11992,7 @@ function normalizeAgentPayload(payload, opts) {
|
|
|
11372
11992
|
async function startBrowserControlServerIfEnabled() {
|
|
11373
11993
|
if (isTruthyEnvValue(process.env.OPENCLAW_SKIP_BROWSER_CONTROL_SERVER)) return null;
|
|
11374
11994
|
const override = process.env.OPENCLAW_BROWSER_CONTROL_MODULE?.trim();
|
|
11375
|
-
const mod = override ? await import(override) : await import("./control-service-
|
|
11995
|
+
const mod = override ? await import(override) : await import("./control-service-CS61Road.js").then((n) => n.t);
|
|
11376
11996
|
const start = typeof mod.startBrowserControlServiceFromConfig === "function" ? mod.startBrowserControlServiceFromConfig : mod.startBrowserControlServerFromConfig;
|
|
11377
11997
|
const stop = typeof mod.stopBrowserControlService === "function" ? mod.stopBrowserControlService : mod.stopBrowserControlServer;
|
|
11378
11998
|
if (!start) return null;
|
|
@@ -12040,8 +12660,8 @@ function hasEventScope(client, event) {
|
|
|
12040
12660
|
}
|
|
12041
12661
|
function createGatewayBroadcaster(params) {
|
|
12042
12662
|
let seq = 0;
|
|
12043
|
-
const
|
|
12044
|
-
const eventSeq = ++seq;
|
|
12663
|
+
const broadcastInternal = (event, payload, opts, targetConnIds) => {
|
|
12664
|
+
const eventSeq = Boolean(targetConnIds) ? void 0 : ++seq;
|
|
12045
12665
|
const frame = JSON.stringify({
|
|
12046
12666
|
type: "event",
|
|
12047
12667
|
event,
|
|
@@ -12051,8 +12671,9 @@ function createGatewayBroadcaster(params) {
|
|
|
12051
12671
|
});
|
|
12052
12672
|
const logMeta = {
|
|
12053
12673
|
event,
|
|
12054
|
-
seq: eventSeq,
|
|
12674
|
+
seq: eventSeq ?? "targeted",
|
|
12055
12675
|
clients: params.clients.size,
|
|
12676
|
+
targets: targetConnIds ? targetConnIds.size : void 0,
|
|
12056
12677
|
dropIfSlow: opts?.dropIfSlow,
|
|
12057
12678
|
presenceVersion: opts?.stateVersion?.presence,
|
|
12058
12679
|
healthVersion: opts?.stateVersion?.health
|
|
@@ -12060,6 +12681,7 @@ function createGatewayBroadcaster(params) {
|
|
|
12060
12681
|
if (event === "agent") Object.assign(logMeta, summarizeAgentEventForWsLog(payload));
|
|
12061
12682
|
logWs("out", "event", logMeta);
|
|
12062
12683
|
for (const c of params.clients) {
|
|
12684
|
+
if (targetConnIds && !targetConnIds.has(c.connId)) continue;
|
|
12063
12685
|
if (!hasEventScope(c, event)) continue;
|
|
12064
12686
|
const slow = c.socket.bufferedAmount > MAX_BUFFERED_BYTES;
|
|
12065
12687
|
if (slow && opts?.dropIfSlow) continue;
|
|
@@ -12074,7 +12696,15 @@ function createGatewayBroadcaster(params) {
|
|
|
12074
12696
|
} catch {}
|
|
12075
12697
|
}
|
|
12076
12698
|
};
|
|
12077
|
-
|
|
12699
|
+
const broadcast = (event, payload, opts) => broadcastInternal(event, payload, opts);
|
|
12700
|
+
const broadcastToConnIds = (event, payload, connIds, opts) => {
|
|
12701
|
+
if (connIds.size === 0) return;
|
|
12702
|
+
broadcastInternal(event, payload, opts, connIds);
|
|
12703
|
+
};
|
|
12704
|
+
return {
|
|
12705
|
+
broadcast,
|
|
12706
|
+
broadcastToConnIds
|
|
12707
|
+
};
|
|
12078
12708
|
}
|
|
12079
12709
|
|
|
12080
12710
|
//#endregion
|
|
@@ -13814,6 +14444,40 @@ function sendJson(res, status, body) {
|
|
|
13814
14444
|
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
13815
14445
|
res.end(JSON.stringify(body));
|
|
13816
14446
|
}
|
|
14447
|
+
function isCanvasPath(pathname) {
|
|
14448
|
+
return pathname === A2UI_PATH || pathname.startsWith(`${A2UI_PATH}/`) || pathname === CANVAS_HOST_PATH || pathname.startsWith(`${CANVAS_HOST_PATH}/`) || pathname === CANVAS_WS_PATH;
|
|
14449
|
+
}
|
|
14450
|
+
function hasAuthorizedWsClientForIp(clients, clientIp) {
|
|
14451
|
+
for (const client of clients) if (client.clientIp && client.clientIp === clientIp) return true;
|
|
14452
|
+
return false;
|
|
14453
|
+
}
|
|
14454
|
+
async function authorizeCanvasRequest(params) {
|
|
14455
|
+
const { req, auth, trustedProxies, clients } = params;
|
|
14456
|
+
if (isLocalDirectRequest(req, trustedProxies)) return true;
|
|
14457
|
+
const token = getBearerToken(req);
|
|
14458
|
+
if (token) {
|
|
14459
|
+
if ((await authorizeGatewayConnect({
|
|
14460
|
+
auth: {
|
|
14461
|
+
...auth,
|
|
14462
|
+
allowTailscale: false
|
|
14463
|
+
},
|
|
14464
|
+
connectAuth: {
|
|
14465
|
+
token,
|
|
14466
|
+
password: token
|
|
14467
|
+
},
|
|
14468
|
+
req,
|
|
14469
|
+
trustedProxies
|
|
14470
|
+
})).ok) return true;
|
|
14471
|
+
}
|
|
14472
|
+
const clientIp = resolveGatewayClientIp({
|
|
14473
|
+
remoteAddr: req.socket?.remoteAddress ?? "",
|
|
14474
|
+
forwardedFor: getHeader(req, "x-forwarded-for"),
|
|
14475
|
+
realIp: getHeader(req, "x-real-ip"),
|
|
14476
|
+
trustedProxies
|
|
14477
|
+
});
|
|
14478
|
+
if (!clientIp) return false;
|
|
14479
|
+
return hasAuthorizedWsClientForIp(clients, clientIp);
|
|
14480
|
+
}
|
|
13817
14481
|
function createHooksRequestHandler(opts) {
|
|
13818
14482
|
const { getHooksConfig, bindHost, port, logHooks, dispatchAgentHook, dispatchWakeHook } = opts;
|
|
13819
14483
|
return async (req, res) => {
|
|
@@ -13822,14 +14486,19 @@ function createHooksRequestHandler(opts) {
|
|
|
13822
14486
|
const url = new URL(req.url ?? "/", `http://${bindHost}:${port}`);
|
|
13823
14487
|
const basePath = hooksConfig.basePath;
|
|
13824
14488
|
if (url.pathname !== basePath && !url.pathname.startsWith(`${basePath}/`)) return false;
|
|
13825
|
-
|
|
14489
|
+
if (url.searchParams.has("token")) {
|
|
14490
|
+
res.statusCode = 400;
|
|
14491
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
14492
|
+
res.end("Hook token must be provided via Authorization: Bearer <token> or X-OpenClaw-Token header (query parameters are not allowed).");
|
|
14493
|
+
return true;
|
|
14494
|
+
}
|
|
14495
|
+
const token = extractHookToken(req);
|
|
13826
14496
|
if (!token || token !== hooksConfig.token) {
|
|
13827
14497
|
res.statusCode = 401;
|
|
13828
14498
|
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
13829
14499
|
res.end("Unauthorized");
|
|
13830
14500
|
return true;
|
|
13831
14501
|
}
|
|
13832
|
-
if (fromQuery) logHooks.warn("Hook token provided via query parameter is deprecated for security reasons. Tokens in URLs appear in logs, browser history, and referrer headers. Use Authorization: Bearer <token> or X-OpenClaw-Token header instead.");
|
|
13833
14502
|
if (req.method !== "POST") {
|
|
13834
14503
|
res.statusCode = 405;
|
|
13835
14504
|
res.setHeader("Allow", "POST");
|
|
@@ -13957,7 +14626,7 @@ function createHooksRequestHandler(opts) {
|
|
|
13957
14626
|
};
|
|
13958
14627
|
}
|
|
13959
14628
|
function createGatewayHttpServer(opts) {
|
|
13960
|
-
const { canvasHost, controlUiEnabled, controlUiBasePath, controlUiRoot, openAiChatCompletionsEnabled, openResponsesEnabled, openResponsesConfig, handleHooksRequest, handlePluginRequest, resolvedAuth } = opts;
|
|
14629
|
+
const { canvasHost, clients, controlUiEnabled, controlUiBasePath, controlUiRoot, openAiChatCompletionsEnabled, openResponsesEnabled, openResponsesConfig, handleHooksRequest, handlePluginRequest, resolvedAuth } = opts;
|
|
13961
14630
|
const httpServer = opts.tlsOptions ? createServer$1(opts.tlsOptions, (req, res) => {
|
|
13962
14631
|
handleRequest(req, res);
|
|
13963
14632
|
}) : createServer((req, res) => {
|
|
@@ -13989,6 +14658,17 @@ function createGatewayHttpServer(opts) {
|
|
|
13989
14658
|
})) return;
|
|
13990
14659
|
}
|
|
13991
14660
|
if (canvasHost) {
|
|
14661
|
+
if (isCanvasPath(new URL(req.url ?? "/", "http://localhost").pathname)) {
|
|
14662
|
+
if (!await authorizeCanvasRequest({
|
|
14663
|
+
req,
|
|
14664
|
+
auth: resolvedAuth,
|
|
14665
|
+
trustedProxies,
|
|
14666
|
+
clients
|
|
14667
|
+
})) {
|
|
14668
|
+
sendUnauthorized(res);
|
|
14669
|
+
return;
|
|
14670
|
+
}
|
|
14671
|
+
}
|
|
13992
14672
|
if (await handleA2uiHttpRequest(req, res)) return;
|
|
13993
14673
|
if (await canvasHost.handleHttpRequest(req, res)) return;
|
|
13994
14674
|
}
|
|
@@ -14015,11 +14695,29 @@ function createGatewayHttpServer(opts) {
|
|
|
14015
14695
|
return httpServer;
|
|
14016
14696
|
}
|
|
14017
14697
|
function attachGatewayUpgradeHandler(opts) {
|
|
14018
|
-
const { httpServer, wss, canvasHost } = opts;
|
|
14698
|
+
const { httpServer, wss, canvasHost, clients, resolvedAuth } = opts;
|
|
14019
14699
|
httpServer.on("upgrade", (req, socket, head) => {
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14700
|
+
(async () => {
|
|
14701
|
+
if (canvasHost) {
|
|
14702
|
+
if (new URL(req.url ?? "/", "http://localhost").pathname === CANVAS_WS_PATH) {
|
|
14703
|
+
if (!await authorizeCanvasRequest({
|
|
14704
|
+
req,
|
|
14705
|
+
auth: resolvedAuth,
|
|
14706
|
+
trustedProxies: loadConfig().gateway?.trustedProxies ?? [],
|
|
14707
|
+
clients
|
|
14708
|
+
})) {
|
|
14709
|
+
socket.write("HTTP/1.1 401 Unauthorized\r\nConnection: close\r\n\r\n");
|
|
14710
|
+
socket.destroy();
|
|
14711
|
+
return;
|
|
14712
|
+
}
|
|
14713
|
+
}
|
|
14714
|
+
if (canvasHost.handleUpgrade(req, socket, head)) return;
|
|
14715
|
+
}
|
|
14716
|
+
wss.handleUpgrade(req, socket, head, (ws) => {
|
|
14717
|
+
wss.emit("connection", ws, req);
|
|
14718
|
+
});
|
|
14719
|
+
})().catch(() => {
|
|
14720
|
+
socket.destroy();
|
|
14023
14721
|
});
|
|
14024
14722
|
});
|
|
14025
14723
|
}
|
|
@@ -14338,6 +15036,8 @@ async function createGatewayRuntimeState(params) {
|
|
|
14338
15036
|
} catch (err) {
|
|
14339
15037
|
params.logCanvas.warn(`canvas host failed to start: ${String(err)}`);
|
|
14340
15038
|
}
|
|
15039
|
+
const clients = /* @__PURE__ */ new Set();
|
|
15040
|
+
const { broadcast, broadcastToConnIds } = createGatewayBroadcaster({ clients });
|
|
14341
15041
|
const handleHooksRequest = createGatewayHooksRequestHandler({
|
|
14342
15042
|
deps: params.deps,
|
|
14343
15043
|
getHooksConfig: params.hooksConfig,
|
|
@@ -14355,6 +15055,7 @@ async function createGatewayRuntimeState(params) {
|
|
|
14355
15055
|
for (const host of bindHosts) {
|
|
14356
15056
|
const httpServer = createGatewayHttpServer({
|
|
14357
15057
|
canvasHost,
|
|
15058
|
+
clients,
|
|
14358
15059
|
controlUiEnabled: params.controlUiEnabled,
|
|
14359
15060
|
controlUiBasePath: params.controlUiBasePath,
|
|
14360
15061
|
controlUiRoot: params.controlUiRoot,
|
|
@@ -14388,10 +15089,10 @@ async function createGatewayRuntimeState(params) {
|
|
|
14388
15089
|
for (const server of httpServers) attachGatewayUpgradeHandler({
|
|
14389
15090
|
httpServer: server,
|
|
14390
15091
|
wss,
|
|
14391
|
-
canvasHost
|
|
15092
|
+
canvasHost,
|
|
15093
|
+
clients,
|
|
15094
|
+
resolvedAuth: params.resolvedAuth
|
|
14392
15095
|
});
|
|
14393
|
-
const clients = /* @__PURE__ */ new Set();
|
|
14394
|
-
const { broadcast } = createGatewayBroadcaster({ clients });
|
|
14395
15096
|
const agentRunSeq = /* @__PURE__ */ new Map();
|
|
14396
15097
|
const dedupe = /* @__PURE__ */ new Map();
|
|
14397
15098
|
const chatRunState = createChatRunState();
|
|
@@ -14400,6 +15101,8 @@ async function createGatewayRuntimeState(params) {
|
|
|
14400
15101
|
const chatDeltaSentAt = chatRunState.deltaSentAt;
|
|
14401
15102
|
const addChatRun = chatRunRegistry.add;
|
|
14402
15103
|
const removeChatRun = chatRunRegistry.remove;
|
|
15104
|
+
const chatAbortControllers = /* @__PURE__ */ new Map();
|
|
15105
|
+
const toolEventRecipients = createToolEventRecipientRegistry();
|
|
14403
15106
|
return {
|
|
14404
15107
|
canvasHost,
|
|
14405
15108
|
httpServer,
|
|
@@ -14408,6 +15111,7 @@ async function createGatewayRuntimeState(params) {
|
|
|
14408
15111
|
wss,
|
|
14409
15112
|
clients,
|
|
14410
15113
|
broadcast,
|
|
15114
|
+
broadcastToConnIds,
|
|
14411
15115
|
agentRunSeq,
|
|
14412
15116
|
dedupe,
|
|
14413
15117
|
chatRunState,
|
|
@@ -14415,7 +15119,8 @@ async function createGatewayRuntimeState(params) {
|
|
|
14415
15119
|
chatDeltaSentAt,
|
|
14416
15120
|
addChatRun,
|
|
14417
15121
|
removeChatRun,
|
|
14418
|
-
chatAbortControllers
|
|
15122
|
+
chatAbortControllers,
|
|
15123
|
+
toolEventRecipients
|
|
14419
15124
|
};
|
|
14420
15125
|
}
|
|
14421
15126
|
|
|
@@ -14884,7 +15589,7 @@ function formatGatewayAuthFailureMessage(params) {
|
|
|
14884
15589
|
const isCli = isGatewayCliClient(client);
|
|
14885
15590
|
const isControlUi = client?.id === GATEWAY_CLIENT_IDS.CONTROL_UI;
|
|
14886
15591
|
const isWebchat = isWebchatClient(client);
|
|
14887
|
-
const tokenHint = isCli ? "set gateway.remote.token to match gateway.auth.token" : isControlUi || isWebchat ? "open
|
|
15592
|
+
const tokenHint = isCli ? "set gateway.remote.token to match gateway.auth.token" : isControlUi || isWebchat ? "open the dashboard URL and paste the token in Control UI settings" : "provide gateway auth token";
|
|
14888
15593
|
const passwordHint = isCli ? "set gateway.remote.password to match gateway.auth.password" : isControlUi || isWebchat ? "enter the password in Control UI settings" : "provide gateway auth password";
|
|
14889
15594
|
switch (reason) {
|
|
14890
15595
|
case "token_missing": return `unauthorized: gateway token missing (${tokenHint})`;
|
|
@@ -15452,7 +16157,8 @@ function attachGatewayWsMessageHandler(params) {
|
|
|
15452
16157
|
socket,
|
|
15453
16158
|
connect: connectParams,
|
|
15454
16159
|
connId,
|
|
15455
|
-
presenceKey
|
|
16160
|
+
presenceKey,
|
|
16161
|
+
clientIp: reportedClientIp
|
|
15456
16162
|
};
|
|
15457
16163
|
setClient(nextClient);
|
|
15458
16164
|
setHandshakeState("connected");
|
|
@@ -15872,7 +16578,7 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
15872
16578
|
let canvasHostServer = null;
|
|
15873
16579
|
const gatewayTls = await loadGatewayTlsRuntime(cfgAtStart.gateway?.tls, log.child("tls"));
|
|
15874
16580
|
if (cfgAtStart.gateway?.tls?.enabled && !gatewayTls.enabled) throw new Error(gatewayTls.error ?? "gateway tls: failed to enable");
|
|
15875
|
-
const { canvasHost, httpServer, httpServers, httpBindHosts, wss, clients, broadcast, agentRunSeq, dedupe, chatRunState, chatRunBuffers, chatDeltaSentAt, addChatRun, removeChatRun, chatAbortControllers } = await createGatewayRuntimeState({
|
|
16581
|
+
const { canvasHost, httpServer, httpServers, httpBindHosts, wss, clients, broadcast, broadcastToConnIds, agentRunSeq, dedupe, chatRunState, chatRunBuffers, chatDeltaSentAt, addChatRun, removeChatRun, chatAbortControllers, toolEventRecipients } = await createGatewayRuntimeState({
|
|
15876
16582
|
cfg: cfgAtStart,
|
|
15877
16583
|
bindHost,
|
|
15878
16584
|
port,
|
|
@@ -15967,11 +16673,13 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
15967
16673
|
});
|
|
15968
16674
|
const agentUnsub = onAgentEvent(createAgentEventHandler({
|
|
15969
16675
|
broadcast,
|
|
16676
|
+
broadcastToConnIds,
|
|
15970
16677
|
nodeSendToSession,
|
|
15971
16678
|
agentRunSeq,
|
|
15972
16679
|
chatRunState,
|
|
15973
16680
|
resolveSessionKeyForRun,
|
|
15974
|
-
clearAgentRunContext
|
|
16681
|
+
clearAgentRunContext,
|
|
16682
|
+
toolEventRecipients
|
|
15975
16683
|
}));
|
|
15976
16684
|
const heartbeatUnsub = onHeartbeatEvent((evt) => {
|
|
15977
16685
|
broadcast("heartbeat", evt, { dropIfSlow: true });
|
|
@@ -16010,6 +16718,7 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
16010
16718
|
incrementPresenceVersion,
|
|
16011
16719
|
getHealthVersion,
|
|
16012
16720
|
broadcast,
|
|
16721
|
+
broadcastToConnIds,
|
|
16013
16722
|
nodeSendToSession,
|
|
16014
16723
|
nodeSendToAllSubscribed,
|
|
16015
16724
|
nodeSubscribe,
|
|
@@ -16024,6 +16733,7 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
16024
16733
|
chatDeltaSentAt: chatRunState.deltaSentAt,
|
|
16025
16734
|
addChatRun,
|
|
16026
16735
|
removeChatRun,
|
|
16736
|
+
registerToolEventRecipient: toolEventRecipients.add,
|
|
16027
16737
|
dedupe,
|
|
16028
16738
|
wizardSessions,
|
|
16029
16739
|
findRunningWizard,
|