cc-safety-net 2.5.0 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +0,0 @@
1
- import{Se,I,O,nt,c,o,we,T,p}from"./index-8cqwk53d.js";import{ve,M}from"./index-mrn9mahg.js";function L(n,t={}){return{malformed:!0,denial:I(t),cwd:n}}function ue(n,t){return{malformed:!0,denial:O(n,t),cwd:n.cwd}}function xe(n,t={}){return(e,i)=>{try{return g(e,i,n,t)}catch(a){return console.error("CC Safety Net error:",a),n.block(I())}}}function g(n,t,e,i){let a=c();if(e.cancelled?.(t))return e.block(I());let l=e.extract(n,t,a.paths);if(!l)return e.allow;let d=()=>e.getSessionId(n,t);if("malformed"in l)return ve(a,l.denial,d,{agent:e.agent,toolName:l.denial.toolName,cwd:l.cwd}),e.block(l.denial);let u=(r,m)=>{let s=Se(r,{includeEvidence:m});return s?e.block(s):e.allow};try{let r=M(a,l,{guard:{auditAllowed:we(a.env),policyOptions:i.policyOptions,dependencies:i.guardDependencies},audit:{agent:e.agent,getSessionId:d}});return u(r,!0)}catch(r){if(!(r instanceof p))throw r;if(T(o.debug,a.env))console.error(`CC Safety Net debug: ${e.debugLabel} analysis failed: ${nt(r.cause)}`);return u(r.evaluation,e.includeEvidenceOnError(l))}}
2
- export{L,ue,xe};