UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.39 kB
import{n as resolveOpenClawPackageRoot}from"./openclaw-root-DP80HYD2.mjs";import{r as isPathInside}from"./path-guards-DGttsOJI.mjs";import{o as resolveSandboxPathMapping}from"./path-policy-mjUsNXiY.mjs";import{n as resolveSandboxReferencePath}from"./fs-bridge-CKvXohsa.mjs";import path from"node:path";import fs from"node:fs/promises"; //!src/agents/docs-path.ts const OPENCLAW_DOCS_URL=`https://docs.openclaw.ai`;const OPENCLAW_SOURCE_URL=`https://github.com/openclaw/openclaw`;async function resolveOpenClawReferencePaths(e){const resolveReference=async(t,n)=>{try{await fs.access(path.join(t,n));if(!e.sandbox?.enabled)return t;const r=await fs.realpath(t);const i=e.sandbox.fsBridge;if(!i)return null;const a=i.pathMappings;const o=await resolveSandboxReferencePath(i,{filePath:a?t:r});const s=a?resolveSandboxPathMapping(a,o.containerPath):null;const c=a?s?.hostPath:o.hostPath;return c&&await fs.realpath(c)===r&&(!s||isPathInside(await fs.realpath(s.mapping.hostRoot),r))?o.containerPath:null}catch{return null}};const t=await resolveOpenClawPackageRoot(e);const n=e.workspaceDir?.trim();return{docsPath:(n?await resolveReference(path.join(n,`docs`),`docs.json`):null)??(t?await resolveReference(path.join(t,`docs`),`docs.json`):null),sourcePath:t?await resolveReference(t,`.git`):null}}export{OPENCLAW_SOURCE_URL as n,resolveOpenClawReferencePaths as r,OPENCLAW_DOCS_URL as t};