@qqbrowser/openclaw-qbot 0.0.88 → 0.0.89
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/dist/{agents-Dxk5oWw_.js → agents-BBYlUP5T.js} +1 -1
- package/dist/{agents.config-CXoN8qvY.js → agents.config-CoZtnyKH.js} +1 -1
- package/dist/{agents.config-D6kg-4Ct.js → agents.config-Dyqz-Sk-.js} +1 -1
- package/dist/{auth-choice-COKpi33u.js → auth-choice-CVvPBerD.js} +1 -1
- package/dist/{auth-choice-K5eGX1sj.js → auth-choice-DSNX3Hdu.js} +1 -1
- package/dist/{banner-DsZegXc3.js → banner-C4Bgn_Gf.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +1 -1
- package/dist/bundled/session-memory/handler.js +1 -1
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-options-BU9Qf5Cq.js → channel-options-9lP0IBR0.js} +1 -1
- package/dist/{channel-options-C-h17ZYO.js → channel-options-C9PHeVlU.js} +1 -1
- package/dist/{channel-web-DmmMXUdc.js → channel-web-DhNCVKla.js} +1 -1
- package/dist/{channel-web-C2Z4xKq3.js → channel-web-NeSGV-e7.js} +1 -1
- package/dist/{channels-cli-WBY_CB2-.js → channels-cli-CWu-PrIl.js} +1 -1
- package/dist/{channels-cli-DM6DIc_P.js → channels-cli-DHD8V6-q.js} +1 -1
- package/dist/{cli-DXZKyKLK.js → cli-BWE7sLVx.js} +1 -1
- package/dist/{cli-RLbxgNsy.js → cli-DF5ZcuuX.js} +1 -1
- package/dist/{command-registry-CIBlcDrG.js → command-registry-DIOnYWDt.js} +1 -1
- package/dist/{compact-BfHim3cA.js → compact-DgbuvsDF.js} +6 -6
- package/dist/{compact.runtime-C_urV0W5.js → compact.runtime-B5zaMKSa.js} +1 -1
- package/dist/{compact.runtime-eUr8DtWw.js → compact.runtime-B6qfwW6l.js} +1 -1
- package/dist/{compact.runtime-DtLl0dZ5.js → compact.runtime-BofMQvNu.js} +1 -1
- package/dist/{compact.runtime-BpYpUiXf.js → compact.runtime-C-OsuZNM.js} +1 -1
- package/dist/{completion-cli-BYf6ef-t.js → completion-cli-CckNzelT.js} +1 -1
- package/dist/{completion-cli-Dsi5-gGE.js → completion-cli-F60ntV7X.js} +1 -1
- package/dist/{config-cli-GwzrxUR-.js → config-cli-1Ut82gjz.js} +1 -1
- package/dist/{config-cli-IpFnLniP.js → config-cli-BVtPmTcO.js} +1 -1
- package/dist/{configure-Cx7WvgVM.js → configure-3Kgwf3gj.js} +1 -1
- package/dist/{configure-DIVEkxxF.js → configure-Bpy51qkb.js} +1 -1
- package/dist/{deps-send-whatsapp.runtime-CdAcLrxO.js → deps-send-whatsapp.runtime-CI4UsY0E.js} +1 -1
- package/dist/{deps-send-whatsapp.runtime-Dj_dh7mb.js → deps-send-whatsapp.runtime-CJbg_i22.js} +1 -1
- package/dist/{deps-send-whatsapp.runtime-DJOAewju.js → deps-send-whatsapp.runtime-CPhSRgv3.js} +1 -1
- package/dist/{deps-send-whatsapp.runtime-BfuHSQxE.js → deps-send-whatsapp.runtime-DLRNnLUS.js} +1 -1
- package/dist/{doctor-completion-BcvWFszV.js → doctor-completion-CucfTzWR.js} +1 -1
- package/dist/{doctor-completion-CQMvGm9I.js → doctor-completion-D76qqYqG.js} +1 -1
- package/dist/entry.js +1 -1
- package/dist/extensionAPI.js +1 -1
- package/dist/{gateway-cli-CBK9IHgW.js → gateway-cli-BKWQlBHk.js} +2 -2
- package/dist/{gateway-cli-BUcUT6It.js → gateway-cli-DtqcCdL7.js} +2 -2
- package/dist/{health-CiTej6rM.js → health-BXDoFh4Q.js} +1 -1
- package/dist/{health-Pqtl8jCk.js → health-xCl2atiY.js} +1 -1
- package/dist/{hooks-cli-C6nsAzQh.js → hooks-cli-B2j44Nvk.js} +1 -1
- package/dist/{hooks-cli-BR-m9Vxi.js → hooks-cli-DT0Hmbz-.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/llm-slug-generator.js +1 -1
- package/dist/{models-CxaUXLzo.js → models-DhX1F_Pj.js} +1 -1
- package/dist/{models-cli-DuamSrQA.js → models-cli-B-kAey2t.js} +1 -1
- package/dist/{models-cli-DM55mW-t.js → models-cli-B53yy1mw.js} +1 -1
- package/dist/{npm-resolution-CKwFeFIB.js → npm-resolution-BIifLd1f.js} +1 -1
- package/dist/{npm-resolution-9bO0TPQF.js → npm-resolution-C2Ow0mqR.js} +1 -1
- package/dist/{onboard-BU0gG29k.js → onboard-D9IefEER.js} +2 -2
- package/dist/{onboard-channels-CsKyM82H.js → onboard-channels-B8JZHEaQ.js} +1 -1
- package/dist/{onboard-channels-BK5KINY9.js → onboard-channels-ByD6UdVu.js} +1 -1
- package/dist/{onboard-BlGJhhEF.js → onboard-qMIhLeRM.js} +2 -2
- package/dist/{onboarding-CM_9Fyo2.js → onboarding-CddGtlY5.js} +1 -1
- package/dist/{onboarding-Kz5K9mKB.js → onboarding-CgqsAteJ.js} +1 -1
- package/dist/{onboarding.finalize-DstFPCVD.js → onboarding.finalize-BgCWB7kF.js} +1 -1
- package/dist/{onboarding.finalize-C96gv5GP.js → onboarding.finalize-CkHWKgcF.js} +1 -1
- package/dist/{pi-embedded-BHryO0s2.js → pi-embedded-C6L57IhI.js} +6 -6
- package/dist/{pi-embedded-D_03X4gB.js → pi-embedded-CN25rQwp.js} +6 -6
- package/dist/{plugin-registry-DyreKTxc.js → plugin-registry-Cido8VxT.js} +1 -1
- package/dist/{plugin-registry-Dsb86j5r.js → plugin-registry-CpPyaWT0.js} +1 -1
- package/dist/plugin-sdk/{channel-web-BDO73YAY.js → channel-web-DgBEXyWx.js} +1 -1
- package/dist/plugin-sdk/{channel-web-C0hljM9U.js → channel-web-T7e1VB_g.js} +1 -1
- package/dist/plugin-sdk/{compact.runtime-B-jUdCSu.js → compact.runtime-B0qhTLAN.js} +1 -1
- package/dist/plugin-sdk/{compact.runtime-iEjcWTOi.js → compact.runtime-C5aI5KIg.js} +1 -1
- package/dist/plugin-sdk/{compact.runtime-BspLSIc1.js → compact.runtime-Da9JL-Re.js} +1 -1
- package/dist/plugin-sdk/{compact.runtime-CMWw2lwa.js → compact.runtime-DuWXCPO4.js} +1 -1
- package/dist/plugin-sdk/{compact.runtime-HnqzVAl7.js → compact.runtime-F35snTaz.js} +1 -1
- package/dist/plugin-sdk/{compact.runtime-C2keFFLA.js → compact.runtime-kL8PhhSi.js} +1 -1
- package/dist/plugin-sdk/compat.js +1 -1
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-BRm24Qy-.js → deps-send-whatsapp.runtime-BWVV9ImJ.js} +1 -1
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-Bw9eegUO.js → deps-send-whatsapp.runtime-BdOLZ0P3.js} +1 -1
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-DdS9G3TR.js → deps-send-whatsapp.runtime-DMD-mrgL.js} +1 -1
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-ClvlojBM.js → deps-send-whatsapp.runtime-DNaHPuYl.js} +1 -1
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-DjAB5JP0.js → deps-send-whatsapp.runtime-DkmDJ3eX.js} +1 -1
- package/dist/plugin-sdk/{deps-send-whatsapp.runtime-yd5qmNGP.js → deps-send-whatsapp.runtime-nRQWODTL.js} +1 -1
- package/dist/plugin-sdk/{dispatch-BtGxkC47.js → dispatch--4Vuy9oL.js} +6 -6
- package/dist/plugin-sdk/{dispatch-BO5EIrCx.js → dispatch-DPafUBvi.js} +6 -6
- package/dist/plugin-sdk/{dispatch-DABpoSJj.js → dispatch-DzdnDix3.js} +6 -6
- package/dist/plugin-sdk/{dispatch-DfBUhUa2.js → dispatch-_3aPMKVc.js} +6 -6
- package/dist/plugin-sdk/{dispatch-BFVL83hy.js → dispatch-v8f5j6tA.js} +6 -6
- package/dist/plugin-sdk/index.js +1 -1
- package/dist/plugin-sdk/irc.js +1 -1
- package/dist/plugin-sdk/matrix.js +1 -1
- package/dist/plugin-sdk/msteams.js +1 -1
- package/dist/plugin-sdk/nextcloud-talk.js +1 -1
- package/dist/plugin-sdk/{reply-0QJVop5g.js → reply-FZOMaPdT.js} +6 -6
- package/dist/plugin-sdk/{slash-dispatch.runtime-I6_T20Yd.js → slash-dispatch.runtime-CV3coyWo.js} +1 -1
- package/dist/plugin-sdk/{slash-dispatch.runtime-BwEZoF7O.js → slash-dispatch.runtime-CYrhiT19.js} +1 -1
- package/dist/plugin-sdk/{slash-dispatch.runtime-W9VRo3lf.js → slash-dispatch.runtime-CkVpd9xh.js} +1 -1
- package/dist/plugin-sdk/{slash-dispatch.runtime-CaemgmaW.js → slash-dispatch.runtime-CzBVRyba.js} +1 -1
- package/dist/plugin-sdk/{slash-dispatch.runtime-B4nePbcc.js → slash-dispatch.runtime-DjGJDpWI.js} +1 -1
- package/dist/plugin-sdk/{slash-dispatch.runtime-ByQEhvcx.js → slash-dispatch.runtime-WIHCc0nP.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-pjzgZyiw.js → subagent-registry-runtime-4o_8yfyB.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-ikSo08Bh.js → subagent-registry-runtime-BJxZkq6N.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-BPHOIYnR.js → subagent-registry-runtime-BRl0zIp-.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-C2TUyWmj.js → subagent-registry-runtime-C-2UF0IM.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-Co3rxlYB.js → subagent-registry-runtime-bCP-yDZd.js} +1 -1
- package/dist/plugin-sdk/{subagent-registry-runtime-Wu14xqj_.js → subagent-registry-runtime-lM2A6bas.js} +1 -1
- package/dist/plugin-sdk/{web-Bgl0ILbD.js → web--MzzmLKe.js} +1 -1
- package/dist/plugin-sdk/{web-BzRQSS8R.js → web-BoQezxCE.js} +1 -1
- package/dist/plugin-sdk/{web-CK9n5ZfK.js → web-CgFT-LB5.js} +1 -1
- package/dist/plugin-sdk/{web-3TYyfPQG.js → web-CskfGkR8.js} +1 -1
- package/dist/plugin-sdk/{web-WIpdyZZQ.js → web-KZ3WEX08.js} +1 -1
- package/dist/plugin-sdk/{web-BCOXLnUB.js → web-sUKMDnvE.js} +1 -1
- package/dist/plugin-sdk/whatsapp.js +1 -1
- package/dist/{plugins-cli-B_m-0xTz.js → plugins-cli-7Rom2MRn.js} +1 -1
- package/dist/{plugins-cli-fpI_fBTE.js → plugins-cli-ULYhpcRr.js} +1 -1
- package/dist/{program-B52FJo5X.js → program-C8M8kVC0.js} +2 -2
- package/dist/{program-context-9FmjmgRi.js → program-context-DNheupaq.js} +1 -1
- package/dist/{prompt-select-styled-7bpPt2PG.js → prompt-select-styled-BfSAWDfm.js} +1 -1
- package/dist/{prompt-select-styled-bL9scez3.js → prompt-select-styled-Qtie1Z5m.js} +1 -1
- package/dist/{provider-auth-helpers-CatlYQ1x.js → provider-auth-helpers-PSez6fyE.js} +1 -1
- package/dist/{provider-auth-helpers-DgQEZQZm.js → provider-auth-helpers-fIKVMJmj.js} +1 -1
- package/dist/{push-apns-Bc0uTUFe.js → push-apns-CZ3x5b7S.js} +1 -1
- package/dist/{push-apns-Dq1z7GKZ.js → push-apns-D4QwEU4o.js} +1 -1
- package/dist/{register.agent-Cjvn_JC_.js → register.agent-CQCSZoM3.js} +1 -1
- package/dist/{register.agent-DZ68nNV_.js → register.agent-CkdmFMol.js} +1 -1
- package/dist/{register.configure-DAq-OZQ_.js → register.configure-CY7jH_t-.js} +1 -1
- package/dist/{register.configure-DNeVIlZk.js → register.configure-jvsFtsEY.js} +1 -1
- package/dist/{register.maintenance-Cx5TbFUH.js → register.maintenance-Cn2-JBxc.js} +1 -1
- package/dist/{register.maintenance-BGD-EdYb.js → register.maintenance-DbdyMqnN.js} +1 -1
- package/dist/{register.message-BVBF2xBA.js → register.message-8Pxm1wyr.js} +1 -1
- package/dist/{register.message-BahjRagK.js → register.message-DxNX0-7A.js} +1 -1
- package/dist/{register.onboard-BYsU9URi.js → register.onboard-BeuVHdxu.js} +1 -1
- package/dist/{register.onboard-CsUvw9JY.js → register.onboard-D9LNxSOp.js} +1 -1
- package/dist/{register.setup-DUGQ3LjU.js → register.setup-AyriKZAD.js} +1 -1
- package/dist/{register.setup-Czz8kiz8.js → register.setup-D6sjApkR.js} +1 -1
- package/dist/{register.status-health-sessions-DwQDXdjY.js → register.status-health-sessions-C3YEi9ej.js} +1 -1
- package/dist/{register.status-health-sessions-C-6pt1vC.js → register.status-health-sessions-DLibm4n2.js} +1 -1
- package/dist/{register.subclis-nr-J0DsM.js → register.subclis-DMwBX73g.js} +1 -1
- package/dist/{reply-Bv0w_dst.js → reply-JaJmymld.js} +6 -6
- package/dist/{run-main-C9SR6tqO.js → run-main-BtJ9Rvkf.js} +1 -1
- package/dist/{server-node-events-DBU3p4Am.js → server-node-events-B1xc0xHC.js} +1 -1
- package/dist/{server-node-events-duTsLOu5.js → server-node-events-DkYb_tMY.js} +1 -1
- package/dist/{slash-dispatch.runtime-BKW0b-z4.js → slash-dispatch.runtime-5FhvH4vs.js} +1 -1
- package/dist/{slash-dispatch.runtime-Dllhj5El.js → slash-dispatch.runtime-8bdhjt7e.js} +1 -1
- package/dist/{slash-dispatch.runtime-BykVo525.js → slash-dispatch.runtime-BSGNAoT3.js} +1 -1
- package/dist/{slash-dispatch.runtime-CwKA-3Mz.js → slash-dispatch.runtime-DzFzghS8.js} +1 -1
- package/dist/{status-BUdDRE9f.js → status-Ln-hRgxh.js} +1 -1
- package/dist/{status-QCEyD_DK.js → status-XJoKJIPd.js} +1 -1
- package/dist/{subagent-registry-runtime-ANqbVbfo.js → subagent-registry-runtime-CMgr0_UE.js} +1 -1
- package/dist/{subagent-registry-runtime-CWrWUjll.js → subagent-registry-runtime-DA3RtD85.js} +1 -1
- package/dist/{subagent-registry-runtime-CA_UwsAM.js → subagent-registry-runtime-DDF1mHS2.js} +1 -1
- package/dist/{subagent-registry-runtime-DjLSmsYn.js → subagent-registry-runtime-DTliYOy2.js} +1 -1
- package/dist/{update-cli-2Prf30Co.js → update-cli-DhZZ9nIA.js} +1 -1
- package/dist/{update-cli-BZ7xaJXP.js → update-cli-T5qjfgGh.js} +1 -1
- package/dist/{update-runner-Dmea_7oZ.js → update-runner-C6Z9RGJ6.js} +1 -1
- package/dist/{update-runner-CzyTP7xB.js → update-runner-DThdoQ9_.js} +1 -1
- package/dist/{web-BYWPQTzp.js → web-BinddLZf.js} +1 -1
- package/dist/{web-B90WZv9Y.js → web-CWJIsRZO.js} +1 -1
- package/dist/{web-DTS3rwm1.js → web-D995jmBq.js} +1 -1
- package/dist/{web-BvZz642s.js → web-F5nE_LwQ.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./paths-DfDmyG-r.js";import{A as e,p as t}from"./subsystem-B35lZH6M.js";import"./utils-eSzw3-BW.js";import"./model-selection-D_WMcs-m.js";import"./agent-scope-DauKPN2a.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-HBWzEstG.js";import"./boolean-Ch3DfXPy.js";import"./env-DEV6pFi3.js";import"./env-overrides-CYDvuetI.js";import"./registry-DwigmP92.js";import"./skills-sxAZFqk6.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CPVBLi22.js";import"./logger-DMM_uqZu.js";import"./exec-Ble6PWIi.js";import"./windows-spawn-ylt31bST.js";import"./redact-DtCbW9Lh.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-alPucxwR.js";import"./paths-wWzafjVT.js";import"./chat-envelope-HVpKusFc.js";import"./call-bAaUSED1.js";import"./onboard-helpers-Dn0KiH64.js";import"./prompt-style-Ct-2QSEG.js";import{t as n}from"./links-CmkiG3i0.js";import{n as r}from"./cli-utils-Cfu5AugP.js";import"./progress-CDXE9V22.js";import"./runtime-guard-CKqXF6-d.js";import"./note-CxxIxPA5.js";import"./clack-prompter-BTYj-mu-.js";import"./onboarding.secret-input-De2KkiI6.js";import"./onboarding-
|
|
1
|
+
import"./paths-DfDmyG-r.js";import{A as e,p as t}from"./subsystem-B35lZH6M.js";import"./utils-eSzw3-BW.js";import"./model-selection-D_WMcs-m.js";import"./agent-scope-DauKPN2a.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-HBWzEstG.js";import"./boolean-Ch3DfXPy.js";import"./env-DEV6pFi3.js";import"./env-overrides-CYDvuetI.js";import"./registry-DwigmP92.js";import"./skills-sxAZFqk6.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CPVBLi22.js";import"./logger-DMM_uqZu.js";import"./exec-Ble6PWIi.js";import"./windows-spawn-ylt31bST.js";import"./redact-DtCbW9Lh.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-alPucxwR.js";import"./paths-wWzafjVT.js";import"./chat-envelope-HVpKusFc.js";import"./call-bAaUSED1.js";import"./onboard-helpers-Dn0KiH64.js";import"./prompt-style-Ct-2QSEG.js";import{t as n}from"./links-CmkiG3i0.js";import{n as r}from"./cli-utils-Cfu5AugP.js";import"./progress-CDXE9V22.js";import"./runtime-guard-CKqXF6-d.js";import"./note-CxxIxPA5.js";import"./clack-prompter-BTYj-mu-.js";import"./onboarding.secret-input-De2KkiI6.js";import"./onboarding-CddGtlY5.js";import"./logging-KnZSytkB.js";import{t as i}from"./onboard-provider-auth-flags-Dvwzdz37.js";import{n as a}from"./auth-choice-options-Dw14noox.js";import{t as o}from"./onboard-qMIhLeRM.js";function s(e,t){if(!e||typeof e!=`object`)return;let n=`getOptionValueSource`in e?e.getOptionValueSource:void 0;if(typeof n==`function`){if(n.call(e,`skipDaemon`)===`cli`)return!1;if(n.call(e,`installDaemon`)===`cli`)return!!t.installDaemon}}const c=a({includeLegacyAliases:!0,includeSkip:!0});function l(a){let l=a.command(`onboard`).description(`Interactive wizard to set up the gateway, workspace, and skills`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${n(`/cli/onboard`,`docs.openclaw.ai/cli/onboard`)}\n`).option(`--workspace <dir>`,`Agent workspace directory (default: ~/.openclaw-qbot/workspace)`).option(`--reset`,`Reset config + credentials + sessions before running wizard (workspace only with --reset-scope full)`).option(`--reset-scope <scope>`,`Reset scope: config|config+creds+sessions|full`).option(`--non-interactive`,`Run without prompts`,!1).option(`--accept-risk`,`Acknowledge that agents are powerful and full system access is risky (required for --non-interactive)`,!1).option(`--flow <flow>`,`Wizard flow: quickstart|advanced|manual`).option(`--mode <mode>`,`Wizard mode: local|remote`).option(`--auth-choice <choice>`,`Auth: ${c}`).option(`--token-provider <id>`,`Token provider id (non-interactive; used with --auth-choice token)`).option(`--token <token>`,`Token value (non-interactive; used with --auth-choice token)`).option(`--token-profile-id <id>`,`Auth profile id (non-interactive; default: <provider>:manual)`).option(`--token-expires-in <duration>`,`Optional token expiry duration (e.g. 365d, 12h)`).option(`--secret-input-mode <mode>`,`API key persistence mode: plaintext|ref (default: plaintext)`).option(`--cloudflare-ai-gateway-account-id <id>`,`Cloudflare Account ID`).option(`--cloudflare-ai-gateway-gateway-id <id>`,`Cloudflare AI Gateway ID`);for(let e of i)l.option(e.cliOption,e.description);l.option(`--custom-base-url <url>`,`Custom provider base URL`).option(`--custom-api-key <key>`,`Custom provider API key (optional)`).option(`--custom-model-id <id>`,`Custom provider model ID`).option(`--custom-provider-id <id>`,`Custom provider ID (optional; auto-derived by default)`).option(`--custom-compatibility <mode>`,`Custom provider API compatibility: openai|anthropic (default: openai)`).option(`--gateway-port <port>`,`Gateway port`).option(`--gateway-bind <mode>`,`Gateway bind: loopback|tailnet|lan|auto|custom`).option(`--gateway-auth <mode>`,`Gateway auth: token|password`).option(`--gateway-token <token>`,`Gateway token (token auth)`).option(`--gateway-token-ref-env <name>`,`Gateway token SecretRef env var name (token auth; e.g. OPENCLAW_GATEWAY_TOKEN)`).option(`--gateway-password <password>`,`Gateway password (password auth)`).option(`--remote-url <url>`,`Remote Gateway WebSocket URL`).option(`--remote-token <token>`,`Remote Gateway token (optional)`).option(`--tailscale <mode>`,`Tailscale: off|serve|funnel`).option(`--tailscale-reset-on-exit`,`Reset tailscale serve/funnel on exit`).option(`--install-daemon`,`Install gateway service`).option(`--no-install-daemon`,`Skip gateway service install`).option(`--skip-daemon`,`Skip gateway service install`).option(`--daemon-runtime <runtime>`,`Daemon runtime: node|bun`).option(`--skip-channels`,`Skip channel setup`).option(`--skip-skills`,`Skip skills setup`).option(`--skip-search`,`Skip search provider setup`).option(`--skip-health`,`Skip health check`).option(`--skip-ui`,`Skip Control UI/TUI prompts`).option(`--node-manager <name>`,`Node manager for skills: npm|pnpm|bun`).option(`--json`,`Output JSON summary`,!1),l.action(async(e,n)=>{await r(t,async()=>{let r=s(n,{installDaemon:!!e.installDaemon}),i=typeof e.gatewayPort==`string`?Number.parseInt(e.gatewayPort,10):void 0;await o({workspace:e.workspace,nonInteractive:!!e.nonInteractive,acceptRisk:!!e.acceptRisk,flow:e.flow,mode:e.mode,authChoice:e.authChoice,tokenProvider:e.tokenProvider,token:e.token,tokenProfileId:e.tokenProfileId,tokenExpiresIn:e.tokenExpiresIn,secretInputMode:e.secretInputMode,anthropicApiKey:e.anthropicApiKey,openaiApiKey:e.openaiApiKey,mistralApiKey:e.mistralApiKey,openrouterApiKey:e.openrouterApiKey,kilocodeApiKey:e.kilocodeApiKey,aiGatewayApiKey:e.aiGatewayApiKey,cloudflareAiGatewayAccountId:e.cloudflareAiGatewayAccountId,cloudflareAiGatewayGatewayId:e.cloudflareAiGatewayGatewayId,cloudflareAiGatewayApiKey:e.cloudflareAiGatewayApiKey,moonshotApiKey:e.moonshotApiKey,kimiCodeApiKey:e.kimiCodeApiKey,geminiApiKey:e.geminiApiKey,zaiApiKey:e.zaiApiKey,xiaomiApiKey:e.xiaomiApiKey,qianfanApiKey:e.qianfanApiKey,modelstudioApiKeyCn:e.modelstudioApiKeyCn,modelstudioApiKey:e.modelstudioApiKey,minimaxApiKey:e.minimaxApiKey,syntheticApiKey:e.syntheticApiKey,veniceApiKey:e.veniceApiKey,togetherApiKey:e.togetherApiKey,huggingfaceApiKey:e.huggingfaceApiKey,opencodeZenApiKey:e.opencodeZenApiKey,opencodeGoApiKey:e.opencodeGoApiKey,xaiApiKey:e.xaiApiKey,litellmApiKey:e.litellmApiKey,volcengineApiKey:e.volcengineApiKey,byteplusApiKey:e.byteplusApiKey,customBaseUrl:e.customBaseUrl,customApiKey:e.customApiKey,customModelId:e.customModelId,customProviderId:e.customProviderId,customCompatibility:e.customCompatibility,gatewayPort:typeof i==`number`&&Number.isFinite(i)?i:void 0,gatewayBind:e.gatewayBind,gatewayAuth:e.gatewayAuth,gatewayToken:e.gatewayToken,gatewayTokenRefEnv:e.gatewayTokenRefEnv,gatewayPassword:e.gatewayPassword,remoteUrl:e.remoteUrl,remoteToken:e.remoteToken,tailscale:e.tailscale,tailscaleResetOnExit:!!e.tailscaleResetOnExit,reset:!!e.reset,resetScope:e.resetScope,installDaemon:r,daemonRuntime:e.daemonRuntime,skipChannels:!!e.skipChannels,skipSkills:!!e.skipSkills,skipSearch:!!e.skipSearch,skipHealth:!!e.skipHealth,skipUi:!!e.skipUi,nodeManager:e.nodeManager,json:!!e.json},t)})})}export{l as registerOnboardCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,p as t}from"./subsystem-C7tbdlOl.js";import"./paths-BRJCySMM.js";import"./boolean-D15s2V33.js";import"./auth-profiles-BkhVHtgY.js";import"./agent-scope-DjUQMckI.js";import"./utils-bGrn0y-f.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-ByNUYL2n.js";import"./env-overrides-fatFjayp.js";import"./version-q3SkUw2K.js";import"./registry-Bfa_Ykoc.js";import"./skills-DaxiAYb1.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CAHuRRVU.js";import"./logger-CzE2MhuY.js";import"./exec-CEAb_WUd.js";import"./windows-spawn-BgzBBwXL.js";import"./redact-Dhbd2Ou5.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DrzTb7KS.js";import"./paths-Iw1AJLOG.js";import"./chat-envelope-Bznn2SoS.js";import"./call-B4oR7TXC.js";import"./onboard-helpers-bAJ8ELmK.js";import"./prompt-style-LoGJ9Sd_.js";import{t as n}from"./links-DRsshHiS.js";import{n as r}from"./cli-utils-C_maQ2m4.js";import"./progress-CR--5qDW.js";import"./note-DwFvlGbe.js";import"./clack-prompter-BMrD-gme.js";import"./runtime-guard-Cpuk3V_0.js";import"./onboarding.secret-input-DvJPvwAu.js";import"./onboarding-
|
|
1
|
+
import{A as e,p as t}from"./subsystem-C7tbdlOl.js";import"./paths-BRJCySMM.js";import"./boolean-D15s2V33.js";import"./auth-profiles-BkhVHtgY.js";import"./agent-scope-DjUQMckI.js";import"./utils-bGrn0y-f.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-ByNUYL2n.js";import"./env-overrides-fatFjayp.js";import"./version-q3SkUw2K.js";import"./registry-Bfa_Ykoc.js";import"./skills-DaxiAYb1.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CAHuRRVU.js";import"./logger-CzE2MhuY.js";import"./exec-CEAb_WUd.js";import"./windows-spawn-BgzBBwXL.js";import"./redact-Dhbd2Ou5.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DrzTb7KS.js";import"./paths-Iw1AJLOG.js";import"./chat-envelope-Bznn2SoS.js";import"./call-B4oR7TXC.js";import"./onboard-helpers-bAJ8ELmK.js";import"./prompt-style-LoGJ9Sd_.js";import{t as n}from"./links-DRsshHiS.js";import{n as r}from"./cli-utils-C_maQ2m4.js";import"./progress-CR--5qDW.js";import"./note-DwFvlGbe.js";import"./clack-prompter-BMrD-gme.js";import"./runtime-guard-Cpuk3V_0.js";import"./onboarding.secret-input-DvJPvwAu.js";import"./onboarding-CgqsAteJ.js";import"./logging-B7juU2TI.js";import{t as i}from"./onboard-provider-auth-flags-CqbipO7D.js";import{n as a}from"./auth-choice-options-B3WQyS7I.js";import{t as o}from"./onboard-D9IefEER.js";function s(e,t){if(!e||typeof e!=`object`)return;let n=`getOptionValueSource`in e?e.getOptionValueSource:void 0;if(typeof n==`function`){if(n.call(e,`skipDaemon`)===`cli`)return!1;if(n.call(e,`installDaemon`)===`cli`)return!!t.installDaemon}}const c=a({includeLegacyAliases:!0,includeSkip:!0});function l(a){let l=a.command(`onboard`).description(`Interactive wizard to set up the gateway, workspace, and skills`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${n(`/cli/onboard`,`docs.openclaw.ai/cli/onboard`)}\n`).option(`--workspace <dir>`,`Agent workspace directory (default: ~/.openclaw-qbot/workspace)`).option(`--reset`,`Reset config + credentials + sessions before running wizard (workspace only with --reset-scope full)`).option(`--reset-scope <scope>`,`Reset scope: config|config+creds+sessions|full`).option(`--non-interactive`,`Run without prompts`,!1).option(`--accept-risk`,`Acknowledge that agents are powerful and full system access is risky (required for --non-interactive)`,!1).option(`--flow <flow>`,`Wizard flow: quickstart|advanced|manual`).option(`--mode <mode>`,`Wizard mode: local|remote`).option(`--auth-choice <choice>`,`Auth: ${c}`).option(`--token-provider <id>`,`Token provider id (non-interactive; used with --auth-choice token)`).option(`--token <token>`,`Token value (non-interactive; used with --auth-choice token)`).option(`--token-profile-id <id>`,`Auth profile id (non-interactive; default: <provider>:manual)`).option(`--token-expires-in <duration>`,`Optional token expiry duration (e.g. 365d, 12h)`).option(`--secret-input-mode <mode>`,`API key persistence mode: plaintext|ref (default: plaintext)`).option(`--cloudflare-ai-gateway-account-id <id>`,`Cloudflare Account ID`).option(`--cloudflare-ai-gateway-gateway-id <id>`,`Cloudflare AI Gateway ID`);for(let e of i)l.option(e.cliOption,e.description);l.option(`--custom-base-url <url>`,`Custom provider base URL`).option(`--custom-api-key <key>`,`Custom provider API key (optional)`).option(`--custom-model-id <id>`,`Custom provider model ID`).option(`--custom-provider-id <id>`,`Custom provider ID (optional; auto-derived by default)`).option(`--custom-compatibility <mode>`,`Custom provider API compatibility: openai|anthropic (default: openai)`).option(`--gateway-port <port>`,`Gateway port`).option(`--gateway-bind <mode>`,`Gateway bind: loopback|tailnet|lan|auto|custom`).option(`--gateway-auth <mode>`,`Gateway auth: token|password`).option(`--gateway-token <token>`,`Gateway token (token auth)`).option(`--gateway-token-ref-env <name>`,`Gateway token SecretRef env var name (token auth; e.g. OPENCLAW_GATEWAY_TOKEN)`).option(`--gateway-password <password>`,`Gateway password (password auth)`).option(`--remote-url <url>`,`Remote Gateway WebSocket URL`).option(`--remote-token <token>`,`Remote Gateway token (optional)`).option(`--tailscale <mode>`,`Tailscale: off|serve|funnel`).option(`--tailscale-reset-on-exit`,`Reset tailscale serve/funnel on exit`).option(`--install-daemon`,`Install gateway service`).option(`--no-install-daemon`,`Skip gateway service install`).option(`--skip-daemon`,`Skip gateway service install`).option(`--daemon-runtime <runtime>`,`Daemon runtime: node|bun`).option(`--skip-channels`,`Skip channel setup`).option(`--skip-skills`,`Skip skills setup`).option(`--skip-search`,`Skip search provider setup`).option(`--skip-health`,`Skip health check`).option(`--skip-ui`,`Skip Control UI/TUI prompts`).option(`--node-manager <name>`,`Node manager for skills: npm|pnpm|bun`).option(`--json`,`Output JSON summary`,!1),l.action(async(e,n)=>{await r(t,async()=>{let r=s(n,{installDaemon:!!e.installDaemon}),i=typeof e.gatewayPort==`string`?Number.parseInt(e.gatewayPort,10):void 0;await o({workspace:e.workspace,nonInteractive:!!e.nonInteractive,acceptRisk:!!e.acceptRisk,flow:e.flow,mode:e.mode,authChoice:e.authChoice,tokenProvider:e.tokenProvider,token:e.token,tokenProfileId:e.tokenProfileId,tokenExpiresIn:e.tokenExpiresIn,secretInputMode:e.secretInputMode,anthropicApiKey:e.anthropicApiKey,openaiApiKey:e.openaiApiKey,mistralApiKey:e.mistralApiKey,openrouterApiKey:e.openrouterApiKey,kilocodeApiKey:e.kilocodeApiKey,aiGatewayApiKey:e.aiGatewayApiKey,cloudflareAiGatewayAccountId:e.cloudflareAiGatewayAccountId,cloudflareAiGatewayGatewayId:e.cloudflareAiGatewayGatewayId,cloudflareAiGatewayApiKey:e.cloudflareAiGatewayApiKey,moonshotApiKey:e.moonshotApiKey,kimiCodeApiKey:e.kimiCodeApiKey,geminiApiKey:e.geminiApiKey,zaiApiKey:e.zaiApiKey,xiaomiApiKey:e.xiaomiApiKey,qianfanApiKey:e.qianfanApiKey,modelstudioApiKeyCn:e.modelstudioApiKeyCn,modelstudioApiKey:e.modelstudioApiKey,minimaxApiKey:e.minimaxApiKey,syntheticApiKey:e.syntheticApiKey,veniceApiKey:e.veniceApiKey,togetherApiKey:e.togetherApiKey,huggingfaceApiKey:e.huggingfaceApiKey,opencodeZenApiKey:e.opencodeZenApiKey,opencodeGoApiKey:e.opencodeGoApiKey,xaiApiKey:e.xaiApiKey,litellmApiKey:e.litellmApiKey,volcengineApiKey:e.volcengineApiKey,byteplusApiKey:e.byteplusApiKey,customBaseUrl:e.customBaseUrl,customApiKey:e.customApiKey,customModelId:e.customModelId,customProviderId:e.customProviderId,customCompatibility:e.customCompatibility,gatewayPort:typeof i==`number`&&Number.isFinite(i)?i:void 0,gatewayBind:e.gatewayBind,gatewayAuth:e.gatewayAuth,gatewayToken:e.gatewayToken,gatewayTokenRefEnv:e.gatewayTokenRefEnv,gatewayPassword:e.gatewayPassword,remoteUrl:e.remoteUrl,remoteToken:e.remoteToken,tailscale:e.tailscale,tailscaleResetOnExit:!!e.tailscaleResetOnExit,reset:!!e.reset,resetScope:e.resetScope,installDaemon:r,daemonRuntime:e.daemonRuntime,skipChannels:!!e.skipChannels,skipSkills:!!e.skipSkills,skipSearch:!!e.skipSearch,skipHealth:!!e.skipHealth,skipUi:!!e.skipUi,nodeManager:e.nodeManager,json:!!e.json},t)})})}export{l as registerOnboardCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,p as t}from"./subsystem-C7tbdlOl.js";import"./paths-BRJCySMM.js";import"./boolean-D15s2V33.js";import{Eo as n,Ro as r}from"./auth-profiles-BkhVHtgY.js";import{D as i,v as a}from"./agent-scope-DjUQMckI.js";import{x as o}from"./utils-bGrn0y-f.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-ByNUYL2n.js";import"./env-overrides-fatFjayp.js";import"./version-q3SkUw2K.js";import"./registry-Bfa_Ykoc.js";import"./skills-DaxiAYb1.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CAHuRRVU.js";import"./logger-CzE2MhuY.js";import"./exec-CEAb_WUd.js";import"./windows-spawn-BgzBBwXL.js";import"./redact-Dhbd2Ou5.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DrzTb7KS.js";import{o as s}from"./paths-Iw1AJLOG.js";import"./chat-envelope-Bznn2SoS.js";import"./call-B4oR7TXC.js";import"./onboard-helpers-bAJ8ELmK.js";import"./prompt-style-LoGJ9Sd_.js";import{t as c}from"./links-DRsshHiS.js";import{n as l}from"./cli-utils-C_maQ2m4.js";import"./progress-CR--5qDW.js";import{t as u}from"./command-options-BpOUDl2S.js";import"./note-DwFvlGbe.js";import"./clack-prompter-BMrD-gme.js";import"./runtime-guard-Cpuk3V_0.js";import"./onboarding.secret-input-DvJPvwAu.js";import"./onboarding-
|
|
1
|
+
import{A as e,p as t}from"./subsystem-C7tbdlOl.js";import"./paths-BRJCySMM.js";import"./boolean-D15s2V33.js";import{Eo as n,Ro as r}from"./auth-profiles-BkhVHtgY.js";import{D as i,v as a}from"./agent-scope-DjUQMckI.js";import{x as o}from"./utils-bGrn0y-f.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-ByNUYL2n.js";import"./env-overrides-fatFjayp.js";import"./version-q3SkUw2K.js";import"./registry-Bfa_Ykoc.js";import"./skills-DaxiAYb1.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CAHuRRVU.js";import"./logger-CzE2MhuY.js";import"./exec-CEAb_WUd.js";import"./windows-spawn-BgzBBwXL.js";import"./redact-Dhbd2Ou5.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DrzTb7KS.js";import{o as s}from"./paths-Iw1AJLOG.js";import"./chat-envelope-Bznn2SoS.js";import"./call-B4oR7TXC.js";import"./onboard-helpers-bAJ8ELmK.js";import"./prompt-style-LoGJ9Sd_.js";import{t as c}from"./links-DRsshHiS.js";import{n as l}from"./cli-utils-C_maQ2m4.js";import"./progress-CR--5qDW.js";import{t as u}from"./command-options-BpOUDl2S.js";import"./note-DwFvlGbe.js";import"./clack-prompter-BMrD-gme.js";import"./runtime-guard-Cpuk3V_0.js";import"./onboarding.secret-input-DvJPvwAu.js";import"./onboarding-CgqsAteJ.js";import{n as d,t as f}from"./logging-B7juU2TI.js";import{t as p}from"./onboard-D9IefEER.js";import m from"json5";import h from"node:fs/promises";async function g(e){try{let t=await h.readFile(e,`utf-8`),n=m.parse(t);return n&&typeof n==`object`?{exists:!0,parsed:n}:{exists:!0,parsed:{}}}catch{return{exists:!1,parsed:{}}}}async function _(e,c=t){let l=typeof e?.workspace==`string`&&e.workspace.trim()?e.workspace.trim():void 0,u=n().configPath,p=await g(u),m=p.parsed,_=m.agents?.defaults??{},v=l??_.workspace??a,y={...m,agents:{...m.agents,defaults:{..._,workspace:v}},gateway:{...m.gateway,mode:m.gateway?.mode??`local`}};if(!p.exists||_.workspace!==v||m.gateway?.mode!==y.gateway?.mode)if(await r(y),!p.exists)c.log(`Wrote ${f(u)}`);else{let e=[];_.workspace!==v&&e.push(`set agents.defaults.workspace`),m.gateway?.mode!==y.gateway?.mode&&e.push(`set gateway.mode`),d(c,{path:u,suffix:e.length>0?`(${e.join(`, `)})`:void 0})}else c.log(`Config OK: ${f(u)}`);let b=await i({dir:v,ensureBootstrapFiles:!y.agents?.defaults?.skipBootstrap});c.log(`Workspace OK: ${o(b.dir)}`);let x=s();await h.mkdir(x,{recursive:!0}),c.log(`Sessions OK: ${o(x)}`)}function v(n){n.command(`setup`).description(`Initialize ~/.openclaw-qbot/openclaw.json and the agent workspace`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${c(`/cli/setup`,`docs.openclaw.ai/cli/setup`)}\n`).option(`--workspace <dir>`,`Agent workspace directory (default: ~/.openclaw-qbot/workspace; stored as agents.defaults.workspace)`).option(`--wizard`,`Run the interactive onboarding wizard`,!1).option(`--non-interactive`,`Run the wizard without prompts`,!1).option(`--mode <mode>`,`Wizard mode: local|remote`).option(`--remote-url <url>`,`Remote Gateway WebSocket URL`).option(`--remote-token <token>`,`Remote Gateway token (optional)`).action(async(e,n)=>{await l(t,async()=>{let r=u(n,[`wizard`,`nonInteractive`,`mode`,`remoteUrl`,`remoteToken`]);if(e.wizard||r){await p({workspace:e.workspace,nonInteractive:!!e.nonInteractive,mode:e.mode,remoteUrl:e.remoteUrl,remoteToken:e.remoteToken},t);return}await _({workspace:e.workspace},t)})})}export{v as registerSetupCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./paths-DfDmyG-r.js";import{A as e,p as t}from"./subsystem-B35lZH6M.js";import{S as n}from"./utils-eSzw3-BW.js";import{Hs as r,ec as i}from"./model-selection-D_WMcs-m.js";import{D as a,v as o}from"./agent-scope-DauKPN2a.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-HBWzEstG.js";import"./boolean-Ch3DfXPy.js";import"./env-DEV6pFi3.js";import"./env-overrides-CYDvuetI.js";import"./registry-DwigmP92.js";import"./skills-sxAZFqk6.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CPVBLi22.js";import"./logger-DMM_uqZu.js";import"./exec-Ble6PWIi.js";import"./windows-spawn-ylt31bST.js";import"./redact-DtCbW9Lh.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-alPucxwR.js";import{o as s}from"./paths-wWzafjVT.js";import"./chat-envelope-HVpKusFc.js";import"./call-bAaUSED1.js";import"./onboard-helpers-Dn0KiH64.js";import"./prompt-style-Ct-2QSEG.js";import{t as c}from"./links-CmkiG3i0.js";import{n as l}from"./cli-utils-Cfu5AugP.js";import"./progress-CDXE9V22.js";import"./runtime-guard-CKqXF6-d.js";import{t as u}from"./command-options-Bq5nQxz6.js";import"./note-CxxIxPA5.js";import"./clack-prompter-BTYj-mu-.js";import"./onboarding.secret-input-De2KkiI6.js";import"./onboarding-
|
|
1
|
+
import"./paths-DfDmyG-r.js";import{A as e,p as t}from"./subsystem-B35lZH6M.js";import{S as n}from"./utils-eSzw3-BW.js";import{Hs as r,ec as i}from"./model-selection-D_WMcs-m.js";import{D as a,v as o}from"./agent-scope-DauKPN2a.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-HBWzEstG.js";import"./boolean-Ch3DfXPy.js";import"./env-DEV6pFi3.js";import"./env-overrides-CYDvuetI.js";import"./registry-DwigmP92.js";import"./skills-sxAZFqk6.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CPVBLi22.js";import"./logger-DMM_uqZu.js";import"./exec-Ble6PWIi.js";import"./windows-spawn-ylt31bST.js";import"./redact-DtCbW9Lh.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-alPucxwR.js";import{o as s}from"./paths-wWzafjVT.js";import"./chat-envelope-HVpKusFc.js";import"./call-bAaUSED1.js";import"./onboard-helpers-Dn0KiH64.js";import"./prompt-style-Ct-2QSEG.js";import{t as c}from"./links-CmkiG3i0.js";import{n as l}from"./cli-utils-Cfu5AugP.js";import"./progress-CDXE9V22.js";import"./runtime-guard-CKqXF6-d.js";import{t as u}from"./command-options-Bq5nQxz6.js";import"./note-CxxIxPA5.js";import"./clack-prompter-BTYj-mu-.js";import"./onboarding.secret-input-De2KkiI6.js";import"./onboarding-CddGtlY5.js";import{n as d,t as f}from"./logging-KnZSytkB.js";import{t as p}from"./onboard-qMIhLeRM.js";import m from"json5";import h from"node:fs/promises";async function g(e){try{let t=await h.readFile(e,`utf-8`),n=m.parse(t);return n&&typeof n==`object`?{exists:!0,parsed:n}:{exists:!0,parsed:{}}}catch{return{exists:!1,parsed:{}}}}async function _(e,c=t){let l=typeof e?.workspace==`string`&&e.workspace.trim()?e.workspace.trim():void 0,u=r().configPath,p=await g(u),m=p.parsed,_=m.agents?.defaults??{},v=l??_.workspace??o,y={...m,agents:{...m.agents,defaults:{..._,workspace:v}},gateway:{...m.gateway,mode:m.gateway?.mode??`local`}};if(!p.exists||_.workspace!==v||m.gateway?.mode!==y.gateway?.mode)if(await i(y),!p.exists)c.log(`Wrote ${f(u)}`);else{let e=[];_.workspace!==v&&e.push(`set agents.defaults.workspace`),m.gateway?.mode!==y.gateway?.mode&&e.push(`set gateway.mode`),d(c,{path:u,suffix:e.length>0?`(${e.join(`, `)})`:void 0})}else c.log(`Config OK: ${f(u)}`);let b=await a({dir:v,ensureBootstrapFiles:!y.agents?.defaults?.skipBootstrap});c.log(`Workspace OK: ${n(b.dir)}`);let x=s();await h.mkdir(x,{recursive:!0}),c.log(`Sessions OK: ${n(x)}`)}function v(n){n.command(`setup`).description(`Initialize ~/.openclaw-qbot/openclaw.json and the agent workspace`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${c(`/cli/setup`,`docs.openclaw.ai/cli/setup`)}\n`).option(`--workspace <dir>`,`Agent workspace directory (default: ~/.openclaw-qbot/workspace; stored as agents.defaults.workspace)`).option(`--wizard`,`Run the interactive onboarding wizard`,!1).option(`--non-interactive`,`Run the wizard without prompts`,!1).option(`--mode <mode>`,`Wizard mode: local|remote`).option(`--remote-url <url>`,`Remote Gateway WebSocket URL`).option(`--remote-token <token>`,`Remote Gateway token (optional)`).action(async(e,n)=>{await l(t,async()=>{let r=u(n,[`wizard`,`nonInteractive`,`mode`,`remoteUrl`,`remoteToken`]);if(e.wizard||r){await p({workspace:e.workspace,nonInteractive:!!e.nonInteractive,mode:e.mode,remoteUrl:e.remoteUrl,remoteToken:e.remoteToken},t);return}await _({workspace:e.workspace},t)})})}export{v as registerSetupCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,k as t,p as n,w as r}from"./subsystem-C7tbdlOl.js";import"./paths-BRJCySMM.js";import"./boolean-D15s2V33.js";import{Bt as i,Ft as a,Lt as o,Rt as s,ko as c,kt as l,zt as u}from"./auth-profiles-BkhVHtgY.js";import"./agent-scope-DjUQMckI.js";import"./utils-bGrn0y-f.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-ByNUYL2n.js";import"./env-overrides-fatFjayp.js";import"./version-q3SkUw2K.js";import"./registry-Bfa_Ykoc.js";import"./skills-DaxiAYb1.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CAHuRRVU.js";import"./logger-CzE2MhuY.js";import"./exec-CEAb_WUd.js";import"./windows-spawn-BgzBBwXL.js";import"./redact-Dhbd2Ou5.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DrzTb7KS.js";import"./send-CkCusmbI.js";import"./send-BlGs1R4s.js";import"./compact-BfHim3cA.js";import{n as d,r as f}from"./paths-Iw1AJLOG.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-JhtjMTo0.js";import"./tokens-DymrUOGE.js";import"./with-timeout-c1CzdShT.js";import"./deliver-BN5gbKUv.js";import"./diagnostic-ou4gNcG4.js";import"./send-CfpqUapa.js";import"./pi-model-discovery-Cqrh3PhQ.js";import"./exec-approvals-allowlist-DIBvoVsb.js";import"./exec-safe-bin-runtime-policy-y_ErZVFQ.js";import"./model-catalog--OA2KRxM.js";import"./fetch-Br9U2aWg.js";import"./audio-transcription-runner-hG3NgjtU.js";import"./fetch-guard-DOIM5NkG.js";import"./image-B6Fxt2ke.js";import"./tool-display-D4Lgnaij.js";import"./api-key-rotation-DIZSxMN4.js";import"./proxy-fetch-CCr-fxQ0.js";import"./ir-C205jOes.js";import"./render-DrrPmnMI.js";import"./target-errors-Befv_gd6.js";import"./commands-DcqfHXoH.js";import"./commands-registry-D2F_aNf1.js";import"./session-cost-usage-B0e3Qwrd.js";import"./session-utils-DtXFoDhI.js";import"./sqlite-C-YpDuDl.js";import"./call-B4oR7TXC.js";import"./pi-tools.policy-3jwvBbGG.js";import"./fetch-D6B2WSW_.js";import"./pairing-store-BXGybj6M.js";import"./exec-approvals-Dapj8H1y.js";import"./nodes-screen-DX6jz8OP.js";import"./restart-C27sljk1.js";import"./system-run-command-D6cuoREz.js";import"./skill-commands-FzYyVr7Q.js";import"./workspace-dirs-BTT7_AQX.js";import"./pairing-token-ByzqGayx.js";import"./channel-activity-W1yPxWJ3.js";import"./tables-Df7TI1wy.js";import"./runtime-web-tools-CzHbhY0M.js";import"./runtime-CHjN1UTv.js";import"./stagger-BDJo4a4e.js";import"./channel-selection-mEfryJZM.js";import"./plugin-auto-enable-Czb-XnGx.js";import"./send-CeULjLp_.js";import"./outbound-attachment-CxQjEgw4.js";import"./delivery-queue-C3NiY2Ub.js";import"./send-CLQzNoUy.js";import"./fetch-yQOUtDBh.js";import"./command-secret-targets-BzThfkzp.js";import"./connection-auth-C0uJgiku.js";import"./onboard-helpers-bAJ8ELmK.js";import"./prompt-style-LoGJ9Sd_.js";import"./pairing-labels-DdIEj5Sz.js";import"./search-manager-B35sLSi1.js";import"./manager-hztaxN5m.js";import"./memory-cli-Bp_xpCbr.js";import{t as p}from"./links-DRsshHiS.js";import{n as m}from"./cli-utils-C_maQ2m4.js";import{t as h}from"./help-format-BlhzdN7j.js";import"./progress-CR--5qDW.js";import"./skills-status-BMD3tUOS.js";import"./dangerous-tools-CFRYQJ6V.js";import"./skill-scanner-Dnbtf-do.js";import"./issue-format-CH9G9Aj1.js";import"./channels-status-issues-N5UAZzhw.js";import{n as g}from"./helpers-COz1ghcB.js";import"./systemd-NA-h6HLZ.js";import"./service-BmVXm2bV.js";import"./probe-auth-Dg7KGT-W.js";import"./diagnostics-D9kDOJwd.js";import"./table-D3aNZFy4.js";import{n as _}from"./status-QCEyD_DK.js";import{r as v}from"./health-CiTej6rM.js";import"./channel-account-context-CaJykRl9.js";import"./node-command-policy-DyuMc1wv.js";import"./audit-FH3EU9NK.js";import"./node-service-DOO9thfm.js";import"./status.update-C8lR8uWy.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,sessionsCommand as E,t as D}from"./sessions-CtE6ue9O.js";import O from"node:fs";function k(e){return e.missingKeys.has(e.key)?`prune-missing`:e.staleKeys.has(e.key)?`prune-stale`:e.cappedKeys.has(e.key)?`cap-overflow`:e.budgetEvictedKeys.has(e.key)?`evict-budget`:`keep`}function A(t,n){let r=t.padEnd(12);return n?t===`keep`?e.muted(r):t===`prune-missing`?e.error(r):t===`prune-stale`?e.warn(r):t===`cap-overflow`?e.accentBright(r):e.error(r):r}function j(e){return T(e.beforeStore).map(t=>({...t,action:k({key:t.key,missingKeys:e.missingKeys,staleKeys:e.staleKeys,cappedKeys:e.cappedKeys,budgetEvictedKeys:e.budgetEvictedKeys})}))}function M(e){let t=f({storePath:e.storePath}),n=0;for(let[r,i]of Object.entries(e.store)){if(!i?.sessionId)continue;let a=d(i.sessionId,i,t);O.existsSync(a)||(delete e.store[r],n+=1,e.onPruned?.(r))}return n}async function N(e){let t=u(),n=l(e.target.storePath,{skipCache:!0}),r=structuredClone(n),a=new Set,c=new Set,d=new Set,f=e.fixMissing===!0?M({store:r,storePath:e.target.storePath,onPruned:e=>{d.add(e)}}):0,p=s(r,t.pruneAfterMs,{log:!1,onPruned:({key:e})=>{a.add(e)}}),m=o(r,t.maxEntries,{log:!1,onCapped:({key:e})=>{c.add(e)}}),h=structuredClone(r),g=await i({store:r,storePath:e.target.storePath,activeSessionKey:e.activeKey,maintenance:t,warnOnly:!1,dryRun:!0}),_=new Set;for(let e of Object.keys(h))Object.hasOwn(r,e)||_.add(e);let v=Object.keys(n).length,y=Object.keys(r).length,b=f>0||p>0||m>0||(g?.removedEntries??0)>0||(g?.removedFiles??0)>0;return{summary:{agentId:e.target.agentId,storePath:e.target.storePath,mode:e.mode,dryRun:e.dryRun,beforeCount:v,afterCount:y,missing:f,pruned:p,capped:m,diskBudget:g,wouldMutate:b},actionRows:j({beforeStore:n,staleKeys:a,cappedKeys:c,budgetEvictedKeys:_,missingKeys:d})}}function P(n){let r=t();if(n.showAgentHeader&&n.runtime.log(`Agent: ${n.summary.agentId}`),n.runtime.log(`Session store: ${n.summary.storePath}`),n.runtime.log(`Maintenance mode: ${n.summary.mode}`),n.runtime.log(`Entries: ${n.summary.beforeCount} -> ${n.summary.afterCount} (remove ${n.summary.beforeCount-n.summary.afterCount})`),n.runtime.log(`Would prune missing transcripts: ${n.summary.missing}`),n.runtime.log(`Would prune stale: ${n.summary.pruned}`),n.runtime.log(`Would cap overflow: ${n.summary.capped}`),n.summary.diskBudget&&n.runtime.log(`Would enforce disk budget: ${n.summary.diskBudget.totalBytesBefore} -> ${n.summary.diskBudget.totalBytesAfter} bytes (files ${n.summary.diskBudget.removedFiles}, entries ${n.summary.diskBudget.removedEntries})`),n.actionRows.length===0)return;n.runtime.log(``),n.runtime.log(`Planned session actions:`);let i=[`Action`.padEnd(12),`Key`.padEnd(26),`Age`.padEnd(9),`Model`.padEnd(14),`Flags`].join(` `);n.runtime.log(r?e.heading(i):i);for(let e of n.actionRows){let t=C(n.cfg,e,n.displayDefaults),i=[A(e.action,r),w(e.key,r),D(e.updatedAt,r),x(t,r),S(e,r)].join(` `);n.runtime.log(i.trimEnd())}}async function F(e,t){let n=c(),r=y(n),i=e.enforce?`enforce`:u().mode,o=b({cfg:n,opts:{store:e.store,agent:e.agent,allAgents:e.allAgents},runtime:t});if(!o)return;let s=[];for(let t of o){let n=await N({target:t,mode:i,dryRun:!!e.dryRun,activeKey:e.activeKey,fixMissing:!!e.fixMissing});s.push(n)}if(e.dryRun){if(e.json){if(s.length===1){t.log(JSON.stringify(s[0]?.summary??{},null,2));return}t.log(JSON.stringify({allAgents:!0,mode:i,dryRun:!0,stores:s.map(e=>e.summary)},null,2));return}for(let e=0;e<s.length;e+=1){let i=s[e];e>0&&t.log(``),P({cfg:n,summary:i.summary,actionRows:i.actionRows,displayDefaults:r,runtime:t,showAgentHeader:s.length>1})}return}let d=[];for(let t of o){let n={current:null},r=await a(t.storePath,async n=>e.fixMissing?M({store:n,storePath:t.storePath}):0,{activeSessionKey:e.activeKey,maintenanceOverride:{mode:i},onMaintenanceApplied:e=>{n.current=e}}),o=l(t.storePath,{skipCache:!0}),c=s.find(e=>e.summary.storePath===t.storePath),u=n.current,f=u===null?{...c?.summary??{agentId:t.agentId,storePath:t.storePath,mode:i,dryRun:!1,beforeCount:0,afterCount:0,missing:0,pruned:0,capped:0,diskBudget:null,wouldMutate:!1},dryRun:!1,applied:!0,appliedCount:Object.keys(o).length}:{agentId:t.agentId,storePath:t.storePath,mode:u.mode,dryRun:!1,beforeCount:u.beforeCount,afterCount:u.afterCount,missing:r,pruned:u.pruned,capped:u.capped,diskBudget:u.diskBudget,wouldMutate:r>0||u.pruned>0||u.capped>0||(u.diskBudget?.removedEntries??0)>0||(u.diskBudget?.removedFiles??0)>0,applied:!0,appliedCount:Object.keys(o).length};d.push(f)}if(e.json){if(d.length===1){t.log(JSON.stringify(d[0]??{},null,2));return}t.log(JSON.stringify({allAgents:!0,mode:i,dryRun:!1,stores:d},null,2));return}for(let e=0;e<d.length;e+=1){let n=d[e];e>0&&t.log(``),d.length>1&&t.log(`Agent: ${n.agentId}`),t.log(`Session store: ${n.storePath}`),t.log(`Applied maintenance. Current entries: ${n.appliedCount??0}`)}}function I(e){return!!(e.verbose||e.debug)}function L(e){let t=g(e);return e!==void 0&&t===void 0?(n.error(`--timeout must be a positive integer (milliseconds)`),n.exit(1),null):t}async function R(e,t){let i=I(e);r(i);let a=L(e.timeout);a!==null&&await m(n,async()=>{await t({verbose:i,timeoutMs:a})})}function z(t){t.command(`status`).description(`Show channel health and recent session recipients`).option(`--json`,`Output JSON instead of text`,!1).option(`--all`,`Full diagnosis (read-only, pasteable)`,!1).option(`--usage`,`Show model provider usage/quota snapshots`,!1).option(`--deep`,`Probe channels (WhatsApp Web + Telegram + Discord + Slack + Signal)`,!1).option(`--timeout <ms>`,`Probe timeout in milliseconds`,`10000`).option(`--verbose`,`Verbose logging`,!1).option(`--debug`,`Alias for --verbose`,!1).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${h([[`openclaw status`,`Show channel health + session summary.`],[`openclaw status --all`,`Full diagnosis (read-only).`],[`openclaw status --json`,`Machine-readable output.`],[`openclaw status --usage`,`Show model provider usage/quota snapshots.`],[`openclaw status --deep`,`Run channel probes (WA + Telegram + Discord + Slack + Signal).`],[`openclaw status --deep --timeout 5000`,`Tighten probe timeout.`]])}`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${p(`/cli/status`,`docs.openclaw.ai/cli/status`)}\n`).action(async e=>{await R(e,async({verbose:t,timeoutMs:r})=>{await _({json:!!e.json,all:!!e.all,deep:!!e.deep,usage:!!e.usage,timeoutMs:r,verbose:t},n)})}),t.command(`health`).description(`Fetch health from the running gateway`).option(`--json`,`Output JSON instead of text`,!1).option(`--timeout <ms>`,`Connection timeout in milliseconds`,`10000`).option(`--verbose`,`Verbose logging`,!1).option(`--debug`,`Alias for --verbose`,!1).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${p(`/cli/health`,`docs.openclaw.ai/cli/health`)}\n`).action(async e=>{await R(e,async({verbose:t,timeoutMs:r})=>{await v({json:!!e.json,timeoutMs:r,verbose:t},n)})});let i=t.command(`sessions`).description(`List stored conversation sessions`).option(`--json`,`Output as JSON`,!1).option(`--verbose`,`Verbose logging`,!1).option(`--store <path>`,`Path to session store (default: resolved from config)`).option(`--agent <id>`,`Agent id to inspect (default: configured default agent)`).option(`--all-agents`,`Aggregate sessions across all configured agents`,!1).option(`--active <minutes>`,`Only show sessions updated within the past N minutes`).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${h([[`openclaw sessions`,`List all sessions.`],[`openclaw sessions --agent work`,`List sessions for one agent.`],[`openclaw sessions --all-agents`,`Aggregate sessions across agents.`],[`openclaw sessions --active 120`,`Only last 2 hours.`],[`openclaw sessions --json`,`Machine-readable output.`],[`openclaw sessions --store ./tmp/sessions.json`,`Use a specific session store.`]])}\n\n${e.muted(`Shows token usage per session when the agent reports it; set agents.defaults.contextTokens to cap the window and show %.`)}`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${p(`/cli/sessions`,`docs.openclaw.ai/cli/sessions`)}\n`).action(async e=>{r(!!e.verbose),await E({json:!!e.json,store:e.store,agent:e.agent,allAgents:!!e.allAgents,active:e.active},n)});i.enablePositionalOptions(),i.command(`cleanup`).description(`Run session-store maintenance now`).option(`--store <path>`,`Path to session store (default: resolved from config)`).option(`--agent <id>`,`Agent id to maintain (default: configured default agent)`).option(`--all-agents`,`Run maintenance across all configured agents`,!1).option(`--dry-run`,`Preview maintenance actions without writing`,!1).option(`--enforce`,`Apply maintenance even when configured mode is warn`,!1).option(`--fix-missing`,`Remove store entries whose transcript files are missing (bypasses age/count retention)`,!1).option(`--active-key <key>`,`Protect this session key from budget-eviction`).option(`--json`,`Output JSON`,!1).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${h([[`openclaw sessions cleanup --dry-run`,`Preview stale/cap cleanup.`],[`openclaw sessions cleanup --dry-run --fix-missing`,`Also preview pruning entries with missing transcript files.`],[`openclaw sessions cleanup --enforce`,`Apply maintenance now.`],[`openclaw sessions cleanup --agent work --dry-run`,`Preview one agent store.`],[`openclaw sessions cleanup --all-agents --dry-run`,`Preview all agent stores.`],[`openclaw sessions cleanup --enforce --store ./tmp/sessions.json`,`Use a specific store.`]])}`).action(async(e,t)=>{let r=t.parent?.opts();await m(n,async()=>{await F({store:e.store??r?.store,agent:e.agent??r?.agent,allAgents:!!(e.allAgents||r?.allAgents),dryRun:!!e.dryRun,enforce:!!e.enforce,fixMissing:!!e.fixMissing,activeKey:e.activeKey,json:!!(e.json||r?.json)},n)})})}export{z as registerStatusHealthSessionsCommands};
|
|
1
|
+
import{A as e,k as t,p as n,w as r}from"./subsystem-C7tbdlOl.js";import"./paths-BRJCySMM.js";import"./boolean-D15s2V33.js";import{Bt as i,Ft as a,Lt as o,Rt as s,ko as c,kt as l,zt as u}from"./auth-profiles-BkhVHtgY.js";import"./agent-scope-DjUQMckI.js";import"./utils-bGrn0y-f.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-ByNUYL2n.js";import"./env-overrides-fatFjayp.js";import"./version-q3SkUw2K.js";import"./registry-Bfa_Ykoc.js";import"./skills-DaxiAYb1.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CAHuRRVU.js";import"./logger-CzE2MhuY.js";import"./exec-CEAb_WUd.js";import"./windows-spawn-BgzBBwXL.js";import"./redact-Dhbd2Ou5.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DrzTb7KS.js";import"./send-CkCusmbI.js";import"./send-BlGs1R4s.js";import"./compact-DgbuvsDF.js";import{n as d,r as f}from"./paths-Iw1AJLOG.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-JhtjMTo0.js";import"./tokens-DymrUOGE.js";import"./with-timeout-c1CzdShT.js";import"./deliver-BN5gbKUv.js";import"./diagnostic-ou4gNcG4.js";import"./send-CfpqUapa.js";import"./pi-model-discovery-Cqrh3PhQ.js";import"./exec-approvals-allowlist-DIBvoVsb.js";import"./exec-safe-bin-runtime-policy-y_ErZVFQ.js";import"./model-catalog--OA2KRxM.js";import"./fetch-Br9U2aWg.js";import"./audio-transcription-runner-hG3NgjtU.js";import"./fetch-guard-DOIM5NkG.js";import"./image-B6Fxt2ke.js";import"./tool-display-D4Lgnaij.js";import"./api-key-rotation-DIZSxMN4.js";import"./proxy-fetch-CCr-fxQ0.js";import"./ir-C205jOes.js";import"./render-DrrPmnMI.js";import"./target-errors-Befv_gd6.js";import"./commands-DcqfHXoH.js";import"./commands-registry-D2F_aNf1.js";import"./session-cost-usage-B0e3Qwrd.js";import"./session-utils-DtXFoDhI.js";import"./sqlite-C-YpDuDl.js";import"./call-B4oR7TXC.js";import"./pi-tools.policy-3jwvBbGG.js";import"./fetch-D6B2WSW_.js";import"./pairing-store-BXGybj6M.js";import"./exec-approvals-Dapj8H1y.js";import"./nodes-screen-DX6jz8OP.js";import"./restart-C27sljk1.js";import"./system-run-command-D6cuoREz.js";import"./skill-commands-FzYyVr7Q.js";import"./workspace-dirs-BTT7_AQX.js";import"./pairing-token-ByzqGayx.js";import"./channel-activity-W1yPxWJ3.js";import"./tables-Df7TI1wy.js";import"./runtime-web-tools-CzHbhY0M.js";import"./runtime-CHjN1UTv.js";import"./stagger-BDJo4a4e.js";import"./channel-selection-mEfryJZM.js";import"./plugin-auto-enable-Czb-XnGx.js";import"./send-CeULjLp_.js";import"./outbound-attachment-CxQjEgw4.js";import"./delivery-queue-C3NiY2Ub.js";import"./send-CLQzNoUy.js";import"./fetch-yQOUtDBh.js";import"./command-secret-targets-BzThfkzp.js";import"./connection-auth-C0uJgiku.js";import"./onboard-helpers-bAJ8ELmK.js";import"./prompt-style-LoGJ9Sd_.js";import"./pairing-labels-DdIEj5Sz.js";import"./search-manager-B35sLSi1.js";import"./manager-hztaxN5m.js";import"./memory-cli-Bp_xpCbr.js";import{t as p}from"./links-DRsshHiS.js";import{n as m}from"./cli-utils-C_maQ2m4.js";import{t as h}from"./help-format-BlhzdN7j.js";import"./progress-CR--5qDW.js";import"./skills-status-BMD3tUOS.js";import"./dangerous-tools-CFRYQJ6V.js";import"./skill-scanner-Dnbtf-do.js";import"./issue-format-CH9G9Aj1.js";import"./channels-status-issues-N5UAZzhw.js";import{n as g}from"./helpers-COz1ghcB.js";import"./systemd-NA-h6HLZ.js";import"./service-BmVXm2bV.js";import"./probe-auth-Dg7KGT-W.js";import"./diagnostics-D9kDOJwd.js";import"./table-D3aNZFy4.js";import{n as _}from"./status-XJoKJIPd.js";import{r as v}from"./health-BXDoFh4Q.js";import"./channel-account-context-CaJykRl9.js";import"./node-command-policy-DyuMc1wv.js";import"./audit-FH3EU9NK.js";import"./node-service-DOO9thfm.js";import"./status.update-C8lR8uWy.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,sessionsCommand as E,t as D}from"./sessions-CtE6ue9O.js";import O from"node:fs";function k(e){return e.missingKeys.has(e.key)?`prune-missing`:e.staleKeys.has(e.key)?`prune-stale`:e.cappedKeys.has(e.key)?`cap-overflow`:e.budgetEvictedKeys.has(e.key)?`evict-budget`:`keep`}function A(t,n){let r=t.padEnd(12);return n?t===`keep`?e.muted(r):t===`prune-missing`?e.error(r):t===`prune-stale`?e.warn(r):t===`cap-overflow`?e.accentBright(r):e.error(r):r}function j(e){return T(e.beforeStore).map(t=>({...t,action:k({key:t.key,missingKeys:e.missingKeys,staleKeys:e.staleKeys,cappedKeys:e.cappedKeys,budgetEvictedKeys:e.budgetEvictedKeys})}))}function M(e){let t=f({storePath:e.storePath}),n=0;for(let[r,i]of Object.entries(e.store)){if(!i?.sessionId)continue;let a=d(i.sessionId,i,t);O.existsSync(a)||(delete e.store[r],n+=1,e.onPruned?.(r))}return n}async function N(e){let t=u(),n=l(e.target.storePath,{skipCache:!0}),r=structuredClone(n),a=new Set,c=new Set,d=new Set,f=e.fixMissing===!0?M({store:r,storePath:e.target.storePath,onPruned:e=>{d.add(e)}}):0,p=s(r,t.pruneAfterMs,{log:!1,onPruned:({key:e})=>{a.add(e)}}),m=o(r,t.maxEntries,{log:!1,onCapped:({key:e})=>{c.add(e)}}),h=structuredClone(r),g=await i({store:r,storePath:e.target.storePath,activeSessionKey:e.activeKey,maintenance:t,warnOnly:!1,dryRun:!0}),_=new Set;for(let e of Object.keys(h))Object.hasOwn(r,e)||_.add(e);let v=Object.keys(n).length,y=Object.keys(r).length,b=f>0||p>0||m>0||(g?.removedEntries??0)>0||(g?.removedFiles??0)>0;return{summary:{agentId:e.target.agentId,storePath:e.target.storePath,mode:e.mode,dryRun:e.dryRun,beforeCount:v,afterCount:y,missing:f,pruned:p,capped:m,diskBudget:g,wouldMutate:b},actionRows:j({beforeStore:n,staleKeys:a,cappedKeys:c,budgetEvictedKeys:_,missingKeys:d})}}function P(n){let r=t();if(n.showAgentHeader&&n.runtime.log(`Agent: ${n.summary.agentId}`),n.runtime.log(`Session store: ${n.summary.storePath}`),n.runtime.log(`Maintenance mode: ${n.summary.mode}`),n.runtime.log(`Entries: ${n.summary.beforeCount} -> ${n.summary.afterCount} (remove ${n.summary.beforeCount-n.summary.afterCount})`),n.runtime.log(`Would prune missing transcripts: ${n.summary.missing}`),n.runtime.log(`Would prune stale: ${n.summary.pruned}`),n.runtime.log(`Would cap overflow: ${n.summary.capped}`),n.summary.diskBudget&&n.runtime.log(`Would enforce disk budget: ${n.summary.diskBudget.totalBytesBefore} -> ${n.summary.diskBudget.totalBytesAfter} bytes (files ${n.summary.diskBudget.removedFiles}, entries ${n.summary.diskBudget.removedEntries})`),n.actionRows.length===0)return;n.runtime.log(``),n.runtime.log(`Planned session actions:`);let i=[`Action`.padEnd(12),`Key`.padEnd(26),`Age`.padEnd(9),`Model`.padEnd(14),`Flags`].join(` `);n.runtime.log(r?e.heading(i):i);for(let e of n.actionRows){let t=C(n.cfg,e,n.displayDefaults),i=[A(e.action,r),w(e.key,r),D(e.updatedAt,r),x(t,r),S(e,r)].join(` `);n.runtime.log(i.trimEnd())}}async function F(e,t){let n=c(),r=y(n),i=e.enforce?`enforce`:u().mode,o=b({cfg:n,opts:{store:e.store,agent:e.agent,allAgents:e.allAgents},runtime:t});if(!o)return;let s=[];for(let t of o){let n=await N({target:t,mode:i,dryRun:!!e.dryRun,activeKey:e.activeKey,fixMissing:!!e.fixMissing});s.push(n)}if(e.dryRun){if(e.json){if(s.length===1){t.log(JSON.stringify(s[0]?.summary??{},null,2));return}t.log(JSON.stringify({allAgents:!0,mode:i,dryRun:!0,stores:s.map(e=>e.summary)},null,2));return}for(let e=0;e<s.length;e+=1){let i=s[e];e>0&&t.log(``),P({cfg:n,summary:i.summary,actionRows:i.actionRows,displayDefaults:r,runtime:t,showAgentHeader:s.length>1})}return}let d=[];for(let t of o){let n={current:null},r=await a(t.storePath,async n=>e.fixMissing?M({store:n,storePath:t.storePath}):0,{activeSessionKey:e.activeKey,maintenanceOverride:{mode:i},onMaintenanceApplied:e=>{n.current=e}}),o=l(t.storePath,{skipCache:!0}),c=s.find(e=>e.summary.storePath===t.storePath),u=n.current,f=u===null?{...c?.summary??{agentId:t.agentId,storePath:t.storePath,mode:i,dryRun:!1,beforeCount:0,afterCount:0,missing:0,pruned:0,capped:0,diskBudget:null,wouldMutate:!1},dryRun:!1,applied:!0,appliedCount:Object.keys(o).length}:{agentId:t.agentId,storePath:t.storePath,mode:u.mode,dryRun:!1,beforeCount:u.beforeCount,afterCount:u.afterCount,missing:r,pruned:u.pruned,capped:u.capped,diskBudget:u.diskBudget,wouldMutate:r>0||u.pruned>0||u.capped>0||(u.diskBudget?.removedEntries??0)>0||(u.diskBudget?.removedFiles??0)>0,applied:!0,appliedCount:Object.keys(o).length};d.push(f)}if(e.json){if(d.length===1){t.log(JSON.stringify(d[0]??{},null,2));return}t.log(JSON.stringify({allAgents:!0,mode:i,dryRun:!1,stores:d},null,2));return}for(let e=0;e<d.length;e+=1){let n=d[e];e>0&&t.log(``),d.length>1&&t.log(`Agent: ${n.agentId}`),t.log(`Session store: ${n.storePath}`),t.log(`Applied maintenance. Current entries: ${n.appliedCount??0}`)}}function I(e){return!!(e.verbose||e.debug)}function L(e){let t=g(e);return e!==void 0&&t===void 0?(n.error(`--timeout must be a positive integer (milliseconds)`),n.exit(1),null):t}async function R(e,t){let i=I(e);r(i);let a=L(e.timeout);a!==null&&await m(n,async()=>{await t({verbose:i,timeoutMs:a})})}function z(t){t.command(`status`).description(`Show channel health and recent session recipients`).option(`--json`,`Output JSON instead of text`,!1).option(`--all`,`Full diagnosis (read-only, pasteable)`,!1).option(`--usage`,`Show model provider usage/quota snapshots`,!1).option(`--deep`,`Probe channels (WhatsApp Web + Telegram + Discord + Slack + Signal)`,!1).option(`--timeout <ms>`,`Probe timeout in milliseconds`,`10000`).option(`--verbose`,`Verbose logging`,!1).option(`--debug`,`Alias for --verbose`,!1).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${h([[`openclaw status`,`Show channel health + session summary.`],[`openclaw status --all`,`Full diagnosis (read-only).`],[`openclaw status --json`,`Machine-readable output.`],[`openclaw status --usage`,`Show model provider usage/quota snapshots.`],[`openclaw status --deep`,`Run channel probes (WA + Telegram + Discord + Slack + Signal).`],[`openclaw status --deep --timeout 5000`,`Tighten probe timeout.`]])}`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${p(`/cli/status`,`docs.openclaw.ai/cli/status`)}\n`).action(async e=>{await R(e,async({verbose:t,timeoutMs:r})=>{await _({json:!!e.json,all:!!e.all,deep:!!e.deep,usage:!!e.usage,timeoutMs:r,verbose:t},n)})}),t.command(`health`).description(`Fetch health from the running gateway`).option(`--json`,`Output JSON instead of text`,!1).option(`--timeout <ms>`,`Connection timeout in milliseconds`,`10000`).option(`--verbose`,`Verbose logging`,!1).option(`--debug`,`Alias for --verbose`,!1).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${p(`/cli/health`,`docs.openclaw.ai/cli/health`)}\n`).action(async e=>{await R(e,async({verbose:t,timeoutMs:r})=>{await v({json:!!e.json,timeoutMs:r,verbose:t},n)})});let i=t.command(`sessions`).description(`List stored conversation sessions`).option(`--json`,`Output as JSON`,!1).option(`--verbose`,`Verbose logging`,!1).option(`--store <path>`,`Path to session store (default: resolved from config)`).option(`--agent <id>`,`Agent id to inspect (default: configured default agent)`).option(`--all-agents`,`Aggregate sessions across all configured agents`,!1).option(`--active <minutes>`,`Only show sessions updated within the past N minutes`).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${h([[`openclaw sessions`,`List all sessions.`],[`openclaw sessions --agent work`,`List sessions for one agent.`],[`openclaw sessions --all-agents`,`Aggregate sessions across agents.`],[`openclaw sessions --active 120`,`Only last 2 hours.`],[`openclaw sessions --json`,`Machine-readable output.`],[`openclaw sessions --store ./tmp/sessions.json`,`Use a specific session store.`]])}\n\n${e.muted(`Shows token usage per session when the agent reports it; set agents.defaults.contextTokens to cap the window and show %.`)}`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${p(`/cli/sessions`,`docs.openclaw.ai/cli/sessions`)}\n`).action(async e=>{r(!!e.verbose),await E({json:!!e.json,store:e.store,agent:e.agent,allAgents:!!e.allAgents,active:e.active},n)});i.enablePositionalOptions(),i.command(`cleanup`).description(`Run session-store maintenance now`).option(`--store <path>`,`Path to session store (default: resolved from config)`).option(`--agent <id>`,`Agent id to maintain (default: configured default agent)`).option(`--all-agents`,`Run maintenance across all configured agents`,!1).option(`--dry-run`,`Preview maintenance actions without writing`,!1).option(`--enforce`,`Apply maintenance even when configured mode is warn`,!1).option(`--fix-missing`,`Remove store entries whose transcript files are missing (bypasses age/count retention)`,!1).option(`--active-key <key>`,`Protect this session key from budget-eviction`).option(`--json`,`Output JSON`,!1).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${h([[`openclaw sessions cleanup --dry-run`,`Preview stale/cap cleanup.`],[`openclaw sessions cleanup --dry-run --fix-missing`,`Also preview pruning entries with missing transcript files.`],[`openclaw sessions cleanup --enforce`,`Apply maintenance now.`],[`openclaw sessions cleanup --agent work --dry-run`,`Preview one agent store.`],[`openclaw sessions cleanup --all-agents --dry-run`,`Preview all agent stores.`],[`openclaw sessions cleanup --enforce --store ./tmp/sessions.json`,`Use a specific store.`]])}`).action(async(e,t)=>{let r=t.parent?.opts();await m(n,async()=>{await F({store:e.store??r?.store,agent:e.agent??r?.agent,allAgents:!!(e.allAgents||r?.allAgents),dryRun:!!e.dryRun,enforce:!!e.enforce,fixMissing:!!e.fixMissing,activeKey:e.activeKey,json:!!(e.json||r?.json)},n)})})}export{z as registerStatusHealthSessionsCommands};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./paths-DfDmyG-r.js";import{A as e,k as t,p as n,w as r,y as i}from"./subsystem-B35lZH6M.js";import"./utils-eSzw3-BW.js";import{Bn as a,Gs as o,Jn as s,Kn as c,Nr as l,Xn as u,Yn as d,Zn as f,h as p}from"./model-selection-D_WMcs-m.js";import{cn as m,tn as h,un as g}from"./reply-Bv0w_dst.js";import{f as _,r as v}from"./agent-scope-DauKPN2a.js";import{E as y,c as b}from"./session-key-D3P0tf5P.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-HBWzEstG.js";import"./boolean-Ch3DfXPy.js";import"./env-DEV6pFi3.js";import"./env-overrides-CYDvuetI.js";import"./registry-DwigmP92.js";import"./skills-sxAZFqk6.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CPVBLi22.js";import"./logger-DMM_uqZu.js";import"./exec-Ble6PWIi.js";import"./windows-spawn-ylt31bST.js";import"./redact-DtCbW9Lh.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-alPucxwR.js";import"./send-BjtuHdPu.js";import"./send-hasPbLlg.js";import{c as x,n as S,r as C}from"./paths-wWzafjVT.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-Blz-FPzD.js";import"./image-CX5WRMvG.js";import"./models-config-C5gOZ_nc.js";import"./tool-display-C3cLzGSo.js";import"./fetch-guard-vEM0OBSM.js";import"./api-key-rotation-WckBsEDu.js";import"./local-roots-CFjRwfz-.js";import"./model-catalog-CXPniyHC.js";import"./proxy-fetch-C2wlnGrt.js";import"./tokens-DH__4wsg.js";import"./deliver-2PlJp__j.js";import"./commands-DwmEeRNm.js";import"./commands-registry-BU4HdCpx.js";import"./call-bAaUSED1.js";import"./read-only-account-inspect-O_P5quS_.js";import"./send-D7fq-nJ3.js";import"./pi-model-discovery-a98ybLTx.js";import"./ir-BQmB5KFM.js";import"./render-CtSBbJxV.js";import"./target-errors-CNaozwgN.js";import"./with-timeout-DHfOS7eC.js";import"./diagnostic-J-Dby8Y5.js";import"./exec-approvals-allowlist-DtUEPDK1.js";import"./exec-safe-bin-runtime-policy-CbFmGEO0.js";import"./exec-approvals-CZ6LJByp.js";import"./nodes-screen-Daq3OqWy.js";import"./restart-F8FFXkby.js";import"./system-run-command-zYUx5RNl.js";import"./runtime-web-tools-Cs8NdOZU.js";import"./runtime-n_o60Cbj.js";import"./stagger-Ch71fX1z.js";import"./channel-selection-CVjAE1aK.js";import"./plugin-auto-enable-BACDL0lj.js";import"./send-DIiiAeSV.js";import"./outbound-attachment-BHK3lwtT.js";import"./fetch-D0ctXgLA.js";import"./delivery-queue-BavBjrc5.js";import"./send-Du5iNpc_.js";import"./pairing-store-DYDGw_J1.js";import"./session-cost-usage-C7K68CQv.js";import{n as ee}from"./format-relative-BFr4b1kk.js";import"./sqlite-DayONBPh.js";import"./channel-activity-BPEitbxC.js";import"./tables-DoACu3IR.js";import"./fetch-MmzBES-O.js";import"./skill-commands-CPsCP-Wn.js";import"./workspace-dirs-BT0ehvIx.js";import"./pairing-token-BNYR9_wD.js";import"./command-secret-targets-BPZrI3UX.js";import"./connection-auth-BNIAz5tD.js";import"./onboard-helpers-Dn0KiH64.js";import"./prompt-style-Ct-2QSEG.js";import"./pairing-labels-D_pIiFsE.js";import"./memory-cli-BohipG7v.js";import"./manager-Dc0951tf.js";import{t as w}from"./links-CmkiG3i0.js";import{n as T}from"./cli-utils-Cfu5AugP.js";import{t as E}from"./help-format-BY8dc9BS.js";import"./progress-CDXE9V22.js";import{n as D}from"./helpers-Cp8gcO6u.js";import"./skills-status-EVqShVbs.js";import"./dangerous-tools-oYCu5wfC.js";import"./skill-scanner-CHwhesKZ.js";import"./issue-format-D8eNC7S1.js";import"./channels-status-issues-DsqWGQy6.js";import"./systemd-DsnmhpJH.js";import"./service-CqYyZjPe.js";import"./probe-auth-Dw3Mv7tm.js";import"./diagnostics-TnaO44kn.js";import"./table-jkvoEPT5.js";import{t as O}from"./status-BUdDRE9f.js";import{r as k}from"./health-Pqtl8jCk.js";import"./channel-account-context-yUoL1Htv.js";import"./node-command-policy-JnKpKY36.js";import"./audit-8KSk4yf4.js";import"./node-service-39SxwxUC.js";import"./status.update-CyapGDVY.js";import A from"node:fs";function j(e){let t=new Map;for(let n of e)t.has(n.storePath)||t.set(n.storePath,n);return[...t.values()]}function M(e,t){let n=_(e),r=!!t.agent?.trim(),i=t.allAgents===!0;if(r&&i)throw Error(`--agent and --all-agents cannot be used together`);if(t.store&&(r||i))throw Error(`--store cannot be combined with --agent or --all-agents`);if(t.store)return[{agentId:n,storePath:x(t.store,{agentId:n})}];if(i)return j(v(e).map(t=>({agentId:t,storePath:x(e.session?.store,{agentId:t})})));if(r){let n=v(e),r=b(t.agent??``);if(!n.includes(r))throw Error(`Unknown agent id "${t.agent}". Use "openclaw agents list" to see configured agents.`);return[{agentId:r,storePath:x(e.session?.store,{agentId:r})}]}return[{agentId:n,storePath:x(e.session?.store,{agentId:n})}]}function N(e){try{return M(e.cfg,e.opts)}catch(t){return e.runtime.error(t instanceof Error?t.message:String(t)),e.runtime.exit(1),null}}function P(e){return Object.entries(e).map(([e,t])=>{let n=t?.updatedAt??null;return{key:e,updatedAt:n,ageMs:n?Date.now()-n:null,sessionId:t?.sessionId,systemSent:t?.systemSent,abortedLastRun:t?.abortedLastRun,thinkingLevel:t?.thinkingLevel,verboseLevel:t?.verboseLevel,reasoningLevel:t?.reasoningLevel,elevatedLevel:t?.elevatedLevel,responseUsage:t?.responseUsage,groupActivation:t?.groupActivation,inputTokens:t?.inputTokens,outputTokens:t?.outputTokens,totalTokens:t?.totalTokens,totalTokensFresh:t?.totalTokensFresh,model:t?.model,modelProvider:t?.modelProvider,providerOverride:t?.providerOverride,modelOverride:t?.modelOverride,contextTokens:t?.contextTokens}}).toSorted((e,t)=>(t.updatedAt??0)-(e.updatedAt??0))}function F(e){return{model:p({cfg:e,defaultProvider:`anthropic`,defaultModel:`claude-opus-4-6`}).model??`claude-opus-4-6`}}function I(e,t,n){return m(e,t,y(t.key)?.agentId).model??n.model}function L(e){return e.length<=26?e:`${e.slice(0,16)}...${e.slice(-6)}`}function R(t,n){let r=L(t).padEnd(26);return n?e.accent(r):r}function z(t,n){let r=(t?ee(Date.now()-t):`unknown`).padEnd(9);return n?e.muted(r):r}function B(t,n){let r=(t??`unknown`).padEnd(14);return n?e.info(r):r}function V(t,n){let r=[t.thinkingLevel?`think:${t.thinkingLevel}`:null,t.verboseLevel?`verbose:${t.verboseLevel}`:null,t.reasoningLevel?`reasoning:${t.reasoningLevel}`:null,t.elevatedLevel?`elev:${t.elevatedLevel}`:null,t.responseUsage?`usage:${t.responseUsage}`:null,t.groupActivation?`activation:${t.groupActivation}`:null,t.systemSent?`system`:null,t.abortedLastRun?`aborted`:null,t.sessionId?`id:${t.sessionId}`:null].filter(Boolean).join(` `);return r.length===0?``:n?e.muted(r):r}function H(e){return e.missingKeys.has(e.key)?`prune-missing`:e.staleKeys.has(e.key)?`prune-stale`:e.cappedKeys.has(e.key)?`cap-overflow`:e.budgetEvictedKeys.has(e.key)?`evict-budget`:`keep`}function U(t,n){let r=t.padEnd(12);return n?t===`keep`?e.muted(r):t===`prune-missing`?e.error(r):t===`prune-stale`?e.warn(r):t===`cap-overflow`?e.accentBright(r):e.error(r):r}function W(e){return P(e.beforeStore).map(t=>({...t,action:H({key:t.key,missingKeys:e.missingKeys,staleKeys:e.staleKeys,cappedKeys:e.cappedKeys,budgetEvictedKeys:e.budgetEvictedKeys})}))}function G(e){let t=C({storePath:e.storePath}),n=0;for(let[r,i]of Object.entries(e.store)){if(!i?.sessionId)continue;let a=S(i.sessionId,i,t);A.existsSync(a)||(delete e.store[r],n+=1,e.onPruned?.(r))}return n}async function K(e){let t=u(),n=a(e.target.storePath,{skipCache:!0}),r=structuredClone(n),i=new Set,o=new Set,c=new Set,l=e.fixMissing===!0?G({store:r,storePath:e.target.storePath,onPruned:e=>{c.add(e)}}):0,p=d(r,t.pruneAfterMs,{log:!1,onPruned:({key:e})=>{i.add(e)}}),m=s(r,t.maxEntries,{log:!1,onCapped:({key:e})=>{o.add(e)}}),h=structuredClone(r),g=await f({store:r,storePath:e.target.storePath,activeSessionKey:e.activeKey,maintenance:t,warnOnly:!1,dryRun:!0}),_=new Set;for(let e of Object.keys(h))Object.hasOwn(r,e)||_.add(e);let v=Object.keys(n).length,y=Object.keys(r).length,b=l>0||p>0||m>0||(g?.removedEntries??0)>0||(g?.removedFiles??0)>0;return{summary:{agentId:e.target.agentId,storePath:e.target.storePath,mode:e.mode,dryRun:e.dryRun,beforeCount:v,afterCount:y,missing:l,pruned:p,capped:m,diskBudget:g,wouldMutate:b},actionRows:W({beforeStore:n,staleKeys:i,cappedKeys:o,budgetEvictedKeys:_,missingKeys:c})}}function q(n){let r=t();if(n.showAgentHeader&&n.runtime.log(`Agent: ${n.summary.agentId}`),n.runtime.log(`Session store: ${n.summary.storePath}`),n.runtime.log(`Maintenance mode: ${n.summary.mode}`),n.runtime.log(`Entries: ${n.summary.beforeCount} -> ${n.summary.afterCount} (remove ${n.summary.beforeCount-n.summary.afterCount})`),n.runtime.log(`Would prune missing transcripts: ${n.summary.missing}`),n.runtime.log(`Would prune stale: ${n.summary.pruned}`),n.runtime.log(`Would cap overflow: ${n.summary.capped}`),n.summary.diskBudget&&n.runtime.log(`Would enforce disk budget: ${n.summary.diskBudget.totalBytesBefore} -> ${n.summary.diskBudget.totalBytesAfter} bytes (files ${n.summary.diskBudget.removedFiles}, entries ${n.summary.diskBudget.removedEntries})`),n.actionRows.length===0)return;n.runtime.log(``),n.runtime.log(`Planned session actions:`);let i=[`Action`.padEnd(12),`Key`.padEnd(26),`Age`.padEnd(9),`Model`.padEnd(14),`Flags`].join(` `);n.runtime.log(r?e.heading(i):i);for(let e of n.actionRows){let t=I(n.cfg,e,n.displayDefaults),i=[U(e.action,r),R(e.key,r),z(e.updatedAt,r),B(t,r),V(e,r)].join(` `);n.runtime.log(i.trimEnd())}}async function J(e,t){let n=o(),r=F(n),i=e.enforce?`enforce`:u().mode,s=N({cfg:n,opts:{store:e.store,agent:e.agent,allAgents:e.allAgents},runtime:t});if(!s)return;let l=[];for(let t of s){let n=await K({target:t,mode:i,dryRun:!!e.dryRun,activeKey:e.activeKey,fixMissing:!!e.fixMissing});l.push(n)}if(e.dryRun){if(e.json){if(l.length===1){t.log(JSON.stringify(l[0]?.summary??{},null,2));return}t.log(JSON.stringify({allAgents:!0,mode:i,dryRun:!0,stores:l.map(e=>e.summary)},null,2));return}for(let e=0;e<l.length;e+=1){let i=l[e];e>0&&t.log(``),q({cfg:n,summary:i.summary,actionRows:i.actionRows,displayDefaults:r,runtime:t,showAgentHeader:l.length>1})}return}let d=[];for(let t of s){let n={current:null},r=await c(t.storePath,async n=>e.fixMissing?G({store:n,storePath:t.storePath}):0,{activeSessionKey:e.activeKey,maintenanceOverride:{mode:i},onMaintenanceApplied:e=>{n.current=e}}),o=a(t.storePath,{skipCache:!0}),s=l.find(e=>e.summary.storePath===t.storePath),u=n.current,f=u===null?{...s?.summary??{agentId:t.agentId,storePath:t.storePath,mode:i,dryRun:!1,beforeCount:0,afterCount:0,missing:0,pruned:0,capped:0,diskBudget:null,wouldMutate:!1},dryRun:!1,applied:!0,appliedCount:Object.keys(o).length}:{agentId:t.agentId,storePath:t.storePath,mode:u.mode,dryRun:!1,beforeCount:u.beforeCount,afterCount:u.afterCount,missing:r,pruned:u.pruned,capped:u.capped,diskBudget:u.diskBudget,wouldMutate:r>0||u.pruned>0||u.capped>0||(u.diskBudget?.removedEntries??0)>0||(u.diskBudget?.removedFiles??0)>0,applied:!0,appliedCount:Object.keys(o).length};d.push(f)}if(e.json){if(d.length===1){t.log(JSON.stringify(d[0]??{},null,2));return}t.log(JSON.stringify({allAgents:!0,mode:i,dryRun:!1,stores:d},null,2));return}for(let e=0;e<d.length;e+=1){let n=d[e];e>0&&t.log(``),d.length>1&&t.log(`Agent: ${n.agentId}`),t.log(`Session store: ${n.storePath}`),t.log(`Applied maintenance. Current entries: ${n.appliedCount??0}`)}}const Y=e=>`${(e/1e3).toFixed(e>=1e4?0:1)}k`,X=(t,n,r)=>!r||n===null?t:n>=95?e.error(t):n>=80?e.warn(t):n>=60?e.success(t):e.muted(t),Z=(t,n,r)=>{if(t===void 0){let t=`unknown/${n?Y(n):`?`} (?%)`;return r?e.muted(t.padEnd(20)):t.padEnd(20)}let i=Y(t),a=n?Y(n):`?`,o=n?Math.min(999,Math.round(t/n*100)):null;return X(`${i}/${a} (${o??`?`}%)`.padEnd(20),o,r)},Q=(t,n)=>{let r=t.padEnd(6);return n?t===`group`?e.accentBright(r):t===`global`?e.warn(r):t===`direct`?e.accent(r):e.muted(r):r};async function te(n,r){let s=n.allAgents===!0,c=o(),u=F(c),d=c.agents?.defaults?.contextTokens??g(u.model)??2e5,f=N({cfg:c,opts:{store:n.store,agent:n.agent,allAgents:n.allAgents},runtime:r});if(!f)return;let p;if(n.active!==void 0){let e=Number.parseInt(String(n.active),10);if(Number.isNaN(e)||e<=0){r.error(`--active must be a positive integer (minutes)`),r.exit(1);return}p=e}let m=f.flatMap(e=>{let t=a(e.storePath);return P(t).map(n=>({...n,agentId:y(n.key)?.agentId??e.agentId,kind:h(n.key,t[n.key])}))}).filter(e=>p===void 0?!0:e.updatedAt?Date.now()-e.updatedAt<=p*6e4:!1).toSorted((e,t)=>(t.updatedAt??0)-(e.updatedAt??0));if(n.json){let e=f.length>1,t=s||e;r.log(JSON.stringify({path:t?null:f[0]?.storePath??null,stores:t?f.map(e=>({agentId:e.agentId,path:e.storePath})):void 0,allAgents:s?!0:void 0,count:m.length,activeMinutes:p??null,sessions:m.map(e=>{let t=I(c,e,u);return{...e,totalTokens:l(e)??null,totalTokensFresh:typeof e.totalTokens==`number`?e.totalTokensFresh!==!1:!1,contextTokens:e.contextTokens??g(t)??d??null,model:t}})},null,2));return}if(f.length===1&&!s?r.log(i(`Session store: ${f[0]?.storePath}`)):r.log(i(`Session stores: ${f.length} (${f.map(e=>e.agentId).join(`, `)})`)),r.log(i(`Sessions listed: ${m.length}`)),p&&r.log(i(`Filtered to last ${p} minute(s)`)),m.length===0){r.log(`No sessions found.`);return}let _=t(),v=s||f.length>1,b=[...v?[`Agent`.padEnd(10)]:[],`Kind`.padEnd(6),`Key`.padEnd(26),`Age`.padEnd(9),`Model`.padEnd(14),`Tokens (ctx %)`.padEnd(20),`Flags`].join(` `);r.log(_?e.heading(b):b);for(let t of m){let n=I(c,t,u),i=t.contextTokens??g(n)??d,a=l(t),o=[...v?[_?e.accentBright(t.agentId.padEnd(10)):t.agentId.padEnd(10)]:[],Q(t.kind,_),R(t.key,_),z(t.updatedAt,_),B(n,_),Z(a,i??null,_),V(t,_)].join(` `);r.log(o.trimEnd())}}function ne(e){return!!(e.verbose||e.debug)}function re(e){let t=D(e);return e!==void 0&&t===void 0?(n.error(`--timeout must be a positive integer (milliseconds)`),n.exit(1),null):t}async function $(e,t){let i=ne(e);r(i);let a=re(e.timeout);a!==null&&await T(n,async()=>{await t({verbose:i,timeoutMs:a})})}function ie(t){t.command(`status`).description(`Show channel health and recent session recipients`).option(`--json`,`Output JSON instead of text`,!1).option(`--all`,`Full diagnosis (read-only, pasteable)`,!1).option(`--usage`,`Show model provider usage/quota snapshots`,!1).option(`--deep`,`Probe channels (WhatsApp Web + Telegram + Discord + Slack + Signal)`,!1).option(`--timeout <ms>`,`Probe timeout in milliseconds`,`10000`).option(`--verbose`,`Verbose logging`,!1).option(`--debug`,`Alias for --verbose`,!1).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${E([[`openclaw status`,`Show channel health + session summary.`],[`openclaw status --all`,`Full diagnosis (read-only).`],[`openclaw status --json`,`Machine-readable output.`],[`openclaw status --usage`,`Show model provider usage/quota snapshots.`],[`openclaw status --deep`,`Run channel probes (WA + Telegram + Discord + Slack + Signal).`],[`openclaw status --deep --timeout 5000`,`Tighten probe timeout.`]])}`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${w(`/cli/status`,`docs.openclaw.ai/cli/status`)}\n`).action(async e=>{await $(e,async({verbose:t,timeoutMs:r})=>{await O({json:!!e.json,all:!!e.all,deep:!!e.deep,usage:!!e.usage,timeoutMs:r,verbose:t},n)})}),t.command(`health`).description(`Fetch health from the running gateway`).option(`--json`,`Output JSON instead of text`,!1).option(`--timeout <ms>`,`Connection timeout in milliseconds`,`10000`).option(`--verbose`,`Verbose logging`,!1).option(`--debug`,`Alias for --verbose`,!1).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${w(`/cli/health`,`docs.openclaw.ai/cli/health`)}\n`).action(async e=>{await $(e,async({verbose:t,timeoutMs:r})=>{await k({json:!!e.json,timeoutMs:r,verbose:t},n)})});let i=t.command(`sessions`).description(`List stored conversation sessions`).option(`--json`,`Output as JSON`,!1).option(`--verbose`,`Verbose logging`,!1).option(`--store <path>`,`Path to session store (default: resolved from config)`).option(`--agent <id>`,`Agent id to inspect (default: configured default agent)`).option(`--all-agents`,`Aggregate sessions across all configured agents`,!1).option(`--active <minutes>`,`Only show sessions updated within the past N minutes`).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${E([[`openclaw sessions`,`List all sessions.`],[`openclaw sessions --agent work`,`List sessions for one agent.`],[`openclaw sessions --all-agents`,`Aggregate sessions across agents.`],[`openclaw sessions --active 120`,`Only last 2 hours.`],[`openclaw sessions --json`,`Machine-readable output.`],[`openclaw sessions --store ./tmp/sessions.json`,`Use a specific session store.`]])}\n\n${e.muted(`Shows token usage per session when the agent reports it; set agents.defaults.contextTokens to cap the window and show %.`)}`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${w(`/cli/sessions`,`docs.openclaw.ai/cli/sessions`)}\n`).action(async e=>{r(!!e.verbose),await te({json:!!e.json,store:e.store,agent:e.agent,allAgents:!!e.allAgents,active:e.active},n)});i.enablePositionalOptions(),i.command(`cleanup`).description(`Run session-store maintenance now`).option(`--store <path>`,`Path to session store (default: resolved from config)`).option(`--agent <id>`,`Agent id to maintain (default: configured default agent)`).option(`--all-agents`,`Run maintenance across all configured agents`,!1).option(`--dry-run`,`Preview maintenance actions without writing`,!1).option(`--enforce`,`Apply maintenance even when configured mode is warn`,!1).option(`--fix-missing`,`Remove store entries whose transcript files are missing (bypasses age/count retention)`,!1).option(`--active-key <key>`,`Protect this session key from budget-eviction`).option(`--json`,`Output JSON`,!1).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${E([[`openclaw sessions cleanup --dry-run`,`Preview stale/cap cleanup.`],[`openclaw sessions cleanup --dry-run --fix-missing`,`Also preview pruning entries with missing transcript files.`],[`openclaw sessions cleanup --enforce`,`Apply maintenance now.`],[`openclaw sessions cleanup --agent work --dry-run`,`Preview one agent store.`],[`openclaw sessions cleanup --all-agents --dry-run`,`Preview all agent stores.`],[`openclaw sessions cleanup --enforce --store ./tmp/sessions.json`,`Use a specific store.`]])}`).action(async(e,t)=>{let r=t.parent?.opts();await T(n,async()=>{await J({store:e.store??r?.store,agent:e.agent??r?.agent,allAgents:!!(e.allAgents||r?.allAgents),dryRun:!!e.dryRun,enforce:!!e.enforce,fixMissing:!!e.fixMissing,activeKey:e.activeKey,json:!!(e.json||r?.json)},n)})})}export{ie as registerStatusHealthSessionsCommands};
|
|
1
|
+
import"./paths-DfDmyG-r.js";import{A as e,k as t,p as n,w as r,y as i}from"./subsystem-B35lZH6M.js";import"./utils-eSzw3-BW.js";import{Bn as a,Gs as o,Jn as s,Kn as c,Nr as l,Xn as u,Yn as d,Zn as f,h as p}from"./model-selection-D_WMcs-m.js";import{cn as m,tn as h,un as g}from"./reply-JaJmymld.js";import{f as _,r as v}from"./agent-scope-DauKPN2a.js";import{E as y,c as b}from"./session-key-D3P0tf5P.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-HBWzEstG.js";import"./boolean-Ch3DfXPy.js";import"./env-DEV6pFi3.js";import"./env-overrides-CYDvuetI.js";import"./registry-DwigmP92.js";import"./skills-sxAZFqk6.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CPVBLi22.js";import"./logger-DMM_uqZu.js";import"./exec-Ble6PWIi.js";import"./windows-spawn-ylt31bST.js";import"./redact-DtCbW9Lh.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-alPucxwR.js";import"./send-BjtuHdPu.js";import"./send-hasPbLlg.js";import{c as x,n as S,r as C}from"./paths-wWzafjVT.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-Blz-FPzD.js";import"./image-CX5WRMvG.js";import"./models-config-C5gOZ_nc.js";import"./tool-display-C3cLzGSo.js";import"./fetch-guard-vEM0OBSM.js";import"./api-key-rotation-WckBsEDu.js";import"./local-roots-CFjRwfz-.js";import"./model-catalog-CXPniyHC.js";import"./proxy-fetch-C2wlnGrt.js";import"./tokens-DH__4wsg.js";import"./deliver-2PlJp__j.js";import"./commands-DwmEeRNm.js";import"./commands-registry-BU4HdCpx.js";import"./call-bAaUSED1.js";import"./read-only-account-inspect-O_P5quS_.js";import"./send-D7fq-nJ3.js";import"./pi-model-discovery-a98ybLTx.js";import"./ir-BQmB5KFM.js";import"./render-CtSBbJxV.js";import"./target-errors-CNaozwgN.js";import"./with-timeout-DHfOS7eC.js";import"./diagnostic-J-Dby8Y5.js";import"./exec-approvals-allowlist-DtUEPDK1.js";import"./exec-safe-bin-runtime-policy-CbFmGEO0.js";import"./exec-approvals-CZ6LJByp.js";import"./nodes-screen-Daq3OqWy.js";import"./restart-F8FFXkby.js";import"./system-run-command-zYUx5RNl.js";import"./runtime-web-tools-Cs8NdOZU.js";import"./runtime-n_o60Cbj.js";import"./stagger-Ch71fX1z.js";import"./channel-selection-CVjAE1aK.js";import"./plugin-auto-enable-BACDL0lj.js";import"./send-DIiiAeSV.js";import"./outbound-attachment-BHK3lwtT.js";import"./fetch-D0ctXgLA.js";import"./delivery-queue-BavBjrc5.js";import"./send-Du5iNpc_.js";import"./pairing-store-DYDGw_J1.js";import"./session-cost-usage-C7K68CQv.js";import{n as ee}from"./format-relative-BFr4b1kk.js";import"./sqlite-DayONBPh.js";import"./channel-activity-BPEitbxC.js";import"./tables-DoACu3IR.js";import"./fetch-MmzBES-O.js";import"./skill-commands-CPsCP-Wn.js";import"./workspace-dirs-BT0ehvIx.js";import"./pairing-token-BNYR9_wD.js";import"./command-secret-targets-BPZrI3UX.js";import"./connection-auth-BNIAz5tD.js";import"./onboard-helpers-Dn0KiH64.js";import"./prompt-style-Ct-2QSEG.js";import"./pairing-labels-D_pIiFsE.js";import"./memory-cli-BohipG7v.js";import"./manager-Dc0951tf.js";import{t as w}from"./links-CmkiG3i0.js";import{n as T}from"./cli-utils-Cfu5AugP.js";import{t as E}from"./help-format-BY8dc9BS.js";import"./progress-CDXE9V22.js";import{n as D}from"./helpers-Cp8gcO6u.js";import"./skills-status-EVqShVbs.js";import"./dangerous-tools-oYCu5wfC.js";import"./skill-scanner-CHwhesKZ.js";import"./issue-format-D8eNC7S1.js";import"./channels-status-issues-DsqWGQy6.js";import"./systemd-DsnmhpJH.js";import"./service-CqYyZjPe.js";import"./probe-auth-Dw3Mv7tm.js";import"./diagnostics-TnaO44kn.js";import"./table-jkvoEPT5.js";import{t as O}from"./status-Ln-hRgxh.js";import{r as k}from"./health-xCl2atiY.js";import"./channel-account-context-yUoL1Htv.js";import"./node-command-policy-JnKpKY36.js";import"./audit-8KSk4yf4.js";import"./node-service-39SxwxUC.js";import"./status.update-CyapGDVY.js";import A from"node:fs";function j(e){let t=new Map;for(let n of e)t.has(n.storePath)||t.set(n.storePath,n);return[...t.values()]}function M(e,t){let n=_(e),r=!!t.agent?.trim(),i=t.allAgents===!0;if(r&&i)throw Error(`--agent and --all-agents cannot be used together`);if(t.store&&(r||i))throw Error(`--store cannot be combined with --agent or --all-agents`);if(t.store)return[{agentId:n,storePath:x(t.store,{agentId:n})}];if(i)return j(v(e).map(t=>({agentId:t,storePath:x(e.session?.store,{agentId:t})})));if(r){let n=v(e),r=b(t.agent??``);if(!n.includes(r))throw Error(`Unknown agent id "${t.agent}". Use "openclaw agents list" to see configured agents.`);return[{agentId:r,storePath:x(e.session?.store,{agentId:r})}]}return[{agentId:n,storePath:x(e.session?.store,{agentId:n})}]}function N(e){try{return M(e.cfg,e.opts)}catch(t){return e.runtime.error(t instanceof Error?t.message:String(t)),e.runtime.exit(1),null}}function P(e){return Object.entries(e).map(([e,t])=>{let n=t?.updatedAt??null;return{key:e,updatedAt:n,ageMs:n?Date.now()-n:null,sessionId:t?.sessionId,systemSent:t?.systemSent,abortedLastRun:t?.abortedLastRun,thinkingLevel:t?.thinkingLevel,verboseLevel:t?.verboseLevel,reasoningLevel:t?.reasoningLevel,elevatedLevel:t?.elevatedLevel,responseUsage:t?.responseUsage,groupActivation:t?.groupActivation,inputTokens:t?.inputTokens,outputTokens:t?.outputTokens,totalTokens:t?.totalTokens,totalTokensFresh:t?.totalTokensFresh,model:t?.model,modelProvider:t?.modelProvider,providerOverride:t?.providerOverride,modelOverride:t?.modelOverride,contextTokens:t?.contextTokens}}).toSorted((e,t)=>(t.updatedAt??0)-(e.updatedAt??0))}function F(e){return{model:p({cfg:e,defaultProvider:`anthropic`,defaultModel:`claude-opus-4-6`}).model??`claude-opus-4-6`}}function I(e,t,n){return m(e,t,y(t.key)?.agentId).model??n.model}function L(e){return e.length<=26?e:`${e.slice(0,16)}...${e.slice(-6)}`}function R(t,n){let r=L(t).padEnd(26);return n?e.accent(r):r}function z(t,n){let r=(t?ee(Date.now()-t):`unknown`).padEnd(9);return n?e.muted(r):r}function B(t,n){let r=(t??`unknown`).padEnd(14);return n?e.info(r):r}function V(t,n){let r=[t.thinkingLevel?`think:${t.thinkingLevel}`:null,t.verboseLevel?`verbose:${t.verboseLevel}`:null,t.reasoningLevel?`reasoning:${t.reasoningLevel}`:null,t.elevatedLevel?`elev:${t.elevatedLevel}`:null,t.responseUsage?`usage:${t.responseUsage}`:null,t.groupActivation?`activation:${t.groupActivation}`:null,t.systemSent?`system`:null,t.abortedLastRun?`aborted`:null,t.sessionId?`id:${t.sessionId}`:null].filter(Boolean).join(` `);return r.length===0?``:n?e.muted(r):r}function H(e){return e.missingKeys.has(e.key)?`prune-missing`:e.staleKeys.has(e.key)?`prune-stale`:e.cappedKeys.has(e.key)?`cap-overflow`:e.budgetEvictedKeys.has(e.key)?`evict-budget`:`keep`}function U(t,n){let r=t.padEnd(12);return n?t===`keep`?e.muted(r):t===`prune-missing`?e.error(r):t===`prune-stale`?e.warn(r):t===`cap-overflow`?e.accentBright(r):e.error(r):r}function W(e){return P(e.beforeStore).map(t=>({...t,action:H({key:t.key,missingKeys:e.missingKeys,staleKeys:e.staleKeys,cappedKeys:e.cappedKeys,budgetEvictedKeys:e.budgetEvictedKeys})}))}function G(e){let t=C({storePath:e.storePath}),n=0;for(let[r,i]of Object.entries(e.store)){if(!i?.sessionId)continue;let a=S(i.sessionId,i,t);A.existsSync(a)||(delete e.store[r],n+=1,e.onPruned?.(r))}return n}async function K(e){let t=u(),n=a(e.target.storePath,{skipCache:!0}),r=structuredClone(n),i=new Set,o=new Set,c=new Set,l=e.fixMissing===!0?G({store:r,storePath:e.target.storePath,onPruned:e=>{c.add(e)}}):0,p=d(r,t.pruneAfterMs,{log:!1,onPruned:({key:e})=>{i.add(e)}}),m=s(r,t.maxEntries,{log:!1,onCapped:({key:e})=>{o.add(e)}}),h=structuredClone(r),g=await f({store:r,storePath:e.target.storePath,activeSessionKey:e.activeKey,maintenance:t,warnOnly:!1,dryRun:!0}),_=new Set;for(let e of Object.keys(h))Object.hasOwn(r,e)||_.add(e);let v=Object.keys(n).length,y=Object.keys(r).length,b=l>0||p>0||m>0||(g?.removedEntries??0)>0||(g?.removedFiles??0)>0;return{summary:{agentId:e.target.agentId,storePath:e.target.storePath,mode:e.mode,dryRun:e.dryRun,beforeCount:v,afterCount:y,missing:l,pruned:p,capped:m,diskBudget:g,wouldMutate:b},actionRows:W({beforeStore:n,staleKeys:i,cappedKeys:o,budgetEvictedKeys:_,missingKeys:c})}}function q(n){let r=t();if(n.showAgentHeader&&n.runtime.log(`Agent: ${n.summary.agentId}`),n.runtime.log(`Session store: ${n.summary.storePath}`),n.runtime.log(`Maintenance mode: ${n.summary.mode}`),n.runtime.log(`Entries: ${n.summary.beforeCount} -> ${n.summary.afterCount} (remove ${n.summary.beforeCount-n.summary.afterCount})`),n.runtime.log(`Would prune missing transcripts: ${n.summary.missing}`),n.runtime.log(`Would prune stale: ${n.summary.pruned}`),n.runtime.log(`Would cap overflow: ${n.summary.capped}`),n.summary.diskBudget&&n.runtime.log(`Would enforce disk budget: ${n.summary.diskBudget.totalBytesBefore} -> ${n.summary.diskBudget.totalBytesAfter} bytes (files ${n.summary.diskBudget.removedFiles}, entries ${n.summary.diskBudget.removedEntries})`),n.actionRows.length===0)return;n.runtime.log(``),n.runtime.log(`Planned session actions:`);let i=[`Action`.padEnd(12),`Key`.padEnd(26),`Age`.padEnd(9),`Model`.padEnd(14),`Flags`].join(` `);n.runtime.log(r?e.heading(i):i);for(let e of n.actionRows){let t=I(n.cfg,e,n.displayDefaults),i=[U(e.action,r),R(e.key,r),z(e.updatedAt,r),B(t,r),V(e,r)].join(` `);n.runtime.log(i.trimEnd())}}async function J(e,t){let n=o(),r=F(n),i=e.enforce?`enforce`:u().mode,s=N({cfg:n,opts:{store:e.store,agent:e.agent,allAgents:e.allAgents},runtime:t});if(!s)return;let l=[];for(let t of s){let n=await K({target:t,mode:i,dryRun:!!e.dryRun,activeKey:e.activeKey,fixMissing:!!e.fixMissing});l.push(n)}if(e.dryRun){if(e.json){if(l.length===1){t.log(JSON.stringify(l[0]?.summary??{},null,2));return}t.log(JSON.stringify({allAgents:!0,mode:i,dryRun:!0,stores:l.map(e=>e.summary)},null,2));return}for(let e=0;e<l.length;e+=1){let i=l[e];e>0&&t.log(``),q({cfg:n,summary:i.summary,actionRows:i.actionRows,displayDefaults:r,runtime:t,showAgentHeader:l.length>1})}return}let d=[];for(let t of s){let n={current:null},r=await c(t.storePath,async n=>e.fixMissing?G({store:n,storePath:t.storePath}):0,{activeSessionKey:e.activeKey,maintenanceOverride:{mode:i},onMaintenanceApplied:e=>{n.current=e}}),o=a(t.storePath,{skipCache:!0}),s=l.find(e=>e.summary.storePath===t.storePath),u=n.current,f=u===null?{...s?.summary??{agentId:t.agentId,storePath:t.storePath,mode:i,dryRun:!1,beforeCount:0,afterCount:0,missing:0,pruned:0,capped:0,diskBudget:null,wouldMutate:!1},dryRun:!1,applied:!0,appliedCount:Object.keys(o).length}:{agentId:t.agentId,storePath:t.storePath,mode:u.mode,dryRun:!1,beforeCount:u.beforeCount,afterCount:u.afterCount,missing:r,pruned:u.pruned,capped:u.capped,diskBudget:u.diskBudget,wouldMutate:r>0||u.pruned>0||u.capped>0||(u.diskBudget?.removedEntries??0)>0||(u.diskBudget?.removedFiles??0)>0,applied:!0,appliedCount:Object.keys(o).length};d.push(f)}if(e.json){if(d.length===1){t.log(JSON.stringify(d[0]??{},null,2));return}t.log(JSON.stringify({allAgents:!0,mode:i,dryRun:!1,stores:d},null,2));return}for(let e=0;e<d.length;e+=1){let n=d[e];e>0&&t.log(``),d.length>1&&t.log(`Agent: ${n.agentId}`),t.log(`Session store: ${n.storePath}`),t.log(`Applied maintenance. Current entries: ${n.appliedCount??0}`)}}const Y=e=>`${(e/1e3).toFixed(e>=1e4?0:1)}k`,X=(t,n,r)=>!r||n===null?t:n>=95?e.error(t):n>=80?e.warn(t):n>=60?e.success(t):e.muted(t),Z=(t,n,r)=>{if(t===void 0){let t=`unknown/${n?Y(n):`?`} (?%)`;return r?e.muted(t.padEnd(20)):t.padEnd(20)}let i=Y(t),a=n?Y(n):`?`,o=n?Math.min(999,Math.round(t/n*100)):null;return X(`${i}/${a} (${o??`?`}%)`.padEnd(20),o,r)},Q=(t,n)=>{let r=t.padEnd(6);return n?t===`group`?e.accentBright(r):t===`global`?e.warn(r):t===`direct`?e.accent(r):e.muted(r):r};async function te(n,r){let s=n.allAgents===!0,c=o(),u=F(c),d=c.agents?.defaults?.contextTokens??g(u.model)??2e5,f=N({cfg:c,opts:{store:n.store,agent:n.agent,allAgents:n.allAgents},runtime:r});if(!f)return;let p;if(n.active!==void 0){let e=Number.parseInt(String(n.active),10);if(Number.isNaN(e)||e<=0){r.error(`--active must be a positive integer (minutes)`),r.exit(1);return}p=e}let m=f.flatMap(e=>{let t=a(e.storePath);return P(t).map(n=>({...n,agentId:y(n.key)?.agentId??e.agentId,kind:h(n.key,t[n.key])}))}).filter(e=>p===void 0?!0:e.updatedAt?Date.now()-e.updatedAt<=p*6e4:!1).toSorted((e,t)=>(t.updatedAt??0)-(e.updatedAt??0));if(n.json){let e=f.length>1,t=s||e;r.log(JSON.stringify({path:t?null:f[0]?.storePath??null,stores:t?f.map(e=>({agentId:e.agentId,path:e.storePath})):void 0,allAgents:s?!0:void 0,count:m.length,activeMinutes:p??null,sessions:m.map(e=>{let t=I(c,e,u);return{...e,totalTokens:l(e)??null,totalTokensFresh:typeof e.totalTokens==`number`?e.totalTokensFresh!==!1:!1,contextTokens:e.contextTokens??g(t)??d??null,model:t}})},null,2));return}if(f.length===1&&!s?r.log(i(`Session store: ${f[0]?.storePath}`)):r.log(i(`Session stores: ${f.length} (${f.map(e=>e.agentId).join(`, `)})`)),r.log(i(`Sessions listed: ${m.length}`)),p&&r.log(i(`Filtered to last ${p} minute(s)`)),m.length===0){r.log(`No sessions found.`);return}let _=t(),v=s||f.length>1,b=[...v?[`Agent`.padEnd(10)]:[],`Kind`.padEnd(6),`Key`.padEnd(26),`Age`.padEnd(9),`Model`.padEnd(14),`Tokens (ctx %)`.padEnd(20),`Flags`].join(` `);r.log(_?e.heading(b):b);for(let t of m){let n=I(c,t,u),i=t.contextTokens??g(n)??d,a=l(t),o=[...v?[_?e.accentBright(t.agentId.padEnd(10)):t.agentId.padEnd(10)]:[],Q(t.kind,_),R(t.key,_),z(t.updatedAt,_),B(n,_),Z(a,i??null,_),V(t,_)].join(` `);r.log(o.trimEnd())}}function ne(e){return!!(e.verbose||e.debug)}function re(e){let t=D(e);return e!==void 0&&t===void 0?(n.error(`--timeout must be a positive integer (milliseconds)`),n.exit(1),null):t}async function $(e,t){let i=ne(e);r(i);let a=re(e.timeout);a!==null&&await T(n,async()=>{await t({verbose:i,timeoutMs:a})})}function ie(t){t.command(`status`).description(`Show channel health and recent session recipients`).option(`--json`,`Output JSON instead of text`,!1).option(`--all`,`Full diagnosis (read-only, pasteable)`,!1).option(`--usage`,`Show model provider usage/quota snapshots`,!1).option(`--deep`,`Probe channels (WhatsApp Web + Telegram + Discord + Slack + Signal)`,!1).option(`--timeout <ms>`,`Probe timeout in milliseconds`,`10000`).option(`--verbose`,`Verbose logging`,!1).option(`--debug`,`Alias for --verbose`,!1).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${E([[`openclaw status`,`Show channel health + session summary.`],[`openclaw status --all`,`Full diagnosis (read-only).`],[`openclaw status --json`,`Machine-readable output.`],[`openclaw status --usage`,`Show model provider usage/quota snapshots.`],[`openclaw status --deep`,`Run channel probes (WA + Telegram + Discord + Slack + Signal).`],[`openclaw status --deep --timeout 5000`,`Tighten probe timeout.`]])}`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${w(`/cli/status`,`docs.openclaw.ai/cli/status`)}\n`).action(async e=>{await $(e,async({verbose:t,timeoutMs:r})=>{await O({json:!!e.json,all:!!e.all,deep:!!e.deep,usage:!!e.usage,timeoutMs:r,verbose:t},n)})}),t.command(`health`).description(`Fetch health from the running gateway`).option(`--json`,`Output JSON instead of text`,!1).option(`--timeout <ms>`,`Connection timeout in milliseconds`,`10000`).option(`--verbose`,`Verbose logging`,!1).option(`--debug`,`Alias for --verbose`,!1).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${w(`/cli/health`,`docs.openclaw.ai/cli/health`)}\n`).action(async e=>{await $(e,async({verbose:t,timeoutMs:r})=>{await k({json:!!e.json,timeoutMs:r,verbose:t},n)})});let i=t.command(`sessions`).description(`List stored conversation sessions`).option(`--json`,`Output as JSON`,!1).option(`--verbose`,`Verbose logging`,!1).option(`--store <path>`,`Path to session store (default: resolved from config)`).option(`--agent <id>`,`Agent id to inspect (default: configured default agent)`).option(`--all-agents`,`Aggregate sessions across all configured agents`,!1).option(`--active <minutes>`,`Only show sessions updated within the past N minutes`).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${E([[`openclaw sessions`,`List all sessions.`],[`openclaw sessions --agent work`,`List sessions for one agent.`],[`openclaw sessions --all-agents`,`Aggregate sessions across agents.`],[`openclaw sessions --active 120`,`Only last 2 hours.`],[`openclaw sessions --json`,`Machine-readable output.`],[`openclaw sessions --store ./tmp/sessions.json`,`Use a specific session store.`]])}\n\n${e.muted(`Shows token usage per session when the agent reports it; set agents.defaults.contextTokens to cap the window and show %.`)}`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${w(`/cli/sessions`,`docs.openclaw.ai/cli/sessions`)}\n`).action(async e=>{r(!!e.verbose),await te({json:!!e.json,store:e.store,agent:e.agent,allAgents:!!e.allAgents,active:e.active},n)});i.enablePositionalOptions(),i.command(`cleanup`).description(`Run session-store maintenance now`).option(`--store <path>`,`Path to session store (default: resolved from config)`).option(`--agent <id>`,`Agent id to maintain (default: configured default agent)`).option(`--all-agents`,`Run maintenance across all configured agents`,!1).option(`--dry-run`,`Preview maintenance actions without writing`,!1).option(`--enforce`,`Apply maintenance even when configured mode is warn`,!1).option(`--fix-missing`,`Remove store entries whose transcript files are missing (bypasses age/count retention)`,!1).option(`--active-key <key>`,`Protect this session key from budget-eviction`).option(`--json`,`Output JSON`,!1).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${E([[`openclaw sessions cleanup --dry-run`,`Preview stale/cap cleanup.`],[`openclaw sessions cleanup --dry-run --fix-missing`,`Also preview pruning entries with missing transcript files.`],[`openclaw sessions cleanup --enforce`,`Apply maintenance now.`],[`openclaw sessions cleanup --agent work --dry-run`,`Preview one agent store.`],[`openclaw sessions cleanup --all-agents --dry-run`,`Preview all agent stores.`],[`openclaw sessions cleanup --enforce --store ./tmp/sessions.json`,`Use a specific store.`]])}`).action(async(e,t)=>{let r=t.parent?.opts();await T(n,async()=>{await J({store:e.store??r?.store,agent:e.agent??r?.agent,allAgents:!!(e.allAgents||r?.allAgents),dryRun:!!e.dryRun,enforce:!!e.enforce,fixMissing:!!e.fixMissing,activeKey:e.activeKey,json:!!(e.json||r?.json)},n)})})}export{ie as registerStatusHealthSessionsCommands};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-CNxR59P3.js";import{J as t,U as n,Z as r}from"./subsystem-C7tbdlOl.js";import{i}from"./entry.js";import{r as a}from"./helpers-COz1ghcB.js";async function o(e,t){let r=t.at(-1),i=(r?.parent??e).rawArgs,o=a(r),s=r?.name()?[r.name(),...o]:o,c=n({programName:e.name(),rawArgs:i,fallbackArgv:s});await e.parseAsync(c)}function s(e,t){let n=e.commands,r=n.indexOf(t);return r<0?!1:(n.splice(r,1),!0)}function c(e,t){let n=e.commands.find(e=>e.name()===t);return n?s(e,n):!1}var l=e({getSubCliCommandsWithSubcommands:()=>h,getSubCliEntries:()=>m,loadValidatedConfigForPluginRegistration:()=>f,registerSubCliByName:()=>g,registerSubCliCommands:()=>v});const u=e=>!(i(process.env.OPENCLAW_DISABLE_LAZY_SUBCOMMANDS)||r(e)),d=e=>i(process.env.OPENCLAW_DISABLE_LAZY_SUBCOMMANDS),f=async()=>{let e=await import(`./auth-profiles-BkhVHtgY.js`).then(e=>e.So);return(await e.readConfigFileSnapshot()).valid?e.loadConfig():null},p=[{name:`acp`,description:`Agent Control Protocol tools`,hasSubcommands:!0,register:async e=>{(await import(`./acp-cli-CvtdpmTG.js`)).registerAcpCli(e)}},{name:`gateway`,description:`Run, inspect, and query the WebSocket Gateway`,hasSubcommands:!0,register:async e=>{(await import(`./gateway-cli-
|
|
1
|
+
import{t as e}from"./rolldown-runtime-CNxR59P3.js";import{J as t,U as n,Z as r}from"./subsystem-C7tbdlOl.js";import{i}from"./entry.js";import{r as a}from"./helpers-COz1ghcB.js";async function o(e,t){let r=t.at(-1),i=(r?.parent??e).rawArgs,o=a(r),s=r?.name()?[r.name(),...o]:o,c=n({programName:e.name(),rawArgs:i,fallbackArgv:s});await e.parseAsync(c)}function s(e,t){let n=e.commands,r=n.indexOf(t);return r<0?!1:(n.splice(r,1),!0)}function c(e,t){let n=e.commands.find(e=>e.name()===t);return n?s(e,n):!1}var l=e({getSubCliCommandsWithSubcommands:()=>h,getSubCliEntries:()=>m,loadValidatedConfigForPluginRegistration:()=>f,registerSubCliByName:()=>g,registerSubCliCommands:()=>v});const u=e=>!(i(process.env.OPENCLAW_DISABLE_LAZY_SUBCOMMANDS)||r(e)),d=e=>i(process.env.OPENCLAW_DISABLE_LAZY_SUBCOMMANDS),f=async()=>{let e=await import(`./auth-profiles-BkhVHtgY.js`).then(e=>e.So);return(await e.readConfigFileSnapshot()).valid?e.loadConfig():null},p=[{name:`acp`,description:`Agent Control Protocol tools`,hasSubcommands:!0,register:async e=>{(await import(`./acp-cli-CvtdpmTG.js`)).registerAcpCli(e)}},{name:`gateway`,description:`Run, inspect, and query the WebSocket Gateway`,hasSubcommands:!0,register:async e=>{(await import(`./gateway-cli-BKWQlBHk.js`)).registerGatewayCli(e)}},{name:`daemon`,description:`Gateway service (legacy alias)`,hasSubcommands:!0,register:async e=>{(await import(`./daemon-cli-Bq_Aq2h1.js`).then(e=>e.t)).registerDaemonCli(e)}},{name:`logs`,description:`Tail gateway file logs via RPC`,hasSubcommands:!1,register:async e=>{(await import(`./logs-cli-DOKwBBsg.js`)).registerLogsCli(e)}},{name:`system`,description:`System events, heartbeat, and presence`,hasSubcommands:!0,register:async e=>{(await import(`./system-cli-Dhdyd59o.js`)).registerSystemCli(e)}},{name:`models`,description:`Discover, scan, and configure models`,hasSubcommands:!0,register:async e=>{(await import(`./models-cli-B53yy1mw.js`)).registerModelsCli(e)}},{name:`approvals`,description:`Manage exec approvals (gateway or node host)`,hasSubcommands:!0,register:async e=>{(await import(`./exec-approvals-cli-Ch9y720V.js`)).registerExecApprovalsCli(e)}},{name:`nodes`,description:`Manage gateway-owned node pairing and node commands`,hasSubcommands:!0,register:async e=>{(await import(`./nodes-cli-BHfcpCaK.js`)).registerNodesCli(e)}},{name:`devices`,description:`Device pairing + token management`,hasSubcommands:!0,register:async e=>{(await import(`./devices-cli-CR0RBwW6.js`)).registerDevicesCli(e)}},{name:`node`,description:`Run and manage the headless node host service`,hasSubcommands:!0,register:async e=>{(await import(`./node-cli-BdQrCHKj.js`)).registerNodeCli(e)}},{name:`sandbox`,description:`Manage sandbox containers for agent isolation`,hasSubcommands:!0,register:async e=>{(await import(`./sandbox-cli-CNuP4mAO.js`)).registerSandboxCli(e)}},{name:`tui`,description:`Open a terminal UI connected to the Gateway`,hasSubcommands:!1,register:async e=>{(await import(`./tui-cli-NHVHBOlZ.js`)).registerTuiCli(e)}},{name:`cron`,description:`Manage cron jobs via the Gateway scheduler`,hasSubcommands:!0,register:async e=>{(await import(`./cron-cli-q7Bs2cuy.js`)).registerCronCli(e)}},{name:`dns`,description:`DNS helpers for wide-area discovery (Tailscale + CoreDNS)`,hasSubcommands:!0,register:async e=>{(await import(`./dns-cli-Cn4xpCHQ.js`)).registerDnsCli(e)}},{name:`docs`,description:`Search the live OpenClaw docs`,hasSubcommands:!1,register:async e=>{(await import(`./docs-cli-CgbkdL7Q.js`)).registerDocsCli(e)}},{name:`hooks`,description:`Manage internal agent hooks`,hasSubcommands:!0,register:async e=>{(await import(`./hooks-cli-B2j44Nvk.js`)).registerHooksCli(e)}},{name:`webhooks`,description:`Webhook helpers and integrations`,hasSubcommands:!0,register:async e=>{(await import(`./webhooks-cli-B15yNW3Y.js`)).registerWebhooksCli(e)}},{name:`qr`,description:`Generate iOS pairing QR/setup code`,hasSubcommands:!1,register:async e=>{(await import(`./qr-cli-5y_tXKmN.js`)).registerQrCli(e)}},{name:`clawbot`,description:`Legacy clawbot command aliases`,hasSubcommands:!0,register:async e=>{(await import(`./clawbot-cli-CGVKi-JC.js`)).registerClawbotCli(e)}},{name:`pairing`,description:`Secure DM pairing (approve inbound requests)`,hasSubcommands:!0,register:async e=>{let{registerPluginCliCommands:t}=await import(`./cli-BWE7sLVx.js`),n=await f();n&&t(e,n),(await import(`./pairing-cli-BW4ZYATC.js`)).registerPairingCli(e)}},{name:`plugins`,description:`Manage OpenClaw plugins and extensions`,hasSubcommands:!0,register:async e=>{(await import(`./plugins-cli-ULYhpcRr.js`)).registerPluginsCli(e);let{registerPluginCliCommands:t}=await import(`./cli-BWE7sLVx.js`),n=await f();n&&t(e,n)}},{name:`channels`,description:`Manage connected chat channels (Telegram, Discord, etc.)`,hasSubcommands:!0,register:async e=>{(await import(`./channels-cli-DHD8V6-q.js`)).registerChannelsCli(e)}},{name:`directory`,description:`Lookup contact and group IDs (self, peers, groups) for supported chat channels`,hasSubcommands:!0,register:async e=>{(await import(`./directory-cli-D-7M0Nii.js`)).registerDirectoryCli(e)}},{name:`security`,description:`Security tools and local config audits`,hasSubcommands:!0,register:async e=>{(await import(`./security-cli-BVgJKt0G.js`)).registerSecurityCli(e)}},{name:`secrets`,description:`Secrets runtime reload controls`,hasSubcommands:!0,register:async e=>{(await import(`./secrets-cli-DzUjrczB.js`)).registerSecretsCli(e)}},{name:`skills`,description:`List and inspect available skills`,hasSubcommands:!0,register:async e=>{(await import(`./skills-cli-BduM8dqO.js`)).registerSkillsCli(e)}},{name:`update`,description:`Update OpenClaw and inspect update channel status`,hasSubcommands:!0,register:async e=>{(await import(`./update-cli-T5qjfgGh.js`)).registerUpdateCli(e)}},{name:`completion`,description:`Generate shell completion script`,hasSubcommands:!1,register:async e=>{(await import(`./completion-cli-F60ntV7X.js`).then(e=>e.n)).registerCompletionCli(e)}}];function m(){return p}function h(){return p.filter(e=>e.hasSubcommands).map(e=>e.name)}async function g(e,t){let n=p.find(e=>e.name===t);return n?(c(e,n.name),await n.register(e),!0):!1}function _(e,t){let n=e.command(t.name).description(t.description);n.allowUnknownOption(!0),n.allowExcessArguments(!0),n.action(async(...r)=>{s(e,n),await t.register(e),await o(e,r)})}function v(e,n=process.argv){if(d(n)){for(let t of p)t.register(e);return}let r=t(n);if(r&&u(n)){let t=p.find(e=>e.name===r);if(t){_(e,t);return}}for(let t of p)_(e,t)}export{l as a,v as i,m as n,c as o,g as r,o as s,h as t};
|