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
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{y as Y,z as we}from"./chunk-4UUCUASK.js";import{Ad as z,Ba as fe,Be as ke,C as pe,Cd as R,Ce as We,Dd as _,Ea as F,Ed as Re,Ja as H,Ka as me,La as ye,Me as Ee,Nd as J,Oa as I,Od as Ie,Pa as ge,Pd as K,Qa as ve,Qd as be,Rd as Ce,Sd as Q,Va as w,W as S,g as C,id as g,jd as Se,kd as T,ld as V,md as q,rd as k,sd as U,ua as N,za as he,zd as B}from"./chunk-OIVZ7PW6.js";import{spawn as bt}from"child_process";import{existsSync as Ct,rmSync as xe}from"fs";import{dirname as wt,resolve as $}from"path";import{fileURLToPath as kt}from"url";import{createHash as rt,randomUUID as Ae}from"crypto";import{existsSync as nt,linkSync as it,readdirSync as ot,rmSync as st}from"fs";import{basename as at,dirname as ct,join as v}from"path";var O=1,dt=10*6e4,Yt=10080*6e4,X="requests",lt="claims",ut="completions",pt="staging";function Pe(e,t,r={}){let n=r.now?.()??new Date,i=St(r.ttlMs),o=Rt(r.idempotencyKey),d=o?`key-${rt("sha256").update(o).digest("hex")}`:`request-${(r.randomId??Ae)()}`,s={version:O,requestId:d,...o?{idempotencyKey:o}:{},createdAt:n.toISOString(),deadlineAt:new Date(n.getTime()+i).toISOString(),detail:t.trim().slice(0,2048)||"stale index observed by a command"},c=vt(e,d),a=mt(e,c,s,r.onStage);if(a.published)return{disposition:"accepted",request:s,achievedDurability:a.achievedDurability,directorySync:a.directorySync};let l=Z(c);if(!l)throw new Error(`Watch refresh request identity ${d} exists but is malformed.`);return{disposition:"duplicate",request:l}}function Xt(e){let t=yt(e),r=new Map,n=gt(v(e,X),Z);for(let c of D(v(e,ut))){let a=ft(c);if(!a){n++;continue}r.set(a.requestId,a)}let i=new Set;for(let c of D(v(e,lt))){let a=ht(c);if(!a){n++;continue}i.add(a.requestId)}let o=t.filter(c=>!r.has(c.requestId)&&!i.has(c.requestId)),d=[...r.values()].filter(c=>c.outcome==="completed").length,s=[...r.values()].filter(c=>c.outcome==="expired").length;return{pending:o.length,claimed:t.filter(c=>!r.has(c.requestId)&&i.has(c.requestId)).length,completed:d,expired:s,invalid:n,...o.length>0?{oldestPendingAt:o.map(c=>c.createdAt).reduce((c,a)=>It(c,a))}:{}}}function Z(e){return ee(e,t=>{let r=t;return r.version===O&&W(r.requestId)&&(r.idempotencyKey===void 0||typeof r.idempotencyKey=="string")&&C(r.createdAt)&&C(r.deadlineAt)&&Date.parse(r.deadlineAt)>=Date.parse(r.createdAt)&&typeof r.detail=="string"&&r.detail.length>0})}function ht(e){return ee(e,t=>{let r=t;return r.version===O&&W(r.requestId)&&W(r.claimId)&&C(r.claimedAt)})}function ft(e){return ee(e,t=>{let r=t;return r.version===O&&W(r.requestId)&&(r.claimId===void 0||W(r.claimId))&&(r.outcome==="completed"||r.outcome==="expired")&&C(r.completedAt)})}function mt(e,t,r,n){let i=v(e,pt),o=ct(t),d=H(i),s=H(o),c=v(i,`${at(t)}.${process.pid}.${Ae()}.tmp`);try{let a=U(c,r,{spacing:2,trailingNewline:!0});n?.("after-staged");try{it(c,t)}catch(u){if(u.code==="EEXIST")return{published:!1};throw u}let l=ye(d,s,a.directorySync,me(o));return n?.("after-published"),{published:!0,achievedDurability:l==="synced"?"directory-durable":"file-flushed",directorySync:l}}finally{st(c,{force:!0})}}function yt(e){let t=[];for(let r of D(v(e,X))){let n=Z(r);n&&t.push(n)}return t}function gt(e,t){return D(e).filter(r=>!t(r)).length}function D(e,t=".json"){return nt(e)?ot(e,{withFileTypes:!0}).filter(r=>r.isFile()&&r.name.endsWith(t)).map(r=>v(e,r.name)).sort():[]}function ee(e,t){try{let r=JSON.parse(S(e,"watch refresh request record"));return t(r)?r:null}catch{return null}}function vt(e,t){return v(e,X,`${t}.json`)}function St(e){if(e===void 0)return dt;if(!Number.isFinite(e)||e<=0)throw new Error("Watch refresh request ttlMs must be positive.");return Math.floor(e)}function Rt(e){let t=e?.trim();return t?t.slice(0,512):void 0}function W(e){return typeof e=="string"&&/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)}function It(e,t){return Date.parse(t)<Date.parse(e)?t:e}var Te=5e3,Wt=6e3,Et=1e3,re=10,At=new Set(["capabilities","check-deps","config-validate","continue","doctor","init","install-skills","reindex","setup","setup-agent","status","suppress","uninstall","watch"]);function gr(e){let t=e.classification;if(t.kind!=="live")return;let{state:r}=t;return r.watcher.state==="idle"&&r.lastError===void 0?r.indexGeneration:void 0}function Pt(e,t=process.env){return t.SCIP_QUERY_SKIP_WATCH_SERVICE!=="1"&&!e.startsWith("__")&&!At.has(e)}function vr(e){let t=e.env??process.env;if(t.SCIP_QUERY_SKIP_WATCH_SERVICE==="1")return{kind:"skipped",reason:"environment"};if(!Pt(e.commandName,t))return{kind:"skipped",reason:"excluded-command"};if(e.config.watch?.enabled!==!0)return{kind:"skipped",reason:"disabled"};try{let r=xt({projectRoot:e.projectRoot,cacheDir:e.cacheDir,cliVersion:e.cliVersion,gitContext:e.gitContext,runtime:e.runtime});return{kind:r.disposition,state:r.state}}catch(r){return{kind:"failed",message:r instanceof Error?r.message:String(r)}}}function Oe(e,t,r){let n=F($(e));if(r&&F(r.projectRoot)===n)return{projectRoot:n,worktreeKind:"git",worktreeId:r.worktreeId,cliVersion:t};let i=he(n);if(i.kind==="error")throw new Error(`Could not establish Git worktree identity for ${n}: ${i.message}`);return i.kind==="non-git"?{projectRoot:n,worktreeKind:"non-git",cliVersion:t}:{projectRoot:n,worktreeKind:"git",worktreeId:i.identity.worktreeId,cliVersion:t}}function Sr(e){return M(e,Oe(e.projectRoot,e.cliVersion,e.gitContext))}function M(e,t){let r=e.runtime??se,n=R(e.cacheDir),i=_(n.statePath),o=oe(n.lockPath);return{identity:t,classification:Tt(i,t,r.now(),r.isProcessAlive),lock:o,lockIsLive:o!==null&&r.isProcessAlive(o.pid),paths:n}}function xt(e){let t=e.runtime??se,r=Oe(e.projectRoot,e.cliVersion,e.gitContext),n=M(e,r),i=ne("ensure",n.classification);if(i.kind==="reuse")return L(n.paths.activityPath,t),{disposition:"reused",state:i.state};if(i.kind==="refuse-replace")throw new Error(`scip-query watch service pid ${i.state.pid} is still alive but its heartbeat is old. Refusing automatic replacement because civil-clock age alone cannot authorize a process signal.`);if(i.kind==="replace")ie(i.state,e,t),E(n.paths,i.state.pid,t);else if(i.kind==="start"){if(n.lockIsLive){let s=qe(e,r,t,Math.min(e.startupTimeoutMs??1e3,1e3));if(s)return L(n.paths.activityPath,t),{disposition:"reused",state:s};throw new Error(`scip-query watch is already running for ${$(e.projectRoot)} (pid ${n.lock?.pid}; lock: ${n.paths.lockPath}) without compatible daemon state. Stop the foreground watcher before starting the service.`)}n.classification.kind==="stale"&&E(n.paths,n.classification.state.pid,t)}else throw new Error(`Unexpected ensure action: ${i.kind}`);if(n=M(e,r),i=ne("ensure",n.classification),i.kind==="reuse")return L(n.paths.activityPath,t),{disposition:"reused",state:i.state};if(i.kind==="refuse-replace")throw new Error(`scip-query watch service pid ${i.state.pid} remains alive with an old heartbeat; automatic replacement is not authorized.`);let o=e.serverPath??kt(new URL("./watch-server.js",import.meta.url));t.spawnServer(o,r.projectRoot,e.cliVersion,e.watchOverrides??{});let d=qe(e,r,t,e.startupTimeoutMs??Te);if(!d)throw new Error(`scip-query watch service did not become ready within ${e.startupTimeoutMs??Te}ms.`);return L(n.paths.activityPath,t),{disposition:"started",state:d}}function Le(e){let t=e.runtime??se,r=R(e.cacheDir),n=_(r.statePath),i=n?_e(n,t)?{kind:"live",state:n}:{kind:"stale",state:n,reason:"dead-process"}:{kind:"stopped"},o=ne("stop",i);if(o.kind==="signal-stop")return ie(o.state,e,t),E(r,o.state.pid,t),{disposition:"stopped",pid:o.state.pid};if(o.kind==="clean-stale")return E(r,o.state.pid,t),{disposition:"stopped",pid:o.state.pid};let d=oe(r.lockPath);return o.kind==="already-stopped"&&d?(_e(d,t)&&ie(d,e,t),E(r,d.pid,t),{disposition:"stopped",pid:d.pid}):{disposition:"already-stopped"}}function Me(e,t=Date.now()){k(e,{version:1,at:new Date(t).toISOString()})}function Rr(e,t,r=Date.now(),n={}){Pe(R(wt(e)).refreshRequestsPath,t,{...n,now:()=>new Date(r)}),Me(e,r)}function Ir(e,t,r={}){let n=r.pid??process.pid,i=r.isProcessAlive??g,o=()=>{},d=r.readProcessIdentity??V,s=r.now??(()=>new Date),c={...J,wallNow:()=>s().getTime(),isProcessAlive:i,readProcessIdentity:d},a=Ie(e,{kind:"watch",pid:n,processIdentity:d(n),detail:{projectRoot:$(t)},parseLegacy:G,runtime:c});if(a.kind==="contended"){let l=Ge(a.observation);return{acquired:!1,lockPath:e,message:qt(e,t,l),release:o}}return{acquired:!0,lockPath:e,message:"",release:()=>{a.lock.release()}}}function oe(e){return Ge(K(e,{parseLegacy:G}))}var G=e=>{let t=$e(e);return t?{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}:null};function Ge(e){if(e.state==="valid"&&e.record?.kind==="watch"){let t=e.record.detail?.projectRoot;return typeof t!="string"?null:{version:1,pid:e.record.pid,...e.record.processIdentity?{processIdentity:e.record.processIdentity}:{},projectRoot:t,startedAt:e.record.startedAt}}return $e(e.parsed)}function $e(e){try{let t=e;if(t.version!==1||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||!Re(t.startedAt))return null;let r=t.processIdentity===void 0?null:Se(t.processIdentity);return t.processIdentity!==void 0&&(!r||r.pid!==t.pid)?null:{version:1,pid:t.pid,...r?{processIdentity:r}:{},projectRoot:t.projectRoot,startedAt:t.startedAt}}catch{return null}}function Tt(e,t,r,n){if(!e)return{kind:"stopped"};if(e.protocolVersion!==B)return{kind:"incompatible",state:e,reason:"protocol"};if(e.projectRoot!==t.projectRoot)return{kind:"incompatible",state:e,reason:"project"};let i=t.worktreeKind==="git"?t.worktreeId:void 0;if(e.worktreeId!==i)return{kind:"incompatible",state:e,reason:"worktree"};if(e.cliVersion!==t.cliVersion)return{kind:"incompatible",state:e,reason:"cli-version"};if(!n(e.pid))return{kind:"stale",state:e,reason:"dead-process"};let o=Date.parse(e.heartbeatAt);return r-o>z?{kind:"stale",state:e,reason:"old-heartbeat"}:{kind:"live",state:e}}function ne(e,t){switch(e){case"status":return{kind:"report",classification:t};case"ensure":switch(t.kind){case"stopped":return{kind:"start"};case"stale":return t.reason==="old-heartbeat"?{kind:"refuse-replace",state:t.state,reason:"old-heartbeat"}:{kind:"start"};case"live":return{kind:"reuse",state:t.state};case"incompatible":return{kind:"replace",state:t.state};default:return te(t)}case"stop":switch(t.kind){case"stopped":return{kind:"already-stopped"};case"stale":return t.reason==="old-heartbeat"?{kind:"signal-stop",state:t.state}:{kind:"clean-stale",state:t.state};case"live":case"incompatible":return{kind:"signal-stop",state:t.state};default:return te(t)}default:return te(e)}}function qe(e,t,r,n){let i=r.monotonicNow??q,o=i()+n;for(;i()<=o;){let d=M(e,t).classification;if(d.kind==="live")return d.state;r.sleep(re)}return null}function ie(e,t,r){let{pid:n}=e;if(!r.isProcessAlive(n))return;De(e,r),r.signalProcess(n);let i=t.stopTimeoutMs??Wt,o=r.monotonicNow??q,d=o()+i;for(;o()<=d;){if(!r.isProcessAlive(n))return;r.sleep(re)}if(!r.forceSignalProcess)throw new Error(`scip-query watch service pid ${n} did not stop within ${i}ms and forced termination is unavailable.`);De(e,r),r.forceSignalProcess(n);let s=t.forceStopTimeoutMs??Et,c=o()+s;for(;o()<=c;){if(!r.isProcessAlive(n))return;let a=r.readProcessIdentity(n);if(e.processIdentity&&a&&!T(e.processIdentity,a))return;r.sleep(re)}throw new Error(`scip-query watch service pid ${n} remained alive ${s}ms after forced termination.`)}function E(e,t,r){if(xe(e.statePath,{force:!0}),xe(e.activityPath,{force:!0}),oe(e.lockPath)?.pid===t){let i={...J,wallNow:r.now,isProcessAlive:r.isProcessAlive,readProcessIdentity:r.readProcessIdentity},o=K(e.lockPath,{parseLegacy:G,runtime:i});be(e.lockPath,o,{parseLegacy:G,runtime:i})}}function _e(e,t){if(!t.isProcessAlive(e.pid))return!1;if(!e.processIdentity)return!0;let r=t.readProcessIdentity(e.pid);return r===null||T(e.processIdentity,r)}function qt(e,t,r){return`error: scip-query watch is already running for ${$(t)}${r?` (pid ${r.pid}, started ${r.startedAt}; lock: ${e})`:` (lock: ${e})`}. Stop that watcher before starting another.`}function L(e,t){try{(t.recordActivity??Me)(e,t.now())}catch(r){let n=_t(r);if(n!=="EPERM"&&n!=="EACCES"&&n!=="EROFS")throw r}}function _t(e){return e.code}var se={now:Date.now,monotonicNow:q,isProcessAlive:g,readProcessIdentity:V,spawnServer(e,t,r,n){if(!Ct(e))throw new Error(`Watch service helper was not found at ${e}. Run npm run build first.`);bt(process.execPath,[e,t,r,JSON.stringify(n)],{detached:!0,stdio:"ignore",env:{...process.env,SCIP_QUERY_SKIP_WATCH_SERVICE:"1"}}).unref()},signalProcess(e){process.kill(e,"SIGTERM")},forceSignalProcess(e){process.kill(e,"SIGKILL")},sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)}};function De(e,t){if(!e.processIdentity)throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its ownership record has no process identity.`);let r=t.readProcessIdentity(e.pid);if(!r)throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its process identity is unavailable.`);if(!T(e.processIdentity,r))throw new Error(`Refusing to signal scip-query watch pid ${e.pid}: its process identity does not match the ownership record.`)}function te(e){throw new Error(`Unhandled watch service value: ${JSON.stringify(e)}`)}import{existsSync as j,lstatSync as A,readdirSync as Fe,realpathSync as je,rmSync as b,statSync as He}from"fs";import{join as p,resolve as P,sep as Ve}from"path";var Dt=3600*1e3,Ot=2*1024*1024*1024,Ue=300*1e3,Lt="gc-state.json",Mt="gc.lock";function Gt(e){let t=e.leases.filter(s=>s.managed&&!s.live&&!s.busy),r=Be(e.leases,e.locks),n={};for(let s of e.generations)r.has(s.generationId)||(n[s.generationId]=s.unreferencedAt??e.nowMs);let i=e.generations.filter(s=>!r.has(s.generationId)).sort((s,c)=>n[s.generationId]-n[c.generationId]||s.generationId.localeCompare(c.generationId)),o=new Set;for(let s of i)e.nowMs-n[s.generationId]>=e.policy.generationTtlMs&&o.add(s.generationId);let d=e.generations.filter(s=>!o.has(s.generationId)).reduce((s,c)=>s+c.size,0);for(let s of i){if(d<=e.policy.budgetBytes)break;o.has(s.generationId)||(o.add(s.generationId),d-=s.size)}for(let s of o)delete n[s];return{deleteWorktrees:t,deleteGenerations:e.generations.filter(s=>o.has(s.generationId)),deleteLocks:e.locks.filter(s=>!s.live),deleteTemporaries:e.temporaries.filter(s=>!s.live),protectedGenerationIds:[...r].sort(),unreferencedSince:n}}function Be(e,t){let r=new Set(e.filter(n=>n.managed&&(n.live||n.busy)).flatMap(n=>[n.lease.baseGenerationId,n.lease.activeGenerationId]).filter(n=>n!==void 0));for(let n of t)n.live&&r.add(n.generationId);return r}function Lr(e,t,r={}){if(!ve())return{kind:"disabled"};let n=r.repositoryId===void 0?N(e)?.repositoryId:r.repositoryId;if(!n)return{kind:"unavailable"};let i=p(I(),"repositories",n),o=(r.now??Date.now)(),d=j(i)?ze(e,i,n,t,o,r):{kind:"unavailable"};return $t(e,n,t,o,r),d}function ze(e,t,r,n,i,o){let d=p(t,"gc-state.json"),s=Ke(d);if(!o.force&&s&&i-Date.parse(s.lastSweepAt)<Ue)return{kind:"throttled",sweptAt:s.lastSweepAt};let c=Ce(t,{now:()=>i});if(!c)return{kind:"busy"};try{let a=Je(e,t,r,s?.unreferencedSince??{}),l=Gt({nowMs:i,...a,policy:{generationTtlMs:o.policy?.generationTtlMs??Dt,budgetBytes:o.policy?.budgetBytes??Ot}}),u=0,f=0;for(let h of l.deleteWorktrees){if(!de(h.lease))continue;if(!j(h.lease.localCacheDir)){b(h.leasePath,{force:!0}),f+=1;continue}if(!Nt(h.lease))continue;let ue=Q(p(h.lease.localCacheDir,"cache-lifecycle.lock"));if(ue)try{if(ae(h.lease,!0))continue;try{Le({projectRoot:h.lease.projectRoot,cacheDir:h.lease.localCacheDir,cliVersion:n})}catch{continue}if(ae(h.lease,!0))continue;b(h.lease.localCacheDir,{recursive:!0,force:!0}),b(h.leasePath,{force:!0}),f+=1}finally{ue.release()}}for(let h of l.deleteLocks)b(h.path,{force:!0});for(let h of l.deleteTemporaries)b(h.path,{recursive:!0,force:!0});for(let h of l.deleteGenerations)b(h.path,{recursive:!0,force:!0}),u+=h.size;pe(p(t,"evidence.db"));let y={kind:"swept",sweptAt:new Date(i).toISOString(),deletedWorktrees:f,deletedGenerations:l.deleteGenerations.length,deletedBytes:u,protectedGenerations:l.protectedGenerationIds.length},m={version:1,lastSweepAt:y.sweptAt,unreferencedSince:l.unreferencedSince,lastResult:y};return k(d,m,{spacing:2,trailingNewline:!0}),y}catch(a){return{kind:"failed",error:a instanceof Error?a.message:String(a)}}finally{c.release()}}function $t(e,t,r,n,i){let o=p(I(),"repositories");if(!j(o))return;let d=p(o,Lt),s=Ht(d);if(!i.force&&s!==void 0&&n-s<Ue)return;let c=Q(p(o,Mt));if(c)try{for(let a of x(o)){if(a===t||!/^[a-f0-9]{24}$/.test(a))continue;let l=p(o,a),u;try{u=A(l)}catch{continue}if(!u.isDirectory()||u.isSymbolicLink())continue;let f=Ft(l)??e;ze(f,l,a,r,n,i)}k(d,{version:1,lastSweepAt:new Date(n).toISOString()},{spacing:2,trailingNewline:!0})}finally{c.release()}}function Mr(e,t,r){let n=ke(e,r.dbPath,t);if(n)return{state:"bypassed",reason:n,localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let i=N(e);if(!i)return{state:"unavailable",reason:"Git worktree identity is unavailable",localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let o=p(I(),"repositories",i.repositoryId),d=le(p(o,"worktrees",`${i.worktreeId}.json`)),s=Ke(p(o,"gc-state.json")),c=Je(e,o,i.repositoryId,s?.unreferencedSince??{}),a=Be(c.leases,c.locks),l=c.generations.filter(m=>!a.has(m.generationId)),u=c.generations.reduce((m,h)=>m+h.size,0),f=We(e,t),y=0;return f&&(y=jt(f)),{state:"managed",repositoryId:i.repositoryId,worktreeId:i.worktreeId,localCacheDir:r.cacheDir,...d?{baseGenerationId:d.baseGenerationId,activeGenerationId:d.activeGenerationId,lastAction:d.lastAction,reason:d.lastReason,lastSeenAt:d.lastSeenAt}:{},generations:c.generations.length,generationBytes:u,protectedGenerations:c.generations.filter(m=>a.has(m.generationId)).length,unreferencedGenerations:l.length,unreferencedBytes:l.reduce((m,h)=>m+h.size,0),temporaryGenerations:c.temporaries.length,sharedEvidence:{path:f,exists:y>0,bytes:y},cleanup:s?.lastResult}}function jt(e){return[e,`${e}-wal`,`${e}-shm`].reduce((t,r)=>{try{return t+He(r).size}catch{return t}},0)}function Je(e,t,r,n){let i=new Set(fe(e).map(a=>P(a.path))),o=[];for(let a of x(p(t,"worktrees"))){if(!a.endsWith(".json"))continue;let l=p(t,"worktrees",a),u=le(l);if(!u)continue;let f=P(u.projectRoot);o.push({leasePath:l,lease:u,managed:u.repositoryId===r&&de(u),live:i.has(f)||j(f),busy:ae(u)})}let d=[];for(let a of x(p(t,"locks"))){let l=/^([a-f0-9]{64})\.lock$/.exec(a);if(!l)continue;let u=p(t,"locks",a),f=ce(u),y=f!==void 0&&g(f),m=l[1];d.push({generationId:m,path:u,live:y})}let s=[],c=[];for(let a of x(p(t,"generations"))){let l=/^\.tmp-(\d+)-/.exec(a);if(l){let y=p(t,"generations",a),m=Number(l[1]);try{c.push({path:y,size:Ne(y),live:Number.isSafeInteger(m)&&g(m)})}catch{}continue}if(!/^[a-f0-9]{64}$/.test(a))continue;let u=p(t,"generations",a),f;try{f=A(u)}catch{continue}!f.isDirectory()||f.isSymbolicLink()||s.push({generationId:a,path:u,size:Ne(u),...n[a]===void 0?{}:{unreferencedAt:n[a]}})}return{leases:o,generations:s,locks:d,temporaries:c}}function de(e){if(e.ownershipChecksum!==Ee(e)||w(e.localCacheDir)!==w(ge(e.projectRoot)))return!1;let t=w(p(I(),"projects"));return w(e.localCacheDir).startsWith(`${t}${Ve}`)}function Nt(e){if(!de(e))return!1;let t=P(I()),r=P(p(t,"projects")),n=P(e.localCacheDir);try{let i=A(t),o=A(r),d=A(n);if(!i.isDirectory()||i.isSymbolicLink()||!o.isDirectory()||o.isSymbolicLink()||!d.isDirectory()||d.isSymbolicLink())return!1;let s=je(r);return je(n).startsWith(`${s}${Ve}`)}catch{return!1}}function Ft(e){for(let t of x(p(e,"worktrees"))){if(!t.endsWith(".json"))continue;let r=le(p(e,"worktrees",t));if(r)return r.projectRoot}}function ae(e,t=!1){for(let n of t?["index.lock"]:["index.lock","cache-lifecycle.lock"]){let i=ce(p(e.localCacheDir,n));if(i!==void 0&&g(i))return!0}let r=ce(R(e.localCacheDir).lockPath);return r!==void 0&&g(r)}function le(e){try{let t=JSON.parse(S(e,"worktree cache lease"));return t.version!==1||typeof t.repositoryId!="string"||typeof t.worktreeId!="string"||typeof t.projectRoot!="string"||t.treeOid!==void 0&&typeof t.treeOid!="string"||typeof t.localCacheDir!="string"||t.baseGenerationId!==void 0&&typeof t.baseGenerationId!="string"||t.activeGenerationId!==void 0&&typeof t.activeGenerationId!="string"||typeof t.ownershipChecksum!="string"||!/^[a-f0-9]{64}$/.test(t.ownershipChecksum)||typeof t.lastAction!="string"||t.lastReason!==void 0&&typeof t.lastReason!="string"||typeof t.lastSeenAt!="string"?null:t}catch{return null}}function ce(e){try{let t=JSON.parse(S(e,"watch lock record"));return typeof t.pid=="number"&&Number.isSafeInteger(t.pid)&&t.pid>0?t.pid:void 0}catch{return}}function Ke(e){try{let t=JSON.parse(S(e,"repository cache GC state"));return t.version!==1||typeof t.lastSweepAt!="string"||!Number.isFinite(Date.parse(t.lastSweepAt))||!t.unreferencedSince||typeof t.unreferencedSince!="object"||!t.lastResult?null:t}catch{return null}}function Ht(e){try{let t=JSON.parse(S(e,"global repository cache GC state"));if(t.version!==1||typeof t.lastSweepAt!="string")return;let r=Date.parse(t.lastSweepAt);return Number.isFinite(r)?r:void 0}catch{return}}function x(e){try{return Fe(e)}catch{return[]}}function Ne(e){let t=0,r=[e];for(;r.length>0;){let n=r.pop();for(let i of Fe(n,{withFileTypes:!0})){let o=p(n,i.name);i.isDirectory()?r.push(o):i.isFile()&&(t+=He(o).size)}}return t}var Qe=[{question:"Who can call or reach this?",family:"execution",direction:"incoming"},{question:"What can this call or reach?",family:"execution",direction:"outgoing"},{question:"Where can this value come from?",family:"dataflow",direction:"incoming"},{question:"Where can this value go?",family:"dataflow",direction:"outgoing"},{question:"Which producer and consumer rendezvous?",family:"runtime",direction:"both"},{question:"What resource is observed or changed?",family:"state",direction:"both"},{question:"What occurs before or after this?",family:"temporal",direction:"both"},{question:"What interface constrains this?",family:"contract",direction:"both"},{question:"Are these observations the same entity?",family:"identity",direction:"both"},{question:"What contains or owns this?",family:"ownership",direction:"both"},{question:"What does this statically rely on?",family:"dependencies",direction:"outgoing"}],Ye={execution:{establishes:"Static may-call reachability between resolved program constructs.",nonClaims:["A may-call edge does not prove that a runtime invocation occurred."]},runtime:{establishes:"A source-grounded handoff between producer and consumer participants through a runtime mechanism.",nonClaims:["An unresolved or candidate join does not prove a runtime handoff."]},dataflow:{establishes:"A value, definition, argument, parameter, return, or statically resolved value may flow to another construct.",nonClaims:["Current partial providers do not establish general interprocedural definition-use coverage."]},state:{establishes:"A construct reads, writes, creates, deletes, or otherwise changes an identified state resource.",nonClaims:["A state edge does not prove transactionality, durability, or exclusive ownership unless qualified."]},temporal:{establishes:"One observed construct is locally ordered before or after another under the reported source evidence.",nonClaims:["Source order does not imply cross-process happens-before or durability."]},contract:{establishes:"A program construct implements, constrains, or is typed by an identified contract.",nonClaims:["Contract identity does not prove runtime invocation or conformance outside reported checks."]},identity:{establishes:"Two observations refer to the same compiler-owned or source-owned program entity.",nonClaims:["Shared identity does not establish execution or value transfer."]},ownership:{establishes:"A source construct, symbol, runtime observation, or state resource is contained or owned by another program entity.",nonClaims:["Structural ownership does not establish lifetime, singleton scope, or runtime execution unless qualified."]},dependencies:{establishes:"A file, module, or symbol statically relies on another indexed entity.",nonClaims:["A dependency edge does not establish that the depended-on code executes."]}};function Xe(e){return Y.flatMap(t=>t.relations.filter(r=>r.family===e).map(r=>({...r,providerId:t.id,providerLabel:t.label})))}function Ze(e){return[...new Set(Y.filter(t=>t.relations.some(r=>r.family===e)).map(t=>t.label))]}var Nr=we.map(e=>({family:e,...Ye[e],providers:Ze(e),relations:Xe(e)}));function et(e){return{family:e,...Ye[e],providers:Ze(e),relations:Xe(e)}}var Vr=["search","outline","entrypoints","evidence","inspect","code"];function Ur(){return Qe.map(e=>{let t=et(e.family);return{...e,establishes:t.establishes,evidenceStrengths:tt(t.relations.flatMap(r=>r.evidenceStrengths)),supportCeilings:tt(t.relations.map(r=>r.supportCeiling)),nonClaim:t.nonClaims.join(" ")}})}function tt(e){return[...new Set(e)]}export{Nr as a,Xt as b,gr as c,Pt as d,vr as e,Sr as f,xt as g,Le as h,Rr as i,Ir as j,oe as k,Lr as l,Mr as m,Vr as n,Ur as o};
|
|
3
|
+
//# sourceMappingURL=chunk-6T7H2AFY.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as i}from"./chunk-HUZNZ3H2.js";import{a as o}from"./chunk-7COHFNJK.js";import{y as l}from"./chunk-5IZTXSOL.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
|
|
2
|
+
WHERE relative_path IN (${a})
|
|
3
|
+
ORDER BY relative_path`,...s).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)),p=l(e,n,{onlyDocumented:!0,sort:!0}).map(({relativePath:t,...f})=>f),m=o(e,"forward",s).filter(t=>!e.isIgnored(t)),d=o(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:n,symbols:p,dependsOn:m,dependedOnBy:d}}function g(e,r){return y(e,r)}export{y as a,g as b};
|
|
4
|
+
//# sourceMappingURL=chunk-73Z33VFI.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{v as M,w as _}from"./chunk-I3U2FN2T.js";import{a as S}from"./chunk-AA7K3XLM.js";import{c as I,g as A,i as F,r as m,v as G,w as b}from"./chunk-DMQ7ZKJG.js";var C=G({kind:"file-dependency-graph",invalidation:b("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:T}),x=I("file-dep-graph",{clearGroups:["whole-project"]});function Q(e,n,r){if(r.length===0)return[];let i=new Set(r),s=w(e),t=new Set;if(n==="forward")for(let c of i)for(let o of s.get(c)??[])i.has(o)||t.add(o);else for(let[c,o]of s)if(!i.has(c))for(let d of i)o.has(d)&&t.add(c);return[...t].sort()}function w(e,n,r={}){let i=r.scipEdges??"all-references",s=r.sourceEdges??"imports-only",t=N(n,i,s);return x.get(e,t,()=>{let c=new Set(S(e,{includeIgnored:!1})),o=F(e),d=0,a=0,u=null,O=!1,p=0,E=0,D=null;return m("file-dep-graph.product",()=>{if(o){let l=C.read(e,t,o);if(l){O=!0,D=l.construction;let y=$(l);return d=l.sourceFileCount,a=l.sourceEdgeCount,p=l.scipEdgeCount,E=y.size,u=l.sourceDependencyFingerprint,y}}let f=m("file-dep-graph.source-imports",()=>{let l=J(e,c,n,s);return d=l.files.length,a=l.edges.length,u=l.fingerprint,l},()=>({scope:n??null,sourceEdges:s,files:d,edges:a})),g=new Map,P=(l,y)=>h(e,g,c,l,y);m("file-dep-graph.scip-edges",()=>{for(let l of K(e,n,i))p=(p??0)+1,P(l.from_file,l.to_file)},()=>({scope:n??null,edges:p}));for(let l of f.edges)P(l.fromFile,l.toFile);return E=g.size,o&&(D="full",C.write(e,t,o,{version:2,construction:"full",sourceDependencyFingerprint:f.fingerprint,sourceFileCount:f.files.length,sourceEdgeCount:f.edges.length,scipEdgeCount:p,edgeCount:v(g),graph:R(g)})),g},()=>({scope:n??null,available:o!==null,hit:O,construction:D,files:d,sourceEdges:a,sourceEdgeMode:s,scipEdges:p,graphFiles:E,sourceDependencyFingerprint:u}))})}function X(e){let n=N(void 0,"all-references","imports-only"),r=w(e);return{cacheKey:n,graph:H(r)}}function Z(e,n,r){let i=F(e);if(!i)return!1;let s=N(void 0,"all-references","imports-only");if(n.cacheKey!==s)return!1;let t=new Set(S(e,{includeIgnored:!1})),c=new Set(r),o=new Map;for(let[d,a]of n.graph)if(!(c.has(d)||!t.has(d)))for(let u of a)h(e,o,t,d,u);for(let d of L(e,c,"all-references"))h(e,o,t,d.from_file,d.to_file);for(let d of c)if(t.has(d))for(let a of _(e,d))a.sourcePath&&h(e,o,t,d,a.sourcePath);return C.write(e,s,i,{version:2,construction:"carried",sourceDependencyFingerprint:null,sourceFileCount:t.size,sourceEdgeCount:null,scipEdgeCount:null,edgeCount:v(o),graph:R(o)}),!0}function J(e,n,r,i){let s=[],t=[];for(let c of n)if(!(r&&!c.includes(r))){s.push(c);for(let o of _(e,c))o.sourcePath&&t.push({fromFile:c,toFile:o.sourcePath});if(i==="imports-and-reexports")for(let o of M(e,c))o.sourcePath&&t.push({fromFile:c,toFile:o.sourcePath})}return{files:s,edges:t,fingerprint:k(s,t)}}function k(e,n){let r=n.map(i=>`${i.fromFile}\0${i.toFile}`).sort();return A(JSON.stringify({files:e,edges:r}))}function N(e,n,r){return`edge-mode-v4:${n}:${r}:${e??"<all>"}`}function R(e){return[...e].map(([n,r])=>[n,[...r].sort()]).sort(([n],[r])=>n.localeCompare(r))}function $(e){return new Map(e.graph.map(([n,r])=>[n,new Set(r)]))}function T(e){let n=JSON.parse(e);return j(n)?n:null}function j(e){if(!e||typeof e!="object")return!1;let n=e;return n.version===2&&(n.construction==="full"||n.construction==="carried")&&(n.sourceDependencyFingerprint===null||typeof n.sourceDependencyFingerprint=="string")&&typeof n.sourceFileCount=="number"&&(n.sourceEdgeCount===null||typeof n.sourceEdgeCount=="number")&&(n.scipEdgeCount===null||typeof n.scipEdgeCount=="number")&&typeof n.edgeCount=="number"&&Array.isArray(n.graph)&&n.graph.every(z)}function H(e){return new Map([...e].map(([n,r])=>[n,new Set(r)]))}function v(e){let n=0;for(let r of e.values())n+=r.size;return n}function z(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(n=>typeof n=="string")}function K(e,n,r){let i=n?"AND d1.relative_path LIKE ?":"",s=n?[`%${n}%`]:[],t=r==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
|
|
2
|
+
d1.relative_path AS from_file,
|
|
3
|
+
d2.relative_path AS to_file
|
|
4
|
+
FROM mentions m
|
|
5
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
+
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
+
JOIN (
|
|
9
|
+
SELECT m2.symbol_id, c2.document_id
|
|
10
|
+
FROM mentions m2
|
|
11
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
+
WHERE m2.role = 1
|
|
13
|
+
GROUP BY m2.symbol_id
|
|
14
|
+
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
+
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
+
WHERE d1.id != d2.id
|
|
17
|
+
${t}
|
|
18
|
+
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
+
${i}`,...s)}function L(e,n,r){let i=[...n].sort();if(i.length===0)return[];let s=r==="imports-only"?"AND m.role = 2":"AND m.role != 1",t=[];for(let c=0;c<i.length;c+=500){let o=i.slice(c,c+500),d=o.map(()=>"?").join(", ");t.push(...e.all(`SELECT DISTINCT
|
|
20
|
+
d1.relative_path AS from_file,
|
|
21
|
+
d2.relative_path AS to_file
|
|
22
|
+
FROM mentions m
|
|
23
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
24
|
+
JOIN documents d1 ON c.document_id = d1.id
|
|
25
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
26
|
+
JOIN (
|
|
27
|
+
SELECT m2.symbol_id, c2.document_id
|
|
28
|
+
FROM mentions m2
|
|
29
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
30
|
+
WHERE m2.role = 1
|
|
31
|
+
GROUP BY m2.symbol_id
|
|
32
|
+
) sym_def ON sym_def.symbol_id = gs.id
|
|
33
|
+
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
34
|
+
WHERE d1.id != d2.id
|
|
35
|
+
${s}
|
|
36
|
+
${e.pathExclusionsFor("d1","d2")}
|
|
37
|
+
AND d1.relative_path IN (${d})`,...o))}return t}function h(e,n,r,i,s){if(i===s||e.isIgnored(i)||e.isIgnored(s)||!r.has(s))return;let t=n.get(i);t||(t=new Set,n.set(i,t)),t.add(s)}export{Q as a,w as b,X as c,Z as d};
|
|
38
|
+
//# sourceMappingURL=chunk-7COHFNJK.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{$ as ue,F as ne,H as re,K as ie,M as k,N as se,T as oe,U as ce,V as ae,a as F,ba as le,e as P,f as B,g as _,h as te}from"./chunk-MO226P4Q.js";import{createRequire as ke}from"module";import{existsSync as Ne,lstatSync as Jt,readdirSync as Oe,statSync as Re}from"fs";import p from"path";import{AsyncLocalStorage as Te}from"async_hooks";var Ee=new Te;function j(e,t){let n=N(e);if(!n||n.missing.has(t))return;let r=n.files.get(t);if(r)return r;let i=n.readBaseFile?.(t);return i&&n.files.set(t,i),i}function x(e,t){let n=N(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function fe(e,t){return N(e)?.fingerprints.get(t)}function w(e){return N(e)?.paths}function N(e){let t=Ee.getStore();if(t)return t.projectRoot===ue(e)?t:void 0}var _e=ke(import.meta.url),pe=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function Ae(e,t=[]){let n=p.resolve(e),r=t.flatMap(a=>We(n,a));if(r.length>0)return ge(n,he(r));let i=De(n),s=he(i),o=Je(n,s)?[n,...s]:s,c=o.length>0?o:[n];return ge(n,c)}function me(e,t,n=[]){let r;try{r=_e("@ts-morph/common/dist/typescript.js")}catch{return null}let i=p.resolve(e),s=t==="workspace"?Ae(i,n):["."],o=new Set;for(let c of s){let a=c==="."?i:p.join(i,c),u=p.join(a,"tsconfig.json"),g=He(r,i);if(!g.fileExists(u))return null;let l=r.readConfigFile(u,g.readFile);if(l.error)return null;let f=r.parseJsonConfigFileContent(l.config,g,a);if(f.errors.length>0)return null;for(let S of f.fileNames){let d=p.resolve(S);P(i,d)&&o.add(p.relative(i,d).split(p.sep).join("/"))}}return o}function ge(e,t){return[...new Set(t.map(n=>v(e,n)))].sort((n,r)=>n.localeCompare(r))}function De(e){let t=w(e);if(t)return t.flatMap(i=>{if(i.split("/").some(o=>pe.has(o)))return[];let s=p.join(e,...i.split("/"));return de(e,s)?[p.dirname(s)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),s;try{s=Oe(i,{withFileTypes:!0})}catch{continue}for(let o of s){let c=p.join(i,o.name);if(o.isDirectory()){!pe.has(o.name)&&!o.name.startsWith(".")&&r.push(c);continue}o.isFile()&&de(e,c)&&n.push(p.dirname(c))}}return n}function We(e,t){let n=t.trim();if(!n)return[];let r=p.resolve(e,n);if(!P(e,r))return[];let i=w(e);if(i){let s=v(e,r);if(i.includes(s)&&A(p.basename(r)))return[p.dirname(r)];let o=s==="."?"":`${s}/`;return i.some(c=>c.startsWith(o))?[r]:[]}try{let s=Re(r);if(s.isDirectory())return[r];if(s.isFile()&&A(p.basename(r)))return[p.dirname(r)]}catch{return[]}return[]}function de(e,t){if(!A(p.basename(t)))return!1;let n=ye(e,t);return n?p.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function A(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function he(e){let t=[...new Set(e.map(n=>p.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&qe(n,r)))}function Je(e,t){if(t.length===0||t.some(r=>p.resolve(r)===e))return!1;let n=p.join(e,"tsconfig.json");return Ue(e,n)&&$e(e,n)}function $e(e,t){let r=ye(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!p.extname(i))):!1}function ye(e,t){try{let n=JSON.parse(Ke(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Ue(e,t){let n=v(e,t),r=x(e,n);return r?r==="present":Ne(t)}function Ke(e,t){let n=v(e,t);if(w(e)){let i=j(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return re(t,"TypeScript project config")}function He(e,t){let n=w(t);if(!n)return e.sys;let r=p.resolve(t),i=new Set(n),s=Ge(r,n),o=e,c=a=>{let u=p.resolve(a);return P(r,u)?v(r,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(a){let u=c(a);return u===null?e.sys.fileExists(a):i.has(u)},readFile(a){let u=c(a);return u===null?e.sys.readFile(a):j(r,u)?.content.toString("utf8")},readDirectory(a,u,g,l,f){let S=p.resolve(a);return P(r,S)?o.matchFiles(S,u,g,l,e.sys.useCaseSensitiveFileNames,r,f,d=>s.get(p.resolve(d))??{files:[],directories:[]},d=>d):e.sys.readDirectory(a,u,g,l,f)}}}function Ge(e,t){let n=new Map,r=new Map,i=s=>{n.has(s)||n.set(s,new Set),r.has(s)||r.set(s,new Set)};i(e);for(let s of t){let o=s.split("/"),c=e;for(let a=0;a<o.length-1;a+=1){let u=o[a];i(c),r.get(c).add(u),c=p.join(c,u),i(c)}n.get(c).add(o.at(-1))}return new Map([...n].map(([s,o])=>[s,{files:[...o].sort(),directories:[...r.get(s)??[]].sort()}]))}function v(e,t){let n=p.relative(e,t);return n?n.split(p.sep).join("/"):"."}function qe(e,t){let n=p.relative(e,t);return!!n&&!n.startsWith("..")&&!p.isAbsolute(n)}import{execFileSync as lt}from"child_process";import{isUtf8 as we}from"buffer";import{createHash as K}from"crypto";import{closeSync as Ie,fstatSync as L,lstatSync as G,openSync as ze,readdirSync as ft,readFileSync as pt,readSync as Be,readlinkSync as gt,realpathSync as T}from"fs";import{isAbsolute as dt,join as q,relative as ht,resolve as mt,sep as yt}from"path";import{closeSync as Se,existsSync as W,openSync as Ye,realpathSync as Ve,renameSync as Xe,unlinkSync as Fe,writeSync as Qe}from"fs";import{dirname as Ze,join as et}from"path";var tt="fingerprint-stat-cache.json",Pe=1,nt=8*1024*1024,D=new Map;function J(e,t,n,r){let i=be(e),s=i.files.get(t);if(!(!s||!je(s,n,r)))return i.hits+=1,{hash:s.hash,size:s.fingerprintSize}}function $(e,t,n,r,i){if(i.hash==="unreadable"||i.size<0||!Number.isFinite(i.size))return;let s=be(e),o={kind:n,dev:r.dev,ino:r.ino,mtimeMs:r.mtimeMs,ctimeMs:r.ctimeMs,size:r.size,hash:i.hash,fingerprintSize:i.size},c=s.files.get(t);c&&at(c,o)||(s.files.set(t,o),s.stores+=1,s.dirty=!0)}function U(e){let t=D.get(xe(e));if(!(!t?.dirty||!t.cachePath))try{let n=Ze(t.cachePath);if(!W(n))return;ut(t.cachePath,st(t)),t.dirty=!1}catch{}}function be(e){let t=xe(e),n=D.get(t);if(n)return n;let r=rt(t),i=it(r),s={cachePath:r,files:i,dirty:!1,hits:0,stores:0};return D.set(t,s),s}function rt(e){try{let t=le(e);return W(t)?et(t,tt):null}catch{return null}}function it(e){let t=new Map;if(!e||!W(e))return t;try{let n=JSON.parse(ne(e,{inputKind:"fingerprint stat cache",maxBytes:nt}).toString("utf8"));if(!ot(n))return t;for(let[r,i]of Object.entries(n.files))i&&t.set(r,i)}catch{return t}return t}function st(e){return{version:Pe,files:Object.fromEntries(e.files)}}function ot(e){if(typeof e!="object"||e===null)return!1;let t=e;return t.version!==Pe||typeof t.files!="object"||t.files===null?!1:Object.values(t.files).every(ct)}function ct(e){if(typeof e!="object"||e===null)return!1;let t=e;return(t.kind==="file"||t.kind==="symlink")&&Number.isFinite(t.dev)&&Number.isFinite(t.ino)&&Number.isFinite(t.mtimeMs)&&Number.isFinite(t.ctimeMs)&&Number.isFinite(t.size)&&Number.isFinite(t.fingerprintSize)&&typeof t.hash=="string"&&t.hash!=="unreadable"}function je(e,t,n){return e.kind===t&&e.dev===n.dev&&e.ino===n.ino&&e.mtimeMs===n.mtimeMs&&e.ctimeMs===n.ctimeMs&&e.size===n.size}function at(e,t){return je(e,t.kind,t)&&e.hash===t.hash&&e.fingerprintSize===t.fingerprintSize}function ut(e,t){let n=`${e}.${process.pid}.tmp`;try{Fe(n)}catch{}let r=Buffer.from(`${JSON.stringify(t)}
|
|
2
|
+
`,"utf8"),i=Ye(n,"wx",384);try{se(i,r,{writeFile:(s,o,c,a)=>Qe(s,o,c,a)},"fingerprint stat cache")}catch(s){throw Se(i),Fe(n),s}Se(i),Xe(n,e)}function xe(e){return Ve(e)}var E=64*1024*1024,St=1024*1024,Ft=1024,C=class extends Error{constructor(n,r,i,s){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${s} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=s;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function Pt(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function Y(e,t,n={}){let r=B(t),i=oe(e,()=>T(e)),s=mt(i,...r.split("/"));if(!P(i,s)||s===i)throw new F(t,"outside-project");let o=T(s);if(!P(i,o)||o===i)throw new F(t,"outside-project");let c=G(o);if(!c.isFile())throw new F(t,"not-a-file");let a={projectRoot:i,relativePath:r,absolutePath:o,size:c.size,mtimeMs:c.mtimeMs,device:c.dev,inode:c.ino},u=n.maxBytes??E;if(k(u),a.size>u)throw new C(n.inputKind??"project file",a.relativePath,a.size,u);return a}function bt(e,t,n={}){let r=B(t),i=x(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let a=j(e,r);if(!a)throw new F(r,"changed-during-read");let u=n.maxBytes??E;if(k(u),a.size>u)throw new C(n.inputKind??"project file",r,a.size,u);return Buffer.from(a.content)}let s=Y(e,t,n),o=n.maxBytes??E,c=ze(s.absolutePath,"r");try{let a=L(c);if(M(a,s,t),a.size>o)throw new C(n.inputKind??"project file",s.relativePath,a.size,o);let u=pt(c),g=L(c);if(M(g,s,t),u.byteLength!==a.size)throw new F(t,"changed-during-read");return u}finally{Ie(c)}}function gn(e,t,n,r={}){if(n.byteLength===0)throw new Error("Project file probe literal must not be empty.");let{matchedLiteralIndexes:i,...s}=jt(e,t,[n],r);return{...s,includesLiteral:i.length>0}}function jt(e,t,n,r={}){if(n.length===0||n.some(a=>a.byteLength===0))throw new Error("Project file probe literals must not be empty.");let i=B(t),s=x(e,i);if(s){if(s==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(i)} does not exist.`),{code:"ENOENT"});let a=j(e,i);if(!a)throw new F(i,"changed-during-read");let u=r.maxBytes??E;if(k(u),a.size>u)throw new C(r.inputKind??"project file",i,a.size,u);let g=!a.content.includes(0)&&we(a.content),l=n.map(Ce),f=g?wt(a.content,n,l):[];return{byteLength:a.size,isUtf8Text:g,matchedLiteralIndexes:f,bytes:f.length>0?Buffer.from(a.content):null,...r.computeSha256?{sha256:a.sha256}:{}}}let o=Y(e,t,r),c=ze(o.absolutePath,"r");try{let a=L(c);M(a,o,t);let u=r.computeSha256?K("sha256"):null,g=r.scratchBuffer??Buffer.allocUnsafe(St);if(g.byteLength===0)throw new Error("Project file probe scratch buffer must not be empty.");let l=0,f=n.map(()=>!1),S=!1,d=!0,b=Buffer.alloc(0),X=n.map(()=>Buffer.alloc(0)),Me=n.map(Ce);for(;l<a.size;){let m=Be(c,g,0,Math.min(g.byteLength,a.size-l),l);if(m<=0)throw new F(t,"changed-during-read");let y=g.subarray(0,m);if(u?.update(y),S||=y.includes(0),d){let h=b.byteLength>0?Buffer.concat([b,y]):y,z=xt(h);d=we(h.subarray(0,z)),b=Buffer.from(h.subarray(z))}for(let h=0;h<n.length;h+=1){if(f[h])continue;let z=n[h],ee=X[h];f[h]=Bt(y,z,ee,Me[h]),X[h]=Ct(y,z,ee)}l+=m}d&&=b.byteLength===0,M(L(c),o,t);let Q=!S&&d,Z=Q?f.flatMap((m,y)=>m?[y]:[]):[],I=null;if(Z.length>0){I=Buffer.allocUnsafe(a.size);let m=0;for(;m<I.byteLength;){let y=Be(c,I,m,I.byteLength-m,m);if(y<=0)throw new F(t,"changed-during-read");m+=y}M(L(c),o,t)}return{byteLength:a.size,isUtf8Text:Q,matchedLiteralIndexes:Z,bytes:I,...u?{sha256:u.digest("hex")}:{}}}finally{Ie(c)}}function dn(e,t,n={}){return bt(e,t,n).toString("utf8")}function M(e,t,n){if(!e.isFile()||e.dev!==t.device||e.ino!==t.inode||e.size!==t.size)throw new F(n,"changed-during-read")}function xt(e){if(e.byteLength===0)return 0;let t=e.byteLength-1,n=0;for(;t>=0&&n<3&&(e[t]&192)===128;)n+=1,t-=1;if(t<0)return e.byteLength;let r=e[t];return((r&128)===0?1:(r&224)===192?2:(r&240)===224?3:(r&248)===240?4:0)>e.byteLength-t?t:e.byteLength}function wt(e,t,n){return t.flatMap((r,i)=>H(e,r,n[i])?[i]:[])}function Bt(e,t,n,r){if(H(e,t,r))return!0;if(n.byteLength===0||t.byteLength===1)return!1;let i=e.subarray(0,Math.min(e.byteLength,t.byteLength-1));return H(Buffer.concat([n,i]),t,r)}function H(e,t,n){if(n<0)return e.includes(t);let r=t[n],i=e.indexOf(r),s=0;for(;i>=0;){if(s+=1,s>Ft)return e.includes(t);let o=i-n;if(o>=0&&o+t.byteLength<=e.byteLength&&e.compare(t,0,t.byteLength,o,o+t.byteLength)===0)return!0;i=e.indexOf(r,i+1)}return!1}function Ce(e){for(let n=1;n<e.byteLength;n+=1){let r=e[n];if(r>=65&&r<=90)return n}let t=e[0];return t>=65&&t<=90?0:-1}function Ct(e,t,n){let r=t.byteLength-1;if(r===0)return Buffer.alloc(0);if(e.byteLength>=r)return Buffer.from(e.subarray(e.byteLength-r));let i=Buffer.concat([n,e]);return Buffer.from(i.subarray(Math.max(0,i.byteLength-r)))}function V(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function hn(e,t){try{return Y(e,t),!0}catch(n){if(V(n))return!1;throw n}}function It(e){let t=w(e);return t?t.filter(n=>n&&!R(n)).sort():(kt(e)??Nt(e)).filter(n=>n&&!R(n)).sort()}function zt(e,t={}){let n=(t.includePaths??[]).map(B),r=[...new Set([...It(e),...n])].filter(o=>!R(o)).filter(o=>!t.language||te(o,t.language,t.markerFiles)).filter(o=>!t.includePath||t.includePath(o)).sort(),i=T(e),s=r.flatMap(o=>ve(e,i,o));return U(i),s}function ve(e,t,n){let r=fe(e,n);if(r)return[{path:n,size:r.fingerprintSize??r.size,hash:r.sha256}];if(x(e,n)==="present"){let s=j(e,n);if(s)return[{path:n,size:s.fingerprintSize??s.size,hash:s.sha256}]}let i=q(e,n);try{let s=G(i);if(s.isSymbolicLink()){let g=J(t,n,"symlink",O(s));if(g)return[{path:n,size:g.size,hash:g.hash}];let l=T(i),f=ht(t,l);if(f===".."||f.startsWith(`..${yt}`)||dt(f))throw new Error("external symlink");let S=gt(i),d=K("sha256").update("symlink\0").update(S).digest("hex"),b=Buffer.byteLength(S);return $(t,n,"symlink",O(s),{hash:d,size:b}),[{path:n,size:b,hash:d}]}let o=J(t,n,"file",O(s));if(o)return[{path:n,size:o.size,hash:o.hash}];let c=K("sha256"),a=ie(i,{inputKind:"project fingerprint input",maxBytes:E},g=>c.update(g)),u=c.digest("hex");return $(t,n,"file",O(s),{hash:u,size:a}),[{path:n,size:a,hash:u}]}catch(s){return V(s)?[]:[{path:n,size:-1,hash:"unreadable"}]}}function O(e){return{dev:e.dev,ino:e.ino,mtimeMs:e.mtimeMs,ctimeMs:e.ctimeMs,size:e.size}}function vt(e,t,n){let r=Le(t,n),i=[...r.typescriptProjects.filter(o=>Tt(e,o)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],s=r.languages.includes("typescript")?me(e,r.typescriptProjectMode,r.typescriptProjects):null;return{...r,files:zt(e,{includePath:o=>{let c=_(o,t,i);return c==="other"?!1:c!=="source"||!Mt(o)||!s?!0:s.has(o)},includePaths:i})}}function mn(e,t,n,r,i,s){let o=l=>({mode:"full",fingerprint:vt(e,t,n),reason:l});if(!i)return o("change-journal-unavailable");if(!i.complete)return o(`change-journal-incomplete:${i.incompleteReason??"unknown"}`);if(!s)return o("accepted-generation-unavailable");if(i.baseGeneration!==s)return o("change-journal-base-mismatch");if(!r)return o("prior-project-input-snapshot-unavailable");let c=Le(t,n);if(!Lt(r,c))return o("project-input-configuration-changed");if(new Set(r.files.map(l=>l.path)).size!==r.files.length)return o("prior-project-input-snapshot-has-duplicate-paths");if(i.entries.length===0)return{mode:"delta",fingerprint:{...c,files:[...r.files].sort((l,f)=>l.path.localeCompare(f.path))},changedPaths:[]};let a=[...c.typescriptProjects,...c.clojureConfigPath?[c.clojureConfigPath]:[]],u=new Map(r.files.map(l=>[l.path,l]));for(let l of i.entries){let f=u.get(l.path);if(_(l.path,t,a)!=="source")return o("non-source-project-input-changed");if(l.kind==="add"&&f)return o("added-path-already-in-prior-project-input-snapshot");if(l.kind==="delete"&&!f)return o("deleted-path-not-in-prior-project-input-snapshot");if(l.kind==="change"&&!f)return o("changed-path-not-in-prior-project-input-snapshot");if(f&&(f.hash==="unreadable"||f.size<0))return o("changed-path-was-unreadable")}let g=T(e);for(let l of i.entries){let f=ve(e,g,l.path);if(l.kind==="delete"){if(f.length!==0)return o("deleted-source-is-still-readable");u.delete(l.path);continue}if(f.length!==1||f[0].hash==="unreadable"||f[0].size<0)return o(l.kind==="add"?"added-source-is-not-readable":"changed-source-no-longer-readable");u.set(l.path,f[0])}return U(g),{mode:"delta",fingerprint:{...c,files:[...u.values()].sort((l,f)=>l.path.localeCompare(f.path))},changedPaths:i.entries.map(l=>l.path).sort()}}function Lt(e,t){return e.version===t.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Mt(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function Tt(e,t){let n;try{n=B(t)}catch{return!1}let r=x(e,n);if(r)return r==="present";try{return G(q(e,n)).isFile()}catch(i){if(V(i))return!1;throw i}}function Le(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:Pt(t.typescriptProjects),clojureConfigPath:Et(t.clojureConfigPath)}}function Et(e){return e?.trim()||void 0}function kt(e){try{let t=ce(e,52428800,()=>lt("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:104857600,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}));return[...ae(t)]}catch{return null}}function Nt(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?q(e,r):e,s;try{s=ft(i,{withFileTypes:!0})}catch{continue}for(let o of s){let c=r?`${r}/${o.name}`:o.name;if(o.isDirectory()){R(c)||n.push(c);continue}t.push(c)}}return t}function R(e){let t=e.split("/");return e==="meta.json"||t[0]===".scipquery"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>Ot.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var Ot=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{Ae as a,C as b,Pt as c,Y as d,bt as e,gn as f,jt as g,dn as h,V as i,hn as j,It as k,zt as l,vt as m,mn as n,Le as o};
|
|
3
|
+
//# sourceMappingURL=chunk-7HU2IJ2T.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import{a as f,g as u}from"./chunk-4DCKBY6T.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
|
|
2
|
+
`)}function A(n,t){let r=n.trimStart();if(!r||r.startsWith("#"))return n;let e=n.slice(0,n.length-r.length),i=r.startsWith("!"),o=i?r.slice(1):r;if(!o||o.startsWith("#"))return n;let s=o.startsWith("/"),a=s?o.slice(1):o,p=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${t}/${a}`:`${t}/**/${a}`;return`${e}${i?"!":""}${p}`}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 g(n,t,r){let e=x(t,r);if(!e)return!1;try{return n.ignores(e)}catch{return!1}}function x(n,t){if(!t||t===".")return null;if(!m(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=m(t)?t:S(n,t),e=T(n,r).replaceAll("\\","/");return!e||e==="."||e.startsWith("..")?null:e}export{E as a};
|
|
60
|
+
//# sourceMappingURL=chunk-7IOAZRVL.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function i(e){let n=new Set,t=[];for(let o of e){let r=`${o.symbol}|${o.file}`;n.has(r)||(n.add(r),t.push(o))}return t}function u(e){return[...new Set((e??[]).map(n=>n.trim()).filter(Boolean))]}function f(e){return e.replace(/^#/u,"").replace(/\(\)$/u,"")}export{i as a,u as b,f as c};
|
|
2
|
+
//# sourceMappingURL=chunk-7KCZELVM.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as T}from"./chunk-DOPCR5BY.js";import{C as v,Z as x,aa as m,ba as P,ca as k,ea as b,ga as j}from"./chunk-4DCKBY6T.js";import{createHash as A}from"crypto";import{isUtf8 as K}from"buffer";import{TextDecoder as _}from"util";var O=new _("utf-8",{fatal:!0});function H(e){return j(e.config.projectRoot)}function Q(e,t){let a=v(t),r;try{r=m(e.config.projectRoot,a,{inputKind:"repository text file"})}catch(o){if(b(o)||o instanceof x)return null;throw o}let n=C(r);return n===null?null:w(a,r,n,E(e),L(e))}function V(e,t,a){let r=H(e).filter(i=>!t.scope||i.includes(t.scope)),n=E(e),o=L(e),u=[],S=[],B=[],f=0,d=0,h={aligned:0,stale:0,unavailable:0},l=t.literalBytes?Buffer.isBuffer(t.literalBytes)?[t.literalBytes]:[...t.literalBytes]:[],F=l.length>0?Buffer.allocUnsafe(1024*1024):void 0;for(let i of r){let c,p,g=[],y=o.has(i);try{if(l.length>0){let s=l.length===1?P(e.config.projectRoot,i,l[0],{inputKind:"repository text file",computeSha256:y,scratchBuffer:F}):k(e.config.projectRoot,i,l,{inputKind:"repository text file",computeSha256:y,scratchBuffer:F});if(!s.isUtf8Text){u.push(i);continue}f+=s.byteLength,d+=1,p=s.sha256;let z=R(i,p,n,o);if(h[z.state]+=1,g="matchedLiteralIndexes"in s?s.matchedLiteralIndexes:s.includesLiteral?[0]:[],g.length===0||!s.bytes)continue;c=s.bytes}else c=m(e.config.projectRoot,i,{inputKind:"repository text file"})}catch(s){if(s instanceof x){B.push(i);continue}if(b(s))continue;S.push(i);continue}if(l.length===0&&!I(c)){u.push(i);continue}if(l.length===0){f+=c.byteLength,d+=1,p=y?M(c):void 0;let s=R(i,p,n,o);h[s.state]+=1}if(t.includeBytes&&!t.includeBytes(i,c))continue;let U=O.decode(c);a(w(i,c,U,n,o,p),g)}return{candidateFiles:r.length,scannedTextFiles:d,semanticFiles:h,scannedBytes:f,skippedBinaryPaths:u,skippedUnreadablePaths:S,skippedOversizedPaths:B}}function w(e,t,a,r,n,o){let u=o??M(t);return{relativePath:e,text:a,bytes:t.byteLength,freshness:{exactText:{state:"current",basis:"working-tree-read",sha256:u},semantic:R(e,u,r,n)}}}function R(e,t,a,r){if(!r.has(e))return{state:"unavailable",basis:"no-compiler-document"};let n=a.get(e);return!n||!t?{state:"unavailable",basis:"fingerprint-unavailable"}:{state:n===t?"aligned":"stale",basis:"indexed-input-fingerprint"}}function L(e){return new Set(e.all(`SELECT documents.relative_path FROM documents WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`).map(t=>t.relative_path))}function E(e){let t=new Map;if(!e.generation.metadataRaw)return t;let a=T(e.generation.metadataRaw);if(a.kind!=="legacy"&&a.kind!=="supported")return t;let r=a.metadata.fingerprint;if(!D(r)||!Array.isArray(r.files))return t;for(let n of r.files)!D(n)||typeof n.path!="string"||typeof n.hash!="string"||t.set(n.path,n.hash);return t}function C(e){return I(e)?O.decode(e):null}function I(e){return!e.includes(0)&&K(e)}function M(e){return A("sha256").update(e).digest("hex")}function D(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}export{H as a,Q as b,V as c};
|
|
2
|
+
//# sourceMappingURL=chunk-7PPYXENX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as c}from"./chunk-5IZTXSOL.js";import{v as a}from"./chunk-I3U2FN2T.js";var D=4;function m(e,i,t,r={}){return p(e,i,t,r.maxReexportDepth??D,0,new Set)}function p(e,i,t,r,s,o){let f=`${i}\0${t}`;if(o.has(f)||s>r)return[];o.add(f);let u=c(e,i).filter(n=>n.leaf===t);return u.length>0?u:a(e,i).flatMap(n=>n.sourcePath?n.kind==="named"&&!n.names.includes(t)?[]:p(e,n.sourcePath,t,r,s+1,new Set(o)):[])}export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7TWP3MCP.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{c as F,d as J,e as L,f as _e,g as Le,h as Fe,n as Pe,o as y,u as Ee,w as Ae,x as g,z as we}from"./chunk-DMQ7ZKJG.js";import{H as X,c as v}from"./chunk-MO226P4Q.js";import{basename as Ve}from"path";var Dt=F("indexed-document-paths",{clearGroups:["whole-project"]});function $(e,t={}){let n=Wt(t);return[...Dt.get(e,n,()=>{let o=t.scope?"AND relative_path LIKE ?":"",s=t.like?"AND relative_path LIKE ?":"",i=[...t.scope?[`%${t.scope}%`]:[],...t.like?[t.like]:[]],a=e.all(`SELECT relative_path
|
|
2
|
+
FROM documents
|
|
3
|
+
WHERE 1 = 1
|
|
4
|
+
${e.pathExclusionsFor("documents")}
|
|
5
|
+
${o}
|
|
6
|
+
${s}
|
|
7
|
+
ORDER BY relative_path`,...i).map(l=>l.relative_path),c=t.extensions?a.filter(l=>t.extensions.some(p=>l.toLowerCase().endsWith(p.toLowerCase()))):a;return t.includeIgnored===!1?c.filter(l=>!e.isIgnored(l)):c})]}function Wt(e){let t=e.extensions?[...new Set(e.extensions.map(n=>n.toLowerCase()))].sort():null;return JSON.stringify({scope:e.scope??null,like:e.like??null,extensions:t,includeIgnored:e.includeIgnored!==!1})}function Qo(e,t,n){let r=Ie(t);if(!r)return[];let o=e.all(`SELECT relative_path
|
|
8
|
+
FROM documents
|
|
9
|
+
WHERE relative_path = ?
|
|
10
|
+
${e.pathExclusionsFor("documents")}`,r).filter(c=>!e.isIgnored(c.relative_path)).map(c=>({relativePath:c.relative_path,score:Re(c.relative_path,r)}));if(o.length>0)return o;let s=$(e,{includeIgnored:!1}).map(c=>({relativePath:c,score:Re(c,r)})).filter(c=>c.score>0).sort((c,l)=>l.score-c.score||c.relativePath.localeCompare(l.relativePath)),i=s.filter(c=>c.score>=1100);if(i.length>0)return n.allowMultiple?i:[i[0]];if(n.requirePathMatch)return[];let a=s.filter(c=>c.score>=800);return a.length>0?n.allowMultiple?a:[a[0]]:n.allowMultiple?s:s.slice(0,1)}function Re(e,t){let n=Ie(e),r=Ve(n),o=Ve(t),s=0;return n===t&&(s+=1200),n.endsWith(`/${t}`)&&(s+=1100),r===o&&(s+=900),n.startsWith(`${t}/`)&&(s+=850),n.includes(t)&&(s+=250),s}function Ie(e){return e.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}import{extname as je}from"path";var Ut={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function D(e){return Ut[je(e).toLowerCase()]??null}function le(e){return je(e).toLowerCase()===".vue"}import{createRequire as Mt}from"module";var d=Mt(import.meta.url),Z=null,Be=!1;function zt(){if(Be)return null;if(Z)return Z;try{return Z=d("tree-sitter"),Z}catch{return Be=!0,null}}var Oe=new Map,G=new Set;function qt(e){if(G.has(e))return null;let t=Oe.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return G.add(e),null}}catch{return G.add(e),null}return Oe.set(e,n),n}var $e=new Map;function Ht(e){let t=$e.get(e);if(t)return t;let n=qt(e);if(!n)return null;let r=zt();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return G.add(e),null}return $e.set(e,o),o}function Xt(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function P(e,t){let n=Ht(e);if(!n)return null;try{return Xt(n,t)}catch{return null}}import{createRequire as Jt}from"module";import{posix as ue}from"path";var Zt=L("vue-sfc-units"),Gt=Jt(import.meta.url),Kt;function Qt(){return Kt??=Gt("@vue/compiler-sfc")}function Ue(...e){return Qt().parse(...e)}function V(e,t){let n=Me(t),r=g(e,n);return Zt.get(e,n,r,()=>pe(e,n,r))}function Me(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Yt(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function E(e){return!e||e.body.length===0?0:e.body.split(`
|
|
11
|
+
`).length}function pe(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Ue(n,{filename:t})}catch(i){return r.errors.push(We(i)),r}r.errors.push(...o.errors.map(We));let{descriptor:s}=o;return s.template&&(r.template=K(e,t,"template",s.template)),s.script&&r.scripts.push(De(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(De(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>K(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>K(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function De(e,t,n,r){let o=K(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:Yt(o.lang)}}function K(e,t,n,r){let o=tn(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=en(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),p=l?Math.max(0,l.split(`
|
|
12
|
+
`).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:p,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function en(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Me(ue.normalize(ue.join(ue.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function tn(e){return{...e}}function We(e){return e instanceof Error?e.message:String(e)}function fe(e,t,n){let o=pe(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
|
|
13
|
+
`.repeat(i.startLine)}${i.body}`).join(`
|
|
14
|
+
`),startLine:0,language:s}:null}var ze=_e("ast-trees",{clearGroups:["whole-project","source-file"]});function qe(e,t){if(le(t))return nn(e,t);let n=D(t);if(!n)return null;let r=g(e,t);return r?ze.get(e,t,r,()=>P(n,r)):null}function hs(e,t,n){if(le(t)){let s=fe(e,t,n);if(!s)return null;let i=P(s.language,`
|
|
15
|
+
`.repeat(s.startLine)+s.body);return i?{tree:i,language:s.language}:null}let r=D(t);if(!r)return null;let o=P(r,n);return o?{tree:o,language:r}:null}function nn(e,t){let n=g(e,t);return n?ze.get(e,t,n,()=>{let r=fe(e,t,n);if(!r)return null;let o=`
|
|
16
|
+
`.repeat(r.startLine)+r.body;return P(r.language,o)}):null}function W(e){return e.type==="comment"||e.type==="line_comment"||e.type==="block_comment"}var Qe=["function_declaration","generator_function_declaration","method_definition","method_signature","function_signature"],rn=new Set(Qe),on=[...Qe,"variable_declarator","public_field_definition"],sn=["function_item","function_signature_item"],an=["function_definition"],cn=[],He=new Set(["arrow_function","function_expression","generator_function"]);function vs(e){return e==="rust"?sn:e==="python"?an:e==="typescript"||e==="tsx"||e==="javascript"?on:cn}function Ye(e,t){let n=un(e,t);if(n)return{name:n.name,startLine:n.definitionNode.startPosition.row,endLine:n.definitionNode.endPosition.row,paramCount:Ge(n.functionNode),params:Xe(n.functionNode),paramsEndLine:Je(n.functionNode),isLiteralPassthrough:Ke(n.functionNode,t)};if(!ln(e.type,t))return null;let r=e.childForFieldName("name")??e.namedChildren.find(o=>o.type==="identifier"||o.type==="property_identifier");return r?{name:r.text,startLine:e.startPosition.row,endLine:e.endPosition.row,paramCount:Ge(e),params:Xe(e),paramsEndLine:Je(e),isLiteralPassthrough:Ke(e,t)}:null}function et(e){return e.namedChildren.find(t=>t.type==="parameters"||t.type==="formal_parameters")}function Xe(e){let t=et(e);if(!t)return[];let n=[];for(let r of t.namedChildren){if(W(r))continue;if(r.type==="identifier"){n.push({name:r.text,simple:!0});continue}let o=r.namedChildren.some(a=>a.type.endsWith("_modifier"))||/^\s*(?:public|private|protected|readonly|override)\b/.test(r.text),s=r.childForFieldName("pattern");if(!o&&s&&s.type==="identifier"){n.push({name:s.text,simple:!0});continue}let i=r.namedChildren.find(a=>a.type==="identifier");n.push({name:s?.type==="identifier"?s.text:i?.text??"",simple:!1})}return n}function Je(e){let t=et(e);return t?t.endPosition.row:e.startPosition.row}function ln(e,t){return t==="rust"?e==="function_item"||e==="function_signature_item":t==="python"?e==="function_definition":t==="typescript"||t==="tsx"||t==="javascript"?rn.has(e):!1}function un(e,t){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript")return null;if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=Ze(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}if(e.type==="public_field_definition"){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(!n||!r)return null;let o=Ze(r);return o?{name:n.text,definitionNode:e,functionNode:o}:null}return null}function Ze(e){if(He.has(e.type))return e;if(e.type!=="call_expression"||(e.childForFieldName("function")??e.namedChild(0))?.type!=="call_expression")return null;let r=((e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"))?.namedChildren??[]).filter(o=>He.has(o.type));return r.length===1?r[0]:null}function Ge(e){let t=e.namedChildren.find(r=>r.type==="parameters"||r.type==="formal_parameters");if(!t)return 0;let n=0;for(let r of t.namedChildren)W(r)||(n+=1);return n}function Ke(e,t){let n=e.namedChildren.find(u=>u.type==="block"||u.type==="statement_block");if(!n)return!1;let r=n.namedChildren.filter(u=>!W(u));if(r.length!==1)return!1;let o=r[0],s=null;if(o.type==="return_statement"||o.type==="expression_statement"?s=o.namedChild(0)??null:t==="rust"&&(o.type==="call_expression"||o.type==="macro_invocation")&&(s=o),!s)return!1;let i=t==="python"?"call":"call_expression";if(s.type!==i)return!1;let a=s.namedChildren.find(u=>u.type==="arguments"||u.type==="argument_list");if(!a)return!1;let c=a.namedChildren.filter(u=>!W(u)),l=e.namedChildren.find(u=>u.type==="parameters"||u.type==="formal_parameters");if(!l)return!1;let p=[];for(let u of l.namedChildren){if(u.type==="identifier"){p.push(u.text);continue}let N=u.namedChildren.find(B=>B.type==="identifier");N&&p.push(N.text)}if(c.length!==p.length)return!1;for(let u=0;u<p.length;u+=1){let N=c[u];if(N.type!=="identifier"||N.text!==p[u])return!1}return!0}function Ns(e,t){return e.filter(n=>n.startLine<=t&&n.endLine>=t).sort((n,r)=>n.endLine-n.startLine-(r.endLine-r.startLine)||n.startLine-r.startLine)[0]??null}import{readdirSync as pn}from"fs";import{execFileSync as fn}from"child_process";import{extname as Q,join as mn}from"path";var dn=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],Fs=[".vue"],tt=[".tsx",".jsx"],nt=[".vue"],gn=[...tt,...nt],hn=new Set(tt),Sn=new Set(nt),rt=new Set(dn.map(e=>e.toLowerCase())),yn=[...rt].sort().join(","),ot=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function U(e,t={}){let n=t.includeIndexed??!0,r=t.includeAuxiliary??!0,o=t.extensions?.map(c=>c.toLowerCase()),s=o?new Set(o):rt,i=o?[...s].sort().join(","):yn,a=`${n?"1":"0"}|${r?"1":"0"}|${i}`;return xn.get(e,a,()=>{let c=new Set;if(n)for(let l of $(e,{includeIgnored:!1}))s.has(Q(l).toLowerCase())&&c.add(l);if(r)for(let l of vn(e.config.projectRoot,s))e.isIgnored(l)||n&&c.has(l)||c.add(l);return[...c].sort()})}function Ps(e,t={}){let n=!1,r=!1;for(let o of U(e,{extensions:gn})){if(t.scope&&!o.includes(t.scope))continue;let s=Q(o).toLowerCase();if(n||=hn.has(s),r||=Sn.has(s),n&&r)break}return{react:n,vue:r}}var xn=F("source-files",{clearGroups:[]});function vn(e,t){return Nn(e,t)??bn(e,t)}function Nn(e,t){try{let n=fn("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"]}),r=new Set;for(let o of n.split(`
|
|
17
|
+
`)){let s=o.trim();s&&(Cn(s)||t.has(Q(s).toLowerCase())&&r.add(s))}return r}catch{return null}}function Cn(e){return e.split("/").some(t=>ot.has(t))}function bn(e,t){let n=new Set,r=o=>{let s=o?mn(e,o):e,i;try{i=pn(s,{withFileTypes:!0})}catch{return}for(let a of i)if(!ot.has(a.name)){if(a.isDirectory()){r(o?`${o}/${a.name}`:a.name);continue}t.has(Q(a.name).toLowerCase())&&n.add(o?`${o}/${a.name}`:a.name)}};return r(""),n}import{extname as Fn}from"path";function ee(e,t){let n=kn(e,t);if(!n)return null;let r=Y(n);if(!r)return null;let o=_n(n);return{calleeLeaf:r,calleeQualifier:o?Tn(n):void 0,calleeText:n.text,memberAccess:o,line:e.startPosition.row}}function Tn(e){return(e.childForFieldName("object")??e.childForFieldName("value")??e.namedChild(0)??void 0)?.text||void 0}function kn(e,t){if(t==="rust")return e.type==="call_expression"?e.childForFieldName("function")??e.namedChild(0):e.type==="macro_invocation"?e.childForFieldName("macro")??e.namedChild(0):null;if(t==="python")return e.type!=="call"?null:e.childForFieldName("function")??e.namedChild(0);if(t==="typescript"||t==="tsx"||t==="javascript"){if(e.type==="call_expression")return e.childForFieldName("function")??e.namedChild(0);if(e.type==="new_expression")return e.childForFieldName("constructor")??e.namedChild(0)}return null}function _n(e){switch(e.type){case"field_expression":case"member_expression":case"attribute":return!0;default:return!1}}function Y(e){switch(e.type){case"identifier":case"type_identifier":case"field_identifier":case"property_identifier":case"private_property_identifier":case"shorthand_property_identifier":return e.text.replace(/^#/u,"");case"field_expression":case"member_expression":case"attribute":{let t=e.namedChild(e.namedChildCount-1);return t?Y(t):null}case"generic_function":{let t=e.childForFieldName("function")??e.namedChild(0);return t?Y(t):null}case"scoped_identifier":{let t=e.childForFieldName("name")??e.namedChild(e.namedChildCount-1);return t?Y(t):null}case"super":case"self":case"this":return null;default:return null}}var Ln=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function te(e){return e.length<=2||Ln.has(e)}var Pn=[".tsx",".jsx"],st=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),En=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),An=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),wn=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),Vn=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),Rn=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),In=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),jn=L("react-component-behavior-profiles"),it=Ee({kind:"react-component-behavior-profiles",invalidation:Ae("react-component-behavior-profiles"),serialize:Dn,deserialize:Wn});function ut(e,t={}){let n=U(e,{extensions:Pn}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>de(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function de(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return jn.get(e,n,r,()=>Bn(e,n,r)).map($n)}function Bn(e,t,n){let r=Fe(e,t,n),o=it.read(e,t,r);if(o)return o;let s=On(e,t);return it.write(e,t,r,s),s}function On(e,t){let n=Mn(t);if(!n)return[];let r=qe(e,t);if(!r)return[];let o=we(e,t).length;return zn(r.rootNode,n).filter(i=>i.kind==="hook"||ge(i.bodyNode)).map(i=>{let a=Kn(i.bodyNode),c=nr(i.bodyNode,n);return{file:t,name:i.name,kind:i.kind,startLine:i.node.startPosition.row,endLine:i.node.endPosition.row,loc:Math.max(1,i.node.endPosition.row-i.node.startPosition.row+1),fileLines:o,jsxTokens:a.tokens,behaviorTokens:c.tokens,componentNames:b(a.componentNames),nativeTags:b(a.nativeTags),propNames:b(a.propNames),eventNames:b(a.eventNames),hookNames:b(c.hookNames),requestNames:b(c.requestNames),stateNames:b(c.stateNames),effectNames:b(c.effectNames),handlerNames:b(c.handlerNames)}})}function $n(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function Dn(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function Wn(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let r of t){let o=Un(r);if(!o)return null;n.push(o)}return n}catch{return null}}function Un(e){if(!Pe(e))return null;let{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:c,behaviorTokens:l,componentNames:p,nativeTags:u,propNames:N,eventNames:B,hookNames:ae,requestNames:ce,stateNames:m,effectNames:C,handlerNames:O}=e;if(typeof t!="string"||typeof n!="string"||r!=="component"&&r!=="hook"||!ne(o)||!ne(s)||!ne(i)||!ne(a))return null;let S={jsxTokens:y(c),behaviorTokens:y(l),componentNames:y(p),nativeTags:y(u),propNames:y(N),eventNames:y(B),hookNames:y(ae),requestNames:y(ce),stateNames:y(m),effectNames:y(C),handlerNames:y(O)};return Object.values(S).some($t=>$t===null)?null:{file:t,name:n,kind:r,startLine:o,endLine:s,loc:i,fileLines:a,jsxTokens:new Set(S.jsxTokens),behaviorTokens:new Set(S.behaviorTokens),componentNames:S.componentNames,nativeTags:S.nativeTags,propNames:S.propNames,eventNames:S.eventNames,hookNames:S.hookNames,requestNames:S.requestNames,stateNames:S.stateNames,effectNames:S.effectNames,handlerNames:S.handlerNames}}function ne(e){return typeof e=="number"&&Number.isFinite(e)}function Mn(e){let t=Fn(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:D(e)}function zn(e,t){let n=[],r=new Set,o=s=>{let i=qn(s);if(i&&(!Zn(s)||i.kind==="component")){let a=`${i.name}:${i.node.startIndex}:${i.node.endIndex}`;r.has(a)||(r.add(a),n.push(i))}for(let a of s.namedChildren)o(a)};return(t==="tsx"||t==="javascript")&&o(e),n}function qn(e){if(e.type==="class_declaration"){let s=me(e);if(!s||!/^[A-Z]/.test(s))return null;let i=Hn(e);return!i||!Xn(e)&&!ge(i)?null:{name:s,kind:"component",node:e,bodyNode:i}}if(e.type==="function_declaration"){let s=me(e);return!s||!at(s)?null:{name:s,kind:ct(s),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),r=M(t);if(!r||!n||!at(r))return null;let o=Jn(n);return o?{name:r,kind:ct(r),node:e,bodyNode:o}:null}function Hn(e){for(let t of e.namedChildren)if(t.type==="class_body")for(let n of t.namedChildren){if(n.type!=="method_definition")continue;if((n.childForFieldName("name")??n.namedChild(0))?.text==="render")return n}return null}function Xn(e){return/\b(?:React\.)?(?:Pure)?Component\b/.test(e.text)}function at(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function ct(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function Jn(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=Gn(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Zn(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function me(e){return M(e.childForFieldName("name")??e.namedChild(0))}function Gn(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function ge(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some(ge)}function Kn(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=r=>{r.type==="jsx_opening_element"||r.type==="jsx_self_closing_element"?Qn(r,t):r.type==="jsx_element"&&r.text.trimStart().startsWith("<>")?t.tokens.add("jsx:fragment"):r.type==="jsx_expression"?Yn(r,t):r.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of r.children)n(o)};return n(e),t}function Qn(e,t){let n=er(e),r=!1;if(n){let o=lt(n),s=o==="Fragment"||o==="React.Fragment";r=ar(o)&&!s,s?t.tokens.add("jsx:fragment"):r?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let s=tr(o);if(!s)continue;let i=lt(s);if(i.startsWith("on")&&i.length>2){let a=i.slice(2).replace(/^[A-Z]/,c=>c.toLowerCase());t.eventNames.add(a),t.tokens.add(`event:${a}`)}else In.has(i)||(t.propNames.add(i),t.tokens.add(`${r?"prop":"native-prop"}:${i}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add(pt(o))}function Yn(e,t){let n=e.text;/^\{\s*\.\.\./.test(n)&&t.tokens.add(pt(e)),ft(e)&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let r of cr(n))te(r)||t.tokens.add(`binding:${r}`)}function pt(e){let t=/^\{\s*\.\.\.\s*([^}]+)\s*\}$/.exec(e.text)?.[1],n=e.namedChildren.find(s=>s.type!=="comment"),r=t??n?.text??"",o=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/.exec(r.trim())?.[0];return o?`prop:spread:${o}`:"prop:spread"}function ft(e){return e.type==="ternary_expression"||e.type==="conditional_expression"?!0:e.namedChildren.some(ft)}function er(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function tr(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function nr(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},r=o=>{if(o.type==="call_expression"){let s=ee(o,t);s&&rr(s.calleeLeaf,n)}else if(o.type==="variable_declarator")sr(o,n);else if(o.type==="function_declaration"){let s=me(o);s&&mt(s,n)}for(let s of o.namedChildren)r(s)};return r(e),n}function rr(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!st.has(e)&&!wn.has(e)&&t.tokens.add(`hook:${e}`)),st.has(e)&&t.tokens.add(`react-hook:${e}`),En.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),An.has(e)&&t.tokens.add(`state-hook:${e}`),or(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function or(e){if(Vn.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function sr(e,t){let n=e.childForFieldName("name")??e.namedChild(0),r=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&r?.text.includes("useState")){let s=n.namedChildren.find(a=>M(a)),i=M(s);i&&(t.stateNames.add(i),t.tokens.add(`state:${i}`))}let o=M(n);o&&mt(o,t)}function mt(e,t){let n=ir(e);!n||!Rn.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function ir(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function ar(e){return/^[A-Z]/.test(e)||e.includes(".")}function lt(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function M(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function cr(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];t.includes(r)||t.push(r)}return t}function b(e){return[...e].sort()}var lr=new Set(["ref","shallowRef","reactive","computed","watch","watchEffect"]),ur=new Set(["onBeforeMount","onMounted","onBeforeUpdate","onUpdated","onBeforeUnmount","onUnmounted","onActivated","onDeactivated","onErrorCaptured"]),pr=new Set(["axios","fetch","runRequest","useAsyncData","useFetch","useResource"]),fr=new Set(["defineEmits","defineExpose","defineModel","defineOptions","defineProps","withDefaults"]),mr=new Set(["catch","for","function","if","return","switch","while"]);function oe(e){let t={imports:[],functions:[],calls:[],composables:[],stores:[],reactivity:[],lifecycle:[],requests:[],macros:[],lineCount:0,externalLineCount:0,externalScriptPaths:[],unresolvedScripts:[]};for(let n of e.scripts){t.lineCount+=E(n),n.external&&(t.externalLineCount+=E(n),t.externalScriptPaths.push(n.sourcePath));for(let o of n.errors)t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:o});if(!n.body||!n.astLanguage){n.astLanguage||t.unresolvedScripts.push({sourcePath:n.sourcePath,reason:`Unsupported Vue script language: ${n.lang??"unknown"}`});continue}t.imports.push(...Sr(n));let r=P(n.astLanguage,n.body);r?gr(n,r.rootNode,t):hr(n,t)}return dr(t),t.externalScriptPaths=gt(t.externalScriptPaths),t}function dr(e){e.composables=R(e,"composable"),e.stores=R(e,"store"),e.reactivity=R(e,"reactivity"),e.lifecycle=R(e,"lifecycle"),e.requests=R(e,"request"),e.macros=R(e,"macro")}function R(e,t){return gt(e.calls.filter(n=>n.categories.includes(t)).map(n=>n.name))}function gr(e,t,n){let r=new Set,o=new Set,s=i=>{let a=Ye(i,e.astLanguage);if(a){let l=`${a.name}:${a.startLine}:${a.endLine}`;o.has(l)||(o.add(l),n.functions.push({name:a.name,sourcePath:e.sourcePath,startLine:e.startLine+a.startLine,endLine:e.startLine+a.endLine,setup:e.setup}))}let c=ee(i,e.astLanguage);if(c){let l=`${c.calleeLeaf}:${c.line}`;r.has(l)||(r.add(l),n.calls.push({name:c.calleeLeaf,sourcePath:e.sourcePath,line:e.startLine+c.line,categories:dt(c.calleeLeaf),setup:e.setup}))}for(let l of i.children)s(l)};s(t)}function hr(e,t){for(let n of e.body.matchAll(/\b([A-Za-z_$][\w$]*)\s*\(/g)){let r=n[1];!r||mr.has(r)||t.calls.push({name:r,sourcePath:e.sourcePath,line:e.startLine+re(e.body,n.index??0),categories:dt(r),setup:e.setup})}for(let n of e.body.matchAll(/\bfunction\s+([A-Za-z_$][\w$]*)\b/g)){let r=n[1];if(!r)continue;let o=e.startLine+re(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}for(let n of e.body.matchAll(/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function\b|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/g)){let r=n[1];if(!r)continue;let o=e.startLine+re(e.body,n.index??0);t.functions.push({name:r,sourcePath:e.sourcePath,startLine:o,endLine:o,setup:e.setup})}}function Sr(e){let t=[];for(let n of e.body.matchAll(/\bimport\s+(?:type\s+)?([^'";]+?)\s+from\s+['"]([^'"]+)['"]/g)){let r=n[1]?.trim(),o=n[2];if(!r||!o)continue;let s=e.startLine+re(e.body,n.index??0);for(let i of yr(r))t.push({local:i,source:o,sourcePath:e.sourcePath,line:s,setup:e.setup})}return t}function yr(e){let t=[],r=e.split(",").map(i=>i.trim()).filter(Boolean)[0];r&&!r.startsWith("{")&&!r.startsWith("*")&&t.push(r);let o=/\{([^}]*)\}/.exec(e)?.[1];if(o)for(let i of o.split(",")){let a=i.trim();if(!a)continue;let c=/\bas\s+([A-Za-z_$][\w$]*)$/.exec(a)?.[1];t.push(c??a.replace(/^type\s+/,"").trim())}let s=/\*\s+as\s+([A-Za-z_$][\w$]*)/.exec(e)?.[1];return s&&t.push(s),t.filter(i=>/^[A-Za-z_$][\w$]*$/.test(i))}function dt(e){let t=["call"];return/^use[A-Z0-9_]/.test(e)&&t.push("composable"),/^use[A-Z0-9_].*Store$/.test(e)&&t.push("store"),lr.has(e)&&t.push("reactivity"),ur.has(e)&&t.push("lifecycle"),pr.has(e)&&t.push("request"),fr.has(e)&&t.push("macro"),t}function re(e,t){let n=0;for(let r=0;r<t&&r<e.length;r+=1)e.charCodeAt(r)===10&&(n+=1);return n}function gt(e){return[...new Set(e)].sort()}import{createRequire as xr}from"module";function ht(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var vr=L("vue-template-facts"),Nr=xr(import.meta.url),Cr;function z(){return Cr??=Nr("@vue/compiler-dom")}var br=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),Tr=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),kr=new Set(["div","span","template"]),_r=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function se(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n);return vr.get(e,n,r,()=>Lr(n,V(e,n).template))}function Lr(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=z().parse(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return yt(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function yt(e,t,n,r){for(let o of e)if(o.type===z().NodeTypes.ELEMENT)Fr(o,t,n,r),yt(o.children,t,n,r);else if(o.type===z().NodeTypes.INTERPOLATION){r("interpolation");let s=he(o.content);s&&xt(s,t,o.loc.start.line,n,r)}}function Fr(e,t,n,r){let o=Ir(e.tag),s={tag:e.tag,normalized:o,kind:Rr(e),startLine:I(t,e.loc.start.line),endLine:I(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),kr.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)Pr(i,t,n,r)}function Pr(e,t,n,r){if(e.type===z().NodeTypes.ATTRIBUTE){let a=e.value?.content??null,c=St("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=Ar(e),s=he(e.exp),i=St(Er(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&xt(s,t,e.loc.start.line,n,r)}function St(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:I(r,o),endLine:I(r,s)}}function Er(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function Ar(e){let t=he(e.arg);return t||e.name}function he(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function xt(e,t,n,r,o){for(let s of wr(e)){let i={name:s,startLine:I(t,n),endLine:I(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function wr(e){let t=new Set,n=Vr(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];_r.has(s)||te(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function Vr(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function Rr(e){let t=e.tag;return e.tagType===z().ElementTypes.COMPONENT?"component":br.has(t)?"builtin":Tr.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function Ir(e){return ht(e,/[-_:]/)}function I(e,t){return e+Math.max(0,t-1)}import{createRequire as Hr}from"module";import{existsSync as w}from"fs";import{basename as Nt,dirname as h,extname as T,join as x,relative as A,resolve as f,sep as Xr}from"path";import{existsSync as ye,readdirSync as jr,statSync as Br}from"fs";import{join as j,relative as Or}from"path";function vt(e){let t=$r(e)??Mr(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of zr(e,o)){if(r.has(s))continue;r.add(s);let i=qr(e,s);i&&n.push(i)}return n}function $r(e){let t=j(e,"pnpm-workspace.yaml");if(!ye(t))return null;try{return Dr(X(t,"pnpm workspace manifest"))}catch{return null}}function Dr(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Wr(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=Ur(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Wr(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Ur(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Mr(e){let t=j(e,"package.json");if(!ye(t))return null;try{let n=JSON.parse(X(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function zr(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=j(e,t);return Se(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=j(e,r||".");return Se(s)?jr(s).map(i=>j(s,i,o)).filter(Se):[]}function Se(e){try{return Br(e).isDirectory()}catch{return!1}}function qr(e,t){let n=j(t,"package.json");if(!ye(n))return null;try{let r=JSON.parse(X(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:Or(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var Jr=J("indexed-paths",{clearGroups:[]}),Zr=J("indexed-path-digest",{clearGroups:[]}),Gr=F("tsconfig-alias-config",{clearGroups:["whole-project"]}),Kr=F("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),Qr=Hr(import.meta.url),q;function Yr(){if(q!==void 0)return q;try{q=Qr("typescript")}catch{q=null}return q}var eo=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],to=J("workspace-packages",{clearGroups:["whole-project"]}),H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],Ct=[".py",".pyi"],bt=[".java",".scala",".kt",".kts"],Tt=[".rs"],kt=[".rb"],_t=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Lt=[".cs",".vb"],Ft=[".dart"],Pt=[".php"],ie=[".clj",".cljs",".cljc"],no=new Set(H),xe=new Set(Ct),Et=new Set(bt),ve=new Set(Tt),Ne=new Set(kt),At=new Set(_t),wt=new Set(Lt),Ce=new Set(Ft),Vt=new Set(Pt),Rt=new Set(ie),ro=[{extensions:H,lookup:no},{extensions:Ct,lookup:xe},{extensions:bt,lookup:Et},{extensions:Tt,lookup:ve},{extensions:kt,lookup:Ne},{extensions:_t,lookup:At},{extensions:Lt,lookup:wt},{extensions:Ft,lookup:Ce},{extensions:Pt,lookup:Vt},{extensions:ie,lookup:Rt}];function k(e,t){return t.has(T(e).toLowerCase())}function oo(e){return k(e,xe)}function so(e){return k(e,Et)}function io(e){return k(e,ve)}function ao(e){return k(e,Ne)}function co(e){return k(e,At)}function lo(e){return k(e,wt)}function hi(e){return T(e).toLowerCase()===".vb"}function uo(e){return k(e,Ce)}function po(e){return k(e,Vt)}function fo(e){return k(e,Rt)}function mo(e){let t=T(e).toLowerCase();for(let n of ro)if(n.lookup.has(t))return n.extensions;return H}function go(e){return so(e)||lo(e)||po(e)}function It(e,t,n){return oo(t)?Fo(e,t,n):io(t)?Po(e,t,n):ao(t)?Eo(e,t,n):co(t)?Ao(e,t,n):go(t)?wo(e,n.replace(/\\/g,"."),mo(t)):uo(t)?Vo(e,t,n):fo(t)?Ro(e,n):ho(e,t,n)}function ho(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return So(e,t,n)??xo(e,n);let r=h(x(e.config.projectRoot,t)),o=f(r,n),s=_(e);for(let i of Te(o)){let a=v(A(e.config.projectRoot,i));if(s.has(a)||w(i))return a}return v(A(e.config.projectRoot,o))}function So(e,t,n){let r=ko(e,t);if(!r)return null;let o=_(e);for(let s of yo(r,n)){let i=f(r.baseUrl,s);for(let a of Te(i)){let c=v(A(e.config.projectRoot,a));if(o.has(c)||w(a))return c}}return null}function yo(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function xo(e,t){let n=No(vo(e),t);if(!n)return null;let r=_(e);for(let o of Co(n)){let s=f(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of Te(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}}return null}function vo(e){return to.get(e,()=>vt(e.config.projectRoot))}function No(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function Co(e){let t=[],n=bo(e.pkg.exports,e.subpath);if(n){let r=To(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function bo(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return jt(e[n])}function jt(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=jt(t[n]);if(r)return r}return null}function To(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function ko(e,t){let n=v(h(t));return Kr.get(e,n,()=>_o(e,n))}function _o(e,t){let n=Yr();if(!n)return null;let r=f(e.config.projectRoot),o=f(r,t);for(;o===r||o.startsWith(r+Xr);){for(let i of eo){let a=x(o,i);if(!w(a))continue;let c=Gr.get(e,a,()=>Lo(n,a));if(c)return c}let s=h(o);if(s===o)break;o=s}return null}function Lo(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,h(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?f(h(t),r.options.baseUrl):h(t),paths:o}}catch{return null}}function Fo(e,t,n){let r=_(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=h(x(e.config.projectRoot,t));for(let l=1;l<i;l++)c=h(c);o=a?f(c,a.replace(/\./g,"/")):c}else o=f(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of Io(o)){let i=v(A(e.config.projectRoot,s));if(r.has(i)||w(s))return i}return null}function Po(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=h(x(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=f(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=f(o,r.slice(6).replace(/::/g,"/")):s=f(h(o),r.slice(7).replace(/::/g,"/")),be(e,jo(s))}function Eo(e,t,n){let r=h(x(e.config.projectRoot,t)),o=f(r,n);return be(e,Bo(o))}function Ao(e,t,n){let r=h(x(e.config.projectRoot,t)),o=[f(r,n),f(e.config.projectRoot,n),f(e.config.projectRoot,"include",n),f(e.config.projectRoot,"src",n)];return be(e,o)}function wo(e,t,n){let r=_(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,p=[...r].find(u=>u.endsWith(l));if(p)return p}for(let c of n){let l=[...r].find(p=>Nt(p)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(T(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function Vo(e,t,n){let r=_(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=v(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=h(x(e.config.projectRoot,t)),s=f(o,n);for(let i of Oo(s)){let a=v(A(e.config.projectRoot,i));if(r.has(a)||w(i))return a}return null}function Ro(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=_(e);for(let o of ie){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of ie){let s=[...r].find(i=>Nt(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function Io(e){let t=T(e);return xe.has(t)?[e]:[`${e}.py`,`${e}.pyi`,x(e,"__init__.py"),x(e,"__init__.pyi")]}function be(e,t){let n=_(e);for(let r of t){let o=v(A(e.config.projectRoot,r));if(n.has(o)||w(r))return o}return null}function jo(e){let t=T(e);return ve.has(t)?[e]:[`${e}.rs`,x(e,"mod.rs")]}function Bo(e){let t=T(e);return Ne.has(t)?[e]:[`${e}.rb`,x(e,"index.rb")]}function Oo(e){let t=T(e);return Ce.has(t)?[e]:[`${e}.dart`,e]}function Te(e){let t=T(e),n=new Set;if(t){n.add(e);for(let r of H)n.add(e.slice(0,-t.length)+r)}else for(let r of H)n.add(`${e}${r}`),n.add(x(e,`index${r}`));return[...n]}function _(e){return Jr.get(e,()=>new Set($(e,{includeIgnored:!1}).map(v)))}function Si(e){return Zr.get(e,()=>Le([..._(e)].sort().join(`
|
|
18
|
+
`)))}var $o=new Set(["in","key","of"]),Do=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),Wo=L("vue-component-behavior-profiles");function Bt(e,t={}){let n=U(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>ke(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function ke(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=Wo.get(e,n,r,()=>Uo(e,n,r));return zo(o)}function Uo(e,t,n){let r=V(e,t),o=se(e,t),s=oe(r),i=Xo(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,C,O)=>O.indexOf(m)===C).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,C,O)=>O.indexOf(m)===C).sort(),l=n?n.split(`
|
|
19
|
+
`).length:0,p=E(r.template),u=s.lineCount,N=r.styles.reduce((m,C)=>m+E(C),0),B=r.customBlocks.reduce((m,C)=>m+E(C),0),{lines:ae,paths:ce}=Mo(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:Ho(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:p,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:B,delegatedComposableLines:ae,delegatedComposablePaths:ce}}function Mo(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=It(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
|
|
20
|
+
`).length:0)},0),paths:o}}function zo(e){let t=qo(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function qo(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function Ho(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(Do.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function Xo(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Jo(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of Ot(n.value))t.add(r);return[...t].sort()}function Jo(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?Ot(t[1]??""):[]}function Ot(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];$o.has(r)||t.push(r)}return t}function wi(e){return{capability:(t,n)=>Zo(t,n),reactProfiles:(t={})=>ut(e,t),reactProfilesForFile:t=>de(e,t),vueProfiles:(t={})=>Bt(e,t),vueProfileForFile:t=>ke(e,t),vueTemplateFacts:t=>se(e,t),vueScriptFacts:t=>oe(V(e,t))}}function Zo(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{$ as a,Qo as b,vt as c,zr as d,H as e,Ct as f,bt as g,Tt as h,kt as i,_t as j,Lt as k,Ft as l,Pt as m,ie as n,hi as o,mo as p,It as q,Fo as r,Po as s,Eo as t,Ao as u,wo as v,Vo as w,Ro as x,Si as y,D as z,le as A,fe as B,qe as C,hs as D,ee as E,Y as F,vs as G,Ye as H,Ns as I,ht as J,Fs as K,ot as L,U as M,Ps as N,wi as O};
|
|
21
|
+
//# sourceMappingURL=chunk-AA7K3XLM.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as z}from"./chunk-Z3GCK3PD.js";import{b as C}from"./chunk-7PPYXENX.js";import{c as W}from"./chunk-SKUMCCC5.js";import{b as U}from"./chunk-EA4SH4U5.js";import{d as D}from"./chunk-WULAPQUD.js";import{a as _}from"./chunk-3EX7DNBC.js";import{a as k,b as j,e as A}from"./chunk-VGRUM7JI.js";import{G as I,N as O,V as h,_ as T,p as F,q as M,r as B}from"./chunk-SDPA5DKN.js";import{c as S,d as w,l as $}from"./chunk-DRENNWRG.js";import{x as P}from"./chunk-4DCKBY6T.js";import{basename as me,extname as K}from"path";var oe=12,se=280;function y(n,e,t,o){let i=ae(n,e,t,o);if(i.size===0)return ce();let r=[],a=new Set,u=(l,d,c,f)=>{if(d===e&&c<=o&&f>=t)return;let m=`${d}:${c}:${f}:${l}`;a.has(m)||(a.add(m),r.push({name:l,relativePath:d,startLine:c,endLine:f}))};for(let l of h(n,e))i.has(l.leaf)&&u(l.leaf,l.relativePath,l.startLine,l.endLine);for(let l of O(n,e)){let d=l.localName;if(!d||!i.has(d)||!l.sourcePath||l.kind==="namespace")continue;let c=l.importedName==="default"?d:l.importedName;for(let f of _(n,l.sourcePath,c,{maxReexportDepth:3}))u(d,f.relativePath,f.startLine,f.endLine)}r.sort(H);let s=r.map(l=>{let d=le(n,l);return d?{...l,source:d}:null}).filter(l=>l!==null).slice(0,oe);return x(s)}function X(n,e=[]){return x(ue(n.flatMap(t=>t?.inline??[]),e))}function ae(n,e,t,o){let i=I(n,e),r=new Set;if(!i)return r;for(let a=t;a<=o;a+=1)for(let u of i.identifiersByLine[a]??[])r.add(u);return r}function le(n,e){if(e.startLine!==e.endLine)return null;let t=(B(n,e.relativePath)[e.startLine]??"").trim();if(!t||t.length>se)return null;let o=t.indexOf("=");if(o<0||t[o+1]===">")return null;let i=t.slice(o+1).replace(/(?:\/\/|#).*$/u,"").trim();if(!i||i.includes("${")||/\b(?:function|class|struct|interface|trait|enum|lambda)\b/u.test(i))return null;let a=i.replace(/(['"`])(?:\\.|(?!\1).)*\1/gu,"").replace(/\b(?:0[xX][\dA-Fa-f_]+|0[bB][01_]+|0[oO][0-7_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)n?\b/gu,""),u=new Set(["true","false","null","undefined","None","True","False"]);return(a.match(/[A-Za-z_][A-Za-z0-9_]*/gu)??[]).some(l=>!u.has(l))?null:t}function ue(n,e){let t=new Map;for(let o of n){if(de(o,e))continue;let i=`${o.relativePath}:${o.startLine}:${o.endLine}:${o.name}`;t.has(i)||t.set(i,{...o})}return[...t.values()].sort(H)}function de(n,e){return e.some(t=>t.relativePath===n.relativePath&&t.startLine<=n.startLine&&t.endLine>=n.endLine)}function H(n,e){return n.relativePath.localeCompare(e.relativePath)||n.startLine-e.startLine||n.name.localeCompare(e.name)}function x(n){return{coverage:"indexed-project-literal-values",inline:n}}function ce(){return x([])}function G(n,e){let t=W(n,e);if(!t)return[];let o=T(n,[t],{sort:!0});if(o.length===0)return[];let i=Math.max(0,M(F(n,t)).length-1),r=o.map(s=>({symbol:s.symbol,shortName:s.shortName,startLine:s.startLine,endLine:Math.min(s.endLine,i),signature:s.signature,children:[]})),a=new Map;for(let s of r)a.set(s.symbol,s);let u=[];for(let s=0;s<o.length;s++){let l=o[s],d=r[s];if(l.enclosingSymbol&&a.has(l.enclosingSymbol)){a.get(l.enclosingSymbol).children.push(d);continue}let c=null,f=1/0;for(let m of r)if(m!==d&&m.startLine<=d.startLine&&m.endLine>=d.endLine){if(m.startLine===d.startLine&&m.endLine===d.endLine&&!$(m.symbol,d.symbol))continue;let g=m.endLine-m.startLine;g<f&&(f=g,c=m)}c?c.children.push(d):u.push(d)}return u}function Je(n,e,t={}){let{context:o=0}=t,i=ie(e);if(i)return re(n,i.filePath,i.startLine,i.endLine,o);let r=ne(n,e);if(r)return Y(n,r);let a=k(n,e);return a?p(n,a,o):null}function Qe(n,e,t={}){if(e.length===0)throw new RangeError("code requires at least one selector.");if(e.length>24)throw new RangeError(`code accepts at most ${24} selectors per complete packet; received ${e.length}.`);let o=t.context??0,i=t.members??"exported",r=e.map(s=>ge(n,s,o,i)),a=r.flatMap(s=>s.results),u=a.map(s=>({relativePath:s.relativePath,startLine:s.startLine,endLine:s.endLine}));return{requested:e.length,matched:r.filter(s=>s.status==="matched").length,ambiguous:r.filter(s=>s.status==="ambiguous").length,missing:r.filter(s=>s.status==="missing").length,entries:r,bindingClosure:X(a.map(s=>s.bindingClosure),u)}}function ge(n,e,t,o){let i=ie(e);if(i){let d=re(n,i.filePath,i.startLine,i.endLine,t);return d?he(n,e,d,t):R(n,e,"definition-source-unreadable")}let r=ne(n,e);if(r)return be(n,e,r,t,o);let a=j(n,e);if(!a.match)return R(n,e,"definition-not-found");let u=Ne(n,a),s=u.map(te);if(a.total>1){let d=a.total<=4&&u.length===a.total;return{selector:e,status:"ambiguous",kind:"source",totalCandidates:a.total,results:d?u.flatMap(c=>{let f=p(n,c,t);return f?[f]:[]}):[],definitions:[],candidates:s,omittedCandidates:Math.max(0,a.total-s.length),suggestions:[]}}let l=p(n,a.match,t);return l?Re(e,l):R(n,e,"definition-source-unreadable")}function he(n,e,t,o){let i=h(n,t.relativePath).filter(l=>!Z(l,t.relativePath)),r=pe(n,t,i),a=V(r.map(l=>p(n,l,o)).filter(l=>l!==null)).filter(l=>!ee(t,l)),u=new Set(a.map(l=>l.symbol)),s=r.filter(l=>!u.has(l.symbol)&&!(t.startLine<=l.startLine&&t.endLine>=l.endLine)).map(te);return{selector:e,status:"matched",kind:"source",totalCandidates:1,results:[t,...a],definitions:[],candidates:[],omittedCandidates:0,suggestions:[],rangeCoverage:{basis:"requested-range-and-same-file-call-closure",referencedDefinitions:r.length,returnedDefinitions:r.length-s.length,returnedBodies:a.length,omittedDefinitions:s.length,omittedLedger:s}}}function pe(n,e,t){if(!b(e.freshness))return[];if(t.length===0)return[];let o=D(n,t,{additive:!1,semantic:!1}),i=new Map;for(let a of t){let u=i.get(a.symbol)??[];u.push(a),i.set(a.symbol,u)}let r=new Map;for(let a of t)if(!(a.endLine<e.startLine||a.startLine>e.endLine)){for(let u of o.get(a.symbolId)??[])if(u.file===e.relativePath&&!(u.source==="ast-callsite"&&(u.chunkId<e.startLine||u.chunkId>e.endLine)))for(let s of i.get(u.symbol)??[])r.set(s.symbolId,s)}return Q(n,[...r.values()],t)}function be(n,e,t,o,i){let r=t.relativePath,a=ye(n,r),u=b(t.freshness)?h(n,r).filter(g=>!Z(g,r)):[],s=u.filter(g=>z(n,g)),l=s.length>0?s:Ce(a,u),d=i==="all"?[]:Q(n,l,u),c=i==="all"||u.length===0?[Y(n,t)]:V(d.map(g=>p(n,g,o)).filter(g=>g!==null)),f=ve(a,c),m=Se(r,a,c),v=De(a);return{selector:e,status:"matched",kind:"file-source",totalCandidates:1,results:c,definitions:[],candidates:[],omittedCandidates:0,suggestions:[],fileCoverage:{members:i,basis:i==="all"||u.length===0?"complete-file-source":s.length>0?"explicit-exports-and-same-file-reference-closure":"top-level-and-same-file-reference-closure",totalDefinitions:v,returnedDefinitions:f,returnedBodies:c.length,omittedDefinitions:Math.max(0,v-f),omittedLedger:m}}}function Ce(n,e){let t=new Set(n.map(o=>o.symbol));return e.filter(o=>t.has(o.symbol))}function ye(n,e){return G(n,e).flatMap(t=>Le(t,e)?t.children:[t])}function Z(n,e){return J(e).has(n.leaf)}function Le(n,e){return J(e).has(w(n.symbol))}function J(n){let e=me(n);return new Set([e,e.slice(0,Math.max(0,e.length-K(e).length))])}function Q(n,e,t){if(e.length===0)return[];let o=D(n,t,{additive:!0,semantic:!1}),i=new Map;for(let u of t){let s=i.get(u.symbol)??[];s.push(u),i.set(u.symbol,s)}let r=new Map,a=[...e];for(;a.length>0;){let u=a.shift();if(!r.has(u.symbolId)){r.set(u.symbolId,u);for(let s of o.get(u.symbolId)??[])for(let l of i.get(s.symbol)??[])r.has(l.symbolId)||a.push(l)}}return[...r.values()].sort(xe)}function V(n){let e=[...n].sort((o,i)=>o.relativePath.localeCompare(i.relativePath)||o.startLine-i.startLine||i.endLine-o.endLine),t=[];for(let o of e)t.some(i=>ee(i,o))||t.push(o);return t}function Y(n,e){let t=e.text.split(`
|
|
2
|
+
`);return{symbol:e.relativePath,shortName:e.relativePath,relativePath:e.relativePath,startLine:0,endLine:Math.max(0,t.length-1),language:n.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath)?.language??E(e.relativePath),source:e.text,freshness:e.freshness,...b(e.freshness)?{bindingClosure:y(n,e.relativePath,0,Math.max(0,t.length-1))}:{}}}function ve(n,e){return L(n).filter(t=>e.some(o=>N(t,o))).length}function Se(n,e,t){let o=[];return q(o,n,e,t,0),o}function q(n,e,t,o,i){for(let r of t){if(o.some(u=>N(r,u)))continue;let a=L(r.children).filter(u=>!o.some(s=>N(u,s))).length;n.push({symbol:r.symbol,shortName:r.shortName,relativePath:e,startLine:r.startLine,endLine:r.endLine,signature:r.signature,depth:i,nestedDefinitions:a}),q(n,e,r.children,o,i+1)}}function L(n){return n.flatMap(e=>[e,...L(e.children)])}function De(n){return L(n).length}function N(n,e){return e.startLine<=n.startLine&&e.endLine>=n.endLine}function ee(n,e){return n.relativePath===e.relativePath&&n.startLine<=e.startLine&&n.endLine>=e.endLine}function xe(n,e){return n.startLine-e.startLine||e.endLine-n.endLine||n.symbol.localeCompare(e.symbol)}function Re(n,e){return{selector:n,status:"matched",kind:"source",totalCandidates:1,results:[e],definitions:[],candidates:[],omittedCandidates:0,suggestions:[]}}function R(n,e,t){return{selector:e,status:"missing",kind:"source",totalCandidates:0,results:[],definitions:[],candidates:[],omittedCandidates:0,suggestions:A(n,e,5),reason:t}}function ne(n,e){try{return C(n,e)}catch(t){if(t instanceof P)return null;throw t}}function Ne(n,e){if(!e.match)return[];let t=[e.match];for(let i of e.candidates){let r=h(n,i.relativePath).find(a=>a.symbol===i.symbol&&a.startLine===i.startLine);r&&t.push(r)}let o=new Set;return t.filter(i=>{let r=`${i.relativePath}:${i.startLine}:${i.endLine}:${i.symbol}`;return o.has(r)?!1:(o.add(r),!0)})}function te(n){return{symbol:n.symbol,shortName:S(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine}}function ie(n){let e=n.match(/^(.+):(\d+)-(\d+)$/);if(!e)return null;let t=Number(e[2]),o=Number(e[3]);if(!Number.isSafeInteger(t)||t<1)throw new RangeError(`Source range start line must be a positive integer, got "${e[2]}".`);if(!Number.isSafeInteger(o)||o<t)throw new RangeError(`Source range end line must be an integer at or after ${t}, got "${e[3]}".`);return{filePath:e[1],startLine:t,endLine:o}}function p(n,e,t){let o=n.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),i=C(n,e.relativePath);if(!i)return null;let a=i.text.split(`
|
|
3
|
+
`),u=e.endLine<=e.startLine?U(n,e.relativePath,e.startLine,Number.MAX_SAFE_INTEGER):null,s=u?.unitType?u.unitStartLine:e.startLine,l=u?.unitType?u.unitEndLine:e.endLine,d=Math.max(0,s-t),c=Math.min(a.length-1,l+t),f=a.slice(d,c+1).join(`
|
|
4
|
+
`);return{symbol:e.symbol,shortName:S(e.symbol),relativePath:e.relativePath,startLine:d,endLine:c,language:o?.language??E(e.relativePath),source:f,freshness:i.freshness,...b(i.freshness)?{bindingClosure:y(n,e.relativePath,d,c)}:{}}}function re(n,e,t,o,i){let r=C(n,e);if(!r)return null;let a=n.get("SELECT language FROM documents WHERE relative_path = ?",r.relativePath),s=r.text.split(`
|
|
5
|
+
`);if(t>s.length)return null;let l=Math.max(0,t-1-i),d=Math.min(s.length-1,o-1+i),c=s.slice(l,d+1).join(`
|
|
6
|
+
`);return{symbol:`${r.relativePath}:${t}-${o}`,shortName:`${r.relativePath}:${t}-${o}`,relativePath:r.relativePath,startLine:l,endLine:d,language:a?.language??E(r.relativePath),source:c,freshness:r.freshness,...b(r.freshness)?{bindingClosure:y(n,r.relativePath,l,d)}:{}}}function b(n){return!!(n&&n.semantic.state!=="stale"&&n.semantic.basis!=="no-compiler-document")}function E(n){switch(K(n).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{G as a,Je as b,Qe as c};
|
|
7
|
+
//# sourceMappingURL=chunk-AJVMVE7X.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as l,e as m}from"./chunk-VGRUM7JI.js";import{c as r}from"./chunk-DRENNWRG.js";function d(s,e){let t=l(s,e);return t.match?{matched:!0,resolved:{symbol:t.match.symbol,shortName:r(t.match.symbol),relativePath:t.match.relativePath},otherMatches:t.candidates.map(n=>({shortName:n.shortName,relativePath:n.relativePath,startLine:n.startLine})),totalMatches:t.total}:{matched:!1,suggestions:m(s,e,5)}}function g(s){let e=s.entries[0];return s.requested===1&&e?.status==="matched"&&e.kind==="source"&&(!e.rangeCoverage||e.rangeCoverage.referencedDefinitions===0)&&e.results.length===1?e.results[0]:null}function u(s,e,t){if(!t)return d(s,e);let n={file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:o(t.startLine),endLine:o(t.endLine)},...t.freshness?{freshness:t.freshness}:{},lines:t.source.split(`
|
|
2
|
+
`).map((h,c)=>({line:o(t.startLine+c),text:h}))},a=d(s,e),i=a.totalMatches??0;return!a.matched||!a.resolved||i<=1?n:{...n,resolution:{selected:a.resolved,alternatives:a.otherMatches??[],totalMatches:i}}}function f(s){return{requested:s.requested,matched:s.matched,ambiguous:s.ambiguous,missing:s.missing,entries:s.entries.map(e=>({selector:e.selector,status:e.status,kind:e.kind,totalCandidates:e.totalCandidates,sources:e.results.map(t=>({file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:o(t.startLine),endLine:o(t.endLine)},...t.freshness?{freshness:t.freshness}:{},lines:t.source.split(`
|
|
3
|
+
`).map((n,a)=>({line:o(t.startLine+a),text:n}))})),definitions:e.definitions,...e.fileCoverage?{fileCoverage:e.fileCoverage}:{},...e.rangeCoverage?{rangeCoverage:e.rangeCoverage}:{},candidates:e.candidates,omittedCandidates:e.omittedCandidates,suggestions:e.suggestions,...e.reason?{reason:e.reason}:{}})),literalValues:s.bindingClosure.inline}}function v(s,e,t){let n=g(t);return n?u(s,e[0],n):f(t)}function o(s){return s+1}export{d as a,g as b,u as c,f as d,v as e};
|
|
4
|
+
//# sourceMappingURL=chunk-ANWGXPPN.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{c as S}from"./chunk-BBEDPVPB.js";import{a as y,b as h}from"./chunk-UQ7XPRWU.js";import{a as f}from"./chunk-HWLCBKFE.js";import{d as v}from"./chunk-6SWA6B24.js";import{c as p}from"./chunk-FUG6RPYY.js";import{b as d}from"./chunk-LPGDO2XA.js";import{d as l,t as m}from"./chunk-5IZTXSOL.js";import{z as u}from"./chunk-DMQ7ZKJG.js";function B(i,r,c={}){let t=g(i,r,c);if(t.kind!=="matched")return t;let{referenceEvidence:n,claimSupport:e,...s}=t;return s}function g(i,r,c={}){let t=d(i,r);if(!t.match)return{kind:"missing",query:r};if(t.total>1)return{kind:"ambiguous",query:r,total:t.total,candidates:[{symbol:t.match.symbol,shortName:l(t.match.symbol),relativePath:t.match.relativePath,startLine:t.match.startLine},...t.candidates]};let n=t.match,e=R(c.parts),s=e.includes("definition")||e.includes("references")?S(i,n.symbol,{semantic:c.semantic,referenceContext:c.referenceContext}):{definitions:[],referencedBy:[],referenceEvidence:[],claimSupport:null},o=e.includes("callers")||e.includes("callees")?f(i,n.symbol,{semantic:c.semantic}):null,a=c.relatedSourceLines??80;return{kind:"matched",query:r,symbol:n.symbol,shortName:l(n.symbol),file:n.relativePath,parts:e,definition:e.includes("definition")?v(i,n.symbol):null,referenceWindows:e.includes("references")?L(i,s.referencedBy):[],callers:e.includes("callers")?E(i,o?.callers??[],a):[],callees:e.includes("callees")?E(i,o?.callees??[],a):[],dependencies:e.includes("dependencies")?y(i,n.relativePath):[],consumers:e.includes("consumers")?h(i,n.relativePath):[],referenceEvidence:s.referenceEvidence,claimSupport:s.claimSupport}}function L(i,r){let c=r.filter(n=>n.sourceStartLine!==null&&n.sourceEndLine!==null&&n.source!==null).sort((n,e)=>n.relativePath.localeCompare(e.relativePath)||n.sourceStartLine-e.sourceStartLine||n.line-e.line),t=[];for(let n of c){let e=t[t.length-1];if(e&&e.relativePath===n.relativePath&&n.sourceStartLine<=e.endLine+1){e.endLine=Math.max(e.endLine,n.sourceEndLine),e.references.push(b(n)),e.source=u(i,e.relativePath).slice(e.startLine,e.endLine+1).join(`
|
|
2
|
+
`);continue}t.push({relativePath:n.relativePath,startLine:n.sourceStartLine,endLine:n.sourceEndLine,source:n.source,references:[b(n)]})}return t}function b(i){return{line:i.line,enclosingSymbol:i.enclosingSymbol,enclosingShort:i.enclosingShort}}function R(i){let r=i&&i.length>0?i:["definition","references"];return[...new Set(r)]}function E(i,r,c){let t=[],n=new Set;for(let e of r){if(n.has(e.symbol))continue;n.add(e.symbol);let s=(e.file?m(i,e.file).find(a=>a.symbol===e.symbol):void 0)??d(i,e.symbol).match;if(!s)continue;let o=p(i,s.relativePath,s.startLine,s.endLine,c);o&&t.push({...o,symbol:e.symbol,shortName:e.shortName,omittedLines:Math.max(0,s.endLine-o.endLine)})}return t}export{B as a,g as b};
|
|
3
|
+
//# sourceMappingURL=chunk-APLKXICZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as d,b as m}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as d,b as m}from"./chunk-5SE323LF.js";import{c as u}from"./chunk-KMVGRIO2.js";import{b as c}from"./chunk-7COHFNJK.js";function y(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:p}=e,r=e.minDeps??(p?1:3),{profiles:i,distinctiveDeps:f}=D(t,{scope:n,minDeps:r}),s=d(i,a=>a.deps);return m({profiles:i,limit:l,filePattern:p,overrunFactor:5,candidateIndex:s,profile:{name:"similar-files"},compare:(a,g)=>F(a,g,o,f)})}function D(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:p,distinctiveDeps:r}=S(n),i=[];for(let[f,s]of n)s.size>=l&&i.push({file:f,deps:new Set([...s].filter(a=>!p.has(a)))});return{profiles:i,distinctiveDeps:r}}function S(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let i of r)n.set(i,(n.get(i)??0)+1);let p=Math.max(3,Math.ceil(l*.03));for(let[r,i]of n)i>=5&&i/l>.3?e.add(r):i<=p&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function F(t,e,o,l){let n=new Set;for(let s of t.deps)e.deps.has(s)&&n.add(s);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let p=0;for(let s of n)l.has(s)&&p++;if(p<2)return null;let r=u(t.deps,e.deps);if(r<o)return null;let i=[];for(let s of t.deps)e.deps.has(s)||i.push(s);let f=[];for(let s of e.deps)t.deps.has(s)||f.push(s);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:i,uniqueToB:f}}export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-AQDWTCDC.js.map
|