UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.27 kB
import{l as normalizeOptionalString}from"./string-coerce-CpTFcSwY.mjs";import{t as isOsRequirementSatisfied}from"./requirements-C8NELC6G.mjs"; //!src/shared/entry-status.ts function evaluateEntryRequirementsForCurrentPlatform(e){const{metadata:t,frontmatter:n}=e.entry;const r=t?.emoji??n?.emoji;const i=normalizeOptionalString(t?.homepage??n?.homepage??n?.website??n?.url);const{always:a,hasLocalBin:o,isEnvSatisfied:s,isConfigSatisfied:c,remote:l}=e;const u=e.platform??process.platform;const d={bins:t?.requires?.bins??[],anyBins:t?.requires?.anyBins??[],env:t?.requires?.env??[],config:t?.requires?.config??[],os:t?.os??[]};const f=l?.hasBin;const p=l?.hasAnyBin;const m=d.bins.filter(e=>!o(e)&&!f?.(e));const h=d.anyBins.length===0||d.anyBins.some(e=>o(e))||p?.(d.anyBins)?[]:d.anyBins;const g=isOsRequirementSatisfied(d.os,[u,...l?.platforms??[]])?[]:d.os;const _=d.env.filter(e=>!s(e));const v=d.config.map(e=>({path:e,satisfied:c(e)}));const y=v.filter(e=>!e.satisfied).map(e=>e.path);const b={bins:a?[]:m,anyBins:a?[]:h,env:a?[]:_,config:a?[]:y,os:g};const x=Object.values(b).every(e=>e.length===0);return{...r?{emoji:r}:{},...i?{homepage:i}:{},required:d,missing:b,requirementsSatisfied:x,configChecks:v}}export{evaluateEntryRequirementsForCurrentPlatform as t};