scip-query 0.10.5 → 0.10.7
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/README.md +6 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-CJJP64OC.js → chunk-27FU2KX7.js} +2 -2
- package/dist/chunk-3C4NIBY5.js +2 -0
- package/dist/chunk-3LQFMQPY.js +3 -0
- package/dist/{chunk-QVCCLDZI.js → chunk-5JXH6VGF.js} +2 -2
- package/dist/{chunk-77YBOOYT.js → chunk-5LM7RJMQ.js} +2 -2
- package/dist/{chunk-EWC3UK4V.js → chunk-5MHQI4RR.js} +2 -2
- package/dist/{chunk-X7ZY6FFF.js → chunk-72QDTW5U.js} +2 -2
- package/dist/{chunk-MZ7APUFN.js → chunk-733EF5FD.js} +2 -2
- package/dist/chunk-7AOMEMOA.js +4 -0
- package/dist/chunk-A536TEU4.js +3 -0
- package/dist/chunk-BZ2RRK7Y.js +8 -0
- package/dist/chunk-C6ROZBJA.js +32 -0
- package/dist/chunk-CMXD5VC4.js +2 -0
- package/dist/{chunk-BNKE4TT5.js → chunk-CQEJU32R.js} +2 -2
- package/dist/{chunk-5FOPAXWY.js → chunk-DBTL56LR.js} +2 -2
- package/dist/chunk-DOZ2X6TS.js +2 -0
- package/dist/{chunk-D322LMSA.js → chunk-DS6QEB3G.js} +5 -5
- package/dist/chunk-EOUTP32Q.js +4 -0
- package/dist/{chunk-QSXQT3NE.js → chunk-EPPCGQUI.js} +2 -2
- package/dist/{chunk-CSWZFD46.js → chunk-EW64FEJL.js} +2 -2
- package/dist/{chunk-O3OKSF6O.js → chunk-FG4NT6VY.js} +2 -2
- package/dist/chunk-FKYPOK7P.js +5 -0
- package/dist/chunk-FPYQA7JK.js +21 -0
- package/dist/{chunk-FIB4JPEX.js → chunk-FRIASDLG.js} +2 -2
- package/dist/chunk-FXI3AAKO.js +2 -0
- package/dist/{chunk-QUJBXLBY.js → chunk-FXWV2V7K.js} +2 -2
- package/dist/chunk-G2CGUNQU.js +4 -0
- package/dist/{chunk-LPLGJ4HO.js → chunk-GIOT3O6P.js} +2 -2
- package/dist/{chunk-YUTRW57I.js → chunk-GKRRO3WC.js} +2 -2
- package/dist/{chunk-Z4VHYJ5U.js → chunk-GOWLZ4NA.js} +2 -2
- package/dist/{chunk-4ZUJJRWT.js → chunk-GRZRMELG.js} +2 -2
- package/dist/{chunk-CFL2CNIF.js → chunk-H6RLM7D7.js} +2 -2
- package/dist/chunk-HDBQHJNY.js +2 -0
- package/dist/{chunk-AW4N6MGC.js → chunk-IA7Q6HVP.js} +2 -2
- package/dist/{chunk-E44ZMVNA.js → chunk-IL2EVPYP.js} +2 -2
- package/dist/{chunk-E7KERP7E.js → chunk-J43GIAVM.js} +2 -2
- package/dist/{chunk-56UN3DMK.js → chunk-JOGZKF5W.js} +2 -2
- package/dist/{chunk-CTCAF3YA.js → chunk-KT2ZO3CE.js} +2 -2
- package/dist/{chunk-DAI74TJU.js → chunk-KUIIQPDA.js} +2 -2
- package/dist/{chunk-VAA5FFIW.js → chunk-LM5SHAN4.js} +2 -2
- package/dist/chunk-LONIY5FF.js +2 -0
- package/dist/{chunk-FNRPGGVI.js → chunk-LQSLW7K7.js} +2 -2
- package/dist/{chunk-WBJZNPUT.js → chunk-M3YEHOCD.js} +2 -2
- package/dist/{chunk-GZCQTZLK.js → chunk-MFWAZFYD.js} +2 -2
- package/dist/{chunk-EYLXU575.js → chunk-MHATKJ3J.js} +2 -2
- package/dist/{chunk-ZQLO2SCU.js → chunk-MJXJ56LG.js} +2 -2
- package/dist/{chunk-47UA45TU.js → chunk-NIGHS7UP.js} +2 -2
- package/dist/{chunk-NVFERV4U.js → chunk-OFO7BIRK.js} +2 -2
- package/dist/{chunk-7OHWPJ5N.js → chunk-OMGE3V2Q.js} +2 -2
- package/dist/{chunk-ICXVNWMI.js → chunk-OT6CDRKC.js} +2 -2
- package/dist/{chunk-6UFMPECA.js → chunk-OWXN6ZS5.js} +2 -2
- package/dist/{chunk-QLNGUWR7.js → chunk-OZUJ3VZS.js} +2 -2
- package/dist/chunk-P3K7LX7M.js +4 -0
- package/dist/{chunk-ZSLT7NWQ.js → chunk-PQ6QG3EX.js} +2 -2
- package/dist/chunk-PTKQNPWX.js +23 -0
- package/dist/{chunk-YYD245WG.js → chunk-QMH2D6S5.js} +2 -2
- package/dist/{chunk-5M4TYWVI.js → chunk-QPTVFG4O.js} +2 -2
- package/dist/{chunk-MUULWXSJ.js → chunk-QR337MAA.js} +2 -2
- package/dist/{chunk-SPE4YCOT.js → chunk-QVS4SYAX.js} +2 -2
- package/dist/{chunk-AUVBR62P.js → chunk-RISLKTKQ.js} +2 -2
- package/dist/{chunk-OLD6PBU6.js → chunk-S7DNZ6IW.js} +2 -2
- package/dist/{chunk-EOZIZWW4.js → chunk-SXESPZUX.js} +2 -2
- package/dist/{chunk-TM6GVHA6.js → chunk-TDBTVMHY.js} +2 -2
- package/dist/{chunk-3UW7VM4H.js → chunk-TJXOD4IK.js} +2 -2
- package/dist/chunk-U73YFD3P.js +3 -0
- package/dist/{chunk-YUOAAR24.js → chunk-UBDFQBSE.js} +2 -2
- package/dist/chunk-UJEVABIR.js +2 -0
- package/dist/{chunk-5QJXH6ZL.js → chunk-VA3FJ3AY.js} +2 -2
- package/dist/{chunk-3KLLFNT4.js → chunk-VOYOYC5T.js} +2 -2
- package/dist/chunk-W2CBNBEL.js +71 -0
- package/dist/chunk-W2TIXAGN.js +40 -0
- package/dist/{chunk-CAWSSEVM.js → chunk-WMIQMXSK.js} +2 -2
- package/dist/{chunk-YQH353VA.js → chunk-WVRTGVHJ.js} +2 -2
- package/dist/{chunk-DJMK4DBL.js → chunk-WXMVK53S.js} +2 -2
- package/dist/{chunk-YTR4CO5S.js → chunk-XAYARHNF.js} +3 -3
- package/dist/{chunk-ESG4HBEF.js → chunk-XBIF45WK.js} +2 -2
- package/dist/{chunk-DE7MA6OD.js → chunk-XYI7XRZC.js} +2 -2
- package/dist/{chunk-7KCSELEV.js → chunk-YNLK3G63.js} +2 -2
- package/dist/{chunk-NNDYO2DX.js → chunk-YOCYR7KJ.js} +2 -2
- package/dist/chunk-YZA6PPZL.js +3 -0
- package/dist/{chunk-5UDFZC4D.js → chunk-ZUTV7DDX.js} +2 -2
- package/dist/cli.js +274 -237
- package/dist/{config-types-Bj4sh28g.d.ts → config-types-BDIWAYzr.d.ts} +13 -1
- package/dist/{db-CTarohbZ.d.ts → db-BAVwb4Pb.d.ts} +1 -1
- package/dist/{health-Bx0x1HAG.d.ts → health-B17sVFYf.d.ts} +6 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +8 -5
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +7 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +5 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +3 -3
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +5 -3
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +11 -11
- package/dist/reindex.d.ts +11 -2
- package/dist/reindex.js +22 -22
- package/dist/runtime.d.ts +17 -20
- package/dist/runtime.js +2 -2
- package/dist/scip-cli-CnK9Va4O.d.ts +56 -0
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/COMMAND_REFERENCE.md +3 -2
- package/docs/analyzer-inventory.md +2 -2
- package/docs/analyzer-validation-ledger.md +2 -2
- package/package.json +1 -1
- package/skills/concrete-plan/SKILL.md +2 -2
- package/skills/scip-adoption/SKILL.md +4 -2
- package/skills/scip-ai-cleanup/SKILL.md +1 -1
- package/skills/scip-api-impact/SKILL.md +6 -2
- package/skills/scip-debloat/SKILL.md +1 -1
- package/skills/scip-debug/SKILL.md +6 -2
- package/skills/scip-diagram/SKILL.md +3 -1
- package/skills/scip-directory-architecture/SKILL.md +7 -3
- package/skills/scip-doc-reconcile/SKILL.md +3 -1
- package/skills/scip-explore/SKILL.md +2 -2
- package/skills/scip-health-audit/SKILL.md +6 -2
- package/skills/scip-health-improve/SKILL.md +6 -2
- package/skills/scip-maintainability/SKILL.md +6 -3
- package/skills/scip-query/SKILL.md +10 -6
- package/skills/scip-query-setup/SKILL.md +10 -5
- package/skills/scip-react-maintainability/SKILL.md +7 -2
- package/skills/scip-triage-issue/SKILL.md +4 -2
- package/skills/scip-verify/SKILL.md +5 -3
- package/skills/scip-vue-maintainability/SKILL.md +7 -2
- package/dist/chunk-237YUOPK.js +0 -8
- package/dist/chunk-3UVJJ6Z7.js +0 -2
- package/dist/chunk-3ZYF3ELZ.js +0 -2
- package/dist/chunk-7JOTOWZO.js +0 -4
- package/dist/chunk-A3VNUGKJ.js +0 -2
- package/dist/chunk-A4L36SZS.js +0 -22
- package/dist/chunk-A7RNHUJH.js +0 -20
- package/dist/chunk-AYYIZ4BA.js +0 -4
- package/dist/chunk-BKDXBJDQ.js +0 -2
- package/dist/chunk-C3MZZ2ZN.js +0 -2
- package/dist/chunk-CRU42NJU.js +0 -2
- package/dist/chunk-ERHOS6AW.js +0 -2
- package/dist/chunk-FOQHUKNZ.js +0 -4
- package/dist/chunk-FUPDW5AC.js +0 -3
- package/dist/chunk-G3WGZU5Q.js +0 -2
- package/dist/chunk-HVTYSC26.js +0 -40
- package/dist/chunk-KPHKX4LP.js +0 -71
- package/dist/chunk-MA7OVFHI.js +0 -2
- package/dist/chunk-OBBDKQAG.js +0 -3
- package/dist/chunk-RHTJBYZ5.js +0 -2
- package/dist/chunk-UQJGTVHV.js +0 -5
- package/dist/chunk-ZFMPHDAT.js +0 -4
- package/dist/scip-cli-Bh1M_JPu.d.ts +0 -20
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{a as C}from"./chunk-LONIY5FF.js";import{e as S}from"./chunk-U73YFD3P.js";import{c as y,f as p,h as b}from"./chunk-JM72FNGA.js";import{execFileSync as g}from"child_process";import{existsSync as v,readFileSync as E}from"fs";import{basename as F}from"path";function R(e){let t=new Map;for(let i of e){let n=t.get(i.file);n||(n=[],t.set(i.file,n)),n.push(i)}return t}var B="Unable to compute git diff.";function ge(e,t={}){let i=t.plan??P(e,t);return i.note?A(i.note,i.changedFileLines):i.changedFiles.length===0?O(i.changedFileLines):T(i.changedFiles,[$(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function P(e,t={}){let{base:i="HEAD"}=t;try{let n=k(e.config.projectRoot,i),r=Y(e,n),s=j(e,z(e.config.projectRoot,i));return{changedFileLines:n,changedFiles:r,changedRanges:s,renamedFiles:H(e.config.projectRoot,i,r),note:n.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:B}}}function $(e,t,i,n=[]){let r=new C(e),s=new Set(i),a=R(n),o=[],d=new Map,f=t.flatMap(c=>r.definitionsForFile(c)).filter(te).filter(c=>Z(c,a)).sort((c,m)=>c.relativePath.localeCompare(m.relativePath)||c.startLine-m.startLine),l=f.map(c=>c.symbolId),u=X(e,l),M=ee(e,l,i),N=S(e,f.filter(c=>u.get(c.symbolId)===0));for(let c of f)Q(e,c,s,o,d,N.get(c.symbolId)??new Set,u.get(c.symbolId)??0,M.get(c.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...d.entries()].map(([c,m])=>({file:c,symbols:[...m].sort()}))}}function T(e,t){let i=new Map,n=t.flatMap(s=>s.changedSymbols);for(let s of t)for(let a of s.consumerEntries){let o=i.get(a.file);o||(o=new Set,i.set(a.file,o));for(let d of a.symbols)o.add(d)}let r=ne(i);return{changedFiles:[...e],changedSymbols:n,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:n.length,totalAffectedFiles:r.length}}}function A(e,t=[]){return{changedFiles:t,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:t.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function O(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function k(e,t){let i=g("git",["diff","--name-only",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-only","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([i,n,r].flatMap(s=>s.split(`
|
|
2
|
+
`)).map(s=>s.trim()).filter(s=>s.length>0))]}function z(e,t){let i=g("git",["diff","--unified=0",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--unified=0","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return _([...D(i),...D(n)])}function h(e,t,i){try{return g("git",["show",`${t}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function ue(e,t,i=[]){let n=W(e,t,i);return r=>(n.has(r)||n.set(r,h(e,t,r)),n.get(r)??null)}function me(e,t=e.changedFiles){let i=new Map(e.renamedFiles.map(n=>[n.to,n.from]));return[...new Set(t.map(n=>i.get(n)??n))]}function W(e,t,i){let n=[...new Set(i)],r=new Map;if(n.length===0)return r;try{let s=n.map(o=>`${t}:./${o}
|
|
3
|
+
`).join(""),a=g("git",["cat-file","--batch"],{cwd:e,input:s,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"]});return U(a,n)}catch{for(let s of n)r.set(s,h(e,t,s));return r}}function U(e,t){let i=new Map,n=0;for(let r of t){let s=e.indexOf(10,n);if(s<0)throw new Error("git cat-file batch output ended before object header");let a=e.subarray(n,s).toString("utf-8");if(n=s+1,a.endsWith(" missing")){i.set(r,null);continue}let o=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(a);if(!o)throw new Error(`unexpected git cat-file batch header: ${a}`);let[,d,f]=o,l=Number(f);if(!Number.isFinite(l)||l<0)throw new Error(`unexpected git cat-file batch size: ${a}`);if(n+l>e.length)throw new Error("git cat-file batch output ended before blob payload");let u=e.subarray(n,n+l);i.set(r,d==="blob"?u.toString("utf-8"):null),n+=l,e[n]===10&&(n+=1)}return i}function H(e,t,i){if(i.length===0)return[];let n=new Map,r=new Set;for(let a of q(e,t))i.includes(a.to)&&(n.set(a.to,a),r.add(a.from));let s=J(e,t);if(s.length===0)return[...n.values()].sort((a,o)=>a.to.localeCompare(o.to));for(let a of i){if(n.has(a)||!v(`${e}/${a}`))continue;let o=s.filter(l=>!r.has(l)).filter(l=>F(l)===F(a));if(o.length===0)continue;let d=E(`${e}/${a}`,"utf-8"),f=o.map(l=>({from:l,to:a,similarity:G(h(e,t,l)??"",d)})).sort((l,u)=>u.similarity-l.similarity)[0];f&&f.similarity>=.45&&(n.set(a,f),r.add(f.from))}return[...n.values()].sort((a,o)=>a.to.localeCompare(o.to))}function J(e,t){let i=g("git",["diff","--name-only","--diff-filter=D",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-only","--diff-filter=D","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([...w(i),...w(n)])]}function q(e,t){let i=g("git",["diff","--name-status","--find-renames",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-status","--find-renames","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return[...i.split(`
|
|
4
|
+
`),...n.split(`
|
|
5
|
+
`)].map(r=>r.trim()).filter(r=>r.startsWith("R")).map(r=>r.split(" ")).filter(r=>r.length>=3).map(([r,s,a])=>({from:s,to:a,similarity:Number(r.slice(1))/100}))}function G(e,t){let i=new Set(I(e)),n=new Set(I(t));if(i.size===0&&n.size===0)return 1;if(i.size===0||n.size===0)return 0;let r=0;for(let s of i)n.has(s)&&(r+=1);return 2*r/(i.size+n.size)}function I(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function w(e){return e.split(`
|
|
6
|
+
`).map(t=>t.trim()).filter(t=>t.length>0)}function Y(e,t){let i=x(e),n=[];for(let r of t){let s=i(r);s&&!e.isIgnored(s)&&n.push(s)}return n}function j(e,t){let i=x(e),n=[];for(let r of t){let s=i(r.file);s&&!e.isIgnored(s)&&n.push({...r,file:s})}return _(n)}function x(e){let t=e.all(`SELECT relative_path FROM documents
|
|
7
|
+
ORDER BY id`).map(n=>n.relative_path),i=new Map(t.map(n=>[n,n]));return n=>{let r=n.replace(/\\/g,"/"),s=i.get(r);return s||(t.find(a=>a.endsWith(r))??null)}}function D(e){let t=[],i=null;for(let n of e.split(`
|
|
8
|
+
`)){if(n.startsWith("+++ ")){i=V(n.slice(4).trim());continue}if(!i||!n.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(n);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);t.push({file:i,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return t}function V(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function _(e){let t=new Set,i=[];for(let n of e){let r=`${n.file}:${n.startLine}:${n.endLine}`;t.has(r)||(t.add(r),i.push(n))}return i}function Z(e,t){let i=t.get(e.relativePath);return!i||i.length===0?!0:i.some(n=>K(e.startLine,e.endLine,n.startLine,n.endLine))}function K(e,t,i,n){return e<=n&&i<=t}function Q(e,t,i,n,r,s,a,o){let d=Math.max(a,s.size);if(!ie(t,d))return;let f=y(t.symbol);n.push({symbol:t.symbol,shortName:f,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,fanIn:d});for(let l of o)L(e,i,r,l,f);for(let l of s)L(e,i,r,l,f)}function X(e,t){if(t.length===0)return new Map;let i=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
|
|
9
|
+
FROM mentions m
|
|
10
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
11
|
+
WHERE m.symbol_id IN (${t.map(()=>"?").join(",")})
|
|
12
|
+
AND m.role != 1
|
|
13
|
+
GROUP BY m.symbol_id`,...t);return new Map(i.map(n=>[n.symbol_id,n.fan_in]))}function ee(e,t,i){if(t.length===0||i.length===0)return new Map;let n=e.all(`SELECT DISTINCT m.symbol_id, ref_d.relative_path
|
|
14
|
+
FROM mentions m
|
|
15
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
16
|
+
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
17
|
+
WHERE m.symbol_id IN (${t.map(()=>"?").join(",")})
|
|
18
|
+
AND m.role != 1
|
|
19
|
+
AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
|
|
20
|
+
${e.pathExclusionsFor("ref_d")}`,...t,...i),r=new Map;for(let s of n){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function L(e,t,i,n,r){if(e.isIgnored(n)||t.has(n))return;let s=i.get(n);s||(s=new Set,i.set(n,s)),s.add(r)}function ne(e){return[...e.entries()].map(([t,i])=>({file:t,consumedSymbols:i.size})).sort((t,i)=>i.consumedSymbols-t.consumedSymbols)}function te(e){return!(b(e.symbol)||e.parentTypeName!==null&&!p(e.symbol))}function ie(e,t){return p(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&t>0}export{R as a,B as b,ge as c,P as d,$ as e,T as f,h as g,ue as h,me as i,W as j};
|
|
21
|
+
//# sourceMappingURL=chunk-FPYQA7JK.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-LONIY5FF.js";import{a as h}from"./chunk-XAYARHNF.js";import{p as S}from"./chunk-W2TIXAGN.js";import{a as d,b}from"./chunk-733EF5FD.js";import{k as y}from"./chunk-TJXOD4IK.js";import{c as m}from"./chunk-JM72FNGA.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{v as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FRIASDLG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as F}from"./chunk-G2CGUNQU.js";import{d as x}from"./chunk-JM72FNGA.js";import{a as v,d as S}from"./chunk-5MHQI4RR.js";import{a as L,b as y}from"./chunk-DS6QEB3G.js";import{b as m,d as g,e as d}from"./chunk-C6ROZBJA.js";import{c as p}from"./chunk-7S5E7KWT.js";var C=p("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function k(t,e,r){return t.callerFileMap(e,{semantic:r.semantic,sourceFallback:r.sourceFallback})}function z(t,e,r){let n=[],i=0,s=0,c=x(e.symbol);for(let a of r)_(t,a,e.relativePath,c)?i++:h(t,a,c)?s++:n.push(a);return{realConsumers:n,barrelConsumers:i,importOnlyConsumers:s}}function h(t,e,r){if(!r)return!1;let n=v(e);if(!n)return!1;let i=C.get(t,e,()=>b(t,e,n));return i.importedLeaves.has(r)&&!i.usedLeaves.has(r)}function b(t,e,r){let n=L(t,e);if(!n)return U();let i=m(t,e,n),s=g(t,"consumer-file-usage",e,i);if(s){let a=E(s);if(a)return a}let c=w(t,e,r);return d(t,"consumer-file-usage",e,i,D(c)),c}function w(t,e,r){let n=new Set,i=new Set,s=S(t,e);if(!s)return{importedLeaves:n,usedLeaves:i};let c=r==="rust"?new Set(["use_declaration"]):r==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let u=f||c.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(u?n.add(o.text):i.add(o.text));for(let l of o.children)a(l,u)};return a(s.rootNode,!1),{importedLeaves:n,usedLeaves:i}}function U(){return{importedLeaves:new Set,usedLeaves:new Set}}function D(t){return JSON.stringify({importedLeaves:[...t.importedLeaves],usedLeaves:[...t.usedLeaves]})}function E(t){try{let e=JSON.parse(t);return!Array.isArray(e.importedLeaves)||!Array.isArray(e.usedLeaves)?null:{importedLeaves:new Set(e.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(e.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function _(t,e,r,n){if(!n)return!1;let i=y(t,e);if(i.length===0)return!1;let s=F(t,e);if(s.length===0)return!1;let c=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${c}\\b`),o=0;for(let f=0;f<i.length;f++){if(!a.test(i[f]??""))continue;if(o++,!s.find(l=>l.startLine<=f&&f<=l.endLine))return!1}return o>0}export{k as a,z as b,h as c};
|
|
2
|
+
//# sourceMappingURL=chunk-FXI3AAKO.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l,c as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as l,c as g}from"./chunk-HDBQHJNY.js";function v(e){let n=[],r=[],i=[];for(let o of e.primitiveGroups)o.values.length!==0&&h(o.bucket,r,i).push(`${o.reasonPrefix}: ${o.values.join(", ")}`);for(let o of e.nameGroups)u(o.names,o.label,e.genericWords,e.stripPrefixes??[],n,h(o.fallbackBucket,r,i));let c=n.length>0,d=r.length>0,s=i.length>0,t=c?d||s?"mixed":"domain-behavior":s?"shared-abstraction":"generic-workflow-scaffolding";return{actionTier:t==="domain-behavior"||t==="mixed"?"signal":"support",evidenceClass:t,reasons:[...n,...i,...r].slice(0,6),recommendation:e.recommendation(t)}}function x(e,n){if(e.size===0||n.size===0)return 0;let i=l(e,n).size/Math.min(e.size,n.size);return Math.max(g(e,n),i)}function y(e,n){return[...e].filter(r=>r.startsWith(n)).map(r=>r.slice(n.length)).sort()}function b(e){return[...e].sort()}function u(e,n,r,i,c,d){let s=[],t=[];for(let a of e)m(a,i).filter(f=>!r.has(f)).length>0?s.push(a):t.push(a);s.length&&c.push(`${n} has domain term(s): ${s.slice(0,6).join(", ")}`),t.length&&d.push(`${n} is generic workflow: ${t.slice(0,6).join(", ")}`)}function m(e,n){let r=e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2");for(let i of n)r=r.replace(i,"");return r.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function h(e,n,r){return e==="generic"?n:r}export{v as a,x as b,y as c,b as d};
|
|
2
|
+
//# sourceMappingURL=chunk-FXWV2V7K.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as ne,b as oe,c as P,d as ie,e as ae,f as pe,g as j,h as ce,i as F,j as me,k as le,l as _,m as U,n as T,o as H,p as V,q as S,r as Q,s as ue,t as J,v as C,w as h,x as M,y as G}from"./chunk-3LQFMQPY.js";import{b as ge}from"./chunk-YZA6PPZL.js";import{a as de,b as fe,d as R}from"./chunk-5MHQI4RR.js";import{a as v}from"./chunk-DS6QEB3G.js";import{b as te,d as re,e as se}from"./chunk-C6ROZBJA.js";import{c as L}from"./chunk-7S5E7KWT.js";import{basename as Se}from"path";var je=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function x(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&je.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function b(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,le(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function O(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function D(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=C(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=R(t,r);if(n){let o=e(n);if(o)return o}return s()}function X(t,r,e,s){let n=R(t,r),o=de(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function he(t,r,e){return I(t,r,s=>Me(t,r,s),()=>ve(t,r,e))}function ve(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=Se(o).replace(/\.[^.]+$/,"");return[$(o,i,V(t,r,o),h(n,i))]})}function Me(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(c=>c.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=Se(i).replace(/\.[^.]+$/,"");n.push(f(i,a,V(t,r,i),s))}return n}function ye(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let p=C(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:Q(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function xe(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:Q(t,r,o)})}return s}function Ne(t,r,e){return X(t,r,{csharp:s=>qe(t,r,s),vb:s=>$e(t,r,s)},()=>{let s=me(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),m=!!p,c=(m?p:a)?.trim()??i,l=c.split(".").pop()??c,u=m?a?.trim()??l:l;return[b(t,r,o,c,l,u,S(t,c,j))]})})}function $e(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,m=a.text,c=m.split(".").pop()??m,l=p?.text??c;n.push(f(c,l,S(t,m,j),s,p?"namespace":"named"))}return n}function qe(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let m=p.text,c=m.split(".").pop()??m,l=a?.text??c;n.push(f(c,l,S(t,m,j),s,a?"namespace":"named"))}return n}var Fe=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Ie(t,r){return Fe.get(t,r,()=>{let e=new Set,s=v(t,r);if(!s)return e;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))e.add(i[0]);return e})}function Y(t,r,e){return I(t,r,s=>We(t,r,s),()=>Ue(t,r,e))}function Ue(t,r,e){return Ze(e).flatMap(s=>et(t,r,s.clause,s.specifier,s.start,s.end,e))}function We(t,r,e){let s=Je(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...Xe(t,r,e,o,s));return n}function Je(t,r,e){let s=g(e,new Set(["import_statement"]));if(fe(r))for(let n of Ie(t,r))s.add(n);return s}function Xe(t,r,e,s,n){let o=Qe(s);if(!o)return[];let i=_(t,r,o),a=x(s,"import_clause");return a?ze(e,a,i,n,Ge(s.text)):[O("*",i)]}function ze(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Be(i.text,e,s,n));else if(i.type==="namespace_import"){let a=He(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Ve(i,e,s,n));return o}function Be(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function He(t,r,e,s,n){let i=x(r,"identifier")?.text??"";if(!i)return null;let a=Ke(t,i);return D("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Ve(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,m=a?.text??p;n.push(f(p,m,r,e,"named",{isTypeOnly:s||Ye(o.text)}))}return n}function Qe(t){let r=x(t,"string");if(!r)return null;let e=x(r,"string_fragment");return e?e.text:null}function Ge(t){return/^\s*import\s+type\b/.test(t)}function Ye(t){return/^\s*type\b/.test(t.trim())}function Ke(t,r){let e=new Set;for(let s of t.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&e.add(o.text)}return[...e]}function Ze(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function et(t,r,e,s,n,o,i){let a=_(t,r,s),p=C(i,n,o);return e?tt(e).map(c=>({...c,sourcePath:a})).map(c=>{if(c.kind==="namespace"){let l=M(p,c.localName);return D(c.importedName,c.sourcePath,{localName:c.localName,usedMembers:l,used:l.length>0||h(p,c.localName),isTypeOnly:c.isTypeOnly})}return c.kind==="side-effect"?O(c.importedName,c.sourcePath):$(c.importedName,c.localName??"",c.sourcePath,c.localName?h(p,c.localName):!1,c.kind,[],{isTypeOnly:c.isTypeOnly})}):[O("*",a)]}function tt(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=rt(s),i=[];return n&&i.push(...Pe(n,e)),o&&i.push(...Pe(o,e)),i}function Pe(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?y(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,m]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(m??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function rt(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function K(t,r,e){let s=R(t,r);return s?pt(t,r,s):st(t,r,e)}function st(t,r,e){return[...nt(t,r,e),...ot(t,r,e),...it(t,r,e)]}function nt(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=y(i).map(l=>at(l.trim())).filter(l=>!!l),m=q(e,o.index),c=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:_(t,r,a),names:p,startLine:m,endLine:c})}return s}function ot(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function it(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:_(t,r,i),names:[],startLine:a,endLine:p})}return s}function at(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function pt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=ct(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=mt(n,o,i,a);s.push(p)}return s}function ct(t,r,e){let s=x(e,"string");if(!s)return;let n=x(s,"string_fragment");if(n)return _(t,r,n.text)}function mt(t,r,e,s){let n=x(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),m=a.namedChild(1);p&&i.push((m??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return x(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function be(t,r,e){return X(t,r,{java:s=>lt(t,r,s),kotlin:s=>ut(t,r,s),scala:s=>dt(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?ft(t,r,o,n):[]}))}function lt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let m=p.text;if(i){n.push(D("*",S(t,m,P)));continue}let c=m.split(".").pop()??m;n.push(f(c,c,S(t,m,P),s))}return n}function ut(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(D("*",S(t,i.text,P)));continue}let m=i.text,c=m.split(".").pop()??m,u=p?.namedChild(0)?.text??c;n.push(f(c,u,S(t,m,P),s))}return n}function dt(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(D("*",S(t,p,P)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let E=u.text,A=d?.text??E;if(E==="_")continue;n.push(f(E,A,S(t,`${p}.${E}`,P),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,P),s))}continue}let m=a[a.length-1]?.text??p,c=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(m,m,S(t,c&&a.length>1?`${c}.${m}`:p,P),s))}return n}function ft(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),c=p?.trim();if(!c||c==="_")return[];let l=(m??c.split(".").pop()??c).trim(),u=c==="_"?n:`${n}.${c}`.replace(/\.\./g,".");return[b(t,r,s,u,c,l)]})}return[b(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function _e(t,r,e){return I(t,r,s=>gt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.split(/\s+as\s+/i),c=p?.trim()??a,l=c.split("\\").pop()??c,u=(m??l).trim();return[b(t,r,n,c,l,u,S(t,c.replace(/\\/g,"."),F))]}):[]}))}function gt(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),F),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(m=>m.type==="namespace_name")?.text??"";for(let m of a.namedChildren){if(m.type!=="namespace_use_clause")continue;let{importedName:c,localName:l,qualified:u}=Ee(m,p);c&&o(u,c,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:m,localName:c,qualified:l}=Ee(p,"");m&&o(l,m,c)}}return n}function Ee(t,r){let e=t.namedChildren.find(m=>m.type==="qualified_name"),s=t.namedChildren.filter(m=>m.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function Ce(t,r,e){return I(t,r,s=>St(t,r,s),()=>yt(e).flatMap(s=>Nt(t,r,s,e)))}function St(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Te(i);if(!a)continue;let p=U(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ht(i);if(a===null)continue;let p=U(t,r,a);for(let m=1;m<o.namedChildCount;m+=1){let c=o.namedChild(m);if(c.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=Te(c);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function Te(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function ht(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=x(t,"import_prefix")?.text??"",e=x(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function yt(t){let r=t.split(`
|
|
2
|
+
`),e=[],s=0;for(let n=0;n<r.length;n++){let o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let p=o,m=a+o.length,c=G(o);for(;n+1<r.length&&(c>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
|
|
3
|
+
${u}`,m+=1+u.length,c+=G(u),s+=u.length+1}let l=xt(p);l&&e.push({...l,start:a,end:m})}return e}function xt(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function Nt(t,r,e,s){let n=C(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return y(o).flatMap(p=>{let m=p.trim().replace(/,$/,"");if(!m)return[];let[c,l]=m.split(/\s+as\s+/),u=c.trim(),d=(l??u.split(".")[0]??u).trim(),E=U(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:E,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?U(t,r,e.module):null,a=[];for(let p of y(o)){let m=p.trim().replace(/,$/,"");if(!m)continue;if(m==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[c,l]=m.split(/\s+as\s+/),u=(l??c).trim();a.push({importedName:c.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as It}from"path";function Re(t,r,e){return I(t,r,s=>bt(t,r,s),()=>Pt(t,r,e))}function Pt(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?H(t,r,i):null;if(a){let p=Oe(i);return[$(p,p,a,h(n,p))]}return[O(i,a)]})}function bt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let m=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!m||m.type!=="string")continue;let l=m.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?H(t,r,l):null;if(u){let d=Oe(l);n.push(f(d,d,u,s))}else n.push(O(l,u))}return n}function Oe(t){return ge(It(t).replace(/\.[^.]+$/,""),/_/)}function De(t,r,e){return I(t,r,s=>Et(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?_t(t,r,o,n):[]}))}function Et(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of W(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function W(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:z(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:z(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=z(r,e.text),o=[];for(let i of s.namedChildren)o.push(...W(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...W(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=W(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:z(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function z(t,r){return t?r?`${t}::${r}`:t:r}function _t(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let c=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[E,A]=d.split(/\s+as\s+/),w=E?.trim();if(!w)return[];let we=(A??w.split("::").pop()??w).trim(),Le=`${c}::${w}`.replace(/::::/g,"::");return[b(t,r,s,Le,w.split("::").pop()??w,we,T(t,r,c))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),m=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[b(t,r,s,a,a.split("::").pop()??a,p,m)]}function ke(t,r,e){let s=R(t,r);if(s)return Tt(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(...Rt(t,r,i))}return n}function Tt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!Ct(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of W(o,""))i.importedName&&s.push(Z(t,r,i.qualifiedName))}return s}function Ct(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Rt(t,r,e){let s=e.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),m=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[Z(t,r,m)]})}return[Z(t,r,s)]}function Z(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function Ae(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var Ot={language:"javascript",extensions:ne,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Y,parseReExports:K},Dt=k({language:"python",extensions:oe,imports:"ast-with-regex-fallback",parseImports:Ce}),kt=k({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:be}),At={language:"rust",extensions:ie,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:De,parseExports:ke},wt=k({language:"ruby",extensions:ae,imports:"ast-with-regex-fallback",parseImports:Re}),Lt=k({language:"c/cpp",extensions:pe,imports:"ast-with-regex-fallback",parseImports:he}),jt=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:Ne}),vt={language:"dart",extensions:ce,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ye,parseExports:xe},Mt=k({language:"php",extensions:F,imports:"ast-with-regex-fallback",parseImports:_e}),$t=[Ot,Dt,kt,At,wt,Lt,jt,vt,Mt];function B(t){return Ae($t,t)}var ee={clearGroups:["whole-project","source-file"]},qt=L("source-imports",ee),Ft=L("source-exports",ee),Ut=L("source-reexports",ee);function ns(t,r){let e=J(r);return Ut.get(t,e,()=>{let s=B(e);if(!s?.parseReExports)return[];let n=v(t,e);return n?s.parseReExports(t,e,n):[]})}function os(t,r){let e=J(r);return qt.get(t,e,()=>{let s=B(e);if(!s)return[];let n=v(t,e);if(!n)return[];let o=te(t,e,n),i=ue(t),a=re(t,"source-imports",e,o);if(a!==null)try{let m=JSON.parse(a);if(m.resolutionFingerprint===i&&Array.isArray(m.imports))return m.imports}catch{}let p=s.parseImports(t,e,n);return se(t,"source-imports",e,o,JSON.stringify({resolutionFingerprint:i,imports:p})),p})}function is(t,r){let e=J(r);return Ft.get(t,e,()=>{let s=B(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{ns as a,os as b,is as c};
|
|
4
|
+
//# sourceMappingURL=chunk-G2CGUNQU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-KT2ZO3CE.js";import{a as h}from"./chunk-733EF5FD.js";import{c as p}from"./chunk-JM72FNGA.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let l=h(t,e);return l?R(t,l,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),l;try{l=f(r,"utf-8")}catch{return null}let n=l.split(`
|
|
2
2
|
`),c=Math.max(0,e.startLine-a),i=Math.min(n.length-1,e.endLine+a),u=n.slice(c,i+1).join(`
|
|
3
3
|
`);return{symbol:e.symbol,shortName:p(e.symbol),relativePath:e.relativePath,startLine:c,endLine:i,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let l=m(t,e);if(!l)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",l);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),i;try{i=f(c,"utf-8")}catch{return null}let u=i.split(`
|
|
4
4
|
`),o=Math.max(0,a-1-r),g=Math.min(u.length-1,s-1+r),b=u.slice(o,g+1).join(`
|
|
5
5
|
`);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:g,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-GIOT3O6P.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-O3OKSF6O.js";import{a as ne}from"./chunk-3KLLFNT4.js";import{a as te}from"./chunk-QSXQT3NE.js";import{a as ie}from"./chunk-5UDFZC4D.js";import{a as re}from"./chunk-BNKE4TT5.js";import{a as Z}from"./chunk-WBJZNPUT.js";import{a as ee}from"./chunk-56UN3DMK.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as J}from"./chunk-SPE4YCOT.js";import{a as X}from"./chunk-ZFMPHDAT.js";import{a as Q}from"./chunk-C2QSK7E7.js";import{b as Y}from"./chunk-UQJGTVHV.js";import{a as j}from"./chunk-G3WGZU5Q.js";import{a as G}from"./chunk-DE7MA6OD.js";import{a as q}from"./chunk-7KCSELEV.js";import{a as W}from"./chunk-AW4N6MGC.js";import{a as T,b as U}from"./chunk-C3MZZ2ZN.js";import{b as N}from"./chunk-EYLXU575.js";import{b as I,c as z}from"./chunk-KRGBLZT2.js";import{a as K}from"./chunk-DAI74TJU.js";import{a as O}from"./chunk-CJJP64OC.js";import{f as A,g as k}from"./chunk-ZQLO2SCU.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Me(e),{breakdown:t,pressure:i}=Be(e),o=se(t,"risk"),n=se(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null},axes:Ae(e),validation:Te(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ae(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ke(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ke(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:l(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Te(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,n=0,a=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(n+=g.fixChanges,a+=1);let d=i.size>0?l(o/i.size):0,h=a>0?l(n/a):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=l(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?l(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:d,baselineFixDensity:h,ratio:i.size>0&&h>0?l(d/h):null,byCategory:S}}function l(e){return Math.round(e*100)/100}function ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${ce(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${ce(t)} score-weighted)`}function Me(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove unused abstractions; review single-consumer ownership before moving or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,n)=>{let a=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-a}),r}var ae={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function se(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Be(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(u,y,C)=>{y>0&&i.push({axis:u,points:y,detail:C,kind:ae[u]??"hygiene"})},a=(u,y,C,we,Pe,Re,De)=>{let w=Math.max(we,1);if(C<=w)return;let D=C/w,E=Math.min(Pe,Math.ceil(Math.log2(D)*Re));if(E<=0)return;let Ee=ae[u]??"hygiene";o.push({axis:u,category:y,kind:Ee,count:C,threshold:l(w),ratio:l(D),extraPenalty:E}),n(u,E,`${C} ${De} exceed pressure threshold ${l(w)} (${l(D)}x)`)},d=e.dead.count/t;n("dead-code",Math.min(20,Math.round(d*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;n("isolated",Math.min(10,Math.round(h*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let g=m(e.reactHookCandidates),f=g/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),xe=L/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(xe)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Le=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(Le/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);n("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);n("passthroughs",Math.min(3,F),v(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let ye=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(ye*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(u/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:u},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",u,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",g,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",L,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",_,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as Ve}from"v8";var $e=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ve();r.heap_size_limit-r.used_heap_size<$e||e()}var _e=50,Fe=75e3,Ie=5e3,ue=2500,le=50,ze=10,Ne=["overview","dead","isolated","cycles","similar","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],me={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Ue(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:We(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:qe(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:je(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Ye(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Xe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Qe(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Je(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ke(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Ze(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ge(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:et(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:tt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:rt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:nt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:at(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:it(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:ot(e,t)})};function qt(e,r={}){return he(e,r.full!==!1,(t,i)=>{let o=Oe(e,r.scope,t,i);return M(o)})}function jt(e,r,t={}){return he(e,t.full!==!1,(i,o)=>me[r](e,t.scope,o,i))}function he(e,r,t){let i=Q(e),o=st(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Gt(e){return M(ge(e))}function ge(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:de(e,"git-evidence")?.gitEvidence??null,suppressions:de(e,"suppressions")?.suppressions??null}}function de(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Oe(e,r,t,i){return ge(Ne.map(o=>me[o](e,r,i,t)))}function Ue(e,r,t){return s(e,t,"dead",()=>{let i=U(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(lt(e,i.symbols))})}function We(e,r,t){return s(e,t,"isolated",()=>{let i=j(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(dt(e,i))})}function qe(e,r,t){return s(e,t,"cycles",()=>O(e,{scope:r}).filter(o=>o.kind==="real").length)}function je(e,r,t){return s(e,t,"similar",()=>Y(e,{scope:r,...p.similar,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ge(e,r,t){return s(e,t,"extract-candidates",()=>q(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ye(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Xe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,mt)})}function Qe(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return pt(i)})}function Je(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ke(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,ht)})}function Ze(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function et(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=J(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,gt)})}function tt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=G(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ft)})}function rt(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=X(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,a)=>n+a.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function it(e,r){return s(e,r,"git-evidence",()=>{let t=I(e);if(!t)return null;let i=N(e,void 0,{limit:r.candidateResultLimit}),o={};for(let[n,a]of t)o[n]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:z(e),hiddenCoupling:{pairCount:i.findings.length,scoreCount:$(i.findings.reduce((n,a)=>n+pe(a),0)),top:i.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:pe(n),subjectContext:n.subjectContext}))},fileStats:o}})}function ot(e,r){return s(e,r,"suppressions",()=>{let t=ne(e);return{total:t.total,byCategory:{...t.byCategory}}})}function nt(e,r,t){return s(e,t,"drift",()=>{let i=W(e,{scope:r,...p.drift}),o=i.results.filter(d=>d.kind!=="pattern-deviation"),n=o.filter(d=>d.actionTier==="direct").length,a=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:a}})}function at(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=K(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>_e).length}})}function st(e,r){let t=e.symbols>=Fe||e.documents>=Ie,i=r?Number.POSITIVE_INFINITY:le,o=r?Number.POSITIVE_INFINITY:ze;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ue,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ue} symbols and reported their top ${le} findings. Enable full mode for unbounded candidate counts.`]}}function ct(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){ut(t);try{return i()}finally{ct(e,r)}}function ut(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function lt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function fe(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function pt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function Ce(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=e.sharedHooks.length>0,t=be({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ve(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function ht(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=be({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ve(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function be(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!He.has(Se(r))).length+Math.min(e.functions.length,3)}function ve(e,r,t){let i=[...e,...r,...t].map(Se);return i.length>0&&i.every(o=>He.has(o))}function Se(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function gt(e){return e.actionTier==="signal"?.25:1}function ft(e){return e.actionTier==="signal"?.25:1}function pe(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var He=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Ne as a,qt as b,jt as c,Gt as d};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as oe}from"./chunk-FG4NT6VY.js";import{a as ne}from"./chunk-VOYOYC5T.js";import{a as te}from"./chunk-EPPCGQUI.js";import{a as ie}from"./chunk-ZUTV7DDX.js";import{a as re}from"./chunk-CQEJU32R.js";import{a as Z}from"./chunk-M3YEHOCD.js";import{a as ee}from"./chunk-JOGZKF5W.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as J}from"./chunk-QVS4SYAX.js";import{a as X}from"./chunk-EOUTP32Q.js";import{a as Q}from"./chunk-C2QSK7E7.js";import{b as Y}from"./chunk-FKYPOK7P.js";import{a as j}from"./chunk-UJEVABIR.js";import{a as G}from"./chunk-XYI7XRZC.js";import{a as q}from"./chunk-YNLK3G63.js";import{a as W}from"./chunk-IA7Q6HVP.js";import{a as T,b as U}from"./chunk-CMXD5VC4.js";import{b as N}from"./chunk-MHATKJ3J.js";import{b as I,c as z}from"./chunk-KRGBLZT2.js";import{a as K}from"./chunk-KUIIQPDA.js";import{a as O}from"./chunk-27FU2KX7.js";import{f as A,g as k}from"./chunk-MJXJ56LG.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Me(e),{breakdown:t,pressure:i}=Be(e),o=se(t,"risk"),n=se(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null},axes:Ae(e),validation:Te(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ae(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:ke(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function ke(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:l(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function Te(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,n=0,a=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(n+=g.fixChanges,a+=1);let d=i.size>0?l(o/i.size):0,h=a>0?l(n/a):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=l(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?l(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:d,baselineFixDensity:h,ratio:i.size>0&&h>0?l(d/h):null,byCategory:S}}function l(e){return Math.round(e*100)/100}function ce(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${ce(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${ce(t)} score-weighted)`}function Me(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove unused abstractions; review single-consumer ownership before moving or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,n)=>{let a=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-a}),r}var ae={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function se(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Be(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(u,y,C)=>{y>0&&i.push({axis:u,points:y,detail:C,kind:ae[u]??"hygiene"})},a=(u,y,C,we,Pe,Re,De)=>{let w=Math.max(we,1);if(C<=w)return;let D=C/w,E=Math.min(Pe,Math.ceil(Math.log2(D)*Re));if(E<=0)return;let Ee=ae[u]??"hygiene";o.push({axis:u,category:y,kind:Ee,count:C,threshold:l(w),ratio:l(D),extraPenalty:E}),n(u,E,`${C} ${De} exceed pressure threshold ${l(w)} (${l(D)}x)`)},d=e.dead.count/t;n("dead-code",Math.min(20,Math.round(d*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;n("isolated",Math.min(10,Math.round(h*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let g=m(e.reactHookCandidates),f=g/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),xe=L/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(xe)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let Le=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(Le/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);n("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);n("passthroughs",Math.min(3,F),v(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let ye=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(ye*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(u/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:u},"co-changing pair(s) without a structural link"))}if(a("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),a("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let u=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling-pressure","Hidden coupling",u,50,10,4,"score-weighted co-changing pair(s)")}return a("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),a("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),a("react-hook-candidates-pressure","Duplicated React hook behavior",g,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),a("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),a("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),a("vue-composable-candidates-pressure","Duplicated Vue behavior",L,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),a("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),a("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),a("wrappers-pressure","Wrapper functions",_,50,4,2,"wrapper candidate(s)"),a("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),a("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),a("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as Ve}from"v8";var $e=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Ve();r.heap_size_limit-r.used_heap_size<$e||e()}var _e=50,Fe=75e3,Ie=5e3,ue=2500,le=50,ze=10,Ne=["overview","dead","isolated","cycles","similar","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],me={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:We(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:qe(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:je(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:Ge(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Xe(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Qe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Je(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Ke(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ze(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:et(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ye(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:tt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:rt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:it(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:at(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:st(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:ot(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:nt(e,t)})};function jt(e,r={}){return he(e,r.full!==!1,(t,i)=>{let o=Ue(e,r.scope,t,i);return M(o)})}function Gt(e,r,t={}){return Oe(e,[r],t)[0]}function Oe(e,r,t={}){return he(e,t.full!==!1,(i,o)=>{let n={...o,releaseCachesBetweenPhases:!1};return r.map(a=>me[a](e,t.scope,n,i))})}function he(e,r,t){let i=Q(e),o=ct(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Yt(e){return M(ge(e))}function ge(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:de(e,"git-evidence")?.gitEvidence??null,suppressions:de(e,"suppressions")?.suppressions??null}}function de(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Ue(e,r,t,i){return ge(Ne.map(o=>me[o](e,r,i,t)))}function We(e,r,t){return s(e,t,"dead",()=>{let i=U(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(dt(e,i.symbols))})}function qe(e,r,t){return s(e,t,"isolated",()=>{let i=j(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(pt(e,i))})}function je(e,r,t){return s(e,t,"cycles",()=>O(e,{scope:r}).filter(o=>o.kind==="real").length)}function Ge(e,r,t){return s(e,t,"similar",()=>Y(e,{scope:r,...p.similar,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ye(e,r,t){return s(e,t,"extract-candidates",()=>q(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Xe(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Qe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,ht)})}function Je(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return mt(i)})}function Ke(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ze(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Ce(i,gt)})}function et(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function tt(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=J(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ft)})}function rt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=G(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,Ct)})}function it(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=X(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,a)=>n+a.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function ot(e,r){return s(e,r,"git-evidence",()=>{let t=I(e);if(!t)return null;let i=N(e,void 0,{limit:r.candidateResultLimit}),o={};for(let[n,a]of t)o[n]={changes:a.changes,fixChanges:a.fixChanges};return{amplification:z(e),hiddenCoupling:{pairCount:i.findings.length,scoreCount:$(i.findings.reduce((n,a)=>n+pe(a),0)),top:i.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:pe(n),subjectContext:n.subjectContext}))},fileStats:o}})}function nt(e,r){return s(e,r,"suppressions",()=>{let t=ne(e);return{total:t.total,byCategory:{...t.byCategory}}})}function at(e,r,t){return s(e,t,"drift",()=>{let i=W(e,{scope:r,...p.drift}),o=i.results.filter(d=>d.kind!=="pattern-deviation"),n=o.filter(d=>d.actionTier==="direct").length,a=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:a}})}function st(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=K(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>_e).length}})}function ct(e,r){let t=e.symbols>=Fe||e.documents>=Ie,i=r?Number.POSITIVE_INFINITY:le,o=r?Number.POSITIVE_INFINITY:ze;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ue,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ue} symbols and reported their top ${le} findings. Enable full mode for unbounded candidate counts.`]}}function ut(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){lt(t);try{return i()}finally{ut(e,r)}}function lt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function pt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function fe(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function Ce(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function ht(e){let r=e.sharedHooks.length>0,t=be({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ve(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function gt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=be({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ve(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function be(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!He.has(Se(r))).length+Math.min(e.functions.length,3)}function ve(e,r,t){let i=[...e,...r,...t].map(Se);return i.length>0&&i.every(o=>He.has(o))}function Se(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function ft(e){return e.actionTier==="signal"?.25:1}function Ct(e){return e.actionTier==="signal"?.25:1}function pe(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var He=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Ne as a,jt as b,Gt as c,Oe as d,Yt as e};
|
|
2
|
+
//# sourceMappingURL=chunk-GKRRO3WC.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as i}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as i}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-MFWAZFYD.js";import{a}from"./chunk-XAYARHNF.js";import{a as r}from"./chunk-733EF5FD.js";import{c as o}from"./chunk-JM72FNGA.js";function S(s,n,c={}){let e=r(s,n);if(!e)return null;let t=c.semantic!==!1,y=m(s,e,{limit:50,semantic:t}),b=i(a(s,e,{limit:50,additive:!0,callableOnly:!0,semantic:t}));return{symbol:e.symbol,shortName:o(e.symbol),callers:y.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file})),callees:b.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file}))}}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GOWLZ4NA.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-KT2ZO3CE.js";function m(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -30,4 +30,4 @@ import{a as s}from"./chunk-CTCAF3YA.js";function m(e,d){let i=s(e,d);return i?e.
|
|
|
30
30
|
WHERE d2.relative_path = ?
|
|
31
31
|
AND d1.relative_path != ?
|
|
32
32
|
ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{m as a,o as b};
|
|
33
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-GRZRMELG.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as N}from"./chunk-
|
|
1
|
+
import{a as N}from"./chunk-MFWAZFYD.js";import{a as I,b as S}from"./chunk-733EF5FD.js";import{f as p,k as g}from"./chunk-TJXOD4IK.js";import{c as h,e as b}from"./chunk-JM72FNGA.js";function x(o,s,r={}){let{maxDepth:c=5,scope:a}=r,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let i=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&i.push(n.symbolMatch)}t=i}return u.sort((e,i)=>e.depth-i.depth||e.file.localeCompare(i.file)),u}function D(o,s,r){let c=N(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!r||t.file.includes(r)),a=new Set(c.map(t=>t.file)),l=[];for(let t of M(o,s,r)){if(a.has(t))continue;let e=p(o,t),i=e.length>0?g(e,e[0].startLine):null;l.push({symbol:i?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=S(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:h(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!_(e.symbol))continue;let i=`${e.symbolId}|${e.relativePath}`;m.has(i)||(m.add(i),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function M(o,s,r){let c=r?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return r&&a.push(`%${r}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
@@ -7,4 +7,4 @@ import{a as N}from"./chunk-GZCQTZLK.js";import{a as I,b as S}from"./chunk-MZ7APU
|
|
|
7
7
|
AND c.document_id != ?
|
|
8
8
|
${o.pathExclusionsFor("consumer_d")}
|
|
9
9
|
${c}`,...a).map(l=>l.relative_path).filter(l=>!o.isIgnored(l)))}function _(o){let s=b(o);return s==="method"||s==="type"||o.endsWith("().")}export{x as a};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-H6RLM7D7.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function g(n,t){let e=new Set;for(let r of n)t.has(r)&&e.add(r);return e}function p(n,t){let e=new Set;for(let r of n)t.has(r)||e.add(r);return e}function S(n,t){if(n.size===0&&t.size===0)return 0;let e=0;for(let o of n)t.has(o)&&(e+=1);let r=n.size+t.size-e;return r===0?0:e/r}function M(n,t){if(n.size===0)return 0;let e=0;for(let r of n)t.has(r)&&(e+=1);return e/n.size}function b(n){let t=n.length;if(t===0)return new Map;let e=new Map;for(let r of n)for(let o of r)e.set(o,(e.get(o)??0)+1);return m(e,t)}function m(n,t){if(t<=0)return new Map;let e=new Map;for(let[r,o]of n)o>0&&e.set(r,Math.log(t/o));return e}function l(n){let t=[...n.values()].sort((r,o)=>r-o);if(t.length===0)return 0;let e=Math.floor(t.length/2);return t.length%2===0?(t[e-1]+t[e])/2:t[e]}function w(n,t,e,r={}){let o=0,u=0,c=0,d=r.medianIdf??l(e),a=[],f=[];for(let s of n){let i=e.get(s)??0;u+=i*i,t.has(s)&&(o+=i*i,i>=d?a.push(s):f.push(s))}if(a.length===0&&f.length===0)return{similarity:0,significantShared:[],trivialShared:[]};for(let s of t){let i=e.get(s)??0;c+=i*i}let T=Math.sqrt(u)*Math.sqrt(c),h=T>0?o/T:0;return a.sort((s,i)=>(e.get(i)??0)-(e.get(s)??0)),{similarity:h,significantShared:a,trivialShared:f}}export{g as a,p as b,S as c,M as d,b as e,m as f,l as g,w as h};
|
|
2
|
+
//# sourceMappingURL=chunk-HDBQHJNY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{a as m}from"./chunk-LONIY5FF.js";import{b as h}from"./chunk-MJXJ56LG.js";import{c as b}from"./chunk-U73YFD3P.js";import{b as g}from"./chunk-G2CGUNQU.js";import{a as S}from"./chunk-64MNV6AB.js";import d from"path";function u(e){let t=e.replace(/\\/g,"/").split("/").filter(Boolean);return t.length<=1?"(root)":t.length>=3&&["src","lib","app","server","client"].includes(t[0])?`${t[0]}/${t[1]}`:t[0]}function y(e,n){if(e===n)return"ok";let t=p(e),i=p(n);return t&&i?R(t,i)?"ok":"violation":k(e,n)}function D(e,n){let t=p(u(e)),i=p(u(n));return!!t&&!!i}function p(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function R(e,n){return n==="domain"?!0:e==="domain"?!1:{analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),"language-parsers":new Set(["domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["domain","queries","reindex","resolution","semantic","source","storage","symbols"]),semantic:new Set(["domain","resolution","storage","symbols"]),source:new Set(["domain","storage"]),storage:new Set(["domain","source"]),symbols:new Set(["analysis","domain","language-parsers","resolution","semantic","source","storage"])}[e]?.has(n)??!1}function k(e,n){if(n==="shared")return"ok";let t={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return t[e]?t[e].has(n)?"ok":"violation":null}function X(e,n){let{scope:t,minDeviation:i=5}=n??{},r=n?.semantic!==!1,c=new m(e).fileDependencyGraph(t),a=O(e,t);return _([...x(e,c,a,{semantic:r}),...$(c),...I(c,i)])}function x(e,n,t,i){let r=[];for(let[s,c]of n){if(l(s))continue;let a=t.get(s)??new Set;for(let o of c)if(!l(o)&&!a.has(o)){if(i.semantic&&A(e,s,o)||j(e,s,o)||B(e,s,o)||L(o)||q(e,s,o)||V(o))continue;r.push({file:s,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${s} to ${o}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."})}}return r}function $(e){let n=[],t=F(e);for(let[i,r]of e){if(l(i))continue;let s=u(i);for(let c of r){if(l(c))continue;let a=u(c);if(s===a)continue;let o=y(s,a),f=o?"explicit":"inferred";if((o??t.get(`${s}->${a}`))==="violation"){let w=f==="explicit"?"direct":"signal";n.push({file:i,kind:"layer-violation",description:`Imports from ${a}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${s}/ should not depend on ${a}/`,actionTier:w,policyBasis:f,evidenceReasons:[`dependency edge exists from ${i} to ${c}`,f==="explicit"?`explicit layer policy rejects ${s}/ -> ${a}/`:`rare cross-layer edge ${s}/ -> ${a}/ is inferred as a violation`],recommendation:f==="explicit"?"Move the dependency behind an allowed layer boundary or document a policy change.":"Review whether this is a real boundary break or an intentional exception before moving code."})}}}return n}function I(e,n){let t=[];for(let[i,r]of M(e)){let s=r.filter(a=>!l(a));if(s.length<n)continue;let c=P(e,s);for(let a of s)for(let o of e.get(a)??[])l(o)||(c.get(o)??0)===1&&d.dirname(o)!==i&&d.dirname(o)!==d.dirname(i)&&(D(a,o)||t.push({file:a,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${o}`,dep:o,actionTier:"signal",evidenceReasons:[`${s.length} sibling file(s) in ${i}/ were compared`,`${a} is the only non-skipped sibling depending on ${o}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."}))}return t}function _(e){return{results:e,unusedImports:e.filter(n=>n.kind==="unused-import").length,layerViolations:e.filter(n=>n.kind==="layer-violation").length,patternDeviations:e.filter(n=>n.kind==="pattern-deviation").length}}function M(e){let n=new Map;for(let t of e.keys()){let i=d.dirname(t),r=n.get(i);r||(r=[],n.set(i,r)),r.push(t)}return n}function P(e,n){let t=new Map;for(let i of n)for(let r of e.get(i)??[])l(r)||t.set(r,(t.get(r)??0)+1);return t}function O(e,n){let t=new Map;return E(e,t,n),T(e,t),t}function E(e,n,t){for(let i of N(e,t))v(e,n,i.from_file,i.to_file)}function N(e,n){let t=n?`AND d1.relative_path LIKE '%${n}%'`:"";return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -15,4 +15,4 @@ import{a as m}from"./chunk-3ZYF3ELZ.js";import{b as h}from"./chunk-ZQLO2SCU.js";
|
|
|
15
15
|
AND m.role != 1
|
|
16
16
|
${e.pathExclusionsFor("d1","d2")}
|
|
17
17
|
${t}`)}function T(e,n){new m(e).scanSourceReferences({paths:S(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},i=>{i.target.relativePath!==i.sourceFile&&(e.isIgnored(i.target.relativePath)||v(e,n,i.sourceFile,i.target.relativePath))})}function v(e,n,t,i){if(e.isIgnored(t)||e.isIgnored(i))return;let r=n.get(t);r||(r=new Set,n.set(t,r)),r.add(i)}function F(e){let n=new Map;for(let[i,r]of e){if(l(i))continue;let s=u(i);for(let c of r){if(l(c))continue;let a=u(c);if(s===a||y(s,a))continue;let o=`${s}->${a}`;n.set(o,(n.get(o)??0)+1)}}let t=new Map;for(let[i,r]of n)t.set(i,r<=2?"violation":"ok");return t}function L(e){return e.includes("types")||e.endsWith(".d.ts")}function A(e,n,t){let i=b(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.isUsed)}function j(e,n,t){let i=g(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.some(r=>r.used)}function B(e,n,t){let i=g(e,n).filter(r=>r.sourcePath===t);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function V(e){return e.endsWith(".vue")}function q(e,n,t){let i=g(e,n).filter(r=>r.sourcePath===t);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function l(e){let n=h(e);return!!(n==="entry"||n==="barrel"||n==="test"||n==="worker"||J(d.basename(e)))}function J(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{X as a};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-IA7Q6HVP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as D}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as D}from"./chunk-LONIY5FF.js";import{o as A}from"./chunk-W2TIXAGN.js";import{b as d,d as h,f as y}from"./chunk-U73YFD3P.js";import{c as S}from"./chunk-JM72FNGA.js";function F(e,n={}){let{samples:o=50,scope:r,maxDisagreements:l=5}=n,s=new D(e),i=C(s.productionCallableDefinitions({scope:r,minLoc:2,requireFunctionLikeSymbol:!0}),o);if(i.length===0||!R(e,i))return{available:!1,sampleSize:i.length,oracleCoverage:0,scores:[],topDisagreements:[]};let c={references:v(),callees:v()},a=[],g=0,T=y(e,i);for(let t of i){let u=f(t,h(e,t).map(m=>m.file)),b=f(t,(T.get(t.symbolId)??[]).map(m=>m.file));if(u.size===0&&b.size===0)continue;g+=1;let Q=f(t,A(e,t).map(m=>m.file)),I=f(t,(s.calleeMap([t],{semantic:!1}).get(t.symbolId)??[]).map(m=>m.file));x(c.references,t,"references",Q,u,a),x(c.callees,t,"callees",I,b,a)}return a.sort((t,u)=>u.cheapOnly.length+u.oracleOnly.length-(t.cheapOnly.length+t.oracleOnly.length)),{available:!0,sampleSize:i.length,oracleCoverage:i.length>0?p(g/i.length):0,scores:["references","callees"].map(t=>O(t,c[t])),topDisagreements:a.slice(0,l)}}function v(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0}}function C(e,n){let o=[...e].sort((s,i)=>s.symbolId-i.symbolId);if(o.length<=n)return o;let r=o.length/n,l=[];for(let s=0;s<n;s++)l.push(o[Math.floor(s*r)]);return l}function R(e,n){let o=n[0];if(!o)return!1;try{return d(e,o.relativePath).availability().available}catch{return!1}}function f(e,n){let o=new Set;for(let r of n)r!==e.relativePath&&o.add(r);return o}function x(e,n,o,r,l,s){if(r.size===0&&l.size===0)return;e.comparedSymbols+=1,e.cheapTotal+=r.size,e.oracleTotal+=l.size;let i=[],c=[];for(let a of r)l.has(a)?e.agreed+=1:i.push(a);for(let a of l)r.has(a)||c.push(a);(i.length>0||c.length>0)&&s.push({symbol:S(n.symbol),question:o,cheapOnly:i,oracleOnly:c})}var z={references:!0,callees:!1};function O(e,n){let o=n.oracleTotal>0?n.agreed/n.oracleTotal:1,r=n.cheapTotal-n.agreed;return{question:e,comparedSymbols:n.comparedSymbols,precision:z[e]&&n.cheapTotal>0?p(n.agreed/n.cheapTotal):null,recall:p(o),unverified:r}}function p(e){return Math.round(e*1e3)/1e3}export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-IL2EVPYP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-MFWAZFYD.js";import{g as l}from"./chunk-TJXOD4IK.js";import{c as r}from"./chunk-JM72FNGA.js";function b(o,t={}){let{limit:n=30,scope:e}=t,i=e?`AND def_d.relative_path LIKE '%${e}%'`:"",m=o.all(`SELECT
|
|
2
2
|
gs.symbol,
|
|
3
3
|
COUNT(*) AS ref_count,
|
|
4
4
|
COUNT(DISTINCT ref_d.id) AS file_count,
|
|
@@ -22,4 +22,4 @@ import{a as d}from"./chunk-GZCQTZLK.js";import{g as l}from"./chunk-3UW7VM4H.js";
|
|
|
22
22
|
GROUP BY gs.id
|
|
23
23
|
ORDER BY ref_count DESC
|
|
24
24
|
LIMIT ?`,n).filter(s=>!o.isIgnored(s.defined_in)).map(s=>({symbol:s.symbol,shortName:r(s.symbol),refCount:s.ref_count,fileCount:s.file_count,definedIn:s.defined_in}));return m.length>0?m:f(o,e,n)}function f(o,t,n){return l(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>u(o,e)).filter(e=>e.refCount>0).sort((e,i)=>i.refCount-e.refCount||i.fileCount-e.fileCount).slice(0,n)}function u(o,t){let n=d(o,t,{limit:500});return{symbol:t.symbol,shortName:r(t.symbol),refCount:n.length,fileCount:new Set(n.map(e=>e.file)).size,definedIn:t.relativePath}}export{b as a};
|
|
25
|
-
//# sourceMappingURL=chunk-
|
|
25
|
+
//# sourceMappingURL=chunk-J43GIAVM.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p,b as H,c as l,d as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p,b as H,c as l,d as m}from"./chunk-FXWV2V7K.js";import{a as b}from"./chunk-PVZMPG5I.js";import{a as R,b as g}from"./chunk-HDBQHJNY.js";import{e as v}from"./chunk-5MHQI4RR.js";function V(e,s={}){let{minSimilarity:d=.45,minSharedBehaviors:i=6,limit:o=20,scope:n,scanLimit:a,filePattern:c}=s,h=v(e,{scope:n,minBehaviorTokens:Math.max(3,i),scanLimit:a}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r}));return b({profiles:h,limit:o,filePattern:c,compare:(r,t)=>y(r,t,d,i),sort:(r,t)=>t.similarity-r.similarity||r.fileA.localeCompare(t.fileA)||r.componentA.localeCompare(t.componentA)||r.fileB.localeCompare(t.fileB)||r.componentB.localeCompare(t.componentB)})}function y(e,s,d,i){let o=R(e.tokens,s.tokens);if(o.size<i||!A(o))return null;let n=H(e.tokens,s.tokens);if(n<d)return null;let a=l(o,"hook:"),c=l(o,"react-hook:"),h=l(o,"effect:"),r=l(o,"state:"),t=l(o,"request:"),u=l(o,"handler:"),k=l(o,"handler-verb:"),f=B({sharedHooks:a,sharedReactHooks:c,sharedEffects:h,sharedState:r,sharedRequests:t,sharedHandlers:u,sharedHandlerVerbs:k});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:n,sharedTokens:m(o),sharedHooks:a,sharedReactHooks:c,sharedEffects:h,sharedState:r,sharedRequests:t,sharedHandlers:u,sharedHandlerVerbs:k,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:m(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:m(g(s.tokens,e.tokens)).slice(0,25),reason:E({sharedHooks:a,sharedReactHooks:c,sharedEffects:h,sharedState:r,sharedRequests:t,sharedHandlers:u,sharedHandlerVerbs:k}),locA:e.profile.loc,locB:s.profile.loc}}function B(e){return p({genericWords:P,stripPrefixes:S,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:C})}function C(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function A(e){let s=0,d=0,i=0,o=0,n=0,a=0,c=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?d+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?n+=1:t.startsWith("state:")?a+=1:t.startsWith("state-hook:")&&(c+=1);let h=a+c,r=s+d+i+o+n+h;return o>=1&&r>=4||s>=1&&(o>=1||a>=1||n>=2)&&r>=5||a>=1&&n>=2&&(i>=1||d>=2)&&r>=5}function E(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var P=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),S=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JOGZKF5W.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-733EF5FD.js";import{a as c}from"./chunk-64MNV6AB.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as g,join as d}from"path";function S(t,r){let e=f(t,r,{allowMultiple:!1})[0]?.relativePath;return e||x(t,r)}function j(t,r){return f(t,r,{allowMultiple:!0}).map(e=>e.relativePath)}function x(t,r){if(!r)return null;let e=r.replace(/\\/g,"/").replace(/^\.\//,""),s=g(e)&&e.startsWith(t.config.projectRoot)?e.slice(t.config.projectRoot.length).replace(/^\/+/,""):e,i=d(t.config.projectRoot,s);return m(i)?s:null}function f(t,r,e){let s=h(r);if(!s)return[];let i=c(t,{includeIgnored:!1}).map(o=>({relativePath:o,score:v(o,s)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.relativePath.localeCompare(l.relativePath));if(i.length===0){let o=u(t,r);return!o||t.isIgnored(o.relativePath)?[]:[{relativePath:o.relativePath,score:700}]}let n=i.filter(o=>o.score>=1100);if(n.length>0)return e.allowMultiple?n:[n[0]];let a=i.filter(o=>o.score>=800);return a.length>0?e.allowMultiple?a:[a[0]]:e.allowMultiple?i:[i[0]]}function v(t,r){let e=h(t),s=p(e),i=p(r),n=0;return e===r&&(n+=1200),e.endsWith(`/${r}`)&&(n+=1100),s===i&&(n+=900),e.startsWith(`${r}/`)&&(n+=850),e.includes(r)&&(n+=250),n}function h(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,j as b};
|
|
2
|
+
//# sourceMappingURL=chunk-KT2ZO3CE.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as u}from"./chunk-PFOCOG57.js";import{a as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as u}from"./chunk-PFOCOG57.js";import{a as p}from"./chunk-LONIY5FF.js";import{c as i}from"./chunk-JM72FNGA.js";function x(e,r){let{scope:m,minLoc:o=10,limit:c=30,scanLimit:a}=r??{},s=new p(e);return u({candidates:()=>s.productionCallableDefinitions({scope:m,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,prepare:t=>({callerMap:s.crossFileCallerMap(t,{semantic:r?.semantic!==!1}),calleeMap:s.calleeMap(t,{semantic:r?.semantic!==!1})}),evaluate:(t,n)=>b(t,n,o),orderResults:(t,n)=>n.score-t.score||n.loc-t.loc,limit:c})}function b(e,r,m){let o=e.endLine-e.startLine+1;if(o<m)return null;let c=r.callerMap.get(e.symbolId)?.size??0,a=r.calleeMap.get(e.symbolId)??[],s=a.filter(l=>l.file!==e.relativePath),t=new Set(s.map(l=>`${l.symbol}|${l.file}`)).size,n=new Set(a.map(l=>`${l.symbol}|${l.file}`)).size;return{symbol:e.symbol,shortName:i(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o,fanIn:c,fanOut:t,calleeCount:n,score:Math.round(o/50*(c/5)*Math.max(t/5,1)*100)/100}}export{x as a};
|
|
2
|
+
//# sourceMappingURL=chunk-KUIIQPDA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c,c as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c,c as l}from"./chunk-DS6QEB3G.js";function h(e,a,i,r,n,o){let t=new Set;d(e,a,i,r)&&t.add(n);for(let s of o)s.value&&p(t,s.label,s.value);return[...t].slice(0,6)}function p(e,a,i){let r=u(i);a.endsWith("name")&&y(r)&&e.add(`${a} has type-guard boundary shape`);for(let n of r){let o=f.get(n);o&&e.add(`${a} has ${o} term: ${n}`)}}function d(e,a,i,r){if(i<=0)return!1;let n=c(e,a);if(n.length===0)return!1;for(let o=i-1;o>=0&&o>=i-5;o-=1){let t=(n[o]??"").trim();if(t!==""){if(l(t)===r)return!0;if(!t.startsWith("//")&&!t.startsWith("*")&&!t.startsWith("/*")&&!t.startsWith("@")&&!t.startsWith("#"))return!1}}return!1}function u(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function y(e){return e.some(a=>g.has(a))&&e.some(a=>m.has(a))}var f=new Map([["access","access policy"],["accessible","access policy"],["adapter","adapter"],["adapters","adapter"],["allow","access policy"],["allowed","access policy"],["animation","animation calculation"],["api","api surface"],["apply","settings/application"],["audit","side-effect boundary"],["auth","authorization"],["authorize","authorization"],["audio","audio side-effect"],["can","access policy"],["capabilities","capability boundary"],["capability","capability boundary"],["boundary","boundary"],["begin","lifecycle"],["bridge","bridge"],["bridges","bridge"],["cache","state cache"],["chase","gameplay action"],["command","command boundary"],["context","context policy"],["cooldown","temporal state"],["cooldowns","temporal state"],["controller","controller"],["controllers","controller"],["diagnostic","diagnostics"],["diagnostics","diagnostics"],["effect","side-effect boundary"],["effects","side-effect boundary"],["energy","gameplay calculation"],["expired","temporal state"],["facade","facade"],["facades","facade"],["fire","gameplay action"],["gateway","gateway"],["gateways","gateway"],["guard","guard"],["guards","guard"],["haptic","haptic side-effect"],["haptics","haptic side-effect"],["head","sequence boundary"],["history","state history"],["input","input boundary"],["jump","gameplay action"],["keyboard","input boundary"],["log","side-effect boundary"],["logger","side-effect boundary"],["lock","coordination boundary"],["middleware","middleware"],["multiplier","gameplay calculation"],["mute","audio side-effect"],["normalize","normalization"],["normalise","normalization"],["normalizer","normalization"],["oscillate","animation calculation"],["oscillation","animation calculation"],["overlap","collision predicate"],["performance","diagnostics"],["permission","access policy"],["permissions","access policy"],["policy","policy"],["pool","state pool"],["pooled","state pool"],["pools","state pool"],["predict","prediction"],["presenter","presenter"],["presenters","presenter"],["projectile","gameplay entity"],["provider","provider boundary"],["providers","provider boundary"],["public","public surface"],["quality","settings/application"],["rate","calculation"],["register","registry"],["registry","registry"],["relay","relay"],["relays","relay"],["reseed","state lifecycle"],["reset","state lifecycle"],["respond","response boundary"],["response","response boundary"],["resolve","resolution"],["resolver","resolution"],["route","route boundary"],["routes","route boundary"],["run","lifecycle"],["sample","diagnostics"],["score","gameplay calculation"],["scope","scope policy"],["scroll","position state"],["scrolled","position state"],["seed","state lifecycle"],["seeded","state lifecycle"],["segment","segment boundary"],["segments","segment boundary"],["setting","settings/application"],["settings","settings/application"],["spawn","gameplay lifecycle"],["spawning","gameplay lifecycle"],["speed","gameplay calculation"],["surface","public surface"],["tail","sequence boundary"],["tick","temporal state"],["transaction","transaction"],["transactional","transaction"],["transform","transformation"],["transformer","transformation"],["translate","translation"],["translator","translation"],["try","fallible action"],["validate","validation"],["validation","validation"],["validator","validation"],["visual","diagnostics"],["window","settings/application"],["socket","transport boundary"],["websocket","transport boundary"]]),g=new Set(["can","has","is","should"]),m=new Set(["access","api","auth","collision","expired","input","keyboard","overlap","permission","permissions","policy","projectile","response","route","routes","scope"]);export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LM5SHAN4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as y,f as E,g as q}from"./chunk-MJXJ56LG.js";import{a as g}from"./chunk-BGBBVSH4.js";import{b as O,c as H,d as W}from"./chunk-MFWAZFYD.js";import{c as G}from"./chunk-XAYARHNF.js";import{a as j,j as B,l as F,m as V}from"./chunk-W2TIXAGN.js";import{a as k}from"./chunk-RISLKTKQ.js";import{f as K,h as S}from"./chunk-TJXOD4IK.js";import{f as P,g as N,i as A,j as w}from"./chunk-JM72FNGA.js";import{a as M,f as p}from"./chunk-OZUJ3VZS.js";import{a as b,b as L}from"./chunk-5MHQI4RR.js";import{a as C,d}from"./chunk-DS6QEB3G.js";import{c as T}from"./chunk-A536TEU4.js";import{a as v}from"./chunk-64MNV6AB.js";function Y(t,e,r){let a=e.identifierResolution==="strict"?F:V;for(let n of e.paths)if(!(!b(n)&&!(e.includeVueSfc&&L(n)))&&!t.isIgnored(n)&&!e.skipPath?.(n))try{if(e.candidateNames&&!B(C(t,n),e.candidateNames))continue;let l=(i,c,R,m)=>{if(e.candidateNames&&!e.candidateNames.has(i))return;let h=e.resolveTargets?e.resolveTargets({sourceFile:n,name:i,kind:c,defaultTargets:m}):m();for(let D of h)r({sourceFile:n,name:i,target:D,occurrences:R,kind:c})},f=j(t,n);for(let[i,c]of f)l(i,"identifier",c.length,()=>a(t,n,i));for(let i of p(t,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=i.kind==="cross-language-dispatch"?()=>F(t,n,i.name):()=>a(t,n,i.name);l(i.name,i.kind,i.occurrences,c)}}finally{e.afterPath?.(n)}}function _(t,e={}){let{scope:r,minLoc:a=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:l=!1,excludeTypesFiles:f=!1,excludeRootedSymbols:i=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:R=!1,excludeRustTraitImplMembers:m=!1,includeSuppressed:h=!1,sortByLocDesc:D=!1}=e,I=[];for(let s of S(t,r)){let u=s.relativePath;if(t.isIgnored(u)||l&&E(t,u)||!J(s,{requireFunctionLikeSymbol:c,requireCallableSymbol:R})||o!==void 0&&s.symbol===o)continue;let x=g(s);x<a||x>n||f&&Q(u)||i&&q(t,s.symbol,u)||m&&A(s.symbol)||y(u)!=="test"&&(w(s.symbol)||!h&&d(t,u,s.startLine)||I.push(s))}return D?I.sort((s,u)=>g(u)-g(s)):I}function J(t,e){return e.requireCallableSymbol?P(t.symbol):e.requireFunctionLikeSymbol?N(t.symbol):t.isFunctionLike}function Q(t){return(t.split("/").pop()??"").includes("types")}var z=class{constructor(e){this.db=e}db;scopedDefinitions(e){return S(this.db,e)}definitionsForFile(e){return K(this.db,e)}productionCallableDefinitions(e={}){return _(this.db,e)}calleeMap(e,r={}){return G(this.db,e,r)}crossFileCallerMap(e,r={}){return O(this.db,e,r)}sourceFallbackCallerFiles(e){return H(this.db,e)}callerFileMap(e,r={}){return W(this.db,e,r)}frameworkReferencedSymbolIds(e){let r=new Map;for(let n of e){if(!n.leaf)continue;let o=r.get(n.leaf)??[];o.push(n.symbolId),r.set(n.leaf,o)}let a=new Set;for(let n of v(this.db,{includeIgnored:!1}))if(b(n)==="rust")for(let{name:o}of p(this.db,n,{includeRustAttributeNames:!0}))for(let l of r.get(o)??[])a.add(l);return a}symbolsWithNonSelfCallees(e,r={}){if(e.length===0)return new Set;let a=new Map(e.map(o=>[o.symbolId,o.symbol])),n=this.calleeMap(e,r);return new Set([...n.entries()].filter(([o,l])=>{let f=a.get(o);return l.some(i=>i.symbol!==f)}).map(([o])=>o))}fileDependencyGraph(e){return k(this.db,e)}fileKind(e){return y(e)}hasSuppressionComment(e){return d(this.db,e.relativePath,e.startLine)}sourceFiles(){return T(this.db)}scanSourceReferences(e,r){Y(this.db,e,r)}callableSignature(e){let r=M(this.db,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);return r?{paramCount:r.paramCount}:null}};export{z as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LONIY5FF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-U73YFD3P.js";import{y as d}from"./chunk-3LQFMQPY.js";import{c as h,d as S,g as x}from"./chunk-TJXOD4IK.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as g}from"./chunk-DS6QEB3G.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-LQSLW7K7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as s,d as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as s,d as l}from"./chunk-FXWV2V7K.js";import{a as u}from"./chunk-PVZMPG5I.js";import{a as p,b as m,c as f}from"./chunk-HDBQHJNY.js";import{e as c}from"./chunk-5MHQI4RR.js";function A(i,t={}){let{minSimilarity:r=.62,minTokens:e=8,limit:a=20,scope:d,scanLimit:g,filePattern:h}=t,k=c(i,{scope:d,minJsxTokens:e,scanLimit:g}).filter(n=>n.kind==="component").map(n=>({file:n.file,component:n.name,tokens:n.jsxTokens,profile:n}));return u({profiles:k,limit:a,filePattern:h,compare:(n,o)=>P(n,o,r),sort:(n,o)=>o.similarity-n.similarity||n.fileA.localeCompare(o.fileA)||n.componentA.localeCompare(o.componentA)||n.fileB.localeCompare(o.fileB)||n.componentB.localeCompare(o.componentB)})}function P(i,t,r){let e=p(i.tokens,t.tokens);if(e.size<6||!B(e))return null;let a=f(i.tokens,t.tokens);return a<r?null:{fileA:i.file,componentA:i.component,fileB:t.file,componentB:t.component,similarity:a,sharedTokens:l(e),sharedComponents:s(e,"component:"),sharedNativeTags:s(e,"native:"),sharedProps:s(e,"prop:"),sharedEvents:s(e,"event:"),sharedBindings:s(e,"binding:"),uniqueToA:l(m(i.tokens,t.tokens)).slice(0,25),uniqueToB:l(m(t.tokens,i.tokens)).slice(0,25),locA:i.profile.loc,locB:t.profile.loc}}function B(i){let t=0,r=0;for(let e of i)e.startsWith("component:")&&(t+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("native:")||e.startsWith("jsx:"))&&(r+=1);return t>=1||r>=4}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-M3YEHOCD.js.map
|