UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 954 B
import{o as formatExecSecretRefIdValidationMessage,u as isValidExecSecretRefId}from"./ref-contract-CdpCUlb6.mjs"; //!src/secrets/exec-resolution-policy.ts function selectRefsForExecPolicy(e){const t=[];const n=[];for(const r of e.refs)(r.source===`exec`&&!e.allowExec?n:t).push(r);return{refsToResolve:t,skippedExecRefs:n}}function getSkippedExecRefStaticError(e){const t=e.ref.id.trim();const n=`${e.ref.source}:${e.ref.provider}:${t}`;if(!t)return`Error: Secret reference id is empty.`;if(!isValidExecSecretRefId(t))return`Error: ${formatExecSecretRefIdValidationMessage()} (ref: ${n}).`;const r=e.config.secrets?.providers?.[e.ref.provider];if(!r)return`Error: Secret provider "${e.ref.provider}" is not configured (ref: ${n}).`;if(r.source!==e.ref.source)return`Error: Secret provider "${e.ref.provider}" has source "${r.source}" but ref requests "${e.ref.source}".`;return null}export{selectRefsForExecPolicy as n,getSkippedExecRefStaticError as t};