scip-query 0.6.9 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-23YIGCYF.js +25 -0
- package/dist/{chunk-V4WRHJU3.js → chunk-2IYEIFPP.js} +6 -6
- package/dist/chunk-2JEFS2YJ.js +2 -0
- package/dist/chunk-33SSUPCB.js +7 -0
- package/dist/chunk-3GNFUVFA.js +2 -0
- package/dist/chunk-3OUC276S.js +2 -0
- package/dist/{chunk-JLFAQ2E2.js → chunk-4STLJYHI.js} +4 -4
- package/dist/chunk-563HLCDW.js +35 -0
- package/dist/chunk-5TT47UMX.js +44 -0
- package/dist/chunk-6H2XIIPY.js +71 -0
- package/dist/{chunk-I5BB33E6.js → chunk-72JOIFXL.js} +3 -3
- package/dist/chunk-7H4RJ4MC.js +2 -0
- package/dist/chunk-7O4MJYIW.js +63 -0
- package/dist/chunk-7OX2O53H.js +62 -0
- package/dist/chunk-A2AVLALL.js +2 -0
- package/dist/chunk-AQYBOORI.js +2 -0
- package/dist/chunk-ARBZM2NF.js +34 -0
- package/dist/{chunk-GRAEZYYU.js → chunk-BI4F6GXI.js} +2 -2
- package/dist/chunk-BOVNTAKQ.js +3 -0
- package/dist/chunk-CKIO6SVS.js +2 -0
- package/dist/chunk-D6Z67MZL.js +2 -0
- package/dist/chunk-DFK54IRN.js +2 -0
- package/dist/chunk-FD37DBTD.js +2 -0
- package/dist/chunk-FOQQDXE7.js +2 -0
- package/dist/chunk-GAQGJ52J.js +11 -0
- package/dist/chunk-IODTPF5H.js +20 -0
- package/dist/chunk-J6Z5YKGQ.js +4 -0
- package/dist/chunk-JB4PUN5S.js +40 -0
- package/dist/chunk-JTXKS5GK.js +3 -0
- package/dist/chunk-KJ3ZJIE5.js +2 -0
- package/dist/chunk-KJ6CW6EK.js +2 -0
- package/dist/{chunk-AXHDRSRI.js → chunk-KNA6Z7JB.js} +3 -3
- package/dist/{chunk-U3GYMGBX.js → chunk-LDV2B7ET.js} +8 -8
- package/dist/chunk-LWYIGRHR.js +5 -0
- package/dist/chunk-MDAYGS6T.js +2 -0
- package/dist/chunk-MX6F756F.js +2 -0
- package/dist/chunk-NHDPYW7O.js +2 -0
- package/dist/{chunk-IIKNAXAE.js → chunk-NKJKI6SE.js} +2 -2
- package/dist/chunk-NN3O7TPH.js +8 -0
- package/dist/chunk-NSTZMBAB.js +18 -0
- package/dist/chunk-NYEMZHUC.js +6 -0
- package/dist/chunk-OHEIZWIA.js +4 -0
- package/dist/chunk-PG3ZI5IH.js +2 -0
- package/dist/chunk-QAEDNTY7.js +2 -0
- package/dist/chunk-QE6MGGUY.js +2 -0
- package/dist/chunk-QPRIYXH4.js +2 -0
- package/dist/chunk-QWJBIBE6.js +3 -0
- package/dist/chunk-RCJEFQOK.js +4 -0
- package/dist/chunk-ROOHENEP.js +61 -0
- package/dist/{chunk-3JGBAAP7.js → chunk-ROZNBWIF.js} +2 -2
- package/dist/chunk-TGK5DFBJ.js +2 -0
- package/dist/chunk-TKDJQ2WD.js +59 -0
- package/dist/chunk-TRNAQABL.js +7 -0
- package/dist/chunk-U75WH4XG.js +2 -0
- package/dist/chunk-V53J46BX.js +2 -0
- package/dist/chunk-V76FCF5F.js +2 -0
- package/dist/chunk-VUBQBW7H.js +16 -0
- package/dist/chunk-WJQY2LGT.js +2 -0
- package/dist/{chunk-ZO5IFJRM.js → chunk-WODJHE6Z.js} +3 -3
- package/dist/{chunk-IX45SWX5.js → chunk-WPLKHAH7.js} +4 -4
- package/dist/chunk-XO6R3X5J.js +2 -0
- package/dist/chunk-YSZNAG4G.js +2 -0
- package/dist/chunk-ZNUPGRPR.js +3 -0
- package/dist/{chunk-UIM4WALN.js → chunk-ZXFTC5ET.js} +4 -4
- package/dist/cli.js +362 -527
- package/dist/config-types-CGIeLEpY.d.ts +108 -0
- package/dist/db-DdTPetj5.d.ts +69 -0
- package/dist/health-x7B4Xu_6.d.ts +119 -0
- package/dist/index.d.ts +100 -334
- package/dist/index.js +3 -131
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +9 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +12 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +12 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +19 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +16 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/code.d.ts +12 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +15 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +19 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +22 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +8 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +16 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +32 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +34 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.d.ts +8 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +6 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +22 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/drift.d.ts +18 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.d.ts +19 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +7 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +6 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +4 -81
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +8 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +10 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +13 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/index.d.ts +45 -44
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +11 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.d.ts +10 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +8 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +10 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +14 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +13 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +7 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/similar-chains.d.ts +21 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +12 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +16 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +21 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +16 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +36 -3
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +11 -2
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.d.ts +8 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +10 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +10 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.d.ts +18 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +14 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +10 -10
- package/dist/reindex.d.ts +153 -0
- package/dist/reindex.js +69 -0
- package/dist/runtime.d.ts +108 -0
- package/dist/runtime.js +3 -0
- package/dist/scip-cli-a-xOztiK.d.ts +20 -0
- package/package.json +184 -4
- package/dist/chunk-2OP63JQQ.js +0 -2
- package/dist/chunk-33Z6HQBX.js +0 -5
- package/dist/chunk-3F453KPT.js +0 -2
- package/dist/chunk-3PKPUCIJ.js +0 -11
- package/dist/chunk-42BWO2NN.js +0 -2
- package/dist/chunk-4MDCFY3E.js +0 -2
- package/dist/chunk-4QWTQ6YV.js +0 -2
- package/dist/chunk-5IRX5I64.js +0 -5
- package/dist/chunk-5MPZ2A7J.js +0 -2
- package/dist/chunk-67OMD56K.js +0 -90
- package/dist/chunk-6UVVA5I4.js +0 -7
- package/dist/chunk-BAA4EJRX.js +0 -2
- package/dist/chunk-BT36WY5B.js +0 -114
- package/dist/chunk-CLKFDBS6.js +0 -39
- package/dist/chunk-CWMWTHV3.js +0 -2
- package/dist/chunk-DXO2ECRF.js +0 -7
- package/dist/chunk-EHEZLULQ.js +0 -85
- package/dist/chunk-FVH3Y44U.js +0 -1
- package/dist/chunk-GWBRU65E.js +0 -2
- package/dist/chunk-H4DXD2FB.js +0 -5
- package/dist/chunk-I2KUHGMX.js +0 -16
- package/dist/chunk-JMASYYSW.js +0 -2
- package/dist/chunk-KAM4C6ZD.js +0 -4
- package/dist/chunk-LBWLO7NA.js +0 -70
- package/dist/chunk-LJ2YWNQF.js +0 -2
- package/dist/chunk-LLDPR3DG.js +0 -6
- package/dist/chunk-LNUZWWWL.js +0 -2
- package/dist/chunk-NLJCXHFU.js +0 -84
- package/dist/chunk-NRAJIFQA.js +0 -2
- package/dist/chunk-OYRGWW6Z.js +0 -2
- package/dist/chunk-PVMRIOM6.js +0 -33
- package/dist/chunk-QRYEOK3M.js +0 -2
- package/dist/chunk-SF2HYG53.js +0 -4
- package/dist/chunk-SHGPRVWH.js +0 -2
- package/dist/chunk-SMOUOKAO.js +0 -2
- package/dist/chunk-TBJDUS4E.js +0 -71
- package/dist/chunk-TPXWXKL6.js +0 -2
- package/dist/chunk-TTCUMJ43.js +0 -19
- package/dist/chunk-TYR7QY5G.js +0 -2
- package/dist/chunk-UZG3QXTG.js +0 -2
- package/dist/chunk-VDMRAGBK.js +0 -6
- package/dist/chunk-W6SRVK2Y.js +0 -5
- package/dist/chunk-WGYJDGBI.js +0 -25
- package/dist/chunk-WYX3RU2K.js +0 -2
- package/dist/chunk-WZYA234B.js +0 -2
- package/dist/chunk-Y6ZFXZ7B.js +0 -2
- package/dist/chunk-YCN5XEST.js +0 -7
- package/dist/db-Rx8Ho_JF.d.ts +0 -838
- package/dist/queries/drift-policy.d.ts +0 -6
- package/dist/queries/drift-policy.js +0 -2
- package/dist/queries/health-cache-control.d.ts +0 -15
- package/dist/queries/health-cache-control.js +0 -2
package/dist/chunk-OYRGWW6Z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as b}from"./chunk-JMASYYSW.js";import{k as y,l as g,m as S}from"./chunk-EHEZLULQ.js";import{a as f}from"./chunk-BT36WY5B.js";import{s as m}from"./chunk-NLJCXHFU.js";function D(l,t,i={}){let o=f(l,t);if(!o)return null;let n=[{file:o.relativePath,line:o.startLine}],r=b(l,o,{semantic:i.semantic}),s=(r.length>0?r:S(l,o)).filter(e=>!l.isIgnored(e.file)).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?m(e.enclosingSymbol):"(top-level)"})),{producers:u,consumers:p}=d(l,o,s,{semantic:i.semantic!==!1});return{symbol:o.symbol,shortName:m(o.symbol),relativePath:o.relativePath,definitionSites:n.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:u.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:m(e.symbol),file:e.file})),consumers:p.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":m(e.symbol),file:e.file}))}}function d(l,t,i,o){let n=a(y(l,t,{limit:30,semantic:o.semantic}).map(s=>({symbol:s.symbol,file:s.file}))),r=a(g(l,t,{limit:30,semantic:o.semantic})),c=r.length>0?r:a(i.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:n,consumers:c}}function a(l){let t=new Set,i=[];for(let o of l){let n=`${o.symbol}|${o.file}`;t.has(n)||(t.add(n),i.push(o))}return i}export{D as a};
|
|
2
|
-
//# sourceMappingURL=chunk-OYRGWW6Z.js.map
|
package/dist/chunk-PVMRIOM6.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{a as v}from"./chunk-LNUZWWWL.js";import{d as j,e as V,f as Y,g as G,h as z}from"./chunk-IIKNAXAE.js";import{a as L,b as M,c as E,f as T,h as x,l as U}from"./chunk-EHEZLULQ.js";import{d as w,g as _,j as N}from"./chunk-33Z6HQBX.js";import{E as W,F as J,M as R,f as F,h as I,i as C,k as P,s as O,v as k,w as A,x as B,y as $,z as H}from"./chunk-NLJCXHFU.js";var S=750;function Oe(e,n={}){let{scope:t,minLoc:i=1,includeTests:o=!1,skipBarrels:r=!1,includeMembers:s=!1,deadCodeOnly:a=!1,scanLimit:c,semantic:f=!0}=n,m=le(ae(e,{scope:t,minLoc:i,includeTests:o,includeMembers:s}),c),l=r?new Set(j(e)):new Set,u=a?new Map:te(e,l,m.map(d=>d.symbolId)),p=a?oe(e,m.map(d=>d.symbolId),l):new Set,g=a?m.filter(d=>!p.has(d.symbolId)):m;a?pe(e,g,u,l):de(e,g,u,l);let h=a?g.filter(d=>!K(u,d.symbolId)):m;Se(e,h,u,{includeTests:o,inactiveBarrelPaths:l,includeSemantic:!a&&f});let b=a?g.filter(d=>!K(u,d.symbolId)):m;return me(e,ue(b,u))}function te(e,n,t){if(t)return re(e,n,t);let i=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
|
-
${e.pathExclusionsFor("d")}
|
|
10
|
-
GROUP BY m.symbol_id, d.relative_path`),o=new Map;for(let r of i){if(e.isIgnored(r.relative_path)||n.has(r.relative_path))continue;let s=o.get(r.symbol_id);s||(s=new Map,o.set(r.symbol_id,s)),s.set(r.relative_path,r.ref_count)}return o}function re(e,n,t){let i=new Map;for(let o=0;o<t.length;o+=S)for(let r of ie(e,t.slice(o,o+S))){if(e.isIgnored(r.relative_path)||n.has(r.relative_path))continue;let s=i.get(r.symbol_id);s||(s=new Map,i.set(r.symbol_id,s)),s.set(r.relative_path,r.ref_count)}return i}function ie(e,n){return n.length===0?[]:e.all(`SELECT
|
|
11
|
-
m.symbol_id,
|
|
12
|
-
d.relative_path,
|
|
13
|
-
COUNT(*) AS ref_count
|
|
14
|
-
FROM mentions m
|
|
15
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
16
|
-
JOIN documents d ON c.document_id = d.id
|
|
17
|
-
WHERE m.role != 1
|
|
18
|
-
AND m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
19
|
-
${e.pathExclusionsFor("d")}
|
|
20
|
-
GROUP BY m.symbol_id, d.relative_path`,...n)}function oe(e,n,t){let i=new Set;for(let o=0;o<n.length;o+=S)for(let r of se(e,n.slice(o,o+S)))e.isIgnored(r.relative_path)||t.has(r.relative_path)||i.add(r.symbol_id);return i}function se(e,n){return n.length===0?[]:e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
|
|
21
|
-
FROM mentions m
|
|
22
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
23
|
-
JOIN documents d ON c.document_id = d.id
|
|
24
|
-
WHERE m.role != 1
|
|
25
|
-
AND m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
26
|
-
${e.pathExclusionsFor("d")}`,...n).filter(t=>t.symbol_id!==null)}function ae(e,n){let t=_e(e),i=[];for(let o of ce(e,n.scope))try{for(let r of J(e,o))e.isIgnored(r.relativePath)||B(r.symbol)||Z(r.symbol)&&(!r.isFunctionLike&&r.enclosingSymbol&&Z(r.enclosingSymbol)||!n.includeTests&&!ne(r.relativePath)||!n.includeTests&&t(r.relativePath,r.startLine,r.symbol,r.parentTypeName)||$(r.symbol)||H(r.symbol)||!n.includeMembers&&!ve(r)||r.endLine-r.startLine+1<n.minLoc||i.push(r))}finally{W(e,o),q(e,o)}return i}function ce(e,n){let t=n?"AND relative_path LIKE ?":"",i=n?[`%${n}%`]:[];return e.all(`SELECT relative_path
|
|
27
|
-
FROM documents
|
|
28
|
-
WHERE 1 = 1
|
|
29
|
-
${e.pathExclusionsFor("documents")}
|
|
30
|
-
${t}
|
|
31
|
-
ORDER BY relative_path`,...i).map(o=>o.relative_path)}function le(e,n){return typeof n!="number"||n<=0||e.length<=n?e:e.slice(0,n)}function ue(e,n){return e.map(t=>fe(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 fe(e,n){let t=n.get(e.symbolId)??new Map,i=t.get(e.relativePath)??0,o=0;for(let[r,s]of t)r!==e.relativePath&&(o+=s);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:o}}function me(e,n){let t=[],i=0,o=0,r=0;for(let s of n){if(e.isIgnored(s.relative_path)||V(e,s.relative_path)||Y(e,s.symbol,s.relative_path))continue;let a=s.same_file_refs===0?"dead-code":"file-internal";a==="dead-code"?i++:o++,r+=s.loc,t.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:O(s.symbol),sameFileRefs:s.same_file_refs,kind:a})}return{symbols:t,totalCount:t.length,deadCodeCount:i,fileInternalCount:o,totalLoc:r}}function de(e,n,t,i){if(n.length===0)return;let o=new v(e),r=new Set(n.map(c=>c.symbolId)),s=new Set(n.map(c=>c.leaf).filter(Boolean)),a=new Set(o.sourceFiles());for(let c of X(e))a.add(c);o.scanSourceReferences({paths:a,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:s,skipPath:c=>i.has(c)},c=>{r.has(c.target.symbolId)&&(he(e,c)||y(t,c.target.symbolId,c.sourceFile,be(c)))})}function pe(e,n,t,i){if(n.length===0)return;let o=new v(e),r=ge(n),s=new Set(o.sourceFiles());for(let a of X(e))s.add(a);for(let a of s){let c=I(a);if(!(!c&&!C(a))&&!e.isIgnored(a)&&!i.has(a))try{let f=ye(e,a),m=T(e,a);for(let[l,u]of m){let p=r.get(l);if(!p)continue;let g=D(a,l,p,f,{permissive:!0});for(let h of g){let b=a===h.relativePath?Math.max(0,u.length-1):u.length;ee(e,{sourceFile:a,name:l,target:h,occurrences:b})||y(t,h.symbolId,a,b)}}for(let l of E(e,a)){let u=r.get(l);if(u)for(let p of D(a,l,u,f,{permissive:!1}))y(t,p.symbolId,a,1)}if(c==="rust")for(let l of M(e,a)){let u=r.get(l);if(u)for(let p of D(a,l,u,f,{permissive:!0}))y(t,p.symbolId,a,1)}}finally{q(e,a)}}}function q(e,n){x(e,n),N(e,n),w(e,n),P(e,n),F(e,n)}function ge(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 D(e,n,t,i,o){let r=t.filter(c=>c.relativePath===e);if(r.length>0)return r;let s=i.get(n);if(s)for(let c of s){let f=t.filter(m=>Q(c,m.relativePath));if(f.length>0)return f}let a=new Set;for(let c of i.values())for(let f of c)a.add(f);for(let c of a){let f=t.filter(m=>Q(c,m.relativePath));if(f.length>0&&f.length===t.length)return f}return o.permissive?[...t]:[]}function K(e,n){let t=e.get(n);if(!t)return!1;for(let i of t.values())if(i>0)return!0;return!1}function X(e){let n=e.all(`SELECT relative_path FROM documents
|
|
32
|
-
WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`);return new Set(n.map(t=>t.relative_path))}function he(e,n){return n.kind==="cross-language-dispatch"&&n.target.relativePath===n.sourceFile?!0:n.kind==="identifier"&&ee(e,n)}function be(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function y(e,n,t,i){if(i<=0)return;let o=e.get(n);o||(o=new Map,e.set(n,o)),o.set(t,(o.get(t)??0)+i)}function ee(e,n){return n.occurrences>1?!1:_(e,n.sourceFile).some(t=>t.used||t.sourcePath!==n.target.relativePath?!1:t.importedName===n.name||t.localName===n.name)}function ye(e,n){let t=new Map;for(let i of _(e,n)){if(!i.sourcePath)continue;let o=i.localName??i.importedName;if(o){let r=t.get(o);r||(r=new Set,t.set(o,r)),r.add(i.sourcePath)}if(i.kind==="namespace")for(let r of i.usedMembers){let s=t.get(r);s||(s=new Set,t.set(r,s)),s.add(i.sourcePath)}}return t}function Q(e,n){let t=i=>i.replace(/\\/g,"/").replace(/^\.\//,"");return t(e)===t(n)}function Se(e,n,t,i){for(let o of n){let r=U(e,o,{semantic:i.includeSemantic!==!1});if(r.length===0)continue;let s=t.get(o.symbolId);s||(s=new Map,t.set(o.symbolId,s));for(let a of r){let c=a.file;c===o.relativePath||e.isIgnored(c)||i.inactiveBarrelPaths.has(c)||!i.includeTests&&!ne(c)||s.set(c,Math.max(1,s.get(c)??0))}}}function _e(e){let n=new Map,t=i=>{let o=n.get(i);if(o)return o;let r=L(e,i);return o={ranges:r.map(s=>({startLine:s.startLine,endLine:s.endLine})),containers:new Set(r.map(s=>s.containerName).filter(s=>!!s))},n.set(i,o),o};return(i,o,r,s)=>{let a=t(i);for(let c of a.ranges)if(o>=c.startLine&&o<=c.endLine)return!0;if(s&&a.containers.has(s))return!0;for(let c of R(r))if(a.containers.has(c))return!0;return!1}}function ne(e){return[...new Set([...G,...z])].every(t=>!Re(e,t))}function Re(e,n){return new RegExp(`^${n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/%/g,".*").replace(/_/g,".")}$`).test(e)}function Z(e){return A(e)||e.endsWith("().")||e.endsWith(".")}function ve(e){return k(e.symbol)||R(e.symbol).length===0}export{Oe as a};
|
|
33
|
-
//# sourceMappingURL=chunk-PVMRIOM6.js.map
|
package/dist/chunk-QRYEOK3M.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{statSync as i}from"fs";function r(t){let e=t.get("SELECT COUNT(*) as c FROM documents").c,s=t.get("SELECT COUNT(*) as c FROM global_symbols").c,n=t.get("SELECT COUNT(*) as c FROM mentions WHERE role = 1").c,c=t.get("SELECT COUNT(*) as c FROM mentions WHERE role != 1").c;return{documents:e,symbols:s,definitions:n,references:c,...o(t.config.dbPath)}}function o(t){try{let e=i(t);return{indexSizeBytes:e.size,lastBuilt:e.mtime}}catch{return{indexSizeBytes:0,lastBuilt:null}}}export{r as a};
|
|
2
|
-
//# sourceMappingURL=chunk-QRYEOK3M.js.map
|
package/dist/chunk-SF2HYG53.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-JMASYYSW.js";import{m as S}from"./chunk-EHEZLULQ.js";import{a as d}from"./chunk-BT36WY5B.js";import{C as g,D as f,d as u,s as l,w as m}from"./chunk-NLJCXHFU.js";function j(n,o,r={}){let e=d(n,o);if(!e)return{definitions:[],referencedBy:[]};let t=n.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",e.symbolId),a=f(t?.documentation??null),s=n.isIgnored(e.relativePath)?[]:[{relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,signature:h(a,t?.display_name??null,e.symbol),source:b(n,e.relativePath,e.startLine,e.endLine)}],c=p(n,e,{semantic:r.semantic}),y=(c.length>0?c:S(n,e)).filter(i=>!n.isIgnored(i.file)).map(i=>({relativePath:i.file,line:i.line,enclosingSymbol:i.enclosingSymbol,enclosingShort:i.enclosingSymbol?l(i.enclosingSymbol):"(top-level)"}));return{definitions:s,referencedBy:y}}function b(n,o,r,e){let t=u(n,o);if(!t)return null;let s=t.split(`
|
|
2
|
-
`).slice(r,e+1).join(`
|
|
3
|
-
`).trimEnd();return s.length>0?s:null}function h(n,o,r){let e=g(n);if(e&&!v(e))return e;let t=(o??"").trim();return t?m(r)&&!t.endsWith("()")?`${t}()`:t:l(r)}function v(n){return n.startsWith("undefined")||n.includes("|")||n.includes("```")}export{j as a};
|
|
4
|
-
//# sourceMappingURL=chunk-SF2HYG53.js.map
|
package/dist/chunk-SHGPRVWH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-LNUZWWWL.js";import{s as u}from"./chunk-NLJCXHFU.js";function L(o,t){let{scope:n,minLoc:c=10,limit:r=30,scanLimit:a}=t??{},{definitions:d,callerMap:y,calleeMap:f}=C(o,n,a,t?.semantic!==!1);return d.map(e=>{let s=e.endLine-e.startLine+1,p=y.get(e.symbolId)?.size??0,i=f.get(e.symbolId)??[],x=i.filter(l=>l.file!==e.relativePath),m=new Set(x.map(l=>`${l.symbol}|${l.file}`)).size,M=new Set(i.map(l=>`${l.symbol}|${l.file}`)).size;return{symbol:e.symbol,shortName:u(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:s,fanIn:p,fanOut:m,calleeCount:M,score:Math.round(s/50*(p/5)*Math.max(m/5,1)*100)/100}}).filter(e=>e.loc>=c).sort((e,s)=>s.score-e.score||s.loc-e.loc).slice(0,r)}function C(o,t,n,c){let r=new b(o),a=S(r.productionCallableDefinitions({scope:t,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof n=="number"&&n>0}),n);return{definitions:a,callerMap:r.crossFileCallerMap(a,{semantic:c}),calleeMap:r.calleeMap(a,{semantic:c})}}function S(o,t){return typeof t!="number"||t<=0||o.length<=t?o:o.slice(0,t)}export{L as a};
|
|
2
|
-
//# sourceMappingURL=chunk-SHGPRVWH.js.map
|
package/dist/chunk-SMOUOKAO.js
DELETED
package/dist/chunk-TBJDUS4E.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import ue from"better-sqlite3";import{createRequire as ce}from"module";import{existsSync as le,mkdtempSync as Sn,readFileSync as v,rmSync as yn,statSync as vn,writeFileSync as Rn}from"fs";import{cpus as Vn,tmpdir as xn}from"os";import{dirname as F,extname as ge,join as O,relative as fe,resolve as de}from"path";import{pathToFileURL as me}from"url";import{Worker as In}from"worker_threads";import K from"better-sqlite3";import{execFileSync as B}from"child_process";import{existsSync as J,readdirSync as z,readFileSync as X}from"fs";import{extname as m,join as E}from"path";import M from"ignore";import{readFileSync as A,existsSync as h}from"fs";import{dirname as b,isAbsolute as R,join as S,relative as P,resolve as j}from"path";function V(e){let n=M(),r=!1,t=W(e);for(let o of t)try{let i=A(o,"utf-8");n.add(i),r=!0}catch{}return r||n.add($),{isIgnored:o=>k(n,e,o),filter:o=>o.filter(i=>!k(n,e,i))}}function W(e){let n=[],r=S(e,".gitignore");h(r)&&n.push(r);let t=b(e),o=0;for(;t!==b(t)&&o<5;){let i=S(t,".gitignore");if(h(i)&&n.push(i),h(S(t,".git")))break;t=b(t),o++}return n}var $=`
|
|
2
|
-
# Dependencies
|
|
3
|
-
node_modules/
|
|
4
|
-
vendor/
|
|
5
|
-
.bundle/
|
|
6
|
-
|
|
7
|
-
# Build output
|
|
8
|
-
dist/
|
|
9
|
-
build/
|
|
10
|
-
out/
|
|
11
|
-
target/
|
|
12
|
-
bin/
|
|
13
|
-
obj/
|
|
14
|
-
|
|
15
|
-
# Python
|
|
16
|
-
__pycache__/
|
|
17
|
-
*.pyc
|
|
18
|
-
*.pyo
|
|
19
|
-
.venv/
|
|
20
|
-
venv/
|
|
21
|
-
.env/
|
|
22
|
-
env/
|
|
23
|
-
*.egg-info/
|
|
24
|
-
|
|
25
|
-
# Rust
|
|
26
|
-
target/
|
|
27
|
-
|
|
28
|
-
# Java / Kotlin / Scala
|
|
29
|
-
*.class
|
|
30
|
-
.gradle/
|
|
31
|
-
.mvn/
|
|
32
|
-
|
|
33
|
-
# C# / .NET
|
|
34
|
-
bin/
|
|
35
|
-
obj/
|
|
36
|
-
packages/
|
|
37
|
-
|
|
38
|
-
# Go
|
|
39
|
-
vendor/
|
|
40
|
-
|
|
41
|
-
# Dart
|
|
42
|
-
.dart_tool/
|
|
43
|
-
build/
|
|
44
|
-
|
|
45
|
-
# PHP
|
|
46
|
-
vendor/
|
|
47
|
-
|
|
48
|
-
# IDE / OS
|
|
49
|
-
.idea/
|
|
50
|
-
.vscode/
|
|
51
|
-
*.swp
|
|
52
|
-
*.swo
|
|
53
|
-
.DS_Store
|
|
54
|
-
Thumbs.db
|
|
55
|
-
|
|
56
|
-
# Type definitions (often noise in queries)
|
|
57
|
-
*.d.ts
|
|
58
|
-
`;function k(e,n,r){let t=U(n,r);if(!t)return!1;try{return e.ignores(t)}catch{return!1}}function U(e,n){if(!n||n===".")return null;if(!R(n)&&!n.startsWith(".."))return n.replaceAll("\\","/");let r=R(n)?n:j(e,n),t=P(e,r).replaceAll("\\","/");return!t||t==="."||t.startsWith("..")?null:t}import{readdirSync as Be}from"fs";import{extname as ze,join as Xe}from"path";function x(e){let n=new WeakMap,r=t=>{let o=n.get(t);return o||(o=new Map,n.set(t,o)),o};return{get(t,o,i){let s=r(t);if(s.has(o))return s.get(o);let a=i();return s.set(o,a),a},invalidate(t,o){n.get(t)?.delete(o)},invalidateAll(t){n.delete(t)},size(t){return n.get(t)?.size??0}}}var H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],w=[".vue"],G=new Set(H.map(e=>e.toLowerCase())),qe=[...G].sort().join(","),T=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var Qe=x("source-files");function an(e){let n=new Set((e.extensions??w).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!J(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=V(e.projectRoot),t=Y(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new K(e.dbPath);try{let i=Q(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
59
|
-
VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let g of l){if(i.has(g))continue;let f=X(E(e.projectRoot,g),"utf-8"),_=s.run(Z(g),g,f);d+=Number(_.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function Y(e,n){let r=q(e,n);if(r)return r;let t=[],o=i=>{let s=i?E(e,i):e,a;try{a=z(s,{withFileTypes:!0})}catch{return}for(let u of a){if(T.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(m(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function q(e,n){try{return B("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
|
|
60
|
-
`).filter(t=>t&&n.has(m(t).toLowerCase())).sort()}catch{return null}}function Q(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function Z(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as ee}from"child_process";import{createHash as ne}from"crypto";import{readdirSync as te,readFileSync as re}from"fs";import{join as I}from"path";function oe(e){return(ie(e)??se(e)).filter(n=>n&&!C(n)).sort()}function dn(e){return oe(e).map(n=>{let r=I(e,n);try{let t=re(r);return{path:n,size:t.byteLength,hash:ne("sha256").update(t).digest("hex")}}catch{return{path:n,size:-1,hash:"unreadable"}}})}function ie(e){try{return ee("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
|
|
61
|
-
`).filter(Boolean)}catch{return null}}function se(e){let n=[],r=[""];for(;r.length>0;){let t=r.pop(),o=t?I(e,t):e,i;try{i=te(o,{withFileTypes:!0})}catch{continue}for(let s of i){let a=t?`${t}/${s.name}`:s.name;if(s.isDirectory()){C(a)||r.push(a);continue}n.push(a)}}return n}function C(e){return e.split("/").some(r=>ae.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var ae=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);function Cn(e){let n=de(e.projectRoot,e.tsconfig),r=ke(e.projectRoot,n),t=new ue(e.dbPath,{readonly:!0});try{let o=Me();return pe({projectRoot:e.projectRoot,vueFiles:e.vueFiles??[],tasks:e.tasks,context:r,symbolLookup:Ee(t,e.projectRoot,o),vueSymbolLookup:Fe(t,e.projectRoot),sourceCache:o})}finally{t.close()}}function pe(e){let n=[],r=0,t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=he(e,o);n.push(...i.occurrences),r+=i.skippedReferences}return{occurrences:n,skippedReferences:r}}function he(e,n){let r=e.context.language.scripts.get(n.fileName),t=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!t)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let o=e.sourceCache(n.fileName);if(!o)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let i=e.context.language.maps.get(t,r),s=p(e.projectRoot,n.fileName),a=[...Le(o.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:ye(a),processedStarts:new Set};return be({...e,fileName:n.fileName,sourceInfo:o,sourceFile:s,map:i,tokenContext:u})}function be(e){let n=[],r=0;for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start))continue;let o=De(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(u=>!Ne(e.projectRoot,u.fileName));if(!s){r++;continue}let a=Oe(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}L(n,e.sourceInfo,e.sourceFile,t,a),e.tokenContext.processedStarts.add(t.start),Se(n,e,t,o,a)}return{occurrences:n,skippedReferences:r}}function Se(e,n,r,t,o){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let i of ve(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(i))continue;let s=n.tokenContext.tokenByStart.get(i);s&&(L(e,n.sourceInfo,n.sourceFile,s,o),n.tokenContext.processedStarts.add(i))}}function L(e,n,r,t,o){let i=N(n,t.start);e.push({sourceFile:r,sourceLine:i.line,sourceStartChar:i.character,sourceEndChar:i.character+t.text.length,symbolId:o})}function ye(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function ve(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=Re(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function Re(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=D(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}function ke(e,n){let{vueCore:r,ts:t,volarTs:o}=Ve(e),{parsed:i,vueOptions:s}=xe(r,t,n),a=F(n),u=r.createVueLanguagePlugin(t,i.options,s,f=>f),c=we(r,t,u),l=Te(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,f=>f,l),g=t.createLanguageService(d);return{ts:t,language:c,languageService:g,fileNames:i.fileNames,configDir:a}}function Ve(e){let n=ce(me(O(e,"package.json")).href);return{vueCore:y(n,"@vue/language-core",e),ts:y(n,"typescript",e),volarTs:y(n,"@volar/typescript",e)}}function xe(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,F(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function we(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!le(i))return;let s=v(i,"utf-8");t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??_e(i))});return t.current=o,o}function Te(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function y(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function Ee(e,n,r){let t=Ie(e);return o=>{let i=p(n,o.fileName),s=r(o.fileName);if(!s)return null;let a=N(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:Ce(u.starts,a.line,2)}}function Ie(e){let n=e.prepare(`
|
|
62
|
-
SELECT
|
|
63
|
-
d.relative_path AS relativePath,
|
|
64
|
-
der.start_line AS startLine,
|
|
65
|
-
der.end_line AS endLine,
|
|
66
|
-
der.symbol_id AS symbolId
|
|
67
|
-
FROM defn_enclosing_ranges der
|
|
68
|
-
JOIN documents d ON d.id = der.document_id
|
|
69
|
-
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
70
|
-
`).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,t.symbolId)}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function Ce(e,n,r){let t=0,o=e.length-1;for(;t<=o;){let s=Math.floor((t+o)/2);e[s].line<n?t=s+1:o=s-1}let i=null;for(let s of[o,t]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-n);u>r||(!i||u<i.distance)&&(i={distance:u,symbolId:a.symbolId})}return i?.symbolId??null}function Fe(e,n){let r=Pe(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=p(n,i),a=je(r.name,r.version,s),c=t.get(a)?.id??null;return o.set(i,c),c}}}function Oe(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(D(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*Le(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function De(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function D(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function N(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function Ne(e,n){return p(e,n).startsWith("node_modules/")}function p(e,n){return fe(e,n).replaceAll("\\","/")}function _e(e){switch(ge(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function Me(){let e=new Map;return n=>{if(e.has(n))return e.get(n)??null;try{let r=v(n,"utf-8"),t={text:r,lineStarts:Ae(r)};return e.set(n,t),t}catch{return e.set(n,null),null}}}function Ae(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function Pe(e){try{let n=JSON.parse(v(O(e,"package.json"),"utf-8"));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function je(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}export{an as a,dn as b,Cn as c};
|
|
71
|
-
//# sourceMappingURL=chunk-TBJDUS4E.js.map
|
package/dist/chunk-TPXWXKL6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{s as D}from"./chunk-67OMD56K.js";import{C as y,D as L,G as $,d as x,s as S}from"./chunk-NLJCXHFU.js";function O(t,e={}){let{scope:l,minLoc:o=1,limit:s,scanLimit:c}=e,u=e.semantic!==!1,a=new Map,r=w($(t,{scope:l}).filter(n=>n.isFunctionLike&&!t.isIgnored(n.relativePath)).filter(n=>n.endLine-n.startLine+1>=o).sort((n,i)=>typeof c!="number"||c<=0?0:h(i)-h(n)||n.relativePath.localeCompare(i.relativePath)),c);for(let n of r){let i=h(n),f=v(t,n,{semantic:u});if(!f)continue;let p={symbol:n.symbol,shortName:S(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:i},g=a.get(f);g?g.push(p):a.set(f,[p])}let m=[];for(let[n,i]of a)i.length<2||m.push({signature:n,functions:i});return m.sort((n,i)=>{let f=i.functions.length-n.functions.length;if(f!==0)return f;let p=n.functions.reduce((d,b)=>d+b.loc,0);return i.functions.reduce((d,b)=>d+b.loc,0)-p}),s?m.slice(0,s):m}function v(t,e,l){if(l.semantic){let c=D(t,e);if(c)return c}let o=P(e.documentation),s=o?I(o):null;return s||R(z(t,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function h(t){return t.endLine-t.startLine+1}function w(t,e){return typeof e!="number"||e<=0||t.length<=e?t:t.slice(0,e)}function P(t){return y(L(t))}function z(t,e,l,o,s){let c=x(t,e);if(!c)return null;let u=c.split(/\r?\n/),a=C(u,l,o,s);for(let r of a){let m=Math.min(u.length-1,Math.max(r,r+4)),n="";for(let i=r;i<=m;i+=1){let f=u[i]?.trim();if(f&&(n=n?`${n} ${f}`:f,A(n)))return n}if(n&&n.includes("("))return n}return null}function A(t){let e=t.replace(/\s+/g," ").trim();return!e.includes("(")||E(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function I(t){if(!t||!t.trim())return null;let e=t.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),l=e.indexOf("(");return l===-1||(e=e.slice(l),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(t,e){if(!t||!t.trim())return null;let l=t.replace(/\s+/g," ").trim(),o=l.indexOf("(");if(o===-1)return null;let s=l.slice(0,o),u=new RegExp(`\\b${M(e)}\\b`,"i").exec(s);u&&typeof u.index=="number"&&(s=s.slice(0,u.index)),s=s.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let a=T(l.slice(o)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!a.startsWith("("))return null;let r=`${s?`${s} `:""}${a}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function T(t){let e=0,l=0,o=0,s=0,c=null,u=!1;for(let a=0;a<t.length;a+=1){let r=t[a];if(c){if(u){u=!1;continue}if(r==="\\"){u=!0;continue}r===c&&(c=null);continue}if(r==='"'||r==="'"||r==="`"){c=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")o+=1;else if(r==="]")o=Math.max(0,o-1);else if(r==="<")s+=1;else if(r===">")s=Math.max(0,s-1);else if(r==="{"){if(e===0&&o===0&&s===0)return t.slice(0,a);l+=1}else if(r==="}")l=Math.max(0,l-1);else if(r==="="&&t[a+1]===">"&&e===0&&l===0&&o===0&&s===0)return t.slice(0,a)}return t}function C(t,e,l,o){let s=M(o),c=new RegExp(`\\b${s}\\b\\s*\\(`,"i"),u=new RegExp(`\\bdef\\s+${s}\\b`,"i"),a=[],r=new Set,m=Math.max(0,Math.min(e,t.length-1)),n=Math.max(m,Math.min(t.length-1,Math.max(l,e+4)));for(let i=m;i<=n;i+=1){let f=t[i]??"";(c.test(f)||u.test(f))&&!r.has(i)&&(r.add(i),a.push(i))}for(let i=0;i<t.length;i+=1){let f=t[i]??"";(c.test(f)||u.test(f))&&!r.has(i)&&(r.add(i),a.push(i))}return a}function E(t){let e=0;for(let l of t)l==="("&&(e+=1),l===")"&&(e-=1);return e}function M(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{O as a};
|
|
2
|
-
//# sourceMappingURL=chunk-TPXWXKL6.js.map
|
package/dist/chunk-TTCUMJ43.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{a as u,b as g,c as S}from"./chunk-LJ2YWNQF.js";import{a as p}from"./chunk-LNUZWWWL.js";import{a as y}from"./chunk-IIKNAXAE.js";import{g as d}from"./chunk-33Z6HQBX.js";import{o as m}from"./chunk-67OMD56K.js";import l from"path";function q(t,n){let{scope:i,minDeviation:r=5}=n??{},e=n?.semantic!==!1,a=new p(t).fileDependencyGraph(i),c=M(t,i);return R([...D(t,a,c,{semantic:e}),...v(a),...b(a,r)])}function D(t,n,i,r){let e=[];for(let[s,a]of n){if(f(s))continue;let c=i.get(s)??new Set;for(let o of a)if(!f(o)&&!c.has(o)){if(r.semantic&&F(t,s,o)||w(t,s,o)||L(t,s,o)||$(o)||x(t,s,o)||P(o))continue;e.push({file:s,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o})}}return e}function v(t){let n=[],i=N(t);for(let[r,e]of t){if(f(r))continue;let s=u(r);for(let a of e){if(f(a))continue;let c=u(a);if(s===c)continue;(g(s,c)??i.get(`${s}->${c}`))==="violation"&&n.push({file:r,kind:"layer-violation",description:`Imports from ${c}/ (${a}) \u2014 may cross architectural boundary`,dep:a,detail:`${s}/ should not depend on ${c}/`})}}return n}function b(t,n){let i=[];for(let[r,e]of _(t)){let s=e.filter(c=>!f(c));if(s.length<n)continue;let a=k(t,s);for(let c of s)for(let o of t.get(c)??[])f(o)||(a.get(o)??0)===1&&l.dirname(o)!==r&&l.dirname(o)!==l.dirname(r)&&(S(c,o)||i.push({file:c,kind:"pattern-deviation",description:`Only file in ${r}/ that depends on ${o}`,dep:o}))}return i}function R(t){return{results:t,unusedImports:t.filter(n=>n.kind==="unused-import").length,layerViolations:t.filter(n=>n.kind==="layer-violation").length,patternDeviations:t.filter(n=>n.kind==="pattern-deviation").length}}function _(t){let n=new Map;for(let i of t.keys()){let r=l.dirname(i),e=n.get(r);e||(e=[],n.set(r,e)),e.push(i)}return n}function k(t,n){let i=new Map;for(let r of n)for(let e of t.get(r)??[])f(e)||i.set(e,(i.get(e)??0)+1);return i}function M(t,n){let i=new Map;return E(t,i,n),O(t,i),i}function E(t,n,i){for(let r of I(t,i))h(t,n,r.from_file,r.to_file)}function I(t,n){let i=n?`AND d1.relative_path LIKE '%${n}%'`:"";return t.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
5
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
JOIN (
|
|
7
|
-
SELECT m2.symbol_id, c2.document_id
|
|
8
|
-
FROM mentions m2
|
|
9
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
-
WHERE m2.role = 1
|
|
11
|
-
GROUP BY m2.symbol_id
|
|
12
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
13
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
14
|
-
WHERE d1.id != d2.id
|
|
15
|
-
AND m.role != 1
|
|
16
|
-
${t.pathExclusionsFor("d1","d2")}
|
|
17
|
-
${i}`)}function O(t,n){let i=new p(t),r=t.all(`SELECT relative_path FROM documents
|
|
18
|
-
WHERE 1 = 1 ${t.pathExclusionsFor("documents")}`);i.scanSourceReferences({paths:r.map(e=>e.relative_path),includeRustAttributeNames:!0,identifierResolution:"permissive"},e=>{e.target.relativePath!==e.sourceFile&&(t.isIgnored(e.target.relativePath)||h(t,n,e.sourceFile,e.target.relativePath))})}function h(t,n,i,r){if(t.isIgnored(i)||t.isIgnored(r))return;let e=n.get(i);e||(e=new Set,n.set(i,e)),e.add(r)}function N(t){let n=new Map;for(let[r,e]of t){if(f(r))continue;let s=u(r);for(let a of e){if(f(a))continue;let c=u(a);if(s===c||g(s,c))continue;let o=`${s}->${c}`;n.set(o,(n.get(o)??0)+1)}}let i=new Map;for(let[r,e]of n)i.set(r,e<=2?"violation":"ok");return i}function $(t){return t.includes("types")||t.endsWith(".d.ts")}function F(t,n,i){let r=m(t,n).filter(e=>e.sourcePath===i);return r.length>0&&r.some(e=>e.isUsed)}function w(t,n,i){let r=d(t,n).filter(e=>e.sourcePath===i);return r.length>0&&r.some(e=>e.used)}function L(t,n,i){let r=d(t,n).filter(e=>e.sourcePath===i);return r.length>0&&r.every(e=>e.isTypeOnly===!0)}function P(t){return t.endsWith(".vue")}function x(t,n,i){let r=d(t,n).filter(e=>e.sourcePath===i);return r.length===0?!1:r.every(e=>e.kind==="side-effect"||e.kind==="namespace"&&e.usedMembers.length===0&&!e.used)}function f(t){let n=y(t);return!!(n==="entry"||n==="barrel"||n==="test"||n==="worker"||T(l.basename(t)))}function T(t){return!!(t==="index.ts"||t==="index.js"||t==="cli.ts"||t==="main.ts"||t==="main.rs"||t.includes("worker.")||t.includes("postinstall.")||t==="health.ts"||t==="health.js")}export{q as a};
|
|
19
|
-
//# sourceMappingURL=chunk-TTCUMJ43.js.map
|
package/dist/chunk-TYR7QY5G.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as L,b as R}from"./chunk-W6SRVK2Y.js";import{a as f}from"./chunk-QRYEOK3M.js";import{a as w}from"./chunk-DXO2ECRF.js";import{a as b}from"./chunk-GWBRU65E.js";import{b as C}from"./chunk-VDMRAGBK.js";import{a as y}from"./chunk-4QWTQ6YV.js";import{a as x}from"./chunk-TTCUMJ43.js";import{a as S}from"./chunk-UZG3QXTG.js";import{a as m,b as h}from"./chunk-3F453KPT.js";import{a as H}from"./chunk-GRAEZYYU.js";import{a as g}from"./chunk-PVMRIOM6.js";import{a as P}from"./chunk-SHGPRVWH.js";import{e as l,f as d}from"./chunk-IIKNAXAE.js";var O=50,j=75e3,W=5e3,A=2500,gt=["overview","dead","isolated","cycles","similar","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots"],q={overview:(t,a,e,r)=>({phase:"overview",statsResult:r,warnings:e.warnings}),dead:(t,a,e)=>({phase:"dead",dead:D(t,a,e)}),isolated:(t,a,e)=>({phase:"isolated",isolated:T(t,a,e)}),cycles:(t,a,e)=>({phase:"cycles",realCycleCount:B(t,a,e)}),similar:(t,a,e)=>({phase:"similar",similarCount:M(t,a,e)}),"extract-candidates":(t,a,e)=>({phase:"extract-candidates",extractCount:_(t,a,e)}),"wrapper-candidates":(t,a,e)=>({phase:"wrapper-candidates",wrappers:I(t,a,e)}),"passthrough-candidates":(t,a,e)=>({phase:"passthrough-candidates",passthroughs:$(t,a,e)}),"stale-abstractions":(t,a,e)=>({phase:"stale-abstractions",stale:z(t,a,e)}),drift:(t,a,e)=>({phase:"drift",drift:k(t,a,e)}),"complexity-hotspots":(t,a,e)=>({phase:"complexity-hotspots",complexity:N(t,a,e)})};function Ht(t,a={}){return E(t,a.full===!0,(e,r)=>{let i=F(t,a.scope,e,r);return v(i)})}function yt(t,a,e={}){return E(t,e.full===!0,(r,i)=>q[a](t,e.scope,i,r))}function E(t,a,e){let r=f(t),i=K(r,a);try{return e(r,i)}finally{m(t,{semanticProvider:!0}),h()}}function Ct(t){let a=n(t,"overview"),e={statsResult:a.statsResult,warnings:a.warnings,dead:n(t,"dead").dead,isolated:n(t,"isolated").isolated,realCycleCount:n(t,"cycles").realCycleCount,similarCount:n(t,"similar").similarCount,extractCount:n(t,"extract-candidates").extractCount,wrappers:n(t,"wrapper-candidates").wrappers,passthroughs:n(t,"passthrough-candidates").passthroughs,stale:n(t,"stale-abstractions").stale,drift:n(t,"drift").drift,complexity:n(t,"complexity-hotspots").complexity};return v(e)}function n(t,a){let e=t.find(r=>r.phase===a);if(!e)throw new Error(`Missing health phase result: ${a}`);return e}function v(t){let a=Q(t);return{score:J(t),overview:{documents:t.statsResult.documents,symbols:t.statsResult.symbols,indexSizeBytes:t.statsResult.indexSizeBytes},findings:{deadSymbols:t.dead.count,deadLoc:t.dead.loc,isolatedSymbols:t.isolated.count,isolatedLoc:t.isolated.loc,cycles:t.realCycleCount,similarPairs:t.similarCount,extractionCandidates:t.extractCount,wrappers:t.wrappers.count,passthroughs:t.passthroughs.count,staleTypes:t.stale.count,driftedFiles:t.drift.count,complexityHotspotCount:t.complexity.extremeCount},actions:a,topComplexity:t.complexity.top,warnings:t.warnings.length>0?t.warnings:void 0}}function F(t,a,e,r){let i=G(t,a,r),o=Y(t,a,r),c=X(t,a,r);return{statsResult:e,warnings:r.warnings,...i,...o,...c}}function G(t,a,e){return{dead:D(t,a,e),isolated:T(t,a,e),realCycleCount:B(t,a,e)}}function Y(t,a,e){return{similarCount:M(t,a,e),extractCount:_(t,a,e),wrappers:I(t,a,e),passthroughs:$(t,a,e),stale:z(t,a,e)}}function X(t,a,e){return{drift:k(t,a,e),complexity:N(t,a,e)}}function D(t,a,e){return s(t,e,"dead",()=>{let r=g(t,{scope:a,minLoc:3,skipBarrels:!0,deadCodeOnly:!0,scanLimit:e.candidateScanLimit,semantic:!1});return u(et(t,r.symbols))})}function T(t,a,e){return s(t,e,"isolated",()=>{let r=y(t,{scope:a,minLoc:3,scanLimit:e.candidateScanLimit,semantic:!1});return u(at(t,r))})}function B(t,a,e){return s(t,e,"cycles",()=>H(t,{scope:a}).filter(i=>i.kind==="real").length)}function M(t,a,e){return s(t,e,"similar",()=>C(t,{scope:a,minSimilarity:.6,limit:50,minCallees:4,scanLimit:e.candidateScanLimit,semantic:!1}).length)}function _(t,a,e){return s(t,e,"extract-candidates",()=>S(t,{scope:a,minLoc:15,minCallees:5,limit:50,scanLimit:e.candidateScanLimit,semantic:!1}).length)}function I(t,a,e){return s(t,e,"wrapper-candidates",()=>u(w(t,{scope:a,maxLoc:15,limit:50,scanLimit:e.candidateScanLimit,semantic:!1})))}function $(t,a,e){return s(t,e,"passthrough-candidates",()=>u(b(t,{scope:a,maxLoc:15,limit:50,scanLimit:e.candidateScanLimit,semantic:!1})))}function z(t,a,e){return s(t,e,"stale-abstractions",()=>{let r=L(t,{scope:a,minLoc:3,limit:50,scanLimit:e.candidateScanLimit,semantic:!1}),i=r.filter(o=>o.consumers===0).length;return{count:r.length,loc:r.reduce((o,c)=>o+c.loc,0),unused:i,singleUse:r.length-i}})}function k(t,a,e){return s(t,e,"drift",()=>{let r=x(t,{scope:a,semantic:!1});return{count:r.unusedImports+r.layerViolations,unusedImports:r.unusedImports,layerViolations:r.layerViolations}})}function N(t,a,e){return s(t,e,"complexity-hotspots",()=>{let r=P(t,{scope:a,minLoc:10,limit:10,scanLimit:e.candidateScanLimit,semantic:!1});return{top:r.slice(0,5).map(i=>({symbol:i.shortName,score:i.score})),extremeCount:r.filter(i=>i.score>O).length}})}function Q(t){let a=[];if(t.dead.count>0&&a.push({category:"Dead code",description:`${t.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:t.dead.count,locRecoverable:t.dead.loc}),t.isolated.count>0&&a.push({category:"Isolated symbols",description:`${t.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:t.isolated.count,locRecoverable:t.isolated.loc}),t.realCycleCount>0&&a.push({category:"Circular dependencies",description:`${t.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:t.realCycleCount,locRecoverable:0}),t.similarCount>0&&a.push({category:"Similar functions",description:`${t.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:t.similarCount,locRecoverable:0}),t.extractCount>0&&a.push({category:"Extraction candidates",description:`${t.extractCount} large functions with isolated callee clusters \u2014 extract method opportunities`,effort:"medium",impact:"medium",count:t.extractCount,locRecoverable:0}),t.wrappers.count>0&&a.push({category:"Wrapper functions",description:`${t.wrappers.count} single-consumer symbols that could be inlined`,effort:"low",impact:"low",count:t.wrappers.count,locRecoverable:t.wrappers.loc}),t.passthroughs.count>0&&a.push({category:"Passthrough functions",description:`${t.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:t.passthroughs.count,locRecoverable:t.passthroughs.loc}),t.stale.count>0){let i=[];t.stale.unused>0&&i.push(`${t.stale.unused} unused`),t.stale.singleUse>0&&i.push(`${t.stale.singleUse} single-consumer (not in types file)`),a.push({category:"Stale abstractions",description:`${i.join(", ")} \u2014 premature abstraction`,effort:"low",impact:"medium",count:t.stale.count,locRecoverable:t.stale.loc})}if(t.drift.count>0){let i=[];t.drift.unusedImports>0&&i.push(`${t.drift.unusedImports} unused imports`),t.drift.layerViolations>0&&i.push(`${t.drift.layerViolations} layer violations`),a.push({category:"Structural drift",description:i.join(", "),effort:t.drift.layerViolations>0?"medium":"low",impact:t.drift.layerViolations>0?"medium":"low",count:t.drift.count,locRecoverable:0})}let e={high:3,medium:2,low:1},r={low:3,medium:2,high:1};return a.sort((i,o)=>{let c=e[i.impact]*r[i.effort];return e[o.impact]*r[o.effort]-c}),a}function J(t){let a=Math.max(t.statsResult.documents,1),e=Math.max(t.statsResult.symbols,1),r=100,i=t.dead.count/e;r-=Math.min(20,Math.round(i*200));let o=t.isolated.count/e;r-=Math.min(10,Math.round(o*200)),r-=Math.min(15,t.realCycleCount*5);let c=t.similarCount/e*1e3;r-=Math.min(10,Math.round(c));let p=t.extractCount/e*1e3;r-=Math.min(5,Math.round(p/2)),r-=Math.min(3,t.wrappers.count),r-=Math.min(3,t.passthroughs.count);let U=t.stale.count/Math.max(e*.1,1);r-=Math.min(8,Math.round(U*10));let V=t.drift.count/a;return r-=Math.min(5,Math.round(V*50)),r-=Math.min(5,t.complexity.extremeCount*2),Math.max(0,Math.min(100,r))}function K(t,a){return t.symbols>=j||t.documents>=W?a?{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:["Large index detected; running unbounded health analyses because --full was supplied."]}:{candidateScanLimit:A,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${A} symbols. Run "scip-query health --full" for unbounded candidate counts.`]}:{candidateScanLimit:void 0,releaseCachesBetweenPhases:!0,warnings:[]}}function Z(t,a){a.releaseCachesBetweenPhases&&(R(t),m(t),h())}function s(t,a,e,r){tt(e);try{return r()}finally{Z(t,a)}}function tt(t){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${t}`)}function et(t,a){return a.filter(e=>!l(t,e.relativePath)&&!d(t,e.symbol,e.relativePath)&&e.kind==="dead-code")}function at(t,a){return a.filter(e=>!l(t,e.relativePath)&&!d(t,e.symbol,e.relativePath))}function u(t){return{count:t.length,loc:t.reduce((a,e)=>a+e.loc,0)}}export{gt as a,Ht as b,yt as c,Ct as d};
|
|
2
|
-
//# sourceMappingURL=chunk-TYR7QY5G.js.map
|
package/dist/chunk-UZG3QXTG.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-LNUZWWWL.js";import{s as f}from"./chunk-NLJCXHFU.js";function E(e,s={}){let{scope:t,minLoc:o=10,minCallees:l=6,limit:n=20,scanLimit:c}=s,r=new g(e),i=r.productionCallableDefinitions({scope:t,minLoc:o,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),m=L(i,c),p=r.calleeMap(m,{semantic:s.semantic!==!1}),d=[];for(let a of m){let u=b(a,p.get(a.symbolId)??[],l);u&&d.push(u)}return d.sort((a,u)=>u.clusters.length-a.clusters.length||u.loc-a.loc),d.slice(0,n)}function b(e,s,t){let o=new Set(s.map(r=>r.symbol));if(o.size<t)return null;let l=h(o,s),n=S(o,l);if(n.length<2)return null;let c=C(n,l);return c.length===0?null:{symbol:e.symbol,shortName:f(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:x(e),totalCallees:o.size,clusters:c}}function h(e,s){let t=new Map;for(let l of e)t.set(l,new Set);let o=new Map;for(let l of s){let n=o.get(l.chunkId);n||(n=new Set,o.set(l.chunkId,n)),n.add(l.symbol)}for(let l of o.values()){let n=[...l];for(let c=0;c<n.length;c++)for(let r=c+1;r<n.length;r++)t.get(n[c]).add(n[r]),t.get(n[r]).add(n[c])}return t}function S(e,s){let t=new Set,o=[];for(let l of e){if(t.has(l))continue;let n=new Set,c=[l];for(;c.length>0;){let r=c.pop();if(!t.has(r)){t.add(r),n.add(r);for(let i of s.get(r)??[])t.has(i)||c.push(i)}}o.push(n)}return o}function C(e,s){return e.filter(t=>t.size>=3).map(t=>y(t,e,s)).filter(t=>t.isolation>.5).sort((t,o)=>o.isolation-t.isolation)}function y(e,s,t){let o=new Set;for(let r of s)if(r!==e)for(let i of r)o.add(i);let l=0;for(let r of e)for(let i of t.get(r)??[])o.has(i)&&l++;let n=e.size*o.size,c=n>0?1-l/n:1;return{callees:[...e].map(f),isolation:c}}function x(e){return e.endLine-e.startLine+1}function L(e,s){return typeof s!="number"||s<=0||e.length<=s?e:e.slice(0,s)}export{E as a};
|
|
2
|
-
//# sourceMappingURL=chunk-UZG3QXTG.js.map
|
package/dist/chunk-VDMRAGBK.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as F,b as y,d as A,e as T}from"./chunk-RKTDEIHF.js";import{a as k}from"./chunk-LNUZWWWL.js";import{k as B}from"./chunk-EHEZLULQ.js";import{a as R}from"./chunk-BT36WY5B.js";import{d as P,s as p,t as M,w as x,z as q}from"./chunk-NLJCXHFU.js";function re(e,t,i={}){let{minSimilarity:s=.4,limit:r=20}=i,a=Z(e,t,{semantic:i.semantic!==!1});if(!a)return[];if(!x(a.symbol))return[];let n=O(e,a,s,{scanLimit:i.scanLimit,semantic:i.semantic!==!1});return n.length>0?n.slice(0,r):K(e,t,{minSimilarity:s,limit:r})}function O(e,t,i,s){let r=v(e,{minCallees:3,excludeSymbol:t.symbol,scanLimit:s.scanLimit,semantic:s.semantic}),a=A([t,...r].map(o=>o.callees)),n=[];for(let o of r){if(o.callees.size<3)continue;let l=$(t,o,a,{minSimilarity:i,requireSignificantShared:1,requireSharedCount:0});l&&n.push(l)}return n.sort((o,l)=>l.similarity-o.similarity),n}function $(e,t,i,s){let{similarity:r,significantShared:a}=T(e.callees,t.callees,i);if(r<s.minSimilarity)return null;let n=F(e.callees,t.callees).size;if(a.length<s.requireSignificantShared&&n<s.requireSharedCount)return null;let o=a.length>0?a:[...F(e.callees,t.callees)];return{symbolA:e.symbol,shortNameA:p(e.symbol),fileA:e.file,symbolB:t.symbol,shortNameB:p(t.symbol),fileB:t.file,similarity:r,similarityBasis:"callees",sharedCallees:o.map(p),uniqueToA:[...y(e.callees,t.callees)].map(p),uniqueToB:[...y(t.callees,e.callees)].map(p)}}function ae(e,t={}){let{minSimilarity:i=.5,limit:s=20,scope:r,minCallees:a=4,crossFileOnly:n=!1,scanLimit:o}=t,l=v(e,{minCallees:a,scope:r,scanLimit:o,semantic:t.semantic!==!1}),c=A(l.map(m=>m.callees)),u=new Map;for(let m of l)for(let f of m.callees)u.set(f,(u.get(f)??0)+1);let h=Math.max(8,Math.ceil(Math.sqrt(l.length))),w=new Map;for(let m=0;m<l.length;m+=1)for(let f of l[m].callees){if((u.get(f)??0)>h)continue;let g=w.get(f);g||(g=[],w.set(f,g)),g.push(m)}let C=[],z=new Set;e:for(let m=0;m<l.length;m+=1){let f=l[m],g=new Set;for(let D of f.callees){let S=w.get(D);if(S)for(let b of S)b>m&&g.add(b)}for(let D of g){let S=`${m}|${D}`;if(z.has(S))continue;z.add(S);let b=l[D];if(n&&f.file===b.file)continue;if(f.paramCount>=0&&b.paramCount>=0){let j=Math.abs(f.paramCount-b.paramCount),_=Math.max(2,Math.ceil(Math.max(f.paramCount,b.paramCount)*.5));if(j>_)continue}let L=$(f,b,c,{minSimilarity:i,requireSignificantShared:2,requireSharedCount:4});if(L&&(C.push(L),C.length>s*5))break e}}return C.sort((m,f)=>f.similarity-m.similarity),C.slice(0,s)}var V=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function Z(e,t,i){let s=R(e,t),r=new k(e);if(!s)return null;let a=B(e,s,{semantic:i.semantic});return{symbol:s.symbol,file:s.relativePath,callees:E(a.map(n=>n.symbol)),paramCount:r.callableSignature(s)?.paramCount??-1}}function v(e,t){let{minCallees:i,scope:s,excludeSymbol:r,scanLimit:a}=t,n=new k(e),o=U(n.productionCallableDefinitions({scope:s,minLoc:5,excludeSymbol:r,sortByLocDesc:typeof a=="number"&&a>0}),a),l=n.calleeMap(o,{semantic:t.semantic!==!1});return o.map(c=>({symbol:c.symbol,file:c.relativePath,callees:E((l.get(c.symbolId)??[]).map(u=>u.symbol)),paramCount:n.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=i)}function U(e,t){return typeof t!="number"||t<=0||e.length<=t?e:e.slice(0,t)}function E(e){return new Set([...e].filter(t=>!W(t)))}function W(e){return V.some(t=>e.includes(t))}function K(e,t,i){let s=G(e,t);if(!s||s.tokens.size<3)return[];let r=i.minSimilarity>=.5?i.minSimilarity:.3,a=[];for(let n of J(e)){if(n.symbol===s.symbol||n.tokens.size<3)continue;let o=F(s.tokens,n.tokens);if(o.size<2)continue;let l=new Set([...s.tokens,...n.tokens]),c=l.size>0?o.size/l.size:0;c<r||a.push({symbolA:s.symbol,shortNameA:p(s.symbol),fileA:s.file,symbolB:n.symbol,shortNameB:p(n.symbol),fileB:n.file,similarity:c,similarityBasis:"source-tokens",sharedCallees:[...o].sort(),uniqueToA:[...y(s.tokens,n.tokens)].sort(),uniqueToB:[...y(n.tokens,s.tokens)].sort()})}return a.sort((n,o)=>o.similarity-n.similarity||n.shortNameB.localeCompare(o.shortNameB)),a.slice(0,i.limit)}function G(e,t){let i=R(e,t);if(!i||!x(i.symbol))return null;let s=H(e,i);return s?{symbol:i.symbol,file:i.relativePath,tokens:s}:null}function H(e,t){let i=M(t.symbol),s=I(e,t.relativePath,t.startLine,t.endLine,i),r=N(s,i);return r.size>0?r:null}function J(e){let t=new k(e);return t.scopedDefinitions().filter(i=>i.isFunctionLike).filter(i=>t.fileKind(i.relativePath)!=="test").filter(i=>!q(i.symbol)).map(i=>({symbol:i.symbol,file:i.relativePath,tokens:N(I(e,i.relativePath,i.startLine,i.endLine,i.leaf),i.leaf)})).filter(i=>i.tokens.size>0)}function I(e,t,i,s,r){let a=P(e,t);if(!a)return"";let n=a.split(`
|
|
2
|
-
`);if(s>=i&&s-i<=12)return n.slice(i,s+1).join(`
|
|
3
|
-
`);let o=[new RegExp(`\\bdef\\s+${d(r)}\\b`),new RegExp(`\\bfun\\s+${d(r)}\\b`),new RegExp(`\\bfn\\s+${d(r)}\\b`),new RegExp(`\\bfunction\\s+${d(r)}\\b`),new RegExp(`\\b${d(r)}\\s*\\(`)],l=n.findIndex(c=>o.some(u=>u.test(c)));if(l>=0){let c=l;for(let u=l+1;u<n.length&&u<=l+8;u++){let h=n[u]??"";if(u>l&&X(h)||(c=u,h.trim()===""&&u>l+1))break}return n.slice(l,c+1).join(`
|
|
4
|
-
`)}return n.slice(i,Math.min(n.length,i+8)).join(`
|
|
5
|
-
`)}function N(e,t){if(!e)return new Set;let i=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),s=Q(t),a=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(n=>n.trim()).filter(n=>n.length>1).filter(n=>!i.has(n)).filter(n=>!s.has(n));return new Set(a)}function Q(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(t=>t.toLowerCase()).filter(t=>t.length>1))}function X(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function d(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{re as a,ae as b};
|
|
6
|
-
//# sourceMappingURL=chunk-VDMRAGBK.js.map
|
package/dist/chunk-W6SRVK2Y.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as P}from"./chunk-LNUZWWWL.js";import{f as D}from"./chunk-33Z6HQBX.js";import{a as S,d as b,h as C,l as x,n as I,r as L,s as v,t as d}from"./chunk-NLJCXHFU.js";function ue(n,e){let{scope:t,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:a=!1,scanLimit:o}=e??{},f=e?.semantic!==!1,c=new P(n),u=c.scopedDefinitions(t),m=G(c,t),p=Y(B(n,c,u,{minLoc:i,maxLoc:s}).sort((l,g)=>y(g)-y(l)||l.relativePath.localeCompare(g.relativePath)),o),A=N(c,p,{semantic:f}),$=U(n,c,u,p,{semantic:f}),_=E(p);return j(n,p,A,_).filter(l=>!$.has(l.definition.symbolId)).filter(l=>!l.transitivelyReachable).filter(l=>l.realConsumers.length<=1).filter(l=>!(l.realConsumers.length===0&&l.barrelConsumers>0)).filter(l=>q(l.definition,l.realConsumers.length,m)).map(l=>O(n,l)).filter(l=>a||l.confidence!=="low").sort((l,g)=>{let h={high:0,medium:1,low:2};return h[l.confidence]-h[g.confidence]||g.loc-l.loc||l.file.localeCompare(g.file)||l.startLine-g.startLine}).slice(0,r)}function B(n,e,t,i){return t.filter(s=>s.isTypeLike&&y(s)>=i.minLoc).filter(s=>y(s)<=i.maxLoc).filter(s=>!n.isIgnored(s.relativePath)).filter(s=>!Z(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function N(n,e,t){return R(n.crossFileCallerMap(e,{semantic:t.semantic}),n.sourceFallbackCallerFiles(e))}function E(n){let e=new Map;for(let t of n){let i=e.get(t.relativePath);i||(i=new Map,e.set(t.relativePath,i));let s=d(t.symbol);s&&i.set(s,t)}return e}function j(n,e,t,i){return e.map(s=>{let a=[...t.get(s.symbolId)??new Set].filter(u=>u!==s.relativePath&&!n.isIgnored(u)),{realConsumers:o,barrelConsumers:f}=J(n,s.relativePath,s.symbol,a),c=Q(n,s,t,i);return{definition:s,realConsumers:o,barrelConsumers:f,transitivelyReachable:c}})}function O(n,e){let t=k(n,e.definition.relativePath,e.definition.startLine),i=M(e.definition.relativePath)?!0:ne(n,e.definition),{confidence:s,reason:r}=te(e.realConsumers.length,t,i);return{symbol:e.definition.symbol,shortName:v(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:y(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:t,definerUsesType:i,confidence:s,reason:r}}function U(n,e,t,i,s){let r=H(n,z(t),i),a=r.map(c=>c.singleton);if(r.length===0)return new Set;let o=R(e.crossFileCallerMap(a,{semantic:s.semantic}),e.sourceFallbackCallerFiles(a)),f=new Set;for(let{singleton:c,classId:u}of r)V(n,c,o)&&f.add(u);return f}function z(n){let e=new Map;for(let t of n){let i=d(t.symbol);i&&e.set(w(t.relativePath,i),t)}return e}function H(n,e,t){let i=[];for(let s of t){let r=K(n,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function K(n,e,t){if(k(n,t.relativePath,t.startLine)!=="class")return null;let i=d(t.symbol);if(!i)return null;let s=W(n,t.relativePath,i);return s?e.get(w(t.relativePath,s))??null:null}function V(n,e,t){let i=d(e.symbol),s=t.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!n.isIgnored(r)&&!T(n,r,i))}function w(n,e){return`${n}\0${e}`}function W(n,e,t){let i=b(n,e);if(!i)return null;let s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(r)?.[1]??null}function G(n,e){return new Set(n.scopedDefinitions(e).filter(t=>t.isFunctionLike).map(t=>t.relativePath))}function Z(n){let e=L(n);if("kind"in e)return!1;let t=e.descriptors;if(t.length<2)return!1;let i=t[t.length-1],s=t[t.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function M(n){let t=(n.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(t==="types"||t==="models"||t==="schema"||t==="common"||t==="protocol"||t==="proto"||t==="dto"||t==="mod"||/(^|\/)types(\/|\.)/.test(n)||/(^|\/)models?(\/|\.)/.test(n)||/(^|\/)proto(?:col)?(\/|\.)/.test(n)||/(^|\/)schema(\/|\.)/.test(n))}function q(n,e,t){return!(M(n.relativePath)&&e>0||e===0&&t.has(n.relativePath))}function J(n,e,t,i){let s=[],r=0,a=d(t);for(let o of i)ee(n,o,e,a)||T(n,o,a)?r++:s.push(o);return{realConsumers:s,barrelConsumers:r}}function Q(n,e,t,i){let s=I(n,e.relativePath),r=d(e.symbol);if(!r)return!1;let a=s.get(r);if(!a||a.size===0)return!1;let o=i.get(e.relativePath);if(!o)return!1;for(let f of a){let c=o.get(f);if(!c)continue;let u=t.get(c.symbolId);if(u){for(let m of u)if(m!==e.relativePath&&!n.isIgnored(m))return!0}}return!1}var F=S("stale-abs-file-usage");function T(n,e,t){if(!t)return!1;let i=C(e);if(!i)return!1;let s=F.get(n,e,()=>X(n,e,i));return s.importedLeaves.has(t)&&!s.usedLeaves.has(t)}function X(n,e,t){let i=new Set,s=new Set,r=x(n,e);if(!r)return{importedLeaves:i,usedLeaves:s};let a=t==="rust"?new Set(["use_declaration"]):t==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),o=(f,c)=>{let u=c||a.has(f.type);(f.type==="identifier"||f.type==="type_identifier"||f.type==="property_identifier"||f.type==="field_identifier")&&(u?i.add(f.text):s.add(f.text));for(let m of f.children)o(m,u)};return o(r.rootNode,!1),{importedLeaves:i,usedLeaves:s}}function Y(n,e){return typeof e!="number"||e<=0||n.length<=e?n:n.slice(0,e)}function de(n){F.invalidateAll(n)}function ee(n,e,t,i){if(!i)return!1;let s=b(n,e);if(!s)return!1;let r=D(n,e);if(r.length===0)return!1;let a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`\\b${a}\\b`),f=s.split(`
|
|
2
|
-
`),c=0;for(let u=0;u<f.length;u++){if(!o.test(f[u]??""))continue;if(c++,!r.find(p=>p.startLine<=u&&u<=p.endLine))return!1}return c>0}function k(n,e,t){let i=b(n,e);if(!i)return"other";let s=i.split(`
|
|
3
|
-
`),r=Math.max(0,t-2),a=Math.min(s.length-1,t+2);for(let o=r;o<=a;o++){let c=(s[o]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(c))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(c))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(c))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(c))return"enum"}return"other"}function ne(n,e){let t=b(n,e.relativePath);if(!t)return!1;let i=d(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),a=t.split(`
|
|
4
|
-
`);for(let o=0;o<a.length;o++)if(!(o>=e.startLine&&o<=e.endLine)&&r.test(a[o]??""))return!0;return!1}function te(n,e,t){return n===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:n===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:n===1&&!t?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}function y(n){return n.endLine-n.startLine+1}function R(...n){let e=new Map;for(let t of n)for(let[i,s]of t){let r=e.get(i);r||(r=new Set,e.set(i,r));for(let a of s)r.add(a)}return e}export{ue as a,de as b};
|
|
5
|
-
//# sourceMappingURL=chunk-W6SRVK2Y.js.map
|
package/dist/chunk-WGYJDGBI.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{l as d}from"./chunk-EHEZLULQ.js";import{G as l,s as m}from"./chunk-NLJCXHFU.js";function y(o,t={}){let{limit:s=30,scope:e}=t,n=e?`AND def_d.relative_path LIKE '%${e}%'`:"",r=o.all(`SELECT
|
|
2
|
-
gs.symbol,
|
|
3
|
-
COUNT(*) AS ref_count,
|
|
4
|
-
COUNT(DISTINCT ref_d.id) AS file_count,
|
|
5
|
-
def_d.relative_path AS defined_in
|
|
6
|
-
FROM mentions m
|
|
7
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
8
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
9
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
10
|
-
JOIN (
|
|
11
|
-
SELECT m2.symbol_id, c2.document_id
|
|
12
|
-
FROM mentions m2
|
|
13
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
14
|
-
WHERE m2.role = 1
|
|
15
|
-
GROUP BY m2.symbol_id
|
|
16
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
17
|
-
JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
18
|
-
WHERE m.role != 1
|
|
19
|
-
${o.pathExclusionsFor("def_d")}
|
|
20
|
-
${o.symbolNoiseFor("gs")}
|
|
21
|
-
${n}
|
|
22
|
-
GROUP BY gs.id
|
|
23
|
-
ORDER BY ref_count DESC
|
|
24
|
-
LIMIT ?`,s).filter(i=>!o.isIgnored(i.defined_in)).map(i=>({symbol:i.symbol,shortName:m(i.symbol),refCount:i.ref_count,fileCount:i.file_count,definedIn:i.defined_in}));return r.length>0?r:f(o,e,s)}function f(o,t,s){return l(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>u(o,e)).filter(e=>e.refCount>0).sort((e,n)=>n.refCount-e.refCount||n.fileCount-e.fileCount).slice(0,s)}function u(o,t){let s=d(o,t,{limit:500});return{symbol:t.symbol,shortName:m(t.symbol),refCount:s.length,fileCount:new Set(s.map(e=>e.file)).size,definedIn:t.relativePath}}export{y as a};
|
|
25
|
-
//# sourceMappingURL=chunk-WGYJDGBI.js.map
|
package/dist/chunk-WYX3RU2K.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as d}from"./chunk-RKTDEIHF.js";import{j as a}from"./chunk-EHEZLULQ.js";function F(t,i={}){let{minSimilarity:f=.5,limit:n=20,scope:o,filePattern:s}=i,u=i.minDeps??(s?1:3),e=g(t,{scope:o,minDeps:u}),p=[];if(s){let r=e.find(l=>l.file.includes(s));if(!r)return[];for(let l of e){if(l.file===r.file)continue;let c=m(r,l,f);c&&p.push(c)}}else for(let r=0;r<e.length;r++){for(let l=r+1;l<e.length;l++){let c=m(e[r],e[l],f);c&&p.push(c)}if(p.length>n*5)break}return p.sort((r,l)=>l.similarity-r.similarity),p.slice(0,n)}function g(t,i){let{scope:f,minDeps:n}=i,o=a(t,f),s=h(o),u=[];for(let[e,p]of o)p.size>=n&&u.push({file:e,deps:new Set([...p].filter(r=>!s.has(r)))});return u}function h(t){let i=new Set,f=t.size;if(f===0)return i;let n=new Map;for(let o of t.values())for(let s of o)n.set(s,(n.get(s)??0)+1);for(let[o,s]of n)s>=5&&s/f>.3&&i.add(o);return i}function m(t,i,f){let n=new Set;for(let e of t.deps)i.deps.has(e)&&n.add(e);if(n.size<3||t.deps.size<4||i.deps.size<4)return null;let o=d(t.deps,i.deps);if(o<f)return null;let s=[];for(let e of t.deps)i.deps.has(e)||s.push(e);let u=[];for(let e of i.deps)t.deps.has(e)||u.push(e);return{fileA:t.file,fileB:i.file,similarity:o,sharedDeps:[...n],uniqueToA:s,uniqueToB:u}}export{F as a};
|
|
2
|
-
//# sourceMappingURL=chunk-WYX3RU2K.js.map
|
package/dist/chunk-WZYA234B.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l}from"./chunk-LNUZWWWL.js";import{a as i}from"./chunk-BT36WY5B.js";import{A as n,s,u as m}from"./chunk-NLJCXHFU.js";function c(r,a){let t=i(r,a);return t?new l(r).definitionsForFile(t.relativePath).filter(e=>e.symbol!==t.symbol).filter(e=>n(t.symbol,e.symbol)).sort((e,o)=>e.startLine-o.startLine||e.endLine-o.endLine).map(e=>({symbol:e.symbol,shortName:s(e.symbol),startLine:e.startLine,endLine:e.endLine,kind:m(e.symbol)??"unknown"})):[]}export{c as a};
|
|
2
|
-
//# sourceMappingURL=chunk-WZYA234B.js.map
|
package/dist/chunk-Y6ZFXZ7B.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as y}from"./chunk-EHEZLULQ.js";function L(D,k={}){let{limit:x=10,scope:M,minDepth:j=3}=k,a=y(D,M),u=new Map,o=[],l=new Map,r=new Map,g=new Set,f=[],d=0;for(let t of a.keys()){if(l.has(t))continue;let n=[],s=(a.get(t)??new Set).values();for(l.set(t,d),r.set(t,d),d+=1,f.push(t),g.add(t),n.push({node:t,iter:s,pendingChild:null});n.length>0;){let e=n[n.length-1];if(e.pendingChild!==null){let h=e.pendingChild;e.pendingChild=null,r.set(e.node,Math.min(r.get(e.node),r.get(h)))}let c=e.iter.next();if(c.done){if(r.get(e.node)===l.get(e.node)){let h=[];for(;;){let p=f.pop();if(g.delete(p),h.push(p),u.set(p,o.length),p===e.node)break}o.push(h)}n.pop();continue}let i=c.value;if(l.has(i))g.has(i)&&r.set(e.node,Math.min(r.get(e.node),l.get(i)));else{l.set(i,d),r.set(i,d),d+=1,f.push(i),g.add(i);let h=(a.get(i)??new Set).values();e.pendingChild=i,n.push({node:i,iter:h,pendingChild:null})}}}let m=new Map,b=new Array(o.length);for(let t=0;t<o.length;t++)b[t]=o[t].length,m.set(t,new Set);for(let[t,n]of a){let s=u.get(t);for(let e of n){let c=u.get(e);c!==s&&m.get(s).add(c)}}let S=new Array(o.length),I=new Array(o.length);for(let t=0;t<o.length;t++){let n=[],s=0;for(let e of m.get(t)){let c=I[e];c>s&&(s=c,n=S[e])}S[t]=[t,...n],I[t]=b[t]+s}function v(t){return S[t]}let A=o.map(t=>[...t].sort()),C=new Set,w=[];for(let t=0;t<o.length;t++){let n=v(t),s=[];for(let c of n)s.push(...A[c]);if(s.length<j)continue;let e=s.join(" ");C.has(e)||(C.add(e),w.push({chain:s,depth:s.length}))}return w.sort((t,n)=>n.depth-t.depth),w.slice(0,x)}export{L as a};
|
|
2
|
-
//# sourceMappingURL=chunk-Y6ZFXZ7B.js.map
|
package/dist/chunk-YCN5XEST.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-LNUZWWWL.js";import{a as m}from"./chunk-BT36WY5B.js";import{s as l}from"./chunk-NLJCXHFU.js";import{readFileSync as u}from"fs";import{join as p}from"path";function R(e,n,r={}){let t=m(e,n);if(!t)return null;let c=new b(e),s=P(y(e,t.relativePath,t.startLine,t.endLine),h(e,t.relativePath)),o=t.endLine-t.startLine+1,a=c.calleeMap([t],{additive:!0,semantic:r.semantic}).get(t.symbolId)??[],g=new Set(a.map(f=>f.symbol));return{symbol:t.symbol,shortName:l(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:o,branches:s,cyclomaticEstimate:s+1,calleeCount:g.size,fanIn:d(e,t.symbolId),fanOut:S(a,t.relativePath)}}function h(e,n){return e.get("SELECT language FROM documents WHERE relative_path = ?",n)?.language??"unknown"}function y(e,n,r,t){try{return u(p(e.config.projectRoot,n),"utf-8").split(`
|
|
2
|
-
`).slice(r,t+1).join(`
|
|
3
|
-
`)}catch{return""}}function d(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS c
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
WHERE m.symbol_id = ? AND m.role != 1`,n)?.c??0}function S(e,n){return new Set(e.filter(r=>r.file!==n).map(r=>r.symbol)).size}function P(e,n){let r=C(e),t=0,c=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let s of c){let o=r.match(s);o&&(t+=o.length)}if(n==="python"){let s=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let o of s){let i=r.match(o);i&&(t+=i.length)}}else if(n==="rust"){let s=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let o of s){let i=r.match(o);i&&(t+=i.length)}}else if(n==="ruby"){let s=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let o of s){let i=r.match(o);i&&(t+=i.length)}}else if(n==="go"){let s=[/\bselect\b/g,/\bdefer\b/g];for(let o of s){let i=r.match(o);i&&(t+=i.length)}}return t}function C(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*/g,"").replace(/#.*/g,"").replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/'(?:[^'\\]|\\.)*'/g,"''").replace(/`(?:[^`\\]|\\.)*`/g,"``")}export{R as a};
|
|
7
|
-
//# sourceMappingURL=chunk-YCN5XEST.js.map
|