codebaseiq 0.2.0 → 0.3.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 +44 -2
- package/README.md +1 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-2DMVFAY7.js → chunk-23C5AD3B.js} +2 -2
- package/dist/{chunk-WH5SYOMD.js → chunk-2E6OUPCF.js} +2 -2
- package/dist/{chunk-RWKEXCHU.js → chunk-2EDX3JT5.js} +2 -2
- package/dist/chunk-2I2UHZET.js +2 -0
- package/dist/{chunk-CSZOQ7YO.js → chunk-2OMXFE64.js} +2 -2
- package/dist/{chunk-EXMVF3JR.js → chunk-2PRONPAS.js} +3 -3
- package/dist/{chunk-5WXOEJ4G.js → chunk-356EZBIP.js} +2 -2
- package/dist/{chunk-A7XQT7MH.js → chunk-36JC5BG2.js} +2 -2
- package/dist/{chunk-RRPK327J.js → chunk-3RR2K7EZ.js} +2 -2
- package/dist/{chunk-3NUZVLR7.js → chunk-3RSBGWGL.js} +2 -2
- package/dist/{chunk-MTMF4N7F.js → chunk-3VJ3OCRE.js} +2 -2
- package/dist/{chunk-IBM3F2BJ.js → chunk-4LK5OIPW.js} +2 -2
- package/dist/{chunk-FQA3KIFX.js → chunk-5DSL3NT2.js} +2 -2
- package/dist/{chunk-IYBIBMPF.js → chunk-5FWR5HLG.js} +2 -2
- package/dist/{chunk-CIVYHK7U.js → chunk-5IC2WZAL.js} +2 -2
- package/dist/{chunk-PARCKE3Q.js → chunk-5IZRKWTZ.js} +2 -2
- package/dist/{chunk-HHBBGWES.js → chunk-5LL4KEHO.js} +2 -2
- package/dist/chunk-5T44HG5Y.js +88 -0
- package/dist/{chunk-YFQPWKHR.js → chunk-5ZI2PPI7.js} +2 -2
- package/dist/{chunk-T3YFIJ5P.js → chunk-67VJAYVR.js} +2 -2
- package/dist/{chunk-DKJXK3HA.js → chunk-6BF3VYEF.js} +2 -2
- package/dist/chunk-6JMAVFL4.js +3 -0
- package/dist/chunk-6O3KXIDL.js +2 -0
- package/dist/{chunk-OJFLPVBP.js → chunk-6VREELBC.js} +2 -2
- package/dist/chunk-6WAPPQ5F.js +82 -0
- package/dist/{chunk-QLTFXVUI.js → chunk-75KJGYX7.js} +2 -2
- package/dist/{chunk-PLZXWZHY.js → chunk-7GAK2F3H.js} +2 -2
- package/dist/{chunk-X5I2BQGX.js → chunk-7JELP5YE.js} +2 -2
- package/dist/{chunk-W3FK73MD.js → chunk-7UCDGXRW.js} +2 -2
- package/dist/{chunk-CMXW7MFV.js → chunk-AEXQYQD7.js} +2 -2
- package/dist/{chunk-PHPQ24UG.js → chunk-AQI4N64O.js} +2 -2
- package/dist/{chunk-XUJM6474.js → chunk-AURCQHSG.js} +2 -2
- package/dist/{chunk-EM5UHLAM.js → chunk-BBP7HVBJ.js} +2 -2
- package/dist/{chunk-57KFVPVZ.js → chunk-BFBIMTCJ.js} +2 -2
- package/dist/{chunk-VVCBMH5O.js → chunk-BGGB5N53.js} +2 -2
- package/dist/{chunk-ZOEDRCR4.js → chunk-BRQL7AFJ.js} +2 -2
- package/dist/{chunk-KDYQQJ6X.js → chunk-BWL3PMPT.js} +2 -2
- package/dist/{chunk-M7LAIM77.js → chunk-C6WKPKCF.js} +2 -2
- package/dist/{chunk-2F5ERMNI.js → chunk-C7OUW52M.js} +2 -2
- package/dist/{chunk-N3Q3AWGW.js → chunk-C7QWUBR2.js} +96 -96
- package/dist/{chunk-BX2U3QQV.js → chunk-CCIYWXX6.js} +2 -2
- package/dist/{chunk-3AC56WAR.js → chunk-CIYA2KZN.js} +2 -2
- package/dist/{chunk-35YYZD3D.js → chunk-CR3OG6SQ.js} +2 -2
- package/dist/{chunk-VYZQZ4ZN.js → chunk-CVHOQONG.js} +2 -2
- package/dist/{chunk-4IFISPQW.js → chunk-CW6AXOLR.js} +2 -2
- package/dist/{chunk-NDGTJHQN.js → chunk-D53LWANR.js} +2 -2
- package/dist/{chunk-VCWAJPXQ.js → chunk-D7AZAOZX.js} +2 -2
- package/dist/{chunk-ACZDU5GK.js → chunk-D7DOB27N.js} +7 -7
- package/dist/{chunk-CDWSLAPN.js → chunk-DAKIGMIK.js} +2 -2
- package/dist/chunk-DDN2F6GB.js +2 -0
- package/dist/{chunk-L3YSDLNB.js → chunk-DVWO7RBC.js} +2 -2
- package/dist/{chunk-KNV5VFDV.js → chunk-E52K4L2W.js} +2 -2
- package/dist/chunk-EIBGSU2R.js +2 -0
- package/dist/chunk-EQNMD62X.js +51 -0
- package/dist/{chunk-LY2NB5XR.js → chunk-EXZ7VLRY.js} +2 -2
- package/dist/{chunk-YIOQJ45A.js → chunk-F3QSL4W2.js} +2 -2
- package/dist/{chunk-JOALNFY3.js → chunk-F74LZWCE.js} +2 -2
- package/dist/{chunk-ZB3V5QM7.js → chunk-FEIZXBLH.js} +2 -2
- package/dist/{chunk-NJA4MMBD.js → chunk-FH5WG4LE.js} +2 -2
- package/dist/{chunk-MRGTCMDK.js → chunk-FOZ74V56.js} +2 -2
- package/dist/{chunk-S5SKXCND.js → chunk-FQTIFWLR.js} +2 -2
- package/dist/chunk-FTTV7IRX.js +355 -0
- package/dist/chunk-FWQGH2N2.js +2 -0
- package/dist/{chunk-PFPHS4NO.js → chunk-GDHWOA57.js} +2 -2
- package/dist/{chunk-H3CKAL6P.js → chunk-GIDCP7KV.js} +2 -2
- package/dist/{chunk-6SDEQTVY.js → chunk-GL6UTNUB.js} +2 -2
- package/dist/{chunk-37TKC6MB.js → chunk-GP7C5VAE.js} +2 -2
- package/dist/{chunk-U24M5RQM.js → chunk-GQLDYCWS.js} +2 -2
- package/dist/{chunk-I5FCDTK2.js → chunk-GQXXOS55.js} +2 -2
- package/dist/{chunk-NTRW52UR.js → chunk-GUFPEFBG.js} +2 -2
- package/dist/{chunk-B2E3HZ2A.js → chunk-GV2CEZCW.js} +2 -2
- package/dist/{chunk-AM5SUGHF.js → chunk-GVAF222T.js} +2 -2
- package/dist/{chunk-TAJ6UGCO.js → chunk-GWYZVVKY.js} +3 -3
- package/dist/{chunk-NK76RSB6.js → chunk-HENP2O4A.js} +2 -2
- package/dist/{chunk-VG55NFXF.js → chunk-HINZQKSY.js} +2 -2
- package/dist/{chunk-6OVNYYY4.js → chunk-HQA7EBSK.js} +2 -2
- package/dist/{chunk-DLC6JDN7.js → chunk-HVFB3PME.js} +2 -2
- package/dist/{chunk-FY5V4V4F.js → chunk-I22IZYDI.js} +2 -2
- package/dist/{chunk-RVYLJDXC.js → chunk-ICUL7XRT.js} +2 -2
- package/dist/{chunk-QVHZB75Z.js → chunk-IHSLIIL3.js} +2 -2
- package/dist/{chunk-PNVZIJ57.js → chunk-ITSJMNUD.js} +2 -2
- package/dist/{chunk-XNUWRTYM.js → chunk-IZDPGOZR.js} +2 -2
- package/dist/chunk-J3GLP7Q5.js +3 -0
- package/dist/{chunk-BH5CE4LN.js → chunk-J7AMBVWF.js} +2 -2
- package/dist/{chunk-YXJ4IAHH.js → chunk-JCMFBF4Z.js} +2 -2
- package/dist/{chunk-ZJZQ7Q2Q.js → chunk-JFIA2JI3.js} +2 -2
- package/dist/{chunk-FIXYHQ3W.js → chunk-JLZLLLW5.js} +2 -2
- package/dist/{chunk-2E6BTWER.js → chunk-JSNTHRLQ.js} +2 -2
- package/dist/{chunk-77GHPR2R.js → chunk-JX6ZWDOS.js} +2 -2
- package/dist/{chunk-SRY26ITJ.js → chunk-JYI7CV25.js} +2 -2
- package/dist/chunk-K7JLSGCJ.js +8 -0
- package/dist/{chunk-DFPAZXLU.js → chunk-KPZGTB2O.js} +2 -2
- package/dist/{chunk-7Z7HCZ7J.js → chunk-LKUTSP4G.js} +2 -2
- package/dist/{chunk-HIEXRDJF.js → chunk-LMTSB3TB.js} +2 -2
- package/dist/{chunk-BLKYYQ7C.js → chunk-LONKINMJ.js} +95 -95
- package/dist/{chunk-SF34QLK2.js → chunk-LQHYYIOB.js} +2 -2
- package/dist/{chunk-HBQGKMM3.js → chunk-LZSQ6X7E.js} +2 -2
- package/dist/{chunk-RCPZOPV6.js → chunk-M2Y6PCFE.js} +2 -2
- package/dist/{chunk-WJOQC4P7.js → chunk-MEUHIDI3.js} +2 -2
- package/dist/{chunk-MT5W4DUG.js → chunk-MHWMEZDA.js} +2 -2
- package/dist/{chunk-FLLXYUOL.js → chunk-MQW6SJ4P.js} +2 -2
- package/dist/{chunk-57KEZDPT.js → chunk-MSI3K7PJ.js} +2 -2
- package/dist/chunk-MVRGB4KJ.js +278 -0
- package/dist/{chunk-27PHVDKL.js → chunk-MZNMASFM.js} +2 -2
- package/dist/{chunk-DVYG3JTA.js → chunk-NBCQZSGR.js} +2 -2
- package/dist/{chunk-NIO346UL.js → chunk-NBZKSTXP.js} +2 -2
- package/dist/{chunk-UWB5WMC2.js → chunk-NCJILOAK.js} +2 -2
- package/dist/{chunk-JN5LIBT3.js → chunk-NDKOVQFG.js} +2 -2
- package/dist/{chunk-W6C6QTXJ.js → chunk-NEWHKGVD.js} +2 -2
- package/dist/{chunk-HBXZAGY6.js → chunk-O2M3VNDY.js} +2 -2
- package/dist/chunk-OFGOOL6U.js +3 -0
- package/dist/{chunk-FEBLLMTL.js → chunk-OQUCBKOI.js} +2 -2
- package/dist/{chunk-5IO2APSS.js → chunk-P4NVCOM7.js} +2 -2
- package/dist/{chunk-SJZQ2PTZ.js → chunk-PFC44E6D.js} +2 -2
- package/dist/{chunk-LAGDJXFY.js → chunk-PHNCEUXX.js} +2 -2
- package/dist/{chunk-HYKSLTAR.js → chunk-PTQPPPG2.js} +2 -2
- package/dist/{chunk-5XEVXVTK.js → chunk-PUVNH4PO.js} +2 -2
- package/dist/chunk-Q23IMHXS.js +343 -0
- package/dist/{chunk-YYFV32WR.js → chunk-Q3ZCQY2Y.js} +2 -2
- package/dist/{chunk-OMBRP7BB.js → chunk-Q4XEU3UH.js} +2 -2
- package/dist/{chunk-I645ZF75.js → chunk-QEOWONKY.js} +2 -2
- package/dist/{chunk-JXHLB7TP.js → chunk-QMOZZ2VX.js} +2 -2
- package/dist/{chunk-2VKB5CMA.js → chunk-RCIGX23V.js} +2 -2
- package/dist/{chunk-J24VICI5.js → chunk-RIYJ4L33.js} +2 -2
- package/dist/{chunk-M4EVGA5S.js → chunk-RJVAPMHF.js} +3 -3
- package/dist/chunk-SB7NASHU.js +2 -0
- package/dist/{chunk-3XFJUWJE.js → chunk-SGMNWYTH.js} +2 -2
- package/dist/chunk-SMDIEDM4.js +27 -0
- package/dist/{chunk-IOVPAZWP.js → chunk-SX72EVMY.js} +2 -2
- package/dist/{chunk-WO47BIPY.js → chunk-T5X7DK6C.js} +2 -2
- package/dist/{chunk-CZEIHYMP.js → chunk-T6MQNNAC.js} +2 -2
- package/dist/chunk-T75DS2E6.js +21 -0
- package/dist/{chunk-57GCCPLS.js → chunk-TEANKHUU.js} +2 -2
- package/dist/{chunk-T55YPJGB.js → chunk-TJBOJUVN.js} +2 -2
- package/dist/{chunk-I2KP4AGR.js → chunk-TJWVT4DO.js} +2 -2
- package/dist/{chunk-KM4QRWI5.js → chunk-TNJGTQWO.js} +2 -2
- package/dist/{chunk-EFFMFK7C.js → chunk-TOTWJZIX.js} +2 -2
- package/dist/{chunk-QMGWSEPL.js → chunk-TPO7XC5Z.js} +2 -2
- package/dist/{chunk-54K6556S.js → chunk-U33PMPNW.js} +2 -2
- package/dist/{chunk-GXVDTHFC.js → chunk-U7NUXDQO.js} +2 -2
- package/dist/chunk-UC2FD2PS.js +4 -0
- package/dist/{chunk-TUTSO7UZ.js → chunk-UQE4XFSA.js} +2 -2
- package/dist/{chunk-4O52YNKL.js → chunk-UQYQBLJX.js} +2 -2
- package/dist/{chunk-FPDL2TUB.js → chunk-USOAJHY7.js} +2 -2
- package/dist/{chunk-JUO3Z644.js → chunk-UW6KD57C.js} +2 -2
- package/dist/{chunk-VLTUX4IF.js → chunk-VGWZ4MOY.js} +2 -2
- package/dist/{chunk-U2XX3BT4.js → chunk-VWYGCMV5.js} +2 -2
- package/dist/{chunk-IWAMYGPN.js → chunk-W7YLRXZE.js} +2 -2
- package/dist/{chunk-QKVTWODE.js → chunk-WK2IQJPK.js} +2 -2
- package/dist/{chunk-S64NCE2Z.js → chunk-WWCV4E6J.js} +2 -2
- package/dist/{chunk-IVJJNVSX.js → chunk-XMJ53WG4.js} +2 -2
- package/dist/{chunk-IGYAZPRX.js → chunk-XN3EKMLI.js} +2 -2
- package/dist/{chunk-FWY2PRIF.js → chunk-XQAVQVIL.js} +2 -2
- package/dist/{chunk-JYX5UZSZ.js → chunk-XQPPURLQ.js} +2 -2
- package/dist/{chunk-4AOOSCZ7.js → chunk-YHPG3S2U.js} +2 -2
- package/dist/{chunk-5BDK6QC3.js → chunk-YRKP7PM7.js} +2 -2
- package/dist/{chunk-4NHWNAWQ.js → chunk-YT4DVWUV.js} +2 -2
- package/dist/{chunk-5NJPH3QZ.js → chunk-YTJHCGYB.js} +2 -2
- package/dist/chunk-Z35GOVEH.js +2 -0
- package/dist/{chunk-K5G7SPAG.js → chunk-Z6RL7XOE.js} +4 -4
- package/dist/{chunk-OVKZM2XI.js → chunk-ZAFGY22Q.js} +2 -2
- package/dist/{chunk-A67HT5FR.js → chunk-ZB4C5TTR.js} +2 -2
- package/dist/{chunk-CWMHWD56.js → chunk-ZNH33XIB.js} +2 -2
- package/dist/{chunk-ZNQCR656.js → chunk-ZQ62NNKN.js} +2 -2
- package/dist/{cli-context-XEPPF4RX.js → cli-context-FJL2JHOE.js} +2 -2
- package/dist/{cli-context-TSADTXLB.js → cli-context-PQNWHMCQ.js} +2 -2
- package/dist/{cli-program-KJGQEM72.js → cli-program-UO7PZD6V.js} +2 -2
- package/dist/cli.js +1 -1
- package/dist/{code-CDe-mIjx.d.ts → code-DfX3xeWy.d.ts} +1 -1
- package/dist/{code-viewer-YGDON6SY.js → code-viewer-KIXEYQNJ.js} +2 -2
- package/dist/{code-viewer-ZCTHXQ5C.js → code-viewer-VHLBLIUM.js} +2 -2
- package/dist/{command-descriptors-5VAB2MZX.js → command-descriptors-F5P2V3NW.js} +129 -129
- package/dist/{command-descriptors-EAHKIRAG.js → command-descriptors-YCLATF5I.js} +130 -130
- package/dist/{db-DmRNdCtm.d.ts → db-BoG_PWYH.d.ts} +1 -1
- package/dist/direct-navigation-4XJTXIDT.js +2 -0
- package/dist/direct-navigation-J5MVYYAD.js +3 -0
- package/dist/{graph-evidence-Bs54NWws.d.ts → graph-evidence-D1jx1Cql.d.ts} +1 -1
- package/dist/{health-BnzbSLCE.d.ts → health-DkYBS5BI.d.ts} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/invocation-command-descriptors-RWV4VAI4.js +2 -0
- package/dist/invocation-command-descriptors-U76PN7IY.js +3 -0
- package/dist/{scip-cli-BRFKkHQn.d.ts → maintenance-types-CdL5eQii.d.ts} +1 -20
- package/dist/output-continuation-command-BL25S26S.js +3 -0
- package/dist/output-continuation-command-BTETTXEC.js +2 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-CRJU3IFG.js +2 -0
- package/dist/project-reindex-TQFCOA2O.js +3 -0
- package/dist/queries/affected.d.ts +1 -1
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.d.ts +1 -1
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.d.ts +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.d.ts +2 -2
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +1 -1
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.d.ts +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +2 -2
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.d.ts +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +2 -2
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +4 -4
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.d.ts +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.d.ts +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.d.ts +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.d.ts +3 -3
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +1 -1
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +1 -1
- package/dist/queries/surface.d.ts +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.d.ts +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.d.ts +2 -2
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +2 -2
- package/dist/reindex.d.ts +2 -4
- package/dist/reindex.js +71 -32
- package/dist/runtime.d.ts +1 -2
- package/dist/runtime.js +3 -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/sentinel-ensure-command-OSWGCFFL.js +3 -0
- package/dist/sentinel-ensure-command-SPW7XQLB.js +2 -0
- package/dist/sentinel-worker.js +1 -1
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +2 -2
- package/docs/INDEX_GENERATIONS.md +2 -2
- package/docs/NPM_RELEASE.md +323 -0
- package/docs/schemas/npm-release-state.schema.json +4 -13
- package/package.json +3 -11
- package/dist/chunk-2Q2LW5JW.js +0 -14
- package/dist/chunk-327YK6TB.js +0 -4
- package/dist/chunk-347TXATM.js +0 -2
- package/dist/chunk-36WRYYTE.js +0 -3
- package/dist/chunk-6OAHRI2D.js +0 -6
- package/dist/chunk-6URCE5QY.js +0 -2
- package/dist/chunk-6ZV5EDUT.js +0 -5
- package/dist/chunk-7R64XY4Y.js +0 -12
- package/dist/chunk-CANBLFVQ.js +0 -15
- package/dist/chunk-CCRZLRWJ.js +0 -2
- package/dist/chunk-G2XUZCF2.js +0 -88
- package/dist/chunk-H5QXP63L.js +0 -2
- package/dist/chunk-HCMQZPEO.js +0 -2
- package/dist/chunk-IEL6Q5W3.js +0 -308
- package/dist/chunk-IGQQUENU.js +0 -109
- package/dist/chunk-K2O7SBAU.js +0 -2
- package/dist/chunk-QVWDQTMG.js +0 -2
- package/dist/chunk-RJWAB4VR.js +0 -345
- package/dist/chunk-VCL7FK3E.js +0 -3
- package/dist/chunk-WOOTEWQT.js +0 -239
- package/dist/chunk-XYLV727H.js +0 -21
- package/dist/chunk-YMGZZEW4.js +0 -2
- package/dist/direct-navigation-B3SGOOBW.js +0 -2
- package/dist/direct-navigation-ZL362KXF.js +0 -3
- package/dist/invocation-command-descriptors-CSUGUHTT.js +0 -2
- package/dist/invocation-command-descriptors-PPVZOIE5.js +0 -3
- package/dist/output-continuation-command-FTVVBVSN.js +0 -2
- package/dist/output-continuation-command-ITPRC3YV.js +0 -3
- package/dist/project-reindex-7HZSLLLY.js +0 -3
- package/dist/project-reindex-NGM3DYBN.js +0 -2
- package/dist/sentinel-ensure-command-KYYULCFU.js +0 -2
- package/dist/sentinel-ensure-command-RIZA3RY7.js +0 -3
- package/docs/WINDOWS_SIDECAR_RELEASE.md +0 -424
- package/docs/schemas/windows-sidecar-provenance.schema.json +0 -137
- package/scripts/build-codebaseiq-windows.mjs +0 -197
- package/scripts/codebaseiq-windows-provenance.mjs +0 -364
- package/scripts/verify-codebaseiq-windows.mjs +0 -29
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{closeSync as te,fstatSync as N,openSync as re,readFileSync as yt,readSync as ke}from"fs";import{createHash as St}from"crypto";var Fe=8*1024*1024,Ee=64*1024*1024,xt=512*1024*1024,bt=256*1024*1024,j=class extends Error{constructor(r,n,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function ve(e,t){ie(t.maxBytes);let r=String(e),n=re(e,"r");try{let i=N(n);De(i,t,r);let o=yt(n),s=N(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new j(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{te(n)}}function I(e,t,r="utf8"){return ve(e,t).toString(r)}function D(e,t){return I(e,{maxBytes:Fe,inputKind:t})}function Pt(e,t){return I(e,{maxBytes:Ee,inputKind:t})}function ne(e,t){ie(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=ke(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new j(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function jt(e,t,r="utf8"){return ne(e,t).toString(r)}function Ie(e,t){let r=re(e,"r");try{return ne(r,t)}finally{te(r)}}function wt(e,t,r="utf8"){return Ie(e,t).toString(r)}function z(e,t,r){ie(t.maxBytes);let n=String(e),i=re(e,"r");try{let o=N(i);De(o,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=ke(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;r(s.subarray(0,u)),a+=u}let c=N(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new j(t.inputKind,n,"changed-during-read",c.size,t.maxBytes);return a}finally{te(i)}}function Ct(e,t){let r=St("sha256");return z(e,t,n=>r.update(n)),r.digest("hex")}function De(e,t,r){if(!e.isFile())throw new j(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new j(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function ie(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function oe(e,t,r=[]){let n=se(e);if(Be.has(n)||r.some(o=>M(n,o))||t.some(o=>Le(n,o)))return"config";if(t.some(ze)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let i=Ne(n);return t.some(o=>(Me[o]??[]).includes(i))?"source":"other"}function _e(e,t,r){let n=se(e);if(Be.has(n)||r?.some(o=>M(n,o))||Le(n,t)||ze(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let i=Ne(n);return(Me[t]??[]).includes(i)}function wn(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!Re(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!Re(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(kt)?null:t}function Cn(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),i=new Set([...r.keys(),...n.keys()]),o=[];for(let a of[...i].sort()){let c=r.get(a),u=n.get(a),l=oe(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:l,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:l,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:l,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(Oe(e?.files??[])||Oe(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ft)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Et(e,t):!0,uncertainty:[...s].sort()}}function Re(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Oe(e){return new Set(e.map(t=>t.path)).size!==e.length}function kt(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ft(e){return e.hash==="unreadable"||e.size<0}function Et(e,t){return Ae(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&Ae(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Ae(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((i,o)=>i===n[o])}var Be=new Set([".codebaseiq.json"]),vt={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},It={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Te=new Map;function Le(e,t){return vt[t].some(r=>M(e,r))||It[t].some(r=>M(e,r))}function M(e,t){let r=se(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,i=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return i===r;let o=Te.get(r);if(!o){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Te.set(r,o)}return o.test(i)}function se(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ne(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ze(e){return e==="typescript"||e==="javascript"}var Me={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{createRequire as Dt}from"module";var Rt=Dt(import.meta.url),Ge=Ot().version;function Ot(){for(let e of["../package.json","../../package.json"])try{return Rt(e)}catch{}return{version:"0.0.0"}}import{createHash as Xe,randomUUID as zt}from"crypto";import{chmodSync as Ye,existsSync as k,linkSync as Mt,lstatSync as H,readdirSync as le,realpathSync as x,unlinkSync as Gt,writeSync as Wt}from"fs";import{homedir as $t}from"os";import{basename as Ht,dirname as U,isAbsolute as qe,join as y,resolve as J}from"path";import{closeSync as At,existsSync as Tt,fsyncSync as _t,mkdirSync as Bt,openSync as Lt}from"fs";import{dirname as $e}from"path";function We(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function ae(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var R=Object.freeze({platform:process.platform,pathExists:e=>Tt(e),makeDirectory:e=>Bt(e,{recursive:!0}),openFile:(e,t,r)=>Lt(e,t,r),syncFile:e=>_t(e),closeFile:e=>At(e)});function He(e,t=R){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=$e(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=W(i,G($e(o),t));return i}function G(e,t=R){let r;try{r=t.openFile(e,"r")}catch(n){if(ae(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(ae(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function W(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{isAbsolute as Je,relative as Nt}from"path";var m=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function ce(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Tn(e){return e.replace(/\\/g,"/")}function _n(e,t){return ce(e)===ce(t)}function Ue(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let i=/^\/([A-Za-z]):(\/|$)/.exec(n);i&&(n=`/${i[1].toUpperCase()}:${n.slice(3)}`);let o=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${o}`}function Bn(e,t){return Ue(e)===Ue(t)}function S(e,t){let r=Nt(e,t);return r===""||!r.startsWith("..")&&!Je(r)}function C(e){if(!e)throw new m(e,"empty-path");if(e.includes("\0"))throw new m(e,"nul-byte");if(Je(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new m(e,"absolute-path");let t=ce(e);if(t.split("/").some(n=>n===".."))throw new m(e,"parent-traversal");if(!t||t===".")throw new m(e,"empty-path");return t}var Ve=1,A=".codebaseiq-cache-owner.json",Ut=16*1024,Qe=Object.freeze({...R,randomToken:()=>zt(),linkFile:(e,t)=>Mt(e,t),removeFile:e=>Gt(e),writeFile:(e,t,r,n)=>Wt(e,t,r,n)});function $(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function b(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Jt(e,t){let r=x(e);return Kt(r,de(r,t))}function de(e,t){let r=x(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?J(n):t?.dbPath?Yt(r,t.dbPath):qt(r)}function Ze(){let e=process.env.XDG_CACHE_HOME;return y(e||y($t(),".cache"),"codebaseiq")}function qt(e){let t=J(e);try{t=x(t)}catch{}let r=Xe("sha256").update(t).digest("hex").slice(0,12);return y(Ze(),"projects",r)}function qn(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(Ze(),"repositories",e);return rt(t),x(t)}function Kn(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Xn(e,t){let r=Jt(e,t);return{cacheDir:r,dbPath:y(r,"index.db"),indexPath:y(r,"index.scip"),metaPath:y(r,"meta.json")}}function Kt(e,t,r=Qe){return Xt(e,t,r).cacheDir}function Xt(e,t,r=Qe){let n=x(e),i=k(t)?"synced":rt(t,r),o=x(t),s=y(o,A);if(k(s))return ue(n,o),pe(s),O(o),{kind:"existing",cacheDir:o};Ke(o),tr(o),Ke(o);let c=`${JSON.stringify({schemaVersion:Ve,canonicalProjectRoot:n,canonicalCacheDir:o,creatorVersion:Ge},null,2)}
|
|
1
|
+
import{closeSync as te,fstatSync as N,openSync as re,readFileSync as yt,readSync as ke}from"fs";import{createHash as St}from"crypto";var Fe=8*1024*1024,Ee=64*1024*1024,xt=512*1024*1024,bt=256*1024*1024,j=class extends Error{constructor(r,n,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function ve(e,t){ie(t.maxBytes);let r=String(e),n=re(e,"r");try{let i=N(n);De(i,t,r);let o=yt(n),s=N(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new j(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{te(n)}}function I(e,t,r="utf8"){return ve(e,t).toString(r)}function D(e,t){return I(e,{maxBytes:Fe,inputKind:t})}function Pt(e,t){return I(e,{maxBytes:Ee,inputKind:t})}function ne(e,t){ie(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=ke(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new j(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function jt(e,t,r="utf8"){return ne(e,t).toString(r)}function Ie(e,t){let r=re(e,"r");try{return ne(r,t)}finally{te(r)}}function wt(e,t,r="utf8"){return Ie(e,t).toString(r)}function z(e,t,r){ie(t.maxBytes);let n=String(e),i=re(e,"r");try{let o=N(i);De(o,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=ke(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;r(s.subarray(0,u)),a+=u}let c=N(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new j(t.inputKind,n,"changed-during-read",c.size,t.maxBytes);return a}finally{te(i)}}function Ct(e,t){let r=St("sha256");return z(e,t,n=>r.update(n)),r.digest("hex")}function De(e,t,r){if(!e.isFile())throw new j(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new j(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function ie(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function oe(e,t,r=[]){let n=se(e);if(Be.has(n)||r.some(o=>M(n,o))||t.some(o=>Le(n,o)))return"config";if(t.some(ze)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let i=Ne(n);return t.some(o=>(Me[o]??[]).includes(i))?"source":"other"}function _e(e,t,r){let n=se(e);if(Be.has(n)||r?.some(o=>M(n,o))||Le(n,t)||ze(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let i=Ne(n);return(Me[t]??[]).includes(i)}function wn(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!Re(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!Re(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(kt)?null:t}function Cn(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),i=new Set([...r.keys(),...n.keys()]),o=[];for(let a of[...i].sort()){let c=r.get(a),u=n.get(a),l=oe(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:l,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:l,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:l,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(Oe(e?.files??[])||Oe(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ft)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Et(e,t):!0,uncertainty:[...s].sort()}}function Re(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Oe(e){return new Set(e.map(t=>t.path)).size!==e.length}function kt(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ft(e){return e.hash==="unreadable"||e.size<0}function Et(e,t){return Ae(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&Ae(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Ae(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((i,o)=>i===n[o])}var Be=new Set([".codebaseiq.json"]),vt={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln","*.slnx"],vb:["*.vbproj","*.sln","*.slnx"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},It={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Te=new Map;function Le(e,t){return vt[t].some(r=>M(e,r))||It[t].some(r=>M(e,r))}function M(e,t){let r=se(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,i=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return i===r;let o=Te.get(r);if(!o){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Te.set(r,o)}return o.test(i)}function se(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ne(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ze(e){return e==="typescript"||e==="javascript"}var Me={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{createRequire as Dt}from"module";var Rt=Dt(import.meta.url),Ge=Ot().version;function Ot(){for(let e of["../package.json","../../package.json"])try{return Rt(e)}catch{}return{version:"0.0.0"}}import{createHash as Xe,randomUUID as zt}from"crypto";import{chmodSync as Ye,existsSync as k,linkSync as Mt,lstatSync as H,readdirSync as le,realpathSync as x,unlinkSync as Gt,writeSync as Wt}from"fs";import{homedir as $t}from"os";import{basename as Ht,dirname as U,isAbsolute as qe,join as y,resolve as J}from"path";import{closeSync as At,existsSync as Tt,fsyncSync as _t,mkdirSync as Bt,openSync as Lt}from"fs";import{dirname as $e}from"path";function We(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function ae(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var R=Object.freeze({platform:process.platform,pathExists:e=>Tt(e),makeDirectory:e=>Bt(e,{recursive:!0}),openFile:(e,t,r)=>Lt(e,t,r),syncFile:e=>_t(e),closeFile:e=>At(e)});function He(e,t=R){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=$e(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=W(i,G($e(o),t));return i}function G(e,t=R){let r;try{r=t.openFile(e,"r")}catch(n){if(ae(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(ae(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function W(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{isAbsolute as Je,relative as Nt}from"path";var m=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function ce(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Tn(e){return e.replace(/\\/g,"/")}function _n(e,t){return ce(e)===ce(t)}function Ue(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let i=/^\/([A-Za-z]):(\/|$)/.exec(n);i&&(n=`/${i[1].toUpperCase()}:${n.slice(3)}`);let o=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${o}`}function Bn(e,t){return Ue(e)===Ue(t)}function S(e,t){let r=Nt(e,t);return r===""||!r.startsWith("..")&&!Je(r)}function C(e){if(!e)throw new m(e,"empty-path");if(e.includes("\0"))throw new m(e,"nul-byte");if(Je(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new m(e,"absolute-path");let t=ce(e);if(t.split("/").some(n=>n===".."))throw new m(e,"parent-traversal");if(!t||t===".")throw new m(e,"empty-path");return t}var Ve=1,A=".codebaseiq-cache-owner.json",Ut=16*1024,Qe=Object.freeze({...R,randomToken:()=>zt(),linkFile:(e,t)=>Mt(e,t),removeFile:e=>Gt(e),writeFile:(e,t,r,n)=>Wt(e,t,r,n)});function $(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function b(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Jt(e,t){let r=x(e);return Kt(r,de(r,t))}function de(e,t){let r=x(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?J(n):t?.dbPath?Yt(r,t.dbPath):qt(r)}function Ze(){let e=process.env.XDG_CACHE_HOME;return y(e||y($t(),".cache"),"codebaseiq")}function qt(e){let t=J(e);try{t=x(t)}catch{}let r=Xe("sha256").update(t).digest("hex").slice(0,12);return y(Ze(),"projects",r)}function qn(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(Ze(),"repositories",e);return rt(t),x(t)}function Kn(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Xn(e,t){let r=Jt(e,t);return{cacheDir:r,dbPath:y(r,"index.db"),indexPath:y(r,"index.scip"),metaPath:y(r,"meta.json")}}function Kt(e,t,r=Qe){return Xt(e,t,r).cacheDir}function Xt(e,t,r=Qe){let n=x(e),i=k(t)?"synced":rt(t,r),o=x(t),s=y(o,A);if(k(s))return ue(n,o),pe(s),O(o),{kind:"existing",cacheDir:o};Ke(o),tr(o),Ke(o);let c=`${JSON.stringify({schemaVersion:Ve,canonicalProjectRoot:n,canonicalCacheDir:o,creatorVersion:Ge},null,2)}
|
|
2
2
|
`;try{let u=rr(s,c,r),l=W(i,u);return{kind:"published",cacheDir:o,achievedDurability:l==="synced"?"directory-durable":"file-flushed",directorySync:l}}catch(u){if(ir(u))return ue(n,o),{kind:"existing",cacheDir:o};throw u}}function ue(e,t){let r=x(e),n=x(t);return Qt(n,r,n)}function Yn(e,t){return k(y(t,A))?(ue(e,t),et(t),!0):!1}function Yt(e,t){let r;try{r=C(t)}catch(s){throw s instanceof m?$(t,s.reason):s}let n=J(e,...r.split("/"));if(n===e||!S(e,n))throw $(t,"outside-project");let i=Vt(n),o=x(i);if(!S(e,o)&&o!==e)throw $(t,"symlink-escape");return n}function Vt(e){let t=e;for(;!k(t);){let r=U(t);if(r===t)throw $(e,"no-existing-ancestor");t=r}return t}function Qt(e,t,r){let n=y(e,A);if(!k(n)||H(n).isSymbolicLink())throw b(e,"missing regular ownership record");let i=H(n);if(!i.isFile()||i.size>Ut)throw b(e,"invalid ownership record file");let o=D(n,"cache ownership record"),s=Zt(o,e);if(s.canonicalProjectRoot!==t)throw b(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==r)throw b(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Xe("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Zt(e,t){try{let r=JSON.parse(e);if(r.schemaVersion!==Ve||typeof r.canonicalProjectRoot!="string"||typeof r.canonicalCacheDir!="string"||typeof r.creatorVersion!="string"||!qe(r.canonicalProjectRoot)||!qe(r.canonicalCacheDir))throw new Error("invalid fields");return r}catch(r){throw b(t,`malformed ownership record: ${r instanceof Error?r.message:String(r)}`)}}function Ke(e){let t=le(e).filter(r=>r!==A&&!er(r));if(t.length>0)throw b(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function er(e){return e.startsWith(`${A}.tmp-`)||[".codebaseiq-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function tr(e){for(let t of le(e)){let r=y(e,t);try{let n=H(r);if(n.isSymbolicLink())throw b(e,`legacy cache entry ${t} is a symlink`);if(n.isDirectory())O(r);else if(n.isFile())pe(r);else throw b(e,`legacy cache entry ${t} is not a file or directory`)}catch(n){if(tt(n))continue;throw n}}O(e)}function et(e,t=!1){try{let r=H(e);if(r.isSymbolicLink())throw b(e,"managed cache tree contains a symlink");if(r.isFile()){pe(e);return}if(!r.isDirectory())throw b(e,"managed cache tree contains a special file");O(e);for(let n of le(e))et(y(e,n),!0)}catch(r){if(t&&tt(r))return;throw r}}function tt(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function rt(e,t=R){let r=He(e,t);return O(e),r}function rr(e,t,r){let n=`${e}.tmp-${process.pid}-${r.randomToken()}`,i,o=!1;try{i=r.openFile(n,"wx",384),o=!0,We(i,Buffer.from(t),r,"cache ownership record"),r.syncFile(i),r.closeFile(i),i=void 0,r.linkFile(n,e);let s=G(U(e),r);return r.removeFile(n),o=!1,W(s,G(U(e),r))}finally{if(i!==void 0)try{r.closeFile(i)}catch{}if(o)try{r.removeFile(n)}catch{}}}function O(e){process.platform!=="win32"&&Ye(e,448)}function pe(e){process.platform!=="win32"&&Ye(e,384)}function nr(e){if(k(e))return x(e);let t=[],r=e;for(;;){let n=U(r);if(n===r)return e;if(t.unshift(Ht(r)),k(n))return y(x(n),...t);r=n}}function Vn(e){return nr(J(e))}function ir(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as or}from"child_process";import{createHash as sr}from"crypto";import{existsSync as ar,lstatSync as cr,realpathSync as ur}from"fs";import{dirname as lr,isAbsolute as dr,join as pr,resolve as K}from"path";function he(){return{...process.env,GIT_OPTIONAL_LOCKS:"0",LC_ALL:"C"}}var T={run(e,t){let r=nt(e,t);return r.kind==="success"?r.output:void 0},runResult:nt},fr=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],fe=/^[0-9a-f]{40,64}$/;function ni(e,t,r=T){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let n=r.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(n.kind!=="success"||!fe.test(n.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return n.output}function ii(e,t=T){let r=t.runResult(e,fr);if(r.kind==="success"){let n=gr(r.output);if(n)return hr(n,t)}return mr(e,t)}function gr(e){let t=e.split(`
|
|
3
3
|
`).map(c=>c.trim());if(t.length!==5)return;let[r,n,i,o,s]=t;if(!r||!n||!i||!o||!s||!fe.test(o)||!fe.test(s))return;let a=P(r);return{root:a,gitDir:P(q(a,n)),commonDir:P(q(a,i)),headCommit:o,treeOid:s}}function hr(e,t){let r=t.run(e.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...it(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:me("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.length===0}}function mr(e,t){let r=yr(e,t);if(r.kind!=="worktree")return;let n=r.identity,i=n.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=P(q(i,o)),a=ge(t.run(i,["rev-parse","--verify","HEAD"])),c=ge(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,["status","--porcelain=v1","-z","--untracked-files=all"]);if(u!==void 0)return{...n,commonDir:s,repositoryId:me("repository",s),headCommit:a,treeOid:c,clean:u.length===0}}function yr(e,t=T){let r=t.runResult(e,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let i=P(n),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=P(q(i,o));return{kind:"worktree",identity:it(i,s)}}function it(e,t){return{projectRoot:e,gitDir:t,worktreeId:me("worktree",`${e}\0${t}`)}}function oi(e,t=T){let r=t.run(e,["worktree","list","--porcelain","-z"]);return r===void 0?[]:Sr(r)}function Sr(e){let t=[],r;for(let n of e.split("\0")){if(n===""){r&&t.push(r),r=void 0;continue}let i=n.indexOf(" "),o=i<0?n:n.slice(0,i),s=i<0?"":n.slice(i+1);if(o==="worktree"){r&&t.push(r),r={path:P(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}r&&(o==="HEAD"?r.head=s:o==="branch"?r.branch=s:o==="detached"?r.detached=!0:o==="bare"?r.bare=!0:o==="prunable"?r.prunable=!0:o==="locked"&&(r.locked=!0))}return r&&t.push(r),t}function si(e,t,r=T){return ge(r.run(e,t))}function q(e,t){return dr(t)?t:K(e,t)}function P(e){try{return ur(e)}catch{return K(e)}}function me(e,t){return sr("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function ge(e){return e?.trim()||void 0}function nt(e,t){let r=or("git",["-C",e,...t],{encoding:"utf-8",env:he(),maxBuffer:52428800,stdio:["ignore","pipe","pipe"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let i=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&ar(K(e)))&&!xr(e)?{kind:"not-repository"}:{kind:"error",message:i}}function xr(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=K(e);for(;;){try{return cr(pr(t,".git")),!0}catch(n){let i=n.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let r=lr(t);if(r===t)return!1;t=r}}import{execFileSync as Xr}from"child_process";import{createHash as ft}from"crypto";import{closeSync as Yr,fstatSync as gt,lstatSync as be,openSync as Vr,readdirSync as Qr,readFileSync as Zr,readlinkSync as en,realpathSync as V}from"fs";import{isAbsolute as tn,join as Pe,relative as rn,resolve as nn,sep as on}from"path";import{execFileSync as ye}from"child_process";import{createHash as br}from"crypto";import{mkdirSync as Pr,renameSync as jr,writeFileSync as wr}from"fs";import{basename as Cr,dirname as kr,join as Fr}from"path";var Er="git-content-hashes.json",vr=32*1024*1024,Ir=2e5,X=3e4;function Se(){return{env:he(),encoding:"utf8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:X,killSignal:"SIGKILL"}}function ot(e){let t,r;try{t=ye("git",["-C",e,"ls-files","-s","-z","--","."],{...Se(),timeout:X}),r=ye("git",["-C",e,"status","--porcelain=v1","-z","--untracked-files=all","--no-renames","--","."],{...Se(),timeout:X})}catch{return null}let n=new Map,i=[];for(let l of t.split("\0")){if(!l)continue;let f=l.indexOf(" "),p=f>0?l.slice(0,f).split(" "):[];if(p.length!==3)continue;let[h,g,L]=p,w=l.slice(f+1);if(h!=="100644"&&h!=="100755"||L!=="0"){n.delete(w);continue}n.set(w,g),Cr(w)===".gitattributes"&&i.push(`${w}:${g}`)}let o=new Set;for(let l of r.split("\0"))l.length>=4&&l[2]===" "&&o.add(l.slice(3));let s=Dr(e,i),a=Fr(de(e),Er),c=Rr(a,s),u=new Map;return{lookup(l){if(o.has(l))return;let f=n.get(l);if(f)return u.get(f)??c.entries[f]},seed(l,f){if(o.has(l))return;let p=n.get(l);!p||c.entries[p]||u.has(p)||u.set(p,f)},persist(){if(u.size===0)return;let l=new Set(n.values()),f={};for(let[p,h]of Object.entries(c.entries))l.has(p)&&(f[p]=h);for(let[p,h]of u)f[p]=h;if(!(Object.keys(f).length>Ir))try{Pr(kr(a),{recursive:!0});let p=`${a}.${process.pid}.tmp`;wr(p,JSON.stringify({version:1,salt:s,entries:f})),jr(p,a)}catch{}}}}function Dr(e,t){let r="";try{r=ye("git",["-C",e,"config","--get-regexp","^core\\.(autocrlf|eol|safecrlf)$"],{...Se(),timeout:X})}catch{}return br("sha256").update(JSON.stringify([r.trim(),t.sort()])).digest("hex")}function Rr(e,t){let r={version:1,salt:t,entries:{}};try{let n=I(e,{maxBytes:vr,inputKind:"git-content-hash-store"}),i=JSON.parse(n);if(i.version!==1||i.salt!==t||!i.entries||typeof i.entries!="object")return r;let o={};for(let[s,a]of Object.entries(i.entries))/^[0-9a-f]{40,64}$/.test(s)&&a&&typeof a.size=="number"&&Number.isInteger(a.size)&&a.size>=0&&typeof a.hash=="string"&&/^[0-9a-f]{64}$/.test(a.hash)&&(o[s]={size:a.size,hash:a.hash});return{version:1,salt:t,entries:o}}catch{return r}}import{AsyncLocalStorage as Or}from"async_hooks";var Ar=new Or;function E(e,t){let r=Y(e);if(!r||r.missing.has(t))return;let n=r.files.get(t);if(n)return n;let i=r.readBaseFile?.(t);return i&&r.files.set(t,i),i}function v(e,t){let r=Y(e);if(r)return r.missing.has(t)?"missing":r.paths.includes(t)?"present":"missing"}function st(e,t){return Y(e)?.fingerprints.get(t)}function F(e){return Y(e)?.paths}function Y(e){let t=Ar.getStore();if(t)return t.projectRoot===P(e)?t:void 0}import{createRequire as Tr}from"module";import{existsSync as _r,readdirSync as Br,statSync as Lr}from"fs";import d from"path";var Nr=Tr(import.meta.url),at=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function zr(e,t=[]){let r=d.resolve(e),n=t.flatMap(c=>Gr(r,c));if(n.length>0)return ct(r,lt(n));let i=Mr(r),o=lt(i),s=Wr(r,o)?[r,...o]:o,a=s.length>0?s:[r];return ct(r,a)}function dt(e,t,r=[]){let n;try{n=Nr("ts-morph")}catch{return null}let i=d.resolve(e),o=t==="workspace"?zr(i,r):["."],s=new Set;for(let a of o){let c=a==="."?i:d.join(i,a),u=d.join(c,"tsconfig.json"),l=Jr(n.ts,i);if(!l.fileExists(u))return null;let f=n.ts.readConfigFile(u,l.readFile);if(f.error)return null;let p=n.ts.parseJsonConfigFileContent(f.config,l,c);if(p.errors.length>0)return null;for(let h of p.fileNames){let g=d.resolve(h);S(i,g)&&s.add(d.relative(i,g).split(d.sep).join("/"))}}return s}function ct(e,t){return[...new Set(t.map(r=>_(e,r)))].sort((r,n)=>r.localeCompare(n))}function Mr(e){let t=F(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>at.has(s)))return[];let o=d.join(e,...i.split("/"));return ut(e,o)?[d.dirname(o)]:[]});let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=Br(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=d.join(i,s.name);if(s.isDirectory()){!at.has(s.name)&&!s.name.startsWith(".")&&n.push(a);continue}s.isFile()&&ut(e,a)&&r.push(d.dirname(a))}}return r}function Gr(e,t){let r=t.trim();if(!r)return[];let n=d.resolve(e,r);if(!S(e,n))return[];let i=F(e);if(i){let o=_(e,n);if(i.includes(o)&&xe(d.basename(n)))return[d.dirname(n)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[n]:[]}try{let o=Lr(n);if(o.isDirectory())return[n];if(o.isFile()&&xe(d.basename(n)))return[d.dirname(n)]}catch{return[]}return[]}function ut(e,t){if(!xe(d.basename(t)))return!1;let r=pt(e,t);return r?d.basename(t)==="tsconfig.json"||"include"in r||"files"in r||"references"in r:!1}function xe(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function lt(e){let t=[...new Set(e.map(r=>d.resolve(r)))].sort((r,n)=>r.localeCompare(n));return t.length<=1?t:t.filter(r=>!t.some(n=>n!==r&&Kr(r,n)))}function Wr(e,t){if(t.length===0||t.some(n=>d.resolve(n)===e))return!1;let r=d.join(e,"tsconfig.json");return Hr(e,r)&&$r(e,r)}function $r(e,t){let n=pt(e,t)?.include;return Array.isArray(n)?n.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!d.extname(i))):!1}function pt(e,t){try{let r=JSON.parse(Ur(e,t));return r&&typeof r=="object"&&!Array.isArray(r)?r:null}catch{return null}}function Hr(e,t){let r=_(e,t),n=v(e,r);return n?n==="present":_r(t)}function Ur(e,t){let r=_(e,t);if(F(e)){let i=E(e,r);if(!i)throw Object.assign(new Error(`Snapshot file ${r} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return D(t,"TypeScript project config")}function Jr(e,t){let r=F(t);if(!r)return e.sys;let n=d.resolve(t),i=new Set(r),o=qr(n,r),s=e,a=c=>{let u=d.resolve(c);return S(n,u)?_(n,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):E(n,u)?.content.toString("utf8")},readDirectory(c,u,l,f,p){let h=d.resolve(c);return S(n,h)?s.matchFiles(h,u,l,f,e.sys.useCaseSensitiveFileNames,n,p,g=>o.get(d.resolve(g))??{files:[],directories:[]},g=>g):e.sys.readDirectory(c,u,l,f,p)}}}function qr(e,t){let r=new Map,n=new Map,i=o=>{r.has(o)||r.set(o,new Set),n.has(o)||n.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),n.get(a).add(u),a=d.join(a,u),i(a)}r.get(a).add(s.at(-1))}return new Map([...r].map(([o,s])=>[o,{files:[...s].sort(),directories:[...n.get(o)??[]].sort()}]))}function _(e,t){let r=d.relative(e,t);return r?r.split(d.sep).join("/"):"."}function Kr(e,t){let r=d.relative(e,t);return!!r&&!r.startsWith("..")&&!d.isAbsolute(r)}var Q=64*1024*1024,B=class extends Error{constructor(r,n,i,o){super(`${r} ${JSON.stringify(n)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=r;this.inputPath=n;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="CODEBASEIQ_INPUT_TOO_LARGE"};function sn(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function ht(e,t,r={}){let n=C(t),i=V(e),o=nn(i,...n.split("/"));if(!S(i,o)||o===i)throw new m(t,"outside-project");let s=V(o);if(!S(i,s)||s===i)throw new m(t,"outside-project");let a=be(s);if(!a.isFile())throw new m(t,"not-a-file");let c={projectRoot:i,relativePath:n,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=r.maxBytes??Q;if(mt(u),c.size>u)throw new B(r.inputKind??"project file",c.relativePath,c.size,u);return c}function an(e,t,r={}){let n=C(t),i=v(e,n);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(n)} does not exist.`),{code:"ENOENT"});let c=E(e,n);if(!c)throw new m(n,"changed-during-read");let u=r.maxBytes??Q;if(mt(u),c.size>u)throw new B(r.inputKind??"project file",n,c.size,u);return Buffer.from(c.content)}let o=ht(e,t,r),s=r.maxBytes??Q,a=Vr(o.absolutePath,"r");try{let c=gt(a);if(!c.isFile()||c.dev!==o.device||c.ino!==o.inode||c.size!==o.size)throw new m(t,"changed-during-read");if(c.size>s)throw new B(r.inputKind??"project file",o.relativePath,c.size,s);let u=Zr(a),l=gt(a);if(l.dev!==c.dev||l.ino!==c.ino||l.size!==c.size||u.byteLength!==c.size)throw new m(t,"changed-during-read");return u}finally{Yr(a)}}function Bi(e,t,r={}){return an(e,t,r).toString("utf8")}function je(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function Li(e,t){try{return ht(e,t),!0}catch(r){if(je(r))return!1;throw r}}function mt(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function cn(e){return(F(e)??gn(e)??hn(e)).filter(t=>t&&!we(t)).sort()}function un(e,t={}){let r=(t.includePaths??[]).map(C),n=[...new Set([...cn(e),...r])].filter(c=>!we(c)).filter(c=>!t.language||_e(c,t.language,t.markerFiles)).filter(c=>!t.includePath||t.includePath(c)).sort(),i=V(e),o,s=()=>o??=ot(i),a=n.flatMap(c=>{let u=st(e,c);if(u)return[{path:c,size:u.fingerprintSize??u.size,hash:u.sha256}];let l=v(e,c);if(l==="present"){let g=E(e,c);if(g)return[{path:c,size:g.fingerprintSize??g.size,hash:g.sha256}]}let f=l===void 0?s():null,p=f?.lookup(c);if(p)return[{path:c,size:p.size,hash:p.hash}];let h=Pe(e,c);try{if(be(h).isSymbolicLink()){let Z=V(h),ee=rn(i,Z);if(ee===".."||ee.startsWith(`..${on}`)||tn(ee))throw new Error("external symlink");let Ce=en(h);return[{path:c,size:Buffer.byteLength(Ce),hash:ft("sha256").update("symlink\0").update(Ce).digest("hex")}]}let g=ft("sha256"),L=z(h,{inputKind:"project fingerprint input",maxBytes:Q},Z=>g.update(Z)),w=g.digest("hex");return f?.seed(c,{size:L,hash:w}),[{path:c,size:L,hash:w}]}catch(g){return je(g)?[]:[{path:c,size:-1,hash:"unreadable"}]}});return o?.persist(),a}function Ni(e,t,r){let n=pn(t,r),i=[...n.typescriptProjects.filter(s=>dn(e,s)),...n.clojureConfigPath?[n.clojureConfigPath]:[]],o=n.languages.includes("typescript")?dt(e,n.typescriptProjectMode,n.typescriptProjects):null;return{...n,files:un(e,{includePath:s=>{let a=oe(s,t,i);return a==="other"?!1:a!=="source"||!ln(s)||!o?!0:o.has(s)},includePaths:i})}}function ln(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function dn(e,t){let r;try{r=C(t)}catch{return!1}let n=v(e,r);if(n)return n==="present";try{return be(Pe(e,r)).isFile()}catch(i){if(je(i))return!1;throw i}}function pn(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:sn(t.typescriptProjects),clojureConfigPath:fn(t.clojureConfigPath)}}function fn(e){return e?.trim()||void 0}function gn(e){try{return Xr("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
4
4
|
`).filter(Boolean)}catch{return null}}function hn(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?Pe(e,n):e,o;try{o=Qr(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){we(a)||r.push(a);continue}t.push(a)}}return t}function we(e){let t=e.split("/");return e==="meta.json"||t[0]===".codebaseiq"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(r=>mn.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var mn=new Set([".git","node_modules",".codebaseiq-cache",".codebaseiq-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{Fe as a,Ee as b,xt as c,bt as d,j as e,ve as f,I as g,D as h,Pt as i,jt as j,wt as k,z as l,Ct as m,oe as n,wn as o,Cn as p,kt as q,vt as r,We as s,ae as t,R as u,He as v,G as w,W as x,m as y,ce as z,Tn as A,_n as B,Ue as C,Bn as D,S as E,C as F,Ge as G,A as H,de as I,Ze as J,qt as K,qn as L,Kn as M,Xn as N,Yn as O,Vn as P,he as Q,T as R,ni as S,ii as T,yr as U,oi as V,si as W,q as X,P as Y,zr as Z,B as _,sn as $,ht as aa,an as ba,Bi as ca,je as da,Li as ea,cn as fa,un as ga,Ni as ha,pn as ia};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-UQYQBLJX.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{A as G,D as P,a as y,b as ce,i as k,j as le,t as B,u as de,w as j,x as ue,y as b}from"./chunk-
|
|
2
|
+
import{A as G,D as P,a as y,b as ce,i as k,j as le,t as B,u as de,w as j,x as ue,y as b}from"./chunk-JLZLLLW5.js";import{c as Y,d as H,e as Z,g as X,i as ee,k as x}from"./chunk-AQI4N64O.js";import{E,a as g,b as Q,c as C,e as S,v as se,x as ae}from"./chunk-C7QWUBR2.js";import{la as W}from"./chunk-7UCDGXRW.js";import{Ga as N,Ha as L,Ja as M,V as te,Wa as oe,Xa as re,Za as ie,ga as T,ka as ne}from"./chunk-FTTV7IRX.js";function ge(e,n,t){if(!Number.isSafeInteger(t.limit)||t.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=N(e,n);if(!o)return{rows:[],hasMore:!1,producer:t.producer??"source-keyset",semanticEnrichment:!1};if(t.producer==="complete-only"||t.semantic===!0||o.relativePath.endsWith(".rb"))return F(e,n,t);let i=oe(e,o);if(!i)return F(e,n,t);let s=fe(e,o),c=Te(e,s),a=[],l=t.producer==="source-keyset";for(let u of c){if(t.after&&u<t.after.relativePath)continue;t.instrumentation?.fileScanned?.(u);let f=re(e,i,u);f.length>0&&(l=!0);let d=new Set(f);s?.relativePath===u&&d.add(s.line);for(let m of[...d].sort((p,Ae)=>p-Ae)){let p={relativePath:u,line:m};if(!(t.after&&R(p,t.after)<=0)&&(a.push(p),t.instrumentation?.rowAccepted?.(p),l&&a.length>t.limit))return me(a,t.limit)}}return l?me(a,t.limit):F(e,n,t,s)}function R(e,n){return(e.relativePath<n.relativePath?-1:e.relativePath>n.relativePath?1:0)||e.line-n.line}function me(e,n){return{rows:e.slice(0,n),hasMore:e.length>n,producer:"source-keyset",semanticEnrichment:!1}}function F(e,n,t,o){let r=N(e,n),i=t.semantic===!0||r?.relativePath.endsWith(".rb")?E(e,n,{semantic:t.semantic}):De(e,n,o),s=Me(i).filter(c=>!t.after||R(c,t.after)>0);for(let c of s.slice(0,t.limit+1))t.instrumentation?.rowAccepted?.(c);return{rows:s.slice(0,t.limit),hasMore:s.length>t.limit,producer:"complete-only",semanticEnrichment:t.semantic===!0}}function De(e,n,t){let o=N(e,n);if(!o)return[];let r=t===void 0?fe(e,o):t,i=ie(e,o).map(s=>({relativePath:s.file,line:s.line}));return r?[r,...i]:i}function fe(e,n){return!ne(n.symbol)&&!e.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function Te(e,n){let t=te(e);return!n||t.includes(n.relativePath)?t:[...t,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Me(e){let n=new Map;for(let t of e)n.set(`${t.relativePath}\0${t.line}`,t);return[...n.values()].sort(R)}import{InvalidArgumentError as v}from"commander";var St=W,Be=/^[+-]?\d+$/u,je=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,xt=(e=>V(e,"an integer")),pe=(e=>{let n=V(e,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${e}".`);return n}),he=(e=>{let n=V(e,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${e}".`);return n}),Et=(e=>{if(!je.test(e))throw new v(`Expected a number, got "${e}".`);let n=Number(e);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${e}".`);return n});function V(e,n){if(!Be.test(e))throw new v(`Expected ${n}, got "${e}".`);let t=Number(e);if(!Number.isSafeInteger(t))throw new v(`Expected ${n}, got "${e}".`);return t}function h(e,n,t,...o){return o.length>0?{flags:e,description:n,parser:t,defaultValue:o[0]}:{flags:e,description:n,parser:t}}function Ge(){return h("--json","Output as JSON for programmatic consumption")}function Fe(){return h("--compact","Emit minified one-line JSON (use with --json)")}function Ve(){return h("--result-only","Emit only the command-owned result (use with --json)")}function Ce(e=[]){return I(e)}function I(e=[]){let n=[Ge(),Ve(),Fe()],t=new Set(n.map(o=>o.flags));return[...e.filter(o=>!t.has(o.flags)),...n]}function $(e,n=[]){return{category:e,examples:n}}function Pt(e,n){return{origin:"mixed",observedSources:e,producerValidation:{status:"not-evaluated"},families:n}}function $t(e,n){return{origin:e,observedSources:n,producerValidation:{status:"not-evaluated"}}}function wt(e,n,t){return{id:e,selector:n,origin:{kind:"fixed",origin:t}}}function Ot(e,n,t,o){return{id:e,selector:n,origin:{kind:"result-field",field:t,values:o}}}function w(e,n,t,o,r,i,s){return{answers:typeof e=="string"?[e]:e,returns:typeof n=="string"?[n]:n,inputs:t,coverage:o,operation:i,semantic:s,...r?{scope:r}:{}}}function Nt(e,n,t,o,r,i=y){let s=typeof e=="string"?[e]:e,c=typeof n=="string"?[n]:n;return w(s,c,t,o,r,i,K(s.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function ye(e,n,t,o,r,i=y){let s=typeof e=="string"?[e]:e,c=typeof n=="string"?[n]:n;return w(s,c,t,o,r,i,Ke(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function be(e,n,t={ranking:"identity-only"}){return{kind:"locator",locates:e,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...t}}function Lt(e){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...e}}function Re(e,n,t,o={}){return{kind:"source-read",reads:e,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...t?{compatibility:t}:{},...o}}function K(e,n,t,o,r={}){return{kind:"analysis",analysis:e,resultMeaning:n,nonClaims:t,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Ke(e,n,t,o={}){return{kind:"maintenance",effect:e,nonClaims:n,outputCost:"variable",frontierClosure:[],...t?{compatibility:t}:{},...o}}function J(e){return Buffer.from(JSON.stringify(e),"utf8").toString("base64url")}function A(e){return e.generation.identity}function U(e){return"after"in e?J({version:2,...e}):J({version:1,...e})}function ve(e,n){let t=_e(e);if(!Je(t)&&!Ue(t))throw new Error("Invalid result cursor. Run the command again without --cursor.");return ze(t,n),t}function Je(e){if(!e||typeof e!="object")return!1;let n=e;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ue(e){if(!e||typeof e!="object")return!1;let n=e,t=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!t&&typeof t.relativePath=="string"&&t.relativePath.length>0&&Number.isSafeInteger(t.line)&&(t.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function _e(e){try{return JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function ze(e,n){if(e.command!==n.command||e.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(e.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function Se(e,n){let t=L(e,n),o=qe(t);for(let r of o)console.log(r)}function xe(e,n,t="No results found for resolved symbol."){return L(e,n).match?t:z(n,M(e,n,5))}function _(e,n,t,o){return{...D(e,n),[o]:t}}function D(e,n){let t=L(e,n);return t.match?{matched:!0,resolved:{symbol:t.match.symbol,shortName:T(t.match.symbol),relativePath:t.match.relativePath},otherMatches:t.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:t.total}:{matched:!1,suggestions:M(e,n,5)}}function z(e,n){let t=`No definition matched '${e}'.`;return n.length>0?`${t} Suggestions: ${n.join(", ")}`:t}function qe(e){if(!e.match||e.total<=1)return[];let n=e.match,t=Math.max(0,e.total-1),o=[`Resolved: ${T(n.symbol)} (${n.relativePath}) -- ${t} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=e.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(i=>`${i.shortName} (${i.relativePath}:${g(i.startLine)})`).join("; ")}`),o.push(""),o}var We=k(({db:e,args:n,opts:t})=>{let o=B(n,0),r=b(t,"signatures"),i=se(e,o);if(b(t,"json")){P("outline",n,t,i);return}if(console.log(`\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550
|
|
3
3
|
file=${JSON.stringify(o)}; signatures=${r?"shown":"hidden"}`),i.length===0){console.log(`
|
|
4
4
|
\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550
|
|
5
5
|
No compiler-owned constructs were found for ${JSON.stringify(o)}.`),console.log(`
|
|
@@ -28,4 +28,4 @@ ${p}continue with --cursor ${d.cursor}`)}});function Ye(e,n,t){let o=E(e,n,{sema
|
|
|
28
28
|
`),o=0,r=0;for(let i=0;i<t.length;i++){let s=t[i].length+12;i>o&&r+s>Ee&&(n.push(`${e.relativePath}:${g(e.startLine+o)}-${g(e.startLine+i-1)}`),o=i,r=0),r+=s}return n.push(`${e.relativePath}:${g(e.startLine+o)}-${g(e.endLine)}`),n}function Pe(e,n){return{requested:n.length,matched:n.filter(t=>t.status==="matched").length,ambiguous:n.filter(t=>t.status==="ambiguous").length,missing:n.filter(t=>t.status==="missing").length,entries:[...n],bindingClosure:e.bindingClosure}}function $e(e,n){return["codebaseiq","code",...e.map(O),...n.members==="all"?["--members","all"]:[],...n.context>0?["--context",String(n.context)]:[]].join(" ")}function dt(e,n,t){if(!t)return D(e,n);let o={file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:g(t.startLine),endLine:g(t.endLine)},...t.freshness?{freshness:t.freshness}:{},lines:t.source.split(`
|
|
29
29
|
`).map((s,c)=>({line:g(t.startLine+c),text:s}))},r=D(e,n),i=r.totalMatches??0;return!r.matched||!r.resolved||i<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:i}}}function ut(e){return{requested:e.requested,matched:e.matched,ambiguous:e.ambiguous,missing:e.missing,entries:e.entries.map(n=>({selector:n.selector,status:n.status,kind:n.kind,totalCandidates:n.totalCandidates,sources:n.results.map(t=>({file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:g(t.startLine),endLine:g(t.endLine)},...t.freshness?{freshness:t.freshness}:{},lines:t.source.split(`
|
|
30
30
|
`).map((o,r)=>({line:g(t.startLine+r),text:o}))})),definitions:n.definitions,...n.fileCoverage?{fileCoverage:n.fileCoverage}:{},...n.rangeCoverage?{rangeCoverage:n.rangeCoverage}:{},candidates:n.candidates,omittedCandidates:n.omittedCandidates,suggestions:n.suggestions,...n.reason?{reason:n.reason}:{}})),literalValues:e.bindingClosure.inline}}function O(e){return`'${e.replaceAll("'","'\\''")}'`}var Zt=[{id:"session",command:"session",description:"Show evidence already delivered in this agent exploration session",options:[h("--reset","Clear this agent exploration-session ledger")],agent:ye("Which indexed source ranges and graph facts have already been delivered in this exploration session?","prior command ordinals, exact source ranges, and content-bound graph receipts",[],"complete","repository",ce("repository-observation",[{when:{kind:"option",name:"reset",equals:!0},role:"mutation"}])),renderShape:"custom",docs:$("Navigation"),handler:et},{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:Ce([h("--full","Run unbounded semantic analysis on large indexes"),h("-n, --limit <n>","Maximum reference sites to return",he),h("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{operation:y,answers:["Which files reference this symbol?","Is this symbol used anywhere, or only defined?"],returns:["referencing file paths","reference line numbers grouped by file"],inputs:["symbol"],coverage:"bounded",semantic:K("Resolve the exact reference sites attributed to one compiler symbol identity.","Referencing file paths and reference line numbers grouped by file.",["Reference sites do not establish runtime execution, data flow, or task relevance."]),contrasts:[{command:"imported-by",distinction:"imported-by lists files importing the symbol; refs covers every reference site, imported or not."},{command:"affected",distinction:"refs is one hop out; affected is the transitive closure of what could break."}]},renderShape:"grouped-by-file",docs:$("Navigation",["codebaseiq refs login"]),handler:Qe},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:{...w("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete",void 0,y,be(["file","symbol","construct"],["File ownership and nesting do not establish execution or task relevance."],{ranking:"identity-only",manualInput:"One exact current project file path.",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay."})),contrasts:[{command:"search",distinction:"outline enumerates constructs in one known file; search locates exact text across current project text."},{command:"code",distinction:"outline returns identities and ranges; code materializes exact source for selected identities."}]},options:I([h("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:$("Navigation"),handler:We},{id:"code",command:"code <selectors...>",description:"Read exact definitions, ranges with local call closure, or file export surfaces",agent:{...w("What exact source defines these symbols, ranges, or file surfaces?","per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",[["symbol","file"]],"complete",void 0,y,Re(["construct","exact-source"],["Source materialization does not establish callers, runtime reachability, or task relevance by itself."],void 0,{manualInput:"One or more exact symbols, file:line ranges, or file paths.",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed."})),resultUnits:{kind:"field",field:"code"},contrasts:[{command:"inspect",distinction:"code materializes complete exact source; inspect batches bounded behavior or source gaps."},{command:"outline",distinction:"code reads selected implementations; outline enumerates file structure without reading every body."}]},options:I([h("-C, --context <n>","Extra lines of context above/below",pe,0),h("--members <exported|all>","For file selectors, return the exported surface or the complete file",void 0,"exported")]),renderShape:"custom",docs:$("Navigation",["codebaseiq code parseRequest handleRequest","codebaseiq code src/api.ts src/web.ts"]),handler:Xe}];export{St as a,xt as b,pe as c,he as d,Et as e,h as f,Fe as g,Ce as h,I as i,$ as j,Pt as k,$t as l,wt as m,Ot as n,w as o,Nt as p,ye as q,be as r,Lt as s,Re as t,K as u,Se as v,xe as w,_ as x,D as y,Zt as z};
|
|
31
|
-
//# sourceMappingURL=chunk-
|
|
31
|
+
//# sourceMappingURL=chunk-USOAJHY7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-356EZBIP.js";import{b as i}from"./chunk-LMTSB3TB.js";import{y as l}from"./chunk-GVAF222T.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
2
|
WHERE relative_path IN (${a})
|
|
3
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-
|
|
4
|
+
//# sourceMappingURL=chunk-UW6KD57C.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{a as x}from"./chunk-
|
|
1
|
+
import{a as x}from"./chunk-BWL3PMPT.js";import{C as b}from"./chunk-ICUL7XRT.js";import{x as p}from"./chunk-7GAK2F3H.js";var y=new Set(["call","call_expression","command","command_call","function_call_expression","invocation_expression","macro_invocation","method_call","method_invocation","new_expression","object_creation_expression"]);function h(e,t,n,r){if(!Number.isSafeInteger(n)||n<0)return null;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`contextLines must be a non-negative safe integer; received ${r}`);let i=p(e,t);if(i.length===0||n>=i.length)return null;let o=Math.max(0,n-r),c=Math.min(i.length-1,n+r);return{relativePath:t,startLine:o,endLine:c,focusLine:n,source:i.slice(o,c+1).join(`
|
|
2
2
|
`)}}function F(e,t,n,r,i){let o=h(e,t,n,r);if(!o)return null;let c=b(e,t)?.rootNode??null;if(!c)return{...o,kind:"bounded-context"};let s=_(c,n,i);if(s.length!==1)return{...o,kind:s.length===0?"non-call-reference":"bounded-context"};let l=s[0],a=p(e,t),u=Math.max(0,l.startPosition.row),S=l.endPosition.column===0?l.endPosition.row-1:l.endPosition.row,d=Math.min(a.length-1,Math.max(u,S));return{relativePath:t,startLine:u,endLine:d,focusLine:n,source:a.slice(u,d+1).join(`
|
|
3
3
|
`),kind:"complete-call-expression"}}function L(e,t,n,r,i){if(!Number.isSafeInteger(i)||i<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${i}`);let o=p(e,t);if(o.length===0||n<0||n>=o.length)return null;let c=Math.min(o.length-1,r,n+i-1);return{relativePath:t,startLine:n,endLine:c,focusLine:n,source:o.slice(n,c+1).join(`
|
|
4
4
|
`)}}function k(e,t,n,r,i=6){if(!Number.isSafeInteger(r)||r<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${r}`);let o=p(e,t);if(o.length===0||n<0||n>=o.length)return null;let c=x(e,t,n);if(!c){let m=h(e,t,n,i);return m?{...m,unitType:null,unitStartLine:m.startLine,unitEndLine:m.endLine,omittedLines:0}:null}let s=c.startLine,l=c.endLine,a=l-s+1,u=Math.min(a,r),S=n-s-Math.floor(u/2),d=Math.max(0,Math.min(a-u,S)),f=s+d,g=f+u-1;return{relativePath:t,startLine:f,endLine:g,focusLine:n,source:o.slice(f,g+1).join(`
|
|
5
5
|
`),unitType:c.type,unitStartLine:s,unitEndLine:l,omittedLines:a-u}}function _(e,t,n){let r=[];return N(e,t,n,r),r.filter(i=>!r.some(o=>o!==i&&o.startIndex>=i.startIndex&&o.endIndex<=i.endIndex))}function N(e,t,n,r){if(M(e,t)){y.has(e.type)&&w(e)===n&&r.push(e);for(let i of e.namedChildren)N(i,t,n,r)}}function w(e){let t=e.childForFieldName("function")??e.childForFieldName("constructor")??e.childForFieldName("method")??e.childForFieldName("name")??e.namedChild(0);return t?t.text.match(/[\p{L}_$][\p{L}\p{N}_$!?-]*/gu)?.at(-1)??null:null}function M(e,t){return e.startPosition.row<=t&&e.endPosition.row>=t}export{h as a,F as b,L as c,k as d};
|
|
6
|
-
//# sourceMappingURL=chunk-
|
|
6
|
+
//# sourceMappingURL=chunk-VGWZ4MOY.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as p}from"./chunk-HENP2O4A.js";import{a as y}from"./chunk-6VREELBC.js";import{a as h}from"./chunk-MSI3K7PJ.js";import{o as u}from"./chunk-J7AMBVWF.js";import{a as S,c as b}from"./chunk-SGMNWYTH.js";import{A as d,d as m}from"./chunk-GVAF222T.js";function x(e,o,r={}){let{direction:c="backward",maxDepth:s=3}=r,l=S(e,o);return l?c==="backward"?k(e,l,s,{semantic:r.semantic!==!1}):D(e,l,{semantic:r.semantic!==!1}):null}function j(e,o,r={}){return x(e,o,r)}function k(e,o,r,c){let s=[],l=new Set([o.symbol]),t=[o];for(let n=1;n<=r&&t.length!==0;n++){let i=[];for(let g of t){let w=h(e,g,{semantic:c.semantic,semanticEvidence:y});for(let a of w){if(l.has(a.symbol))continue;l.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function D(e,o,r){let c=new Set,s=[],l=new p(e);for(let t of u(e,o,{semantic:r.semantic,semanticEvidence:y})){if(s.length>=30)break;let n=t.enclosingSymbol??d(l.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{x as a,j as b};
|
|
2
|
+
//# sourceMappingURL=chunk-VWYGCMV5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-356EZBIP.js";import{a as t}from"./chunk-LMTSB3TB.js";function a(e,o){let r=t(e,o);return r?i(e,"forward",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}function p(e,o){let r=t(e,o);return r?i(e,"reverse",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}export{a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-W7YLRXZE.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as b,b as y}from"./chunk-IRQOAM5G.js";import{a as R,b as H,c as B,e as h,f as k}from"./chunk-OTOKVOJ3.js";import{a as p,b as g}from"./chunk-NMTSZXCL.js";import{M as v}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as b,b as y}from"./chunk-IRQOAM5G.js";import{a as R,b as H,c as B,e as h,f as k}from"./chunk-OTOKVOJ3.js";import{a as p,b as g}from"./chunk-NMTSZXCL.js";import{M as v}from"./chunk-ICUL7XRT.js";function V(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:i=6,limit:o=20,scope:c,scanLimit:n,filePattern:d,focusFiles:f}=s,l=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,i),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),t=b(l,r=>r.tokens);return y({profiles:l,limit:o,filePattern:d,focusFiles:f,candidateIndex:t,profile:{name:"react-hook-candidates"},compare:(r,a)=>C(r,a,m,i),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.componentA.localeCompare(a.componentA)||r.fileB.localeCompare(a.fileB)||r.componentB.localeCompare(a.componentB)})}function C(e,s,m,i){let o=p(e.tokens,s.tokens);if(o.size<i||!E(o))return null;let c=H(e.tokens,s.tokens);if(c<m)return null;let n=h(o,"hook:"),d=h(o,"react-hook:"),f=h(o,"effect:"),l=h(o,"state:"),t=h(o,"request:"),r=h(o,"handler:"),a=h(o,"handler-verb:"),u=A({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:k(o),sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){return R({genericWords:q,stripPrefixes:w,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:S})}function S(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,m=0,i=0,o=0,c=0,n=0,d=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?m+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?c+=1:t.startsWith("state:")?n+=1:t.startsWith("state-hook:")&&(d+=1);let f=n+d,l=s+m+i+o+c+f;return B([{name:"requests",count:o},{name:"customHooks",count:s},{name:"namedStates",count:n},{name:"handlers",count:c},{name:"effects",count:i},{name:"reactHooks",count:m},{name:"namedBehavior",count:l}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var q=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),w=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
|
|
2
|
+
//# sourceMappingURL=chunk-WK2IQJPK.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as P,b as y}from"./chunk-IRQOAM5G.js";import{a as C,c as b,e as r,f}from"./chunk-OTOKVOJ3.js";import{a as g,b as h,c as k}from"./chunk-NMTSZXCL.js";import{M as v}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as P,b as y}from"./chunk-IRQOAM5G.js";import{a as C,c as b,e as r,f}from"./chunk-OTOKVOJ3.js";import{a as g,b as h,c as k}from"./chunk-NMTSZXCL.js";import{M as v}from"./chunk-ICUL7XRT.js";function L(e,i={}){let{minSimilarity:o=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=B(e,{scope:l,minTokens:n,scanLimit:u}),p=P(s,t=>t.tokens);return y({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,o),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function B(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(o=>({file:o.file,tokens:o.templateTokens,loc:T(o)}))}function T(e){return e.totalLines}function V(e,i,o){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<o)return null;let l=r(n,"component:"),u=r(n,"prop:"),m=r(n,"event:"),d=r(n,"directive:"),s=r(n,"slot:"),p=r(n,"id:"),t=S({sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p});return{fileA:e.file,fileB:i.file,similarity:c,tokenCountA:e.tokens.size,tokenCountB:i.tokens.size,sharedTokens:f(n),sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p,evidenceClass:t.evidenceClass,actionTier:t.actionTier,evidenceClassReasons:t.reasons,recommendation:t.recommendation,uniqueToA:f(h(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(h(i.tokens,e.tokens)).slice(0,25),locA:e.loc,locB:i.loc}}function R(e){let i=0,o=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(o+=1);return b([{name:"component",count:i},{name:"behavior",count:o}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return C({genericWords:x,primitiveGroups:[{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"},{values:e.sharedDirectives,reasonPrefix:"shared directives",bucket:"generic"},{values:e.sharedSlots,reasonPrefix:"shared slots",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedIdentifiers,label:"shared identifier",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific Vue primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-WWCV4E6J.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as x}from"./chunk-
|
|
1
|
+
import{c as x}from"./chunk-HENP2O4A.js";import{a as S}from"./chunk-SGMNWYTH.js";import{d as g}from"./chunk-GVAF222T.js";import{b as p}from"./chunk-F74LZWCE.js";import{C as u}from"./chunk-ICUL7XRT.js";import{f as h,g as y}from"./chunk-SX72EVMY.js";function U(e,t,s={}){let n=S(e,t);if(!n)return null;let o=new x(e),a=w(e,n),r=n.endLine-n.startLine+1,i=o.calleeEvidenceMap([n],{additive:!0,semantic:s.semantic}),l=i.rows.get(n.symbolId)??[],c=new Set(l.map(L=>L.symbol)),m=i.incompleteSymbolIds.has(n.symbolId),b=i.unavailableSymbolIds.has(n.symbolId),N=s.semantic===!1?"disabled":m&&b?"incomplete-and-unavailable":m?"incomplete":b?"unavailable":"complete",d=!m&&!b;return{symbol:n.symbol,shortName:g(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:a.branches,estimateBasis:a.estimateBasis,cyclomaticEstimate:a.branches+1,calleeCount:d?c.size:null,fanIn:C(e,n.symbolId),fanOut:d?D(l,n.relativePath):null,coverage:{semanticEvidence:N}}}function w(e,t){let s=u(e,t.relativePath);if(s){let n=v(s.rootNode,t.startLine,t.endLine);if(n)return{branches:M(n),estimateBasis:"ast"}}return{branches:P(E(e,t.relativePath,t.startLine,t.endLine),_(e,t.relativePath)),estimateBasis:"regex-fallback"}}function W(e,t){let s=new Map,n=new Map;for(let o of t){let a=n.get(o.relativePath)??[];a.push(o),n.set(o.relativePath,a)}for(let[o,a]of n){let r=u(e,o),i=r===null?[]:a.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),l=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});O(r.rootNode,i,s)}for(let c of a)l.has(c.symbolId)||s.set(c.symbolId,I(e,c))}return s}function I(e,t){return{branches:P(E(e,t.relativePath,t.startLine,t.endLine),_(e,t.relativePath)),estimateBasis:"regex-fallback"}}function _(e,t){return e.get("SELECT language FROM documents WHERE relative_path = ?",t)?.language??"unknown"}function E(e,t,s,n){try{return h(e.config.projectRoot,t,{inputKind:"indexed source file"}).split(`
|
|
2
2
|
`).slice(s,n+1).join(`
|
|
3
3
|
`)}catch(o){if(!y(o))throw o;return""}}function C(e,t){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS c
|
|
4
4
|
FROM mentions m
|
|
@@ -13,4 +13,4 @@ import{c as x}from"./chunk-NK76RSB6.js";import{a as S}from"./chunk-3XFJUWJE.js";
|
|
|
13
13
|
WHERE m.symbol_id = ?
|
|
14
14
|
AND m.role != 1
|
|
15
15
|
AND sym_def.document_id != c.document_id`,t)?.c??0}function D(e,t){return new Set(e.filter(s=>s.file!==t).map(s=>s.symbol)).size}function M(e){let t=0;return f(e,s=>{t+=B(s)}),t}function O(e,t,s){let n=[...t].sort((o,a)=>o.startLine-a.startLine||a.endLine-o.endLine);f(e,o=>{let a=B(o);if(a===0)return;let r=o.startPosition.row,i=o.endPosition.row;for(let l of n){if(l.startLine>r)break;if(l.endLine<i)continue;let c=s.get(l.symbolId);c&&(c.branches+=a)}})}function f(e,t){t(e);for(let s of e.namedChildren)f(s,t)}function v(e,t,s){if(e.startPosition.row>t||e.endPosition.row<s)return null;for(let n of e.namedChildren){let o=v(n,t,s);if(o)return o}return e}var F=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function B(e){return F.has(e.type)?1:e.type==="binary_expression"&&e.parent?.type!=="binary_expression"&&(e.text.includes("&&")||e.text.includes("||"))?R(e.text):0}function R(e){return(e.match(/&&|\|\|/g)??[]).length}function P(e,t){let s=p(e),n=0,o=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let a of o){let r=s.match(a);r&&(n+=r.length)}if(t==="python"){let a=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(t==="rust"){let a=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(t==="ruby"){let a=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(t==="go"){let a=[/\bselect\b/g,/\bdefer\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}return n}export{U as a,w as b,W as c,M as d};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-XMJ53WG4.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as f,I as h,K as x,L as b,i as m,k as d}from"./chunk-
|
|
1
|
+
import{H as f,I as h,K as x,L as b,i as m,k as d}from"./chunk-5FWR5HLG.js";import{createHash as N}from"crypto";var y=2,S=200,C=new Set(["string","template_string","string_literal","raw_string_literal","char_literal","concatenated_string"]),A={class_declaration:"name",abstract_class_declaration:"name",class:"name",class_definition:"name",trait_item:"name",impl_item:"type",mod_item:"name"},L=m({kind:"callable-units",invalidation:d("callable-units"),serialize:t=>JSON.stringify({version:y,...t}),deserialize:t=>{try{let e=JSON.parse(t);return e.version!==y?null:{language:e.language,contentHash:e.contentHash,units:e.units}}catch{return null}}});function U(t){return N("sha256").update(t).digest("hex")}function j(t,e,r){let s=U(r),n=L.read(t,e,s);if(n&&n.contentHash===s)return n;let o=f(t,e,r);if(!o)return null;let i={language:o.language,contentHash:s,units:E(o.tree,o.language)};return L.write(t,e,s,i),i}function E(t,e){let r=[],s=new Map,n=[],o=i=>{let l=b(i,e),u=l?.functionNode.childForFieldName("body");if(l&&u){let a=`${n.join(".")}#${l.name}`,g=s.get(a)??0;s.set(a,g+1),r.push(H(l.name,[...n],g,l.definitionNode,u,e)),n.push(l.name);for(let p of i.children)o(p);n.pop();return}let c=T(i);c&&n.push(c);for(let a of i.children)o(a);c&&n.pop()};return o(t.rootNode),r}function H(t,e,r,s,n,o){let i=[],l=[],u=new Set,c=a=>{if(x(a))return;let g=h(a,o);if(g&&u.add(g.calleeLeaf),C.has(a.type)){i.push(a.text.replace(/\r\n/g,`
|
|
2
2
|
`)),l.push("\0L");return}if(a.childCount===0){i.push(a.text),l.push(a.text);return}for(let p of a.children)c(p)};return c(n),{name:t,container:e,ordinal:r,startLine:s.startPosition.row,endLine:s.endPosition.row,bodyStartLine:n.startPosition.row,bodyLines:n.text.split(/\r?\n/).filter(a=>a.trim().length>0).length,tokenCount:i.length,signature:v(s,n),exactHash:_(i),shapeHash:_(l),calleeLeaves:[...u].sort(),exported:F(s)}}function T(t){let e=A[t.type];return e?t.childForFieldName(e)?.text??null:null}function v(t,e){let r=t.text.lastIndexOf(e.text),n=(r>=0?t.text.slice(0,r):w(t.text)).replace(/\s+/g," ").trim().replace(/[=:]?\s*$/,"").trim();return n.length>S?`${n.slice(0,S-1)}\u2026`:n}function w(t){let e=t.indexOf(`
|
|
3
3
|
`);return e>=0?t.slice(0,e):t}function F(t){if(t.namedChildren.some(r=>r.type==="visibility_modifier"&&r.text.startsWith("pub")))return!0;let e=t;for(let r=0;e&&r<3;r++,e=e.parent)if(e.type==="export_statement")return!0;return!1}function _(t){return N("sha256").update(t.join("")).digest("hex").slice(0,24)}export{j as a};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-XN3EKMLI.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as S,e as d}from"./chunk-
|
|
1
|
+
import{a as S,e as d}from"./chunk-YT4DVWUV.js";import{readdirSync as m}from"fs";import{execFileSync as x}from"child_process";import{extname as l,join as y}from"path";var h=[".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"],X=[".vue"],f=[".tsx",".jsx"],g=[".vue"],_=[...f,...g],I=new Set(f),w=new Set(g),p=new Set(h.map(e=>e.toLowerCase())),C=[...p].sort().join(","),E=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".codebaseiq-cache","__pycache__",".venv","venv",".idea",".vscode"]);function O(e,t={}){let s=t.includeIndexed??!0,i=t.includeAuxiliary??!0,n=t.extensions?.map(c=>c.toLowerCase()),o=n?new Set(n):p,u=n?[...o].sort().join(","):C,r=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return R.get(e,r,()=>{let c=new Set;if(s)for(let a of d(e,{includeIgnored:!1}))o.has(l(a).toLowerCase())&&c.add(a);if(i)for(let a of N(e.config.projectRoot,o))e.isIgnored(a)||s&&c.has(a)||c.add(a);return[...c].sort()})}function k(e,t={}){let s=!1,i=!1;for(let n of O(e,{extensions:_})){if(t.scope&&!n.includes(t.scope))continue;let o=l(n).toLowerCase();if(s||=I.has(o),i||=w.has(o),s&&i)break}return{react:s,vue:i}}var R=S("source-files",{clearGroups:[]});function N(e,t){return T(e,t)??v(e,t)}function T(e,t){try{let s=x("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,killSignal:"SIGKILL",stdio:["ignore","pipe","ignore"],windowsHide:!0}),i=new Set;for(let n of s.split(`
|
|
2
2
|
`)){let o=n.trim();o&&(j(o)||t.has(l(o).toLowerCase())&&i.add(o))}return i}catch{return null}}function j(e){return e.split("/").some(t=>E.has(t))}function v(e,t){let s=new Set,i=n=>{let o=n?y(e,n):e,u;try{u=m(o,{withFileTypes:!0})}catch{return}for(let r of u)if(!E.has(r.name)){if(r.isDirectory()){i(n?`${n}/${r.name}`:r.name);continue}t.has(l(r.name).toLowerCase())&&s.add(n?`${n}/${r.name}`:r.name)}};return i(""),s}export{X as a,E as b,O as c,k as d};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-XQAVQVIL.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{a as R}from"./chunk-6VREELBC.js";import{o as h}from"./chunk-J7AMBVWF.js";import{a as g}from"./chunk-SGMNWYTH.js";import{h as d}from"./chunk-GVAF222T.js";import{a as m}from"./chunk-ICUL7XRT.js";import{w as p}from"./chunk-7GAK2F3H.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
|
|
2
2
|
`);for(let o=0;o<c.length;o++){let f=c[o]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:o})}}return e}function S(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{D as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-XQPPURLQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{C as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{C as s}from"./chunk-ICUL7XRT.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-YHPG3S2U.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as B,g as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as B,g as S}from"./chunk-2OMXFE64.js";import{b as O}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-BGBBVSH4.js";import{c as k}from"./chunk-NDKOVQFG.js";import{a as L}from"./chunk-BRQL7AFJ.js";import{d as P}from"./chunk-SGX43S2L.js";import{d as I,g as z,j as D,u as $}from"./chunk-GVAF222T.js";import{b as T,k as v,p as A}from"./chunk-F74LZWCE.js";import{A as _}from"./chunk-7GAK2F3H.js";import{d as p}from"./chunk-3LCDIREB.js";import{d as b}from"./chunk-UC2FD2PS.js";var U=new Set(P());function $e(e,t={}){let{includeHomonyms:n=!1,limit:i}=t,s=X(e,t).filter(r=>r.relationship==="divergent"||n&&r.relationship==="homonym");return i?s.slice(0,i):s}function X(e,t={}){let{scope:n,minSimilarity:i=.3,scanLimit:s}=t,r=Q(e,{scope:n,scanLimit:s});return Y(r,{minSimilarity:i,isDelegatePair:De(e)}).filter(a=>!a.members.some(o=>_(e,o.file,o.startLine,"twin")))}function Y(e,t={}){let n=t.minSimilarity??.3,i=t.isDelegatePair,s=e.filter(c=>!V(c.leaf)&&!fe(c.leaf)&&L(c.file)!=="test"&&!D(c.symbol)&&!Z(c.symbol)&&!j(c.symbol,c.leaf)),{recordsByLeaf:r,recordOrder:a}=p("twin-drift.group-by-leaf",()=>q(s),()=>({records:s.length})),o=p("twin-drift.cluster-leaf-names",()=>W([...r.keys()]),()=>({leaves:r.size}));return p("twin-drift.compare-clusters",()=>{let c=[];for(let h of o){let u=J(h,r,a);if(u.length<2||new Set(u.map(f=>f.file)).size<2)continue;let m=null,R=!1,C=!1,y=new Set;for(let f=0;f<u.length;f+=1)for(let w=f+1;w<u.length;w+=1){let d=u[f],g=u[w];if(d.file===g.file||!ge(d,g)||i?.(d,g,u)||i?.(g,d,u))continue;if(R=!0,y.add(d.symbol),y.add(g.symbol),d.normalizedBody===g.normalizedBody){C=!0;continue}let M=oe(d.tokens,g.tokens);(!m||M>m.similarity)&&(m={a:d,b:g,similarity:M})}if(!R)continue;let x=u.filter(f=>y.has(f.symbol)).sort((f,w)=>f.file.localeCompare(w.file)||f.startLine-w.startLine).map(se);if(!m){c.push({leaf:G(h),relationship:C?"identical":"homonym",maxDivergence:0,members:x});continue}let N=m.similarity>=n?"divergent":"homonym";c.push({leaf:G(h),relationship:N,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:x,...N==="divergent"?{firstDivergentTokens:ae(m.a.tokens,m.b.tokens)}:{}})}return c},()=>({clusters:o.length,records:s.length})).sort((c,h)=>h.members.length-c.members.length||h.maxDivergence-c.maxDivergence||c.leaf.localeCompare(h.leaf))}function q(e){let t=new Map,n=new Map;for(let[i,s]of e.entries()){let r=t.get(s.leaf)??[];r.push(s),t.set(s.leaf,r),n.set(s,i)}return{recordsByLeaf:t,recordOrder:n}}function J(e,t,n){let i=[...e].flatMap(s=>t.get(s)??[]);return e.size>1&&i.sort((s,r)=>(n.get(s)??0)-(n.get(r)??0)),i}function Q(e,t){let n=p("twin-drift.load-definitions",()=>$(e,{scope:t.scope}).filter(r=>ee(r)&&!e.isIgnored(r.relativePath)).filter(r=>!k(r.relativePath)));p("twin-drift.sort-definitions",()=>n.sort((r,a)=>r.relativePath.localeCompare(a.relativePath)||r.startLine-a.startLine),()=>({definitions:n.length}));let i=O(n,t.scanLimit),s=p("twin-drift.select-candidates",()=>te(i),()=>({scanned:i.length}));return p("twin-drift.build-records",()=>{let r=[];for(let a of s){let o=ne(e,a);o&&r.push(o)}return r},()=>({candidates:s.length,scanned:i.length}))}function ee(e){return e.isFunctionLike?e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&U.has(e.kind):!0:!1}function te(e){let t=e.filter(r=>r.leaf&&!V(r.leaf)&&!D(r.symbol)&&!Z(r.symbol)&&!j(r.symbol,r.leaf)),n=new Map;for(let r of t){let a=n.get(r.leaf)??[];a.push(r),n.set(r.leaf,a)}let i=W([...n.keys()]),s=new Set;for(let r of i){let a=[...r].flatMap(o=>n.get(o)??[]);if(!(a.length<2)&&!(new Set(a.map(o=>o.relativePath)).size<2)&&!a.every(o=>L(o.relativePath)==="test"))for(let o of a)s.add(o)}return e.filter(r=>s.has(r))}function ne(e,t){if(!t.leaf)return null;let n=B(e,t);if(!n||!z(t.symbol)&&!re(n,t.leaf))return null;let i=T(S(n)),s=i.replace(/\s+/g,"");if(!s||s.length<8)return null;let r=i.match(ie)??[];return r.length===0?null:{leaf:t.leaf,symbol:t.symbol,shortName:I(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:E(t),normalizedBody:s,tokens:r,isThinForwarder:H(i)}}function re(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`\\b(?:const|let|var)\\s+${n}(?:\\s*:[^=]+)?\\s*=\\s*(?:async\\s*)?(?:\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>`,"s").test(e)}var ie=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function se(e){return{symbol:e.symbol,shortName:e.shortName,file:e.file,startLine:e.startLine,endLine:e.endLine,loc:e.loc}}function oe(e,t){let n=new Set(e),i=new Set(t);if(n.size===0&&i.size===0)return 1;if(n.size===0||i.size===0)return 0;let s=0;for(let a of n)i.has(a)&&(s+=1);let r=n.size+i.size-s;return r===0?0:s/r}function ae(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;let s=e.slice(i,i+6).join(" "),r=t.slice(i,i+6).join(" ");return!s&&!r?"(bodies differ only in trailing length)":`A: ${s||"(end)"} | B: ${r||"(end)"}`}function W(e){let t=new Map;for(let a of e)t.set(a,a);let n=a=>{let o=a;for(;t.get(o)!==o;)o=t.get(o);let l=a;for(;t.get(l)!==o;){let c=t.get(l);t.set(l,o),l=c}return o},i=(a,o)=>{let l=n(a),c=n(o);l!==c&&t.set(l,c)},s=new Map;for(let a of e){let o=a.slice(0,2).toLowerCase(),l=s.get(o)??[];l.push(a),s.set(o,l)}for(let a of s.values())for(let o=0;o<a.length;o+=1)for(let l=o+1;l<a.length;l+=1)le(a[o],a[l])&&i(a[o],a[l]);let r=new Map;for(let a of e){let o=n(a),l=r.get(o)??new Set;l.add(a),r.set(o,l)}return[...r.values()]}function le(e,t){return e===t||e.toLowerCase()===t.toLowerCase()?!0:e.length<8||t.length<8||Math.abs(e.length-t.length)>2||ce(e.toLowerCase(),t.toLowerCase())/Math.max(e.length,t.length)<.8?!1:pe(e.toLowerCase(),t.toLowerCase(),2)}function ce(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;return i}function fe(e){return/^[A-Z][A-Z0-9_]*$/.test(e)||/^__[^_].*__$/.test(e)||ue.has(e.toLowerCase())}var ue=new Set(["main","row"]),me=new Set(["app","component","components","feature","features","impl","index","lib","route","routes","shared","src","tsx","typescript","ui"]);function Z(e){return e.startsWith("rust-analyzer ")&&/\/(?:tests?|benches?)\//.test(e)}var de=new Set(["default","new","reset"]);function j(e,t){return e.startsWith("rust-analyzer ")&&de.has(t.toLowerCase())}function ge(e,t){if(e.leaf.toLowerCase()!==t.leaf.toLowerCase()||e.leaf.length>4)return!0;let n=F(e);return[...F(t)].some(i=>n.has(i))}function F(e){let t=e.leaf.toLowerCase();return new Set(`${e.file}/${e.shortName}`.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>2&&n!==t&&!me.has(n)))}function pe(e,t,n){if(Math.abs(e.length-t.length)>n)return!1;let i=Array.from({length:t.length+1},(s,r)=>r);for(let s=1;s<=e.length;s+=1){let r=[s],a=r[0];for(let o=1;o<=t.length;o+=1){let l=e[s-1]===t[o-1]?0:1,c=Math.min(i[o]+1,r[o-1]+1,i[o-1]+l);r.push(c),a=Math.min(a,c)}if(a>n)return!1;i=r}return i[t.length]<=n}function ke(e){return H(T(S(e)))}function H(e){let t=e.trim();if(!t||he.test(t))return!1;let n=be(t);return n.length===0||n.length>2?!1:ye(n[n.length-1])}var he=/\b(?:if|else|for|while|switch|try|catch|do)\b/,we=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function ye(e){let t=e.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return we.test(t)}function be(e){let t=[],n=0,i="";for(let s of e){if(s==="("||s==="["||s==="{"?n+=1:(s===")"||s==="]"||s==="}")&&(n=Math.max(0,n-1)),s===";"&&n===0){t.push(i),i="";continue}i+=s}return i.trim()&&t.push(i),t.map(s=>s.trim()).filter(s=>s.length>0)}var Te=3;function De(e){let t=new Map;return(n,i,s)=>{if(!n.isThinForwarder)return!1;let r=`${n.symbol}\0${i.symbol}`,a=t.get(r);if(a!==void 0)return a;let o=K(e,n,i,s,Te,new Set);return t.set(r,o),o}}function K(e,t,n,i,s,r){if(s<=0||r.has(t.symbol)||(r.add(t.symbol),(v(e,t.file)??[]).filter(l=>l.line>=t.startLine&&l.line<=t.endLine&&l.calleeLeaf===n.leaf).length===0))return!1;let o=new Set(A(e,t.file).filter(l=>l.sourcePath&&(l.kind!=="namespace"||l.usedMembers.includes(n.leaf))).map(l=>l.sourcePath));if([...o].some(l=>b(l,n.file)))return!0;for(let l of i)if(!(l.symbol===t.symbol||l.symbol===n.symbol||!l.isThinForwarder)&&[...o].some(c=>b(c,l.file))&&K(e,l,n,i,s-1,r))return!0;return!1}function V(e){return e.startsWith("<")&&e.endsWith(">")}function G(e){return[...e].sort()[0]}export{$e as a,X as b,Y as c,ke as d,be as e};
|
|
2
|
+
//# sourceMappingURL=chunk-YRKP7PM7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as p}from"./chunk-
|
|
1
|
+
import{c as p}from"./chunk-RCIGX23V.js";import{basename as D}from"path";function h(){let t=new WeakMap;return{cache:t,ensure(r){let a=t.get(r);return a||(a=new Map,t.set(r,a)),a}}}function g(t,r){let{cache:a,ensure:o}=h(),i={get(e,c,s){let n=o(e);if(n.has(c))return n.get(c);let l=s();return n.set(c,l),l},invalidate(e,c){a.get(e)?.delete(c)},invalidateAll(e){a.delete(e)},size(e){return a.get(e)?.size??0}};return p({name:t,groups:r.clearGroups,clearAll:e=>i.invalidateAll(e),clearFile:(e,c)=>i.invalidate(e,c)}),i}function S(t,r){let a=new WeakMap,o={get(i,e){let c=a.get(i);if(c)return c.value;let s=e();return a.set(i,{value:s}),s},invalidate(i){a.delete(i)},has(i){return a.has(i)}};return p({name:t,groups:r.clearGroups,clearAll:i=>o.invalidate(i)}),o}var m={clearGroups:["whole-project","source-file"]};function E(t){return v(t,m)}function v(t,r){let{cache:a,ensure:o}=h(),i={get(e,c,s,n){let l=o(e),u=l.get(c);if(u&&u.source===s)return u.value;let d=n();return l.set(c,{source:s,value:d}),d},invalidate(e,c){a.get(e)?.delete(c)},invalidateAll(e){a.delete(e)}};return p({name:t,groups:r.clearGroups,clearAll:e=>i.invalidateAll(e),clearFile:(e,c)=>i.invalidate(e,c)}),i}var C=g("indexed-document-paths",{clearGroups:["whole-project"]});function x(t,r={}){let a=V(r);return[...C.get(t,a,()=>{let i=r.scope?"AND relative_path LIKE ?":"",e=r.like?"AND relative_path LIKE ?":"",c=[...r.scope?[`%${r.scope}%`]:[],...r.like?[r.like]:[]],s=t.all(`SELECT relative_path
|
|
2
2
|
FROM documents
|
|
3
3
|
WHERE 1 = 1
|
|
4
4
|
${t.pathExclusionsFor("documents")}
|
|
@@ -8,4 +8,4 @@ import{c as p}from"./chunk-2VKB5CMA.js";import{basename as D}from"path";function
|
|
|
8
8
|
FROM documents
|
|
9
9
|
WHERE relative_path = ?
|
|
10
10
|
${t.pathExclusionsFor("documents")}`,o).filter(n=>!t.isIgnored(n.relative_path)).map(n=>({relativePath:n.relative_path,score:b(n.relative_path,o)}));if(i.length>0)return i;let e=x(t,{includeIgnored:!1}).map(n=>({relativePath:n,score:b(n,o)})).filter(n=>n.score>0).sort((n,l)=>l.score-n.score||n.relativePath.localeCompare(l.relativePath)),c=e.filter(n=>n.score>=1100);if(c.length>0)return a.allowMultiple?c:[c[0]];let s=e.filter(n=>n.score>=800);return s.length>0?a.allowMultiple?s:[s[0]]:a.allowMultiple?e:e.slice(0,1)}function b(t,r){let a=f(t),o=D(a),i=D(r),e=0;return a===r&&(e+=1200),a.endsWith(`/${r}`)&&(e+=1100),o===i&&(e+=900),a.startsWith(`${r}/`)&&(e+=850),a.includes(r)&&(e+=250),e}function f(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{g as a,S as b,E as c,v as d,x as e,K as f,f as g};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-YT4DVWUV.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as M,b as _}from"./chunk-
|
|
1
|
+
import{a as M,b as _}from"./chunk-XQAVQVIL.js";import{a as k,g as j}from"./chunk-RCIGX23V.js";import{a as x,b as w,ca as N,g as S,ga as D}from"./chunk-UQYQBLJX.js";import he from"better-sqlite3";import{existsSync as En}from"fs";import{dirname as Tn,join as Cn,resolve as Se}from"path";import xe from"better-sqlite3";import{execFileSync as ve}from"child_process";import{existsSync as Ie,readdirSync as we}from"fs";import{extname as v,join as Ee}from"path";function $(e={}){return{id:"auxiliary-documents",facts:["auxiliary-document"],run:n=>Te({projectRoot:n.projectRoot,dbPath:n.dbPath,extensions:e.extensions,onStatus:n.onStatus})}}function Te(e){let n=new Set((e.extensions??M).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!Ie(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let t=j(e.projectRoot),r=Ce(e.projectRoot,n).filter(i=>!t.isIgnored(i)),o=new xe(k(e.dbPath));try{let i=Le(o,r),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
2
2
|
VALUES (?, ?, NULL, ?)`),a=o.transaction(l=>{let f=0;for(let g of l){if(i.has(g))continue;let p=N(e.projectRoot,g,{inputKind:"auxiliary source file"}),m=s.run(Pe(g),g,p);f+=Number(m.changes)}return f})(r),c={scanned:r.length,inserted:a,existing:r.length-a};return e.onStatus?.(`Augmented SQLite documents with ${a} auxiliary source file${a===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function Ce(e,n){let t=Fe(e,n);if(t)return t;let r=[],o=i=>{let s=i?Ee(e,i):e,u;try{u=we(s,{withFileTypes:!0})}catch{return}for(let a of u){if(_.has(a.name))continue;let c=i?`${i}/${a.name}`:a.name;if(a.isDirectory()){o(c);continue}n.has(v(a.name).toLowerCase())&&r.push(c)}};return o(""),r.sort()}function Fe(e,n){try{return ve("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
3
3
|
`).filter(r=>r&&n.has(v(r).toLowerCase())).sort()}catch{return null}}function Le(e,n){let t=new Set,r=500;for(let o=0;o<n.length;o+=r){let i=n.slice(o,o+r),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let u of s)t.add(u.relative_path)}return t}function Pe(e){return v(e).toLowerCase()===".vue"?"vue":v(e).replace(/^\./,"").toLowerCase()||"source"}import{writeFileSync as Oe}from"fs";function U(e,n){let t=performance.now(),r=e.run(n);return{stageId:e.id,facts:e.facts,durationMs:performance.now()-t,result:r}}async function B(e){let n=e.readFingerprint(),t=Ae(e.cachePath,n);if(t)return e.onCacheHit?.(t.result),t.result;let r=await e.compute();return Ne(e.cachePath,e.readFingerprint(),r),r}function Ae(e,n){try{let t=JSON.parse(S(e,{maxBytes:x,inputKind:"post-index augmentation cache"}));return W(t.fingerprint)===W(n)?{result:t.result}:null}catch{return null}}function Ne(e,n,t){Oe(e,`${JSON.stringify({updatedAt:new Date().toISOString(),fingerprint:n,result:t},null,2)}
|
|
4
4
|
`)}function W(e){return JSON.stringify(e)}import{randomUUID as Me}from"crypto";import{mkdtempSync as _e,rmSync as je,statSync as K}from"fs";import{tmpdir as $e}from"os";import{join as G}from"path";import{Worker as We}from"worker_threads";function De(){return{"missing-source-file":0,"missing-service-script":0,"no-definition":0,"same-file-definition":0,"unindexed-definition":0}}function y(){return{skippedReferences:0,skippedReferenceReasons:De(),skippedReferenceSamples:[]}}function I(e,n){e.skippedReferences+=n.skippedReferences;for(let t of Object.keys(e.skippedReferenceReasons)){e.skippedReferenceReasons[t]+=n.skippedReferenceReasons[t];for(let r of n.skippedReferenceSamples.filter(o=>o.reason===t))e.skippedReferenceSamples.filter(i=>i.reason===t&&i.sourceFile===r.sourceFile).length<2&&e.skippedReferenceSamples.push(r)}}var Ue=3e5,J=64*1024*1024,Be={createResultDirectory:()=>_e(G($e(),"codebaseiq-vue-workers-")),spawn:(e,n)=>new We(e,{workerData:n}),resultSize:e=>K(e).size,readResult:e=>S(e,{maxBytes:J,inputKind:"Vue worker result"}),removeResultDirectory:e=>je(e,{recursive:!0,force:!0})};function z(e){return e.length>=8&&Y(e.length)>1}async function X(e,n=Be){let t=Y(e.vueFiles.length),r=tn(e.vueFiles),o=on(r,t),i=new URL("./augment-vue-worker.js",import.meta.url),s=e.timeoutMs??en(),u=e.maxResultBytes??nn();H("timeoutMs",s),H("maxResultBytes",u);let a=Me(),c=n.createResultDirectory(),l=[],f,g,p;try{for(let d=0;d<o.length;d++){let b=d,L=o[d]??[],P=L.map(Ve=>Ve.taskId),O=G(c,`${b}.json`),A=n.spawn(i,{projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,tasks:L,resultPath:O,runId:a,workerId:b,taskIds:P});l.push({workerId:b,taskIds:P,resultPath:O,handle:A,completion:He(A,b)})}await Ke(l,s);let m=l.sort((d,b)=>d.workerId-b.workerId).map(d=>Je(d,a,u,n));p={occurrences:m.flatMap(d=>d.occurrences),...y()};for(let d of m)I(p,d)}catch(m){f=m}finally{let m=await Ge(l);if(m.length===0)try{n.removeResultDirectory(c)}catch(d){m.push(d)}if(m.length>0){let d=f===void 0?m:[f,...m];g=new AggregateError(d,`Vue worker cleanup failed: ${Ze(d[0])}`)}}if(g)throw g;if(f!==void 0)throw f;if(!p)throw new Error("Vue workers completed without producing a merged result.");return p}function He(e,n){return new Promise((t,r)=>{let o=!1,i=a=>{o||(o=!0,e.off("error",s),e.off("exit",u),a?r(a):t())},s=a=>{i(new Error(`Vue reference worker ${n} failed: ${a.message}`,{cause:a}))},u=a=>{i(a===0?void 0:new Error(`Vue reference worker ${n} exited with code ${a}`))};e.once("error",s),e.once("exit",u)})}async function Ke(e,n){let t;try{await Promise.race([Promise.all(e.map(r=>r.completion)),new Promise((r,o)=>{t=setTimeout(()=>o(new Error(`Vue reference workers timed out after ${(n/1e3).toFixed(3)}s`)),n),t.unref()})])}finally{t&&clearTimeout(t)}}async function Ge(e){return(await Promise.allSettled(e.map(async t=>t.handle.terminate()))).flatMap(t=>t.status==="rejected"?[t.reason]:[])}function Je(e,n,t,r){let o=r.resultSize(e.resultPath);if(!Number.isSafeInteger(o)||o<0||o>t)throw new Error(`Vue reference worker ${e.workerId} result is ${o} bytes; limit is ${t} bytes`);let i;try{i=JSON.parse(r.readResult(e.resultPath))}catch(s){throw new Error(`Vue reference worker ${e.workerId} produced invalid JSON`,{cause:s})}if(!V(i)||i.version!==1||i.runId!==n||i.workerId!==e.workerId)throw new Error(`Vue reference worker ${e.workerId} result identity does not match its assignment`);if(!Qe(i.taskIds,e.taskIds))throw new Error(`Vue reference worker ${e.workerId} result task identities do not match its assignment`);if(i.ok===!1)throw typeof i.error!="string"?new Error(`Vue reference worker ${e.workerId} failure payload is malformed`):new Error(`Vue reference worker ${e.workerId} failed: ${i.error}`);if(i.ok!==!0||!ze(i.result))throw new Error(`Vue reference worker ${e.workerId} success payload is malformed`);return i.result}function ze(e){if(!V(e)||!Array.isArray(e.occurrences)||!e.occurrences.every(Xe)||!R(e.skippedReferences)||!V(e.skippedReferenceReasons))return!1;for(let n of["missing-source-file","missing-service-script","no-definition","same-file-definition","unindexed-definition"])if(!R(e.skippedReferenceReasons[n]))return!1;return Array.isArray(e.skippedReferenceSamples)&&e.skippedReferenceSamples.every(Ye)}function Xe(e){return V(e)&&typeof e.sourceFile=="string"&&R(e.sourceLine)&&R(e.sourceStartChar)&&R(e.sourceEndChar)&&typeof e.sourceToken=="string"&&typeof e.definitionFile=="string"&&R(e.symbolId)}function Ye(e){return V(e)&&typeof e.sourceFile=="string"&&R(e.sourceLine)&&R(e.sourceStartChar)&&R(e.sourceEndChar)&&typeof e.token=="string"&&qe(e.reason)}function qe(e){return e==="missing-source-file"||e==="missing-service-script"||e==="no-definition"||e==="same-file-definition"||e==="unindexed-definition"}function R(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function V(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Qe(e,n){return Array.isArray(e)&&e.length===n.length&&e.every((t,r)=>typeof t=="string"&&t===n[r])}function H(e,n){if(!Number.isSafeInteger(n)||n<=0)throw new TypeError(`${e} must be a positive safe integer.`)}function Ze(e){return e instanceof Error?e.message:String(e)}function Y(e){let n=Number(process.env.CODEBASEIQ_AUGMENT_VUE_WORKERS??0),t=Number.isFinite(n)&&n>0?n:1;return Math.max(1,Math.min(e,t))}function en(){let e=Number(process.env.CODEBASEIQ_AUGMENT_VUE_WORKER_TIMEOUT_MS??0);return Number.isFinite(e)&&e>0?e:Ue}function nn(){let e=Number(process.env.CODEBASEIQ_AUGMENT_VUE_WORKER_RESULT_MAX_BYTES??0);return Number.isSafeInteger(e)&&e>0?e:J}function tn(e){let n=rn(),t=[];for(let r of e){let o=q(r),i=Math.max(1,Math.ceil(o/n));for(let s=0;s<i;s++)t.push({taskId:`${t.length}:${r}:${s}`,fileName:r,startOffset:Math.floor(o*s/i),endOffset:s===i-1?Number.POSITIVE_INFINITY:Math.floor(o*(s+1)/i),countFileSkip:s===0})}return t}function rn(){return Number.POSITIVE_INFINITY}function on(e,n){let t=Array.from({length:n},()=>({tasks:[],weight:0})),r=e.map(o=>({task:o,weight:sn(o)})).sort((o,i)=>i.weight-o.weight);for(let o of r){let i=t.reduce((s,u)=>u.weight<s.weight?u:s);i.tasks.push(o.task),i.weight+=o.weight}return t.map(o=>o.tasks).filter(o=>o.length>0)}function sn(e){return Number.isFinite(e.endOffset)?Math.max(1,e.endOffset-e.startOffset):Math.max(1,q(e.fileName)-e.startOffset)}function q(e){try{return K(e).size}catch{return 1}}import{createRequire as un}from"module";import{existsSync as an}from"fs";import{dirname as Q,extname as cn,join as Z,relative as ln,resolve as fn}from"path";import{pathToFileURL as dn}from"url";function gn(e){e.transaction(()=>{e.prepare(`
|
|
@@ -58,4 +58,4 @@ import{a as M,b as _}from"./chunk-FWY2PRIF.js";import{a as k,g as j}from"./chunk
|
|
|
58
58
|
(SELECT MAX(id) FROM global_symbols) AS maxSymbolId
|
|
59
59
|
`).get();return{version:3,tsconfig:t,files:D(n),db:r}}function Lt(e){let n=Se(e.projectRoot,e.tsconfig),t=new he(k(e.dbPath),{readonly:!0});try{let r=be({db:t,projectRoot:e.projectRoot,configPath:n,vueSymbolLookup:ie(t,e.projectRoot)});return ye({vueFiles:e.vueFiles??[],tasks:e.tasks,...r})}finally{t.close()}}function be(e){let n=de();return{projectRoot:e.projectRoot,context:ne(e.projectRoot,e.configPath),symbolLookup:te(e.db,e.projectRoot,n),vueSymbolLookup:e.vueSymbolLookup,sourceReader:n}}function ye(e){let n=[],t=y(),r=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of r){let i=Nn(e,o);n.push(...i.occurrences),I(t,i)}return{occurrences:n,...t}}function Nn(e,n){let t=e.sourceReader.get(n.fileName);if(!t)return Re(e.projectRoot,n,"missing-source-file");let r=e.context.language.scripts.get(n.fileName),o=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!o)return Re(e.projectRoot,n,"missing-service-script");let i=e.context.language.maps.get(o,r),s=h(e.projectRoot,n.fileName),u=[...ce(t.text)],a={tokens:u.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(u.map(c=>[c.start,c])),tokenTextCounts:Bn(u),processedStarts:new Set};return Dn({...e,fileName:n.fileName,sourceInfo:t,sourceFile:s,map:i,tokenContext:a})}function Dn(e){let n=[],t=y();for(let r of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(r.start)||Mn(e.sourceInfo.text,r.start))continue;let o=le(e.map,r.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(l=>!fe(e.projectRoot,l.fileName));if(!s){C(t,e.sourceReader,e.sourceInfo,e.sourceFile,r,"no-definition");continue}let u=h(e.projectRoot,s.fileName),a=_n(e.sourceFile,r.text,u);if(a){C(t,e.sourceReader,e.sourceInfo,e.sourceFile,r,a);continue}let c=se(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(c===null){C(t,e.sourceReader,e.sourceInfo,e.sourceFile,r,"unindexed-definition");continue}ke(n,e.sourceReader,e.sourceInfo,e.sourceFile,r,u,c),e.tokenContext.processedStarts.add(r.start),Un(n,e,r,o,u,c)}return{occurrences:n,...t}}function Mn(e,n){let t=e.lastIndexOf(`
|
|
60
60
|
`,n-1)+1,r=e.slice(t,n);return/\bfrom\s+['"][^'"]*$/.test(r)||/\bimport\s*\(\s*['"][^'"]*$/.test(r)}function _n(e,n,t){return t===e?"same-file-definition":t.endsWith(".vue")&&n!==t.split("/").at(-1)?.replace(/\.vue$/,"")?"unindexed-definition":null}function Re(e,n,t){let r=y();return n.countFileSkip&&(r.skippedReferences=1,r.skippedReferenceReasons[t]=1,r.skippedReferenceSamples.push({sourceFile:h(e,n.fileName),sourceLine:0,sourceStartChar:0,sourceEndChar:0,token:"",reason:t})),{occurrences:[],...r}}function C(e,n,t,r,o,i){if(e.skippedReferences++,e.skippedReferenceReasons[i]++,e.skippedReferenceSamples.filter(u=>u.reason===i&&u.sourceFile===r).length>=2)return;let s=n.positionAt(t,o.start);e.skippedReferenceSamples.push({sourceFile:r,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+o.text.length,token:o.text,reason:i})}function F(e,n){let t=new Map;for(let i of e){let s=t.get(i.sourceFile)??[];s.push(i),t.set(i.sourceFile,s)}let r=[...t.keys()].sort(),o=[];for(let i=0;o.length<n;i++){let s=!1;for(let u of r){let a=t.get(u)?.[i];if(a&&(o.push(a),s=!0,o.length===n))break}if(!s)break}return o}function jn(e,n){let t=F(e.filter(i=>i.sourceFile!==i.definitionFile),Math.ceil(n/2)),r=new Set(t.map(i=>`${i.sourceFile}:${i.sourceLine}:${i.sourceStartChar}:${i.sourceEndChar}:${i.symbolId}`)),o=F(e.filter(i=>!r.has(`${i.sourceFile}:${i.sourceLine}:${i.sourceStartChar}:${i.sourceEndChar}:${i.symbolId}`)),n-t.length);return[...t,...o]}function $n(e,n){let t=[...new Set(e.map(o=>o.reason))].sort(),r=[];for(let[o,i]of t.entries()){let s=t.length-o,u=Math.ceil((n-r.length)/s);r.push(...F(e.filter(a=>a.reason===i),u))}return r.slice(0,n)}function Wn(e,n,t){let r=e.prepare("SELECT symbol FROM global_symbols WHERE id = ?");return jn(n,t).map(({symbolId:o,...i})=>({...i,definitionSymbol:r.get(o)?.symbol??`symbol-id:${o}`}))}function Un(e,n,t,r,o,i){if(!((n.tokenContext.tokenTextCounts.get(t.text)??0)<=1))for(let s of Hn(n.context.languageService,n.fileName,r+1,n.map,t,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(s))continue;let u=n.tokenContext.tokenByStart.get(s);u&&(ke(e,n.sourceReader,n.sourceInfo,n.sourceFile,u,o,i),n.tokenContext.processedStarts.add(s))}}function ke(e,n,t,r,o,i,s){let u=n.positionAt(t,o.start);e.push({sourceFile:r,sourceLine:u.line,sourceStartChar:u.character,sourceEndChar:u.character+o.text.length,sourceToken:o.text,definitionFile:i,symbolId:s})}function Bn(e){let n=new Map;for(let t of e)n.set(t.text,(n.get(t.text)??0)+1);return n}function Hn(e,n,t,r,o,i){let s=e.getDocumentHighlights?.(n,t,[n])??[],u=[];for(let a of s)if(a.fileName===n)for(let c of a.highlightSpans){let l=Kn(r,c.textSpan.start,i,o.text);l!==null&&u.push(l)}return u}function Kn(e,n,t,r){let o=t.get(n);if(o?.text===r)return o.start;let i=T(e,n);if(i===null)return null;let s=t.get(i);return s?.text===r?s.start:null}export{$ as a,Te as b,U as c,Ft as d,Lt as e};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-YTJHCGYB.js.map
|