@qqbrowser/openclaw-qbot 0.0.143 → 0.0.145

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.
Files changed (33) hide show
  1. package/dist/build-info.json +3 -3
  2. package/dist/canvas-host/a2ui/.bundle.hash +1 -1
  3. package/dist/{command-registry-CPthpEk3.js → command-registry-CSBvrqwW.js} +2 -2
  4. package/dist/{completion-cli-DeGEpJri.js → completion-cli-Bizog38J.js} +2 -2
  5. package/dist/{completion-cli-C4_SZmjl.js → completion-cli-W1_FoDFF.js} +2 -2
  6. package/dist/{doctor-completion-Bad_h3hm.js → doctor-completion-Da0cocZX.js} +2 -2
  7. package/dist/{doctor-completion-APZJ17BJ.js → doctor-completion-DpCWb88H.js} +2 -2
  8. package/dist/entry.js +1 -1
  9. package/dist/{gateway-cli-CbJj0QhL.js → gateway-cli-C4YOlz3m.js} +5 -5
  10. package/dist/{gateway-cli-tXsBFRlk.js → gateway-cli-D78GfbjG.js} +5 -5
  11. package/dist/index.js +1 -1
  12. package/dist/{onboard-7i9A1nNd.js → onboard-2iF3lTUI.js} +2 -2
  13. package/dist/{onboard-DSaXIS5U.js → onboard-B9ouFJC7.js} +2 -2
  14. package/dist/{onboarding-RZTEMxl0.js → onboarding-BTBbx6Ka.js} +2 -2
  15. package/dist/{onboarding-BRewu6jg.js → onboarding-TkoOoq9D.js} +2 -2
  16. package/dist/{onboarding.finalize-Bp8ST2z_.js → onboarding.finalize-C9QGFQpa.js} +2 -2
  17. package/dist/{onboarding.finalize-Bi53z1zE.js → onboarding.finalize-CwjLMPKK.js} +2 -2
  18. package/dist/{program-D9AMAbv6.js → program-CCS3CIqA.js} +2 -2
  19. package/dist/{program-context-BX9wN65q.js → program-context-lyPXjPfN.js} +2 -2
  20. package/dist/{prompt-select-styled-hxyoyq2i.js → prompt-select-styled-DmTwJKOO.js} +2 -2
  21. package/dist/{prompt-select-styled-C2c13Ndq.js → prompt-select-styled-Z30OVmpM.js} +2 -2
  22. package/dist/{register.maintenance-BkM8-Ttt.js → register.maintenance-COWBeetm.js} +2 -2
  23. package/dist/{register.maintenance-AeTvVTtt.js → register.maintenance-vhmmqtIi.js} +2 -2
  24. package/dist/{register.onboard-C-j99DGw.js → register.onboard-CJZKG0PP.js} +2 -2
  25. package/dist/{register.onboard-BY-QLNp9.js → register.onboard-CaFl_mB1.js} +2 -2
  26. package/dist/{register.setup-DA4HFCro.js → register.setup-CSW03BKj.js} +2 -2
  27. package/dist/{register.setup-DiAi_1pJ.js → register.setup-DDkBFyvF.js} +2 -2
  28. package/dist/{register.subclis-smZuHVcv.js → register.subclis-B_0ZS-_K.js} +2 -2
  29. package/dist/{run-main-DEZR4lCo.js → run-main-CV49c7uu.js} +2 -2
  30. package/dist/{update-cli-ISorpxrU.js → update-cli--P65ciut.js} +2 -2
  31. package/dist/{update-cli-C0qadZEs.js → update-cli-Ibrshx_w.js} +2 -2
  32. package/package.json +1 -1
  33. package/preset-config.json +1 -1
