scip-query 0.20.0 → 0.21.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/CHANGELOG.md +69 -0
- package/README.md +255 -884
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-CI3O6PQG.js +2 -0
- package/dist/call-graph-6QTUTXH7.js +2 -0
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +11 -0
- package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
- package/dist/chunk-26CT72HM.js +2 -0
- package/dist/{chunk-7PIO7NKH.js → chunk-2COFMIVK.js} +2 -2
- package/dist/chunk-2H4IAJHO.js +2 -0
- package/dist/chunk-2I3RSUWX.js +16 -0
- package/dist/chunk-2RP27XLR.js +2 -0
- package/dist/chunk-2ZBMOQGG.js +3 -0
- package/dist/{chunk-HX4GQPZP.js → chunk-32A42O5B.js} +3 -3
- package/dist/chunk-35ELD3RM.js +2 -0
- package/dist/chunk-35IW3P4H.js +2 -0
- package/dist/{chunk-DQGFVPUV.js → chunk-3653GTR7.js} +3 -3
- package/dist/chunk-3EX7DNBC.js +2 -0
- package/dist/chunk-3FQ3KMCD.js +2 -0
- package/dist/{chunk-5E4WNAVD.js → chunk-3PII3JI5.js} +2 -2
- package/dist/chunk-3TNRNKAT.js +2 -0
- package/dist/chunk-3VLJ2DCA.js +2 -0
- package/dist/{chunk-XSRF6Q77.js → chunk-46JLFIGA.js} +2 -2
- package/dist/chunk-4DCKBY6T.js +5 -0
- package/dist/chunk-4EXFZP6H.js +2 -0
- package/dist/chunk-4IIMPWMR.js +29 -0
- package/dist/chunk-4ILHWBYF.js +2 -0
- package/dist/chunk-4N6QSEMZ.js +10 -0
- package/dist/chunk-4OE2JO6I.js +2 -0
- package/dist/{chunk-7BAVHKMJ.js → chunk-4S4DF62J.js} +9 -9
- package/dist/chunk-4UUCUASK.js +554 -0
- package/dist/chunk-5236NQV3.js +2 -0
- package/dist/chunk-54EOGFBR.js +2 -0
- package/dist/{chunk-LY4WC4AD.js → chunk-5H7IWVXJ.js} +2 -2
- package/dist/chunk-5IZTXSOL.js +117 -0
- package/dist/{chunk-AZJQQKDD.js → chunk-5SE323LF.js} +2 -2
- package/dist/chunk-5ZJH6DDE.js +2 -0
- package/dist/chunk-63MBA7EG.js +3 -0
- package/dist/chunk-6BJ7SOY7.js +2 -0
- package/dist/chunk-6GJAP4OE.js +2 -0
- package/dist/chunk-6IEVHGWG.js +26 -0
- package/dist/chunk-6SWA6B24.js +7 -0
- package/dist/chunk-6T7H2AFY.js +3 -0
- package/dist/chunk-73Z33VFI.js +4 -0
- package/dist/chunk-7COHFNJK.js +38 -0
- package/dist/chunk-7HU2IJ2T.js +3 -0
- package/dist/chunk-7IOAZRVL.js +60 -0
- package/dist/chunk-7KCZELVM.js +2 -0
- package/dist/chunk-7PPYXENX.js +2 -0
- package/dist/chunk-7TWP3MCP.js +2 -0
- package/dist/chunk-AA7K3XLM.js +21 -0
- package/dist/chunk-AJVMVE7X.js +7 -0
- package/dist/chunk-ANWGXPPN.js +4 -0
- package/dist/chunk-APLKXICZ.js +3 -0
- package/dist/{chunk-JDOEX4E6.js → chunk-AQDWTCDC.js} +2 -2
- package/dist/chunk-AUP6YI5M.js +2 -0
- package/dist/chunk-B7ECWJAZ.js +2 -0
- package/dist/{chunk-ZHXX42OH.js → chunk-BATIVRU2.js} +4 -4
- package/dist/chunk-BBEDPVPB.js +4 -0
- package/dist/chunk-BBWPOMGU.js +2 -0
- package/dist/chunk-BD6CV7PN.js +2 -0
- package/dist/{chunk-XKWKXZKW.js → chunk-BHE44MHT.js} +2 -2
- package/dist/chunk-BOJ5SVE2.js +2 -0
- package/dist/chunk-BZYSGZRK.js +2 -0
- package/dist/chunk-CA5RE6H7.js +2 -0
- package/dist/chunk-CKDOY6JA.js +2 -0
- package/dist/chunk-CN2WGM7D.js +2 -0
- package/dist/chunk-COTMS5KM.js +3 -0
- package/dist/chunk-CSDDOUA4.js +3 -0
- package/dist/chunk-CT5SI2I4.js +2 -0
- package/dist/chunk-D5EKVZPI.js +2 -0
- package/dist/{chunk-FKSELJQF.js → chunk-D5W4UZY5.js} +2 -2
- package/dist/{chunk-RUJURYSV.js → chunk-DEUGHURX.js} +2 -2
- package/dist/chunk-DHKBIOXF.js +7 -0
- package/dist/chunk-DMQ7ZKJG.js +81 -0
- package/dist/chunk-DMUGTKMD.js +2 -0
- package/dist/chunk-DOPCR5BY.js +2 -0
- package/dist/chunk-DRENNWRG.js +2 -0
- package/dist/chunk-E4EJBGDZ.js +2 -0
- package/dist/chunk-E7BJXRNV.js +2 -0
- package/dist/chunk-EA4SH4U5.js +5 -0
- package/dist/{chunk-L7AW2QB5.js → chunk-EKZRF57O.js} +2 -2
- package/dist/chunk-ELNRLMC5.js +29 -0
- package/dist/chunk-F4FNK44D.js +2 -0
- package/dist/chunk-F7WQ337U.js +308 -0
- package/dist/chunk-FEQIQ26E.js +2 -0
- package/dist/chunk-FGB567HK.js +23 -0
- package/dist/chunk-FHV7NMFU.js +29 -0
- package/dist/chunk-FN6EJM6Q.js +2 -0
- package/dist/chunk-FTSQNONX.js +2 -0
- package/dist/chunk-FUG6RPYY.js +6 -0
- package/dist/chunk-G2F6T5BV.js +2 -0
- package/dist/chunk-G6OGPXJW.js +9 -0
- package/dist/chunk-GFLTPNWV.js +3 -0
- package/dist/chunk-GTDP2SKQ.js +2 -0
- package/dist/chunk-H46QMB7E.js +2 -0
- package/dist/chunk-H5EXS3HM.js +2 -0
- package/dist/chunk-HEOMG7IM.js +8 -0
- package/dist/chunk-HG5YI7PV.js +2 -0
- package/dist/{chunk-7SQQWSY3.js → chunk-HGKEAP7F.js} +2 -2
- package/dist/chunk-HUZNZ3H2.js +2 -0
- package/dist/chunk-HWLCBKFE.js +2 -0
- package/dist/chunk-I3U2FN2T.js +13 -0
- package/dist/{chunk-JAYYFEQY.js → chunk-I7PFL5P3.js} +2 -2
- package/dist/{chunk-2HPVVXM5.js → chunk-ICHBVITH.js} +2 -2
- package/dist/chunk-ICUQONOG.js +38 -0
- package/dist/chunk-IDPLC3FI.js +5 -0
- package/dist/{chunk-A73XVBCR.js → chunk-IGKKTHJR.js} +2 -2
- package/dist/chunk-IOKWFRFQ.js +4 -0
- package/dist/chunk-IPAL6DP2.js +3 -0
- package/dist/chunk-IUJ3ZFEE.js +7 -0
- package/dist/chunk-IXJ26KJJ.js +16 -0
- package/dist/chunk-IYV2YBHM.js +2 -0
- package/dist/chunk-JVZNWJBH.js +2 -0
- package/dist/chunk-K5MZYZV7.js +3 -0
- package/dist/{chunk-3G66UZBH.js → chunk-KFK7GF5C.js} +2 -2
- package/dist/chunk-KTRGJLY7.js +18 -0
- package/dist/chunk-KW6B5OL4.js +2 -0
- package/dist/chunk-KWARB5FZ.js +2 -0
- package/dist/chunk-LHTT5C3Z.js +2 -0
- package/dist/chunk-LPGDO2XA.js +3 -0
- package/dist/chunk-LXLD46LH.js +21 -0
- package/dist/chunk-MEI3PTUK.js +2 -0
- package/dist/chunk-MJNV7OCG.js +5 -0
- package/dist/chunk-MO226P4Q.js +4 -0
- package/dist/{chunk-3CLX5EOX.js → chunk-MOBF2GH6.js} +2 -2
- package/dist/chunk-MXNGIEPU.js +3 -0
- package/dist/chunk-MYUKI5VN.js +4 -0
- package/dist/{chunk-TFRAYKN6.js → chunk-N5C65OFK.js} +2 -2
- package/dist/{chunk-PXY7F6Y4.js → chunk-O2RM7E7L.js} +5 -5
- package/dist/chunk-OFUBXBYX.js +3 -0
- package/dist/chunk-OFY4HTMI.js +2 -0
- package/dist/chunk-OIRWZIYL.js +38 -0
- package/dist/chunk-OIVZ7PW6.js +438 -0
- package/dist/chunk-ORBKAUCH.js +4 -0
- package/dist/chunk-OUB4J26T.js +2 -0
- package/dist/chunk-OVPS2ILI.js +20 -0
- package/dist/chunk-PHSPBQM6.js +5 -0
- package/dist/{chunk-JVYA47YU.js → chunk-PIZY2GX6.js} +2 -2
- package/dist/chunk-PNISDVYC.js +3 -0
- package/dist/chunk-PQOL42AW.js +2 -0
- package/dist/chunk-PUVZNFVY.js +11 -0
- package/dist/chunk-PZEI2TVL.js +4 -0
- package/dist/{chunk-ZK26BAQL.js → chunk-Q2J2VZZT.js} +2 -2
- package/dist/chunk-Q7HB7BFJ.js +2 -0
- package/dist/{chunk-ZTETIQ35.js → chunk-QBANU5BQ.js} +2 -2
- package/dist/chunk-QD7IFBCR.js +10 -0
- package/dist/chunk-QDCCHMVZ.js +2 -0
- package/dist/chunk-QLQBZOJH.js +3 -0
- package/dist/{chunk-PQCI4SQX.js → chunk-QXR5QPSF.js} +2 -2
- package/dist/chunk-R2MOKIVO.js +2 -0
- package/dist/{chunk-EN3O7VJA.js → chunk-RFWAUHVW.js} +2 -2
- package/dist/chunk-RGCJ4646.js +16 -0
- package/dist/{chunk-BPAPWKP6.js → chunk-S3RTPPLQ.js} +8 -8
- package/dist/chunk-S73HBCGI.js +11 -0
- package/dist/chunk-SDPA5DKN.js +210 -0
- package/dist/chunk-SEUJVWT2.js +3 -0
- package/dist/chunk-SF7X6QNW.js +2 -0
- package/dist/chunk-SKUMCCC5.js +2 -0
- package/dist/chunk-SSSJO4RG.js +2 -0
- package/dist/chunk-SWFAFA4G.js +49 -0
- package/dist/chunk-SYUNTKO2.js +2 -0
- package/dist/chunk-T6FRID7Y.js +3 -0
- package/dist/chunk-TGWNNMPF.js +3 -0
- package/dist/chunk-TM5XEDDR.js +4 -0
- package/dist/chunk-TNOHGHZQ.js +2 -0
- package/dist/chunk-U2GPTA5U.js +3 -0
- package/dist/{chunk-SXP2MBJH.js → chunk-U7DR7MJD.js} +2 -2
- package/dist/chunk-U7LRSQG6.js +3 -0
- package/dist/chunk-UL4VJUMD.js +2 -0
- package/dist/chunk-UNORWZIJ.js +16 -0
- package/dist/chunk-UQ7XPRWU.js +2 -0
- package/dist/{chunk-6SHPK5ZE.js → chunk-URMZLV2N.js} +2 -2
- package/dist/chunk-URTX2BEA.js +6 -0
- package/dist/chunk-UZFCZ7SJ.js +2 -0
- package/dist/{chunk-KMKTIO2G.js → chunk-V7LQZTTZ.js} +2 -2
- package/dist/chunk-VETXXOYU.js +3 -0
- package/dist/chunk-VGRUM7JI.js +3 -0
- package/dist/{chunk-WXZLAAWK.js → chunk-VNKYRJKN.js} +2 -2
- package/dist/chunk-VWLIOEEF.js +11 -0
- package/dist/chunk-WB6LGCFB.js +6 -0
- package/dist/{chunk-W4ETQAXM.js → chunk-WK4FD4PG.js} +2 -2
- package/dist/{chunk-O64IZ6UX.js → chunk-WKPZCQLI.js} +2 -2
- package/dist/chunk-WSG3DK5H.js +2 -0
- package/dist/chunk-WULAPQUD.js +38 -0
- package/dist/chunk-WZQFY5S7.js +4 -0
- package/dist/chunk-X434XZAI.js +2 -0
- package/dist/chunk-X7PJJYKX.js +29 -0
- package/dist/chunk-XDAUYDFT.js +2 -0
- package/dist/chunk-XITQLISP.js +2 -0
- package/dist/chunk-XRXCANFQ.js +4 -0
- package/dist/chunk-XVDMJMES.js +3 -0
- package/dist/chunk-XXJ7WL3F.js +35 -0
- package/dist/chunk-Y4XQ7LES.js +9 -0
- package/dist/chunk-YIEFEPG6.js +16 -0
- package/dist/chunk-YRVERHJR.js +49 -0
- package/dist/{chunk-CJST5ETY.js → chunk-YUFWLWIC.js} +2 -2
- package/dist/chunk-YUKYB54I.js +1 -0
- package/dist/chunk-Z3GCK3PD.js +3 -0
- package/dist/chunk-ZBNL3QCY.js +4 -0
- package/dist/chunk-ZD3Z54IW.js +2 -0
- package/dist/chunk-ZDVDSDFG.js +4 -0
- package/dist/{chunk-32LVLCLN.js → chunk-ZHSARYVS.js} +3 -3
- package/dist/{chunk-BDCC2NPY.js → chunk-ZW44MCJM.js} +2 -2
- package/dist/{chunk-N5W4YZMK.js → chunk-ZYREOING.js} +2 -2
- package/dist/cli-main.js +8 -0
- package/dist/cli.js +1 -3
- package/dist/code-CczEvHui.d.ts +121 -0
- package/dist/code-EQL6ZBLH.js +2 -0
- package/dist/code-result-json-6E4J6LGZ.js +2 -0
- package/dist/command-descriptors-QH3G2OVD.js +346 -0
- package/dist/{config-types-jVM3D7MA.d.ts → config-types-Cm-VSEBb.d.ts} +189 -23
- package/dist/dataflow-2BLMUZBP.js +2 -0
- package/dist/{db-B5PM5yNk.d.ts → db-LKJXAlNS.d.ts} +1 -1
- package/dist/dependence-slice-MGAJDZXB.js +2 -0
- package/dist/deps-GQMUYVKW.js +2 -0
- package/dist/direct-navigation-6RUJKLAV.js +3 -0
- package/dist/entry-map-V2NQP5JU.js +2 -0
- package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
- package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
- package/dist/file-kind-BKCVMNUf.d.ts +10 -0
- package/dist/files-VM53I4IU.js +2 -0
- package/dist/graph-evidence-CbUPCSKV.d.ts +126 -0
- package/dist/graph-exploration-contract-CqDsnPQL.d.ts +7 -0
- package/dist/{health-Do5TKSJI.d.ts → health-Wl5G_LRt.d.ts} +33 -34
- package/dist/hierarchy-D553WRSZ.js +2 -0
- package/dist/imports-DOZAJWLW.js +2 -0
- package/dist/index.d.ts +4 -31
- package/dist/index.js +1 -1
- package/dist/members-HE67475K.js +2 -0
- package/dist/methods-K5JK4PPH.js +2 -0
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
- package/dist/output-continuation-command-LKBUTNRL.js +3 -0
- package/dist/output-pagination-VAWOGX4R.js +19 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-4ARU6QCM.js +3 -0
- package/dist/queries/affected.d.ts +22 -4
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +123 -0
- package/dist/queries/anchors.js +2 -0
- package/dist/queries/architecture.d.ts +3 -2
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +26 -7
- 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 +17 -3
- 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 +5 -26
- 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/context.d.ts +145 -0
- package/dist/queries/context.js +2 -0
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +8 -3
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +34 -7
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +40 -14
- 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/decorative-checkers.d.ts +3 -3
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +4 -38
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.d.ts +47 -0
- package/dist/queries/dependence-slice.js +2 -0
- package/dist/queries/dependency-depth.d.ts +49 -0
- package/dist/queries/dependency-depth.js +2 -0
- package/dist/queries/deps.d.ts +4 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +4 -4
- 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/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +121 -0
- package/dist/queries/entry-map.js +2 -0
- package/dist/queries/evidence.d.ts +70 -0
- package/dist/queries/evidence.js +2 -0
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +18 -5
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +4 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +5 -3
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +11 -5
- 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 +4 -4
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +56 -136
- 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/not-implemented.d.ts +3 -3
- package/dist/queries/not-implemented.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 +5 -9
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +27 -64
- 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/reference-neighborhood.d.ts +4 -0
- package/dist/queries/reference-neighborhood.js +2 -0
- package/dist/queries/reference-reachability.d.ts +48 -0
- package/dist/queries/reference-reachability.js +2 -0
- 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 +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +3 -36
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.d.ts +209 -0
- package/dist/queries/source-inspection.js +2 -0
- package/dist/queries/source-search.d.ts +13 -0
- package/dist/queries/source-search.js +2 -0
- 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 +13 -4
- 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-map.d.ts +449 -0
- package/dist/queries/system-map.js +2 -0
- package/dist/queries/system.d.ts +5 -3
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +47 -3
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +3 -3
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +3 -3
- package/dist/queries/twin-drift.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/value-flow.d.ts +43 -0
- package/dist/queries/value-flow.js +2 -0
- 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/query-service-fastpath.js +6 -0
- package/dist/query-service-server.js +5 -0
- package/dist/refs-NBHKL4UQ.js +2 -0
- package/dist/refs-pagination-BBVTIHMH.js +2 -0
- package/dist/reindex-worker.js +27 -45
- package/dist/reindex.d.ts +62 -42
- package/dist/reindex.js +32 -33
- package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
- package/dist/runtime.d.ts +286 -7
- package/dist/runtime.js +4 -3
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-BnEwZRLJ.d.ts → scip-cli-CppzF5MK.d.ts} +33 -2
- package/dist/slice-U6S6LBSB.js +2 -0
- package/dist/source-search-types-Dwz8KeuW.d.ts +79 -0
- package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
- package/dist/stats-OOJ74B32.js +2 -0
- package/dist/surface-C7SS5CDQ.js +2 -0
- package/dist/symbol-resolution-3FVEKDTJ.js +2 -0
- package/dist/system-6K2NOO5C.js +2 -0
- package/dist/trace-II5K2TMH.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-MKFUUE5B.js +2 -0
- package/dist/watch-server.js +3 -2
- package/docs/AGENT_GUIDE.md +133 -476
- package/docs/AI_FAILURE_MODES.md +30 -301
- package/docs/API.md +1 -1
- package/docs/API_EVOLUTION.md +6 -0
- package/docs/CLI_JSON_OUTPUT.md +207 -29
- package/docs/COMMAND_REFERENCE.md +255 -154
- package/docs/CONFIGURATION_WRITE_SAFETY.md +14 -13
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +84 -0
- package/docs/DETECTOR_GUIDE.md +46 -138
- package/docs/DURABILITY.md +7 -1
- package/docs/INDEX_GENERATIONS.md +6 -0
- package/docs/LOCK_PROTOCOL.md +8 -0
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +13 -3
- package/docs/SECURITY_MODEL.md +39 -42
- package/docs/accuracy-audit-checklist.md +4 -0
- package/docs/accuracy-hardening-goal.md +9 -2
- package/docs/analyzer-inventory.md +59 -264
- package/docs/analyzer-validation-protocol.md +62 -170
- package/docs/architecture-coherence-vision.md +18 -12
- package/docs/locality-analyzer-design.md +1 -1
- package/docs/schemas/cli-json-envelope.schema.json +212 -27
- package/docs/schemas/cli-json-export-receipt.schema.json +25 -0
- package/docs/schemas/cli-output-page.schema.json +1 -1
- package/docs/schemas/observation-receipt.schema.json +164 -0
- package/docs/schemas/project-config.schema.json +27 -45
- package/docs/schemas/suppression-record.schema.json +1 -34
- package/package.json +65 -8
- package/skills/concrete-plan/SKILL.md +8 -0
- package/skills/concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-explore/SKILL.md +3 -85
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/SKILL.md +185 -0
- package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
- package/skills/scip-plan/SKILL.md +67 -49
- package/skills/scip-plan/agents/openai.yaml +3 -3
- package/skills/scip-query/SKILL.md +77 -77
- package/skills/scip-query/agents/openai.yaml +3 -3
- package/skills/scip-setup/SKILL.md +10 -102
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/chunk-26QA6FAI.js +0 -8
- package/dist/chunk-2KAZEZ6M.js +0 -2
- package/dist/chunk-3ORVDL3H.js +0 -2
- package/dist/chunk-46XGSFNI.js +0 -2
- package/dist/chunk-4MAK2HOY.js +0 -6
- package/dist/chunk-4TURLRL5.js +0 -16
- package/dist/chunk-4UQVNCQE.js +0 -2
- package/dist/chunk-55Q3WLZX.js +0 -2
- package/dist/chunk-5I5G2QOX.js +0 -3
- package/dist/chunk-6LDJQXAH.js +0 -2
- package/dist/chunk-6O5TICIZ.js +0 -3
- package/dist/chunk-7O5IKBTZ.js +0 -16
- package/dist/chunk-7S5E7KWT.js +0 -2
- package/dist/chunk-7WPLAODU.js +0 -5
- package/dist/chunk-AFHORGLH.js +0 -42
- package/dist/chunk-AIE7TFJW.js +0 -9
- package/dist/chunk-AQOFWNQJ.js +0 -1
- package/dist/chunk-B2PX5I6M.js +0 -2
- package/dist/chunk-B75HZHUP.js +0 -2
- package/dist/chunk-B7PBSLZN.js +0 -2
- package/dist/chunk-BBW6JFHN.js +0 -2
- package/dist/chunk-BNXCIFVY.js +0 -2
- package/dist/chunk-BS2NMXQZ.js +0 -4
- package/dist/chunk-C3KV2II6.js +0 -2
- package/dist/chunk-C43RDDP4.js +0 -20
- package/dist/chunk-DAFAHMNB.js +0 -42
- package/dist/chunk-DQLPXMH6.js +0 -8
- package/dist/chunk-EKZTZXHZ.js +0 -117
- package/dist/chunk-EW2NTSFA.js +0 -18
- package/dist/chunk-F3Z4OUDS.js +0 -8
- package/dist/chunk-FJH2NW7J.js +0 -66
- package/dist/chunk-FTFP6O3L.js +0 -11
- package/dist/chunk-FYLK2DEJ.js +0 -2
- package/dist/chunk-GH74ASD6.js +0 -11
- package/dist/chunk-GMXWZP2B.js +0 -2
- package/dist/chunk-GOUBFH5O.js +0 -3
- package/dist/chunk-HLF2TX6R.js +0 -2
- package/dist/chunk-HX7M4BDI.js +0 -30
- package/dist/chunk-HZ72SESS.js +0 -128
- package/dist/chunk-IB2N4FIY.js +0 -10
- package/dist/chunk-IZYYAFN5.js +0 -2
- package/dist/chunk-JFGGXWQF.js +0 -947
- package/dist/chunk-JN4NMBEX.js +0 -8
- package/dist/chunk-JW56N3KI.js +0 -4
- package/dist/chunk-JZ2OXNWB.js +0 -2
- package/dist/chunk-KFZNKUNT.js +0 -2
- package/dist/chunk-L5GJNV2T.js +0 -8
- package/dist/chunk-L7JDSCDF.js +0 -4
- package/dist/chunk-LU47HG23.js +0 -14
- package/dist/chunk-LVY7NPF7.js +0 -2
- package/dist/chunk-MKCDWWGV.js +0 -4
- package/dist/chunk-MNE7YG56.js +0 -2
- package/dist/chunk-MRXBEXSY.js +0 -26
- package/dist/chunk-MV7OWDUX.js +0 -2
- package/dist/chunk-NGEXCJJW.js +0 -11
- package/dist/chunk-NIW6JDC5.js +0 -29
- package/dist/chunk-PBUQFCNB.js +0 -16
- package/dist/chunk-POAVPHH7.js +0 -2
- package/dist/chunk-QZ4JVECJ.js +0 -2
- package/dist/chunk-RDO52JGY.js +0 -2
- package/dist/chunk-RJT3TUUZ.js +0 -2
- package/dist/chunk-RVLDN63O.js +0 -4
- package/dist/chunk-RXOXSKY3.js +0 -2
- package/dist/chunk-S7OYBOCK.js +0 -2
- package/dist/chunk-SMNXQT5Z.js +0 -3
- package/dist/chunk-SRAFT254.js +0 -2
- package/dist/chunk-T7YQSHPQ.js +0 -3
- package/dist/chunk-UJCOIXDY.js +0 -2
- package/dist/chunk-UJPRPGCO.js +0 -13
- package/dist/chunk-WCCFZ7V7.js +0 -113
- package/dist/chunk-WUPW3UN3.js +0 -3
- package/dist/chunk-X54AGLVX.js +0 -2
- package/dist/chunk-Y2MVPNKY.js +0 -5
- package/dist/chunk-YKUU5AIC.js +0 -3
- package/dist/chunk-YLCJLTPL.js +0 -2
- package/dist/chunk-YTQVETEO.js +0 -2
- package/dist/chunk-Z4N3MZYA.js +0 -38
- package/dist/chunk-ZJOOT3BG.js +0 -2
- package/dist/command-descriptors-DSS46KXI.js +0 -642
- package/dist/diff-gate-types-B0QYpDv1.d.ts +0 -11
- package/dist/direct-navigation-6YHV6IB5.js +0 -3
- package/dist/queries/diff-gate.d.ts +0 -253
- package/dist/queries/diff-gate.js +0 -2
- package/docs/COMMITTED_RECORD_COMPATIBILITY.md +0 -154
- package/docs/analyzer-validation-ledger.md +0 -516
- package/docs/schemas/outcome-event-record.schema.json +0 -95
- package/skills/_shared/SKILL.md +0 -101
- package/skills/_shared/agents/openai.yaml +0 -4
- package/skills/_shared/references/agent-contract-catalog.md +0 -105
- package/skills/_shared/references/command-catalog.md +0 -118
- package/skills/_shared/references/detector-precision-and-diffgate.md +0 -59
- package/skills/_shared/references/evidence-and-dead-code.md +0 -25
- package/skills/scip-audit/SKILL.md +0 -77
- package/skills/scip-audit/agents/openai.yaml +0 -4
- package/skills/scip-audit/references/claims.md +0 -98
- package/skills/scip-audit/references/cleanup.md +0 -100
- package/skills/scip-audit/references/directory.md +0 -222
- package/skills/scip-audit/references/frontend.md +0 -130
- package/skills/scip-audit/references/integrity.md +0 -154
- package/skills/scip-audit/references/maintainability.md +0 -162
- package/skills/scip-audit/references/twin-drift.md +0 -104
- package/skills/scip-diagnose/SKILL.md +0 -52
- package/skills/scip-diagnose/agents/openai.yaml +0 -4
- package/skills/scip-diagnose/references/debug.md +0 -117
- package/skills/scip-diagnose/references/probe-reachability.md +0 -77
- package/skills/scip-diagnose/references/root-cause.md +0 -145
- package/skills/scip-diagnose/references/triage.md +0 -119
- package/skills/scip-explore/references/diagrams.md +0 -40
- package/skills/scip-explore/references/language-playbook.md +0 -49
- package/skills/scip-improve/SKILL.md +0 -56
- package/skills/scip-improve/agents/openai.yaml +0 -4
- package/skills/scip-improve/references/cleanup-batches.md +0 -53
- package/skills/scip-improve/references/directory-moves.md +0 -53
- package/skills/scip-improve/references/doc-reconcile.md +0 -30
- package/skills/scip-improve/references/frontend-extraction.md +0 -39
- package/skills/scip-improve/references/maintainability-mechanism.md +0 -43
- package/skills/scip-improve/references/twin-drift.md +0 -35
- package/skills/scip-plan/references/api-impact.md +0 -19
- package/skills/scip-plan/references/conductor.md +0 -41
- package/skills/scip-plan/references/high-assurance.md +0 -43
- package/skills/scip-plan/references/hyper-optimization.md +0 -50
- package/skills/scip-plan/references/tla-model.md +0 -88
- package/skills/scip-setup/references/bootstrap-workflow.md +0 -119
- package/skills/scip-setup/references/language-verification.md +0 -61
- package/skills/scip-setup/references/lifecycle-commands.md +0 -119
- package/skills/scip-setup/references/per-repo-triage.md +0 -24
- package/skills/scip-verify/SKILL.md +0 -229
- package/skills/scip-verify/agents/openai.yaml +0 -4
- package/skills/scip-verify/references/calibrate-detectors.md +0 -170
package/dist/chunk-DAFAHMNB.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import{A as ie,C as _e,E as Ae,F as Oe,G as $e,H as oe,I as se,J as qe,K as Be,L as Ue,M as q,N as He,O as Ve,P as Ge,Q as Ke,R as Ye,S as K,T as Y,U as We,W as ze,X as ae,Y as Je,Z as Qe,a as Ee,c as H,ma as Xe,w as Le,xa as Ze,ya as nt,z as re}from"./chunk-HZ72SESS.js";import{b as $,c as je,f as L}from"./chunk-FJH2NW7J.js";import{b as Re,c as Te,j as we,m as ne,o as Ne}from"./chunk-WUPW3UN3.js";import{a as De,c as Fe,u as ce,v as et,w as W,x as le,y as tt}from"./chunk-AIE7TFJW.js";import{a as V,e as R}from"./chunk-HGFDYOVB.js";import{a as ke,d as G}from"./chunk-MNE7YG56.js";import{a as Ce,g as Pe,h as U}from"./chunk-46XGSFNI.js";import{randomUUID as Kt}from"crypto";import{resolve as Yt}from"path";var rt=class{projectRoot;currentGeneration;createEmitter;wallNow;monotonicNow;active=null;requests=0;sessionsCreated=0;sessionsReplaced=0;lastRequestAtMs=null;lastDurationMs=null;lastError=null;unavailable=!1;constructor(e){this.projectRoot=Yt(e.projectRoot),this.currentGeneration=e.currentGeneration,this.createEmitter=e.createEmitter??Ze,this.wallNow=e.wallNow??e.now??Date.now,this.monotonicNow=e.monotonicNow??e.now??ke}handle(e,t){let n=this.monotonicNow();try{if(this.currentGeneration()!==e)throw new Error("TypeScript index request does not match the currently published generation.");let i=this.emitterFor(t);if(i.emitter.producerIdentity!==t.producerIdentity)throw new Error("TypeScript index producer identity changed.");let o=i.emitter.snapshotStats(),s=i.emitter.advance({modifiedFiles:t.modifiedFiles,affectedFiles:t.affectedFiles}),a=this.monotonicNow()-n;return this.requests+=1,this.lastRequestAtMs=this.wallNow(),this.lastDurationMs=a,this.lastError=null,this.unavailable=!1,{producerIdentity:s.producerIdentity,cold:s.stats.initializations>o.initializations,durationMs:a,fragments:s.fragments.map(c=>({relativePath:c.relativePath,bytesBase64:c.bytes===null?null:Buffer.from(c.bytes).toString("base64"),occurrences:c.occurrences,symbols:c.symbols,referenceFragments:c.referenceFragments}))}}catch(i){throw this.lastError=i instanceof Error?i.message:String(i),i}}status(e){let t=this.active?.emitter.snapshotStats();return{protocolVersion:nt,state:this.unavailable?"unavailable":this.lastError?"error":this.active?"ready":"idle",requests:this.requests,sessionsCreated:this.sessionsCreated,sessionsReplaced:this.sessionsReplaced,initializations:t?.initializations??0,programUpdates:t?.programUpdates??0,documentsEmitted:t?.documentsEmitted??0,documentsRemoved:t?.documentsRemoved??0,...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastDurationMs===null?{}:{lastDurationMs:this.lastDurationMs},...this.lastError?{lastError:this.lastError}:{},...e?{mailbox:e}:{}}}close(){this.active=null}emitterFor(e){let t=`${e.tsconfigPath}\0${e.projectArgument}`;if(this.active&&this.active.sessionKey===t&&this.active.projectIdentity===e.projectIdentity)return this.active;let n=this.createEmitter({workspaceRoot:this.projectRoot,tsconfigPath:e.tsconfigPath,projectRoot:e.projectArgument});if(!n.available)throw this.unavailable=!0,new Error(n.reason);return this.active&&(this.sessionsReplaced+=1),this.active={sessionKey:t,projectIdentity:e.projectIdentity,emitter:n.emitter},this.sessionsCreated+=1,this.active}};function Ir(r){W(r)}var vr=`typescript-index-${process.pid}-${Kt()}`,it=G(process.pid),Cr={pid:process.pid,...it?{processIdentity:it}:{}};import{existsSync as zt}from"fs";import{isAbsolute as kr,join as Jt,relative as wr,resolve as Nr}from"path";var D=1,j=2,Wt="./node_modules/scip-query/docs/schemas/project-config.schema.json";function ot(r){let e=r;if(typeof r=="string")try{e=JSON.parse(r)}catch(a){return{kind:"malformed",reason:`invalid JSON: ${a instanceof Error?a.message:String(a)}`}}if(!De(e))return{kind:"malformed",reason:"project config must be a JSON object"};let t=e.schemaVersion;if(t!==void 0&&!Number.isInteger(t))return{kind:"malformed",reason:"schemaVersion must be an integer"};let n=t===void 0?D:t;if(n!==D&&n!==j)return{kind:"unsupported",schemaVersion:n,direction:n<D?"older":"future"};let i=e.$schema;if(i!==void 0&&(typeof i!="string"||i.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let o=st(e),s=n!==j||typeof e.$schema!="string";return n===D?{kind:"legacy",sourceVersion:D,config:o,needsMigration:s}:{kind:"supported",sourceVersion:j,config:o,needsMigration:s}}function st(r){let e=r,{$schema:t,schemaVersion:n,...i}=e;return{$schema:typeof t=="string"&&t.trim()!==""?t:Wt,schemaVersion:j,...i}}var z=".scipquery.json",Qt=250,Xt=5e3,Zt=10*6e4,en={enabled:!1,debounceMs:Qt,cooldownMs:Xt,gitPollMs:2e3,idleTimeoutMs:Zt,autoRefresh:!0,ignore:[]};var Ar=new Set(Ee);function Or(r){let e=Jt(r,z);if(!zt(e))return{};let t;try{t=Pe(e,{maxBytes:Ce,inputKind:"scip-query project config"})}catch(n){let i=n instanceof Error?n.message:String(n);throw new Error(`unable to read ${z} at ${e}: ${i}`,{cause:n})}return tn(ot(t),e,"read").config}function $r(r){return{...en,...r.watch}}function tn(r,e,t){if(r.kind==="legacy"||r.kind==="supported")return r;if(r.kind==="malformed"){let i=t==="read"?`invalid ${z} at ${e}: ${r.reason}`:`Cannot update ${e}: the latest project config is ${r.reason}.`;throw new Error(`${i} The file was left untouched.`)}let n=t==="read"?`invalid ${z} at ${e}`:`Cannot update ${e}: the latest project config is invalid`;throw new Error(`${n} (unsupported ${r.direction} schemaVersion ${r.schemaVersion}; this scip-query reads legacy v${D} and current v${j}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as at}from"fs";function Yr(r,e,t){let n=new Date().toISOString();if(!at(t.dbPath))return{state:"missing",checkedAt:n,metaPath:t.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!at(t.metaPath))return{state:"unknown",checkedAt:n,metaPath:t.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let i=H(U(t.metaPath,"reindex metadata"));if(i.kind==="unsupported")return{state:"unknown",checkedAt:n,metaPath:t.metaPath,reason:`Reindex metadata version ${i.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(i.kind==="malformed")return{state:"unknown",checkedAt:n,metaPath:t.metaPath,reason:`Could not decode reindex metadata: ${i.reason}`,remedy:"Run: scip-query reindex"};let o=i.metadata,s=e.languages??Qe(r),a=nn(r,s,e),c=[...o.indexedLanguages??[]].sort(),l=i.capabilities.publishableGeneration&&JSON.stringify(o.fingerprint)===JSON.stringify(a)&&JSON.stringify(c)===JSON.stringify(a.languages),d=Xe(t.dbPath,t.metaPath),p=d.state==="invalid"||d.state==="drifted",u=l&&!p;return{state:u?"fresh":"stale",checkedAt:n,metaPath:t.metaPath,updatedAt:o.updatedAt,lastRefresh:o.lastRefresh,reason:p?`SQLite generation requires repair: ${d.reason}`:l?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:u?void 0:"Run: scip-query reindex"}}catch(i){return{state:"unknown",checkedAt:n,metaPath:t.metaPath,reason:`Could not read reindex metadata: ${i instanceof Error?i.message:String(i)}`,remedy:"Run: scip-query reindex"}}}function nn(r,e,t){return Ne(r,e,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath})}import{join as rn}from"path";var J=3,on=2,sn="typescript-semantic";function ei(r){let e=rn(r,sn),t=et(e);return{...t,requestDir:t.legacyRequestDir}}function ti(r){return Le(r)}function an(r){let e=JSON.parse(r),t=e.protocolVersion,n=t===on;if(!n&&t!==J||typeof e.id!="string"||typeof e.generation!="string"||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||e.profileEnvironment!==void 0&&!Fe(e.profileEnvironment)||!e.request||!cn(e.request)||!n&&(e.mailboxVersion!==ce||typeof e.operationKey!="string"||!/^[a-f0-9]{64}$/.test(e.operationKey)||e.id!==tt(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||e.deadlineAtMs<e.enqueuedAtMs))throw new Error("TypeScript semantic service received an invalid mailbox request.");if(!n){let o=e,s=le("typescript-semantic-v3",{generation:o.generation,profileEnvironment:o.profileEnvironment,request:o.request});if(o.operationKey!==s)throw new Error("TypeScript semantic service received a mismatched mailbox operation identity.");return o}let i=le("typescript-semantic-v2",{id:e.id,generation:e.generation,request:e.request});return{protocolVersion:J,mailboxVersion:ce,id:e.id,operationKey:i,clientId:"legacy-v2",enqueuedAtMs:e.deadlineAtMs,deadlineAtMs:e.deadlineAtMs,generation:e.generation,...e.profileEnvironment?{profileEnvironment:e.profileEnvironment}:{},request:e.request}}function cn(r){if(!r||typeof r!="object"||!("kind"in r))return!1;let e=r;switch(e.kind){case"availability":return!0;case"import-usage":return typeof e.file=="string";case"reference-fragments":return qe(e.files)!==null;case"references":return ct(e.definitions)&&(e.exact===void 0||typeof e.exact=="boolean");case"callees":return ct(e.definitions);case"signature":return lt(e.definition);default:return!1}}function ct(r){return Array.isArray(r)&&r.every(lt)}function lt(r){if(!r||typeof r!="object")return!1;let e=r;return typeof e.symbolId=="number"&&typeof e.documentId=="number"&&typeof e.symbol=="string"&&typeof e.relativePath=="string"&&typeof e.leaf=="string"&&typeof e.startLine=="number"&&typeof e.endLine=="number"}import{randomUUID as cr}from"crypto";import{resolve as Ot}from"path";import{performance as m}from"perf_hooks";function Q(r){return{forFile(e,t){return dt(r,e,t)},forFiles(e,t){let n=new Map;for(let i of e)n.set(i,dt(r,i,t));return n}}}function dt(r,e,t){let n={file:e},i=t.facts||t.identifiers;if(t.text&&(n.text=Be(r,e)),t.lines&&(n.lines=Ue(r,e)),t.ast&&(n.ast=He(r,e)),t.imports&&(n.imports=Ye(r,e)),t.reexports&&(n.reexports=Ke(r,e)),i){let o=Ve(r,e),s=o.facts;t.facts&&(n.facts=s),o.unavailable&&(n.sourceFactsUnavailable=o.unavailable),t.identifiers&&s&&(n.identifiers=s.fileIdentifiers,n.identifierLineMap=s.identifierLineMap)}return n}var ln={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function X(r){if(r.startsWith("local "))return{kind:"local",id:r.slice(6),raw:r};let e=r.split(" ");if(e.length<4)return{scheme:e[0]??"",manager:e[1]??"",packageName:e[2]??"",version:"",descriptors:[],raw:r};let t=e[0],n=e[1],i=r.slice(t.length+1+n.length+1),o;if(i.startsWith("`")){let l=i.indexOf("`",1);l===-1?(o=i.slice(1),i=""):(o=i.slice(1,l),i=i.slice(l+2))}else{let l=i.indexOf(" ");l===-1?(o=i,i=""):(o=i.slice(0,l),i=i.slice(l+1))}let s,a=i.indexOf(" ");a===-1?(s=i,i=""):(s=i.slice(0,a),i=i.slice(a+1));let c=dn(i);return{scheme:t,manager:n,packageName:o,version:s,descriptors:c,raw:r}}function _(r){let e=X(r);if("kind"in e)return null;for(let t=e.descriptors.length-2;t>=0;t--){let n=e.descriptors[t];if(n?.suffix==="type")return n.name}return null}function dn(r){let e=[],t=0;for(;t<r.length;){if(r[t]==="["){let o=r.indexOf("]",t+1);if(o===-1){e.push({name:r.slice(t+1),suffix:"type-param"});break}e.push({name:r.slice(t+1,o),suffix:"type-param"}),t=o+1;continue}if(r[t]==="("&&(e.length===0||t===0||pt(r[t-1]))){let o=r.indexOf(")",t+1);if(o!==-1&&r[o+1]!=="."){e.push({name:r.slice(t+1,o),suffix:"parameter"}),t=o+1;continue}}let n;if(r[t]==="`"){let o=r.indexOf("`",t+1);if(o===-1){n=r.slice(t+1),e.push({name:n,suffix:"term"});break}n=r.slice(t+1,o),t=o+1}else{let o=t;for(;t<r.length&&!pt(r[t]);)t++;n=r.slice(o,t)}if(t>=r.length){n&&e.push({name:n,suffix:"term"});break}let i=r[t];if(i==="("){let o=r.indexOf(")",t+1);o!==-1&&r[o+1]==="."?(e.push({name:n,suffix:"method"}),t=o+2):o!==-1?(e.push({name:n,suffix:"method"}),t=o+1):(e.push({name:n,suffix:"term"}),t++)}else{let o=ln[i];o&&e.push({name:n,suffix:o}),t+=1}}return e}function pt(r){return r==="/"||r==="#"||r==="."||r==="("||r==="["||r===":"||r==="!"}function F(r){let e=X(r);if("kind"in e&&e.kind==="local")return e.id;let t=e;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function E(r){let e=X(r);if("kind"in e&&e.kind==="local")return null;let t=e;return t.descriptors[t.descriptors.length-1]?.suffix??null}function ut(r){let e=E(r);return e==="method"?!0:e!=="term"?!1:r.endsWith("().")?!0:r.startsWith("rust-analyzer ")&&r.includes("#")?!1:r.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(r):!0}function pn(r,e={}){if(_(r.symbol)!==null)return e.includeClassMemberFallbacks===!0;let i=(r.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(i)}function ft(r,e,t={}){let n=new Map;for(let o of e)r.length>0&&!pn(o,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||n.set(o.id,o);for(let o of r)n.set(o.id,o);let i=[...n.values()];return t.sort?i.sort((o,s)=>o.start_line-s.start_line||o.end_line-s.end_line||o.symbol.localeCompare(s.symbol)):i}var un=$("file-definitions",{clearGroups:["definition-catalog"]}),Ii=je("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),vi=$("file-function-like-definitions",{clearGroups:["definition-catalog"]});function k(r,e,t={}){return t.includeClassMemberFallbacks?mt(r,e,void 0,{includeClassMemberFallbacks:!0}):un.get(r,e,()=>{let n=fn(r,e);if(n)return n;let i=mt(r,e),o=ie(r),s=Q(r).forFile(e,{text:!0}).text;return o&&s&>.write(r,e,re(r,e,s),{projectFingerprint:o,definitions:i.map(a=>({...a}))}),i})}var gt=_e({kind:"file-definitions",invalidation:Ae("file-definitions"),serialize:mn,deserialize:hn});function fn(r,e){let t=ie(r);if(!t)return null;let n=Q(r).forFile(e,{text:!0}).text;if(!n)return null;let i=gt.read(r,e,re(r,e,n));return i?gn(i,t,e):null}function mn(r){return JSON.stringify(r)}function hn(r){try{let e=JSON.parse(r);return!se(e)||typeof e.projectFingerprint!="string"||!Array.isArray(e.definitions)?null:{projectFingerprint:e.projectFingerprint,definitions:e.definitions}}catch{return null}}function gn(r,e,t){if(r.projectFingerprint!==e)return null;let n=[];for(let i of r.definitions){let o=yn(i,t);if(!o)return null;n.push(o)}return n}function yn(r,e){return!se(r)||typeof r.symbolId!="number"||typeof r.symbol!="string"||typeof r.documentId!="number"||typeof r.startLine!="number"||typeof r.startChar!="number"&&r.startChar!==void 0||typeof r.endLine!="number"||typeof r.endChar!="number"&&r.endChar!==void 0||r.relativePath!==e||typeof r.leaf!="string"||typeof r.parentTypeName!="string"&&r.parentTypeName!==null||typeof r.isFunctionLike!="boolean"||typeof r.isTypeLike!="boolean"||typeof r.kind!="number"&&r.kind!==null||typeof r.documentation!="string"&&r.documentation!==null||typeof r.enclosingSymbol!="string"&&r.enclosingSymbol!==null?null:{symbolId:r.symbolId,symbol:r.symbol,documentId:r.documentId,startLine:r.startLine,startChar:r.startChar,endLine:r.endLine,endChar:r.endChar,relativePath:r.relativePath,leaf:r.leaf,parentTypeName:r.parentTypeName,isFunctionLike:r.isFunctionLike,isTypeLike:r.isTypeLike,kind:r.kind,documentation:r.documentation,enclosingSymbol:r.enclosingSymbol}}function mt(r,e,t,n={}){let i=ft(bn(r,e),Sn(r,e),{sort:!0,includeClassMemberFallbacks:n.includeClassMemberFallbacks}).map(xn);return t&&(i=i.filter(t)),In(r,e,i)}function bn(r,e){return r.all(`SELECT
|
|
2
|
-
gs.id,
|
|
3
|
-
gs.symbol,
|
|
4
|
-
der.document_id,
|
|
5
|
-
der.start_line,
|
|
6
|
-
der.start_char,
|
|
7
|
-
der.end_line,
|
|
8
|
-
der.end_char,
|
|
9
|
-
d.relative_path,
|
|
10
|
-
gs.display_name,
|
|
11
|
-
gs.kind,
|
|
12
|
-
gs.documentation,
|
|
13
|
-
gs.enclosing_symbol
|
|
14
|
-
FROM global_symbols gs
|
|
15
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
16
|
-
JOIN documents d ON der.document_id = d.id
|
|
17
|
-
WHERE d.relative_path = ?
|
|
18
|
-
${r.symbolNoiseFor("gs")}
|
|
19
|
-
ORDER BY der.start_line, der.end_line`,e)}function Sn(r,e){return r.all(`SELECT
|
|
20
|
-
gs.id,
|
|
21
|
-
gs.symbol,
|
|
22
|
-
c.document_id,
|
|
23
|
-
MIN(c.start_line) AS start_line,
|
|
24
|
-
0 AS start_char,
|
|
25
|
-
MAX(c.end_line) AS end_line,
|
|
26
|
-
0 AS end_char,
|
|
27
|
-
d.relative_path,
|
|
28
|
-
gs.display_name,
|
|
29
|
-
gs.kind,
|
|
30
|
-
gs.documentation,
|
|
31
|
-
gs.enclosing_symbol
|
|
32
|
-
FROM global_symbols gs
|
|
33
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
34
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
35
|
-
JOIN documents d ON c.document_id = d.id
|
|
36
|
-
WHERE d.relative_path = ?
|
|
37
|
-
AND m.role = 1
|
|
38
|
-
${r.symbolNoiseFor("gs")}
|
|
39
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
40
|
-
ORDER BY start_line, end_line`,e)}function xn(r){return{symbolId:r.id,symbol:r.symbol,documentId:r.document_id,startLine:r.start_line,startChar:r.start_char??0,endLine:r.end_line,endChar:r.end_char??0,relativePath:r.relative_path,leaf:F(r.symbol),parentTypeName:_(r.symbol),isFunctionLike:ut(r.symbol),isTypeLike:E(r.symbol)==="type",kind:r.kind??null,documentation:r.documentation??null,enclosingSymbol:r.enclosing_symbol??null}}function yt(r,e={}){return Mn(r,e.scope)}function Mn(r,e){return L(r,{scope:e,includeIgnored:!1}).flatMap(t=>k(r,t)).filter(t=>!r.isIgnored(t.relativePath))}function In(r,e,t){let n=Q(r).forFile(e,{text:!0}).text,i=Ge(r,e);return i?Dn(t,i,n):n?vn(t,n):t}function vn(r,e){let t=e.split(/\r?\n/),n=Cn(r,t),i=Pn(r,n),o=Rn(i,t);return Tn(r,o)}function Cn(r,e){let t=r.some(i=>Z(i.symbol))?jn(e):null,n=new Map;for(let i of r)n.set(i.symbolId,Ln(e,t,i));return n}function Pn(r,e){return r.filter(t=>Z(t.symbol)).map(t=>({definition:t,startLine:e.get(t.symbolId)??t.startLine})).sort((t,n)=>t.startLine-n.startLine||t.definition.startLine-n.definition.startLine||t.definition.symbol.localeCompare(n.definition.symbol))}function Rn(r,e){let t=new Map;for(let n=0;n<r.length;n+=1){let i=r[n],o=r[n+1],s=o?Math.max(i.startLine,o.startLine-1):e.length-1;t.set(i.definition.symbolId,{startLine:i.startLine,endLine:_n(e,i.definition,i.startLine,s)})}return t}function Tn(r,e){return r.map(t=>{let n=e.get(t.symbolId);return n?{...t,startLine:n.startLine,endLine:n.endLine}:t})}function Dn(r,e,t=null){let n=new Map;for(let i of e){let o=n.get(i.name);o?o.push(i):n.set(i.name,[i])}return r.map(i=>{if(!Nn(i)||!i.leaf)return ht(i,t);let o=n.get(i.leaf);if(!o||o.length===0)return ht(i,t);let s=t?Fn(i,o,t):null;if(s)return{...i,startLine:s.startLine,endLine:s.endLine};let a=o[0],c=Math.abs(a.startLine-i.startLine);for(let l=1;l<o.length;l+=1){let d=o[l],p=Math.abs(d.startLine-i.startLine);p<c&&(a=d,c=p)}return{...i,startLine:a.startLine,endLine:a.endLine}})}function Fn(r,e,t){let n=En(r.symbol);if(!n)return null;let i=t.split(/\r?\n/),o=new RegExp(`\\b${q(n)}\\b`);for(let s of e){let a=kn(i,s.startLine);if(a&&o.test(a))return s}return null}function En(r){return r.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function kn(r,e){for(let t=e;t>=0;t-=1){let n=r[t]?.trim()??"";if(n){if(/^impl\b/.test(n))return wn(r,t,e);if(/^(?:struct|enum|trait|mod)\b/.test(n))return null}}return null}function wn(r,e,t){let n=[];for(let i=e;i<=t;i+=1){let o=r[i]??"";if(n.push(o),o.includes("{"))break}return n.join(" ")}function Nn(r){return Z(r.symbol)?!0:E(r.symbol)==="term"&&_(r.symbol)===null}function ht(r,e){if(!e||!r.leaf||E(r.symbol)!=="term"||_(r.symbol)!==null)return r;let t=q(r.leaf),n=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),o=e.split(/\r?\n/).findIndex(s=>n.test(s));return o>=0?{...r,startLine:o,endLine:o}:r}function Ln(r,e,t){if(!Z(t.symbol))return t.startLine;let n=Math.max(0,Math.min(t.startLine,r.length-1));if(!e)return n;let i=e.get(t.leaf);if(!i||i.length===0)return n;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??n}function jn(r){let e=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,n=/^\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<r.length;a+=1){let c=r[a]??"";for(let d of c.matchAll(e))d[1]&&s(d[1],a);for(let d of c.matchAll(t))d[1]&&s(d[1],a);let l=c.match(n);l?.[1]&&s(l[1],a);for(let d of c.matchAll(i))d[1]&&s(d[1],a)}return o}function _n(r,e,t,n){let i=Math.max(t,Math.min(r.length-1,n)),o=Math.max(t,Math.min(i,e.endLine)),s=0,a=0,c=!1;for(let l=t;l<=i;l+=1){let d=An(r[l]??"");for(let p of d)p==="{"?(s+=1,c=!0):p==="}"?s=Math.max(0,s-1):p==="("?a+=1:p===")"&&(a=Math.max(0,a-1));if(c&&s===0||!c&&a===0&&l>=o)return l}return o}function An(r){let e="",t=null,n=!1;for(let i=0;i<r.length;i+=1){let o=r[i],s=r[i+1];if(!t&&o==="/"&&s==="/"){e+=" ".repeat(r.length-i);break}if(t){if(n){n=!1,e+=" ";continue}if(o==="\\"){n=!0,e+=" ";continue}o===t&&(t=null),e+=" ";continue}if(o==='"'||o==="'"||o==="`"){t=o,e+=" ";continue}e+=o}return e}function Z(r){return r.includes("().")}function M(r,e,t){if(r.has(e))return r.get(e);let n=t();return r.set(e,n),n}import xt from"path";import{realpathSync as bt}from"fs";function On(r,e){return r.getReferences().map(t=>{let n=t.getNode();return ee(n,e)})}function $n(r){let e=r;return typeof e.findReferences=="function"?e.findReferences():[]}function Mt(r,e,t,n){let i=[];for(let o of $n(r))for(let s of On(o,n))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||i.push(s);for(let o of t)i.push(o);return A(i)}function It(r,e,t,n){let i=[],o=t?.getStart();for(let s of r.getReferences()){let a=s.getNode();O(n,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||i.push({location:ee(a,n),node:a}))}return i}function ee(r,e){let t=r.getSourceFile(),n=t.getLineAndColumnAtPos(r.getStart());return{file:O(e,t.getFilePath())??t.getBaseName(),line:n.line-1,column:n.column-1}}function vt(r,e,t){let n=r.getSourceFile(),i=pe(n,r),o=r.getText(),s=new RegExp(`\\b${q(o)}\\b`,"g"),a=n.getFullText().split(`
|
|
41
|
-
`),c=[];for(let l=0;l<a.length;l++){if(l===i)continue;let d=a[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(d))!==null;)c.push({file:e,line:l,column:p.index})}return A(c.filter(l=>O(t,xt.join(t,l.file))===e))}function de(r){for(let e=r;e;e=e.getParent()){let t=e.getKindName();if(t.includes("Type")||t==="InterfaceDeclaration"||t==="TypeAliasDeclaration")return!0;if(t==="CallExpression"||t==="NewExpression"||t==="ExpressionStatement")return!1}return!1}function pe(r,e){return r.getLineAndColumnAtPos(e.getStart()).line-1}function A(r){let e=new Set,t=[];for(let n of r){let i=`${n.file}:${n.line}:${n.column}`;e.has(i)||(e.add(i),t.push(n))}return t}function O(r,e){let t=r||process.cwd(),n=St(t,e);if(n)return n;try{return St(bt(t),bt(e))}catch{return null}}function St(r,e){let t=xt.relative(r,e).replace(/\\/g,"/");return!t||t===".."||t.startsWith("../")?null:t}function Ct(r,e,t,n){let i=qn(e,n);return i.size===0?new Map:Bn(r,t,i)}function qn(r,e){let t=new Map;for(let n of k(r,e)){let i=F(n.symbol)??n.leaf;if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.push(n)}return t}function Bn(r,e,t){let n=new Map,i=new Map;return e.forEachDescendant(o=>{for(let s of Un(r,o)){let a=t.get(s);if(!a)continue;let c=pe(e,o);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let d=Math.abs(c-l.startLine),p=i.get(l.symbolId);p!==void 0&&p<=d||(i.set(l.symbolId,d),n.set(l.symbolId,o))}}}),n}function Un(r,e){let t=[],n=i=>{i&&!t.includes(i)&&t.push(i)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let i=e.getNameNode();n(i?.getText())}if("getName"in e&&typeof e.getName=="function"){let i=e.getName();n(i)}return r.Node.isIdentifier(e)&&n(e.getText()),t}var Hn=$("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function Pt(r,e,t,n){let i=me(r,e),o=ue(i.get(n)??[],t);if(o)return o;let s=[];for(let a of i.values())for(let c of a)((c.leaf||F(c.symbol)||"").includes(n)||c.symbol.includes(n))&&s.push(c);return ue(s,t)}function fe(r,e,t,n){return ue(me(r,e).get(n)??[],t)}function Rt(r,e){let t=new Map;for(let[n,i]of me(r,e)){let o=i[0];o&&t.set(n,o)}return t}function me(r,e){return Hn.get(r,e,()=>{let t=new Map;for(let n of k(r,e)){let i=n.leaf||F(n.symbol);if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.push({...n,leaf:i})}for(let n of t.values())n.sort((i,o)=>i.startLine-o.startLine||i.endLine-o.endLine||i.symbolId-o.symbolId);return t})}function ue(r,e){let t=null,n=Number.POSITIVE_INFINITY;for(let i of r){let o=Math.abs(i.startLine-e);(o<n||o===n&&t&&i.startLine<t.startLine)&&(t=i,n=o)}return t}import Vn from"path";import{realpathSync as Gn}from"fs";function Tt(r,e){let t=new Map,n=null,i=null,o=()=>(i??=L(r,{extensions:K}),i),s=()=>(n??=R("typescript.source-file-index",()=>Kn(r.config.projectRoot,e,o()),()=>({projects:e.length,indexedDocuments:o().length})),n),a=c=>Y(c)?M(t,c,()=>{let l=Dt(r.config.projectRoot,c);if(!l)return null;for(let{project:d,sourceFiles:p}of s()){let u=p.get(l)??null;if(u||(u=d.addSourceFileAtPathIfExists(l)??null,u&&he(p,u)),u)return{project:d,sourceFile:u}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:o}}function Kn(r,e,t){let n=e.map(({project:i})=>{let o=new Map;for(let s of i.getSourceFiles())he(o,s);return{project:i,sourceFiles:o}});for(let i of t){let o=Dt(r,i);if(o)for(let s of n){if(s.sourceFiles.has(o))break;let a=s.project.addSourceFileAtPathIfExists(o)??null;if(a){he(s.sourceFiles,a);break}}}return n}function he(r,e){let t=ge(e.getFilePath());r.set(t,e);try{r.set(ge(Gn(t)),e)}catch(n){if(!ne(n))throw n}}function Dt(r,e){try{return ge(we(r,e,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(t){if(!ne(t))throw t;return null}}function ge(r){return Vn.resolve(r)}function ye(r,e){for(let t of r)if(e===t.name||e.startsWith(`${t.name}/`))return t.name;return null}function Ft(r){let e=`${r.relativeDir}/src`;return[`${e}/index.ts`,`${e}/index.tsx`,`${e}/index.mts`,`${e}/index.cts`]}import{existsSync as B}from"fs";import S from"path";var be=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function Se(r,e){let n=e?S.dirname(S.join(r,e)):r,i=S.resolve(r);for(;n.startsWith(i);){for(let s of be){let a=S.join(n,s);if(B(a))return a}let o=S.dirname(n);if(o===n)break;n=o}for(let o of be){let s=S.join(r,o);if(B(s))return s}return null}function Et(r){let e=r.config.projectRoot,t=new Set(Yn(e,r.config.semantic?.typescript?.tsconfigs)),n=L(r,{includeIgnored:!1,extensions:K});for(let i of n){let o=Se(e,i);o&&t.add(S.resolve(o))}if(t.size===0){let i=Se(e);i&&t.add(S.resolve(i))}return[...t].filter(i=>!kt(e,i)).sort((i,o)=>i.localeCompare(o))}function Yn(r,e=[]){let t=new Set;for(let n of e){let i=S.isAbsolute(n)?n:S.join(r,n);B(i)&&t.add(S.resolve(i))}for(let n of Wn(r))for(let i of be){let o=S.join(n,i);B(o)&&t.add(S.resolve(o))}if(t.size===0){let n=Se(r);n&&t.add(S.resolve(n))}return[...t].filter(n=>!kt(r,n)).sort((n,i)=>n.localeCompare(i))}function Wn(r){let e=S.join(r,"package.json");if(!B(e))return[];let t;try{t=JSON.parse(U(e,"project package manifest"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(i=>$e(r,i))}function kt(r,e){let t=S.relative(r,e).replace(/\\/g,"/");return t.startsWith("..")||t.includes("/node_modules/")||t.startsWith("node_modules/")||t.includes("/dist/")||t.startsWith("dist/")}var zn=32;function At(r,e,t,n={}){return R("typescript.provider.construct",()=>new Me(r,e,t),()=>({tsconfigs:t.length,reusedProjects:n.reusedProjects===!0}))}var Me=class{constructor(e,t,n){this.db=e;this.tsMorph=t;this.projects=n;this.workspacePackages=Oe(e.config.projectRoot),this.sourceFiles=Tt(e,n)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return M(this.importUsageCache,e,()=>{let t=this.sourceFiles.sourceFile(e);if(!t)return[];let n=Qn();return R("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,t,n),()=>({file:e,...n}))})}referencesFor(e){return M(this.referencesCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,t)})}referencesForDefinitions(e,t={}){let n=new Map,i=V(),o=[];for(let d of e){let p=this.referencesCache.get(d.symbolId);p?n.set(d.symbolId,p):o.push(d)}if(o.length===0)return n;let s=o,a=t.exact?[]:o.filter(d=>!Nt(d));if(a.length>=zn){let d=this.referencesForDefinitionsBySymbolScan(a);for(let p of a){let u=d.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,u),n.set(p.symbolId,u)}if(s=o.filter(p=>Nt(p)),s.length===0)return n}let c=new Map;for(let d of s){let p=c.get(d.relativePath);p?p.push(d):c.set(d.relativePath,[d])}let l=[];for(let[d,p]of c){let u=Lt();R("typescript.references-map.file",()=>{let b=this.definitionNodesForFile(d);for(let h of p){i&&(u.cacheMisses+=1);let y=b.get(h.symbolId)??null;i&&(y?u.nodeHits+=1:u.nodeMisses+=1);try{let f=this.referencesForDefinitionNode(h,y,i?u:void 0);this.referencesCache.set(h.symbolId,f),n.set(h.symbolId,f)}catch{u.preciseSearchFailures+=1,l.push(h)}}},()=>({relativePath:d,definitions:p.length,...jt(u)}))}if(l.length>0){let d=this.referencesForDefinitionsBySymbolScan(l);for(let p of l){let u=d.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,u),n.set(p.symbolId,u)}}return n}referenceFragmentsForFiles(e){let t=yt(this.db).filter(o=>Y(o.relativePath)),n=e.filter(o=>this.sourceFiles.sourceFile(o)!==null),i=this.referencesForDefinitionsBySymbolScan(t,n);return Je(t,i,n)}referencesForDefinitionsBySymbolScan(e,t){let n=V(),i=Lt(),o=new Map,s=new Set(e.map(c=>c.symbolId)),a=new Map(e.map(c=>[c.symbolId,c]));for(let c of e)o.set(c.symbolId,[]);return R("typescript.references-map.inverted-scan",()=>{let c=n?m.now():0,l=t?this.packageImportReferencesForFiles(t):this.packageImportReferences();for(let f of e){let g=l.get(f.symbolId)??[];if(g.length>0){let v=o.get(f.symbolId)??[];v.push(...g),o.set(f.symbolId,v)}n&&(i.packageReferenceCount+=g.length)}n&&(i.packageRefsMs+=m.now()-c);let d=new Map,p=new Map,u=this.hierarchyTargetsForDefinitions(e),b=new Set(e.map(f=>f.leaf).filter(Boolean)),h=n?m.now():0;for(let f of t??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(f))continue;let g=this.sourceFiles.sourceFile(f);g&&(n&&(i.scanFiles+=1),this.addReferencesFromSourceFileScan(g,f,s,a,u,b,d,p,o,n?i:void 0))}n&&(i.scanMs+=m.now()-h);let y=n?m.now():0;this.addHierarchyMemberReferences(e,o,n?i:void 0),n&&(i.hierarchyMs+=m.now()-y);for(let[f,g]of o){let v=A(g);o.set(f,v),n&&(i.referenceCount+=v.length)}},()=>({definitions:e.length,...jt(i)})),o}addReferencesFromSourceFileScan(e,t,n,i,o,s,a,c,l,d){let p=this.compilerCheckerForSourceFile(e),u=e.compilerNode,b=er(e),h=y=>{if(this.tsMorph.ts.isIdentifier(y)){if(d&&(d.identifiers+=1),!s.has(y.text)&&!b.has(y.text)){this.tsMorph.ts.forEachChild(y,h);return}let f=this.compilerReferenceSymbol(p,y,d);if(f){let g;a.has(f)?g=a.get(f)??null:(g=this.referenceDefinitionFromCompilerSymbol(f),a.set(f,g)),d&&(g?d.targetHits+=1:d.targetMisses+=1);let v=M(c,f,()=>this.compilerSymbolKeys(f)),w=null,C=null,N=g&&n.has(g.symbolId)?i.get(g.symbolId):void 0;if(N&&(w=xe(u,y),!wt(N,t,w))){let T=u.getLineAndCharacterOfPosition(y.getStart(u));C={file:t,line:T.line,column:T.character};let P=l.get(N.symbolId)??[];P.push(C),l.set(N.symbolId,P),d&&(d.requestedHits+=1)}for(let T of v)for(let P of o.get(T)?.values()??[]){if(w??=xe(u,y),wt(P,t,w))continue;if(!C){let I=u.getLineAndCharacterOfPosition(y.getStart(u));C={file:t,line:I.line,column:I.character}}let x=l.get(P.symbolId)??[];x.push(C),l.set(P.symbolId,x),d&&(d.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(y,h)};h(u)}hierarchyTargetsForDefinitions(e){let t=new Map;for(let n of e){let i=this.nodeForDefinition(n),o=i?.compilerNode;if(!o||!this.isHierarchyMethod(o))continue;let s=o.parent;if(!this.isHierarchyContainer(s))continue;let a=this.compilerCheckerForSourceFile(i.getSourceFile()),c=a.getSymbolAtLocation(o.name);if(c)for(let l of this.hierarchyMemberSymbols(a,s,c))for(let d of this.compilerSymbolKeys(l)){let p=t.get(d)??new Map;p.set(n.symbolId,n),t.set(d,p)}}return t}hierarchyMemberSymbols(e,t,n){let i=new Set,o=new Set,s=(a,c,l)=>{if(!o.has(a)){o.add(a),i.add(c);for(let d of l){let p=d.getProperty(n.name);p&&s(d,p,this.hierarchyAncestorTypesForType(e,d))}}};return s(e.getTypeAtLocation(t),n,this.hierarchyAncestorTypes(e,t)),i}addHierarchyMemberReferences(e,t,n){let i=new Map;for(let o of e){let s=this.nodeForDefinition(o),a=s?.compilerNode;if(!a||!this.isHierarchyMethod(a))continue;let c=a.parent;if(!this.isHierarchyContainer(c))continue;let l=this.compilerCheckerForSourceFile(s.getSourceFile()),d=l.getSymbolAtLocation(a.name);if(!d)continue;let p=a.getSourceFile(),u=p.getLineAndCharacterOfPosition(a.name.getStart(p)),b={definition:o,location:{file:o.relativePath,line:u.line,column:u.character}},h=t.get(o.symbolId)??[];for(let f of this.hierarchyMemberSymbols(l,c,d))if(f!==d)for(let g of this.compilerSymbolLocations(f))h.push(g),n&&(n.hierarchyReferences+=1);t.set(o.symbolId,h);let y=this.hierarchyRootMemberSymbols(l,c,d);for(let f of y){let g=i.get(f)??new Map;g.set(o.symbolId,b),i.set(f,g)}n&&(n.hierarchyDefinitions+=1)}for(let o of i.values())if(!(o.size<2)){n&&(n.hierarchyFamilies+=1);for(let{definition:s}of o.values()){let a=t.get(s.symbolId)??[];for(let c of o.values())c.definition.symbolId!==s.symbolId&&(a.push(c.location),n&&(n.hierarchyReferences+=1));t.set(s.symbolId,a)}}}hierarchyRootMemberSymbols(e,t,n){let i=new Set,o=new Set,s=(a,c,l)=>{if(o.has(a))return;o.add(a);let d=!1;for(let p of l){let u=p.getProperty(n.name);u&&(d=!0,s(p,u,this.hierarchyAncestorTypesForType(e,p)))}if(!d)for(let p of this.compilerSymbolKeys(c))i.add(p)};return s(e.getTypeAtLocation(t),n,this.hierarchyAncestorTypes(e,t)),i}compilerSymbolKeys(e){return(e.declarations??[]).map(t=>{let n=t.getSourceFile();return`${n.fileName}\0${t.getStart(n)}\0${e.name}`})}compilerSymbolLocations(e){let t=[];for(let n of e.declarations??[]){let i=n.getSourceFile(),o=O(this.db.config.projectRoot,i.fileName);if(!o)continue;let s=n.name,a=i.getLineAndCharacterOfPosition((s??n).getStart(i));t.push({file:o,line:a.line,column:a.character})}return t}baseTypes(e,t){try{return e.getBaseTypes(t)??[]}catch{return[]}}hierarchyAncestorTypes(e,t){let n=new Set(this.hierarchyAncestorTypesForType(e,e.getTypeAtLocation(t)));for(let i of t.heritageClauses??[])for(let o of i.types)n.add(e.getTypeAtLocation(o));return[...n]}hierarchyAncestorTypesForType(e,t){let n=new Set(this.baseTypes(e,t));for(let i of t.getSymbol()?.declarations??[])if(this.isHierarchyContainer(i))for(let o of i.heritageClauses??[])for(let s of o.types)n.add(e.getTypeAtLocation(s));return[...n]}isHierarchyMethod(e){return this.tsMorph.ts.isMethodDeclaration(e)||this.tsMorph.ts.isMethodSignature(e)}isHierarchyContainer(e){return this.tsMorph.ts.isClassDeclaration(e)||this.tsMorph.ts.isClassExpression(e)||this.tsMorph.ts.isInterfaceDeclaration(e)}compilerReferenceSymbol(e,t,n){n&&(n.symbolLookups+=1);let i=e.getSymbolAtLocation(t);if(i){if((i.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return i;try{return n&&(n.aliasResolutions+=1),e.getAliasedSymbol(i)}catch{return i}}}calleesFor(e){return M(this.calleesCache,e.symbolId,()=>M(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}calleesForDefinitions(e){let t=new Map,n=new Map;for(let i of e){let o=n.get(i.relativePath);o?o.push(i):n.set(i.relativePath,[i])}for(let[i,o]of n){let s=this.fileCalleesCache.get(i),a=new Set(o.map(l=>l.symbolId)),c=s??this.calleeMapForFile(i,a);for(let l of o){let d=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,d),t.set(l.symbolId,d)}}return t}referencesForDefinitionNode(e,t,n){let i=n?m.now():0,o=this.packageImportReferencesForDefinition(e);if(n&&(n.packageRefsMs+=m.now()-i,n.packageReferenceCount+=o.length),!t)return o;let s=n?m.now():0,a=Mt(t,e,o,this.db.config.projectRoot);return n&&(n.semanticRefsMs+=m.now()-s,n.referenceCount+=a.length),a}signatureFor(e){return M(this.signatureCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);if(!t||!this.tsMorph.Node.isFunctionDeclaration(t)&&!this.tsMorph.Node.isMethodDeclaration(t)&&!this.tsMorph.Node.isArrowFunction(t)&&!this.tsMorph.Node.isFunctionExpression(t)&&!this.tsMorph.Node.isConstructorDeclaration(t))return null;let n=t.getType().getCallSignatures()[0];if(!n)return null;let i=n.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return _t(c)}),o=n.getReturnType().getText(t);return`(${i.join(",")})=>${_t(o)}`})}importUsageForSourceFile(e,t,n){let i=[],o=new Map;for(let s of t.getImportDeclarations()){n.declarations+=1;let a=oe(this.db,e,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let l of Ie(s)){n.entries+=1;let d=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(d?n.bindingSymbols+=1:n.missingBindingSymbols+=1);let p={sourcePath:a,entry:l,typeOnlyDeclaration:c,bindingSymbol:d,references:[]};if(i.push(p),c||!l.localName||!d)continue;let u=o.get(l.localName);u?u.push(p):o.set(l.localName,[p])}}return o.size>0&&t.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=o.get(s.getText());if(!a||Xn(s))return;n.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(n.symbolLookups+=1,!!c){for(let l of a)if(l.bindingSymbol===c){l.references.push({location:ee(s,this.db.config.projectRoot),node:s}),n.matchedReferences+=1;break}}}),i.map(s=>s.typeOnlyDeclaration?Jn(e,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(n.fallbackEntries+=1,this.valueImportUsageForEntry(e,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(e,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(e,t,n){let i=n.identifier?n.identifier.findReferences():[],o=[];for(let s of i)for(let a of It(s,e,n.identifier,this.db.config.projectRoot))o.push(a);return this.valueImportUsageFromLocations(e,t,n,o)}valueImportUsageFromLocations(e,t,n,i){let o=i.some(c=>!de(c.node)),s=i.some(c=>de(c.node)),a=n.isTypeOnly;return{importer:e,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:a,isUsed:a||i.length>0,isTypeUsed:a||s,isValueUsed:o,references:i.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferencesForFiles(e){let t=new Map,n=new Set;for(let o of e){let s=this.sourceFiles.sourceFile(o);if(s)for(let a of s.getImportDeclarations()){let c=ye(this.workspacePackages,a.getModuleSpecifierValue());c&&n.add(c)}}if(n.size===0)return t;let i=this.packageExportsForNames(n);for(let o of e)this.addPackageImportReferencesForDocument(t,i,o);for(let[o,s]of t)t.set(o,A(s));return t}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,t=this.packageExports();for(let n of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,t,n);for(let[n,i]of e)e.set(n,A(i));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,t,n){if(this.db.isIgnored(n))return;let i=this.sourceFiles.sourceFileMatch(n);if(i)for(let o of i.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,t,n,o)}addPackageImportReferencesForDeclaration(e,t,n,i){let o=ye(this.workspacePackages,i.getModuleSpecifierValue());if(!o)return;let s=t.get(o);if(s)for(let a of Ie(i)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=vt(a.identifier,n,this.db.config.projectRoot);l.length>0&&ir(e,c,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(e=>e.name))),this.packageExportIndex)}packageExportsForNames(e){let t=new Map;for(let n of this.workspacePackages){if(!e.has(n.name))continue;let i=new Map;for(let o of Ft(n))this.collectPackageExports(n,o,i,new Set);i.size>0&&t.set(n.name,i)}return t}collectPackageExports(e,t,n,i){if(i.has(t))return;i.add(t);let o=this.sourceFiles.sourceFile(t);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?oe(this.db,t,a):t;if(!c||!c.startsWith(`${e.relativeDir}/src/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,n,i);continue}for(let d of l){let p=d.getNameNode().getText(),u=d.getAliasNode()?.getText()??p,b=this.indexedDefinitionByLeaf(c,p);if(!b)continue;let h=n.get(u);h||(h=new Set,n.set(u,h)),h.add(b.symbolId)}}}indexedDefinitionByLeaf(e,t){return M(this.indexedDefinitionLeafCache,e,()=>Rt(this.db,e)).get(t)??null}nodeForDefinition(e){return M(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return M(this.fileDefinitionNodeCache,e,()=>{let t=this.sourceFiles.sourceFile(e);return t?Ct(this.tsMorph,this.db,t,e):new Map})}referenceDefinitionFromCompilerSymbol(e){return this.definitionFromCompilerSymbol(e,void 0,!0)}definitionFromCompilerSymbol(e,t,n=!1){let i=e.name,o=t?m.now():0,s=e.declarations??[];t&&(t.declarationsMs+=m.now()-o,t.declarationChecks+=s.length);for(let a of s){let c=t?m.now():0,l=a.getSourceFile(),d=O(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(a.getStart(l)).line;if(t&&(t.declarationLocationMs+=m.now()-c),!d||this.db.isIgnored(d))continue;let u=t?m.now():0,b=this.compilerDeclarationName(a),h=n?fe(this.db,d,p,i)??(b&&b!==i?fe(this.db,d,p,b):null):Pt(this.db,d,p,i);if(t&&(t.indexedLookupMs+=m.now()-u),h)return{symbolId:h.symbolId,symbol:h.symbol,file:h.relativePath,line:h.startLine}}return null}compilerDeclarationName(e){let t=e.name;return t&&this.tsMorph.ts.isIdentifier(t)?t.text:null}calleeMapForFile(e,t){let n=V(),i=0,o=0,s=0,a=0,c=0,l=0,d=0,p=0,u=n?nr():void 0;return R("typescript.callee-map.file",()=>{let b=n?m.now():0,h=this.sourceFiles.sourceFile(e);if(n&&(c=Math.round(m.now()-b)),!h)return new Map;let y=n?m.now():0,f=k(this.db,e).sort((x,I)=>x.startLine-I.startLine||I.endLine-x.endLine);if(n&&(l=Math.round(m.now()-y)),i=f.length,f.length===0)return new Map;let g=new Map,v=n?m.now():0,w=this.compilerCheckerForSourceFile(h),C=h.compilerNode;n&&(d=Math.round(m.now()-v));let N=new Map,T=x=>{if(this.tsMorph.ts.isCallExpression(x)||this.tsMorph.ts.isNewExpression(x)){n&&(o+=1);let I=this.semanticCalleeForCallNode(w,C,f,x,N,t,u);I&&(n&&(s+=1),Zn(g,I.callerId,I.target))}this.tsMorph.ts.forEachChild(x,T)},P=n?m.now():0;T(C),n&&(p=Math.round(m.now()-P));for(let[x,I]of g)g.set(x,or(I));return a=g.size,g},()=>({relativePath:e,definitions:i,callNodes:o,resolvedCallees:s,outputRows:a,requestedDefinitions:t?.size??i,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:d,traversalMs:p,...u?rr(u):{}}))}semanticCalleeForCallNode(e,t,n,i,o,s,a){let c=a?m.now():0,l=tr(n,xe(t,i));if(a&&(a.callerLookupMs+=m.now()-c),!l)return null;if(s&&!s.has(l.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let d=i.expression,p=this.compilerSymbolForExpression(e,d,a),u=null;if(p)if(a&&(a.targetSymbolHits+=1),o.has(p))a&&(a.compilerSymbolCacheHits+=1),u=o.get(p)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let b=a?m.now():0;u=this.definitionFromCompilerSymbol(p,a),a&&(a.targetLookupMs+=m.now()-b),o.set(p,u)}else a&&(a.targetMisses+=1);return u?{callerId:l.symbolId,target:{symbol:u.symbol,file:u.file,line:u.line}}:null}compilerSymbolForExpression(e,t,n){let i=n?m.now():0,o=e.getSymbolAtLocation(t);if(n&&(n.expressionSymbolMs+=m.now()-i),o)return o;n&&(n.typeFallbacks+=1);let s=n?m.now():0,a=e.getTypeAtLocation(t).getSymbol();return n&&(n.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(e){let t=e.getProject(),n=this.compilerCheckerCache.get(t);return n||(n=t.getTypeChecker().compilerObject,this.compilerCheckerCache.set(t,n)),n}};function Ie(r){let e=[],t=r.getDefaultImport();t&&e.push({identifier:t,importedName:"default",localName:t.getText(),kind:"default",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});let n=r.getNamespaceImport();n&&e.push({identifier:n,importedName:"*",localName:n.getText(),kind:"namespace",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});for(let i of r.getNamedImports()){let o=i.getNameNode(),a=i.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(r.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Jn(r,e,t){return{importer:r,sourcePath:e,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Qn(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function Xn(r){for(let e=r;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function Zn(r,e,t){let n=r.get(e);n||(n=[],r.set(e,n)),n.push(t)}function er(r){let e=new Set;for(let t of r.getImportDeclarations())for(let n of Ie(t))n.localName&&e.add(n.localName);return e}function tr(r,e){let t=null;for(let n of r)e<n.startLine||e>n.endLine||(!t||n.startLine>=t.startLine)&&(t=n);return t}function xe(r,e){return r.getLineAndCharacterOfPosition(e.getStart(r)).line}function wt(r,e,t){return e===r.relativePath&&t>=r.startLine&&t<=r.endLine}function Nt(r){return r.symbol.includes("#")?E(r.symbol)==="type"&&r.relativePath.endsWith(".d.ts"):!1}function nr(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function rr(r){return{...r,callerLookupMs:Math.round(r.callerLookupMs),expressionSymbolMs:Math.round(r.expressionSymbolMs),typeSymbolMs:Math.round(r.typeSymbolMs),targetLookupMs:Math.round(r.targetLookupMs),declarationsMs:Math.round(r.declarationsMs),declarationLocationMs:Math.round(r.declarationLocationMs),indexedLookupMs:Math.round(r.indexedLookupMs)}}function Lt(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}function jt(r){return{...r,scanMs:Math.round(r.scanMs),packageRefsMs:Math.round(r.packageRefsMs),semanticRefsMs:Math.round(r.semanticRefsMs),hierarchyMs:Math.round(r.hierarchyMs)}}function ir(r,e,t){for(let n of e){let i=r.get(n)??[];i.push(...t),r.set(n,i)}}function or(r){let e=new Set,t=[];for(let n of r){let i=`${n.symbol}|${n.file}|${n.line}`;e.has(i)||(e.add(i),t.push(n))}return t}function _t(r){return r.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var te=class{loadModule;discoverTsconfigs;createProjects;createProvider;db;module=null;projects=null;provider=null;stats={providerRequests:0,sessionsCreated:0,sessionsReused:0,sessionsRefreshed:0,sessionsReplaced:0,projectsCreated:0};constructor(e,t={}){this.db=e,this.loadModule=t.loadModule??We,this.discoverTsconfigs=t.discoverTsconfigs??Et,this.createProjects=t.createProjects??ze,this.createProvider=t.createProvider??((n,i,o)=>At(n,i,o,{reusedProjects:!0}))}semanticProvider(){return this.stats.providerRequests+=1,this.provider?(this.stats.sessionsReused+=1,this.provider):this.createSession()}advanceGeneration(e,t){let n=sr(t);return this.provider?.dispose?.(),this.provider=null,this.db=e,this.projects?n.mode==="replace"?(this.projects=null,this.module=null,this.stats.sessionsReplaced+=1,n):(n.mode==="refresh"&&(ar(this.projects,e.config.projectRoot,n),this.stats.sessionsRefreshed+=1),n):n}snapshotStats(){return{...this.stats}}dispose(){this.provider?.dispose?.(),this.provider=null,this.projects=null,this.module=null}createSession(){let e=this.module??this.loadModule();if(!e)return this.provider=ae("ts-morph is not installed"),this.provider;if(this.module=e,!this.projects){let t=this.discoverTsconfigs(this.db);if(t.length===0)return this.provider=ae("no tsconfig found"),this.provider;this.projects=this.createProjects(e,t),this.stats.projectsCreated+=this.projects.length}return this.provider=this.createProvider(this.db,e,this.projects),this.stats.sessionsCreated+=1,this.provider}};function sr(r){let e=new Set;r.projectIdentityChanged&&e.add("project-identity-changed");for(let o of r.uncertainty)e.add(o);for(let o of r.changes)o.inputKind!=="source"&&e.add(`${o.inputKind}-input-changed`);if(e.size>0)return{mode:"replace",addedFiles:[],modifiedFiles:[],deletedFiles:[],reasons:[...e].sort()};let t=ve(r.changes,"added"),n=ve(r.changes,"modified"),i=ve(r.changes,"deleted");return{mode:t.length+n.length+i.length===0?"reuse":"refresh",addedFiles:t,modifiedFiles:n,deletedFiles:i,reasons:[]}}function ve(r,e){return r.filter(t=>t.kind===e).map(t=>t.path).sort()}function ar(r,e,t){for(let n of r){for(let i of t.deletedFiles)n.project.getSourceFile(Ot(e,i))?.forget();for(let i of t.modifiedFiles){let o=n.project.getSourceFile(Ot(e,i));o&&o.refreshFromFileSystemSync()}t.addedFiles.length>0&&n.project.addSourceFilesFromTsConfig(n.tsconfigPath)}}var $t=class{openDb;createHost;generationIdentity;readSnapshot;now;db=null;host=null;generation=null;snapshot=null;requests=0;lastRequestAtMs=null;lastError=null;available=null;constructor(e){this.openDb=e.openDb,this.createHost=e.createHost??(t=>new te(t)),this.generationIdentity=e.generationIdentity?t=>e.generationIdentity(t.config.dbPath):t=>t.generation.identity,this.readSnapshot=e.readSnapshot?t=>e.readSnapshot(t.config.dbPath):pr,this.now=e.now??Date.now}handle(e,t){try{this.syncGeneration(e);let n=this.host.semanticProvider();switch(this.available=n.availability().available,this.requests+=1,this.lastRequestAtMs=this.now(),this.lastError=null,t.kind){case"availability":return n.availability();case"import-usage":return n.importUsage(t.file);case"references":return[...lr(n,t.definitions,{exact:t.exact===!0})];case"reference-fragments":if(!n.referenceFragmentsForFiles)throw new Error("TypeScript provider does not support reference fragments.");return[...n.referenceFragmentsForFiles(t.files)];case"callees":return[...dr(n,t.definitions)];case"signature":return n.signatureFor(t.definition);default:return fr(t)}}catch(n){throw this.lastError=n instanceof Error?n.message:String(n),n}}status(e){let t=this.host?.snapshotStats();return{protocolVersion:J,state:this.lastError?"error":this.host?this.available?"ready":"unavailable":"idle",requests:this.requests,...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastError?{lastError:this.lastError}:{},sessionsCreated:t?.sessionsCreated??0,sessionsReused:t?.sessionsReused??0,sessionsRefreshed:t?.sessionsRefreshed??0,sessionsReplaced:t?.sessionsReplaced??0,projectsCreated:t?.projectsCreated??0,...e?{mailbox:e}:{}}}closeTypeScriptService(){this.host?.dispose(),this.db?.close(),this.host=null,this.db=null,this.generation=null,this.snapshot=null,this.available=null}syncGeneration(e){if(this.generation===e&&this.host&&this.db)return;let t=this.openDb(),n=this.generationIdentity(t);if(!n||n!==e)throw t.close(),new Error("TypeScript semantic request does not match the currently published index generation.");let i=this.readSnapshot(t);if(!this.host||!this.db)this.db=t,this.host=this.createHost(t);else{let o=this.db;this.host.advanceGeneration(t,ur(this.snapshot,i)),this.db=t,o.close()}this.generation=n,this.snapshot=i,this.available=null}};function Do(r){W(r)}function lr(r,e,t){return r.referencesForDefinitions?.(e,t)??new Map(e.map(n=>[n.symbolId,r.referencesFor(n)]))}function dr(r,e){return r.calleesForDefinitions?.(e)??new Map(e.map(t=>[t.symbolId,r.calleesFor(t)]))}function pr(r){if(!r.generation.metadataRaw)return null;let e=H(r.generation.metadataRaw);return e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache?null:Re(e.metadata.fingerprint)}function ur(r,e){return e?Te(r,e):{version:1,changes:[],projectIdentityChanged:!0,uncertainty:["prior-snapshot-unavailable"]}}function fr(r){throw new Error(`Unhandled TypeScript semantic request: ${JSON.stringify(r)}`)}var Fo=`typescript-semantic-${process.pid}-${cr()}`,qt=G(process.pid),Eo={pid:process.pid,...qt?{processIdentity:qt}:{}};export{rt as a,Ir as b,Or as c,$r as d,Yr as e,J as f,ei as g,ti as h,an as i,$t as j,Do as k};
|
|
42
|
-
//# sourceMappingURL=chunk-DAFAHMNB.js.map
|
package/dist/chunk-DQLPXMH6.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as w}from"./chunk-ILMHV3KM.js";import{a as $,b as M}from"./chunk-SMNXQT5Z.js";import{a as N,b as _}from"./chunk-IZYYAFN5.js";import{j as H,l as b,m as S}from"./chunk-WUPW3UN3.js";import{a as d}from"./chunk-MNE7YG56.js";import m from"process";import{existsSync as Oe}from"fs";import{dirname as B,join as Be,resolve as j,sep as je}from"path";import{fileURLToPath as qe}from"url";import{spawn as fe}from"child_process";import{platform as U}from"os";var c=class extends Error{},p=class extends Error{},L=class extends Error{constructor(r,n,i){super(`rust-analyzer LSP request ${n} failed: ${i}`);this.code=r}code},de=3e4,me=16*1024,pe=64*1024*1024,J=64*1024,K=256*1024*1024,g=Buffer.from(`\r
|
|
2
|
-
\r
|
|
3
|
-
`,"ascii"),P=class{constructor(e,r={}){this.transport=e;this.requestTimeoutMs=r.requestTimeoutMs??de,this.configuration=r.configuration??{};let n=he(r.maxHeaderBytes,r.maxMessageBytes);this.maxHeaderBytes=n.maxHeaderBytes,this.maxMessageBytes=n.maxMessageBytes,this.monotonicNow=r.monotonicNow??d,this.headerBuffer=Buffer.allocUnsafe(this.maxHeaderBytes+g.length),this.transport.onData(i=>this.handleData(i)),this.transport.onClose((i,s)=>this.failTransport(new Error(Le(i,s)),!1)),this.transport.onError(i=>this.failTransport(i,!0))}transport;nextId=1;pending=new Map;diagnosedUris=new Set;diagnosticWaiters=new Map;readinessWaiters=new Set;requestTimeoutMs;configuration;maxHeaderBytes;maxMessageBytes;monotonicNow;headerBuffer;headerLength=0;bodyBuffer=null;bodyLength=0;transportFailure=null;transportKilled=!1;transportKillPromise=null;currentServerStatusGeneration=0;latestServerStatus=null;shutdownStarted=!1;async initialize(e,r={}){let n=e.capabilities??{},i=n.experimental&&typeof n.experimental=="object"&&!Array.isArray(n.experimental)?n.experimental:{},s=await this.request("initialize",{...e,capabilities:{...n,experimental:{...i,serverStatusNotification:!0}}},r);return this.notify("initialized",{}),s}async references(e,r={}){let n=await this.request("textDocument/references",e,r);return Array.isArray(n)?n:[]}async definition(e,r={}){let n=await this.request("textDocument/definition",e,r);return we(n)}async prepareCallHierarchy(e,r={}){let n=await this.request("textDocument/prepareCallHierarchy",e,r);return Array.isArray(n)?n:[]}async outgoingCalls(e,r={}){let n=await this.request("callHierarchy/outgoingCalls",{item:e},r);return Array.isArray(n)?n:[]}async hover(e,r={}){let n=await this.request("textDocument/hover",e,r);return n&&typeof n=="object"?n:null}async readinessBarrier(e={}){try{await this.request("scip-query/readinessBarrier",null,e)}catch(r){if(r instanceof L&&r.code===-32601)return;throw r}}serverStatusGeneration(){return this.currentServerStatusGeneration}serverStatusSnapshot(){let e=this.latestServerStatus;return e?{generation:e.generation,status:{...e.status}}:null}waitForQuiescence(e,r){if(this.transportFailure)return Promise.reject(this.transportFailure);let n=this.latestServerStatus;if(n&&n.generation>e){if(n.status.health==="error")return Promise.reject(G());if(n.status.quiescent)return Promise.resolve(n.status)}return new Promise((i,s)=>{let o={afterGeneration:e,resolve:i,reject:s,timeout:setTimeout(()=>{this.readinessWaiters.delete(o),s(new Error(`rust-analyzer readiness timed out after ${r}ms`))},r)};this.readinessWaiters.add(o)})}didOpenTextDocument(e){this.notify("textDocument/didOpen",{textDocument:e})}waitForDiagnostics(e,r){return this.transportFailure?Promise.resolve(!1):this.diagnosedUris.has(e)?Promise.resolve(!0):new Promise(n=>{let i=u=>{clearTimeout(s),n(u)},s=setTimeout(()=>{let u=this.diagnosticWaiters.get(e)?.filter(l=>l!==i);u&&u.length>0?this.diagnosticWaiters.set(e,u):this.diagnosticWaiters.delete(e),n(!1)},r),o=this.diagnosticWaiters.get(e)??[];o.push(i),this.diagnosticWaiters.set(e,o)})}async shutdown(e={}){if(!this.shutdownStarted){this.shutdownStarted=!0;try{await this.request("shutdown",null,e),this.notify("exit",null)}catch(r){throw this.notify("exit",null),this.killTransportOnce(),r}}}async shutdownAndReap(e={}){let r;try{await this.shutdown(e)}catch(n){r=n}try{await this.killTransportOnce()}catch(n){throw new Error(`rust-analyzer process-tree cleanup failed: ${n instanceof Error?n.message:String(n)}`,{cause:n})}if(r)throw r}request(e,r,n={}){if(this.transportFailure)return Promise.reject(this.transportFailure);let i=z(n.timeoutMs??this.requestTimeoutMs,n.deadlineMs,this.monotonicNow),s=this.nextId++,o={jsonrpc:"2.0",id:s,method:e,params:r};return new Promise((u,l)=>{let f=setTimeout(()=>{let y=i.deadlineLimited?new c(`rust-analyzer readiness deadline expired during LSP request ${e}`):new Error(`rust-analyzer LSP request ${e} timed out after ${i.timeoutMs}ms`);this.cancelAndFailTimedOutRequest(s,y)},i.timeoutMs);this.pending.set(s,{method:e,deadlineMs:n.deadlineMs,resolve:y=>u(y),reject:l,timeout:f}),this.transport.write(v(o))})}notify(e,r){this.transportFailure||this.transport.write(v({jsonrpc:"2.0",method:e,params:r}))}handleData(e){if(this.transportFailure||e.length===0)return;let r=0;for(;r<e.length&&!this.transportFailure;){if(this.bodyBuffer){let o=Math.min(e.length-r,this.bodyBuffer.length-this.bodyLength);if(e.copy(this.bodyBuffer,this.bodyLength,r,r+o),r+=o,this.bodyLength+=o,this.bodyLength===this.bodyBuffer.length){let u=this.bodyBuffer.toString("utf8");this.bodyBuffer=null,this.bodyLength=0;let l;try{l=ve(u)}catch{this.failProtocol("rust-analyzer LSP response body was not a valid JSON object");continue}try{this.dispatchMessage(l)}catch{this.failTransport(new Error("rust-analyzer LSP message handling failed"),!0)}}continue}if(this.headerLength===this.headerBuffer.length){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}if(this.headerBuffer[this.headerLength++]=e[r++],!this.headerDelimiterComplete())continue;let n=this.headerLength-g.length;if(n>this.maxHeaderBytes){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}let i=this.headerBuffer.subarray(0,n).toString("ascii");this.headerLength=0;let s;try{s=ye(i,this.maxMessageBytes)}catch(o){this.failProtocol(o instanceof Error?o.message:String(o));return}this.bodyBuffer=Buffer.allocUnsafe(s),this.bodyLength=0,s===0&&(this.bodyBuffer=null,this.failProtocol("rust-analyzer LSP response body was not a valid JSON object"))}}headerDelimiterComplete(){if(this.headerLength<g.length)return!1;let e=this.headerLength-g.length;return this.headerBuffer.subarray(e,this.headerLength).equals(g)}failProtocol(e){this.failTransport(new p(e),!0)}failTransport(e,r){this.transportFailure||(this.transportFailure=e,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0,r&&this.killTransportOnce().catch(()=>{}),this.rejectPending(e),this.resolveDiagnosticWaiters(!1))}killTransportOnce(){return this.transportKilled?this.transportKillPromise??Promise.resolve():(this.transportKilled=!0,this.transportKillPromise=Promise.resolve(this.transport.kill()),this.transportKillPromise)}async cancelAndFailTimedOutRequest(e,r){let n=this.pending.get(e);if(!n)return;this.pending.delete(e);try{this.transport.write(v({jsonrpc:"2.0",method:"$/cancelRequest",params:{id:e}}))}catch{}this.transportFailure||(this.transportFailure=r,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0);let i=r;try{await this.killTransportOnce()}catch(s){i=new Error(`${r.message}; rust-analyzer cleanup failed: ${s instanceof Error?s.message:String(s)}`,{cause:s})}n.reject(i),this.rejectPending(i),this.resolveDiagnosticWaiters(!1)}dispatchMessage(e){if(this.recordDiagnosticNotification(e),this.recordServerStatusNotification(e),e.id!==void 0&&e.id!==null&&e.method){this.respondToServerRequest(e);return}if(e.id===void 0||e.id===null)return;let r=this.pending.get(e.id);if(r){if(clearTimeout(r.timeout),this.pending.delete(e.id),e.error){r.reject(new L(e.error.code,r.method,e.error.message));return}if(r.deadlineMs!==void 0&&this.monotonicNow()>=r.deadlineMs){r.reject(new c(`rust-analyzer readiness deadline expired during LSP request ${r.method}`));return}r.resolve(e.result)}}recordDiagnosticNotification(e){if(e.method!=="textDocument/publishDiagnostics")return;let r=e.params,n=r&&typeof r=="object"&&typeof r.uri=="string"?r.uri:null;if(!n)return;this.diagnosedUris.add(n);let i=this.diagnosticWaiters.get(n)??[];this.diagnosticWaiters.delete(n),i.forEach(s=>s(!0))}recordServerStatusNotification(e){if(e.method!=="experimental/serverStatus"||e.id!==void 0||!ge(e.params))return;let r=e.params,n={health:r.health,quiescent:r.quiescent,...typeof r.message=="string"?{message:r.message}:{}},i=++this.currentServerStatusGeneration;if(this.latestServerStatus={generation:i,status:n},n.health==="error"){this.rejectReadinessWaiters(G());return}if(n.quiescent)for(let s of this.readinessWaiters)i<=s.afterGeneration||(clearTimeout(s.timeout),this.readinessWaiters.delete(s),s.resolve(n))}respondToServerRequest(e){if(e.id===void 0||e.id===null||!e.method)return;let r=e.method==="workspace/configuration"?this.workspaceConfiguration(e.params):null;this.transport.write(v({jsonrpc:"2.0",id:e.id,result:r}))}workspaceConfiguration(e){return(e&&typeof e=="object"&&Array.isArray(e.items)?e.items:[]).map(n=>typeof n.section=="string"?Re(this.configuration,n.section):this.configuration)}rejectPending(e){for(let[r,n]of this.pending)clearTimeout(n.timeout),n.reject(e),this.pending.delete(r);this.rejectReadinessWaiters(e)}resolveDiagnosticWaiters(e){for(let r of this.diagnosticWaiters.values())r.forEach(n=>n(e));this.diagnosticWaiters.clear()}rejectReadinessWaiters(e){for(let r of this.readinessWaiters)clearTimeout(r.timeout),r.reject(e),this.readinessWaiters.delete(r)}};function he(t=me,e=pe){if(!Number.isSafeInteger(t)||t<=0)throw new TypeError("maxHeaderBytes must be a positive safe integer.");if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxMessageBytes must be a positive safe integer.");if(t>J)throw new RangeError(`maxHeaderBytes cannot exceed ${J} bytes for rust-analyzer LSP.`);if(t+g.length+e>K)throw new RangeError(`Combined rust-analyzer LSP header and message limits cannot exceed ${K} bytes.`);return{maxHeaderBytes:t,maxMessageBytes:e}}function ye(t,e){let r=[];for(let s of t.split(`\r
|
|
4
|
-
`)){let o=s.indexOf(":");o<0||s.slice(0,o).trim().toLowerCase()!=="content-length"||r.push(s.slice(o+1).trim())}if(r.length===0)throw new p("rust-analyzer LSP response missing Content-Length header");if(r.length>1){let s=new Set(r).size>1?"rust-analyzer LSP response has conflicting Content-Length headers":"rust-analyzer LSP response has duplicate Content-Length headers";throw new p(s)}let n=r[0];if(!/^\d+$/.test(n))throw new p("rust-analyzer LSP Content-Length must be a non-negative safe integer");let i=Number(n);if(!Number.isSafeInteger(i))throw new p("rust-analyzer LSP Content-Length must be a non-negative safe integer");if(i>e)throw new p(`rust-analyzer LSP Content-Length exceeds ${e} byte message limit`);return i}function z(t,e,r=d){if(e===void 0)return{timeoutMs:t,deadlineLimited:!1};let n=e-r();if(n<=0)throw new c("rust-analyzer readiness deadline expired before LSP operation");return{timeoutMs:Math.min(t,n),deadlineLimited:n<=t}}function ge(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return(e.health==="ok"||e.health==="warning"||e.health==="error")&&typeof e.quiescent=="boolean"&&(e.message===void 0||e.message===null||typeof e.message=="string")}function G(){return new c("rust-analyzer reported error health before reaching readiness")}function Re(t,e){let r=e.startsWith("rust-analyzer.")?e.slice(14):e;if(r===""||r==="rust-analyzer")return t;let n=t;for(let i of r.split(".")){if(!n||typeof n!="object")return null;n=n[i]}return n??null}function we(t){return t?(Array.isArray(t)?t:[t]).flatMap(r=>be(r)?[r]:Se(r)?[{uri:r.targetUri,range:r.targetSelectionRange}]:[]):[]}function be(t){return!!(t&&typeof t=="object"&&typeof t.uri=="string")}function Se(t){return!!(t&&typeof t=="object"&&typeof t.targetUri=="string")}function Y(t,e,r=process.env,n){let i=fe(t,[],{cwd:e,env:r,detached:U()!=="win32",stdio:["pipe","pipe","pipe"]}),s=i.pid===void 0?null:N(i.pid,U()!=="win32"),o=s?$(n,s):null,u=null;return i.on("close",()=>M(o)),{write(l){i.stdin.write(l)},onData(l){i.stdout.on("data",l)},onClose(l){i.on("close",l)},onError(l){i.on("error",l)},kill(){if(!s){i.kill();return}return u??=_(s,{gracefulMs:1e3,forceMs:1e3}).then(l=>{if(!l.reaped)throw new Error(l.detail??`rust-analyzer process tree ${s.rootPid} was not reaped.`);M(o)}),u}}}function v(t){let e=JSON.stringify(t);return`Content-Length: ${Buffer.byteLength(e,"utf8")}\r
|
|
5
|
-
\r
|
|
6
|
-
${e}`}function ve(t){let e=JSON.parse(t);if(!e||typeof e!="object")throw new Error("rust-analyzer LSP response was not a JSON object");return e}function Le(t,e){return`rust-analyzer LSP transport closed${e?` by ${e}`:t===null?"":` with code ${t}`}`}async function Z(t,e,r,n=d){let i=r-n();if(i<=0)throw new c("rust-analyzer readiness deadline expired before quiescence");try{let s=await t.waitForQuiescence(e,i);if(x(r,n,"during quiescence"),s.health==="error")throw new c("rust-analyzer reported error health before reaching readiness");if(!s.quiescent)throw new c("rust-analyzer did not report quiescence before reaching readiness");return s}catch(s){throw s instanceof c?s:new c(s instanceof Error?s.message:String(s))}}async function ht(t,e,r,n,i,s=d,o=k){let u=await Z(t,e,n,s);if(r===0)return u;let l=t.serverStatusSnapshot();if(!l)throw new c("rust-analyzer status is unavailable after initial document open");return await Pe(t,l,r,n,i,s,o)??u}async function Pe(t,e,r,n,i,s=d,o=k){if(r===0)return null;if(!e)throw new c("rust-analyzer status is unavailable before document open");Q(e.status,"before document open");try{await t.readinessBarrier({deadlineMs:n}),x(n,s,"during post-open synchronization")}catch(f){throw f instanceof c?f:new c(f instanceof Error?f.message:String(f))}let u=t.serverStatusSnapshot();if(!u||u.generation<e.generation)throw new c("rust-analyzer status is unavailable after document open");let l;return u.generation===e.generation?(Q(u.status,"after document open"),l=u.status):l=await Z(t,e.generation,n,s),await E(i,n,s,o),l}async function yt(t,e,r,n=d){let i=z(e,r,n);await t(i.timeoutMs),x(r,n,"during diagnostics")}async function E(t,e,r=d,n=k){if(t<=0)return;if(z(t,e,r).deadlineLimited)throw new c("rust-analyzer readiness deadline cannot accommodate delay");await n(t),x(e,r,"during delay")}async function gt(t,e){try{return await t()}catch(r){throw r instanceof c&&await e(),r}}function Rt(t){return t instanceof c?{ok:!1,error:t.message}:null}function x(t,e,r){if(t-e()<=0)throw new c(`rust-analyzer readiness deadline expired ${r}`)}function Q(t,e){if(t.health==="error")throw new c(`rust-analyzer reported error health ${e}`);if(!t.quiescent)throw new c(`rust-analyzer did not report quiescence ${e}`)}function k(t){return new Promise(e=>setTimeout(e,t))}import{realpathSync as A}from"fs";import{basename as ze,dirname as xe,join as Ae,relative as Te,sep as Ce}from"path";import{fileURLToPath as De,pathToFileURL as X}from"url";function T(t,e){return e==="."||e==="./"?X(A(t)).href:X(H(t,e).absolutePath).href}function O(t,e){let r=De(e);return Te(A(t),Me(r)).split(Ce).join("/")}function Me(t){try{return A(t)}catch{try{return Ae(A(xe(t)),ze(t))}catch{return t}}}function C(t,e,r){return{textDocument:{uri:T(t,e.relativePath)},position:Ee(t,e),context:{includeDeclaration:r}}}function Ee(t,e){let r={line:e.startLine,character:e.startChar??0};try{return ke(b(t,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(n){if(!S(n))throw n;return r}}function ke(t,e,r={line:e.startLine,character:e.startChar??0}){let n=t.split(/\r?\n/),i=n[e.startLine];if(i===void 0||e.leaf.length===0)return r;let s=Math.max(0,Math.min(r.character,i.length)),o=i.indexOf(e.leaf,s);if(o>=0)return{line:e.startLine,character:I(o,e.leaf)};let u=i.indexOf(e.leaf);if(u>=0)return{line:e.startLine,character:I(u,e.leaf)};let l=Ie(n,e.startLine,e.leaf);return l||r}function I(t,e){return t+Math.max(0,e.length-2)}function Ie(t,e,r){for(let n of[-1,1,-2,2]){let i=e+n;if(i<0||i>=t.length)continue;let s=t[i].indexOf(r);if(s>=0)return{line:i,character:I(s,r)}}return null}function V(t,e){return e.map(r=>({file:O(t,r.uri),line:r.range.start.line,column:r.range.start.character}))}function ee(t){let e=new Map;for(let r of t)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,n)=>{let i=r.file.localeCompare(n.file);return i!==0?i:r.line!==n.line?r.line-n.line:r.column-n.column})}async function We(t){let e=t.includeReferences!==!1,r=t.includeCallees===!0,n=t.includeSignatures===!0,i={timeoutMs:t.requestTimeoutMs},s=Fe(t),o=re(t),u=ne(t),l=ie(t),f=Ye(t.projectRoot,s),y=Ge(t.projectRoot,f),q=Ke(f),h=new P(Y(t.rustAnalyzerBinary,y),{requestTimeoutMs:t.requestTimeoutMs,configuration:q});try{let D=await h.initialize({processId:m.pid,rootUri:T(y,"."),capabilities:{textDocument:{references:{dynamicRegistration:!1},callHierarchy:{dynamicRegistration:!1},hover:{dynamicRegistration:!1}}},initializationOptions:q});if(e&&!D.capabilities.referencesProvider)return{available:!1,reason:"rust-analyzer initialized without textDocument/references support.",references:o.map(a=>[a.symbolId,[]]),...r?{callees:u.map(a=>[a.symbolId,[]])}:{}};if(r&&!D.capabilities.callHierarchyProvider)return{available:!1,reason:"rust-analyzer initialized without call hierarchy support.",references:o.map(a=>[a.symbolId,[]]),callees:u.map(a=>[a.symbolId,[]]),...n?{signatures:l.map(a=>[a.symbolId,null])}:{}};if(n&&!D.capabilities.hoverProvider)return{available:!1,reason:"rust-analyzer initialized without hover support.",references:o.map(a=>[a.symbolId,[]]),...r?{callees:u.map(a=>[a.symbolId,[]])}:{},signatures:l.map(a=>[a.symbolId,null])};let ue=Qe(h,t.projectRoot,s);await Ze(h,ue,t.diagnosticsTimeoutMs??1e4),await ae(t.settleDelayMs??5e3);let W=e?await w(o,t.concurrency??8,async a=>{let F=await se(h,C(t.projectRoot,a,!1),{requestTimeoutMs:t.requestTimeoutMs,retryTimeoutMs:t.referenceRetryTimeoutMs});return{symbolId:a.symbolId,references:ee(V(t.projectRoot,F.locations)),complete:F.complete}}):o.map(a=>({symbolId:a.symbolId,references:[],complete:!0})),le=r?await w(u,t.concurrency??8,async a=>({symbolId:a.symbolId,callees:await Ve(h,t.projectRoot,a,i)})):[],ce=n?await w(l,t.concurrency??8,async a=>({symbolId:a.symbolId,signature:await He(h,t.projectRoot,a,i)})):[];return{available:!0,references:W.filter(a=>a.complete).map(a=>[a.symbolId,a.references]),incompleteReferenceSymbolIds:W.filter(a=>!a.complete).map(a=>a.symbolId),...r?{callees:le.map(a=>[a.symbolId,a.callees])}:{},...n?{signatures:ce.map(a=>[a.symbolId,a.signature])}:{}}}finally{await h.shutdown().catch(()=>{})}}function re(t){return t.referenceDefinitions??t.definitions}function ne(t){return t.calleeDefinitions??t.definitions}function ie(t){return t.signatureDefinitions??t.definitions}function Fe(t){return[...t.includeReferences!==!1?re(t):[],...t.includeCallees===!0?ne(t):[],...t.includeSignatures===!0?ie(t):[]]}async function He(t,e,r,n={}){let i=C(e,r,!1),s=await Ne(t,{textDocument:i.textDocument,position:i.position},n);return _e(s)}async function Ne(t,e,r={}){try{return await t.hover(e,r)}catch(n){if(R(n),!(n instanceof Error?n.message:String(n)).includes("content modified"))return null;await oe(r.deadlineMs);try{return await t.hover(e,r)}catch(s){return R(s),null}}}function _e(t){if(!t)return null;let e=$e(t.contents),r=/```(?:rust)?\s*([\s\S]*?)```/i.exec(e),n=r?r[1]:e;for(let i of n.split(/\r?\n/)){let s=i.replace(/^`+|`+$/g,"").trim();if(s&&Je(s))return s}return null}function $e(t){return typeof t=="string"?t:Array.isArray(t)?t.map(Ue).join(`
|
|
7
|
-
`):"value"in t?t.value:""}function Ue(t){return typeof t=="string"?t:t.value}function Je(t){return/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?(?:unsafe\s+)?(?:extern\s+(?:"[^"]+"\s+)?)?(?:fn|struct|enum|trait|type|const|static|mod)\b/.test(t)}function Ke(t){return{...t.length>0?{linkedProjects:t}:{},references:{excludeImports:!1,excludeTests:!1}}}function Ge(t,e){return e.length===1?B(e[0]):j(t)}function Ye(t,e){let r=j(t),n=[],i=new Set;for(let s of e){let o=B(j(r,s.relativePath));for(;it(r,o);){let u=Be(o,"Cargo.toml");if(Oe(u)){i.has(u)||(i.add(u),n.push(u));break}let l=B(o);if(l===o)break;o=l}}return n}function Qe(t,e,r){let n=new Set,i=[];for(let s of r)if(!n.has(s.relativePath)){n.add(s.relativePath);try{let o=T(e,s.relativePath);t.didOpenTextDocument({uri:o,languageId:"rust",version:1,text:b(e,s.relativePath,{inputKind:"indexed Rust source file"})}),i.push(o)}catch(o){if(!S(o))throw o}}return i}async function Ze(t,e,r){await Promise.all(e.map(n=>t.waitForDiagnostics(n,r).catch(()=>!1)))}async function It(t,e){return(await se(t,e)).locations}async function se(t,e,r={}){try{return{locations:await t.references(e,{timeoutMs:r.requestTimeoutMs,deadlineMs:r.deadlineMs}),complete:!0}}catch(n){R(n);let i=n instanceof Error?n.message:String(n);if(te(n))return{locations:[],complete:!1};if(!i.includes("content modified"))return{locations:[],complete:!0};await oe(r.deadlineMs);try{return{locations:await t.references(e,Xe(r)),complete:!0}}catch(s){return R(s),{locations:[],complete:!te(s)}}}}function Xe(t){return{...t.retryTimeoutMs&&t.retryTimeoutMs>0?{timeoutMs:t.retryTimeoutMs}:{},...t.deadlineMs!==void 0?{deadlineMs:t.deadlineMs}:{}}}function te(t){let e=t instanceof Error?t.message:String(t);return e.includes("rust-analyzer LSP request")&&e.includes("timed out after")}async function Ve(t,e,r,n={}){let i=C(e,r,!1),s=await et(t,{textDocument:i.textDocument,position:i.position},n),o=(await Promise.all(s.map(u=>tt(t,u,n)))).flat();return nt(rt(e,o))}async function et(t,e,r={}){try{return await t.prepareCallHierarchy(e,r)}catch(n){return R(n),[]}}async function tt(t,e,r={}){try{return await t.outgoingCalls(e,r)}catch(n){return R(n),[]}}async function oe(t){if(t===void 0){await ae(1e3);return}await E(1e3,t)}function R(t){if(t instanceof c)throw t}function rt(t,e){return e.map(r=>({symbol:r.to.name,file:O(t,r.to.uri),line:r.to.selectionRange.start.line}))}function nt(t){let e=new Set,r=[];for(let n of t){let i=`${n.symbol}\0${n.file}\0${n.line}`;e.has(i)||(e.add(i),r.push(n))}return r.sort((n,i)=>n.file.localeCompare(i.file)||n.line-i.line||n.symbol.localeCompare(i.symbol))}function ae(t){return t<=0?Promise.resolve():new Promise(e=>setTimeout(e,t))}function it(t,e){return e===t||e.startsWith(`${t}${je}`)}async function st(){return new Promise((t,e)=>{let r=[];m.stdin.on("data",n=>r.push(n)),m.stdin.on("error",e),m.stdin.on("end",()=>t(Buffer.concat(r).toString("utf8")))})}async function ot(){try{let t=JSON.parse(await st()),e=await We(t);m.stdout.write(JSON.stringify(e))}catch(t){let e={available:!1,reason:t instanceof Error?t.message:String(t),references:[]};m.stdout.write(JSON.stringify(e)),m.exitCode=1}}m.argv[1]&&qe(import.meta.url)===m.argv[1]&&ot();export{P as a,Y as b,ht as c,Pe as d,yt as e,gt as f,Rt as g,T as h,O as i,C as j,V as k,ee as l,We as m,re as n,ne as o,ie as p,Fe as q,He as r,Ne as s,_e as t,Ke as u,Ge as v,Ye as w,Qe as x,Ze as y,It as z,se as A,Ve as B,ae as C};
|
|
8
|
-
//# sourceMappingURL=chunk-DQLPXMH6.js.map
|
package/dist/chunk-EKZTZXHZ.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import{a as _,g as C,j as T,o as $,p as A}from"./chunk-UJPRPGCO.js";import{A as O}from"./chunk-GH74ASD6.js";import{A as M,J as k,K as N,k as S,l as h,r as D,y as E}from"./chunk-WCCFZ7V7.js";import{a as x}from"./chunk-NGEXCJJW.js";import{c as y,d as R}from"./chunk-7S5E7KWT.js";var ne={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=te(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function te(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let s=e.indexOf("]",t+1);if(s===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,s),suffix:"type-param"}),t=s+1;continue}if(e[t]==="("&&(n.length===0||t===0||w(e[t-1]))){let s=e.indexOf(")",t+1);if(s!==-1&&e[s+1]!=="."){n.push({name:e.slice(t+1,s),suffix:"parameter"}),t=s+1;continue}}let i;if(e[t]==="`"){let s=e.indexOf("`",t+1);if(s===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,s),t=s+1}else{let s=t;for(;t<e.length&&!w(e[t]);)t++;i=e.slice(s,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let s=e.indexOf(")",t+1);s!==-1&&e[s+1]==="."?(n.push({name:i,suffix:"method"}),t=s+2):s!==-1?(n.push({name:i,suffix:"method"}),t=s+1):(n.push({name:i,suffix:"term"}),t++)}else{let s=ne[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function w(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function v(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let s=ie(r);s&&i.push(s)}return i.join(":")}function ie(e){let n=e.suffix==="namespace"?re(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function re(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function P(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function Qe(e){return e.endsWith("().")||p(e)==="method"}function Q(e){let n=p(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function je(e){return p(e)==="namespace"}var se=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function Be(e){return se.test(e)}var oe=new Set(["test","tests","_tests"]);function Je(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&oe.has(i.name))return!0}return!1}function We(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ze(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ue(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
|
|
2
|
-
FROM global_symbols gs
|
|
3
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
|
-
JOIN documents d ON der.document_id = d.id
|
|
5
|
-
WHERE ${n.where}
|
|
6
|
-
${e.pathExclusionsFor("d")}
|
|
7
|
-
${B(n.orderBy)}
|
|
8
|
-
${J(n.limit)}`,...n.params??[])}function Ge(e,n){return e.all(`SELECT
|
|
9
|
-
gs.id,
|
|
10
|
-
gs.symbol,
|
|
11
|
-
c.document_id,
|
|
12
|
-
MIN(c.start_line) AS start_line,
|
|
13
|
-
0 AS start_char,
|
|
14
|
-
MAX(c.end_line) AS end_line,
|
|
15
|
-
0 AS end_char,
|
|
16
|
-
d.relative_path,
|
|
17
|
-
gs.display_name,
|
|
18
|
-
gs.documentation
|
|
19
|
-
FROM global_symbols gs
|
|
20
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
21
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
22
|
-
JOIN documents d ON c.document_id = d.id
|
|
23
|
-
WHERE m.role = 1
|
|
24
|
-
AND ${n.where}
|
|
25
|
-
${e.pathExclusionsFor("d")}
|
|
26
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
27
|
-
${B(n.orderBy)}
|
|
28
|
-
${J(n.limit)}`,...n.params??[])}function B(e){return e?`ORDER BY ${e}`:""}function J(e){return typeof e=="number"?`LIMIT ${e}`:""}function W(e){return!e||!e.trim()?null:e.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()||null}function z(e){if(!e)return null;let n=j(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(j(i)??i).replace(/\n/g," ")}function j(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function g(e){return{forFile(n,t){return H(e,n,t)},forFiles(n,t){let i=new Map;for(let r of n)i.set(r,H(e,r,t));return i}}}function H(e,n,t){let i={file:n},r=t.facts||t.identifiers;if(t.text&&(i.text=k(e,n)),t.lines&&(i.lines=N(e,n)),t.ast&&(i.ast=O(e,n)),t.imports&&(i.imports=A(e,n)),t.reexports&&(i.reexports=$(e,n)),r){let s=C(e,n),o=s.facts;t.facts&&(i.facts=o),s.unavailable&&(i.sourceFactsUnavailable=s.unavailable),t.identifiers&&o&&(i.identifiers=o.fileIdentifiers,i.identifierLineMap=o.identifierLineMap)}return i}function ae(e,n={}){if(m(e.symbol)!==null)return n.includeClassMemberFallbacks===!0;let r=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(r)}function I(e,n,t={}){let i=new Map;for(let s of n)e.length>0&&!ae(s,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||i.set(s.id,s);for(let s of e)i.set(s.id,s);let r=[...i.values()];return t.sort?r.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):r}var le=y("file-definitions",{clearGroups:["definition-catalog"]}),ce=R("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),de=y("file-function-like-definitions",{clearGroups:["definition-catalog"]}),U=new WeakMap;function F(e,n,t={}){return t.includeClassMemberFallbacks?L(e,n,void 0,{includeClassMemberFallbacks:!0}):le.get(e,n,()=>{let i=X(e,n);if(i)return i;let r=L(e,n),s=h(e),o=g(e).forFile(n,{text:!0}).text;return s&&o&&Y.write(e,n,S(e,n,o),{projectFingerprint:s,definitions:r.map(a=>({...a}))}),r})}function ue(e,n){return de.get(e,n,()=>{let t=X(e,n);return t?t.filter(i=>i.isFunctionLike):L(e,n,i=>i.isFunctionLike)})}var Y=E({kind:"file-definitions",invalidation:M("file-definitions"),serialize:fe,deserialize:me});function X(e,n){let t=h(e);if(!t)return null;let i=g(e).forFile(n,{text:!0}).text;if(!i)return null;let r=Y.read(e,n,S(e,n,i));return r?pe(r,t,n):null}function fe(e){return JSON.stringify(e)}function me(e){try{let n=JSON.parse(e);return!D(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function pe(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let s=ge(r,t);if(!s)return null;i.push(s)}return i}function ge(e,n){return!D(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function L(e,n,t,i={}){let r=I(be(e,n),ye(e,n),{sort:!0,includeClassMemberFallbacks:i.includeClassMemberFallbacks}).map(Z);return t&&(r=r.filter(t)),V(e,n,r)}function be(e,n){return e.all(`SELECT
|
|
29
|
-
gs.id,
|
|
30
|
-
gs.symbol,
|
|
31
|
-
der.document_id,
|
|
32
|
-
der.start_line,
|
|
33
|
-
der.start_char,
|
|
34
|
-
der.end_line,
|
|
35
|
-
der.end_char,
|
|
36
|
-
d.relative_path,
|
|
37
|
-
gs.display_name,
|
|
38
|
-
gs.kind,
|
|
39
|
-
gs.documentation,
|
|
40
|
-
gs.enclosing_symbol
|
|
41
|
-
FROM global_symbols gs
|
|
42
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
43
|
-
JOIN documents d ON der.document_id = d.id
|
|
44
|
-
WHERE d.relative_path = ?
|
|
45
|
-
${e.symbolNoiseFor("gs")}
|
|
46
|
-
ORDER BY der.start_line, der.end_line`,n)}function ye(e,n){return e.all(`SELECT
|
|
47
|
-
gs.id,
|
|
48
|
-
gs.symbol,
|
|
49
|
-
c.document_id,
|
|
50
|
-
MIN(c.start_line) AS start_line,
|
|
51
|
-
0 AS start_char,
|
|
52
|
-
MAX(c.end_line) AS end_line,
|
|
53
|
-
0 AS end_char,
|
|
54
|
-
d.relative_path,
|
|
55
|
-
gs.display_name,
|
|
56
|
-
gs.kind,
|
|
57
|
-
gs.documentation,
|
|
58
|
-
gs.enclosing_symbol
|
|
59
|
-
FROM global_symbols gs
|
|
60
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
61
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
62
|
-
JOIN documents d ON c.document_id = d.id
|
|
63
|
-
WHERE d.relative_path = ?
|
|
64
|
-
AND m.role = 1
|
|
65
|
-
${e.symbolNoiseFor("gs")}
|
|
66
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
67
|
-
ORDER BY start_line, end_line`,n)}function Z(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:P(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:Q(e.symbol),isTypeLike:p(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function pn(e,n={}){return Se(e,n.scope)}function Se(e,n){return x(e,{scope:n,includeIgnored:!1}).flatMap(t=>F(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function gn(e,n){return x(e,{scope:n,includeIgnored:!1}).flatMap(t=>ue(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function bn(e,n){let t=ce.get(e,()=>new WeakMap),i=t.get(n.symbolMatches);i||(i=new Map,t.set(n.symbolMatches,i));let r=JSON.stringify({scope:n.scope??null,sqlPrefilter:n.sqlPrefilter??null}),s=i.get(r);if(s)return[...s];let o=G(he(e,n.scope,n.sqlPrefilter)),a=G(xe(e,n.scope,n.sqlPrefilter)),c=new Set([...o.keys(),...a.keys()]),l=[];for(let d of[...c].sort()){if(e.isIgnored(d))continue;let f=I(o.get(d)??[],a.get(d)??[],{sort:!0}).filter(ee=>n.symbolMatches(ee.symbol));f.length!==0&&l.push(...V(e,d,f.map(Z)))}return i.set(r,l),[...l]}function he(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${q("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
68
|
-
gs.id,
|
|
69
|
-
gs.symbol,
|
|
70
|
-
der.document_id,
|
|
71
|
-
der.start_line,
|
|
72
|
-
der.start_char,
|
|
73
|
-
der.end_line,
|
|
74
|
-
der.end_char,
|
|
75
|
-
d.relative_path,
|
|
76
|
-
gs.display_name,
|
|
77
|
-
gs.kind,
|
|
78
|
-
gs.documentation,
|
|
79
|
-
gs.enclosing_symbol
|
|
80
|
-
FROM global_symbols gs
|
|
81
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
82
|
-
JOIN documents d ON der.document_id = d.id
|
|
83
|
-
WHERE 1 = 1
|
|
84
|
-
${e.pathExclusionsFor("d")}
|
|
85
|
-
${i}
|
|
86
|
-
${r}
|
|
87
|
-
${e.symbolNoiseFor("gs")}
|
|
88
|
-
ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function xe(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${q("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
89
|
-
gs.id,
|
|
90
|
-
gs.symbol,
|
|
91
|
-
c.document_id,
|
|
92
|
-
MIN(c.start_line) AS start_line,
|
|
93
|
-
0 AS start_char,
|
|
94
|
-
MAX(c.end_line) AS end_line,
|
|
95
|
-
0 AS end_char,
|
|
96
|
-
d.relative_path,
|
|
97
|
-
gs.display_name,
|
|
98
|
-
gs.kind,
|
|
99
|
-
gs.documentation,
|
|
100
|
-
gs.enclosing_symbol
|
|
101
|
-
FROM global_symbols gs
|
|
102
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
103
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
104
|
-
JOIN documents d ON c.document_id = d.id
|
|
105
|
-
WHERE m.role = 1
|
|
106
|
-
AND NOT EXISTS (
|
|
107
|
-
SELECT 1
|
|
108
|
-
FROM defn_enclosing_ranges existing_der
|
|
109
|
-
WHERE existing_der.symbol_id = gs.id
|
|
110
|
-
)
|
|
111
|
-
${e.pathExclusionsFor("d")}
|
|
112
|
-
${i}
|
|
113
|
-
${r}
|
|
114
|
-
${e.symbolNoiseFor("gs")}
|
|
115
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
116
|
-
ORDER BY d.relative_path, start_line, end_line`,...s)}function De(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function q(e,n){return n==="callable"?De(e):_e(e)}function _e(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function G(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function yn(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>F(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:W(z(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Ie(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function Sn(e,n){let t=U.get(e);return t||(t=Ie(e),U.set(e,t)),t.get(n)??null}function hn(e,n){let t=F(e,n.relative_path).find(i=>i.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function V(e,n,t){let i=g(e).forFile(n,{text:!0}).text,r=T(e,n);return r?ke(t,r,i):i?Le(t,i):t}function Le(e,n){let t=n.split(/\r?\n/),i=Fe(e,t),r=Re(e,i),s=Ee(r,t);return Me(e,s)}function Fe(e,n){let t=e.some(r=>b(r.symbol))?we(n):null,i=new Map;for(let r of e)i.set(r.symbolId,Ae(n,t,r));return i}function Re(e,n){return e.filter(t=>b(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function Ee(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:ve(n,r.definition,r.startLine,o)})}return t}function Me(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function ke(e,n,t=null){let i=new Map;for(let r of n){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!$e(r)||!r.leaf)return K(r,t);let s=i.get(r.leaf);if(!s||s.length===0)return K(r,t);let o=t?Ne(r,s,t):null;if(o)return{...r,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-r.startLine);for(let l=1;l<s.length;l+=1){let d=s[l],f=Math.abs(d.startLine-r.startLine);f<c&&(a=d,c=f)}return{...r,startLine:a.startLine,endLine:a.endLine}})}function Ne(e,n,t){let i=Oe(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),s=new RegExp(`\\b${_(i)}\\b`);for(let o of n){let a=Ce(r,o.startLine);if(a&&s.test(a))return o}return null}function Oe(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Ce(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return Te(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function Te(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let s=e[r]??"";if(i.push(s),s.includes("{"))break}return i.join(" ")}function $e(e){return b(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function K(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=_(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),s=n.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function Ae(e,n,t){if(!b(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-t.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function we(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,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.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]&&o(d[1],a);for(let d of c.matchAll(t))d[1]&&o(d[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let d of c.matchAll(r))d[1]&&o(d[1],a)}return s}function ve(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),s=Math.max(t,Math.min(r,n.endLine)),o=0,a=0,c=!1;for(let l=t;l<=r;l+=1){let d=Pe(e[l]??"");for(let f of d)f==="{"?(o+=1,c=!0):f==="}"?o=Math.max(0,o-1):f==="("?a+=1:f===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function Pe(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!t&&s==="/"&&o==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(s==="\\"){i=!0,n+=" ";continue}s===t&&(t=null),n+=" ";continue}if(s==='"'||s==="'"||s==="`"){t=s,n+=" ";continue}n+=s}return n}function b(e){return e.includes("().")}function xn(e){let n=u(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{g as a,u as b,m as c,v as d,P as e,p as f,Qe as g,Q as h,je as i,Be as j,Je as k,We as l,ze as m,Ue as n,Ge as o,W as p,z as q,I as r,F as s,pn as t,Se as u,gn as v,bn as w,yn as x,Ie as y,Sn as z,hn as A,xn as B};
|
|
117
|
-
//# sourceMappingURL=chunk-EKZTZXHZ.js.map
|
package/dist/chunk-EW2NTSFA.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{c as S}from"./chunk-YTQVETEO.js";import{c as m}from"./chunk-UJCOIXDY.js";import{c as h}from"./chunk-26QA6FAI.js";import{j as y}from"./chunk-HX7M4BDI.js";import{p}from"./chunk-UJPRPGCO.js";import{a as g}from"./chunk-NGEXCJJW.js";import f from"path";function W(e,t){let{scope:i,minDeviation:r=5,limit:n=50}=t??{},a=t?.semantic!==!1,u=t?.includePatternDeviations===!0,o=new m(e).fileDependencyGraph(i),l=S(e,{scope:i}),c=x([...D(e,o,{scope:i,semantic:a}),...R(l.forbiddenEdges),...u?E(o,r):[]]);return t?.includeArchitecture===!0&&(c.architecture=l),n<=0||c.results.length<=n?c:{...c,results:c.results.slice(0,n),totalResults:c.results.length}}function D(e,t,i){let r=_(e,i.scope),n=[],a=new Set;for(let[s,o]of t){if(d(s))continue;let l=r.get(s)??new Set;for(let c of o)d(c)||l.has(c)||v(e,s,c,i)||(n.push({file:s,dep:c}),a.add(s))}a.size>0&&w(e,r,{paths:[...a]});let u=[];for(let{file:s,dep:o}of n)(r.get(s)??new Set).has(o)||u.push({file:s,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${s} to ${o}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return u}function v(e,t,i,r){return C(e,t,i)||M(e,t,i)||O(i)||P(e,t,i)||N(i)?!0:r.semantic&&A(e,t,i)}function R(e){return e.flatMap(t=>{let i=t.examples[0];return i?[{file:i.fromFile,kind:"architecture-violation",description:`${t.from} depends on forbidden boundary ${t.to} through ${t.fileEdgeCount} file edge(s)`,dep:i.toFile,detail:`${t.from} may not depend on ${t.to}`,actionTier:"direct",policyBasis:"explicit",architecture:{fromBoundary:t.from,toBoundary:t.to,fileEdgeCount:t.fileEdgeCount,importerCount:t.importerCount,importedFileCount:t.importedFileCount,examples:t.examples},evidenceReasons:[`configured dependency row for ${t.from} does not allow ${t.to}`,`${t.fileEdgeCount} file edge(s) connect ${t.importerCount} importer(s) to ${t.importedFileCount} imported file(s)`,...t.examples.map(r=>`${r.fromFile} imports ${r.toFile}`)],recommendation:"Move the dependency behind an allowed boundary, reverse the dependency through an owned interface, or deliberately update the project architecture rule."}]:[]})}function E(e,t){let i=[];for(let[r,n]of k(e)){let a=n.filter(s=>!d(s));if(a.length<t)continue;let u=I(e,a);for(let s of a)for(let o of e.get(s)??[])d(o)||(u.get(o)??0)===1&&f.dirname(o)!==r&&f.dirname(o)!==f.dirname(r)&&i.push({file:s,kind:"pattern-deviation",description:`Only file in ${r}/ that depends on ${o}`,dep:o,actionTier:"signal",evidenceReasons:[`${a.length} sibling file(s) in ${r}/ were compared`,`${s} is the only non-skipped sibling depending on ${o}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."})}return i}function x(e){let t=e.filter(i=>i.kind==="architecture-violation").length;return{results:e,unusedImports:e.filter(i=>i.kind==="unused-import").length,architectureViolations:t,layerViolations:t,patternDeviations:e.filter(i=>i.kind==="pattern-deviation").length}}function k(e){let t=new Map;for(let i of e.keys()){let r=f.dirname(i),n=t.get(r);n||(n=[],t.set(r,n)),n.push(i)}return t}function I(e,t){let i=new Map;for(let r of t)for(let n of e.get(r)??[])d(n)||i.set(n,(i.get(n)??0)+1);return i}function _(e,t){let i=new Map;return $(e,i,t),i}function $(e,t,i){for(let r of F(e,i))b(e,t,r.from_file,r.to_file)}function F(e,t){let i=t?"AND d1.relative_path LIKE ?":"",r=t?[`%${t}%`]:[];return e.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
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
17
|
-
${i}`,...r)}function w(e,t,i={}){new m(e).scanSourceReferences({paths:i.paths??g(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},n=>{n.target.relativePath!==n.sourceFile&&(e.isIgnored(n.target.relativePath)||b(e,t,n.sourceFile,n.target.relativePath))})}function b(e,t,i,r){if(e.isIgnored(i)||e.isIgnored(r))return;let n=t.get(i);n||(n=new Set,t.set(i,n)),n.add(r)}function O(e){return e.includes("types")||e.endsWith(".d.ts")}function A(e,t,i){let r=y(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.some(n=>n.isUsed)}function C(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.some(n=>n.used)}function M(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.every(n=>n.isTypeOnly===!0)}function N(e){return e.endsWith(".vue")}function P(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length===0?!1:r.every(n=>n.kind==="side-effect"||n.kind==="namespace"&&n.usedMembers.length===0&&!n.used)}function d(e){let t=h(e);return!!(t==="entry"||t==="barrel"||t==="test"||t==="worker"||T(f.basename(e)))}function T(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{W as a};
|
|
18
|
-
//# sourceMappingURL=chunk-EW2NTSFA.js.map
|
package/dist/chunk-F3Z4OUDS.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{$ as F,$e as Y,Bb as P,Ke as p,Le as H,Mb as _,Me as X,Oe as w,_e as L,ca as I,ea as V,ha as v,ia as x,ja as D,ka as B,kf as C,la as W,ma as U,mf as Z,nf as q,of as g,qf as ee,sd as Q,tf as N,wf as k,xe as z}from"./chunk-JFGGXWQF.js";function ne(e,n,t){if(!Number.isSafeInteger(t.limit)||t.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=v(e,n);if(!o)return{rows:[],hasMore:!1,producer:t.producer??"source-keyset",semanticEnrichment:!1};if(t.producer==="complete-only"||t.semantic===!0||o.relativePath.endsWith(".rb"))return G(e,n,t);let s=B(e,o);if(!s)return G(e,n,t);let i=oe(e,o),u=ue(e,i),a=[],c=t.producer==="source-keyset";for(let l of u){if(t.after&&l<t.after.relativePath)continue;t.instrumentation?.fileScanned?.(l);let f=W(e,s,l);f.length>0&&(c=!0);let R=new Set(f);i?.relativePath===l&&R.add(i.line);for(let b of[...R].sort((m,ce)=>m-ce)){let m={relativePath:l,line:b};if(!(t.after&&h(m,t.after)<=0)&&(a.push(m),t.instrumentation?.rowAccepted?.(m),c&&a.length>t.limit))return te(a,t.limit)}}return c?te(a,t.limit):G(e,n,t,i)}function h(e,n){return(e.relativePath<n.relativePath?-1:e.relativePath>n.relativePath?1:0)||e.line-n.line}function te(e,n){return{rows:e.slice(0,n),hasMore:e.length>n,producer:"source-keyset",semanticEnrichment:!1}}function G(e,n,t,o){let r=v(e,n),s=t.semantic===!0||r?.relativePath.endsWith(".rb")?P(e,n,{semantic:t.semantic}):le(e,n,o),i=me(s).filter(u=>!t.after||h(u,t.after)>0);for(let u of i.slice(0,t.limit+1))t.instrumentation?.rowAccepted?.(u);return{rows:i.slice(0,t.limit),hasMore:i.length>t.limit,producer:"complete-only",semanticEnrichment:t.semantic===!0}}function le(e,n,t){let o=v(e,n);if(!o)return[];let r=t===void 0?oe(e,o):t,s=U(e,o).map(i=>({relativePath:i.file,line:i.line}));return r?[r,...s]:s}function oe(e,n){return!V(n.symbol)&&!e.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function ue(e,n){let t=F(e);return!n||t.includes(n.relativePath)?t:[...t,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function me(e){let n=new Map;for(let t of e)n.set(`${t.relativePath}\0${t.line}`,t);return[...n.values()].sort(h)}import{InvalidArgumentError as y}from"commander";var Ae=z,de=/^[+-]?\d+$/u,fe=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,Fe=(e=>M(e,"an integer")),re=(e=>{let n=M(e,"a non-negative integer");if(n<0)throw new y(`Expected a non-negative integer, got "${e}".`);return n}),ie=(e=>{let n=M(e,"a positive integer");if(n<1)throw new y(`Expected a positive integer, got "${e}".`);return n}),Ve=(e=>{if(!fe.test(e))throw new y(`Expected a number, got "${e}".`);let n=Number(e);if(!Number.isFinite(n))throw new y(`Expected a finite number, got "${e}".`);return n});function M(e,n){if(!de.test(e))throw new y(`Expected ${n}, got "${e}".`);let t=Number(e);if(!Number.isSafeInteger(t))throw new y(`Expected ${n}, got "${e}".`);return t}function d(e,n,t,...o){return o.length>0?{flags:e,description:n,parser:t,defaultValue:o[0]}:{flags:e,description:n,parser:t}}function pe(){return d("--json","Output as JSON for programmatic consumption")}function ge(){return d("--compact","Emit minified one-line JSON (use with --json)")}function he(){return d("--result-only","Emit only the command-owned result (use with --json)")}function se(e=[]){return S(e)}function S(e=[]){let n=[pe(),he(),ge()],t=new Set(n.map(o=>o.flags));return[...e.filter(o=>!t.has(o.flags)),...n]}function E(e,n=[]){return{category:e,examples:n}}function K(e,n,t,o,r){return{answers:typeof e=="string"?[e]:e,returns:typeof n=="string"?[n]:n,inputs:t,coverage:o,...r?{scope:r}:{}}}function $(e){return e.generation.identity}function j(e){return"after"in e?k({version:2,...e}):k({version:1,...e})}function ae(e,n){let t=be(e);if(!ye(t)&&!Re(t))throw new Error("Invalid result cursor. Run the command again without --cursor.");return Pe(t,n),t}function ye(e){if(!e||typeof e!="object")return!1;let n=e;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Re(e){if(!e||typeof e!="object")return!1;let n=e,t=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!t&&typeof t.relativePath=="string"&&t.relativePath.length>0&&Number.isSafeInteger(t.line)&&(t.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function be(e){try{return JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function Pe(e,n){if(e.command!==n.command||e.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(e.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function J(e,n){let t=x(e,n),o=ve(t);for(let r of o)console.log(r)}function T(e,n,t="No results found for resolved symbol."){return x(e,n).match?t:we(n,D(e,n,5))}function A(e,n,t,o){return{...O(e,n),[o]:t}}function O(e,n){let t=x(e,n);return t.match?{matched:!0,resolved:{symbol:t.match.symbol,shortName:I(t.match.symbol),relativePath:t.match.relativePath},otherMatches:t.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:t.total}:{matched:!1,suggestions:D(e,n,5)}}function we(e,n){let t=`No definition matched '${e}'.`;return n.length>0?`${t} Suggestions: ${n.join(", ")}`:t}function ve(e){if(!e.match||e.total<=1)return[];let n=e.match,t=Math.max(0,e.total-1),o=[`Resolved: ${I(n.symbol)} (${n.relativePath}) -- ${t} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=e.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${p(s.startLine)})`).join("; ")}`),o.push(""),o}var xe=L(({db:e,args:n,opts:t})=>{let o=C(n,0),r=g(t,"signatures"),s=_(e,o);if(g(t,"json")){N("outline",n,t,s);return}if(s.length===0)return w.empty(`No symbols found for "${o}".`);function i(u,a){for(let c of u){let l=" ".repeat(a),f=r&&c.signature?` - ${Ce(c.signature)}`:"";console.log(`${l}${H(c.startLine,c.endLine)} ${c.shortName}${f}`),i(c.children,a+1)}}i(s,0)});function Ce(e){return e.length>120?`${e.slice(0,117)}...`:e}var Ne=Y("refs",({db:e,args:n,opts:t,budget:o})=>{let r=C(n,0),s=Z(t,"cursor"),i=q(t,"limit"),u=$(e),a=s?ae(s,{command:"refs",target:r,indexGeneration:u}):void 0,c=!a&&i===void 0,l=c?Se(e,r,o.semantic):a?.version===1?Ee(e,r,a.offset,i??50,o.semantic):$e(e,r,{limit:i??50,cursor:a,semantic:a?.semanticEnrichment??g(t,"full"),indexGeneration:u}),{rows:f,continuation:R,coverage:b}=l;if(g(t,"json")){let m={...A(e,r,f,"references"),pagination:l.pagination};N("refs",n,t,m,{analysisBudget:o.analysisBudget,coverage:b});return}if(f.length===0)return w.empty(T(e,r,"No references found."));if(J(e,r),w.groupedByFile(f,m=>` line ${p(m.line)}`),l.pagination.producer==="complete-only"&&!c&&console.error(`
|
|
3
|
-
This evidence provider required complete analysis; --limit bounded the returned rows, not analysis work.`),R){let m=b.totalKnown?`${b.omitted} omitted; `:"More references are available; ";console.log(`
|
|
4
|
-
${m}continue with --cursor ${R.cursor}`)}});function Se(e,n,t){let o=P(e,n,{semantic:t}).sort(h);return{rows:o,coverage:{complete:!0,totalKnown:!0,returned:o.length,total:o.length,omitted:0},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:t}}}function Ee(e,n,t,o,r){let s=P(e,n,{semantic:r}).sort(h);if(t>s.length)throw new Error("This cursor points past the current result set. Run again without --cursor.");let i=s.slice(t,t+o),u=t+i.length,a=i[i.length-1],c=t===0&&i.length===s.length,l=u<s.length&&a?{cursor:j({command:"refs",target:n,after:a,producer:"complete-only",semanticEnrichment:r,indexGeneration:$(e)}),indexGeneration:$(e)}:void 0;return{rows:i,continuation:l,coverage:c?{complete:!0,totalKnown:!0,returned:i.length,total:i.length,omitted:0}:{complete:!1,totalKnown:!0,returned:i.length,total:s.length,omitted:s.length-i.length,...l?{continuation:l}:{}},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:r}}}function $e(e,n,t){let o=ne(e,n,{limit:t.limit,after:t.cursor?.after,producer:t.cursor?.producer,semantic:t.semantic}),r=o.rows[o.rows.length-1],s=o.hasMore&&r?{cursor:j({command:"refs",target:n,after:r,producer:o.producer,semanticEnrichment:o.semanticEnrichment,indexGeneration:t.indexGeneration}),indexGeneration:t.indexGeneration}:void 0,i=!t.cursor&&!o.hasMore;return{rows:o.rows,continuation:s,coverage:i?{complete:!0,totalKnown:!0,returned:o.rows.length,total:o.rows.length,omitted:0}:{complete:!1,totalKnown:!1,returned:o.rows.length,...s?{continuation:s}:{}},pagination:{cursorVersion:2,producer:o.producer,semanticEnrichment:o.semanticEnrichment}}}var Oe=L(({db:e,args:n,opts:t})=>{let o=C(n,0),r=Q(e,o,{context:ee(t,"context",0)});if(g(t,"json")){N("code",n,t,A(e,o,r,"code"),{resultOnly:Ie(e,o,r)});return}if(!r)return w.empty(T(e,o,"Symbol found, but source was unreadable."));J(e,o),console.log(`${X(r.relativePath,r.startLine,r.endLine)} ${r.shortName} [${r.language??"unknown"}]
|
|
5
|
-
`);let s=r.source.split(`
|
|
6
|
-
`);for(let i=0;i<s.length;i++)console.log(` ${String(p(r.startLine+i)).padStart(4)} ${s[i]}`)});function Ie(e,n,t){if(!t)return O(e,n);let o={file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:p(t.startLine),endLine:p(t.endLine)},lines:t.source.split(`
|
|
7
|
-
`).map((i,u)=>({line:p(t.startLine+u),text:i}))},r=O(e,n),s=r.totalMatches??0;return!r.matched||!r.resolved||s<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:s}}}var it=[{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:se([d("--full","Run unbounded semantic analysis on large indexes"),d("-n, --limit <n>","Maximum reference sites to return",ie),d("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{answers:["Which files reference this symbol?","Is this symbol used anywhere, or only defined?"],returns:["referencing file paths","reference line numbers grouped by file"],inputs:["symbol"],coverage:"bounded",contrasts:[{command:"imported-by",distinction:"imported-by lists files importing the symbol; refs covers every reference site, imported or not."},{command:"affected",distinction:"refs is one hop out; affected is the transitive closure of what could break."}]},renderShape:"grouped-by-file",docs:E("Navigation",["scip-query refs login"]),handler:Ne},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:K("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete"),options:S([d("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:E("Navigation"),handler:xe},{id:"code",command:"code <symbol>",description:"Read the source code for a symbol (bounded to its definition range)",agent:{...K("What is the compiler-resolved definition source for this symbol?","definition identity, source, and line range",["symbol"],"complete"),resultUnits:{kind:"field",field:"code"}},options:S([d("-C, --context <n>","Extra lines of context above/below",re,0)]),renderShape:"custom",docs:E("Navigation"),handler:Oe}];export{Ae as a,Fe as b,re as c,ie as d,Ve as e,d as f,ge as g,se as h,S as i,E as j,K as k,J as l,T as m,A as n,O as o,it as p};
|
|
8
|
-
//# sourceMappingURL=chunk-F3Z4OUDS.js.map
|
package/dist/chunk-FJH2NW7J.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import{a as m,g as b}from"./chunk-46XGSFNI.js";import y from"ignore";import{existsSync as v,readdirSync as P}from"fs";import{dirname as g,isAbsolute as D,join as d,relative as V,resolve as _}from"path";function R(t){let e=y();return A(t,e)||e.add(F),{isIgnored:s=>h(e,t,s),filter:s=>s.filter(i=>!h(e,t,i))}}function A(t,e){let r=new Set,s=(a,o)=>{if(!(r.has(a)||!v(a)))try{let c=b(a,{maxBytes:m,inputKind:"gitignore file"});e.add(o?E(c,o):c),r.add(a)}catch{}},i=g(t),n=0;for(;i!==g(i)&&n<5&&(s(d(i,".gitignore"),""),!v(d(i,".git")));)i=g(i),n++;return C(t,"",e,s),r.size>0}function C(t,e,r,s){let i=e?d(t,e):t;s(d(i,".gitignore"),e);let n;try{n=P(i,{withFileTypes:!0})}catch{return}for(let a of n){if(!a.isDirectory()||a.name===".git")continue;let o=e?`${e}/${a.name}`:a.name;h(r,t,`${o}/`)||C(t,o,r,s)}}function E(t,e){let r=e.replaceAll("\\","/").replace(/\/+$/,"");return t.split(/\r?\n/).map(s=>I(s,r)).join(`
|
|
2
|
-
`)}function I(t,e){let r=t.trimStart();if(!r||r.startsWith("#"))return t;let s=t.slice(0,t.length-r.length),i=r.startsWith("!"),n=i?r.slice(1):r;if(!n||n.startsWith("#"))return t;let a=n.startsWith("/"),o=a?n.slice(1):n,u=(o.endsWith("/")?o.slice(0,-1):o).includes("/")||a?`${e}/${o}`:`${e}/**/${o}`;return`${s}${i?"!":""}${u}`}var F=`
|
|
3
|
-
# Dependencies
|
|
4
|
-
node_modules/
|
|
5
|
-
vendor/
|
|
6
|
-
.bundle/
|
|
7
|
-
|
|
8
|
-
# Build output
|
|
9
|
-
dist/
|
|
10
|
-
build/
|
|
11
|
-
out/
|
|
12
|
-
target/
|
|
13
|
-
bin/
|
|
14
|
-
obj/
|
|
15
|
-
|
|
16
|
-
# Python
|
|
17
|
-
__pycache__/
|
|
18
|
-
*.pyc
|
|
19
|
-
*.pyo
|
|
20
|
-
.venv/
|
|
21
|
-
venv/
|
|
22
|
-
.env/
|
|
23
|
-
env/
|
|
24
|
-
*.egg-info/
|
|
25
|
-
|
|
26
|
-
# Rust
|
|
27
|
-
target/
|
|
28
|
-
|
|
29
|
-
# Java / Kotlin / Scala
|
|
30
|
-
*.class
|
|
31
|
-
.gradle/
|
|
32
|
-
.mvn/
|
|
33
|
-
|
|
34
|
-
# C# / .NET
|
|
35
|
-
bin/
|
|
36
|
-
obj/
|
|
37
|
-
packages/
|
|
38
|
-
|
|
39
|
-
# Go
|
|
40
|
-
vendor/
|
|
41
|
-
|
|
42
|
-
# Dart
|
|
43
|
-
.dart_tool/
|
|
44
|
-
build/
|
|
45
|
-
|
|
46
|
-
# PHP
|
|
47
|
-
vendor/
|
|
48
|
-
|
|
49
|
-
# IDE / OS
|
|
50
|
-
.idea/
|
|
51
|
-
.vscode/
|
|
52
|
-
*.swp
|
|
53
|
-
*.swo
|
|
54
|
-
.DS_Store
|
|
55
|
-
Thumbs.db
|
|
56
|
-
|
|
57
|
-
# Type definitions (often noise in queries)
|
|
58
|
-
*.d.ts
|
|
59
|
-
`;function h(t,e,r){let s=M(e,r);if(!s)return!1;try{return t.ignores(s)}catch{return!1}}function M(t,e){if(!e||e===".")return null;if(!D(e)&&!e.startsWith(".."))return e.replaceAll("\\","/");let r=D(e)?e:_(t,e),s=V(t,r).replaceAll("\\","/");return!s||s==="."||s.startsWith("..")?null:s}var O=[];function p(t){t.groups.length>0&&O.push(t)}function S(){let t=new WeakMap;return{cache:t,ensure(e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}}}function x(t,e){let{cache:r,ensure:s}=S(),i={get(n,a,o){let c=s(n);if(c.has(a))return c.get(a);let l=o();return c.set(a,l),l},invalidate(n,a){r.get(n)?.delete(a)},invalidateAll(n){r.delete(n)},size(n){return r.get(n)?.size??0}};return p({name:t,groups:e.clearGroups,clearAll:n=>i.invalidateAll(n),clearFile:(n,a)=>i.invalidate(n,a)}),i}function H(t,e){let r=new WeakMap,s={get(i,n){let a=r.get(i);if(a)return a.value;let o=n();return r.set(i,{value:o}),o},invalidate(i){r.delete(i)},has(i){return r.has(i)}};return p({name:t,groups:e.clearGroups,clearAll:i=>s.invalidate(i)}),s}var $={clearGroups:["whole-project","source-file"]};function j(t){return G(t,$)}function G(t,e){let{cache:r,ensure:s}=S(),i={get(n,a,o,c){let l=s(n),u=l.get(a);if(u&&u.source===o)return u.value;let f=c();return l.set(a,{source:o,value:f}),f},invalidate(n,a){r.get(n)?.delete(a)},invalidateAll(n){r.delete(n)}};return p({name:t,groups:e.clearGroups,clearAll:n=>i.invalidateAll(n),clearFile:(n,a)=>i.invalidate(n,a)}),i}import{basename as J}from"path";var K=x("indexed-document-paths",{clearGroups:["whole-project"]});function Y(t,e={}){let r=w(e);return[...K.get(t,r,()=>{let i=e.scope?"AND relative_path LIKE ?":"",n=e.like?"AND relative_path LIKE ?":"",a=[...e.scope?[`%${e.scope}%`]:[],...e.like?[e.like]:[]],o=t.all(`SELECT relative_path
|
|
60
|
-
FROM documents
|
|
61
|
-
WHERE 1 = 1
|
|
62
|
-
${t.pathExclusionsFor("documents")}
|
|
63
|
-
${i}
|
|
64
|
-
${n}
|
|
65
|
-
ORDER BY relative_path`,...a).map(l=>l.relative_path),c=e.extensions?o.filter(l=>e.extensions.some(u=>l.toLowerCase().endsWith(u.toLowerCase()))):o;return e.includeIgnored===!1?c.filter(l=>!t.isIgnored(l)):c})]}function w(t){let e=t.extensions?[...new Set(t.extensions.map(r=>r.toLowerCase()))].sort():null;return JSON.stringify({scope:t.scope??null,like:t.like??null,extensions:e,includeIgnored:t.includeIgnored!==!1})}export{p as a,x as b,H as c,j as d,G as e,Y as f,R as g};
|
|
66
|
-
//# sourceMappingURL=chunk-FJH2NW7J.js.map
|
package/dist/chunk-FTFP6O3L.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-S7OYBOCK.js";import{c as y}from"./chunk-UJCOIXDY.js";import{a as R,b as k,c as C,i as b}from"./chunk-26QA6FAI.js";import{l as v}from"./chunk-HX7M4BDI.js";import{d as h}from"./chunk-EKZTZXHZ.js";import{E as f,F as g}from"./chunk-WCCFZ7V7.js";import{c as m}from"./chunk-C3KV2II6.js";function _(e,a){let n=m(a),t=[],r="complete",o=C(n);o==="entry"&&s(t,"operational-root","structural entrypoint path"),o==="worker"&&s(t,"operational-root","worker launch convention"),b(n)&&s(t,"operational-root","framework-discovered entrypoint"),L(e,n)&&s(t,"operational-root","configured entry root");let l=!1;try{l=R(e,n),l&&s(t,"published-api","package manifest export");for(let i of k(e,n))s(t,"operational-root",i)}catch(i){r="partial",s(t,"metadata-unavailable",`package metadata unavailable: ${x(i)}`)}try{let i=f(e.config.projectRoot,n,{maxBytes:8388608,inputKind:"change-surface source"});w(i)&&s(t,"operational-root","module contains a direct-execution process guard")}catch(i){r="partial",s(t,"metadata-unavailable",g(i)?"indexed source file is unavailable on disk":`source metadata unavailable: ${x(i)}`)}return{operationalRoot:t.some(i=>i.kind==="operational-root"),publishedApi:l,coverage:r,reasons:t}}function L(e,a){let n=e.config.entryRoots;return n?n.files?.some(t=>m(t)===a)?!0:n.pathPrefixes?.some(t=>a.startsWith(m(t)))??!1:!1}function w(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,a,n){e.some(t=>t.kind===a&&t.detail===n)||e.push({kind:a,detail:n})}function x(e){return e instanceof Error?e.message:String(e)}function q(e,a,n={}){let t=S(e,a);if(!t)return null;let r=D(e,t);if(!r||e.isIgnored(r.relative_path))return null;let o=[],l=0,i=M(e,r.relative_path),p=_(e,r.relative_path),F=n.semantic===!1?new Map:v(e,i);for(let u of i){let c=I(e,r,u,F.get(u.symbolId)??new Set);l+=c;let d=N(c),E=[...p.reasons,...c>0?[{kind:"external-consumers",detail:`${c} external consumer${c===1?"":"s"}`}]:[]];o.push({symbol:u.symbol,shortName:h(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:c,externalConsumerRiskLevel:d,riskLevel:P(d,p),riskReasons:E})}return{file:r.relative_path,symbols:o,totalExternalConsumers:l,fileRisk:p}}function D(e,a){return e.get(`SELECT id, relative_path FROM documents
|
|
2
|
-
WHERE relative_path = ?
|
|
3
|
-
${e.pathExclusionsFor("documents")}
|
|
4
|
-
LIMIT 1`,a)??null}function M(e,a){return new y(e).definitionsForFile(a).sort((n,t)=>n.startLine-t.startLine||n.endLine-t.endLine)}function I(e,a,n,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
|
|
5
|
-
FROM mentions m
|
|
6
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
-
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
8
|
-
WHERE m.symbol_id = ?
|
|
9
|
-
AND m.role != 1
|
|
10
|
-
AND c.document_id != ?`,n.symbolId,a.id);return new Set([...r.map(o=>o.relative_path),...[...t].filter(o=>o!==a.relative_path)]).size}function N(e){return e>10?"high":e>0?"medium":"low"}function P(e,a){return e==="high"?"high":e==="medium"||a.operationalRoot||a.publishedApi||a.coverage==="partial"?"medium":"low"}export{q as a};
|
|
11
|
-
//# sourceMappingURL=chunk-FTFP6O3L.js.map
|
package/dist/chunk-FYLK2DEJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as m,d}from"./chunk-26QA6FAI.js";import{a as $}from"./chunk-C43RDDP4.js";function v(r,e={}){return P(r,e).cycles}function P(r,e={}){let{scope:s,maxDepth:i=10}=e,n=$(r,s,{scipEdges:"imports-only"}),c=[],a=new Set,l=new Set,f=[],g=!1;function b(t,o){if(o>i){g=!0;return}if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),y=u.indexOf(u.reduce((C,D)=>C<D?C:D)),p=[...u.slice(y,-1),...u.slice(0,y),u[y]],k=p.join(" -> ");S.has(k)||(S.add(k),c.push({path:p,kind:w(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let x=n.get(t);if(x)for(let h of x)b(h,o+1);f.pop(),l.delete(t)}let S=new Set;for(let t of n.keys())a.has(t)||b(t,0);return c.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),{cycles:c,truncated:g,maxDepth:i}}function w(r){for(let i of r){let n=m(i);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(r.length!==3)return"real";let[e,s]=r;return!e||!s?"real":d(e)||d(s)||B(e,s)||B(s,e)||R(e,s)||R(s,e)||m(e)==="entry"||m(s)==="entry"?"module-hierarchy":"real"}function B(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=e.replace(/\.rs$/,"/");return r.startsWith(s)?!r.slice(s.length).includes("/"):!1}function R(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=r.replace(/\.rs$/,""),i=e.replace(/\.rs$/,"");if(s===i+"_tests"||s===i+"/tests")return!0;let n=r.split("/"),c=e.split("/");if(n.length===c.length&&n.includes("tests")&&c.includes("src")){let a=n[n.length-1],l=c[c.length-1];if(a&&a===l)return!0}return!1}export{v as a,P as b};
|
|
2
|
-
//# sourceMappingURL=chunk-FYLK2DEJ.js.map
|