@visulima/vis 1.0.0-alpha.15 → 1.0.0-alpha.16
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/CHANGELOG.md +49 -0
- package/LICENSE.md +44 -233
- package/dist/bin.js +1 -1
- package/dist/config/index.d.ts +121 -94
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/bin.js +271 -271
- package/dist/packem_chunks/config.js +18 -0
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +4 -4
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -5
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -1
- package/dist/packem_chunks/handler21.js +18 -1
- package/dist/packem_chunks/handler22.js +1 -5
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +5 -3
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +3 -1
- package/dist/packem_chunks/handler27.js +1 -7
- package/dist/packem_chunks/handler28.js +1 -23
- package/dist/packem_chunks/handler29.js +7 -3
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +23 -18
- package/dist/packem_chunks/handler31.js +3 -1
- package/dist/packem_chunks/handler32.js +1 -2
- package/dist/packem_chunks/handler33.js +2 -25
- package/dist/packem_chunks/handler34.js +25 -2
- package/dist/packem_chunks/handler35.js +2 -2
- package/dist/packem_chunks/handler36.js +8 -8
- package/dist/packem_chunks/handler37.js +3 -3
- package/dist/packem_chunks/handler38.js +4 -4
- package/dist/packem_chunks/handler39.js +6 -6
- package/dist/packem_chunks/handler40.js +5 -5
- package/dist/packem_chunks/handler41.js +9 -9
- package/dist/packem_chunks/handler42.js +10 -10
- package/dist/packem_chunks/handler43.js +1 -1
- package/dist/packem_chunks/handler44.js +5 -5
- package/dist/packem_chunks/handler45.js +3 -3
- package/dist/packem_chunks/handler46.js +9 -9
- package/dist/packem_chunks/handler47.js +161 -36
- package/dist/packem_chunks/handler48.js +1 -1
- package/dist/packem_chunks/handler5.js +5 -5
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +2 -2
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +16 -16
- package/dist/packem_chunks/index.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_shared/{ai-analysis-CGVjqwdc.js → ai-analysis-C_GpXikx.js} +3 -3
- package/dist/packem_shared/ai-cache-DrCLD4gc.js +1 -0
- package/dist/packem_shared/ai-fix-CWOz12Om.js +43 -0
- package/dist/packem_shared/applyDefaults-DLY94gWA.js +1 -0
- package/dist/packem_shared/cache-directory-C_U1qsIw.js +1 -0
- package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
- package/dist/packem_shared/dependency-scan-YdgNVvoz.js +2 -0
- package/dist/packem_shared/docker-Dl0AoVTZ.js +60 -0
- package/dist/packem_shared/failure-log-CSC6KfcO.js +2 -0
- package/dist/packem_shared/flakiness-Dzz-I3dB.js +1 -0
- package/dist/packem_shared/lifecycle-BC6Nst6i.js +2 -0
- package/dist/packem_shared/{lockfile-B7JJzxnL.js → lockfile-i-qvq_k8.js} +1 -1
- package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
- package/dist/packem_shared/{readTomlSync-1fKo0R52-DAKNI1Me.js → readTomlSync-1fKo0R52-DtxWULlF.js} +1 -1
- package/dist/packem_shared/run-summary-utils-CJv75pla.js +1 -0
- package/dist/packem_shared/runtime-check-CBU6W8qG.js +1 -0
- package/dist/packem_shared/{selectors-Sem2CTYA.js → selectors-B2ISH581.js} +1 -1
- package/dist/packem_shared/toolchain-B7dckBQ1.js +5 -0
- package/dist/packem_shared/typosquats-B3A38-qx.js +1 -0
- package/dist/packem_shared/verify-WDStBFvK.js +1 -0
- package/dist/packem_shared/vis-update-app-D0uL3eO5.js +1 -0
- package/package.json +13 -13
- package/schemas/project.schema.json +12 -2
- package/schemas/vis-config.schema.json +248 -3
- package/dist/packem_chunks/applyDefaults.js +0 -2
- package/dist/packem_shared/ai-cache-BdPgSfg2.js +0 -1
- package/dist/packem_shared/ai-fix-iHtGLkJS.js +0 -43
- package/dist/packem_shared/cache-directory-DTfMSzT9.js +0 -1
- package/dist/packem_shared/dependency-scan-SQeRzrpJ.js +0 -2
- package/dist/packem_shared/docker-D5p9mRPU.js +0 -2
- package/dist/packem_shared/failure-log-CElcbnb9.js +0 -2
- package/dist/packem_shared/flakiness-C4t4_NoA.js +0 -1
- package/dist/packem_shared/otel-CO8UEfTa.js +0 -17
- package/dist/packem_shared/otelPlugin-DTynZDWh.js +0 -1
- package/dist/packem_shared/registry-D04iOQ5H.js +0 -2
- package/dist/packem_shared/run-summary-utils-BPraMTcm.js +0 -1
- package/dist/packem_shared/runtime-check-l4qFpo08.js +0 -1
- package/dist/packem_shared/toolchain-BhZNts--.js +0 -5
- package/dist/packem_shared/typosquats-Dr7VIL2B.js +0 -1
- package/dist/packem_shared/verify-C6NNOhTA.js +0 -1
- package/dist/packem_shared/vis-update-app-DGiMc5kb.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Te=Object.defineProperty;var w=(e,t)=>Te(e,"name",{value:t,configurable:!0});import{createRequire as ze}from"node:module";import{t as Be,aF as Ie,p as Ne,aT as qe}from"./bin.js";import{z as he,M as me,$ as I}from"../packem_shared/otel-CO8UEfTa.js";const Me=ze(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fe=w(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,r]=z.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return z.getBuiltinModule(e)}return Me(e)},"__cjs_getBuiltinModule"),{createRequire:Ge}=Fe("node:module");var De=Object.defineProperty,Ke=w((e,t)=>De(e,"name",{value:t,configurable:!0}),"p$6"),Qe=Object.defineProperty,de=Ke((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"e"),Ve=Object.defineProperty,He=de((e,t)=>Ve(e,"name",{value:t,configurable:!0}),"E");const ge=String.raw,re=ge`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Je=He(()=>new RegExp(ge`\p{RI}{2}|(?)${re}(?:\u200D${re})*`,"gu"),"default");var Ye=Object.defineProperty,Xe=de((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"p");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const T=Je(),Ze=/[-_./\s]+/g,L=/(\u001B\[[0-9;]*[a-z])/i,ne=new RegExp("\\p{Script=Arabic}","u"),et=new RegExp("\\p{Script=Bengali}","u"),_=new RegExp("\\p{Script=Cyrillic}","u"),tt=new RegExp("\\p{Script=Devanagari}","u"),rt=new RegExp("\\p{Script=Ethiopic}","u"),Q=new RegExp("\\p{Script=Greek}","u"),ae=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),nt=new RegExp("\\p{Script=Gujarati}","u"),at=new RegExp("\\p{Script=Gurmukhi}","u"),ie=new RegExp("\\p{Script=Hangul}","u"),se=new RegExp("\\p{Script=Hebrew}","u"),it=new RegExp("\\p{Script=Hiragana}","u"),oe=new RegExp("\\p{Script=Han}","u"),st=new RegExp("\\p{Script=Kannada}","u"),ot=new RegExp("\\p{Script=Katakana}","u"),lt=new RegExp("\\p{Script=Khmer}","u"),ct=new RegExp("\\p{Script=Lao}","u"),O=new RegExp("\\p{Script=Latin}","u"),ut=new RegExp("\\p{Script=Malayalam}","u"),pt=new RegExp("\\p{Script=Myanmar}","u"),ft=new RegExp("\\p{Script=Oriya}","u"),ht=new RegExp("\\p{Script=Sinhala}","u"),mt=new RegExp("\\p{Script=Tamil}","u"),dt=new RegExp("\\p{Script=Telugu}","u"),gt=new RegExp("\\p{Script=Thai}","u"),yt=new RegExp("\\p{Script=Tibetan}","u"),le=/[\u02BB\u02BC\u0027]/u,bt=Xe(e=>e.replace(T,""),"stripEmoji");var $t=Object.defineProperty,ye=w((e,t)=>$t(e,"name",{value:t,configurable:!0}),"i$5"),vt=Object.defineProperty,be=ye((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r"),wt=Object.defineProperty,jt=be((e,t)=>wt(e,"name",{value:t,configurable:!0}),"c");let W=class{static{w(this,"l")}static{ye(this,"y")}static{be(this,"s")}static{jt(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(r=>r!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,r){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,r),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(r=>r!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Et=Object.defineProperty,Ot=w((e,t)=>Et(e,"name",{value:t,configurable:!0}),"r$6"),kt=Object.defineProperty,xt=Ot((e,t)=>kt(e,"name",{value:t,configurable:!0}),"a"),Ct=Object.defineProperty,St=xt((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"s");const Pt=St((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");var At=Object.defineProperty,Lt=w((e,t)=>At(e,"name",{value:t,configurable:!0}),"I"),Wt=Object.defineProperty,q=Lt((e,t)=>Wt(e,"name",{value:t,configurable:!0}),"W");const Rt=Ge(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_t=q(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,r]=M.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return M.getBuiltinModule(e)}return Rt(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:Ut}=_t("node:util");var Tt=Object.defineProperty,zt=q((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"g");const V=new W(1e3),Mt=/[.*+?^${}()|[\]\\]/g,Ft=zt(e=>{const t=e.join("");if(V.has(t))return V.get(t);const r=e.map(a=>a.replaceAll(Mt,String.raw`\$&`)).join("|"),n=new RegExp(r,"g");return V.set(t,n),n},"getSeparatorsRegex");var Bt=Object.defineProperty,It=q((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"t");const Nt=It(e=>{const t=[];let r=0,n;for(T.lastIndex=0;(n=T.exec(e))!==null;)n.index>r&&t.push(e.slice(r,n.index)),t.push(n[0]),r=T.lastIndex;return r<e.length&&t.push(e.slice(r)),t.filter(Boolean)},"splitByEmoji");var qt=Object.defineProperty,$=q((e,t)=>qt(e,"name",{value:t,configurable:!0}),"u");const Gt=/[ČŠŽĐ]/i,$e=new Uint8Array(128),ve=new Uint8Array(128),we=new Uint8Array(128);for(let e=0;e<128;e++)$e[e]=e>=65&&e<=90?1:0,ve[e]=e>=97&&e<=122?1:0,we[e]=e>=48&&e<=57?1:0;const H=$(e=>$e[e],"isUpper"),ce=$(e=>ve[e],"isLower"),J=$(e=>we[e],"isDigit"),A=$((e,t,r,n,a)=>{if(e.length===0)return[];let i=!1;const l=Object.values(t);for(const u of l)if(u(e[0])){i=!0;break}if(!i&&!r)return[e];const o=[...e],h=[];let s=o[0],f="other";const m=Object.entries(t);for(const u of m){const[p,g]=u;if(g(o[0])){f=p;break}}let c=r&&n?o[0]===o[0].toLocaleUpperCase(n):!1;for(let u=1;u<o.length;u++){const p=o[u];let g="other";for(const b of m){const[v,E]=b;if(E(p)){g=v;break}}const y=r&&n?p===p.toLocaleUpperCase(n):!1;let d=!1;a?d=a(f,g,c,y,p,u,o):(f!==g&&f!=="other"&&g!=="other"&&(d=!0),r&&g!=="other"&&!c&&y&&(d=!0)),d?(h.push(s),s=p):s+=p,f=g,r&&(c=y)}return s&&s.length>0&&h.push(s),h.length>0?h:[e]},"handleScriptTransitions"),Dt=$((e,t,r,n)=>{if(r.size===0)return t;for(const a of r)if(e.startsWith(a,t))return n.push(a),t+a.length;return t},"detectAndProcessAcronym"),je=$((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let r=0;const n=[],a=e.length;for(let i=1;i<a;i++){const l=Dt(e,r,t,n);if(l!==r){r=l,i=r-1;continue}const o=e.codePointAt(i-1),h=e.codePointAt(i),s=o&&o<128&&H(o),f=h&&h<128&&H(h),m=o&&o<128&&ce(o),c=o&&o<128&&J(o),u=h&&h<128&&J(h);if(m&&f){n.push(e.slice(r,i)),r=i;continue}if(c&&!u||!c&&u){n.push(e.slice(r,i)),r=i;continue}if(u&&!c){let p=!1,g=!1;if(i+1<a){const y=e.codePointAt(i+1);p=y&&y<128&&H(y),g=y&&y<128&&J(y)}if(!g&&p){n.push(e.slice(r,i),e.slice(i,i+1)),r=i+1;continue}}if(i+1<a){const p=e.codePointAt(i+1),g=p&&p<128&&ce(p);if(s&&f&&g){const y=e.slice(r,i+1);t.has(y)||(n.push(e.slice(r,i)),r=i)}}}return r<a&&n.push(e.slice(r)),n.filter(i=>i!=="")},"splitCamelCaseFast"),Ee=$((e,t,r)=>{if(e.length===0)return[];const n=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!n&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t),p=u,g=u?0:-1;for(let y=1;y<f;y++){const d=s[y],b=d===d.toLocaleUpperCase(t);if(b===u)c+=d;else if(b)c&&c.length>0&&(m.push(c),c=d),p=!0,g=y;else{if(p&&y-g>1){const v=s[y-1],E=c.slice(0,-1);E&&E.length>0&&m.push(E),c=v+d}else c+=d;p=!1,g=-1}u=b}return c&&c.length>0&&m.push(c),m}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0];const u=s[0];let p;_.test(u)?p=1:O.test(u)?p=2:p=0;let g=u===u.toLocaleUpperCase(t);for(let d=1;d<f;d++){const b=s[d];let v;_.test(b)?v=1:O.test(b)?v=2:v=0;const E=b===b.toLocaleUpperCase(t);p!==v&&(p===1||p===2)&&(v===1||v===2)||v===p&&!g&&E?(m.push(c),c=b):c+=b,p=v,g=E}c&&c.length>0&&m.push(c);const y=[];for(let d=0;d<m.length;d++)d<m.length-1&&m[d].length===1&&O.test(m[d])&&_.test(m[d+1][0])?(y.push(m[d]+m[d+1]),d+=1):y.push(m[d]);return y}if(t.startsWith("el")){if(!Q.test(e)&&!O.test(e))return[e];const s=[];ae.lastIndex=0;let f;for(;(f=ae.exec(e))!==null;)s.push(f[0]);s.length===0&&s.push(e);const m=[];if(s.length===1){const c=s[0];if(!c||!Q.test(c[0])||c.length===1)return[c??e]}for(const c of s){if(!c)continue;if(!Q.test(c[0])||c.length===1){m.push(c);continue}const u=c.length;let p=c[0],g=c[0]===c[0].toLocaleUpperCase(t);for(let y=1;y<u;y++){const d=c[y],b=d===d.toLocaleUpperCase(t);!g&&b?(m.push(p),p=d):p+=d,g=b}p&&m.push(p)}return m}if(t.startsWith("ja")||t.startsWith("ko")){const s=t.startsWith("ja"),f=s?{hiragana:$(c=>it.test(c),"hiragana"),kanji:$(c=>oe.test(c),"kanji"),katakana:$(c=>ot.test(c),"katakana"),latin:$(c=>O.test(c),"latin")}:{hangul:$(c=>ie.test(c),"hangul"),latin:$(c=>O.test(c),"latin")},m=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(s){const c=A(e,f,!1,t,(p,g)=>p==="hiragana"&&g==="katakana"||p==="katakana"&&g==="hiragana"||p==="hiragana"&&g==="latin"||p==="katakana"&&g==="latin"||p==="kanji"&&g==="latin"||p==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const p of c){const g=p;g.length===1&&m.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[e]}return A(e,f,!1,t,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(t.startsWith("sl")){const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t),d=Gt.test(g),b=p<f-1&&s[p+1]===s[p+1].toLocaleUpperCase(t);!u&&y||d&&b?(m.push(c),c=g,d&&b&&(m.push(c),c="")):c+=g,u=y}return c&&c.length>0&&m.push(c),m}if(t.startsWith("zh"))return A(e,{han:$(s=>oe.test(s),"han"),latin:$(s=>O.test(s),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const s=$(f=>se.test(f)||ne.test(f),"isRtlChar");return A(e,{latin:$(f=>O.test(f),"latin"),rtl:$(f=>s(f),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const s=$(f=>tt.test(f)||et.test(f)||nt.test(f)||at.test(f)||st.test(f)||mt.test(f)||dt.test(f)||ut.test(f)||ht.test(f)||gt.test(f)||ct.test(f)||yt.test(f)||pt.test(f)||rt.test(f)||lt.test(f)||ft.test(f),"isIndicChar");return A(e,{indic:$(f=>s(f),"indic"),latin:$(f=>O.test(f),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return A(e,{cyrillic:$(s=>_.test(s),"cyrillic"),latin:$(s=>O.test(s),"latin")},!0,t);if(["ar","fa","he"].includes(t))return A(e,{latin:$(s=>O.test(s),"latin"),rtl:$(s=>se.test(s)||ne.test(s),"rtl")},!1,t);if(t.startsWith("ko"))return A(e,{hangul:$(s=>ie.test(s),"hangul"),latin:$(s=>O.test(s),"latin")},!1,t);if(t.startsWith("uz")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t);if(le.test(g)||le.test(s[p-1])){c+=g;continue}!u&&y?(m.push(c),c=g):c+=g,u=y}return c&&c.length>0&&m.push(c),m}const a=[...e],i=a.length,l=[];let o=a[0],h=a[0]===a[0].toLocaleUpperCase(t);for(const s of r)if(e.startsWith(s)){l.push(s),o=a[s.length],h=o===o.toLocaleUpperCase(t);break}for(let s=1;s<i;s++){const f=a[s],m=f===f.toLocaleUpperCase(t);let c=0;for(const u of r)if(e.startsWith(u,s)){l.push(o,u),c=u.length,o="";const p=u.at(-1);p&&(h=p===p.toLocaleUpperCase(t));break}if(c>0){s+=c-1;continue}!h&&m?(l.push(o),o=f):o+=f,h=m}return o&&l.push(o),l},"splitCamelCaseLocale"),Kt=$((e,t,r)=>{const n=[],a=L.test(e)?e.split(L).filter(Boolean):[e];for(const i of a){const l=i;if(L.test(l))n.push(l);else{const o=T.test(l)?Nt(l).filter(Boolean):[l];for(const h of o)if(T.test(h))n.push(h);else if(t){const s=t.toLowerCase().split("-")[0];n.push(...Ee(h,s,r))}else n.push(...je(h,r))}}return n},"processTextWithAnsiEmoji"),G=$((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:r=!1,handleEmoji:n=!1,knownAcronyms:a=[],locale:i,normalize:l=!1,separators:o,stripAnsi:h=!1,stripEmoji:s=!1}=t,f=new Set([...a].toSorted((d,b)=>b.length-d.length));let m=e;h&&(m=Ut(m)),s&&(m=bt(m));let c;Array.isArray(o)?c=Ft(o):o instanceof RegExp?c=o:c=Ze;const u=[];let p=m;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;p.length>0;){const d=g.exec(p);if(!d){p===".."?u.push(".."):p==="."?u.push("."):p.length>0&&u.push(p);break}const b=d.index,v=d[0],E=v.length,B=p.slice(0,b),Ue=p.slice(b+E);if(v.startsWith("../"))u.push(".."),p=p.slice(b+3);else if(v.startsWith("./"))u.push("."),p=p.slice(b+2);else if(b===0&&v==="..")u.push(".."),p=p.slice(2);else if(b===0&&v===".")u.push("."),p=p.slice(1);else{B.length>0&&u.push(B);let S=0;for(;(S=v.indexOf("../",S))!==-1;)u.push(".."),S+=3;for(S=0;(S=v.indexOf("./",S))!==-1;)(S===0||v[S-1]!==".")&&u.push("."),S+=2;let P=Ue;for(;P.startsWith("../");)u.push(".."),P=P.slice(3);for(;P.startsWith("./");)u.push("."),P=P.slice(2);if(P===".."){u.push("..");break}else if(P==="."){u.push(".");break}else p=P}g.lastIndex=0}if(u.length===0){const d=m.split(c).filter(Boolean);u.push(...d)}let y=[];for(const d of u)r||n?y.push(...Kt(d,i,f)):i?y.push(...Ee(d,i,f)):y.push(...je(d,f));return l&&(y=y.map(d=>f.has(d)?d:i&&d===d.toLocaleUpperCase(i)?d[0]+d.slice(1).toLocaleLowerCase(i):d.toUpperCase()===d&&!f.has(d)?d.slice(0,1)+d.slice(1).toLowerCase():d)),y},"splitByCase");var Qt=Object.defineProperty,Vt=w((e,t)=>Qt(e,"name",{value:t,configurable:!0}),"r$5"),Ht=Object.defineProperty,Jt=Vt((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"o"),Yt=Object.defineProperty,Xt=Jt((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"s");const Z=Xt((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");var Zt=Object.defineProperty,er=w((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"r$4"),tr=Object.defineProperty,rr=er((e,t)=>tr(e,"name",{value:t,configurable:!0}),"r"),nr=Object.defineProperty,ar=rr((e,t)=>nr(e,"name",{value:t,configurable:!0}),"n");const D=ar((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"generateCacheKey");var ir=Object.defineProperty,sr=w((e,t)=>ir(e,"name",{value:t,configurable:!0}),"i$3"),or=Object.defineProperty,lr=sr((e,t)=>or(e,"name",{value:t,configurable:!0}),"f"),cr=Object.defineProperty,ur=lr((e,t)=>cr(e,"name",{value:t,configurable:!0}),"l");const K=ur((e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let a="",i="";for(let l=0;l<r;l++){const o=e[l];if(L.test(o)){a?(n.push(a+i+o),a="",i=""):(n.length>0&&n.push(t),a=o);continue}a?(i&&(i+=t),i+=o):(n.length>0&&n.push(t),n.push(o))}return n.join("")},"joinSegments");var pr=Object.defineProperty,fr=w((e,t)=>pr(e,"name",{value:t,configurable:!0}),"r$3"),hr=Object.defineProperty,mr=fr((e,t)=>hr(e,"name",{value:t,configurable:!0}),"a"),dr=Object.defineProperty,gr=mr((e,t)=>dr(e,"name",{value:t,configurable:!0}),"e");const yr=/(?<![a-zß])SS(?![a-z])/g,ee=gr(e=>e.replaceAll(yr,"ß"),"normalizeGermanEszett");var br=Object.defineProperty,$r=w((e,t)=>br(e,"name",{value:t,configurable:!0}),"c$3"),vr=Object.defineProperty,wr=$r((e,t)=>vr(e,"name",{value:t,configurable:!0}),"c"),jr=Object.defineProperty,Er=wr((e,t)=>jr(e,"name",{value:t,configurable:!0}),"o");const Or=new W(1e3),kr=Er((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Or;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);let i=!0;const l=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&L.test(o))return o;const h=t?.locale?.startsWith("de")?ee(o):o,s=t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase();return i?(i=!1,Pt(s,t)):Z(s,t)}),"");return r&&a&&n.set(a,l),l},"camelCase");var xr=Object.defineProperty,Cr=w((e,t)=>xr(e,"name",{value:t,configurable:!0}),"l$3"),Sr=Object.defineProperty,Pr=Cr((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"l"),Ar=Object.defineProperty,Lr=Pr((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"o");const Wr=new W(1e3),te=Lr((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??Wr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&L.test(o))return o;if(t?.toUpperCase)return t.locale?o.toLocaleUpperCase(t.locale):o.toUpperCase();const h=t?.locale?.startsWith("de")?ee(o):o;return t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase()}),l=K(i,t?.joiner??"-");return r&&a&&n.set(a,l),l},"kebabCase");var Rr=Object.defineProperty,_r=w((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"r$2"),Ur=Object.defineProperty,Tr=_r((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"a"),zr=Object.defineProperty,Mr=Tr((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s");const Fr=new W(1e3),Br=Mr((e,t)=>te(e,{cacheStore:Fr,...t,joiner:"_",toUpperCase:!0}),"constantCase");var Ir=Object.defineProperty,Nr=w((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l$2"),qr=Object.defineProperty,Gr=Nr((e,t)=>qr(e,"name",{value:t,configurable:!0}),"l"),Dr=Object.defineProperty,Kr=Gr((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i");const Qr=new W(1e3),Vr=Kr((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Qr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>{if(t?.handleAnsi&&L.test(l))return l;const o=t?.locale?.startsWith("de")?ee(l):l;return Z(t?.locale?o.toLocaleLowerCase(t.locale):o.toLowerCase(),{locale:t?.locale})}),"");return r&&a&&n.set(a,i),i},"pascalCase");var Hr=Object.defineProperty,Jr=w((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"r$1"),Yr=Object.defineProperty,Xr=Jr((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,en=Xr((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"s");const tn=new W(1e3),rn=en((e,t)=>te(e,{cacheStore:tn,...t,joiner:"_"}),"snakeCase");var nn=Object.defineProperty,an=w((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r"),sn=Object.defineProperty,on=an((e,t)=>sn(e,"name",{value:t,configurable:!0}),"e"),ln=Object.defineProperty,cn=on((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i");const un=new W(1e3),pn=cn((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??un;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>Z(l,{locale:t?.locale})),"-");return r&&a&&n.set(a,i),i},"trainCase");var fn=Object.defineProperty,k=w((e,t)=>fn(e,"name",{value:t,configurable:!0}),"e");const x=k(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),Y={camel_case:k(e=>kr(x(e)),"camel_case"),kebab_case:k(e=>te(x(e)),"kebab_case"),lower_case:k(e=>x(e).toLowerCase(),"lower_case"),pascal_case:k(e=>Vr(x(e)),"pascal_case"),path_join:k((e,...t)=>{const r=[x(e),...t.map(n=>x(n))];return me(...r)},"path_join"),path_relative:k((e,t)=>he(x(t),x(e)),"path_relative"),snake_case:k(e=>rn(x(e)),"snake_case"),upper_case:k(e=>x(e).toUpperCase(),"upper_case"),upper_kebab_case:k(e=>pn(x(e)),"upper_kebab_case"),upper_snake_case:k(e=>Br(x(e)),"upper_snake_case")};k(e=>Object.hasOwn(Y,e),"isKnownFilter");const Oe=k((e,t,r=[])=>{const n=Y[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(Y).sort().join(", ")}.`);return n(t,...r)},"applyFilter");var hn=Object.defineProperty,ke=w((e,t)=>hn(e,"name",{value:t,configurable:!0}),"d$1");const xe=ke(e=>{const t=[];let r=0,n=0,a,i=-1;for(const l of e){if(i+=1,a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l===","&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t},"splitCommaOutsideQuotes"),mn=ke(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var dn=Object.defineProperty,R=w((e,t)=>dn(e,"name",{value:t,configurable:!0}),"s$1");const gn=/\[([^\]]+)\]/g,yn=R(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),a=t.slice(r+1,-1).trim();return a===""?{args:[],name:n}:{args:xe(a).map(i=>{const l=i.trim();return mn(l)??l}),name:n}},"parseFilterCall"),bn=R(e=>{const t=e.split("|").map(n=>n.trim()),r=t[0]??"";if(!r)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(n=>yn(n)),name:r}},"parsePipe"),$n=R(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),vn=R((e,t)=>{const r=e.replaceAll(gn,(n,a)=>{const{filters:i,name:l}=bn(a);if(!Object.hasOwn(t,l))throw new Error(`Variable "${l}" used in filename "${e}" but not defined`);let o=t[l];for(const h of i)o=Oe(h.name,o,h.args);return $n(o)});return Ce(r)},"interpolateFilename"),Ce=R(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),wn=R(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),jn=R(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var En=Object.defineProperty,On=w((e,t)=>En(e,"name",{value:t,configurable:!0}),"i");const kn=On((e,t)=>{if(!e.startsWith(`---
|
|
1
|
+
var Te=Object.defineProperty;var w=(e,t)=>Te(e,"name",{value:t,configurable:!0});import{createRequire as ze}from"node:module";import{u as Be,aI as Ie,p as Ne,aY as qe}from"./bin.js";import{z as he,M as me,$ as I}from"./config.js";const Me=ze(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fe=w(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[t,r]=z.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return z.getBuiltinModule(e)}return Me(e)},"__cjs_getBuiltinModule"),{createRequire:Ge}=Fe("node:module");var De=Object.defineProperty,Ke=w((e,t)=>De(e,"name",{value:t,configurable:!0}),"p$6"),Qe=Object.defineProperty,de=Ke((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"e"),Ve=Object.defineProperty,He=de((e,t)=>Ve(e,"name",{value:t,configurable:!0}),"E");const ge=String.raw,re=ge`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,Je=He(()=>new RegExp(ge`\p{RI}{2}|(?)${re}(?:\u200D${re})*`,"gu"),"default");var Ye=Object.defineProperty,Xe=de((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"p");Object.freeze(new Map([[0,0],[1,22],[2,22],[3,23],[4,24],[7,27],[8,28],[9,29],[30,39],[31,39],[32,39],[33,39],[34,39],[35,39],[36,39],[37,39],[40,49],[41,49],[42,49],[43,49],[44,49],[45,49],[46,49],[47,49],[90,39]]));const T=Je(),Ze=/[-_./\s]+/g,L=/(\u001B\[[0-9;]*[a-z])/i,ne=new RegExp("\\p{Script=Arabic}","u"),et=new RegExp("\\p{Script=Bengali}","u"),_=new RegExp("\\p{Script=Cyrillic}","u"),tt=new RegExp("\\p{Script=Devanagari}","u"),rt=new RegExp("\\p{Script=Ethiopic}","u"),Q=new RegExp("\\p{Script=Greek}","u"),ae=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),nt=new RegExp("\\p{Script=Gujarati}","u"),at=new RegExp("\\p{Script=Gurmukhi}","u"),ie=new RegExp("\\p{Script=Hangul}","u"),se=new RegExp("\\p{Script=Hebrew}","u"),it=new RegExp("\\p{Script=Hiragana}","u"),oe=new RegExp("\\p{Script=Han}","u"),st=new RegExp("\\p{Script=Kannada}","u"),ot=new RegExp("\\p{Script=Katakana}","u"),lt=new RegExp("\\p{Script=Khmer}","u"),ct=new RegExp("\\p{Script=Lao}","u"),O=new RegExp("\\p{Script=Latin}","u"),ut=new RegExp("\\p{Script=Malayalam}","u"),pt=new RegExp("\\p{Script=Myanmar}","u"),ft=new RegExp("\\p{Script=Oriya}","u"),ht=new RegExp("\\p{Script=Sinhala}","u"),mt=new RegExp("\\p{Script=Tamil}","u"),dt=new RegExp("\\p{Script=Telugu}","u"),gt=new RegExp("\\p{Script=Thai}","u"),yt=new RegExp("\\p{Script=Tibetan}","u"),le=/[\u02BB\u02BC\u0027]/u,bt=Xe(e=>e.replace(T,""),"stripEmoji");var $t=Object.defineProperty,ye=w((e,t)=>$t(e,"name",{value:t,configurable:!0}),"i$5"),vt=Object.defineProperty,be=ye((e,t)=>vt(e,"name",{value:t,configurable:!0}),"r"),wt=Object.defineProperty,jt=be((e,t)=>wt(e,"name",{value:t,configurable:!0}),"c");let W=class{static{w(this,"l")}static{ye(this,"y")}static{be(this,"s")}static{jt(this,"LRUCache")}capacity;cache;keyOrder;constructor(t){this.capacity=t,this.cache=new Map,this.keyOrder=[]}get(t){if(this.cache.has(t))return this.keyOrder=this.keyOrder.filter(r=>r!==t),this.keyOrder.push(t),this.cache.get(t)}has(t){return this.cache.has(t)}set(t,r){if(this.cache.has(t))this.keyOrder=this.keyOrder.filter(n=>n!==t);else if(this.cache.size>=this.capacity){const n=this.keyOrder.shift();n!==void 0&&this.cache.delete(n)}this.cache.set(t,r),this.keyOrder.push(t)}delete(t){this.cache.delete(t),this.keyOrder=this.keyOrder.filter(r=>r!==t)}clear(){this.cache.clear(),this.keyOrder=[]}size(){return this.cache.size}};var Et=Object.defineProperty,Ot=w((e,t)=>Et(e,"name",{value:t,configurable:!0}),"r$6"),kt=Object.defineProperty,xt=Ot((e,t)=>kt(e,"name",{value:t,configurable:!0}),"a"),Ct=Object.defineProperty,St=xt((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"s");const Pt=St((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleLowerCase(t.locale):e[0].toLowerCase())+e.slice(1),"lowerFirst");var At=Object.defineProperty,Lt=w((e,t)=>At(e,"name",{value:t,configurable:!0}),"I"),Wt=Object.defineProperty,q=Lt((e,t)=>Wt(e,"name",{value:t,configurable:!0}),"W");const Rt=Ge(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_t=q(e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[t,r]=M.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return M.getBuiltinModule(e)}return Rt(e)},"__cjs_getBuiltinModule"),{stripVTControlCharacters:Ut}=_t("node:util");var Tt=Object.defineProperty,zt=q((e,t)=>Tt(e,"name",{value:t,configurable:!0}),"g");const V=new W(1e3),Mt=/[.*+?^${}()|[\]\\]/g,Ft=zt(e=>{const t=e.join("");if(V.has(t))return V.get(t);const r=e.map(a=>a.replaceAll(Mt,String.raw`\$&`)).join("|"),n=new RegExp(r,"g");return V.set(t,n),n},"getSeparatorsRegex");var Bt=Object.defineProperty,It=q((e,t)=>Bt(e,"name",{value:t,configurable:!0}),"t");const Nt=It(e=>{const t=[];let r=0,n;for(T.lastIndex=0;(n=T.exec(e))!==null;)n.index>r&&t.push(e.slice(r,n.index)),t.push(n[0]),r=T.lastIndex;return r<e.length&&t.push(e.slice(r)),t.filter(Boolean)},"splitByEmoji");var qt=Object.defineProperty,$=q((e,t)=>qt(e,"name",{value:t,configurable:!0}),"u");const Gt=/[ČŠŽĐ]/i,$e=new Uint8Array(128),ve=new Uint8Array(128),we=new Uint8Array(128);for(let e=0;e<128;e++)$e[e]=e>=65&&e<=90?1:0,ve[e]=e>=97&&e<=122?1:0,we[e]=e>=48&&e<=57?1:0;const H=$(e=>$e[e],"isUpper"),ce=$(e=>ve[e],"isLower"),J=$(e=>we[e],"isDigit"),A=$((e,t,r,n,a)=>{if(e.length===0)return[];let i=!1;const l=Object.values(t);for(const u of l)if(u(e[0])){i=!0;break}if(!i&&!r)return[e];const o=[...e],h=[];let s=o[0],f="other";const m=Object.entries(t);for(const u of m){const[p,g]=u;if(g(o[0])){f=p;break}}let c=r&&n?o[0]===o[0].toLocaleUpperCase(n):!1;for(let u=1;u<o.length;u++){const p=o[u];let g="other";for(const b of m){const[v,E]=b;if(E(p)){g=v;break}}const y=r&&n?p===p.toLocaleUpperCase(n):!1;let d=!1;a?d=a(f,g,c,y,p,u,o):(f!==g&&f!=="other"&&g!=="other"&&(d=!0),r&&g!=="other"&&!c&&y&&(d=!0)),d?(h.push(s),s=p):s+=p,f=g,r&&(c=y)}return s&&s.length>0&&h.push(s),h.length>0?h:[e]},"handleScriptTransitions"),Dt=$((e,t,r,n)=>{if(r.size===0)return t;for(const a of r)if(e.startsWith(a,t))return n.push(a),t+a.length;return t},"detectAndProcessAcronym"),je=$((e,t=new Set)=>{if(e.length===0)return[];if(e.toUpperCase()===e)return[e];let r=0;const n=[],a=e.length;for(let i=1;i<a;i++){const l=Dt(e,r,t,n);if(l!==r){r=l,i=r-1;continue}const o=e.codePointAt(i-1),h=e.codePointAt(i),s=o&&o<128&&H(o),f=h&&h<128&&H(h),m=o&&o<128&&ce(o),c=o&&o<128&&J(o),u=h&&h<128&&J(h);if(m&&f){n.push(e.slice(r,i)),r=i;continue}if(c&&!u||!c&&u){n.push(e.slice(r,i)),r=i;continue}if(u&&!c){let p=!1,g=!1;if(i+1<a){const y=e.codePointAt(i+1);p=y&&y<128&&H(y),g=y&&y<128&&J(y)}if(!g&&p){n.push(e.slice(r,i),e.slice(i,i+1)),r=i+1;continue}}if(i+1<a){const p=e.codePointAt(i+1),g=p&&p<128&&ce(p);if(s&&f&&g){const y=e.slice(r,i+1);t.has(y)||(n.push(e.slice(r,i)),r=i)}}}return r<a&&n.push(e.slice(r)),n.filter(i=>i!=="")},"splitCamelCaseFast"),Ee=$((e,t,r)=>{if(e.length===0)return[];const n=e===e.toLocaleUpperCase(t);if(t.startsWith("de")){if(!n&&e.replaceAll("ß","SS")===e.toLocaleUpperCase(t))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t),p=u,g=u?0:-1;for(let y=1;y<f;y++){const d=s[y],b=d===d.toLocaleUpperCase(t);if(b===u)c+=d;else if(b)c&&c.length>0&&(m.push(c),c=d),p=!0,g=y;else{if(p&&y-g>1){const v=s[y-1],E=c.slice(0,-1);E&&E.length>0&&m.push(E),c=v+d}else c+=d;p=!1,g=-1}u=b}return c&&c.length>0&&m.push(c),m}if(t.startsWith("uk")||t.startsWith("ru")||t.startsWith("bg")||t.startsWith("sr")||t.startsWith("mk")||t.startsWith("be")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0];const u=s[0];let p;_.test(u)?p=1:O.test(u)?p=2:p=0;let g=u===u.toLocaleUpperCase(t);for(let d=1;d<f;d++){const b=s[d];let v;_.test(b)?v=1:O.test(b)?v=2:v=0;const E=b===b.toLocaleUpperCase(t);p!==v&&(p===1||p===2)&&(v===1||v===2)||v===p&&!g&&E?(m.push(c),c=b):c+=b,p=v,g=E}c&&c.length>0&&m.push(c);const y=[];for(let d=0;d<m.length;d++)d<m.length-1&&m[d].length===1&&O.test(m[d])&&_.test(m[d+1][0])?(y.push(m[d]+m[d+1]),d+=1):y.push(m[d]);return y}if(t.startsWith("el")){if(!Q.test(e)&&!O.test(e))return[e];const s=[];ae.lastIndex=0;let f;for(;(f=ae.exec(e))!==null;)s.push(f[0]);s.length===0&&s.push(e);const m=[];if(s.length===1){const c=s[0];if(!c||!Q.test(c[0])||c.length===1)return[c??e]}for(const c of s){if(!c)continue;if(!Q.test(c[0])||c.length===1){m.push(c);continue}const u=c.length;let p=c[0],g=c[0]===c[0].toLocaleUpperCase(t);for(let y=1;y<u;y++){const d=c[y],b=d===d.toLocaleUpperCase(t);!g&&b?(m.push(p),p=d):p+=d,g=b}p&&m.push(p)}return m}if(t.startsWith("ja")||t.startsWith("ko")){const s=t.startsWith("ja"),f=s?{hiragana:$(c=>it.test(c),"hiragana"),kanji:$(c=>oe.test(c),"kanji"),katakana:$(c=>ot.test(c),"katakana"),latin:$(c=>O.test(c),"latin")}:{hangul:$(c=>ie.test(c),"hangul"),latin:$(c=>O.test(c),"latin")},m=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(s){const c=A(e,f,!1,t,(p,g)=>p==="hiragana"&&g==="katakana"||p==="katakana"&&g==="hiragana"||p==="hiragana"&&g==="latin"||p==="katakana"&&g==="latin"||p==="kanji"&&g==="latin"||p==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const p of c){const g=p;g.length===1&&m.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[e]}return A(e,f,!1,t,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(t.startsWith("sl")){const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t),d=Gt.test(g),b=p<f-1&&s[p+1]===s[p+1].toLocaleUpperCase(t);!u&&y||d&&b?(m.push(c),c=g,d&&b&&(m.push(c),c="")):c+=g,u=y}return c&&c.length>0&&m.push(c),m}if(t.startsWith("zh"))return A(e,{han:$(s=>oe.test(s),"han"),latin:$(s=>O.test(s),"latin")},!1,t);if(["ar","fa","he","ur"].includes(t.split("-")[0])){const s=$(f=>se.test(f)||ne.test(f),"isRtlChar");return A(e,{latin:$(f=>O.test(f),"latin"),rtl:$(f=>s(f),"rtl")},!1,t)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(t.split("-")[0])){const s=$(f=>tt.test(f)||et.test(f)||nt.test(f)||at.test(f)||st.test(f)||mt.test(f)||dt.test(f)||ut.test(f)||ht.test(f)||gt.test(f)||ct.test(f)||yt.test(f)||pt.test(f)||rt.test(f)||lt.test(f)||ft.test(f),"isIndicChar");return A(e,{indic:$(f=>s(f),"indic"),latin:$(f=>O.test(f),"latin")},!1,t)}if(["be","bg","ru","sr","uk"].includes(t))return A(e,{cyrillic:$(s=>_.test(s),"cyrillic"),latin:$(s=>O.test(s),"latin")},!0,t);if(["ar","fa","he"].includes(t))return A(e,{latin:$(s=>O.test(s),"latin"),rtl:$(s=>se.test(s)||ne.test(s),"rtl")},!1,t);if(t.startsWith("ko"))return A(e,{hangul:$(s=>ie.test(s),"hangul"),latin:$(s=>O.test(s),"latin")},!1,t);if(t.startsWith("uz")){if(!_.test(e)&&!O.test(e))return[e];const s=[...e],f=s.length,m=[];let c=s[0],u=s[0]===s[0].toLocaleUpperCase(t);for(let p=1;p<f;p++){const g=s[p],y=g===g.toLocaleUpperCase(t);if(le.test(g)||le.test(s[p-1])){c+=g;continue}!u&&y?(m.push(c),c=g):c+=g,u=y}return c&&c.length>0&&m.push(c),m}const a=[...e],i=a.length,l=[];let o=a[0],h=a[0]===a[0].toLocaleUpperCase(t);for(const s of r)if(e.startsWith(s)){l.push(s),o=a[s.length],h=o===o.toLocaleUpperCase(t);break}for(let s=1;s<i;s++){const f=a[s],m=f===f.toLocaleUpperCase(t);let c=0;for(const u of r)if(e.startsWith(u,s)){l.push(o,u),c=u.length,o="";const p=u.at(-1);p&&(h=p===p.toLocaleUpperCase(t));break}if(c>0){s+=c-1;continue}!h&&m?(l.push(o),o=f):o+=f,h=m}return o&&l.push(o),l},"splitCamelCaseLocale"),Kt=$((e,t,r)=>{const n=[],a=L.test(e)?e.split(L).filter(Boolean):[e];for(const i of a){const l=i;if(L.test(l))n.push(l);else{const o=T.test(l)?Nt(l).filter(Boolean):[l];for(const h of o)if(T.test(h))n.push(h);else if(t){const s=t.toLowerCase().split("-")[0];n.push(...Ee(h,s,r))}else n.push(...je(h,r))}}return n},"processTextWithAnsiEmoji"),G=$((e,t={})=>{if(!e||typeof e!="string")return[];const{handleAnsi:r=!1,handleEmoji:n=!1,knownAcronyms:a=[],locale:i,normalize:l=!1,separators:o,stripAnsi:h=!1,stripEmoji:s=!1}=t,f=new Set([...a].toSorted((d,b)=>b.length-d.length));let m=e;h&&(m=Ut(m)),s&&(m=bt(m));let c;Array.isArray(o)?c=Ft(o):o instanceof RegExp?c=o:c=Ze;const u=[];let p=m;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;p.length>0;){const d=g.exec(p);if(!d){p===".."?u.push(".."):p==="."?u.push("."):p.length>0&&u.push(p);break}const b=d.index,v=d[0],E=v.length,B=p.slice(0,b),Ue=p.slice(b+E);if(v.startsWith("../"))u.push(".."),p=p.slice(b+3);else if(v.startsWith("./"))u.push("."),p=p.slice(b+2);else if(b===0&&v==="..")u.push(".."),p=p.slice(2);else if(b===0&&v===".")u.push("."),p=p.slice(1);else{B.length>0&&u.push(B);let S=0;for(;(S=v.indexOf("../",S))!==-1;)u.push(".."),S+=3;for(S=0;(S=v.indexOf("./",S))!==-1;)(S===0||v[S-1]!==".")&&u.push("."),S+=2;let P=Ue;for(;P.startsWith("../");)u.push(".."),P=P.slice(3);for(;P.startsWith("./");)u.push("."),P=P.slice(2);if(P===".."){u.push("..");break}else if(P==="."){u.push(".");break}else p=P}g.lastIndex=0}if(u.length===0){const d=m.split(c).filter(Boolean);u.push(...d)}let y=[];for(const d of u)r||n?y.push(...Kt(d,i,f)):i?y.push(...Ee(d,i,f)):y.push(...je(d,f));return l&&(y=y.map(d=>f.has(d)?d:i&&d===d.toLocaleUpperCase(i)?d[0]+d.slice(1).toLocaleLowerCase(i):d.toUpperCase()===d&&!f.has(d)?d.slice(0,1)+d.slice(1).toLowerCase():d)),y},"splitByCase");var Qt=Object.defineProperty,Vt=w((e,t)=>Qt(e,"name",{value:t,configurable:!0}),"r$5"),Ht=Object.defineProperty,Jt=Vt((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"o"),Yt=Object.defineProperty,Xt=Jt((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"s");const Z=Xt((e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),"upperFirst");var Zt=Object.defineProperty,er=w((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"r$4"),tr=Object.defineProperty,rr=er((e,t)=>tr(e,"name",{value:t,configurable:!0}),"r"),nr=Object.defineProperty,ar=rr((e,t)=>nr(e,"name",{value:t,configurable:!0}),"n");const D=ar((e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}`,"generateCacheKey");var ir=Object.defineProperty,sr=w((e,t)=>ir(e,"name",{value:t,configurable:!0}),"i$3"),or=Object.defineProperty,lr=sr((e,t)=>or(e,"name",{value:t,configurable:!0}),"f"),cr=Object.defineProperty,ur=lr((e,t)=>cr(e,"name",{value:t,configurable:!0}),"l");const K=ur((e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let a="",i="";for(let l=0;l<r;l++){const o=e[l];if(L.test(o)){a?(n.push(a+i+o),a="",i=""):(n.length>0&&n.push(t),a=o);continue}a?(i&&(i+=t),i+=o):(n.length>0&&n.push(t),n.push(o))}return n.join("")},"joinSegments");var pr=Object.defineProperty,fr=w((e,t)=>pr(e,"name",{value:t,configurable:!0}),"r$3"),hr=Object.defineProperty,mr=fr((e,t)=>hr(e,"name",{value:t,configurable:!0}),"a"),dr=Object.defineProperty,gr=mr((e,t)=>dr(e,"name",{value:t,configurable:!0}),"e");const yr=/(?<![a-zß])SS(?![a-z])/g,ee=gr(e=>e.replaceAll(yr,"ß"),"normalizeGermanEszett");var br=Object.defineProperty,$r=w((e,t)=>br(e,"name",{value:t,configurable:!0}),"c$3"),vr=Object.defineProperty,wr=$r((e,t)=>vr(e,"name",{value:t,configurable:!0}),"c"),jr=Object.defineProperty,Er=wr((e,t)=>jr(e,"name",{value:t,configurable:!0}),"o");const Or=new W(1e3),kr=Er((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Or;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);let i=!0;const l=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&L.test(o))return o;const h=t?.locale?.startsWith("de")?ee(o):o,s=t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase();return i?(i=!1,Pt(s,t)):Z(s,t)}),"");return r&&a&&n.set(a,l),l},"camelCase");var xr=Object.defineProperty,Cr=w((e,t)=>xr(e,"name",{value:t,configurable:!0}),"l$3"),Sr=Object.defineProperty,Pr=Cr((e,t)=>Sr(e,"name",{value:t,configurable:!0}),"l"),Ar=Object.defineProperty,Lr=Pr((e,t)=>Ar(e,"name",{value:t,configurable:!0}),"o");const Wr=new W(1e3),te=Lr((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??Wr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{if(t?.handleAnsi&&L.test(o))return o;if(t?.toUpperCase)return t.locale?o.toLocaleUpperCase(t.locale):o.toUpperCase();const h=t?.locale?.startsWith("de")?ee(o):o;return t?.locale?h.toLocaleLowerCase(t.locale):h.toLowerCase()}),l=K(i,t?.joiner??"-");return r&&a&&n.set(a,l),l},"kebabCase");var Rr=Object.defineProperty,_r=w((e,t)=>Rr(e,"name",{value:t,configurable:!0}),"r$2"),Ur=Object.defineProperty,Tr=_r((e,t)=>Ur(e,"name",{value:t,configurable:!0}),"a"),zr=Object.defineProperty,Mr=Tr((e,t)=>zr(e,"name",{value:t,configurable:!0}),"s");const Fr=new W(1e3),Br=Mr((e,t)=>te(e,{cacheStore:Fr,...t,joiner:"_",toUpperCase:!0}),"constantCase");var Ir=Object.defineProperty,Nr=w((e,t)=>Ir(e,"name",{value:t,configurable:!0}),"l$2"),qr=Object.defineProperty,Gr=Nr((e,t)=>qr(e,"name",{value:t,configurable:!0}),"l"),Dr=Object.defineProperty,Kr=Gr((e,t)=>Dr(e,"name",{value:t,configurable:!0}),"i");const Qr=new W(1e3),Vr=Kr((e,t)=>{if(typeof e!="string"||!e)return"";const r=t?.cache??!1,n=t?.cacheStore??Qr;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>{if(t?.handleAnsi&&L.test(l))return l;const o=t?.locale?.startsWith("de")?ee(l):l;return Z(t?.locale?o.toLocaleLowerCase(t.locale):o.toLowerCase(),{locale:t?.locale})}),"");return r&&a&&n.set(a,i),i},"pascalCase");var Hr=Object.defineProperty,Jr=w((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"r$1"),Yr=Object.defineProperty,Xr=Jr((e,t)=>Yr(e,"name",{value:t,configurable:!0}),"a"),Zr=Object.defineProperty,en=Xr((e,t)=>Zr(e,"name",{value:t,configurable:!0}),"s");const tn=new W(1e3),rn=en((e,t)=>te(e,{cacheStore:tn,...t,joiner:"_"}),"snakeCase");var nn=Object.defineProperty,an=w((e,t)=>nn(e,"name",{value:t,configurable:!0}),"r"),sn=Object.defineProperty,on=an((e,t)=>sn(e,"name",{value:t,configurable:!0}),"e"),ln=Object.defineProperty,cn=on((e,t)=>ln(e,"name",{value:t,configurable:!0}),"i");const un=new W(1e3),pn=cn((e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??un;let a;if(r&&(a=D(e,t)),r&&a&&n.has(a))return n.get(a);const i=K(G(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>Z(l,{locale:t?.locale})),"-");return r&&a&&n.set(a,i),i},"trainCase");var fn=Object.defineProperty,k=w((e,t)=>fn(e,"name",{value:t,configurable:!0}),"e");const x=k(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),Y={camel_case:k(e=>kr(x(e)),"camel_case"),kebab_case:k(e=>te(x(e)),"kebab_case"),lower_case:k(e=>x(e).toLowerCase(),"lower_case"),pascal_case:k(e=>Vr(x(e)),"pascal_case"),path_join:k((e,...t)=>{const r=[x(e),...t.map(n=>x(n))];return me(...r)},"path_join"),path_relative:k((e,t)=>he(x(t),x(e)),"path_relative"),snake_case:k(e=>rn(x(e)),"snake_case"),upper_case:k(e=>x(e).toUpperCase(),"upper_case"),upper_kebab_case:k(e=>pn(x(e)),"upper_kebab_case"),upper_snake_case:k(e=>Br(x(e)),"upper_snake_case")};k(e=>Object.hasOwn(Y,e),"isKnownFilter");const Oe=k((e,t,r=[])=>{const n=Y[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(Y).sort().join(", ")}.`);return n(t,...r)},"applyFilter");var hn=Object.defineProperty,ke=w((e,t)=>hn(e,"name",{value:t,configurable:!0}),"d$1");const xe=ke(e=>{const t=[];let r=0,n=0,a,i=-1;for(const l of e){if(i+=1,a){l===a&&(a=void 0);continue}if(l==='"'||l==="'"){a=l;continue}l==="("?r+=1:l===")"?r-=1:l===","&&r===0&&(t.push(e.slice(n,i)),n=i+1)}return t.push(e.slice(n)),t},"splitCommaOutsideQuotes"),mn=ke(e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},"stripQuotes");var dn=Object.defineProperty,R=w((e,t)=>dn(e,"name",{value:t,configurable:!0}),"s$1");const gn=/\[([^\]]+)\]/g,yn=R(e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),a=t.slice(r+1,-1).trim();return a===""?{args:[],name:n}:{args:xe(a).map(i=>{const l=i.trim();return mn(l)??l}),name:n}},"parseFilterCall"),bn=R(e=>{const t=e.split("|").map(n=>n.trim()),r=t[0]??"";if(!r)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(n=>yn(n)),name:r}},"parsePipe"),$n=R(e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),"stringify"),vn=R((e,t)=>{const r=e.replaceAll(gn,(n,a)=>{const{filters:i,name:l}=bn(a);if(!Object.hasOwn(t,l))throw new Error(`Variable "${l}" used in filename "${e}" but not defined`);let o=t[l];for(const h of i)o=Oe(h.name,o,h.args);return $n(o)});return Ce(r)},"interpolateFilename"),Ce=R(e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),"stripTeraSuffix"),wn=R(e=>e.endsWith(".raw")?e.slice(0,-4):e,"stripRawSuffix"),jn=R(e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},"isPartialPath");var En=Object.defineProperty,On=w((e,t)=>En(e,"name",{value:t,configurable:!0}),"i");const kn=On((e,t)=>{if(!e.startsWith(`---
|
|
2
2
|
`)&&!e.startsWith(`---\r
|
|
3
3
|
`))return{body:e};const r=e.indexOf(`
|
|
4
4
|
---`,3);if(r===-1)return{body:e};let n=r+1+3;e[n]==="\r"&&(n+=1),e[n]===`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var o=(t,e)=>u(t,"name",{value:e,configurable:!0});import{
|
|
1
|
+
var u=Object.defineProperty;var o=(t,e)=>u(t,"name",{value:e,configurable:!0});import{K as n}from"./config.js";import{createJiti as l}from"jiti";var p=Object.defineProperty,a=o((t,e)=>p(t,"name",{value:e,configurable:!0}),"r");const i=a((t,e)=>{if(!e||typeof e!="object")throw new TypeError(`${t}: default export must be an object (got ${e===null?"null":typeof e}). Use createTemplate({ ... }).`);const r=e;if(typeof r.about!="object"||r.about===null)throw new TypeError(`${t}: default export missing required "about" object`);if(typeof r.produce!="function")throw new TypeError(`${t}: default export missing required "produce" function`);return e},"validateTemplateExport"),s=a(async t=>{const e=await l(n(t),{fsCache:!1,moduleCache:!1}).import(t,{default:!0,try:!0})??null;return i(t,e)},"loadNativeTemplate");export{s as loadNativeTemplate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var H=Object.defineProperty;var k=(e,r)=>H(e,"name",{value:r,configurable:!0});import{createRequire as B}from"node:module";import{renderToString as z
|
|
1
|
+
var H=Object.defineProperty;var k=(e,r)=>H(e,"name",{value:r,configurable:!0});import{createRequire as B}from"node:module";import{renderToString as z}from"@visulima/tui";import{Box as U}from"@visulima/tui/components/box";import{Table as W}from"@visulima/tui/components/table";import{Text as y}from"@visulima/tui/components/text";import v from"react";import{k as K,T as G,R as Y,j as X}from"./ai-cache-DrCLD4gc.js";const F=B(import.meta.url),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=k(e=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[r,a]=w.versions.node.split(".").map(Number);if(r>22||r===22&&a>=3||r===20&&a>=16)return w.getBuiltinModule(e)}return F(e)},"__cjs_getBuiltinModule"),{spawn:D,execFileSync:O}=$("node:child_process"),{existsSync:T}=$("node:fs"),{platform:J,homedir:R}=$("node:os"),{join:g}=$("node:path"),Q=/v?(\d+\.\d+\.\d+(?:-[\w.]+)?)/,Z=5e3,ee=1e4,re=3e5,te=4096,E=J()==="win32",M=["amp","claude","codex","copilot","crush","cursor","droid","gemini","kimi","opencode","qwen"];var ae=Object.defineProperty,ne=k((e,r)=>ae(e,"name",{value:r,configurable:!0}),"A$1"),ie=Object.defineProperty,m=ne((e,r)=>ie(e,"name",{value:r,configurable:!0}),"o"),oe=Object.defineProperty,se=m((e,r)=>oe(e,"name",{value:r,configurable:!0}),"a$6");const ce={alternateCommands:[],buildArgs:se((e,r,a)=>["-x",e,"--dangerously-allow-all"],"buildArgs"),command:"amp",defaultModel:"",envVariable:"AMP_PATH"};var le=Object.defineProperty,ue=m((e,r)=>le(e,"name",{value:r,configurable:!0}),"t$8");const de={alternateCommands:[],buildArgs:ue((e,r,a)=>["--dangerously-skip-permissions","--model",r,"--output-format","text","-p",e],"buildArgs"),command:"claude",defaultModel:"claude-sonnet-4-20250514",envVariable:"CLAUDE_PATH"};var me=Object.defineProperty,pe=m((e,r)=>me(e,"name",{value:r,configurable:!0}),"a$4");const ge={alternateCommands:["openai-codex"],buildArgs:pe((e,r,a)=>[e,"--approval-mode","full-auto","--quiet","--model",r,"--max-tokens",String(a)],"buildArgs"),command:"codex",defaultModel:"o3",envVariable:"CODEX_PATH"};var fe=Object.defineProperty,he=m((e,r)=>fe(e,"name",{value:r,configurable:!0}),"l");const ve={alternateCommands:[],buildArgs:he((e,r,a)=>{const t=["-p",e,"--allow-all-tools"];return r&&t.push("--model",r),t},"buildArgs"),command:"copilot",defaultModel:"",envVariable:"COPILOT_PATH"};var ye=Object.defineProperty,be=m((e,r)=>ye(e,"name",{value:r,configurable:!0}),"n$2");const ke={alternateCommands:[],buildArgs:be((e,r,a)=>{const t=["run","--yolo"];return r&&t.push("-m",r),t.push(e),t},"buildArgs"),command:"crush",defaultModel:"",envVariable:"CRUSH_PATH"};var we=Object.defineProperty,Ae=m((e,r)=>we(e,"name",{value:r,configurable:!0}),"t$5");const $e={alternateCommands:["cursor"],buildArgs:Ae((e,r,a)=>{const t=["-p","--force","--output-format","text"];return r&&t.push("--model",r),t.push(e),t},"buildArgs"),command:"agent",defaultModel:"",envVariable:"CURSOR_PATH"};var Se=Object.defineProperty,Pe=m((e,r)=>Se(e,"name",{value:r,configurable:!0}),"i");const Te={alternateCommands:[],buildArgs:Pe((e,r,a)=>{const t=[e,"--skip-permissions-unsafe","-o","text"];return r&&t.push("-m",r),t},"buildArgs"),command:"droid",defaultModel:"",envVariable:"DROID_PATH"};var Ce=Object.defineProperty,je=m((e,r)=>Ce(e,"name",{value:r,configurable:!0}),"o$1");const Oe={alternateCommands:["gemini-cli"],buildArgs:je((e,r,a)=>["--sandbox","--model",r,"--max-output-tokens",String(a),"-p",e],"buildArgs"),command:"gemini",defaultModel:"gemini-2.5-pro",envVariable:"GEMINI_PATH"};var Re=Object.defineProperty,Ee=m((e,r)=>Re(e,"name",{value:r,configurable:!0}),"o");const Me={alternateCommands:[],buildArgs:Ee((e,r,a)=>{const t=["--quiet","-p",e];return r&&t.push("-m",r),t},"buildArgs"),command:"kimi",defaultModel:"",envVariable:"KIMI_PATH"};var xe=Object.defineProperty,_e=m((e,r)=>xe(e,"name",{value:r,configurable:!0}),"r");const Ie={alternateCommands:[],buildArgs:_e((e,r,a)=>{const t=["run",e];return r&&t.push("-m",r),t},"buildArgs"),command:"opencode",defaultModel:"anthropic/claude-sonnet-4",envVariable:"OPENCODE_PATH"};var Ne=Object.defineProperty,Le=m((e,r)=>Ne(e,"name",{value:r,configurable:!0}),"n");const qe={alternateCommands:["qwen-code"],buildArgs:Le((e,r,a)=>["-p",e,"--yolo","-o","text"],"buildArgs"),command:"qwen",defaultModel:"",envVariable:"QWEN_PATH"};var Ve=Object.defineProperty,f=m((e,r)=>Ve(e,"name",{value:r,configurable:!0}),"s");const x={amp:ce,claude:de,codex:ge,copilot:ve,crush:ke,cursor:$e,droid:Te,gemini:Oe,kimi:Me,opencode:Ie,qwen:qe},C=f(e=>e.startsWith("~")?g(R(),e.slice(1)):e,"resolveHome"),He=f(e=>{try{const r=O(E?"where":"which",[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:Z}).trim().split(`
|
|
2
2
|
`)[0]?.trim();return r&&r.length>0?r:void 0}catch{return}},"whichCommand"),Be=f(e=>{const r=R();if(E){const a=process.env.APPDATA??"",t=process.env.LOCALAPPDATA??"",n=process.env.ProgramFiles??"";return[g(a,"npm",`${e}.cmd`),g(a,"npm",e),g(t,"Programs",e,`${e}.exe`),g(n,e,`${e}.exe`),g(r,".npm-global","bin",`${e}.cmd`)]}return[`/opt/homebrew/bin/${e}`,`/usr/local/bin/${e}`,g(r,".npm-global","bin",e),g(r,".local","bin",e),g(r,".cargo","bin",e)]},"getKnownPaths"),S=f(e=>{try{const r=O(e,["--version"],{encoding:"utf8",stdio:["pipe","pipe","pipe"],timeout:ee}),a=Q.exec(r);return a?a[1]:void 0}catch{return}},"detectVersion"),_=f(e=>{const r=x[e],a={available:!1,name:e},t=process.env[r.envVariable];if(t&&T(C(t))){const i=C(t);return{...a,available:!0,detectionMethod:"envvar",path:i,version:S(i)}}const n=[r.command,...r.alternateCommands];for(const i of n){const o=He(i);if(o)return{...a,available:!0,detectionMethod:"which",path:o,version:S(o)}}for(const i of n)for(const o of Be(i))if(T(o))return{...a,available:!0,detectionMethod:"known-path",path:o,version:S(o)};return a},"detectProvider"),Fe=f(()=>M.map(e=>_(e)),"detectAllProviders"),De=f(()=>Fe().filter(e=>e.available),"detectAvailableProviders"),Je=f((e,r,a={})=>{const t=x[e],n=a.model??t.defaultModel,i=a.maxTokens??te;return t.buildArgs(r,n,i)},"buildCliArgs"),ze=f(async(e,r,a={})=>{if(!e.available||!e.path)throw new Error(`AI provider "${e.name}" is not available.`);const t=Je(e.name,r,a),n=a.timeoutMs??re;return new Promise((i,o)=>{const p={env:{...process.env,FORCE_COLOR:"0",NO_COLOR:"1"},stdio:["pipe","pipe","pipe"]},s=D(e.path,t,p);s.stdin.end();let c="",d="",u=!1;const b=setTimeout(()=>{u=!0,s.kill("SIGTERM"),o(new Error(`${e.name} CLI timed out after ${String(n)}ms`))},n);s.stdout.on("data",h=>{c+=h.toString("utf8")}),s.stderr.on("data",h=>{d+=h.toString("utf8")}),s.on("close",h=>{clearTimeout(b),!u&&(h===0?i({provider:e.name,stderr:d,stdout:c}):o(new Error(`${e.name} CLI exited with code ${String(h)}: ${d||c}`)))}),s.on("error",h=>{clearTimeout(b),u||o(new Error(`Failed to spawn ${e.name} CLI: ${h.message}`))})})},"runProvider");var Ue=Object.defineProperty,I=k((e,r)=>Ue(e,"name",{value:r,configurable:!0}),"i");const We=12e4,Ke=2,Ge=1e3,Ye=I(e=>new Promise(r=>{setTimeout(r,e)}),"sleep"),N=I(async(e,r,a=Ke)=>{let t;for(let n=0;n<=a;n+=1)try{return(await ze(e,r,{timeoutMs:We})).stdout}catch(i){if(t=i instanceof Error?i:new Error(String(i)),t.message.includes("timed out"))throw t;if(n<a){const o=Ge*2**n;await Ye(o)}}throw t??new Error("AI request failed after retries")},"runWithRetry");var Xe=Object.defineProperty,l=k((e,r)=>Xe(e,"name",{value:r,configurable:!0}),"c");const Qe={amp:30,claude:80,codex:60,copilot:50,crush:35,cursor:40,droid:20,gemini:100,kimi:25,opencode:35,qwen:30},Ze=l(e=>{if(e?.provider){if(!M.includes(e.provider))return;const t=_(e.provider);return t.available?t:void 0}const r=De();if(r.length===0)return;const a={...Qe,...e?.priority};return r.toSorted((t,n)=>(a[n.name]??0)-(a[t.name]??0))[0]},"resolveProvider"),er=new Set(["defer","review","skip","update"]),rr=new Set(["critical","high","low","medium"]),tr=new Set(["high","low","medium"]),ar=50,P=30,nr=l(e=>e.map(r=>{const a=r.vulnerabilities&&r.vulnerabilities.length>0?` [VULNERABILITIES: ${r.vulnerabilities.map(n=>`${n.severity} ${n.id}`).join(", ")}]`:"";let t="";if(r.socketReport){const n=Math.round(r.socketReport.score.overall*100),i=[`score:${String(n)}%`];if(r.socketReport.alerts.length>0){const o={};for(const s of r.socketReport.alerts)o[s.severity]=(o[s.severity]??0)+1;const p=Object.entries(o).map(([s,c])=>`${String(c)} ${s}`).join(", ");i.push(`alerts: ${p}`)}i.push(`supply-chain:${String(Math.round(r.socketReport.score.supplyChain*100))}%`),i.push(`quality:${String(Math.round(r.socketReport.score.quality*100))}%`),t=` [SOCKET.DEV: ${i.join(", ")}]`}return`- ${r.packageName}: ${r.currentRange} → ${r.newRange} (${r.updateType})${a}${t}`}).join(`
|
|
3
3
|
`),"buildPackageList"),A=`Respond ONLY with valid JSON in this exact structure:
|
|
4
4
|
{
|
|
@@ -60,9 +60,9 @@ For each package:
|
|
|
60
60
|
5. Flag any packages where skipping the update poses security risk
|
|
61
61
|
6. If Socket.dev scores are provided, factor in supply chain and quality scores — low scores indicate higher risk
|
|
62
62
|
|
|
63
|
-
${A}`,"security")},or=new Set(["compatibility","impact","recommend","security"])
|
|
63
|
+
${A}`,"security")},or=new Set(["compatibility","impact","recommend","security"]),$r=l(e=>or.has(e)?e:"impact","validateAnalysisType"),L=l((e,r="impact")=>{const a=nr(e);return ir[r](a)},"buildAnalysisPrompt"),sr=/```(?:json)?\s*([\s\S]*?)```/,cr=/\{[\s\S]*\}/,lr=l(e=>{try{return JSON.parse(e)}catch{}const r=sr.exec(e);if(r?.[1])try{return JSON.parse(r[1])}catch{}const a=cr.exec(e);if(a?.[0])try{return JSON.parse(a[0])}catch{}},"extractJson"),ur=l(e=>({action:er.has(e.action)?e.action:"review",breakingChanges:Array.isArray(e.breakingChanges)?e.breakingChanges:[],effort:tr.has(e.effort)?e.effort:"medium",package:typeof e.package=="string"?e.package:"",reason:typeof e.reason=="string"?e.reason:"",riskLevel:rr.has(e.riskLevel)?e.riskLevel:"medium"}),"normalizeRecommendation"),q=l((e,r,a)=>{const t=lr(e);if(!t||typeof t!="object")return{analysisType:a,provider:r,recommendations:[],summary:"Failed to parse AI response.",warnings:["AI response was not valid JSON."]};const n=t,i=Array.isArray(n.recommendations)?n.recommendations:[];return{analysisType:a,provider:r,recommendations:i.map(o=>ur(o)),summary:typeof n.summary=="string"?n.summary:"",warnings:Array.isArray(n.warnings)?n.warnings:[]}},"parseAiResponse"),dr={eslint:["ESLint 9.0: Flat config required","ESLint 8.0+: New rule formats"],next:["Next.js 13+: App router changes","Next.js 14+: Server components default"],react:["React 17 to 18: Concurrent features","React 18+: Strict mode changes"],typescript:["TypeScript 5.0: New decorators","TypeScript 4.7+: ESM changes"],vite:["Vite 5: Node.js 18+ required"],vue:["Vue 3: Composition API","Vue 3: Breaking template changes"],webpack:["Webpack 5: Node.js polyfills removed"]},mr=new Set(["bcrypt","cors","crypto-js","express-session","helmet","jose","jsonwebtoken","node-forge","oauth","passport"]),j=l((e,r)=>{const a=e.map(t=>{const n=t.vulnerabilities&&t.vulnerabilities.length>0,i=mr.has(t.packageName),o=dr[t.packageName]??[];let p="low",s="update",c="low",d="Patch/minor update, safe to apply.";return t.updateType==="major"?(p="high",s=o.length>0?"review":"update",c="medium",d=o.length>0?`Major update with known breaking changes: ${o[0]}`:"Major version update, review changelog before applying."):t.updateType==="minor"&&(p="medium",d="Minor update, generally safe."),n&&(p="high",s="update",d="Security update — current version has known vulnerabilities."),i&&t.updateType==="major"&&(s="review",d="Security-sensitive package with major update, careful review needed.",c="high"),{action:s,breakingChanges:o,effort:c,package:t.packageName,reason:d,riskLevel:p}});return{analysisType:r,provider:"rule-engine",recommendations:a,summary:`Rule-based ${r} analysis for ${String(e.length)} packages.`,warnings:["No AI provider available — using built-in rule engine."]}},"ruleBasedAnalysis"),pr=l(async(e,r,a)=>{const t=L(r,a),n=await N(e,t);return q(n,e.name,a)},"analyzeChunk"),gr=l((e,r,a)=>{const t=[],n=[],i=[];for(const o of e)t.push(...o.recommendations),n.push(...o.warnings),o.summary&&i.push(o.summary);return{analysisType:a,provider:r,recommendations:t,summary:i.length===1?i[0]??"":`Analyzed ${String(t.length)} packages in ${String(e.length)} batches.`,warnings:[...new Set(n)]}},"mergeResults"),V={compatibility:"Compatibility",impact:"Impact",recommend:"Recommendations",security:"Security"},Sr=l(e=>{const r=`${V[e.analysisType]??e.analysisType} Analysis (${e.provider})`,a=e.recommendations.flatMap(n=>{const i=[{action:n.action,effort:n.effort,package:n.package,reason:n.reason,risk:n.riskLevel}];return n.breakingChanges.length>0&&i.push({action:"",effort:"",package:"",reason:`Breaking: ${n.breakingChanges.join("; ")}`,risk:""}),i}),t=process.stdout.columns||80;return z(v.createElement(U,{borderStyle:"round",flexDirection:"column",paddingLeft:1,paddingRight:1},v.createElement(y,{bold:!0},r),v.createElement(y,null,""),v.createElement(y,null,e.summary),v.createElement(y,null,""),v.createElement(W,{borderStyle:"none",data:a}),...e.warnings.length>0?[v.createElement(y,null,""),...e.warnings.map((n,i)=>v.createElement(y,{dimColor:!0,key:String(i)},` ${n}`))]:[]),{columns:t})},"formatAiAnalysis");l(e=>JSON.stringify(e,void 0,2),"formatAiAnalysisJson");const Pr=l(async(e,r,a,t="impact")=>{const n=Ze(a);if(!n)return r.info(`No AI CLI tool found, using rule-based analysis.
|
|
64
64
|
`),j(e,t);const i=K(n.name,t,e),o=G(i);if(o)return r.info(`Using cached ${t} analysis from ${o.provider}.
|
|
65
65
|
`),o;const p=V[t]??t;r.info(`Running ${p.toLowerCase()} analysis with ${n.name}...
|
|
66
66
|
`);try{let s;if(e.length>ar){r.info(`Splitting ${String(e.length)} packages into batches of ${String(P)}...
|
|
67
67
|
`);const c=[];for(let u=0;u<e.length;u+=P)c.push(e.slice(u,u+P));const d=[];for(let u=0;u<c.length;u+=1){r.info(` Batch ${String(u+1)}/${String(c.length)}...`);const b=c[u];b&&d.push(await pr(n,b,t))}s=gr(d,n.name,t)}else{const c=await N(n,L(e,t));s=q(c,n.name,t)}return Y(i,s,X(t,a?.cacheTtl)),s}catch(s){const c=s instanceof Error?s.message:String(s);return r.warn(`AI analysis failed (${c}), falling back to rule engine.
|
|
68
|
-
`),j(e,t)}},"runAiAnalysis");export{
|
|
68
|
+
`),j(e,t)}},"runAiAnalysis");export{$r as H,ze as O,Qe as R,Sr as Z,Fe as _,Ze as b,Pr as e,N as r,lr as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var S=Object.defineProperty;var g=(t,e)=>S(t,"name",{value:e,configurable:!0});import{createRequire as _}from"node:module";import{X as v}from"./xxh3-DrAUNq4n.js";import{M as c,h as w,a as d,n as j}from"../packem_chunks/config.js";import{l as A}from"../packem_chunks/bin.js";const M=_(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=g(t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,r]=u.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return u.getBuiltinModule(t)}return M(t)},"__cjs_getBuiltinModule"),{rmSync:f,writeFileSync:h,readdirSync:p,statSync:D}=b("node:fs");var B=Object.defineProperty,n=g((t,e)=>B(t,"name",{value:e,configurable:!0}),"r");const a=n(()=>c(A(),"ai"),"getCacheDirectory"),J=3600*1e3,N=1800*1e3,C=n(()=>{w(a())},"ensureCacheDirectory"),k=n((t,e,r)=>{const s=r.map(i=>({currentRange:i.currentRange,name:i.packageName,targetVersion:i.targetVersion})).toSorted((i,y)=>i.name.localeCompare(y.name)),o=JSON.stringify({analysisType:e,packages:s,provider:t});return v(Buffer.from(o))},"buildCacheKey"),q=n(t=>{const e=c(a(),`${t}.json`);if(d(e))try{const r=j(e);if(Date.now()-r.createdAt>r.ttlMs){f(e,{force:!0});return}return r.result}catch{f(e,{force:!0});return}},"getCachedAnalysis"),z=n((t,e,r)=>{C();const s=a(),o={createdAt:Date.now(),result:e,ttlMs:r};h(c(s,`${t}.json`),JSON.stringify(o,void 0,2),"utf8")},"setCachedAnalysis"),V=n((t,e)=>e!==void 0&&e>0?e:t==="security"?N:J,"getTtlForAnalysisType"),F=n(()=>{const t=a();if(!d(t))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const e=p(t).filter(i=>i.endsWith(".json"));let r=0,s,o;for(const i of e){const y=c(t,i),m=D(y);r+=m.size;const{mtimeMs:l}=m;(s===void 0||l<s)&&(s=l),(o===void 0||l>o)&&(o=l)}return{entries:e.length,newestEntry:o,oldestEntry:s,totalSizeBytes:r}},"getCacheStats"),K=n(t=>v(Buffer.from(JSON.stringify(t))),"buildHashCacheKey"),P=n(t=>{const e=c(a(),`${t}.json`);if(d(e))try{const r=j(e);if(Date.now()-r.createdAt>r.ttlMs){f(e,{force:!0});return}return r.result}catch{f(e,{force:!0});return}},"getCachedJson"),W=n((t,e,r)=>{C();const s=a(),o={createdAt:Date.now(),result:e,ttlMs:r};h(c(s,`${t}.json`),JSON.stringify(o,void 0,2),"utf8")},"setCachedJson"),x=n(()=>{const t=a();if(!d(t))return 0;const e=p(t).filter(r=>r.endsWith(".json"));for(const r of e)f(c(t,r),{force:!0});return e.length},"clearCache");export{x as B,F as J,K as M,P as N,W as O,z as R,q as T,V as j,k};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var O=Object.defineProperty;var f=(t,e)=>O(t,"name",{value:e,configurable:!0});import{createRequire as F}from"node:module";import{readLastRunSummary as T}from"@visulima/task-runner";import{a as k}from"./failure-log-CSC6KfcO.js";import{r as j,f as y,a as D,d as _}from"./run-summary-utils-CJv75pla.js";import{Q as N}from"../packem_chunks/bin.js";import{b as $,C as b,M as A,z as E}from"../packem_chunks/config.js";import{w as B,b as H,r as W}from"./ai-analysis-C_GpXikx.js";import{M as q,N as L,O as Y}from"./ai-cache-DrCLD4gc.js";const C=F(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=f(t=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,a]=l.versions.node.split(".").map(Number);if(e>22||e===22&&a>=3||e===20&&a>=16)return l.getBuiltinModule(t)}return C(t)},"__cjs_getBuiltinModule"),{readFile:M,writeFile:R}=I("node:fs/promises");var z=Object.defineProperty,m=f((t,e)=>z(t,"name",{value:e,configurable:!0}),"u");const J=32*1024,K=m((t,e)=>{if(t.length<=e)return t;const a=t.slice(-e),o=t.length-a.length;return`[…${String(o)} bytes truncated from head…]
|
|
2
|
+
${a}`},"truncateHead"),U=m(async(t,e)=>e===void 0?T(t,{dataDirectory:N(t)}):j(t,e),"loadSummary"),xt=m(async(t,e,a={})=>{const o=a.terminalOutputLimit??J,[n,r]=await Promise.all([k(t,e),U(t,a.runId)]),i=r?y(r,e):void 0;if(!n&&!i)return;let s,c;if(r&&i){const d=await D(t,r.id),g=d?y(d,e):void 0;s=_(i.hashDetails,g?.hashDetails),c=d?.id}const h=n?.terminalOutput??"";return{command:n?.command??void 0,cwd:n?.cwd??void 0,dependencies:i?.dependencies??[],duration:i?.duration,exitCode:n?.exitCode??i?.exitCode,hash:i?.hash??n?.hash,hashDetails:i?.hashDetails,hashDiff:s,previousRunId:c,project:i?.target.project,runId:r?.id??n?.runId,status:n?.status??(i?G(i):void 0),target:i?.target.target,taskId:e,terminalOutput:K(h,o),terminalOutputCaptured:!!n,timestamp:n?.timestamp??i?.endTime??i?.startTime}},"aggregateFailureContext"),G=m(t=>{if(t.exitCode!==void 0&&t.exitCode!==0)return"failure";switch(t.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return t.exitCode===0?"success":void 0}},"mapCacheStatusToTaskStatus");var Q=Object.defineProperty,u=f((t,e)=>Q(t,"name",{value:e,configurable:!0}),"a");const V=3600*1e3,S=80,X=new Set(["high","low","medium"]),Z=u(()=>`You are an expert software engineer helping fix a failing build/test/lint task.
|
|
3
|
+
|
|
4
|
+
You will be given:
|
|
5
|
+
- The terminal output (stdout/stderr) from the failed task.
|
|
6
|
+
- Optional metadata: command, working directory, project, task hash, and a diff describing what changed in the task's hash inputs since the previous run that did not fail.
|
|
7
|
+
|
|
8
|
+
Your job:
|
|
9
|
+
1. Identify the root cause from the terminal output.
|
|
10
|
+
2. Propose a minimal set of source-file patches that fix the cause.
|
|
11
|
+
3. If you cannot determine a safe fix, set "cannotFix" with a clear, actionable explanation.
|
|
12
|
+
|
|
13
|
+
Constraints:
|
|
14
|
+
- Patches MUST be exact string replacements. The "oldString" must appear verbatim in the named file. Paths are relative to the working directory.
|
|
15
|
+
- Each "oldString" must be unique within its file. Include surrounding context so the match is unambiguous.
|
|
16
|
+
- Do NOT include unrelated cleanup, formatting changes, or speculative refactors.
|
|
17
|
+
- If the failure is environmental (missing tool, network) or requires running commands, prefer "cannotFix" over a guess.
|
|
18
|
+
- Keep "explanation" short (1-3 sentences). Reserve "reason" on each patch for why that specific edit fixes the cause.
|
|
19
|
+
|
|
20
|
+
Respond ONLY with valid JSON in this exact structure:
|
|
21
|
+
{
|
|
22
|
+
"explanation": "Brief root-cause analysis and what the fix does.",
|
|
23
|
+
"confidence": "low|medium|high",
|
|
24
|
+
"patches": [
|
|
25
|
+
{
|
|
26
|
+
"file": "path/relative/to/cwd.ts",
|
|
27
|
+
"oldString": "exact text to find",
|
|
28
|
+
"newString": "exact replacement text",
|
|
29
|
+
"reason": "why this change fixes it"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"cannotFix": "optional — set when no safe patch can be proposed"
|
|
33
|
+
}`,"buildSystemPrompt"),v=u((t,e)=>{const a=[];if(e.added.length>0&&a.push(` added: ${e.added.join(", ")}`),e.changed.length>0&&a.push(` changed: ${e.changed.join(", ")}`),e.removed.length>0&&a.push(` removed: ${e.removed.join(", ")}`),a.length!==0)return`- ${t}:
|
|
34
|
+
${a.join(`
|
|
35
|
+
`)}`},"formatBucket"),tt=u(t=>{if(!t.hashDiff)return"No hash-diff available — there is no previous run to compare against.";const e=[];t.hashDiff.commandChanged&&e.push("- command line changed since previous run");const a=v("file inputs",t.hashDiff.nodes),o=v("implicit deps",t.hashDiff.implicitDeps),n=v("runtime/env",t.hashDiff.runtime);return a&&e.push(a),o&&e.push(o),n&&e.push(n),e.length===0?"No detectable changes between this run and the previous run.":e.join(`
|
|
36
|
+
`)},"buildHashDiffSummary"),et=u(t=>{const e=[`Task: ${t.taskId}`];return t.project&&e.push(`Project: ${t.project}`),t.target&&e.push(`Target: ${t.target}`),t.command&&e.push(`Command: ${t.command}`),t.cwd&&e.push(`CWD: ${t.cwd}`),t.exitCode!==void 0&&e.push(`Exit code: ${String(t.exitCode)}`),t.hash&&e.push(`Task hash: ${t.hash}`),e.push("","Hash-diff since previous run:",tt(t),""),t.terminalOutputCaptured?e.push("Terminal output:","```",t.terminalOutput,"```"):e.push("Terminal output: <no failure log was captured for this task>",'Set "cannotFix" and tell the user to re-run with `vis run` so logs can be captured.'),e.join(`
|
|
37
|
+
`)},"buildUserPrompt"),at=u(t=>`${Z()}
|
|
38
|
+
|
|
39
|
+
${et(t)}`,"buildFixPrompt"),it=u((t,e)=>{const a=Array.isArray(t.patches)?t.patches:[],o=[];for(const r of a)typeof r.file!="string"||r.file.length===0||typeof r.oldString!="string"||r.oldString.length===0||typeof r.newString=="string"&&o.push({file:r.file,newString:r.newString,oldString:r.oldString,reason:typeof r.reason=="string"&&r.reason.length>0?r.reason:void 0});const n=typeof t.cannotFix=="string"&&t.cannotFix.length>0?t.cannotFix:void 0;return{cannotFix:n,confidence:X.has(t.confidence)?t.confidence:"low",explanation:typeof t.explanation=="string"?t.explanation:"",patches:n?[]:o,provider:e}},"normalizeFixProposal"),rt=u((t,e)=>{const a=B(t);return!a||typeof a!="object"?{cannotFix:"AI response was not valid JSON.",confidence:"low",explanation:"Failed to parse AI response.",patches:[],provider:e}:it(a,e)},"parseFixResponse"),nt=u((t,e)=>q({cwd:e.cwd??null,flow:"ai-fix",hash:e.hash??null,provider:t,taskId:e.taskId,terminalOutput:e.terminalOutput,terminalOutputCaptured:e.terminalOutputCaptured}),"buildFixCacheKey"),wt=u(async(t,e,a={})=>{const o=H(a.config);if(!o){e.warn(`No AI provider available — install one of: claude, gemini, copilot, codex.
|
|
40
|
+
`);return}const n=a.cache!==!1,r=nt(o.name,t);if(n){const i=L(r);if(i)return e.info(`Using cached fix proposal from ${i.provider}.
|
|
41
|
+
`),i}e.info(`Generating fix proposal with ${o.name}...
|
|
42
|
+
`);try{const i=await W(o,at(t)),s=rt(i,o.name);return n&&s.patches.length>0&&!s.cannotFix&&Y(r,s,V),s}catch(i){const s=i instanceof Error?i.message:String(i);e.warn(`AI fix proposal failed (${s}).
|
|
43
|
+
`);return}},"runFixAnalysis"),st=u((t,e,a)=>$(a)?b(a):b(A(e??t,a)),"resolvePatchPath"),ot=u((t,e)=>{const a=E(t,e);return a===""?!0:!a.startsWith("..")&&!$(a)},"isInsideWorkspace"),ct=u((t,e,a)=>{const o=t.indexOf(e),n=Math.max(0,o-S),r=Math.min(t.length,o+e.length+S),i=t.slice(n,r);return{previewAfter:`${t.slice(n,o)}${a}${t.slice(o+e.length,r)}`,previewBefore:i}},"buildPreview"),yt=u(async(t,e,a,o={})=>{const n=o.dryRun===!0,r=new Map,i=[];for(const s of a.patches){const c=st(t,e,s.file);if(!ot(t,c)){i.push({absolutePath:c,patch:s,status:"outside-workspace"});continue}let h=r.get(c);if(h===void 0){try{h=await M(c,"utf8")}catch(p){const w=p.code;i.push({absolutePath:c,error:w==="ENOENT"?void 0:p.message,patch:s,status:w==="ENOENT"?"missing-file":"error"});continue}r.set(c,h)}const d=h.indexOf(s.oldString);if(d===-1){i.push({absolutePath:c,patch:s,status:"no-match"});continue}if(h.indexOf(s.oldString,d+s.oldString.length)!==-1){i.push({absolutePath:c,patch:s,status:"ambiguous-match"});continue}const{previewAfter:g,previewBefore:P}=ct(h,s.oldString,s.newString),x=`${h.slice(0,d)}${s.newString}${h.slice(d+s.oldString.length)}`;if(!n)try{await R(c,x,"utf8")}catch(p){r.delete(c),i.push({absolutePath:c,error:p.message,patch:s,status:"error"});continue}r.set(c,x),i.push({absolutePath:c,patch:s,previewAfter:g,previewBefore:P,status:"applied"})}return i},"applyFixProposal");export{xt as a,wt as b,yt as c,st as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as e}from"node:module";import{p as l,O as p,k as d,l as u,r as _,i as c,j as g,I as m,X as C,e as T}from"../packem_chunks/config.js";import"jiti";import{otelPlugin as j}from"./otelPlugin-CJR2T_lk.js";import{definePlugin as S}from"./definePlugin-CWm4Dv_t.js";const n=e(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;export{l as CONFIG_FILES,p as SECURITY_DEFAULTS,d as TASK_CONFIG_FILES,u as applyDefaults,_ as defineConfig,S as definePlugin,c as defineTaskConfig,g as findVisConfigFile,m as findVisTaskConfigFile,C as loadVisConfig,T as loadVisTaskConfig,j as otelPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=Object.defineProperty;var l=(e,r)=>h(e,"name",{value:r,configurable:!0});import{createRequire as f}from"node:module";import{b as p,C as a,z as m}from"../packem_chunks/config.js";import{getMainWorktreeRoot as C}from"@visulima/task-runner";import{D as u}from"../packem_chunks/bin.js";const d=f(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=l(e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[r,t]=i.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return i.getBuiltinModule(e)}return d(e)},"__cjs_getBuiltinModule"),{execFileSync:_}=g("node:child_process");var v=Object.defineProperty,n=l((e,r)=>v(e,"name",{value:r,configurable:!0}),"i");const R=n((e,r,t)=>{const s=n(c=>p(c)?c:a(e,c),"normalize");if(r&&r.length>0)return s(r);if(t&&t.length>0)return s(t);const o=process.env.VIS_CACHE_DIRECTORY;return o&&o.length>0?s(o):a(e,u)},"resolveCacheDirectory"),y=n((e,r)=>r===!1?e:C(e)??e,"resolveSharedCacheRoot"),O=n((e,r,t,s)=>{const o=r??t??process.env.VIS_CACHE_DIRECTORY;if(o&&o.length>0)return R(e,r,t);const c=y(e,s);return a(c,u)},"resolveSharedCacheDirectory"),E=/[^\w.-]+/g,S=/^-+|-+$/g,b=n(e=>e.trim().replaceAll(E,"-").replaceAll(S,"").slice(0,64),"sanitizeBranchSegment"),D=n(e=>{try{const r=_("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();return!r||r==="HEAD"?void 0:r}catch{return}},"detectGitBranch"),z=n((e,r,t)=>{if(t!==!0)return e;const s=D(r);if(!s)return e;const o=b(s);return o.length===0?e:a(e,"branches",o)},"applyBranchScope"),H=n((e,r)=>{const t=m(r,e);return t.length===0?!1:t!==".."&&!t.startsWith("../")&&!p(t)},"isCacheDirectoryInsideWorkspace");export{O as E,H as _,z as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var r=(e,n)=>i(e,"name",{value:n,configurable:!0});var a=Object.defineProperty,l=r((e,n)=>a(e,"name",{value:n,configurable:!0}),"n");const u=l(e=>e,"definePlugin");export{u as definePlugin};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var j=Object.defineProperty;var b=(t,e)=>j(t,"name",{value:e,configurable:!0});import{e as E,aE as h,E as w,c as M,d as O,s as R}from"../packem_chunks/bin.js";import{render as A}from"@visulima/tui";import k from"react";import{jsx as i,jsxs as v}from"react/jsx-runtime";import{Box as g}from"@visulima/tui/components/box";import{Spinner as I}from"@visulima/tui/components/spinner";import{Text as f}from"@visulima/tui/components/text";import{D as S,W as Y,T as B,C as G}from"./symbols-CQmER5MT.js";import{$ as T,M as D}from"../packem_chunks/config.js";import{F as P}from"./lockfile-i-qvq_k8.js";var N=Object.defineProperty,W=b((t,e)=>N(t,"name",{value:e,configurable:!0}),"l$1");const $=W(({rows:t})=>i(g,{flexDirection:"column",children:t.map(e=>{let r;switch(e.status){case"error":{r=i(f,{color:"red",children:G});break}case"ok":{r=i(f,{color:"green",children:B});break}case"running":{r=i(f,{color:"white",children:i(I,{type:"dots"})});break}case"warn":{r=i(f,{color:"yellow",children:Y});break}default:{r=i(f,{dimColor:!0,children:S});break}}return v(g,{children:[i(g,{width:3,children:r}),i(g,{flexGrow:1,children:i(f,{children:e.label})}),e.summary?i(g,{children:v(f,{dimColor:!0,children:[S," ",e.summary]})}):null]},e.id)})}),"ScanProgressApp");var z=Object.defineProperty,l=b((t,e)=>z(t,"name",{value:e,configurable:!0}),"e");const F={error:O(h.failure),ok:M(h.success),pending:w(h.dash),skip:w(h.dash),warn:E(h.warning)},H=l((t,e,r)=>{const m=r?`${t} ${w(`— ${r}`)}`:t;return` ${F[e]} ${m}
|
|
2
|
+
`},"formatStaticRow"),te=l((t,e={})=>{const r=e.stream??process.stderr,m=typeof r.isTTY=="boolean"&&r.isTTY&&!R,u=e.live??m,n=new Map;for(const o of t)n.set(o.id,{id:o.id,label:o.label,status:"pending"});if(!u||t.length===0)return{finish:l((o,c,y)=>{const d=n.get(o);d&&(n.set(o,{...d,status:c,summary:y}),r.write(H(d.label,c,y)))},"finish"),start:l(o=>{const c=n.get(o);c&&n.set(o,{...c,status:"running"})},"start"),stop:l(()=>{},"stop")};const p=l(()=>t.map(o=>n.get(o.id)),"buildRows");let s=A(k.createElement($,{rows:p()}),{interactive:!0,patchConsole:!1});const a=l(()=>{s?.rerender(k.createElement($,{rows:p()}))},"rerender");return{finish:l((o,c,y)=>{const d=n.get(o);d&&(n.set(o,{...d,status:c,summary:y}),a())},"finish"),start:l(o=>{const c=n.get(o);c&&(n.set(o,{...c,status:"running"}),a())},"start"),stop:l(()=>{s&&(a(),s.unmount(),s=void 0)},"stop")}},"startScanProgress");var K=Object.defineProperty,x=b((t,e)=>K(t,"name",{value:e,configurable:!0}),"l");const C={bun:{file:"bun.lock",type:"bun"},npm:{file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},ne=x((t,e)=>{const r=C[e];if(!r)return[];let m;try{m=T(D(t,r.file))}catch{return[]}const u=P(m,r.type);if(u.length===0)return[];const n=new Set,p=[];for(const s of u){const a=`${s.name}@${s.version}`;n.has(a)||(n.add(a),p.push({isDev:!1,name:s.name,version:s.version}))}return p},"lockedPackages"),se=x((t,e)=>{const r=C[e];if(!r)return[];let m;try{m=T(D(t,r.file))}catch{return[]}const u=P(m,r.type);if(u.length===0)return[];const n=new Map;for(const s of u)n.has(s.name)||n.set(s.name,new Set),n.get(s.name).add(s.version);const p=[];for(const[s,a]of n)a.size<=1||p.push({name:s,versions:[...a]});return p.sort((s,a)=>s.name.localeCompare(a.name))},"findDuplicateDependencies");export{se as f,ne as l,te as s};
|