@codeledger/core-engine 0.6.9 → 0.7.0
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/bin/codeledger-core.cjs +15 -15
- package/package.json +4 -4
package/bin/codeledger-core.cjs
CHANGED
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
/* Free for individual use. Commercial use requires a license. */
|
|
5
5
|
/* No network calls. No telemetry. Runs entirely local. */
|
|
6
6
|
/* Run with --license or --explain-architecture for details. */
|
|
7
|
-
"use strict";var Ze=require("node:fs");var ee=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","is","it","that","this","be","as","are","was","were","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","need","must","not","no","if","then","else","when","up","out","so","than","too","very","just","about","into","over","after","before","between","under","above","all","each","every","both","few","more","most","some","any","add","fix","update","change","make","use","get","set","find","check","look","see","know","think","want","try","run","show","help","work","take","give","tell","call","go","come","keep","let","begin","start","end","stop","ready","live","done","good","new","old","big","small"]),Je=new Set(["test","tests","testing","build","lint","debug","deploy","review","audit","evaluate","assess","analyze","examine","application","app","project","codebase","code","repo"]),Ve=["ready for","go live","production ready","readiness","find out","evaluate","assess","audit","review the","status of","state of","quality of","health of","overall","end to end","full","comprehensive"].map(e=>new RegExp(`\\b${e}\\b`)),Qe=["replace","everywhere","all files","every file","migrate","files that import","files that use","across all","update all","rename all"].map(e=>new RegExp(`\\b${e}\\b`)),H=50,Ae=[".sql",".proto",".prisma",".graphql",".gql"],Le=["openapi","swagger","schema","migrations"],et=new Set(["config","configuration","script","dependency","dependencies","setup","package","tsconfig","eslint","prettier","webpack","vite","rollup"]),tt=new Set(["test","tests","testing","ci","pipeline","failing","pass","coverage","jest","vitest","mocha","cypress","playwright"]),st=new Set(["schema","api","endpoint","migration","contract","proto","graphql","openapi","swagger","prisma","database"]),nt=["package.json","tsconfig","pnpm-workspace",".env.example","eslint","prettier","webpack.config","vite.config","rollup.config"],ot=["vitest.config","jest.config",".github/workflows","ci.yml","ci.yaml","test-setup","test-helper","test-utils",".test.ts",".test.tsx",".test.js",".spec.ts",".spec.tsx",".spec.js","__tests__/"],rt=/\b(?:and then|and also|and|then|also|plus)\b|[;,]/i;function U(e){let t=e.toLowerCase(),o=Ve.some(r=>r.test(t))?new Set([...ee,...Je]):ee,s=t.split(/[^\p{L}\p{N}]+/u).filter(r=>r.length>1&&!o.has(r));return[...new Set(s)]}function Ne(e){let t=e.split(rt).map(o=>o.trim()).filter(o=>o.length>0);if(t.length<=1)return[U(e)];let n=[];for(let o of t){let s=U(o);s.length>0&&n.push(s)}return n.length>0?n:[U(e)]}function De(e,t,n){let o=new Map;for(let s of e){let r=0;for(let a of t.files)(a.path.toLowerCase().includes(s)||a.content_keywords?.some(d=>d===s||d===s+"s"||s===d+"s"))&&r++;if(r===0){o.set(s,0);continue}let i=1/Math.sqrt(Math.max(1,r));s.length<=2&&(i=Math.min(i,.35)),r>n&&(i=Math.min(i,.35)),i=Math.max(.35,Math.min(1,i)),o.set(s,i)}return o}function it(e){let t=e.toLowerCase();return Qe.some(n=>n.test(t))}function at(e,t){let n=[];for(let o of t.files){let i=(o.path.toLowerCase().split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/);for(let a of e)if(i.some(c=>c===a||c===a+"s"||a===c+"s")){n.push(o.path);break}}return n}function te(e,t,n,o){let s=new Set,r=new Set,i=new Set,a=o??n.default_scope??Oe(e,t),d=Ne(e),c=[...new Set(d.flat())],p=De(c,t,n.hot_zone_count),f=a?t.files.filter(x=>a.some(b=>x.path.startsWith(b))):t.files;for(let x of d)for(let b of f){if(s.has(b.path))continue;let M=b.path.toLowerCase();for(let h of x){if(M.includes(h)){s.add(b.path);break}if(b.content_keywords?.some(L=>L===h||L===h+"s"||h===L+"s")){s.add(b.path);break}}}let m=(n.default_budget.max_files??1/0)<=15,_=new Set(f.map(x=>x.path)),u=t.churn.slice(0,n.hot_zone_count);for(let x of u)_.has(x.path)&&(m&&!s.has(x.path)||s.add(x.path));let l=a?_:void 0,g=[...s];for(let x of g)lt(x,t,s,n.dependency_depth,n.dependency_cap_per_seed,l);if(it(e)){let x=at(c,t);for(let b of x){if(s.size>=H)break;let M=t.dep_graph.dependents[b]??[];for(let h of M){if(s.size>=H)break;l&&!l.has(h)||(s.add(h),r.add(h))}if(s.size<H)for(let h of M){if(s.size>=H)break;if(l&&!l.has(h))continue;let L=t.dep_graph.dependents[h]??[];for(let v of L){if(s.size>=H)break;l&&!l.has(v)||(s.add(v),r.add(v))}}}}let w=[...s];for(let x of t.test_map)w.includes(x.source_file)&&(!l||l.has(x.test_file))&&s.add(x.test_file),w.includes(x.test_file)&&(!l||l.has(x.source_file))&&s.add(x.source_file);let T=ct(t.files,n.contract_patterns);if(T.length>0&&s.size>0){let x=new Set([...s].map(b=>b.split("/").slice(0,-1).join("/")));for(let b of T){let M=b.split("/").slice(0,-1).join("/");(x.has(M)||[...x].some(L=>L.startsWith(M+"/")||M.startsWith(L+"/")))&&s.add(b)}}let k=new Set(c),R=[...et].some(x=>k.has(x)),E=[...tt].some(x=>k.has(x)),N=[...st].some(x=>k.has(x));if(R||E||N){let x=N?new Set([...s].map(b=>b.split("/").slice(0,-1).join("/"))):void 0;for(let b of f){if(s.has(b.path))continue;let M=b.path.toLowerCase();if(R&&nt.some(h=>M.includes(h))){s.add(b.path),i.add(b.path);continue}if(E&&ot.some(h=>M.includes(h))){s.add(b.path),i.add(b.path);continue}if(N&&x){let h=b.extension.toLowerCase(),L=M.split("/").pop()??"";if(Ae.includes(h)||Le.some(A=>L.startsWith(A))){let A=b.path.split("/").slice(0,-1).join("/");(x.has(A)||[...x].some(z=>z.startsWith(A+"/")||A.startsWith(z+"/")))&&(s.add(b.path),i.add(b.path))}}}}return{candidates:s,tokenWeights:p,fanoutFiles:r,surfaceFiles:i}}function ct(e,t){let n=[];for(let o of e){let s=o.extension.toLowerCase(),r=o.path.toLowerCase();if(Ae.includes(s)){n.push(o.path);continue}if(t?.some(a=>r.includes(a.toLowerCase()))){n.push(o.path);continue}let i=r.split("/").pop()??"";Le.some(a=>i.startsWith(a))&&n.push(o.path)}return n}function lt(e,t,n,o,s,r){let i=[e],a=0;for(let d=0;d<o&&a<s;d++){let c=[];for(let p of i){let f=t.dep_graph.imports[p]??[];for(let _ of f)r&&!r.has(_)||!n.has(_)&&a<s&&(n.add(_),c.push(_),a++);let m=t.dep_graph.dependents[p]??[];for(let _ of m)r&&!r.has(_)||!n.has(_)&&a<s&&(n.add(_),c.push(_),a++)}i=c}}function Oe(e,t){let n=e.toLowerCase(),o=/[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)+/g,s=(n.match(o)??[]).filter(d=>!ee.has(d));if(s.length===0)return;let r=new Map;for(let d of t.files){let c=d.path.split("/");for(let p=0;p<c.length-1;p++){let f=c[p];if(!f)continue;let m=f.toLowerCase(),_=c.slice(0,p+1).join("/")+"/";r.has(m)||r.set(m,new Set),r.get(m).add(_)}}let i=new Set;for(let d of s){let c=r.get(d);if(!(!c||c.size===0))for(let p of c)i.add(p)}if(i.size===0)return;let a=[...i].filter(d=>![...i].some(c=>c!==d&&c.startsWith(d)));return a.length>0?a:void 0}var pt=["auth","login","logout","session","oauth","jwt","token","crypt","hash","secret","password","credential","validat","sanitiz","escap","query","sql","database","migration","route","controller","endpoint","middleware","permission","rbac","acl","role","csrf","cors","helmet","rate-limit"],dt=new Set(["security","secure","audit","vulnerability","vulnerabilities","injection","xss","csrf","auth","authentication","authorization","encrypt","decrypt","hash","password","credential","token","sanitize","escape","validate","permission","privilege"]);function se(e){let n=e.path.toLowerCase().split("/"),o=[];for(let r of n){let i=r.replace(/\.\w+$/,"");for(let a of i.split(/[-_]/))a.length>0&&o.push(a)}return o.some(r=>pt.some(i=>r===i||r===i+"s"||r.startsWith(i)))?1:0}function ne(e){return e.some(t=>dt.has(t))}var ft=["error","exception","validation","validator","schema"],ut=3,ht=.5,mt=2,_t=.25;function gt(e){return(e.path.toLowerCase().split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/).some(r=>ft.some(i=>r===i||r===i+"s"))?1:0}function Fe(e,t,n,o,s,r){let i=e.path.toLowerCase(),a=e.content_keywords??[],c=(i.split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/),p=0,f=0,m=!1;for(let C of t){let j=s?.get(C)??1;if(j!==0){if(f+=j,i.includes(C)){let F=c.some(B=>B===C||B===C+"s"||C===B+"s");p+=j*(F?ut:1)}else if(a.some(F=>F===C||F===C+"s"||C===F+"s")){let F=C.length>=12&&a.includes(C);p+=j*(F?mt:ht),m=!0}}}let _=f>0?Math.min(1,p/(f*1.5)):0,u=n.dep_graph.imports[e.path]?.length??0,l=n.dep_graph.dependents[e.path]?.length??0,g=u+l,w=Math.max(1,...n.files.map(C=>{let j=n.dep_graph.imports[C.path]?.length??0,F=n.dep_graph.dependents[C.path]?.length??0;return j+F})),T=g/w,k=n.churn.find(C=>C.path===e.path),R=k?.time_decayed_score??0,E=k?.days_since_last_touch??999,N=E<=7?1:E<=14?.8:E<=30?.5:E<=60?.2:0,x=n.test_map.filter(C=>C.source_file===e.path||C.test_file===e.path),b=/[./](?:test|spec)\.[^/]+$/.test(i)||i.includes("__tests__/"),M=0;x.length>0?(M=.5,M+=Math.min(.5,x.length*.25)):b&&(M=.4);let h=Math.max(0,Math.min(1,e.lines/1e3)),L=o?.success_files.has(e.path)?1:0,v=o?.fail_files.has(e.path)?1:0,A=gt(e),$=r?.has(e.path)?1:0,z=se(e);return{keyword:_,centrality:T,churn:R,recent_touch:N,test_relevance:M,size_penalty:h,success_prior:L,fail_prior:v,error_infrastructure:A,branch_changed:$,security_surface:z,_hasContentMatch:m}}function Ie(e){let t;return e.keyword>=.3?t=1:e.keyword>0?t=.5:e.test_relevance>0||e.centrality>.1?t=.4:t=0,t===1?e:{...e,churn:e.churn*t,recent_touch:e.recent_touch*t}}function Pe(e,t){return e.keyword*t.keyword+e.centrality*t.centrality+e.churn*t.churn+e.recent_touch*t.recent_touch+e.test_relevance*t.test_relevance-e.size_penalty*t.size_penalty+e.success_prior*t.success_prior-e.fail_prior*t.fail_prior+e.error_infrastructure*(t.error_infrastructure??.08)+e.branch_changed*(t.branch_changed??0)+(e.security_surface??0)*(t.security_surface??0)}function je(e){let t=[];return e.keyword>0&&(t.push("keyword_match"),e._hasContentMatch&&t.push("content_match")),e.centrality>.3&&t.push("dependency_neighbor"),e.churn>.3&&t.push("high_churn"),e.recent_touch>.5&&t.push("recent_touch"),e.test_relevance>0&&t.push("test_relevant"),e.size_penalty>.5&&t.push("size_penalty"),e.success_prior>0&&t.push("success_prior"),e.error_infrastructure>0&&t.push("error_infrastructure"),e.branch_changed>0&&t.push("branch_changed"),(e.security_surface??0)>0&&t.push("security_surface"),t}function oe(e,t,n,o,s,r,i,a,d){let c=new Map(n.files.map(f=>[f.path,f])),p=[];for(let f of e){let m=c.get(f);if(!m)continue;let _=Fe(m,t,n,s,r,a),l={...Ie(_),_hasContentMatch:_._hasContentMatch,branch_changed:_.branch_changed,security_surface:_.security_surface},g=Pe(l,o),w=je(l);i?.has(f)&&(g+=_t,w.includes("dependent_neighbor")||w.push("dependent_neighbor")),d?.has(f)&&l.keyword===0&&(g=0,w.length=0,w.push("surface_auto_include")),p.push({path:f,score:g,features:l,reasons:w})}return p.sort((f,m)=>m.score-f.score),p}function yt(e){return e.some(t=>t.reasons.includes("keyword_match")||t.reasons.includes("test_relevant")||t.reasons.includes("temporal_affinity"))}function re(e,t,n,o){return!!(t.max_files&&e.files.length>=t.max_files||t.tokens&&e.totalTokens>=t.tokens||o>0&&e.cumulativeScore/o>=n&&yt(e.files))}var X=require("node:fs"),ze=require("node:path"),wt=10*1024*1024;function G(e,t,n,o,s){let r=(0,ze.join)(e,t),i;try{let l=(0,X.statSync)(r).size;if(l>wt)return{content:`// File too large (${Math.round(l/1024)}KB), skipped`,spans:null,lineCount:1};i=(0,X.readFileSync)(r,"utf-8")}catch{return{content:"",spans:null,lineCount:0}}let a=i.split(`
|
|
8
|
-
`);if(a.length<=o)return{content:i,spans:null,lineCount:a.length};let d=[],c=new Set;for(let l=0;l<a.length;l++){let g=a[l];if(
|
|
7
|
+
"use strict";var Xe=require("node:fs");var te=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","is","it","that","this","be","as","are","was","were","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","need","must","not","no","if","then","else","when","up","out","so","than","too","very","just","about","into","over","after","before","between","under","above","all","each","every","both","few","more","most","some","any","add","fix","update","change","make","use","get","set","find","check","look","see","know","think","want","try","run","show","help","work","take","give","tell","call","go","come","keep","let","begin","start","end","stop","ready","live","done","good","new","old","big","small"]),Ve=new Set(["test","tests","testing","build","lint","debug","deploy","review","audit","evaluate","assess","analyze","examine","application","app","project","codebase","code","repo"]),Qe=["ready for","go live","production ready","readiness","find out","evaluate","assess","audit","review the","status of","state of","quality of","health of","overall","end to end","full","comprehensive"].map(e=>new RegExp(`\\b${e}\\b`)),et=["replace","everywhere","all files","every file","migrate","files that import","files that use","across all","update all","rename all"].map(e=>new RegExp(`\\b${e}\\b`)),H=50,Le=[".sql",".proto",".prisma",".graphql",".gql"],Ne=["openapi","swagger","schema","migrations"],tt=new Set(["config","configuration","script","dependency","dependencies","setup","package","tsconfig","eslint","prettier","webpack","vite","rollup"]),st=new Set(["test","tests","testing","ci","pipeline","failing","pass","coverage","jest","vitest","mocha","cypress","playwright"]),nt=new Set(["schema","api","endpoint","migration","contract","proto","graphql","openapi","swagger","prisma","database"]),ot=["package.json","tsconfig","pnpm-workspace",".env.example","eslint","prettier","webpack.config","vite.config","rollup.config"],rt=["vitest.config","jest.config",".github/workflows","ci.yml","ci.yaml","test-setup","test-helper","test-utils",".test.ts",".test.tsx",".test.js",".spec.ts",".spec.tsx",".spec.js","__tests__/"],it=/\b(?:and then|and also|and|then|also|plus)\b|[;,]/i;function K(e){let t=e.toLowerCase(),o=Qe.some(r=>r.test(t))?new Set([...te,...Ve]):te,s=t.split(/[^\p{L}\p{N}]+/u).filter(r=>r.length>1&&!o.has(r));return[...new Set(s)]}function De(e){let t=e.split(it).map(o=>o.trim()).filter(o=>o.length>0);if(t.length<=1)return[K(e)];let n=[];for(let o of t){let s=K(o);s.length>0&&n.push(s)}return n.length>0?n:[K(e)]}function at(e){let t=/\b[A-Z][a-z]+[A-Z][a-zA-Z0-9]*\b/g,n=/\b[a-z]+[A-Z][a-zA-Z0-9]*\b/g,o=[...e.match(t)??[],...e.match(n)??[]];return[...new Set(o)]}function ct(e){let t=new Set,n=/(?:^|[\s(])([a-zA-Z0-9_./-]+\.[a-zA-Z]{1,4})(?::\d+|(?:\(\d+[,)]))(?:\b|$)/gm;for(let r of e.matchAll(n)){let i=r[1];i.includes("/")&&!i.startsWith("http")&&t.add(i)}let o=/at\s+\S+\s+\(([a-zA-Z0-9_./-]+\.[a-zA-Z]{1,4}):\d+/g;for(let r of e.matchAll(o))t.add(r[1]);let s=/[Ff]ile:\s*([a-zA-Z0-9_./-]+\.[a-zA-Z]{1,4})/g;for(let r of e.matchAll(s))t.add(r[1]);return[...t]}function Oe(e,t,n){let o=new Map;for(let s of e){let r=0;for(let a of t.files)(a.path.toLowerCase().includes(s)||a.content_keywords?.some(d=>d===s||d===s+"s"||s===d+"s"))&&r++;if(r===0){o.set(s,0);continue}let i=1/Math.sqrt(Math.max(1,r));s.length<=2&&(i=Math.min(i,.35)),r>n&&(i=Math.min(i,.35)),i=Math.max(.35,Math.min(1,i)),o.set(s,i)}return o}function lt(e){let t=e.toLowerCase();return et.some(n=>n.test(t))}function pt(e,t){let n=[];for(let o of t.files){let i=(o.path.toLowerCase().split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/);for(let a of e)if(i.some(c=>c===a||c===a+"s"||a===c+"s")){n.push(o.path);break}}return n}function se(e,t,n,o){let s=new Set,r=new Set,i=new Set,a=o??n.default_scope??Pe(e,t),d=De(e),c=[...new Set(d.flat())],p=Oe(c,t,n.hot_zone_count),u=a?t.files.filter(f=>a.some(x=>f.path.startsWith(x))):t.files;for(let f of d)for(let x of u){if(s.has(x.path))continue;let S=x.path.toLowerCase();for(let k of f){if(S.includes(k)){s.add(x.path);break}if(x.content_keywords?.some(R=>R===k||R===k+"s"||k===R+"s")){s.add(x.path);break}}}let m=at(e);for(let f of m){let x=f.toLowerCase();for(let S of u)s.has(S.path)||S.content_keywords?.some(k=>k.toLowerCase()===x||k===f)&&s.add(S.path)}let _=ct(e);for(let f of _)for(let x of u)(x.path===f||x.path.endsWith("/"+f))&&s.add(x.path);let h=n.default_budget.max_files??1/0,l=h<=10,g=h<=15,w=new Set(u.map(f=>f.path));if(!l){let f=t.churn.slice(0,n.hot_zone_count);for(let x of f)w.has(x.path)&&(g&&!s.has(x.path)||s.add(x.path))}let b=a?w:void 0,T=[...s];for(let f of T)ft(f,t,s,n.dependency_depth,n.dependency_cap_per_seed,b);if(lt(e)){let f=pt(c,t);for(let x of f){if(s.size>=H)break;let S=t.dep_graph.dependents[x]??[];for(let k of S){if(s.size>=H)break;b&&!b.has(k)||(s.add(k),r.add(k))}if(s.size<H)for(let k of S){if(s.size>=H)break;if(b&&!b.has(k))continue;let R=t.dep_graph.dependents[k]??[];for(let F of R){if(s.size>=H)break;b&&!b.has(F)||(s.add(F),r.add(F))}}}}let A=[...s];for(let f of t.test_map)A.includes(f.source_file)&&(!b||b.has(f.test_file))&&s.add(f.test_file),A.includes(f.test_file)&&(!b||b.has(f.source_file))&&s.add(f.source_file);let C=dt(t.files,n.contract_patterns);if(C.length>0&&s.size>0){let f=new Set([...s].map(x=>x.split("/").slice(0,-1).join("/")));for(let x of C){let S=x.split("/").slice(0,-1).join("/");(f.has(S)||[...f].some(R=>R.startsWith(S+"/")||S.startsWith(R+"/")))&&s.add(x)}}let N=new Set(c),O=[...tt].some(f=>N.has(f)),$=[...st].some(f=>N.has(f)),P=[...nt].some(f=>N.has(f));if(O||$||P){let f=P?new Set([...s].map(x=>x.split("/").slice(0,-1).join("/"))):void 0;for(let x of u){if(s.has(x.path))continue;let S=x.path.toLowerCase();if(O&&ot.some(k=>S.includes(k))){s.add(x.path),i.add(x.path);continue}if($&&rt.some(k=>S.includes(k))){s.add(x.path),i.add(x.path);continue}if(P&&f){let k=x.extension.toLowerCase(),R=S.split("/").pop()??"";if(Le.includes(k)||Ne.some(E=>R.startsWith(E))){let E=x.path.split("/").slice(0,-1).join("/");(f.has(E)||[...f].some(L=>L.startsWith(E+"/")||E.startsWith(L+"/")))&&(s.add(x.path),i.add(x.path))}}}}return{candidates:s,tokenWeights:p,fanoutFiles:r,surfaceFiles:i}}function dt(e,t){let n=[];for(let o of e){let s=o.extension.toLowerCase(),r=o.path.toLowerCase();if(Le.includes(s)){n.push(o.path);continue}if(t?.some(a=>r.includes(a.toLowerCase()))){n.push(o.path);continue}let i=r.split("/").pop()??"";Ne.some(a=>i.startsWith(a))&&n.push(o.path)}return n}function ft(e,t,n,o,s,r){let i=[e],a=0;for(let d=0;d<o&&a<s;d++){let c=[];for(let p of i){let u=t.dep_graph.imports[p]??[];for(let _ of u)r&&!r.has(_)||!n.has(_)&&a<s&&(n.add(_),c.push(_),a++);let m=t.dep_graph.dependents[p]??[];for(let _ of m)r&&!r.has(_)||!n.has(_)&&a<s&&(n.add(_),c.push(_),a++)}i=c}}function Pe(e,t){let n=e.toLowerCase(),o=/[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)+/g,s=(n.match(o)??[]).filter(d=>!te.has(d));if(s.length===0)return;let r=new Map;for(let d of t.files){let c=d.path.split("/");for(let p=0;p<c.length-1;p++){let u=c[p];if(!u)continue;let m=u.toLowerCase(),_=c.slice(0,p+1).join("/")+"/";r.has(m)||r.set(m,new Set),r.get(m).add(_)}}let i=new Set;for(let d of s){let c=r.get(d);if(!(!c||c.size===0))for(let p of c)i.add(p)}if(i.size===0)return;let a=[...i].filter(d=>![...i].some(c=>c!==d&&c.startsWith(d)));return a.length>0?a:void 0}var ut=["auth","login","logout","session","oauth","jwt","token","crypt","hash","secret","password","credential","validat","sanitiz","escap","query","sql","database","migration","route","controller","endpoint","middleware","permission","rbac","acl","role","csrf","cors","helmet","rate-limit"],ht=new Set(["security","secure","audit","vulnerability","vulnerabilities","injection","xss","csrf","auth","authentication","authorization","encrypt","decrypt","hash","password","credential","token","sanitize","escape","validate","permission","privilege"]);function ne(e){let n=e.path.toLowerCase().split("/"),o=[];for(let r of n){let i=r.replace(/\.\w+$/,"");for(let a of i.split(/[-_]/))a.length>0&&o.push(a)}return o.some(r=>ut.some(i=>r===i||r===i+"s"||r.startsWith(i)))?1:0}function oe(e){return e.some(t=>ht.has(t))}var mt=["error","exception","validation","validator","schema"],_t=3,gt=.5,yt=2,wt=.25;function xt(e){return(e.path.toLowerCase().split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/).some(r=>mt.some(i=>r===i||r===i+"s"))?1:0}function Fe(e,t,n,o,s,r){let i=e.path.toLowerCase(),a=e.content_keywords??[],c=(i.split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/),p=0,u=0,m=!1;for(let E of t){let I=s?.get(E)??1;if(I!==0){if(u+=I,i.includes(E)){let L=c.some(U=>U===E||U===E+"s"||E===U+"s");p+=I*(L?_t:1)}else if(a.some(L=>L===E||L===E+"s"||E===L+"s")){let L=E.length>=12&&a.includes(E);p+=I*(L?yt:gt),m=!0}}}let _=u>0?Math.min(1,p/(u*1.5)):0,h=n.dep_graph.imports[e.path]?.length??0,l=n.dep_graph.dependents[e.path]?.length??0,g=h+l,w=Math.max(1,...n.files.map(E=>{let I=n.dep_graph.imports[E.path]?.length??0,L=n.dep_graph.dependents[E.path]?.length??0;return I+L})),b=g/w,T=n.churn.find(E=>E.path===e.path),A=T?.time_decayed_score??0,C=T?.days_since_last_touch??999,N=C<=7?1:C<=14?.8:C<=30?.5:C<=60?.2:0,O=n.test_map.filter(E=>E.source_file===e.path||E.test_file===e.path),$=/[./](?:test|spec)\.[^/]+$/.test(i)||i.includes("__tests__/"),P=0;O.length>0?(P=.5,P+=Math.min(.5,O.length*.25)):$&&(P=.4);let f=Math.max(0,Math.min(1,e.lines/1e3)),x=o?.success_files.has(e.path)?1:0,S=o?.fail_files.has(e.path)?1:0,k=xt(e),R=r?.has(e.path)?1:0,F=ne(e);return{keyword:_,centrality:b,churn:A,recent_touch:N,test_relevance:P,size_penalty:f,success_prior:x,fail_prior:S,error_infrastructure:k,branch_changed:R,security_surface:F,_hasContentMatch:m}}function Ie(e){let t;return e.keyword>=.3?t=1:e.keyword>0?t=.5:e.test_relevance>0||e.centrality>.1?t=.4:t=0,t===1?e:{...e,churn:e.churn*t,recent_touch:e.recent_touch*t}}function ze(e,t){return e.keyword*t.keyword+e.centrality*t.centrality+e.churn*t.churn+e.recent_touch*t.recent_touch+e.test_relevance*t.test_relevance-e.size_penalty*t.size_penalty+e.success_prior*t.success_prior-e.fail_prior*t.fail_prior+e.error_infrastructure*(t.error_infrastructure??.08)+e.branch_changed*(t.branch_changed??0)+(e.security_surface??0)*(t.security_surface??0)}function je(e){let t=[];return e.keyword>0&&(t.push("keyword_match"),e._hasContentMatch&&t.push("content_match")),e.centrality>.3&&t.push("dependency_neighbor"),e.churn>.3&&t.push("high_churn"),e.recent_touch>.5&&t.push("recent_touch"),e.test_relevance>0&&t.push("test_relevant"),e.size_penalty>.5&&t.push("size_penalty"),e.success_prior>0&&t.push("success_prior"),e.error_infrastructure>0&&t.push("error_infrastructure"),e.branch_changed>0&&t.push("branch_changed"),(e.security_surface??0)>0&&t.push("security_surface"),t}function re(e,t,n,o,s,r,i,a,d){let c=new Map(n.files.map(u=>[u.path,u])),p=[];for(let u of e){let m=c.get(u);if(!m)continue;let _=Fe(m,t,n,s,r,a),l={...Ie(_),_hasContentMatch:_._hasContentMatch,branch_changed:_.branch_changed,security_surface:_.security_surface},g=ze(l,o),w=je(l);i?.has(u)&&(g+=wt,w.includes("dependent_neighbor")||w.push("dependent_neighbor")),d?.has(u)&&l.keyword===0&&(g=0,w.length=0,w.push("surface_auto_include")),p.push({path:u,score:g,features:l,reasons:w})}return p.sort((u,m)=>m.score-u.score),p}function bt(e){return e.some(t=>t.reasons.includes("keyword_match")||t.reasons.includes("test_relevant")||t.reasons.includes("temporal_affinity")||t.reasons.includes("branch_changed")||t.reasons.includes("content_match"))}function ie(e,t,n,o){return!!(t.max_files&&e.files.length>=t.max_files||t.tokens&&e.totalTokens>=t.tokens||o>0&&e.cumulativeScore/o>=n&&bt(e.files))}var Y=require("node:fs"),We=require("node:path"),St=10*1024*1024;function G(e,t,n,o,s){let r=(0,We.join)(e,t),i;try{let l=(0,Y.statSync)(r).size;if(l>St)return{content:`// File too large (${Math.round(l/1024)}KB), skipped`,spans:null,lineCount:1};i=(0,Y.readFileSync)(r,"utf-8")}catch{return{content:"",spans:null,lineCount:0}}let a=i.split(`
|
|
8
|
+
`);if(a.length<=o)return{content:i,spans:null,lineCount:a.length};let d=[],c=new Set;for(let l=0;l<a.length;l++){let g=a[l];if(kt(g)){let w=Math.max(0,l-1),b=Math.min(a.length-1,l+1);Tt(g)&&(b=Et(a,l,20)),d.push({start_line:w+1,end_line:b+1,reason:"type_surface"});for(let T=w;T<=b;T++)c.add(T)}}for(let l=0;l<a.length;l++){let g=a[l];if(vt(g)&&!c.has(l)){let w=Math.max(0,l-1),b=Math.min(a.length-1,l+2);d.push({start_line:w+1,end_line:b+1,reason:"export_signature"});for(let T=w;T<=b;T++)c.add(T)}}for(let l=0;l<a.length;l++){let g=a[l].toLowerCase();for(let w of n)if(g.includes(w)){let b=Math.max(0,l-s),T=Math.min(a.length-1,l+s);d.push({start_line:b+1,end_line:T+1,reason:`keyword_match:${w}`});for(let A=b;A<=T;A++)c.add(A);break}}let p=[...c].sort((l,g)=>l-g),u=[],m=-2;for(let l of p)l>m+1&&u.push(`
|
|
9
9
|
// ... (lines ${m+2}\u2013${l} omitted) ...
|
|
10
|
-
`),
|
|
11
|
-
`),
|
|
12
|
-
`).length,
|
|
13
|
-
`),o=[],s=0;for(;s<n.length;){let r=n[s],i=r.trim();if(
|
|
10
|
+
`),u.push(a[l]),m=l;let _=u.join(`
|
|
11
|
+
`),h=Ct(d);return{content:_,spans:h,lineCount:p.length}}function kt(e){let n=e.trim().replace(/^export\s+(default\s+)?/,"").replace(/^declare\s+/,"");return n.startsWith("interface ")||n.startsWith("type ")||n.startsWith("enum ")||n.startsWith("function ")&&!n.includes("=>")||n.startsWith("abstract class ")||n.startsWith("class ")}function Tt(e){let t=e.trim();return t.includes("{")&&!t.includes("}")}function Et(e,t,n){let o=0,s=Math.min(e.length-1,t+n);for(let r=t;r<=s;r++){let i=e[r];for(let a of i)a==="{"&&o++,a==="}"&&o--;if(o<=0&&r>t)return r}return s}function vt(e){let t=e.trim();return t.startsWith("export ")&&(t.includes("function ")||t.includes("class ")||t.includes("interface ")||t.includes("type ")||t.includes("const ")||t.includes("enum "))}function Ct(e){if(e.length===0)return[];let t=[...e].sort((o,s)=>o.start_line-s.start_line),n=[t[0]];for(let o=1;o<t.length;o++){let s=t[o],r=n[n.length-1];s.start_line<=r.end_line+1?(r.end_line=Math.max(r.end_line,s.end_line),r.reason=`${r.reason}+${s.reason}`):n.push({...s})}return n}var Ke=require("node:crypto"),He=require("node:fs"),Ge=require("node:path");function ae(e,t,n,o,s){let r=[],i=0;if(e.length===0)return{level:"low",score:0,reasons:Rt(o,s),envelope:{structural_coverage:0,test_presence:0,churn_recency:0,keyword_saturation:0,dependency_depth:0}};let a=e.slice(0,5),d=a.filter(h=>h.reasons.includes("keyword_match")),c=d.length/a.length;if(c>=.6?(i+=.35,r.push(`Strong keyword signal: ${d.length}/${a.length} top files match task keywords`)):c>0?(i+=.15,r.push(`Weak keyword signal: only ${d.length}/${a.length} top files match task keywords`)):r.push("No keyword matches in top 5 files \u2014 selection driven by churn/centrality"),e.length>=2){let h=e[0].score,l=e[1].score;h>0&&l>0&&((h-l)/h>=.3?(i+=.2,r.push("Clear top-ranked file with significant score gap")):i+=.1)}let p=e.reduce((h,l)=>h+l.reasons.length,0)/e.length;p>=2?(i+=.2,r.push("Files selected for multiple independent reasons")):p>=1.5&&(i+=.1),n>=3?i+=.15:n>=2?i+=.1:r.push("Task description has few discriminating keywords \u2014 consider being more specific"),e.filter(h=>!h.reasons.every(l=>l==="test_relevant")).length>=e.length*.5&&(i+=.1);let m;if(i>=.65?m="high":i>=.35?m="medium":m="low",m!=="high"){let h=Mt(e,c,n,s);for(let l of h)r.push(l)}let _=At(e,o,s);return{level:m,score:Math.round(i*100)/100,reasons:r,envelope:_}}function At(e,t,n){let o=e.filter(c=>!c.is_stub&&!c.is_exemplar),s=0;if(t&&o.length>0){let c=new Set(o.map(u=>u.path)),p=0;for(let u of o){let m=t.dep_graph.imports[u.path]??[],_=t.dep_graph.dependents[u.path]??[];(m.some(l=>c.has(l))||_.some(l=>c.has(l)))&&p++}s=p/o.length}else o.length>0&&(s=e.some(p=>p.reasons.includes("dependency_neighbor")||p.reasons.includes("dependent_neighbor"))?.5:.2);let r=0;o.length>0&&(r=o.filter(p=>p.reasons.includes("test_relevant")).length/o.length);let i=0;o.length>0&&(i=o.filter(p=>p.reasons.includes("recent_touch")||p.reasons.includes("high_churn")).length/o.length);let a=0;if(n&&n.length>0&&o.length>0){let c=new Set;for(let p of n)for(let u of o)if(u.path.toLowerCase().includes(p)){c.add(p);break}a=c.size/n.length}else if(o.length>0){let c=o.filter(p=>p.reasons.includes("keyword_match")).length;a=Math.min(1,c/Math.max(1,o.length*.5))}let d=0;if(t&&o.length>0){let c=new Set(o.map(u=>u.path)),p=0;for(let u of o){let m=0,_=[u.path],h=new Set;for(let l=0;l<3;l++){let g=[];for(let w of _){if(h.has(w))continue;h.add(w);let b=t.dep_graph.imports[w]??[];for(let T of b)c.has(T)&&!h.has(T)&&(g.push(T),m=l+1)}if(g.length===0)break;_=g}p+=m}d=Math.min(1,p/o.length/3)}return{structural_coverage:Z(s),test_presence:Z(r),churn_recency:Z(i),keyword_saturation:Z(a),dependency_depth:Z(d)}}function Z(e){return Math.round(e*100)/100}function Rt(e,t){let n=["Empty bundle \u2014 no files matched the task"];if(!e||e.files.length===0)return n.push('The repository index contains no files. Run "codeledger scan" to rebuild it.'),n;if(!t||t.length===0)return n.push("No discriminating keywords could be extracted from the task description."),n.push("Suggestion: use specific terms \u2014 file names, function names, or module names."),n;let o=[],s=[];for(let r of t)e.files.some(a=>a.path.toLowerCase().includes(r)||(a.content_keywords?.some(d=>d===r||d===r+"s"||r===d+"s")??!1))?o.push(r):s.push(r);return s.length===t.length?(n.push(`None of the task keywords exist in this repo: "${s.join('", "')}".`),n.push("Suggestion: check spelling, or use file paths and identifiers from this codebase.")):s.length>0?(n.push(`Keywords not found in repo: "${s.join('", "')}". Matched keywords: "${o.join('", "')}".`),n.push("Suggestion: matching files may have been filtered by scope or budget constraints. Try --expand.")):(n.push("All keywords matched files, but they were filtered out (scope, exclude rules, or budget)."),n.push("Suggestion: try --expand for a larger budget, or check --scope if set.")),n}function Mt(e,t,n,o){let s=[];if(t===0)if(o?.some(a=>a.includes("/")||a.includes("."))??!1)s.push("Suggestion: task contains path-like keywords but no files matched \u2014 verify the paths exist in the current branch");else{let a=e.slice(0,3).map(d=>{let c=d.path.split("/");return c[c.length-1]?.replace(/\.\w+$/,"")??d.path});a.length>0&&s.push(`Suggestion: try including file-specific keywords like "${a.join('", "')}" in your task`)}return n<=1&&s.push('Suggestion: use a more descriptive task \u2014 e.g., "fix JWT refresh in auth middleware" instead of "fix auth"'),e.every(i=>i.path.includes(".test.")||i.path.includes(".spec.")||i.path.includes("tests/"))&&e.length>0&&s.push("Suggestion: bundle contains only test files \u2014 add source file keywords to your task"),s}var Be=require("node:fs"),J=require("node:path");var Lt={typescript:3.5,javascript:3.5,tsx:3.5,jsx:3.5,go:3.8,rust:4.2,c:3.8,cpp:4,java:4.5,kotlin:3.8,csharp:4.2,python:3.2,ruby:3,php:3.8,json:2.5,yaml:2.5,toml:2.5,xml:4,markdown:5,bash:3.5,shell:3.5,css:3,scss:3.2,sql:4,graphql:3,protobuf:3.5,prisma:3},Nt=4;function $e(e,t){let n=Lt[t.toLowerCase()]??Nt;return Math.ceil(e*n)}function z(e,t){let n=Ot(t);return $e(e,n)}var Dt={".ts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"jsx",".mjs":"javascript",".cjs":"javascript",".py":"python",".go":"go",".rs":"rust",".java":"java",".kt":"kotlin",".cs":"csharp",".rb":"ruby",".php":"php",".c":"c",".cpp":"cpp",".h":"c",".hpp":"cpp",".json":"json",".yaml":"yaml",".yml":"yaml",".toml":"toml",".xml":"xml",".md":"markdown",".mdx":"markdown",".sh":"bash",".bash":"bash",".css":"css",".scss":"scss",".sql":"sql",".graphql":"graphql",".gql":"graphql",".proto":"protobuf",".prisma":"prisma"};function Ot(e){return Dt[e.toLowerCase()]??"unknown"}function ce(e,t,n,o,s){let r=new Map;for(let c of t){let p=n.imports[c]??[];for(let u of p)t.has(u)||r.set(u,(r.get(u)??0)+1)}if(r.size===0)return[];let i=[...r.entries()].sort((c,p)=>p[1]-c[1]).slice(0,o),a=[],d=0;for(let[c]of i){let p=(0,J.join)(e,c),u;try{u=(0,Be.readFileSync)(p,"utf-8")}catch{continue}let m=Pt(u,c);if(!m)continue;let _=m.split(`
|
|
12
|
+
`).length,h=(0,J.extname)(c),l=z(_,h);if(d+l>s)continue;let g=["interface_stub"];a.push({path:c,score:0,reasons:g,excerpt_spans:null,content:m,token_estimate:l,is_stub:!0}),d+=l}return a}function Pt(e,t){let n=e.split(`
|
|
13
|
+
`),o=[],s=0;for(;s<n.length;){let r=n[s],i=r.trim();if(Ft(i)){if(i.includes("{")&&!i.includes("}")){let a=zt(n,s);o.push(...a),s+=a.length;continue}o.push(r),s++;continue}if(It(i)){let a=jt(n,s);o.push(a),s=Wt(n,s);continue}s++}return o.length===0?null:`// Interface stub (auto-generated by CodeLedger)
|
|
14
14
|
${o.join(`
|
|
15
|
-
`)}`}function
|
|
16
|
-
`}return n||e[t]}function
|
|
17
|
-
`);for(let r=0;r<s.length;r++){let i=s[r],a=i.trim();if(!(a.startsWith("//")||a.startsWith("*")||a.startsWith("/*")))for(let d of n){let c;try{c=new RegExp(d.pattern)}catch{continue}let p=c.exec(i);p&&o.push({line:r+1,matched:p[0],message:d.message})}}return o}var
|
|
18
|
-
`).length,
|
|
19
|
-
`).length,
|
|
20
|
-
`),n=[],o=0;for(let r of t)for(let i of
|
|
21
|
-
`),!0):e.includes("--license")?(process.stdout.write([`CodeLedger Core Engine v${
|
|
22
|
-
`)),!0):e.includes("--explain-architecture")?(process.stdout.write([`CodeLedger Core Engine v${
|
|
23
|
-
`)),!0):!1}async function
|
|
15
|
+
`)}`}function Ft(e){let t=e.startsWith("export ")?e.slice(7).replace(/^default\s+/,""):null;return t?t.startsWith("interface ")||t.startsWith("type ")||t.startsWith("enum "):!1}function It(e){return e.startsWith("export ")?e.slice(7).replace(/^default\s+/,"").replace(/^async\s+/,"").startsWith("function "):!1}function zt(e,t){let n=[],o=0;for(let s=t;s<e.length&&s<t+50;s++){let r=e[s];n.push(r);for(let i of r)i==="{"&&o++,i==="}"&&o--;if(o<=0&&s>t)break}return n}function jt(e,t){let n="";for(let o=t;o<e.length&&o<t+5;o++){let s=e[o],r=s.indexOf("{");if(r>=0){n+=s.slice(0,r).trimEnd()+";";break}n+=s+`
|
|
16
|
+
`}return n||e[t]}function Wt(e,t){let n=0;for(let o=t;o<e.length;o++){let s=e[o];for(let r of s)r==="{"&&n++,r==="}"&&n--;if(n<=0&&o>t)return o+1}return e.length}var $t=[{pattern:"\\bfs\\.exists\\b",message:"fs.exists is deprecated \u2014 use fs.access() or fs.stat()"},{pattern:"\\bfs\\.existsSync\\b",message:"fs.existsSync is deprecated in async contexts \u2014 prefer fs.accessSync()"},{pattern:"\\bnew Buffer\\(",message:"Buffer() constructor is deprecated \u2014 use Buffer.from() or Buffer.alloc()"},{pattern:"\\brequire\\('url'\\)\\.parse",message:"url.parse() is deprecated \u2014 use new URL() constructor"},{pattern:"\\burl\\.parse\\(",message:"url.parse() is deprecated \u2014 use new URL() constructor"},{pattern:"\\butil\\.isArray\\b",message:"util.isArray is deprecated \u2014 use Array.isArray()"},{pattern:"\\butil\\.isDate\\b",message:"util.isDate is deprecated \u2014 use instanceof Date"},{pattern:"\\butil\\.isRegExp\\b",message:"util.isRegExp is deprecated \u2014 use instanceof RegExp"},{pattern:"\\bcomponentWillMount\\b",message:"componentWillMount is deprecated \u2014 use componentDidMount or useEffect"},{pattern:"\\bcomponentWillReceiveProps\\b",message:"componentWillReceiveProps is deprecated \u2014 use getDerivedStateFromProps or useEffect"},{pattern:"\\bcomponentWillUpdate\\b",message:"componentWillUpdate is deprecated \u2014 use getSnapshotBeforeUpdate"},{pattern:"\\bReact\\.createClass\\b",message:"React.createClass is removed \u2014 use class components or function components"},{pattern:"\\bReactDOM\\.render\\(",message:"ReactDOM.render is deprecated in React 18+ \u2014 use createRoot().render()"},{pattern:"@ts-ignore",message:"Prefer @ts-expect-error over @ts-ignore for better error tracking"}];function le(e,t){let n=[...$t,...t??[]],o=[],s=e.split(`
|
|
17
|
+
`);for(let r=0;r<s.length;r++){let i=s[r],a=i.trim();if(!(a.startsWith("//")||a.startsWith("*")||a.startsWith("/*")))for(let d of n){let c;try{c=new RegExp(d.pattern)}catch{continue}let p=c.exec(i);p&&o.push({line:r+1,matched:p[0],message:d.message})}}return o}var pe=require("node:fs"),D=require("node:path");var Bt=["add","create","implement","build","new","introduce","scaffold","write","make","generate","setup","set up"],Ut=["test","tests","testing","spec","specs","write","add","create"];function de(e,t,n,o,s,r,i){let a=o.some(g=>Bt.includes(g)),c=i==="test_update"&&o.some(g=>Ut.includes(g));if(!a&&!c)return[];let p=new Set(t.map(g=>g.path)),u=[],m=0;if(c){let g=new Set;for(let w of n.test_map){if(u.length>=s)break;if(!p.has(w.source_file)||p.has(w.test_file)||g.has(w.test_file))continue;let b=(0,D.join)(e,w.test_file),T;try{T=(0,pe.readFileSync)(b,"utf-8")}catch{continue}let A=T.split(`
|
|
18
|
+
`).length,C=(0,D.extname)(w.test_file),N=z(A,C);if(m+N>r)continue;let O=["pattern_exemplar"];u.push({path:w.test_file,score:0,reasons:O,excerpt_spans:null,content:T,token_estimate:N,is_exemplar:!0}),m+=N,g.add(w.test_file)}}if(!a)return u;let _=new Map;for(let g of t){if(g.is_stub||g.is_exemplar)continue;let w=(0,D.dirname)(g.path),b=_.get(w)??[];b.push(g.path),_.set(w,b)}let h=new Set,l=new Set(u.map(g=>g.path));for(let[g,w]of _){if(h.has(g))continue;if(u.length>=s)break;let b=n.files.filter(S=>p.has(S.path)||l.has(S.path)||S.is_test?!1:(0,D.dirname)(S.path)===g);if(b.length===0)continue;let T=(0,D.extname)(w[0]),A=b.map(S=>{let k=0;(0,D.extname)(S.path)===T&&(k+=2);let R=(0,D.basename)(S.path,(0,D.extname)(S.path));for(let F of w){let E=(0,D.basename)(F,(0,D.extname)(F)),I=R.split(/[-_.]/),L=E.split(/[-_.]/),U=I.filter(q=>L.includes(q));k+=U.length*.5}return S.lines<=150?k+=1:S.lines<=300&&(k+=.5),{file:S,score:k}});A.sort((S,k)=>k.score-S.score);let C=A[0];if(!C||C.score<1)continue;let N=(0,D.join)(e,C.file.path),O;try{O=(0,pe.readFileSync)(N,"utf-8")}catch{continue}let $=O.split(`
|
|
19
|
+
`).length,P=(0,D.extname)(C.file.path),f=z($,P);if(m+f>r)continue;let x=["pattern_exemplar"];u.push({path:C.file.path,score:0,reasons:x,excerpt_spans:null,content:O,token_estimate:f,is_exemplar:!0}),m+=f,h.add(g)}return u}var Ue=["test","tests","testing","spec","specs","jest","vitest","mocha"],Kt=["config","configuration","settings","setup","env","environment"],Ht=["database","migration","schema","sql","query","model","table"];function fe(e,t,n,o){let s=[],r=o.toLowerCase();!e.some(h=>!h.is_stub&&!h.is_exemplar&&h.reasons.includes("keyword_match"))&&e.length>0&&s.push({level:"warning",code:"no_keyword_match",message:"No files matched task keywords. Bundle is based on churn/centrality signals only \u2014 consider rephrasing the task."});let a=t.some(h=>Ue.includes(h))||Ue.some(h=>r.includes(h)),d=e.some(h=>h.path.includes(".test.")||h.path.includes(".spec.")||h.path.includes("__tests__"));a&&!d&&s.push({level:"warning",code:"missing_test_files",message:"Task mentions testing but no test files are in the bundle. Test files may have been filtered or out of budget."});let c=t.some(h=>Kt.includes(h)),p=e.some(h=>{let l=h.path.toLowerCase();return l.includes("config")||l.includes(".env")||l.includes("tsconfig")||l.includes("package.json")});c&&!p&&s.push({level:"info",code:"missing_config_files",message:"Task mentions configuration but no config files are in the bundle."});let u=t.some(h=>Ht.includes(h)),m=e.some(h=>{let l=h.path.toLowerCase();return l.includes("model")||l.includes("migration")||l.includes("schema")||l.includes(".sql")||l.includes("db/")||l.includes("database")});u&&!m&&s.push({level:"info",code:"missing_db_files",message:"Task mentions database/schema but no database files are in the bundle."});let _=e.filter(h=>!h.is_stub&&!h.is_exemplar);if(_.length>=5){let h=_[0]?.score??0,l=_[_.length-1]?.score??0;h>0&&l>0&&l/h>.85&&s.push({level:"info",code:"score_plateau",message:"File scores are very close together \u2014 no strong signal file. The task may be too broad or generic."})}if(_.length===0&&s.push({level:"warning",code:"empty_bundle",message:"Bundle contains no source files. The task may not match any files in the repository."}),n.length>0&&_.length>0){let h=_[_.length-1].score,l=n.filter(g=>g.score>h&&!e.some(w=>w.path===g.path));l.length>3&&s.push({level:"info",code:"budget_squeeze",message:`${l.length} files with strong scores were excluded by budget constraints. Consider increasing --budget or --max-files.`})}return s}var Gt=5;function ue(e,t,n,o,s,r){let i=new Set(t.map(p=>p.path)),a=s??Gt,d=[],c=0;for(let p of e){if(c++,i.has(p.path)||p.score<=0)continue;if(d.length>=a)break;let m=r?.get(p.path)??Math.max(1,Math.round(p.features.size_penalty*1e3)),_=p.path.includes(".")?"."+p.path.split(".").pop():"",h=z(m,_),l=o?o-n:1/0,g=Math.max(0,h-l),w=Zt(p,g),b=[...p.reasons];d.push({path:p.path,score:Math.round(p.score*1e3)/1e3,rank:c,reasons:b,budget_gap_tokens:g,suggestion:w})}return d}function Zt(e,t){let n=[],o=e.path.split("/"),r=(o[o.length-1]??"").replace(/\.\w+$/,"").split(/[-_.]/).join(" ");return t>0&&n.push(`increase budget by ~${t} tokens`),e.features.keyword===0&&r&&n.push(`add "${r}" to your task description`),n.length===0&&n.push("increase --max-files or --budget"),n.join("; or ")}function he(e,t,n){let o=[],s=new Set(e.map(i=>i.path)),r=new Map;for(let i of n){let a=r.get(i.source_file)??[];a.push(i.test_file),r.set(i.source_file,a)}for(let i of e){if(i.is_stub||i.is_exemplar)continue;let a=(t.dependents[i.path]??[]).filter(u=>!s.has(u)),d=qt(i.path,t,s),c=new Set,p=r.get(i.path)??[];for(let u of p)c.add(u);for(let u of a){let m=r.get(u)??[];for(let _ of m)c.add(_)}for(let u of d){let m=r.get(u)??[];for(let _ of m)c.add(_)}a.length===0&&d.length===0&&c.size===0||o.push({path:i.path,direct_dependents:a,transitive_dependents:d,impacted_tests:[...c]})}return o.sort((i,a)=>{let d=i.direct_dependents.length+i.transitive_dependents.length+i.impacted_tests.length;return a.direct_dependents.length+a.transitive_dependents.length+a.impacted_tests.length-d}),o}function qt(e,t,n){let o=new Set([e]),s=[],r=[e];for(let i=0;i<3;i++){let a=[];for(let d of r){let c=t.dependents[d]??[];for(let p of c)if(!o.has(p)){if(o.add(p),!n.has(p)&&(s.push(p),s.length>=20))return s;a.push(p)}}if(r=a,r.length===0)break}return s}var Xt=["fix","bug","broken","crash","error","issue","wrong","fail","incorrect","invalid","null","undefined","exception","regression","patch","hotfix"],Yt=["add","create","implement","build","new","introduce","scaffold","feature","endpoint","component","page","route","service"],Jt=["refactor","restructure","reorganize","clean","simplify","extract","rename","move","split","merge","consolidate","optimize","improve","modernize","upgrade","migrate","replace"],Vt=["test","tests","testing","spec","specs","coverage","assertion","mock","stub","fixture","jest","vitest","mocha","e2e","execute"],Qt=["config","configuration","settings","setup","env","environment","ci","pipeline","deploy","docker","workflow","tsconfig","webpack","vite"],es=["security","vulnerability","cve","xss","csrf","injection","auth","authentication","authorization","permission","permissions","sanitize","escape","encrypt","decrypt","token","secret","cors","owasp","exploit","attack","malicious"],ts=["doc","docs","documentation","readme","changelog","contributing","jsdoc","tsdoc","comment","comments","annotate","annotation","guide","tutorial","example","examples","wiki"],ss=["dependency","dependencies","upgrade","downgrade","bump","version","package","lockfile","npm","yarn","pnpm","pip","cargo","outdated","deprecated","breaking","semver","peer"],ns=["performance","perf","slow","speed","fast","latency","throughput","cache","caching","memoize","memoization","lazy","benchmark","profile","profiling","bottleneck","memory","leak","optimize","debounce","throttle","batch","pagination","index","query"],os=["validate","lint","format","prettier","eslint","compliance","todo","todos","fixme","codemod","sweep"],rs=["repo.?wide","across repo","everywhere","update all","rename everywhere","bulk"].map(e=>new RegExp(`\\b${e}\\b`,"i"));function me(e){let t=e.toLowerCase(),n=t.split(/[^\p{L}\p{N}]+/u).filter(i=>i.length>0),o={bug_fix:0,feature_add:0,refactor:0,test_update:0,config:0,repo_scan:0,security_fix:0,docs_update:0,dependency_upgrade:0,performance:0,general:0};for(let i of n)Xt.includes(i)&&(o.bug_fix+=1),Yt.includes(i)&&(o.feature_add+=1),Jt.includes(i)&&(o.refactor+=1),Vt.includes(i)&&(o.test_update+=1),Qt.includes(i)&&(o.config+=1),os.includes(i)&&(o.repo_scan+=1),es.includes(i)&&(o.security_fix+=1),ts.includes(i)&&(o.docs_update+=1),ss.includes(i)&&(o.dependency_upgrade+=1),ns.includes(i)&&(o.performance+=1);for(let i of rs)i.test(t)&&(o.repo_scan+=1);if(o.repo_scan>=2)return"repo_scan";let s="general",r=0;for(let[i,a]of Object.entries(o))a>r&&(r=a,s=i);return r>0?s:"general"}var is={bug_fix:{error_infrastructure:1.5,recent_touch:1.3,churn:1.2,keyword:1.1},feature_add:{centrality:1.3,keyword:1.2,test_relevance:.8},refactor:{churn:1.4,centrality:1.3,size_penalty:.7},test_update:{test_relevance:2.5,keyword:1.2,centrality:.5,churn:.5},config:{keyword:1.3,churn:.7,centrality:.8},repo_scan:{keyword:1.4,recent_touch:1.3,centrality:.4,size_penalty:1.3,churn:.6,test_relevance:.5},security_fix:{keyword:1.3,error_infrastructure:1.4,centrality:1.2,recent_touch:1.1,test_relevance:1.2},docs_update:{keyword:1.5,centrality:.4,churn:.5,test_relevance:.3},dependency_upgrade:{keyword:1.4,centrality:.6,churn:.8,test_relevance:1.1},performance:{keyword:1.2,churn:1.3,centrality:1.2,recent_touch:1.2,test_relevance:1.3},general:{}};function _e(e,t){let n=is[t];if(Object.keys(n).length===0)return e;let o={...e};for(let[s,r]of Object.entries(n)){let i=o[s];typeof i=="number"&&(o[s]=i*r)}return o}var as=[{pattern:"/types/",layer:0},{pattern:"/types.",layer:0},{pattern:"/interfaces/",layer:0},{pattern:"/models/",layer:1},{pattern:"/entities/",layer:1},{pattern:"/schemas/",layer:1},{pattern:"/repo/",layer:2},{pattern:"/repositories/",layer:2},{pattern:"/db/",layer:2},{pattern:"/database/",layer:2},{pattern:"/migrations/",layer:2},{pattern:"/services/",layer:3},{pattern:"/service.",layer:3},{pattern:"/use-cases/",layer:3},{pattern:"/domain/",layer:3},{pattern:"/api/",layer:4},{pattern:"/routes/",layer:4},{pattern:"/controllers/",layer:4},{pattern:"/handlers/",layer:4},{pattern:"/pages/",layer:4},{pattern:"/components/",layer:4},{pattern:"/middleware/",layer:5},{pattern:"/config/",layer:6},{pattern:"/utils/",layer:6},{pattern:"/helpers/",layer:6},{pattern:"/lib/",layer:6},{pattern:"/jobs/",layer:7},{pattern:"/workers/",layer:7},{pattern:"/tasks/",layer:7},{pattern:"/tests/",layer:8},{pattern:"/test/",layer:8},{pattern:"/__tests__/",layer:8},{pattern:".test.",layer:8},{pattern:".spec.",layer:8}],cs=5;function ge(e,t){let n=t??as,o=e.toLowerCase();for(let s of n)if(o.includes(s.pattern))return s.layer;return cs}function ye(e,t){return[...e].sort((n,o)=>{let s=ge(n.path,t),r=ge(o.path,t);return s-r})}var ls=[/\bTODO\b/i,/\bFIXME\b/i,/\bHACK\b/i,/\bXXX\b/i,/\bBUG\b(?:\s*#?\d+)/i,/\bWORKAROUND\b/i];function we(e){let t=e.split(`
|
|
20
|
+
`),n=[],o=0;for(let r of t)for(let i of ls){let a=i.exec(r);if(a){o++;let d=a[0].toUpperCase();n.includes(d)||n.push(d);break}}let s=t.length>0?Math.min(1,o/t.length*100):0;return{count:o,density:s,markers:n}}var be={enabled:!1,weight:.2,min_affinity:.25,min_co_commit_count:3,tau_days:60,commit_size_penalty:!0,max_shadow_adds:8};function xe(e){return Math.round(e*1e3)/1e3}function Se(e,t,n){if(!t.temporal_co_commit)return[];let{meta:o,adjacency:s}=t.temporal_co_commit,r=new Set(e.map(c=>c.path)),i=new Map(t.churn.map(c=>[c.path,c.commit_count])),a=new Map;for(let c of e){let p=s[c.path];if(!p)continue;let u=i.get(c.path)??0;for(let m of p){if(r.has(m.other_path)||m.co_commit_count<n.min_co_commit_count)continue;let _=i.get(m.other_path)??0,h=Math.max(u||m.co_commit_count,_||m.co_commit_count),l=m.co_commit_count/h;if(l<n.min_affinity)continue;let g=(o.built_at_unix-m.last_co_commit_unix)/86400,w=Math.exp(-g/n.tau_days),b=n.commit_size_penalty?1/Math.log2(2+m.avg_commit_files):1,T=l*w*b,A=n.weight*Math.min(1,T),C={linked_to:c.path,co_commit_count:m.co_commit_count,churn_shadow:_,churn_linked:u,affinity:xe(l),recency_days:Math.round(g),shadow_score:xe(T),boost:xe(A)},N=a.get(m.other_path);(!N||A>N.boost)&&a.set(m.other_path,{path:m.other_path,boost:A,reason:C})}}let d=Array.from(a.values());return d.sort((c,p)=>p.boost-c.boost),d.slice(0,n.max_shadow_adds)}function Te(e){let{taskText:t,repoIndex:n,selectorConfig:o,budget:s=o.default_budget,sufficiencyThreshold:r=o.sufficiency_threshold,ledgerStats:i,explain:a=!1,scope:d,branchChangedFiles:c,includeNearMisses:p=!1,includeBlastRadius:u=!1,layerOrder:m=!1}=e,_=me(t),h=_e(o.weights,_),l=K(t),g=c&&c.size>0?{...h,branch_changed:h.branch_changed??.15}:h;oe(l)&&(g={...g,security_surface:Math.max(g.security_surface??0,.2)});let{candidates:w,tokenWeights:b,fanoutFiles:T,surfaceFiles:A}=se(t,n,o,d);_==="repo_scan"&&gs(w,n,t);let C=re(w,l,n,g,i,b,T,c,A);_==="test_update"&&ps(C,l,n);let N=C.reduce((y,v)=>y+Math.max(0,v.score),0),$=(s.max_files??1/0)<=15?2:0,P={...s,max_files:s.max_files?Math.max(1,s.max_files-$):void 0},f={files:[],totalTokens:0,cumulativeScore:0},x={};for(let y of C){if(ie(f,P,r,N))break;let v=y.score>.7?o.excerpt_full_file_max_lines:y.score>.4?Math.round(o.excerpt_full_file_max_lines*.6):Math.round(o.excerpt_full_file_max_lines*.3),M=G(n.root,y.path,l,v,o.excerpt_window_lines),j=y.path.includes(".")?"."+y.path.split(".").pop():"",W=z(M.lineCount,j);if(s.tokens&&f.totalTokens+W>s.tokens*1.1&&f.files.length>0)break;let B=le(M.content,o.deprecation_rules),X=we(M.content),Ye=y.reasons.includes("security_surface"),Je={path:y.path,score:Math.round(y.score*1e3)/1e3,reasons:y.reasons,excerpt_spans:M.spans,content:M.content,token_estimate:W,deprecation_warnings:B.length>0?B:void 0,todo_count:X.count>0?X.count:void 0,security_relevant:Ye||void 0};f.files.push(Je),f.totalTokens+=W,f.cumulativeScore+=Math.max(0,y.score),a&&(x[y.path]=y.features)}let S=new Set(f.files.map(y=>y.path)),k=new Map(f.files.map(y=>[y.path,y.score])),R=[];for(let y of n.test_map)S.has(y.source_file)&&!S.has(y.test_file)&&R.push({testPath:y.test_file,sourceScore:k.get(y.source_file)??0});R.sort((y,v)=>v.sourceScore-y.sourceScore);for(let y of R){if(s.max_files&&f.files.length>=s.max_files)break;let v=y.sourceScore>.7?o.excerpt_full_file_max_lines:y.sourceScore>.4?Math.round(o.excerpt_full_file_max_lines*.6):Math.round(o.excerpt_full_file_max_lines*.3),M=G(n.root,y.testPath,l,v,o.excerpt_window_lines),j=y.testPath.includes(".")?"."+y.testPath.split(".").pop():"",W=z(M.lineCount,j);if(s.tokens&&f.totalTokens+W>s.tokens*1.1)continue;let B=C.find(X=>X.path===y.testPath);f.files.push({path:y.testPath,score:B?Math.round(B.score*1e3)/1e3:0,reasons:B?.reasons??["test_relevant"],excerpt_spans:M.spans,content:M.content,token_estimate:W}),f.totalTokens+=W}let F={...be,...o.shadow_files};if(F.enabled&&n.temporal_co_commit){let y=Se(f.files,n,F);for(let v of y){if(s.max_files&&f.files.length>=s.max_files)break;let M=G(n.root,v.path,l,o.excerpt_full_file_max_lines,o.excerpt_window_lines),j=v.path.includes(".")?"."+v.path.split(".").pop():"",W=z(M.lineCount,j);if(s.tokens&&f.totalTokens+W>s.tokens*1.1)continue;let B={path:v.path,score:Math.round(v.boost*1e3)/1e3,reasons:["temporal_affinity"],excerpt_spans:M.spans,content:M.content,token_estimate:W,shadow_reason:v.reason};f.files.push(B),f.totalTokens+=W}}let E=new Set(f.files.map(y=>y.path)),I=(s.tokens??1/0)-f.totalTokens,L=Math.max(0,(s.max_files??25)-f.files.length);if(L>0&&I>0){let y=ce(n.root,E,n.dep_graph,Math.min(L,5),Math.min(I,1e3));for(let v of y)f.files.push(v),f.totalTokens+=v.token_estimate}let U=ae(f.files,f.cumulativeScore,l.length,n,l),q=new Set(f.files.map(y=>y.path)),V=[];for(let y of q){let v=n.dep_graph.imports[y]??[];for(let M of v)q.has(M)&&V.push({from:y,to:M})}let Ae=(s.tokens??1/0)-f.totalTokens,Re=Math.max(0,(s.max_files??25)-f.files.length);if(Re>0&&Ae>0){let y=de(n.root,f.files,n,l,Math.min(Re,2),Math.min(Ae,2e3),_);for(let v of y)f.files.push(v),f.totalTokens+=v.token_estimate}if(m){let y=f.files.filter(j=>!j.is_stub&&!j.is_exemplar),v=f.files.filter(j=>j.is_stub||j.is_exemplar),M=ye(y);f.files=[...M,...v]}let Me=fe(f.files,l,C,t),Q=p?(()=>{let y=new Map(n.files.map(v=>[v.path,v.lines]));return ue(C,f.files,f.totalTokens,s.tokens,void 0,y)})():void 0,ee=u?he(f.files,n.dep_graph,n.test_map):void 0;return{bundle_id:`bnd_${(0,Ke.randomUUID)().slice(0,12)}`,task:t,task_type:_,budget:s,sufficiency_threshold:r,cumulative_score:Math.round(f.cumulativeScore*1e3)/1e3,files:f.files,total_tokens:f.totalTokens,generated_at:new Date().toISOString(),confidence:U,explain:a?x:void 0,file_relationships:V.length>0?V:void 0,warnings:Me.length>0?Me:void 0,near_misses:Q&&Q.length>0?Q:void 0,blast_radius:ee&&ee.length>0?ee:void 0}}var ke=.35;function ps(e,t,n){let o=new Set(n.test_map.map(r=>r.source_file));for(let r of e)/[./](?:test|spec)\.[^/]+$/.test(r.path.toLowerCase())||r.path.toLowerCase().includes("__tests__/")||o.has(r.path)&&(r.features.keyword>0||r.features._hasContentMatch)&&(r.score=Math.min(1,r.score+ke),r.reasons.includes("test_relevant")||r.reasons.push("test_relevant"));let s=e.filter(r=>r.score>=ke&&o.has(r.path)).map(r=>r.path);if(s.length>0){let r=new Set;for(let i of s){let a=n.dep_graph.imports[i]??[];for(let d of a){let c=d.toLowerCase(),u=(c.split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/),m=c.split("/").slice(0,-1);(c.endsWith(".d.ts")||u.some(h=>h==="types"||h==="type"||h==="interfaces")||m.some(h=>h==="types"||h==="interfaces"))&&r.add(d)}}for(let i of e)r.has(i.path)&&(i.score=Math.min(1,i.score+ke*.5))}e.sort((r,i)=>i.score-r.score)}var ds=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".md",".json",".yml",".yaml",".txt",".sql",".py",".go",".rs",".java",".rb",".sh"]),fs=["scripts/","tools/",".github/"],us=["validate","lint","format","eslint","prettier"],hs=256*1024,ms=2e3,_s=400;function gs(e,t,n){let o=n.toLowerCase();for(let d of t.files){let c=d.path.toLowerCase();if(fs.some(u=>c.startsWith(u))){e.add(d.path);continue}let p=c.split("/").pop()??"";if(us.some(u=>p.includes(u))){e.add(d.path);continue}}let s=t.files.find(d=>d.path==="package.json");if(s&&e.add(s.path),!/\btodo|todos|fixme\b/i.test(o))return;let i=t.files.filter(d=>{if(e.has(d.path)||d.is_test)return!1;let c=d.extension.toLowerCase();return!(!ds.has(c)||d.size>hs)}).sort((d,c)=>d.path.localeCompare(c.path)).slice(0,ms),a=0;for(let d of i){if(a>=_s)break;if((d.content_keywords??[]).some(p=>p==="todo"||p==="fixme")){e.add(d.path),a++;continue}try{let p=(0,He.readFileSync)((0,Ge.join)(t.root,d.path),"utf-8");/\bTODO\b|\bFIXME\b/i.test(p)&&(e.add(d.path),a++)}catch{}}}var ys=require("node:crypto");var Ze=require("node:fs"),vs=require("node:path"),Wn=10*1024*1024;var qe=require("node:crypto");var Ce="0.1.0";function Os(e){return e.includes("--version")?(process.stdout.write(`codeledger-core ${Ce}
|
|
21
|
+
`),!0):e.includes("--license")?(process.stdout.write([`CodeLedger Core Engine v${Ce}`,"","Copyright (c) 2025 Intelligent Context AI, Inc.","","This binary is licensed under the CodeLedger Core License:"," - FREE for individual developer use"," - FREE for open-source projects"," - Commercial and CI/CD usage requires a CodeLedger Pro license","","Contact: team@codeledger.dev","Details: https://codeledger.dev/license","","Privacy: This engine runs entirely locally. No network calls,","no telemetry, no data collection. Your code never leaves your machine.",""].join(`
|
|
22
|
+
`)),!0):e.includes("--explain-architecture")?(process.stdout.write([`CodeLedger Core Engine v${Ce} \u2014 Architecture`,"","The engine selects the most relevant files for a coding task using","a deterministic, multi-signal scoring algorithm:",""," 1. CANDIDATE GENERATION (five-stage pipeline)"," - Keyword matching with IDF weighting"," - Hot-zone inclusion from git churn history"," - Dependency graph expansion (imports + dependents)"," - Fan-out detection for cross-cutting changes"," - Test neighborhood pairing",""," 2. SCORING (weighted multi-signal)"," Each candidate is scored across 9 signals:"," keyword, centrality, churn, recency, test_relevance,"," size_penalty, success_prior, fail_prior, error_infrastructure",""," 3. BOUNDED SELECTION"," Files are selected in score order until the token budget"," or file count ceiling is reached. A sufficiency threshold"," stops early when cumulative score plateaus.",""," 4. POST-PROCESSING"," - Deterministic test pairing (source \u2192 test)"," - Interface stub generation for adjacent dependencies"," - Confidence assessment (high / medium / low)"," - Smart excerpt extraction with keyword windowing","","Input: Task description + repo index + config","Output: Deterministic ContextBundle (same input = same rankings and content; metadata fields like bundle_id vary)","","Privacy: Runs entirely local. No network calls. No telemetry.",""].join(`
|
|
23
|
+
`)),!0):!1}async function Ps(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e).toString("utf-8")}async function Fs(){if(Os(process.argv.slice(2)))return;let e=await Ps(),t=JSON.parse(e),n;if(t.indexPath)n=JSON.parse((0,Xe.readFileSync)(t.indexPath,"utf-8"));else if(t.repoIndex)n=t.repoIndex;else throw new Error("Either indexPath or repoIndex must be provided");let o=t.ledgerStats?{success_files:new Set(t.ledgerStats.success_files),fail_files:new Set(t.ledgerStats.fail_files)}:void 0,s=t.branchChangedFiles?new Set(t.branchChangedFiles):void 0,r=Te({taskText:t.task,repoIndex:n,selectorConfig:t.selectorConfig,budget:t.budget,explain:t.explain,ledgerStats:o,scope:t.scope,branchChangedFiles:s,includeNearMisses:t.includeNearMisses,includeBlastRadius:t.includeBlastRadius,layerOrder:t.layerOrder});process.stdout.write(JSON.stringify(r))}Fs().catch(e=>{process.stderr.write(JSON.stringify({error:String(e)})+`
|
|
24
24
|
`),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeledger/core-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Protected scoring engine for CodeLedger — compiled binary bridge",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE-CORE",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/codeledgerECF/codeledger
|
|
9
|
+
"url": "https://github.com/codeledgerECF/codeledger.git",
|
|
10
10
|
"directory": "packages/core-engine"
|
|
11
11
|
},
|
|
12
12
|
"publishConfig": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@codeledger/types": "0.
|
|
28
|
+
"@codeledger/types": "0.7.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.4.0",
|
|
32
|
-
"@codeledger/selector": "0.
|
|
32
|
+
"@codeledger/selector": "0.7.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsc",
|