@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,89 +1,94 @@
|
|
|
1
1
|
import { $ as DEFAULT_CHAT_CHANNEL, A as getChildLogger, B as resolveConfigPath, C as setVerbose, D as colorize, F as CONFIG_PATH, L as STATE_DIR, M as getResolvedLoggerSettings, O as isRich, R as isNixMode, U as resolveGatewayLockDir, W as resolveGatewayPort, X as resolveStateDir, Z as CHANNEL_IDS, j as getLogger, k as theme, l as setConsoleSubsystemFilter, n as isTruthyEnvValue, o as createSubsystemLogger, p as defaultRuntime, r as logAcceptedEnvOption, s as runtimeForLogger, st as getActivePluginRegistry, u as setConsoleTimestampPrefix } from "./entry.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as formatCliCommand } from "./command-format-
|
|
4
|
-
import {
|
|
5
|
-
import { b as truncateUtf16Safe, g as shortenHomePath, m as resolveUserPath, o as ensureDir, t as CONFIG_DIR } from "./utils-
|
|
6
|
-
import { a as logDebug, c as logWarn, n as runExec, t as runCommandWithTimeout } from "./exec-
|
|
7
|
-
import { t as resolveOpenClawPackageRoot } from "./openclaw-root-
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import
|
|
11
|
-
import { o as
|
|
12
|
-
import "./
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { n as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { i as
|
|
23
|
-
import {
|
|
24
|
-
import { t as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import "./
|
|
28
|
-
import "./
|
|
29
|
-
import
|
|
30
|
-
import { n as
|
|
31
|
-
import "./
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import "./
|
|
35
|
-
import "./
|
|
36
|
-
import "./
|
|
37
|
-
import "./
|
|
38
|
-
import
|
|
39
|
-
import "./
|
|
40
|
-
import
|
|
41
|
-
import {
|
|
42
|
-
import
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import { d as
|
|
47
|
-
import "./
|
|
48
|
-
import {
|
|
49
|
-
import "./
|
|
50
|
-
import "./
|
|
51
|
-
import {
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import {
|
|
55
|
-
import "./
|
|
56
|
-
import "./
|
|
57
|
-
import { r as
|
|
58
|
-
import "./
|
|
59
|
-
import
|
|
60
|
-
import "./
|
|
61
|
-
import {
|
|
62
|
-
import "./
|
|
63
|
-
import "./
|
|
64
|
-
import "./
|
|
65
|
-
import "./
|
|
66
|
-
import
|
|
67
|
-
import "./
|
|
68
|
-
import "./
|
|
69
|
-
import
|
|
70
|
-
import
|
|
71
|
-
import
|
|
72
|
-
import {
|
|
73
|
-
import
|
|
74
|
-
import
|
|
75
|
-
import "./
|
|
76
|
-
import "./
|
|
77
|
-
import { i as
|
|
78
|
-
import {
|
|
79
|
-
import {
|
|
80
|
-
import "./
|
|
81
|
-
import
|
|
82
|
-
import
|
|
83
|
-
import {
|
|
84
|
-
import "./
|
|
85
|
-
import "./status
|
|
86
|
-
import
|
|
2
|
+
import { D as isCliProvider, E as getModelRefStatus, F as resolveHooksGmailModel, L as resolveThinkingDefault, N as resolveConfiguredModelRef, P as resolveDefaultModelForAgent, _t as DEFAULT_PROVIDER, gt as DEFAULT_MODEL, ht as DEFAULT_CONTEXT_TOKENS, j as resolveAllowedModelRef } from "./auth-profiles-CYBuGiBb.js";
|
|
3
|
+
import { t as formatCliCommand } from "./command-format-ayFsmwwz.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-CZkcvAtx.js";
|
|
5
|
+
import { b as truncateUtf16Safe, g as shortenHomePath, m as resolveUserPath, o as ensureDir, t as CONFIG_DIR } from "./utils-DX85MiPR.js";
|
|
6
|
+
import { a as logDebug, c as logWarn, n as runExec, t as runCommandWithTimeout } from "./exec-B8JKbXKW.js";
|
|
7
|
+
import { t as resolveOpenClawPackageRoot } from "./openclaw-root-9ILYSmJ9.js";
|
|
8
|
+
import { T as resolveWorkspaceTemplateDir, _ as DEFAULT_MEMORY_FILENAME, b as DEFAULT_USER_FILENAME, c as resolveDefaultAgentId, d as DEFAULT_AGENTS_FILENAME, g as DEFAULT_MEMORY_ALT_FILENAME, h as DEFAULT_IDENTITY_FILENAME, i as resolveAgentModelFallbacksOverride, l as resolveSessionAgentId, m as DEFAULT_HEARTBEAT_FILENAME, n as resolveAgentConfig, p as DEFAULT_BOOTSTRAP_FILENAME, r as resolveAgentDir, s as resolveAgentWorkspaceDir, t as listAgentIds, v as DEFAULT_SOUL_FILENAME, w as resolveDefaultAgentWorkspaceDir, x as ensureAgentWorkspace, y as DEFAULT_TOOLS_FILENAME } from "./agent-scope-C9VjJXEK.js";
|
|
9
|
+
import "./github-copilot-token-SLWintYd.js";
|
|
10
|
+
import "./pi-model-discovery-DzEIEgHL.js";
|
|
11
|
+
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-CKLedg5Y.js";
|
|
12
|
+
import { o as isTestDefaultMemorySlotDisabled } from "./manifest-registry-C69Z-I4v.js";
|
|
13
|
+
import "./server-context-yKyxyxOJ.js";
|
|
14
|
+
import { d as ensurePortAvailable, f as inspectPortUsage, m as formatPortDiagnostics, n as formatErrorMessage } from "./errors-CZ9opC6L.js";
|
|
15
|
+
import { t as rawDataToString } from "./ws-D091yo4M.js";
|
|
16
|
+
import { n as createBrowserControlContext, r as startBrowserControlServiceFromConfig } from "./control-service-D2E9NKqQ.js";
|
|
17
|
+
import { t as ensureOpenClawCliOnPath } from "./path-env-h3xp5PqO.js";
|
|
18
|
+
import { i as enableTailscaleServe, n as disableTailscaleServe, o as getTailnetHostname, r as enableTailscaleFunnel, t as disableTailscaleFunnel } from "./tailscale-9MusRvOi.js";
|
|
19
|
+
import { n as pickPrimaryTailnetIPv6, t as pickPrimaryTailnetIPv4 } from "./tailnet-Byp3obcc.js";
|
|
20
|
+
import { a as resolveGatewayBindHost, n as isLoopbackHost$2, o as resolveGatewayClientIp, r as isTrustedProxyAddress, s as resolveGatewayListenHosts, t as isLoopbackAddress } from "./net-CWMMy37F.js";
|
|
21
|
+
import { i as resolveGatewayAuth, n as authorizeGatewayConnect, r as isLocalDirectRequest, t as assertGatewayAuthConfigured } from "./auth-DksjO6WG.js";
|
|
22
|
+
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-CxbkcEZ7.js";
|
|
23
|
+
import { n as callGateway, o as loadGatewayTlsRuntime$1 } from "./call-90HgQQ8o.js";
|
|
24
|
+
import { f as GATEWAY_CLIENT_CAPS, g as hasGatewayClientCap, h as GATEWAY_CLIENT_NAMES, i as isGatewayMessageChannel, l as normalizeMessageChannel, m as GATEWAY_CLIENT_MODES, n as isDeliverableMessageChannel, p as GATEWAY_CLIENT_IDS, r as isGatewayCliClient, s as isWebchatClient, t as INTERNAL_MESSAGE_CHANNEL } from "./message-channel-BlgPSDAh.js";
|
|
25
|
+
import { t as formatDocsLink } from "./links-D0uzJbi6.js";
|
|
26
|
+
import { r as buildChannelUiCatalog, t as applyPluginAutoEnable } from "./plugin-auto-enable-DyW8lHTT.js";
|
|
27
|
+
import { n as listChannelPlugins, r as normalizeChannelId, t as getChannelPlugin } from "./plugins-BUPpq5aS.js";
|
|
28
|
+
import "./logging-CfEk_PnX.js";
|
|
29
|
+
import "./accounts-Dto4p9zB.js";
|
|
30
|
+
import { $ as approveNodePairing, $n as isTtsEnabled, $t as listSessionsFromStore, A as resolveHeartbeatVisibility, An as scheduleGatewaySigusr1Restart, Ar as clearInternalHooks, B as createReplyDispatcher, Bn as normalizeCronJobPatch, Bt as emitAgentEvent, C as buildControlUiAvatarUrl, Cn as resetDirectoryCache, Cr as resolveUserTimeFormat, Ct as normalizeMimeList, Dn as authorizeGatewaySigusr1Restart, Dt as runEmbeddedPiAgent, Et as stopSubagentsForRequester, Ft as getHookType, G as normalizeSendPolicy, Gn as isSystemEventContextChanged, H as getCliSessionId, Ht as onAgentEvent, In as summarizeRestartSentinel, It as isExternalHookSession, J as primeRemoteSkillsCache, Jt as loadProviderUsageSummary, K as resolveSendPolicy, Kt as loadModelCatalog, L as getChannelActivity, Lt as initSubagentRegistry, M as getLastHeartbeatEvent, Mn as consumeRestartSentinel, Mr as registerInternalHook, Mt as createOpenClawTools, N as onHeartbeatEvent, Nn as formatDoctorNonInteractiveHint, Nr as triggerInternalHook, Nt as buildSafeExternalPrompt, O as createReplyPrefixOptions, On as consumeGatewaySigusr1RestartAuthorization, Or as resolveAgentIdentity, Ot as abortEmbeddedPiRun, Pn as formatRestartSentinelMessage, Pt as detectSuspiciousPatterns, Q as setSkillsRemoteRegistry, Qn as getTtsProvider, Qt as listAgentsForGateway, Rn as writeRestartSentinel, Rt as resolveAgentTimeoutMs, S as CONTROL_UI_AVATAR_PREFIX, Sr as formatUserTime, St as extractImageContentFromSource, T as resolveAssistantAvatarUrl, Tn as runWithModelFallback, Tt as isAbortTrigger, U as setCliSessionId, Ut as registerAgentRunContext, Vn as migrateLegacyCronPayload, Vt as getAgentRunContext, W as runCliAgent, Wn as enqueueSystemEvent, Wt as resolveAnnounceTargetFromKey, X as refreshRemoteBinsForConnectedNodes, Xn as OPENAI_TTS_MODELS, Y as recordRemoteNodeInfo, Yn as getPluginToolMeta, Z as refreshRemoteNodeBins, Zn as OPENAI_TTS_VOICES, _t as DEFAULT_INPUT_PDF_MAX_PAGES, an as capArrayByJsonBytes, ar as resolveTtsProviderOrder, at as verifyNodeToken, bn as resolveOutboundTarget, bt as DEFAULT_INPUT_TIMEOUT_MS, cn as resolveSessionTranscriptCandidates, cr as textToSpeech, d as handleReset, dn as lookupContextTokens, dr as CommandLane, dt as DEFAULT_INPUT_FILE_MAX_BYTES, en as loadCombinedSessionStoreForGateway, er as isTtsProviderConfigured, et as listNodePairing, fn as clearSessionQueues, fr as startDiagnosticHeartbeat, ft as DEFAULT_INPUT_FILE_MAX_CHARS, gn as resolveOutboundSessionRoute, gt as DEFAULT_INPUT_MAX_REDIRECTS, hn as ensureOutboundSessionEntry, hr as DEFAULT_HEARTBEAT_ACK_MAX_CHARS, ht as DEFAULT_INPUT_IMAGE_MIMES, in as archiveFileOnDisk, ir as resolveTtsPrefsPath, it as updatePairedNodeMetadata, jn as setGatewaySigusr1RestartPolicy, jr as createInternalHookEvent, jt as registerUnhandledRejectionHandler, k as buildHistoryContextFromEntries, kn as isGatewaySigusr1RestartExternallyAllowed, kt as waitForEmbeddedPiRunEnd, ln as stripEnvelopeFromMessages, lt as applyVerboseOverride, mr as isDiagnosticsEnabled, mt as DEFAULT_INPUT_IMAGE_MAX_BYTES, n as handleSlackHttpRequest, nn as resolveGatewaySessionStoreTarget, nr as resolveTtsAutoMode, nt as renamePairedNode, on as readSessionMessages, or as setTtsEnabled, ot as getSkillsSnapshotVersion, pn as normalizeGroupActivation, pr as stopDiagnosticHeartbeat, pt as DEFAULT_INPUT_FILE_MIMES, q as getRemoteSkillEligibility, qn as requestHeartbeatNow, qt as applyModelOverrideToSessionEntry, rn as resolveSessionModelRef, rr as resolveTtsConfig, rt as requestNodePairing, sn as readSessionPreviewItemsFromTranscript, sr as setTtsProvider, st as registerSkillsChangeListener, t as loadOpenClawPlugins, tn as loadSessionEntry, tr as resolveTtsApiKey, tt as rejectNodePairing, ur as setCommandLaneConcurrency, ut as parseVerboseOverride, vt as DEFAULT_INPUT_PDF_MAX_PIXELS, w as normalizeControlUiBasePath, wr as resolveUserTimezone, wt as formatZonedTimestamp, xn as resolveSessionDeliveryTarget, xr as normalizePollInput, xt as extractFileContentFromSource, yr as stripHeartbeatToken, yt as DEFAULT_INPUT_PDF_MIN_TEXT_CHARS, z as dispatchInboundMessage, zn as normalizeCronJobCreate, zt as clearAgentRunContext } from "./loader-_Pj-TZS2.js";
|
|
31
|
+
import { n as withProgress } from "./progress-Da1ehW-x.js";
|
|
32
|
+
import "./prompt-style-Dc0C5HC9.js";
|
|
33
|
+
import "./note-Ci08TSbV.js";
|
|
34
|
+
import { t as WizardCancelledError } from "./prompts-CXLLIBwP.js";
|
|
35
|
+
import { t as resolveChannelDefaultAccountId } from "./helpers-D66_XoIz.js";
|
|
36
|
+
import "./onboard-channels-D-ZQTy5V.js";
|
|
37
|
+
import "./archive-D0z3LZDK.js";
|
|
38
|
+
import "./skill-scanner-Bp1D9gra.js";
|
|
39
|
+
import "./installs-DsJkyWfL.js";
|
|
40
|
+
import "./manager-BXiIQku7.js";
|
|
41
|
+
import { n as resolveSessionFilePath, o as resolveStorePath, r as resolveSessionTranscriptPath } from "./paths-CTg8F3AE.js";
|
|
42
|
+
import "./sqlite-DqUEZnjO.js";
|
|
43
|
+
import { m as detectMime, r as saveMediaBuffer } from "./routes-BSfXf8a5.js";
|
|
44
|
+
import { B as normalizeThinkLevel, F as formatXHighModelHint, H as normalizeVerboseLevel, P as formatThinkingLevels, R as normalizeElevatedLevel, V as normalizeUsageDisplay, W as supportsXHighThinking, z as normalizeReasoningLevel } from "./pi-embedded-helpers-DF8SAHU-.js";
|
|
45
|
+
import { o as normalizeReplyPayloadsForDelivery, t as deliverOutboundPayloads } from "./deliver-Cau4HL7W.js";
|
|
46
|
+
import { $ as stripPluginOnlyAllowlist, F as resolveExplicitAgentSessionKey, I as resolveMainSessionKey, J as collectExplicitAllowlist, L as resolveMainSessionKeyFromConfig, P as resolveAgentMainSessionKey, Q as resolveToolProfilePolicy, S as mergeDeliveryContext, Y as expandPolicyWithPluginGroups, Z as normalizeToolName, b as deliveryContextFromSession, d as loadSessionStore, g as updateSessionStore, q as buildPluginToolGroups, w as normalizeSessionDeliveryFields, z as snapshotSessionOrigin } from "./sandbox-DuqLKN5J.js";
|
|
47
|
+
import "./channel-summary-D9nzC5WB.js";
|
|
48
|
+
import { i as getMachineDisplayName, r as createBrowserRouteDispatcher } from "./wsl-ATjkMwMA.js";
|
|
49
|
+
import { d as hasBinary, i as loadWorkspaceSkillEntries, r as buildWorkspaceSkillSnapshot } from "./skills-CmU0Q92f.js";
|
|
50
|
+
import "./image-nRwqkmtf.js";
|
|
51
|
+
import { c as normalizeExecApprovals, g as saveExecApprovals, l as readExecApprovalsSnapshot, m as resolveExecApprovalsSocketPath, r as ensureExecApprovals } from "./exec-approvals-BCEFzcbC.js";
|
|
52
|
+
import "./redact-B8YiFlwn.js";
|
|
53
|
+
import "./tool-display-DmgKs6-V.js";
|
|
54
|
+
import { t as parseAbsoluteTimeMs } from "./parse-gTOGQPH6.js";
|
|
55
|
+
import { n as resolveMessageChannelSelection } from "./channel-selection-PZuuCvrp.js";
|
|
56
|
+
import { i as loadSessionUsageTimeSeries, l as hasNonzeroUsage, n as loadCostUsageSummary, r as loadSessionCostSummary, t as discoverAllSessions } from "./session-cost-usage-BTXosU1k.js";
|
|
57
|
+
import { n as formatTokenCount, r as formatUsd } from "./usage-format-E3bMcUMV.js";
|
|
58
|
+
import { c as resolveSubagentToolPolicy, i as filterToolsByPolicy, o as resolveEffectiveToolPolicy, s as resolveGroupToolPolicy } from "./commands-DAC7XMAT.js";
|
|
59
|
+
import "./pairing-store-DTfv_FGA.js";
|
|
60
|
+
import "./login-qr-Cmsf7BGt.js";
|
|
61
|
+
import { r as runCommandWithRuntime } from "./cli-utils-ByANh4Sp.js";
|
|
62
|
+
import "./pairing-labels-BbydDT7w.js";
|
|
63
|
+
import { t as buildChannelAccountSnapshot } from "./status-CRIEi8Mc.js";
|
|
64
|
+
import "./channels-status-issues-CJ8PJgDc.js";
|
|
65
|
+
import "./register.subclis-BpIR6Iqi.js";
|
|
66
|
+
import "./completion-cli-BbhA_JbG.js";
|
|
67
|
+
import { n as createOutboundSendDeps, t as createDefaultDeps } from "./deps-ytXmI88x.js";
|
|
68
|
+
import "./daemon-runtime-BCn_QIHK.js";
|
|
69
|
+
import "./service-_JwSmGSn.js";
|
|
70
|
+
import "./systemd-8sIc6isV.js";
|
|
71
|
+
import "./shared-fnGLWyZ6.js";
|
|
72
|
+
import { a as runDaemonStop, i as runDaemonStart, n as runDaemonStatus, o as runDaemonUninstall, r as runDaemonRestart, s as runDaemonInstall } from "./daemon-cli-CMKd_D6h.js";
|
|
73
|
+
import "./service-audit-DDX1kO3k.js";
|
|
74
|
+
import "./table-CJSx0YID.js";
|
|
75
|
+
import { n as resolveWideAreaDiscoveryDomain, r as writeWideAreaGatewayZone } from "./widearea-dns-CsSylzXH.js";
|
|
76
|
+
import { a as toOptionString, i as parsePort$1, n as extractGatewayMiskeys, r as maybeExplainGatewayServiceStop, t as describeUnknownError } from "./shared-C1XLEyB0.js";
|
|
77
|
+
import { i as probeGateway } from "./audit-BWbjQmyv.js";
|
|
78
|
+
import { g as discoverGatewayBeacons, n as installSkill } from "./onboard-skills-YobctE-R.js";
|
|
79
|
+
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-ND2rUbQO.js";
|
|
80
|
+
import { S as normalizeUpdateChannel, _ as resolveNpmChannelTag, h as compareSemverStrings, m as checkUpdateStatus, t as runGatewayUpdate, y as DEFAULT_PACKAGE_CHANNEL } from "./update-runner-2i8_mIG5.js";
|
|
81
|
+
import "./github-copilot-auth-B_lK1g__.js";
|
|
82
|
+
import "./logging-Cc7m6PTv.js";
|
|
83
|
+
import { i as shouldIncludeHook, n as loadWorkspaceHookEntries, r as resolveHookConfig } from "./hooks-status-CKmUPU-M.js";
|
|
84
|
+
import { f as runOnboardingWizard, n as getStatusSummary, s as loadAgentIdentity, u as loadAgentIdentityFromWorkspace } from "./status-BRXuHUsK.js";
|
|
85
|
+
import { t as buildWorkspaceSkillStatus } from "./skills-status-DtXrj3fy.js";
|
|
86
|
+
import "./tui-DPorsF4z.js";
|
|
87
|
+
import { i as setGatewayWsLogStyle, n as logWs, r as summarizeAgentEventForWsLog, t as formatForLog } from "./ws-log-DJIXahf0.js";
|
|
88
|
+
import { T as resolveGmailHookRuntimeConfig, _ as buildGogWatchServeArgs, i as ensureTailscaleEndpoint, v as buildGogWatchStartArgs } from "./gmail-setup-utils-Bi6W14MK.js";
|
|
89
|
+
import { a as createOutboundSendDeps$1, i as resolveAgentOutboundTarget, r as resolveAgentDeliveryPlan, t as agentCommand } from "./agent-DztWhVCH.js";
|
|
90
|
+
import "./node-service-Lc1LlnFH.js";
|
|
91
|
+
import { n as forceFreePortAndWait } from "./ports-0V-Mu4ch.js";
|
|
87
92
|
import { spawn, spawnSync } from "node:child_process";
|
|
88
93
|
import path from "node:path";
|
|
89
94
|
import os from "node:os";
|
|
@@ -1962,7 +1967,48 @@ function createChatRunState() {
|
|
|
1962
1967
|
clear
|
|
1963
1968
|
};
|
|
1964
1969
|
}
|
|
1965
|
-
|
|
1970
|
+
const TOOL_EVENT_RECIPIENT_TTL_MS = 600 * 1e3;
|
|
1971
|
+
const TOOL_EVENT_RECIPIENT_FINAL_GRACE_MS = 30 * 1e3;
|
|
1972
|
+
function createToolEventRecipientRegistry() {
|
|
1973
|
+
const recipients = /* @__PURE__ */ new Map();
|
|
1974
|
+
const prune = () => {
|
|
1975
|
+
if (recipients.size === 0) return;
|
|
1976
|
+
const now = Date.now();
|
|
1977
|
+
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);
|
|
1978
|
+
};
|
|
1979
|
+
const add = (runId, connId) => {
|
|
1980
|
+
if (!runId || !connId) return;
|
|
1981
|
+
const now = Date.now();
|
|
1982
|
+
const existing = recipients.get(runId);
|
|
1983
|
+
if (existing) {
|
|
1984
|
+
existing.connIds.add(connId);
|
|
1985
|
+
existing.updatedAt = now;
|
|
1986
|
+
} else recipients.set(runId, {
|
|
1987
|
+
connIds: new Set([connId]),
|
|
1988
|
+
updatedAt: now
|
|
1989
|
+
});
|
|
1990
|
+
prune();
|
|
1991
|
+
};
|
|
1992
|
+
const get = (runId) => {
|
|
1993
|
+
const entry = recipients.get(runId);
|
|
1994
|
+
if (!entry) return;
|
|
1995
|
+
entry.updatedAt = Date.now();
|
|
1996
|
+
prune();
|
|
1997
|
+
return entry.connIds;
|
|
1998
|
+
};
|
|
1999
|
+
const markFinal = (runId) => {
|
|
2000
|
+
const entry = recipients.get(runId);
|
|
2001
|
+
if (!entry) return;
|
|
2002
|
+
entry.finalizedAt = Date.now();
|
|
2003
|
+
prune();
|
|
2004
|
+
};
|
|
2005
|
+
return {
|
|
2006
|
+
add,
|
|
2007
|
+
get,
|
|
2008
|
+
markFinal
|
|
2009
|
+
};
|
|
2010
|
+
}
|
|
2011
|
+
function createAgentEventHandler({ broadcast, broadcastToConnIds, nodeSendToSession, agentRunSeq, chatRunState, resolveSessionKeyForRun, clearAgentRunContext, toolEventRecipients }) {
|
|
1966
2012
|
const emitChatDelta = (sessionKey, clientRunId, seq, text) => {
|
|
1967
2013
|
chatRunState.buffers.set(clientRunId, text);
|
|
1968
2014
|
const now = Date.now();
|
|
@@ -2018,17 +2064,17 @@ function createAgentEventHandler({ broadcast, nodeSendToSession, agentRunSeq, ch
|
|
|
2018
2064
|
broadcast("chat", payload);
|
|
2019
2065
|
nodeSendToSession(sessionKey, "chat", payload);
|
|
2020
2066
|
};
|
|
2021
|
-
const
|
|
2067
|
+
const resolveToolVerboseLevel = (runId, sessionKey) => {
|
|
2022
2068
|
const runVerbose = normalizeVerboseLevel(getAgentRunContext(runId)?.verboseLevel);
|
|
2023
|
-
if (runVerbose) return runVerbose
|
|
2024
|
-
if (!sessionKey) return
|
|
2069
|
+
if (runVerbose) return runVerbose;
|
|
2070
|
+
if (!sessionKey) return "off";
|
|
2025
2071
|
try {
|
|
2026
2072
|
const { cfg, entry } = loadSessionEntry(sessionKey);
|
|
2027
2073
|
const sessionVerbose = normalizeVerboseLevel(entry?.verboseLevel);
|
|
2028
|
-
if (sessionVerbose) return sessionVerbose
|
|
2029
|
-
return normalizeVerboseLevel(cfg.agents?.defaults?.verboseDefault)
|
|
2074
|
+
if (sessionVerbose) return sessionVerbose;
|
|
2075
|
+
return normalizeVerboseLevel(cfg.agents?.defaults?.verboseDefault) ?? "off";
|
|
2030
2076
|
} catch {
|
|
2031
|
-
return
|
|
2077
|
+
return "off";
|
|
2032
2078
|
}
|
|
2033
2079
|
};
|
|
2034
2080
|
return (evt) => {
|
|
@@ -2041,10 +2087,25 @@ function createAgentEventHandler({ broadcast, nodeSendToSession, agentRunSeq, ch
|
|
|
2041
2087
|
sessionKey
|
|
2042
2088
|
} : evt;
|
|
2043
2089
|
const last = agentRunSeq.get(evt.runId) ?? 0;
|
|
2044
|
-
|
|
2090
|
+
const isToolEvent = evt.stream === "tool";
|
|
2091
|
+
const toolVerbose = isToolEvent ? resolveToolVerboseLevel(evt.runId, sessionKey) : "off";
|
|
2092
|
+
if (isToolEvent && toolVerbose === "off") {
|
|
2045
2093
|
agentRunSeq.set(evt.runId, evt.seq);
|
|
2046
2094
|
return;
|
|
2047
2095
|
}
|
|
2096
|
+
const toolPayload = isToolEvent && toolVerbose !== "full" ? (() => {
|
|
2097
|
+
const data = evt.data ? { ...evt.data } : {};
|
|
2098
|
+
delete data.result;
|
|
2099
|
+
delete data.partialResult;
|
|
2100
|
+
return sessionKey ? {
|
|
2101
|
+
...evt,
|
|
2102
|
+
sessionKey,
|
|
2103
|
+
data
|
|
2104
|
+
} : {
|
|
2105
|
+
...evt,
|
|
2106
|
+
data
|
|
2107
|
+
};
|
|
2108
|
+
})() : agentPayload;
|
|
2048
2109
|
if (evt.seq !== last + 1) broadcast("agent", {
|
|
2049
2110
|
runId: evt.runId,
|
|
2050
2111
|
stream: "error",
|
|
@@ -2057,10 +2118,13 @@ function createAgentEventHandler({ broadcast, nodeSendToSession, agentRunSeq, ch
|
|
|
2057
2118
|
}
|
|
2058
2119
|
});
|
|
2059
2120
|
agentRunSeq.set(evt.runId, evt.seq);
|
|
2060
|
-
|
|
2121
|
+
if (isToolEvent) {
|
|
2122
|
+
const recipients = toolEventRecipients.get(evt.runId);
|
|
2123
|
+
if (recipients && recipients.size > 0) broadcastToConnIds("agent", toolPayload, recipients);
|
|
2124
|
+
} else broadcast("agent", agentPayload);
|
|
2061
2125
|
const lifecyclePhase = evt.stream === "lifecycle" && typeof evt.data?.phase === "string" ? evt.data.phase : null;
|
|
2062
2126
|
if (sessionKey) {
|
|
2063
|
-
nodeSendToSession(sessionKey, "agent", agentPayload);
|
|
2127
|
+
nodeSendToSession(sessionKey, "agent", isToolEvent ? toolPayload : agentPayload);
|
|
2064
2128
|
if (!isAborted && evt.stream === "assistant" && typeof evt.data?.text === "string") emitChatDelta(sessionKey, clientRunId, evt.seq, evt.data.text);
|
|
2065
2129
|
else if (!isAborted && (lifecyclePhase === "end" || lifecyclePhase === "error")) if (chatLink) {
|
|
2066
2130
|
const finished = chatRunState.registry.shift(evt.runId);
|
|
@@ -2078,7 +2142,10 @@ function createAgentEventHandler({ broadcast, nodeSendToSession, agentRunSeq, ch
|
|
|
2078
2142
|
if (chatLink) chatRunState.registry.remove(evt.runId, clientRunId, sessionKey);
|
|
2079
2143
|
}
|
|
2080
2144
|
}
|
|
2081
|
-
if (lifecyclePhase === "end" || lifecyclePhase === "error")
|
|
2145
|
+
if (lifecyclePhase === "end" || lifecyclePhase === "error") {
|
|
2146
|
+
toolEventRecipients.markFinal(evt.runId);
|
|
2147
|
+
clearAgentRunContext(evt.runId);
|
|
2148
|
+
}
|
|
2082
2149
|
};
|
|
2083
2150
|
}
|
|
2084
2151
|
|
|
@@ -2578,7 +2645,10 @@ async function runCronIsolatedAgentTurn(params) {
|
|
|
2578
2645
|
model,
|
|
2579
2646
|
catalog: await loadCatalog()
|
|
2580
2647
|
});
|
|
2581
|
-
if (thinkLevel === "xhigh" && !supportsXHighThinking(provider, model))
|
|
2648
|
+
if (thinkLevel === "xhigh" && !supportsXHighThinking(provider, model)) {
|
|
2649
|
+
logWarn(`[cron:${params.job.id}] Thinking level "xhigh" is not supported for ${provider}/${model}; downgrading to "high".`);
|
|
2650
|
+
thinkLevel = "high";
|
|
2651
|
+
}
|
|
2582
2652
|
const timeoutMs = resolveAgentTimeoutMs({
|
|
2583
2653
|
cfg: cfgWithAgentDefaults,
|
|
2584
2654
|
overrideSeconds: params.job.payload.kind === "agentTurn" ? params.job.payload.timeoutSeconds : void 0
|
|
@@ -2855,7 +2925,8 @@ async function readCronRunLogEntries(filePath, opts) {
|
|
|
2855
2925
|
//#region src/cron/schedule.ts
|
|
2856
2926
|
function computeNextRunAtMs(schedule, nowMs) {
|
|
2857
2927
|
if (schedule.kind === "at") {
|
|
2858
|
-
const
|
|
2928
|
+
const sched = schedule;
|
|
2929
|
+
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;
|
|
2859
2930
|
if (atMs === null) return;
|
|
2860
2931
|
return atMs > nowMs ? atMs : void 0;
|
|
2861
2932
|
}
|
|
@@ -2931,7 +3002,8 @@ function computeJobNextRunAtMs(job, nowMs) {
|
|
|
2931
3002
|
if (!job.enabled) return;
|
|
2932
3003
|
if (job.schedule.kind === "at") {
|
|
2933
3004
|
if (job.state.lastStatus === "ok" && job.state.lastRunAtMs) return;
|
|
2934
|
-
const
|
|
3005
|
+
const schedule = job.schedule;
|
|
3006
|
+
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;
|
|
2935
3007
|
return atMs !== null ? atMs : void 0;
|
|
2936
3008
|
}
|
|
2937
3009
|
return computeNextRunAtMs(job.schedule, nowMs);
|
|
@@ -3251,10 +3323,6 @@ async function getFileMtimeMs(path) {
|
|
|
3251
3323
|
}
|
|
3252
3324
|
async function ensureLoaded(state, opts) {
|
|
3253
3325
|
if (state.store && !opts?.forceReload) return;
|
|
3254
|
-
if (opts?.forceReload && state.store) {
|
|
3255
|
-
const mtime = await getFileMtimeMs(state.deps.storePath);
|
|
3256
|
-
if (mtime !== null && state.storeFileMtimeMs !== null && mtime === state.storeFileMtimeMs) return;
|
|
3257
|
-
}
|
|
3258
3326
|
const fileMtimeMs = await getFileMtimeMs(state.deps.storePath);
|
|
3259
3327
|
const jobs = (await loadCronStore(state.deps.storePath)).jobs ?? [];
|
|
3260
3328
|
let mutated = false;
|
|
@@ -3341,7 +3409,7 @@ async function ensureLoaded(state, opts) {
|
|
|
3341
3409
|
};
|
|
3342
3410
|
state.storeLoadedAtMs = state.deps.nowMs();
|
|
3343
3411
|
state.storeFileMtimeMs = fileMtimeMs;
|
|
3344
|
-
recomputeNextRuns(state);
|
|
3412
|
+
if (!opts?.skipRecompute) recomputeNextRuns(state);
|
|
3345
3413
|
if (mutated) await persist(state);
|
|
3346
3414
|
}
|
|
3347
3415
|
function warnIfDisabled(state, action) {
|
|
@@ -3376,20 +3444,23 @@ function armTimer(state) {
|
|
|
3376
3444
|
state.deps.log.error({ err: String(err) }, "cron: timer tick failed");
|
|
3377
3445
|
});
|
|
3378
3446
|
}, clampedDelay);
|
|
3379
|
-
state.timer.unref?.();
|
|
3380
3447
|
}
|
|
3381
3448
|
async function onTimer(state) {
|
|
3382
3449
|
if (state.running) return;
|
|
3383
3450
|
state.running = true;
|
|
3384
3451
|
try {
|
|
3385
3452
|
await locked(state, async () => {
|
|
3386
|
-
await ensureLoaded(state, {
|
|
3453
|
+
await ensureLoaded(state, {
|
|
3454
|
+
forceReload: true,
|
|
3455
|
+
skipRecompute: true
|
|
3456
|
+
});
|
|
3387
3457
|
await runDueJobs(state);
|
|
3458
|
+
recomputeNextRuns(state);
|
|
3388
3459
|
await persist(state);
|
|
3389
|
-
armTimer(state);
|
|
3390
3460
|
});
|
|
3391
3461
|
} finally {
|
|
3392
3462
|
state.running = false;
|
|
3463
|
+
armTimer(state);
|
|
3393
3464
|
}
|
|
3394
3465
|
}
|
|
3395
3466
|
async function runDueJobs(state) {
|
|
@@ -4932,7 +5003,7 @@ function timestampOptsFromConfig(cfg) {
|
|
|
4932
5003
|
//#endregion
|
|
4933
5004
|
//#region src/gateway/server-methods/agent.ts
|
|
4934
5005
|
const agentHandlers = {
|
|
4935
|
-
agent: async ({ params, respond, context }) => {
|
|
5006
|
+
agent: async ({ params, respond, context, client }) => {
|
|
4936
5007
|
const p = params;
|
|
4937
5008
|
if (!validateAgentParams(p)) {
|
|
4938
5009
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid agent params: ${formatValidationErrors(validateAgentParams.errors)}`));
|
|
@@ -5082,6 +5153,9 @@ const agentHandlers = {
|
|
|
5082
5153
|
registerAgentRunContext(idem, { sessionKey: requestedSessionKey });
|
|
5083
5154
|
}
|
|
5084
5155
|
const runId = idem;
|
|
5156
|
+
const connId = typeof client?.connId === "string" ? client.connId : void 0;
|
|
5157
|
+
const wantsToolEvents = hasGatewayClientCap(client?.connect?.caps, GATEWAY_CLIENT_CAPS.TOOL_EVENTS);
|
|
5158
|
+
if (connId && wantsToolEvents) context.registerToolEventRecipient(runId, connId);
|
|
5085
5159
|
const wantsDelivery = request.deliver === true;
|
|
5086
5160
|
const explicitTo = typeof request.replyTo === "string" && request.replyTo.trim() ? request.replyTo.trim() : typeof request.to === "string" && request.to.trim() ? request.to.trim() : void 0;
|
|
5087
5161
|
const explicitThreadId = typeof request.threadId === "string" && request.threadId.trim() ? request.threadId.trim() : void 0;
|
|
@@ -6036,7 +6110,10 @@ const chatHandlers = {
|
|
|
6036
6110
|
const configured = cfg.agents?.defaults?.thinkingDefault;
|
|
6037
6111
|
if (configured) thinkingLevel = configured;
|
|
6038
6112
|
else {
|
|
6039
|
-
const { provider, model } = resolveSessionModelRef(cfg, entry
|
|
6113
|
+
const { provider, model } = resolveSessionModelRef(cfg, entry, resolveSessionAgentId({
|
|
6114
|
+
sessionKey,
|
|
6115
|
+
config: cfg
|
|
6116
|
+
}));
|
|
6040
6117
|
thinkingLevel = resolveThinkingDefault({
|
|
6041
6118
|
cfg,
|
|
6042
6119
|
provider,
|
|
@@ -6045,11 +6122,13 @@ const chatHandlers = {
|
|
|
6045
6122
|
});
|
|
6046
6123
|
}
|
|
6047
6124
|
}
|
|
6125
|
+
const verboseLevel = entry?.verboseLevel ?? cfg.agents?.defaults?.verboseDefault;
|
|
6048
6126
|
respond(true, {
|
|
6049
6127
|
sessionKey,
|
|
6050
6128
|
sessionId,
|
|
6051
6129
|
messages: capped,
|
|
6052
|
-
thinkingLevel
|
|
6130
|
+
thinkingLevel,
|
|
6131
|
+
verboseLevel
|
|
6053
6132
|
});
|
|
6054
6133
|
},
|
|
6055
6134
|
"chat.abort": ({ params, respond, context }) => {
|
|
@@ -6225,15 +6304,17 @@ const chatHandlers = {
|
|
|
6225
6304
|
SenderUsername: clientInfo?.displayName,
|
|
6226
6305
|
GatewayClientScopes: client?.connect?.scopes
|
|
6227
6306
|
};
|
|
6228
|
-
const
|
|
6229
|
-
|
|
6230
|
-
|
|
6307
|
+
const { onModelSelected, ...prefixOptions } = createReplyPrefixOptions({
|
|
6308
|
+
cfg,
|
|
6309
|
+
agentId: resolveSessionAgentId({
|
|
6310
|
+
sessionKey: p.sessionKey,
|
|
6311
|
+
config: cfg
|
|
6312
|
+
}),
|
|
6313
|
+
channel: INTERNAL_MESSAGE_CHANNEL
|
|
6231
6314
|
});
|
|
6232
|
-
let prefixContext = { identityName: resolveIdentityName(cfg, agentId) };
|
|
6233
6315
|
const finalReplyParts = [];
|
|
6234
6316
|
const dispatcher = createReplyDispatcher({
|
|
6235
|
-
|
|
6236
|
-
responsePrefixContextProvider: () => prefixContext,
|
|
6317
|
+
...prefixOptions,
|
|
6237
6318
|
onError: (err) => {
|
|
6238
6319
|
context.logGateway.warn(`webchat dispatch failed: ${formatForLog(err)}`);
|
|
6239
6320
|
},
|
|
@@ -6254,15 +6335,13 @@ const chatHandlers = {
|
|
|
6254
6335
|
abortSignal: abortController.signal,
|
|
6255
6336
|
images: parsedImages.length > 0 ? parsedImages : void 0,
|
|
6256
6337
|
disableBlockStreaming: true,
|
|
6257
|
-
onAgentRunStart: () => {
|
|
6338
|
+
onAgentRunStart: (runId) => {
|
|
6258
6339
|
agentRunStarted = true;
|
|
6340
|
+
const connId = typeof client?.connId === "string" ? client.connId : void 0;
|
|
6341
|
+
const wantsToolEvents = hasGatewayClientCap(client?.connect?.caps, GATEWAY_CLIENT_CAPS.TOOL_EVENTS);
|
|
6342
|
+
if (connId && wantsToolEvents) context.registerToolEventRecipient(runId, connId);
|
|
6259
6343
|
},
|
|
6260
|
-
onModelSelected
|
|
6261
|
-
prefixContext.provider = ctx.provider;
|
|
6262
|
-
prefixContext.model = extractShortModelName(ctx.model);
|
|
6263
|
-
prefixContext.modelFull = `${ctx.provider}/${ctx.model}`;
|
|
6264
|
-
prefixContext.thinkingLevel = ctx.thinkLevel ?? "off";
|
|
6265
|
-
}
|
|
6344
|
+
onModelSelected
|
|
6266
6345
|
}
|
|
6267
6346
|
}).then(() => {
|
|
6268
6347
|
if (!agentRunStarted) {
|
|
@@ -6436,6 +6515,123 @@ function applyMergePatch(base, patch) {
|
|
|
6436
6515
|
return result;
|
|
6437
6516
|
}
|
|
6438
6517
|
|
|
6518
|
+
//#endregion
|
|
6519
|
+
//#region src/config/redact-snapshot.ts
|
|
6520
|
+
/**
|
|
6521
|
+
* Sentinel value used to replace sensitive config fields in gateway responses.
|
|
6522
|
+
* Write-side handlers (config.set, config.apply, config.patch) detect this
|
|
6523
|
+
* sentinel and restore the original value from the on-disk config, so a
|
|
6524
|
+
* round-trip through the Web UI does not corrupt credentials.
|
|
6525
|
+
*/
|
|
6526
|
+
const REDACTED_SENTINEL = "__OPENCLAW_REDACTED__";
|
|
6527
|
+
/**
|
|
6528
|
+
* Patterns that identify sensitive config field names.
|
|
6529
|
+
* Aligned with the UI-hint logic in schema.ts.
|
|
6530
|
+
*/
|
|
6531
|
+
const SENSITIVE_KEY_PATTERNS = [
|
|
6532
|
+
/token/i,
|
|
6533
|
+
/password/i,
|
|
6534
|
+
/secret/i,
|
|
6535
|
+
/api.?key/i
|
|
6536
|
+
];
|
|
6537
|
+
function isSensitiveKey(key) {
|
|
6538
|
+
return SENSITIVE_KEY_PATTERNS.some((pattern) => pattern.test(key));
|
|
6539
|
+
}
|
|
6540
|
+
/**
|
|
6541
|
+
* Deep-walk an object and replace values whose key matches a sensitive pattern
|
|
6542
|
+
* with the redaction sentinel.
|
|
6543
|
+
*/
|
|
6544
|
+
function redactObject(obj) {
|
|
6545
|
+
if (obj === null || obj === void 0) return obj;
|
|
6546
|
+
if (typeof obj !== "object") return obj;
|
|
6547
|
+
if (Array.isArray(obj)) return obj.map(redactObject);
|
|
6548
|
+
const result = {};
|
|
6549
|
+
for (const [key, value] of Object.entries(obj)) if (isSensitiveKey(key) && value !== null && value !== void 0) result[key] = REDACTED_SENTINEL;
|
|
6550
|
+
else if (typeof value === "object" && value !== null) result[key] = redactObject(value);
|
|
6551
|
+
else result[key] = value;
|
|
6552
|
+
return result;
|
|
6553
|
+
}
|
|
6554
|
+
function redactConfigObject(value) {
|
|
6555
|
+
return redactObject(value);
|
|
6556
|
+
}
|
|
6557
|
+
/**
|
|
6558
|
+
* Collect all sensitive string values from a config object.
|
|
6559
|
+
* Used for text-based redaction of the raw JSON5 source.
|
|
6560
|
+
*/
|
|
6561
|
+
function collectSensitiveValues(obj) {
|
|
6562
|
+
const values = [];
|
|
6563
|
+
if (obj === null || obj === void 0 || typeof obj !== "object") return values;
|
|
6564
|
+
if (Array.isArray(obj)) {
|
|
6565
|
+
for (const item of obj) values.push(...collectSensitiveValues(item));
|
|
6566
|
+
return values;
|
|
6567
|
+
}
|
|
6568
|
+
for (const [key, value] of Object.entries(obj)) if (isSensitiveKey(key) && typeof value === "string" && value.length > 0) values.push(value);
|
|
6569
|
+
else if (typeof value === "object" && value !== null) values.push(...collectSensitiveValues(value));
|
|
6570
|
+
return values;
|
|
6571
|
+
}
|
|
6572
|
+
/**
|
|
6573
|
+
* Replace known sensitive values in a raw JSON5 string with the sentinel.
|
|
6574
|
+
* Values are replaced longest-first to avoid partial matches.
|
|
6575
|
+
*/
|
|
6576
|
+
function redactRawText(raw, config) {
|
|
6577
|
+
const sensitiveValues = collectSensitiveValues(config);
|
|
6578
|
+
sensitiveValues.sort((a, b) => b.length - a.length);
|
|
6579
|
+
let result = raw;
|
|
6580
|
+
for (const value of sensitiveValues) {
|
|
6581
|
+
const escaped = value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
6582
|
+
result = result.replace(new RegExp(escaped, "g"), REDACTED_SENTINEL);
|
|
6583
|
+
}
|
|
6584
|
+
result = result.replace(/(^|[{\s,])((["'])([^"']+)\3|([A-Za-z0-9_$.-]+))(\s*:\s*)(["'])([^"']*)\7/g, (match, prefix, keyExpr, _keyQuote, keyQuoted, keyBare, sep, valQuote, val) => {
|
|
6585
|
+
const key = keyQuoted ?? keyBare;
|
|
6586
|
+
if (!key || !isSensitiveKey(key)) return match;
|
|
6587
|
+
if (val === REDACTED_SENTINEL) return match;
|
|
6588
|
+
return `${prefix}${keyExpr}${sep}${valQuote}${REDACTED_SENTINEL}${valQuote}`;
|
|
6589
|
+
});
|
|
6590
|
+
return result;
|
|
6591
|
+
}
|
|
6592
|
+
/**
|
|
6593
|
+
* Returns a copy of the config snapshot with all sensitive fields
|
|
6594
|
+
* replaced by {@link REDACTED_SENTINEL}. The `hash` is preserved
|
|
6595
|
+
* (it tracks config identity, not content).
|
|
6596
|
+
*
|
|
6597
|
+
* Both `config` (the parsed object) and `raw` (the JSON5 source) are scrubbed
|
|
6598
|
+
* so no credential can leak through either path.
|
|
6599
|
+
*/
|
|
6600
|
+
function redactConfigSnapshot(snapshot) {
|
|
6601
|
+
const redactedConfig = redactConfigObject(snapshot.config);
|
|
6602
|
+
const redactedRaw = snapshot.raw ? redactRawText(snapshot.raw, snapshot.config) : null;
|
|
6603
|
+
const redactedParsed = snapshot.parsed ? redactConfigObject(snapshot.parsed) : snapshot.parsed;
|
|
6604
|
+
return {
|
|
6605
|
+
...snapshot,
|
|
6606
|
+
config: redactedConfig,
|
|
6607
|
+
raw: redactedRaw,
|
|
6608
|
+
parsed: redactedParsed
|
|
6609
|
+
};
|
|
6610
|
+
}
|
|
6611
|
+
/**
|
|
6612
|
+
* Deep-walk `incoming` and replace any {@link REDACTED_SENTINEL} values
|
|
6613
|
+
* (on sensitive keys) with the corresponding value from `original`.
|
|
6614
|
+
*
|
|
6615
|
+
* This is called by config.set / config.apply / config.patch before writing,
|
|
6616
|
+
* so that credentials survive a Web UI round-trip unmodified.
|
|
6617
|
+
*/
|
|
6618
|
+
function restoreRedactedValues(incoming, original) {
|
|
6619
|
+
if (incoming === null || incoming === void 0) return incoming;
|
|
6620
|
+
if (typeof incoming !== "object") return incoming;
|
|
6621
|
+
if (Array.isArray(incoming)) {
|
|
6622
|
+
const origArr = Array.isArray(original) ? original : [];
|
|
6623
|
+
return incoming.map((item, i) => restoreRedactedValues(item, origArr[i]));
|
|
6624
|
+
}
|
|
6625
|
+
const orig = original && typeof original === "object" && !Array.isArray(original) ? original : {};
|
|
6626
|
+
const result = {};
|
|
6627
|
+
for (const [key, value] of Object.entries(incoming)) if (isSensitiveKey(key) && value === REDACTED_SENTINEL) {
|
|
6628
|
+
if (!(key in orig)) throw new Error(`config write rejected: "${key}" is redacted; set an explicit value instead of ${REDACTED_SENTINEL}`);
|
|
6629
|
+
result[key] = orig[key];
|
|
6630
|
+
} else if (typeof value === "object" && value !== null) result[key] = restoreRedactedValues(value, orig[key]);
|
|
6631
|
+
else result[key] = value;
|
|
6632
|
+
return result;
|
|
6633
|
+
}
|
|
6634
|
+
|
|
6439
6635
|
//#endregion
|
|
6440
6636
|
//#region src/config/schema.ts
|
|
6441
6637
|
const GROUP_LABELS = {
|
|
@@ -6690,6 +6886,7 @@ const FIELD_LABELS = {
|
|
|
6690
6886
|
"commands.debug": "Allow /debug",
|
|
6691
6887
|
"commands.restart": "Allow Restart",
|
|
6692
6888
|
"commands.useAccessGroups": "Use Access Groups",
|
|
6889
|
+
"commands.ownerAllowFrom": "Command Owners",
|
|
6693
6890
|
"ui.seamColor": "Accent Color",
|
|
6694
6891
|
"ui.assistant.name": "Assistant Name",
|
|
6695
6892
|
"ui.assistant.avatar": "Assistant Avatar",
|
|
@@ -6952,6 +7149,7 @@ const FIELD_HELP = {
|
|
|
6952
7149
|
"commands.debug": "Allow /debug chat command for runtime-only overrides (default: false).",
|
|
6953
7150
|
"commands.restart": "Allow /restart and gateway restart tool actions (default: false).",
|
|
6954
7151
|
"commands.useAccessGroups": "Enforce access-group allowlists/policies for commands.",
|
|
7152
|
+
"commands.ownerAllowFrom": "Explicit owner allowlist for owner-only tools/commands. Use channel-native IDs (optionally prefixed like \"whatsapp:+15551234567\"). '*' is ignored.",
|
|
6955
7153
|
"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).",
|
|
6956
7154
|
"session.identityLinks": "Map canonical identities to provider-prefixed peer IDs for DM session linking (example: telegram:123456).",
|
|
6957
7155
|
"channels.telegram.configWrites": "Allow Telegram to write config in response to channel events/commands (default: true).",
|
|
@@ -7292,7 +7490,7 @@ const configHandlers = {
|
|
|
7292
7490
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid config.get params: ${formatValidationErrors(validateConfigGetParams.errors)}`));
|
|
7293
7491
|
return;
|
|
7294
7492
|
}
|
|
7295
|
-
respond(true, await readConfigFileSnapshot(), void 0);
|
|
7493
|
+
respond(true, redactConfigSnapshot(await readConfigFileSnapshot()), void 0);
|
|
7296
7494
|
},
|
|
7297
7495
|
"config.schema": ({ params, respond }) => {
|
|
7298
7496
|
if (!validateConfigSchemaParams(params)) {
|
|
@@ -7331,7 +7529,8 @@ const configHandlers = {
|
|
|
7331
7529
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid config.set params: ${formatValidationErrors(validateConfigSetParams.errors)}`));
|
|
7332
7530
|
return;
|
|
7333
7531
|
}
|
|
7334
|
-
|
|
7532
|
+
const snapshot = await readConfigFileSnapshot();
|
|
7533
|
+
if (!requireConfigBaseHash(params, snapshot, respond)) return;
|
|
7335
7534
|
const rawValue = params.raw;
|
|
7336
7535
|
if (typeof rawValue !== "string") {
|
|
7337
7536
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config.set params: raw (string) required"));
|
|
@@ -7347,11 +7546,18 @@ const configHandlers = {
|
|
|
7347
7546
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config", { details: { issues: validated.issues } }));
|
|
7348
7547
|
return;
|
|
7349
7548
|
}
|
|
7350
|
-
|
|
7549
|
+
let restored;
|
|
7550
|
+
try {
|
|
7551
|
+
restored = restoreRedactedValues(validated.config, snapshot.config);
|
|
7552
|
+
} catch (err) {
|
|
7553
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, String(err instanceof Error ? err.message : err)));
|
|
7554
|
+
return;
|
|
7555
|
+
}
|
|
7556
|
+
await writeConfigFile(restored);
|
|
7351
7557
|
respond(true, {
|
|
7352
7558
|
ok: true,
|
|
7353
7559
|
path: CONFIG_PATH,
|
|
7354
|
-
config:
|
|
7560
|
+
config: redactConfigObject(restored)
|
|
7355
7561
|
}, void 0);
|
|
7356
7562
|
},
|
|
7357
7563
|
"config.patch": async ({ params, respond }) => {
|
|
@@ -7380,7 +7586,14 @@ const configHandlers = {
|
|
|
7380
7586
|
return;
|
|
7381
7587
|
}
|
|
7382
7588
|
const merged = applyMergePatch(snapshot.config, parsedRes.parsed);
|
|
7383
|
-
|
|
7589
|
+
let restoredMerge;
|
|
7590
|
+
try {
|
|
7591
|
+
restoredMerge = restoreRedactedValues(merged, snapshot.config);
|
|
7592
|
+
} catch (err) {
|
|
7593
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, String(err instanceof Error ? err.message : err)));
|
|
7594
|
+
return;
|
|
7595
|
+
}
|
|
7596
|
+
const validated = validateConfigObjectWithPlugins(applyLegacyMigrations(restoredMerge).next ?? restoredMerge);
|
|
7384
7597
|
if (!validated.ok) {
|
|
7385
7598
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config", { details: { issues: validated.issues } }));
|
|
7386
7599
|
return;
|
|
@@ -7415,7 +7628,7 @@ const configHandlers = {
|
|
|
7415
7628
|
respond(true, {
|
|
7416
7629
|
ok: true,
|
|
7417
7630
|
path: CONFIG_PATH,
|
|
7418
|
-
config: validated.config,
|
|
7631
|
+
config: redactConfigObject(validated.config),
|
|
7419
7632
|
restart,
|
|
7420
7633
|
sentinel: {
|
|
7421
7634
|
path: sentinelPath,
|
|
@@ -7428,7 +7641,8 @@ const configHandlers = {
|
|
|
7428
7641
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid config.apply params: ${formatValidationErrors(validateConfigApplyParams.errors)}`));
|
|
7429
7642
|
return;
|
|
7430
7643
|
}
|
|
7431
|
-
|
|
7644
|
+
const snapshot = await readConfigFileSnapshot();
|
|
7645
|
+
if (!requireConfigBaseHash(params, snapshot, respond)) return;
|
|
7432
7646
|
const rawValue = params.raw;
|
|
7433
7647
|
if (typeof rawValue !== "string") {
|
|
7434
7648
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config.apply params: raw (string) required"));
|
|
@@ -7444,7 +7658,14 @@ const configHandlers = {
|
|
|
7444
7658
|
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "invalid config", { details: { issues: validated.issues } }));
|
|
7445
7659
|
return;
|
|
7446
7660
|
}
|
|
7447
|
-
|
|
7661
|
+
let restoredApply;
|
|
7662
|
+
try {
|
|
7663
|
+
restoredApply = restoreRedactedValues(validated.config, snapshot.config);
|
|
7664
|
+
} catch (err) {
|
|
7665
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, String(err instanceof Error ? err.message : err)));
|
|
7666
|
+
return;
|
|
7667
|
+
}
|
|
7668
|
+
await writeConfigFile(restoredApply);
|
|
7448
7669
|
const sessionKey = typeof params.sessionKey === "string" ? params.sessionKey?.trim() || void 0 : void 0;
|
|
7449
7670
|
const note = typeof params.note === "string" ? params.note?.trim() || void 0 : void 0;
|
|
7450
7671
|
const restartDelayMsRaw = params.restartDelayMs;
|
|
@@ -7474,7 +7695,7 @@ const configHandlers = {
|
|
|
7474
7695
|
respond(true, {
|
|
7475
7696
|
ok: true,
|
|
7476
7697
|
path: CONFIG_PATH,
|
|
7477
|
-
config:
|
|
7698
|
+
config: redactConfigObject(restoredApply),
|
|
7478
7699
|
restart,
|
|
7479
7700
|
sentinel: {
|
|
7480
7701
|
path: sentinelPath,
|
|
@@ -8774,7 +8995,7 @@ const nodeHandlers = {
|
|
|
8774
8995
|
const p = params;
|
|
8775
8996
|
const payloadJSON = typeof p.payloadJSON === "string" ? p.payloadJSON : p.payload !== void 0 ? JSON.stringify(p.payload) : null;
|
|
8776
8997
|
await respondUnavailableOnThrow(respond, async () => {
|
|
8777
|
-
const { handleNodeEvent } = await import("./server-node-events-
|
|
8998
|
+
const { handleNodeEvent } = await import("./server-node-events-BR2vHqf6.js");
|
|
8778
8999
|
const nodeId = client?.connect?.device?.id ?? client?.connect?.client?.id ?? "node";
|
|
8779
9000
|
await handleNodeEvent({
|
|
8780
9001
|
deps: context.deps,
|
|
@@ -9074,6 +9295,10 @@ function normalizeExecAsk(raw) {
|
|
|
9074
9295
|
async function applySessionsPatchToStore(params) {
|
|
9075
9296
|
const { cfg, store, storeKey, patch } = params;
|
|
9076
9297
|
const now = Date.now();
|
|
9298
|
+
const resolvedDefault = resolveDefaultModelForAgent({
|
|
9299
|
+
cfg,
|
|
9300
|
+
agentId: normalizeAgentId(parseAgentSessionKey(storeKey)?.agentId ?? resolveDefaultAgentId(cfg))
|
|
9301
|
+
});
|
|
9077
9302
|
const existing = store[storeKey];
|
|
9078
9303
|
const next = existing ? {
|
|
9079
9304
|
...existing,
|
|
@@ -9112,14 +9337,7 @@ async function applySessionsPatchToStore(params) {
|
|
|
9112
9337
|
if (raw === null) delete next.thinkingLevel;
|
|
9113
9338
|
else if (raw !== void 0) {
|
|
9114
9339
|
const normalized = normalizeThinkLevel(String(raw));
|
|
9115
|
-
if (!normalized) {
|
|
9116
|
-
const resolvedDefault = resolveConfiguredModelRef({
|
|
9117
|
-
cfg,
|
|
9118
|
-
defaultProvider: DEFAULT_PROVIDER,
|
|
9119
|
-
defaultModel: DEFAULT_MODEL
|
|
9120
|
-
});
|
|
9121
|
-
return invalid(`invalid thinkingLevel (use ${formatThinkingLevels(existing?.providerOverride?.trim() || resolvedDefault.provider, existing?.modelOverride?.trim() || resolvedDefault.model, "|")})`);
|
|
9122
|
-
}
|
|
9340
|
+
if (!normalized) return invalid(`invalid thinkingLevel (use ${formatThinkingLevels(existing?.providerOverride?.trim() || resolvedDefault.provider, existing?.modelOverride?.trim() || resolvedDefault.model, "|")})`);
|
|
9123
9341
|
if (normalized === "off") delete next.thinkingLevel;
|
|
9124
9342
|
else next.thinkingLevel = normalized;
|
|
9125
9343
|
}
|
|
@@ -9197,11 +9415,6 @@ async function applySessionsPatchToStore(params) {
|
|
|
9197
9415
|
}
|
|
9198
9416
|
if ("model" in patch) {
|
|
9199
9417
|
const raw = patch.model;
|
|
9200
|
-
const resolvedDefault = resolveConfiguredModelRef({
|
|
9201
|
-
cfg,
|
|
9202
|
-
defaultProvider: DEFAULT_PROVIDER,
|
|
9203
|
-
defaultModel: DEFAULT_MODEL
|
|
9204
|
-
});
|
|
9205
9418
|
if (raw === null) applyModelOverrideToSessionEntry({
|
|
9206
9419
|
entry: next,
|
|
9207
9420
|
selection: {
|
|
@@ -9237,11 +9450,6 @@ async function applySessionsPatchToStore(params) {
|
|
|
9237
9450
|
}
|
|
9238
9451
|
}
|
|
9239
9452
|
if (next.thinkingLevel === "xhigh") {
|
|
9240
|
-
const resolvedDefault = resolveConfiguredModelRef({
|
|
9241
|
-
cfg,
|
|
9242
|
-
defaultProvider: DEFAULT_PROVIDER,
|
|
9243
|
-
defaultModel: DEFAULT_MODEL
|
|
9244
|
-
});
|
|
9245
9453
|
if (!supportsXHighThinking(next.providerOverride ?? resolvedDefault.provider, next.modelOverride ?? resolvedDefault.model)) {
|
|
9246
9454
|
if ("thinkingLevel" in patch) return invalid(`thinkingLevel "xhigh" is only supported for ${formatXHighModelHint()}`);
|
|
9247
9455
|
next.thinkingLevel = "high";
|
|
@@ -9501,11 +9709,17 @@ const sessionsHandlers = {
|
|
|
9501
9709
|
respond(false, void 0, applied.error);
|
|
9502
9710
|
return;
|
|
9503
9711
|
}
|
|
9712
|
+
const agentId = normalizeAgentId(parseAgentSessionKey(target.canonicalKey ?? key)?.agentId ?? resolveDefaultAgentId(cfg));
|
|
9713
|
+
const resolved = resolveSessionModelRef(cfg, applied.entry, agentId);
|
|
9504
9714
|
respond(true, {
|
|
9505
9715
|
ok: true,
|
|
9506
9716
|
path: storePath,
|
|
9507
9717
|
key: target.canonicalKey,
|
|
9508
|
-
entry: applied.entry
|
|
9718
|
+
entry: applied.entry,
|
|
9719
|
+
resolved: {
|
|
9720
|
+
modelProvider: resolved.provider,
|
|
9721
|
+
model: resolved.model
|
|
9722
|
+
}
|
|
9509
9723
|
}, void 0);
|
|
9510
9724
|
},
|
|
9511
9725
|
"sessions.reset": async ({ params, respond }) => {
|
|
@@ -10159,18 +10373,54 @@ const updateHandlers = { "update.run": async ({ params, respond }) => {
|
|
|
10159
10373
|
//#region src/gateway/server-methods/usage.ts
|
|
10160
10374
|
const COST_USAGE_CACHE_TTL_MS = 3e4;
|
|
10161
10375
|
const costUsageCache = /* @__PURE__ */ new Map();
|
|
10376
|
+
/**
|
|
10377
|
+
* Parse a date string (YYYY-MM-DD) to start of day timestamp in UTC.
|
|
10378
|
+
* Returns undefined if invalid.
|
|
10379
|
+
*/
|
|
10380
|
+
const parseDateToMs = (raw) => {
|
|
10381
|
+
if (typeof raw !== "string" || !raw.trim()) return;
|
|
10382
|
+
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(raw.trim());
|
|
10383
|
+
if (!match) return;
|
|
10384
|
+
const [, year, month, day] = match;
|
|
10385
|
+
const ms = Date.UTC(parseInt(year), parseInt(month) - 1, parseInt(day));
|
|
10386
|
+
if (Number.isNaN(ms)) return;
|
|
10387
|
+
return ms;
|
|
10388
|
+
};
|
|
10162
10389
|
const parseDays = (raw) => {
|
|
10163
10390
|
if (typeof raw === "number" && Number.isFinite(raw)) return Math.floor(raw);
|
|
10164
10391
|
if (typeof raw === "string" && raw.trim() !== "") {
|
|
10165
10392
|
const parsed = Number(raw);
|
|
10166
10393
|
if (Number.isFinite(parsed)) return Math.floor(parsed);
|
|
10167
10394
|
}
|
|
10168
|
-
|
|
10395
|
+
};
|
|
10396
|
+
/**
|
|
10397
|
+
* Get date range from params (startDate/endDate or days).
|
|
10398
|
+
* Falls back to last 30 days if not provided.
|
|
10399
|
+
*/
|
|
10400
|
+
const parseDateRange = (params) => {
|
|
10401
|
+
const now = /* @__PURE__ */ new Date();
|
|
10402
|
+
const todayStartMs = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate());
|
|
10403
|
+
const todayEndMs = todayStartMs + 1440 * 60 * 1e3 - 1;
|
|
10404
|
+
const startMs = parseDateToMs(params.startDate);
|
|
10405
|
+
const endMs = parseDateToMs(params.endDate);
|
|
10406
|
+
if (startMs !== void 0 && endMs !== void 0) return {
|
|
10407
|
+
startMs,
|
|
10408
|
+
endMs: endMs + 1440 * 60 * 1e3 - 1
|
|
10409
|
+
};
|
|
10410
|
+
const days = parseDays(params.days);
|
|
10411
|
+
if (days !== void 0) return {
|
|
10412
|
+
startMs: todayStartMs - (Math.max(1, days) - 1) * 24 * 60 * 60 * 1e3,
|
|
10413
|
+
endMs: todayEndMs
|
|
10414
|
+
};
|
|
10415
|
+
return {
|
|
10416
|
+
startMs: todayStartMs - 696 * 60 * 60 * 1e3,
|
|
10417
|
+
endMs: todayEndMs
|
|
10418
|
+
};
|
|
10169
10419
|
};
|
|
10170
10420
|
async function loadCostUsageSummaryCached(params) {
|
|
10171
|
-
const
|
|
10421
|
+
const cacheKey = `${params.startMs}-${params.endMs}`;
|
|
10172
10422
|
const now = Date.now();
|
|
10173
|
-
const cached = costUsageCache.get(
|
|
10423
|
+
const cached = costUsageCache.get(cacheKey);
|
|
10174
10424
|
if (cached?.summary && cached.updatedAt && now - cached.updatedAt < COST_USAGE_CACHE_TTL_MS) return cached.summary;
|
|
10175
10425
|
if (cached?.inFlight) {
|
|
10176
10426
|
if (cached.summary) return cached.summary;
|
|
@@ -10178,10 +10428,11 @@ async function loadCostUsageSummaryCached(params) {
|
|
|
10178
10428
|
}
|
|
10179
10429
|
const entry = cached ?? {};
|
|
10180
10430
|
const inFlight = loadCostUsageSummary({
|
|
10181
|
-
|
|
10431
|
+
startMs: params.startMs,
|
|
10432
|
+
endMs: params.endMs,
|
|
10182
10433
|
config: params.config
|
|
10183
10434
|
}).then((summary) => {
|
|
10184
|
-
costUsageCache.set(
|
|
10435
|
+
costUsageCache.set(cacheKey, {
|
|
10185
10436
|
summary,
|
|
10186
10437
|
updatedAt: Date.now()
|
|
10187
10438
|
});
|
|
@@ -10190,14 +10441,14 @@ async function loadCostUsageSummaryCached(params) {
|
|
|
10190
10441
|
if (entry.summary) return entry.summary;
|
|
10191
10442
|
throw err;
|
|
10192
10443
|
}).finally(() => {
|
|
10193
|
-
const current = costUsageCache.get(
|
|
10444
|
+
const current = costUsageCache.get(cacheKey);
|
|
10194
10445
|
if (current?.inFlight === inFlight) {
|
|
10195
10446
|
current.inFlight = void 0;
|
|
10196
|
-
costUsageCache.set(
|
|
10447
|
+
costUsageCache.set(cacheKey, current);
|
|
10197
10448
|
}
|
|
10198
10449
|
});
|
|
10199
10450
|
entry.inFlight = inFlight;
|
|
10200
|
-
costUsageCache.set(
|
|
10451
|
+
costUsageCache.set(cacheKey, entry);
|
|
10201
10452
|
if (entry.summary) return entry.summary;
|
|
10202
10453
|
return await inFlight;
|
|
10203
10454
|
}
|
|
@@ -10207,10 +10458,395 @@ const usageHandlers = {
|
|
|
10207
10458
|
},
|
|
10208
10459
|
"usage.cost": async ({ respond, params }) => {
|
|
10209
10460
|
const config = loadConfig();
|
|
10461
|
+
const { startMs, endMs } = parseDateRange({
|
|
10462
|
+
startDate: params?.startDate,
|
|
10463
|
+
endDate: params?.endDate,
|
|
10464
|
+
days: params?.days
|
|
10465
|
+
});
|
|
10210
10466
|
respond(true, await loadCostUsageSummaryCached({
|
|
10211
|
-
|
|
10467
|
+
startMs,
|
|
10468
|
+
endMs,
|
|
10212
10469
|
config
|
|
10213
10470
|
}), void 0);
|
|
10471
|
+
},
|
|
10472
|
+
"sessions.usage": async ({ respond, params }) => {
|
|
10473
|
+
if (!validateSessionsUsageParams(params)) {
|
|
10474
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `invalid sessions.usage params: ${formatValidationErrors(validateSessionsUsageParams.errors)}`));
|
|
10475
|
+
return;
|
|
10476
|
+
}
|
|
10477
|
+
const p = params;
|
|
10478
|
+
const config = loadConfig();
|
|
10479
|
+
const { startMs, endMs } = parseDateRange({
|
|
10480
|
+
startDate: p.startDate,
|
|
10481
|
+
endDate: p.endDate
|
|
10482
|
+
});
|
|
10483
|
+
const limit = typeof p.limit === "number" && Number.isFinite(p.limit) ? p.limit : 50;
|
|
10484
|
+
const includeContextWeight = p.includeContextWeight ?? false;
|
|
10485
|
+
const specificKey = typeof p.key === "string" ? p.key.trim() : null;
|
|
10486
|
+
const { store } = loadCombinedSessionStoreForGateway(config);
|
|
10487
|
+
const now = Date.now();
|
|
10488
|
+
const mergedEntries = [];
|
|
10489
|
+
if (specificKey) {
|
|
10490
|
+
const storeEntry = store[specificKey];
|
|
10491
|
+
let sessionId = storeEntry?.sessionId ?? specificKey;
|
|
10492
|
+
const sessionFile = resolveSessionFilePath(sessionId, storeEntry);
|
|
10493
|
+
try {
|
|
10494
|
+
const stats = fs.statSync(sessionFile);
|
|
10495
|
+
if (stats.isFile()) mergedEntries.push({
|
|
10496
|
+
key: specificKey,
|
|
10497
|
+
sessionId,
|
|
10498
|
+
sessionFile,
|
|
10499
|
+
label: storeEntry?.label,
|
|
10500
|
+
updatedAt: storeEntry?.updatedAt ?? stats.mtimeMs,
|
|
10501
|
+
storeEntry
|
|
10502
|
+
});
|
|
10503
|
+
} catch {}
|
|
10504
|
+
} else {
|
|
10505
|
+
const discoveredSessions = await discoverAllSessions({
|
|
10506
|
+
startMs,
|
|
10507
|
+
endMs
|
|
10508
|
+
});
|
|
10509
|
+
const storeBySessionId = /* @__PURE__ */ new Map();
|
|
10510
|
+
for (const [key, entry] of Object.entries(store)) if (entry?.sessionId) storeBySessionId.set(entry.sessionId, {
|
|
10511
|
+
key,
|
|
10512
|
+
entry
|
|
10513
|
+
});
|
|
10514
|
+
for (const discovered of discoveredSessions) {
|
|
10515
|
+
const storeMatch = storeBySessionId.get(discovered.sessionId);
|
|
10516
|
+
if (storeMatch) mergedEntries.push({
|
|
10517
|
+
key: storeMatch.key,
|
|
10518
|
+
sessionId: discovered.sessionId,
|
|
10519
|
+
sessionFile: discovered.sessionFile,
|
|
10520
|
+
label: storeMatch.entry.label,
|
|
10521
|
+
updatedAt: storeMatch.entry.updatedAt ?? discovered.mtime,
|
|
10522
|
+
storeEntry: storeMatch.entry
|
|
10523
|
+
});
|
|
10524
|
+
else mergedEntries.push({
|
|
10525
|
+
key: discovered.sessionId,
|
|
10526
|
+
sessionId: discovered.sessionId,
|
|
10527
|
+
sessionFile: discovered.sessionFile,
|
|
10528
|
+
label: void 0,
|
|
10529
|
+
updatedAt: discovered.mtime
|
|
10530
|
+
});
|
|
10531
|
+
}
|
|
10532
|
+
}
|
|
10533
|
+
mergedEntries.sort((a, b) => b.updatedAt - a.updatedAt);
|
|
10534
|
+
const limitedEntries = mergedEntries.slice(0, limit);
|
|
10535
|
+
const sessions = [];
|
|
10536
|
+
const aggregateTotals = {
|
|
10537
|
+
input: 0,
|
|
10538
|
+
output: 0,
|
|
10539
|
+
cacheRead: 0,
|
|
10540
|
+
cacheWrite: 0,
|
|
10541
|
+
totalTokens: 0,
|
|
10542
|
+
totalCost: 0,
|
|
10543
|
+
inputCost: 0,
|
|
10544
|
+
outputCost: 0,
|
|
10545
|
+
cacheReadCost: 0,
|
|
10546
|
+
cacheWriteCost: 0,
|
|
10547
|
+
missingCostEntries: 0
|
|
10548
|
+
};
|
|
10549
|
+
const aggregateMessages = {
|
|
10550
|
+
total: 0,
|
|
10551
|
+
user: 0,
|
|
10552
|
+
assistant: 0,
|
|
10553
|
+
toolCalls: 0,
|
|
10554
|
+
toolResults: 0,
|
|
10555
|
+
errors: 0
|
|
10556
|
+
};
|
|
10557
|
+
const toolAggregateMap = /* @__PURE__ */ new Map();
|
|
10558
|
+
const byModelMap = /* @__PURE__ */ new Map();
|
|
10559
|
+
const byProviderMap = /* @__PURE__ */ new Map();
|
|
10560
|
+
const byAgentMap = /* @__PURE__ */ new Map();
|
|
10561
|
+
const byChannelMap = /* @__PURE__ */ new Map();
|
|
10562
|
+
const dailyAggregateMap = /* @__PURE__ */ new Map();
|
|
10563
|
+
const latencyTotals = {
|
|
10564
|
+
count: 0,
|
|
10565
|
+
sum: 0,
|
|
10566
|
+
min: Number.POSITIVE_INFINITY,
|
|
10567
|
+
max: 0,
|
|
10568
|
+
p95Max: 0
|
|
10569
|
+
};
|
|
10570
|
+
const dailyLatencyMap = /* @__PURE__ */ new Map();
|
|
10571
|
+
const modelDailyMap = /* @__PURE__ */ new Map();
|
|
10572
|
+
const emptyTotals = () => ({
|
|
10573
|
+
input: 0,
|
|
10574
|
+
output: 0,
|
|
10575
|
+
cacheRead: 0,
|
|
10576
|
+
cacheWrite: 0,
|
|
10577
|
+
totalTokens: 0,
|
|
10578
|
+
totalCost: 0,
|
|
10579
|
+
inputCost: 0,
|
|
10580
|
+
outputCost: 0,
|
|
10581
|
+
cacheReadCost: 0,
|
|
10582
|
+
cacheWriteCost: 0,
|
|
10583
|
+
missingCostEntries: 0
|
|
10584
|
+
});
|
|
10585
|
+
const mergeTotals = (target, source) => {
|
|
10586
|
+
target.input += source.input;
|
|
10587
|
+
target.output += source.output;
|
|
10588
|
+
target.cacheRead += source.cacheRead;
|
|
10589
|
+
target.cacheWrite += source.cacheWrite;
|
|
10590
|
+
target.totalTokens += source.totalTokens;
|
|
10591
|
+
target.totalCost += source.totalCost;
|
|
10592
|
+
target.inputCost += source.inputCost;
|
|
10593
|
+
target.outputCost += source.outputCost;
|
|
10594
|
+
target.cacheReadCost += source.cacheReadCost;
|
|
10595
|
+
target.cacheWriteCost += source.cacheWriteCost;
|
|
10596
|
+
target.missingCostEntries += source.missingCostEntries;
|
|
10597
|
+
};
|
|
10598
|
+
for (const merged of limitedEntries) {
|
|
10599
|
+
const usage = await loadSessionCostSummary({
|
|
10600
|
+
sessionId: merged.sessionId,
|
|
10601
|
+
sessionEntry: merged.storeEntry,
|
|
10602
|
+
sessionFile: merged.sessionFile,
|
|
10603
|
+
config,
|
|
10604
|
+
startMs,
|
|
10605
|
+
endMs
|
|
10606
|
+
});
|
|
10607
|
+
if (usage) {
|
|
10608
|
+
aggregateTotals.input += usage.input;
|
|
10609
|
+
aggregateTotals.output += usage.output;
|
|
10610
|
+
aggregateTotals.cacheRead += usage.cacheRead;
|
|
10611
|
+
aggregateTotals.cacheWrite += usage.cacheWrite;
|
|
10612
|
+
aggregateTotals.totalTokens += usage.totalTokens;
|
|
10613
|
+
aggregateTotals.totalCost += usage.totalCost;
|
|
10614
|
+
aggregateTotals.inputCost += usage.inputCost;
|
|
10615
|
+
aggregateTotals.outputCost += usage.outputCost;
|
|
10616
|
+
aggregateTotals.cacheReadCost += usage.cacheReadCost;
|
|
10617
|
+
aggregateTotals.cacheWriteCost += usage.cacheWriteCost;
|
|
10618
|
+
aggregateTotals.missingCostEntries += usage.missingCostEntries;
|
|
10619
|
+
}
|
|
10620
|
+
const agentId = parseAgentSessionKey(merged.key)?.agentId;
|
|
10621
|
+
const channel = merged.storeEntry?.channel ?? merged.storeEntry?.origin?.provider;
|
|
10622
|
+
const chatType = merged.storeEntry?.chatType ?? merged.storeEntry?.origin?.chatType;
|
|
10623
|
+
if (usage) {
|
|
10624
|
+
if (usage.messageCounts) {
|
|
10625
|
+
aggregateMessages.total += usage.messageCounts.total;
|
|
10626
|
+
aggregateMessages.user += usage.messageCounts.user;
|
|
10627
|
+
aggregateMessages.assistant += usage.messageCounts.assistant;
|
|
10628
|
+
aggregateMessages.toolCalls += usage.messageCounts.toolCalls;
|
|
10629
|
+
aggregateMessages.toolResults += usage.messageCounts.toolResults;
|
|
10630
|
+
aggregateMessages.errors += usage.messageCounts.errors;
|
|
10631
|
+
}
|
|
10632
|
+
if (usage.toolUsage) for (const tool of usage.toolUsage.tools) toolAggregateMap.set(tool.name, (toolAggregateMap.get(tool.name) ?? 0) + tool.count);
|
|
10633
|
+
if (usage.modelUsage) for (const entry of usage.modelUsage) {
|
|
10634
|
+
const modelKey = `${entry.provider ?? "unknown"}::${entry.model ?? "unknown"}`;
|
|
10635
|
+
const modelExisting = byModelMap.get(modelKey) ?? {
|
|
10636
|
+
provider: entry.provider,
|
|
10637
|
+
model: entry.model,
|
|
10638
|
+
count: 0,
|
|
10639
|
+
totals: emptyTotals()
|
|
10640
|
+
};
|
|
10641
|
+
modelExisting.count += entry.count;
|
|
10642
|
+
mergeTotals(modelExisting.totals, entry.totals);
|
|
10643
|
+
byModelMap.set(modelKey, modelExisting);
|
|
10644
|
+
const providerKey = entry.provider ?? "unknown";
|
|
10645
|
+
const providerExisting = byProviderMap.get(providerKey) ?? {
|
|
10646
|
+
provider: entry.provider,
|
|
10647
|
+
model: void 0,
|
|
10648
|
+
count: 0,
|
|
10649
|
+
totals: emptyTotals()
|
|
10650
|
+
};
|
|
10651
|
+
providerExisting.count += entry.count;
|
|
10652
|
+
mergeTotals(providerExisting.totals, entry.totals);
|
|
10653
|
+
byProviderMap.set(providerKey, providerExisting);
|
|
10654
|
+
}
|
|
10655
|
+
if (usage.latency) {
|
|
10656
|
+
const { count, avgMs, minMs, maxMs, p95Ms } = usage.latency;
|
|
10657
|
+
if (count > 0) {
|
|
10658
|
+
latencyTotals.count += count;
|
|
10659
|
+
latencyTotals.sum += avgMs * count;
|
|
10660
|
+
latencyTotals.min = Math.min(latencyTotals.min, minMs);
|
|
10661
|
+
latencyTotals.max = Math.max(latencyTotals.max, maxMs);
|
|
10662
|
+
latencyTotals.p95Max = Math.max(latencyTotals.p95Max, p95Ms);
|
|
10663
|
+
}
|
|
10664
|
+
}
|
|
10665
|
+
if (usage.dailyLatency) for (const day of usage.dailyLatency) {
|
|
10666
|
+
const existing = dailyLatencyMap.get(day.date) ?? {
|
|
10667
|
+
date: day.date,
|
|
10668
|
+
count: 0,
|
|
10669
|
+
sum: 0,
|
|
10670
|
+
min: Number.POSITIVE_INFINITY,
|
|
10671
|
+
max: 0,
|
|
10672
|
+
p95Max: 0
|
|
10673
|
+
};
|
|
10674
|
+
existing.count += day.count;
|
|
10675
|
+
existing.sum += day.avgMs * day.count;
|
|
10676
|
+
existing.min = Math.min(existing.min, day.minMs);
|
|
10677
|
+
existing.max = Math.max(existing.max, day.maxMs);
|
|
10678
|
+
existing.p95Max = Math.max(existing.p95Max, day.p95Ms);
|
|
10679
|
+
dailyLatencyMap.set(day.date, existing);
|
|
10680
|
+
}
|
|
10681
|
+
if (usage.dailyModelUsage) for (const entry of usage.dailyModelUsage) {
|
|
10682
|
+
const key = `${entry.date}::${entry.provider ?? "unknown"}::${entry.model ?? "unknown"}`;
|
|
10683
|
+
const existing = modelDailyMap.get(key) ?? {
|
|
10684
|
+
date: entry.date,
|
|
10685
|
+
provider: entry.provider,
|
|
10686
|
+
model: entry.model,
|
|
10687
|
+
tokens: 0,
|
|
10688
|
+
cost: 0,
|
|
10689
|
+
count: 0
|
|
10690
|
+
};
|
|
10691
|
+
existing.tokens += entry.tokens;
|
|
10692
|
+
existing.cost += entry.cost;
|
|
10693
|
+
existing.count += entry.count;
|
|
10694
|
+
modelDailyMap.set(key, existing);
|
|
10695
|
+
}
|
|
10696
|
+
if (agentId) {
|
|
10697
|
+
const agentTotals = byAgentMap.get(agentId) ?? emptyTotals();
|
|
10698
|
+
mergeTotals(agentTotals, usage);
|
|
10699
|
+
byAgentMap.set(agentId, agentTotals);
|
|
10700
|
+
}
|
|
10701
|
+
if (channel) {
|
|
10702
|
+
const channelTotals = byChannelMap.get(channel) ?? emptyTotals();
|
|
10703
|
+
mergeTotals(channelTotals, usage);
|
|
10704
|
+
byChannelMap.set(channel, channelTotals);
|
|
10705
|
+
}
|
|
10706
|
+
if (usage.dailyBreakdown) for (const day of usage.dailyBreakdown) {
|
|
10707
|
+
const daily = dailyAggregateMap.get(day.date) ?? {
|
|
10708
|
+
date: day.date,
|
|
10709
|
+
tokens: 0,
|
|
10710
|
+
cost: 0,
|
|
10711
|
+
messages: 0,
|
|
10712
|
+
toolCalls: 0,
|
|
10713
|
+
errors: 0
|
|
10714
|
+
};
|
|
10715
|
+
daily.tokens += day.tokens;
|
|
10716
|
+
daily.cost += day.cost;
|
|
10717
|
+
dailyAggregateMap.set(day.date, daily);
|
|
10718
|
+
}
|
|
10719
|
+
if (usage.dailyMessageCounts) for (const day of usage.dailyMessageCounts) {
|
|
10720
|
+
const daily = dailyAggregateMap.get(day.date) ?? {
|
|
10721
|
+
date: day.date,
|
|
10722
|
+
tokens: 0,
|
|
10723
|
+
cost: 0,
|
|
10724
|
+
messages: 0,
|
|
10725
|
+
toolCalls: 0,
|
|
10726
|
+
errors: 0
|
|
10727
|
+
};
|
|
10728
|
+
daily.messages += day.total;
|
|
10729
|
+
daily.toolCalls += day.toolCalls;
|
|
10730
|
+
daily.errors += day.errors;
|
|
10731
|
+
dailyAggregateMap.set(day.date, daily);
|
|
10732
|
+
}
|
|
10733
|
+
}
|
|
10734
|
+
sessions.push({
|
|
10735
|
+
key: merged.key,
|
|
10736
|
+
label: merged.label,
|
|
10737
|
+
sessionId: merged.sessionId,
|
|
10738
|
+
updatedAt: merged.updatedAt,
|
|
10739
|
+
agentId,
|
|
10740
|
+
channel,
|
|
10741
|
+
chatType,
|
|
10742
|
+
origin: merged.storeEntry?.origin,
|
|
10743
|
+
modelOverride: merged.storeEntry?.modelOverride,
|
|
10744
|
+
providerOverride: merged.storeEntry?.providerOverride,
|
|
10745
|
+
modelProvider: merged.storeEntry?.modelProvider,
|
|
10746
|
+
model: merged.storeEntry?.model,
|
|
10747
|
+
usage,
|
|
10748
|
+
contextWeight: includeContextWeight ? merged.storeEntry?.systemPromptReport ?? null : void 0
|
|
10749
|
+
});
|
|
10750
|
+
}
|
|
10751
|
+
const formatDateStr = (ms) => {
|
|
10752
|
+
const d = new Date(ms);
|
|
10753
|
+
return `${d.getUTCFullYear()}-${String(d.getUTCMonth() + 1).padStart(2, "0")}-${String(d.getUTCDate()).padStart(2, "0")}`;
|
|
10754
|
+
};
|
|
10755
|
+
const aggregates = {
|
|
10756
|
+
messages: aggregateMessages,
|
|
10757
|
+
tools: {
|
|
10758
|
+
totalCalls: Array.from(toolAggregateMap.values()).reduce((sum, count) => sum + count, 0),
|
|
10759
|
+
uniqueTools: toolAggregateMap.size,
|
|
10760
|
+
tools: Array.from(toolAggregateMap.entries()).map(([name, count]) => ({
|
|
10761
|
+
name,
|
|
10762
|
+
count
|
|
10763
|
+
})).toSorted((a, b) => b.count - a.count)
|
|
10764
|
+
},
|
|
10765
|
+
byModel: Array.from(byModelMap.values()).toSorted((a, b) => {
|
|
10766
|
+
const costDiff = b.totals.totalCost - a.totals.totalCost;
|
|
10767
|
+
if (costDiff !== 0) return costDiff;
|
|
10768
|
+
return b.totals.totalTokens - a.totals.totalTokens;
|
|
10769
|
+
}),
|
|
10770
|
+
byProvider: Array.from(byProviderMap.values()).toSorted((a, b) => {
|
|
10771
|
+
const costDiff = b.totals.totalCost - a.totals.totalCost;
|
|
10772
|
+
if (costDiff !== 0) return costDiff;
|
|
10773
|
+
return b.totals.totalTokens - a.totals.totalTokens;
|
|
10774
|
+
}),
|
|
10775
|
+
byAgent: Array.from(byAgentMap.entries()).map(([id, totals]) => ({
|
|
10776
|
+
agentId: id,
|
|
10777
|
+
totals
|
|
10778
|
+
})).toSorted((a, b) => b.totals.totalCost - a.totals.totalCost),
|
|
10779
|
+
byChannel: Array.from(byChannelMap.entries()).map(([name, totals]) => ({
|
|
10780
|
+
channel: name,
|
|
10781
|
+
totals
|
|
10782
|
+
})).toSorted((a, b) => b.totals.totalCost - a.totals.totalCost),
|
|
10783
|
+
latency: latencyTotals.count > 0 ? {
|
|
10784
|
+
count: latencyTotals.count,
|
|
10785
|
+
avgMs: latencyTotals.sum / latencyTotals.count,
|
|
10786
|
+
minMs: latencyTotals.min === Number.POSITIVE_INFINITY ? 0 : latencyTotals.min,
|
|
10787
|
+
maxMs: latencyTotals.max,
|
|
10788
|
+
p95Ms: latencyTotals.p95Max
|
|
10789
|
+
} : void 0,
|
|
10790
|
+
dailyLatency: Array.from(dailyLatencyMap.values()).map((entry) => ({
|
|
10791
|
+
date: entry.date,
|
|
10792
|
+
count: entry.count,
|
|
10793
|
+
avgMs: entry.count ? entry.sum / entry.count : 0,
|
|
10794
|
+
minMs: entry.min === Number.POSITIVE_INFINITY ? 0 : entry.min,
|
|
10795
|
+
maxMs: entry.max,
|
|
10796
|
+
p95Ms: entry.p95Max
|
|
10797
|
+
})).toSorted((a, b) => a.date.localeCompare(b.date)),
|
|
10798
|
+
modelDaily: Array.from(modelDailyMap.values()).toSorted((a, b) => a.date.localeCompare(b.date) || b.cost - a.cost),
|
|
10799
|
+
daily: Array.from(dailyAggregateMap.values()).toSorted((a, b) => a.date.localeCompare(b.date))
|
|
10800
|
+
};
|
|
10801
|
+
respond(true, {
|
|
10802
|
+
updatedAt: now,
|
|
10803
|
+
startDate: formatDateStr(startMs),
|
|
10804
|
+
endDate: formatDateStr(endMs),
|
|
10805
|
+
sessions,
|
|
10806
|
+
totals: aggregateTotals,
|
|
10807
|
+
aggregates
|
|
10808
|
+
}, void 0);
|
|
10809
|
+
},
|
|
10810
|
+
"sessions.usage.timeseries": async ({ respond, params }) => {
|
|
10811
|
+
const key = typeof params?.key === "string" ? params.key.trim() : null;
|
|
10812
|
+
if (!key) {
|
|
10813
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "key is required for timeseries"));
|
|
10814
|
+
return;
|
|
10815
|
+
}
|
|
10816
|
+
const config = loadConfig();
|
|
10817
|
+
const { entry } = loadSessionEntry(key);
|
|
10818
|
+
const timeseries = await loadSessionUsageTimeSeries({
|
|
10819
|
+
sessionId: entry?.sessionId ?? key,
|
|
10820
|
+
sessionEntry: entry,
|
|
10821
|
+
sessionFile: entry?.sessionFile ?? resolveSessionFilePath(key),
|
|
10822
|
+
config,
|
|
10823
|
+
maxPoints: 200
|
|
10824
|
+
});
|
|
10825
|
+
if (!timeseries) {
|
|
10826
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, `No transcript found for session: ${key}`));
|
|
10827
|
+
return;
|
|
10828
|
+
}
|
|
10829
|
+
respond(true, timeseries, void 0);
|
|
10830
|
+
},
|
|
10831
|
+
"sessions.usage.logs": async ({ respond, params }) => {
|
|
10832
|
+
const key = typeof params?.key === "string" ? params.key.trim() : null;
|
|
10833
|
+
if (!key) {
|
|
10834
|
+
respond(false, void 0, errorShape(ErrorCodes.INVALID_REQUEST, "key is required for logs"));
|
|
10835
|
+
return;
|
|
10836
|
+
}
|
|
10837
|
+
const limit = typeof params?.limit === "number" && Number.isFinite(params.limit) ? Math.min(params.limit, 1e3) : 200;
|
|
10838
|
+
const config = loadConfig();
|
|
10839
|
+
const { entry } = loadSessionEntry(key);
|
|
10840
|
+
const sessionId = entry?.sessionId ?? key;
|
|
10841
|
+
const sessionFile = entry?.sessionFile ?? resolveSessionFilePath(key);
|
|
10842
|
+
const { loadSessionLogs } = await import("./session-cost-usage-BTXosU1k.js").then((n) => n.a);
|
|
10843
|
+
respond(true, { logs: await loadSessionLogs({
|
|
10844
|
+
sessionId,
|
|
10845
|
+
sessionEntry: entry,
|
|
10846
|
+
sessionFile,
|
|
10847
|
+
config,
|
|
10848
|
+
limit
|
|
10849
|
+
}) ?? [] }, void 0);
|
|
10214
10850
|
}
|
|
10215
10851
|
};
|
|
10216
10852
|
|
|
@@ -11210,29 +11846,14 @@ function resolveHooksConfig(cfg) {
|
|
|
11210
11846
|
mappings: resolveHookMappings(cfg.hooks)
|
|
11211
11847
|
};
|
|
11212
11848
|
}
|
|
11213
|
-
function extractHookToken(req
|
|
11849
|
+
function extractHookToken(req) {
|
|
11214
11850
|
const auth = typeof req.headers.authorization === "string" ? req.headers.authorization.trim() : "";
|
|
11215
11851
|
if (auth.toLowerCase().startsWith("bearer ")) {
|
|
11216
11852
|
const token = auth.slice(7).trim();
|
|
11217
|
-
if (token) return
|
|
11218
|
-
token,
|
|
11219
|
-
fromQuery: false
|
|
11220
|
-
};
|
|
11853
|
+
if (token) return token;
|
|
11221
11854
|
}
|
|
11222
11855
|
const headerToken = typeof req.headers["x-openclaw-token"] === "string" ? req.headers["x-openclaw-token"].trim() : "";
|
|
11223
|
-
if (headerToken) return
|
|
11224
|
-
token: headerToken,
|
|
11225
|
-
fromQuery: false
|
|
11226
|
-
};
|
|
11227
|
-
const queryToken = url.searchParams.get("token");
|
|
11228
|
-
if (queryToken) return {
|
|
11229
|
-
token: queryToken.trim(),
|
|
11230
|
-
fromQuery: true
|
|
11231
|
-
};
|
|
11232
|
-
return {
|
|
11233
|
-
token: void 0,
|
|
11234
|
-
fromQuery: false
|
|
11235
|
-
};
|
|
11856
|
+
if (headerToken) return headerToken;
|
|
11236
11857
|
}
|
|
11237
11858
|
async function readJsonBody(req, maxBytes) {
|
|
11238
11859
|
return await new Promise((resolve) => {
|
|
@@ -11370,7 +11991,7 @@ function normalizeAgentPayload(payload, opts) {
|
|
|
11370
11991
|
async function startBrowserControlServerIfEnabled() {
|
|
11371
11992
|
if (isTruthyEnvValue(process.env.OPENCLAW_SKIP_BROWSER_CONTROL_SERVER)) return null;
|
|
11372
11993
|
const override = process.env.OPENCLAW_BROWSER_CONTROL_MODULE?.trim();
|
|
11373
|
-
const mod = override ? await import(override) : await import("./control-service-
|
|
11994
|
+
const mod = override ? await import(override) : await import("./control-service-D2E9NKqQ.js").then((n) => n.t);
|
|
11374
11995
|
const start = typeof mod.startBrowserControlServiceFromConfig === "function" ? mod.startBrowserControlServiceFromConfig : mod.startBrowserControlServerFromConfig;
|
|
11375
11996
|
const stop = typeof mod.stopBrowserControlService === "function" ? mod.stopBrowserControlService : mod.stopBrowserControlServer;
|
|
11376
11997
|
if (!start) return null;
|
|
@@ -12038,8 +12659,8 @@ function hasEventScope(client, event) {
|
|
|
12038
12659
|
}
|
|
12039
12660
|
function createGatewayBroadcaster(params) {
|
|
12040
12661
|
let seq = 0;
|
|
12041
|
-
const
|
|
12042
|
-
const eventSeq = ++seq;
|
|
12662
|
+
const broadcastInternal = (event, payload, opts, targetConnIds) => {
|
|
12663
|
+
const eventSeq = Boolean(targetConnIds) ? void 0 : ++seq;
|
|
12043
12664
|
const frame = JSON.stringify({
|
|
12044
12665
|
type: "event",
|
|
12045
12666
|
event,
|
|
@@ -12049,8 +12670,9 @@ function createGatewayBroadcaster(params) {
|
|
|
12049
12670
|
});
|
|
12050
12671
|
const logMeta = {
|
|
12051
12672
|
event,
|
|
12052
|
-
seq: eventSeq,
|
|
12673
|
+
seq: eventSeq ?? "targeted",
|
|
12053
12674
|
clients: params.clients.size,
|
|
12675
|
+
targets: targetConnIds ? targetConnIds.size : void 0,
|
|
12054
12676
|
dropIfSlow: opts?.dropIfSlow,
|
|
12055
12677
|
presenceVersion: opts?.stateVersion?.presence,
|
|
12056
12678
|
healthVersion: opts?.stateVersion?.health
|
|
@@ -12058,6 +12680,7 @@ function createGatewayBroadcaster(params) {
|
|
|
12058
12680
|
if (event === "agent") Object.assign(logMeta, summarizeAgentEventForWsLog(payload));
|
|
12059
12681
|
logWs("out", "event", logMeta);
|
|
12060
12682
|
for (const c of params.clients) {
|
|
12683
|
+
if (targetConnIds && !targetConnIds.has(c.connId)) continue;
|
|
12061
12684
|
if (!hasEventScope(c, event)) continue;
|
|
12062
12685
|
const slow = c.socket.bufferedAmount > MAX_BUFFERED_BYTES;
|
|
12063
12686
|
if (slow && opts?.dropIfSlow) continue;
|
|
@@ -12072,7 +12695,15 @@ function createGatewayBroadcaster(params) {
|
|
|
12072
12695
|
} catch {}
|
|
12073
12696
|
}
|
|
12074
12697
|
};
|
|
12075
|
-
|
|
12698
|
+
const broadcast = (event, payload, opts) => broadcastInternal(event, payload, opts);
|
|
12699
|
+
const broadcastToConnIds = (event, payload, connIds, opts) => {
|
|
12700
|
+
if (connIds.size === 0) return;
|
|
12701
|
+
broadcastInternal(event, payload, opts, connIds);
|
|
12702
|
+
};
|
|
12703
|
+
return {
|
|
12704
|
+
broadcast,
|
|
12705
|
+
broadcastToConnIds
|
|
12706
|
+
};
|
|
12076
12707
|
}
|
|
12077
12708
|
|
|
12078
12709
|
//#endregion
|
|
@@ -13812,6 +14443,40 @@ function sendJson(res, status, body) {
|
|
|
13812
14443
|
res.setHeader("Content-Type", "application/json; charset=utf-8");
|
|
13813
14444
|
res.end(JSON.stringify(body));
|
|
13814
14445
|
}
|
|
14446
|
+
function isCanvasPath(pathname) {
|
|
14447
|
+
return pathname === A2UI_PATH || pathname.startsWith(`${A2UI_PATH}/`) || pathname === CANVAS_HOST_PATH || pathname.startsWith(`${CANVAS_HOST_PATH}/`) || pathname === CANVAS_WS_PATH;
|
|
14448
|
+
}
|
|
14449
|
+
function hasAuthorizedWsClientForIp(clients, clientIp) {
|
|
14450
|
+
for (const client of clients) if (client.clientIp && client.clientIp === clientIp) return true;
|
|
14451
|
+
return false;
|
|
14452
|
+
}
|
|
14453
|
+
async function authorizeCanvasRequest(params) {
|
|
14454
|
+
const { req, auth, trustedProxies, clients } = params;
|
|
14455
|
+
if (isLocalDirectRequest(req, trustedProxies)) return true;
|
|
14456
|
+
const token = getBearerToken(req);
|
|
14457
|
+
if (token) {
|
|
14458
|
+
if ((await authorizeGatewayConnect({
|
|
14459
|
+
auth: {
|
|
14460
|
+
...auth,
|
|
14461
|
+
allowTailscale: false
|
|
14462
|
+
},
|
|
14463
|
+
connectAuth: {
|
|
14464
|
+
token,
|
|
14465
|
+
password: token
|
|
14466
|
+
},
|
|
14467
|
+
req,
|
|
14468
|
+
trustedProxies
|
|
14469
|
+
})).ok) return true;
|
|
14470
|
+
}
|
|
14471
|
+
const clientIp = resolveGatewayClientIp({
|
|
14472
|
+
remoteAddr: req.socket?.remoteAddress ?? "",
|
|
14473
|
+
forwardedFor: getHeader(req, "x-forwarded-for"),
|
|
14474
|
+
realIp: getHeader(req, "x-real-ip"),
|
|
14475
|
+
trustedProxies
|
|
14476
|
+
});
|
|
14477
|
+
if (!clientIp) return false;
|
|
14478
|
+
return hasAuthorizedWsClientForIp(clients, clientIp);
|
|
14479
|
+
}
|
|
13815
14480
|
function createHooksRequestHandler(opts) {
|
|
13816
14481
|
const { getHooksConfig, bindHost, port, logHooks, dispatchAgentHook, dispatchWakeHook } = opts;
|
|
13817
14482
|
return async (req, res) => {
|
|
@@ -13820,14 +14485,19 @@ function createHooksRequestHandler(opts) {
|
|
|
13820
14485
|
const url = new URL(req.url ?? "/", `http://${bindHost}:${port}`);
|
|
13821
14486
|
const basePath = hooksConfig.basePath;
|
|
13822
14487
|
if (url.pathname !== basePath && !url.pathname.startsWith(`${basePath}/`)) return false;
|
|
13823
|
-
|
|
14488
|
+
if (url.searchParams.has("token")) {
|
|
14489
|
+
res.statusCode = 400;
|
|
14490
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
14491
|
+
res.end("Hook token must be provided via Authorization: Bearer <token> or X-OpenClaw-Token header (query parameters are not allowed).");
|
|
14492
|
+
return true;
|
|
14493
|
+
}
|
|
14494
|
+
const token = extractHookToken(req);
|
|
13824
14495
|
if (!token || token !== hooksConfig.token) {
|
|
13825
14496
|
res.statusCode = 401;
|
|
13826
14497
|
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
13827
14498
|
res.end("Unauthorized");
|
|
13828
14499
|
return true;
|
|
13829
14500
|
}
|
|
13830
|
-
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.");
|
|
13831
14501
|
if (req.method !== "POST") {
|
|
13832
14502
|
res.statusCode = 405;
|
|
13833
14503
|
res.setHeader("Allow", "POST");
|
|
@@ -13955,7 +14625,7 @@ function createHooksRequestHandler(opts) {
|
|
|
13955
14625
|
};
|
|
13956
14626
|
}
|
|
13957
14627
|
function createGatewayHttpServer(opts) {
|
|
13958
|
-
const { canvasHost, controlUiEnabled, controlUiBasePath, controlUiRoot, openAiChatCompletionsEnabled, openResponsesEnabled, openResponsesConfig, handleHooksRequest, handlePluginRequest, resolvedAuth } = opts;
|
|
14628
|
+
const { canvasHost, clients, controlUiEnabled, controlUiBasePath, controlUiRoot, openAiChatCompletionsEnabled, openResponsesEnabled, openResponsesConfig, handleHooksRequest, handlePluginRequest, resolvedAuth } = opts;
|
|
13959
14629
|
const httpServer = opts.tlsOptions ? createServer$1(opts.tlsOptions, (req, res) => {
|
|
13960
14630
|
handleRequest(req, res);
|
|
13961
14631
|
}) : createServer((req, res) => {
|
|
@@ -13987,6 +14657,17 @@ function createGatewayHttpServer(opts) {
|
|
|
13987
14657
|
})) return;
|
|
13988
14658
|
}
|
|
13989
14659
|
if (canvasHost) {
|
|
14660
|
+
if (isCanvasPath(new URL(req.url ?? "/", "http://localhost").pathname)) {
|
|
14661
|
+
if (!await authorizeCanvasRequest({
|
|
14662
|
+
req,
|
|
14663
|
+
auth: resolvedAuth,
|
|
14664
|
+
trustedProxies,
|
|
14665
|
+
clients
|
|
14666
|
+
})) {
|
|
14667
|
+
sendUnauthorized(res);
|
|
14668
|
+
return;
|
|
14669
|
+
}
|
|
14670
|
+
}
|
|
13990
14671
|
if (await handleA2uiHttpRequest(req, res)) return;
|
|
13991
14672
|
if (await canvasHost.handleHttpRequest(req, res)) return;
|
|
13992
14673
|
}
|
|
@@ -14013,11 +14694,29 @@ function createGatewayHttpServer(opts) {
|
|
|
14013
14694
|
return httpServer;
|
|
14014
14695
|
}
|
|
14015
14696
|
function attachGatewayUpgradeHandler(opts) {
|
|
14016
|
-
const { httpServer, wss, canvasHost } = opts;
|
|
14697
|
+
const { httpServer, wss, canvasHost, clients, resolvedAuth } = opts;
|
|
14017
14698
|
httpServer.on("upgrade", (req, socket, head) => {
|
|
14018
|
-
|
|
14019
|
-
|
|
14020
|
-
|
|
14699
|
+
(async () => {
|
|
14700
|
+
if (canvasHost) {
|
|
14701
|
+
if (new URL(req.url ?? "/", "http://localhost").pathname === CANVAS_WS_PATH) {
|
|
14702
|
+
if (!await authorizeCanvasRequest({
|
|
14703
|
+
req,
|
|
14704
|
+
auth: resolvedAuth,
|
|
14705
|
+
trustedProxies: loadConfig().gateway?.trustedProxies ?? [],
|
|
14706
|
+
clients
|
|
14707
|
+
})) {
|
|
14708
|
+
socket.write("HTTP/1.1 401 Unauthorized\r\nConnection: close\r\n\r\n");
|
|
14709
|
+
socket.destroy();
|
|
14710
|
+
return;
|
|
14711
|
+
}
|
|
14712
|
+
}
|
|
14713
|
+
if (canvasHost.handleUpgrade(req, socket, head)) return;
|
|
14714
|
+
}
|
|
14715
|
+
wss.handleUpgrade(req, socket, head, (ws) => {
|
|
14716
|
+
wss.emit("connection", ws, req);
|
|
14717
|
+
});
|
|
14718
|
+
})().catch(() => {
|
|
14719
|
+
socket.destroy();
|
|
14021
14720
|
});
|
|
14022
14721
|
});
|
|
14023
14722
|
}
|
|
@@ -14336,6 +15035,8 @@ async function createGatewayRuntimeState(params) {
|
|
|
14336
15035
|
} catch (err) {
|
|
14337
15036
|
params.logCanvas.warn(`canvas host failed to start: ${String(err)}`);
|
|
14338
15037
|
}
|
|
15038
|
+
const clients = /* @__PURE__ */ new Set();
|
|
15039
|
+
const { broadcast, broadcastToConnIds } = createGatewayBroadcaster({ clients });
|
|
14339
15040
|
const handleHooksRequest = createGatewayHooksRequestHandler({
|
|
14340
15041
|
deps: params.deps,
|
|
14341
15042
|
getHooksConfig: params.hooksConfig,
|
|
@@ -14353,6 +15054,7 @@ async function createGatewayRuntimeState(params) {
|
|
|
14353
15054
|
for (const host of bindHosts) {
|
|
14354
15055
|
const httpServer = createGatewayHttpServer({
|
|
14355
15056
|
canvasHost,
|
|
15057
|
+
clients,
|
|
14356
15058
|
controlUiEnabled: params.controlUiEnabled,
|
|
14357
15059
|
controlUiBasePath: params.controlUiBasePath,
|
|
14358
15060
|
controlUiRoot: params.controlUiRoot,
|
|
@@ -14386,10 +15088,10 @@ async function createGatewayRuntimeState(params) {
|
|
|
14386
15088
|
for (const server of httpServers) attachGatewayUpgradeHandler({
|
|
14387
15089
|
httpServer: server,
|
|
14388
15090
|
wss,
|
|
14389
|
-
canvasHost
|
|
15091
|
+
canvasHost,
|
|
15092
|
+
clients,
|
|
15093
|
+
resolvedAuth: params.resolvedAuth
|
|
14390
15094
|
});
|
|
14391
|
-
const clients = /* @__PURE__ */ new Set();
|
|
14392
|
-
const { broadcast } = createGatewayBroadcaster({ clients });
|
|
14393
15095
|
const agentRunSeq = /* @__PURE__ */ new Map();
|
|
14394
15096
|
const dedupe = /* @__PURE__ */ new Map();
|
|
14395
15097
|
const chatRunState = createChatRunState();
|
|
@@ -14398,6 +15100,8 @@ async function createGatewayRuntimeState(params) {
|
|
|
14398
15100
|
const chatDeltaSentAt = chatRunState.deltaSentAt;
|
|
14399
15101
|
const addChatRun = chatRunRegistry.add;
|
|
14400
15102
|
const removeChatRun = chatRunRegistry.remove;
|
|
15103
|
+
const chatAbortControllers = /* @__PURE__ */ new Map();
|
|
15104
|
+
const toolEventRecipients = createToolEventRecipientRegistry();
|
|
14401
15105
|
return {
|
|
14402
15106
|
canvasHost,
|
|
14403
15107
|
httpServer,
|
|
@@ -14406,6 +15110,7 @@ async function createGatewayRuntimeState(params) {
|
|
|
14406
15110
|
wss,
|
|
14407
15111
|
clients,
|
|
14408
15112
|
broadcast,
|
|
15113
|
+
broadcastToConnIds,
|
|
14409
15114
|
agentRunSeq,
|
|
14410
15115
|
dedupe,
|
|
14411
15116
|
chatRunState,
|
|
@@ -14413,7 +15118,8 @@ async function createGatewayRuntimeState(params) {
|
|
|
14413
15118
|
chatDeltaSentAt,
|
|
14414
15119
|
addChatRun,
|
|
14415
15120
|
removeChatRun,
|
|
14416
|
-
chatAbortControllers
|
|
15121
|
+
chatAbortControllers,
|
|
15122
|
+
toolEventRecipients
|
|
14417
15123
|
};
|
|
14418
15124
|
}
|
|
14419
15125
|
|
|
@@ -14882,7 +15588,7 @@ function formatGatewayAuthFailureMessage(params) {
|
|
|
14882
15588
|
const isCli = isGatewayCliClient(client);
|
|
14883
15589
|
const isControlUi = client?.id === GATEWAY_CLIENT_IDS.CONTROL_UI;
|
|
14884
15590
|
const isWebchat = isWebchatClient(client);
|
|
14885
|
-
const tokenHint = isCli ? "set gateway.remote.token to match gateway.auth.token" : isControlUi || isWebchat ? "open
|
|
15591
|
+
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";
|
|
14886
15592
|
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";
|
|
14887
15593
|
switch (reason) {
|
|
14888
15594
|
case "token_missing": return `unauthorized: gateway token missing (${tokenHint})`;
|
|
@@ -15450,7 +16156,8 @@ function attachGatewayWsMessageHandler(params) {
|
|
|
15450
16156
|
socket,
|
|
15451
16157
|
connect: connectParams,
|
|
15452
16158
|
connId,
|
|
15453
|
-
presenceKey
|
|
16159
|
+
presenceKey,
|
|
16160
|
+
clientIp: reportedClientIp
|
|
15454
16161
|
};
|
|
15455
16162
|
setClient(nextClient);
|
|
15456
16163
|
setHandshakeState("connected");
|
|
@@ -15870,7 +16577,7 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
15870
16577
|
let canvasHostServer = null;
|
|
15871
16578
|
const gatewayTls = await loadGatewayTlsRuntime(cfgAtStart.gateway?.tls, log.child("tls"));
|
|
15872
16579
|
if (cfgAtStart.gateway?.tls?.enabled && !gatewayTls.enabled) throw new Error(gatewayTls.error ?? "gateway tls: failed to enable");
|
|
15873
|
-
const { canvasHost, httpServer, httpServers, httpBindHosts, wss, clients, broadcast, agentRunSeq, dedupe, chatRunState, chatRunBuffers, chatDeltaSentAt, addChatRun, removeChatRun, chatAbortControllers } = await createGatewayRuntimeState({
|
|
16580
|
+
const { canvasHost, httpServer, httpServers, httpBindHosts, wss, clients, broadcast, broadcastToConnIds, agentRunSeq, dedupe, chatRunState, chatRunBuffers, chatDeltaSentAt, addChatRun, removeChatRun, chatAbortControllers, toolEventRecipients } = await createGatewayRuntimeState({
|
|
15874
16581
|
cfg: cfgAtStart,
|
|
15875
16582
|
bindHost,
|
|
15876
16583
|
port,
|
|
@@ -15965,11 +16672,13 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
15965
16672
|
});
|
|
15966
16673
|
const agentUnsub = onAgentEvent(createAgentEventHandler({
|
|
15967
16674
|
broadcast,
|
|
16675
|
+
broadcastToConnIds,
|
|
15968
16676
|
nodeSendToSession,
|
|
15969
16677
|
agentRunSeq,
|
|
15970
16678
|
chatRunState,
|
|
15971
16679
|
resolveSessionKeyForRun,
|
|
15972
|
-
clearAgentRunContext
|
|
16680
|
+
clearAgentRunContext,
|
|
16681
|
+
toolEventRecipients
|
|
15973
16682
|
}));
|
|
15974
16683
|
const heartbeatUnsub = onHeartbeatEvent((evt) => {
|
|
15975
16684
|
broadcast("heartbeat", evt, { dropIfSlow: true });
|
|
@@ -16008,6 +16717,7 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
16008
16717
|
incrementPresenceVersion,
|
|
16009
16718
|
getHealthVersion,
|
|
16010
16719
|
broadcast,
|
|
16720
|
+
broadcastToConnIds,
|
|
16011
16721
|
nodeSendToSession,
|
|
16012
16722
|
nodeSendToAllSubscribed,
|
|
16013
16723
|
nodeSubscribe,
|
|
@@ -16022,6 +16732,7 @@ async function startGatewayServer(port = 18789, opts = {}) {
|
|
|
16022
16732
|
chatDeltaSentAt: chatRunState.deltaSentAt,
|
|
16023
16733
|
addChatRun,
|
|
16024
16734
|
removeChatRun,
|
|
16735
|
+
registerToolEventRecipient: toolEventRecipients.add,
|
|
16025
16736
|
dedupe,
|
|
16026
16737
|
wizardSessions,
|
|
16027
16738
|
findRunningWizard,
|