import{A as e,p as t,v as n}from"./subsystem-kTFXkQM5.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import"./auth-profiles-qXC1L8hs.js";import"./agent-scope-BKE4M04k.js";import"./utils-7Gdj77QB.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-R4odAlsj.js";import"./version-q3SkUw2K.js";import"./registry-Div2nEwi.js";import"./skills-Df0CxTMH.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-CCU8jDti.js";import"./logger-C1GUBMt-.js";import"./exec-CiwCrGw3.js";import"./windows-spawn-Dw4dpTt2.js";import"./redact-bVcVj47r.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-DNQO70y-.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./call-De18doTr.js";import{t as r}from"./links-pHmQCzdF.js";import"./progress-Cy6zNuIC.js";import{n as i,t as a}from"./gateway-rpc-DXAU2juh.js";const o=e=>{let t=typeof e==`string`?e.trim():``;if(!t)return`next-heartbeat`;if(t===`now`||t===`next-heartbeat`)return t;throw Error(`--mode must be now or next-heartbeat`)};async function s(e,r,i){try{let n=await r();e.json||i===void 0?t.log(JSON.stringify(n,null,2)):t.log(i)}catch(e){t.error(n(String(e))),t.exit(1)}}function c(t){let n=t.command(`system`).description(`System tools (events, heartbeat, presence)`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${r(`/cli/system`,`docs.openclaw.ai/cli/system`)}\n`);a(n.command(`event`).description(`Enqueue a system event and optionally trigger a heartbeat`).requiredOption(`--text <text>`,`System event text`).option(`--mode <mode>`,`Wake mode (now|next-heartbeat)`,`next-heartbeat`).option(`--json`,`Output JSON`,!1)).action(async e=>{await s(e,async()=>{let t=typeof e.text==`string`?e.text.trim():``;if(!t)throw Error(`--text is required`);return await i(`wake`,e,{mode:o(e.mode),text:t},{expectFinal:!1})},`ok`)});let c=n.command(`heartbeat`).description(`Heartbeat controls`);a(c.command(`last`).description(`Show the last heartbeat event`).option(`--json`,`Output JSON`,!1)).action(async e=>{await s(e,async()=>await i(`last-heartbeat`,e,void 0,{expectFinal:!1}))}),a(c.command(`enable`).description(`Enable heartbeats`).option(`--json`,`Output JSON`,!1)).action(async e=>{await s(e,async()=>await i(`set-heartbeats`,e,{enabled:!0},{expectFinal:!1}))}),a(c.command(`disable`).description(`Disable heartbeats`).option(`--json`,`Output JSON`,!1)).action(async e=>{await s(e,async()=>await i(`set-heartbeats`,e,{enabled:!1},{expectFinal:!1}))}),a(n.command(`presence`).description(`List system presence entries`).option(`--json`,`Output JSON`,!1)).action(async e=>{await s(e,async()=>await i(`system-presence`,e,void 0,{expectFinal:!1}))})}export{c as registerSystemCli};
