#!/usr/bin/env node
import {g,i,a as a$1,f as f$1,j,d as d$1,e,k,m,l}from'./chunk-KYA4TP26.js';import {h,f,a,g as g$1,d,b}from'./chunk-WR6D3SC6.js';import'./chunk-5TAVYPOV.js';import t from'chalk';async function M(e){let o=process.cwd(),r=g(o),c=i(r),f$1=Object.keys(r.checks);if(e.json){h({level:r.level,orchestration:r.orchestration,overrides:r.checks,resolved:c});return}f("Enforcement Configuration"),a(""),g$1("Level",$(r.level)),g$1("Orchestration threshold",String(r.orchestration.threshold)+" files"),g$1("Detection",r.orchestration.detection),g$1("Overrides",f$1.length>0?String(f$1.length):t.dim("none")),a("");let i$1=30,m=12,b=12;a("  "+t.dim("Check ID".padEnd(i$1))+t.dim("Severity".padEnd(m))+t.dim("Source")),a("  "+t.dim("\u2500".repeat(i$1+m+b)));for(let v of a$1){let j=c[v],D=r.checks[v]!==void 0?t.cyan("override"):t.dim("preset");a("  "+v.padEnd(i$1)+y(j).padEnd(m+10)+D);}a("");}async function U(e){if(!f$1(e)){d(`Invalid level: ${e}. Must be one of: strict, balanced, minimal`),process.exitCode=1;return}let o=process.cwd();try{j(o,e),b(`Enforcement level set to ${$(e)}`);}catch(r){d(`Failed to set level: ${r.message}`),process.exitCode=1;}}async function H(e$1,o){if(!d$1(e$1)){d(`Unknown check ID: ${e$1}`),a("  Valid IDs: "+a$1.join(", ")),process.exitCode=1;return}if(!e(o)){d(`Invalid severity: ${o}. Must be one of: block, warn, off`),process.exitCode=1;return}let r=process.cwd();try{k(r,e$1,o),b(`Override set: ${e$1} = ${y(o)}`);}catch(c){d(`Failed to set override: ${c.message}`),process.exitCode=1;}}async function P(e){let o=process.cwd();if(!e){try{m(o),b("All enforcement overrides cleared");}catch(r){d(`Failed to reset overrides: ${r.message}`),process.exitCode=1;}return}if(!d$1(e)){d(`Unknown check ID: ${e}`),a("  Valid IDs: "+a$1.join(", ")),process.exitCode=1;return}try{l(o,e),b(`Override removed: ${e} (reverted to preset default)`);}catch(r){d(`Failed to reset override: ${r.message}`),process.exitCode=1;}}async function _(e){let o=process.cwd(),r=g(o),c=i(r);if(e.json){h(c);return}f("Resolved Enforcement Checks"),a("");for(let[f,i]of Object.entries(c))a("  "+f.padEnd(30)+y(i));a("");}function y(e){switch(e){case "block":return t.red("block");case "warn":return t.yellow("warn");case "off":return t.dim("off");default:return String(e)}}function $(e){switch(e){case "strict":return t.red(e);case "balanced":return t.yellow(e);case "minimal":return t.green(e);default:return e}}export{H as enforcementOverrideCommand,P as enforcementResetCommand,_ as enforcementResolveCommand,U as enforcementSetCommand,M as enforcementStatusCommand};