scip-query 0.10.11 → 0.10.12
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 +56 -35
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-2DOW7QCA.js +71 -0
- package/dist/chunk-2FMFF4RI.js +2 -0
- package/dist/{chunk-LSET2TXH.js → chunk-2GLNBCHB.js} +2 -2
- package/dist/chunk-2UVCH7CQ.js +2 -0
- package/dist/{chunk-LM5SHAN4.js → chunk-3XSNW5XB.js} +2 -2
- package/dist/chunk-4ISHQ7UW.js +35 -0
- package/dist/{chunk-BFXPG2VN.js → chunk-5GXTUANY.js} +2 -2
- package/dist/{chunk-FXNWFMKW.js → chunk-5JHEN5VN.js} +2 -2
- package/dist/chunk-62ULXMQ7.js +18 -0
- package/dist/chunk-63CI3IXR.js +102 -0
- package/dist/{chunk-P753MDDE.js → chunk-6BN3EHQE.js} +2 -2
- package/dist/chunk-7C6JBBE4.js +23 -0
- package/dist/chunk-7EK7OSWS.js +2 -0
- package/dist/chunk-7IWIMNHI.js +2 -0
- package/dist/chunk-7XTO4YXB.js +8 -0
- package/dist/{chunk-Z3YYR4OS.js → chunk-A4UTLKHU.js} +2 -2
- package/dist/{chunk-FDEQIPPK.js → chunk-ANUEY5WV.js} +2 -2
- package/dist/chunk-AOWFUGDL.js +2 -0
- package/dist/chunk-AREANYIA.js +3 -0
- package/dist/{chunk-6IR2AOBM.js → chunk-AZBELWZQ.js} +2 -2
- package/dist/{chunk-JME7OWD3.js → chunk-CXWCLVYL.js} +2 -2
- package/dist/chunk-CYHIKTJN.js +3 -0
- package/dist/{chunk-BVRS7RKQ.js → chunk-DDQONX6B.js} +2 -2
- package/dist/{chunk-IHUETYFW.js → chunk-DFSEARAU.js} +2 -2
- package/dist/{chunk-EY43NV4M.js → chunk-DQ6433ZG.js} +2 -2
- package/dist/chunk-DVFP6PZI.js +2 -0
- package/dist/chunk-E3ADDB43.js +2 -0
- package/dist/{chunk-YWOOQ4FF.js → chunk-ELC77ZDE.js} +1 -1
- package/dist/chunk-EOLGSSDR.js +2 -0
- package/dist/chunk-F6IXELII.js +20 -0
- package/dist/{chunk-QYB5P7GL.js → chunk-FMGVZBS2.js} +2 -2
- package/dist/{chunk-VOYOYC5T.js → chunk-FX6ULETZ.js} +2 -2
- package/dist/chunk-GG5LHT27.js +2 -0
- package/dist/chunk-GKB4JJDU.js +2 -0
- package/dist/chunk-H7JF2CKK.js +2 -0
- package/dist/chunk-HHOMJCP5.js +4 -0
- package/dist/chunk-HRDSU5FN.js +9 -0
- package/dist/{chunk-BZ53S4ZN.js → chunk-HWVYTJOV.js} +2 -2
- package/dist/chunk-JJ5SAWBT.js +2 -0
- package/dist/chunk-JNMLBL36.js +2 -0
- package/dist/chunk-JS6B76AQ.js +2 -0
- package/dist/{chunk-Z4HICZGY.js → chunk-KZ4MG5NY.js} +2 -2
- package/dist/{chunk-RNM6LMCF.js → chunk-L446VQYQ.js} +2 -2
- package/dist/{chunk-FFVIFETB.js → chunk-LDJUB7XW.js} +2 -2
- package/dist/{chunk-54KGX7EX.js → chunk-LEHVP4DY.js} +2 -2
- package/dist/chunk-MNCQPMCH.js +2 -0
- package/dist/chunk-MYTUWXHK.js +4 -0
- package/dist/chunk-N25HPUOK.js +2 -0
- package/dist/chunk-NABVR6B7.js +2 -0
- package/dist/{chunk-TK7O5ER5.js → chunk-NBNEVLRC.js} +2 -2
- package/dist/chunk-NTSR6SRP.js +2 -0
- package/dist/{chunk-7B6LP46R.js → chunk-OFXN2BCT.js} +2 -2
- package/dist/chunk-PWAK75BU.js +2 -0
- package/dist/chunk-Q5P7NOVM.js +2 -0
- package/dist/{chunk-G5UPYQGL.js → chunk-RGKRYO22.js} +4 -4
- package/dist/chunk-RM2WQ75T.js +2 -0
- package/dist/chunk-ROGZXWN2.js +2 -0
- package/dist/chunk-RSSXKJ6J.js +38 -0
- package/dist/chunk-RUV5IY25.js +7 -0
- package/dist/chunk-RVGEZYMQ.js +2 -0
- package/dist/{chunk-6LJHXREW.js → chunk-RXINFVBN.js} +2 -2
- package/dist/{chunk-YWYFU2V3.js → chunk-S2MRVIJ5.js} +2 -2
- package/dist/chunk-SA3DPTHT.js +7 -0
- package/dist/chunk-SGTKURU6.js +52 -0
- package/dist/chunk-SQNHOOJ5.js +3 -0
- package/dist/chunk-T3AEVJBG.js +4 -0
- package/dist/{chunk-NOJAM5ZV.js → chunk-T4N2ZRVY.js} +2 -2
- package/dist/{chunk-JATUZIEH.js → chunk-TBCHRDAC.js} +2 -2
- package/dist/chunk-THB6AM3V.js +11 -0
- package/dist/{chunk-TQ5W2H3S.js → chunk-ULHLDOD6.js} +1 -1
- package/dist/chunk-UQ73QF5D.js +43 -0
- package/dist/chunk-UVPY3RUZ.js +2 -0
- package/dist/chunk-V5FGK3DZ.js +2 -0
- package/dist/{chunk-ZQDIXAF5.js → chunk-VB2EZZPA.js} +2 -2
- package/dist/{chunk-7TWLSZK5.js → chunk-WTY5FERW.js} +2 -2
- package/dist/chunk-WUOB4DHH.js +6 -0
- package/dist/chunk-XHMVZFA6.js +2 -0
- package/dist/chunk-XRUGSM76.js +10 -0
- package/dist/{chunk-BASVXNY3.js → chunk-XUCZ3RQ5.js} +2 -2
- package/dist/chunk-YFQIKYOP.js +2 -0
- package/dist/chunk-Z2LDWIJV.js +5 -0
- package/dist/chunk-ZNWWVYQL.js +3 -0
- package/dist/{chunk-FKCGBZAC.js → chunk-ZUUNREKS.js} +2 -2
- package/dist/cli.js +238 -216
- package/dist/{config-types-BDIWAYzr.d.ts → config-types-dvHOz0zU.d.ts} +4 -1
- package/dist/{db-Djj3Nqrb.d.ts → db-rMZO5JFK.d.ts} +1 -1
- package/dist/{health-D5J42g4D.d.ts → health-CtTIGh6H.d.ts} +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.js +2 -2
- 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 +2 -2
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- 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 +2 -2
- 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 +7 -4
- 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 +46 -17
- 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 +9 -9
- package/dist/reindex.d.ts +30 -4
- package/dist/reindex.js +19 -19
- package/dist/runtime.d.ts +4 -3
- package/dist/runtime.js +2 -2
- package/dist/{scip-cli-CnK9Va4O.d.ts → scip-cli-trnNvymv.d.ts} +1 -1
- package/docs/COMMAND_REFERENCE.md +1 -1
- package/docs/analyzer-inventory.md +8 -0
- package/docs/analyzer-validation-ledger.md +7 -0
- package/package.json +3 -1
- package/scripts/evidence-product-contract.mjs +197 -0
- package/dist/chunk-2KHTSEIL.js +0 -102
- package/dist/chunk-3VD3JMK2.js +0 -2
- package/dist/chunk-4UZO3XCV.js +0 -35
- package/dist/chunk-5GOLFJEO.js +0 -8
- package/dist/chunk-5OST6GYB.js +0 -2
- package/dist/chunk-65AU3HFZ.js +0 -2
- package/dist/chunk-6GN7FXCH.js +0 -2
- package/dist/chunk-6JRV4MY2.js +0 -23
- package/dist/chunk-6QSOCTZT.js +0 -18
- package/dist/chunk-72KY2ZFO.js +0 -2
- package/dist/chunk-7GO4EQF5.js +0 -2
- package/dist/chunk-7IVSJJZU.js +0 -7
- package/dist/chunk-A536TEU4.js +0 -3
- package/dist/chunk-AVWPHM2Q.js +0 -4
- package/dist/chunk-BSN22NRK.js +0 -9
- package/dist/chunk-C5CTSJ6X.js +0 -6
- package/dist/chunk-CO5GJRP7.js +0 -2
- package/dist/chunk-CW5YFOCP.js +0 -5
- package/dist/chunk-DS6QEB3G.js +0 -5
- package/dist/chunk-E35O7UCB.js +0 -2
- package/dist/chunk-EXDQ35NN.js +0 -2
- package/dist/chunk-FAYI6KZ5.js +0 -2
- package/dist/chunk-FG4NT6VY.js +0 -2
- package/dist/chunk-GQBMH2TQ.js +0 -2
- package/dist/chunk-GRJY65YT.js +0 -2
- package/dist/chunk-HF25DFSC.js +0 -3
- package/dist/chunk-HHN2B5KA.js +0 -2
- package/dist/chunk-JCLDUKT6.js +0 -38
- package/dist/chunk-JGN2ZFJR.js +0 -2
- package/dist/chunk-JM72FNGA.js +0 -2
- package/dist/chunk-KDFONWTW.js +0 -40
- package/dist/chunk-LPL4MA6R.js +0 -2
- package/dist/chunk-LZHUWKGD.js +0 -2
- package/dist/chunk-M4COR2H6.js +0 -2
- package/dist/chunk-O6ZH6C6Y.js +0 -2
- package/dist/chunk-OBGRLXWF.js +0 -3
- package/dist/chunk-OLTESY4K.js +0 -3
- package/dist/chunk-P4KYUPBD.js +0 -4
- package/dist/chunk-P5RYBRIO.js +0 -4
- package/dist/chunk-P7AL7Y37.js +0 -2
- package/dist/chunk-PFOCOG57.js +0 -2
- package/dist/chunk-QLAUCRDJ.js +0 -2
- package/dist/chunk-QPU7EXAW.js +0 -2
- package/dist/chunk-RVWSAMTT.js +0 -2
- package/dist/chunk-USPV3T5K.js +0 -2
- package/dist/chunk-VCQYSG2M.js +0 -10
- package/dist/chunk-VUKC6F77.js +0 -20
- package/dist/chunk-W2CBNBEL.js +0 -71
- package/dist/chunk-W6BVEKYC.js +0 -3
- package/dist/chunk-WUCEKFQC.js +0 -3
- package/dist/chunk-XUGQU7PM.js +0 -41
- package/dist/chunk-Y5NBHMQX.js +0 -2
- package/dist/chunk-YCOFCT4B.js +0 -2
- package/dist/chunk-YZA6PPZL.js +0 -3
package/dist/chunk-P7AL7Y37.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as oe}from"./chunk-FG4NT6VY.js";import{a as ne}from"./chunk-VOYOYC5T.js";import{a as te}from"./chunk-QPU7EXAW.js";import{a as ie}from"./chunk-LZHUWKGD.js";import{a as re}from"./chunk-HHN2B5KA.js";import{a as Z}from"./chunk-FAYI6KZ5.js";import{a as ee}from"./chunk-RVWSAMTT.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as J}from"./chunk-7IVSJJZU.js";import{a as X}from"./chunk-AVWPHM2Q.js";import{a as Q}from"./chunk-C2QSK7E7.js";import{d as Y}from"./chunk-CW5YFOCP.js";import{a as j}from"./chunk-O6ZH6C6Y.js";import{a as G}from"./chunk-WUCEKFQC.js";import{a as q}from"./chunk-M4COR2H6.js";import{a as W}from"./chunk-6QSOCTZT.js";import{a as T,b as U}from"./chunk-USPV3T5K.js";import{b as N}from"./chunk-65AU3HFZ.js";import{b as I,c as z}from"./chunk-BSN22NRK.js";import{a as K}from"./chunk-GQBMH2TQ.js";import{a as O}from"./chunk-QYB5P7GL.js";import{f as A,g as k}from"./chunk-C5CTSJ6X.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,scanLimit:t.candidateScanLimit}))}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,includePatternDeviations:!1}),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-P7AL7Y37.js.map
|
package/dist/chunk-PFOCOG57.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as d}from"./chunk-B75HZHUP.js";function u(e){let i=e.orderCandidates?[...e.candidates()].sort(e.orderCandidates):e.candidates(),a=d(i,e.scanLimit),r=e.prepare?.(a)??void 0,t=[];for(let s of a){let n=e.evaluate(s,r);n&&t.push(n)}return e.orderResults&&t.sort(e.orderResults),typeof e.limit=="number"?t.slice(0,e.limit):t}export{u as a};
|
|
2
|
-
//# sourceMappingURL=chunk-PFOCOG57.js.map
|
package/dist/chunk-QLAUCRDJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as D}from"./chunk-LZHUWKGD.js";import{a as F}from"./chunk-HHN2B5KA.js";import{a as f}from"./chunk-FAYI6KZ5.js";import{a as g}from"./chunk-RVWSAMTT.js";import{c as y}from"./chunk-CW5YFOCP.js";import{e as h}from"./chunk-BSN22NRK.js";import{d as p}from"./chunk-A536TEU4.js";var v=.7,R=.62,S=.45;function Y(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=h(i);if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let l=I(s,e);if(l.size===0)return{available:!0,windowCommits:e,findings:[]};let d=A(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:l}).map(r=>w(r,s,e)).filter(r=>r!==null);d.sort((r,c)=>(r.kind===c.kind?0:r.kind==="echo"?-1:1)||c.similarity-r.similarity||r.echoFile.localeCompare(c.echoFile)||r.echoSymbol.localeCompare(c.echoSymbol)||r.domain.localeCompare(c.domain));let b=d.slice(0,n).map(T);return{available:!0,windowCommits:e,findings:b,rootCauseGroups:N(b)}}function A(i,t){let e=K(t.limit),n=[...B(i,{scope:t.scope,minSimilarity:t.minSimilarity??v,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=p(i,{scope:t.scope});return a.react&&n.push(...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function B(i,t){return y(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function k(i,t){return u(i,t,{query:f,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:P(...e.evidenceBuckets(n)),sharedCallees:[]}))}function E(i,t){return u(i,t,{query:g,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}function L(i,t){return u(i,t,{query:F,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function x(i,t){return u(i,t,{query:D,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function I(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function w(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let l=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:l?i.symbolA:i.symbolB,echoFile:l?i.fileA:i.fileB,echoAgeCommits:(l?n:a)??0,establishedSymbol:l?i.symbolB:i.symbolA,establishedFile:l?i.fileB:i.fileA,establishedAgeCommits:l?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function T(i){let t=C(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function C(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??C(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:O(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let l of n.sharedEvidence)s.sharedEvidence.add(l)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function O(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function P(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{Y as a};
|
|
2
|
-
//# sourceMappingURL=chunk-QLAUCRDJ.js.map
|
package/dist/chunk-QPU7EXAW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as l}from"./chunk-HF25DFSC.js";function S(e,n={}){let{minComponentLines:o=300,minFileLines:t=800,minJsxTokens:r=80,minBehaviorTokens:a=40,limit:m=20,scope:c,scanLimit:p,filePattern:i}=n;return l(e,{scope:c,scanLimit:p}).filter(s=>s.kind==="component").filter(s=>!i||s.file.includes(i)||s.name.includes(i)).map(s=>g(s,{minComponentLines:o,minFileLines:t,minJsxTokens:r,minBehaviorTokens:a})).filter(s=>s!==null).sort((s,u)=>u.componentLines-s.componentLines||u.fileLines-s.fileLines||s.file.localeCompare(u.file)).slice(0,m)}function g(e,n){let o=[];e.loc>=n.minComponentLines&&o.push(`${e.loc} component line(s)`);let t=Math.max(80,Math.floor(n.minComponentLines/2));if(e.fileLines>=n.minFileLines&&e.loc>=t&&o.push(`${e.fileLines} file line(s)`),e.jsxTokens.size>=n.minJsxTokens&&o.push(`${e.jsxTokens.size} JSX structure token(s)`),e.behaviorTokens.size>=n.minBehaviorTokens&&o.push(`${e.behaviorTokens.size} behavior token(s)`),o.length===0)return null;let r=x(e),a=C(e,n,r),m=f(e),c=b(r,a,m);return{file:e.file,component:e.name,componentLines:e.loc,fileLines:e.fileLines,jsxTokens:e.jsxTokens.size,behaviorTokens:e.behaviorTokens.size,dominantPressure:r,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:R(c,m),reasons:o,loc:e.loc}}function x(e){let n=[{axis:"component",value:e.loc},{axis:"file",value:e.fileLines},{axis:"jsx-structure",value:e.jsxTokens.size*3},{axis:"hook-behavior",value:e.behaviorTokens.size*4}];return n.sort((o,t)=>t.value-o.value),n[0]?.axis??"component"}function C(e,n,o){let t=[];e.loc>=n.minComponentLines&&t.push("component");let r=Math.max(80,Math.floor(n.minComponentLines/2));return e.fileLines>=n.minFileLines&&e.loc>=r&&t.push("file"),e.jsxTokens.size>=n.minJsxTokens&&t.push("jsx-structure"),e.behaviorTokens.size>=n.minBehaviorTokens&&t.push("hook-behavior"),[...new Set(t.length>0?t:[o])]}function f(e){let n=e.file.split(/[\\/]+/).filter(Boolean),o=n.slice(0,-1).map(i=>i.toLowerCase()),t=(n.at(-1)??e.name).replace(/\.[^.]+$/,""),r=`${t} ${e.name}`.split(/[^A-Za-z0-9]+/).filter(Boolean).map(i=>i.toLowerCase()),a=o.findIndex(i=>v.has(i)),m=a>=0&&o.slice(a+1).some(i=>h.has(i)),c=d(t)||d(e.name);return/(?:Page|Route|Screen|View)$/.test(t)||/(?:Page|Route|Screen|View)$/.test(e.name)||r.some(i=>k.has(i))||a>=0&&!m&&!c?"route-page":"component"}function d(e){let n=e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return n.at(-1)&&L.has(n.at(-1))?!0:[...L].some(o=>e.endsWith(T(o)))}function b(e,n,o){return e==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":n.includes("hook-behavior")?"behavior-extraction":n.includes("jsx-structure")?"jsx-decomposition":n.includes("file")?"file-decomposition":e==="jsx-structure"?"jsx-decomposition":e==="file"&&!n.includes("component")?"file-decomposition":"component-decomposition"}function R(e,n){switch(e){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return n==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),L=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),v=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),k=new Set(["landing","page","route","screen","view"]);function T(e){return e.charAt(0).toUpperCase()+e.slice(1)}export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-QPU7EXAW.js.map
|
package/dist/chunk-RVWSAMTT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as p,b as H,c as d,d as u}from"./chunk-BZ53S4ZN.js";import{a as b}from"./chunk-3VD3JMK2.js";import{a as R,b as g}from"./chunk-YWOOQ4FF.js";import{e as v}from"./chunk-HF25DFSC.js";function F(e,r={}){let{minSimilarity:h=.45,minSharedBehaviors:c=6,limit:t=20,scope:n,scanLimit:a,filePattern:l,focusFiles:f}=r,i=v(e,{scope:n,minBehaviorTokens:Math.max(3,c),scanLimit:a}).map(s=>({file:s.file,component:s.name,tokens:s.behaviorTokens,profile:s}));return b({profiles:i,limit:t,filePattern:l,focusFiles:f,compare:(s,o)=>y(s,o,h,c),sort:(s,o)=>o.similarity-s.similarity||s.fileA.localeCompare(o.fileA)||s.componentA.localeCompare(o.componentA)||s.fileB.localeCompare(o.fileB)||s.componentB.localeCompare(o.componentB)})}function y(e,r,h,c){let t=R(e.tokens,r.tokens);if(t.size<c||!A(t))return null;let n=H(e.tokens,r.tokens);if(n<h)return null;let a=d(t,"hook:"),l=d(t,"react-hook:"),f=d(t,"effect:"),i=d(t,"state:"),s=d(t,"request:"),o=d(t,"handler:"),k=d(t,"handler-verb:"),m=B({sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k});return{fileA:e.file,componentA:e.component,fileB:r.file,componentB:r.component,similarity:n,sharedTokens:u(t),sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:u(g(e.tokens,r.tokens)).slice(0,25),uniqueToB:u(g(r.tokens,e.tokens)).slice(0,25),reason:E({sharedHooks:a,sharedReactHooks:l,sharedEffects:f,sharedState:i,sharedRequests:s,sharedHandlers:o,sharedHandlerVerbs:k}),locA:e.profile.loc,locB:r.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 r=0,h=0,c=0,t=0,n=0,a=0,l=0;for(let s of e)s.startsWith("hook:")?r+=1:s.startsWith("react-hook:")?h+=1:s.startsWith("effect:")?c+=1:s.startsWith("request:")?t+=1:s.startsWith("handler:")||s.startsWith("handler-verb:")?n+=1:s.startsWith("state:")?a+=1:s.startsWith("state-hook:")&&(l+=1);let f=a+l,i=r+h+c+t+n+f;return t>=1&&i>=4||r>=1&&(t>=1||a>=1||n>=2)&&i>=5||a>=1&&n>=2&&(c>=1||h>=2)&&i>=5}function E(e){let r=[];return e.sharedHooks.length&&r.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&r.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&r.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&r.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&r.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&r.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&r.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),r.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{F as a};
|
|
2
|
-
//# sourceMappingURL=chunk-RVWSAMTT.js.map
|
package/dist/chunk-USPV3T5K.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as re}from"./chunk-B75HZHUP.js";import{a as I}from"./chunk-5OST6GYB.js";import{b as Z,e as J,f as q,g as $}from"./chunk-C5CTSJ6X.js";import{a as ne}from"./chunk-RNM6LMCF.js";import{c as X,d as Q,e as Y,f as w,l as te}from"./chunk-KDFONWTW.js";import{e as ee}from"./chunk-OLTESY4K.js";import{b as p}from"./chunk-TQ5W2H3S.js";import{b as B}from"./chunk-P5RYBRIO.js";import{h as G,o as R}from"./chunk-2KHTSEIL.js";import{c as W,f as H,g as z,h as U,i as K,j as V}from"./chunk-JM72FNGA.js";import{a as j,d as L}from"./chunk-HF25DFSC.js";import{a as D}from"./chunk-DS6QEB3G.js";import{b as A,d as M,e as O}from"./chunk-XUGQU7PM.js";import{a as S}from"./chunk-64MNV6AB.js";import{b as v}from"./chunk-7S5E7KWT.js";var x=new WeakMap;function se(e,t){let n=j(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=D(e,t);if(!r)return[];let s=A(e,t,r),a=M(e,"definition-exclusions",t,s);if(a){let c=Ee(a);if(c)return c}let u=n==="rust"?Ne(e,t):Le(e,t);return O(e,"definition-exclusions",t,s,JSON.stringify(u)),u}function Ee(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(Ce)?null:t}catch{return null}}function Ce(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"?!1:t.containerName===void 0||typeof t.containerName=="string"}var oe=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),ve=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,De=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Le(e,t){let n=D(e,t);if(!n||!we(n))return[];let i=L(e,t);if(!i)return[];let r=x.get(i);if(r)return r;let s=!1,a=i.rootNode;for(let c of a.namedChildren){if(c.type!=="expression_statement")continue;let d=c.namedChild(0);if(!d||d.type!=="call_expression")continue;let o=d.namedChild(0);if(!o)continue;let l=o.type==="member_expression"?o.namedChild(o.namedChildCount-1)?.text:o.text;if(l&&oe.has(l)){s=!0;break}}let u=[];s&&u.push({startLine:0,endLine:a.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let c of a.namedChildren){let d=null,o=null;if(c.type==="function_declaration")d=c.namedChild(0)?.text??null,o=c;else if(c.type==="export_statement"){let l=c.namedChild(0);l?.type==="function_declaration"&&(d=l.namedChild(0)?.text??null,o=l)}else if(c.type==="lexical_declaration"){let l=c.namedChild(0);if(l?.type==="variable_declarator"){let m=l.namedChild(0)?.text,y=l.namedChild(1);m&&(y?.type==="arrow_function"||y?.type==="function_expression")&&(d=m,o=l)}}d&&/^use[A-Z]/.test(d)&&o&&u.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"React custom hook (use*)"})}return u.push(...ae(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),x.set(i,u),u}function we(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of oe)if(e.includes(n)){t=!0;break}return t&&ve.test(e)?!0:e.includes("use")&&De.test(e)}var Ie=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Pe(e){return Ie.test(e)}function ae(e,t,n){let i=[],r=s=>{if(t.has(s.type)&&s.parent){let u=s.parent.children,c=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===s.startIndex&&u[d].type===s.type){c=d;break}if(c>0)for(let d=c-1;d>=0;d-=1){let o=u[d];if(n.has(o.type)){if(Pe(o.text)){i.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(o.type==="attribute_item"||o.type==="inner_attribute_item"))break}}for(let a of s.namedChildren)r(a)};return r(e.rootNode),i}function Ne(e,t){let n=L(e,t);if(!n)return[];let i=x.get(n);if(i)return i;let r=[],s=ke(n);return s?(x.set(n,s),s):(ce(n.rootNode,r,!1,!1),r.push(...ae(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...We(n.rootNode)),x.set(n,r),r)}function ke(e){return He(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function ce(e,t,n,i){let r=n,s=i;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(s=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?Fe(e,t,n,i):i&&Be(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?Te(e,t,n):e.type==="mod_item"&&P(e).some(a=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(a))&&(r=!0);for(let a of e.namedChildren)ce(a,t,r,s)}function Fe(e,t,n,i){let r=P(e),s=null;i?s="trait impl method (dynamic dispatch)":n&&(s="inside #[cfg(test)] mod");for(let a of r){let u=Me(a);if(u){s=u;break}if(le(a)){s="#[allow(dead_code)]";break}}s&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:s})}function Te(e,t,n){let i=P(e),r=e.namedChildren.find(s=>s.type==="type_identifier")?.text;i.some(je)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),i.some(le)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function P(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let s=0;s<n.length;s+=1)if(n[s].startIndex===e.startIndex&&n[s].type===e.type){i=s;break}if(i<=0)return[];let r=[];for(let s=i-1;s>=0;s-=1){let a=n[s];if(a.type==="attribute_item"||a.type==="inner_attribute_item")r.push(a.text);else{if(a.type==="line_comment"||a.type==="block_comment")continue;break}}return r}var Ae=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function Me(e){return Ae.find(({re:t})=>t.test(e))?.reason??null}var Oe=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function je(e){return/#\[\s*derive\s*\(/.test(e)?Oe.some(t=>t.test(e)):!1}function le(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Be(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function We(e){let t=Ue(e);if(t.size===0)return[];let n=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&t.has(r)&&n.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return n}function He(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var ze=/^#!?\[\s*serde\s*\(/,ie=/\bwith\s*=\s*"([^"]+)"/g;function Ue(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!ze.test(n.text))continue;ie.lastIndex=0;let i;for(;(i=ie.exec(n.text))!==null;){let r=i[1],s=r.split("::").pop()??r;s&&t.add(s)}}return t}function ue(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let s=se(e,i);return r={ranges:s.map(a=>({startLine:a.startLine,endLine:a.endLine})),containers:new Set(s.map(a=>a.containerName).filter(a=>!!a))},t.set(i,r),r};return(i,r,s,a)=>{let u=n(i);for(let c of u.ranges)if(r>=c.startLine&&r<=c.endLine)return!0;if(a&&u.containers.has(a))return!0;for(let c of R(s))if(u.containers.has(c))return!0;return!1}}function mt(e,t={}){v(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function de(e,t,n={}){v(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function me(e,t){return t.isIgnoredPath(e.relativePath)?b("ignored-file"):U(e.symbol)?b("module-like-symbol"):fe(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&fe(e.enclosingSymbol)?b("nested-non-callable-value"):!t.includeTests&&!N(e.relativePath)?b("test-file"):!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?b("excluded-file-region"):K(e.symbol)?b("rust-trait-impl-member"):V(e.symbol)?b("rust-test-module"):!t.includeMembers&&!Ke(e)?b("member"):e.endLine-e.startLine+1<t.minLoc?b("below-min-loc"):{accepted:!0}:b("non-value-symbol")}function N(e){return Z(e)!=="test"}function b(e){return{accepted:!1,rejectionReason:e}}function fe(e){return z(e)||e.endsWith("().")||e.endsWith(".")}function Ke(e){return H(e.symbol)||R(e.symbol).length===0}function pe(){return new Map}function be(e,t,n){let i=new Map;for(let r of X(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||E(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function ye(e,t,n){let i=new Set;for(let r of Q(e,t))e.isIgnored(r.relative_path)||n.has(r.relative_path)||i.add(r.symbol_id);return i}function k(e,t){let n=e.get(t);if(!n)return!1;for(let i of n.values())if(i.occurrences>0)return!0;return!1}function _(e,t,n){let i=e.get(t);if(!i)return!1;for(let[r,s]of i)if(r!==n&&s.occurrences>0)return!0;return!1}function ge(e){return e?.occurrences??0}function E(e,t,n,i,r="source-fallback"){if(i<=0)return;let s=xe(e,t,n);s.occurrences+=i,s.sources.add(r)}function he(e,t,n,i,r){if(i<=0)return;let s=xe(e,t,n);s.occurrences=Math.max(i,s.occurrences),s.sources.add(r)}function xe(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r={occurrences:0,sources:new Set},i.set(n,r)),r}var Ve=3e3,Ze=1e3;function jt(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:s=!1,includeMembers:a=!1,deadCodeOnly:u=!1,scanLimit:c,semantic:d=!0}=t,o=0,l=p("dead.candidates",()=>{let f=re(Je(e,{scope:n,minLoc:i,includeTests:r,includeMembers:a}),c);return o=f.length,f},()=>({definitions:o})),m=s?new Set(J(e)):new Set,y=0,g=u?pe():p("dead.mention-reference-counts",()=>{let f=be(e,m,l.map(C=>C.symbolId));return y=f.size,f},()=>({definitions:l.length,symbolsWithReferences:y})),F=0,Re=u?p("dead.mentioned-symbol-ids",()=>{let f=ye(e,l.map(C=>C.symbolId),m);return F=f.size,f},()=>({definitions:l.length,referencedSymbols:F})):new Set,h=u?l.filter(f=>!Re.has(f.symbolId)):l.filter(f=>!_(g,f.symbolId,f.relativePath));u?p("dead.source-fallback.dead-code-only",()=>Qe(e,h,g,m),()=>({definitions:h.length})):p("dead.source-fallback.ast",()=>Xe(e,h,g,m),()=>({definitions:h.length}));let T=u?h.filter(f=>!k(g,f.symbolId)):h.filter(f=>!_(g,f.symbolId,f.relativePath));p("dead.caller-map-supplement",()=>rt(e,T,g,{includeTests:r,inactiveBarrelPaths:m,includeSemantic:!u&&d}),()=>({definitions:T.length,semantic:!u&&d}));let _e=u?h.filter(f=>!k(g,f.symbolId)):l;return Ge(e,qe(_e,g))}function Je(e,t){let n=ue(e),i=[];for(let r of G(e,t.scope))me(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:a=>e.isIgnored(a),isExcludedRegion:n}).accepted&&i.push(r);return i}function qe(e,t){return e.map(n=>$e(n,t)).filter(n=>n.cross_file_refs===0).sort((n,i)=>i.loc-n.loc||n.relative_path.localeCompare(i.relative_path)||n.start_line-i.start_line)}function $e(e,t){let n=t.get(e.symbolId)??new Map,i=ge(n.get(e.relativePath)),r=0;for(let[s,a]of n)s!==e.relativePath&&(r+=a.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:i,cross_file_refs:r}}function Ge(e,t){let n=[],i=0,r=0,s=0;for(let a of t){if(e.isIgnored(a.relative_path)||q(e,a.relative_path)||$(e,a.symbol,a.relative_path))continue;let u=a.same_file_refs===0?"dead-code":"file-internal";u==="dead-code"?i++:r++,s+=a.loc,n.push({relativePath:a.relative_path,startLine:a.start_line,endLine:a.end_line,loc:a.loc,symbol:a.symbol,shortName:W(a.symbol),sameFileRefs:a.same_file_refs,kind:u})}return{symbols:n,counts:{total:n.length,deadCode:i,fileInternal:r,loc:s},totalCount:n.length,deadCodeCount:i,fileInternalCount:r,totalLoc:s}}function Xe(e,t,n,i){if(t.length===0)return;let r=new I(e),s=new Set(t.map(c=>c.symbolId)),a=new Set(t.map(c=>c.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let c of S(e))u.add(c);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:a,skipPath:c=>i.has(c)},c=>{s.has(c.target.symbolId)&&(tt(e,c)||E(n,c.target.symbolId,c.sourceFile,nt(c),"source-fallback"))})}function Qe(e,t,n,i){if(t.length===0)return;let r=new I(e),s=Ye(t),a=new Set(r.sourceFiles());for(let o of S(e))a.add(o);let u=new Set(s.keys()),c=new Map,d=o=>{let l=c.get(o);return l||(l=te(e,o),c.set(o,l)),l};r.scanSourceReferences({paths:a,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:o=>i.has(o),resolveTargets:({sourceFile:o,name:l,kind:m})=>{let y=s.get(l);return y?et(o,l,y,()=>d(o),{permissive:m!=="cross-language-dispatch"}):[]},afterPath:o=>{c.delete(o),de(e,o)}},o=>{let l=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&Se(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:l})||E(n,o.target.symbolId,o.sourceFile,l,"source-fallback")})}function Ye(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let i=t.get(n.leaf)??[];i.push(n),t.set(n.leaf,i)}return t}function et(e,t,n,i,r){let s=n.filter(d=>d.relativePath===e);if(s.length>0)return s;if(!r.permissive&&n.length===1)return[...n];let a=i(),u=a.get(t);if(u)for(let d of u){let o=n.filter(l=>w(d,l.relativePath));if(o.length>0)return o}let c=new Set;for(let d of a.values())for(let o of d)c.add(o);for(let d of c){let o=n.filter(l=>w(d,l.relativePath));if(o.length>0&&o.length===n.length)return o}return r.permissive?[...n]:[]}function tt(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Se(e,t)}function nt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Se(e,t){return t.occurrences>1?!1:B(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function rt(e,t,n,i){let r=i.includeSemantic!==!1,s=r&&t.length>=Ve&&S(e).length>=Ze,a=(o,l)=>{l===o.relativePath||e.isIgnored(l)||i.inactiveBarrelPaths.has(l)||!i.includeTests&&!N(l)||he(n,o.symbolId,l,1,"caller-map")};if(s?p("dead.caller-map.mention-chunks",()=>it(e,t,a),()=>({definitions:t.length})):p("dead.caller-map.per-symbol",()=>{for(let o of t){let l=ne(e,o,{semantic:r});if(l.length!==0)for(let m of l)a(o,m.file)}},()=>({definitions:t.length,semantic:r})),!s)return;let u=0,c=p("dead.caller-map.semantic-candidates",()=>{let o=t.filter(l=>!_(n,l.symbolId,l.relativePath));return u=o.length,o},()=>({definitions:t.length,semanticCandidates:u}));if(c.length===0)return;let d=ee(e,c);for(let o of c){let l=d.get(o.symbolId);if(l)for(let m of l)a(o,m)}}function it(e,t,n){let i=new Map(t.map(r=>[r.symbolId,r]));for(let r of Y(e,[...i.keys()])){let s=i.get(r.symbol_id);s&&n(s,r.relative_path)}}export{mt as a,jt as b};
|
|
2
|
-
//# sourceMappingURL=chunk-USPV3T5K.js.map
|
package/dist/chunk-VCQYSG2M.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as N}from"./chunk-RNM6LMCF.js";import{a as I,b as S}from"./chunk-TK7O5ER5.js";import{f as p,m as g}from"./chunk-2KHTSEIL.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
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
AND c.document_id != ?
|
|
8
|
-
${o.pathExclusionsFor("consumer_d")}
|
|
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-VCQYSG2M.js.map
|
package/dist/chunk-VUKC6F77.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{b as c}from"./chunk-P5RYBRIO.js";import{a}from"./chunk-64MNV6AB.js";import{c as d}from"./chunk-7S5E7KWT.js";var g=d("file-dep-graph",{clearGroups:["whole-project"]});function p(e,i){return g.get(e,i??"",()=>{let s=new Map,n=new Set(a(e,{includeIgnored:!1})),r=(t,o)=>f(e,s,n,t,o);for(let t of m(e,i))r(t.from_file,t.to_file);for(let t of n)if(!(i&&!t.includes(i)))for(let o of c(e,t))o.sourcePath&&r(t,o.sourcePath);return s})}function m(e,i){let s=i?`AND d1.relative_path LIKE '%${i}%'`:"";return e.all(`SELECT DISTINCT
|
|
2
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
AND m.role != 1
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${s}`)}function f(e,i,s,n,r){if(n===r||e.isIgnored(n)||e.isIgnored(r)||!s.has(r))return;let t=i.get(n);t||(t=new Set,i.set(n,t)),t.add(r)}export{p as a};
|
|
20
|
-
//# sourceMappingURL=chunk-VUKC6F77.js.map
|
package/dist/chunk-W2CBNBEL.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import Ge from"better-sqlite3";import{existsSync as Wt,readFileSync as Ht,writeFileSync as Kt}from"fs";import{dirname as Bt,join as Jt,resolve as Ue}from"path";import oe from"better-sqlite3";import{execFileSync as ie}from"child_process";import{existsSync as se,readdirSync as ae,readFileSync as ue}from"fs";import{extname as m,join as F}from"path";import B from"ignore";import{readFileSync as J,existsSync as b}from"fs";import{dirname as S,isAbsolute as x,join as h,relative as z,resolve as q}from"path";function C(e){let t=B(),r=!1,n=Y(e);for(let i of n)try{let o=J(i,"utf-8");t.add(o),r=!0}catch{}return r||t.add(Q),{isIgnored:i=>V(t,e,i),filter:i=>i.filter(o=>!V(t,e,o))}}function Y(e){let t=[],r=h(e,".gitignore");b(r)&&t.push(r);let n=S(e),i=0;for(;n!==S(n)&&i<5;){let o=h(n,".gitignore");if(b(o)&&t.push(o),b(h(n,".git")))break;n=S(n),i++}return t}var Q=`
|
|
2
|
-
# Dependencies
|
|
3
|
-
node_modules/
|
|
4
|
-
vendor/
|
|
5
|
-
.bundle/
|
|
6
|
-
|
|
7
|
-
# Build output
|
|
8
|
-
dist/
|
|
9
|
-
build/
|
|
10
|
-
out/
|
|
11
|
-
target/
|
|
12
|
-
bin/
|
|
13
|
-
obj/
|
|
14
|
-
|
|
15
|
-
# Python
|
|
16
|
-
__pycache__/
|
|
17
|
-
*.pyc
|
|
18
|
-
*.pyo
|
|
19
|
-
.venv/
|
|
20
|
-
venv/
|
|
21
|
-
.env/
|
|
22
|
-
env/
|
|
23
|
-
*.egg-info/
|
|
24
|
-
|
|
25
|
-
# Rust
|
|
26
|
-
target/
|
|
27
|
-
|
|
28
|
-
# Java / Kotlin / Scala
|
|
29
|
-
*.class
|
|
30
|
-
.gradle/
|
|
31
|
-
.mvn/
|
|
32
|
-
|
|
33
|
-
# C# / .NET
|
|
34
|
-
bin/
|
|
35
|
-
obj/
|
|
36
|
-
packages/
|
|
37
|
-
|
|
38
|
-
# Go
|
|
39
|
-
vendor/
|
|
40
|
-
|
|
41
|
-
# Dart
|
|
42
|
-
.dart_tool/
|
|
43
|
-
build/
|
|
44
|
-
|
|
45
|
-
# PHP
|
|
46
|
-
vendor/
|
|
47
|
-
|
|
48
|
-
# IDE / OS
|
|
49
|
-
.idea/
|
|
50
|
-
.vscode/
|
|
51
|
-
*.swp
|
|
52
|
-
*.swo
|
|
53
|
-
.DS_Store
|
|
54
|
-
Thumbs.db
|
|
55
|
-
|
|
56
|
-
# Type definitions (often noise in queries)
|
|
57
|
-
*.d.ts
|
|
58
|
-
`;function V(e,t,r){let n=Z(t,r);if(!n)return!1;try{return e.ignores(n)}catch{return!1}}function Z(e,t){if(!t||t===".")return null;if(!x(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=x(t)?t:q(e,t),n=z(e,r).replaceAll("\\","/");return!n||n==="."||n.startsWith("..")?null:n}import{readdirSync as ot}from"fs";import{execFileSync as st}from"child_process";import{extname as ut,join as ct}from"path";var ee=[];function k(e){e.groups.length>0&&ee.push(e)}function te(){let e=new WeakMap;return{cache:e,ensure(t){let r=e.get(t);return r||(r=new Map,e.set(t,r)),r}}}function T(e,t){let{cache:r,ensure:n}=te(),i={get(o,s,a){let u=n(o);if(u.has(s))return u.get(s);let c=a();return u.set(s,c),c},invalidate(o,s){r.get(o)?.delete(s)},invalidateAll(o){r.delete(o)},size(o){return r.get(o)?.size??0}};return k({name:e,groups:t.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,s)=>i.invalidate(o,s)}),i}var ne=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],E=[".vue"],L=[".tsx",".jsx"],D=[".vue"],gt=[...L,...D],dt=new Set(L),ft=new Set(D),re=new Set(ne.map(e=>e.toLowerCase())),pt=[...re].sort().join(","),I=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var mt=T("source-files",{clearGroups:[]});function Vt(e){let t=new Set((e.extensions??E).map(o=>o.toLowerCase()));if(t.size===0)return{scanned:0,inserted:0,existing:0};if(!se(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=C(e.projectRoot),n=ce(e.projectRoot,t).filter(o=>!r.isIgnored(o)),i=new oe(e.dbPath);try{let o=ge(i,n),s=i.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
59
|
-
VALUES (?, ?, NULL, ?)`),u=i.transaction(l=>{let p=0;for(let g of l){if(o.has(g))continue;let d=ue(F(e.projectRoot,g),"utf-8"),X=s.run(de(g),g,d);p+=Number(X.changes)}return p})(n),c={scanned:n.length,inserted:u,existing:n.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{i.close()}}function ce(e,t){let r=le(e,t);if(r)return r;let n=[],i=o=>{let s=o?F(e,o):e,a;try{a=ae(s,{withFileTypes:!0})}catch{return}for(let u of a){if(I.has(u.name))continue;let c=o?`${o}/${u.name}`:u.name;if(u.isDirectory()){i(c);continue}t.has(m(u.name).toLowerCase())&&n.push(c)}};return i(""),n.sort()}function le(e,t){try{return ie("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
|
|
60
|
-
`).filter(n=>n&&t.has(m(n).toLowerCase())).sort()}catch{return null}}function ge(e,t){let r=new Set,n=500;for(let i=0;i<t.length;i+=n){let o=t.slice(i,i+n),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${o.map(()=>"?").join(",")})`).all(...o);for(let a of s)r.add(a.relative_path)}return r}function de(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as fe}from"child_process";import{createHash as pe}from"crypto";import{readdirSync as me,readFileSync as be}from"fs";import{join as O}from"path";function w(e){return(he(e)??ye(e)).filter(t=>t&&!A(t)).sort()}function Dt(e,t={}){return(t.language?w(e).filter(n=>Se(n,t.language,t.markerFiles)):w(e)).map(n=>{let i=O(e,n);try{let o=be(i);return{path:n,size:o.byteLength,hash:pe("sha256").update(o).digest("hex")}}catch{return{path:n,size:-1,hash:"unreadable"}}})}function Se(e,t,r){let n=e.split("/").at(-1)??e;if(r?.includes(e)||r?.includes(n)||Re.has(n))return!0;let i=e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:"";return(xe[t]??[]).includes(i)}function he(e){try{return fe("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
|
|
61
|
-
`).filter(Boolean)}catch{return null}}function ye(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?O(e,n):e,o;try{o=me(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){A(a)||r.push(a);continue}t.push(a)}}return t}function A(e){return e.split("/").some(r=>ve.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var ve=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]),Re=new Set(["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lockb","tsconfig.json","tsconfig.base.json","pyproject.toml","setup.py","setup.cfg","Cargo.toml","Cargo.lock","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","build.sbt","compile_commands.json","CMakeLists.txt","Makefile","Gemfile","Gemfile.lock","composer.json","composer.lock","pubspec.yaml","pubspec.lock"]),xe={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"]};import{createRequire as Ve}from"module";import{existsSync as Ce,readFileSync as v}from"fs";import{dirname as N,extname as ke,join as _,relative as Te,resolve as At}from"path";import{pathToFileURL as Ee}from"url";function P(e,t){let{vueCore:r,ts:n,volarTs:i}=Le(e),{parsed:o,vueOptions:s}=De(r,n,t),a=N(t),u=r.createVueLanguagePlugin(n,o.options,s,d=>d),c=Ie(r,n,u),l=Fe(a,o),{languageServiceHost:p}=i.createLanguageServiceHost(n,n.sys,c,d=>d,l),g=n.createLanguageService(p);return{ts:n,language:c,languageService:g,fileNames:o.fileNames,configDir:a}}function Le(e){let t=Ve(Ee(_(e,"package.json")).href);return{vueCore:y(t,"@vue/language-core",e),ts:y(t,"typescript",e),volarTs:y(t,"@volar/typescript",e)}}function De(e,t,r){let n=t.readConfigFile(r,t.sys.readFile);if(n.error||!n.config)throw new Error(`Failed to read ${r}`);let o=e.createParsedCommandLine(t,t.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(o.globalTypesPath=e.createGlobalTypesWriter(o,t.sys.writeFile)),{parsed:t.parseJsonConfigFileContent(n.config,t.sys,N(r),void 0,r,void 0,e.getAllExtensions(o).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:t.ScriptKind.Deferred}))),vueOptions:o}}function Ie(e,t,r){let n={},i=e.createLanguage([r],new Map,o=>{if(!Ce(o))return;let s=v(o,"utf-8");n.current?.scripts.set(o,t.ScriptSnapshot.fromString(s),r.getLanguageId(o)??Ne(o))});return n.current=i,i}function Fe(e,t){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>t.options,getScriptFileNames:()=>t.fileNames,getProjectReferences:()=>t.projectReferences,getProjectVersion:()=>"0"}}function y(e,t,r){try{return e(t)}catch(n){throw(typeof n=="object"&&n!==null&&"code"in n?n.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${t} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:n}):n}}function j(e,t,r){let n=we(e);return i=>{let o=f(t,i.fileName),s=r.get(i.fileName);if(!s)return null;let a=r.positionAt(s,i.textSpan.start),u=n.get(o);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:Oe(u.starts,a.line,2)}}function we(e){let t=e.prepare(`
|
|
62
|
-
SELECT
|
|
63
|
-
d.relative_path AS relativePath,
|
|
64
|
-
der.start_line AS startLine,
|
|
65
|
-
der.end_line AS endLine,
|
|
66
|
-
der.symbol_id AS symbolId
|
|
67
|
-
FROM defn_enclosing_ranges der
|
|
68
|
-
JOIN documents d ON d.id = der.document_id
|
|
69
|
-
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
70
|
-
`).all(),r=new Map;for(let n of t){let i=r.get(n.relativePath);i||(i={containingByLine:new Map,starts:[]},r.set(n.relativePath,i)),i.starts.push({line:n.startLine,symbolId:n.symbolId});for(let o=n.startLine;o<=n.endLine;o++)i.containingByLine.set(o,n.symbolId)}for(let n of r.values())n.starts.sort((i,o)=>i.line-o.line);return r}function Oe(e,t,r){let n=0,i=e.length-1;for(;n<=i;){let s=Math.floor((n+i)/2);e[s].line<t?n=s+1:i=s-1}let o=null;for(let s of[i,n]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-t);u>r||(!o||u<o.distance)&&(o={distance:u,symbolId:a.symbolId})}return o?.symbolId??null}function M(e,t){let r=Pe(t),n=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),i=new Map;return{get(o){if(i.has(o))return i.get(o)??null;let s=je(n,r,t,o);return i.set(o,s),s}}}function G(e,t,r,n,i){if(e.fileName.endsWith(".vue")){let o=n.language.scripts.get(e.fileName),s=o?.generated?.languagePlugin.typescript?.getServiceScript(o.generated.root)?.code;if(o&&s){let a=n.language.maps.get(s,o);if(R(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(i)?r.get(e.fileName):null}return t(e)}function*U(e){let t=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),n;for(;n=t.exec(e);){let i=n[0];r.has(i)||(yield{text:i,start:n.index,end:n.index+i.length})}}function $(e,t){for(let[r]of e.toGeneratedLocation(t,n=>!!n.navigation))return r;return null}function R(e,t){let r=e;for(let[n]of r.toSourceLocation(t,i=>!!i.navigation))return n;return null}function Ae(e,t){let r=0,n=e.lineStarts.length-1;for(;r<=n;){let o=Math.floor((r+n)/2);e.lineStarts[o]<=t?r=o+1:n=o-1}let i=Math.max(0,n);return{line:i,character:t-e.lineStarts[i]}}function W(e,t){return f(e,t).startsWith("node_modules/")}function f(e,t){return Te(e,t).replaceAll("\\","/")}function Ne(e){switch(ke(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function H(){let e=new Map;return{get(t){if(e.has(t))return e.get(t)??null;try{let r=v(t,"utf-8"),n={text:r,lineStarts:_e(r)};return e.set(t,n),n}catch{return e.set(t,null),null}},positionAt:Ae}}function _e(e){let t=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&t.push(r+1);return t}function Pe(e){try{let t=JSON.parse(v(_(e,"package.json"),"utf-8"));return{name:t.name??"workspace",version:t.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function je(e,t,r,n){let i=f(r,n),o=Me(t.name,t.version,i);return e.get(o)?.id??null}function Me(e,t,r){let n=r.split("/").map(i=>`\`${i.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${t} ${n}/default.`}function qt(e){let t=Ue(e.projectRoot,e.tsconfig),r=new Ge(e.dbPath,{readonly:!0});try{let n=$e({db:r,projectRoot:e.projectRoot,configPath:t,vueSymbolLookup:M(r,e.projectRoot)});return We({vueFiles:e.vueFiles??[],tasks:e.tasks,...n})}finally{r.close()}}function $e(e){let t=H();return{projectRoot:e.projectRoot,context:P(e.projectRoot,e.configPath),symbolLookup:j(e.db,e.projectRoot,t),vueSymbolLookup:e.vueSymbolLookup,sourceReader:t}}function We(e){let t=[],r=0,n=e.tasks??e.vueFiles.map(i=>({fileName:i,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let i of n){let o=He(e,i);t.push(...o.occurrences),r+=o.skippedReferences}return{occurrences:t,skippedReferences:r}}function He(e,t){let r=e.context.language.scripts.get(t.fileName),n=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!n)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let i=e.sourceReader.get(t.fileName);if(!i)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let o=e.context.language.maps.get(n,r),s=f(e.projectRoot,t.fileName),a=[...U(i.text)],u={tokens:a.filter(c=>c.start>=t.startOffset&&c.start<t.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Be(a),processedStarts:new Set};return Ke({...e,fileName:t.fileName,sourceInfo:i,sourceFile:s,map:o,tokenContext:u})}function Ke(e){let t=[],r=0;for(let n of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(n.start))continue;let i=$(e.map,n.start);if(i===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,i+1)??[]).find(u=>!W(e.projectRoot,u.fileName));if(!s){r++;continue}let a=G(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}K(t,e.sourceReader,e.sourceInfo,e.sourceFile,n,a),e.tokenContext.processedStarts.add(n.start),Xe(t,e,n,i,a)}return{occurrences:t,skippedReferences:r}}function Xe(e,t,r,n,i){if(!((t.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let o of Je(t.context.languageService,t.fileName,n+1,t.map,r,t.tokenContext.tokenByStart)){if(t.tokenContext.processedStarts.has(o))continue;let s=t.tokenContext.tokenByStart.get(o);s&&(K(e,t.sourceReader,t.sourceInfo,t.sourceFile,s,i),t.tokenContext.processedStarts.add(o))}}function K(e,t,r,n,i,o){let s=t.positionAt(r,i.start);e.push({sourceFile:n,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+i.text.length,symbolId:o})}function Be(e){let t=new Map;for(let r of e)t.set(r.text,(t.get(r.text)??0)+1);return t}function Je(e,t,r,n,i,o){let s=e.getDocumentHighlights?.(t,r,[t])??[],a=[];for(let u of s)if(u.fileName===t)for(let c of u.highlightSpans){let l=ze(n,c.textSpan.start,o,i.text);l!==null&&a.push(l)}return a}function ze(e,t,r,n){let i=r.get(t);if(i?.text===n)return i.start;let o=R(e,t);if(o===null)return null;let s=r.get(o);return s?.text===n?s.start:null}export{Vt as a,Dt as b,qt as c};
|
|
71
|
-
//# sourceMappingURL=chunk-W2CBNBEL.js.map
|
package/dist/chunk-W6BVEKYC.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{q as d}from"./chunk-KDFONWTW.js";import{a as h}from"./chunk-TK7O5ER5.js";import{g}from"./chunk-JM72FNGA.js";import{a as m}from"./chunk-DS6QEB3G.js";import{a as p}from"./chunk-64MNV6AB.js";function _(t,r,n={}){let e=h(t,r);if(!e)return[];let l=!g(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=d(t,e,{semantic:n.semantic}).map(o=>({relativePath:o.file,line:o.line})),s=R(t,e),f=new Set,a=[];for(let o of[...l,...c,...s]){let u=`${o.relativePath}:${o.line}`;f.has(u)||(f.add(u),a.push(o))}return a}function R(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=b(r.symbol);if(n.length===0)return[];let e=[];for(let i of p(t,{extensions:[".rb"],includeIgnored:!1})){let l=m(t,i);if(!l)continue;let c=l.split(`
|
|
2
|
-
`);for(let s=0;s<c.length;s++){let f=c[s]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:s})}}return e}function b(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{_ as a};
|
|
3
|
-
//# sourceMappingURL=chunk-W6BVEKYC.js.map
|
package/dist/chunk-WUCEKFQC.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as P}from"./chunk-LM5SHAN4.js";import{a as x}from"./chunk-PFOCOG57.js";import{a as v}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-5OST6GYB.js";import{a as g,g as p}from"./chunk-C5CTSJ6X.js";import{a as h}from"./chunk-BGBBVSH4.js";import{c as l,d as m,g as u}from"./chunk-JM72FNGA.js";import{b as f}from"./chunk-72KY2ZFO.js";import{b as d}from"./chunk-DS6QEB3G.js";import{basename as y,extname as L}from"path";function X(n,e){let{scope:i,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new b(n);return x({candidates:()=>A(a,i,t),orderCandidates:v,scanLimit:s,prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>S(n,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function S(n,e,i){let t=R(i);if(t.size!==1||!f(n,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=I(n,e,o),a=T(n,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:D(r,s,a)}}function I(n,e,i){return P(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:y(e.relativePath,L(e.relativePath))},{label:"callee module",value:y(i.file,L(i.file))}])}function D(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(C);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return E(n,e)?g(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:p(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function E(n,e){let i=d(n,e.relativePath);if(i.length===0)return!1;let t=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
|
|
2
|
-
`);return j.test(t)?!0:w(i,m(e.symbol))}function w(n,e){if(!e)return!1;let i=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${F(e)}\\b`);return n.some(t=>i.test(t))}function C(n){return n.includes("public surface")}function F(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R(n){let e=n.some(t=>u(t.symbol))?n.filter(t=>u(t.symbol)):n,i=new Map;for(let t of e)i.has(t.symbol)||i.set(t.symbol,t);return i}function A(n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:3,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0})}var j=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function\b|(?:const|let|var)\b)/m;export{X as a};
|
|
3
|
-
//# sourceMappingURL=chunk-WUCEKFQC.js.map
|
package/dist/chunk-XUGQU7PM.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-7S5E7KWT.js";import{createHash as h}from"crypto";import{readFileSync as v}from"fs";import{dirname as g,join as f}from"path";import N from"better-sqlite3";var y="evidence.db",d=new WeakMap,m=p("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),L=p("evidence-project-fingerprint",{clearGroups:["whole-project"]}),c="evidence-v1",E="version NOT LIKE 'evidence-%'";function T(n){return h("sha256").update(n).digest("hex")}function A(n,t,e){return m.get(n,t,()=>T(e))}function O(n){return L.get(n,"current",()=>{try{let t=JSON.parse(v(f(g(n.config.dbPath),"meta.json"),"utf-8"));if(t.version!==2&&t.version!==3||t.status!=="complete"||t.fingerprint===void 0)return null;let e=Array.isArray(t.indexedLanguages)?[...t.indexedLanguages].sort():[];return T(JSON.stringify({fingerprint:t.fingerprint,indexedLanguages:e}))}catch(t){return u("project fingerprint unavailable",t),null}})}function u(n,t){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${n}: ${t instanceof Error?t.message:String(t)}`)}function s(n){if(d.has(n))return d.get(n)??null;let t=null;try{let e=new N(f(g(n.config.dbPath),y));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
3
|
-
kind TEXT NOT NULL,
|
|
4
|
-
relative_path TEXT NOT NULL,
|
|
5
|
-
content_hash TEXT NOT NULL,
|
|
6
|
-
version TEXT NOT NULL,
|
|
7
|
-
payload TEXT NOT NULL,
|
|
8
|
-
PRIMARY KEY (kind, relative_path)
|
|
9
|
-
);
|
|
10
|
-
CREATE TABLE IF NOT EXISTS semantic_callees (
|
|
11
|
-
relative_path TEXT NOT NULL,
|
|
12
|
-
symbol TEXT NOT NULL,
|
|
13
|
-
content_hash TEXT NOT NULL,
|
|
14
|
-
deps_digest TEXT NOT NULL,
|
|
15
|
-
version TEXT NOT NULL,
|
|
16
|
-
payload TEXT NOT NULL,
|
|
17
|
-
PRIMARY KEY (relative_path, symbol)
|
|
18
|
-
);
|
|
19
|
-
CREATE TABLE IF NOT EXISTS semantic_references (
|
|
20
|
-
relative_path TEXT NOT NULL,
|
|
21
|
-
symbol TEXT NOT NULL,
|
|
22
|
-
project_fingerprint TEXT NOT NULL,
|
|
23
|
-
version TEXT NOT NULL,
|
|
24
|
-
payload TEXT NOT NULL,
|
|
25
|
-
PRIMARY KEY (relative_path, symbol)
|
|
26
|
-
);
|
|
27
|
-
`),t={evidence:e,readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.prepare(`SELECT payload FROM file_evidence
|
|
28
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${E}
|
|
29
|
-
ORDER BY version DESC
|
|
30
|
-
LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
|
|
31
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.prepare(`SELECT payload FROM semantic_callees
|
|
32
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${E}
|
|
33
|
-
ORDER BY version DESC
|
|
34
|
-
LIMIT 1`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
35
|
-
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
|
|
36
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.prepare(`SELECT payload FROM semantic_references
|
|
37
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${E}
|
|
38
|
-
ORDER BY version DESC
|
|
39
|
-
LIMIT 1`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
40
|
-
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE project_fingerprint != ?")}}catch(e){u("disabled (open failed)",e)}return d.set(n,t),t}function o(n,t,e){u(`disabled (${t})`,e),d.set(n,null)}function b(n,t,e,a){let r=s(n);if(!r)return null;try{return(r.readFileEvidence.get(t,e,a,c)??r.readLegacyFileEvidence.get(t,e,a))?.payload??null}catch(i){return o(n,"file_evidence read",i),null}}function w(n,t,e,a,r){let i=s(n);if(i)try{i.writeFileEvidence.run(t,e,a,c,r)}catch(l){o(n,"file_evidence write",l)}}function F(n,t,e,a,r){let i=s(n);if(!i)return null;try{return(i.readCallees.get(t,e,a,r,c)??i.readLegacyCallees.get(t,e,a,r))?.payload??null}catch(l){return o(n,"semantic_callees read",l),null}}function I(n,t,e,a){let r=s(n);if(!r)return null;try{return(r.readReferences.get(t,e,a,c)??r.readLegacyReferences.get(t,e,a))?.payload??null}catch(i){return o(n,"semantic_references read",i),null}}function x(n,t){if(t.length===0)return;let e=s(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t){let i=`${r.relativePath}\0${r.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(r.relativePath,r.contentHash)),e.writeCallees.run(r.relativePath,r.symbol,r.contentHash,r.depsDigest,c,r.payload)}})()}catch(a){o(n,"semantic_callees write",a)}}function U(n,t){if(t.length===0)return;let e=s(n);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let r of t)a.has(r.projectFingerprint)||(a.add(r.projectFingerprint),e.dropStaleReferences.run(r.projectFingerprint)),e.writeReferences.run(r.relativePath,r.symbol,r.projectFingerprint,c,r.payload)})()}catch(a){o(n,"semantic_references write",a)}}function j(n){return typeof n=="object"&&n!==null}function X(n){return Array.isArray(n)&&n.every(t=>typeof t=="string")?n:null}export{T as a,A as b,O as c,b as d,w as e,F as f,I as g,x as h,U as i,j,X as k};
|
|
41
|
-
//# sourceMappingURL=chunk-XUGQU7PM.js.map
|
package/dist/chunk-Y5NBHMQX.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as D}from"./chunk-5OST6GYB.js";import{p as A}from"./chunk-KDFONWTW.js";import{b as d,d as h,f as y}from"./chunk-OLTESY4K.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-Y5NBHMQX.js.map
|
package/dist/chunk-YCOFCT4B.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-5OST6GYB.js";import{a as l}from"./chunk-TK7O5ER5.js";import{d as o,f as a}from"./chunk-JM72FNGA.js";import{basename as d}from"path";function M(t,c){let n=l(t,c);if(!n)return[];let r=o(n.symbol),s=new m(t).definitionsForFile(n.relativePath).filter(e=>a(e.symbol)),i=s.filter(e=>e.parentTypeName===r||e.symbol.includes(r));return(i.length>0?i:p(d(n.relativePath))===r?s.filter(e=>e.symbol.includes("<invalid-global-code>")):[]).map(e=>({startLine:e.startLine,endLine:e.endLine,name:o(e.symbol)}))}function p(t){return t.replace(/\.[^.]+$/,"")}export{M as a};
|
|
2
|
-
//# sourceMappingURL=chunk-YCOFCT4B.js.map
|
package/dist/chunk-YZA6PPZL.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as v,e as F,f as L,h as g,i as V}from"./chunk-DS6QEB3G.js";import{c as N}from"./chunk-A536TEU4.js";import{e as b}from"./chunk-7S5E7KWT.js";import{ElementTypes as M,NodeTypes as A,parse as Z}from"@vue/compiler-dom";import{parse as Ee}from"@vue/compiler-sfc";function P(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var W=b("vue-template-facts"),H=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),G=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Y=new Set(["div","span","template"]),K=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function w(e,t){let n=t.replace(/\\/g,"/"),r=v(e,n);return W.get(e,n,r,()=>J(n,L(e,n).template))}function J(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=Z(t.body,{comments:!1})}catch{return n}let i=new Set,o=s=>{s.trim()&&i.add(s)};return B(r.children,t.startLine,n,o),n.structuralTokens=[...i].sort(),n}function B(e,t,n,r){for(let i of e)i.type===A.ELEMENT&&(Q(i,t,n,r),B(i.children,t,n,r))}function Q(e,t,n,r){let i=se(e.tag),o={tag:e.tag,normalized:i,kind:oe(e),startLine:h(t,e.loc.start.line),endLine:h(t,e.loc.end.line)};o.kind==="component"?(n.componentTags.push(o),r(`component:${i}`)):o.kind==="builtin"?(n.builtinTags.push(o),r(`builtin:${i}`)):(n.nativeTags.push(o),Y.has(e.tag)||r(`native:${e.tag}`));for(let s of e.props)X(s,t,n,r)}function X(e,t,n,r){if(e.type===A.ATTRIBUTE){let a=e.value?.content??null,u=_("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(u),r(`prop:${e.name}`);return}let i=te(e),o=E(e.exp),s=_(ee(e.name),i,o,t,e.loc.start.line,e.loc.end.line);switch(s.kind){case"prop":n.props.push(s),r(`prop:${i}`);break;case"event":n.events.push(s),r(`event:${i}`);break;case"slot":n.slots.push(s),r(`slot:${i}`);break;case"directive":n.directives.push(s),r(`directive:${i}`);break}o&&ne(o,t,e.loc.start.line,n,r)}function _(e,t,n,r,i,o){return{kind:e,name:t,value:n,startLine:h(r,i),endLine:h(r,o)}}function ee(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function te(e){let t=E(e.arg);return t||e.name}function E(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function ne(e,t,n,r,i){for(let o of re(e)){let s={name:o,startLine:h(t,n),endLine:h(t,n)};r.expressionIdentifiers.push(s),i(`id:${o}`)}}function re(e){let t=new Set,n=ie(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,i;for(;i=r.exec(n);){let o=i[0];K.has(o)||/^[A-Z_]+$/.test(o)||t.add(o)}return[...t].sort()}function ie(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function oe(e){let t=e.tag;return e.tagType===M.COMPONENT?"component":H.has(t)?"builtin":G.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function se(e){return P(e,/[-_:]/)}function h(e,t){return e+Math.max(0,t-1)}function S(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var ae=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function z(e,t){let n=ue(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:I(n.functionNode),params:$(n.functionNode),paramsEndLine:k(n.functionNode),isLiteralPassthrough:R(n.functionNode,t)};if(!ce(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(i=>i.type==="identifier"||i.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:I(e),params:$(e),paramsEndLine:k(e),isLiteralPassthrough:R(e,t)}:null}function U(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function $(e){let t=U(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(S(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let i=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),o=r.childForFieldName("pattern");if(!i&&o&&o.type==="identifier"){n.push({name:o.text,simple:!0});continue}let s=r.namedChildren.find(a=>a.type==="identifier");n.push({name:o?.type==="identifier"?o.text:s?.text??"",simple:!1})}return n}function k(e){let t=U(e);return t?t.endPosition.row:e.startPosition.row}function ce(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?ae.has(e):!1}function ue(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}return null}function I(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)S(r)||(n+=1);return n}function R(e,t){let n=e.namedChildren.find(c=>c.type==="block"||c.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(c=>!S(c));if(r.length!==1)return!1;let i=r[0],o=null;if(i.type==="return_statement"||i.type==="expression_statement"?o=i.namedChild(0)??null:t==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(o=i),!o)return!1;let s=t==="python"?"call":"call_expression";if(o.type!==s)return!1;let a=o.namedChildren.find(c=>c.type==="arguments"||c.type==="argument_list");if(!a)return!1;let u=a.namedChildren.filter(c=>!S(c)),l=e.namedChildren.find(c=>c.type==="parameters"||c.type==="formal_parameters");if(!l)return!1;let m=[];for(let c of l.namedChildren){if(c.type==="identifier"){m.push(c.text);continue}let f=c.namedChildren.find(T=>T.type==="identifier");f&&m.push(f.text)}if(u.length!==m.length)return!1;for(let c=0;c<m.length;c+=1){let f=u[c];if(f.type!=="identifier"||f.text!==m[c])return!1}return!0}var le=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),pe=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),me=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),fe=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),de=new Set(["catch","for","function","if","return","switch","while"]);function D(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=g(n),n.external&&(t.externalLineCount+=g(n),t.externalScriptPaths.push(n.sourcePath));for(let i of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:i});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...Se(n));let r=F(n.astLanguage,n.body);r?he(n,r.rootNode,t):ye(n,t)}return ge(t),t.externalScriptPaths=j(t.externalScriptPaths),t}function ge(e){e.composables=y(e,"composable"),e.stores=y(e,"store"),e.reactivity=y(e,"reactivity"),e.lifecycle=y(e,"lifecycle"),e.requests=y(e,"request"),e.macros=y(e,"macro")}function y(e,t){return j(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function he(e,t,n){let r=new Set,i=new Set,o=s=>{let a=z(s,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;i.has(l)||(i.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let u=V(s,e.astLanguage);if(u){let l=`${u.calleeLeaf}:${u.line}`;r.has(l)||(r.add(l),n.calls.push({name:u.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+u.line,categories:O(u.calleeLeaf),setup:e.setup}))}for(let l of s.children)o(l)};o(t)}function ye(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||de.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+x(e.body,n.index??0),categories:O(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let i=e.startLine+x(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let i=e.startLine+x(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}}function Se(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),i=n[2];if(!r||!i)continue;let o=e.startLine+x(e.body,n.index??0);for(let s of be(r))t.push({local:s,source:i,sourcePath:e.sourcePath,line:o,setup:e.setup})}return t}function be(e){let t=[],r=e.split(",").map(s=>s.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let i=/\{([^}]*)\}/.exec(e)?.[1];if(i)for(let s of i.split(",")){let a=s.trim();if(!a)continue;let u=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(u??a.replace(/^type\s+/,"").trim())}let o=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return o&&t.push(o),t.filter(s=>/^[A-Za-z_$][\w$]*$/.test(s))}function O(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),le.has(e)&&t.push("reactivity"),pe.has(e)&&t.push("lifecycle"),me.has(e)&&t.push("request"),fe.has(e)&&t.push("macro"),t}function x(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function j(e){return[...new Set(e)].sort()}var ve=new Set(["in","key","of"]),Le=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),xe=b("vue-component-behavior-profiles");function Xe(e,t={}){let n=N(e,{extensions:[".vue"]}).filter(i=>!t.scope||i.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(i=>Te(e,i)).filter(i=>(t.minTemplateTokens===void 0||i.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||i.behaviorTokens.size>=t.minBehaviorTokens))}function Te(e,t){let n=t.replace(/\\/g,"/"),r=v(e,n),i=xe.get(e,n,r,()=>Ce(e,n,r));return Fe(i)}function Ce(e,t,n){let r=L(e,t),i=w(e,t),o=D(r),s=Pe(i),a=i.expressionIdentifiers.map(p=>p.name).filter(p=>!s.includes(p)).filter((p,d,C)=>C.indexOf(p)===d).sort(),u=i.componentTags.map(p=>p.normalized).filter((p,d,C)=>C.indexOf(p)===d).sort(),l=n?n.split(`
|
|
2
|
-
`).length:0,m=g(r.template),c=o.lineCount,f=r.styles.reduce((p,d)=>p+g(d),0),T=r.customBlocks.reduce((p,d)=>p+g(d),0);return{file:t,sfc:r,templateFacts:i,scriptFacts:o,templateTokens:new Set(i.structuralTokens),behaviorTokens:Ne(i,o,a),templateBindingNames:a,templateLocalNames:s,componentNames:u,sfcLines:l,totalLines:l+o.externalLineCount,templateLines:m,scriptLines:c,styleLines:f,externalScriptLines:o.externalLineCount,externalScriptPaths:o.externalScriptPaths,customBlockLines:T}}function Fe(e){let t=Ve(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths}}function Ve(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function Ne(e,t,n){let r=new Set;for(let i of t.composables)r.add(`composable:${i}`);for(let i of t.stores)r.add(`store:${i}`);for(let i of t.reactivity)r.add(`reactivity:${i}`);for(let i of t.lifecycle)r.add(`lifecycle:${i}`);for(let i of t.requests)r.add(`request:${i}`);for(let i of t.macros)r.add(`macro:${i}`);for(let i of t.functions){if(Le.has(i.name))continue;r.add(`function:${i.name}`);let o=/^[a-z]+/.exec(i.name)?.[0]??null;o&&o.length>2&&o!==i.name&&r.add(`function-verb:${o}`)}for(let i of e.events)r.add(`template-event:${i.name}`);for(let i of n)r.add(`template-binding:${i}`);return r}function Pe(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of _e(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of q(n.value))t.add(r);return[...t].sort()}function _e(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?q(t[1]??""):[]}function q(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];ve.has(r)||t.push(r)}return t}export{z as a,P as b,Xe as c};
|
|
3
|
-
//# sourceMappingURL=chunk-YZA6PPZL.js.map
|