@@ -1,2 +1,2 @@
1
- import{A as e,p as t}from"./subsystem-BLbY429l.js";import{g as n,i as r,m as i,o as a,u as o}from"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Ai as s,Fo as c,Ki as l,jo as u}from"./auth-profiles-T8DuH3ax.js";import{t as d}from"./command-format-CLxIPuLR.js";import"./agent-scope-DAWJwFfl.js";import{g as f}from"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-CW81y5Wz.js";import"./send-DavpkzhH.js";import"./compact-BEeB6bwq.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-_htt7eY5.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-BHuhHfkH.js";import"./diagnostic-DQq4Bwrs.js";import"./send-DkiKKUkt.js";import"./pi-model-discovery-CpjYoBQf.js";import"./exec-approvals-allowlist-D8mN7nxV.js";import"./exec-safe-bin-runtime-policy-dcCS_Adf.js";import"./model-catalog-COVzoZD9.js";import"./fetch-CQaNr5J1.js";import"./audio-transcription-runner-Bd1OZC6K.js";import"./fetch-guard-BrTtJw7h.js";import"./image-BkWwI54C.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-D0QU-kQ9.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-D8Hh84ab.js";import"./render-DrrPmnMI.js";import"./target-errors-CgWAJOam.js";import"./commands-Dy7duWlt.js";import"./commands-registry-Cpl4QnG4.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-8acNlxwP.js";import"./sqlite-CILF3z9U.js";import"./call-B8Fb4_oh.js";import"./pi-tools.policy-D40r0HmD.js";import"./pairing-store-BH-FTYkn.js";import"./fetch-Dh-apy46.js";import"./skill-commands-CSF6wVPU.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-DAR7V7FJ.js";import"./channel-activity-BBrgoad1.js";import"./tables-Brc2lNcB.js";import"./kill-tree-B3g7HrAO.js";import"./runtime-web-tools-D8fms06-.js";import"./runtime-Dlg2-Omq.js";import"./node-shell-DyOfwHrh.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BBeE1TmB.js";import"./plugin-auto-enable-NzmNh4oU.js";import"./send-CVplsJpw.js";import"./outbound-attachment-BgAe99RM.js";import"./delivery-queue-nkPJu0fY.js";import"./send-C48Y9SAq.js";import"./system-run-command-BKfMiqQM.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BlN-J_fA.js";import"./connection-auth-B_Uk6Vk8.js";import{f as p,g as m,i as h,o as g}from"./onboard-helpers-PGl5bVPE.js";import{n as _,r as v,t as y}from"./prompt-style-BThRSQJR.js";import"./pairing-labels-D-kzQEL2.js";import"./search-manager-Bp9x20r6.js";import"./manager-C2YW7Hkq.js";import"./memory-cli-XaxtBQm1.js";import{t as b}from"./links-CBnmRP9D.js";import{n as x}from"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import"./skills-status-DswSl5aD.js";import{t as S}from"./clipboard-Bk8cviBt.js";import"./note-Dp-d_utk.js";import"./issue-format-C_lNzrKa.js";import"./channels-status-issues-8eFrGKyf.js";import"./completion-cli-C4_SZmjl.js";import"./register.subclis-smZuHVcv.js";import"./command-registry-CPthpEk3.js";import"./program-context-CH9p6anW.js";import"./daemon-install-plan.shared-Dx3DBXCG.js";import"./runtime-guard-DX2Ie4ri.js";import"./gateway-install-token-BCnuZeh1.js";import"./systemd-DbevZh65.js";import{n as C}from"./service-DZ9EbS15.js";import"./systemd-hints-lXpMy-kY.js";import"./diagnostics-Cdctg9K_.js";import"./health-DBu0V1Y-.js";import"./control-ui-assets-CTHGGgaX.js";import"./channel-account-context-DAcarnqW.js";import"./update-runner-CvWH2ZAc.js";import"./logging-tYw1NbJd.js";import"./oauth-tls-preflight-BSBRDIfC.js";import"./doctor-config-flow-D4F3mz4h.js";import{a as w,i as T,o as E,r as D,t as O}from"./cleanup-utils-BWm70DoD.js";import"./systemd-linger-cWKbFNpu.js";import"./health-format-B1nj3Wfn.js";import{n as k,t as A}from"./prompt-select-styled-C2c13Ndq.js";import"./doctor-completion-APZJ17BJ.js";import j from"node:path";import{cancel as M,confirm as N,isCancel as P,multiselect as F}from"@clack/prompts";async function I(e,t=process.env){let n=await s({config:e,env:t,value:e.gateway?.auth?.token,path:`gateway.auth.token`,readFallback:()=>l(t)});return{token:n.value,source:n.source===`config`?`config`:n.source===`secretRef`?`secretRef`:n.source===`fallback`?`env`:void 0,unresolvedRefReason:n.unresolvedRefReason,tokenSecretRefConfigured:n.secretRefConfigured}}async function L(e=t,n={}){let r=await c(),i=r.valid?r.config:{},a=o(i),s=i.gateway?.bind??`loopback`,l=i.gateway?.controlUi?.basePath,u=i.gateway?.customBindHost,d=await I(i,process.env),f=d.token??``,_=m({port:a,bind:s===`lan`?`loopback`:s,customBindHost:u,basePath:l}),v=f.length>0&&!d.tokenSecretRefConfigured,y=v?`${_.httpUrl}#token=${encodeURIComponent(f)}`:_.httpUrl;e.log(`Dashboard URL: ${y}`),d.tokenSecretRefConfigured&&f&&e.log(`Token auto-auth is disabled for SecretRef-managed gateway.auth.token; use your external token source if prompted.`),d.unresolvedRefReason&&(e.log(`Token auto-auth unavailable: ${d.unresolvedRefReason}`),e.log("Set OPENCLAW_GATEWAY_TOKEN in this shell or resolve your secret provider, then rerun `openclaw dashboard`."));let b=await S(y).catch(()=>!1);e.log(b?`Copied to clipboard.`:`Copy to clipboard unavailable.`);let x=!1,C;n.noOpen?C=`Browser launch disabled (--no-open). Use the URL above.`:((await h()).ok&&(x=await p(y)),x||(C=g({port:a,basePath:l,token:v&&f||void 0}))),x?e.log(`Opened in your browser. Keep that tab to control OpenClaw.`):C&&e.log(C)}function R(){let e=u(),t=n(),r=a(),o=i();return{cfg:e,stateDir:t,configPath:r,oauthDir:o,...O({cfg:e,stateDir:t,configPath:r,oauthDir:o})}}async function z(e){if(r)return;let t=C(),n=!1;try{n=await t.isLoaded({env:process.env})}catch(t){e.error(`Gateway service check failed: ${String(t)}`);return}if(n)try{await t.stop({env:process.env,stdout:process.stdout})}catch(t){e.error(`Gateway stop failed: ${String(t)}`)}}function B(e){e.log(`Recommended first: ${d(`openclaw backup create`)}`)}async function V(e,t){let n=!t.nonInteractive;if(!n&&!t.yes){e.error(`Non-interactive mode requires --yes.`),e.exit(1);return}let r=t.scope;if(!r){if(!n){e.error(`Non-interactive mode requires --scope.`),e.exit(1);return}let t=await A({message:`Reset scope`,options:[{value:`config`,label:`Config only`,hint:`openclaw.json`},{value:`config+creds+sessions`,label:`Config + credentials + sessions`,hint:`keeps workspace + auth profiles`},{value:`full`,label:`Full reset`,hint:`state dir + workspace`}],initialValue:`config+creds+sessions`});if(P(t)){M(v(`Reset cancelled.`)??`Reset cancelled.`),e.exit(0);return}r=t}if(![`config`,`config+creds+sessions`,`full`].includes(r)){e.error(`Invalid --scope. Expected "config", "config+creds+sessions", or "full".`),e.exit(1);return}if(n&&!t.yes){let t=await N({message:_(`Proceed with ${r} reset?`)});if(P(t)||!t){M(v(`Reset cancelled.`)??`Reset cancelled.`),e.exit(0);return}}let i=!!t.dryRun,{stateDir:a,configPath:o,oauthDir:s,configInsideState:c,oauthInsideState:l,workspaceDirs:u}=R();if(r!==`config`&&(B(e),i?e.log(`[dry-run] stop gateway service`):await z(e)),r===`config`){await T(o,e,{dryRun:i,label:o});return}if(r===`config+creds+sessions`){await T(o,e,{dryRun:i,label:o}),await T(s,e,{dryRun:i,label:s});let t=await D(a);for(let n of t)await T(n,e,{dryRun:i,label:n});e.log(`Next: ${d(`openclaw onboard --install-daemon`)}`);return}if(r===`full`){await w({stateDir:a,configPath:o,oauthDir:s,configInsideState:c,oauthInsideState:l},e,{dryRun:i}),await E(u,e,{dryRun:i}),e.log(`Next: ${d(`openclaw onboard --install-daemon`)}`);return}}const H=e=>F({...e,message:_(e.message),options:e.options.map(e=>e.hint===void 0?e:{...e,hint:y(e.hint)})});function U(e){let t=!!(e.all||e.service||e.state||e.workspace||e.app),n=new Set;return(e.all||e.service)&&n.add(`service`),(e.all||e.state)&&n.add(`state`),(e.all||e.workspace)&&n.add(`workspace`),(e.all||e.app)&&n.add(`app`),{scopes:n,hadExplicit:t}}async function W(e){if(r)return e.error(`Nix mode detected; service uninstall is disabled.`),!1;let t=C(),n=!1;try{n=await t.isLoaded({env:process.env})}catch(t){return e.error(`Gateway service check failed: ${String(t)}`),!1}if(!n)return e.log(`Gateway service ${t.notLoadedText}.`),!0;try{await t.stop({env:process.env,stdout:process.stdout})}catch(t){e.error(`Gateway stop failed: ${String(t)}`)}try{return await t.uninstall({env:process.env,stdout:process.stdout}),!0}catch(t){return e.error(`Gateway uninstall failed: ${String(t)}`),!1}}async function G(e,t){process.platform===`darwin`&&await T(`/Applications/OpenClaw.app`,e,{dryRun:t,label:`/Applications/OpenClaw.app`})}function K(e){e.log(`Recommended first: ${d(`openclaw backup create`)}`)}async function q(e,t){let{scopes:n,hadExplicit:r}=U(t),i=!t.nonInteractive;if(!i&&!t.yes){e.error(`Non-interactive mode requires --yes.`),e.exit(1);return}if(!r){if(!i){e.error(`Non-interactive mode requires explicit scopes (use --all).`),e.exit(1);return}let t=await H({message:`Uninstall which components?`,options:[{value:`service`,label:`Gateway service`,hint:`launchd / systemd / schtasks`},{value:`state`,label:`State + config`,hint:`~/.qbotclaw`},{value:`workspace`,label:`Workspace`,hint:`agent files`},{value:`app`,label:`macOS app`,hint:`/Applications/OpenClaw.app`}],initialValues:[`service`,`state`,`workspace`]});if(P(t)){M(v(`Uninstall cancelled.`)??`Uninstall cancelled.`),e.exit(0);return}for(let e of t)n.add(e)}if(n.size===0){e.log(`Nothing selected.`);return}if(i&&!t.yes){let t=await N({message:_(`Proceed with uninstall?`)});if(P(t)||!t){M(v(`Uninstall cancelled.`)??`Uninstall cancelled.`),e.exit(0);return}}let a=!!t.dryRun,{stateDir:o,configPath:s,oauthDir:c,configInsideState:l,oauthInsideState:u,workspaceDirs:d}=R();if((n.has(`state`)||n.has(`workspace`))&&K(e),n.has(`service`)&&(a?e.log(`[dry-run] remove gateway service`):await W(e)),n.has(`state`)&&await w({stateDir:o,configPath:s,oauthDir:c,configInsideState:l,oauthInsideState:u},e,{dryRun:a}),n.has(`workspace`)&&await E(d,e,{dryRun:a}),n.has(`app`)&&await G(e,a),e.log(`CLI still installed. Remove via npm/pnpm if desired.`),n.has(`state`)&&!n.has(`workspace`)){let t=f();t&&d.some(e=>e.startsWith(j.resolve(t)))&&e.log(`Tip: workspaces were preserved. Re-run with --workspace to remove them.`)}}function J(n){n.command(`doctor`).description(`Health checks + quick fixes for the gateway and channels`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${b(`/cli/doctor`,`docs.openclaw.ai/cli/doctor`)}\n`).option(`--no-workspace-suggestions`,`Disable workspace memory system suggestions`,!1).option(`--yes`,`Accept defaults without prompting`,!1).option(`--repair`,`Apply recommended repairs without prompting`,!1).option(`--fix`,`Apply recommended repairs (alias for --repair)`,!1).option(`--force`,`Apply aggressive repairs (overwrites custom service config)`,!1).option(`--non-interactive`,`Run without prompts (safe migrations only)`,!1).option(`--generate-gateway-token`,`Generate and configure a gateway token`,!1).option(`--deep`,`Scan system services for extra gateway installs`,!1).action(async e=>{await x(t,async()=>{await k(t,{workspaceSuggestions:e.workspaceSuggestions,yes:!!e.yes,repair:!!e.repair||!!e.fix,force:!!e.force,nonInteractive:!!e.nonInteractive,generateGatewayToken:!!e.generateGatewayToken,deep:!!e.deep}),t.exit(0)})}),n.command(`dashboard`).description(`Open the Control UI with your current token`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${b(`/cli/dashboard`,`docs.openclaw.ai/cli/dashboard`)}\n`).option(`--no-open`,`Print URL but do not launch a browser`).action(async e=>{await x(t,async()=>{await L(t,{noOpen:e.open===!1})})}),n.command(`reset`).description(`Reset local config/state (keeps the CLI installed)`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${b(`/cli/reset`,`docs.openclaw.ai/cli/reset`)}\n`).option(`--scope <scope>`,`config|config+creds+sessions|full (default: interactive prompt)`).option(`--yes`,`Skip confirmation prompts`,!1).option(`--non-interactive`,`Disable prompts (requires --scope + --yes)`,!1).option(`--dry-run`,`Print actions without removing files`,!1).action(async e=>{await x(t,async()=>{await V(t,{scope:e.scope,yes:!!e.yes,nonInteractive:!!e.nonInteractive,dryRun:!!e.dryRun})})}),n.command(`uninstall`).description(`Uninstall the gateway service + local data (CLI remains)`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${b(`/cli/uninstall`,`docs.openclaw.ai/cli/uninstall`)}\n`).option(`--service`,`Remove the gateway service`,!1).option(`--state`,`Remove state + config`,!1).option(`--workspace`,`Remove workspace dirs`,!1).option(`--app`,`Remove the macOS app`,!1).option(`--all`,`Remove service + state + workspace + app`,!1).option(`--yes`,`Skip confirmation prompts`,!1).option(`--non-interactive`,`Disable prompts (requires --yes)`,!1).option(`--dry-run`,`Print actions without removing files`,!1).action(async e=>{await x(t,async()=>{await q(t,{service:!!e.service,state:!!e.state,workspace:!!e.workspace,app:!!e.app,all:!!e.all,yes:!!e.yes,nonInteractive:!!e.nonInteractive,dryRun:!!e.dryRun})})})}export{J as registerMaintenanceCommands};
2
- //# sourceMappingURL=register.maintenance-BkM8-Ttt.js.map
1
+ import{A as e,p as t}from"./subsystem-BLbY429l.js";import{g as n,i as r,m as i,o as a,u as o}from"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Ai as s,Fo as c,Ki as l,jo as u}from"./auth-profiles-T8DuH3ax.js";import{t as d}from"./command-format-CLxIPuLR.js";import"./agent-scope-DAWJwFfl.js";import{g as f}from"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-CW81y5Wz.js";import"./send-DavpkzhH.js";import"./compact-BEeB6bwq.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-_htt7eY5.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-BHuhHfkH.js";import"./diagnostic-DQq4Bwrs.js";import"./send-DkiKKUkt.js";import"./pi-model-discovery-CpjYoBQf.js";import"./exec-approvals-allowlist-D8mN7nxV.js";import"./exec-safe-bin-runtime-policy-dcCS_Adf.js";import"./model-catalog-COVzoZD9.js";import"./fetch-CQaNr5J1.js";import"./audio-transcription-runner-Bd1OZC6K.js";import"./fetch-guard-BrTtJw7h.js";import"./image-BkWwI54C.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-D0QU-kQ9.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-D8Hh84ab.js";import"./render-DrrPmnMI.js";import"./target-errors-CgWAJOam.js";import"./commands-Dy7duWlt.js";import"./commands-registry-Cpl4QnG4.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-8acNlxwP.js";import"./sqlite-CILF3z9U.js";import"./call-B8Fb4_oh.js";import"./pi-tools.policy-D40r0HmD.js";import"./pairing-store-BH-FTYkn.js";import"./fetch-Dh-apy46.js";import"./skill-commands-CSF6wVPU.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-DAR7V7FJ.js";import"./channel-activity-BBrgoad1.js";import"./tables-Brc2lNcB.js";import"./kill-tree-B3g7HrAO.js";import"./runtime-web-tools-D8fms06-.js";import"./runtime-Dlg2-Omq.js";import"./node-shell-DyOfwHrh.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BBeE1TmB.js";import"./plugin-auto-enable-NzmNh4oU.js";import"./send-CVplsJpw.js";import"./outbound-attachment-BgAe99RM.js";import"./delivery-queue-nkPJu0fY.js";import"./send-C48Y9SAq.js";import"./system-run-command-BKfMiqQM.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BlN-J_fA.js";import"./connection-auth-B_Uk6Vk8.js";import{f as p,g as m,i as h,o as g}from"./onboard-helpers-PGl5bVPE.js";import{n as _,r as v,t as y}from"./prompt-style-BThRSQJR.js";import"./pairing-labels-D-kzQEL2.js";import"./search-manager-Bp9x20r6.js";import"./manager-C2YW7Hkq.js";import"./memory-cli-XaxtBQm1.js";import{t as b}from"./links-CBnmRP9D.js";import{n as x}from"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import"./skills-status-DswSl5aD.js";import{t as S}from"./clipboard-Bk8cviBt.js";import"./note-Dp-d_utk.js";import"./issue-format-C_lNzrKa.js";import"./channels-status-issues-8eFrGKyf.js";import"./completion-cli-W1_FoDFF.js";import"./register.subclis-B_0ZS-_K.js";import"./command-registry-CSBvrqwW.js";import"./program-context-CH9p6anW.js";import"./daemon-install-plan.shared-Dx3DBXCG.js";import"./runtime-guard-DX2Ie4ri.js";import"./gateway-install-token-BCnuZeh1.js";import"./systemd-DbevZh65.js";import{n as C}from"./service-DZ9EbS15.js";import"./systemd-hints-lXpMy-kY.js";import"./diagnostics-Cdctg9K_.js";import"./health-DBu0V1Y-.js";import"./control-ui-assets-CTHGGgaX.js";import"./channel-account-context-DAcarnqW.js";import"./update-runner-CvWH2ZAc.js";import"./logging-tYw1NbJd.js";import"./oauth-tls-preflight-BSBRDIfC.js";import"./doctor-config-flow-D4F3mz4h.js";import{a as w,i as T,o as E,r as D,t as O}from"./cleanup-utils-BWm70DoD.js";import"./systemd-linger-cWKbFNpu.js";import"./health-format-B1nj3Wfn.js";import{n as k,t as A}from"./prompt-select-styled-Z30OVmpM.js";import"./doctor-completion-DpCWb88H.js";import j from"node:path";import{cancel as M,confirm as N,isCancel as P,multiselect as F}from"@clack/prompts";async function I(e,t=process.env){let n=await s({config:e,env:t,value:e.gateway?.auth?.token,path:`gateway.auth.token`,readFallback:()=>l(t)});return{token:n.value,source:n.source===`config`?`config`:n.source===`secretRef`?`secretRef`:n.source===`fallback`?`env`:void 0,unresolvedRefReason:n.unresolvedRefReason,tokenSecretRefConfigured:n.secretRefConfigured}}async function L(e=t,n={}){let r=await c(),i=r.valid?r.config:{},a=o(i),s=i.gateway?.bind??`loopback`,l=i.gateway?.controlUi?.basePath,u=i.gateway?.customBindHost,d=await I(i,process.env),f=d.token??``,_=m({port:a,bind:s===`lan`?`loopback`:s,customBindHost:u,basePath:l}),v=f.length>0&&!d.tokenSecretRefConfigured,y=v?`${_.httpUrl}#token=${encodeURIComponent(f)}`:_.httpUrl;e.log(`Dashboard URL: ${y}`),d.tokenSecretRefConfigured&&f&&e.log(`Token auto-auth is disabled for SecretRef-managed gateway.auth.token; use your external token source if prompted.`),d.unresolvedRefReason&&(e.log(`Token auto-auth unavailable: ${d.unresolvedRefReason}`),e.log("Set OPENCLAW_GATEWAY_TOKEN in this shell or resolve your secret provider, then rerun `openclaw dashboard`."));let b=await S(y).catch(()=>!1);e.log(b?`Copied to clipboard.`:`Copy to clipboard unavailable.`);let x=!1,C;n.noOpen?C=`Browser launch disabled (--no-open). Use the URL above.`:((await h()).ok&&(x=await p(y)),x||(C=g({port:a,basePath:l,token:v&&f||void 0}))),x?e.log(`Opened in your browser. Keep that tab to control OpenClaw.`):C&&e.log(C)}function R(){let e=u(),t=n(),r=a(),o=i();return{cfg:e,stateDir:t,configPath:r,oauthDir:o,...O({cfg:e,stateDir:t,configPath:r,oauthDir:o})}}async function z(e){if(r)return;let t=C(),n=!1;try{n=await t.isLoaded({env:process.env})}catch(t){e.error(`Gateway service check failed: ${String(t)}`);return}if(n)try{await t.stop({env:process.env,stdout:process.stdout})}catch(t){e.error(`Gateway stop failed: ${String(t)}`)}}function B(e){e.log(`Recommended first: ${d(`openclaw backup create`)}`)}async function V(e,t){let n=!t.nonInteractive;if(!n&&!t.yes){e.error(`Non-interactive mode requires --yes.`),e.exit(1);return}let r=t.scope;if(!r){if(!n){e.error(`Non-interactive mode requires --scope.`),e.exit(1);return}let t=await A({message:`Reset scope`,options:[{value:`config`,label:`Config only`,hint:`openclaw.json`},{value:`config+creds+sessions`,label:`Config + credentials + sessions`,hint:`keeps workspace + auth profiles`},{value:`full`,label:`Full reset`,hint:`state dir + workspace`}],initialValue:`config+creds+sessions`});if(P(t)){M(v(`Reset cancelled.`)??`Reset cancelled.`),e.exit(0);return}r=t}if(![`config`,`config+creds+sessions`,`full`].includes(r)){e.error(`Invalid --scope. Expected "config", "config+creds+sessions", or "full".`),e.exit(1);return}if(n&&!t.yes){let t=await N({message:_(`Proceed with ${r} reset?`)});if(P(t)||!t){M(v(`Reset cancelled.`)??`Reset cancelled.`),e.exit(0);return}}let i=!!t.dryRun,{stateDir:a,configPath:o,oauthDir:s,configInsideState:c,oauthInsideState:l,workspaceDirs:u}=R();if(r!==`config`&&(B(e),i?e.log(`[dry-run] stop gateway service`):await z(e)),r===`config`){await T(o,e,{dryRun:i,label:o});return}if(r===`config+creds+sessions`){await T(o,e,{dryRun:i,label:o}),await T(s,e,{dryRun:i,label:s});let t=await D(a);for(let n of t)await T(n,e,{dryRun:i,label:n});e.log(`Next: ${d(`openclaw onboard --install-daemon`)}`);return}if(r===`full`){await w({stateDir:a,configPath:o,oauthDir:s,configInsideState:c,oauthInsideState:l},e,{dryRun:i}),await E(u,e,{dryRun:i}),e.log(`Next: ${d(`openclaw onboard --install-daemon`)}`);return}}const H=e=>F({...e,message:_(e.message),options:e.options.map(e=>e.hint===void 0?e:{...e,hint:y(e.hint)})});function U(e){let t=!!(e.all||e.service||e.state||e.workspace||e.app),n=new Set;return(e.all||e.service)&&n.add(`service`),(e.all||e.state)&&n.add(`state`),(e.all||e.workspace)&&n.add(`workspace`),(e.all||e.app)&&n.add(`app`),{scopes:n,hadExplicit:t}}async function W(e){if(r)return e.error(`Nix mode detected; service uninstall is disabled.`),!1;let t=C(),n=!1;try{n=await t.isLoaded({env:process.env})}catch(t){return e.error(`Gateway service check failed: ${String(t)}`),!1}if(!n)return e.log(`Gateway service ${t.notLoadedText}.`),!0;try{await t.stop({env:process.env,stdout:process.stdout})}catch(t){e.error(`Gateway stop failed: ${String(t)}`)}try{return await t.uninstall({env:process.env,stdout:process.stdout}),!0}catch(t){return e.error(`Gateway uninstall failed: ${String(t)}`),!1}}async function G(e,t){process.platform===`darwin`&&await T(`/Applications/OpenClaw.app`,e,{dryRun:t,label:`/Applications/OpenClaw.app`})}function K(e){e.log(`Recommended first: ${d(`openclaw backup create`)}`)}async function q(e,t){let{scopes:n,hadExplicit:r}=U(t),i=!t.nonInteractive;if(!i&&!t.yes){e.error(`Non-interactive mode requires --yes.`),e.exit(1);return}if(!r){if(!i){e.error(`Non-interactive mode requires explicit scopes (use --all).`),e.exit(1);return}let t=await H({message:`Uninstall which components?`,options:[{value:`service`,label:`Gateway service`,hint:`launchd / systemd / schtasks`},{value:`state`,label:`State + config`,hint:`~/.qbotclaw`},{value:`workspace`,label:`Workspace`,hint:`agent files`},{value:`app`,label:`macOS app`,hint:`/Applications/OpenClaw.app`}],initialValues:[`service`,`state`,`workspace`]});if(P(t)){M(v(`Uninstall cancelled.`)??`Uninstall cancelled.`),e.exit(0);return}for(let e of t)n.add(e)}if(n.size===0){e.log(`Nothing selected.`);return}if(i&&!t.yes){let t=await N({message:_(`Proceed with uninstall?`)});if(P(t)||!t){M(v(`Uninstall cancelled.`)??`Uninstall cancelled.`),e.exit(0);return}}let a=!!t.dryRun,{stateDir:o,configPath:s,oauthDir:c,configInsideState:l,oauthInsideState:u,workspaceDirs:d}=R();if((n.has(`state`)||n.has(`workspace`))&&K(e),n.has(`service`)&&(a?e.log(`[dry-run] remove gateway service`):await W(e)),n.has(`state`)&&await w({stateDir:o,configPath:s,oauthDir:c,configInsideState:l,oauthInsideState:u},e,{dryRun:a}),n.has(`workspace`)&&await E(d,e,{dryRun:a}),n.has(`app`)&&await G(e,a),e.log(`CLI still installed. Remove via npm/pnpm if desired.`),n.has(`state`)&&!n.has(`workspace`)){let t=f();t&&d.some(e=>e.startsWith(j.resolve(t)))&&e.log(`Tip: workspaces were preserved. Re-run with --workspace to remove them.`)}}function J(n){n.command(`doctor`).description(`Health checks + quick fixes for the gateway and channels`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${b(`/cli/doctor`,`docs.openclaw.ai/cli/doctor`)}\n`).option(`--no-workspace-suggestions`,`Disable workspace memory system suggestions`,!1).option(`--yes`,`Accept defaults without prompting`,!1).option(`--repair`,`Apply recommended repairs without prompting`,!1).option(`--fix`,`Apply recommended repairs (alias for --repair)`,!1).option(`--force`,`Apply aggressive repairs (overwrites custom service config)`,!1).option(`--non-interactive`,`Run without prompts (safe migrations only)`,!1).option(`--generate-gateway-token`,`Generate and configure a gateway token`,!1).option(`--deep`,`Scan system services for extra gateway installs`,!1).action(async e=>{await x(t,async()=>{await k(t,{workspaceSuggestions:e.workspaceSuggestions,yes:!!e.yes,repair:!!e.repair||!!e.fix,force:!!e.force,nonInteractive:!!e.nonInteractive,generateGatewayToken:!!e.generateGatewayToken,deep:!!e.deep}),t.exit(0)})}),n.command(`dashboard`).description(`Open the Control UI with your current token`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${b(`/cli/dashboard`,`docs.openclaw.ai/cli/dashboard`)}\n`).option(`--no-open`,`Print URL but do not launch a browser`).action(async e=>{await x(t,async()=>{await L(t,{noOpen:e.open===!1})})}),n.command(`reset`).description(`Reset local config/state (keeps the CLI installed)`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${b(`/cli/reset`,`docs.openclaw.ai/cli/reset`)}\n`).option(`--scope <scope>`,`config|config+creds+sessions|full (default: interactive prompt)`).option(`--yes`,`Skip confirmation prompts`,!1).option(`--non-interactive`,`Disable prompts (requires --scope + --yes)`,!1).option(`--dry-run`,`Print actions without removing files`,!1).action(async e=>{await x(t,async()=>{await V(t,{scope:e.scope,yes:!!e.yes,nonInteractive:!!e.nonInteractive,dryRun:!!e.dryRun})})}),n.command(`uninstall`).description(`Uninstall the gateway service + local data (CLI remains)`).addHelpText(`after`,()=>`\n${e.muted(`Docs:`)} ${b(`/cli/uninstall`,`docs.openclaw.ai/cli/uninstall`)}\n`).option(`--service`,`Remove the gateway service`,!1).option(`--state`,`Remove state + config`,!1).option(`--workspace`,`Remove workspace dirs`,!1).option(`--app`,`Remove the macOS app`,!1).option(`--all`,`Remove service + state + workspace + app`,!1).option(`--yes`,`Skip confirmation prompts`,!1).option(`--non-interactive`,`Disable prompts (requires --yes)`,!1).option(`--dry-run`,`Print actions without removing files`,!1).action(async e=>{await x(t,async()=>{await q(t,{service:!!e.service,state:!!e.state,workspace:!!e.workspace,app:!!e.app,all:!!e.all,yes:!!e.yes,nonInteractive:!!e.nonInteractive,dryRun:!!e.dryRun})})})}export{J as registerMaintenanceCommands};
2
+ //# sourceMappingURL=register.maintenance-COWBeetm.js.map
@@ -1,2 +1,2 @@
1
- import{g as e,i as t,m as n,o as r,u as i}from"./paths-B4IRk3wi.js";import{A as a,p as o}from"./subsystem-C5XF2Fy5.js";import{_ as s}from"./utils-UGOV_184.js";import{Ga as c,Zs as l,qs as u,so as d}from"./model-selection-BlC_rXAN.js";import"./reply-CjyZeZ-j.js";import"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import{t as f}from"./command-format-BbDT1tlm.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-DHbOKEGc.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-Cgd_VJHR.js";import"./send-hZFDcGLM.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-D4Bp6MM7.js";import"./image-DsoO5VP5.js";import"./models-config-CdMhNxKV.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-DPdY0NXR.js";import"./api-key-rotation-BRt-vnRV.js";import"./local-roots-6waH0SZ0.js";import"./model-catalog-C1kpjR75.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-ClBkV2eD.js";import"./commands-CGpM84iR.js";import"./commands-registry-B1x54ukc.js";import"./pairing-store-Cg2UxreQ.js";import"./fetch-Dikjvc5M.js";import"./call-CqoMqP5b.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-DOzHPnht.js";import"./send-B7sHR38c2.js";import"./pi-model-discovery-Dps1PPWz.js";import"./exec-approvals-allowlist-CE3nYh0K.js";import"./exec-safe-bin-runtime-policy-Dt0GchLp.js";import"./ir-Dk7OQ4bA.js";import"./render-D8OWO2hT.js";import"./target-errors-a35Md15n.js";import"./read-only-account-inspect-DBwAwB3_.js";import"./channel-selection-CbNtbAEf.js";import"./plugin-auto-enable-DpVL6-ES.js";import"./send-C-AP01PR.js";import"./outbound-attachment-B7wMxwj6.js";import"./delivery-queue-CKbauSFq.js";import"./send-DbeEC2a3.js";import"./channel-activity-YjYNzCpJ.js";import"./tables-Oieq7UbT.js";import"./fetch-Bn0mWg6a.js";import"./skill-commands-HJHHZqt6.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-BjYBuREl.js";import"./restart-CHXEHdSC.js";import"./runtime-web-tools-bz76ZaRc.js";import"./command-secret-targets-BVN3kiT9.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-C8iru0UB.js";import{f as p,g as m,i as h,o as g}from"./onboard-helpers-zwybUJWu.js";import{n as _,r as v,t as y}from"./prompt-style-CXKekIBY.js";import"./pairing-labels-BUU_-70B.js";import"./memory-cli-jhzJ3as7.js";import"./query-expansion-0OxEb1Io.js";import"./manager-M1GKhLUC.js";import{t as b}from"./links-CySwdMcF.js";import{n as x}from"./cli-utils-BY7dLMFy.js";import"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-DECgxo6A.js";import"./system-run-command-DEWnZE0r.js";import"./runtime-BC5Ep2pJ.js";import"./stagger-DmFYysrJ.js";import"./runtime-guard-DFYBaYZS.js";import"./program-context-BX9wN65q.js";import"./skills-status-BWIugRCz.js";import{t as S}from"./clipboard-CKT_VIkG.js";import"./note-D4GAwgha.js";import"./issue-format-BT7cQEt3.js";import"./channels-status-issues-PRgOT90w.js";import"./completion-cli-DeGEpJri.js";import"./daemon-install-plan.shared-CfA37Ut_.js";import"./gateway-install-token-DiDvDPJQ.js";import"./systemd-D7odsu4K.js";import{n as C}from"./service-BtB9epJk.js";import"./systemd-hints-C0DKDl35.js";import"./diagnostics-BgbeL9KE.js";import"./health-RQzDNQwf.js";import"./control-ui-assets-BIa0GGDg.js";import"./channel-account-context-BMPAMZEv.js";import"./update-runner-mMbwEOlU.js";import"./logging-Dqe9dxSX.js";import"./oauth-tls-preflight-ByNjbUR5.js";import"./doctor-config-flow-DnOyVZhQ.js";import{a as w,i as T,o as E,r as D,t as O}from"./cleanup-utils-D-RhEX6F.js";import"./systemd-linger-C2MJD6KG.js";import"./health-format-VBr6LEpt.js";import{n as k,t as A}from"./prompt-select-styled-hxyoyq2i.js";import"./doctor-completion-Bad_h3hm.js";import j from"node:path";import{cancel as M,confirm as N,isCancel as P,multiselect as F}from"@clack/prompts";async function I(e,t=process.env){let n=await c({config:e,env:t,value:e.gateway?.auth?.token,path:`gateway.auth.token`,readFallback:()=>d(t)});return{token:n.value,source:n.source===`config`?`config`:n.source===`secretRef`?`secretRef`:n.source===`fallback`?`env`:void 0,unresolvedRefReason:n.unresolvedRefReason,tokenSecretRefConfigured:n.secretRefConfigured}}async function L(e=o,t={}){let n=await l(),r=n.valid?n.config:{},a=i(r),s=r.gateway?.bind??`loopback`,c=r.gateway?.controlUi?.basePath,u=r.gateway?.customBindHost,d=await I(r,process.env),f=d.token??``,_=m({port:a,bind:s===`lan`?`loopback`:s,customBindHost:u,basePath:c}),v=f.length>0&&!d.tokenSecretRefConfigured,y=v?`${_.httpUrl}#token=${encodeURIComponent(f)}`:_.httpUrl;e.log(`Dashboard URL: ${y}`),d.tokenSecretRefConfigured&&f&&e.log(`Token auto-auth is disabled for SecretRef-managed gateway.auth.token; use your external token source if prompted.`),d.unresolvedRefReason&&(e.log(`Token auto-auth unavailable: ${d.unresolvedRefReason}`),e.log("Set OPENCLAW_GATEWAY_TOKEN in this shell or resolve your secret provider, then rerun `openclaw dashboard`."));let b=await S(y).catch(()=>!1);e.log(b?`Copied to clipboard.`:`Copy to clipboard unavailable.`);let x=!1,C;t.noOpen?C=`Browser launch disabled (--no-open). Use the URL above.`:((await h()).ok&&(x=await p(y)),x||(C=g({port:a,basePath:c,token:v&&f||void 0}))),x?e.log(`Opened in your browser. Keep that tab to control OpenClaw.`):C&&e.log(C)}function R(){let t=u(),i=e(),a=r(),o=n();return{cfg:t,stateDir:i,configPath:a,oauthDir:o,...O({cfg:t,stateDir:i,configPath:a,oauthDir:o})}}async function z(e){if(t)return;let n=C(),r=!1;try{r=await n.isLoaded({env:process.env})}catch(t){e.error(`Gateway service check failed: ${String(t)}`);return}if(r)try{await n.stop({env:process.env,stdout:process.stdout})}catch(t){e.error(`Gateway stop failed: ${String(t)}`)}}function B(e){e.log(`Recommended first: ${f(`openclaw backup create`)}`)}async function V(e,t){let n=!t.nonInteractive;if(!n&&!t.yes){e.error(`Non-interactive mode requires --yes.`),e.exit(1);return}let r=t.scope;if(!r){if(!n){e.error(`Non-interactive mode requires --scope.`),e.exit(1);return}let t=await A({message:`Reset scope`,options:[{value:`config`,label:`Config only`,hint:`openclaw.json`},{value:`config+creds+sessions`,label:`Config + credentials + sessions`,hint:`keeps workspace + auth profiles`},{value:`full`,label:`Full reset`,hint:`state dir + workspace`}],initialValue:`config+creds+sessions`});if(P(t)){M(v(`Reset cancelled.`)??`Reset cancelled.`),e.exit(0);return}r=t}if(![`config`,`config+creds+sessions`,`full`].includes(r)){e.error(`Invalid --scope. Expected "config", "config+creds+sessions", or "full".`),e.exit(1);return}if(n&&!t.yes){let t=await N({message:_(`Proceed with ${r} reset?`)});if(P(t)||!t){M(v(`Reset cancelled.`)??`Reset cancelled.`),e.exit(0);return}}let i=!!t.dryRun,{stateDir:a,configPath:o,oauthDir:s,configInsideState:c,oauthInsideState:l,workspaceDirs:u}=R();if(r!==`config`&&(B(e),i?e.log(`[dry-run] stop gateway service`):await z(e)),r===`config`){await T(o,e,{dryRun:i,label:o});return}if(r===`config+creds+sessions`){await T(o,e,{dryRun:i,label:o}),await T(s,e,{dryRun:i,label:s});let t=await D(a);for(let n of t)await T(n,e,{dryRun:i,label:n});e.log(`Next: ${f(`openclaw onboard --install-daemon`)}`);return}if(r===`full`){await w({stateDir:a,configPath:o,oauthDir:s,configInsideState:c,oauthInsideState:l},e,{dryRun:i}),await E(u,e,{dryRun:i}),e.log(`Next: ${f(`openclaw onboard --install-daemon`)}`);return}}const H=e=>F({...e,message:_(e.message),options:e.options.map(e=>e.hint===void 0?e:{...e,hint:y(e.hint)})});function U(e){let t=!!(e.all||e.service||e.state||e.workspace||e.app),n=new Set;return(e.all||e.service)&&n.add(`service`),(e.all||e.state)&&n.add(`state`),(e.all||e.workspace)&&n.add(`workspace`),(e.all||e.app)&&n.add(`app`),{scopes:n,hadExplicit:t}}async function W(e){if(t)return e.error(`Nix mode detected; service uninstall is disabled.`),!1;let n=C(),r=!1;try{r=await n.isLoaded({env:process.env})}catch(t){return e.error(`Gateway service check failed: ${String(t)}`),!1}if(!r)return e.log(`Gateway service ${n.notLoadedText}.`),!0;try{await n.stop({env:process.env,stdout:process.stdout})}catch(t){e.error(`Gateway stop failed: ${String(t)}`)}try{return await n.uninstall({env:process.env,stdout:process.stdout}),!0}catch(t){return e.error(`Gateway uninstall failed: ${String(t)}`),!1}}async function G(e,t){process.platform===`darwin`&&await T(`/Applications/OpenClaw.app`,e,{dryRun:t,label:`/Applications/OpenClaw.app`})}function K(e){e.log(`Recommended first: ${f(`openclaw backup create`)}`)}async function q(e,t){let{scopes:n,hadExplicit:r}=U(t),i=!t.nonInteractive;if(!i&&!t.yes){e.error(`Non-interactive mode requires --yes.`),e.exit(1);return}if(!r){if(!i){e.error(`Non-interactive mode requires explicit scopes (use --all).`),e.exit(1);return}let t=await H({message:`Uninstall which components?`,options:[{value:`service`,label:`Gateway service`,hint:`launchd / systemd / schtasks`},{value:`state`,label:`State + config`,hint:`~/.qbotclaw`},{value:`workspace`,label:`Workspace`,hint:`agent files`},{value:`app`,label:`macOS app`,hint:`/Applications/OpenClaw.app`}],initialValues:[`service`,`state`,`workspace`]});if(P(t)){M(v(`Uninstall cancelled.`)??`Uninstall cancelled.`),e.exit(0);return}for(let e of t)n.add(e)}if(n.size===0){e.log(`Nothing selected.`);return}if(i&&!t.yes){let t=await N({message:_(`Proceed with uninstall?`)});if(P(t)||!t){M(v(`Uninstall cancelled.`)??`Uninstall cancelled.`),e.exit(0);return}}let a=!!t.dryRun,{stateDir:o,configPath:c,oauthDir:l,configInsideState:u,oauthInsideState:d,workspaceDirs:f}=R();if((n.has(`state`)||n.has(`workspace`))&&K(e),n.has(`service`)&&(a?e.log(`[dry-run] remove gateway service`):await W(e)),n.has(`state`)&&await w({stateDir:o,configPath:c,oauthDir:l,configInsideState:u,oauthInsideState:d},e,{dryRun:a}),n.has(`workspace`)&&await E(f,e,{dryRun:a}),n.has(`app`)&&await G(e,a),e.log(`CLI still installed. Remove via npm/pnpm if desired.`),n.has(`state`)&&!n.has(`workspace`)){let t=s();t&&f.some(e=>e.startsWith(j.resolve(t)))&&e.log(`Tip: workspaces were preserved. Re-run with --workspace to remove them.`)}}function J(e){e.command(`doctor`).description(`Health checks + quick fixes for the gateway and channels`).addHelpText(`after`,()=>`\n${a.muted(`Docs:`)} ${b(`/cli/doctor`,`docs.openclaw.ai/cli/doctor`)}\n`).option(`--no-workspace-suggestions`,`Disable workspace memory system suggestions`,!1).option(`--yes`,`Accept defaults without prompting`,!1).option(`--repair`,`Apply recommended repairs without prompting`,!1).option(`--fix`,`Apply recommended repairs (alias for --repair)`,!1).option(`--force`,`Apply aggressive repairs (overwrites custom service config)`,!1).option(`--non-interactive`,`Run without prompts (safe migrations only)`,!1).option(`--generate-gateway-token`,`Generate and configure a gateway token`,!1).option(`--deep`,`Scan system services for extra gateway installs`,!1).action(async e=>{await x(o,async()=>{await k(o,{workspaceSuggestions:e.workspaceSuggestions,yes:!!e.yes,repair:!!e.repair||!!e.fix,force:!!e.force,nonInteractive:!!e.nonInteractive,generateGatewayToken:!!e.generateGatewayToken,deep:!!e.deep}),o.exit(0)})}),e.command(`dashboard`).description(`Open the Control UI with your current token`).addHelpText(`after`,()=>`\n${a.muted(`Docs:`)} ${b(`/cli/dashboard`,`docs.openclaw.ai/cli/dashboard`)}\n`).option(`--no-open`,`Print URL but do not launch a browser`).action(async e=>{await x(o,async()=>{await L(o,{noOpen:e.open===!1})})}),e.command(`reset`).description(`Reset local config/state (keeps the CLI installed)`).addHelpText(`after`,()=>`\n${a.muted(`Docs:`)} ${b(`/cli/reset`,`docs.openclaw.ai/cli/reset`)}\n`).option(`--scope <scope>`,`config|config+creds+sessions|full (default: interactive prompt)`).option(`--yes`,`Skip confirmation prompts`,!1).option(`--non-interactive`,`Disable prompts (requires --scope + --yes)`,!1).option(`--dry-run`,`Print actions without removing files`,!1).action(async e=>{await x(o,async()=>{await V(o,{scope:e.scope,yes:!!e.yes,nonInteractive:!!e.nonInteractive,dryRun:!!e.dryRun})})}),e.command(`uninstall`).description(`Uninstall the gateway service + local data (CLI remains)`).addHelpText(`after`,()=>`\n${a.muted(`Docs:`)} ${b(`/cli/uninstall`,`docs.openclaw.ai/cli/uninstall`)}\n`).option(`--service`,`Remove the gateway service`,!1).option(`--state`,`Remove state + config`,!1).option(`--workspace`,`Remove workspace dirs`,!1).option(`--app`,`Remove the macOS app`,!1).option(`--all`,`Remove service + state + workspace + app`,!1).option(`--yes`,`Skip confirmation prompts`,!1).option(`--non-interactive`,`Disable prompts (requires --yes)`,!1).option(`--dry-run`,`Print actions without removing files`,!1).action(async e=>{await x(o,async()=>{await q(o,{service:!!e.service,state:!!e.state,workspace:!!e.workspace,app:!!e.app,all:!!e.all,yes:!!e.yes,nonInteractive:!!e.nonInteractive,dryRun:!!e.dryRun})})})}export{J as registerMaintenanceCommands};
2
- //# sourceMappingURL=register.maintenance-AeTvVTtt.js.map
1
+ import{g as e,i as t,m as n,o as r,u as i}from"./paths-B4IRk3wi.js";import{A as a,p as o}from"./subsystem-C5XF2Fy5.js";import{_ as s}from"./utils-UGOV_184.js";import{Ga as c,Zs as l,qs as u,so as d}from"./model-selection-BlC_rXAN.js";import"./reply-CjyZeZ-j.js";import"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import{t as f}from"./command-format-BbDT1tlm.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-DHbOKEGc.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-Cgd_VJHR.js";import"./send-hZFDcGLM.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-D4Bp6MM7.js";import"./image-DsoO5VP5.js";import"./models-config-CdMhNxKV.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-DPdY0NXR.js";import"./api-key-rotation-BRt-vnRV.js";import"./local-roots-6waH0SZ0.js";import"./model-catalog-C1kpjR75.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-ClBkV2eD.js";import"./commands-CGpM84iR.js";import"./commands-registry-B1x54ukc.js";import"./pairing-store-Cg2UxreQ.js";import"./fetch-Dikjvc5M.js";import"./call-CqoMqP5b.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-DOzHPnht.js";import"./send-B7sHR38c2.js";import"./pi-model-discovery-Dps1PPWz.js";import"./exec-approvals-allowlist-CE3nYh0K.js";import"./exec-safe-bin-runtime-policy-Dt0GchLp.js";import"./ir-Dk7OQ4bA.js";import"./render-D8OWO2hT.js";import"./target-errors-a35Md15n.js";import"./read-only-account-inspect-DBwAwB3_.js";import"./channel-selection-CbNtbAEf.js";import"./plugin-auto-enable-DpVL6-ES.js";import"./send-C-AP01PR.js";import"./outbound-attachment-B7wMxwj6.js";import"./delivery-queue-CKbauSFq.js";import"./send-DbeEC2a3.js";import"./channel-activity-YjYNzCpJ.js";import"./tables-Oieq7UbT.js";import"./fetch-Bn0mWg6a.js";import"./skill-commands-HJHHZqt6.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-BjYBuREl.js";import"./restart-CHXEHdSC.js";import"./runtime-web-tools-bz76ZaRc.js";import"./command-secret-targets-BVN3kiT9.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-C8iru0UB.js";import{f as p,g as m,i as h,o as g}from"./onboard-helpers-zwybUJWu.js";import{n as _,r as v,t as y}from"./prompt-style-CXKekIBY.js";import"./pairing-labels-BUU_-70B.js";import"./memory-cli-jhzJ3as7.js";import"./query-expansion-0OxEb1Io.js";import"./manager-M1GKhLUC.js";import{t as b}from"./links-CySwdMcF.js";import{n as x}from"./cli-utils-BY7dLMFy.js";import"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-DECgxo6A.js";import"./system-run-command-DEWnZE0r.js";import"./runtime-BC5Ep2pJ.js";import"./stagger-DmFYysrJ.js";import"./runtime-guard-DFYBaYZS.js";import"./program-context-lyPXjPfN.js";import"./skills-status-BWIugRCz.js";import{t as S}from"./clipboard-CKT_VIkG.js";import"./note-D4GAwgha.js";import"./issue-format-BT7cQEt3.js";import"./channels-status-issues-PRgOT90w.js";import"./completion-cli-Bizog38J.js";import"./daemon-install-plan.shared-CfA37Ut_.js";import"./gateway-install-token-DiDvDPJQ.js";import"./systemd-D7odsu4K.js";import{n as C}from"./service-BtB9epJk.js";import"./systemd-hints-C0DKDl35.js";import"./diagnostics-BgbeL9KE.js";import"./health-RQzDNQwf.js";import"./control-ui-assets-BIa0GGDg.js";import"./channel-account-context-BMPAMZEv.js";import"./update-runner-mMbwEOlU.js";import"./logging-Dqe9dxSX.js";import"./oauth-tls-preflight-ByNjbUR5.js";import"./doctor-config-flow-DnOyVZhQ.js";import{a as w,i as T,o as E,r as D,t as O}from"./cleanup-utils-D-RhEX6F.js";import"./systemd-linger-C2MJD6KG.js";import"./health-format-VBr6LEpt.js";import{n as k,t as A}from"./prompt-select-styled-DmTwJKOO.js";import"./doctor-completion-Da0cocZX.js";import j from"node:path";import{cancel as M,confirm as N,isCancel as P,multiselect as F}from"@clack/prompts";async function I(e,t=process.env){let n=await c({config:e,env:t,value:e.gateway?.auth?.token,path:`gateway.auth.token`,readFallback:()=>d(t)});return{token:n.value,source:n.source===`config`?`config`:n.source===`secretRef`?`secretRef`:n.source===`fallback`?`env`:void 0,unresolvedRefReason:n.unresolvedRefReason,tokenSecretRefConfigured:n.secretRefConfigured}}async function L(e=o,t={}){let n=await l(),r=n.valid?n.config:{},a=i(r),s=r.gateway?.bind??`loopback`,c=r.gateway?.controlUi?.basePath,u=r.gateway?.customBindHost,d=await I(r,process.env),f=d.token??``,_=m({port:a,bind:s===`lan`?`loopback`:s,customBindHost:u,basePath:c}),v=f.length>0&&!d.tokenSecretRefConfigured,y=v?`${_.httpUrl}#token=${encodeURIComponent(f)}`:_.httpUrl;e.log(`Dashboard URL: ${y}`),d.tokenSecretRefConfigured&&f&&e.log(`Token auto-auth is disabled for SecretRef-managed gateway.auth.token; use your external token source if prompted.`),d.unresolvedRefReason&&(e.log(`Token auto-auth unavailable: ${d.unresolvedRefReason}`),e.log("Set OPENCLAW_GATEWAY_TOKEN in this shell or resolve your secret provider, then rerun `openclaw dashboard`."));let b=await S(y).catch(()=>!1);e.log(b?`Copied to clipboard.`:`Copy to clipboard unavailable.`);let x=!1,C;t.noOpen?C=`Browser launch disabled (--no-open). Use the URL above.`:((await h()).ok&&(x=await p(y)),x||(C=g({port:a,basePath:c,token:v&&f||void 0}))),x?e.log(`Opened in your browser. Keep that tab to control OpenClaw.`):C&&e.log(C)}function R(){let t=u(),i=e(),a=r(),o=n();return{cfg:t,stateDir:i,configPath:a,oauthDir:o,...O({cfg:t,stateDir:i,configPath:a,oauthDir:o})}}async function z(e){if(t)return;let n=C(),r=!1;try{r=await n.isLoaded({env:process.env})}catch(t){e.error(`Gateway service check failed: ${String(t)}`);return}if(r)try{await n.stop({env:process.env,stdout:process.stdout})}catch(t){e.error(`Gateway stop failed: ${String(t)}`)}}function B(e){e.log(`Recommended first: ${f(`openclaw backup create`)}`)}async function V(e,t){let n=!t.nonInteractive;if(!n&&!t.yes){e.error(`Non-interactive mode requires --yes.`),e.exit(1);return}let r=t.scope;if(!r){if(!n){e.error(`Non-interactive mode requires --scope.`),e.exit(1);return}let t=await A({message:`Reset scope`,options:[{value:`config`,label:`Config only`,hint:`openclaw.json`},{value:`config+creds+sessions`,label:`Config + credentials + sessions`,hint:`keeps workspace + auth profiles`},{value:`full`,label:`Full reset`,hint:`state dir + workspace`}],initialValue:`config+creds+sessions`});if(P(t)){M(v(`Reset cancelled.`)??`Reset cancelled.`),e.exit(0);return}r=t}if(![`config`,`config+creds+sessions`,`full`].includes(r)){e.error(`Invalid --scope. Expected "config", "config+creds+sessions", or "full".`),e.exit(1);return}if(n&&!t.yes){let t=await N({message:_(`Proceed with ${r} reset?`)});if(P(t)||!t){M(v(`Reset cancelled.`)??`Reset cancelled.`),e.exit(0);return}}let i=!!t.dryRun,{stateDir:a,configPath:o,oauthDir:s,configInsideState:c,oauthInsideState:l,workspaceDirs:u}=R();if(r!==`config`&&(B(e),i?e.log(`[dry-run] stop gateway service`):await z(e)),r===`config`){await T(o,e,{dryRun:i,label:o});return}if(r===`config+creds+sessions`){await T(o,e,{dryRun:i,label:o}),await T(s,e,{dryRun:i,label:s});let t=await D(a);for(let n of t)await T(n,e,{dryRun:i,label:n});e.log(`Next: ${f(`openclaw onboard --install-daemon`)}`);return}if(r===`full`){await w({stateDir:a,configPath:o,oauthDir:s,configInsideState:c,oauthInsideState:l},e,{dryRun:i}),await E(u,e,{dryRun:i}),e.log(`Next: ${f(`openclaw onboard --install-daemon`)}`);return}}const H=e=>F({...e,message:_(e.message),options:e.options.map(e=>e.hint===void 0?e:{...e,hint:y(e.hint)})});function U(e){let t=!!(e.all||e.service||e.state||e.workspace||e.app),n=new Set;return(e.all||e.service)&&n.add(`service`),(e.all||e.state)&&n.add(`state`),(e.all||e.workspace)&&n.add(`workspace`),(e.all||e.app)&&n.add(`app`),{scopes:n,hadExplicit:t}}async function W(e){if(t)return e.error(`Nix mode detected; service uninstall is disabled.`),!1;let n=C(),r=!1;try{r=await n.isLoaded({env:process.env})}catch(t){return e.error(`Gateway service check failed: ${String(t)}`),!1}if(!r)return e.log(`Gateway service ${n.notLoadedText}.`),!0;try{await n.stop({env:process.env,stdout:process.stdout})}catch(t){e.error(`Gateway stop failed: ${String(t)}`)}try{return await n.uninstall({env:process.env,stdout:process.stdout}),!0}catch(t){return e.error(`Gateway uninstall failed: ${String(t)}`),!1}}async function G(e,t){process.platform===`darwin`&&await T(`/Applications/OpenClaw.app`,e,{dryRun:t,label:`/Applications/OpenClaw.app`})}function K(e){e.log(`Recommended first: ${f(`openclaw backup create`)}`)}async function q(e,t){let{scopes:n,hadExplicit:r}=U(t),i=!t.nonInteractive;if(!i&&!t.yes){e.error(`Non-interactive mode requires --yes.`),e.exit(1);return}if(!r){if(!i){e.error(`Non-interactive mode requires explicit scopes (use --all).`),e.exit(1);return}let t=await H({message:`Uninstall which components?`,options:[{value:`service`,label:`Gateway service`,hint:`launchd / systemd / schtasks`},{value:`state`,label:`State + config`,hint:`~/.qbotclaw`},{value:`workspace`,label:`Workspace`,hint:`agent files`},{value:`app`,label:`macOS app`,hint:`/Applications/OpenClaw.app`}],initialValues:[`service`,`state`,`workspace`]});if(P(t)){M(v(`Uninstall cancelled.`)??`Uninstall cancelled.`),e.exit(0);return}for(let e of t)n.add(e)}if(n.size===0){e.log(`Nothing selected.`);return}if(i&&!t.yes){let t=await N({message:_(`Proceed with uninstall?`)});if(P(t)||!t){M(v(`Uninstall cancelled.`)??`Uninstall cancelled.`),e.exit(0);return}}let a=!!t.dryRun,{stateDir:o,configPath:c,oauthDir:l,configInsideState:u,oauthInsideState:d,workspaceDirs:f}=R();if((n.has(`state`)||n.has(`workspace`))&&K(e),n.has(`service`)&&(a?e.log(`[dry-run] remove gateway service`):await W(e)),n.has(`state`)&&await w({stateDir:o,configPath:c,oauthDir:l,configInsideState:u,oauthInsideState:d},e,{dryRun:a}),n.has(`workspace`)&&await E(f,e,{dryRun:a}),n.has(`app`)&&await G(e,a),e.log(`CLI still installed. Remove via npm/pnpm if desired.`),n.has(`state`)&&!n.has(`workspace`)){let t=s();t&&f.some(e=>e.startsWith(j.resolve(t)))&&e.log(`Tip: workspaces were preserved. Re-run with --workspace to remove them.`)}}function J(e){e.command(`doctor`).description(`Health checks + quick fixes for the gateway and channels`).addHelpText(`after`,()=>`\n${a.muted(`Docs:`)} ${b(`/cli/doctor`,`docs.openclaw.ai/cli/doctor`)}\n`).option(`--no-workspace-suggestions`,`Disable workspace memory system suggestions`,!1).option(`--yes`,`Accept defaults without prompting`,!1).option(`--repair`,`Apply recommended repairs without prompting`,!1).option(`--fix`,`Apply recommended repairs (alias for --repair)`,!1).option(`--force`,`Apply aggressive repairs (overwrites custom service config)`,!1).option(`--non-interactive`,`Run without prompts (safe migrations only)`,!1).option(`--generate-gateway-token`,`Generate and configure a gateway token`,!1).option(`--deep`,`Scan system services for extra gateway installs`,!1).action(async e=>{await x(o,async()=>{await k(o,{workspaceSuggestions:e.workspaceSuggestions,yes:!!e.yes,repair:!!e.repair||!!e.fix,force:!!e.force,nonInteractive:!!e.nonInteractive,generateGatewayToken:!!e.generateGatewayToken,deep:!!e.deep}),o.exit(0)})}),e.command(`dashboard`).description(`Open the Control UI with your current token`).addHelpText(`after`,()=>`\n${a.muted(`Docs:`)} ${b(`/cli/dashboard`,`docs.openclaw.ai/cli/dashboard`)}\n`).option(`--no-open`,`Print URL but do not launch a browser`).action(async e=>{await x(o,async()=>{await L(o,{noOpen:e.open===!1})})}),e.command(`reset`).description(`Reset local config/state (keeps the CLI installed)`).addHelpText(`after`,()=>`\n${a.muted(`Docs:`)} ${b(`/cli/reset`,`docs.openclaw.ai/cli/reset`)}\n`).option(`--scope <scope>`,`config|config+creds+sessions|full (default: interactive prompt)`).option(`--yes`,`Skip confirmation prompts`,!1).option(`--non-interactive`,`Disable prompts (requires --scope + --yes)`,!1).option(`--dry-run`,`Print actions without removing files`,!1).action(async e=>{await x(o,async()=>{await V(o,{scope:e.scope,yes:!!e.yes,nonInteractive:!!e.nonInteractive,dryRun:!!e.dryRun})})}),e.command(`uninstall`).description(`Uninstall the gateway service + local data (CLI remains)`).addHelpText(`after`,()=>`\n${a.muted(`Docs:`)} ${b(`/cli/uninstall`,`docs.openclaw.ai/cli/uninstall`)}\n`).option(`--service`,`Remove the gateway service`,!1).option(`--state`,`Remove state + config`,!1).option(`--workspace`,`Remove workspace dirs`,!1).option(`--app`,`Remove the macOS app`,!1).option(`--all`,`Remove service + state + workspace + app`,!1).option(`--yes`,`Skip confirmation prompts`,!1).option(`--non-interactive`,`Disable prompts (requires --yes)`,!1).option(`--dry-run`,`Print actions without removing files`,!1).action(async e=>{await x(o,async()=>{await q(o,{service:!!e.service,state:!!e.state,workspace:!!e.workspace,app:!!e.app,all:!!e.all,yes:!!e.yes,nonInteractive:!!e.nonInteractive,dryRun:!!e.dryRun})})})}export{J as registerMaintenanceCommands};
2
+ //# sourceMappingURL=register.maintenance-vhmmqtIi.js.map
@@ -1,2 +1,2 @@
1
- import"./paths-B4IRk3wi.js";import{A as e,p as t}from"./subsystem-C5XF2Fy5.js";import"./utils-UGOV_184.js";import"./model-selection-BlC_rXAN.js";import"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-DHbOKEGc.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./call-CqoMqP5b.js";import"./onboard-helpers-zwybUJWu.js";import"./prompt-style-CXKekIBY.js";import{t as n}from"./links-CySwdMcF.js";import{n as r}from"./cli-utils-BY7dLMFy.js";import"./progress-LNttnI-y.js";import"./runtime-guard-DFYBaYZS.js";import"./note-D4GAwgha.js";import"./clack-prompter-Dq0aY6iM.js";import"./onboarding.secret-input-kO5OzYC7.js";import"./onboarding-RZTEMxl0.js";import"./logging-Dqe9dxSX.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-DSaXIS5U.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: ~/.qbotclaw/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};
2
- //# sourceMappingURL=register.onboard-C-j99DGw.js.map
1
+ import"./paths-B4IRk3wi.js";import{A as e,p as t}from"./subsystem-C5XF2Fy5.js";import"./utils-UGOV_184.js";import"./model-selection-BlC_rXAN.js";import"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-DHbOKEGc.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./call-CqoMqP5b.js";import"./onboard-helpers-zwybUJWu.js";import"./prompt-style-CXKekIBY.js";import{t as n}from"./links-CySwdMcF.js";import{n as r}from"./cli-utils-BY7dLMFy.js";import"./progress-LNttnI-y.js";import"./runtime-guard-DFYBaYZS.js";import"./note-D4GAwgha.js";import"./clack-prompter-Dq0aY6iM.js";import"./onboarding.secret-input-kO5OzYC7.js";import"./onboarding-BTBbx6Ka.js";import"./logging-Dqe9dxSX.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-B9ouFJC7.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: ~/.qbotclaw/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};
2
+ //# sourceMappingURL=register.onboard-CJZKG0PP.js.map
@@ -1,2 +1,2 @@
1
- import{A as e,p as t}from"./subsystem-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import"./auth-profiles-T8DuH3ax.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./call-B8Fb4_oh.js";import"./onboard-helpers-PGl5bVPE.js";import"./prompt-style-BThRSQJR.js";import{t as n}from"./links-CBnmRP9D.js";import{n as r}from"./cli-utils-BleB1eys.js";import"./progress-d1m2sqR1.js";import"./note-Dp-d_utk.js";import"./clack-prompter-DBPdGdqp.js";import"./runtime-guard-DX2Ie4ri.js";import"./onboarding.secret-input-BsBgh8Tc.js";import"./onboarding-BRewu6jg.js";import"./logging-tYw1NbJd.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-7i9A1nNd.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: ~/.qbotclaw/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};
2
- //# sourceMappingURL=register.onboard-BY-QLNp9.js.map
1
+ import{A as e,p as t}from"./subsystem-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import"./auth-profiles-T8DuH3ax.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./call-B8Fb4_oh.js";import"./onboard-helpers-PGl5bVPE.js";import"./prompt-style-BThRSQJR.js";import{t as n}from"./links-CBnmRP9D.js";import{n as r}from"./cli-utils-BleB1eys.js";import"./progress-d1m2sqR1.js";import"./note-Dp-d_utk.js";import"./clack-prompter-DBPdGdqp.js";import"./runtime-guard-DX2Ie4ri.js";import"./onboarding.secret-input-BsBgh8Tc.js";import"./onboarding-TkoOoq9D.js";import"./logging-tYw1NbJd.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-2iF3lTUI.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: ~/.qbotclaw/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};
2
+ //# sourceMappingURL=register.onboard-CaFl_mB1.js.map
@@ -1,2 +1,2 @@
1
- import"./paths-B4IRk3wi.js";import{A as e,p as t}from"./subsystem-C5XF2Fy5.js";import{S as n}from"./utils-UGOV_184.js";import{Ws as r,nc as i}from"./model-selection-BlC_rXAN.js";import{D as a,v as o}from"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-DHbOKEGc.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import{o as s}from"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./call-CqoMqP5b.js";import"./onboard-helpers-zwybUJWu.js";import"./prompt-style-CXKekIBY.js";import{t as c}from"./links-CySwdMcF.js";import{n as l}from"./cli-utils-BY7dLMFy.js";import"./progress-LNttnI-y.js";import"./runtime-guard-DFYBaYZS.js";import{t as u}from"./command-options-Bq5nQxz6.js";import"./note-D4GAwgha.js";import"./clack-prompter-Dq0aY6iM.js";import"./onboarding.secret-input-kO5OzYC7.js";import"./onboarding-RZTEMxl0.js";import{n as d,t as f}from"./logging-Dqe9dxSX.js";import{t as p}from"./onboard-DSaXIS5U.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 ~/.qbotclaw/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: ~/.qbotclaw/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};
2
- //# sourceMappingURL=register.setup-DA4HFCro.js.map
1
+ import"./paths-B4IRk3wi.js";import{A as e,p as t}from"./subsystem-C5XF2Fy5.js";import{S as n}from"./utils-UGOV_184.js";import{Ws as r,nc as i}from"./model-selection-BlC_rXAN.js";import{D as a,v as o}from"./agent-scope-DXZc3eNT.js";import"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-DHbOKEGc.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import{o as s}from"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./call-CqoMqP5b.js";import"./onboard-helpers-zwybUJWu.js";import"./prompt-style-CXKekIBY.js";import{t as c}from"./links-CySwdMcF.js";import{n as l}from"./cli-utils-BY7dLMFy.js";import"./progress-LNttnI-y.js";import"./runtime-guard-DFYBaYZS.js";import{t as u}from"./command-options-Bq5nQxz6.js";import"./note-D4GAwgha.js";import"./clack-prompter-Dq0aY6iM.js";import"./onboarding.secret-input-kO5OzYC7.js";import"./onboarding-BTBbx6Ka.js";import{n as d,t as f}from"./logging-Dqe9dxSX.js";import{t as p}from"./onboard-B9ouFJC7.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 ~/.qbotclaw/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: ~/.qbotclaw/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};
2
+ //# sourceMappingURL=register.setup-CSW03BKj.js.map
@@ -1,2 +1,2 @@
1
- import{A as e,p as t}from"./subsystem-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Bo as n,Oo as r}from"./auth-profiles-T8DuH3ax.js";import{D as i,v as a}from"./agent-scope-DAWJwFfl.js";import{x as o}from"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import{o as s}from"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./call-B8Fb4_oh.js";import"./onboard-helpers-PGl5bVPE.js";import"./prompt-style-BThRSQJR.js";import{t as c}from"./links-CBnmRP9D.js";import{n as l}from"./cli-utils-BleB1eys.js";import"./progress-d1m2sqR1.js";import{t as u}from"./command-options-BpOUDl2S.js";import"./note-Dp-d_utk.js";import"./clack-prompter-DBPdGdqp.js";import"./runtime-guard-DX2Ie4ri.js";import"./onboarding.secret-input-BsBgh8Tc.js";import"./onboarding-BRewu6jg.js";import{n as d,t as f}from"./logging-tYw1NbJd.js";import{t as p}from"./onboard-7i9A1nNd.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??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 n(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 ~/.qbotclaw/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: ~/.qbotclaw/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};
2
- //# sourceMappingURL=register.setup-DiAi_1pJ.js.map
1
+ import{A as e,p as t}from"./subsystem-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Bo as n,Oo as r}from"./auth-profiles-T8DuH3ax.js";import{D as i,v as a}from"./agent-scope-DAWJwFfl.js";import{x as o}from"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import{o as s}from"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./call-B8Fb4_oh.js";import"./onboard-helpers-PGl5bVPE.js";import"./prompt-style-BThRSQJR.js";import{t as c}from"./links-CBnmRP9D.js";import{n as l}from"./cli-utils-BleB1eys.js";import"./progress-d1m2sqR1.js";import{t as u}from"./command-options-BpOUDl2S.js";import"./note-Dp-d_utk.js";import"./clack-prompter-DBPdGdqp.js";import"./runtime-guard-DX2Ie4ri.js";import"./onboarding.secret-input-BsBgh8Tc.js";import"./onboarding-TkoOoq9D.js";import{n as d,t as f}from"./logging-tYw1NbJd.js";import{t as p}from"./onboard-2iF3lTUI.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??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 n(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 ~/.qbotclaw/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: ~/.qbotclaw/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};
2
+ //# sourceMappingURL=register.setup-DDkBFyvF.js.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"./rolldown-runtime-CNxR59P3.js";import{J as t,U as n,Z as r}from"./subsystem-BLbY429l.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-T8DuH3ax.js`).then(e=>e.wo);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-BaslDuk6.js`)).registerAcpCli(e)}},{name:`gateway`,description:`Run, inspect, and query the WebSocket Gateway`,hasSubcommands:!0,register:async e=>{(await import(`./gateway-cli-tXsBFRlk.js`)).registerGatewayCli(e)}},{name:`daemon`,description:`Gateway service (legacy alias)`,hasSubcommands:!0,register:async e=>{(await import(`./daemon-cli-BuXTzSnU.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-BA3Aso8a.js`)).registerLogsCli(e)}},{name:`system`,description:`System events, heartbeat, and presence`,hasSubcommands:!0,register:async e=>{(await import(`./system-cli-CeZfoVPN.js`)).registerSystemCli(e)}},{name:`models`,description:`Discover, scan, and configure models`,hasSubcommands:!0,register:async e=>{(await import(`./models-cli-BbcJ6A0F.js`)).registerModelsCli(e)}},{name:`approvals`,description:`Manage exec approvals (gateway or node host)`,hasSubcommands:!0,register:async e=>{(await import(`./exec-approvals-cli-CxUGD08t.js`)).registerExecApprovalsCli(e)}},{name:`nodes`,description:`Manage gateway-owned node pairing and node commands`,hasSubcommands:!0,register:async e=>{(await import(`./nodes-cli-8By8--bW.js`)).registerNodesCli(e)}},{name:`devices`,description:`Device pairing + token management`,hasSubcommands:!0,register:async e=>{(await import(`./devices-cli-Ckxd0k0I.js`)).registerDevicesCli(e)}},{name:`node`,description:`Run and manage the headless node host service`,hasSubcommands:!0,register:async e=>{(await import(`./node-cli-Br04Qmqo.js`)).registerNodeCli(e)}},{name:`sandbox`,description:`Manage sandbox containers for agent isolation`,hasSubcommands:!0,register:async e=>{(await import(`./sandbox-cli-BDorUBm-.js`)).registerSandboxCli(e)}},{name:`tui`,description:`Open a terminal UI connected to the Gateway`,hasSubcommands:!1,register:async e=>{(await import(`./tui-cli-Cq_eXDAV.js`)).registerTuiCli(e)}},{name:`cron`,description:`Manage cron jobs via the Gateway scheduler`,hasSubcommands:!0,register:async e=>{(await import(`./cron-cli-Dha16Lo-.js`)).registerCronCli(e)}},{name:`dns`,description:`DNS helpers for wide-area discovery (Tailscale + CoreDNS)`,hasSubcommands:!0,register:async e=>{(await import(`./dns-cli--4PwtR2Y.js`)).registerDnsCli(e)}},{name:`docs`,description:`Search the live OpenClaw docs`,hasSubcommands:!1,register:async e=>{(await import(`./docs-cli-Cdw9Iz9a.js`)).registerDocsCli(e)}},{name:`hooks`,description:`Manage internal agent hooks`,hasSubcommands:!0,register:async e=>{(await import(`./hooks-cli-xgORhqZ2.js`)).registerHooksCli(e)}},{name:`webhooks`,description:`Webhook helpers and integrations`,hasSubcommands:!0,register:async e=>{(await import(`./webhooks-cli-CIeyainW.js`)).registerWebhooksCli(e)}},{name:`qr`,description:`Generate iOS pairing QR/setup code`,hasSubcommands:!1,register:async e=>{(await import(`./qr-cli-3aG6CB6K.js`)).registerQrCli(e)}},{name:`clawbot`,description:`Legacy clawbot command aliases`,hasSubcommands:!0,register:async e=>{(await import(`./clawbot-cli-CgS7TkEx.js`)).registerClawbotCli(e)}},{name:`pairing`,description:`Secure DM pairing (approve inbound requests)`,hasSubcommands:!0,register:async e=>{let{registerPluginCliCommands:t}=await import(`./cli-CMLvfh6N.js`),n=await f();n&&t(e,n),(await import(`./pairing-cli-D2JEhufv.js`)).registerPairingCli(e)}},{name:`plugins`,description:`Manage OpenClaw plugins and extensions`,hasSubcommands:!0,register:async e=>{(await import(`./plugins-cli-o74CJV4A.js`)).registerPluginsCli(e);let{registerPluginCliCommands:t}=await import(`./cli-CMLvfh6N.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-BfzZrnkt.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-DDTaUkjW.js`)).registerDirectoryCli(e)}},{name:`security`,description:`Security tools and local config audits`,hasSubcommands:!0,register:async e=>{(await import(`./security-cli-DVOfhwAP.js`)).registerSecurityCli(e)}},{name:`secrets`,description:`Secrets runtime reload controls`,hasSubcommands:!0,register:async e=>{(await import(`./secrets-cli-Bo6PC32U.js`)).registerSecretsCli(e)}},{name:`skills`,description:`List and inspect available skills`,hasSubcommands:!0,register:async e=>{(await import(`./skills-cli-BY7OhJzj.js`)).registerSkillsCli(e)}},{name:`update`,description:`Update OpenClaw and inspect update channel status`,hasSubcommands:!0,register:async e=>{(await import(`./update-cli-ISorpxrU.js`)).registerUpdateCli(e)}},{name:`completion`,description:`Generate shell completion script`,hasSubcommands:!1,register:async e=>{(await import(`./completion-cli-C4_SZmjl.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};
2
- //# sourceMappingURL=register.subclis-smZuHVcv.js.map
1
+ import{t as e}from"./rolldown-runtime-CNxR59P3.js";import{J as t,U as n,Z as r}from"./subsystem-BLbY429l.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-T8DuH3ax.js`).then(e=>e.wo);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-BaslDuk6.js`)).registerAcpCli(e)}},{name:`gateway`,description:`Run, inspect, and query the WebSocket Gateway`,hasSubcommands:!0,register:async e=>{(await import(`./gateway-cli-D78GfbjG.js`)).registerGatewayCli(e)}},{name:`daemon`,description:`Gateway service (legacy alias)`,hasSubcommands:!0,register:async e=>{(await import(`./daemon-cli-BuXTzSnU.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-BA3Aso8a.js`)).registerLogsCli(e)}},{name:`system`,description:`System events, heartbeat, and presence`,hasSubcommands:!0,register:async e=>{(await import(`./system-cli-CeZfoVPN.js`)).registerSystemCli(e)}},{name:`models`,description:`Discover, scan, and configure models`,hasSubcommands:!0,register:async e=>{(await import(`./models-cli-BbcJ6A0F.js`)).registerModelsCli(e)}},{name:`approvals`,description:`Manage exec approvals (gateway or node host)`,hasSubcommands:!0,register:async e=>{(await import(`./exec-approvals-cli-CxUGD08t.js`)).registerExecApprovalsCli(e)}},{name:`nodes`,description:`Manage gateway-owned node pairing and node commands`,hasSubcommands:!0,register:async e=>{(await import(`./nodes-cli-8By8--bW.js`)).registerNodesCli(e)}},{name:`devices`,description:`Device pairing + token management`,hasSubcommands:!0,register:async e=>{(await import(`./devices-cli-Ckxd0k0I.js`)).registerDevicesCli(e)}},{name:`node`,description:`Run and manage the headless node host service`,hasSubcommands:!0,register:async e=>{(await import(`./node-cli-Br04Qmqo.js`)).registerNodeCli(e)}},{name:`sandbox`,description:`Manage sandbox containers for agent isolation`,hasSubcommands:!0,register:async e=>{(await import(`./sandbox-cli-BDorUBm-.js`)).registerSandboxCli(e)}},{name:`tui`,description:`Open a terminal UI connected to the Gateway`,hasSubcommands:!1,register:async e=>{(await import(`./tui-cli-Cq_eXDAV.js`)).registerTuiCli(e)}},{name:`cron`,description:`Manage cron jobs via the Gateway scheduler`,hasSubcommands:!0,register:async e=>{(await import(`./cron-cli-Dha16Lo-.js`)).registerCronCli(e)}},{name:`dns`,description:`DNS helpers for wide-area discovery (Tailscale + CoreDNS)`,hasSubcommands:!0,register:async e=>{(await import(`./dns-cli--4PwtR2Y.js`)).registerDnsCli(e)}},{name:`docs`,description:`Search the live OpenClaw docs`,hasSubcommands:!1,register:async e=>{(await import(`./docs-cli-Cdw9Iz9a.js`)).registerDocsCli(e)}},{name:`hooks`,description:`Manage internal agent hooks`,hasSubcommands:!0,register:async e=>{(await import(`./hooks-cli-xgORhqZ2.js`)).registerHooksCli(e)}},{name:`webhooks`,description:`Webhook helpers and integrations`,hasSubcommands:!0,register:async e=>{(await import(`./webhooks-cli-CIeyainW.js`)).registerWebhooksCli(e)}},{name:`qr`,description:`Generate iOS pairing QR/setup code`,hasSubcommands:!1,register:async e=>{(await import(`./qr-cli-3aG6CB6K.js`)).registerQrCli(e)}},{name:`clawbot`,description:`Legacy clawbot command aliases`,hasSubcommands:!0,register:async e=>{(await import(`./clawbot-cli-CgS7TkEx.js`)).registerClawbotCli(e)}},{name:`pairing`,description:`Secure DM pairing (approve inbound requests)`,hasSubcommands:!0,register:async e=>{let{registerPluginCliCommands:t}=await import(`./cli-CMLvfh6N.js`),n=await f();n&&t(e,n),(await import(`./pairing-cli-D2JEhufv.js`)).registerPairingCli(e)}},{name:`plugins`,description:`Manage OpenClaw plugins and extensions`,hasSubcommands:!0,register:async e=>{(await import(`./plugins-cli-o74CJV4A.js`)).registerPluginsCli(e);let{registerPluginCliCommands:t}=await import(`./cli-CMLvfh6N.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-BfzZrnkt.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-DDTaUkjW.js`)).registerDirectoryCli(e)}},{name:`security`,description:`Security tools and local config audits`,hasSubcommands:!0,register:async e=>{(await import(`./security-cli-DVOfhwAP.js`)).registerSecurityCli(e)}},{name:`secrets`,description:`Secrets runtime reload controls`,hasSubcommands:!0,register:async e=>{(await import(`./secrets-cli-Bo6PC32U.js`)).registerSecretsCli(e)}},{name:`skills`,description:`List and inspect available skills`,hasSubcommands:!0,register:async e=>{(await import(`./skills-cli-BY7OhJzj.js`)).registerSkillsCli(e)}},{name:`update`,description:`Update OpenClaw and inspect update channel status`,hasSubcommands:!0,register:async e=>{(await import(`./update-cli--P65ciut.js`)).registerUpdateCli(e)}},{name:`completion`,description:`Generate shell completion script`,hasSubcommands:!1,register:async e=>{(await import(`./completion-cli-W1_FoDFF.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};
2
+ //# sourceMappingURL=register.subclis-B_0ZS-_K.js.map
@@ -1,2 +1,2 @@
1
- import{G as e,J as t,K as n,W as r,X as i,Y as a,Z as o,p as s,q as c,r as l,rt as u}from"./subsystem-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{c as d,i as f,l as p,o as m,s as h}from"./entry.js";import{hc as g}from"./auth-profiles-T8DuH3ax.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import{t as _}from"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import{i as v}from"./errors-6SQWM9dj.js";import"./send-CW81y5Wz.js";import"./send-DavpkzhH.js";import"./compact-BEeB6bwq.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-_htt7eY5.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-BHuhHfkH.js";import"./diagnostic-DQq4Bwrs.js";import"./send-DkiKKUkt.js";import"./pi-model-discovery-CpjYoBQf.js";import"./exec-approvals-allowlist-D8mN7nxV.js";import"./exec-safe-bin-runtime-policy-dcCS_Adf.js";import"./model-catalog-COVzoZD9.js";import"./fetch-CQaNr5J1.js";import{_ as y}from"./audio-transcription-runner-Bd1OZC6K.js";import"./fetch-guard-BrTtJw7h.js";import"./image-BkWwI54C.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-D0QU-kQ9.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-D8Hh84ab.js";import"./render-DrrPmnMI.js";import"./target-errors-CgWAJOam.js";import"./commands-Dy7duWlt.js";import"./commands-registry-Cpl4QnG4.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-8acNlxwP.js";import"./sqlite-CILF3z9U.js";import"./call-B8Fb4_oh.js";import"./pi-tools.policy-D40r0HmD.js";import"./pairing-store-BH-FTYkn.js";import"./fetch-Dh-apy46.js";import"./skill-commands-CSF6wVPU.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-DAR7V7FJ.js";import"./channel-activity-BBrgoad1.js";import"./tables-Brc2lNcB.js";import"./kill-tree-B3g7HrAO.js";import"./runtime-web-tools-D8fms06-.js";import"./runtime-Dlg2-Omq.js";import"./node-shell-DyOfwHrh.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BBeE1TmB.js";import"./plugin-auto-enable-NzmNh4oU.js";import"./send-CVplsJpw.js";import"./outbound-attachment-BgAe99RM.js";import"./delivery-queue-nkPJu0fY.js";import"./send-C48Y9SAq.js";import"./system-run-command-BKfMiqQM.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BlN-J_fA.js";import"./connection-auth-B_Uk6Vk8.js";import"./onboard-helpers-PGl5bVPE.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-D-kzQEL2.js";import"./search-manager-Bp9x20r6.js";import"./manager-C2YW7Hkq.js";import"./memory-cli-XaxtBQm1.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import{t as b}from"./path-env-emdAQejM.js";import"./note-Dp-d_utk.js";import"./issue-format-C_lNzrKa.js";import{t as x}from"./plugin-registry-CYlBYbc8.js";import{t as S}from"./runtime-guard-DX2Ie4ri.js";import{t as C}from"./banner-xQa2kS6O.js";import"./doctor-config-flow-D4F3mz4h.js";import{n as w}from"./config-guard-BTNXbWoO.js";import T from"node:process";import"node:url";const E={match:e=>e[0]===`health`,loadPlugins:e=>!i(e,`--json`),run:async e=>{let t=i(e,`--json`),n=a(e,{includeDebug:!0}),r=c(e,`--timeout`);if(r===null)return!1;let{healthCommand:o}=await import(`./health-DBu0V1Y-.js`).then(e=>e.i);return await o({json:t,timeoutMs:r,verbose:n},s),!0}},D={match:e=>e[0]===`status`,loadPlugins:!0,run:async e=>{let t=i(e,`--json`),n=i(e,`--deep`),r=i(e,`--all`),o=i(e,`--usage`),l=a(e,{includeDebug:!0}),u=c(e,`--timeout`);if(u===null)return!1;let{statusCommand:d}=await import(`./status-BoL8-JxA.js`).then(e=>e.t);return await d({json:t,deep:n,all:r,usage:o,timeoutMs:u,verbose:l},s),!0}},O={match:e=>e[0]===`sessions`&&!e[1],run:async e=>{let t=i(e,`--json`),r=i(e,`--all-agents`),a=n(e,`--agent`);if(a===null)return!1;let o=n(e,`--store`);if(o===null)return!1;let c=n(e,`--active`);if(c===null)return!1;let{sessionsCommand:l}=await import(`./sessions-BsxT0V2m.js`);return await l({json:t,store:o,agent:a,allAgents:r,active:c},s),!0}},k={match:e=>e[0]===`agents`&&e[1]===`list`,run:async e=>{let t=i(e,`--json`),n=i(e,`--bindings`),{agentsListCommand:r}=await import(`./agents-D3Z05GqK.js`);return await r({json:t,bindings:n},s),!0}},A={match:e=>e[0]===`memory`&&e[1]===`status`,run:async e=>{let t=n(e,`--agent`);if(t===null)return!1;let r=i(e,`--json`),a=i(e,`--deep`),o=i(e,`--index`),s=i(e,`--verbose`),{runMemoryStatus:c}=await import(`./memory-cli-XaxtBQm1.js`).then(e=>e.t);return await c({agent:t,json:r,deep:a,index:o,verbose:s}),!0}};function j(e,t){let n=[],r=e.slice(2);for(let e=0;e<r.length;e+=1){let i=r[e];if(!i||i===`--`)break;if(i===t){let t=r[e+1];if(!u(t))return null;n.push(t),e+=1;continue}if(i.startsWith(`${t}=`)){let e=i.slice(t.length+1).trim();if(!e)return null;n.push(e)}}return n}const M=[E,D,O,k,A,{match:e=>e[0]===`config`&&e[1]===`get`,run:async t=>{let n=e(t,{commandPath:[`config`,`get`],booleanFlags:[`--json`]});if(!n||n.length!==1)return!1;let r=n[0];if(!r)return!1;let a=i(t,`--json`),{runConfigGet:o}=await import(`./config-cli-B9hEiZsw.js`);return await o({path:r,json:a}),!0}},{match:e=>e[0]===`config`&&e[1]===`unset`,run:async t=>{let n=e(t,{commandPath:[`config`,`unset`]});if(!n||n.length!==1)return!1;let r=n[0];if(!r)return!1;let{runConfigUnset:i}=await import(`./config-cli-B9hEiZsw.js`);return await i({path:r}),!0}},{match:e=>e[0]===`models`&&e[1]===`list`,run:async e=>{let t=n(e,`--provider`);if(t===null)return!1;let r=i(e,`--all`),a=i(e,`--local`),o=i(e,`--json`),c=i(e,`--plain`),{modelsListCommand:l}=await import(`./models-BEO5lvkx.js`);return await l({all:r,local:a,provider:t,json:o,plain:c},s),!0}},{match:e=>e[0]===`models`&&e[1]===`status`,run:async e=>{let t=n(e,`--probe-provider`);if(t===null)return!1;let r=n(e,`--probe-timeout`);if(r===null)return!1;let a=n(e,`--probe-concurrency`);if(a===null)return!1;let o=n(e,`--probe-max-tokens`);if(o===null)return!1;let c=n(e,`--agent`);if(c===null)return!1;let l=j(e,`--probe-profile`);if(l===null)return!1;let u=l.length===0?void 0:l.length===1?l[0]:l,d=i(e,`--json`),f=i(e,`--plain`),p=i(e,`--check`),m=i(e,`--probe`),{modelsStatusCommand:h}=await import(`./models-BEO5lvkx.js`);return await h({json:d,plain:f,check:p,probe:m,probeProvider:t,probeProfile:u,probeTimeout:r,probeConcurrency:a,probeMaxTokens:o,agent:c},s),!0}}];function N(e){for(let t of M)if(t.match(e))return t;return null}async function P(e){let t=i(e.argv,`--json`);C(_,{argv:e.argv}),await w({runtime:s,commandPath:e.commandPath,...t?{suppressDoctorStdout:!0}:{}}),(typeof e.loadPlugins==`function`?e.loadPlugins(e.argv):e.loadPlugins)&&x()}async function F(e){if(f(process.env.OPENCLAW_DISABLE_ROUTE_FIRST)||o(e))return!1;let t=r(e,2);if(!t[0])return!1;let n=N(t);return n?(await P({argv:e,commandPath:t,loadPlugins:n.loadPlugins}),n.run(e)):!1}async function I(){try{let{closeAllMemorySearchManagers:e}=await import(`./search-manager-Bp9x20r6.js`).then(e=>e.n);await e()}catch{}}function L(e){let t=e.indexOf(`--update`);if(t===-1)return e;let n=[...e];return n.splice(t,1,`update`),n}function R(e){return e.hasBuiltinPrimary?!0:e.primary?!1:o(e.argv)}function z(e){if(o(e))return!1;let[t,n]=r(e,2);return t?!(t===`status`||t===`health`||t===`sessions`||t===`config`&&(n===`get`||n===`unset`)||t===`models`&&(n===`list`||n===`status`)):!0}async function B(e=T.argv){let n=h(e),r=p(n);if(!r.ok)throw Error(r.error);r.profile&&d({profile:r.profile}),n=r.argv,g({quiet:!0}),m(),z(n)&&b(),S();try{if(await F(n))return;l();let{buildProgram:e}=await import(`./program-D9AMAbv6.js`),r=e();y(),T.on(`uncaughtException`,e=>{console.error(`[openclaw] Uncaught exception:`,v(e)),T.exit(1)});let i=L(n),a=t(i);if(a){let{getProgramContext:e}=await import(`./program-context-CH9p6anW.js`).then(e=>e.n),t=e(r);if(t){let{registerCoreCliByName:e}=await import(`./command-registry-CPthpEk3.js`).then(e=>e.t);await e(r,t,a,i)}let{registerSubCliByName:n}=await import(`./register.subclis-smZuHVcv.js`).then(e=>e.a);await n(r,a)}if(!R({argv:i,primary:a,hasBuiltinPrimary:a!==null&&r.commands.some(e=>e.name()===a)})){let{registerPluginCliCommands:e}=await import(`./cli-CMLvfh6N.js`),{loadValidatedConfigForPluginRegistration:t}=await import(`./register.subclis-smZuHVcv.js`).then(e=>e.a),n=await t();n&&e(r,n)}await r.parseAsync(i)}finally{await I()}}export{B as runCli};
2
- //# sourceMappingURL=run-main-DEZR4lCo.js.map
1
+ import{G as e,J as t,K as n,W as r,X as i,Y as a,Z as o,p as s,q as c,r as l,rt as u}from"./subsystem-BLbY429l.js";import"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{c as d,i as f,l as p,o as m,s as h}from"./entry.js";import{hc as g}from"./auth-profiles-T8DuH3ax.js";import"./agent-scope-DAWJwFfl.js";import"./utils-CGdo13HV.js";import"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import{t as _}from"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import{i as v}from"./errors-6SQWM9dj.js";import"./send-CW81y5Wz.js";import"./send-DavpkzhH.js";import"./compact-BEeB6bwq.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-_htt7eY5.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-BHuhHfkH.js";import"./diagnostic-DQq4Bwrs.js";import"./send-DkiKKUkt.js";import"./pi-model-discovery-CpjYoBQf.js";import"./exec-approvals-allowlist-D8mN7nxV.js";import"./exec-safe-bin-runtime-policy-dcCS_Adf.js";import"./model-catalog-COVzoZD9.js";import"./fetch-CQaNr5J1.js";import{_ as y}from"./audio-transcription-runner-Bd1OZC6K.js";import"./fetch-guard-BrTtJw7h.js";import"./image-BkWwI54C.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-D0QU-kQ9.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-D8Hh84ab.js";import"./render-DrrPmnMI.js";import"./target-errors-CgWAJOam.js";import"./commands-Dy7duWlt.js";import"./commands-registry-Cpl4QnG4.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-8acNlxwP.js";import"./sqlite-CILF3z9U.js";import"./call-B8Fb4_oh.js";import"./pi-tools.policy-D40r0HmD.js";import"./pairing-store-BH-FTYkn.js";import"./fetch-Dh-apy46.js";import"./skill-commands-CSF6wVPU.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-DAR7V7FJ.js";import"./channel-activity-BBrgoad1.js";import"./tables-Brc2lNcB.js";import"./kill-tree-B3g7HrAO.js";import"./runtime-web-tools-D8fms06-.js";import"./runtime-Dlg2-Omq.js";import"./node-shell-DyOfwHrh.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BBeE1TmB.js";import"./plugin-auto-enable-NzmNh4oU.js";import"./send-CVplsJpw.js";import"./outbound-attachment-BgAe99RM.js";import"./delivery-queue-nkPJu0fY.js";import"./send-C48Y9SAq.js";import"./system-run-command-BKfMiqQM.js";import"./fetch-Ce-scEU-.js";import"./command-secret-targets-BlN-J_fA.js";import"./connection-auth-B_Uk6Vk8.js";import"./onboard-helpers-PGl5bVPE.js";import"./prompt-style-BThRSQJR.js";import"./pairing-labels-D-kzQEL2.js";import"./search-manager-Bp9x20r6.js";import"./manager-C2YW7Hkq.js";import"./memory-cli-XaxtBQm1.js";import"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import{t as b}from"./path-env-emdAQejM.js";import"./note-Dp-d_utk.js";import"./issue-format-C_lNzrKa.js";import{t as x}from"./plugin-registry-CYlBYbc8.js";import{t as S}from"./runtime-guard-DX2Ie4ri.js";import{t as C}from"./banner-xQa2kS6O.js";import"./doctor-config-flow-D4F3mz4h.js";import{n as w}from"./config-guard-BTNXbWoO.js";import T from"node:process";import"node:url";const E={match:e=>e[0]===`health`,loadPlugins:e=>!i(e,`--json`),run:async e=>{let t=i(e,`--json`),n=a(e,{includeDebug:!0}),r=c(e,`--timeout`);if(r===null)return!1;let{healthCommand:o}=await import(`./health-DBu0V1Y-.js`).then(e=>e.i);return await o({json:t,timeoutMs:r,verbose:n},s),!0}},D={match:e=>e[0]===`status`,loadPlugins:!0,run:async e=>{let t=i(e,`--json`),n=i(e,`--deep`),r=i(e,`--all`),o=i(e,`--usage`),l=a(e,{includeDebug:!0}),u=c(e,`--timeout`);if(u===null)return!1;let{statusCommand:d}=await import(`./status-BoL8-JxA.js`).then(e=>e.t);return await d({json:t,deep:n,all:r,usage:o,timeoutMs:u,verbose:l},s),!0}},O={match:e=>e[0]===`sessions`&&!e[1],run:async e=>{let t=i(e,`--json`),r=i(e,`--all-agents`),a=n(e,`--agent`);if(a===null)return!1;let o=n(e,`--store`);if(o===null)return!1;let c=n(e,`--active`);if(c===null)return!1;let{sessionsCommand:l}=await import(`./sessions-BsxT0V2m.js`);return await l({json:t,store:o,agent:a,allAgents:r,active:c},s),!0}},k={match:e=>e[0]===`agents`&&e[1]===`list`,run:async e=>{let t=i(e,`--json`),n=i(e,`--bindings`),{agentsListCommand:r}=await import(`./agents-D3Z05GqK.js`);return await r({json:t,bindings:n},s),!0}},A={match:e=>e[0]===`memory`&&e[1]===`status`,run:async e=>{let t=n(e,`--agent`);if(t===null)return!1;let r=i(e,`--json`),a=i(e,`--deep`),o=i(e,`--index`),s=i(e,`--verbose`),{runMemoryStatus:c}=await import(`./memory-cli-XaxtBQm1.js`).then(e=>e.t);return await c({agent:t,json:r,deep:a,index:o,verbose:s}),!0}};function j(e,t){let n=[],r=e.slice(2);for(let e=0;e<r.length;e+=1){let i=r[e];if(!i||i===`--`)break;if(i===t){let t=r[e+1];if(!u(t))return null;n.push(t),e+=1;continue}if(i.startsWith(`${t}=`)){let e=i.slice(t.length+1).trim();if(!e)return null;n.push(e)}}return n}const M=[E,D,O,k,A,{match:e=>e[0]===`config`&&e[1]===`get`,run:async t=>{let n=e(t,{commandPath:[`config`,`get`],booleanFlags:[`--json`]});if(!n||n.length!==1)return!1;let r=n[0];if(!r)return!1;let a=i(t,`--json`),{runConfigGet:o}=await import(`./config-cli-B9hEiZsw.js`);return await o({path:r,json:a}),!0}},{match:e=>e[0]===`config`&&e[1]===`unset`,run:async t=>{let n=e(t,{commandPath:[`config`,`unset`]});if(!n||n.length!==1)return!1;let r=n[0];if(!r)return!1;let{runConfigUnset:i}=await import(`./config-cli-B9hEiZsw.js`);return await i({path:r}),!0}},{match:e=>e[0]===`models`&&e[1]===`list`,run:async e=>{let t=n(e,`--provider`);if(t===null)return!1;let r=i(e,`--all`),a=i(e,`--local`),o=i(e,`--json`),c=i(e,`--plain`),{modelsListCommand:l}=await import(`./models-BEO5lvkx.js`);return await l({all:r,local:a,provider:t,json:o,plain:c},s),!0}},{match:e=>e[0]===`models`&&e[1]===`status`,run:async e=>{let t=n(e,`--probe-provider`);if(t===null)return!1;let r=n(e,`--probe-timeout`);if(r===null)return!1;let a=n(e,`--probe-concurrency`);if(a===null)return!1;let o=n(e,`--probe-max-tokens`);if(o===null)return!1;let c=n(e,`--agent`);if(c===null)return!1;let l=j(e,`--probe-profile`);if(l===null)return!1;let u=l.length===0?void 0:l.length===1?l[0]:l,d=i(e,`--json`),f=i(e,`--plain`),p=i(e,`--check`),m=i(e,`--probe`),{modelsStatusCommand:h}=await import(`./models-BEO5lvkx.js`);return await h({json:d,plain:f,check:p,probe:m,probeProvider:t,probeProfile:u,probeTimeout:r,probeConcurrency:a,probeMaxTokens:o,agent:c},s),!0}}];function N(e){for(let t of M)if(t.match(e))return t;return null}async function P(e){let t=i(e.argv,`--json`);C(_,{argv:e.argv}),await w({runtime:s,commandPath:e.commandPath,...t?{suppressDoctorStdout:!0}:{}}),(typeof e.loadPlugins==`function`?e.loadPlugins(e.argv):e.loadPlugins)&&x()}async function F(e){if(f(process.env.OPENCLAW_DISABLE_ROUTE_FIRST)||o(e))return!1;let t=r(e,2);if(!t[0])return!1;let n=N(t);return n?(await P({argv:e,commandPath:t,loadPlugins:n.loadPlugins}),n.run(e)):!1}async function I(){try{let{closeAllMemorySearchManagers:e}=await import(`./search-manager-Bp9x20r6.js`).then(e=>e.n);await e()}catch{}}function L(e){let t=e.indexOf(`--update`);if(t===-1)return e;let n=[...e];return n.splice(t,1,`update`),n}function R(e){return e.hasBuiltinPrimary?!0:e.primary?!1:o(e.argv)}function z(e){if(o(e))return!1;let[t,n]=r(e,2);return t?!(t===`status`||t===`health`||t===`sessions`||t===`config`&&(n===`get`||n===`unset`)||t===`models`&&(n===`list`||n===`status`)):!0}async function B(e=T.argv){let n=h(e),r=p(n);if(!r.ok)throw Error(r.error);r.profile&&d({profile:r.profile}),n=r.argv,g({quiet:!0}),m(),z(n)&&b(),S();try{if(await F(n))return;l();let{buildProgram:e}=await import(`./program-CCS3CIqA.js`),r=e();y(),T.on(`uncaughtException`,e=>{console.error(`[openclaw] Uncaught exception:`,v(e)),T.exit(1)});let i=L(n),a=t(i);if(a){let{getProgramContext:e}=await import(`./program-context-CH9p6anW.js`).then(e=>e.n),t=e(r);if(t){let{registerCoreCliByName:e}=await import(`./command-registry-CSBvrqwW.js`).then(e=>e.t);await e(r,t,a,i)}let{registerSubCliByName:n}=await import(`./register.subclis-B_0ZS-_K.js`).then(e=>e.a);await n(r,a)}if(!R({argv:i,primary:a,hasBuiltinPrimary:a!==null&&r.commands.some(e=>e.name()===a)})){let{registerPluginCliCommands:e}=await import(`./cli-CMLvfh6N.js`),{loadValidatedConfigForPluginRegistration:t}=await import(`./register.subclis-B_0ZS-_K.js`).then(e=>e.a),n=await t();n&&e(r,n)}await r.parseAsync(i)}finally{await I()}}export{B as runCli};
2
+ //# sourceMappingURL=run-main-CV49c7uu.js.map
@@ -1,4 +1,4 @@
1
- import{A as e,p as t}from"./subsystem-BLbY429l.js";import{g as n,n as r,u as i}from"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Bo as a,Fo as o}from"./auth-profiles-T8DuH3ax.js";import{n as s,r as c,t as l}from"./command-format-CLxIPuLR.js";import"./agent-scope-DAWJwFfl.js";import{m as u}from"./utils-CGdo13HV.js";import{t as d}from"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import{t as f}from"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-CW81y5Wz.js";import"./send-DavpkzhH.js";import{Nt as p}from"./compact-BEeB6bwq.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-_htt7eY5.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-BHuhHfkH.js";import"./diagnostic-DQq4Bwrs.js";import"./send-DkiKKUkt.js";import"./pi-model-discovery-CpjYoBQf.js";import"./exec-approvals-allowlist-D8mN7nxV.js";import"./exec-safe-bin-runtime-policy-dcCS_Adf.js";import"./model-catalog-COVzoZD9.js";import"./fetch-CQaNr5J1.js";import"./audio-transcription-runner-Bd1OZC6K.js";import"./fetch-guard-BrTtJw7h.js";import"./image-BkWwI54C.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-D0QU-kQ9.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-D8Hh84ab.js";import"./render-DrrPmnMI.js";import"./target-errors-CgWAJOam.js";import"./commands-Dy7duWlt.js";import"./commands-registry-Cpl4QnG4.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-8acNlxwP.js";import"./sqlite-CILF3z9U.js";import"./call-B8Fb4_oh.js";import"./pi-tools.policy-D40r0HmD.js";import"./pairing-store-BH-FTYkn.js";import"./fetch-Dh-apy46.js";import"./skill-commands-CSF6wVPU.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-DAR7V7FJ.js";import"./channel-activity-BBrgoad1.js";import"./tables-Brc2lNcB.js";import{m,p as h,u as g}from"./arg-split-BOqSMBuf.js";import"./kill-tree-B3g7HrAO.js";import{n as _}from"./cmd-argv-Bh-KpaZ0.js";import"./runtime-web-tools-D8fms06-.js";import"./runtime-Dlg2-Omq.js";import"./node-shell-DyOfwHrh.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BBeE1TmB.js";import"./plugin-auto-enable-NzmNh4oU.js";import"./send-CVplsJpw.js";import"./outbound-attachment-BgAe99RM.js";import"./delivery-queue-nkPJu0fY.js";import"./send-C48Y9SAq.js";import"./system-run-command-BKfMiqQM.js";import"./fetch-Ce-scEU-.js";import{r as v}from"./format-duration-C8AzNqKh.js";import"./command-secret-targets-BlN-J_fA.js";import"./connection-auth-B_Uk6Vk8.js";import"./onboard-helpers-PGl5bVPE.js";import{n as y}from"./prompt-style-BThRSQJR.js";import"./pairing-labels-D-kzQEL2.js";import"./search-manager-Bp9x20r6.js";import"./manager-C2YW7Hkq.js";import"./memory-cli-XaxtBQm1.js";import{t as b}from"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import{t as x}from"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import"./skills-status-DswSl5aD.js";import{n as S}from"./command-options-BpOUDl2S.js";import"./note-Dp-d_utk.js";import"./install-safe-path-C6kc_8NW.js";import"./npm-pack-install-C0te3Oap.js";import"./skill-scanner-CkxXNioD.js";import"./installs-C1xQLuby.js";import{n as ee}from"./issue-format-C_lNzrKa.js";import"./channels-status-issues-8eFrGKyf.js";import{r as C}from"./completion-cli-C4_SZmjl.js";import"./register.subclis-smZuHVcv.js";import"./command-registry-CPthpEk3.js";import"./program-context-CH9p6anW.js";import"./daemon-install-plan.shared-Dx3DBXCG.js";import{r as w}from"./runtime-guard-DX2Ie4ri.js";import"./gateway-install-token-BCnuZeh1.js";import"./systemd-DbevZh65.js";import{n as te}from"./service-DZ9EbS15.js";import"./lifecycle-core-D9KNCvxY.js";import"./systemd-hints-lXpMy-kY.js";import{a as T,i as E,l as D,o as O,r as k}from"./daemon-cli-BuXTzSnU.js";import"./probe-auth-VI96zmTK.js";import"./diagnostics-Cdctg9K_.js";import{n as A,t as j}from"./table-CR7TFMew.js";import"./health-DBu0V1Y-.js";import"./control-ui-assets-CTHGGgaX.js";import{d as M,g as N,h as P,i as ne,m as F,n as I,o as re,r as ie,u as ae}from"./channel-account-context-DAcarnqW.js";import{a as L,c as R,i as oe,l as z,n as se,o as ce,r as le,s as ue,t as de}from"./update-runner-CvWH2ZAc.js";import{i as fe,n as pe,t as me}from"./status.update-B_8Gumuc.js";import"./logging-tYw1NbJd.js";import"./oauth-tls-preflight-BSBRDIfC.js";import{n as he,t as ge}from"./update-CwTy5DPl.js";import"./doctor-config-flow-D4F3mz4h.js";import"./systemd-linger-cWKbFNpu.js";import"./health-format-B1nj3Wfn.js";import{n as _e,t as ve}from"./prompt-select-styled-C2c13Ndq.js";import{r as B,t as ye}from"./doctor-completion-APZJ17BJ.js";import{spawn as be,spawnSync as xe}from"node:child_process";import V from"node:os";import H from"node:path";import U from"node:fs/promises";import{confirm as W,isCancel as G,spinner as Se}from"@clack/prompts";function K(e){let n=e?Number.parseInt(e,10)*1e3:void 0;return n!==void 0&&(Number.isNaN(n)||n<=0)?(t.error(`--timeout must be a positive integer (seconds)`),t.exit(1),null):n}const q=`https://github.com/openclaw/openclaw.git`,Ce=8e3,we=`openclaw`,Te=new Set([we]);function Ee(e){return ue(e,[`openclaw`,we])}function De(e){let t=e.trim();if(!t)return null;let n=t.startsWith(`v`)?t.slice(1):t;return w(n)?n:null}async function Oe(e,t){return De(e)||((await ne({tag:e,timeoutMs:t})).version??null)}async function ke(e){try{return await U.stat(H.join(e,`.git`)),!0}catch{return!1}}async function Ae(e){let t=await R(e);return!!(t&&Te.has(t))}async function je(e){try{return(await U.readdir(e)).length===0}catch{return!1}}function Me(){let e=process.env.OPENCLAW_GIT_DIR?.trim();return e?H.resolve(e):Ne()}function Ne(){return n(process.env,V.homedir)}function J(){let e=H.basename(process.execPath).toLowerCase();return e===`node`||e===`node.exe`?process.execPath:`node`}async function Y(){return await d({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()})??process.cwd()}async function X(e){let t=e.argv.join(` `);e.progress?.onStepStart?.({name:e.name,command:t,index:0,total:0});let n=Date.now(),r=await f(e.argv,{cwd:e.cwd,timeoutMs:e.timeoutMs}),i=Date.now()-n,a=p(r.stderr,Ce);return e.progress?.onStepComplete?.({name:e.name,command:t,index:0,total:0,durationMs:i,exitCode:r.code,stderrTail:a}),{name:e.name,command:t,cwd:e.cwd??process.cwd(),durationMs:i,exitCode:r.code,stdoutTail:p(r.stdout,Ce),stderrTail:a}}async function Pe(e){if(!await u(e.dir))return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],timeoutMs:e.timeoutMs,progress:e.progress});if(!await ke(e.dir)){if(!await je(e.dir))throw Error(`OPENCLAW_GIT_DIR points at a non-git directory: ${e.dir}. Set OPENCLAW_GIT_DIR to an empty folder or an openclaw checkout.`);return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],cwd:e.dir,timeoutMs:e.timeoutMs,progress:e.progress})}if(!await Ae(e.dir))throw Error(`OPENCLAW_GIT_DIR does not look like a core checkout: ${e.dir}.`);return null}async function Z(e){let t=Ie();if(e.installKind===`package`){let n=await oe(t,e.root,e.timeoutMs);if(n)return n}return await le(t,e.timeoutMs)??`npm`}async function Fe(n,r){let i=H.join(n,`openclaw.mjs`);if(!await u(i))return;let a=xe(J(),[i,`completion`,`--write-state`],{cwd:n,env:process.env,encoding:`utf-8`});if(a.error){r||t.log(e.warn(`Completion cache update failed: ${String(a.error)}`));return}if(a.status!==0&&!r){let n=(a.stderr??``).toString().trim(),r=n?` (${n})`:``;t.log(e.warn(`Completion cache update failed${r}.`))}}function Ie(){return async(e,t)=>{let n=await f(e,t);return{stdout:n.stdout,stderr:n.stderr,code:n.code}}}function Le(e){let t=e.sha?e.sha.slice(0,8):null,n=e.branch&&e.branch!==`HEAD`?e.branch:null,r=e.tag;return[n??(r?`detached`:`git`),r?`tag ${r}`:null,t?`@ ${t}`:null].filter(Boolean).join(` · `)}async function Re(n){let r=K(n.timeout);if(r===null)return;let i=await Y(),a=await o(),s=a.valid?F(a.config.update?.channel):null,c=await I({root:i,timeoutMs:r??3500,fetchGit:!0,includeRegistry:!0}),l=N({configChannel:s,installKind:c.installKind,gitTag:c.git?.tag??null,gitBranch:c.git?.branch??null}),u=l.label,d=c.installKind===`git`?Le({branch:c.git?.branch??null,tag:c.git?.tag??null,sha:c.git?.sha??null}):null,f=fe(c),p=pe(c).replace(/^Update:\s*/i,``);if(n.json){t.log(JSON.stringify({update:c,channel:{value:l.channel,source:l.source,label:u,config:s},availability:f},null,2));return}let m=j(),h=[{Item:`Install`,Value:c.installKind===`git`?`git (${c.root??`unknown`})`:c.installKind===`package`?c.packageManager:`unknown`},{Item:`Channel`,Value:u},...d?[{Item:`Git`,Value:d}]:[],{Item:`Update`,Value:f.available?e.warn(`available · ${p}`):p}];t.log(e.heading(`OpenClaw update status`)),t.log(``),t.log(A({width:m,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:h}).trimEnd()),t.log(``);let g=me(c);g&&t.log(e.warn(g))}const ze={"clean check":`Working directory is clean`,"upstream check":`Upstream branch exists`,"git fetch":`Fetching latest changes`,"git rebase":`Rebasing onto target commit`,"git rev-parse @{upstream}":`Resolving upstream commit`,"git rev-list":`Enumerating candidate commits`,"git clone":`Cloning git checkout`,"preflight worktree":`Preparing preflight worktree`,"preflight cleanup":`Cleaning preflight worktree`,"deps install":`Installing dependencies`,build:`Building`,"ui:build":`Building UI assets`,"ui:build (post-doctor repair)":`Restoring missing UI assets`,"ui assets verify":`Validating UI assets`,"openclaw doctor entry":`Checking doctor entrypoint`,"openclaw doctor":`Running doctor checks`,"git rev-parse HEAD (after)":`Verifying update`,"global update":`Updating via package manager`,"global update (omit optional)":`Retrying update without optional deps`,"global install":`Installing global package`};function Be(e){return ze[e.name]??e.name}function Ve(e){if(e.status!==`error`||e.mode!==`npm`)return[];let t=[...e.steps].toReversed().find(e=>e.exitCode!==0);if(!t)return[];let n=(t.stderrTail??``).toLowerCase(),r=[];return t.name.startsWith(`global update`)&&n.includes(`eacces`)&&(r.push(`Detected permission failure (EACCES). Re-run with a writable global prefix or sudo (for system-managed Node installs).`),r.push(`Example: npm config set prefix ~/.local && npm i -g openclaw@latest`)),t.name.startsWith(`global update`)&&(n.includes(`node-gyp`)||n.includes(`prebuild`))&&(r.push(`Detected native optional dependency build failure. The updater retries with --omit=optional automatically.`),r.push(`If it still fails: npm i -g openclaw@latest --omit=optional`)),r}function He(n){if(!n)return{progress:{},stop:()=>{}};let r=null;return{progress:{onStepStart:t=>{r=Se(),r.start(e.accent(Be(t)))},onStepComplete:n=>{if(!r)return;let i=Be(n),a=e.muted(`(${v(n.durationMs)})`),o=n.exitCode===0?e.success(`✓`):e.error(`✗`);if(r.stop(`${o} ${i} ${a}`),r=null,n.exitCode!==0&&n.stderrTail){let r=n.stderrTail.split(`
1
+ import{A as e,p as t}from"./subsystem-BLbY429l.js";import{g as n,n as r,u as i}from"./paths-BjD3T_xq.js";import"./boolean-D15s2V33.js";import{Bo as a,Fo as o}from"./auth-profiles-T8DuH3ax.js";import{n as s,r as c,t as l}from"./command-format-CLxIPuLR.js";import"./agent-scope-DAWJwFfl.js";import{m as u}from"./utils-CGdo13HV.js";import{t as d}from"./openclaw-root-CnsBf6ZU.js";import"./github-copilot-token-C79yeDKS.js";import"./env-overrides-DHtB4kK3.js";import"./version-q3SkUw2K.js";import"./registry-BptzrW8D.js";import"./skills-CKTicUKS.js";import"./frontmatter-C7mzDNxd.js";import"./plugins-DNlgeTTc.js";import"./logger-kQAOe3qp.js";import{t as f}from"./exec-B3eleY5O.js";import"./windows-spawn-7oINn5ao.js";import"./redact-CnRxK70G.js";import"./path-alias-guards-kY_ZbWs-.js";import"./errors-6SQWM9dj.js";import"./send-CW81y5Wz.js";import"./send-DavpkzhH.js";import{Nt as p}from"./compact-BEeB6bwq.js";import"./paths-BfjJY2VL.js";import"./chat-envelope-Bznn2SoS.js";import"./models-config-_htt7eY5.js";import"./tokens-DRM8vzJx.js";import"./with-timeout-c1CzdShT.js";import"./deliver-BHuhHfkH.js";import"./diagnostic-DQq4Bwrs.js";import"./send-DkiKKUkt.js";import"./pi-model-discovery-CpjYoBQf.js";import"./exec-approvals-allowlist-D8mN7nxV.js";import"./exec-safe-bin-runtime-policy-dcCS_Adf.js";import"./model-catalog-COVzoZD9.js";import"./fetch-CQaNr5J1.js";import"./audio-transcription-runner-Bd1OZC6K.js";import"./fetch-guard-BrTtJw7h.js";import"./image-BkWwI54C.js";import"./tool-display-DJDtttQg.js";import"./api-key-rotation-D0QU-kQ9.js";import"./proxy-fetch-gWETR3cl.js";import"./ir-D8Hh84ab.js";import"./render-DrrPmnMI.js";import"./target-errors-CgWAJOam.js";import"./commands-Dy7duWlt.js";import"./commands-registry-Cpl4QnG4.js";import"./session-cost-usage-CHtVgnE8.js";import"./session-utils-8acNlxwP.js";import"./sqlite-CILF3z9U.js";import"./call-B8Fb4_oh.js";import"./pi-tools.policy-D40r0HmD.js";import"./pairing-store-BH-FTYkn.js";import"./fetch-Dh-apy46.js";import"./skill-commands-CSF6wVPU.js";import"./workspace-dirs-A8Vib9_B.js";import"./pairing-token-DAR7V7FJ.js";import"./channel-activity-BBrgoad1.js";import"./tables-Brc2lNcB.js";import{m,p as h,u as g}from"./arg-split-BOqSMBuf.js";import"./kill-tree-B3g7HrAO.js";import{n as _}from"./cmd-argv-Bh-KpaZ0.js";import"./runtime-web-tools-D8fms06-.js";import"./runtime-Dlg2-Omq.js";import"./node-shell-DyOfwHrh.js";import"./stagger-DxzgG2jd.js";import"./channel-selection-BBeE1TmB.js";import"./plugin-auto-enable-NzmNh4oU.js";import"./send-CVplsJpw.js";import"./outbound-attachment-BgAe99RM.js";import"./delivery-queue-nkPJu0fY.js";import"./send-C48Y9SAq.js";import"./system-run-command-BKfMiqQM.js";import"./fetch-Ce-scEU-.js";import{r as v}from"./format-duration-C8AzNqKh.js";import"./command-secret-targets-BlN-J_fA.js";import"./connection-auth-B_Uk6Vk8.js";import"./onboard-helpers-PGl5bVPE.js";import{n as y}from"./prompt-style-BThRSQJR.js";import"./pairing-labels-D-kzQEL2.js";import"./search-manager-Bp9x20r6.js";import"./manager-C2YW7Hkq.js";import"./memory-cli-XaxtBQm1.js";import{t as b}from"./links-CBnmRP9D.js";import"./cli-utils-BleB1eys.js";import{t as x}from"./help-format-B4aEI7V9.js";import"./progress-d1m2sqR1.js";import"./exec-approvals-BXO9Cezj.js";import"./skills-status-DswSl5aD.js";import{n as S}from"./command-options-BpOUDl2S.js";import"./note-Dp-d_utk.js";import"./install-safe-path-C6kc_8NW.js";import"./npm-pack-install-C0te3Oap.js";import"./skill-scanner-CkxXNioD.js";import"./installs-C1xQLuby.js";import{n as ee}from"./issue-format-C_lNzrKa.js";import"./channels-status-issues-8eFrGKyf.js";import{r as C}from"./completion-cli-W1_FoDFF.js";import"./register.subclis-B_0ZS-_K.js";import"./command-registry-CSBvrqwW.js";import"./program-context-CH9p6anW.js";import"./daemon-install-plan.shared-Dx3DBXCG.js";import{r as w}from"./runtime-guard-DX2Ie4ri.js";import"./gateway-install-token-BCnuZeh1.js";import"./systemd-DbevZh65.js";import{n as te}from"./service-DZ9EbS15.js";import"./lifecycle-core-D9KNCvxY.js";import"./systemd-hints-lXpMy-kY.js";import{a as T,i as E,l as D,o as O,r as k}from"./daemon-cli-BuXTzSnU.js";import"./probe-auth-VI96zmTK.js";import"./diagnostics-Cdctg9K_.js";import{n as A,t as j}from"./table-CR7TFMew.js";import"./health-DBu0V1Y-.js";import"./control-ui-assets-CTHGGgaX.js";import{d as M,g as N,h as P,i as ne,m as F,n as I,o as re,r as ie,u as ae}from"./channel-account-context-DAcarnqW.js";import{a as L,c as R,i as oe,l as z,n as se,o as ce,r as le,s as ue,t as de}from"./update-runner-CvWH2ZAc.js";import{i as fe,n as pe,t as me}from"./status.update-B_8Gumuc.js";import"./logging-tYw1NbJd.js";import"./oauth-tls-preflight-BSBRDIfC.js";import{n as he,t as ge}from"./update-CwTy5DPl.js";import"./doctor-config-flow-D4F3mz4h.js";import"./systemd-linger-cWKbFNpu.js";import"./health-format-B1nj3Wfn.js";import{n as _e,t as ve}from"./prompt-select-styled-Z30OVmpM.js";import{r as B,t as ye}from"./doctor-completion-DpCWb88H.js";import{spawn as be,spawnSync as xe}from"node:child_process";import V from"node:os";import H from"node:path";import U from"node:fs/promises";import{confirm as W,isCancel as G,spinner as Se}from"@clack/prompts";function K(e){let n=e?Number.parseInt(e,10)*1e3:void 0;return n!==void 0&&(Number.isNaN(n)||n<=0)?(t.error(`--timeout must be a positive integer (seconds)`),t.exit(1),null):n}const q=`https://github.com/openclaw/openclaw.git`,Ce=8e3,we=`openclaw`,Te=new Set([we]);function Ee(e){return ue(e,[`openclaw`,we])}function De(e){let t=e.trim();if(!t)return null;let n=t.startsWith(`v`)?t.slice(1):t;return w(n)?n:null}async function Oe(e,t){return De(e)||((await ne({tag:e,timeoutMs:t})).version??null)}async function ke(e){try{return await U.stat(H.join(e,`.git`)),!0}catch{return!1}}async function Ae(e){let t=await R(e);return!!(t&&Te.has(t))}async function je(e){try{return(await U.readdir(e)).length===0}catch{return!1}}function Me(){let e=process.env.OPENCLAW_GIT_DIR?.trim();return e?H.resolve(e):Ne()}function Ne(){return n(process.env,V.homedir)}function J(){let e=H.basename(process.execPath).toLowerCase();return e===`node`||e===`node.exe`?process.execPath:`node`}async function Y(){return await d({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()})??process.cwd()}async function X(e){let t=e.argv.join(` `);e.progress?.onStepStart?.({name:e.name,command:t,index:0,total:0});let n=Date.now(),r=await f(e.argv,{cwd:e.cwd,timeoutMs:e.timeoutMs}),i=Date.now()-n,a=p(r.stderr,Ce);return e.progress?.onStepComplete?.({name:e.name,command:t,index:0,total:0,durationMs:i,exitCode:r.code,stderrTail:a}),{name:e.name,command:t,cwd:e.cwd??process.cwd(),durationMs:i,exitCode:r.code,stdoutTail:p(r.stdout,Ce),stderrTail:a}}async function Pe(e){if(!await u(e.dir))return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],timeoutMs:e.timeoutMs,progress:e.progress});if(!await ke(e.dir)){if(!await je(e.dir))throw Error(`OPENCLAW_GIT_DIR points at a non-git directory: ${e.dir}. Set OPENCLAW_GIT_DIR to an empty folder or an openclaw checkout.`);return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],cwd:e.dir,timeoutMs:e.timeoutMs,progress:e.progress})}if(!await Ae(e.dir))throw Error(`OPENCLAW_GIT_DIR does not look like a core checkout: ${e.dir}.`);return null}async function Z(e){let t=Ie();if(e.installKind===`package`){let n=await oe(t,e.root,e.timeoutMs);if(n)return n}return await le(t,e.timeoutMs)??`npm`}async function Fe(n,r){let i=H.join(n,`openclaw.mjs`);if(!await u(i))return;let a=xe(J(),[i,`completion`,`--write-state`],{cwd:n,env:process.env,encoding:`utf-8`});if(a.error){r||t.log(e.warn(`Completion cache update failed: ${String(a.error)}`));return}if(a.status!==0&&!r){let n=(a.stderr??``).toString().trim(),r=n?` (${n})`:``;t.log(e.warn(`Completion cache update failed${r}.`))}}function Ie(){return async(e,t)=>{let n=await f(e,t);return{stdout:n.stdout,stderr:n.stderr,code:n.code}}}function Le(e){let t=e.sha?e.sha.slice(0,8):null,n=e.branch&&e.branch!==`HEAD`?e.branch:null,r=e.tag;return[n??(r?`detached`:`git`),r?`tag ${r}`:null,t?`@ ${t}`:null].filter(Boolean).join(` · `)}async function Re(n){let r=K(n.timeout);if(r===null)return;let i=await Y(),a=await o(),s=a.valid?F(a.config.update?.channel):null,c=await I({root:i,timeoutMs:r??3500,fetchGit:!0,includeRegistry:!0}),l=N({configChannel:s,installKind:c.installKind,gitTag:c.git?.tag??null,gitBranch:c.git?.branch??null}),u=l.label,d=c.installKind===`git`?Le({branch:c.git?.branch??null,tag:c.git?.tag??null,sha:c.git?.sha??null}):null,f=fe(c),p=pe(c).replace(/^Update:\s*/i,``);if(n.json){t.log(JSON.stringify({update:c,channel:{value:l.channel,source:l.source,label:u,config:s},availability:f},null,2));return}let m=j(),h=[{Item:`Install`,Value:c.installKind===`git`?`git (${c.root??`unknown`})`:c.installKind===`package`?c.packageManager:`unknown`},{Item:`Channel`,Value:u},...d?[{Item:`Git`,Value:d}]:[],{Item:`Update`,Value:f.available?e.warn(`available · ${p}`):p}];t.log(e.heading(`OpenClaw update status`)),t.log(``),t.log(A({width:m,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:h}).trimEnd()),t.log(``);let g=me(c);g&&t.log(e.warn(g))}const ze={"clean check":`Working directory is clean`,"upstream check":`Upstream branch exists`,"git fetch":`Fetching latest changes`,"git rebase":`Rebasing onto target commit`,"git rev-parse @{upstream}":`Resolving upstream commit`,"git rev-list":`Enumerating candidate commits`,"git clone":`Cloning git checkout`,"preflight worktree":`Preparing preflight worktree`,"preflight cleanup":`Cleaning preflight worktree`,"deps install":`Installing dependencies`,build:`Building`,"ui:build":`Building UI assets`,"ui:build (post-doctor repair)":`Restoring missing UI assets`,"ui assets verify":`Validating UI assets`,"openclaw doctor entry":`Checking doctor entrypoint`,"openclaw doctor":`Running doctor checks`,"git rev-parse HEAD (after)":`Verifying update`,"global update":`Updating via package manager`,"global update (omit optional)":`Retrying update without optional deps`,"global install":`Installing global package`};function Be(e){return ze[e.name]??e.name}function Ve(e){if(e.status!==`error`||e.mode!==`npm`)return[];let t=[...e.steps].toReversed().find(e=>e.exitCode!==0);if(!t)return[];let n=(t.stderrTail??``).toLowerCase(),r=[];return t.name.startsWith(`global update`)&&n.includes(`eacces`)&&(r.push(`Detected permission failure (EACCES). Re-run with a writable global prefix or sudo (for system-managed Node installs).`),r.push(`Example: npm config set prefix ~/.local && npm i -g openclaw@latest`)),t.name.startsWith(`global update`)&&(n.includes(`node-gyp`)||n.includes(`prebuild`))&&(r.push(`Detected native optional dependency build failure. The updater retries with --omit=optional automatically.`),r.push(`If it still fails: npm i -g openclaw@latest --omit=optional`)),r}function He(n){if(!n)return{progress:{},stop:()=>{}};let r=null;return{progress:{onStepStart:t=>{r=Se(),r.start(e.accent(Be(t)))},onStepComplete:n=>{if(!r)return;let i=Be(n),a=e.muted(`(${v(n.durationMs)})`),o=n.exitCode===0?e.success(`✓`):e.error(`✗`);if(r.stop(`${o} ${i} ${a}`),r=null,n.exitCode!==0&&n.stderrTail){let r=n.stderrTail.split(`
2
2
  `).slice(-10);for(let n of r)n.trim()&&t.log(` ${e.error(n)}`)}}},stop:()=>{r&&=(r.stop(),null)}}}function Ue(t){return t===0?e.success(`✓`):t===null?e.warn(`?`):e.error(`✗`)}function We(n,r){if(r.json){t.log(JSON.stringify(n,null,2));return}let i=n.status===`ok`?e.success:n.status===`skipped`?e.warn:e.error;if(t.log(``),t.log(`${e.heading(`Update Result:`)} ${i(n.status.toUpperCase())}`),n.root&&t.log(` Root: ${e.muted(n.root)}`),n.reason&&t.log(` Reason: ${e.muted(n.reason)}`),n.before?.version||n.before?.sha){let r=n.before.version??n.before.sha?.slice(0,8)??``;t.log(` Before: ${e.muted(r)}`)}if(n.after?.version||n.after?.sha){let r=n.after.version??n.after.sha?.slice(0,8)??``;t.log(` After: ${e.muted(r)}`)}if(!r.hideSteps&&n.steps.length>0){t.log(``),t.log(e.heading(`Steps:`));for(let r of n.steps){let n=Ue(r.exitCode),i=e.muted(`(${v(r.durationMs)})`);if(t.log(` ${n} ${r.name} ${i}`),r.exitCode!==0&&r.stderrTail){let n=r.stderrTail.split(`
3
3
  `).slice(0,5);for(let r of n)r.trim()&&t.log(` ${e.error(r)}`)}}}let a=Ve(n);if(a.length>0){t.log(``),t.log(e.heading(`Recovery hints:`));for(let n of a)t.log(` - ${e.warn(n)}`)}t.log(``),t.log(`Total time: ${e.muted(v(n.durationMs))}`)}function Q(e){return e.replace(/'/g,`'\\''`)}function Ge(e){return/^[A-Za-z0-9 _\-().]+$/.test(e)}function Ke(e){let t=e.OPENCLAW_SYSTEMD_UNIT?.trim();return t?t.endsWith(`.service`)?t:`${t}.service`:`${h(e.OPENCLAW_PROFILE)}.service`}function qe(e){return e.OPENCLAW_LAUNCHD_LABEL?.trim()||g(e.OPENCLAW_PROFILE)}function Je(e){return e.OPENCLAW_WINDOWS_TASK_NAME?.trim()||m(e.OPENCLAW_PROFILE)}async function Ye(e=process.env,t=r){let n=V.tmpdir(),i=Date.now(),a=process.platform,o=``,s=``;try{if(a===`linux`){let t=Q(Ke(e));s=`openclaw-restart-${i}.sh`,o=`#!/bin/sh
4
4
  # Standalone restart script — survives parent process termination.
@@ -74,4 +74,4 @@ ${e.heading(`Notes:`)}
74
74
  - Skips update if the working directory has uncommitted changes
75
75
 
76
76
  ${e.muted(`Docs:`)} ${b(`/cli/update`,`docs.openclaw.ai/cli/update`)}`}).action(async e=>{try{await lt({json:!!e.json,restart:!!e.restart,dryRun:!!e.dryRun,channel:e.channel,tag:e.tag,timeout:e.timeout,yes:!!e.yes})}catch(e){t.error(String(e)),t.exit(1)}});r.command(`wizard`).description(`Interactive update wizard`).option(`--timeout <seconds>`,`Timeout for each update step in seconds (default: 1200)`).addHelpText(`after`,`\n${e.muted(`Docs:`)} ${b(`/cli/update`,`docs.openclaw.ai/cli/update`)}\n`).action(async(e,n)=>{try{await ut({timeout:ft(e,n)})}catch(e){t.error(String(e)),t.exit(1)}}),r.command(`status`).description(`Show update channel and version status`).option(`--json`,`Output result as JSON`,!1).option(`--timeout <seconds>`,`Timeout for update checks in seconds (default: 3)`).addHelpText(`after`,()=>`\n${e.heading(`Examples:`)}\n${x([[`openclaw update status`,`Show channel + version status.`],[`openclaw update status --json`,`JSON output.`],[`openclaw update status --timeout 10`,`Custom timeout.`]])}\n\n${e.heading(`Notes:`)}\n${e.muted(`- Shows current update channel (stable/beta/dev) and source`)}\n${e.muted(`- Includes git tag/branch/SHA for source checkouts`)}\n\n${e.muted(`Docs:`)} ${b(`/cli/update`,`docs.openclaw.ai/cli/update`)}`).action(async(e,n)=>{try{await Re({json:!!e.json||dt(n),timeout:ft(e,n)})}catch(e){t.error(String(e)),t.exit(1)}})}export{pt as registerUpdateCli};
77
- //# sourceMappingURL=update-cli-ISorpxrU.js.map
77
+ //# sourceMappingURL=update-cli--P65ciut.js.map
@@ -1,4 +1,4 @@
1
- import{g as e,n as t,u as n}from"./paths-B4IRk3wi.js";import{A as r,p as i}from"./subsystem-C5XF2Fy5.js";import{h as a}from"./utils-UGOV_184.js";import{Zs as o,nc as s}from"./model-selection-BlC_rXAN.js";import{V as c}from"./reply-CjyZeZ-j.js";import"./agent-scope-DXZc3eNT.js";import{t as l}from"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import{n as u,r as d,t as f}from"./command-format-BbDT1tlm.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-DHbOKEGc.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import{t as p}from"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-Cgd_VJHR.js";import"./send-hZFDcGLM.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-D4Bp6MM7.js";import"./image-DsoO5VP5.js";import"./models-config-CdMhNxKV.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-DPdY0NXR.js";import"./api-key-rotation-BRt-vnRV.js";import"./local-roots-6waH0SZ0.js";import"./model-catalog-C1kpjR75.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-ClBkV2eD.js";import"./commands-CGpM84iR.js";import"./commands-registry-B1x54ukc.js";import"./pairing-store-Cg2UxreQ.js";import"./fetch-Dikjvc5M.js";import"./call-CqoMqP5b.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-DOzHPnht.js";import"./send-B7sHR38c2.js";import"./pi-model-discovery-Dps1PPWz.js";import"./exec-approvals-allowlist-CE3nYh0K.js";import"./exec-safe-bin-runtime-policy-Dt0GchLp.js";import"./ir-Dk7OQ4bA.js";import"./render-D8OWO2hT.js";import"./target-errors-a35Md15n.js";import"./read-only-account-inspect-DBwAwB3_.js";import"./channel-selection-CbNtbAEf.js";import"./plugin-auto-enable-DpVL6-ES.js";import"./send-C-AP01PR.js";import"./outbound-attachment-B7wMxwj6.js";import"./delivery-queue-CKbauSFq.js";import"./send-DbeEC2a3.js";import"./channel-activity-YjYNzCpJ.js";import"./tables-Oieq7UbT.js";import"./fetch-Bn0mWg6a.js";import{r as m}from"./format-duration-D5AMtmHa.js";import"./skill-commands-HJHHZqt6.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-BjYBuREl.js";import"./restart-CHXEHdSC.js";import"./runtime-web-tools-bz76ZaRc.js";import"./command-secret-targets-BVN3kiT9.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-C8iru0UB.js";import"./onboard-helpers-zwybUJWu.js";import{n as h}from"./prompt-style-CXKekIBY.js";import"./pairing-labels-BUU_-70B.js";import"./memory-cli-jhzJ3as7.js";import"./query-expansion-0OxEb1Io.js";import"./manager-M1GKhLUC.js";import{t as g}from"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import{t as _}from"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-DECgxo6A.js";import"./system-run-command-DEWnZE0r.js";import"./runtime-BC5Ep2pJ.js";import"./stagger-DmFYysrJ.js";import{m as v,p as y,u as b}from"./arg-split-DE5RqDHq.js";import{n as x}from"./cmd-argv-BBT5l8AV.js";import{r as S}from"./runtime-guard-DFYBaYZS.js";import"./program-context-BX9wN65q.js";import"./skills-status-BWIugRCz.js";import{n as C}from"./command-options-Bq5nQxz6.js";import"./note-D4GAwgha.js";import"./install-safe-path-iesxijn2.js";import"./npm-pack-install-B23L-AtF.js";import"./skill-scanner-CUUF3Fvo.js";import"./installs-BNeI_oML.js";import{n as ee}from"./issue-format-BT7cQEt3.js";import"./channels-status-issues-PRgOT90w.js";import{r as w}from"./completion-cli-DeGEpJri.js";import"./daemon-install-plan.shared-CfA37Ut_.js";import"./gateway-install-token-DiDvDPJQ.js";import"./systemd-D7odsu4K.js";import{n as te}from"./service-BtB9epJk.js";import"./lifecycle-core-LM5UUUB1.js";import"./systemd-hints-C0DKDl35.js";import{a as T,i as E,l as D,o as O,r as k}from"./daemon-cli-DOTKuS7d.js";import"./probe-auth-BMA0yM94.js";import"./diagnostics-BgbeL9KE.js";import{n as A,t as j}from"./table-CY440fI1.js";import"./health-RQzDNQwf.js";import"./control-ui-assets-BIa0GGDg.js";import{d as M,g as N,h as P,i as ne,m as F,n as I,o as re,r as ie,u as ae}from"./channel-account-context-BMPAMZEv.js";import{a as L,c as R,i as oe,l as z,n as se,o as ce,r as le,s as ue,t as de}from"./update-runner-mMbwEOlU.js";import{i as fe,n as pe,t as me}from"./status.update-DoSzHu2F.js";import"./logging-Dqe9dxSX.js";import"./oauth-tls-preflight-ByNjbUR5.js";import{n as he,t as ge}from"./update-BGrxUIyz.js";import"./doctor-config-flow-DnOyVZhQ.js";import"./systemd-linger-C2MJD6KG.js";import"./health-format-VBr6LEpt.js";import{n as _e,t as ve}from"./prompt-select-styled-hxyoyq2i.js";import{r as B,t as ye}from"./doctor-completion-Bad_h3hm.js";import V from"node:os";import H from"node:path";import U from"node:fs/promises";import{spawn as be,spawnSync as xe}from"node:child_process";import{confirm as W,isCancel as G,spinner as Se}from"@clack/prompts";function K(e){let t=e?Number.parseInt(e,10)*1e3:void 0;return t!==void 0&&(Number.isNaN(t)||t<=0)?(i.error(`--timeout must be a positive integer (seconds)`),i.exit(1),null):t}const q=`https://github.com/openclaw/openclaw.git`,Ce=8e3,we=`openclaw`,Te=new Set([we]);function Ee(e){return ue(e,[`openclaw`,we])}function De(e){let t=e.trim();if(!t)return null;let n=t.startsWith(`v`)?t.slice(1):t;return S(n)?n:null}async function Oe(e,t){return De(e)||((await ne({tag:e,timeoutMs:t})).version??null)}async function ke(e){try{return await U.stat(H.join(e,`.git`)),!0}catch{return!1}}async function Ae(e){let t=await R(e);return!!(t&&Te.has(t))}async function je(e){try{return(await U.readdir(e)).length===0}catch{return!1}}function Me(){let e=process.env.OPENCLAW_GIT_DIR?.trim();return e?H.resolve(e):Ne()}function Ne(){return e(process.env,V.homedir)}function J(){let e=H.basename(process.execPath).toLowerCase();return e===`node`||e===`node.exe`?process.execPath:`node`}async function Y(){return await l({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()})??process.cwd()}async function X(e){let t=e.argv.join(` `);e.progress?.onStepStart?.({name:e.name,command:t,index:0,total:0});let n=Date.now(),r=await p(e.argv,{cwd:e.cwd,timeoutMs:e.timeoutMs}),i=Date.now()-n,a=c(r.stderr,Ce);return e.progress?.onStepComplete?.({name:e.name,command:t,index:0,total:0,durationMs:i,exitCode:r.code,stderrTail:a}),{name:e.name,command:t,cwd:e.cwd??process.cwd(),durationMs:i,exitCode:r.code,stdoutTail:c(r.stdout,Ce),stderrTail:a}}async function Pe(e){if(!await a(e.dir))return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],timeoutMs:e.timeoutMs,progress:e.progress});if(!await ke(e.dir)){if(!await je(e.dir))throw Error(`OPENCLAW_GIT_DIR points at a non-git directory: ${e.dir}. Set OPENCLAW_GIT_DIR to an empty folder or an openclaw checkout.`);return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],cwd:e.dir,timeoutMs:e.timeoutMs,progress:e.progress})}if(!await Ae(e.dir))throw Error(`OPENCLAW_GIT_DIR does not look like a core checkout: ${e.dir}.`);return null}async function Z(e){let t=Ie();if(e.installKind===`package`){let n=await oe(t,e.root,e.timeoutMs);if(n)return n}return await le(t,e.timeoutMs)??`npm`}async function Fe(e,t){let n=H.join(e,`openclaw.mjs`);if(!await a(n))return;let o=xe(J(),[n,`completion`,`--write-state`],{cwd:e,env:process.env,encoding:`utf-8`});if(o.error){t||i.log(r.warn(`Completion cache update failed: ${String(o.error)}`));return}if(o.status!==0&&!t){let e=(o.stderr??``).toString().trim(),t=e?` (${e})`:``;i.log(r.warn(`Completion cache update failed${t}.`))}}function Ie(){return async(e,t)=>{let n=await p(e,t);return{stdout:n.stdout,stderr:n.stderr,code:n.code}}}function Le(e){let t=e.sha?e.sha.slice(0,8):null,n=e.branch&&e.branch!==`HEAD`?e.branch:null,r=e.tag;return[n??(r?`detached`:`git`),r?`tag ${r}`:null,t?`@ ${t}`:null].filter(Boolean).join(` · `)}async function Re(e){let t=K(e.timeout);if(t===null)return;let n=await Y(),a=await o(),s=a.valid?F(a.config.update?.channel):null,c=await I({root:n,timeoutMs:t??3500,fetchGit:!0,includeRegistry:!0}),l=N({configChannel:s,installKind:c.installKind,gitTag:c.git?.tag??null,gitBranch:c.git?.branch??null}),u=l.label,d=c.installKind===`git`?Le({branch:c.git?.branch??null,tag:c.git?.tag??null,sha:c.git?.sha??null}):null,f=fe(c),p=pe(c).replace(/^Update:\s*/i,``);if(e.json){i.log(JSON.stringify({update:c,channel:{value:l.channel,source:l.source,label:u,config:s},availability:f},null,2));return}let m=j(),h=[{Item:`Install`,Value:c.installKind===`git`?`git (${c.root??`unknown`})`:c.installKind===`package`?c.packageManager:`unknown`},{Item:`Channel`,Value:u},...d?[{Item:`Git`,Value:d}]:[],{Item:`Update`,Value:f.available?r.warn(`available · ${p}`):p}];i.log(r.heading(`OpenClaw update status`)),i.log(``),i.log(A({width:m,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:h}).trimEnd()),i.log(``);let g=me(c);g&&i.log(r.warn(g))}const ze={"clean check":`Working directory is clean`,"upstream check":`Upstream branch exists`,"git fetch":`Fetching latest changes`,"git rebase":`Rebasing onto target commit`,"git rev-parse @{upstream}":`Resolving upstream commit`,"git rev-list":`Enumerating candidate commits`,"git clone":`Cloning git checkout`,"preflight worktree":`Preparing preflight worktree`,"preflight cleanup":`Cleaning preflight worktree`,"deps install":`Installing dependencies`,build:`Building`,"ui:build":`Building UI assets`,"ui:build (post-doctor repair)":`Restoring missing UI assets`,"ui assets verify":`Validating UI assets`,"openclaw doctor entry":`Checking doctor entrypoint`,"openclaw doctor":`Running doctor checks`,"git rev-parse HEAD (after)":`Verifying update`,"global update":`Updating via package manager`,"global update (omit optional)":`Retrying update without optional deps`,"global install":`Installing global package`};function Be(e){return ze[e.name]??e.name}function Ve(e){if(e.status!==`error`||e.mode!==`npm`)return[];let t=[...e.steps].toReversed().find(e=>e.exitCode!==0);if(!t)return[];let n=(t.stderrTail??``).toLowerCase(),r=[];return t.name.startsWith(`global update`)&&n.includes(`eacces`)&&(r.push(`Detected permission failure (EACCES). Re-run with a writable global prefix or sudo (for system-managed Node installs).`),r.push(`Example: npm config set prefix ~/.local && npm i -g openclaw@latest`)),t.name.startsWith(`global update`)&&(n.includes(`node-gyp`)||n.includes(`prebuild`))&&(r.push(`Detected native optional dependency build failure. The updater retries with --omit=optional automatically.`),r.push(`If it still fails: npm i -g openclaw@latest --omit=optional`)),r}function He(e){if(!e)return{progress:{},stop:()=>{}};let t=null;return{progress:{onStepStart:e=>{t=Se(),t.start(r.accent(Be(e)))},onStepComplete:e=>{if(!t)return;let n=Be(e),a=r.muted(`(${m(e.durationMs)})`),o=e.exitCode===0?r.success(`✓`):r.error(`✗`);if(t.stop(`${o} ${n} ${a}`),t=null,e.exitCode!==0&&e.stderrTail){let t=e.stderrTail.split(`
1
+ import{g as e,n as t,u as n}from"./paths-B4IRk3wi.js";import{A as r,p as i}from"./subsystem-C5XF2Fy5.js";import{h as a}from"./utils-UGOV_184.js";import{Zs as o,nc as s}from"./model-selection-BlC_rXAN.js";import{V as c}from"./reply-CjyZeZ-j.js";import"./agent-scope-DXZc3eNT.js";import{t as l}from"./openclaw-root-D_0Q6--h.js";import"./github-copilot-token-DGYAlOmV.js";import{n as u,r as d,t as f}from"./command-format-BbDT1tlm.js";import"./boolean-Ch3DfXPy.js";import"./env-D7wNuBx1.js";import"./env-overrides-DXJbFrwI.js";import"./registry-hFAtCSWG.js";import"./skills-DHbOKEGc.js";import"./frontmatter-BkZkwkVO.js";import"./plugins-CYLrFT4h.js";import"./logger-Bl8URnrW.js";import{t as p}from"./exec-DHqLtFYt.js";import"./windows-spawn-AB7ItGAE.js";import"./redact-3_CiXMY6.js";import"./path-alias-guards-mvyLCPlN.js";import"./errors-Bunti32V.js";import"./send-Cgd_VJHR.js";import"./send-hZFDcGLM.js";import"./paths-yLEk_25I.js";import"./chat-envelope-HVpKusFc.js";import"./audio-transcription-runner-D4Bp6MM7.js";import"./image-DsoO5VP5.js";import"./models-config-CdMhNxKV.js";import"./tool-display-DjuSUUbH.js";import"./fetch-guard-DPdY0NXR.js";import"./api-key-rotation-BRt-vnRV.js";import"./local-roots-6waH0SZ0.js";import"./model-catalog-C1kpjR75.js";import"./proxy-fetch-BADsUK4d.js";import"./tokens-XGbQGn67.js";import"./deliver-ClBkV2eD.js";import"./commands-CGpM84iR.js";import"./commands-registry-B1x54ukc.js";import"./pairing-store-Cg2UxreQ.js";import"./fetch-Dikjvc5M.js";import"./call-CqoMqP5b.js";import"./with-timeout-WveKxvFV.js";import"./diagnostic-DOzHPnht.js";import"./send-B7sHR38c2.js";import"./pi-model-discovery-Dps1PPWz.js";import"./exec-approvals-allowlist-CE3nYh0K.js";import"./exec-safe-bin-runtime-policy-Dt0GchLp.js";import"./ir-Dk7OQ4bA.js";import"./render-D8OWO2hT.js";import"./target-errors-a35Md15n.js";import"./read-only-account-inspect-DBwAwB3_.js";import"./channel-selection-CbNtbAEf.js";import"./plugin-auto-enable-DpVL6-ES.js";import"./send-C-AP01PR.js";import"./outbound-attachment-B7wMxwj6.js";import"./delivery-queue-CKbauSFq.js";import"./send-DbeEC2a3.js";import"./channel-activity-YjYNzCpJ.js";import"./tables-Oieq7UbT.js";import"./fetch-Bn0mWg6a.js";import{r as m}from"./format-duration-D5AMtmHa.js";import"./skill-commands-HJHHZqt6.js";import"./workspace-dirs-BhF1Dzxt.js";import"./pairing-token-BjYBuREl.js";import"./restart-CHXEHdSC.js";import"./runtime-web-tools-bz76ZaRc.js";import"./command-secret-targets-BVN3kiT9.js";import"./session-cost-usage-BgqKixv0.js";import"./connection-auth-C8iru0UB.js";import"./onboard-helpers-zwybUJWu.js";import{n as h}from"./prompt-style-CXKekIBY.js";import"./pairing-labels-BUU_-70B.js";import"./memory-cli-jhzJ3as7.js";import"./query-expansion-0OxEb1Io.js";import"./manager-M1GKhLUC.js";import{t as g}from"./links-CySwdMcF.js";import"./cli-utils-BY7dLMFy.js";import{t as _}from"./help-format-BRbF_INg.js";import"./progress-LNttnI-y.js";import"./exec-approvals-BpBNEy6i.js";import"./nodes-screen-DECgxo6A.js";import"./system-run-command-DEWnZE0r.js";import"./runtime-BC5Ep2pJ.js";import"./stagger-DmFYysrJ.js";import{m as v,p as y,u as b}from"./arg-split-DE5RqDHq.js";import{n as x}from"./cmd-argv-BBT5l8AV.js";import{r as S}from"./runtime-guard-DFYBaYZS.js";import"./program-context-lyPXjPfN.js";import"./skills-status-BWIugRCz.js";import{n as C}from"./command-options-Bq5nQxz6.js";import"./note-D4GAwgha.js";import"./install-safe-path-iesxijn2.js";import"./npm-pack-install-B23L-AtF.js";import"./skill-scanner-CUUF3Fvo.js";import"./installs-BNeI_oML.js";import{n as ee}from"./issue-format-BT7cQEt3.js";import"./channels-status-issues-PRgOT90w.js";import{r as w}from"./completion-cli-Bizog38J.js";import"./daemon-install-plan.shared-CfA37Ut_.js";import"./gateway-install-token-DiDvDPJQ.js";import"./systemd-D7odsu4K.js";import{n as te}from"./service-BtB9epJk.js";import"./lifecycle-core-LM5UUUB1.js";import"./systemd-hints-C0DKDl35.js";import{a as T,i as E,l as D,o as O,r as k}from"./daemon-cli-DOTKuS7d.js";import"./probe-auth-BMA0yM94.js";import"./diagnostics-BgbeL9KE.js";import{n as A,t as j}from"./table-CY440fI1.js";import"./health-RQzDNQwf.js";import"./control-ui-assets-BIa0GGDg.js";import{d as M,g as N,h as P,i as ne,m as F,n as I,o as re,r as ie,u as ae}from"./channel-account-context-BMPAMZEv.js";import{a as L,c as R,i as oe,l as z,n as se,o as ce,r as le,s as ue,t as de}from"./update-runner-mMbwEOlU.js";import{i as fe,n as pe,t as me}from"./status.update-DoSzHu2F.js";import"./logging-Dqe9dxSX.js";import"./oauth-tls-preflight-ByNjbUR5.js";import{n as he,t as ge}from"./update-BGrxUIyz.js";import"./doctor-config-flow-DnOyVZhQ.js";import"./systemd-linger-C2MJD6KG.js";import"./health-format-VBr6LEpt.js";import{n as _e,t as ve}from"./prompt-select-styled-DmTwJKOO.js";import{r as B,t as ye}from"./doctor-completion-Da0cocZX.js";import V from"node:os";import H from"node:path";import U from"node:fs/promises";import{spawn as be,spawnSync as xe}from"node:child_process";import{confirm as W,isCancel as G,spinner as Se}from"@clack/prompts";function K(e){let t=e?Number.parseInt(e,10)*1e3:void 0;return t!==void 0&&(Number.isNaN(t)||t<=0)?(i.error(`--timeout must be a positive integer (seconds)`),i.exit(1),null):t}const q=`https://github.com/openclaw/openclaw.git`,Ce=8e3,we=`openclaw`,Te=new Set([we]);function Ee(e){return ue(e,[`openclaw`,we])}function De(e){let t=e.trim();if(!t)return null;let n=t.startsWith(`v`)?t.slice(1):t;return S(n)?n:null}async function Oe(e,t){return De(e)||((await ne({tag:e,timeoutMs:t})).version??null)}async function ke(e){try{return await U.stat(H.join(e,`.git`)),!0}catch{return!1}}async function Ae(e){let t=await R(e);return!!(t&&Te.has(t))}async function je(e){try{return(await U.readdir(e)).length===0}catch{return!1}}function Me(){let e=process.env.OPENCLAW_GIT_DIR?.trim();return e?H.resolve(e):Ne()}function Ne(){return e(process.env,V.homedir)}function J(){let e=H.basename(process.execPath).toLowerCase();return e===`node`||e===`node.exe`?process.execPath:`node`}async function Y(){return await l({moduleUrl:import.meta.url,argv1:process.argv[1],cwd:process.cwd()})??process.cwd()}async function X(e){let t=e.argv.join(` `);e.progress?.onStepStart?.({name:e.name,command:t,index:0,total:0});let n=Date.now(),r=await p(e.argv,{cwd:e.cwd,timeoutMs:e.timeoutMs}),i=Date.now()-n,a=c(r.stderr,Ce);return e.progress?.onStepComplete?.({name:e.name,command:t,index:0,total:0,durationMs:i,exitCode:r.code,stderrTail:a}),{name:e.name,command:t,cwd:e.cwd??process.cwd(),durationMs:i,exitCode:r.code,stdoutTail:c(r.stdout,Ce),stderrTail:a}}async function Pe(e){if(!await a(e.dir))return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],timeoutMs:e.timeoutMs,progress:e.progress});if(!await ke(e.dir)){if(!await je(e.dir))throw Error(`OPENCLAW_GIT_DIR points at a non-git directory: ${e.dir}. Set OPENCLAW_GIT_DIR to an empty folder or an openclaw checkout.`);return await X({name:`git clone`,argv:[`git`,`clone`,q,e.dir],cwd:e.dir,timeoutMs:e.timeoutMs,progress:e.progress})}if(!await Ae(e.dir))throw Error(`OPENCLAW_GIT_DIR does not look like a core checkout: ${e.dir}.`);return null}async function Z(e){let t=Ie();if(e.installKind===`package`){let n=await oe(t,e.root,e.timeoutMs);if(n)return n}return await le(t,e.timeoutMs)??`npm`}async function Fe(e,t){let n=H.join(e,`openclaw.mjs`);if(!await a(n))return;let o=xe(J(),[n,`completion`,`--write-state`],{cwd:e,env:process.env,encoding:`utf-8`});if(o.error){t||i.log(r.warn(`Completion cache update failed: ${String(o.error)}`));return}if(o.status!==0&&!t){let e=(o.stderr??``).toString().trim(),t=e?` (${e})`:``;i.log(r.warn(`Completion cache update failed${t}.`))}}function Ie(){return async(e,t)=>{let n=await p(e,t);return{stdout:n.stdout,stderr:n.stderr,code:n.code}}}function Le(e){let t=e.sha?e.sha.slice(0,8):null,n=e.branch&&e.branch!==`HEAD`?e.branch:null,r=e.tag;return[n??(r?`detached`:`git`),r?`tag ${r}`:null,t?`@ ${t}`:null].filter(Boolean).join(` · `)}async function Re(e){let t=K(e.timeout);if(t===null)return;let n=await Y(),a=await o(),s=a.valid?F(a.config.update?.channel):null,c=await I({root:n,timeoutMs:t??3500,fetchGit:!0,includeRegistry:!0}),l=N({configChannel:s,installKind:c.installKind,gitTag:c.git?.tag??null,gitBranch:c.git?.branch??null}),u=l.label,d=c.installKind===`git`?Le({branch:c.git?.branch??null,tag:c.git?.tag??null,sha:c.git?.sha??null}):null,f=fe(c),p=pe(c).replace(/^Update:\s*/i,``);if(e.json){i.log(JSON.stringify({update:c,channel:{value:l.channel,source:l.source,label:u,config:s},availability:f},null,2));return}let m=j(),h=[{Item:`Install`,Value:c.installKind===`git`?`git (${c.root??`unknown`})`:c.installKind===`package`?c.packageManager:`unknown`},{Item:`Channel`,Value:u},...d?[{Item:`Git`,Value:d}]:[],{Item:`Update`,Value:f.available?r.warn(`available · ${p}`):p}];i.log(r.heading(`OpenClaw update status`)),i.log(``),i.log(A({width:m,columns:[{key:`Item`,header:`Item`,minWidth:10},{key:`Value`,header:`Value`,flex:!0,minWidth:24}],rows:h}).trimEnd()),i.log(``);let g=me(c);g&&i.log(r.warn(g))}const ze={"clean check":`Working directory is clean`,"upstream check":`Upstream branch exists`,"git fetch":`Fetching latest changes`,"git rebase":`Rebasing onto target commit`,"git rev-parse @{upstream}":`Resolving upstream commit`,"git rev-list":`Enumerating candidate commits`,"git clone":`Cloning git checkout`,"preflight worktree":`Preparing preflight worktree`,"preflight cleanup":`Cleaning preflight worktree`,"deps install":`Installing dependencies`,build:`Building`,"ui:build":`Building UI assets`,"ui:build (post-doctor repair)":`Restoring missing UI assets`,"ui assets verify":`Validating UI assets`,"openclaw doctor entry":`Checking doctor entrypoint`,"openclaw doctor":`Running doctor checks`,"git rev-parse HEAD (after)":`Verifying update`,"global update":`Updating via package manager`,"global update (omit optional)":`Retrying update without optional deps`,"global install":`Installing global package`};function Be(e){return ze[e.name]??e.name}function Ve(e){if(e.status!==`error`||e.mode!==`npm`)return[];let t=[...e.steps].toReversed().find(e=>e.exitCode!==0);if(!t)return[];let n=(t.stderrTail??``).toLowerCase(),r=[];return t.name.startsWith(`global update`)&&n.includes(`eacces`)&&(r.push(`Detected permission failure (EACCES). Re-run with a writable global prefix or sudo (for system-managed Node installs).`),r.push(`Example: npm config set prefix ~/.local && npm i -g openclaw@latest`)),t.name.startsWith(`global update`)&&(n.includes(`node-gyp`)||n.includes(`prebuild`))&&(r.push(`Detected native optional dependency build failure. The updater retries with --omit=optional automatically.`),r.push(`If it still fails: npm i -g openclaw@latest --omit=optional`)),r}function He(e){if(!e)return{progress:{},stop:()=>{}};let t=null;return{progress:{onStepStart:e=>{t=Se(),t.start(r.accent(Be(e)))},onStepComplete:e=>{if(!t)return;let n=Be(e),a=r.muted(`(${m(e.durationMs)})`),o=e.exitCode===0?r.success(`✓`):r.error(`✗`);if(t.stop(`${o} ${n} ${a}`),t=null,e.exitCode!==0&&e.stderrTail){let t=e.stderrTail.split(`
2
2
  `).slice(-10);for(let e of t)e.trim()&&i.log(` ${r.error(e)}`)}}},stop:()=>{t&&=(t.stop(),null)}}}function Ue(e){return e===0?r.success(`✓`):e===null?r.warn(`?`):r.error(`✗`)}function We(e,t){if(t.json){i.log(JSON.stringify(e,null,2));return}let n=e.status===`ok`?r.success:e.status===`skipped`?r.warn:r.error;if(i.log(``),i.log(`${r.heading(`Update Result:`)} ${n(e.status.toUpperCase())}`),e.root&&i.log(` Root: ${r.muted(e.root)}`),e.reason&&i.log(` Reason: ${r.muted(e.reason)}`),e.before?.version||e.before?.sha){let t=e.before.version??e.before.sha?.slice(0,8)??``;i.log(` Before: ${r.muted(t)}`)}if(e.after?.version||e.after?.sha){let t=e.after.version??e.after.sha?.slice(0,8)??``;i.log(` After: ${r.muted(t)}`)}if(!t.hideSteps&&e.steps.length>0){i.log(``),i.log(r.heading(`Steps:`));for(let t of e.steps){let e=Ue(t.exitCode),n=r.muted(`(${m(t.durationMs)})`);if(i.log(` ${e} ${t.name} ${n}`),t.exitCode!==0&&t.stderrTail){let e=t.stderrTail.split(`
3
3
  `).slice(0,5);for(let t of e)t.trim()&&i.log(` ${r.error(t)}`)}}}let a=Ve(e);if(a.length>0){i.log(``),i.log(r.heading(`Recovery hints:`));for(let e of a)i.log(` - ${r.warn(e)}`)}i.log(``),i.log(`Total time: ${r.muted(m(e.durationMs))}`)}function Q(e){return e.replace(/'/g,`'\\''`)}function Ge(e){return/^[A-Za-z0-9 _\-().]+$/.test(e)}function Ke(e){let t=e.OPENCLAW_SYSTEMD_UNIT?.trim();return t?t.endsWith(`.service`)?t:`${t}.service`:`${y(e.OPENCLAW_PROFILE)}.service`}function qe(e){return e.OPENCLAW_LAUNCHD_LABEL?.trim()||b(e.OPENCLAW_PROFILE)}function Je(e){return e.OPENCLAW_WINDOWS_TASK_NAME?.trim()||v(e.OPENCLAW_PROFILE)}async function Ye(e=process.env,n=t){let r=V.tmpdir(),i=Date.now(),a=process.platform,o=``,s=``;try{if(a===`linux`){let t=Q(Ke(e));s=`openclaw-restart-${i}.sh`,o=`#!/bin/sh
4
4
  # Standalone restart script — survives parent process termination.
@@ -74,4 +74,4 @@ ${r.heading(`Notes:`)}
74
74
  - Skips update if the working directory has uncommitted changes
75
75
 
76
76
  ${r.muted(`Docs:`)} ${g(`/cli/update`,`docs.openclaw.ai/cli/update`)}`}).action(async e=>{try{await lt({json:!!e.json,restart:!!e.restart,dryRun:!!e.dryRun,channel:e.channel,tag:e.tag,timeout:e.timeout,yes:!!e.yes})}catch(e){i.error(String(e)),i.exit(1)}});t.command(`wizard`).description(`Interactive update wizard`).option(`--timeout <seconds>`,`Timeout for each update step in seconds (default: 1200)`).addHelpText(`after`,`\n${r.muted(`Docs:`)} ${g(`/cli/update`,`docs.openclaw.ai/cli/update`)}\n`).action(async(e,t)=>{try{await ut({timeout:ft(e,t)})}catch(e){i.error(String(e)),i.exit(1)}}),t.command(`status`).description(`Show update channel and version status`).option(`--json`,`Output result as JSON`,!1).option(`--timeout <seconds>`,`Timeout for update checks in seconds (default: 3)`).addHelpText(`after`,()=>`\n${r.heading(`Examples:`)}\n${_([[`openclaw update status`,`Show channel + version status.`],[`openclaw update status --json`,`JSON output.`],[`openclaw update status --timeout 10`,`Custom timeout.`]])}\n\n${r.heading(`Notes:`)}\n${r.muted(`- Shows current update channel (stable/beta/dev) and source`)}\n${r.muted(`- Includes git tag/branch/SHA for source checkouts`)}\n\n${r.muted(`Docs:`)} ${g(`/cli/update`,`docs.openclaw.ai/cli/update`)}`).action(async(e,t)=>{try{await Re({json:!!e.json||dt(t),timeout:ft(e,t)})}catch(e){i.error(String(e)),i.exit(1)}})}export{pt as registerUpdateCli};
77
- //# sourceMappingURL=update-cli-C0qadZEs.js.map
77
+ //# sourceMappingURL=update-cli-Ibrshx_w.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qqbrowser/openclaw-qbot",
3
- "version": "0.0.143",
3
+ "version": "0.0.145",
4
4
  "description": "Multi-channel AI gateway with extensible messaging integrations",
5
5
  "keywords": [],
6
6
  "homepage": "https://github.com/openclaw/openclaw#readme",
@@ -95,7 +95,7 @@
95
95
  "cacheRead": 0,
96
96
  "cacheWrite": 0
97
97
  },
98
- "contextWindow": 200000,
98
+ "contextWindow": 128000,
99
99
  "maxTokens": 8192
100
100
  }
101
101
  ]