openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 992 B
JavaScript
import{v as resolveExecWrapperTrustPlan}from"./exec-command-resolution-BI7wY-6_.mjs";import{n as EXEC_AUTO_REVIEW_DISPATCH_IDENTITY_WARNING}from"./exec-auto-review-jxGBLhyY.mjs";
//!src/infra/exec-auto-approval-eligibility.ts
function resolveUnpinnedAutoApprovalEligibility(e){const t={eligible:false,reason:EXEC_AUTO_REVIEW_DISPATCH_IDENTITY_WARNING};if(!e.authorizationPlan?.ok||!e.binding)return t;const n=e.authorizationPlan.groups.flatMap(e=>e.candidates);if(n.length===0)return t;for(const r of n){if(r.transport.kind!==`direct`)return t;const n=r.sourceSegment;const i=resolveExecWrapperTrustPlan(n.sourceArgv??n.argv,void 0,e.platform);if(n.resolution?.policyBlocked||!i.dispatchChain)return t;if(![...i.dispatchChain.slice(0,-1).map(e=>e.slice(0,1)),n.argv].every(t=>e.binding?.operands.some(e=>e.executable===true&&e.snapshot.argvIndex===0&&e.argv.length===t.length&&e.argv.every((e,n)=>e===t[n]))))return t}return{eligible:true}}export{resolveUnpinnedAutoApprovalEligibility as t};