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
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as p,c as u}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as p,c as u}from"./chunk-DS6QEB3G.js";import{c}from"./chunk-A536TEU4.js";import{d as a}from"./chunk-7S5E7KWT.js";var l=a("suppression-inventory",{clearGroups:["whole-project"]});function b(e){return l.get(e,()=>f(e))}function f(e){let r={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,uncategorized:0},t=new Map,s=0;for(let o of c(e)){let n=p(e,o);if(!(!n||!n.includes("scip-query")))for(let g of n.split(/\r?\n/)){let i=u(g);if(i===null)continue;s+=1,t.set(o,(t.get(o)??0)+1);let y=d(i);r[y]+=1}}return{total:s,byCategory:r,byFile:t}}function d(e){if(!e)return"uncategorized";let r=e.toLowerCase();return r==="dead-code"?"dead":r}export{b as a};
|
|
2
|
+
//# sourceMappingURL=chunk-VOYOYC5T.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as A}from"./chunk-VFLHKRTW.js";import{a as C}from"./chunk-XPOZO76D.js";import{a as k}from"./chunk-T633QLYF.js";import{c as b}from"./chunk-JM72FNGA.js";import{a as p}from"./chunk-64MNV6AB.js";import{posix as f}from"path";var j=20,z=1,_=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),G=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),O=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function De(e,n={}){let t=L(n.limit,j),i=L(n.minConsumers,z),o=new C(e),s=o.fileDependencyGraph(n.scope),r=de(p(e,{includeIgnored:!1})),c=fe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?q(e,o,n.target):Y(e,n.scope,n.scanLimit)).map(a=>K(o,s,a,n,r,c)).filter(a=>a.consumerFiles.length>=i||n.target).sort(ue).slice(0,t)}function q(e,n,t){let i=V(e,t);if(i)return[N(i)];let o=k(e,t);if(!o)return[];let s=n.definitionsForFile(o.relativePath).find(r=>r.symbolId===o.symbolId);return s?[X(s)]:[{unit:{kind:"symbol",file:o.relativePath,shortName:b(o.symbol),symbol:o.symbol,startLine:o.startLine,endLine:o.endLine}}]}function Y(e,n,t){let i=p(e,{scope:n,includeIgnored:!1}),o=L(t,i.length);return i.slice(0,o).map(s=>N(s))}function K(e,n,t,i,o,s){let r=t.definition?J(e,t.definition,i.semantic):Q(n,t.unit.file),c=t.definition?r.length>0?"exact":"none":r.length>0?"file-level":"none",m=t.unit.file,l=u(f.dirname(m)),a=ee(r),h=Z(l),B=w([...F(l),...a?F(a):[]]),y=ne(t.unit,l,a,r),g=te(y,t.unit,l,a,r,o,s),E=ae(t.unit,c,a,r,l,g.whyNoSuggestedHome),W=ce(t.unit,l,a,r,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:t.unit,candidatePath:m,currentDirectory:l,directoryAncestry:h,consumerFiles:r,consumerCoverage:c,nearestCommonOwner:a,boundaryMarkers:B,recommendedTier:y,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:E,reasons:W,recommendation:le(y,g.suggestedHome,c)}}function J(e,n,t){let i=A(e,[n],{semantic:t!==!1,sourceFallback:!0});return H(i.get(n.symbolId)??[])}function Q(e,n){let t=[];for(let[i,o]of e.entries())i!==n&&o.has(n)&&t.push(i);return H(t)}function V(e,n){let t=D(n),i=p(e,{includeIgnored:!1}),o=i.find(r=>r===t);if(o)return o;let s=i.find(r=>r.endsWith(`/${t}`));return s||(i.find(r=>r.includes(t))??null)}function X(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:b(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function N(e){return{unit:{kind:"file",file:e,shortName:f.basename(e)}}}function Z(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let o=t.slice(0,i+1).join("/");n.push({path:o,depth:i,markers:v(o)})}return n}function F(e){return e==="."?[]:I(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function v(e){return w(I(e).map(({marker:n})=>n))}function I(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let o=_.get(n[i]);o&&t.push({marker:o,prefix:n.slice(0,i+1).join("/")})}return t}function ee(e){if(e.length===0)return null;let n=e.map(i=>u(f.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let o=i.split("/").filter(Boolean),s=[],r=Math.min(t.length,o.length);for(let c=0;c<r&&t[c]===o[c];c+=1)s.push(t[c]);t=s}return t.length===0?".":t.join("/")}function ne(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":R(t,"package")?"package-level-shared":R(t,"app")?"app-level-shared":U(t,["feature","domain","module"])||U(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function te(e,n,t,i,o,s,r){let c=ie(e,i);if(c)return d(c);let m=me(n.file),l=re(e,t,m,o,r);if(l)return l;let a=i;if(u(t)===u(a))return d(`${t} is already the nearest common owner for its consumers.`);let h=oe(a,t,m,r);return h||se(a,t,m,s,r)}function ie(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function re(e,n,t,i,o){if(e==="same-file"){let s=i[0]??null;return s?S(s):d("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=u(f.dirname(i[0])),r=M(n,t,s,o);return r?d(r):S(s)}return null}function oe(e,n,t,i){return pe(e)?$(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function se(e,n,t,i,o){if(e===".")return d("The nearest common owner is the repository root.");let s=`${e}/shared`,r=$(s,n,t,o,`Proposed home ${s} is outside source root ${t}.`);return r.confidence==="withheld"||i.has(s)?r:d(`${s} does not exist in the indexed project.`)}function $(e,n,t,i,o){if(!P(e,t))return d(o);let s=M(n,t,e,i);return s?d(s):S(e)}function S(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function d(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ae(e,n,t,i,o,s){let r=["Report-only signal; review ownership before moving files."];return n==="none"&&r.push("No consumers were found in the current index."),n==="file-level"&&r.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&r.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&r.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&r.push("File targets describe module locality, not symbol-level usage."),t&&o.startsWith(`${t}/`)&&r.push("Candidate already lives under the nearest common owner."),s&&r.push(`No exact suggested home: ${s}`),r}function ce(e,n,t,i,o,s){let r=[];return r.push(`${e.shortName} currently lives in ${n}.`),t?r.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):r.push("No consumer owner could be inferred from the current index."),o?r.push(`Suggested home is ${o}.`):s&&r.push(`No exact suggested home: ${s}`),r}function le(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function ue(e,n){return T(n)-T(e)||e.candidatePath.localeCompare(n.candidatePath)}function T(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n-=8),e.recommendedTier==="no-exact-consumers"&&(n-=12),n}function de(e){let n=new Set(["."]);for(let t of e){let i=u(f.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=u(f.dirname(i))}return n}function me(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function P(e,n){let t=u(e),i=u(n);return i==="."||t===i||t.startsWith(`${i}/`)}function ge(e,n,t){let i=x(e),o=x(n);return(P(e,n)?i.slice(o.length):i).some(r=>t.has(r.toLowerCase()))}function M(e,n,t,i){return u(e)===u(t)||!ge(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function fe(...e){let n=new Set(O);for(let t of e)for(let i of t??[]){let o=he(i);o&&n.add(o)}return n}function he(e){let n=e.trim().toLowerCase();return n===""?null:n}function R(e,n){return v(e).includes(n)}function U(e,n){let t=v(e);return n.some(i=>t.includes(i))}function pe(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?G.has(t):!1}function D(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function u(e){let n=D(e);return n===""?".":n}function x(e){let n=D(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function H(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{De as a};
|
|
2
|
+
//# sourceMappingURL=chunk-VXT7WVIN.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import Ge from"better-sqlite3";import{existsSync as Wt,readFileSync as Ht,writeFileSync as Kt}from"fs";import{dirname as Bt,join as Jt,resolve as Ue}from"path";import oe from"better-sqlite3";import{execFileSync as ie}from"child_process";import{existsSync as se,readdirSync as ae,readFileSync as ue}from"fs";import{extname as m,join as F}from"path";import B from"ignore";import{readFileSync as J,existsSync as b}from"fs";import{dirname as S,isAbsolute as x,join as h,relative as z,resolve as q}from"path";function C(e){let t=B(),r=!1,n=Y(e);for(let i of n)try{let o=J(i,"utf-8");t.add(o),r=!0}catch{}return r||t.add(Q),{isIgnored:i=>V(t,e,i),filter:i=>i.filter(o=>!V(t,e,o))}}function Y(e){let t=[],r=h(e,".gitignore");b(r)&&t.push(r);let n=S(e),i=0;for(;n!==S(n)&&i<5;){let o=h(n,".gitignore");if(b(o)&&t.push(o),b(h(n,".git")))break;n=S(n),i++}return t}var Q=`
|
|
2
|
+
# Dependencies
|
|
3
|
+
node_modules/
|
|
4
|
+
vendor/
|
|
5
|
+
.bundle/
|
|
6
|
+
|
|
7
|
+
# Build output
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
out/
|
|
11
|
+
target/
|
|
12
|
+
bin/
|
|
13
|
+
obj/
|
|
14
|
+
|
|
15
|
+
# Python
|
|
16
|
+
__pycache__/
|
|
17
|
+
*.pyc
|
|
18
|
+
*.pyo
|
|
19
|
+
.venv/
|
|
20
|
+
venv/
|
|
21
|
+
.env/
|
|
22
|
+
env/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
|
|
25
|
+
# Rust
|
|
26
|
+
target/
|
|
27
|
+
|
|
28
|
+
# Java / Kotlin / Scala
|
|
29
|
+
*.class
|
|
30
|
+
.gradle/
|
|
31
|
+
.mvn/
|
|
32
|
+
|
|
33
|
+
# C# / .NET
|
|
34
|
+
bin/
|
|
35
|
+
obj/
|
|
36
|
+
packages/
|
|
37
|
+
|
|
38
|
+
# Go
|
|
39
|
+
vendor/
|
|
40
|
+
|
|
41
|
+
# Dart
|
|
42
|
+
.dart_tool/
|
|
43
|
+
build/
|
|
44
|
+
|
|
45
|
+
# PHP
|
|
46
|
+
vendor/
|
|
47
|
+
|
|
48
|
+
# IDE / OS
|
|
49
|
+
.idea/
|
|
50
|
+
.vscode/
|
|
51
|
+
*.swp
|
|
52
|
+
*.swo
|
|
53
|
+
.DS_Store
|
|
54
|
+
Thumbs.db
|
|
55
|
+
|
|
56
|
+
# Type definitions (often noise in queries)
|
|
57
|
+
*.d.ts
|
|
58
|
+
`;function V(e,t,r){let n=Z(t,r);if(!n)return!1;try{return e.ignores(n)}catch{return!1}}function Z(e,t){if(!t||t===".")return null;if(!x(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=x(t)?t:q(e,t),n=z(e,r).replaceAll("\\","/");return!n||n==="."||n.startsWith("..")?null:n}import{readdirSync as ot}from"fs";import{execFileSync as st}from"child_process";import{extname as ut,join as ct}from"path";var ee=[];function k(e){e.groups.length>0&&ee.push(e)}function te(){let e=new WeakMap;return{cache:e,ensure(t){let r=e.get(t);return r||(r=new Map,e.set(t,r)),r}}}function T(e,t){let{cache:r,ensure:n}=te(),i={get(o,s,a){let u=n(o);if(u.has(s))return u.get(s);let c=a();return u.set(s,c),c},invalidate(o,s){r.get(o)?.delete(s)},invalidateAll(o){r.delete(o)},size(o){return r.get(o)?.size??0}};return k({name:e,groups:t.clearGroups,clearAll:o=>i.invalidateAll(o),clearFile:(o,s)=>i.invalidate(o,s)}),i}var ne=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],E=[".vue"],L=[".tsx",".jsx"],D=[".vue"],gt=[...L,...D],dt=new Set(L),ft=new Set(D),re=new Set(ne.map(e=>e.toLowerCase())),pt=[...re].sort().join(","),I=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var mt=T("source-files",{clearGroups:[]});function Vt(e){let t=new Set((e.extensions??E).map(o=>o.toLowerCase()));if(t.size===0)return{scanned:0,inserted:0,existing:0};if(!se(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=C(e.projectRoot),n=ce(e.projectRoot,t).filter(o=>!r.isIgnored(o)),i=new oe(e.dbPath);try{let o=ge(i,n),s=i.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
59
|
+
VALUES (?, ?, NULL, ?)`),u=i.transaction(l=>{let p=0;for(let g of l){if(o.has(g))continue;let d=ue(F(e.projectRoot,g),"utf-8"),X=s.run(de(g),g,d);p+=Number(X.changes)}return p})(n),c={scanned:n.length,inserted:u,existing:n.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{i.close()}}function ce(e,t){let r=le(e,t);if(r)return r;let n=[],i=o=>{let s=o?F(e,o):e,a;try{a=ae(s,{withFileTypes:!0})}catch{return}for(let u of a){if(I.has(u.name))continue;let c=o?`${o}/${u.name}`:u.name;if(u.isDirectory()){i(c);continue}t.has(m(u.name).toLowerCase())&&n.push(c)}};return i(""),n.sort()}function le(e,t){try{return ie("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
|
|
60
|
+
`).filter(n=>n&&t.has(m(n).toLowerCase())).sort()}catch{return null}}function ge(e,t){let r=new Set,n=500;for(let i=0;i<t.length;i+=n){let o=t.slice(i,i+n),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${o.map(()=>"?").join(",")})`).all(...o);for(let a of s)r.add(a.relative_path)}return r}function de(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as fe}from"child_process";import{createHash as pe}from"crypto";import{readdirSync as me,readFileSync as be}from"fs";import{join as O}from"path";function w(e){return(he(e)??ye(e)).filter(t=>t&&!A(t)).sort()}function Dt(e,t={}){return(t.language?w(e).filter(n=>Se(n,t.language,t.markerFiles)):w(e)).map(n=>{let i=O(e,n);try{let o=be(i);return{path:n,size:o.byteLength,hash:pe("sha256").update(o).digest("hex")}}catch{return{path:n,size:-1,hash:"unreadable"}}})}function Se(e,t,r){let n=e.split("/").at(-1)??e;if(r?.includes(e)||r?.includes(n)||Re.has(n))return!0;let i=e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:"";return(xe[t]??[]).includes(i)}function he(e){try{return fe("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
|
|
61
|
+
`).filter(Boolean)}catch{return null}}function ye(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?O(e,n):e,o;try{o=me(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){A(a)||r.push(a);continue}t.push(a)}}return t}function A(e){return e.split("/").some(r=>ve.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var ve=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]),Re=new Set(["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lockb","tsconfig.json","tsconfig.base.json","pyproject.toml","setup.py","setup.cfg","Cargo.toml","Cargo.lock","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","build.sbt","compile_commands.json","CMakeLists.txt","Makefile","Gemfile","Gemfile.lock","composer.json","composer.lock","pubspec.yaml","pubspec.lock"]),xe={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"]};import{createRequire as Ve}from"module";import{existsSync as Ce,readFileSync as v}from"fs";import{dirname as N,extname as ke,join as _,relative as Te,resolve as At}from"path";import{pathToFileURL as Ee}from"url";function P(e,t){let{vueCore:r,ts:n,volarTs:i}=Le(e),{parsed:o,vueOptions:s}=De(r,n,t),a=N(t),u=r.createVueLanguagePlugin(n,o.options,s,d=>d),c=Ie(r,n,u),l=Fe(a,o),{languageServiceHost:p}=i.createLanguageServiceHost(n,n.sys,c,d=>d,l),g=n.createLanguageService(p);return{ts:n,language:c,languageService:g,fileNames:o.fileNames,configDir:a}}function Le(e){let t=Ve(Ee(_(e,"package.json")).href);return{vueCore:y(t,"@vue/language-core",e),ts:y(t,"typescript",e),volarTs:y(t,"@volar/typescript",e)}}function De(e,t,r){let n=t.readConfigFile(r,t.sys.readFile);if(n.error||!n.config)throw new Error(`Failed to read ${r}`);let o=e.createParsedCommandLine(t,t.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(o.globalTypesPath=e.createGlobalTypesWriter(o,t.sys.writeFile)),{parsed:t.parseJsonConfigFileContent(n.config,t.sys,N(r),void 0,r,void 0,e.getAllExtensions(o).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:t.ScriptKind.Deferred}))),vueOptions:o}}function Ie(e,t,r){let n={},i=e.createLanguage([r],new Map,o=>{if(!Ce(o))return;let s=v(o,"utf-8");n.current?.scripts.set(o,t.ScriptSnapshot.fromString(s),r.getLanguageId(o)??Ne(o))});return n.current=i,i}function Fe(e,t){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>t.options,getScriptFileNames:()=>t.fileNames,getProjectReferences:()=>t.projectReferences,getProjectVersion:()=>"0"}}function y(e,t,r){try{return e(t)}catch(n){throw(typeof n=="object"&&n!==null&&"code"in n?n.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${t} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:n}):n}}function j(e,t,r){let n=we(e);return i=>{let o=f(t,i.fileName),s=r.get(i.fileName);if(!s)return null;let a=r.positionAt(s,i.textSpan.start),u=n.get(o);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:Oe(u.starts,a.line,2)}}function we(e){let t=e.prepare(`
|
|
62
|
+
SELECT
|
|
63
|
+
d.relative_path AS relativePath,
|
|
64
|
+
der.start_line AS startLine,
|
|
65
|
+
der.end_line AS endLine,
|
|
66
|
+
der.symbol_id AS symbolId
|
|
67
|
+
FROM defn_enclosing_ranges der
|
|
68
|
+
JOIN documents d ON d.id = der.document_id
|
|
69
|
+
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
70
|
+
`).all(),r=new Map;for(let n of t){let i=r.get(n.relativePath);i||(i={containingByLine:new Map,starts:[]},r.set(n.relativePath,i)),i.starts.push({line:n.startLine,symbolId:n.symbolId});for(let o=n.startLine;o<=n.endLine;o++)i.containingByLine.set(o,n.symbolId)}for(let n of r.values())n.starts.sort((i,o)=>i.line-o.line);return r}function Oe(e,t,r){let n=0,i=e.length-1;for(;n<=i;){let s=Math.floor((n+i)/2);e[s].line<t?n=s+1:i=s-1}let o=null;for(let s of[i,n]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-t);u>r||(!o||u<o.distance)&&(o={distance:u,symbolId:a.symbolId})}return o?.symbolId??null}function M(e,t){let r=Pe(t),n=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),i=new Map;return{get(o){if(i.has(o))return i.get(o)??null;let s=je(n,r,t,o);return i.set(o,s),s}}}function G(e,t,r,n,i){if(e.fileName.endsWith(".vue")){let o=n.language.scripts.get(e.fileName),s=o?.generated?.languagePlugin.typescript?.getServiceScript(o.generated.root)?.code;if(o&&s){let a=n.language.maps.get(s,o);if(R(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(i)?r.get(e.fileName):null}return t(e)}function*U(e){let t=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),n;for(;n=t.exec(e);){let i=n[0];r.has(i)||(yield{text:i,start:n.index,end:n.index+i.length})}}function $(e,t){for(let[r]of e.toGeneratedLocation(t,n=>!!n.navigation))return r;return null}function R(e,t){let r=e;for(let[n]of r.toSourceLocation(t,i=>!!i.navigation))return n;return null}function Ae(e,t){let r=0,n=e.lineStarts.length-1;for(;r<=n;){let o=Math.floor((r+n)/2);e.lineStarts[o]<=t?r=o+1:n=o-1}let i=Math.max(0,n);return{line:i,character:t-e.lineStarts[i]}}function W(e,t){return f(e,t).startsWith("node_modules/")}function f(e,t){return Te(e,t).replaceAll("\\","/")}function Ne(e){switch(ke(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function H(){let e=new Map;return{get(t){if(e.has(t))return e.get(t)??null;try{let r=v(t,"utf-8"),n={text:r,lineStarts:_e(r)};return e.set(t,n),n}catch{return e.set(t,null),null}},positionAt:Ae}}function _e(e){let t=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&t.push(r+1);return t}function Pe(e){try{let t=JSON.parse(v(_(e,"package.json"),"utf-8"));return{name:t.name??"workspace",version:t.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function je(e,t,r,n){let i=f(r,n),o=Me(t.name,t.version,i);return e.get(o)?.id??null}function Me(e,t,r){let n=r.split("/").map(i=>`\`${i.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${t} ${n}/default.`}function qt(e){let t=Ue(e.projectRoot,e.tsconfig),r=new Ge(e.dbPath,{readonly:!0});try{let n=$e({db:r,projectRoot:e.projectRoot,configPath:t,vueSymbolLookup:M(r,e.projectRoot)});return We({vueFiles:e.vueFiles??[],tasks:e.tasks,...n})}finally{r.close()}}function $e(e){let t=H();return{projectRoot:e.projectRoot,context:P(e.projectRoot,e.configPath),symbolLookup:j(e.db,e.projectRoot,t),vueSymbolLookup:e.vueSymbolLookup,sourceReader:t}}function We(e){let t=[],r=0,n=e.tasks??e.vueFiles.map(i=>({fileName:i,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let i of n){let o=He(e,i);t.push(...o.occurrences),r+=o.skippedReferences}return{occurrences:t,skippedReferences:r}}function He(e,t){let r=e.context.language.scripts.get(t.fileName),n=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!n)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let i=e.sourceReader.get(t.fileName);if(!i)return{occurrences:[],skippedReferences:t.countFileSkip?1:0};let o=e.context.language.maps.get(n,r),s=f(e.projectRoot,t.fileName),a=[...U(i.text)],u={tokens:a.filter(c=>c.start>=t.startOffset&&c.start<t.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Be(a),processedStarts:new Set};return Ke({...e,fileName:t.fileName,sourceInfo:i,sourceFile:s,map:o,tokenContext:u})}function Ke(e){let t=[],r=0;for(let n of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(n.start))continue;let i=$(e.map,n.start);if(i===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,i+1)??[]).find(u=>!W(e.projectRoot,u.fileName));if(!s){r++;continue}let a=G(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}K(t,e.sourceReader,e.sourceInfo,e.sourceFile,n,a),e.tokenContext.processedStarts.add(n.start),Xe(t,e,n,i,a)}return{occurrences:t,skippedReferences:r}}function Xe(e,t,r,n,i){if(!((t.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let o of Je(t.context.languageService,t.fileName,n+1,t.map,r,t.tokenContext.tokenByStart)){if(t.tokenContext.processedStarts.has(o))continue;let s=t.tokenContext.tokenByStart.get(o);s&&(K(e,t.sourceReader,t.sourceInfo,t.sourceFile,s,i),t.tokenContext.processedStarts.add(o))}}function K(e,t,r,n,i,o){let s=t.positionAt(r,i.start);e.push({sourceFile:n,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+i.text.length,symbolId:o})}function Be(e){let t=new Map;for(let r of e)t.set(r.text,(t.get(r.text)??0)+1);return t}function Je(e,t,r,n,i,o){let s=e.getDocumentHighlights?.(t,r,[t])??[],a=[];for(let u of s)if(u.fileName===t)for(let c of u.highlightSpans){let l=ze(n,c.textSpan.start,o,i.text);l!==null&&a.push(l)}return a}function ze(e,t,r,n){let i=r.get(t);if(i?.text===n)return i.start;let o=R(e,t);if(o===null)return null;let s=r.get(o);return s?.text===n?s.start:null}export{Vt as a,Dt as b,qt as c};
|
|
71
|
+
//# sourceMappingURL=chunk-W2CBNBEL.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as _,b as m,c as h,d as D,e as f,g as S}from"./chunk-JM72FNGA.js";import{c as L}from"./chunk-
|
|
1
|
+
import{a as _,b as m,c as h,d as D,e as f,g as S}from"./chunk-JM72FNGA.js";import{c as L}from"./chunk-6TDOT7B3.js";import{a as x}from"./chunk-DS6QEB3G.js";import{a as y}from"./chunk-64MNV6AB.js";import{c as g}from"./chunk-7S5E7KWT.js";function K(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
|
|
2
2
|
FROM global_symbols gs
|
|
3
3
|
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
4
|
JOIN documents d ON der.document_id = d.id
|
|
@@ -59,4 +59,4 @@ import{a as _,b as m,c as h,d as D,e as f,g as S}from"./chunk-JM72FNGA.js";impor
|
|
|
59
59
|
${e.symbolNoiseFor("gs")}
|
|
60
60
|
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
61
61
|
ORDER BY start_line, end_line`,n)}function A(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,endLine:e.end_line,relativePath:e.relative_path,leaf:D(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:S(e.symbol),isTypeLike:f(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function ce(e,n={}){return Q(e,n.scope)}function Q(e,n){return y(e,{scope:n,includeIgnored:!1}).flatMap(t=>p(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function de(e,n,t={}){if(n.length===0)return[];let r=n.flatMap(i=>p(e,i)).filter(i=>!e.isIgnored(i.relativePath));return t.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),t.sort&&(r=r.sort((i,o)=>i.relativePath.localeCompare(o.relativePath)||i.startLine-o.startLine||i.endLine-o.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:h(i.symbol),signature:N(w(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function T(e){let n=new Map,t=e.map((r,i)=>({definition:r,index:i,span:r.endLine-r.startLine})).sort((r,i)=>r.span-i.span||r.index-i.index);for(let{definition:r}of t)for(let i=r.startLine;i<=r.endLine;i+=1)n.has(i)||n.set(i,r);return n}function me(e,n){let t=O.get(e);return t||(t=T(e),O.set(e,t)),t.get(n)??null}function ue(e,n){let t=p(e,n.relative_path).find(r=>r.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,endLine:t.endLine,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function P(e,n,t){let r=x(e,n),i=L(e,n);return i?j(t,i,r):r?B(t,r):t}function B(e,n){let t=n.split(/\r?\n/),r=J(e,t),i=H(e,r),o=W(i,t);return Y(e,o)}function J(e,n){let t=e.some(i=>b(i.symbol))?Z(n):null,r=new Map;for(let i of e)r.set(i.symbolId,G(n,t,i));return r}function H(e,n){return e.filter(t=>b(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,r)=>t.startLine-r.startLine||t.definition.startLine-r.definition.startLine||t.definition.symbol.localeCompare(r.definition.symbol))}function W(e,n){let t=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],o=e[r+1],s=o?Math.max(i.startLine,o.startLine-1):n.length-1;t.set(i.definition.symbolId,{startLine:i.startLine,endLine:U(n,i.definition,i.startLine,s)})}return t}function Y(e,n){return e.map(t=>{let r=n.get(t.symbolId);return r?{...t,startLine:r.startLine,endLine:r.endLine}:t})}function j(e,n,t=null){let r=new Map;for(let i of n){let o=r.get(i.name);o?o.push(i):r.set(i.name,[i])}return e.map(i=>{if(!z(i)||!i.leaf)return C(i,t);let o=r.get(i.leaf);if(!o||o.length===0)return C(i,t);let s=o[0],a=Math.abs(s.startLine-i.startLine);for(let c=1;c<o.length;c+=1){let l=o[c],d=Math.abs(l.startLine-i.startLine);d<a&&(s=l,a=d)}return{...i,startLine:s.startLine,endLine:s.endLine}})}function z(e){return b(e.symbol)?!0:f(e.symbol)==="term"&&m(e.symbol)===null}function C(e,n){if(!n||!e.leaf||f(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),o=n.split(/\r?\n/).findIndex(s=>r.test(s));return o>=0?{...e,startLine:o,endLine:o}:e}function G(e,n,t){if(!b(t.symbol))return t.startLine;let r=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return r;let i=n.get(t.leaf);if(!i||i.length===0)return r;let o=null;for(let s of i){let a=Math.abs(s-t.startLine);(!o||a<o.distance)&&(o={line:s,distance:a})}return o?.line??r}function Z(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,i=/\b([A-Za-z_$][\w$]*)\s*\(/g,o=new Map,s=(a,c)=>{let l=o.get(a);if(!l){o.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(n))d[1]&&s(d[1],a);for(let d of c.matchAll(t))d[1]&&s(d[1],a);let l=c.match(r);l?.[1]&&s(l[1],a);for(let d of c.matchAll(i))d[1]&&s(d[1],a)}return o}function U(e,n,t,r){let i=Math.max(t,Math.min(e.length-1,r)),o=Math.max(t,Math.min(i,n.endLine)),s=0,a=0,c=!1;for(let l=t;l<=i;l+=1){let d=X(e[l]??"");for(let u of d)u==="{"?(s+=1,c=!0):u==="}"?s=Math.max(0,s-1):u==="("?a+=1:u===")"&&(a=Math.max(0,a-1));if(c&&s===0||!c&&a===0&&l>=o)return l}return o}function X(e){let n="",t=null,r=!1;for(let i=0;i<e.length;i+=1){let o=e[i],s=e[i+1];if(!t&&o==="/"&&s==="/"){n+=" ".repeat(e.length-i);break}if(t){if(r){r=!1,n+=" ";continue}if(o==="\\"){r=!0,n+=" ";continue}o===t&&(t=null),n+=" ";continue}if(o==='"'||o==="'"||o==="`"){t=o,n+=" ";continue}n+=o}return n}function b(e){return e.includes("().")}function fe(e){let n=_(e);if("kind"in n)return[];let t=[];for(let r=n.descriptors.length-2;r>=0;r-=1){let i=n.descriptors[r];i?.suffix==="type"&&i.name&&t.push(i.name)}return t}export{K as a,V as b,N as c,w as d,E as e,p as f,ce as g,Q as h,de as i,T as j,me as k,ue as l,fe as m};
|
|
62
|
-
//# sourceMappingURL=chunk-
|
|
62
|
+
//# sourceMappingURL=chunk-X3BJUFSN.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as I,b as K,c as $}from"./chunk-VFLHKRTW.js";import{a as A}from"./chunk-PFOCOG57.js";import{a as R}from"./chunk-XPOZO76D.js";import{b as M,g as k}from"./chunk-ANIOISCE.js";import{a as b}from"./chunk-BGBBVSH4.js";import{e as S}from"./chunk-YNSVAJR6.js";import{e as F}from"./chunk-RSKOYTSY.js";import{a as P,c as w,d as p}from"./chunk-JM72FNGA.js";import{e as T}from"./chunk-6TDOT7B3.js";import{a as h}from"./chunk-DS6QEB3G.js";function de(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:o=!1,scanLimit:l}=e??{},d=e?.semantic!==!1,a=new R(t),m=a.scopedDefinitions(n),g=Q(a,n),v={high:0,medium:1,low:2};return A({candidates:()=>O(t,a,m,{minLoc:i,maxLoc:s}),orderCandidates:(u,c)=>b(c)-b(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:l,prepare:u=>{let c=z(u),f=W(t,a,u,c,{semantic:d}),y=u.filter(L=>{let x=C(t,L,f,c);return x.realConsumers.length<=1&&!x.transitivelyReachable&&B(L,x.realConsumers.length,g)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,y,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=C(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!B(f.definition,f.realConsumers.length,g))return null;let y=E(t,f);return!o&&y.confidence==="low"?null:y},orderResults:(u,c)=>v[u.confidence]-v[c.confidence]||c.loc-u.loc||u.file.localeCompare(c.file)||u.startLine-c.startLine,limit:r})}function O(t,e,n,i){return n.filter(s=>s.isTypeLike&&b(s)>=i.minLoc).filter(s=>b(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>M(s.relativePath)!=="test").filter(s=>!k(t,s.symbol,s.relativePath)).filter(s=>!X(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function U(t,e,n){return I(t,e,{semantic:n.semantic,sourceFallback:n.sourceFallback})}function W(t,e,n,i,s){let r=U(e,n,{semantic:!1,sourceFallback:!1}),o=n.filter(a=>{let m=C(t,a,r,i);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&D(a.relativePath))}),l=s.semantic&&o.length>0?S(r,F(t,o)):r,d=o.filter(a=>C(t,a,l,i).realConsumers.length<=1);return S(l,e.sourceFallbackCallerFiles(d))}function z(t){let e=new Map;for(let n of t){let i=e.get(n.relativePath);i||(i=new Map,e.set(n.relativePath,i));let s=p(n.symbol);s&&i.set(s,n)}return e}function C(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:o,barrelConsumers:l,importOnlyConsumers:d}=K(t,e,r),a=Y(t,e,n,i);return{definition:e,realConsumers:o,barrelConsumers:l+d,transitivelyReachable:a}}function E(t,e){let n=N(t,e.definition.relativePath,e.definition.startLine),i=D(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:s,reason:r}=ne(e.realConsumers.length,n,i),o=V(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:w(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:r,actionTier:o.actionTier,stalenessKind:o.stalenessKind,recommendation:o.recommendation}}function V(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,i,s){let r=_(t,Z(n),i),o=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=I(e,o,{semantic:s.semantic}),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,l)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let i=p(n.symbol);i&&e.set(j(n.relativePath,i),n)}return e}function _(t,e,n){let i=[];for(let s of n){let r=q(t,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function q(t,e,n){if(N(t,n.relativePath,n.startLine)!=="class")return null;let i=p(n.symbol);if(!i)return null;let s=J(t,n.relativePath,i);return s?e.get(j(n.relativePath,s))??null:null}function G(t,e,n){let i=p(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!$(t,r,i))}function j(t,e){return`${t}\0${e}`}function J(t,e,n){let i=h(t,e);if(!i)return null;let s=n.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 Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=P(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let i=n[n.length-1],s=n[n.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function D(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function B(t,e,n){return!(D(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,i){let s=T(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let o=s.get(r);if(!o||o.size===0)return!1;let l=i.get(e.relativePath);if(!l)return!1;for(let d of o){let a=l.get(d);if(!a)continue;let m=n.get(a.symbolId);if(m){for(let g of m)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function N(t,e,n){let i=h(t,e);if(!i)return"other";let s=i.split(`
|
|
2
|
+
`),r=Math.max(0,n-2),o=Math.min(s.length-1,n+2);for(let l=r;l<=o;l++){let a=(s[l]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function ee(t,e){let n=h(t,e.relativePath);if(!n)return!1;let i=p(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),o=n.split(`
|
|
3
|
+
`);for(let l=0;l<o.length;l++)if(!(l>=e.startLine&&l<=e.endLine)&&r.test(o[l]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{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"}}export{de as a};
|
|
4
|
+
//# sourceMappingURL=chunk-X3Z4MLVL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as g,f as E,g as q}from"./chunk-ANIOISCE.js";import{a as R}from"./chunk-BGBBVSH4.js";import{b as H,c as W,d as Y}from"./chunk-YNSVAJR6.js";import{c as O}from"./chunk-ZMU6IWDK.js";import{a as j,j as B,k as V,m as F,n as G}from"./chunk-AETMKBZR.js";import{a as k}from"./chunk-2YI45TNM.js";import{f as K,h}from"./chunk-X3BJUFSN.js";import{f as N,g as P,i as A,j as w}from"./chunk-JM72FNGA.js";import{a as M,f as S}from"./chunk-6TDOT7B3.js";import{a as y,b as L}from"./chunk-BTCASU5J.js";import{a as v,d as p}from"./chunk-DS6QEB3G.js";import{c as T}from"./chunk-A536TEU4.js";import{a as C}from"./chunk-64MNV6AB.js";function _(n,e,r){let a=e.identifierResolution==="strict"?F:G,o=e.candidateNames?B(e.candidateNames):null;for(let t of e.paths)if(!(!y(t)&&!(e.includeVueSfc&&L(t)))&&!n.isIgnored(t)&&!e.skipPath?.(t))try{if(o&&!V(v(n,t),o))continue;let f=(i,l,D,b)=>{if(e.candidateNames&&!e.candidateNames.has(i))return;let I=e.resolveTargets?e.resolveTargets({sourceFile:t,name:i,kind:l,defaultTargets:b}):b();for(let d of I)r({sourceFile:t,name:i,target:d,occurrences:D,kind:l})},m=j(n,t);for(let[i,l]of m)f(i,"identifier",l.length,()=>a(n,t,i));for(let i of S(n,t,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let l=i.kind==="cross-language-dispatch"?()=>F(n,t,i.name):()=>a(n,t,i.name);f(i.name,i.kind,i.occurrences,l)}}finally{e.afterPath?.(t)}}function z(n,e={}){let{scope:r,minLoc:a=1,maxLoc:o=Number.POSITIVE_INFINITY,excludeSymbol:t,excludeEntrySurfaces:u=!1,excludeTypesFiles:f=!1,excludeRootedSymbols:m=!1,requireFunctionLikeSymbol:i=!1,requireCallableSymbol:l=!1,excludeRustTraitImplMembers:D=!1,includeSuppressed:b=!1,sortByLocDesc:I=!1}=e,d=[];for(let s of h(n,r)){let c=s.relativePath;if(n.isIgnored(c)||u&&E(n,c)||!Q(s,{requireFunctionLikeSymbol:i,requireCallableSymbol:l})||t!==void 0&&s.symbol===t)continue;let x=R(s);x<a||x>o||f&&U(c)||m&&q(n,s.symbol,c)||D&&A(s.symbol)||g(c)!=="test"&&(w(s.symbol)||!b&&p(n,c,s.startLine)||d.push(s))}return I?d.sort((s,c)=>R(c)-R(s)):d}function Q(n,e){return e.requireCallableSymbol?N(n.symbol):e.requireFunctionLikeSymbol?P(n.symbol):n.isFunctionLike}function U(n){return(n.split("/").pop()??"").includes("types")}var J=class{constructor(e){this.db=e}db;scopedDefinitions(e){return h(this.db,e)}definitionsForFile(e){return K(this.db,e)}productionCallableDefinitions(e={}){return z(this.db,e)}calleeMap(e,r={}){return O(this.db,e,r)}crossFileCallerMap(e,r={}){return H(this.db,e,r)}sourceFallbackCallerFiles(e){return W(this.db,e)}callerFileMap(e,r={}){return Y(this.db,e,r)}frameworkReferencedSymbolIds(e){let r=new Map;for(let o of e){if(!o.leaf)continue;let t=r.get(o.leaf)??[];t.push(o.symbolId),r.set(o.leaf,t)}let a=new Set;for(let o of C(this.db,{includeIgnored:!1}))if(y(o)==="rust")for(let{name:t}of S(this.db,o,{includeRustAttributeNames:!0}))for(let u of r.get(t)??[])a.add(u);return a}symbolsWithNonSelfCallees(e,r={}){if(e.length===0)return new Set;let a=new Map(e.map(t=>[t.symbolId,t.symbol])),o=this.calleeMap(e,r);return new Set([...o.entries()].filter(([t,u])=>{let f=a.get(t);return u.some(m=>m.symbol!==f)}).map(([t])=>t))}fileDependencyGraph(e){return k(this.db,e)}fileKind(e){return g(e)}hasSuppressionComment(e){return p(this.db,e.relativePath,e.startLine)}sourceFiles(){return T(this.db)}scanSourceReferences(e,r){_(this.db,e,r)}callableSignature(e){let r=M(this.db,e.relativePath)?.callables.find(a=>a.startLine===e.startLine&&a.endLine===e.endLine);return r?{paramCount:r.paramCount}:null}};export{J as a};
|
|
2
|
+
//# sourceMappingURL=chunk-XPOZO76D.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as s,d as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as s,d as l}from"./chunk-BZ53S4ZN.js";import{a as u}from"./chunk-PVZMPG5I.js";import{a as p,b as m,c as f}from"./chunk-YWOOQ4FF.js";import{e as c}from"./chunk-BTCASU5J.js";function A(i,t={}){let{minSimilarity:r=.62,minTokens:e=8,limit:a=20,scope:d,scanLimit:g,filePattern:h}=t,k=c(i,{scope:d,minJsxTokens:e,scanLimit:g}).filter(n=>n.kind==="component").map(n=>({file:n.file,component:n.name,tokens:n.jsxTokens,profile:n}));return u({profiles:k,limit:a,filePattern:h,compare:(n,o)=>P(n,o,r),sort:(n,o)=>o.similarity-n.similarity||n.fileA.localeCompare(o.fileA)||n.componentA.localeCompare(o.componentA)||n.fileB.localeCompare(o.fileB)||n.componentB.localeCompare(o.componentB)})}function P(i,t,r){let e=p(i.tokens,t.tokens);if(e.size<6||!B(e))return null;let a=f(i.tokens,t.tokens);return a<r?null:{fileA:i.file,componentA:i.component,fileB:t.file,componentB:t.component,similarity:a,sharedTokens:l(e),sharedComponents:s(e,"component:"),sharedNativeTags:s(e,"native:"),sharedProps:s(e,"prop:"),sharedEvents:s(e,"event:"),sharedBindings:s(e,"binding:"),uniqueToA:l(m(i.tokens,t.tokens)).slice(0,25),uniqueToB:l(m(t.tokens,i.tokens)).slice(0,25),locA:i.profile.loc,locB:t.profile.loc}}function B(i){let t=0,r=0;for(let e of i)e.startsWith("component:")&&(t+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("native:")||e.startsWith("jsx:"))&&(r+=1);return t>=1||r>=4}export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-XWC67C3Q.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as h}from"./chunk-ZMU6IWDK.js";import{e as y,g as S,h as g,i as M,o as C}from"./chunk-AETMKBZR.js";import{e as R}from"./chunk-RSKOYTSY.js";import{g as b}from"./chunk-X3BJUFSN.js";import{d as m,f as p}from"./chunk-6TDOT7B3.js";import{a as f}from"./chunk-BTCASU5J.js";import{a as u}from"./chunk-64MNV6AB.js";function D(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let i=u(e,{includeIgnored:!1}),a=M(e),r=n??b(e),l=new Set(r.map(s=>s.symbolId));return k(e,o,i,a,l),I(e,o,r,l),x(e,o,i,a,l),t.semantic!==!1&&_(o,R(e,A(r))),o}function k(e,n,t,o,i){for(let a of t){if(!f(a))continue;let r=m(e,a);if(r)for(let l of r){let s=S(a,o.get(l.calleeLeaf)??[]);if(!s||s.length===0)continue;let c=g(e,a,s,l.memberAccess);c&&i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function I(e,n,t,o){let i=v(t);for(let a of L(e,o))e.isIgnored(a.relative_path)||w(a,i.get(a.symbol_id))||d(n,a.symbol_id,a.relative_path)}function L(e,n){return y(e,n?[...n]:void 0)}function v(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function w(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function x(e,n,t,o,i){for(let a of t){if(f(a)!=="rust")continue;let r=p(e,a,{includeRustAttributeNames:!0});if(r.length!==0)for(let{name:l}of r){let s=o.get(l);if(s)for(let c of s)i.has(c.symbolId)&&c.file!==a&&d(n,c.symbolId,a)}}}function d(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function A(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function _(e,n){for(let[t,o]of n){let i=e.get(t);i||(i=new Set,e.set(t,i));for(let a of o)i.add(a)}}function O(e,n,t={}){return h(e,n,t)}function F(e,n,t={}){return D(e,n,t)}function j(e,n){return C(e,n)}function Q(e,n,t={}){let o=F(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:V(o,j(e,n))}function V(e,n){let t=new Map;for(let[o,i]of e)t.set(o,new Set(i));for(let[o,i]of n){let a=t.get(o)??new Set;for(let r of i)a.add(r);t.set(o,a)}return t}export{O as a,F as b,j as c,Q as d,V as e};
|
|
2
|
+
//# sourceMappingURL=chunk-YNSVAJR6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function g(r,t){let e=new Set;for(let n of r)t.has(n)&&e.add(n);return e}function l(r,t){let e=new Set;for(let n of r)t.has(n)||e.add(n);return e}function S(r,t){if(r.size===0&&t.size===0)return 0;let e=0;for(let i of r)t.has(i)&&(e+=1);let n=r.size+t.size-e;return n===0?0:e/n}function p(r,t){if(r.size===0)return 0;let e=0;for(let n of r)t.has(n)&&(e+=1);return e/r.size}function M(r,t){if(t<=0)return new Map;let e=new Map;for(let[n,i]of r)i>0&&e.set(n,Math.log(t/i));return e}function m(r){let t=[...r.values()].sort((n,i)=>n-i);if(t.length===0)return 0;let e=Math.floor(t.length/2);return t.length%2===0?(t[e-1]+t[e])/2:t[e]}function b(r,t){let e=0;for(let n of r){let i=t.get(n)??0;e+=i*i}return Math.sqrt(e)}function w(r,t,e,n={}){let i=0,T=0,u=0,d=n.medianIdf??m(e),f=[],h=[];for(let s of r){let o=e.get(s)??0;T+=o*o,t.has(s)&&(i+=o*o,o>=d?f.push(s):h.push(s))}if(f.length===0&&h.length===0)return{similarity:0,significantShared:[],trivialShared:[]};for(let s of t){let o=e.get(s)??0;u+=o*o}let a=Math.sqrt(T)*Math.sqrt(u),c=a>0?i/a:0;return f.sort((s,o)=>(e.get(o)??0)-(e.get(s)??0)),{similarity:c,significantShared:f,trivialShared:h}}function y(r,t,e,n){let i=0,T=n.medianIdf??m(e),u=[],d=[];for(let a of r){if(!t.has(a))continue;let c=e.get(a)??0;i+=c*c,c>=T?u.push(a):d.push(a)}if(u.length===0&&d.length===0)return{similarity:0,significantShared:[],trivialShared:[]};let f=n.magnitudeA*n.magnitudeB,h=f>0?i/f:0;return u.sort((a,c)=>(e.get(c)??0)-(e.get(a)??0)),{similarity:h,significantShared:u,trivialShared:d}}export{g as a,l as b,S as c,p as d,M as e,m as f,b as g,w as h,y as i};
|
|
2
|
+
//# sourceMappingURL=chunk-YWOOQ4FF.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as v,e as F,f as L,h as g,i as V}from"./chunk-DS6QEB3G.js";import{c as N}from"./chunk-A536TEU4.js";import{e as b}from"./chunk-7S5E7KWT.js";import{ElementTypes as M,NodeTypes as A,parse as Z}from"@vue/compiler-dom";import{parse as Ee}from"@vue/compiler-sfc";function P(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var W=b("vue-template-facts"),H=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),G=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),Y=new Set(["div","span","template"]),K=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function w(e,t){let n=t.replace(/\\/g,"/"),r=v(e,n);return W.get(e,n,r,()=>J(n,L(e,n).template))}function J(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=Z(t.body,{comments:!1})}catch{return n}let i=new Set,o=s=>{s.trim()&&i.add(s)};return B(r.children,t.startLine,n,o),n.structuralTokens=[...i].sort(),n}function B(e,t,n,r){for(let i of e)i.type===A.ELEMENT&&(Q(i,t,n,r),B(i.children,t,n,r))}function Q(e,t,n,r){let i=se(e.tag),o={tag:e.tag,normalized:i,kind:oe(e),startLine:h(t,e.loc.start.line),endLine:h(t,e.loc.end.line)};o.kind==="component"?(n.componentTags.push(o),r(`component:${i}`)):o.kind==="builtin"?(n.builtinTags.push(o),r(`builtin:${i}`)):(n.nativeTags.push(o),Y.has(e.tag)||r(`native:${e.tag}`));for(let s of e.props)X(s,t,n,r)}function X(e,t,n,r){if(e.type===A.ATTRIBUTE){let a=e.value?.content??null,u=_("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(u),r(`prop:${e.name}`);return}let i=te(e),o=E(e.exp),s=_(ee(e.name),i,o,t,e.loc.start.line,e.loc.end.line);switch(s.kind){case"prop":n.props.push(s),r(`prop:${i}`);break;case"event":n.events.push(s),r(`event:${i}`);break;case"slot":n.slots.push(s),r(`slot:${i}`);break;case"directive":n.directives.push(s),r(`directive:${i}`);break}o&&ne(o,t,e.loc.start.line,n,r)}function _(e,t,n,r,i,o){return{kind:e,name:t,value:n,startLine:h(r,i),endLine:h(r,o)}}function ee(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function te(e){let t=E(e.arg);return t||e.name}function E(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function ne(e,t,n,r,i){for(let o of re(e)){let s={name:o,startLine:h(t,n),endLine:h(t,n)};r.expressionIdentifiers.push(s),i(`id:${o}`)}}function re(e){let t=new Set,n=ie(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,i;for(;i=r.exec(n);){let o=i[0];K.has(o)||/^[A-Z_]+$/.test(o)||t.add(o)}return[...t].sort()}function ie(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function oe(e){let t=e.tag;return e.tagType===M.COMPONENT?"component":H.has(t)?"builtin":G.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function se(e){return P(e,/[-_:]/)}function h(e,t){return e+Math.max(0,t-1)}function S(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var ae=new Set(["function_declaration","method_definition","method_signature","function_signature"]);function z(e,t){let n=ue(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:I(n.functionNode),params:$(n.functionNode),paramsEndLine:k(n.functionNode),isLiteralPassthrough:R(n.functionNode,t)};if(!ce(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(i=>i.type==="identifier"||i.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:I(e),params:$(e),paramsEndLine:k(e),isLiteralPassthrough:R(e,t)}:null}function U(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function $(e){let t=U(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(S(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let i=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),o=r.childForFieldName("pattern");if(!i&&o&&o.type==="identifier"){n.push({name:o.text,simple:!0});continue}let s=r.namedChildren.find(a=>a.type==="identifier");n.push({name:o?.type==="identifier"?o.text:s?.text??"",simple:!1})}return n}function k(e){let t=U(e);return t?t.endPosition.row:e.startPosition.row}function ce(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?ae.has(e):!1}function ue(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);return!n||!r||r.type!=="arrow_function"&&r.type!=="function_expression"?null:{name:n.text,definitionNode:e,functionNode:r}}return null}function I(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)S(r)||(n+=1);return n}function R(e,t){let n=e.namedChildren.find(c=>c.type==="block"||c.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(c=>!S(c));if(r.length!==1)return!1;let i=r[0],o=null;if(i.type==="return_statement"||i.type==="expression_statement"?o=i.namedChild(0)??null:t==="rust"&&(i.type==="call_expression"||i.type==="macro_invocation")&&(o=i),!o)return!1;let s=t==="python"?"call":"call_expression";if(o.type!==s)return!1;let a=o.namedChildren.find(c=>c.type==="arguments"||c.type==="argument_list");if(!a)return!1;let u=a.namedChildren.filter(c=>!S(c)),l=e.namedChildren.find(c=>c.type==="parameters"||c.type==="formal_parameters");if(!l)return!1;let m=[];for(let c of l.namedChildren){if(c.type==="identifier"){m.push(c.text);continue}let f=c.namedChildren.find(T=>T.type==="identifier");f&&m.push(f.text)}if(u.length!==m.length)return!1;for(let c=0;c<m.length;c+=1){let f=u[c];if(f.type!=="identifier"||f.text!==m[c])return!1}return!0}var le=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),pe=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),me=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),fe=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),de=new Set(["catch","for","function","if","return","switch","while"]);function D(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=g(n),n.external&&(t.externalLineCount+=g(n),t.externalScriptPaths.push(n.sourcePath));for(let i of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:i});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...Se(n));let r=F(n.astLanguage,n.body);r?he(n,r.rootNode,t):ye(n,t)}return ge(t),t.externalScriptPaths=j(t.externalScriptPaths),t}function ge(e){e.composables=y(e,"composable"),e.stores=y(e,"store"),e.reactivity=y(e,"reactivity"),e.lifecycle=y(e,"lifecycle"),e.requests=y(e,"request"),e.macros=y(e,"macro")}function y(e,t){return j(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function he(e,t,n){let r=new Set,i=new Set,o=s=>{let a=z(s,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;i.has(l)||(i.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let u=V(s,e.astLanguage);if(u){let l=`${u.calleeLeaf}:${u.line}`;r.has(l)||(r.add(l),n.calls.push({name:u.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+u.line,categories:O(u.calleeLeaf),setup:e.setup}))}for(let l of s.children)o(l)};o(t)}function ye(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||de.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+x(e.body,n.index??0),categories:O(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let i=e.startLine+x(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let i=e.startLine+x(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:i,endLine:i,setup:e.setup})}}function Se(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),i=n[2];if(!r||!i)continue;let o=e.startLine+x(e.body,n.index??0);for(let s of be(r))t.push({local:s,source:i,sourcePath:e.sourcePath,line:o,setup:e.setup})}return t}function be(e){let t=[],r=e.split(",").map(s=>s.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let i=/\{([^}]*)\}/.exec(e)?.[1];if(i)for(let s of i.split(",")){let a=s.trim();if(!a)continue;let u=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(u??a.replace(/^type\s+/,"").trim())}let o=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return o&&t.push(o),t.filter(s=>/^[A-Za-z_$][\w$]*$/.test(s))}function O(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),le.has(e)&&t.push("reactivity"),pe.has(e)&&t.push("lifecycle"),me.has(e)&&t.push("request"),fe.has(e)&&t.push("macro"),t}function x(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function j(e){return[...new Set(e)].sort()}var ve=new Set(["in","key","of"]),Le=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),xe=b("vue-component-behavior-profiles");function Xe(e,t={}){let n=N(e,{extensions:[".vue"]}).filter(i=>!t.scope||i.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(i=>Te(e,i)).filter(i=>(t.minTemplateTokens===void 0||i.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||i.behaviorTokens.size>=t.minBehaviorTokens))}function Te(e,t){let n=t.replace(/\\/g,"/"),r=v(e,n),i=xe.get(e,n,r,()=>Ce(e,n,r));return Fe(i)}function Ce(e,t,n){let r=L(e,t),i=w(e,t),o=D(r),s=Pe(i),a=i.expressionIdentifiers.map(p=>p.name).filter(p=>!s.includes(p)).filter((p,d,C)=>C.indexOf(p)===d).sort(),u=i.componentTags.map(p=>p.normalized).filter((p,d,C)=>C.indexOf(p)===d).sort(),l=n?n.split(`
|
|
2
|
+
`).length:0,m=g(r.template),c=o.lineCount,f=r.styles.reduce((p,d)=>p+g(d),0),T=r.customBlocks.reduce((p,d)=>p+g(d),0);return{file:t,sfc:r,templateFacts:i,scriptFacts:o,templateTokens:new Set(i.structuralTokens),behaviorTokens:Ne(i,o,a),templateBindingNames:a,templateLocalNames:s,componentNames:u,sfcLines:l,totalLines:l+o.externalLineCount,templateLines:m,scriptLines:c,styleLines:f,externalScriptLines:o.externalLineCount,externalScriptPaths:o.externalScriptPaths,customBlockLines:T}}function Fe(e){let t=Ve(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths}}function Ve(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function Ne(e,t,n){let r=new Set;for(let i of t.composables)r.add(`composable:${i}`);for(let i of t.stores)r.add(`store:${i}`);for(let i of t.reactivity)r.add(`reactivity:${i}`);for(let i of t.lifecycle)r.add(`lifecycle:${i}`);for(let i of t.requests)r.add(`request:${i}`);for(let i of t.macros)r.add(`macro:${i}`);for(let i of t.functions){if(Le.has(i.name))continue;r.add(`function:${i.name}`);let o=/^[a-z]+/.exec(i.name)?.[0]??null;o&&o.length>2&&o!==i.name&&r.add(`function-verb:${o}`)}for(let i of e.events)r.add(`template-event:${i.name}`);for(let i of n)r.add(`template-binding:${i}`);return r}function Pe(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of _e(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of q(n.value))t.add(r);return[...t].sort()}function _e(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?q(t[1]??""):[]}function q(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];ve.has(r)||t.push(r)}return t}export{z as a,P as b,Xe as c};
|
|
3
|
+
//# sourceMappingURL=chunk-YZA6PPZL.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-2YI45TNM.js";function K(i,l={}){let{limit:d=10,scope:h,minDepth:x=3}=l,f=k(i,h),w=new Map,o=[],p=new Map,a=new Map,m=new Set,b=[],g=0;for(let e of f.keys()){if(p.has(e))continue;let t=[],s=(f.get(e)??new Set).values();for(p.set(e,g),a.set(e,g),g+=1,b.push(e),m.add(e),t.push({node:e,iter:s,pendingChild:null});t.length>0;){let n=t[t.length-1];if(n.pendingChild!==null){let u=n.pendingChild;n.pendingChild=null,a.set(n.node,Math.min(a.get(n.node),a.get(u)))}let c=n.iter.next();if(c.done){if(a.get(n.node)===p.get(n.node)){let u=[];for(;;){let S=b.pop();if(m.delete(S),u.push(S),w.set(S,o.length),S===n.node)break}o.push(u)}t.pop();continue}let r=c.value;if(p.has(r))m.has(r)&&a.set(n.node,Math.min(a.get(n.node),p.get(r)));else{p.set(r,g),a.set(r,g),g+=1,b.push(r),m.add(r);let u=(f.get(r)??new Set).values();n.pendingChild=r,t.push({node:r,iter:u,pendingChild:null})}}}let C=new Map,D=new Array(o.length);for(let e=0;e<o.length;e++)D[e]=o[e].length,C.set(e,new Set);for(let[e,t]of f){let s=w.get(e);for(let n of t){let c=w.get(n);c!==s&&C.get(s).add(c)}}let y=new Array(o.length),R=new Array(o.length);for(let e=0;e<o.length;e++){let t=[],s=0;for(let n of C.get(e)){let c=R[n];c>s&&(s=c,t=y[n])}y[e]=[e,...t],R[e]=D[e]+s}function M(e){return y[e]}let T=o.map(e=>[...e].sort()),v=new Set,I=[];for(let e=0;e<o.length;e++){let t=M(e),s=[];for(let c of t)s.push(...T[c]);if(s.length<x)continue;let n=s.join(" ");v.has(n)||(v.add(n),I.push(A(s)))}return I.sort((e,t)=>t.depth-e.depth),F(I).slice(0,d)}function A(i){return{chain:i,depth:i.length,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${i.length} file(s) form the representative transitive dependency path`,"cycles are condensed before longest-path calculation"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(i){let l=[];for(let d of i)l.some(h=>L(d.chain,h.chain))||l.push(d);return l}function L(i,l){if(i.length>=l.length)return!1;let d=l.length-i.length;for(let h=0;h<i.length;h++)if(i[h]!==l[d+h])return!1;return!0}export{K as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ZDR4VTOP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-2YI45TNM.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-ZL52RLDK.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as j,g as G,h as J,i as B,
|
|
1
|
+
import{b as j,g as G,h as J,i as B,p as Q}from"./chunk-AETMKBZR.js";import{a as W,b as U,d as K,f as q}from"./chunk-RSKOYTSY.js";import{a as O}from"./chunk-2YI45TNM.js";import{f as P,g as F,j as H,k as $}from"./chunk-X3BJUFSN.js";import{d as T,f as x}from"./chunk-JM72FNGA.js";import{d as E}from"./chunk-6TDOT7B3.js";import{a as N}from"./chunk-BTCASU5J.js";import{a as M}from"./chunk-DS6QEB3G.js";import{a as A,b as I,f as v,h as k}from"./chunk-C6ROZBJA.js";import{c as L,d as D}from"./chunk-7S5E7KWT.js";function Le(e,n,l={}){let o=Y(e,[n],{additive:l.additive,semantic:l.semantic}),s=l.callableOnly?(o.get(n.symbolId)??[]).filter(c=>x(c.symbol)):o.get(n.symbolId)??[];return typeof l.limit=="number"?s.slice(0,l.limit):s}function De(e,n,l={}){let o=ne(e)?oe(e,n,{semantic:l.semantic!==!1}):te(e).get(n.symbolId)??[];return typeof l.limit=="number"?o.slice(0,l.limit):o}var X=D("caller-rows",{clearGroups:["whole-project"]}),ee=2e4;function ne(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>ee}function te(e){return X.get(e,()=>{let n=F(e),l=Y(e,n),o=new Map;for(let i of n)o.set(i.symbol,i.symbolId);let s=new Map,c=new Map;for(let i of n){let a=l.get(i.symbolId);if(!(!a||a.length===0))for(let d of a){let r=o.get(d.symbol);if(r===void 0||r===i.symbolId)continue;let m=s.get(r);m||(m=[],s.set(r,m),c.set(r,new Set));let u=`${i.symbol}|${i.relativePath}`;c.get(r).has(u)||(c.get(r).add(u),m.push({symbol:i.symbol,file:i.relativePath,source:"caller-map-inversion"}))}}return s})}function oe(e,n,l){let o=[],s=new Set,c=a=>{if(a.symbol===n.symbol)return;let d=`${a.symbol}|${a.file}`;s.has(d)||(s.add(d),o.push(a))};for(let a of Q(e,n))a.file!==n.relativePath&&c({symbol:a.enclosingSymbol??a.file,file:a.file,source:"resolved-reference"});let i=l.semantic?ie(e,n):null;if(i)for(let a of K(e,i)){if(a.file===n.relativePath||e.isIgnored(a.file))continue;let d=$(P(e,a.file),a.line);c({symbol:d?.symbol??a.file,file:a.file,source:"semantic-reference"})}return o}function ie(e,n){return e.get(`SELECT
|
|
2
2
|
d.id AS documentId,
|
|
3
3
|
gs.id AS symbolId,
|
|
4
4
|
gs.symbol,
|
|
@@ -17,7 +17,7 @@ import{b as j,g as G,h as J,i as B,n as Q}from"./chunk-HVTYSC26.js";import{a as
|
|
|
17
17
|
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
18
18
|
JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
|
|
19
19
|
WHERE gs.id = ?
|
|
20
|
-
LIMIT 1`,n.symbolId)??null}function Y(e,n,l={}){if(n.length===0)return new Map;let o=l.additive??!1,s=[],c=[];for(let m of n)
|
|
20
|
+
LIMIT 1`,n.symbolId)??null}function Y(e,n,l={}){if(n.length===0)return new Map;let o=l.additive??!1,s=[],c=[];for(let m of n)N(m.relativePath)&&E(e,m.relativePath)!==null?s.push(m):c.push(m);let i=new Map,a=new Map,d=m=>{for(let[u,t]of m){let b=i.get(u);b||(b=[],i.set(u,b));let p=a.get(u);p||(p=new Set,a.set(u,p));for(let g of t){let h=`${g.symbol}|${g.chunkId}`;p.has(h)||(p.add(h),b.push(g))}}};s.length>0&&d(re(e,s)),l.semantic!==!1&&d(fe(le(e,n)));let r=o?n:c;return r.length>0&&d(ue(e,r)),i}function le(e,n){let l=new Map,o=[],s=[];for(let i of n){if(!W(i.relativePath))continue;let a=M(e,i.relativePath);if(!a){s.push(i);continue}let d=I(e,i.relativePath,a),r=ce(e,i.relativePath),m=v(e,i.relativePath,i.symbol,d,r);if(m!==null){let u=se(m);if(u){u.length>0&&l.set(i.symbolId,u);continue}}o.push({def:i,contentHash:d,depsDigest:r})}if(o.length===0&&s.length===0)return l;let c=q(e,[...s,...o.map(i=>i.def)]);for(let[i,a]of c)l.set(i,a);return U(e).availability().available&&k(e,o.map(i=>({relativePath:i.def.relativePath,symbol:i.def.symbol,contentHash:i.contentHash,depsDigest:i.depsDigest,payload:JSON.stringify(c.get(i.def.symbolId)??[])}))),l}function se(e){try{return JSON.parse(e)}catch{return null}}var ae=L("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function ce(e,n){return ae.get(e,n,()=>{let o=[...O(e).get(n)??[]].sort().map(s=>`${s}:${I(e,s,M(e,s))}`);return A(o.join("|"))})}function re(e,n){let l=new Map,o=me(n,l),s=B(e);for(let[c,i]of o){let a=E(e,c);if(!a)continue;let d=H(i);for(let r of a){let m=d.get(r.line);if(!m)continue;let u=de(e,c,s,r.calleeLeaf,r.memberAccess);u&&u.symbol!==m.symbol&&l.get(m.symbolId).push({symbol:u.symbol,file:u.file,chunkId:r.line,source:"ast-callsite"})}}return l}function me(e,n){let l=new Map;for(let o of e){let s=l.get(o.relativePath);s?s.push(o):l.set(o.relativePath,[o]),n.set(o.symbolId,[])}for(let o of l.values())o.sort((s,c)=>s.endLine-s.startLine-(c.endLine-c.startLine));return l}function de(e,n,l,o,s){let c=G(n,l.get(o)??[]);return c.length===0?null:J(e,n,c,s)}function ue(e,n){if(n.length===0)return new Map;let o=R(n.map(t=>t.documentId)).flatMap(t=>e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
|
|
21
21
|
FROM mentions m
|
|
22
22
|
JOIN chunks c ON m.chunk_id = c.id
|
|
23
23
|
WHERE m.role != 1
|
|
@@ -35,4 +35,4 @@ import{b as j,g as G,h as J,i as B,n as Q}from"./chunk-HVTYSC26.js";import{a as
|
|
|
35
35
|
) def_chunk ON def_chunk.symbol_id = gs.id
|
|
36
36
|
WHERE gs.id IN (${t.map(()=>"?").join(",")})`,...t,...t)),a=R([...n.map(t=>t.documentId),...i.flatMap(t=>t.document_id===null?[]:[t.document_id])]),d=new Map(a.flatMap(t=>e.all(`SELECT id, relative_path FROM documents
|
|
37
37
|
WHERE id IN (${t.map(()=>"?").join(",")})`,...t).map(b=>[b.id,b.relative_path]))),r=new Map;for(let t of i)r.has(t.symbol_id)||r.set(t.symbol_id,{symbol:t.symbol,file:t.document_id!==null?d.get(t.document_id)??"":""});let m=new Map,u=d;for(let t of n){let b=s.get(t.documentId)??[],p=new Set,g=[],h=null,Z=()=>{if(h)return h;let f=u.get(t.documentId)??"",y=new Set;if(f){let _=j(e,f),C=Math.max(0,t.startLine),w=Math.min(_.length-1,t.endLine);for(let S=C;S<=w;S+=1)for(let z of _[S])y.add(z)}return h=y,y};for(let f of b){if(f.symbol_id===t.symbolId)continue;let y=r.get(f.symbol_id);if(!y)continue;if(!(f.start_line>=t.startLine&&f.end_line<=t.endLine)){if(!(f.start_line<=t.endLine&&f.end_line>=t.startLine))continue;let S=T(y.symbol);if(!S||!Z().has(S))continue}let C=`${y.symbol}|${f.chunk_id}`;p.has(C)||(p.add(C),g.push({...y,chunkId:f.chunk_id,source:"scip-chunk"}))}m.set(t.symbolId,g)}return m}var V=500;function R(e){let n=[...new Set(e)],l=[];for(let o=0;o<n.length;o+=V)l.push(n.slice(o,o+V));return l}function fe(e){let n=new Map;for(let[l,o]of e){let s=[];for(let c of o)s.push({symbol:c.symbol,file:c.file,chunkId:-1,source:"semantic-callee"});n.set(l,s)}return n}export{Le as a,De as b,Y as c};
|
|
38
|
-
//# sourceMappingURL=chunk-
|
|
38
|
+
//# sourceMappingURL=chunk-ZMU6IWDK.js.map
|