UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.86 kB
import{n as isTruthyEnvValue}from"./env-fLMEolk5.mjs";import{r as resolveOpenClawPackageRootSync}from"./openclaw-root-DP80HYD2.mjs";import{n as resolveCommitHash,t as gitCommitPrefixesMatch}from"./git-commit-Cb3n8ZQM.mjs";import{n as readInstallOwner}from"./install-owner-BPkbFuTm.mjs";import{i as readBuiltRuntimeIsolation,r as readBuiltRuntimeCommit}from"./update-git-runtime-Bysaru5h.mjs"; //!src/commands/doctor-stale-runtime-build.ts const STALE_RUNTIME_BUILD_CHECK_ID=`core/doctor/stale-runtime-build`;async function collectStaleRuntimeBuildFindings(e={}){const t=e.env??process.env;if(isTruthyEnvValue(t.OPENCLAW_UPDATE_IN_PROGRESS))return[];const n=e.root??resolveOpenClawPackageRootSync({moduleUrl:import.meta.url});if(!n||await readInstallOwner(n))return[];const[r,i]=await Promise.all([readBuiltRuntimeCommit(n),readBuiltRuntimeIsolation(n)]);const a=i?[{checkId:STALE_RUNTIME_BUILD_CHECK_ID,severity:`warning`,message:`This immutable release was built by the operator${i.account?` ${i.account} (uid ${i.uid}, gid ${i.gid})`:``} without an isolated build account.`,path:n,details:i,fixHint:`See https://docs.openclaw.ai/cli/update for build-account provisioning. The sealed release remains usable.`}]:[];if(!r)return a;const{GIT_COMMIT:o,GIT_SHA:s,...c}=t;const l=resolveCommitHash({cwd:n,env:c});if(!l||gitCommitPrefixesMatch(r,l))return a;return[...a,{checkId:STALE_RUNTIME_BUILD_CHECK_ID,severity:`warning`,category:`fix-now`,docsUrl:`https://docs.openclaw.ai/install/updating`,message:`Running build came from commit ${r.slice(0,7)}, but the checkout is at ${l.slice(0,7)}; the loaded runtime is older than its source.`,path:n,fixHint:"Run `openclaw update` to rebuild and restart through the update lifecycle. For a manual build, stop the Gateway before running `pnpm build`, then start it again."}]}export{collectStaleRuntimeBuildFindings};