scip-query 0.10.6 → 0.10.8
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 +7 -2
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-YQH353VA.js → chunk-24S6MYOC.js} +2 -2
- package/dist/{chunk-BNKE4TT5.js → chunk-2H57MJLI.js} +2 -2
- package/dist/{chunk-AUVBR62P.js → chunk-2YI45TNM.js} +2 -2
- package/dist/{chunk-TM6GVHA6.js → chunk-3FYGJ2GY.js} +2 -2
- package/dist/chunk-3LQFMQPY.js +3 -0
- package/dist/chunk-4TMJDHC6.js +5 -0
- package/dist/{chunk-FNRPGGVI.js → chunk-5G5VI7J4.js} +2 -2
- package/dist/chunk-5GVOJOBL.js +2 -0
- package/dist/{chunk-4ZUJJRWT.js → chunk-5SMUKUV5.js} +2 -2
- package/dist/{chunk-DE7MA6OD.js → chunk-63MSELOP.js} +2 -2
- package/dist/{chunk-5FOPAXWY.js → chunk-6BNOACLT.js} +2 -2
- package/dist/chunk-6EO3E3IP.js +23 -0
- package/dist/{chunk-47UA45TU.js → chunk-6N6QTGSD.js} +2 -2
- package/dist/{chunk-QLNGUWR7.js → chunk-6TDOT7B3.js} +2 -2
- package/dist/{chunk-MUULWXSJ.js → chunk-7KJBH4IP.js} +2 -2
- package/dist/chunk-7XWXGANX.js +4 -0
- package/dist/chunk-A536TEU4.js +3 -0
- package/dist/{chunk-CJJP64OC.js → chunk-AA7L7GKI.js} +2 -2
- package/dist/chunk-AETMKBZR.js +40 -0
- package/dist/{chunk-ZQLO2SCU.js → chunk-ANIOISCE.js} +2 -2
- package/dist/{chunk-6UFMPECA.js → chunk-B4EHYG6M.js} +2 -2
- package/dist/{chunk-OLD6PBU6.js → chunk-BEUQVBE3.js} +2 -2
- package/dist/{chunk-EOZIZWW4.js → chunk-BJG67TCR.js} +2 -2
- package/dist/{chunk-ICXVNWMI.js → chunk-BJWNO6BU.js} +2 -2
- package/dist/chunk-BTCASU5J.js +3 -0
- package/dist/{chunk-YUOAAR24.js → chunk-BWL2ECGQ.js} +2 -2
- package/dist/{chunk-QUJBXLBY.js → chunk-BZ53S4ZN.js} +2 -2
- package/dist/{chunk-EYLXU575.js → chunk-C6BYNIH4.js} +2 -2
- package/dist/chunk-C6ROZBJA.js +32 -0
- package/dist/chunk-COUFCH64.js +2 -0
- package/dist/{chunk-D322LMSA.js → chunk-DS6QEB3G.js} +5 -5
- package/dist/{chunk-NVFERV4U.js → chunk-E2CCBFLR.js} +2 -2
- package/dist/{chunk-Z4VHYJ5U.js → chunk-EBIQY3RK.js} +2 -2
- package/dist/{chunk-5UDFZC4D.js → chunk-EKECQP6Z.js} +2 -2
- package/dist/{chunk-O3OKSF6O.js → chunk-FG4NT6VY.js} +2 -2
- package/dist/{chunk-X7ZY6FFF.js → chunk-FGTHPJON.js} +2 -2
- package/dist/{chunk-QSXQT3NE.js → chunk-FHWEEQVO.js} +2 -2
- package/dist/{chunk-CFL2CNIF.js → chunk-FKUCFCLU.js} +2 -2
- package/dist/chunk-FVA3NH4P.js +2 -0
- package/dist/{chunk-5QJXH6ZL.js → chunk-GZQID3FS.js} +2 -2
- package/dist/{chunk-SPE4YCOT.js → chunk-I274B3B3.js} +2 -2
- package/dist/{chunk-DAI74TJU.js → chunk-J6ADQKQA.js} +2 -2
- package/dist/{chunk-E7KERP7E.js → chunk-JRUKS66S.js} +2 -2
- package/dist/{chunk-ZSLT7NWQ.js → chunk-JUIAOOK7.js} +2 -2
- package/dist/{chunk-7KCSELEV.js → chunk-JYSAYZNX.js} +2 -2
- package/dist/chunk-K7VBTWNR.js +2 -0
- package/dist/{chunk-56UN3DMK.js → chunk-KLXVEBVC.js} +2 -2
- package/dist/{chunk-E44ZMVNA.js → chunk-KZYHFI2X.js} +2 -2
- package/dist/{chunk-FIB4JPEX.js → chunk-L4QKEQ4S.js} +2 -2
- package/dist/{chunk-CTCAF3YA.js → chunk-LGX2Y4BA.js} +2 -2
- package/dist/{chunk-VAA5FFIW.js → chunk-LM5SHAN4.js} +2 -2
- package/dist/{chunk-YYD245WG.js → chunk-LWTML2AN.js} +2 -2
- package/dist/{chunk-7OHWPJ5N.js → chunk-MEKSFV6H.js} +2 -2
- package/dist/{chunk-5M4TYWVI.js → chunk-N7F5UM6J.js} +2 -2
- package/dist/{chunk-YUTRW57I.js → chunk-NWFSC356.js} +2 -2
- package/dist/chunk-P3K7LX7M.js +4 -0
- package/dist/{chunk-CAWSSEVM.js → chunk-Q34NWRPP.js} +2 -2
- package/dist/chunk-QDGKE5HN.js +21 -0
- package/dist/{chunk-ESG4HBEF.js → chunk-RHKMQNFI.js} +2 -2
- package/dist/chunk-RSKOYTSY.js +3 -0
- package/dist/chunk-RY7CAOJF.js +4 -0
- package/dist/{chunk-NNDYO2DX.js → chunk-S7YOLFLX.js} +2 -2
- package/dist/{chunk-LPLGJ4HO.js → chunk-SHM5D3DQ.js} +2 -2
- package/dist/chunk-SOGKYB5I.js +8 -0
- package/dist/{chunk-MZ7APUFN.js → chunk-T633QLYF.js} +2 -2
- package/dist/{chunk-AW4N6MGC.js → chunk-VAXDTQHE.js} +2 -2
- package/dist/chunk-VFLHKRTW.js +2 -0
- package/dist/{chunk-77YBOOYT.js → chunk-VMPB52FG.js} +2 -2
- package/dist/{chunk-3KLLFNT4.js → chunk-VOYOYC5T.js} +2 -2
- package/dist/{chunk-DJMK4DBL.js → chunk-VXT7WVIN.js} +2 -2
- package/dist/chunk-W2CBNBEL.js +71 -0
- package/dist/{chunk-3UW7VM4H.js → chunk-X3BJUFSN.js} +2 -2
- package/dist/chunk-X3Z4MLVL.js +4 -0
- package/dist/chunk-XPOZO76D.js +2 -0
- package/dist/{chunk-WBJZNPUT.js → chunk-XWC67C3Q.js} +2 -2
- package/dist/{chunk-GZCQTZLK.js → chunk-YNSVAJR6.js} +2 -2
- package/dist/chunk-YWOOQ4FF.js +2 -0
- package/dist/chunk-YZA6PPZL.js +3 -0
- package/dist/{chunk-CSWZFD46.js → chunk-ZDR4VTOP.js} +2 -2
- package/dist/{chunk-QVCCLDZI.js → chunk-ZL52RLDK.js} +2 -2
- package/dist/{chunk-YTR4CO5S.js → chunk-ZMU6IWDK.js} +3 -3
- package/dist/cli.js +272 -235
- package/dist/{config-types-Bj4sh28g.d.ts → config-types-BDIWAYzr.d.ts} +13 -1
- package/dist/{db-CTarohbZ.d.ts → db-BAVwb4Pb.d.ts} +1 -1
- package/dist/{health-Bx0x1HAG.d.ts → health-B17sVFYf.d.ts} +6 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +8 -5
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +7 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +5 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +3 -3
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +14 -4
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +11 -11
- package/dist/reindex.d.ts +11 -2
- package/dist/reindex.js +22 -22
- package/dist/runtime.d.ts +17 -20
- package/dist/runtime.js +2 -2
- package/dist/scip-cli-CnK9Va4O.d.ts +56 -0
- package/docs/AGENT_GUIDE.md +1 -1
- package/docs/COMMAND_REFERENCE.md +4 -3
- package/docs/analyzer-inventory.md +2 -2
- package/docs/analyzer-validation-ledger.md +2 -2
- package/package.json +1 -1
- package/skills/concrete-plan/SKILL.md +2 -2
- package/skills/scip-adoption/SKILL.md +4 -2
- package/skills/scip-ai-cleanup/SKILL.md +1 -1
- package/skills/scip-api-impact/SKILL.md +6 -2
- package/skills/scip-debloat/SKILL.md +1 -1
- package/skills/scip-debug/SKILL.md +6 -2
- package/skills/scip-diagram/SKILL.md +3 -1
- package/skills/scip-directory-architecture/SKILL.md +7 -3
- package/skills/scip-doc-reconcile/SKILL.md +3 -1
- package/skills/scip-explore/SKILL.md +2 -2
- package/skills/scip-health-audit/SKILL.md +6 -2
- package/skills/scip-health-improve/SKILL.md +6 -2
- package/skills/scip-hyper-optimization/SKILL.md +97 -0
- package/skills/scip-hyper-optimization/agents/openai.yaml +4 -0
- package/skills/scip-maintainability/SKILL.md +6 -3
- package/skills/scip-query/SKILL.md +14 -6
- package/skills/scip-query-setup/SKILL.md +10 -5
- package/skills/scip-react-maintainability/SKILL.md +7 -2
- package/skills/scip-triage-issue/SKILL.md +4 -2
- package/skills/scip-verify/SKILL.md +5 -3
- package/skills/scip-vue-maintainability/SKILL.md +7 -2
- package/dist/chunk-237YUOPK.js +0 -8
- package/dist/chunk-3UVJJ6Z7.js +0 -2
- package/dist/chunk-3ZYF3ELZ.js +0 -2
- package/dist/chunk-7JOTOWZO.js +0 -4
- package/dist/chunk-A3VNUGKJ.js +0 -2
- package/dist/chunk-A4L36SZS.js +0 -22
- package/dist/chunk-A7RNHUJH.js +0 -20
- package/dist/chunk-AYYIZ4BA.js +0 -4
- package/dist/chunk-BKDXBJDQ.js +0 -2
- package/dist/chunk-C3MZZ2ZN.js +0 -2
- package/dist/chunk-CRU42NJU.js +0 -2
- package/dist/chunk-ERHOS6AW.js +0 -2
- package/dist/chunk-EWC3UK4V.js +0 -3
- package/dist/chunk-FOQHUKNZ.js +0 -4
- package/dist/chunk-FUPDW5AC.js +0 -3
- package/dist/chunk-G3WGZU5Q.js +0 -2
- package/dist/chunk-HVTYSC26.js +0 -40
- package/dist/chunk-KPHKX4LP.js +0 -71
- package/dist/chunk-MA7OVFHI.js +0 -2
- package/dist/chunk-OBBDKQAG.js +0 -3
- package/dist/chunk-RHTJBYZ5.js +0 -2
- package/dist/chunk-UQJGTVHV.js +0 -5
- package/dist/chunk-ZFMPHDAT.js +0 -4
- package/dist/scip-cli-Bh1M_JPu.d.ts +0 -20
package/dist/chunk-237YUOPK.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{d as E,g as D}from"./chunk-UQJGTVHV.js";import{d as _}from"./chunk-3UVJJ6Z7.js";import{b as N,d as P,g as T}from"./chunk-A7RNHUJH.js";import{a as R}from"./chunk-3ZYF3ELZ.js";import{c as S,d as y}from"./chunk-JM72FNGA.js";var A=5;function ne(e,t={}){let{base:i="HEAD",minContainment:r=.7,minCallees:n=3,minSiteCoverage:o=.4,maxHelpers:a=Number.POSITIVE_INFINITY,limit:g=20}=t,c=t.semantic!==!1,p=t.diffPlan??P(e,{base:i}),s={available:p.note!==N,base:i,changedFiles:p.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!s.available||p.changedFiles.length===0)return s;let v=new R(e),M=new Set(p.changedFiles),q=new Map(p.renamedFiles.map(l=>[l.to,l.from])),f=K(e,v,M,i,q);if(f.length===0)return s;let k=f.slice(0,a);f.length>a&&(s.note=`helper scoring capped at ${a} of ${f.length} new symbols`);let H=E(e,{minCallees:Math.min(3,n),semantic:c}),x=z(H),O=v.calleeMap(k,{semantic:c}),$=k.map(l=>({def:l,callees:D((O.get(l.symbolId)??[]).map(m=>m.symbol))}));for(let{def:l,callees:m}of $){let h=S(l.symbol);if(m.size<n){s.skipped.push({helperShortName:h,helperFile:l.relativePath,reason:`fewer than ${n} meaningful callees \u2014 too small to score`});continue}let w=J(m,x);if(w===0){s.skipped.push({helperShortName:h,helperFile:l.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let b=U(e,l.symbolId);if(b.length===0){s.skipped.push({helperShortName:h,helperFile:l.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}s.helpersChecked+=1;let C=j({candidateIndex:x,changed:M,helperCallees:m,helperFile:l.relativePath,helperSymbol:l.symbol,minContainment:r,minSiteCoverage:o,migratedFiles:b});C.length!==0&&(C.sort((u,d)=>L(d.migrationScope)-L(u.migrationScope)||d.containment-u.containment||d.siteCoverage-u.siteCoverage||u.file.localeCompare(d.file)),s.findings.push({helperSymbol:l.symbol,helperShortName:h,helperFile:l.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:m.size,specificHelperCalleeCount:w,migratedFiles:b.sort(),leftovers:C.slice(0,A)}))}return s.findings.sort((l,m)=>(m.leftovers[0]?.containment??0)-(l.leftovers[0]?.containment??0)||l.helperFile.localeCompare(m.helperFile)),s.findings=s.findings.slice(0,g),s}function z(e){let t=new Map,i=new Map;for(let r of e)for(let n of r.callees){t.set(n,(t.get(n)??0)+1);let o=i.get(n);o||(o=[],i.set(n,o)),o.push(r)}return{candidatesByCallee:i,docFreq:t,ubiquityThreshold:Math.max(8,Math.ceil(Math.sqrt(e.length)))}}function j(e){let t=[],i=B(e.helperSymbol,e.helperFile,e.migratedFiles),r=new Set;for(let n of e.helperCallees)for(let o of e.candidateIndex.candidatesByCallee.get(n)??[])r.add(o);for(let n of r){if(n.symbol===e.helperSymbol||e.changed.has(n.file)||n.callees.has(e.helperSymbol))continue;let o=_(e.helperCallees,n.callees);if(o<e.minContainment)continue;let a=[...e.helperCallees].filter(p=>n.callees.has(p)),g=n.callees.size===0?0:a.length/n.callees.size;if(g<e.minSiteCoverage||!a.some(p=>(e.candidateIndex.docFreq.get(p)??0)<=e.candidateIndex.ubiquityThreshold))continue;let c=V(i,n.symbol,n.file);t.push({symbol:n.symbol,shortName:S(n.symbol),file:n.file,...c,containment:o,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,n.callees.size-a.length),sharedCallees:a.map(S).sort()})}return t}function L(e){return e==="same-scope"?2:e==="unknown"?1:0}function B(e,t,i){let r=new Set([...I(t),...F(y(e))]);for(let n of i)for(let o of I(n))r.add(o);return r}function V(e,t,i){let r=new Set([...I(i),...F(y(t))]);if(e.size===0||r.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let n=[...r].filter(o=>e.has(o)).sort();return n.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${n.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var G=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function I(e){return F(e.replace(/\.[^.]+$/,""))}function F(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>1&&!G.has(t))}function J(e,t){let i=0;for(let r of e)(t.docFreq.get(r)??0)<=t.ubiquityThreshold&&(i+=1);return i}function K(e,t,i,r,n){let o=new Map;return t.productionCallableDefinitions({requireFunctionLikeSymbol:!0}).filter(a=>{if(!i.has(a.relativePath))return!1;let g=n.get(a.relativePath)??a.relativePath,c=o.get(g);return c===void 0&&(c=T(e.config.projectRoot,r,g),o.set(g,c)),c===null||!new RegExp(`\\b${W(a.leaf)}\\b`).test(c)})}function U(e,t){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
${e.pathExclusionsFor("ref_d")}`,t).map(r=>r.relative_path)}function W(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{ne as a};
|
|
8
|
-
//# sourceMappingURL=chunk-237YUOPK.js.map
|
package/dist/chunk-3UVJJ6Z7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function S(n,e){let t=new Set;for(let r of n)e.has(r)&&t.add(r);return t}function M(n,e){let t=new Set;for(let r of n)e.has(r)||t.add(r);return t}function w(n,e){if(n.size===0&&e.size===0)return 0;let t=0;for(let o of n)e.has(o)&&(t+=1);let r=n.size+e.size-t;return r===0?0:t/r}function x(n,e){if(n.size===0)return 0;let t=0;for(let r of n)e.has(r)&&(t+=1);return t/n.size}function z(n){let e=n.length;if(e===0)return new Map;let t=new Map;for(let o of n)for(let s of o)t.set(s,(t.get(s)??0)+1);let r=new Map;for(let[o,s]of t)r.set(o,Math.log(e/s));return r}function p(n){let e=[...n.values()].sort((r,o)=>r-o);if(e.length===0)return 0;let t=Math.floor(e.length/2);return e.length%2===0?(e[t-1]+e[t])/2:e[t]}function b(n,e,t){let r=S(n,e);if(r.size===0)return{similarity:0,significantShared:[],trivialShared:[]};let o=0,s=0,T=0,l=new Set([...n,...e]);for(let i of l){let a=t.get(i)??0,f=n.has(i)?a:0,u=e.has(i)?a:0;o+=f*u,s+=f*f,T+=u*u}let h=Math.sqrt(s)*Math.sqrt(T),g=h>0?o/h:0,m=p(t),c=[],d=[];for(let i of r)(t.get(i)??0)>=m?c.push(i):d.push(i);return c.sort((i,a)=>(t.get(a)??0)-(t.get(i)??0)),{similarity:g,significantShared:c,trivialShared:d}}export{S as a,M as b,w as c,x as d,z as e,b as f};
|
|
2
|
-
//# sourceMappingURL=chunk-3UVJJ6Z7.js.map
|
package/dist/chunk-3ZYF3ELZ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as y,f as w,g as E}from"./chunk-ZQLO2SCU.js";import{a as g}from"./chunk-BGBBVSH4.js";import{b as V,c as G,d as O}from"./chunk-GZCQTZLK.js";import{c as B}from"./chunk-YTR4CO5S.js";import{a as K,k as F,l as j}from"./chunk-HVTYSC26.js";import{a as T}from"./chunk-AUVBR62P.js";import{f as q,h as S}from"./chunk-3UW7VM4H.js";import{f as k,g as P,i as N,j as A}from"./chunk-JM72FNGA.js";import{a as C,f as p}from"./chunk-QLNGUWR7.js";import{a as b,b as L}from"./chunk-EWC3UK4V.js";import{d}from"./chunk-D322LMSA.js";import{c as M}from"./chunk-OBBDKQAG.js";import{a as v}from"./chunk-64MNV6AB.js";function H(r,e,t){let a=e.identifierResolution==="strict"?F:j;for(let n of e.paths)if(!(!b(n)&&!(e.includeVueSfc&&L(n)))&&!r.isIgnored(n)&&!e.skipPath?.(n))try{let l=(i,c,R,m)=>{if(e.candidateNames&&!e.candidateNames.has(i))return;let h=e.resolveTargets?e.resolveTargets({sourceFile:n,name:i,kind:c,defaultTargets:m}):m();for(let D of h)t({sourceFile:n,name:i,target:D,occurrences:R,kind:c})},f=K(r,n);for(let[i,c]of f)l(i,"identifier",c.length,()=>a(r,n,i));for(let i of p(r,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=i.kind==="cross-language-dispatch"?()=>F(r,n,i.name):()=>a(r,n,i.name);l(i.name,i.kind,i.occurrences,c)}}finally{e.afterPath?.(n)}}function W(r,e={}){let{scope:t,minLoc:a=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:l=!1,excludeTypesFiles:f=!1,excludeRootedSymbols:i=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:R=!1,excludeRustTraitImplMembers:m=!1,includeSuppressed:h=!1,sortByLocDesc:D=!1}=e,I=[];for(let s of S(r,t)){let u=s.relativePath;if(r.isIgnored(u)||l&&w(r,u)||!_(s,{requireFunctionLikeSymbol:c,requireCallableSymbol:R})||o!==void 0&&s.symbol===o)continue;let x=g(s);x<a||x>n||f&&z(u)||i&&E(r,s.symbol,u)||m&&N(s.symbol)||y(u)!=="test"&&(A(s.symbol)||!h&&d(r,u,s.startLine)||I.push(s))}return D?I.sort((s,u)=>g(u)-g(s)):I}function _(r,e){return e.requireCallableSymbol?k(r.symbol):e.requireFunctionLikeSymbol?P(r.symbol):r.isFunctionLike}function z(r){return(r.split("/").pop()??"").includes("types")}var Y=class{constructor(e){this.db=e}db;scopedDefinitions(e){return S(this.db,e)}definitionsForFile(e){return q(this.db,e)}productionCallableDefinitions(e={}){return W(this.db,e)}calleeMap(e,t={}){return B(this.db,e,t)}crossFileCallerMap(e,t={}){return V(this.db,e,t)}sourceFallbackCallerFiles(e){return G(this.db,e)}callerFileMap(e,t={}){return O(this.db,e,t)}frameworkReferencedSymbolIds(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let o=t.get(n.leaf)??[];o.push(n.symbolId),t.set(n.leaf,o)}let a=new Set;for(let n of v(this.db,{includeIgnored:!1}))if(b(n)==="rust")for(let{name:o}of p(this.db,n,{includeRustAttributeNames:!0}))for(let l of t.get(o)??[])a.add(l);return a}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let a=new Map(e.map(o=>[o.symbolId,o.symbol])),n=this.calleeMap(e,t);return new Set([...n.entries()].filter(([o,l])=>{let f=a.get(o);return l.some(i=>i.symbol!==f)}).map(([o])=>o))}fileDependencyGraph(e){return T(this.db,e)}fileKind(e){return y(e)}hasSuppressionComment(e){return d(this.db,e.relativePath,e.startLine)}sourceFiles(){return M(this.db)}scanSourceReferences(e,t){H(this.db,e,t)}callableSignature(e){let t=C(this.db,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{Y as a};
|
|
2
|
-
//# sourceMappingURL=chunk-3ZYF3ELZ.js.map
|
package/dist/chunk-7JOTOWZO.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as te}from"./chunk-NNDYO2DX.js";import{a as ie}from"./chunk-237YUOPK.js";import{a as y}from"./chunk-B32FX5KB.js";import{a as ee}from"./chunk-SPE4YCOT.js";import{a as Q}from"./chunk-ZFMPHDAT.js";import{a as X}from"./chunk-C2QSK7E7.js";import{a as J,b as Z}from"./chunk-UQJGTVHV.js";import{a as W}from"./chunk-G3WGZU5Q.js";import{a as Y}from"./chunk-DE7MA6OD.js";import{a as q}from"./chunk-7KCSELEV.js";import{a as M,c as I,d as P,g as H}from"./chunk-A7RNHUJH.js";import{a as _,b as F,e as z}from"./chunk-AYYIZ4BA.js";import{a as V}from"./chunk-AW4N6MGC.js";import{b as U}from"./chunk-C3MZZ2ZN.js";import{a as A,c as L,d as N,e as B}from"./chunk-EYLXU575.js";import{g as K}from"./chunk-KRGBLZT2.js";import{a as O}from"./chunk-CJJP64OC.js";import{a as E}from"./chunk-3ZYF3ELZ.js";import{f as k,g as T}from"./chunk-ZQLO2SCU.js";import{d as w,e as j}from"./chunk-JM72FNGA.js";import{createHash as Ke}from"crypto";import{existsSync as le}from"fs";function ne(e){let[i,t]=R(e,":"),r=i||"unknown",o=(s={})=>{let n=s.actionTier??fe(r);return{sourceAnalyzer:r,actionTier:n,rootCauseKey:s.rootCauseKey??(t||e),label:s.label??`${r} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??de(n,r),file:s.file}};if(!t)return o({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(r)){let[s,n]=R(t,":");return o({file:s,relatedFiles:s?[s]:[],rootCauseKey:n?`${s}:${n}`:t,label:`${r} finding`,why:n?[`Baseline subject: ${n}.`]:[]})}if(r==="cycle"){let s=t.split(">").filter(Boolean);return o({relatedFiles:s,rootCauseKey:t,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(r==="similar"){let s=t.split("|").filter(Boolean);return o({relatedFiles:[],rootCauseKey:t,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(r==="drift"){let[s,n]=R(t,":"),[c,a]=R(n,":");return o({actionTier:s==="unused-import"?"direct":"signal",file:c,relatedFiles:[...new Set([c,a].filter(Boolean))],rootCauseKey:t,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...a?[`Related dependency: ${a}.`]:[]]})}return o({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function fe(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function de(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function R(e,i){let t=e.indexOf(i);return t<0?[e,""]:[e.slice(0,t),e.slice(t+i.length)]}import{existsSync as ue,readFileSync as re}from"fs";var $={classifyCitation:he,citationContexts:ge,citationKindLabel:pe,citationRemediation:ye,referenceTargets:be};function he(e){let i=e.join(`
|
|
2
|
-
`).toLowerCase(),t=[],r=F(i,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(r.length>0)return t.push(`configuration/example terms near citation: ${r.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:t};let o=F(i,["accepted","intentional","intentionally","retained","historical"]);if(o.length>0)return t.push(`intentional-record terms near citation: ${o.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:t};let s=F(i,["command","cli","usage","example","run","workflow"]);return s.length>0?(t.push(`guide/reference terms near citation: ${s.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:t}):(t.push(e.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:t})}function ge(e,i,t){let r;try{r=re(`${e.config.projectRoot}/${i}`,"utf-8").split(/\r?\n/)}catch{return[]}let o=t.flatMap(me),s=[];for(let n=0;n<r.length;n+=1){let c=r[n]??"";o.some(a=>c.includes(a))&&s.push(_(r,n))}return s}function me(e){let i=e.split("/");return[e,`./${e}`,i.slice(-3).join("/"),i.slice(-2).join("/")].filter((t,r,o)=>t.length>0&&o.indexOf(t)===r)}function pe(e){switch(e){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function ye(e,i){switch(e){case"behavioral-claim":return`Re-read ${i} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${i} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${i} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${i} is still meant to name this file.`}}function be(e,i,t){let r=M(t),o=new Set;for(let s of i)Ce(e,s,r.get(s)??[])&&o.add(s);return o}function Ce(e,i,t){if(t.length===0)return!1;if(!Se.test(i))return!0;let r=`${e.config.projectRoot}/${i}`;if(!ue(r))return!0;let o=re(r,"utf-8").split(/\r?\n/),s=$e(o);for(let n of t)for(let c=n.startLine;c<=n.endLine;c+=1)if((o[c]??"").trim()!==""&&!s.has(c))return!0;return!1}var Se=/\.(?:[cm]?[jt]sx?)$/i;function $e(e){let i=new Set,t=!1;for(let r=0;r<e.length;r+=1){let o=e[r].trim();!t&&De(o)&&(t=!0),t&&(i.add(r),o.endsWith(";")&&(t=!1))}return i}function De(e){return/^import(?:\s|$)/.test(e)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(e)}import{existsSync as we,readFileSync as ke,writeFileSync as Te}from"fs";import{isAbsolute as Fe,join as Re}from"path";var ve=75e3,xe=5e3,Ae=2500;function Ge(e){let i=X(e);return i.symbols>=ve||i.documents>=xe?Ae:void 0}var je=".scipquery-baseline.json";function v(e,i){return i&&Fe(i)?i:Re(e.config.projectRoot,i??je)}function oe(e,i={}){let{scope:t}=i,r=Ge(e),o=[],s=U(e,{scope:t,...y.dead,scanLimit:r});for(let n of s.symbols)k(e,n.relativePath)||T(e,n.symbol,n.relativePath)||n.kind==="dead-code"&&o.push(`dead:${n.relativePath}:${n.shortName}`);for(let n of W(e,{scope:t,...y.isolated,scanLimit:r}))k(e,n.relativePath)||T(e,n.symbol,n.relativePath)||o.push(`isolated:${n.relativePath}:${n.shortName}`);for(let n of O(e,{scope:t}))n.kind==="real"&&o.push(`cycle:${Ee(n.path)}`);for(let n of Z(e,{scope:t,...y.similar,scanLimit:r}))o.push(`similar:${[n.symbolA,n.symbolB].sort().join("|")}`);for(let n of q(e,{scope:t,...y.extract,scanLimit:r}))o.push(`extract:${n.relativePath}:${n.shortName}`);for(let n of ee(e,{scope:t,...y.wrappers,scanLimit:r}))o.push(`wrapper:${n.file}:${n.shortName}`);for(let n of Y(e,{scope:t,...y.passthroughs,scanLimit:r}))o.push(`passthrough:${n.file}:${n.shortName}`);for(let n of Q(e,{scope:t,...y.stale,scanLimit:r}))o.push(`stale:${n.file}:${n.shortName}`);for(let n of V(e,{scope:t,...y.drift}).results)n.kind!=="pattern-deviation"&&o.push(`drift:${n.kind}:${n.file}:${n.dep}`);return[...new Set(o)].sort()}function Ee(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function xi(e,i={}){let t=oe(e,{scope:i.scope}),r=v(e,i.path);return Te(r,JSON.stringify({version:1,findings:t},null,2)+`
|
|
3
|
-
`),{path:r,findingCount:t.length}}function se(e,i={}){let t=v(e,i.path);if(!we(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let r=JSON.parse(ke(t,"utf-8")),o=new Set(r.findings??[]),s=oe(e,{scope:i.scope}),n=new Set(s);return{baselinePath:t,baselineCount:o.size,current:s,newFindings:s.filter(c=>!o.has(c)),fixedFindings:[...o].filter(c=>!n.has(c))}}var Vi=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function qi(e,i={}){let t=i.base??"HEAD",{minTogether:r=6,minConfidence:o=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:n=Number.POSITIVE_INFINITY,minSimilarity:c=.8}=i,a=new Set(i.skip??[]),f=P(e,{base:t}),g=I(e,{base:t,plan:f}),u=g.changedFiles,d=new Set(u),l=new Set(f.changedFileLines),m=oi(e.config.projectRoot,t,f),h={base:t,changedFiles:u,changedSymbols:g.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],rootCauseGroups:[],note:g.summary.note};if(u.length===0)return h;let p=(b,S)=>{if(a.has(b)){h.skipped.push({check:b,reason:"skipped via --skip"});return}S()};return p("echo",()=>Pe(e,g.changedSymbols,d,m,s,c,h)),p("incomplete-migration",()=>Ye(e,t,f,n,h)),p("co-change-partner",()=>Je(e,d,r,o,h)),p("doc-reference",()=>ii(e,d,l,f.changedRanges,h)),p("unused-params",()=>ti(e,u,h)),p("new-dead",()=>ni(e,g.changedSymbols,m,h)),p("baseline",()=>ci(e,h)),Me(h,e.config.suppressions??[]),h.rootCauseGroups=Le(h.findings),h}function Le(e){let i=new Map;for(let t of e){let r=t.groupKey??`${t.check}:${t.id}`,o=i.get(r);o||(o={groupKey:r,check:t.check,severity:t.severity,actionTier:t.actionTier,sourceAnalyzer:t.sourceAnalyzer,rootCauseKey:t.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:t.message,remediation:t.remediation},i.set(r,o)),o.count+=1,o.findingIds.push(t.id),o.severity=Ne(o.severity,t.severity),o.actionTier=Be(o.actionTier,t.actionTier),t.file&&o.files.add(t.file);for(let s of t.relatedFiles??[])o.relatedFiles.add(s)}return[...i.values()].map(t=>({...t,files:[...t.files].sort(),relatedFiles:[...t.relatedFiles].sort()})).sort((t,r)=>r.count-t.count||x(r.severity)-x(t.severity)||t.groupKey.localeCompare(r.groupKey))}function Ne(e,i){return x(i)>x(e)?i:e}function x(e){return e==="error"?2:e==="warning"?1:0}function Be(e,i){return e?i&&ae(i)>ae(e)?i:e:i}function ae(e){return e==="direct"?2:e==="signal"?1:0}function Me(e,i){if(i.length===0||e.findings.length===0)return;let t=[];for(let r of e.findings){let o=i.find(s=>Ie(s,r));o?e.suppressed.push({finding:r,suppression:o}):t.push(r)}e.findings=t}function Ie(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function D(e,i){e.findings.push({...i,suppressionHint:`scip-query: ignore ${i.check} ${i.id} -- <reason>`})}function Pe(e,i,t,r,o,s,n){n.checksRun.push("echo");for(let c of i.slice(0,o)){if(r(c))continue;let a=J(e,c.symbol,{minSimilarity:s,limit:5}),f=[];for(let l of a){let m=l.fileA===c.file?l.fileB:l.fileA,h=l.fileA===c.file?l.shortNameB:l.shortNameA,p=l.fileA===c.file?l.symbolB:l.symbolA;t.has(m)||f.push({otherFile:m,otherShort:h,otherSymbol:p,similarity:l.similarity,similarityBasis:l.similarityBasis??"callees",sharedEvidence:l.sharedCallees})}if(f.length===0)continue;let g=f[0],u=C("echo",c.symbol,c.file,...f.map(l=>`${l.otherSymbol}|${l.otherFile}`).sort()),d=He(c,f);D(n,{id:u,groupKey:u,actionTier:d,check:"echo",severity:"warning",evidence:"heuristic",confidence:g.similarity,file:c.file,symbol:c.symbol,relatedFiles:[...new Set(f.map(l=>l.otherFile))].sort(),message:Ve(c,f),why:qe(c,f),remediation:We(d,c.shortName,g.otherShort)})}i.length>o&&n.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function He(e,i){return i.some(r=>_e(e.symbol,r))?"direct":"signal"}function _e(e,i){if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let t=w(e),r=w(i.otherSymbol);return!t||!r?!1:t===r?!0:Ue(i.sharedEvidence)?!1:ze(t,r)}function ze(e,i){let t=ce(e),r=ce(i);if(t.length===0||r.length===0)return!1;let o=new Set(r),s=t.filter(n=>o.has(n)).length;return s>=2&&s/Math.min(t.length,r.length)>=.5}function ce(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var Oe=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function Ue(e){return e.length>=3&&e.every(i=>Oe.has(i.toLowerCase()))}function Ve(e,i){let t=i[0],r=Math.round(t.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${r}% similar to established ${t.otherShort} (${t.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${r}% similar to ${t.otherShort} (${t.otherFile})`}function qe(e,i){let t=[`${e.shortName} was changed in this diff.`];for(let r of i.slice(0,3))t.push(`${r.otherShort} is outside this diff and scored ${Math.round(r.similarity*100)}% similar by ${r.similarityBasis} evidence.`),t.push(`Shared evidence: ${r.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&t.push(`${i.length-3} additional similar match(es) grouped into this finding.`),t}function We(e,i,t){return e==="direct"?`Extract or reuse the shared behavior with ${t}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function Ye(e,i,t,r,o){let s=ie(e,{base:i,maxHelpers:r,diffPlan:t});if(!s.available){o.skipped.push({check:"incomplete-migration",reason:"no git history"});return}o.checksRun.push("incomplete-migration"),s.note&&o.skipped.push({check:"incomplete-migration",reason:s.note});for(let n of s.findings){let c=n.leftovers.map(l=>`${l.shortName} (${l.file}, ${Math.round(l.containment*100)}% helper / ${Math.round(l.siteCoverage*100)}% site, ${l.migrationScope})`).join(", "),a=n.leftovers.map(l=>`${l.shortName}: ${l.migrationScope} (${l.migrationScopeReasons[0]})`).join("; "),f=[...n.migratedFiles,...n.leftovers.map(l=>l.file)],g=n.leftovers.length===0?void 0:Math.max(...n.leftovers.map(l=>Math.min(l.containment,l.siteCoverage))),u=n.leftovers.some(l=>l.migrationScope==="possible-subtype"),d=C("incomplete-migration",n.helperSymbol,n.helperFile,f.join("|"));D(o,{id:d,check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:g,file:n.helperFile,symbol:n.helperSymbol,relatedFiles:f,message:`new helper ${n.helperShortName} (${n.helperFile}) is wired into ${n.migratedFiles.length} file(s), but ${n.leftovers.length} similar un-migrated site(s) remain: ${c}`,why:[`${n.helperShortName} is new in this diff and already referenced by ${n.migratedFiles.join(", ")}.`,`Helper shape: ${n.helperShape}; ${n.specificHelperCalleeCount}/${n.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${c}.`,`Migration scope hints: ${a}.`],remediation:u?`Migrate same-scope sites to ${n.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${n.helperShortName}, or confirm they are intentionally different.`})}}function Je(e,i,t,r,o){let s=K(e,i,{minTogether:t,minConfidence:0,maxFilesPerCommit:20});if(!s){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let n=new Set,c;for(let a of s){let f=i.has(a.fileA),g=i.has(a.fileB);if(f===g)continue;let u=f?a.fileA:a.fileB,d=f?a.fileB:a.fileA,l=f?a.changesA:a.changesB,m=l>0?a.together/l:0;if(m<r||A(d)||A(u)||!le(`${e.config.projectRoot}/${d}`))continue;let h=`${u}|${d}`;if(n.has(h))continue;n.add(h);let p=C("co-change-partner",u,d,String(a.together)),b=L(u,d),S=N({fileA:u,fileB:d,together:a.together,confidence:m,commitScope:a.commitScope,recency:a.recency,subjectContext:a.subjectContext},b,(c??=B(e))(u,d)),G=[u,d].sort().join("|");o.findings.push({id:p,check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${G}`,confidence:m,file:u,relatedFiles:[d],sourceAnalyzer:"co-change",rootCauseKey:G,partnerClass:b.partnerClass,partnerClassReasons:b.reasons,commitScope:a.commitScope,recency:a.recency,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:a.broadCommitRatio,lastTogetherAt:a.lastTogetherAt,recentTogether:a.recentTogether,subjectContext:a.subjectContext,...S?{declaredCouplingSuggestion:S}:{},message:`${u} changed, but ${d} did not \u2014 they change together ${a.together}x (${Math.round(m*100)}% of the time)`,why:[`${u} is in this diff and ${d} is not.`,`Git history shows ${a.together} co-change(s), which is ${Math.round(m*100)}% of changes to the edited side.`,`History context: ${Ze(a)}.`,`Subject context: ${Qe(a.subjectContext)}.`,...Xe(a),`Partner class: ${b.partnerClass} (${b.reasons.join("; ")}).`],remediation:S?`Update ${d} alongside this change, declare the coupling "${S.name}", or confirm the coupling no longer holds.`:`Update ${d} alongside this change, or confirm the coupling no longer holds.`})}}function Ze(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${ei(e.lastTogetherAt)}`}function Qe(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",t=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",r=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(o=>`"${o}"`).join("; "):"none";return`labels ${i}; refs ${t}; samples ${r}; external issue/PR labels ${e.externalIssueLabelStatus}`}function Xe(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function ei(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}function ii(e,i,t,r,o){o.checksRun.push("doc-reference");let s=$.referenceTargets(e,i,r);if(s.size!==0)for(let n of z(e,s)){if(t.has(n.doc))continue;let c=n.citedClaims.length>0?n.citedClaims:$.citationContexts(e,n.doc,n.cited),a=$.classifyCitation(c),f=C("doc-reference",n.doc,n.cited.join("|"));D(o,{id:f,check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:a.actionTier,confidence:1,file:n.doc,relatedFiles:n.cited,citationKind:a.citationKind,citationKindReasons:a.reasons,citedClaims:c,message:`${n.doc} cites ${n.cited.join(", ")} as ${$.citationKindLabel(a.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${n.cited.join(", ")} changed in this diff.`,`${n.doc} cites the changed file(s) but was not updated in the same diff.`,...a.reasons.map(g=>`Citation kind evidence: ${g}`)],remediation:$.citationRemediation(a.citationKind,n.doc)})}}function ti(e,i,t){t.checksRun.push("unused-params");for(let r of te(e,{files:i,limit:50})){let o=C("unused-params",r.symbol,r.file,r.unusedTrailing.join("|"));D(t,{id:o,check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:r.file,startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,message:`${r.shortName} (${r.file}) has trailing unused parameter(s): ${r.unusedTrailing.join(", ")}`,why:[`${r.shortName} is in a changed file.`,`The trailing parameter(s) ${r.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function ni(e,i,t,r){r.checksRun.push("new-dead");let o=new E(e);for(let s of i){if(t(s)||s.fanIn>0||o.fileKind(s.file)==="test"||k(e,s.file)||T(e,s.symbol,s.file)||ri(s.symbol))continue;let n=C("new-dead",s.symbol,s.file);D(r,{id:n,check:"new-dead",severity:"warning",evidence:"graph-fact",confidence:.9,file:s.file,symbol:s.symbol,message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,why:[`${s.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:"Wire it up, or remove it before it becomes permanent dead code."})}}function ri(e){if(j(e)!=="type")return!1;let i=w(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function oi(e,i,t){let r=new Map(t.renamedFiles.map(s=>[s.to,s.from])),o=new Map;return s=>{let n=r.get(s.file)??s.file,c=w(s.symbol);if(!c)return!1;let a=o.get(n);return a===void 0&&(a=H(e,i,n),o.set(n,a)),a!==null&&si(a,c)}}function si(e,i){return new RegExp(`\\b${ai(i)}\\b`).test(e)}function ai(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ci(e,i){if(!le(v(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=se(e);for(let r of t.newFindings){let o=ne(r),s=C("baseline",r);D(i,{id:s,groupKey:`baseline:${o.sourceAnalyzer}:${o.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:o.actionTier,confidence:1,file:o.file,relatedFiles:o.relatedFiles.length>0?o.relatedFiles:void 0,sourceAnalyzer:o.sourceAnalyzer,rootCauseKey:o.rootCauseKey,message:`new ${o.label} vs committed baseline: ${r}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${o.sourceAnalyzer}.`,`Inherited action tier: ${o.actionTier}.`,`Root cause key: ${o.rootCauseKey}.`,...o.why],remediation:o.remediation})}}function C(e,...i){return`SQ${Ke("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{oe as a,xi as b,se as c,Vi as d,qi as e,oi as f};
|
|
4
|
-
//# sourceMappingURL=chunk-7JOTOWZO.js.map
|
package/dist/chunk-A3VNUGKJ.js
DELETED
package/dist/chunk-A4L36SZS.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-7S5E7KWT.js";import{createHash as u}from"crypto";import{createRequire as h}from"module";import{dirname as g,join as v}from"path";import T from"better-sqlite3";var m=h(import.meta.url),f="evidence.db",s=new WeakMap,N=p("evidence-content-hash",{clearGroups:["whole-project","source-file"]});function C(){for(let t of["../package.json","../../package.json"])try{return m(t).version}catch{}return"0.0.0"}var c=C();function S(t){return u("sha256").update(t).digest("hex")}function O(t,n,e){return N.get(t,n,()=>S(e))}function E(t,n){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${t}: ${n instanceof Error?n.message:String(n)}`)}function l(t){if(s.has(t))return s.get(t)??null;let n=null;try{let e=new T(v(g(t.config.dbPath),f));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
|
-
`),n={evidence:e,readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),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
|
|
20
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
21
|
-
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?")}}catch(e){E("disabled (open failed)",e)}return s.set(t,n),n}function d(t,n,e){E(`disabled (${n})`,e),s.set(t,null)}function A(t,n,e,i){let a=l(t);if(!a)return null;try{return a.readFileEvidence.get(n,e,i,c)?.payload??null}catch(r){return d(t,"file_evidence read",r),null}}function R(t,n,e,i,a){let r=l(t);if(r)try{r.writeFileEvidence.run(n,e,i,c,a)}catch(o){d(t,"file_evidence write",o)}}function w(t,n,e,i,a){let r=l(t);if(!r)return null;try{return r.readCallees.get(n,e,i,a,c)?.payload??null}catch(o){return d(t,"semantic_callees read",o),null}}function F(t,n){if(n.length===0)return;let e=l(t);if(e)try{e.evidence.transaction(()=>{let i=new Set;for(let a of n){let r=`${a.relativePath}\0${a.contentHash}`;i.has(r)||(i.add(r),e.dropStaleCallees.run(a.relativePath,a.contentHash)),e.writeCallees.run(a.relativePath,a.symbol,a.contentHash,a.depsDigest,c,a.payload)}})()}catch(i){d(t,"semantic_callees write",i)}}export{S as a,O as b,A as c,R as d,w as e,F as f};
|
|
22
|
-
//# sourceMappingURL=chunk-A4L36SZS.js.map
|
package/dist/chunk-A7RNHUJH.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-3ZYF3ELZ.js";import{e as b}from"./chunk-FUPDW5AC.js";import{c as h,f as p,h as y}from"./chunk-JM72FNGA.js";import{execFileSync as d}from"child_process";import{existsSync as N,readFileSync as v}from"fs";import{basename as R}from"path";function C(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=[],n.set(t.file,i)),i.push(t)}return n}var P="Unable to compute git diff.";function fe(e,n={}){let t=n.plan??E(e,n);return t.note?O(t.note,t.changedFileLines):t.changedFiles.length===0?$(t.changedFileLines):A(t.changedFiles,[T(e,t.changedFiles,t.changedFiles,t.changedRanges)])}function E(e,n={}){let{base:t="HEAD"}=n;try{let i=k(e.config.projectRoot,t),r=G(e,i),s=Y(e,z(e.config.projectRoot,t));return{changedFileLines:i,changedFiles:r,changedRanges:s,renamedFiles:W(e.config.projectRoot,t,r),note:i.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:P}}}function T(e,n,t,i=[]){let r=new S(e),s=new Set(t),a=C(i),l=[],m=new Map,f=n.flatMap(o=>r.definitionsForFile(o)).filter(ee).filter(o=>V(o,a)).sort((o,u)=>o.relativePath.localeCompare(u.relativePath)||o.startLine-u.startLine),c=f.map(o=>o.symbolId),g=K(e,c),x=Q(e,c,t),M=b(e,f.filter(o=>g.get(o.symbolId)===0));for(let o of f)j(e,o,s,l,m,M.get(o.symbolId)??new Set,g.get(o.symbolId)??0,x.get(o.symbolId)??new Set);return{changedSymbols:l,consumerEntries:[...m.entries()].map(([o,u])=>({file:o,symbols:[...u].sort()}))}}function A(e,n){let t=new Map,i=n.flatMap(s=>s.changedSymbols);for(let s of n)for(let a of s.consumerEntries){let l=t.get(a.file);l||(l=new Set,t.set(a.file,l));for(let m of a.symbols)l.add(m)}let r=X(t);return{changedFiles:[...e],changedSymbols:i,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:i.length,totalAffectedFiles:r.length}}}function O(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function $(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function k(e,n){let t=d("git",["diff","--name-only",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-only","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4}),r=d("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([t,i,r].flatMap(s=>s.split(`
|
|
2
|
-
`)).map(s=>s.trim()).filter(s=>s.length>0))]}function z(e,n){let t=d("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return w([...D(t),...D(i)])}function B(e,n,t){try{return d("git",["show",`${n}:./${t}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function W(e,n,t){if(t.length===0)return[];let i=new Map,r=new Set;for(let a of H(e,n))t.includes(a.to)&&(i.set(a.to,a),r.add(a.from));let s=U(e,n);if(s.length===0)return[...i.values()].sort((a,l)=>a.to.localeCompare(l.to));for(let a of t){if(i.has(a)||!N(`${e}/${a}`))continue;let l=s.filter(c=>!r.has(c)).filter(c=>R(c)===R(a));if(l.length===0)continue;let m=v(`${e}/${a}`,"utf-8"),f=l.map(c=>({from:c,to:a,similarity:J(B(e,n,c)??"",m)})).sort((c,g)=>g.similarity-c.similarity)[0];f&&f.similarity>=.45&&(i.set(a,f),r.add(f.from))}return[...i.values()].sort((a,l)=>a.to.localeCompare(l.to))}function U(e,n){let t=d("git",["diff","--name-only","--diff-filter=D",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-only","--diff-filter=D","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([...F(t),...F(i)])]}function H(e,n){let t=d("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:1e4}),i=d("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:1e4});return[...t.split(`
|
|
3
|
-
`),...i.split(`
|
|
4
|
-
`)].map(r=>r.trim()).filter(r=>r.startsWith("R")).map(r=>r.split(" ")).filter(r=>r.length>=3).map(([r,s,a])=>({from:s,to:a,similarity:Number(r.slice(1))/100}))}function J(e,n){let t=new Set(I(e)),i=new Set(I(n));if(t.size===0&&i.size===0)return 1;if(t.size===0||i.size===0)return 0;let r=0;for(let s of t)i.has(s)&&(r+=1);return 2*r/(t.size+i.size)}function I(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function F(e){return e.split(`
|
|
5
|
-
`).map(n=>n.trim()).filter(n=>n.length>0)}function G(e,n){let t=_(e),i=[];for(let r of n){let s=t(r);s&&!e.isIgnored(s)&&i.push(s)}return i}function Y(e,n){let t=_(e),i=[];for(let r of n){let s=t(r.file);s&&!e.isIgnored(s)&&i.push({...r,file:s})}return w(i)}function _(e){let n=e.all(`SELECT relative_path FROM documents
|
|
6
|
-
ORDER BY id`).map(i=>i.relative_path),t=new Map(n.map(i=>[i,i]));return i=>{let r=i.replace(/\\/g,"/"),s=t.get(r);return s||(n.find(a=>a.endsWith(r))??null)}}function D(e){let n=[],t=null;for(let i of e.split(`
|
|
7
|
-
`)){if(i.startsWith("+++ ")){t=q(i.slice(4).trim());continue}if(!t||!i.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(i);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);n.push({file:t,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return n}function q(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function w(e){let n=new Set,t=[];for(let i of e){let r=`${i.file}:${i.startLine}:${i.endLine}`;n.has(r)||(n.add(r),t.push(i))}return t}function V(e,n){let t=n.get(e.relativePath);return!t||t.length===0?!0:t.some(i=>Z(e.startLine,e.endLine,i.startLine,i.endLine))}function Z(e,n,t,i){return e<=i&&t<=n}function j(e,n,t,i,r,s,a,l){let m=Math.max(a,s.size);if(!ne(n,m))return;let f=h(n.symbol);i.push({symbol:n.symbol,shortName:f,file:n.relativePath,startLine:n.startLine,endLine:n.endLine,fanIn:m});for(let c of l)L(e,t,r,c,f);for(let c of s)L(e,t,r,c,f)}function K(e,n){if(n.length===0)return new Map;let t=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
|
|
8
|
-
FROM mentions m
|
|
9
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
-
WHERE m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
11
|
-
AND m.role != 1
|
|
12
|
-
GROUP BY m.symbol_id`,...n);return new Map(t.map(i=>[i.symbol_id,i.fan_in]))}function Q(e,n,t){if(n.length===0||t.length===0)return new Map;let i=e.all(`SELECT DISTINCT m.symbol_id, ref_d.relative_path
|
|
13
|
-
FROM mentions m
|
|
14
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
15
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
16
|
-
WHERE m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
17
|
-
AND m.role != 1
|
|
18
|
-
AND ref_d.relative_path NOT IN (${t.map(()=>"?").join(",")})
|
|
19
|
-
${e.pathExclusionsFor("ref_d")}`,...n,...t),r=new Map;for(let s of i){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function L(e,n,t,i,r){if(e.isIgnored(i)||n.has(i))return;let s=t.get(i);s||(s=new Set,t.set(i,s)),s.add(r)}function X(e){return[...e.entries()].map(([n,t])=>({file:n,consumedSymbols:t.size})).sort((n,t)=>t.consumedSymbols-n.consumedSymbols)}function ee(e){return!(y(e.symbol)||e.parentTypeName!==null&&!p(e.symbol))}function ne(e,n){return p(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{C as a,P as b,fe as c,E as d,T as e,A as f,B as g};
|
|
20
|
-
//# sourceMappingURL=chunk-A7RNHUJH.js.map
|
package/dist/chunk-AYYIZ4BA.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as O,d as I}from"./chunk-KRGBLZT2.js";import{b as v,c as N,d as E}from"./chunk-A4L36SZS.js";import{existsSync as X,readFileSync as M}from"fs";import{join as D}from"path";function L(t,n){let e=$(t,n)??W(t,n)??G(t,n)??Z(t,n);return J(t,e,n)}function $(t,n){let e=-1,i=null;for(let o=0;o<=n;o+=1){let r=x(t[o]??"");r&&(i===null?(i=r,e=o):r===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let o=n+1;o<t.length;o+=1)if(x(t[o]??"")===i)return{start:e,end:o+1};return{start:e,end:t.length}}function x(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function W(t,n){if(!T(t[n]??""))return null;let e=n;for(;e>0&&T(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&T(t[i]??"");)i+=1;return{start:e,end:i}}function T(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function G(t,n){let e=n;for(;e>=0;){let r=t[e]??"";if(y(r)!==null)break;if(k(r)!==null)return null;e-=1}if(e<0)return null;let i=y(t[e]??"");if(i===null)return null;let o=e+1;for(;o<t.length;){let r=t[o]??"",s=y(r);if(s!==null){if(s<=i)break;o+=1;continue}if(k(r)!==null)break;o+=1}return{start:e,end:o}}function y(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function Z(t,n){let e=t[n]??"";if(F(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&j(t[i-1]??"");)i-=1;let o=n+1;for(;o<t.length&&j(t[o]??"");)o+=1;return{start:i,end:o}}function j(t){return k(t)===null}function k(t){return t.trim().length===0?"blank":F(t)?"heading":x(t)?"fence":T(t)?"table":y(t)!==null?"list":null}function F(t){return/^#{1,6}\s+/.test(t.trim())}function J(t,n,e){let{start:i,end:o}=n;if(o-i>40){let s=Math.floor(20);i=Math.max(i,e-s),o=Math.min(o,i+40),i=Math.max(n.start,o-40)}let r=t.slice(i,o).join(`
|
|
2
|
-
`).trim();return r.length<=2e3?r:`${r.slice(0,2e3).trimEnd()}...`}function w(t,n){return n.filter(e=>t.includes(e))}var p=/\.(?:md|mdx|rst|txt)$/i;function q(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var K=3,H=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function ft(t,n={}){let{doc:e,limit:i=20,minCoupling:o=K}=n,r=Y(t);if(!r)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let s=[];for(let c of r.docFiles){if(e!==void 0&&!c.includes(e)||e===void 0&&!z(t,c)||e!==void 0&&!X(D(t.config.projectRoot,c)))continue;let d=Math.max(0,...r.changeTimes.get(c)??[]),g=Q(t,c),l=new Map,{resolved:a,broken:u,citations:m}=P(t,c,r.tracked,r.trackedBySuffix,r.everSeenInHistory),S=new Map(m.map(f=>[f.file,f.contexts]));for(let f of a){if(f===c||p.test(f))continue;let h=(r.changeTimes.get(f)??[]).filter(b=>b>d).length;h!==0&&l.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:h,...A("reference",g),citationContexts:S.get(f)})}for(let[f,h]of r.coupling.get(c)??[]){if(h<o||!r.tracked.has(f))continue;let b=(r.changeTimes.get(f)??[]).filter(U=>U>d).length;if(b===0)continue;let C=l.get(f);C?(C.evidence="both",C.coChanges=h,Object.assign(C,A("both",g))):l.set(f,{file:f,evidence:"co-change",coChanges:h,changesSinceDocUpdate:b,...A("co-change",g)})}if(l.size===0&&u.length===0)continue;let _=[...l.values()].sort((f,h)=>h.changesSinceDocUpdate-f.changesSinceDocUpdate);s.push({doc:c,docLastChangedAt:d,staleness:_.reduce((f,h)=>f+h.changesSinceDocUpdate,0)+u.length*10,subjects:_.slice(0,8),brokenReferences:u})}return s.sort((c,d)=>d.staleness-c.staleness),{available:!0,commitsAnalyzed:r.historyCommitCount,docsScanned:r.docFiles.length,findings:s.slice(0,i)}}function Q(t,n){let e;try{e=M(D(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
|
|
3
|
-
${e}`.toLowerCase(),o=w(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(o.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${o.join(", ")}`]};let r=w(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return r.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${r.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function A(t,n){return{actionTier:V(t,n.docIntent),docIntent:n.docIntent,docIntentReasons:n.reasons}}function V(t,n){return n==="historical-note"?"support":t==="co-change"?"signal":"direct"}function Y(t){let n=O(t);if(!n)return null;let e=I(t)??new Set,i=new Map,o=new Map,r=new Set;for(let s of n.commits){let c=[...new Set(s.files)],d=c.filter(l=>p.test(l)),g=c.filter(l=>!p.test(l));for(let l of c){r.add(l);let a=i.get(l)??[];a.push(s.timestamp),i.set(l,a)}for(let l of d){let a=o.get(l);a||(a=new Map,o.set(l,a));for(let u of g)a.set(u,(a.get(u)??0)+1)}}return{changeTimes:i,coupling:o,docFiles:[...e].filter(s=>p.test(s)),everSeenInHistory:r,historyCommitCount:n.commits.length,tracked:e,trackedBySuffix:B(e)}}function gt(t,n){let e=I(t)??new Set,i=B(e),o=[];for(let r of e){if(!z(t,r))continue;let{resolved:s,citations:c}=P(t,r,e,i,new Set),d=[...s].filter(g=>n.has(g));if(d.length>0){let g=d.sort(),l=new Set(g),a=c.filter(u=>l.has(u.file));o.push({doc:r,cited:g,citations:a,citedClaims:R(a.flatMap(u=>u.contexts)).slice(0,3)})}}return o}function z(t,n){return p.test(n)&&!q(n)&&X(D(t.config.projectRoot,n))}function B(t){let n=new Map;for(let e of t){let i=e.split("/");for(let o of[2,3]){if(i.length<o)continue;let r=i.slice(-o).join("/"),s=n.get(r)??[];s.push(e),n.set(r,s)}}return n}function P(t,n,e,i,o){let r=new Set,s=new Set,c=et(t,n);if(!c)return{resolved:r,broken:[],citations:[]};let d=tt(t,n,c),g=new Map,l=(a,u)=>{let m=d.get(u);if(!m||m.length===0)return;let S=g.get(a)??[];S.push(...m),g.set(a,R(S).slice(0,3))};for(let a of c){if(e.has(a)){r.add(a),l(a,a);continue}let u=i.get(a);if(u&&u.length===1){r.add(u[0]),l(u[0],a);continue}u&&u.length>1||o.has(a)&&s.add(a)}return{resolved:r,broken:[...s],citations:[...g].map(([a,u])=>({file:a,contexts:u}))}}function tt(t,n,e){let i;try{i=M(D(t.config.projectRoot,n),"utf-8").split(/\r?\n/)}catch{return new Map}let o=new Set(e),r=new Map;for(let s=0;s<i.length;s+=1){let c=i[s]??"";for(let d of c.matchAll(H)){let g=d[0].replace(/^\.?\//,"");if(!o.has(g))continue;let l=L(i,s);if(l.length===0)continue;let a=r.get(g)??[];a.push(l),r.set(g,R(a).slice(0,3))}}return r}function R(t){let n=[];for(let e of new Set(t))n.some(i=>nt(i,e))||n.push(e);return n}function nt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),o=Math.min(e.length,i.length);if(o===0)return!1;if(o<3)return t.includes(n)||n.includes(t);let r=new Set(i),s=e.filter(c=>r.has(c)).length;return s>=3&&s/o>=.6}function et(t,n){let e;try{e=M(D(t.config.projectRoot,n),"utf-8")}catch{return null}let i=v(t,n,e),o=N(t,"doc-path-tokens",n,i);if(o!==null)try{return JSON.parse(o)}catch{}let r=[...new Set([...e.matchAll(H)].map(s=>s[0].replace(/^\.?\//,"")))];return E(t,"doc-path-tokens",n,i,JSON.stringify(r)),r}export{L as a,w as b,q as c,ft as d,gt as e};
|
|
4
|
-
//# sourceMappingURL=chunk-AYYIZ4BA.js.map
|
package/dist/chunk-BKDXBJDQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{g as p}from"./chunk-3UW7VM4H.js";import{a as d,c as f,e as u}from"./chunk-JM72FNGA.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},c=new Map;for(let[e,i]of Object.entries(m))c.set(i.toLowerCase(),Number(e));function y(e){let i=parseInt(e,10);if(!isNaN(i))return i;let s=e.toLowerCase(),n=c.get(s);if(n!==void 0)return n;for(let[r,o]of c)if(r.includes(s))return o;return null}function K(e,i,s={}){let{scope:n,limit:r=100}=s,o=y(i);return o===null?[]:b(e,n).map(t=>({row:t,resolvedKind:g(t)})).filter(t=>t.resolvedKind===o).slice(0,r).map(({row:t,resolvedKind:l})=>({symbol:t.symbol,shortName:f(t.symbol),kind:l,kindName:m[l]??"Unknown",relativePath:t.relative_path,startLine:t.start_line,endLine:t.end_line}))}function P(e,i={}){let s=new Map;for(let n of b(e,i.scope)){let r=g(n);r===null||r===0||s.set(r,(s.get(r)??0)+1)}return[...s.entries()].sort((n,r)=>r[1]-n[1]||n[0]-r[0]).map(([n,r])=>({kind:n,kindName:m[n]??"Unknown",count:r}))}function b(e,i){return p(e,{scope:i}).map(S)}function S(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function g(e){return e.kind!==null&&e.kind!==0?h(e.kind,e.symbol,e.documentation):k(e.symbol,e.documentation,e.enclosing_symbol)}function h(e,i,s){let n=(s??"").toLowerCase();if(u(i)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function k(e,i,s){let n=d(e);if("kind"in n)return null;let r=n.descriptors,o=r[r.length-2]??null,a=u(e),t=(i??"").toLowerCase();return a==="type"?t.includes("type ")?76:t.includes("interface ")?27:t.includes("struct ")?68:t.includes("trait ")?73:(t.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:t.includes("async def ")||t.includes("def ")?23:(s?u(s):o?.suffix??null)==="type"?21:83}export{K as a,P as b};
|
|
2
|
-
//# sourceMappingURL=chunk-BKDXBJDQ.js.map
|
package/dist/chunk-C3MZZ2ZN.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as G}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-3ZYF3ELZ.js";import{b as j,e as O,f as B,g as W}from"./chunk-ZQLO2SCU.js";import{a as z}from"./chunk-GZCQTZLK.js";import{c as V,d as U,f as v,j as q}from"./chunk-HVTYSC26.js";import{b as I}from"./chunk-FOQHUKNZ.js";import{f as H,m as x}from"./chunk-3UW7VM4H.js";import{c as F,f as k,g as N,h as T,i as M,j as A}from"./chunk-JM72FNGA.js";import{a as P,d as _}from"./chunk-EWC3UK4V.js";import{a as h}from"./chunk-64MNV6AB.js";import{b as S}from"./chunk-7S5E7KWT.js";var b=new WeakMap;function K(e,n){let t=P(n);return t==="rust"?pe(e,n):t==="typescript"||t==="tsx"||t==="javascript"?de(e,n):[]}var ue=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]);function de(e,n){let t=_(e,n);if(!t)return[];let i=b.get(t);if(i)return i;let r=!1,o=t.rootNode;for(let c of o.namedChildren){if(c.type!=="expression_statement")continue;let l=c.namedChild(0);if(!l||l.type!=="call_expression")continue;let u=l.namedChild(0);if(!u)continue;let a=u.type==="member_expression"?u.namedChild(u.namedChildCount-1)?.text:u.text;if(a&&ue.has(a)){r=!0;break}}let s=[];r&&s.push({startLine:0,endLine:o.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let c of o.namedChildren){let l=null,u=null;if(c.type==="function_declaration")l=c.namedChild(0)?.text??null,u=c;else if(c.type==="export_statement"){let a=c.namedChild(0);a?.type==="function_declaration"&&(l=a.namedChild(0)?.text??null,u=a)}else if(c.type==="lexical_declaration"){let a=c.namedChild(0);if(a?.type==="variable_declarator"){let d=a.namedChild(0)?.text,f=a.namedChild(1);d&&(f?.type==="arrow_function"||f?.type==="function_expression")&&(l=d,u=a)}}l&&/^use[A-Z]/.test(l)&&u&&s.push({startLine:u.startPosition.row,endLine:u.endPosition.row,reason:"React custom hook (use*)"})}return s.push(...X(t,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),b.set(t,s),s}var fe=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function me(e){return fe.test(e)}function X(e,n,t){let i=[],r=o=>{if(n.has(o.type)&&o.parent){let c=o.parent.children,l=-1;for(let u=0;u<c.length;u+=1)if(c[u].startIndex===o.startIndex&&c[u].type===o.type){l=u;break}if(l>0)for(let u=l-1;u>=0;u-=1){let a=c[u];if(t.has(a.type)){if(me(a.text)){i.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(a.type==="attribute_item"||a.type==="inner_attribute_item"))break}}for(let s of o.namedChildren)r(s)};return r(e.rootNode),i}function pe(e,n){let t=_(e,n);if(!t)return[];let i=b.get(t);if(i)return i;let r=[],o=be(t);return o?(b.set(t,o),o):(Z(t.rootNode,r,!1,!1),r.push(...X(t,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(...ve(t.rootNode)),b.set(t,r),r)}function be(e){return Ee(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function Z(e,n,t,i){let r=t,o=i;e.type==="trait_item"&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?ye(e,n,t,i):i&&_e(e)?n.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"?ge(e,n,t):e.type==="mod_item"&&C(e).some(s=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(s))&&(r=!0);for(let s of e.namedChildren)Z(s,n,r,o)}function ye(e,n,t,i){let r=C(e),o=null;i?o="trait impl method (dynamic dispatch)":t&&(o="inside #[cfg(test)] mod");for(let s of r){let c=xe(s);if(c){o=c;break}if(Q(s)){o="#[allow(dead_code)]";break}}o&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o})}function ge(e,n,t){let i=C(e),r=e.namedChildren.find(o=>o.type==="type_identifier")?.text;i.some(Se)&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),i.some(Q)&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),t&&n.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function C(e){let n=e.parent;if(!n)return[];let t=n.children,i=-1;for(let o=0;o<t.length;o+=1)if(t[o].startIndex===e.startIndex&&t[o].type===e.type){i=o;break}if(i<=0)return[];let r=[];for(let o=i-1;o>=0;o-=1){let s=t[o];if(s.type==="attribute_item"||s.type==="inner_attribute_item")r.push(s.text);else{if(s.type==="line_comment"||s.type==="block_comment")continue;break}}return r}var he=[{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 xe(e){return he.find(({re:n})=>n.test(e))?.reason??null}var Re=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function Se(e){return/#\[\s*derive\s*\(/.test(e)?Re.some(n=>n.test(e)):!1}function Q(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function _e(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function ve(e){let n=De(e);if(n.size===0)return[];let t=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&n.has(r)&&t.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return t}function Ee(e){for(let n=0;n<Math.min(e.namedChildCount,12);n+=1){let t=e.namedChild(n);if(!t||t.type!=="line_comment"&&t.type!=="block_comment")break;if(/@generated\b/.test(t.text)||/This file is .*generated\b/i.test(t.text)||/Code generated by/i.test(t.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(t.text)||/openapi-generator/i.test(t.text)&&/Generated by/i.test(t.text))return!0}return!1}var Ce=/^#!?\[\s*serde\s*\(/,J=/\bwith\s*=\s*"([^"]+)"/g;function De(e){let n=new Set;for(let t of e.descendantsOfType("attribute_item")){if(!Ce.test(t.text))continue;J.lastIndex=0;let i;for(;(i=J.exec(t.text))!==null;){let r=i[1],o=r.split("::").pop()??r;o&&n.add(o)}}return n}function Y(e){let n=new Map,t=i=>{let r=n.get(i);if(r)return r;let o=K(e,i);return r={ranges:o.map(s=>({startLine:s.startLine,endLine:s.endLine})),containers:new Set(o.map(s=>s.containerName).filter(s=>!!s))},n.set(i,r),r};return(i,r,o,s)=>{let c=t(i);for(let l of c.ranges)if(r>=l.startLine&&r<=l.endLine)return!0;if(s&&c.containers.has(s))return!0;for(let l of x(o))if(c.containers.has(l))return!0;return!1}}function ze(e,n={}){S(e,{groups:n.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function D(e,n,t={}){S(e,{groups:t.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:n.replace(/\\/g,"/")})}function ee(e,n){return n.isIgnoredPath(e.relativePath)?m("ignored-file"):T(e.symbol)?m("module-like-symbol"):$(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&$(e.enclosingSymbol)?m("nested-non-callable-value"):!n.includeTests&&!w(e.relativePath)?m("test-file"):!n.includeTests&&n.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?m("excluded-file-region"):M(e.symbol)?m("rust-trait-impl-member"):A(e.symbol)?m("rust-test-module"):!n.includeMembers&&!we(e)?m("member"):e.endLine-e.startLine+1<n.minLoc?m("below-min-loc"):{accepted:!0}:m("non-value-symbol")}function w(e){return j(e)!=="test"}function m(e){return{accepted:!1,rejectionReason:e}}function $(e){return N(e)||e.endsWith("().")||e.endsWith(".")}function we(e){return k(e.symbol)||x(e.symbol).length===0}function te(){return new Map}function ne(e,n,t){let i=new Map;for(let r of V(e,t))e.isIgnored(r.relative_path)||n.has(r.relative_path)||R(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function re(e,n,t){let i=new Set;for(let r of U(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||i.add(r.symbol_id);return i}function L(e,n){let t=e.get(n);if(!t)return!1;for(let i of t.values())if(i.occurrences>0)return!0;return!1}function ie(e){return e?.occurrences??0}function R(e,n,t,i,r="source-fallback"){if(i<=0)return;let o=se(e,n,t);o.occurrences+=i,o.sources.add(r)}function oe(e,n,t,i,r){if(i<=0)return;let o=se(e,n,t);o.occurrences=Math.max(i,o.occurrences),o.sources.add(r)}function se(e,n,t){let i=e.get(n);i||(i=new Map,e.set(n,i));let r=i.get(t);return r||(r={occurrences:0,sources:new Set},i.set(t,r)),r}function mt(e,n={}){let{scope:t,minLoc:i=1,includeTests:r=!1,skipBarrels:o=!1,includeMembers:s=!1,deadCodeOnly:c=!1,scanLimit:l,semantic:u=!0}=n,a=G(Le(e,{scope:t,minLoc:i,includeTests:r,includeMembers:s}),l),d=o?new Set(O(e)):new Set,f=c?te():ne(e,d,a.map(p=>p.symbolId)),y=c?re(e,a.map(p=>p.symbolId),d):new Set,g=c?a.filter(p=>!y.has(p.symbolId)):a;c?Ne(e,g,f,d):ke(e,g,f,d);let ce=c?g.filter(p=>!L(f,p.symbolId)):a;Oe(e,ce,f,{includeTests:r,inactiveBarrelPaths:d,includeSemantic:!c&&u});let le=c?g.filter(p=>!L(f,p.symbolId)):a;return Fe(e,Pe(le,f))}function Le(e,n){let t=Y(e),i=[];for(let r of h(e,{scope:n.scope}))try{for(let o of H(e,r))ee(o,{minLoc:n.minLoc,includeTests:n.includeTests,includeMembers:n.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:t}).accepted&&i.push(o)}finally{D(e,r,{definitions:!0})}return i}function Pe(e,n){return e.map(t=>Ie(t,n)).filter(t=>t.cross_file_refs===0).sort((t,i)=>i.loc-t.loc||t.relative_path.localeCompare(i.relative_path)||t.start_line-i.start_line)}function Ie(e,n){let t=n.get(e.symbolId)??new Map,i=ie(t.get(e.relativePath)),r=0;for(let[o,s]of t)o!==e.relativePath&&(r+=s.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 Fe(e,n){let t=[],i=0,r=0,o=0;for(let s of n){if(e.isIgnored(s.relative_path)||B(e,s.relative_path)||W(e,s.symbol,s.relative_path))continue;let c=s.same_file_refs===0?"dead-code":"file-internal";c==="dead-code"?i++:r++,o+=s.loc,t.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:F(s.symbol),sameFileRefs:s.same_file_refs,kind:c})}return{symbols:t,counts:{total:t.length,deadCode:i,fileInternal:r,loc:o},totalCount:t.length,deadCodeCount:i,fileInternalCount:r,totalLoc:o}}function ke(e,n,t,i){if(n.length===0)return;let r=new E(e),o=new Set(n.map(l=>l.symbolId)),s=new Set(n.map(l=>l.leaf).filter(Boolean)),c=new Set(r.sourceFiles());for(let l of h(e))c.add(l);r.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:s,skipPath:l=>i.has(l)},l=>{o.has(l.target.symbolId)&&(Ae(e,l)||R(t,l.target.symbolId,l.sourceFile,je(l),"source-fallback"))})}function Ne(e,n,t,i){if(n.length===0)return;let r=new E(e),o=Te(n),s=new Set(r.sourceFiles());for(let a of h(e))s.add(a);let c=new Set(o.keys()),l=new Map,u=a=>{let d=l.get(a);return d||(d=q(e,a),l.set(a,d)),d};r.scanSourceReferences({paths:s,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:a=>i.has(a),resolveTargets:({sourceFile:a,name:d,kind:f})=>{let y=o.get(d);return y?Me(a,d,y,u(a),{permissive:f!=="cross-language-dispatch"}):[]},afterPath:a=>{l.delete(a),D(e,a)}},a=>{let d=a.kind==="identifier"&&a.sourceFile===a.target.relativePath?Math.max(0,a.occurrences-1):a.occurrences;a.kind==="identifier"&&ae(e,{sourceFile:a.sourceFile,name:a.name,target:a.target,occurrences:d})||R(t,a.target.symbolId,a.sourceFile,d,"source-fallback")})}function Te(e){let n=new Map;for(let t of e){if(!t.leaf)continue;let i=n.get(t.leaf)??[];i.push(t),n.set(t.leaf,i)}return n}function Me(e,n,t,i,r){let o=t.filter(l=>l.relativePath===e);if(o.length>0)return o;if(!r.permissive&&t.length===1)return[...t];let s=i.get(n);if(s)for(let l of s){let u=t.filter(a=>v(l,a.relativePath));if(u.length>0)return u}let c=new Set;for(let l of i.values())for(let u of l)c.add(u);for(let l of c){let u=t.filter(a=>v(l,a.relativePath));if(u.length>0&&u.length===t.length)return u}return r.permissive?[...t]:[]}function Ae(e,n){return n.kind==="cross-language-dispatch"&&n.target.relativePath===n.sourceFile?!0:n.kind==="identifier"&&ae(e,n)}function je(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function ae(e,n){return n.occurrences>1?!1:I(e,n.sourceFile).some(t=>t.used||t.sourcePath!==n.target.relativePath?!1:t.importedName===n.name||t.localName===n.name)}function Oe(e,n,t,i){for(let r of n){let o=z(e,r,{semantic:i.includeSemantic!==!1});if(o.length!==0)for(let s of o){let c=s.file;c===r.relativePath||e.isIgnored(c)||i.inactiveBarrelPaths.has(c)||!i.includeTests&&!w(c)||oe(t,r.symbolId,c,1,"caller-map")}}}export{ze as a,mt as b};
|
|
2
|
-
//# sourceMappingURL=chunk-C3MZZ2ZN.js.map
|
package/dist/chunk-CRU42NJU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as P}from"./chunk-64MNV6AB.js";import{a as j,d as O,f as w}from"./chunk-7S5E7KWT.js";function G(t){return t.replace(/'''[\s\S]*?'''/g,f).replace(/"""[\s\S]*?"""/g,f).replace(/#.*$/gm,f).replace(/\/\/.*$/gm,f).replace(/\/\*[\s\S]*?\*\//g,f).replace(/`(?:\\[\s\S]|[^`])*`/g,f).replace(/'(?:\\.|[^'\\\r\n])*'/g,f).replace(/"(?:\\.|[^"\\\r\n])*"/g,f)}function f(t){return t.replace(/[^\r\n]/g," ")}var Tt=w("stripped-lines",{clearGroups:["whole-project","source-file"]});j({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{_=null,E=""},clearFile:()=>{_=null,E=""}});var _=null,E="";function V(t){return _===t||(_=t,E=G(t)),E}function Rt(t,n,e){let r=V(t);return`${r.slice(0,n)}${" ".repeat(e-n)}${r.slice(e)}`}function Dt(t,n){return new RegExp(`\\b${v(n)}\\b`,"m").test(t)}function $t(t,n){let e=new Set,r=new RegExp(`\\b${v(n)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let o of t.matchAll(r)){let s=o[1];s&&e.add(s)}return[...e]}function v(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yt(t){let n=0;for(let e of t)e==="("&&(n+=1),e===")"&&(n-=1);return n}import{existsSync as T}from"fs";import{basename as Y,dirname as S,extname as p,join as g,relative as h,resolve as u}from"path";var K=O("indexed-paths",{clearGroups:[]}),m=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],X=[".py",".pyi"],b=[".java",".scala",".kt",".kts"],k=[".rs"],A=[".rb"],L=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],W=[".cs",".vb"],H=[".dart"],U=[".php"],Q=new Set(m),R=new Set(X),J=new Set(b),D=new Set(k),$=new Set(A),M=new Set(L),B=new Set(W),y=new Set(H),z=new Set(U),Z=[{extensions:m,lookup:Q},{extensions:X,lookup:R},{extensions:b,lookup:J},{extensions:k,lookup:D},{extensions:A,lookup:$},{extensions:L,lookup:M},{extensions:W,lookup:B},{extensions:H,lookup:y},{extensions:U,lookup:z}];function x(t,n){return n.has(p(t).toLowerCase())}function q(t){return x(t,R)}function tt(t){return x(t,J)}function nt(t){return x(t,D)}function et(t){return x(t,$)}function rt(t){return x(t,M)}function ot(t){return x(t,B)}function vt(t){return p(t).toLowerCase()===".vb"}function st(t){return x(t,y)}function it(t){return x(t,z)}function ct(t){let n=p(t).toLowerCase();for(let e of Z)if(e.lookup.has(n))return e.extensions;return m}function at(t){return tt(t)||ot(t)||it(t)}function Xt(t,n,e){return q(n)?ut(t,n,e):nt(n)?gt(t,n,e):et(n)?pt(t,n,e):rt(n)?ft(t,n,e):at(n)?St(t,e.replace(/\\/g,"."),ct(n)):st(n)?xt(t,n,e):lt(t,n,e)}function lt(t,n,e){if(!e.startsWith(".")&&!e.startsWith("/"))return null;let r=S(g(t.config.projectRoot,n)),o=u(r,e),s=N(t);for(let c of Nt(o)){let a=d(h(t.config.projectRoot,c));if(s.has(a)||T(c))return a}return d(h(t.config.projectRoot,o))}function ut(t,n,e){let r=N(t),o;if(e.startsWith(".")){let s=e.match(/^(\.+)(.*)$/);if(!s)return null;let c=s[1].length,a=s[2].replace(/^\./,""),i=S(g(t.config.projectRoot,n));for(let l=1;l<c;l++)i=S(i);o=a?u(i,a.replace(/\./g,"/")):i}else o=u(t.config.projectRoot,e.replace(/\./g,"/"));for(let s of dt(o)){let c=d(h(t.config.projectRoot,s));if(r.has(c)||T(s))return c}return null}function gt(t,n,e){if(!e)return null;let r=e.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=S(g(t.config.projectRoot,n)),s;return r.startsWith("crate::")?s=u(t.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=u(o,r.slice(6).replace(/::/g,"/")):s=u(S(o),r.slice(7).replace(/::/g,"/")),C(t,Et(s))}function pt(t,n,e){let r=S(g(t.config.projectRoot,n)),o=u(r,e);return C(t,ht(o))}function ft(t,n,e){let r=S(g(t.config.projectRoot,n)),o=[u(r,e),u(t.config.projectRoot,e),u(t.config.projectRoot,"include",e),u(t.config.projectRoot,"src",e)];return C(t,o)}function St(t,n,e){let r=N(t),o=n.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),c=o.split(".").pop()??o;for(let i of e){let l=`${s}${i}`,I=[...r].find(F=>F.endsWith(l));if(I)return I}for(let i of e){let l=[...r].find(I=>Y(I)===`${c}${i}`);if(l)return l}let a=[...r].filter(i=>e.includes(p(i).toLowerCase())).filter(i=>i.includes(`/${s}/`)||i.includes(`/${c}/`)).sort((i,l)=>i.localeCompare(l));return a.length===1?a[0]:null}function xt(t,n,e){let r=N(t);if(e.startsWith("package:")){let c=e.slice(8),a=c.indexOf("/");if(a<0)return null;let i=c.slice(a+1),l=d(i.startsWith("lib/")?i:`lib/${i}`);return r.has(l)?l:null}let o=S(g(t.config.projectRoot,n)),s=u(o,e);for(let c of mt(s)){let a=d(h(t.config.projectRoot,c));if(r.has(a)||T(c))return a}return null}function dt(t){let n=p(t);return R.has(n)?[t]:[`${t}.py`,`${t}.pyi`,g(t,"__init__.py"),g(t,"__init__.pyi")]}function C(t,n){let e=N(t);for(let r of n){let o=d(h(t.config.projectRoot,r));if(e.has(o)||T(r))return o}return null}function Et(t){let n=p(t);return D.has(n)?[t]:[`${t}.rs`,g(t,"mod.rs")]}function ht(t){let n=p(t);return $.has(n)?[t]:[`${t}.rb`,g(t,"index.rb")]}function mt(t){let n=p(t);return y.has(n)?[t]:[`${t}.dart`,t]}function Nt(t){let n=p(t),e=new Set;if(n){e.add(t);for(let r of m)e.add(t.slice(0,-n.length)+r)}else for(let r of m)e.add(`${t}${r}`),e.add(g(t,`index${r}`));return[...e]}function N(t){return K.get(t,()=>new Set(P(t,{includeIgnored:!1}).map(d)))}function d(t){return t.replace(/\\/g,"/")}export{m as a,X as b,b as c,k as d,A as e,L as f,W as g,H as h,U as i,vt as j,ct as k,Xt as l,ut as m,gt as n,pt as o,ft as p,St as q,xt as r,d as s,G as t,Rt as u,Dt as v,$t as w,yt as x};
|
|
2
|
-
//# sourceMappingURL=chunk-CRU42NJU.js.map
|
package/dist/chunk-ERHOS6AW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as C,b as F,e as V,f as b,h as g,i as N}from"./chunk-D322LMSA.js";import{c as _}from"./chunk-OBBDKQAG.js";import{e as T}from"./chunk-7S5E7KWT.js";import{ElementTypes as q,NodeTypes as w,parse as W}from"@vue/compiler-dom";import{parse as Ae}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 G=T("vue-template-facts"),H=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),Y=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"]),K=new Set(["div","span","template"]),J=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 $(e,t){let n=t.replace(/\\/g,"/"),r=C(e,n);return G.get(e,n,r,()=>Q(n,b(e,n).template))}function Q(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=W(t.body,{comments:!1})}catch{return n}let i=new Set,o=s=>{s.trim()&&i.add(s)};return E(r.children,t.startLine,n,o),n.structuralTokens=[...i].sort(),n}function E(e,t,n,r){for(let i of e)i.type===w.ELEMENT&&(X(i,t,n,r),E(i.children,t,n,r))}function X(e,t,n,r){let i=ae(e.tag),o={tag:e.tag,normalized:i,kind:se(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),K.has(e.tag)||r(`native:${e.tag}`));for(let s of e.props)ee(s,t,n,r)}function ee(e,t,n,r){if(e.type===w.ATTRIBUTE){let a=e.value?.content??null,u=A("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(u),r(`prop:${e.name}`);return}let i=ne(e),o=B(e.exp),s=A(te(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&&re(o,t,e.loc.start.line,n,r)}function A(e,t,n,r,i,o){return{kind:e,name:t,value:n,startLine:h(r,i),endLine:h(r,o)}}function te(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function ne(e){let t=B(e.arg);return t||e.name}function B(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function re(e,t,n,r,i){for(let o of ie(e)){let s={name:o,startLine:h(t,n),endLine:h(t,n)};r.expressionIdentifiers.push(s),i(`id:${o}`)}}function ie(e){let t=new Set,n=oe(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,i;for(;i=r.exec(n);){let o=i[0];J.has(o)||/^[A-Z_]+$/.test(o)||t.add(o)}return[...t].sort()}function oe(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 se(e){let t=e.tag;return e.tagType===q.COMPONENT?"component":H.has(t)?"builtin":Y.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function ae(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 ce=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function D(e,t){let n=le(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:R(n.functionNode),params:k(n.functionNode),paramsEndLine:I(n.functionNode),isLiteralPassthrough:z(n.functionNode,t)};if(!ue(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:R(e),params:k(e),paramsEndLine:I(e),isLiteralPassthrough:z(e,t)}:null}function U(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function k(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 I(e){let t=U(e);return t?t.endPosition.row:e.startPosition.row}function ue(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?ce.has(e):!1}function le(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 R(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 z(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(v=>v.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 pe=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),me=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),fe=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),de=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),ge=new Set(["catch","for","function","if","return","switch","while"]);function j(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(...be(n));let r=V(n.astLanguage,n.body);r?ye(n,r.rootNode,t):Se(n,t)}return he(t),t.externalScriptPaths=Z(t.externalScriptPaths),t}function he(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 Z(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function ye(e,t,n){let r=new Set,i=new Set,o=s=>{let a=D(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=N(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 Se(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||ge.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+L(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+L(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+L(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}}function be(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+L(e.body,n.index??0);for(let s of Le(r))t.push({local:s,source:i,sourcePath:e.sourcePath,line:o,setup:e.setup})}return t}function Le(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"),pe.has(e)&&t.push("reactivity"),me.has(e)&&t.push("lifecycle"),fe.has(e)&&t.push("request"),de.has(e)&&t.push("macro"),t}function L(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 Z(e){return[...new Set(e)].sort()}var ve=new Set(["in","key","of"]),xe=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]);function Ye(e,t={}){let 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=b(e,n),i=$(e,n),o=j(r),s=Fe(i),a=i.expressionIdentifiers.map(p=>p.name).filter(p=>!s.includes(p)).filter((p,d,x)=>x.indexOf(p)===d).sort(),u=i.componentTags.map(p=>p.normalized).filter((p,d,x)=>x.indexOf(p)===d).sort(),l=F(e,n).length,m=g(r.template),c=o.lineCount,f=r.styles.reduce((p,d)=>p+g(d),0),v=r.customBlocks.reduce((p,d)=>p+g(d),0);return{file:n,sfc:r,templateFacts:i,scriptFacts:o,templateTokens:new Set(i.structuralTokens),behaviorTokens:Ce(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:v}}function Ce(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(xe.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 Fe(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Ve(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of M(n.value))t.add(r);return[...t].sort()}function Ve(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?M(t[1]??""):[]}function M(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{D as a,P as b,Ye as c};
|
|
2
|
-
//# sourceMappingURL=chunk-ERHOS6AW.js.map
|
package/dist/chunk-EWC3UK4V.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as f,b as h,e as m,g as x,i as N}from"./chunk-D322LMSA.js";import{c as y}from"./chunk-OBBDKQAG.js";import{f as g}from"./chunk-7S5E7KWT.js";import{extname as S}from"path";var R={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function p(e){return R[S(e).toLowerCase()]??null}function k(e){return S(e).toLowerCase()===".vue"}import{extname as B}from"path";import{parse as $}from"@vue/compiler-sfc";function v(e){let t=$(e),n=t.descriptor.scriptSetup??t.descriptor.script;if(!n||n.src)return null;let s=x(n.lang??null);return s?{body:n.content,startLine:Math.max(0,n.loc.start.line-1),language:s}:null}var b=g("ast-trees",{clearGroups:["whole-project","source-file"]});function _(e,t){if(k(t))return E(e,t);let n=p(t);if(!n)return null;let s=f(e,t);return s?b.get(e,t,s,()=>m(n,s)):null}function E(e,t){let n=f(e,t);return n?b.get(e,t,n,()=>{let s=v(n);if(!s)return null;let r=`
|
|
2
|
-
`.repeat(s.startLine)+s.body;return m(s.language,r)}):null}var O=[".tsx",".jsx"],C=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),J=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),P=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),D=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),V=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),q=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),I=new Set(["children","className","false","key","null","style","true","undefined"]),Z=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]);function Le(e,t={}){let n=y(e,{extensions:O}).filter(r=>!t.scope||r.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(r=>z(e,r)).filter(r=>(t.minJsxTokens===void 0||r.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||r.behaviorTokens.size>=t.minBehaviorTokens))}function z(e,t){let n=t.replace(/\\/g,"/"),s=H(n);if(!s)return[];let r=_(e,n);if(!r)return[];let o=h(e,n).length;return M(r.rootNode,s).filter(a=>a.kind==="hook"||A(a.bodyNode)).map(a=>{let l=Q(a.bodyNode),u=ne(a.bodyNode,s);return{file:n,name:a.name,kind:a.kind,startLine:a.node.startPosition.row,endLine:a.node.endPosition.row,loc:Math.max(1,a.node.endPosition.row-a.node.startPosition.row+1),fileLines:o,jsxTokens:l.tokens,behaviorTokens:u.tokens,componentNames:c(l.componentNames),nativeTags:c(l.nativeTags),propNames:c(l.propNames),eventNames:c(l.eventNames),hookNames:c(u.hookNames),requestNames:c(u.requestNames),stateNames:c(u.stateNames),effectNames:c(u.effectNames),handlerNames:c(u.handlerNames)}})}function H(e){let t=B(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:p(e)}function M(e,t){let n=[],s=new Set,r=o=>{let i=K(o);if(i&&!U(o)){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;s.has(a)||(s.add(a),n.push(i));return}for(let a of o.namedChildren)r(a)};return(t==="tsx"||t==="javascript")&&r(e),n}function K(e){if(e.type==="function_declaration"){let o=j(e);return!o||!L(o)?null:{name:o,kind:w(o),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),s=d(t);if(!s||!n||!L(s))return null;let r=W(n);return r?{name:s,kind:w(s),node:e,bodyNode:r}:null}function L(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function w(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function W(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=G(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(r=>r.type==="arguments")?.namedChildren.find(r=>r.type==="arrow_function"||r.type==="function_expression")??null}function U(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function j(e){return d(e.childForFieldName("name")??e.namedChild(0))}function G(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function A(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(A)}function Q(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=s=>{s.type==="jsx_opening_element"||s.type==="jsx_self_closing_element"?X(s,t):s.type==="jsx_expression"?Y(s,t):s.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let r of s.namedChildren)n(r)};return n(e),t}function X(e,t){let n=ee(e),s=!1;if(n){let r=T(n);s=ie(r),s?(t.componentNames.add(r),t.tokens.add(`component:${r}`)):(t.nativeTags.add(r),t.tokens.add(`native:${r}`))}for(let r of e.namedChildren)if(r.type==="jsx_attribute"){let o=te(r);if(!o)continue;let i=T(o);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,l=>l.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else Z.has(i)||(t.propNames.add(i),t.tokens.add(`${s?"prop":"native-prop"}:${i}`))}else r.type==="jsx_spread_attribute"&&t.tokens.add("prop:spread")}function Y(e,t){let n=e.text;(n.includes("&&")||n.includes("?"))&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let s of ce(n))I.has(s)||t.tokens.add(`binding:${s}`)}function ee(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function te(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function ne(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},s=r=>{if(r.type==="call_expression"){let o=N(r,t);o&&se(o.calleeLeaf,n)}else if(r.type==="variable_declarator")oe(r,n);else if(r.type==="function_declaration"){let o=j(r);o&&F(o,n)}for(let o of r.namedChildren)s(o)};return s(e),n}function se(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!C.has(e)&&!D.has(e)&&t.tokens.add(`hook:${e}`)),C.has(e)&&t.tokens.add(`react-hook:${e}`),J.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),P.has(e)&&t.tokens.add(`state-hook:${e}`),re(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function re(e){if(V.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function oe(e,t){let n=e.childForFieldName("name")??e.namedChild(0),s=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&s?.text.includes("useState")){let o=n.namedChildren.find(a=>d(a)),i=d(o);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let r=d(n);r&&F(r,t)}function F(e,t){let n=ae(e);!n||!q.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function ae(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function ie(e){return/^[A-Z]/.test(e)||e.includes(".")}function T(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function d(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function ce(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let s=n[0];t.includes(s)||t.push(s)}return t}function c(e){return[...e].sort()}export{p as a,k as b,v as c,_ as d,Le as e};
|
|
3
|
-
//# sourceMappingURL=chunk-EWC3UK4V.js.map
|
package/dist/chunk-FOQHUKNZ.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as te,b as re,c as b,d as se,e as ne,f as oe,g as j,h as ie,i as U,j as ae,k as pe,l as E,m as W,n as T,o as V,p as z,q as S,r as Q,s as J,u as R,v as h,w as M,x as G}from"./chunk-CRU42NJU.js";import{b as le}from"./chunk-ERHOS6AW.js";import{a as ce,b as me,d as C}from"./chunk-EWC3UK4V.js";import{a as v}from"./chunk-D322LMSA.js";import{c as L}from"./chunk-7S5E7KWT.js";import{basename as ue}from"path";var ke=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(t){let r=[],e=0,s=0;for(let n=0;n<t.length;n++){let o=t[n];(o==="{"||o==="["||o==="(")&&e++,(o==="}"||o==="]"||o===")")&&e--,o===","&&e===0&&(r.push(t.slice(s,n)),s=n+1)}return r.push(t.slice(s)),r}function y(t,r){for(let e of t.namedChildren)if(e.type===r)return e;return null}function g(t,r){let e=new Set,s=(n,o)=>{let i=o||r.has(n.type);!i&&ke.has(n.type)&&e.add(n.text);for(let a of n.children)s(a,i)};return s(t.rootNode,!1),e}function P(t,r,e,s,n,o,i){return{importedName:n,localName:o,sourcePath:i??S(t,s,pe(r)),kind:"named",used:h(e,o),usedMembers:[]}}function f(t,r,e,s,n="named",o={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function $(t,r,e,s,n="named",o=[],i={}){return{importedName:t,localName:r,sourcePath:e,kind:n,used:s,usedMembers:o,isTypeOnly:i.isTypeOnly}}function D(t,r){return{importedName:t,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function O(t,r,e={}){return{importedName:t,localName:e.localName??null,sourcePath:r,kind:"namespace",used:e.used??!0,usedMembers:e.usedMembers??[],isTypeOnly:e.isTypeOnly}}function N(t,r,e){let s=[];for(let n of t.matchAll(r)){let o=n[0];if(!o||typeof n.index!="number")continue;let i=R(t,n.index,n.index+o.length);for(let a of e(n,i))s.push(a)}return s}function I(t,r,e,s){let n=C(t,r);if(n){let o=e(n);if(o)return o}return s()}function X(t,r,e,s){let n=C(t,r),o=ce(r),i=o?e[o]:void 0;return n&&i?i(n):s()}function de(t,r,e){return I(t,r,s=>we(t,r,s),()=>Ae(t,r,e))}function Ae(t,r,e){return N(e,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(s,n)=>{let o=s[1]?.trim();if(!o)return[];let i=ue(o).replace(/\.[^.]+$/,"");return[$(o,i,z(t,r,o),h(n,i))]})}function we(t,r,e){let s=g(e,new Set(["preproc_include"])),n=[];for(let o of e.rootNode.descendantsOfType("preproc_include")){let i=null;for(let p of o.namedChildren){if(p.type==="system_lib_string"){i=p.text.replace(/^<|>$/g,"");break}if(p.type==="string_literal"){i=p.namedChildren.find(c=>c.type==="string_content")?.text??p.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=ue(i).replace(/\.[^.]+$/,"");n.push(f(i,a,z(t,r,i),s))}return n}function fe(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=n[1]?.trim(),i=n[2]?.trim()??null,a=n[0];if(!o||!a||typeof n.index!="number")continue;let p=R(e,n.index,n.index+a.length);s.push({importedName:o,localName:i,sourcePath:Q(t,r,o),kind:i?"namespace":"side-effect",used:i?h(p,i):!0,usedMembers:i?M(p,i):[]})}return s}function ge(t,r,e){let s=[];for(let n of e.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=n[1]?.trim();o&&s.push({specifier:o,sourcePath:Q(t,r,o)})}return s}function Se(t,r,e){return X(t,r,{csharp:s=>je(t,r,s),vb:s=>Le(t,r,s)},()=>{let s=ae(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(e,s,(n,o)=>{let i=n[1]?.trim();if(!i)return[];let[a,p]=i.split(/\s*=\s*/),m=!!p,c=(m?p:a)?.trim()??i,l=c.split(".").pop()??c,u=m?a?.trim()??l:l;return[P(t,r,o,c,l,u,S(t,c,j))]})})}function Le(t,r,e){let s=g(e,new Set(["imports_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(u=>u.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],p=i.length>1?i[0]:null,m=a.text,c=m.split(".").pop()??m,l=p?.text??c;n.push(f(c,l,S(t,m,j),s,p?"namespace":"named"))}return n}function je(t,r,e){let s=g(e,new Set(["using_directive"])),n=[];for(let o of e.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,p;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],p=i[1]):p=i[i.length-1];let m=p.text,c=m.split(".").pop()??m,l=a?.text??c;n.push(f(c,l,S(t,m,j),s,a?"namespace":"named"))}return n}var ve=L("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function he(t,r){return ve.get(t,r,()=>{let e=new Set,s=v(t,r);if(!s)return e;let o=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))e.add(i[0]);return e})}function Y(t,r,e){return I(t,r,s=>$e(t,r,s),()=>Me(t,r,e))}function Me(t,r,e){return Qe(e).flatMap(s=>Ge(t,r,s.clause,s.specifier,s.start,s.end,e))}function $e(t,r,e){let s=qe(t,r,e),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))n.push(...Ue(t,r,e,o,s));return n}function qe(t,r,e){let s=g(e,new Set(["import_statement"]));if(me(r))for(let n of he(t,r))s.add(n);return s}function Ue(t,r,e,s,n){let o=Be(s);if(!o)return[];let i=E(t,r,o),a=y(s,"import_clause");return a?We(e,a,i,n,He(s.text)):[D("*",i)]}function We(t,r,e,s,n){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Fe(i.text,e,s,n));else if(i.type==="namespace_import"){let a=Je(t,i,e,s,n);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Xe(i,e,s,n));return o}function Fe(t,r,e,s){return f("default",t,r,e,"default",{isTypeOnly:s})}function Je(t,r,e,s,n){let i=y(r,"identifier")?.text??"";if(!i)return null;let a=ze(t,i);return O("*",e,{localName:i,usedMembers:a,isTypeOnly:n,used:a.length>0||s.has(i)})}function Xe(t,r,e,s){let n=[];for(let o of t.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let p=i.text,m=a?.text??p;n.push(f(p,m,r,e,"named",{isTypeOnly:s||Ve(o.text)}))}return n}function Be(t){let r=y(t,"string");if(!r)return null;let e=y(r,"string_fragment");return e?e.text:null}function He(t){return/^\s*import\s+type\b/.test(t)}function Ve(t){return/^\s*type\b/.test(t.trim())}function ze(t,r){let e=new Set;for(let s of t.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),o=s.namedChild(1);!n||!o||n.type!=="identifier"||n.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&e.add(o.text)}return[...e]}function Qe(t){let r=[],e=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(e)){let o=n[0],i=n[1],a=n[2];!o||!a||typeof n.index!="number"||r.push({clause:i,specifier:a,start:n.index,end:n.index+o.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of t.matchAll(s)){let o=n[0],i=n[1];!o||!i||typeof n.index!="number"||r.push({clause:null,specifier:i,start:n.index,end:n.index+o.length})}return r.sort((n,o)=>n.start-o.start)}function Ge(t,r,e,s,n,o,i){let a=E(t,r,s),p=R(i,n,o);return e?Ye(e).map(c=>({...c,sourcePath:a})).map(c=>{if(c.kind==="namespace"){let l=M(p,c.localName);return O(c.importedName,c.sourcePath,{localName:c.localName,usedMembers:l,used:l.length>0||h(p,c.localName),isTypeOnly:c.isTypeOnly})}return c.kind==="side-effect"?D(c.importedName,c.sourcePath):$(c.importedName,c.localName??"",c.sourcePath,c.localName?h(p,c.localName):!1,c.kind,[],{isTypeOnly:c.isTypeOnly})}):[D("*",a)]}function Ye(t){let r=t.trim(),e=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,o]=Ke(s),i=[];return n&&i.push(...xe(n,e)),o&&i.push(...xe(o,e)),i}function xe(t,r){let e=t.trim();if(!e)return[];if(e.startsWith("{")){let s=e.slice(1,-1).trim();return s?x(s).map(n=>{let o=n.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[p,m]=a.split(/\s+as\s+/);return{importedName:p.trim(),localName:(m??p).trim(),kind:"named",isTypeOnly:i}}):[]}return e.startsWith("* as ")?[{importedName:"*",localName:e.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:e,kind:"default",isTypeOnly:r}]}function Ke(t){let r=0;for(let e=0;e<t.length;e++){let s=t[e];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[t.slice(0,e).trim(),t.slice(e+1).trim()]}return[t.trim(),null]}function K(t,r,e){let s=C(t,r);return s?nt(t,r,s):Ze(t,r,e)}function Ze(t,r,e){return[...et(t,r,e),...tt(t,r,e),...rt(t,r,e)]}function et(t,r,e){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",p=x(i).map(l=>st(l.trim())).filter(l=>!!l),m=q(e,o.index),c=q(e,o.index+o[0].length-1);s.push({kind:"named",sourcePath:E(t,r,a),names:p,startLine:m,endLine:c})}return s}function tt(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[2]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star-as",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function rt(t,r,e){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of e.matchAll(n)){if(typeof o.index!="number")continue;let i=o[1]??"",a=q(e,o.index),p=q(e,o.index+o[0].length-1);s.push({kind:"star",sourcePath:E(t,r,i),names:[],startLine:a,endLine:p})}return s}function st(t){if(!t)return null;let r=t.replace(/^type\s+/,"").trim();if(!r)return null;let e=r.match(/^(\w+)\s+as\s+(\w+)$/);if(e)return e[2]??null;let s=r.match(/^(\w+)$/);return s?s[1]??null:null}function q(t,r){let e=0;for(let s=0;s<r&&s<t.length;s++)t.charCodeAt(s)===10&&e++;return e}function nt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("export_statement")){let o=ot(t,r,n);if(o===void 0)continue;let i=n.startPosition.row,a=n.endPosition.row,p=it(n,o,i,a);s.push(p)}return s}function ot(t,r,e){let s=y(e,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return E(t,r,n.text)}function it(t,r,e,s){let n=y(t,"export_clause");if(n){let i=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let p=a.namedChild(0),m=a.namedChild(1);p&&i.push((m??p).text)}return{kind:"named",sourcePath:r,names:i,startLine:e,endLine:s}}return y(t,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:e,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:e,endLine:s}}function ye(t,r,e){return X(t,r,{java:s=>at(t,r,s),kotlin:s=>pt(t,r,s),scala:s=>ct(t,r,s)},()=>N(e,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(s,n)=>{let o=s[1]?.trim();return o?mt(t,r,o,n):[]}))}function at(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(l=>l.type==="asterisk"),p=o.namedChildren.find(l=>l.type==="scoped_identifier")??o.namedChildren.find(l=>l.type==="identifier");if(!p)continue;let m=p.text;if(i){n.push(O("*",S(t,m,b)));continue}let c=m.split(".").pop()??m;n.push(f(c,c,S(t,m,b),s))}return n}function pt(t,r,e){let s=g(e,new Set(["import_header","import_list"])),n=[];for(let o of e.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),p=o.namedChildren.find(d=>d.type==="import_alias");if(a){n.push(O("*",S(t,i.text,b)));continue}let m=i.text,c=m.split(".").pop()??m,u=p?.namedChild(0)?.text??c;n.push(f(c,u,S(t,m,b),s))}return n}function ct(t,r,e){let s=g(e,new Set(["import_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(l=>l.type==="namespace_selectors"||l.type==="namespace_wildcard"),a=o.namedChildren.filter(l=>l!==i&&(l.type==="identifier"||l.type==="stable_identifier")),p=a.map(l=>l.text).join(".");if(!p)continue;if(i?.type==="namespace_wildcard"){n.push(O("*",S(t,p,b)));continue}if(i?.type==="namespace_selectors"){for(let l of i.namedChildren)if(l.type==="arrow_renamed_identifier"){let[u,d]=l.namedChildren;if(!u)continue;let _=u.text,A=d?.text??_;if(_==="_")continue;n.push(f(_,A,S(t,`${p}.${_}`,b),s))}else if(l.type==="identifier"){let u=l.text;n.push(f(u,u,S(t,`${p}.${u}`,b),s))}continue}let m=a[a.length-1]?.text??p,c=a.slice(0,-1).map(l=>l.text).join(".")||p;n.push(f(m,m,S(t,c&&a.length>1?`${c}.${m}`:p,b),s))}return n}function mt(t,r,e,s){if(e.includes("{")&&e.includes("}")){let n=e.slice(0,e.indexOf("{")).replace(/\.$/,"").trim(),o=e.slice(e.indexOf("{")+1,e.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),c=p?.trim();if(!c||c==="_")return[];let l=(m??c.split(".").pop()??c).trim(),u=c==="_"?n:`${n}.${c}`.replace(/\.\./g,".");return[P(t,r,s,u,c,l)]})}return[P(t,r,s,e,e.split(".").pop()??e,e.split(".").pop()??e)]}function Ie(t,r,e){return I(t,r,s=>lt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?x(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[p,m]=a.split(/\s+as\s+/i),c=p?.trim()??a,l=c.split("\\").pop()??c,u=(m??l).trim();return[P(t,r,n,c,l,u,S(t,c.replace(/\\/g,"."),U))]}):[]}))}function lt(t,r,e){let s=g(e,new Set(["namespace_use_declaration"])),n=[],o=(i,a,p)=>{n.push(f(a,p,S(t,i.replace(/\\/g,"."),U),s))};for(let i of e.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(p=>p.type==="namespace_use_group");if(a){let p=i.namedChildren.find(m=>m.type==="namespace_name")?.text??"";for(let m of a.namedChildren){if(m.type!=="namespace_use_clause")continue;let{importedName:c,localName:l,qualified:u}=Ne(m,p);c&&o(u,c,l)}continue}for(let p of i.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:m,localName:c,qualified:l}=Ne(p,"");m&&o(l,m,c)}}return n}function Ne(t,r){let e=t.namedChildren.find(m=>m.type==="qualified_name"),s=t.namedChildren.filter(m=>m.type==="name"),n="";e?n=e.text:s.length>=1&&(n=s[0].text);let o=e&&s.length>0?s[s.length-1]:null,i=n.split("\\").pop()??n,a=o?.text??i,p=r?`${r}\\${n}`:n;return{importedName:i,localName:a,qualified:p}}function Pe(t,r,e){return I(t,r,s=>ut(t,r,s),()=>ft(e).flatMap(s=>St(t,r,s,e)))}function ut(t,r,e){let s=g(e,new Set(["import_statement","import_from_statement"])),n=[];for(let o of e.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=be(i);if(!a)continue;let p=W(t,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:p,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let o of e.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=dt(i);if(a===null)continue;let p=W(t,r,a);for(let m=1;m<o.namedChildCount;m+=1){let c=o.namedChild(m);if(c.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:p,kind:"side-effect",used:!0,usedMembers:[]});continue}let l=be(c);l&&n.push({importedName:l.qualifiedName,localName:l.localName,sourcePath:p,kind:"named",used:s.has(l.localName),usedMembers:[]})}}return n}function be(t){if(t.type==="aliased_import"){let r=t.namedChild(0),e=t.namedChild(1);return!r||!e?null:{qualifiedName:r.text,localName:e.text}}if(t.type==="dotted_name"){let r=t.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return t.type==="identifier"?{qualifiedName:t.text,localName:t.text}:null}function dt(t){if(t.type==="dotted_name")return t.text;if(t.type==="relative_import"){let r=y(t,"import_prefix")?.text??"",e=y(t,"dotted_name")?.text??"";return`${r}${e}`}return null}function ft(t){let r=t.split(`
|
|
2
|
-
`),e=[],s=0;for(let n=0;n<r.length;n++){let o=r[n],i=o.trimStart(),a=s;if(s+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let p=o,m=a+o.length,c=G(o);for(;n+1<r.length&&(c>0||p.trimEnd().endsWith("\\"));){n++;let u=r[n];p+=`
|
|
3
|
-
${u}`,m+=1+u.length,c+=G(u),s+=u.length+1}let l=gt(p);l&&e.push({...l,start:a,end:m})}return e}function gt(t){let r=t.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let e=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!e)return null;let s=e[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:e[1],clause:s}}function St(t,r,e,s){let n=R(s,e.start,e.end),o=e.clause.replace(/\n/g," ").trim();if(e.kind==="import")return x(o).flatMap(p=>{let m=p.trim().replace(/,$/,"");if(!m)return[];let[c,l]=m.split(/\s+as\s+/),u=c.trim(),d=(l??u.split(".")[0]??u).trim(),_=W(t,r,u),A=M(n,d);return[{importedName:u,localName:d,sourcePath:_,kind:"namespace",used:h(n,d)||A.length>0,usedMembers:A}]});let i=e.module?W(t,r,e.module):null,a=[];for(let p of x(o)){let m=p.trim().replace(/,$/,"");if(!m)continue;if(m==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[c,l]=m.split(/\s+as\s+/),u=(l??c).trim();a.push({importedName:c.trim(),localName:u,sourcePath:i,kind:"named",used:h(n,u),usedMembers:[]})}return a}import{basename as ht}from"path";function _e(t,r,e){return I(t,r,s=>yt(t,r,s),()=>xt(t,r,e))}function xt(t,r,e){return N(e,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(s,n)=>{let o=s[1],i=s[2];if(!o||!i)return[];let a=o==="require_relative"?V(t,r,i):null;if(a){let p=Ee(i);return[$(p,p,a,h(n,p))]}return[D(i,a)]})}function yt(t,r,e){let s=g(e,new Set([])),n=[],o=new Set(["require","require_relative","load"]);for(let i of e.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let m=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!m||m.type!=="string")continue;let l=m.namedChildren.find(d=>d.type==="string_content")?.text;if(!l)continue;let u=a.text==="require_relative"?V(t,r,l):null;if(u){let d=Ee(l);n.push(f(d,d,u,s))}else n.push(D(l,u))}return n}function Ee(t){return le(ht(t).replace(/\.[^.]+$/,""),/_/)}function Te(t,r,e){return I(t,r,s=>Nt(t,r,s),()=>N(e,/^[ \t]*use\s+(.+?)\s*;$/gm,(s,n)=>{let o=s[1]?.trim();return o?It(t,r,o,n):[]}))}function Nt(t,r,e){let s=g(e,new Set(["use_declaration"])),n=[];for(let o of e.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of F(i,"")){if(!a.importedName||a.importedName==="*")continue;let p=T(t,r,a.qualifiedName)??T(t,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push(f(a.importedName,a.localName,p,s))}}return n}function F(t,r){switch(t.type){case"identifier":case"super":case"self":case"crate":{let e=t.text;return[{qualifiedName:B(r,e),importedName:e,localName:e}]}case"scoped_identifier":{let e=t.text,s=e.split("::").pop()??e;return[{qualifiedName:B(r,e),importedName:s,localName:s}]}case"scoped_use_list":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=B(r,e.text),o=[];for(let i of s.namedChildren)o.push(...F(i,n));return o}case"use_list":{let e=[];for(let s of t.namedChildren)e.push(...F(s,r));return e}case"use_as_clause":{let e=t.namedChild(0),s=t.namedChild(1);if(!e||!s)return[];let n=F(e,r),o=s.text;return n.map(i=>({...i,localName:o}))}case"use_wildcard":{let e=t.namedChild(0),s=e?e.text:"";return[{qualifiedName:B(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function B(t,r){return t?r?`${t}::${r}`:t:r}function It(t,r,e,s){let n=e.trim();if(n.includes("{")&&n.includes("}")){let c=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),l=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(l).flatMap(u=>{let d=u.trim();if(!d||d==="self")return[];let[_,A]=d.split(/\s+as\s+/),w=_?.trim();if(!w)return[];let De=(A??w.split("::").pop()??w).trim(),Oe=`${c}::${w}`.replace(/::::/g,"::");return[P(t,r,s,Oe,w.split("::").pop()??w,De,T(t,r,c))]})}let[o,i]=n.split(/\s+as\s+/),a=o?.trim()??n,p=(i??a.split("::").pop()??a).trim(),m=T(t,r,a)??T(t,r,a.split("::").slice(0,-1).join("::"));return[P(t,r,s,a,a.split("::").pop()??a,p,m)]}function Re(t,r,e){let s=C(t,r);if(s)return bt(t,r,s);let n=[];for(let o of e.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&n.push(..._t(t,r,i))}return n}function bt(t,r,e){let s=[];for(let n of e.rootNode.descendantsOfType("use_declaration")){if(!Pt(n))continue;let o=n.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of F(o,""))i.importedName&&s.push(Z(t,r,i.qualifiedName))}return s}function Pt(t){for(let r of t.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function _t(t,r,e){let s=e.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),o=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[p]=a.split(/\s+as\s+/),m=`${n}::${p?.trim()??a}`.replace(/::::/g,"::");return[Z(t,r,m)]})}return[Z(t,r,s)]}function Z(t,r,e){return{specifier:e,sourcePath:T(t,r,e)??T(t,r,e.split("::").slice(0,-1).join("::"))}}function k({language:t,extensions:r,imports:e,parseImports:s}){return{language:t,extensions:r,capabilities:{imports:e},parseImports:s}}function Ce(t,r){let e=r.toLowerCase();for(let s of t)for(let n of s.extensions)if(e.endsWith(n))return s;return null}var Et={language:"javascript",extensions:te,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Y,parseReExports:K},Tt=k({language:"python",extensions:re,imports:"ast-with-regex-fallback",parseImports:Pe}),Rt=k({language:"jvm",extensions:b,imports:"ast-dispatch-with-regex-fallback",parseImports:ye}),Ct={language:"rust",extensions:se,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:Te,parseExports:Re},Dt=k({language:"ruby",extensions:ne,imports:"ast-with-regex-fallback",parseImports:_e}),Ot=k({language:"c/cpp",extensions:oe,imports:"ast-with-regex-fallback",parseImports:de}),kt=k({language:"dotnet",extensions:j,imports:"ast-dispatch-with-regex-fallback",parseImports:Se}),At={language:"dart",extensions:ie,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:fe,parseExports:ge},wt=k({language:"php",extensions:U,imports:"ast-with-regex-fallback",parseImports:Ie}),Lt=[Et,Tt,Rt,Ct,Dt,Ot,kt,At,wt];function H(t){return Ce(Lt,t)}var ee={clearGroups:["whole-project","source-file"]},jt=L("source-imports",ee),vt=L("source-exports",ee),Mt=L("source-reexports",ee);function Zr(t,r){let e=J(r);return Mt.get(t,e,()=>{let s=H(e);if(!s?.parseReExports)return[];let n=v(t,e);return n?s.parseReExports(t,e,n):[]})}function es(t,r){let e=J(r);return jt.get(t,e,()=>{let s=H(e);if(!s)return[];let n=v(t,e);return n?s.parseImports(t,e,n):[]})}function ts(t,r){let e=J(r);return vt.get(t,e,()=>{let s=H(e);if(!s?.parseExports)return[];let n=v(t,e);return n?s.parseExports(t,e,n):[]})}export{Zr as a,es as b,ts as c};
|
|
4
|
-
//# sourceMappingURL=chunk-FOQHUKNZ.js.map
|
package/dist/chunk-FUPDW5AC.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{l as T}from"./chunk-CRU42NJU.js";import{f as g}from"./chunk-3UW7VM4H.js";import{d as h}from"./chunk-JM72FNGA.js";import{a as k}from"./chunk-64MNV6AB.js";import{a as U,c as W}from"./chunk-7S5E7KWT.js";function p(i,e,t){if(i.has(e))return i.get(e);let n=t();return i.set(e,n),n}import $ from"path";function le(i,e){return i.getReferences().map(t=>{let n=t.getNode();return V(n,e)})}function fe(i){let e=i;return typeof e.findReferences=="function"?e.findReferences():[]}function _(i,e,t,n){let r=[];for(let o of fe(i))for(let s of le(o,n))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||r.push(s);for(let o of t)r.push(o);return N(r)}function B(i,e,t,n){let r=[],o=t?.getStart();for(let s of i.getReferences()){let a=s.getNode();S(n,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||r.push({location:V(a,n),node:a}))}return r}function V(i,e){let t=i.getSourceFile(),n=t.getLineAndColumnAtPos(i.getStart());return{file:S(e,t.getFilePath())??t.getBaseName(),line:n.line-1,column:n.column-1}}function z(i,e,t){let n=i.getSourceFile(),r=y(n,i),o=i.getText(),s=new RegExp(`\\b${pe(o)}\\b`,"g"),a=n.getFullText().split(`
|
|
2
|
-
`),l=[];for(let c=0;c<a.length;c++){if(c===r)continue;let d=a[c]??"";s.lastIndex=0;let u;for(;(u=s.exec(d))!==null;)l.push({file:e,line:c,column:u.index})}return N(l.filter(c=>S(t,$.join(t,c.file))===e))}function R(i){for(let e=i;e;e=e.getParent()){let t=e.getKindName();if(t.includes("Type")||t==="InterfaceDeclaration"||t==="TypeAliasDeclaration")return!0;if(t==="CallExpression"||t==="NewExpression"||t==="ExpressionStatement")return!1}return!1}function y(i,e){return i.getLineAndColumnAtPos(e.getStart()).line-1}function N(i){let e=new Set,t=[];for(let n of i){let r=`${n.file}:${n.line}:${n.column}`;e.has(r)||(e.add(r),t.push(n))}return t}function S(i,e){let t=$.relative(i||process.cwd(),e).replace(/\\/g,"/");return!t||t.startsWith("..")?null:t}function pe(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(i,e,t,n){let r=de(e,n);return r.size===0?new Map:ue(i,t,r)}function de(i,e){let t=new Map;for(let n of g(i,e)){let r=h(n.symbol)??n.leaf;if(!r)continue;let o=t.get(r);o||(o=[],t.set(r,o)),o.push(n)}return t}function ue(i,e,t){let n=new Map,r=new Map;return e.forEachDescendant(o=>{for(let s of me(i,o)){let a=t.get(s);if(!a)continue;let l=y(e,o);for(let c of a){if(l<c.startLine-1||l>c.endLine+1)continue;let d=Math.abs(l-c.startLine),u=r.get(c.symbolId);u!==void 0&&u<=d||(r.set(c.symbolId,d),n.set(c.symbolId,o))}}}),n}function me(i,e){let t=[],n=r=>{r&&!t.includes(r)&&t.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();n(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();n(r)}return i.Node.isIdentifier(e)&&n(e.getText()),t}var ge=W("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function Y(i,e,t,n){let r=q(i,e),o=K(r.get(n)??[],t);if(o)return o;let s=[];for(let a of r.values())for(let l of a)((l.leaf||h(l.symbol)||"").includes(n)||l.symbol.includes(n))&&s.push(l);return K(s,t)}function X(i,e){let t=new Map;for(let[n,r]of q(i,e)){let o=r[0];o&&t.set(n,o)}return t}function q(i,e){return ge.get(i,e,()=>{let t=new Map;for(let n of g(i,e)){let r=n.leaf||h(n.symbol);if(!r)continue;let o=t.get(r);o||(o=[],t.set(r,o)),o.push({...n,leaf:r})}for(let n of t.values())n.sort((r,o)=>r.startLine-o.startLine||r.endLine-o.endLine||r.symbolId-o.symbolId);return t})}function K(i,e){let t=null,n=Number.POSITIVE_INFINITY;for(let r of i){let o=Math.abs(r.startLine-e);(o<n||o===n&&t&&r.startLine<t.startLine)&&(t=r,n=o)}return t}import ye from"path";var x=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function M(i){let e=i.toLowerCase();return x.some(t=>e.endsWith(t))}function G(i,e){let t=new Map,n=r=>M(r)?p(t,r,()=>{let o=ye.join(i.config.projectRoot,r);for(let{project:s}of e){let a=s.getSourceFile(o)??s.addSourceFileAtPathIfExists(o)??null;if(a)return{project:s,sourceFile:a}}return null}):null;return{sourceFile:r=>n(r)?.sourceFile??null,sourceFileMatch:n,indexedTypeScriptLikeDocuments:()=>k(i,{extensions:x})}}import m from"path";import{existsSync as F,readdirSync as he,readFileSync as H}from"fs";function Q(i){let e=m.join(i,"package.json");if(!F(e))return[];let t;try{t=JSON.parse(H(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(r=>Se(i,r)).flatMap(r=>xe(i,r))}function Se(i,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=m.join(i,e);return F(m.join(s,"package.json"))?[s]:[]}let t=e.indexOf("*"),n=e.slice(0,t).replace(/\/$/,""),r=e.slice(t+1).replace(/^\//,""),o=m.join(i,n||".");if(!F(o))return[];try{return he(o).map(s=>m.join(o,s,r)).filter(s=>F(m.join(s,"package.json")))}catch{return[]}}function xe(i,e){try{let t=JSON.parse(H(m.join(e,"package.json"),"utf8"));if(!t.name)return[];let n=m.relative(i,e).replace(/\\/g,"/");return[{name:t.name,rootRelative:n,sourceRootRelative:`${n}/src`}]}catch{return[]}}function Z(i,e){for(let t of i)if(e===t.name||e.startsWith(`${t.name}/`))return t.name;return null}function ee(i){return[`${i.sourceRootRelative}/index.ts`,`${i.sourceRootRelative}/index.tsx`,`${i.sourceRootRelative}/index.mts`,`${i.sourceRootRelative}/index.cts`]}import{existsSync as I,readFileSync as Ie,readdirSync as be,statSync as De}from"fs";import f from"path";var j=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function E(i,e){let n=e?f.dirname(f.join(i,e)):i,r=f.resolve(i);for(;n.startsWith(r);){for(let s of j){let a=f.join(n,s);if(I(a))return a}let o=f.dirname(n);if(o===n)break;n=o}for(let o of j){let s=f.join(i,o);if(I(s))return s}return null}function te(i){let e=i.config.projectRoot,t=new Set(ke(e,i.config.semantic?.typescript?.tsconfigs)),n=k(i,{includeIgnored:!1,extensions:x});for(let r of n){let o=E(e,r);o&&t.add(f.resolve(o))}if(t.size===0){let r=E(e);r&&t.add(f.resolve(r))}return[...t].filter(r=>!ne(e,r)).sort((r,o)=>r.localeCompare(o))}function ke(i,e=[]){let t=new Set;for(let n of e){let r=f.isAbsolute(n)?n:f.join(i,n);I(r)&&t.add(f.resolve(r))}for(let n of Ne(i))for(let r of j){let o=f.join(n,r);I(o)&&t.add(f.resolve(o))}if(t.size===0){let n=E(i);n&&t.add(f.resolve(n))}return[...t].filter(n=>!ne(i,n)).sort((n,r)=>n.localeCompare(r))}function Ne(i){let e=f.join(i,"package.json");if(!I(e))return[];let t;try{t=JSON.parse(Ie(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(r=>Me(i,r))}function Me(i,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=f.join(i,e);return C(s)?[s]:[]}let t=e.indexOf("*"),n=e.slice(0,t).replace(/\/$/,""),r=e.slice(t+1).replace(/^\//,""),o=f.join(i,n||".");return C(o)?be(o).map(s=>f.join(o,s,r)).filter(C):[]}function C(i){try{return De(i).isDirectory()}catch{return!1}}function ne(i,e){let t=f.relative(i,e).replace(/\\/g,"/");return t.startsWith("..")||t.includes("/node_modules/")||t.startsWith("node_modules/")||t.includes("/dist/")||t.startsWith("dist/")}import{createRequire as Fe}from"module";var ve=Fe(import.meta.url),b;function re(){if(b!==void 0)return b;try{b=ve("ts-morph")}catch{b=null}return b}function ie(i,e){return e.map(t=>({tsconfigPath:t,project:new i.Project({tsConfigFilePath:t,skipFileDependencyResolution:!1})}))}function v(i,e,t){return{language:"typescript",availability:()=>({available:!1,reason:i,tsconfigPath:e,tsconfigPaths:t}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function ae(i,e){let t=re();if(!t)return v("ts-morph is not installed");let n=te(i);if(n.length===0)return v("no tsconfig found");try{let r=ie(t,n);return new w(i,t,r)}catch(r){return v(r instanceof Error?r.message:String(r),n[0],n)}}var w=class{constructor(e,t,n){this.db=e;this.tsMorph=t;this.projects=n;this.workspacePackages=Q(e.config.projectRoot),this.sourceFiles=G(e,n)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return p(this.importUsageCache,e,()=>{let t=this.sourceFiles.sourceFile(e);if(!t)return[];let n=[];for(let r of t.getImportDeclarations())for(let o of this.importUsageForDeclaration(e,r))n.push(o);return n})}referencesFor(e){return p(this.referencesCache,e.symbolId,()=>{let t=this.nodeForDefinition(e),n=this.packageImportReferencesForDefinition(e);return t?_(t,e,n,this.db.config.projectRoot):n})}calleesFor(e){return p(this.calleesCache,e.symbolId,()=>p(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}signatureFor(e){return p(this.signatureCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);if(!t||!this.tsMorph.Node.isFunctionDeclaration(t)&&!this.tsMorph.Node.isMethodDeclaration(t)&&!this.tsMorph.Node.isArrowFunction(t)&&!this.tsMorph.Node.isFunctionExpression(t)&&!this.tsMorph.Node.isConstructorDeclaration(t))return null;let n=t.getType().getCallSignatures()[0];if(!n)return null;let r=n.getParameters().map(s=>{let a=s.getDeclarations()[0],l=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return se(l)}),o=n.getReturnType().getText(t);return`(${r.join(",")})=>${se(o)}`})}importUsageForDeclaration(e,t){let n=T(this.db,e,t.getModuleSpecifierValue()),r=oe(t);return t.getImportClause()?.isTypeOnly()?r.map(o=>Pe(e,n,o)):r.map(o=>this.valueImportUsageForEntry(e,n,o))}valueImportUsageForEntry(e,t,n){let r=n.identifier?n.identifier.findReferences():[],o=[];for(let c of r)for(let d of B(c,e,n.identifier,this.db.config.projectRoot))o.push(d);let s=o.some(c=>!R(c.node)),a=o.some(c=>R(c.node)),l=n.isTypeOnly;return{importer:e,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:l,isUsed:l||o.length>0,isTypeUsed:l||a,isValueUsed:s,references:o.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,t=this.packageExports();for(let n of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,t,n);for(let[n,r]of e)e.set(n,N(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,t,n){if(this.db.isIgnored(n))return;let r=this.sourceFiles.sourceFileMatch(n);if(r)for(let o of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,t,n,o)}addPackageImportReferencesForDeclaration(e,t,n,r){let o=Z(this.workspacePackages,r.getModuleSpecifierValue());if(!o)return;let s=t.get(o);if(s)for(let a of oe(r)){if(a.kind!=="named"||!a.identifier)continue;let l=s.get(a.importedName);if(!l||l.size===0)continue;let c=z(a.identifier,n,this.db.config.projectRoot);c.length>0&&Ce(e,l,c)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let e=new Map;for(let t of this.workspacePackages){let n=new Map;for(let r of ee(t))this.collectPackageExports(t,r,n,new Set);n.size>0&&e.set(t.name,n)}return this.packageExportIndex=e,e}collectPackageExports(e,t,n,r){if(r.has(t))return;r.add(t);let o=this.sourceFiles.sourceFile(t);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),l=a?T(this.db,t,a):t;if(!l||!l.startsWith(`${e.sourceRootRelative}/`))continue;let c=s.getNamedExports();if(c.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,l,n,r);continue}for(let d of c){let u=d.getNameNode().getText(),A=d.getAliasNode()?.getText()??u,O=this.indexedDefinitionByLeaf(l,u);if(!O)continue;let D=n.get(A);D||(D=new Set,n.set(A,D)),D.add(O.symbolId)}}}indexedDefinitionByLeaf(e,t){return p(this.indexedDefinitionLeafCache,e,()=>X(this.db,e)).get(t)??null}nodeForDefinition(e){return p(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return p(this.fileDefinitionNodeCache,e,()=>{let t=this.sourceFiles.sourceFile(e);return t?J(this.tsMorph,this.db,t,e):new Map})}definitionFromSymbol(e){let t=e.getDeclarations();for(let n of t){let r=n.getSourceFile(),o=S(this.db.config.projectRoot,r.getFilePath());if(!o||this.db.isIgnored(o))continue;let s=y(r,n),a=Y(this.db,o,s,e.getName());if(a)return{symbol:a.symbol,file:a.relativePath,line:a.startLine}}return null}calleeMapForFile(e){let t=this.sourceFiles.sourceFile(e);if(!t)return new Map;let n=g(this.db,e).sort((o,s)=>o.startLine-s.startLine||s.endLine-o.endLine);if(n.length===0)return new Map;let r=new Map;t.forEachDescendant(o=>{if(!this.tsMorph.Node.isCallExpression(o)&&!this.tsMorph.Node.isNewExpression(o))return;let s=this.semanticCalleeForCallNode(t,n,o);s&&Te(r,s.callerId,s.target)});for(let[o,s]of r)r.set(o,je(s));return r}semanticCalleeForCallNode(e,t,n){let r=Re(t,y(e,n));if(!r)return null;let o=n.getExpression(),s=o.getSymbol()??o.getType().getSymbol(),a=s?this.definitionFromSymbol(s):null;return a?{callerId:r.symbolId,target:{symbol:a.symbol,file:a.file,line:a.line}}:null}};function oe(i){let e=[],t=i.getDefaultImport();t&&e.push({identifier:t,importedName:"default",localName:t.getText(),kind:"default",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});let n=i.getNamespaceImport();n&&e.push({identifier:n,importedName:"*",localName:n.getText(),kind:"namespace",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});for(let r of i.getNamedImports()){let o=r.getNameNode(),a=r.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:r.isTypeOnly()||(i.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Pe(i,e,t){return{importer:i,sourcePath:e,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Te(i,e,t){let n=i.get(e);n||(n=[],i.set(e,n)),n.push(t)}function Re(i,e){let t=null;for(let n of i)e<n.startLine||e>n.endLine||(!t||n.startLine>=t.startLine)&&(t=n);return t}function Ce(i,e,t){for(let n of e){let r=i.get(n)??[];r.push(...t),i.set(n,r)}}function je(i){let e=new Set,t=[];for(let n of i){let r=`${n.symbol}|${n.file}|${n.line}`;e.has(r)||(e.add(r),t.push(n))}return t}function se(i){return i.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var L=new WeakMap;U({name:"semantic-provider",groups:["semantic-provider"],clearAll:i=>L.delete(i)});function ce(i,e){let t=`${i.config.projectRoot}:typescript-workspace`,n=L.get(i);n||(n=new Map,L.set(i,n));let r=n.get(t);if(r)return r;let o=ae(i,e);return n.set(t,o),o}function kt(i,e){let t=P(i,e);return t?t.importUsage(e):[]}function Ee(i,e){let t=P(i,e.relativePath);return t?t.referencesFor(e):[]}function Nt(i,e){let t=new Map;for(let n of e)for(let r of Ee(i,n)){if(r.file===n.relativePath||i.isIgnored(r.file))continue;let o=t.get(n.symbolId);o||(o=new Set,t.set(n.symbolId,o)),o.add(r.file)}return t}function Mt(i,e){let t=new Map;for(let n of e){let r=P(i,n.relativePath);if(!r)continue;let o=r.calleesFor(n);o.length>0&&t.set(n.symbolId,o)}return t}function Ft(i,e){let t=P(i,e.relativePath);return t?t.signatureFor(e):null}function P(i,e){if(!M(e))return null;let t=ce(i,e);return t.availability().available?t:null}export{M as a,ce as b,kt as c,Ee as d,Nt as e,Mt as f,Ft as g};
|
|
3
|
-
//# sourceMappingURL=chunk-FUPDW5AC.js.map
|
package/dist/chunk-G3WGZU5Q.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as p}from"./chunk-B75HZHUP.js";import{a as y}from"./chunk-3ZYF3ELZ.js";import{a as o}from"./chunk-BGBBVSH4.js";import{c as b}from"./chunk-JM72FNGA.js";function P(u,c={}){let{scope:f,minLoc:L=3,scanLimit:l}=c,s=new y(u),r=c.semantic!==!1,t=p(s.productionCallableDefinitions({scope:f,minLoc:L,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof l=="number"&&l>0}),l),h=s.crossFileCallerMap(t,{semantic:r}),a=new Set(h.keys());for(let e of s.frameworkReferencedSymbolIds(t))a.add(e);let n=s.symbolsWithNonSelfCallees(t,{additive:!1,semantic:r}),m=t.filter(e=>!a.has(e.symbolId)).filter(e=>!n.has(e.symbolId)),I=s.sourceFallbackCallerFiles(m);for(let e of I.keys())a.add(e);let d=m.filter(e=>!a.has(e.symbolId)),C=s.symbolsWithNonSelfCallees(d,{additive:!0,semantic:r});for(let e of C)n.add(e);return d.filter(e=>!n.has(e.symbolId)).sort((e,i)=>o(i)-o(e)||e.relativePath.localeCompare(i.relativePath)||e.startLine-i.startLine).map(e=>({symbol:e.symbol,shortName:b(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o(e)}))}export{P as a};
|
|
2
|
-
//# sourceMappingURL=chunk-G3WGZU5Q.js.map
|
package/dist/chunk-HVTYSC26.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{d as C}from"./chunk-FUPDW5AC.js";import{c as _}from"./chunk-MZ7APUFN.js";import{b as S}from"./chunk-FOQHUKNZ.js";import{t as M}from"./chunk-CRU42NJU.js";import{f as y,k as h}from"./chunk-3UW7VM4H.js";import{d as f}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-QLNGUWR7.js";import{a as v}from"./chunk-EWC3UK4V.js";import{a as m}from"./chunk-D322LMSA.js";import{c as I}from"./chunk-OBBDKQAG.js";import{c as g,d as D}from"./chunk-7S5E7KWT.js";function R(e,r,n,t={}){if(!n)return[];let i=m(e,r);return i?i.indexOf(n)===-1?[]:(L(e,r).get(n)??[]).filter(s=>!B(s,t)):[]}function B(e,r){return typeof r.excludeStartLine=="number"&&typeof r.excludeEndLine=="number"&&e>=r.excludeStartLine&&e<=r.excludeEndLine}var G=g("file-identifiers",{clearGroups:["whole-project","source-file"]});function w(e,r){let n=b(e,r);return n?n.fileIdentifiers:G.get(e,r,()=>new Set(L(e,r).keys()))}var H=g("file-ident-lines",{clearGroups:["whole-project","source-file"]});function L(e,r){let n=b(e,r);return n?n.identifierLineMap:H.get(e,r,()=>z(e,r))}var J=g("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function ie(e,r){let n=b(e,r);return n?n.identifiersByLine:J.get(e,r,()=>{let t=L(e,r),i=0;for(let s of t.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of t)for(let a of c)o[a].add(s);return o})}function z(e,r){let n=new Map,t=(c,a)=>{let l=n.get(c);if(!l){n.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=m(e,r);if(!i)return n;let o=M(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&t(l[1],c)}return n}function k(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function d(e,r){return k(e)===k(r)}function O(e,r){let n=new Map;for(let t of S(e,r)){if(!t.sourcePath)continue;let i=t.localName??t.importedName;if(i&&F(n,i,t.sourcePath),t.kind==="namespace")for(let o of t.usedMembers)F(n,o,t.sourcePath)}return n}function F(e,r,n){let t=e.get(r);t||(t=new Set,e.set(r,t)),t.add(n)}function le(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
|
|
2
|
-
m.symbol_id,
|
|
3
|
-
d.relative_path,
|
|
4
|
-
COUNT(*) AS ref_count
|
|
5
|
-
FROM mentions m
|
|
6
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
-
JOIN documents d ON c.document_id = d.id
|
|
8
|
-
WHERE m.role != 1
|
|
9
|
-
${t}
|
|
10
|
-
${e.pathExclusionsFor("d")}
|
|
11
|
-
GROUP BY m.symbol_id, d.relative_path`,...n??[])})}function fe(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
|
|
12
|
-
FROM mentions m
|
|
13
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
14
|
-
JOIN documents d ON c.document_id = d.id
|
|
15
|
-
WHERE m.role != 1
|
|
16
|
-
${t}
|
|
17
|
-
${e.pathExclusionsFor("d")}`,...n??[])}).filter(n=>n.symbol_id!==null)}function A(e,r){return E(e,r,n=>{let t=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
|
|
18
|
-
c.start_line AS chunk_start, c.end_line AS chunk_end
|
|
19
|
-
FROM mentions m
|
|
20
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
21
|
-
JOIN documents d ON c.document_id = d.id
|
|
22
|
-
WHERE m.role != 1
|
|
23
|
-
${t}
|
|
24
|
-
${e.pathExclusionsFor("d")}
|
|
25
|
-
ORDER BY d.relative_path, c.start_line`,...n??[])})}function E(e,r,n){if(!r)return n();if(r.length===0)return[];let t=[];for(let i=0;i<r.length;i+=750)t.push(...n(r.slice(i,i+750)));return t}function Se(e,r){let n=T(e);return n?r.filter(t=>T(t.file)===n):r}function ye(e,r,n,t){let i=n.find(o=>o.file===r);if(i)return i;if(t){let o=new Set(S(e,r).map(s=>s.sourcePath).filter(s=>!!s));for(let s of n)for(let c of o)if(d(c,s.file))return s;return null}return n.length===1?n[0]:null}function T(e){let r=v(e);return r?r==="typescript"||r==="tsx"||r==="javascript"?"javascript-family":r:null}var W=D("global-leaf-index",{clearGroups:["whole-project"]});function x(e){return W.get(e,()=>{let r=e.all(`SELECT gs.id, gs.symbol,
|
|
26
|
-
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
27
|
-
FROM global_symbols gs
|
|
28
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
29
|
-
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
30
|
-
LEFT JOIN (
|
|
31
|
-
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
32
|
-
FROM mentions m
|
|
33
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
34
|
-
JOIN documents d ON c.document_id = d.id
|
|
35
|
-
WHERE m.role = 1
|
|
36
|
-
GROUP BY m.symbol_id
|
|
37
|
-
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
38
|
-
WHERE 1 = 1
|
|
39
|
-
${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of r){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let i=f(t.symbol);if(!i)continue;let o=n.get(i);o||(o=[],n.set(i,o)),o.some(s=>s.symbolId===t.id)||o.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}function N(e,r,n){let t=x(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[p(t[0])];let i=t.filter(a=>a.file===r);if(i.length>0)return i.map(p);let o=O(e,r),s=o.get(n);if(s)for(let a of s){let l=t.filter(u=>d(a,u.file));if(l.length>0)return l.map(p)}let c=new Set;for(let a of o.values())for(let l of a)c.add(l);for(let a of c){let l=t.filter(u=>d(a,u.file));if(l.length>0&&l.length===t.length)return l.map(p)}return[]}function Ce(e,r,n){let t=N(e,r,n);if(t.length>0)return t;let i=x(e).get(n);return!i||i.length===0?[]:i.map(p)}function $(e,r,n={}){let t=_(e,r);if(!t)return[];let i=f(t.symbol);if(!i)return[];if(n.semantic!==!1){let s=C(e,{...t,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let c=new Map;for(let a of s){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return P(e,c)}}let o=new Map;for(let s of I(e)){let c=m(e,s);if(!c||c.indexOf(i)===-1||s!==t.relativePath&&!N(e,s,i).some(u=>u.symbolId===t.symbolId))continue;let a=R(e,s,i,s===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});a.length>0&&o.set(s,a)}return P(e,o)}function we(e,r){let n=new Map;for(let o of r){if(!o.leaf)continue;let s=n.get(o.leaf)??[];s.push(o),n.set(o.leaf,s)}if(n.size===0)return new Map;let t=new Set(r.map(o=>o.symbolId)),i=new Map;for(let o of I(e)){let s=w(e,o);if(s.size!==0){for(let c of s)if(n.has(c))for(let a of N(e,o,c)){if(!t.has(a.symbolId)||o===a.relativePath)continue;let l=i.get(a.symbolId);l||(l=new Set,i.set(a.symbolId,l)),l.add(o)}}}return i}function p(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function P(e,r){let n=[],t=new Set;for(let[i,o]of r){let s=y(e,i);for(let c of o){let a=h(s,c),l=`${i}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return n}function Y(e,r){let n=q(e,r);return n?K(e,Q(e,n.match,n.identifier)):[]}function je(e,r,n={}){return Z(e,r,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function Z(e,r,n={}){let t=$(e,r,{semantic:n.semantic}),i=t.length>0?j(t,"source-attribution"):j(Y(e,r),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function j(e,r){return e.map(n=>({...n,provenance:r}))}function Q(e,r,n){let t=new Map;for(let[i,o]of U(e,r.symbolId))t.set(i,V(e,i,o,r,n));return t}function U(e,r){let n=new Map;for(let t of A(e,[r])){if(e.isIgnored(t.relative_path))continue;let i=n.get(t.relative_path);i||(i=[],n.set(t.relative_path,i)),i.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function V(e,r,n,t,i){let o=r===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},s=i?R(e,r,i,o):[];return n.flatMap(c=>X(s,c))}function X(e,r){let n=e.filter(t=>t>=r.start_line&&t<=r.end_line);return n.length>0?n:[r.start_line]}function q(e,r){let n=_(e,r);return n?{match:n,identifier:f(n.symbol)||null}:null}function K(e,r){let n=[],t=new Set;for(let[i,o]of r){let s=y(e,i);for(let c of o){let a=h(s,c),l=`${i}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return n}export{L as a,ie as b,le as c,fe as d,A as e,d as f,Se as g,ye as h,x as i,O as j,N as k,Ce as l,we as m,Y as n,je as o};
|
|
40
|
-
//# sourceMappingURL=chunk-HVTYSC26.js.map
|