@vibgrate/cli 2026.701.1 → 2026.701.3
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.
- package/dist/baseline-XEV4GNTD.js +1 -0
- package/dist/{chunk-JW5BRLSC.js → chunk-4CCVMPJI.js} +2 -2
- package/dist/{chunk-JSRJCKDX.js → chunk-MDXZ22QE.js} +1 -1
- package/dist/{chunk-2GHB73ES.js → chunk-VJR7ZTM5.js} +29 -29
- package/dist/cli.js +1 -1
- package/dist/{dist-FEZOAZJW.js → dist-XQIPFIBN.js} +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/baseline-JOD5BTND.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{h as baselineCommand,g as runBaseline}from'./chunk-4CCVMPJI.js';import'./chunk-VJR7ZTM5.js';import'./chunk-MKDRULJ6.js';import'./chunk-XTHPCEME.js';import'./chunk-EK7ODJWE.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {kb}from'./chunk-
|
|
2
|
-
`,"utf8");}async function E(e,t){await m(s.dirname(e)),await i.writeFile(e,t,"utf8");}var n;async function f(){if(n!==void 0)return n??void 0;try{n=(await import('./dist-
|
|
1
|
+
import {kb}from'./chunk-VJR7ZTM5.js';import*as s from'path';import {Command}from'commander';import r from'chalk';import {execFile}from'child_process';import*as i from'fs/promises';import'os';import {promisify}from'util';var o=class{available;queue=[];constructor(t){this.available=t;}async run(t){await this.acquire();try{return await t()}finally{this.release();}}acquire(){return this.available>0?(this.available--,Promise.resolve()):new Promise(t=>this.queue.push(t))}release(){let t=this.queue.shift();t?t():this.available++;}};promisify(execFile);function v(e){return e.charCodeAt(0)===65279?e.slice(1):e}async function j(e){let t=await i.readFile(e,"utf8");return JSON.parse(v(t))}async function D(e){try{return await i.access(e),!0}catch{return false}}async function m(e){await i.mkdir(e,{recursive:true});}async function h(e,t){await m(s.dirname(e)),await i.writeFile(e,JSON.stringify(t,null,2)+`
|
|
2
|
+
`,"utf8");}async function E(e,t){await m(s.dirname(e)),await i.writeFile(e,t,"utf8");}var n;async function f(){if(n!==void 0)return n??void 0;try{n=(await import('./dist-XQIPFIBN.js')).advancedScanHook??null;}catch{n=null;}return n??void 0}async function b(e){console.log(r.dim("Creating baseline..."));let t=await f(),c=await kb(e,{format:"text",concurrency:8},t),p=s.join(e,".vibgrate","baseline.json");await h(p,c),console.log(r.green("\u2714")+` Baseline saved to ${r.bold(".vibgrate/baseline.json")}`),console.log(r.dim(` Baseline score: ${c.drift.score}/100`));}var N=new Command("baseline").description("Create a drift baseline snapshot").argument("[path]","Path to baseline",".").action(async e=>{let t=s.resolve(e);await b(t);});export{o as a,j as b,D as c,m as d,E as e,f,b as g,N as h};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {db,kb}from'./chunk-
|
|
1
|
+
import {db,kb}from'./chunk-VJR7ZTM5.js';import {a}from'./chunk-MKDRULJ6.js';import {j as j$1,n,i,o,p,d}from'./chunk-XTHPCEME.js';import {b}from'./chunk-EK7ODJWE.js';import*as I from'path';import*as V from'fs/promises';import*as w from'typescript';var Y={healthyMax:33,elevatedMax:66},D={healthy:"#3FB0A4",elevated:"#D9A441",critical:"#D0463B"},na={healthy:"Healthy",elevated:"Elevated",critical:"Critical"};function X(e){return e==null||Number.isNaN(e)?null:e<=Y.healthyMax?"healthy":e<=Y.elevatedMax?"elevated":"critical"}function H(e){let a=X(e);return a?D[a]:"#6B7785"}function le(e){let a=X(e);return a?na[a]:"Not scored"}function de(e){return e==null||Number.isNaN(e)||e===0?"flat":e<0?"good":"bad"}function ce(e){if(e==null||Number.isNaN(e))return "\u2014";if(e===0)return "\xB1 0";let a=Math.abs(e);return e>0?`\u25B2 +${a}`:`\u25BC \u2212${a}`}var Ce=8;function ue(e){return `Q${Math.floor(e.getUTCMonth()/3)+1} ${e.getUTCFullYear()}`}function sa(e){return e<=30?30:e<=60?60:e<=90?90:180}function oa(e){return e>0?"breached":e>=-5?"at-risk":"on-track"}function ra(e){let a=e.kpis;if(!a||a.estateDriftScore==null)return "No scan data yet \u2014 run a scan to establish a baseline.";let s=e.budgets.filter(r=>r.current-r.budget>0).length,n=[],t=de(a.driftDelta);return t==="good"&&a.driftDelta!=null?n.push(`Portfolio drift improved ${Math.abs(a.driftDelta)} pts`):t==="bad"&&a.driftDelta!=null?n.push(`Portfolio drift rose ${a.driftDelta} pts`):n.push(`Portfolio drift held at ${a.estateDriftScore}`),s>0?n.push(`${s} ${s===1?"scope is":"scopes are"} over budget`):n.push("all scopes within budget"),`${n.join("; ")}.`}function ia(e){if(e.length<2)return null;let a=e[e.length-1],s=e[e.length-2],n=a.score-s.score;if(n<=0)return "At current pace, portfolio drift is flat or improving \u2014 no band crossing forecast.";let t=Y.healthyMax+1;if(a.score>=t)return "Portfolio is already in the amber band \u2014 prioritise remediation to return to healthy.";let r=Math.ceil((t-a.score)/n);return `At current pace, portfolio crosses into amber in ~${r} period${r===1?"":"s"}.`}function la(e){let a=e.generatedAt??new Date,s=e.period??ue(a),n=e.kpis,t=ca(e.trend),r=e.topRisks.slice(0,5).map((i,d)=>({rank:d+1,label:i.label,scope:i.scope,score:i.score,delta:i.delta??null,driver:i.driver,owner:i.owner})),o=e.budgets.map(i=>{let d=i.current-i.budget;return {...i,variance:d,state:oa(d)}}).sort((i,d)=>d.variance-i.variance),c=e.horizon.filter(i=>i.daysRemaining>=0).map(i=>({...i,lane:sa(i.daysRemaining)})).sort((i,d)=>i.daysRemaining-d.daysRemaining),u=o.filter(i=>i.state==="breached").length,p=e.benchmark?{...e.benchmark,anonymitySatisfied:e.benchmark.cohortSize>=Ce}:null;return {instanceId:`${s}-${(e.asOf??a.toISOString()).slice(0,10)}`,org:e.org,period:s,preparedFor:e.preparedFor,asOf:e.asOf??a.toISOString(),generatedAt:a.toISOString(),confidentiality:"Confidential",headline:{score:n?.estateDriftScore??null,priorScore:n?.priorScore??null,delta:n?.driftDelta??null,breachCount:u,verdict:ra(e)},commentary:e.commentary,trajectory:t,forecastNote:ia(t),risks:r,budgets:o,horizon:c,benchmark:p,roi:e.roi}}function ca(e){if(e.length===0)return [];let a=[...e].sort((t,r)=>t.day.localeCompare(r.day)),s=[],n=null;for(let t of a){let r=Math.round(t.avg_score),o=n==null?0:r-n;s.push({period:t.day,score:r,added:o>0?o:0,remediated:o<0?-o:0}),n=r;}return s}var N={navy:"#182346",teal:"#3FB0A4",ink:"#0E2330",paper:"#F4F6F5"};function x(e){return e==null?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function we(e,a){if(!e)return "\u2014";try{return new Date(e).toLocaleDateString(a,{year:"numeric",month:"short",day:"numeric"})}catch{return x(e)}}function Re(e,a){if(!e)return "\u2014";try{return new Date(e).toLocaleString(a,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"})}catch{return x(e)}}function pa(e){if(e.length<2)return '<div class="chart-empty">Baseline established \u2014 trend available next cycle.</div>';let t=e.map(b=>b.score),r=Math.min(...t,0),c=Math.max(...t,100)-r||1,u=592/(e.length-1),p=b=>24+b*u,i=b=>156-(b-r)/c*132,d=e.map((b,C)=>`${C===0?"M":"L"}${p(C).toFixed(1)},${i(b.score).toFixed(1)}`).join(" "),g=e[e.length-1],m=e[e.length-2],y=g.score-m.score,l={x:p(e.length-1)+u,v:g.score+y},f={x:l.x+u,v:g.score+y*2},h=`M${p(e.length-1).toFixed(1)},${i(g.score).toFixed(1)} L${l.x.toFixed(1)},${i(l.v).toFixed(1)} L${f.x.toFixed(1)},${i(f.v).toFixed(1)}`,k=i(34),v=e.map((b,C)=>`<circle cx="${p(C).toFixed(1)}" cy="${i(b.score).toFixed(1)}" r="2.5" fill="${H(b.score)}" />`).join("");return `<svg viewBox="0 0 ${640+u*2} 180" width="100%" role="img" aria-label="DriftScore trend with forecast">
|
|
2
2
|
<line x1="24" y1="${k.toFixed(1)}" x2="${640+u*2-24}" y2="${k.toFixed(1)}" stroke="${D.elevated}" stroke-width="1" stroke-dasharray="2 3" opacity="0.6" />
|
|
3
3
|
<path d="${d}" fill="none" stroke="${N.teal}" stroke-width="2.5" />
|
|
4
4
|
<path d="${h}" fill="none" stroke="${N.teal}" stroke-width="2" stroke-dasharray="4 4" opacity="0.7" />
|