UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 996 B
import{i as executableFileExistsSync}from"./path-existence-BR9MXlgL.mjs";import"./path-existence-runtime-BFjuPvea.mjs";import path from"node:path"; //!extensions/crabbox/src/crabbox-binary.ts function binaryCandidates(e,t){return t===`win32`?[`.exe`,`.cmd`,`.bat`,`.com`,``].map(t=>`${e}${t}`):[e]}function resolveCrabboxBinary(e){return e.explicit||findCrabboxBinary(e)||`crabbox`}function findCrabboxBinary(e){const t=e.platform??process.platform;const n=e.isExecutable??(e=>executableFileExistsSync(e,t));if(e.explicit)return n(e.cwd?path.resolve(e.cwd,e.explicit):e.explicit)?e.explicit:void 0;if(e.openclawRoot){const r=path.resolve(e.cwd??`.`,e.openclawRoot,`../crabbox/bin/crabbox`);for(const e of binaryCandidates(r,t))if(n(e))return e}const r=t===`win32`?`;`:`:`;const i=binaryCandidates(`crabbox`,t);for(const t of(e.pathEnv??``).split(r)){if(!t)continue;for(const r of i){const i=path.resolve(e.cwd??`.`,t,r);if(n(i))return i}}}export{resolveCrabboxBinary as n,findCrabboxBinary as t};