codebaseiq 0.2.0 → 0.3.1
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 +59 -2
- package/README.md +1 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-WH5SYOMD.js → chunk-2E6OUPCF.js} +2 -2
- package/dist/chunk-2I2UHZET.js +2 -0
- package/dist/{chunk-CSZOQ7YO.js → chunk-2OMXFE64.js} +2 -2
- package/dist/{chunk-57KFVPVZ.js → chunk-2XBJRZEM.js} +2 -2
- package/dist/{chunk-PFPHS4NO.js → chunk-2Z7K66D7.js} +2 -2
- package/dist/{chunk-5WXOEJ4G.js → chunk-356EZBIP.js} +2 -2
- package/dist/{chunk-DLC6JDN7.js → chunk-3H2H5ODK.js} +2 -2
- package/dist/{chunk-HBQGKMM3.js → chunk-3LQJRS4I.js} +2 -2
- package/dist/{chunk-H3CKAL6P.js → chunk-3ON3A2QV.js} +2 -2
- package/dist/{chunk-MTMF4N7F.js → chunk-3VJ3OCRE.js} +2 -2
- package/dist/{chunk-QMGWSEPL.js → chunk-4GWN76B2.js} +2 -2
- package/dist/{chunk-IBM3F2BJ.js → chunk-4LK5OIPW.js} +2 -2
- package/dist/{chunk-6SDEQTVY.js → chunk-53ELMZRF.js} +2 -2
- package/dist/{chunk-OJFLPVBP.js → chunk-57OPIQFM.js} +2 -2
- package/dist/{chunk-2E6BTWER.js → chunk-5CR4U5X2.js} +2 -2
- package/dist/{chunk-IYBIBMPF.js → chunk-5FWR5HLG.js} +2 -2
- package/dist/{chunk-HHBBGWES.js → chunk-5LL4KEHO.js} +2 -2
- package/dist/{chunk-NTRW52UR.js → chunk-5MPBSFZH.js} +2 -2
- package/dist/chunk-5T44HG5Y.js +88 -0
- package/dist/chunk-5TZNHP4T.js +8 -0
- package/dist/{chunk-L3YSDLNB.js → chunk-5YBDBY5L.js} +2 -2
- package/dist/{chunk-YFQPWKHR.js → chunk-5ZI2PPI7.js} +2 -2
- package/dist/{chunk-WO47BIPY.js → chunk-6EYESTJM.js} +2 -2
- package/dist/{chunk-PHPQ24UG.js → chunk-6FXXYYQM.js} +2 -2
- package/dist/chunk-6O3KXIDL.js +2 -0
- package/dist/{chunk-PLZXWZHY.js → chunk-7GAK2F3H.js} +2 -2
- package/dist/{chunk-W3FK73MD.js → chunk-7UCDGXRW.js} +2 -2
- package/dist/{chunk-U2XX3BT4.js → chunk-AGGR2BKS.js} +2 -2
- package/dist/{chunk-ZB3V5QM7.js → chunk-ALOEHWJS.js} +2 -2
- package/dist/{chunk-NDGTJHQN.js → chunk-AXQCHG77.js} +2 -2
- package/dist/{chunk-X5I2BQGX.js → chunk-BFANZRQ5.js} +2 -2
- package/dist/{chunk-VVCBMH5O.js → chunk-BGGB5N53.js} +2 -2
- package/dist/{chunk-PARCKE3Q.js → chunk-BGYRF5YX.js} +2 -2
- package/dist/{chunk-CIVYHK7U.js → chunk-BIADXGC3.js} +2 -2
- package/dist/{chunk-NK76RSB6.js → chunk-BPKNP3KZ.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-37TKC6MB.js → chunk-CB5AVJMM.js} +2 -2
- package/dist/{chunk-BX2U3QQV.js → chunk-CCIYWXX6.js} +2 -2
- package/dist/{chunk-3AC56WAR.js → chunk-CIYA2KZN.js} +2 -2
- package/dist/{chunk-6OVNYYY4.js → chunk-CJTKGAGH.js} +2 -2
- package/dist/{chunk-FIXYHQ3W.js → chunk-CLPCFGRT.js} +2 -2
- package/dist/{chunk-LY2NB5XR.js → chunk-CSPDQLLU.js} +2 -2
- package/dist/{chunk-CMXW7MFV.js → chunk-CYJS33YX.js} +2 -2
- package/dist/{chunk-ACZDU5GK.js → chunk-D7DOB27N.js} +7 -7
- package/dist/{chunk-XUJM6474.js → chunk-DDRA3QKN.js} +2 -2
- package/dist/{chunk-3NUZVLR7.js → chunk-DECN422G.js} +2 -2
- package/dist/{chunk-RRPK327J.js → chunk-DJKOXMNG.js} +2 -2
- package/dist/{chunk-SJZQ2PTZ.js → chunk-DWBAESVW.js} +2 -2
- package/dist/{chunk-S5SKXCND.js → chunk-EHPOTEQX.js} +2 -2
- package/dist/chunk-EIBGSU2R.js +2 -0
- package/dist/{chunk-DVYG3JTA.js → chunk-ELYMY5S2.js} +2 -2
- package/dist/chunk-EOKVZXNF.js +355 -0
- package/dist/chunk-EQNMD62X.js +51 -0
- package/dist/{chunk-YIOQJ45A.js → chunk-F3QSL4W2.js} +2 -2
- package/dist/{chunk-VG55NFXF.js → chunk-F5CJO5JN.js} +2 -2
- package/dist/{chunk-JOALNFY3.js → chunk-F74LZWCE.js} +2 -2
- package/dist/chunk-G7GVV2TV.js +27 -0
- package/dist/{chunk-U24M5RQM.js → chunk-GQLDYCWS.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-T3YFIJ5P.js → chunk-HJTM3C4Y.js} +2 -2
- package/dist/{chunk-FY5V4V4F.js → chunk-HNXRVGMY.js} +2 -2
- package/dist/{chunk-UWB5WMC2.js → chunk-I3OK27P7.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-ILGTMRMZ.js +2 -0
- package/dist/{chunk-XNUWRTYM.js → chunk-IZDPGOZR.js} +2 -2
- package/dist/{chunk-BH5CE4LN.js → chunk-J7AMBVWF.js} +2 -2
- package/dist/chunk-JAFDMV5I.js +2 -0
- package/dist/{chunk-YXJ4IAHH.js → chunk-JCMFBF4Z.js} +2 -2
- package/dist/{chunk-BLKYYQ7C.js → chunk-JNXI6NQ7.js} +95 -95
- package/dist/{chunk-DKJXK3HA.js → chunk-JSB43EX6.js} +2 -2
- package/dist/chunk-JYRJYXUV.js +2 -0
- package/dist/chunk-K4S2VH42.js +82 -0
- package/dist/{chunk-QLTFXVUI.js → chunk-K6FNTQQW.js} +2 -2
- package/dist/{chunk-JYX5UZSZ.js → chunk-KEJ2HLRW.js} +2 -2
- package/dist/{chunk-VCWAJPXQ.js → chunk-KFTHI2R6.js} +2 -2
- package/dist/chunk-KLX6NSWT.js +3 -0
- package/dist/{chunk-DFPAZXLU.js → chunk-KPZGTB2O.js} +2 -2
- package/dist/{chunk-T55YPJGB.js → chunk-KUKKLWJD.js} +2 -2
- package/dist/{chunk-RWKEXCHU.js → chunk-KUKWHP4R.js} +2 -2
- package/dist/{chunk-ZJZQ7Q2Q.js → chunk-KWRQVLPX.js} +2 -2
- package/dist/{chunk-FQA3KIFX.js → chunk-L37EQYAX.js} +2 -2
- package/dist/{chunk-PNVZIJ57.js → chunk-LCW3PSGL.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-SF34QLK2.js → chunk-LQHYYIOB.js} +2 -2
- package/dist/{chunk-EXMVF3JR.js → chunk-LSZYMN2A.js} +3 -3
- package/dist/{chunk-RCPZOPV6.js → chunk-M2Y6PCFE.js} +2 -2
- package/dist/chunk-MC46AL7B.js +343 -0
- package/dist/{chunk-SRY26ITJ.js → chunk-MDFT325O.js} +2 -2
- package/dist/{chunk-WJOQC4P7.js → chunk-MEUHIDI3.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-27PHVDKL.js → chunk-MZNMASFM.js} +2 -2
- package/dist/{chunk-VYZQZ4ZN.js → chunk-N2XDMNVI.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-NNG6M6XD.js +3 -0
- package/dist/chunk-O2KWU34K.js +278 -0
- package/dist/{chunk-HBXZAGY6.js → chunk-O2M3VNDY.js} +2 -2
- package/dist/{chunk-FPDL2TUB.js → chunk-OBC7HSSO.js} +2 -2
- package/dist/{chunk-J24VICI5.js → chunk-OKAF4OQS.js} +2 -2
- package/dist/{chunk-I5FCDTK2.js → chunk-OP6BUIV6.js} +2 -2
- package/dist/{chunk-2DMVFAY7.js → chunk-OQ3DK7FW.js} +2 -2
- package/dist/{chunk-FEBLLMTL.js → chunk-OQUCBKOI.js} +2 -2
- package/dist/chunk-OT5ISJSR.js +2 -0
- package/dist/{chunk-N3Q3AWGW.js → chunk-OWJWOEDU.js} +96 -96
- package/dist/{chunk-M4EVGA5S.js → chunk-PIFYOWS4.js} +3 -3
- package/dist/{chunk-35YYZD3D.js → chunk-PTR3EOXC.js} +2 -2
- package/dist/{chunk-5XEVXVTK.js → chunk-PUVNH4PO.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-NIO346UL.js → chunk-QY7QB7I6.js} +2 -2
- package/dist/{chunk-YYFV32WR.js → chunk-R4OJGTMP.js} +2 -2
- package/dist/{chunk-2VKB5CMA.js → chunk-RCIGX23V.js} +2 -2
- package/dist/{chunk-TUTSO7UZ.js → chunk-RIO3JXHM.js} +2 -2
- package/dist/{chunk-4IFISPQW.js → chunk-SA7G6GJX.js} +2 -2
- package/dist/{chunk-OMBRP7BB.js → chunk-SB53KPWA.js} +2 -2
- package/dist/chunk-SB7NASHU.js +2 -0
- package/dist/{chunk-3XFJUWJE.js → chunk-SGMNWYTH.js} +2 -2
- package/dist/{chunk-A7XQT7MH.js → chunk-SUE7SHZL.js} +2 -2
- package/dist/{chunk-IOVPAZWP.js → chunk-SX72EVMY.js} +2 -2
- package/dist/{chunk-OVKZM2XI.js → chunk-SZ4P7MF7.js} +2 -2
- package/dist/{chunk-EM5UHLAM.js → chunk-T2M5HWBQ.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-MT5W4DUG.js → chunk-TEMM2FEL.js} +2 -2
- package/dist/{chunk-I2KP4AGR.js → chunk-TJWVT4DO.js} +2 -2
- package/dist/{chunk-77GHPR2R.js → chunk-TLTSESB4.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-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-MRGTCMDK.js → chunk-UIAUPFBJ.js} +2 -2
- package/dist/{chunk-LAGDJXFY.js → chunk-UJIXCI3L.js} +2 -2
- package/dist/{chunk-IVJJNVSX.js → chunk-UMEPSVKT.js} +2 -2
- package/dist/{chunk-4O52YNKL.js → chunk-UQYQBLJX.js} +2 -2
- package/dist/{chunk-JUO3Z644.js → chunk-UW6KD57C.js} +2 -2
- package/dist/{chunk-TAJ6UGCO.js → chunk-V4NGDIEA.js} +3 -3
- package/dist/{chunk-VLTUX4IF.js → chunk-VGWZ4MOY.js} +2 -2
- package/dist/{chunk-KNV5VFDV.js → chunk-VSGOIZMQ.js} +2 -2
- package/dist/{chunk-K5G7SPAG.js → chunk-W7QDASTN.js} +4 -4
- package/dist/{chunk-IWAMYGPN.js → chunk-W7YLRXZE.js} +2 -2
- package/dist/{chunk-QKVTWODE.js → chunk-WK2IQJPK.js} +2 -2
- package/dist/{chunk-HYKSLTAR.js → chunk-WO6OFKUC.js} +2 -2
- package/dist/{chunk-S64NCE2Z.js → chunk-WWCV4E6J.js} +2 -2
- package/dist/{chunk-2F5ERMNI.js → chunk-XJBK3QDV.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-NJA4MMBD.js → chunk-XUPFA6GH.js} +2 -2
- package/dist/{chunk-4AOOSCZ7.js → chunk-YHPG3S2U.js} +2 -2
- package/dist/{chunk-CDWSLAPN.js → chunk-YPBKBYPS.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-ZNQCR656.js → chunk-Z66XYVLZ.js} +2 -2
- package/dist/{chunk-A67HT5FR.js → chunk-ZB4C5TTR.js} +2 -2
- package/dist/chunk-ZMA5HWXY.js +3 -0
- package/dist/{chunk-CWMHWD56.js → chunk-ZNH33XIB.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-SCHOHOQE.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-ZCTHXQ5C.js → code-viewer-AMRXV444.js} +2 -2
- package/dist/{code-viewer-YGDON6SY.js → code-viewer-EXI5SFFR.js} +2 -2
- package/dist/{command-descriptors-5VAB2MZX.js → command-descriptors-H6A4UY72.js} +129 -129
- package/dist/{command-descriptors-EAHKIRAG.js → command-descriptors-ROIOTCCW.js} +130 -130
- package/dist/{db-DmRNdCtm.d.ts → db-BoG_PWYH.d.ts} +1 -1
- package/dist/direct-navigation-3JOYP2MO.js +3 -0
- package/dist/direct-navigation-SJMJLBY7.js +2 -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-GMZX3UAD.js +2 -0
- package/dist/invocation-command-descriptors-HNMKDEF6.js +3 -0
- package/dist/{scip-cli-BRFKkHQn.d.ts → maintenance-types-CdL5eQii.d.ts} +1 -20
- package/dist/output-continuation-command-5NWVDQT7.js +2 -0
- package/dist/output-continuation-command-RNEHNYPU.js +3 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-MIW5CYEG.js +3 -0
- package/dist/project-reindex-VQ23LWDA.js +2 -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-H66AZ3VE.js +2 -0
- package/dist/sentinel-ensure-command-R4YAUCJB.js +3 -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-5IO2APSS.js +0 -2
- 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,2 +1,2 @@
|
|
|
1
|
-
import{a as F}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as F}from"./chunk-BGBBVSH4.js";import{a as I}from"./chunk-57OPIQFM.js";import{h as le}from"./chunk-MSI3K7PJ.js";import{b as $,d as ne,e as te,f as ie,g as oe,h as re,j as N,k as ae,l as se}from"./chunk-J7AMBVWF.js";import{d as ee}from"./chunk-ELNRLMC5.js";import{f as X,h as Z}from"./chunk-NDKOVQFG.js";import{a as C}from"./chunk-BRQL7AFJ.js";import{a as H}from"./chunk-GV2CEZCW.js";import{a as O,e as z,g as E,h as P,j as Q,k as W,t as D,u as Y,v as J,w as U,x as A}from"./chunk-GVAF222T.js";import{k as G,m as S}from"./chunk-F74LZWCE.js";import{A as V,K as B,a as v,z as y}from"./chunk-ICUL7XRT.js";import{w as _,z as M}from"./chunk-7GAK2F3H.js";import{d as j}from"./chunk-3LCDIREB.js";function ce(n,e,t={}){let i=new Map;if(e&&e.length===0)return i;let r=v(n,{includeIgnored:!1}),a=ie(n),o=e??Y(n),f=new Set(o.map(u=>u.symbolId)),c=ve(o);return pe(n,i,r,a,f,c),ye(n,i,o,f),Re(n,i,r,a,f,c),t.semantic!==!1&&t.semanticEvidence&&De(i,t.semanticEvidence.callerMap(n,Me(o))),i}function pe(n,e,t,i,r,a){for(let o of t){if(!y(o))continue;let f=G(n,o);if(f)for(let c of f){if(a&&!a.has(c.calleeLeaf))continue;let u=ne(o,i.get(c.calleeLeaf)??[]);if(!u||u.length===0)continue;let s=te(n,o,u,c.memberAccess,c.calleeQualifier);s&&r.has(s.symbolId)&&s.file!==o&&T(e,s.symbolId,o)}}}function ye(n,e,t,i){let r=ge(t);for(let a of Se(n,i))n.isIgnored(a.relative_path)||he(a,r.get(a.symbol_id))||T(e,a.symbol_id,a.relative_path)}function Se(n,e){return ee(n,e?[...e]:void 0)}function ge(n){let e=new Map;for(let t of n)e.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return e}function he(n,e){return!!e&&e.docId===n.document_id&&n.chunk_start>=e.startLine&&n.chunk_end<=e.endLine}function Re(n,e,t,i,r,a){for(let o of t){if(y(o)!=="rust")continue;let f=S(n,o,{includeRustAttributeNames:!0});if(f.length!==0)for(let{name:c}of f){if(a&&!a.has(c))continue;let u=i.get(c);if(u)for(let s of u)r.has(s.symbolId)&&s.file!==o&&T(e,s.symbolId,o)}}}function T(n,e,t){let i=n.get(e);i||(i=new Set,n.set(e,i)),i.add(t)}function ve(n){let e=new Set;for(let t of n){let i="leaf"in t&&typeof t.leaf=="string"?t.leaf:"symbol"in t&&typeof t.symbol=="string"?z(t.symbol):"";i&&e.add(i)}return e.size>0?e:null}function Me(n){return n.filter(e=>"relativePath"in e&&"symbol"in e&&"leaf"in e)}function De(n,e){for(let[t,i]of e){let r=n.get(t);r||(r=new Set,n.set(t,r));for(let a of i)r.add(a)}}function q(n,e,t={}){return ce(n,e,t)}function K(n,e,t={}){return se(n,e,t)}function fe(n,e,t={}){let i=q(n,e,{semantic:t.semantic,semanticEvidence:t.semanticEvidence});return t.sourceFallback===!1?i:Ce(i,K(n,e))}function Ce(n,e){let t=new Map;for(let[i,r]of n)t.set(i,new Set(r));for(let[i,r]of e){let a=t.get(i)??new Set;for(let o of r)a.add(o);t.set(i,a)}return t}function ue(n,e,t){let i=e.identifierResolution==="strict"?N:ae,r=e.candidateNames?oe(e.candidateNames):null,a=0,o=0,f=0,c=0,u="";for(let s of e.paths)if(a+=1,u=s,!(!y(s)&&!(e.includeVueSfc&&V(s)))&&!n.isIgnored(s)&&!e.skipPath?.(s))try{if(r&&!re(_(n,s),r))continue;o+=1;let h=(d,b,x,g)=>{if(e.candidateNames&&!e.candidateNames.has(d))return;f+=1;let R=e.resolveTargets?e.resolveTargets({sourceFile:s,name:d,kind:b,defaultTargets:g}):g();for(let w of R)c+=1,t({sourceFile:s,name:d,target:w,occurrences:x,kind:b})},k=$(n,s);for(let[d,b]of k)h(d,"identifier",b.length,()=>i(n,s,d));for(let d of S(n,s,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let b=d.kind==="cross-language-dispatch"?()=>N(n,s,d.name):()=>i(n,s,d.name);h(d.name,d.kind,d.occurrences,b)}}finally{e.afterPath?.(s),a%10===0&&j("source-reference-scan.progress",()=>{},()=>({scannedPaths:a,currentPath:u,candidateMatchedPaths:o,visitedNames:f,visitedHits:c}))}}function de(n,e={}){let{scope:t,files:i,minLoc:r=1,maxLoc:a=Number.POSITIVE_INFINITY,excludeSymbol:o,excludeEntrySurfaces:f=!1,excludeTypesFiles:c=!1,excludeRootedSymbols:u=!1,requireFunctionLikeSymbol:s=!1,requireCallableSymbol:L=!1,excludeRustTraitImplMembers:h=!1,includeSuppressed:k=!1,sortByLocDesc:d=!1}=e,b=[],x=Ie(n,{scope:t,files:i,requireFunctionLikeSymbol:s,requireCallableSymbol:L}),g=new Map,R=new Map,w=l=>{let m=g.get(l);if(m!==void 0)return m;let p=X(n,l);return g.set(l,p),p},be=l=>{let m=R.get(l);if(m!==void 0)return m;let p=C(l);return R.set(l,p),p};for(let l of x){let m=l.relativePath;if(n.isIgnored(m)||f&&w(m)||!Fe(l,{requireFunctionLikeSymbol:s,requireCallableSymbol:L})||o!==void 0&&l.symbol===o)continue;let p=F(l);p<r||p>a||c&&Le(m)||u&&Z(n,l.symbol,m)||h&&Q(l.symbol)||be(m)!=="test"&&(W(l.symbol)||!k&&M(n,m,l.startLine)||b.push(l))}return d?b.sort((l,m)=>F(m)-F(l)):b}function Ie(n,e){return e.files!==void 0?[...new Set(e.files.map(i=>i.replace(/\\/g,"/")))].sort().filter(i=>!e.scope||i.includes(e.scope)).flatMap(i=>D(n,i)):e.requireCallableSymbol?A(n,{scope:e.scope,symbolMatches:E,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?A(n,{scope:e.scope,symbolMatches:P,sqlPrefilter:"function-like"}):U(n,e.scope)}function Fe(n,e){return e.requireCallableSymbol?E(n.symbol):e.requireFunctionLikeSymbol?P(n.symbol):n.isFunctionLike}function Le(n){return(n.split("/").pop()??"").includes("types")}var me=class{constructor(e){this.db=e}db;scopedDefinitions(e){return J(this.db,e)}definitionsForFile(e){return D(this.db,e)}productionCallableDefinitions(e={}){return de(this.db,e)}calleeMap(e,t={}){return this.calleeEvidenceMap(e,t).rows}calleeEvidenceMap(e,t={}){return le(this.db,e,{...t,semanticEvidence:I})}crossFileCallerMap(e,t={}){return q(this.db,e,{...t,semanticEvidence:I})}sourceFallbackCallerFiles(e,t={}){return K(this.db,e,t)}callerFileMap(e,t={}){return fe(this.db,e,{...t,semanticEvidence:I})}frameworkReferencedSymbolIds(e){let t=new Map;for(let r of e){if(!r.leaf)continue;let a=t.get(r.leaf)??[];a.push(r.symbolId),t.set(r.leaf,a)}let i=new Set;for(let r of v(this.db,{includeIgnored:!1}))if(y(r)==="rust")for(let{name:a}of S(this.db,r,{includeRustAttributeNames:!0}))for(let o of t.get(a)??[])i.add(o);return i}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let i=new Map(e.map(o=>[o.symbolId,o.symbol])),r=this.calleeEvidenceMap(e,t),a=new Set([...r.rows.entries()].filter(([o,f])=>{let c=i.get(o);return f.some(u=>u.symbol!==c)}).map(([o])=>o));for(let o of r.incompleteSymbolIds)a.add(o);for(let o of r.unavailableSymbolIds)a.add(o);return a}fileDependencyGraph(e){return H(this.db,e)}fileKind(e){return C(e)}hasSuppressionComment(e){return M(this.db,e.relativePath,e.startLine)}sourceFiles(){return B(this.db)}scanSourceReferences(e,t){ue(this.db,e,t)}callableSignature(e){let t=O(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(i=>i.startLine===e.startLine&&i.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{K as a,Ce as b,me as c};
|
|
2
|
+
//# sourceMappingURL=chunk-BPKNP3KZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as r}from"./chunk-UC2FD2PS.js";function _(t){let s=r(t);return i(s)?"test":u(s)?"worker":n(s)?"entry":f(s)?"barrel":"source"}function i(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function u(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function n(t){let s=t.split("/"),e=s[s.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:s.length<=2:!1}function f(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}export{_ as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BRQL7AFJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d}from"./chunk-BGGB5N53.js";import{C as c}from"./chunk-ICUL7XRT.js";import{x as s}from"./chunk-7GAK2F3H.js";var p=new Set(["arrow_function","class_declaration","constructor_declaration","field_definition","function_declaration","function_definition","function_expression","function_item","generator_function_declaration","generator_function","lexical_declaration","method","method_declaration","method_definition","object_method","variable_declaration"]);function b(n,t,e){let o=c(n,t)?.rootNode??null,r=L(o,e);if(!r)return null;let a=s(n,t);if(a.length===0)return null;let u=Math.max(0,r.startPosition.row),i=r.endPosition.column===0?r.endPosition.row-1:r.endPosition.row;return{type:r.type,startLine:u,endLine:Math.min(a.length-1,Math.max(u,i))}}function y(n,t,e,o,r){let a=d(n,t,o,r,[e]),u=a.startLine===a.endLine&&/(?:=>|\(|\{|\[|,)\s*$/u.test(s(n,t)[a.startLine]??"");if(!u&&(a.startLine>o||a.endLine<r))return a;let i=b(n,t,e);return u&&i?{startLine:i.startLine,endLine:i.endLine}:i&&i.startLine>=o&&i.endLine<=r?{startLine:i.startLine,endLine:i.endLine}:{startLine:o,endLine:r}}function L(n,t){if(!n||!f(n,t))return null;let e=m(n,t);for(;e;){if(p.has(e.type))return e;e=e.parent}return null}function m(n,t){let e=n.namedChildren.filter(o=>f(o,t)).sort((o,r)=>l(o)-l(r));return e.length>0?m(e[0],t):n}function f(n,t){return n.startPosition.row<=t&&n.endPosition.row>=t}function l(n){return n.endIndex-n.startIndex}export{b as a,y as b};
|
|
2
|
+
//# sourceMappingURL=chunk-BWL3PMPT.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as we}from"./chunk-
|
|
1
|
+
import{c as we}from"./chunk-XQAVQVIL.js";import{a as Xt,b as oe,c as Kt,d as Gt,e as Ae,g as Zt}from"./chunk-DRENNWRG.js";import{C as Jt,D as de,E as re,F as Qt,G as O,H as _e,I as ge,J as ct,M as De,a as Ht,b as $,c as it,i as V,k as W,l as x,m as Ee,q as te,u as G,v as C,w as fe,x as at,y as ne,z as Ce}from"./chunk-5FWR5HLG.js";import{p as K,q as L}from"./chunk-T75DS2E6.js";import{a as k,b as pe,c as me,d as qt,e as Ie}from"./chunk-YT4DVWUV.js";import{A as I,h as Pe}from"./chunk-UQYQBLJX.js";var Cr=new Set(["identifier","type_identifier","field_identifier"]),_r=new Set(["identifier"]),Tr=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Fr=new Set(["rust","python"]),Rr=/\{([^{}]*)\}/g,kr=/\b([A-Za-z_][\w]*)\b/g;function Yt(e,t){return Lr(t).has(e.type)}function en(e,t){return Fr.has(t)&&e.type==="string_content"}function lt(e){let t=0;for(let r of e.values()){let o=r[r.length-1];o!==void 0&&o>t&&(t=o)}let n=new Array(t+1);for(let r=0;r<=t;r+=1)n[r]=new Set;for(let[r,o]of e)for(let s of o)n[s].add(r);return n}function Lr(e){return e==="rust"?Cr:e==="python"?_r:Tr}function tn(e,t){let n=e.startPosition.row;for(let r of e.text.matchAll(Rr)){let o=r[1]??"";for(let s of o.matchAll(kr))s[1]&&t(s[1],n)}}var vr=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Pr=/^#!?\[\s*serde\s*\(/,Er=/^#!?\[\s*schemars\s*\(/,Dr=/^#!?\[\s*validate\s*\(/,wr=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function nn(e,t,n){if(t!=="typescript"&&t!=="tsx"&&t!=="javascript"||e.type!=="call_expression")return;let r=e.childForFieldName("function")??e.namedChild(0);if(!r)return;let o=ct(r);if(!o||!wr.has(o))return;let s=e.namedChildren.find(c=>c.type==="arguments");if(!s)return;let i=s.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&n.add(a.text)}function rn(e,t){let n=Pr.test(e),r=Er.test(e),o=Dr.test(e);if(!(!n&&!r&&!o))for(let s of vr){s.lastIndex=0;let i;for(;(i=s.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&t.add(c)}}}function on(e,t){let n=new Map,r=(i,a)=>{if(i===a)return;let c=n.get(i);c||(c=new Set,n.set(i,c)),c.add(a)},o=t==="python"?new Set(["identifier"]):new Set(["type_identifier"]),s=(i,a)=>{let c=l=>{o.has(l.type)&&l.text!==a&&r(l.text,a);for(let u of l.children)c(u)};for(let l of i.children)c(l)};if(t==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&s(c,a),i.type==="type_item"&&s(i,a)}else if(t==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(u=>u.type==="identifier")?.text;if(!a)continue;let c=i.childForFieldName("superclasses");c&&s(c,a);let l=i.namedChildren.find(u=>u.type==="block");if(l)for(let u of l.descendantsOfType("type"))for(let p of u.descendantsOfType("identifier"))p.text!==a&&r(p.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&s(i,a)}return n}var Ar=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),ut=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function sn(e){let t=[],n=[],r=[],o=new Map,s=[],i=0,a=0,c=(l,u)=>{let p=o.get(l);if(!p){o.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)};for(;a<e.length;){let l=e[a];if(l===`
|
|
2
2
|
`){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=Me(e,a);continue}if(l==='"'){let g=Fe(e,a,i);i=g.line,a=g.index;continue}if(l==="("||l==="["||l==="{"){s.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let g=s.pop();g&&(g.endLine=i,Or(g,{callables:t,callSites:n,clojureMembers:r,recordIdentifier:c}),s[s.length-1]?.children.push(g)),a+=1;continue}if(pt(l)){a+=1;continue}let u=i,p=a;for(;a<e.length&&!mt(e[a]);)a+=1;let m=e.slice(p,a);if(!m)continue;let f={text:m,line:u};Mr(s[s.length-1],f),c(v(m),u)}return{language:"clojure",callables:t,callSites:n,clojureMembers:r,typeContainerMap:new Map,identifierLineMap:o,identifiersByLine:Wr(o),fileIdentifiers:new Set(o.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Or(e,t){if(e.kind!=="("||e.headTokens.length===0)return;let n=e.headTokens[0],r=v(n.text),o=Ar.get(n.text);if(o){let i=e.headTokens[1];if(i){let a=v(i.text);t.recordIdentifier(a,i.line),t.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:o})}}if(jr(e,t),!r||ut.has(n.text)||ut.has(r)||r.startsWith(":"))return;let s=Vr(n.text);t.callSites.push({calleeLeaf:s.leaf,calleeQualifier:s.qualifier,calleeText:s.text,memberAccess:!1,line:n.line})}function Mr(e,t){e&&(e.headTokens.length<2&&e.headTokens.push(t),e.tokens.length<200&&e.tokens.push(t))}function jr(e,t){let n=v(e.tokens[0]?.text??"");if(n==="defprotocol"){let r=v(e.tokens[1]?.text??"");if(!r)return;for(let o of Oe(e))Te(t,r,"protocol",o,"protocol-method");return}if(n==="defrecord"||n==="deftype"){let r=v(e.tokens[1]?.text??"");if(!r)return;let o=n==="defrecord"?"record":"type",s=n==="defrecord"?"record-method":"type-method";for(let i of Oe(e))Te(t,r,o,i,s);return}if(n==="extend-type"){let r=v(e.tokens[1]?.text??"");if(!r)return;for(let o of Oe(e))Te(t,r,"extension",o,"extension-method");return}if(n==="extend-protocol"){let r=v(e.tokens[1]?.text??"");for(let o of Oe(e)){r&&Te(t,r,"extension",o,"extension-method");let s=Br(e,o.startLine);s&&s!==r&&Te(t,s,"extension",o,"extension-method")}}}function Oe(e){return e.children.filter($r)}function $r(e){if(e.kind!=="(")return!1;let t=v(e.tokens[0]?.text??"");return!!(t&&!ut.has(t)&&!t.startsWith(":"))}function Te(e,t,n,r,o){let s=r.tokens[0],i=v(s?.text??"");!s||!i||(e.recordIdentifier(i,s.line),e.clojureMembers.push({ownerName:t,ownerKind:n,memberName:i,memberKind:o,startLine:r.startLine,endLine:r.endLine}))}function Br(e,t){let n=null;for(let r=2;r<e.tokens.length;r+=1){let o=e.tokens[r];if(o.line>t)break;let s=v(o.text);s&&!s.startsWith(":")&&(n=s)}return n}function v(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Vr(e){let t=e.replace(/^#?['`~@]+/,""),n=t.lastIndexOf("/"),r=v(t);if(n<=0)return{leaf:r,text:t};let o=t.slice(0,n);return{leaf:r,qualifier:o,text:t}}function Me(e,t){let n=t;for(;n<e.length&&e[n]!==`
|
|
3
3
|
`;)n+=1;return n}function Fe(e,t,n){let r=t+1,o=n;for(;r<e.length;){let s=e[r];if(s==="\\"){r+=2;continue}if(s===`
|
|
4
4
|
`&&(o+=1),r+=1,s==='"')break}return{index:r,line:o}}function pt(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function mt(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Wr(e){let t=[];for(let[n,r]of e)for(let o of r)t[o]??=new Set,t[o].add(n);return t}var an=6,zr=qt("source-facts",{clearGroups:["whole-project","source-file"]}),ft=V({kind:"source-facts",invalidation:W("source-facts"),serialize:Hr,deserialize:Jr});function z(e,t){return dt(e,t).facts}function dt(e,t){let n=x(e,t);if(!n)return{facts:null};let r=Ur(e,t,n);return r?zr.get(e,t,n,()=>qr(e,t,r,n)):{facts:null}}function Ur(e,t,n){return Ce(t)?Qt(e,t,n)?.language??null:ne(t)}function qr(e,t,n,r){let o=$(e,t,r),s=ft.read(e,t,o);if(s&&s.language===n)return{facts:s};if(n==="clojure"){let c=sn(r);return ft.write(e,t,o,c),{facts:c}}let i=O(e,t);if(!i)return{facts:null,unavailable:{language:n,reason:"parser-unavailable"}};let a=Gr(i,n);return ft.write(e,t,o,a),{facts:a}}function Hr(e){let t={version:an,language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([n,r])=>[n,[...r]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(t)}function Jr(e){try{let t=JSON.parse(e);if(t.version!==an||t.language==="clojure"&&(t.clojureMembers===void 0||t.callSites.some(r=>r.calleeText===void 0)))return null;let n=new Map(t.identifierLineMap);return{language:t.language,callables:t.callables,callSites:t.callSites,clojureMembers:t.clojureMembers??[],typeContainerMap:new Map(t.typeContainerMap.map(([r,o])=>[r,new Set(o)])),identifierLineMap:n,identifiersByLine:lt(n),fileIdentifiers:new Set(n.keys()),rustAttrReferencedNames:new Set(t.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(t.crossLanguageDispatchNames)}}catch{return null}}function Qr(e,t,n,r){let o=z(e,t);return o?Kr(o,n,r)?.isLiteralPassthrough??!0:!0}function Xr(e,t){return t.relativePath.includes(".clj-kondo/hooks/")?!0:z(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine)?.clojureKind==="macro"}function Kr(e,t,n){return e.callables.find(r=>r.startLine===t&&r.endLine===n)??null}function Gr(e,t){let n=[],r=[],o=new Set,s=new Set,i=new Map,a=(l,u)=>{let p=i.get(l);if(!p){i.set(l,[u]);return}p[p.length-1]!==u&&p.push(u)},c=l=>{let u=De(l,t);u&&n.push(u);let p=ge(l,t);p&&r.push(p),nn(l,t,s),t==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&rn(l.text,o),Yt(l,t)&&a(l.text,l.startPosition.row),en(l,t)&&tn(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:t,callables:n,callSites:r,clojureMembers:[],typeContainerMap:on(e,t),identifierLineMap:i,identifiersByLine:lt(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:o,crossLanguageDispatchNames:s}}var cn=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function gt(e,t){let n=z(e,t);return!n||!cn.has(n.language)?null:n.callables.map(r=>({name:r.name,startLine:r.startLine,endLine:r.endLine}))}function Zr(e,t){let n=z(e,t);return!n||!cn.has(n.language)?null:n.callSites}function Yr(e,t){return z(e,t)?.typeContainerMap??new Map}import{ElementTypes as to,NodeTypes as ht,parse as no}from"@vue/compiler-dom";import{parse as Xc}from"@vue/compiler-sfc";var eo=new Set(["children","className","data","e","err","error","ev","event","false","id","idx","index","item","key","null","props","res","result","state","style","true","undefined","val","value"]);function je(e){return e.length<=2||eo.has(e)}function $e(e,t){return e.split(t).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}var ro=me("vue-template-facts"),oo=new Set(["component","keep-alive","slot","suspense","teleport","template","transition","transition-group"]),so=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","menu","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]),io=new Set(["div","span","template"]),ao=new Set(["as","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","export","extends","false","finally","for","from","function","if","import","in","instanceof","let","new","null","of","return","super","switch","this","throw","true","try","typeof","undefined","var","void","while","with","yield"]);function Be(e,t){let n=t.replace(/\\/g,"/"),r=x(e,n);return ro.get(e,n,r,()=>co(n,de(e,n).template))}function co(e,t){let n={relativePath:e,template:t?{startLine:t.startLine,endLine:t.endLine}:null,componentTags:[],nativeTags:[],builtinTags:[],props:[],events:[],directives:[],slots:[],expressionIdentifiers:[],structuralTokens:[]};if(!t)return n;let r;try{r=no(t.body,{comments:!1})}catch{return n}let o=new Set,s=i=>{i.trim()&&o.add(i)};return un(r.children,t.startLine,n,s),n.structuralTokens=[...o].sort(),n}function un(e,t,n,r){for(let o of e)if(o.type===ht.ELEMENT)lo(o,t,n,r),un(o.children,t,n,r);else if(o.type===ht.INTERPOLATION){r("interpolation");let s=St(o.content);s&&pn(s,t,o.loc.start.line,n,r)}}function lo(e,t,n,r){let o=So(e.tag),s={tag:e.tag,normalized:o,kind:ho(e),startLine:he(t,e.loc.start.line),endLine:he(t,e.loc.end.line)};s.kind==="component"?(n.componentTags.push(s),r(`component:${o}`)):s.kind==="builtin"?(n.builtinTags.push(s),r(`builtin:${o}`)):(n.nativeTags.push(s),io.has(e.tag)||r(`native:${e.tag}`));for(let i of e.props)uo(i,t,n,r)}function uo(e,t,n,r){if(e.type===ht.ATTRIBUTE){let a=e.value?.content??null,c=ln("prop",e.name,a,t,e.loc.start.line,e.loc.end.line);n.props.push(c),r(`prop:${e.name}`);return}let o=mo(e),s=St(e.exp),i=ln(po(e.name),o,s,t,e.loc.start.line,e.loc.end.line);switch(i.kind){case"prop":n.props.push(i),r(`prop:${o}`);break;case"event":n.events.push(i),r(`event:${o}`);break;case"slot":n.slots.push(i),r(`slot:${o}`);break;case"directive":n.directives.push(i),r(`directive:${o}`);break}s&&pn(s,t,e.loc.start.line,n,r)}function ln(e,t,n,r,o,s){return{kind:e,name:t,value:n,startLine:he(r,o),endLine:he(r,s)}}function po(e){switch(e){case"bind":case"model":return"prop";case"on":return"event";case"slot":return"slot";default:return"directive"}}function mo(e){let t=St(e.arg);return t||e.name}function St(e){if(!e)return null;let t=("content"in e&&typeof e.content=="string"?e.content:e.loc.source).trim();return t||null}function pn(e,t,n,r,o){for(let s of fo(e)){let i={name:s,startLine:he(t,n),endLine:he(t,n)};r.expressionIdentifiers.push(i),o(`id:${s}`)}}function fo(e){let t=new Set,n=go(e),r=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,o;for(;o=r.exec(n);){let s=o[0];ao.has(s)||je(s)||/^[A-Z_]+$/.test(s)||t.add(s)}return[...t].sort()}function go(e){return e.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/.*$/gm," ").replace(/`(?:\\[\s\S]|\$\{([^}]*)\}|[^`\\])*`/g,(t,n)=>n??" ").replace(/'(?:\\[\s\S]|[^'\\])*'/g," ").replace(/"(?:\\[\s\S]|[^"\\])*"/g," ")}function ho(e){let t=e.tag;return e.tagType===to.COMPONENT?"component":oo.has(t)?"builtin":so.has(t)?"native":/^[A-Z]/.test(t)||t.includes("-")?"component":"native"}function So(e){return $e(e,/[-_:]/)}function he(e,t){return e+Math.max(0,t-1)}import{createRequire as ko}from"module";import{existsSync as ae}from"fs";import{basename as fn,dirname as T,extname as U,join as P,relative as se,resolve as b,sep as Lo}from"path";import{existsSync as xt,readdirSync as yo,statSync as xo}from"fs";import{join as Se,relative as bo}from"path";function mn(e){let t=No(e)??To(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Fo(e,o)){if(r.has(s))continue;r.add(s);let i=Ro(e,s);i&&n.push(i)}return n}function No(e){let t=Se(e,"pnpm-workspace.yaml");if(!xt(t))return null;try{return Io(Pe(t,"pnpm workspace manifest"))}catch{return null}}function Io(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=Co(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=_o(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function Co(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function _o(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function To(e){let t=Se(e,"package.json");if(!xt(t))return null;try{let n=JSON.parse(Pe(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Fo(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=Se(e,t);return yt(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=Se(e,r||".");return yt(s)?yo(s).map(i=>Se(s,i,o)).filter(yt):[]}function yt(e){try{return xo(e).isDirectory()}catch{return!1}}function Ro(e,t){let n=Se(t,"package.json");if(!xt(n))return null;try{let r=JSON.parse(Pe(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:bo(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}var vo=pe("indexed-paths",{clearGroups:[]}),Po=pe("indexed-path-digest",{clearGroups:[]}),Eo=k("tsconfig-alias-config",{clearGroups:["whole-project"]}),Do=k("tsconfig-alias-config-for-dir",{clearGroups:["whole-project"]}),wo=ko(import.meta.url),Re;function Ao(){if(Re!==void 0)return Re;try{Re=wo("typescript")}catch{Re=null}return Re}var Oo=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"],Mo=pe("workspace-packages",{clearGroups:["whole-project"]}),ie=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],Ve=[".py",".pyi"],F=[".java",".scala",".kt",".kts"],We=[".rs"],ze=[".rb"],Ue=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],Z=[".cs",".vb"],qe=[".dart"],ce=[".php"],ye=[".clj",".cljs",".cljc"],jo=new Set(ie),bt=new Set(Ve),dn=new Set(F),Nt=new Set(We),It=new Set(ze),gn=new Set(Ue),hn=new Set(Z),Ct=new Set(qe),Sn=new Set(ce),yn=new Set(ye),$o=[{extensions:ie,lookup:jo},{extensions:Ve,lookup:bt},{extensions:F,lookup:dn},{extensions:We,lookup:Nt},{extensions:ze,lookup:It},{extensions:Ue,lookup:gn},{extensions:Z,lookup:hn},{extensions:qe,lookup:Ct},{extensions:ce,lookup:Sn},{extensions:ye,lookup:yn}];function q(e,t){return t.has(U(e).toLowerCase())}function Bo(e){return q(e,bt)}function Vo(e){return q(e,dn)}function Wo(e){return q(e,Nt)}function zo(e){return q(e,It)}function Uo(e){return q(e,gn)}function qo(e){return q(e,hn)}function xn(e){return U(e).toLowerCase()===".vb"}function Ho(e){return q(e,Ct)}function Jo(e){return q(e,Sn)}function Qo(e){return q(e,yn)}function _t(e){let t=U(e).toLowerCase();for(let n of $o)if(n.lookup.has(t))return n.extensions;return ie}function Xo(e){return Vo(e)||qo(e)||Jo(e)}function B(e,t,n){return Bo(t)?xe(e,t,n):Wo(t)?H(e,t,n):zo(t)?He(e,t,n):Uo(t)?Je(e,t,n):Xo(t)?S(e,n.replace(/\\/g,"."),_t(t)):Ho(t)?Qe(e,t,n):Qo(t)?Tt(e,n):Ko(e,t,n)}function Ko(e,t,n){if(!n.startsWith(".")&&!n.startsWith("/"))return Go(e,t,n)??Yo(e,n);let r=T(P(e.config.projectRoot,t)),o=b(r,n),s=J(e);for(let i of Rt(o)){let a=I(se(e.config.projectRoot,i));if(s.has(a)||ae(i))return a}return I(se(e.config.projectRoot,o))}function Go(e,t,n){let r=ss(e,t);if(!r)return null;let o=J(e);for(let s of Zo(r,n)){let i=b(r.baseUrl,s);for(let a of Rt(i)){let c=I(se(e.config.projectRoot,a));if(o.has(c)||ae(a))return c}}return null}function Zo(e,t){let n=[];for(let[r,o]of Object.entries(e.paths)){let s=r.indexOf("*");if(s===-1){if(t!==r)continue;n.push(...o);continue}let i=r.slice(0,s),a=r.slice(s+1);if(!t.startsWith(i)||!t.endsWith(a)||t.length<i.length+a.length)continue;let c=t.slice(i.length,t.length-a.length);for(let l of o)n.push(l.includes("*")?l.replace("*",c):l)}return n}function Yo(e,t){let n=ts(es(e),t);if(!n)return null;let r=J(e);for(let o of ns(n)){let s=b(e.config.projectRoot,n.pkg.relativeDir,o);for(let i of Rt(s)){let a=I(se(e.config.projectRoot,i));if(r.has(a)||ae(i))return a}}return null}function es(e){return Mo.get(e,()=>mn(e.config.projectRoot))}function ts(e,t){let n=null;for(let r of e){let o=null;t===r.name?o="":t.startsWith(`${r.name}/`)&&(o=t.slice(r.name.length+1)),o!==null&&(!n||r.name.length>n.pkg.name.length)&&(n={pkg:r,subpath:o})}return n}function ns(e){let t=[],n=rs(e.pkg.exports,e.subpath);if(n){let r=os(n);r&&t.push(r)}return t.push(e.subpath?`src/${e.subpath}`:"src/index"),t}function rs(e,t){if(!e||typeof e!="object")return null;let n=t===""?".":`./${t}`;return bn(e[n])}function bn(e){if(typeof e=="string")return e;if(!e||typeof e!="object")return null;let t=e;for(let n of["types","import","default","require","node"]){let r=bn(t[n]);if(r)return r}return null}function os(e){let t=e.replace(/^\.\//,"");return t.startsWith("dist/")?`src/${t.slice(5)}`:null}function ss(e,t){let n=I(T(t));return Do.get(e,n,()=>is(e,n))}function is(e,t){let n=Ao();if(!n)return null;let r=b(e.config.projectRoot),o=b(r,t);for(;o===r||o.startsWith(r+Lo);){for(let i of Oo){let a=P(o,i);if(!ae(a))continue;let c=Eo.get(e,a,()=>as(n,a));if(c)return c}let s=T(o);if(s===o)break;o=s}return null}function as(e,t){try{let n=e.readConfigFile(t,e.sys.readFile);if(n.error||!n.config)return null;let r=e.parseJsonConfigFileContent(n.config,e.sys,T(t)),o=r.options.paths;return!o||Object.keys(o).length===0?null:{baseUrl:r.options.baseUrl?b(T(t),r.options.baseUrl):T(t),paths:o}}catch{return null}}function xe(e,t,n){let r=J(e),o;if(n.startsWith(".")){let s=n.match(/^(\.+)(.*)$/);if(!s)return null;let i=s[1].length,a=s[2].replace(/^\./,""),c=T(P(e.config.projectRoot,t));for(let l=1;l<i;l++)c=T(c);o=a?b(c,a.replace(/\./g,"/")):c}else o=b(e.config.projectRoot,n.replace(/\./g,"/"));for(let s of cs(o)){let i=I(se(e.config.projectRoot,s));if(r.has(i)||ae(s))return i}return null}function H(e,t,n){if(!n)return null;let r=n.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let o=T(P(e.config.projectRoot,t)),s;return r.startsWith("crate::")?s=b(e.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?s=b(o,r.slice(6).replace(/::/g,"/")):s=b(T(o),r.slice(7).replace(/::/g,"/")),Ft(e,ls(s))}function He(e,t,n){let r=T(P(e.config.projectRoot,t)),o=b(r,n);return Ft(e,us(o))}function Je(e,t,n){let r=T(P(e.config.projectRoot,t)),o=[b(r,n),b(e.config.projectRoot,n),b(e.config.projectRoot,"include",n),b(e.config.projectRoot,"src",n)];return Ft(e,o)}function S(e,t,n){let r=J(e),o=t.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),s=o.replace(/\./g,"/"),i=o.split(".").pop()??o;for(let c of n){let l=`${s}${c}`,u=[...r].find(p=>p.endsWith(l));if(u)return u}for(let c of n){let l=[...r].find(u=>fn(u)===`${i}${c}`);if(l)return l}let a=[...r].filter(c=>n.includes(U(c).toLowerCase())).filter(c=>c.includes(`/${s}/`)||c.includes(`/${i}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function Qe(e,t,n){let r=J(e);if(n.startsWith("package:")){let i=n.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),l=I(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let o=T(P(e.config.projectRoot,t)),s=b(o,n);for(let i of ps(s)){let a=I(se(e.config.projectRoot,i));if(r.has(a)||ae(i))return a}return null}function Tt(e,t){let n=t.replace(/-/g,"_").replace(/\./g,"/"),r=J(e);for(let o of ye){let s=`${n}${o}`,i=[...r].find(a=>a.endsWith(s));if(i)return i}for(let o of ye){let s=[...r].find(i=>fn(i)===`${n.split("/").pop()}${o}`);if(s)return s}return null}function cs(e){let t=U(e);return bt.has(t)?[e]:[`${e}.py`,`${e}.pyi`,P(e,"__init__.py"),P(e,"__init__.pyi")]}function Ft(e,t){let n=J(e);for(let r of t){let o=I(se(e.config.projectRoot,r));if(n.has(o)||ae(r))return o}return null}function ls(e){let t=U(e);return Nt.has(t)?[e]:[`${e}.rs`,P(e,"mod.rs")]}function us(e){let t=U(e);return It.has(t)?[e]:[`${e}.rb`,P(e,"index.rb")]}function ps(e){let t=U(e);return Ct.has(t)?[e]:[`${e}.dart`,e]}function Rt(e){let t=U(e),n=new Set;if(t){n.add(e);for(let r of ie)n.add(e.slice(0,-t.length)+r)}else for(let r of ie)n.add(`${e}${r}`),n.add(P(e,`index${r}`));return[...n]}function J(e){return vo.get(e,()=>new Set(Ie(e,{includeIgnored:!1}).map(I)))}function kt(e){return Po.get(e,()=>Ht([...J(e)].sort().join(`
|
|
@@ -124,4 +124,4 @@ ${m}`,l+=1+m.length,u+=at(m),r+=m.length+1}let p=da(c);p&&n.push({...p,start:a,e
|
|
|
124
124
|
${e.symbolNoiseFor("gs")}
|
|
125
125
|
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
126
126
|
ORDER BY d.relative_path, start_line, end_line`,...s)}function tc(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function hr(e,t){return t==="callable"?tc(e):nc(e)}function nc(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function pr(e){let t=new Map;for(let n of e){let r=t.get(n.relative_path);r?r.push(n):t.set(n.relative_path,[n])}return t}function tm(e,t,n={}){if(t.length===0)return[];let r=t.flatMap(o=>Ut(e,o)).filter(o=>!e.isIgnored(o.relativePath));return n.onlyDocumented&&(r=r.filter(o=>o.documentation!==null&&o.documentation!=="")),n.sort&&(r=r.sort((o,s)=>o.relativePath.localeCompare(s.relativePath)||o.startLine-s.startLine||o.endLine-s.endLine)),r.map(o=>({startLine:o.startLine,endLine:o.endLine,symbol:o.symbol,shortName:Kt(o.symbol),signature:cr(lr(o.documentation)),relativePath:o.relativePath,enclosingSymbol:o.enclosingSymbol}))}function rc(e){let t=new Map,n=e.map((r,o)=>({definition:r,index:o,span:r.endLine-r.startLine})).sort((r,o)=>r.span-o.span||r.index-o.index);for(let{definition:r}of n)for(let o=r.startLine;o<=r.endLine;o+=1)t.has(o)||t.set(o,r);return t}function nm(e,t){let n=ur.get(e);return n||(n=rc(e),ur.set(e,n)),n.get(t)??null}function rm(e,t){let n=Ut(e,t.relative_path).find(r=>r.symbolId===t.id);return n?{symbolId:n.symbolId,symbol:n.symbol,documentId:n.documentId,startLine:n.startLine,startChar:n.startChar,endLine:n.endLine,endChar:n.endChar,relativePath:n.relativePath}:{symbolId:t.id,symbol:t.symbol,documentId:t.document_id,startLine:t.start_line,startChar:t.start_char??0,endLine:t.end_line,endChar:t.end_char??0,relativePath:t.relative_path}}function Sr(e,t,n){let r=rt(e).forFile(t,{text:!0}).text,o=gt(e,t);return o?lc(n,o,r):r?oc(n,r):n}function oc(e,t){let n=t.split(/\r?\n/),r=sc(e,n),o=ic(e,r),s=ac(o,n);return cc(e,s)}function sc(e,t){let n=e.some(o=>ot(o.symbol))?hc(t):null,r=new Map;for(let o of e)r.set(o.symbolId,gc(t,n,o));return r}function ic(e,t){return e.filter(n=>ot(n.symbol)).map(n=>({definition:n,startLine:t.get(n.symbolId)??n.startLine})).sort((n,r)=>n.startLine-r.startLine||n.definition.startLine-r.definition.startLine||n.definition.symbol.localeCompare(r.definition.symbol))}function ac(e,t){let n=new Map;for(let r=0;r<e.length;r+=1){let o=e[r],s=e[r+1],i=s?Math.max(o.startLine,s.startLine-1):t.length-1;n.set(o.definition.symbolId,{startLine:o.startLine,endLine:Sc(t,o.definition,o.startLine,i)})}return n}function cc(e,t){return e.map(n=>{let r=t.get(n.symbolId);return r?{...n,startLine:r.startLine,endLine:r.endLine}:n})}function lc(e,t,n=null){let r=new Map;for(let o of t){let s=r.get(o.name);s?s.push(o):r.set(o.name,[o])}return e.map(o=>{if(!dc(o)||!o.leaf)return mr(o,n);let s=r.get(o.leaf);if(!s||s.length===0)return mr(o,n);let i=n?uc(o,s,n):null;if(i)return{...o,startLine:i.startLine,endLine:i.endLine};let a=s[0],c=Math.abs(a.startLine-o.startLine);for(let l=1;l<s.length;l+=1){let u=s[l],p=Math.abs(u.startLine-o.startLine);p<c&&(a=u,c=p)}return{...o,startLine:a.startLine,endLine:a.endLine}})}function uc(e,t,n){let r=pc(e.symbol);if(!r)return null;let o=n.split(/\r?\n/),s=new RegExp(`\\b${te(r)}\\b`);for(let i of t){let a=mc(o,i.startLine);if(a&&s.test(a))return i}return null}function pc(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function mc(e,t){for(let n=t;n>=0;n-=1){let r=e[n]?.trim()??"";if(r){if(/^impl\b/.test(r))return fc(e,n,t);if(/^(?:struct|enum|trait|mod)\b/.test(r))return null}}return null}function fc(e,t,n){let r=[];for(let o=t;o<=n;o+=1){let s=e[o]??"";if(r.push(s),s.includes("{"))break}return r.join(" ")}function dc(e){return ot(e.symbol)?!0:Ae(e.symbol)==="term"&&oe(e.symbol)===null}function mr(e,t){if(!t||!e.leaf||Ae(e.symbol)!=="term"||oe(e.symbol)!==null)return e;let n=te(e.leaf),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${n}\\b`),s=t.split(/\r?\n/).findIndex(i=>r.test(i));return s>=0?{...e,startLine:s,endLine:s}:e}function gc(e,t,n){if(!ot(n.symbol))return n.startLine;let r=Math.max(0,Math.min(n.startLine,e.length-1));if(!t)return r;let o=t.get(n.leaf);if(!o||o.length===0)return r;let s=null;for(let i of o){let a=Math.abs(i-n.startLine);(!s||a<s.distance)&&(s={line:i,distance:a})}return s?.line??r}function hc(e){let t=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,n=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,o=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,i=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let u of c.matchAll(t))u[1]&&i(u[1],a);for(let u of c.matchAll(n))u[1]&&i(u[1],a);let l=c.match(r);l?.[1]&&i(l[1],a);for(let u of c.matchAll(o))u[1]&&i(u[1],a)}return s}function Sc(e,t,n,r){let o=Math.max(n,Math.min(e.length-1,r)),s=Math.max(n,Math.min(o,t.endLine)),i=0,a=0,c=!1;for(let l=n;l<=o;l+=1){let u=yc(e[l]??"");for(let p of u)p==="{"?(i+=1,c=!0):p==="}"?i=Math.max(0,i-1):p==="("?a+=1:p===")"&&(a=Math.max(0,a-1));if(c&&i===0||!c&&a===0&&l>=s)return l}return s}function yc(e){let t="",n=null,r=!1;for(let o=0;o<e.length;o+=1){let s=e[o],i=e[o+1];if(!n&&s==="/"&&i==="/"){t+=" ".repeat(e.length-o);break}if(n){if(r){r=!1,t+=" ";continue}if(s==="\\"){r=!0,t+=" ";continue}s===n&&(n=null),t+=" ";continue}if(s==='"'||s==="'"||s==="`"){n=s,t+=" ";continue}t+=s}return t}function ot(e){return e.includes("().")}function om(e){let t=Xt(e);if("kind"in t)return[];let n=[];for(let r=t.descriptors.length-2;r>=0;r-=1){let o=t.descriptors[r];o?.suffix==="type"&&o.name&&n.push(o.name)}return n}var xc=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function am(e){let t=e.toLowerCase();return xc.some(n=>t.endsWith(n))}import{createRequire as bc}from"module";var yr=bc(import.meta.url),ve,st;function Nc(){if(ve!==void 0)return ve;try{ve=yr("ts-morph")}catch{ve=null}return ve}function um(){if(st)return st;let e=Nc();if(!e)return"ts-morph:unavailable";let t="unknown";try{t=yr("ts-morph/package.json").version??"unknown"}catch{}return st=`ts-morph:${t}:typescript:${e.ts.version}`,st}function pm(e,t){return t.map(n=>({tsconfigPath:n,project:new e.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function mm(e,t,n){return{language:"typescript",availability:()=>({available:!1,reason:e,tsconfigPath:t,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function dm(e,t){let n=new Map(e.map(o=>[o.symbol,o])),r=new Map(e.map(o=>[o.symbolId,[]]));for(let o of t.values())for(let s of o){let i=n.get(s.targetSymbol);i&&r.get(i.symbolId).push(s.location)}for(let[o,s]of r)r.set(o,Ic(s));return r}function gm(e,t,n){let r=br(e,t),o=br(e,n),s=[...r].filter(p=>!o.has(p)).sort(),i=[...o].filter(p=>!r.has(p)).sort(),a=xr(e,t),c=xr(e,n),l=[...a].filter(p=>!c.has(p)).sort(),u=[...c].filter(p=>!a.has(p)).sort();return{passed:s.length===0&&i.length===0,expectedCount:r.size,actualCount:o.size,missing:s,extra:i,callerFiles:{passed:l.length===0&&u.length===0,expectedCount:a.size,actualCount:c.size,missing:l,extra:u}}}function xr(e,t){let n=new Set;for(let r of e)for(let o of t.get(r.symbolId)??[])o.file!==r.relativePath&&n.add(`${r.symbol}\0${o.file}`);return n}function hm(e,t,n){let r=new Set(n),o=new Map(n.map(s=>[s,[]]));for(let s of e)for(let i of t.get(s.symbolId)??[])r.has(i.file)&&o.get(i.file).push({targetSymbol:s.symbol,location:i});for(let[s,i]of o)o.set(s,Cc(i));return o}function br(e,t){let n=new Set;for(let r of e)for(let o of t.get(r.symbolId)??[])n.add(`${r.symbol}\0${o.file}\0${o.line}\0${o.column}`);return n}function Ic(e){let t=new Map;for(let n of e)t.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...t.values()].sort(Nr)}function Cc(e){let t=new Map;for(let n of e){let{location:r}=n;t.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...t.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||Nr(n.location,r.location))}function Nr(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.column-t.column}export{mn as a,Fo as b,ye as c,B as d,z as e,Qr as f,Xr as g,gt as h,Zr as i,Yr as j,ql as k,di as l,tt as m,xp as n,nr as o,rr as p,kp as q,xc as r,am as s,Nc as t,um as u,pm as v,mm as w,dm as x,gm as y,hm as z,rt as A,Ap as B,Op as C,cr as D,lr as E,Wt as F,Gp as G,Ut as H,Zp as I,Za as J,Yp as K,em as L,tm as M,rc as N,nm as O,rm as P,om as Q};
|
|
127
|
-
//# sourceMappingURL=chunk-
|
|
127
|
+
//# sourceMappingURL=chunk-C6WKPKCF.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var s=new Set(["code","outline","refs"]),c=["--symbol","--at","--search","--view","--edge","--direction","--subtype","--connecting","--inventory-only","--fold","--depth","--max-edges"];function d(e){if(e[2]!=="evidence")return;let t=e[3];if(!t||t.startsWith("-"))return;if(e.slice(4).some(i=>c.some(r=>i===r||i.startsWith(`${r}=`)))){e.splice(3,1,"--symbol",t);return}e[2]="evidence-source"}function a(e){return e!==void 0&&s.has(e)}async function p(e){if(e==="continue"){let{outputContinuationCommandDescriptor:n}=await import("./output-continuation-command-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
var s=new Set(["code","outline","refs"]),c=["--symbol","--at","--search","--view","--edge","--direction","--subtype","--connecting","--inventory-only","--fold","--depth","--max-edges"];function d(e){if(e[2]!=="evidence")return;let t=e[3];if(!t||t.startsWith("-"))return;if(e.slice(4).some(i=>c.some(r=>i===r||i.startsWith(`${r}=`)))){e.splice(3,1,"--symbol",t);return}e[2]="evidence-source"}function a(e){return e!==void 0&&s.has(e)}async function p(e){if(e==="continue"){let{outputContinuationCommandDescriptor:n}=await import("./output-continuation-command-5NWVDQT7.js");return[n]}if(e==="__sentinel-ensure-service"){let{sentinelEnsureCommandDescriptor:n}=await import("./sentinel-ensure-command-H66AZ3VE.js");return[n]}if(a(e)){let{directNavigationQueryCommandDescriptors:n}=await import("./direct-navigation-SJMJLBY7.js"),o=n.find(i=>i.id===e);if(!o)throw new Error(`Direct navigation command descriptor is unavailable: ${e}`);return[o]}let{commandDescriptors:t}=await import("./command-descriptors-H6A4UY72.js");return t}export{d as a,a as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-CB5AVJMM.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as O}from"./chunk-P5XHIJHI.js";import{h as H,t as v,v as M}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-P5XHIJHI.js";import{h as H,t as v,v as M}from"./chunk-7GAK2F3H.js";import{execFileSync as U}from"child_process";var L=2e3,S=50,J=64,V=8,W=3,X=2160*60*60,Y=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,Z=3,Q=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,q=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function tt(t){let e=H(t,{clearGroups:["whole-project"]});return(i,n,r)=>{let o=r??P(i.config.projectRoot);if(!o)return null;let s=e.has(i)?e.get(i,()=>({head:"",value:null})):null;return s&&s.head===o?s.value:(e.invalidate(i),e.get(i,()=>({head:o,value:n(i.config.projectRoot,o)})).value)}}function F(t){let e=H(t,{clearGroups:["whole-project"]});return(i,n,r,o)=>{let s=o??P(i.config.projectRoot);if(!s)return null;let c=e.has(i)?e.get(i,()=>({head:"",values:new Map})):null;(!c||c.head!==s)&&e.invalidate(i);let l=e.get(i,()=>({head:s,values:new Map}));if(l.values.has(n))return l.values.get(n)??null;let d=r(i.config.projectRoot,s);return l.values.set(n,d),d}}var et=F("git-commit-history");function nt(t,e={}){let i=e.historyMode??"bounded",n=e.head;return{capability:r=>it(t,r,n),commitHistory:()=>x(t,i,n),fileChurn:()=>st(t,i,n),changeAmplification:()=>at(t,i,n),trackedFiles:()=>lt(t,n),fileAddRecords:()=>dt(t,i,n),coChangePairs:(r={})=>bt(t,r,i,n),coChangePairsForFiles:(r,o={})=>z(t,r,o,i,n),directionalCoChangePairsForFiles:(r,o={})=>yt(t,r,o,i,n)}}function x(t,e="bounded",i){return et(t,y(e),(n,r)=>rt(n,r,e),i)}function it(t,e,i){let n=i??P(t.config.projectRoot);return n?{slot:e,available:!0,head:n}:{slot:e,available:!1,head:null,reason:"git history is unavailable for this project"}}function P(t){try{return C(t,["rev-parse","HEAD"]).trim()||null}catch{return null}}function C(t,e){return U("git",["-C",t,...e],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"})}function rt(t,e,i){let n;try{n=C(t,["log","--no-merges","--name-only",...R(i),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}return{head:e,...w(n,S)}}function ot(t){return Y.test(t.subject)}function st(t,e,i){let n=x(t,e,i);if(!n)return null;let r=new Map;for(let o of n.commits){let s=ot(o);for(let c of o.files){let l=r.get(c)??{changes:0,fixChanges:0,lastChangedAt:0};l.changes+=1,s&&(l.fixChanges+=1),o.timestamp>l.lastChangedAt&&(l.lastChangedAt=o.timestamp),r.set(c,l)}}return r}function at(t,e,i){let n=x(t,e,i);if(!n||n.commits.length===0)return null;let r=n.commits.map(o=>o.files.length).filter(o=>o>0).sort((o,s)=>o-s);return r.length===0?null:{medianFilesPerCommit:D(r,.5),p90FilesPerCommit:D(r,.9),commitsAnalyzed:r.length}}function D(t,e){let i=Math.min(t.length-1,Math.floor(t.length*e));return t[i]}var ct=tt("git-tracked-files");function lt(t,e){return ct(t,i=>{try{let n=C(i,["ls-files"]);return new Set(n.split(`
|
|
2
2
|
`).map(r=>r.trim()).filter(r=>r!==""))}catch{return null}},e)}var ut=F("git-file-adds"),_="__git__/file-adds",k=v({kind:"git-file-adds",invalidation:M("git-file-adds"),serialize:gt,deserialize:ft});function Ot(t){return nt(t).fileAddRecords()}function dt(t,e,i){let n=y(e);return ut(t,n,(r,o)=>mt(t,r,o,e),i)}function mt(t,e,i,n){let r=k.read(t,I(n),i);if(r)return r;let o=ht(e,n);return o&&k.write(t,I(n),i,o),o}function gt(t){return JSON.stringify([...t.entries()])}function ft(t){if(!t)return null;try{let e=JSON.parse(t);if(!Array.isArray(e))return null;let i=new Map;for(let n of e){if(!Array.isArray(n)||n.length!==2||typeof n[0]!="string")return null;let r=n[1];if(!r||typeof r.commitsAgo!="number"||!Number.isFinite(r.commitsAgo)||typeof r.addedAt!="number"||!Number.isFinite(r.addedAt))return null;i.set(n[0],{commitsAgo:r.commitsAgo,addedAt:r.addedAt})}return i}catch{return null}}function ht(t,e){let i;try{i=C(t,["log","--no-merges","--find-renames","--name-status",...R(e),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,r=new Map,o=-1;for(let s of i.split("")){if(s.trim()==="")continue;o+=1;let c=s.indexOf(`
|
|
3
3
|
`),l=c>=0?s.slice(0,c):s,[,d]=l.split("\0"),f=Number(d)||0;if(!(c<0))for(let u of s.slice(c+1).split(`
|
|
4
4
|
`)){let a=pt(u);if(!a)continue;if(a.status==="R"&&a.from&&a.to){let p=r.get(a.to)??new Set([a.to]);r.set(a.from,p);continue}if(a.status!=="A"||!a.to)continue;let m={commitsAgo:o,addedAt:f};n.set(a.to,m);for(let p of r.get(a.to)??[])n.set(p,m)}}return n}function pt(t){let e=t.trim().split(" "),i=e[0]??"";if(!i)return null;let n=i[0]??"";if(n==="R"){let o=e[1],s=e[2];return o&&s?{status:n,from:o,to:s}:null}let r=e[1];return r?{status:n,to:r}:null}var j=F("git-co-change-pairs"),Ct=F("git-directional-co-change-pairs");function bt(t,e,i,n){let r=`all\0${y(i)}\0${T(e)}`,o=j(t,r,()=>{let s=x(t,i,n);return s?G(s,e):null},n);return o&&[...o]}function z(t,e,i,n,r){if(e.size===0)return[];let o=`files\0${y(n)}\0${B(e)}\0${T(i)}`,s=j(t,o,()=>{let c=x(t,n,r);return c?G(c,i,e):null},r);return s&&[...s]}function yt(t,e,i,n,r){if(e.size===0)return[];let o=i.maxFilesPerCommit??S;if(e.size>J)return z(t,e,i,n,r);let s=`directional\0${y(n)}\0${B(e)}\0${T({...i,maxFilesPerCommit:o})}`,c=Ct(t,s,(l,d)=>{let f=At(l,d,e,o,n);return f?G(f,i,e):null},r);return c&&[...c]}function T(t){let e=t.minTogether??4,i=t.minConfidence??.6,n=t.maxFilesPerCommit??S;return`${e}\0${i}\0${n}`}function B(t){return[...t].sort().join("\0")}function G(t,e,i){let{minTogether:n=4,minConfidence:r=.6,maxFilesPerCommit:o=S}=e,s=new Map,c=new Map,l=t.newestAnalyzedAt??0;for(let u of t.commits){let a=[...new Set(u.files)].sort();if(a.length>o)continue;t.newestAnalyzedAt===void 0&&u.timestamp>l&&(l=u.timestamp);let m=Ft(a),p=i===void 0||a.some(g=>i.has(g));for(let g of a)s.set(g,(s.get(g)??0)+1);if(p)for(let g=0;g<a.length;g++)for(let b=g+1;b<a.length;b++){if(i&&!i.has(a[g])&&!i.has(a[b]))continue;let A=`${a[g]}\0${a[b]}`,h=c.get(A)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};h.together+=1,m?h.broadTogether+=1:h.focusedTogether+=1,u.timestamp>h.lastTogetherAt&&(h.lastTogetherAt=u.timestamp),h.timestamps.push(u.timestamp),h.subjects.push(u.subject),c.set(A,h)}}let d=[],f=l-X;for(let[u,a]of c){let m=a.together;if(m<n)continue;let[p,g]=u.split("\0"),b=s.get(p)??m,A=s.get(g)??m,h=Math.max(m/b,m/A);if(h<r)continue;let $=a.broadTogether/m,E=a.timestamps.filter(K=>K>=f).length;d.push({fileA:p,fileB:g,together:m,confidence:h,changesA:b,changesB:A,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:$,lastTogetherAt:a.lastTogetherAt,recentTogether:E,commitScope:Ht(a.broadTogether,m),recency:E>0?"recent":"stale",subjectContext:Pt(a.subjects)})}return d.sort((u,a)=>a.together-u.together||a.confidence-u.confidence||u.fileA.localeCompare(a.fileA)),d}function At(t,e,i,n,r){let o;try{o=xt(t,r)}catch{return null}if(o.length===0)return{head:e,commits:[],skippedBulkCommits:0,newestAnalyzedAt:0};let s;try{s=C(t,["log","--no-merges","--format=%H",...R(r),"--",...[...i].sort()])}catch{return null}let c=new Set(o.map(a=>a.hash)),l=s.split(`
|
|
@@ -6,4 +6,4 @@ import{a as O}from"./chunk-P5XHIJHI.js";import{h as H,t as v,v as M}from"./chunk
|
|
|
6
6
|
`).map(n=>n.trim()).filter(n=>n!=="").map(n=>{let[r,o]=n.split("\0");return{hash:r??"",timestamp:Number(o)||0}}).filter(n=>n.hash!=="")}function R(t){return t==="full"?[]:["-n",String(N())]}function N(){return O(process.env.CODEBASEIQ_GIT_HISTORY_MAX_COMMITS)??L}function y(t){return t==="full"?"full":`bounded:${N()}`}function I(t){let e=y(t);return e===`bounded:${L}`?_:`${_}:${e}`}function St(t,e,i){for(let r=0;r<e.length;r+=20){let o=e.slice(r,r+20),s;try{s=C(t,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...o.map(l=>l.hash)])}catch{return e[0]?.timestamp??0}let c=w(s,i);if(c.commits.length>0)return c.commits[0].timestamp}return 0}function w(t,e){let i=[],n=0;for(let r of t.split("")){if(r.trim()==="")continue;let o=r.indexOf(`
|
|
7
7
|
`),s=o>=0?r.slice(0,o):r,[c,l,d]=s.split("\0");if(!c||!l)continue;let f=o>=0?r.slice(o+1).split(`
|
|
8
8
|
`).map(u=>u.trim()).filter(u=>u!==""):[];if(f.length>e){n+=1;continue}i.push({hash:c,timestamp:Number(l)||0,subject:d??"",files:f})}return{commits:i,skippedBulkCommits:n}}function Ft(t){return t.length>=V?!0:Rt(t).size>=W}function Rt(t){let e=new Set;for(let i of t){let n=i.indexOf("/");e.add(n>=0?i.slice(0,n):".")}return e}function Ht(t,e){return t===0?"focused":t/e>=.5?"broad-sweep":"mixed"}function Pt(t){let e=new Set,i=[],n=[];for(let r of t){!n.includes(r)&&n.length<Z&&n.push(r);for(let o of Tt(r))e.add(o);for(let o of r.match(Q)??[])i.includes(o)||i.push(o)}return{subjectLabels:[...e].sort(),issueRefs:i,sampleSubjects:n,externalIssueLabelStatus:"unavailable"}}function Tt(t){let e=new Set,i=q.exec(t)?.[1]?.toLowerCase();return i&&e.add(Gt(i)),/\b(?:feat|feature)\b/i.test(t)&&e.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(t)&&e.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(t)&&e.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(t)&&e.add("refactor"),/\btests?\b/i.test(t)&&e.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(t)&&e.add("release"),/\bchore\b/i.test(t)&&e.add("chore"),/\bbuild\b/i.test(t)&&e.add("build"),/\bci\b/i.test(t)&&e.add("ci"),/\bperf(?:ormance)?\b/i.test(t)&&e.add("perf"),[...e]}function Gt(t){return t==="feat"?"feature":t}export{nt as a,C as b,Ot as c};
|
|
9
|
-
//# sourceMappingURL=chunk-
|
|
9
|
+
//# sourceMappingURL=chunk-CCIYWXX6.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{H as P,I as ye,a as ae,b as le,d as _,r as U,s as H,t as pe,v as de,w as B,z as me}from"./chunk-
|
|
1
|
+
import{H as P,I as ye,a as ae,b as le,d as _,r as U,s as H,t as pe,v as de,w as B,z as me}from"./chunk-C6WKPKCF.js";import{d as E,e as ue}from"./chunk-DRENNWRG.js";import{q as fe}from"./chunk-5FWR5HLG.js";import{a as ce,e as O}from"./chunk-YT4DVWUV.js";import{a as A,i as x}from"./chunk-R2NOK63J.js";import{aa as se,da as K,h as re}from"./chunk-UQYQBLJX.js";import{existsSync as j}from"fs";import b from"path";var z=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function V(r,t){let e=t?b.dirname(b.join(r,t)):r,o=b.resolve(r);for(;e.startsWith(o);){for(let s of z){let c=b.join(e,s);if(j(c))return c}let i=b.dirname(e);if(i===e)break;e=i}for(let i of z){let s=b.join(r,i);if(j(s))return s}return null}function ge(r){let t=r.config.projectRoot,n=new Set(Ee(t,r.config.semantic?.typescript?.tsconfigs)),e=O(r,{includeIgnored:!1,extensions:U});for(let o of e){let i=V(t,o);i&&n.add(b.resolve(i))}if(n.size===0){let o=V(t);o&&n.add(b.resolve(o))}return[...n].filter(o=>!he(t,o)).sort((o,i)=>o.localeCompare(i))}function Ee(r,t=[]){let n=new Set;for(let e of t){let o=b.isAbsolute(e)?e:b.join(r,e);j(o)&&n.add(b.resolve(o))}for(let e of je(r))for(let o of z){let i=b.join(e,o);j(i)&&n.add(b.resolve(i))}if(n.size===0){let e=V(r);e&&n.add(b.resolve(e))}return[...n].filter(e=>!he(r,e)).sort((e,o)=>e.localeCompare(o))}function je(r){let t=b.join(r,"package.json");if(!j(t))return[];let n;try{n=JSON.parse(re(t,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(o=>le(r,o))}function he(r,t){let n=b.relative(r,t).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as u}from"perf_hooks";function k(r,t,n){if(r.has(t))return r.get(t);let e=n();return r.set(t,e),e}import Ie from"path";import{realpathSync as Se}from"fs";function Ae(r,t){return r.getReferences().map(n=>{let e=n.getNode();return $(e,t)})}function Oe(r){let t=r;return typeof t.findReferences=="function"?t.findReferences():[]}function Me(r,t,n,e){let o=[];for(let i of Oe(r))for(let s of Ae(i,e))s.file===t.relativePath&&s.line>=t.startLine&&s.line<=t.endLine||o.push(s);for(let i of n)o.push(i);return L(o)}function Fe(r,t,n,e){let o=[],i=n?.getStart();for(let s of r.getReferences()){let c=s.getNode();w(e,c.getSourceFile().getFilePath())===t&&(i!==void 0&&c.getStart()===i||o.push({location:$(c,e),node:c}))}return o}function $(r,t){let n=r.getSourceFile(),e=n.getLineAndColumnAtPos(r.getStart());return{file:w(t,n.getFilePath())??n.getBaseName(),line:e.line-1,column:e.column-1}}function q(r,t,n){let e=r.getSourceFile(),o=G(e,r),i=r.getText(),s=new RegExp(`\\b${fe(i)}\\b`,"g"),c=e.getFullText().split(`
|
|
2
2
|
`),a=[];for(let l=0;l<c.length;l++){if(l===o)continue;let f=c[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(f))!==null;)a.push({file:t,line:l,column:p.index})}return L(a.filter(l=>w(n,Ie.join(n,l.file))===t))}function Y(r){for(let t=r;t;t=t.getParent()){let n=t.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function G(r,t){return r.getLineAndColumnAtPos(t.getStart()).line-1}function L(r){let t=new Set,n=[];for(let e of r){let o=`${e.file}:${e.line}:${e.column}`;t.has(o)||(t.add(o),n.push(e))}return n}function w(r,t){let n=r||process.cwd(),e=be(n,t);if(e)return e;try{return be(Se(n),Se(t))}catch{return null}}function be(r,t){let n=Ie.relative(r,t).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function xe(r,t,n,e){let o=Ue(t,e);return o.size===0?new Map:He(r,n,o)}function Ue(r,t){let n=new Map;for(let e of P(r,t)){let o=E(e.symbol)??e.leaf;if(!o)continue;let i=n.get(o);i||(i=[],n.set(o,i)),i.push(e)}return n}function He(r,t,n){let e=new Map,o=new Map;return t.forEachDescendant(i=>{for(let s of Be(r,i)){let c=n.get(s);if(!c)continue;let a=G(t,i);for(let l of c){if(a<l.startLine-1||a>l.endLine+1)continue;let f=Math.abs(a-l.startLine),p=o.get(l.symbolId);p!==void 0&&p<=f||(o.set(l.symbolId,f),e.set(l.symbolId,i))}}}),e}function Be(r,t){let n=[],e=o=>{o&&!n.includes(o)&&n.push(o)};if("getNameNode"in t&&typeof t.getNameNode=="function"){let o=t.getNameNode();e(o?.getText())}if("getName"in t&&typeof t.getName=="function"){let o=t.getName();e(o)}return r.Node.isIdentifier(t)&&e(t.getText()),n}var $e=ce("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ke(r,t,n,e){let o=Q(r,t),i=J(o.get(e)??[],n);if(i)return i;let s=[];for(let c of o.values())for(let a of c)((a.leaf||E(a.symbol)||"").includes(e)||a.symbol.includes(e))&&s.push(a);return J(s,n)}function X(r,t,n,e){return J(Q(r,t).get(e)??[],n)}function Te(r,t){let n=new Map;for(let[e,o]of Q(r,t)){let i=o[0];i&&n.set(e,i)}return n}function Q(r,t){return $e.get(r,t,()=>{let n=new Map;for(let e of P(r,t)){let o=e.leaf||E(e.symbol);if(!o)continue;let i=n.get(o);i||(i=[],n.set(o,i)),i.push({...e,leaf:o})}for(let e of n.values())e.sort((o,i)=>o.startLine-i.startLine||o.endLine-i.endLine||o.symbolId-i.symbolId);return n})}function J(r,t){let n=null,e=Number.POSITIVE_INFINITY;for(let o of r){let i=Math.abs(o.startLine-t);(i<e||i===e&&n&&o.startLine<n.startLine)&&(n=o,e=i)}return n}import We from"path";import{realpathSync as Ke}from"fs";function De(r,t){let n=new Map,e=null,o=null,i=()=>(o??=O(r,{extensions:U}),o),s=()=>(e??=x("typescript.source-file-index",()=>_e(r.config.projectRoot,t,i()),()=>({projects:t.length,indexedDocuments:i().length})),e),c=a=>H(a)?k(n,a,()=>{let l=Ce(r.config.projectRoot,a);if(!l)return null;for(let{project:f,sourceFiles:p}of s()){let d=p.get(l)??null;if(d||(d=f.addSourceFileAtPathIfExists(l)??null,d&&Z(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:a=>c(a)?.sourceFile??null,sourceFileMatch:c,indexedTypeScriptLikeDocuments:i}}function _e(r,t,n){let e=t.map(({project:o})=>{let i=new Map;for(let s of o.getSourceFiles())Z(i,s);return{project:o,sourceFiles:i}});for(let o of n){let i=Ce(r,o);if(i)for(let s of e){if(s.sourceFiles.has(i))break;let c=s.project.addSourceFileAtPathIfExists(i)??null;if(c){Z(s.sourceFiles,c);break}}}return e}function Z(r,t){let n=ee(t.getFilePath());r.set(n,t);try{r.set(ee(Ke(n)),t)}catch(e){if(!K(e))throw e}}function Ce(r,t){try{return ee(se(r,t,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!K(n))throw n;return null}}function ee(r){return We.resolve(r)}function te(r,t){for(let n of r)if(t===n.name||t.startsWith(`${n.name}/`))return n.name;return null}function Ne(r){let t=`${r.relativeDir}/src`;return[`${t}/index.ts`,`${t}/index.tsx`,`${t}/index.mts`,`${t}/index.cts`]}function ne(r,t){try{return r()}catch{t?.();return}}var ze=32;function Yt(r,t){let n=x("typescript.provider.load",()=>pe());if(!n)return B("ts-morph is not installed");let e=x("typescript.provider.tsconfig-discovery",()=>ge(r));if(e.length===0)return B("no tsconfig found");try{let o=x("typescript.provider.project-bundles",()=>de(n,e),()=>({tsconfigs:e.length}));return Ve(r,n,o)}catch(o){return B(o instanceof Error?o.message:String(o),e[0],e)}}function Ve(r,t,n,e={}){return x("typescript.provider.construct",()=>new oe(r,t,n),()=>({tsconfigs:n.length,reusedProjects:e.reusedProjects===!0}))}var oe=class{constructor(t,n,e){this.db=t;this.tsMorph=n;this.projects=e;this.workspacePackages=ae(t.config.projectRoot),this.sourceFiles=De(t,e)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(t=>t.tsconfigPath)}}importUsage(t){return k(this.importUsageCache,t,()=>{let n=this.sourceFiles.sourceFile(t);if(!n)return[];let e=Ye();return x("typescript.import-usage.file",()=>this.importUsageForSourceFile(t,n,e),()=>({file:t,...e}))})}referencesFor(t){return k(this.referencesCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);return this.referencesForDefinitionNode(t,n)})}referencesForDefinitions(t,n={}){let e=new Map,o=A(),i=[];for(let f of t){let p=this.referencesCache.get(f.symbolId);p?e.set(f.symbolId,p):i.push(f)}if(i.length===0)return e;let s=i,c=n.exact?[]:i.filter(f=>!ve(f));if(c.length>=ze){let f=this.referencesForDefinitionsBySymbolScan(c);if(f.incompleteFiles.size===0)for(let p of c){let d=f.references.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}if(s=i.filter(p=>ve(p)),s.length===0)return e}let a=new Map;for(let f of s){let p=a.get(f.relativePath);p?p.push(f):a.set(f.relativePath,[f])}let l=[];for(let[f,p]of a){let d=Pe();x("typescript.references-map.file",()=>{let h=this.definitionNodesForFile(f);for(let m of p){o&&(d.cacheMisses+=1);let I=h.get(m.symbolId)??null;o&&(I?d.nodeHits+=1:d.nodeMisses+=1);try{let g=this.referencesForDefinitionNode(m,I,o?d:void 0);this.referencesCache.set(m.symbolId,g),e.set(m.symbolId,g)}catch{d.preciseSearchFailures+=1,l.push(m)}}},()=>({relativePath:f,definitions:p.length,...Le(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);if(f.incompleteFiles.size===0)for(let p of l){let d=f.references.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}}return e}referenceFragmentsForFiles(t){let n=ye(this.db).filter(s=>H(s.relativePath)),e=t.filter(s=>this.sourceFiles.sourceFile(s)!==null),o=this.referencesForDefinitionsBySymbolScan(n,e),i=e.filter(s=>!o.incompleteFiles.has(s));return me(n,o.references,i)}referencesForDefinitionsBySymbolScan(t,n){let e=A(),o=Pe(),i=new Map,s=new Set,c=new Set(t.map(l=>l.symbolId)),a=new Map(t.map(l=>[l.symbolId,l]));for(let l of t)i.set(l.symbolId,[]);return x("typescript.references-map.inverted-scan",()=>{let l=e?u.now():0,f=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let y of t){let S=f.get(y.symbolId)??[];if(S.length>0){let T=i.get(y.symbolId)??[];T.push(...S),i.set(y.symbolId,T)}e&&(o.packageReferenceCount+=S.length)}e&&(o.packageRefsMs+=u.now()-l);let p=new Map,d=new Map,h=this.hierarchyTargetsForDefinitions(t),m=new Set(t.map(y=>y.leaf).filter(Boolean)),I=e?u.now():0;for(let y of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(y))continue;let S=this.sourceFiles.sourceFile(y);if(!S)continue;e&&(o.scanFiles+=1),this.addReferencesFromSourceFileScan(S,y,c,a,h,m,p,d,i,e?o:void 0)||s.add(y)}e&&(o.scanMs+=u.now()-I);let g=e?u.now():0;this.addHierarchyMemberReferences(t,i,e?o:void 0),e&&(o.hierarchyMs+=u.now()-g);for(let[y,S]of i){let T=L(S);i.set(y,T),e&&(o.referenceCount+=T.length)}},()=>({definitions:t.length,...Le(o)})),{references:i,incompleteFiles:s}}addReferencesFromSourceFileScan(t,n,e,o,i,s,c,a,l,f){let p=this.compilerCheckerForSourceFile(t),d=t.compilerNode,h=Xe(t),m=!0,I=g=>{if(this.tsMorph.ts.isIdentifier(g)){if(f&&(f.identifiers+=1),!s.has(g.text)&&!h.has(g.text)){this.tsMorph.ts.forEachChild(g,I);return}let y=this.compilerReferenceSymbol(p,g,f,()=>{m=!1});if(y){let S;c.has(y)?S=c.get(y)??null:(S=this.referenceDefinitionFromCompilerSymbol(y),c.set(y,S)),f&&(S?f.targetHits+=1:f.targetMisses+=1);let T=k(a,y,()=>this.compilerSymbolKeys(y)),R=null,D=null,v=S&&e.has(S.symbolId)?o.get(S.symbolId):void 0;if(v&&(R=W(d,g),!Re(v,n,R))){let N=d.getLineAndCharacterOfPosition(g.getStart(d));D={file:n,line:N.line,column:N.character};let C=l.get(v.symbolId)??[];C.push(D),l.set(v.symbolId,C),f&&(f.requestedHits+=1)}for(let N of T)for(let C of i.get(N)?.values()??[]){if(R??=W(d,g),Re(C,n,R))continue;if(!D){let F=d.getLineAndCharacterOfPosition(g.getStart(d));D={file:n,line:F.line,column:F.character}}let M=l.get(C.symbolId)??[];M.push(D),l.set(C.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(g,I)};return I(d),m}hierarchyTargetsForDefinitions(t){let n=new Map;for(let e of t){let o=this.nodeForDefinition(e),i=o?.compilerNode;if(!i||!this.isHierarchyMethod(i))continue;let s=i.parent;if(!this.isHierarchyContainer(s))continue;let c=this.compilerCheckerForSourceFile(o.getSourceFile()),a=c.getSymbolAtLocation(i.name);if(a)for(let l of this.hierarchyMemberSymbols(c,s,a))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(e.symbolId,e),n.set(f,p)}}return n}hierarchyMemberSymbols(t,n,e){let o=new Set,i=new Set,s=(c,a,l)=>{if(!i.has(c)){i.add(c),o.add(a);for(let f of l){let p=f.getProperty(e.name);p&&s(f,p,this.hierarchyAncestorTypesForType(t,f))}}};return s(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}addHierarchyMemberReferences(t,n,e){let o=new Map;for(let i of t){let s=this.nodeForDefinition(i),c=s?.compilerNode;if(!c||!this.isHierarchyMethod(c))continue;let a=c.parent;if(!this.isHierarchyContainer(a))continue;let l=this.compilerCheckerForSourceFile(s.getSourceFile()),f=l.getSymbolAtLocation(c.name);if(!f)continue;let p=c.getSourceFile(),d=p.getLineAndCharacterOfPosition(c.name.getStart(p)),h={definition:i,location:{file:i.relativePath,line:d.line,column:d.character}},m=n.get(i.symbolId)??[];for(let g of this.hierarchyMemberSymbols(l,a,f))if(g!==f)for(let y of this.compilerSymbolLocations(g))m.push(y),e&&(e.hierarchyReferences+=1);n.set(i.symbolId,m);let I=this.hierarchyRootMemberSymbols(l,a,f);for(let g of I){let y=o.get(g)??new Map;y.set(i.symbolId,h),o.set(g,y)}e&&(e.hierarchyDefinitions+=1)}for(let i of o.values())if(!(i.size<2)){e&&(e.hierarchyFamilies+=1);for(let{definition:s}of i.values()){let c=n.get(s.symbolId)??[];for(let a of i.values())a.definition.symbolId!==s.symbolId&&(c.push(a.location),e&&(e.hierarchyReferences+=1));n.set(s.symbolId,c)}}}hierarchyRootMemberSymbols(t,n,e){let o=new Set,i=new Set,s=(c,a,l)=>{if(i.has(c))return;i.add(c);let f=!1;for(let p of l){let d=p.getProperty(e.name);d&&(f=!0,s(p,d,this.hierarchyAncestorTypesForType(t,p)))}if(!f)for(let p of this.compilerSymbolKeys(a))o.add(p)};return s(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}compilerSymbolKeys(t){return(t.declarations??[]).map(n=>{let e=n.getSourceFile();return`${e.fileName}\0${n.getStart(e)}\0${t.name}`})}compilerSymbolLocations(t){let n=[];for(let e of t.declarations??[]){let o=e.getSourceFile(),i=w(this.db.config.projectRoot,o.fileName);if(!i)continue;let s=e.name,c=o.getLineAndCharacterOfPosition((s??e).getStart(o));n.push({file:i,line:c.line,column:c.character})}return n}baseTypes(t,n){try{return t.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(t,n){let e=new Set(this.hierarchyAncestorTypesForType(t,t.getTypeAtLocation(n)));for(let o of n.heritageClauses??[])for(let i of o.types)e.add(t.getTypeAtLocation(i));return[...e]}hierarchyAncestorTypesForType(t,n){let e=new Set(this.baseTypes(t,n));for(let o of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(o))for(let i of o.heritageClauses??[])for(let s of i.types)e.add(t.getTypeAtLocation(s));return[...e]}isHierarchyMethod(t){return this.tsMorph.ts.isMethodDeclaration(t)||this.tsMorph.ts.isMethodSignature(t)}isHierarchyContainer(t){return this.tsMorph.ts.isClassDeclaration(t)||this.tsMorph.ts.isClassExpression(t)||this.tsMorph.ts.isInterfaceDeclaration(t)}compilerReferenceSymbol(t,n,e,o){e&&(e.symbolLookups+=1);let i=ne(()=>t.getSymbolAtLocation(n),o);if(i){if((i.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return i;try{return e&&(e.aliasResolutions+=1),t.getAliasedSymbol(i)}catch{return o?.(),i}}}calleesFor(t){if(this.calleesCache.has(t.symbolId))return this.calleesCache.get(t.symbolId)??[];let n=k(this.fileCalleesCache,t.relativePath,()=>this.calleeMapForFile(t.relativePath));if(n.incompleteSymbolIds.has(t.symbolId))throw new Error(`TypeScript callee evidence is incomplete for ${t.symbol}.`);let e=n.callees.get(t.symbolId)??[];return this.calleesCache.set(t.symbolId,e),e}calleesForDefinitions(t){let n=new Map,e=new Map;for(let o of t){if(this.calleesCache.has(o.symbolId)){n.set(o.symbolId,this.calleesCache.get(o.symbolId)??[]);continue}let i=e.get(o.relativePath);i?i.push(o):e.set(o.relativePath,[o])}for(let[o,i]of e){let s=this.fileCalleesCache.get(o),c=new Set(i.map(l=>l.symbolId)),a=s??this.calleeMapForFile(o,c);for(let l of i){if(a.incompleteSymbolIds.has(l.symbolId))continue;let f=a.callees.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(t,n,e){let o=e?u.now():0,i=this.packageImportReferencesForDefinition(t);if(e&&(e.packageRefsMs+=u.now()-o,e.packageReferenceCount+=i.length),!n)return i;let s=e?u.now():0,c=Me(n,t,i,this.db.config.projectRoot);return e&&(e.semanticRefsMs+=u.now()-s,e.referenceCount+=c.length),c}signatureFor(t){return k(this.signatureCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let e=n.getType().getCallSignatures()[0];if(!e)return null;let o=e.getParameters().map(s=>{let c=s.getDeclarations()[0],a=c?s.getTypeAtLocation(c).getText(c):s.getValueDeclaration()?.getType().getText()??"unknown";return we(a)}),i=e.getReturnType().getText(n);return`(${o.join(",")})=>${we(i)}`})}importUsageForSourceFile(t,n,e){let o=[],i=new Map;for(let s of n.getImportDeclarations()){e.declarations+=1;let c=_(this.db,t,s.getModuleSpecifierValue()),a=s.getImportClause()?.isTypeOnly()??!1;for(let l of ie(s)){e.entries+=1;let f=a?null:l.identifier?.getSymbol()?.compilerSymbol??null;!a&&l.identifier&&(f?e.bindingSymbols+=1:e.missingBindingSymbols+=1);let p={sourcePath:c,entry:l,typeOnlyDeclaration:a,bindingSymbol:f,references:[]};if(o.push(p),a||!l.localName||!f)continue;let d=i.get(l.localName);d?d.push(p):i.set(l.localName,[p])}}return i.size>0&&n.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let c=i.get(s.getText());if(!c||Ge(s))return;e.scannedIdentifiers+=1;let a=s.getSymbol()?.compilerSymbol;if(e.symbolLookups+=1,!!a){for(let l of c)if(l.bindingSymbol===a){l.references.push({location:$(s,this.db.config.projectRoot),node:s}),e.matchedReferences+=1;break}}}),o.map(s=>s.typeOnlyDeclaration?qe(t,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(e.fallbackEntries+=1,this.valueImportUsageForEntry(t,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(t,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(t,n,e){let o;try{o=e.identifier?e.identifier.findReferences():[]}catch{let s=e.identifier?q(e.identifier,t,this.db.config.projectRoot):[];return{importer:t,sourcePath:n,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:e.isTypeOnly,isUsed:e.isTypeOnly||s.length>0,isTypeUsed:e.isTypeOnly,isValueUsed:!e.isTypeOnly&&s.length>0,references:s}}let i=[];for(let s of o)for(let c of Fe(s,t,e.identifier,this.db.config.projectRoot))i.push(c);return this.valueImportUsageFromLocations(t,n,e,i)}valueImportUsageFromLocations(t,n,e,o){let i=o.some(a=>!Y(a.node)),s=o.some(a=>Y(a.node)),c=e.isTypeOnly;return{importer:t,sourcePath:n,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:c,isUsed:c||o.length>0,isTypeUsed:c||s,isValueUsed:i,references:o.map(a=>a.location)}}packageImportReferencesForDefinition(t){return this.packageImportReferences().get(t.symbolId)??[]}packageImportReferencesForFiles(t){let n=new Map,e=new Set;for(let i of t){let s=this.sourceFiles.sourceFile(i);if(s)for(let c of s.getImportDeclarations()){let a=te(this.workspacePackages,c.getModuleSpecifierValue());a&&e.add(a)}}if(e.size===0)return n;let o=this.packageExportsForNames(e);for(let i of t)this.addPackageImportReferencesForDocument(n,o,i);for(let[i,s]of n)n.set(i,L(s));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let t=new Map,n=this.packageExports();for(let e of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(t,n,e);for(let[e,o]of t)t.set(e,L(o));return this.packageImportReferenceIndex=t,t}addPackageImportReferencesForDocument(t,n,e){if(this.db.isIgnored(e))return;let o=this.sourceFiles.sourceFileMatch(e);if(o)for(let i of o.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(t,n,e,i)}addPackageImportReferencesForDeclaration(t,n,e,o){let i=te(this.workspacePackages,o.getModuleSpecifierValue());if(!i)return;let s=n.get(i);if(s)for(let c of ie(o)){if(c.kind!=="named"||!c.identifier)continue;let a=s.get(c.importedName);if(!a||a.size===0)continue;let l=q(c.identifier,e,this.db.config.projectRoot);l.length>0&&tt(t,a,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(t=>t.name))),this.packageExportIndex)}packageExportsForNames(t){let n=new Map;for(let e of this.workspacePackages){if(!t.has(e.name))continue;let o=new Map;for(let i of Ne(e))this.collectPackageExports(e,i,o,new Set);o.size>0&&n.set(e.name,o)}return n}collectPackageExports(t,n,e,o){if(o.has(n))return;o.add(n);let i=this.sourceFiles.sourceFile(n);if(i)for(let s of i.getExportDeclarations()){let c=s.getModuleSpecifierValue(),a=c?_(this.db,n,c):n;if(!a||!a.startsWith(`${t.relativeDir}/src/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(t,a,e,o);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,h=this.indexedDefinitionByLeaf(a,p);if(!h)continue;let m=e.get(d);m||(m=new Set,e.set(d,m)),m.add(h.symbolId)}}}indexedDefinitionByLeaf(t,n){return k(this.indexedDefinitionLeafCache,t,()=>Te(this.db,t)).get(n)??null}nodeForDefinition(t){return k(this.definitionNodeCache,t.symbolId,()=>this.definitionNodesForFile(t.relativePath).get(t.symbolId)??null)}definitionNodesForFile(t){return k(this.fileDefinitionNodeCache,t,()=>{let n=this.sourceFiles.sourceFile(t);return n?xe(this.tsMorph,this.db,n,t):new Map})}referenceDefinitionFromCompilerSymbol(t){return this.definitionFromCompilerSymbol(t,void 0,!0)}definitionFromCompilerSymbol(t,n,e=!1){let o=t.name,i=n?u.now():0,s=t.declarations??[];n&&(n.declarationsMs+=u.now()-i,n.declarationChecks+=s.length);for(let c of s){let a=n?u.now():0,l=c.getSourceFile(),f=w(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(c.getStart(l)).line;if(n&&(n.declarationLocationMs+=u.now()-a),!f||this.db.isIgnored(f))continue;let d=n?u.now():0,h=this.compilerDeclarationName(c),m=e?X(this.db,f,p,o)??(h&&h!==o?X(this.db,f,p,h):null):ke(this.db,f,p,o);if(n&&(n.indexedLookupMs+=u.now()-d),m)return{symbolId:m.symbolId,symbol:m.symbol,file:m.relativePath,line:m.startLine}}return null}compilerDeclarationName(t){let n=t.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(t,n){let e=A(),o=0,i=0,s=0,c=0,a=0,l=0,f=0,p=0,d=e?Ze():void 0;return x("typescript.callee-map.file",()=>{let h=e?u.now():0,m=this.sourceFiles.sourceFile(t);if(e&&(a=Math.round(u.now()-h)),!m)return{callees:new Map,incompleteSymbolIds:new Set};let I=e?u.now():0,g=P(this.db,t).sort((M,F)=>M.startLine-F.startLine||F.endLine-M.endLine);if(e&&(l=Math.round(u.now()-I)),o=g.length,g.length===0)return{callees:new Map,incompleteSymbolIds:new Set};let y=new Map,S=new Set,T=e?u.now():0,R=this.compilerCheckerForSourceFile(m),D=m.compilerNode;e&&(f=Math.round(u.now()-T));let v=new Map,N=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){e&&(i+=1);let F=this.semanticCalleeForCallNode(R,D,g,M,v,n,S,d);F&&(e&&(s+=1),Je(y,F.callerId,F.target))}this.tsMorph.ts.forEachChild(M,N)},C=e?u.now():0;N(D),e&&(p=Math.round(u.now()-C));for(let[M,F]of y)y.set(M,nt(F));return c=y.size,{callees:y,incompleteSymbolIds:S}},()=>({relativePath:t,definitions:o,callNodes:i,resolvedCallees:s,outputRows:c,requestedDefinitions:n?.size??o,sourceFileLookupMs:a,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?et(d):{}}))}semanticCalleeForCallNode(t,n,e,o,i,s,c,a){let l=a?u.now():0,f=Qe(e,W(n,o));if(a&&(a.callerLookupMs+=u.now()-l),!f)return null;if(s&&!s.has(f.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let p=o.expression,d=this.compilerSymbolForExpression(t,p,a);d.incomplete&&c?.add(f.symbolId);let h=d.symbol,m=null;if(h)if(a&&(a.targetSymbolHits+=1),i.has(h))a&&(a.compilerSymbolCacheHits+=1),m=i.get(h)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let I=a?u.now():0;m=this.definitionFromCompilerSymbol(h,a),a&&(a.targetLookupMs+=u.now()-I),i.set(h,m)}else a&&(a.targetMisses+=1);return m?{callerId:f.symbolId,target:{symbol:m.symbol,file:m.file,line:m.line,callsiteLine:W(n,o)}}:null}compilerSymbolForExpression(t,n,e){let o=!1,i=e?u.now():0,s=ne(()=>t.getSymbolAtLocation(n),()=>{o=!0});if(e&&(e.expressionSymbolMs+=u.now()-i),s)return{symbol:s,incomplete:!1};e&&(e.typeFallbacks+=1);let c=!1,a=e?u.now():0,l=ne(()=>t.getTypeAtLocation(n).getSymbol(),()=>{c=!0});return e&&(e.typeSymbolMs+=u.now()-a),{symbol:l,incomplete:!l&&(o||c)}}compilerCheckerForSourceFile(t){let n=t.getProject(),e=this.compilerCheckerCache.get(n);return e||(e=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,e)),e}};function ie(r){let t=[],n=r.getDefaultImport();n&&t.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});let e=r.getNamespaceImport();e&&t.push({identifier:e,importedName:"*",localName:e.getText(),kind:"namespace",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});for(let o of r.getNamedImports()){let i=o.getNameNode(),c=o.getAliasNode()??(i.getKindName()==="Identifier"?i:null);t.push({identifier:c,importedName:i.getText(),localName:c?.getText()??i.getText(),kind:"named",isTypeOnly:o.isTypeOnly()||(r.getImportClause()?.isTypeOnly()??!1)})}return t.length===0&&t.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),t}function qe(r,t,n){return{importer:r,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Ye(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function Ge(r){for(let t=r;t;t=t.getParent())if(t.getKindName()==="ImportDeclaration")return!0;return!1}function Je(r,t,n){let e=r.get(t);e||(e=[],r.set(t,e)),e.push(n)}function Xe(r){let t=new Set;for(let n of r.getImportDeclarations())for(let e of ie(n))e.localName&&t.add(e.localName);return t}function Qe(r,t){let n=null;for(let e of r)t<e.startLine||t>e.endLine||(!n||e.startLine>=n.startLine)&&(n=e);return n}function W(r,t){return r.getLineAndCharacterOfPosition(t.getStart(r)).line}function Re(r,t,n){return t===r.relativePath&&n>=r.startLine&&n<=r.endLine}function ve(r){return r.symbol.includes("#")?ue(r.symbol)==="type"&&r.relativePath.endsWith(".d.ts"):!1}function Ze(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function et(r){return{...r,callerLookupMs:Math.round(r.callerLookupMs),expressionSymbolMs:Math.round(r.expressionSymbolMs),typeSymbolMs:Math.round(r.typeSymbolMs),targetLookupMs:Math.round(r.targetLookupMs),declarationsMs:Math.round(r.declarationsMs),declarationLocationMs:Math.round(r.declarationLocationMs),indexedLookupMs:Math.round(r.indexedLookupMs)}}function Pe(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}function Le(r){return{...r,scanMs:Math.round(r.scanMs),packageRefsMs:Math.round(r.packageRefsMs),semanticRefsMs:Math.round(r.semanticRefsMs),hierarchyMs:Math.round(r.hierarchyMs)}}function tt(r,t,n){for(let e of t){let o=r.get(e)??[];o.push(...n),r.set(e,o)}}function nt(r){let t=new Set,n=[];for(let e of r){let o=`${e.symbol}|${e.file}|${e.line}|${e.callsiteLine??""}`;t.has(o)||(t.add(o),n.push(e))}return n}function we(r){return r.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{ge as a,Ee as b,Yt as c,Ve as d};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-CIYA2KZN.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-LMTSB3TB.js";import{h as p}from"./chunk-KLX6NSWT.js";import{a as f}from"./chunk-SGMNWYTH.js";import{d as u,e as _,i as N}from"./chunk-GVAF222T.js";import{p as d}from"./chunk-F74LZWCE.js";import{a as I,z as l}from"./chunk-ICUL7XRT.js";import{w as b}from"./chunk-7GAK2F3H.js";import{c}from"./chunk-UC2FD2PS.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d ON c.document_id = d.id
|
|
@@ -32,4 +32,4 @@ import{a as g}from"./chunk-HIEXRDJF.js";import{h as p}from"./chunk-VCL7FK3E.js";
|
|
|
32
32
|
WHERE imp_d.relative_path = ?
|
|
33
33
|
AND m.role = 2
|
|
34
34
|
ORDER BY def_d.relative_path, gs.symbol`,t).filter(n=>!e.isIgnored(n.importer));if(o.length>0){let n=r.semantic===!1?[]:p(e,t);return o.map(i=>({symbol:i.symbol,shortName:u(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||n.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function E(e,t){let r=p(e,t);return r.length>0?r.map(s=>{let o=y(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function S(e,t){let r=A(t,b(e,t));return d(e,t).map(s=>{let o=y(s.importedName,s.localName,s.kind),n=s.kind==="side-effect"||v(t,s)||r.has(s.localName??s.importedName)?!0:s.used;return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:n}})}function A(e,t){let r=new Set;if(l(e)!=="python")return r;let s=/(?:^|\n)\s*__all__\s*(?:\+?=)\s*[[(]([\s\S]*?)[\])]/g;for(let o of t.matchAll(s)){let n=o[1]??"";for(let i of n.matchAll(/(['"])([A-Za-z_]\w*)\1/g))r.add(i[2])}return r}function v(e,t){if(l(e)!=="rust"||t.used||t.kind==="side-effect")return!1;let r=t.localName??t.importedName;return r==="_"||/^[A-Z]/.test(r)}function y(e,t,r){return r==="namespace"&&e==="*"&&t?`* as ${t}`:r==="default"&&t?`default as ${t}`:r==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function $(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{Y as a,Z as b,G as c};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-CJTKGAGH.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as v}from"./chunk-PHPQ24UG.js";import{e as s,fb as E,kb as V,lb as I}from"./chunk-N3Q3AWGW.js";import{c as y}from"./chunk-XZEE23VG.js";import{aa as h,ka as S,t as w}from"./chunk-W3FK73MD.js";import{l as x}from"./chunk-G2XUZCF2.js";var ce={defaultRole:"repository-observation"};function pe(e,n=[]){return{defaultRole:e,...n.length>0?{rules:n}:{}}}function k(e,n){for(let t of e.rules??[]){if(t.when.kind==="option-present"){let r=n.options[t.when.name];if(r!==void 0&&r!==!1)return t.role;continue}if((t.when.kind==="argument"?n.args[t.when.index]:n.options[t.when.name])===t.when.equals)return t.role}return e.defaultRole}function fe(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(n=>n.role)])]}function A(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}import{AsyncLocalStorage as z}from"async_hooks";var U=1,j=1;var F={policyId:"codebaseiq:unresolved-repository-policy",policyVersion:j,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function N(e){return{schemaVersion:U,origin:e.contract.origin,coverage:$(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:w(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??F,...e.contract.families?{families:e.contract.families}:{}}}function $(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}var W="codebaseiq-result";var G=1,Y=1,_=1,L=1;function M(e){let n=e.resultSchemaVersion??Y;if(!X(n))throw new Error("CLI result schema version must be a positive safe integer.");let{producerVersion:t,...o}=e;return{kind:W,schemaVersion:G,producer:{name:"codebaseiq",version:t},resultSchemaVersion:n,...o}}function J(e,n){return JSON.stringify(e,null,n?0:2)}function X(e){return Number.isSafeInteger(e)&&Number(e)>0}var P=Symbol("option-value-source"),T=new Map,D=new Map,B=new Map,H=new z;function Ie(e,n){return H.run(e,n)}function ke(e){T=new Map(e)}function Ae(e){D=new Map(e)}function Ne(e){B=new Map(e)}function m(e){return(...n)=>{let{args:t,opts:o}=le(n);S(r=>{v(r.generation.identity),e({db:r,args:t,opts:o})})}}function R(e,n){return m(t=>{let o=I(t.db,e,d(t.opts,"full"),{quiet:d(t.opts,"json")});n({...t,budget:o})})}function _e(e){return m(n=>c(n,e,{kind:"list"}))}function Le(e){return m(n=>c(n,e,{kind:"table",headers:e.headers,dashWidths:e.dashWidths}))}function Me(e){return m(n=>c(n,e,{kind:"grouped",key:e.key}))}function Z(e){return m(n=>b(n,e))}function Je(e){return Z({commandName:e.commandName,query:e.query,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(n,t)=>s.sectionedReport(e.sections(n,t)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}function ee(e,n){return R(e,t=>b(t,{...n,commandName:n.commandName??e}))}function Pe(e,n){return ee(e,{commandName:n.commandName??e,query:n.query,emptyMessage:n.emptyMessage,heuristicLabel:n.heuristicLabel,before:n.before,render:(t,o)=>s.sectionedReport(n.sections(t,o)),toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,after:n.after})}function Te(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"list"}))}function De(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"grouped",key:n.key}))}function Be(e,n){return String(e[n])}function He(e,n){let t=e[n];return typeof t=="string"?[t]:Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function Q(e,n){let t=e[n];return typeof t=="number"?t:void 0}function d(e,n){return!!e[n]}function Ke(e,n){let t=e[n];return Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Ue(e,n,t){return Q(e,n)??t}function je(e,n,t){let o=Q(e,n),r=o!==void 0&&ne(e,n)!=="default";if(d(e,"full")){if(r)throw new Error("--full cannot be combined with --limit. Use --full for all findings, or --limit N for a capped report.");return Number.MAX_SAFE_INTEGER}return o??t}function ne(e,n){return e[P]?.(n)}function c(e,n,t){b(e,{commandName:n.commandName,query:n.query,emptyMessage:(o,r)=>o.length===0&&n.emptyMessage?n.emptyMessage(r):void 0,heuristicLabel:n.heuristicLabel,render:(o,r)=>{t.kind==="list"?s.list(o,i=>n.format(i,r)):t.kind==="table"?s.table(t.headers,o.map(i=>n.format(i,r)),t.dashWidths):s.groupedByFile(o,i=>n.format(i,r),t.key?i=>t.key(i,r):void 0)},toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,before:n.before,after:n.after})}function b(e,n){let t=n.query(e);if(d(e.opts,"json")){if(!n.commandName)throw new Error("JSON output requires a command name so its result contract can be identified.");oe(n.commandName,e.args,e.opts,n.toJson?n.toJson(t,e):t,{analysisBudget:te(e),coverage:n.coverage?.(t,e),agentResult:n.agentResult?.(t,e),resultSchemaVersion:n.resultSchemaVersion});return}let o=n.emptyMessage?.(t,e);if(o){s.empty(o);return}n.heuristicLabel&&V(n.heuristicLabel),n.before?.(t,e),n.render(t,e),n.after?.(t,e)}function te(e){return e.budget?.analysisBudget}function oe(e,n,t,o,r={}){let i=T.get(e),a=D.get(e),u=B.get(e),p=a?k(a.operation,{args:n,options:t}):void 0,f=H.getStore();if(f!==void 0&&p!==void 0&&f!==p)throw new Error(`Command ${e} changed operation role during execution: selected ${f}, rendered ${p}.`);let g=f??p,O=de(o),C=r.coverage??ae(a,o,r.analysisBudget),l=C&&O&&!C.resolution?{...C,resolution:O}:C;if(l&&ie(l),d(t,"resultOnly")){let K=Object.hasOwn(r,"resultOnly")?r.resultOnly:o;y(JSON.stringify(K,null,d(t,"compact")?0:2));return}let q=M({producerVersion:x,command:e,...g?{operationRole:g}:{},...i?{evidence:i}:{},...r.analysisBudget?{analysisBudget:r.analysisBudget}:{},args:ue(n),options:t,result:o,...l?{coverage:l}:{},...r.agentResult!==void 0?{agentResult:r.agentResult}:{},...re(g,i,r.analysisBudget,l,u,r.observationReceipt),...r.resultSchemaVersion===void 0?{}:{resultSchemaVersion:r.resultSchemaVersion}});y(J(q,d(t,"compact")))}function re(e,n,t,o,r,i){if(!e||!A(e))return{};let a=h(),u=i??(a?E({projectRoot:a.config.projectRoot,db:a,...r?{observedSourceKinds:r.observedSources}:{}}):void 0);return u?{evidenceContext:{schemaVersion:_,operationRole:e,receipt:u,analysisManifest:{schemaVersion:L,...n?{evidence:n}:{},...t?{analysisBudget:t}:{},...o?{coverage:o}:{},...r?{claimQualification:N({contract:r,receipt:u,...o?{coverage:o}:{}})}:{}}}}:{}}function ie(e){if(!Number.isSafeInteger(e.returned)||e.returned<0)throw new Error("Invocation coverage returned count must be a non-negative safe integer.");if(e.complete!==!0&&e.complete!==!1&&e.complete!==null)throw new Error("Invocation coverage complete must be true, false, or null.");if(e.complete===!0){if(!e.totalKnown)throw new Error("Complete invocation coverage must know its total.");if(!Number.isSafeInteger(e.total)||e.total!==e.returned)throw new Error("Complete invocation coverage total must equal returned.");if(e.omitted!==0)throw new Error("Complete invocation coverage cannot omit results.");if(e.omittedIdentities!==void 0)throw new Error("Complete invocation coverage cannot name omitted identities.");if(e.continuation!==void 0)throw new Error("Complete invocation coverage cannot provide a continuation.")}else if(e.totalKnown){if(e.complete!==!1)throw new Error("Known incomplete invocation coverage must set complete to false.");if(!Number.isSafeInteger(e.total)||e.total<e.returned)throw new Error("Known invocation coverage total must be a safe integer at least as large as returned.");let n=e.total-e.returned;if(e.omitted!==n)throw new Error("Known invocation coverage omitted count must equal total minus returned.");if(n===0)throw new Error("Known incomplete invocation coverage must omit at least one result.");if(e.omittedIdentities&&e.omittedIdentities.length!==n)throw new Error("Omitted identity count must equal the disclosed omitted count.")}else{if(e.total!==void 0||e.omitted!==void 0)throw new Error("Unknown invocation coverage cannot claim a total or omitted count.");if(e.omittedIdentities!==void 0)throw new Error("Unknown invocation coverage cannot claim omitted identities.")}if(e.continuation&&(e.continuation.cursor.length===0||e.continuation.indexGeneration.length===0))throw new Error("Invocation coverage continuation requires a cursor and index generation.");if(e.resolution){if(!Number.isSafeInteger(e.resolution.totalCandidates)||e.resolution.totalCandidates<0)throw new Error("Invocation resolution candidate count must be a non-negative safe integer.");if(e.resolution.state==="exact"&&e.resolution.totalCandidates!==1)throw new Error("Exact invocation resolution must name exactly one candidate.");if(e.resolution.state==="missing"&&e.resolution.totalCandidates!==0)throw new Error("Missing invocation resolution cannot name candidates.");if(e.resolution.state==="ambiguous"&&e.resolution.totalCandidates<2)throw new Error("Ambiguous invocation resolution must name at least two candidates.")}}function ae(e,n,t){if(!e)return;let o=se(e,n);return e.coverage==="complete"?{complete:!0,totalKnown:!0,returned:o,total:o,omitted:0}:e.coverage==="sampled"?{complete:!1,totalKnown:!1,returned:o}:e.coverage==="bounded"&&t?{complete:!1,totalKnown:!1,returned:o}:{complete:null,totalKnown:!1,returned:o}}function se(e,n){let t=e.resultUnits??{kind:"report"};if(t.kind==="rows")return Array.isArray(n)?n.length:0;if(t.kind==="field"){if(!n||typeof n!="object")return 0;let o=n[t.field];return Array.isArray(o)?o.length:o==null?0:1}return n==null?0:1}function de(e){if(!e||typeof e!="object"||Array.isArray(e))return;let n=e;if(n.matched===!1)return{state:"missing",totalCandidates:0};if(n.matched!==!0||!Number.isSafeInteger(n.totalMatches))return;let t=n.totalMatches;return t<=0?{state:"missing",totalCandidates:0}:t===1?{state:"exact",totalCandidates:t}:{state:"ambiguous",totalCandidates:t}}function ue(e){return e.filter(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean")}function le(e){if(e.length===0)return{args:[],opts:{}};let n=e[e.length-1];return{args:e.slice(0,-1),opts:me(n)}}function me(e){if(!e||typeof e!="object")return{};let n=e,t=typeof n.optsWithGlobals=="function"?n.optsWithGlobals.bind(n):typeof n.opts=="function"?n.opts.bind(n):null;if(t){let o=t();return!o||typeof o!="object"?{}:(typeof n.getOptionValueSource=="function"&&Object.defineProperty(o,P,{value:r=>n.getOptionValueSource(r),enumerable:!1}),o)}return e}export{ce as a,pe as b,k as c,fe as d,Ie as e,ke as f,Ae as g,Ne as h,m as i,R as j,_e as k,Le as l,Me as m,Z as n,Je as o,ee as p,Pe as q,Te as r,De as s,Be as t,He as u,Qe as v,qe as w,Q as x,d as y,Ke as z,Ue as A,je as B,ne as C,oe as D,le as E,me as F};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{b as v}from"./chunk-6FXXYYQM.js";import{e as s,fb as E,kb as V,lb as I}from"./chunk-OWJWOEDU.js";import{c as y}from"./chunk-XZEE23VG.js";import{aa as h,ka as S,t as w}from"./chunk-7UCDGXRW.js";import{l as x}from"./chunk-5T44HG5Y.js";var ce={defaultRole:"repository-observation"};function pe(e,n=[]){return{defaultRole:e,...n.length>0?{rules:n}:{}}}function k(e,n){for(let t of e.rules??[]){if(t.when.kind==="option-present"){let r=n.options[t.when.name];if(r!==void 0&&r!==!1)return t.role;continue}if((t.when.kind==="argument"?n.args[t.when.index]:n.options[t.when.name])===t.when.equals)return t.role}return e.defaultRole}function fe(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(n=>n.role)])]}function A(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}import{AsyncLocalStorage as z}from"async_hooks";var U=1,j=1;var F={policyId:"codebaseiq:unresolved-repository-policy",policyVersion:j,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function N(e){return{schemaVersion:U,origin:e.contract.origin,coverage:$(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:w(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??F,...e.contract.families?{families:e.contract.families}:{}}}function $(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}var W="codebaseiq-result";var G=1,Y=1,_=1,L=1;function M(e){let n=e.resultSchemaVersion??Y;if(!X(n))throw new Error("CLI result schema version must be a positive safe integer.");let{producerVersion:t,...o}=e;return{kind:W,schemaVersion:G,producer:{name:"codebaseiq",version:t},resultSchemaVersion:n,...o}}function J(e,n){return JSON.stringify(e,null,n?0:2)}function X(e){return Number.isSafeInteger(e)&&Number(e)>0}var P=Symbol("option-value-source"),T=new Map,D=new Map,B=new Map,H=new z;function Ie(e,n){return H.run(e,n)}function ke(e){T=new Map(e)}function Ae(e){D=new Map(e)}function Ne(e){B=new Map(e)}function m(e){return(...n)=>{let{args:t,opts:o}=le(n);S(r=>{v(r.generation.identity),e({db:r,args:t,opts:o})})}}function R(e,n){return m(t=>{let o=I(t.db,e,d(t.opts,"full"),{quiet:d(t.opts,"json")});n({...t,budget:o})})}function _e(e){return m(n=>c(n,e,{kind:"list"}))}function Le(e){return m(n=>c(n,e,{kind:"table",headers:e.headers,dashWidths:e.dashWidths}))}function Me(e){return m(n=>c(n,e,{kind:"grouped",key:e.key}))}function Z(e){return m(n=>b(n,e))}function Je(e){return Z({commandName:e.commandName,query:e.query,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(n,t)=>s.sectionedReport(e.sections(n,t)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}function ee(e,n){return R(e,t=>b(t,{...n,commandName:n.commandName??e}))}function Pe(e,n){return ee(e,{commandName:n.commandName??e,query:n.query,emptyMessage:n.emptyMessage,heuristicLabel:n.heuristicLabel,before:n.before,render:(t,o)=>s.sectionedReport(n.sections(t,o)),toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,after:n.after})}function Te(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"list"}))}function De(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"grouped",key:n.key}))}function Be(e,n){return String(e[n])}function He(e,n){let t=e[n];return typeof t=="string"?[t]:Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function Q(e,n){let t=e[n];return typeof t=="number"?t:void 0}function d(e,n){return!!e[n]}function Ke(e,n){let t=e[n];return Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Ue(e,n,t){return Q(e,n)??t}function je(e,n,t){let o=Q(e,n),r=o!==void 0&&ne(e,n)!=="default";if(d(e,"full")){if(r)throw new Error("--full cannot be combined with --limit. Use --full for all findings, or --limit N for a capped report.");return Number.MAX_SAFE_INTEGER}return o??t}function ne(e,n){return e[P]?.(n)}function c(e,n,t){b(e,{commandName:n.commandName,query:n.query,emptyMessage:(o,r)=>o.length===0&&n.emptyMessage?n.emptyMessage(r):void 0,heuristicLabel:n.heuristicLabel,render:(o,r)=>{t.kind==="list"?s.list(o,i=>n.format(i,r)):t.kind==="table"?s.table(t.headers,o.map(i=>n.format(i,r)),t.dashWidths):s.groupedByFile(o,i=>n.format(i,r),t.key?i=>t.key(i,r):void 0)},toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,before:n.before,after:n.after})}function b(e,n){let t=n.query(e);if(d(e.opts,"json")){if(!n.commandName)throw new Error("JSON output requires a command name so its result contract can be identified.");oe(n.commandName,e.args,e.opts,n.toJson?n.toJson(t,e):t,{analysisBudget:te(e),coverage:n.coverage?.(t,e),agentResult:n.agentResult?.(t,e),resultSchemaVersion:n.resultSchemaVersion});return}let o=n.emptyMessage?.(t,e);if(o){s.empty(o);return}n.heuristicLabel&&V(n.heuristicLabel),n.before?.(t,e),n.render(t,e),n.after?.(t,e)}function te(e){return e.budget?.analysisBudget}function oe(e,n,t,o,r={}){let i=T.get(e),a=D.get(e),u=B.get(e),p=a?k(a.operation,{args:n,options:t}):void 0,f=H.getStore();if(f!==void 0&&p!==void 0&&f!==p)throw new Error(`Command ${e} changed operation role during execution: selected ${f}, rendered ${p}.`);let g=f??p,O=de(o),C=r.coverage??ae(a,o,r.analysisBudget),l=C&&O&&!C.resolution?{...C,resolution:O}:C;if(l&&ie(l),d(t,"resultOnly")){let K=Object.hasOwn(r,"resultOnly")?r.resultOnly:o;y(JSON.stringify(K,null,d(t,"compact")?0:2));return}let q=M({producerVersion:x,command:e,...g?{operationRole:g}:{},...i?{evidence:i}:{},...r.analysisBudget?{analysisBudget:r.analysisBudget}:{},args:ue(n),options:t,result:o,...l?{coverage:l}:{},...r.agentResult!==void 0?{agentResult:r.agentResult}:{},...re(g,i,r.analysisBudget,l,u,r.observationReceipt),...r.resultSchemaVersion===void 0?{}:{resultSchemaVersion:r.resultSchemaVersion}});y(J(q,d(t,"compact")))}function re(e,n,t,o,r,i){if(!e||!A(e))return{};let a=h(),u=i??(a?E({projectRoot:a.config.projectRoot,db:a,...r?{observedSourceKinds:r.observedSources}:{}}):void 0);return u?{evidenceContext:{schemaVersion:_,operationRole:e,receipt:u,analysisManifest:{schemaVersion:L,...n?{evidence:n}:{},...t?{analysisBudget:t}:{},...o?{coverage:o}:{},...r?{claimQualification:N({contract:r,receipt:u,...o?{coverage:o}:{}})}:{}}}}:{}}function ie(e){if(!Number.isSafeInteger(e.returned)||e.returned<0)throw new Error("Invocation coverage returned count must be a non-negative safe integer.");if(e.complete!==!0&&e.complete!==!1&&e.complete!==null)throw new Error("Invocation coverage complete must be true, false, or null.");if(e.complete===!0){if(!e.totalKnown)throw new Error("Complete invocation coverage must know its total.");if(!Number.isSafeInteger(e.total)||e.total!==e.returned)throw new Error("Complete invocation coverage total must equal returned.");if(e.omitted!==0)throw new Error("Complete invocation coverage cannot omit results.");if(e.omittedIdentities!==void 0)throw new Error("Complete invocation coverage cannot name omitted identities.");if(e.continuation!==void 0)throw new Error("Complete invocation coverage cannot provide a continuation.")}else if(e.totalKnown){if(e.complete!==!1)throw new Error("Known incomplete invocation coverage must set complete to false.");if(!Number.isSafeInteger(e.total)||e.total<e.returned)throw new Error("Known invocation coverage total must be a safe integer at least as large as returned.");let n=e.total-e.returned;if(e.omitted!==n)throw new Error("Known invocation coverage omitted count must equal total minus returned.");if(n===0)throw new Error("Known incomplete invocation coverage must omit at least one result.");if(e.omittedIdentities&&e.omittedIdentities.length!==n)throw new Error("Omitted identity count must equal the disclosed omitted count.")}else{if(e.total!==void 0||e.omitted!==void 0)throw new Error("Unknown invocation coverage cannot claim a total or omitted count.");if(e.omittedIdentities!==void 0)throw new Error("Unknown invocation coverage cannot claim omitted identities.")}if(e.continuation&&(e.continuation.cursor.length===0||e.continuation.indexGeneration.length===0))throw new Error("Invocation coverage continuation requires a cursor and index generation.");if(e.resolution){if(!Number.isSafeInteger(e.resolution.totalCandidates)||e.resolution.totalCandidates<0)throw new Error("Invocation resolution candidate count must be a non-negative safe integer.");if(e.resolution.state==="exact"&&e.resolution.totalCandidates!==1)throw new Error("Exact invocation resolution must name exactly one candidate.");if(e.resolution.state==="missing"&&e.resolution.totalCandidates!==0)throw new Error("Missing invocation resolution cannot name candidates.");if(e.resolution.state==="ambiguous"&&e.resolution.totalCandidates<2)throw new Error("Ambiguous invocation resolution must name at least two candidates.")}}function ae(e,n,t){if(!e)return;let o=se(e,n);return e.coverage==="complete"?{complete:!0,totalKnown:!0,returned:o,total:o,omitted:0}:e.coverage==="sampled"?{complete:!1,totalKnown:!1,returned:o}:e.coverage==="bounded"&&t?{complete:!1,totalKnown:!1,returned:o}:{complete:null,totalKnown:!1,returned:o}}function se(e,n){let t=e.resultUnits??{kind:"report"};if(t.kind==="rows")return Array.isArray(n)?n.length:0;if(t.kind==="field"){if(!n||typeof n!="object")return 0;let o=n[t.field];return Array.isArray(o)?o.length:o==null?0:1}return n==null?0:1}function de(e){if(!e||typeof e!="object"||Array.isArray(e))return;let n=e;if(n.matched===!1)return{state:"missing",totalCandidates:0};if(n.matched!==!0||!Number.isSafeInteger(n.totalMatches))return;let t=n.totalMatches;return t<=0?{state:"missing",totalCandidates:0}:t===1?{state:"exact",totalCandidates:t}:{state:"ambiguous",totalCandidates:t}}function ue(e){return e.filter(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean")}function le(e){if(e.length===0)return{args:[],opts:{}};let n=e[e.length-1];return{args:e.slice(0,-1),opts:me(n)}}function me(e){if(!e||typeof e!="object")return{};let n=e,t=typeof n.optsWithGlobals=="function"?n.optsWithGlobals.bind(n):typeof n.opts=="function"?n.opts.bind(n):null;if(t){let o=t();return!o||typeof o!="object"?{}:(typeof n.getOptionValueSource=="function"&&Object.defineProperty(o,P,{value:r=>n.getOptionValueSource(r),enumerable:!1}),o)}return e}export{ce as a,pe as b,k as c,fe as d,Ie as e,ke as f,Ae as g,Ne as h,m as i,R as j,_e as k,Le as l,Me as m,Z as n,Je as o,ee as p,Pe as q,Te as r,De as s,Be as t,He as u,Qe as v,qe as w,Q as x,d as y,Ke as z,Ue as A,je as B,ne as C,oe as D,le as E,me as F};
|
|
3
|
+
//# sourceMappingURL=chunk-CLPCFGRT.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as Ue}from"./chunk-
|
|
1
|
+
import{a as Ue}from"./chunk-CYJS33YX.js";import{b as xe,c as Se}from"./chunk-ILGTMRMZ.js";import{c as ze}from"./chunk-TJWVT4DO.js";import{d as Te}from"./chunk-BGGB5N53.js";import{i as Be}from"./chunk-GQLDYCWS.js";import{c as We}from"./chunk-BPKNP3KZ.js";import{d as Xe,e as Ke,f as qe}from"./chunk-J7AMBVWF.js";import{a as z}from"./chunk-BRQL7AFJ.js";import{A as $e,d as te,i as oe,t as ge}from"./chunk-GVAF222T.js";import{f as Q}from"./chunk-F74LZWCE.js";import{x as we}from"./chunk-7GAK2F3H.js";var Pe=new Set(["a","an","and","are","as","at","be","become","becomes","by","can","does","for","from","how","in","into","is","it","its","of","on","or","that","the","their","then","this","through","to","what","when","where","which","with"]);function le(e){return e.replace(/([\p{Ll}\d])([\p{Lu}])/gu,"$1 $2").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").match(/[\p{L}\d]+/gu)??[]}function T(e){return new Set(le(e).flatMap(Ie).filter(n=>n.length>=3))}function Ie(e){let n=ve(e);return n.length>4&&n.endsWith("e")?[n,n.slice(0,-1)]:[n]}function ve(e){let n=e.toLocaleLowerCase();return n.length>5&&n.endsWith("ies")?`${n.slice(0,-3)}y`:n.length>4&&n.endsWith("ied")?`${n.slice(0,-3)}y`:n.length>4&&n.endsWith("ed")?je(n.slice(0,-2)):n.length>5&&n.endsWith("ing")?je(n.slice(0,-3)):n.length>4&&n.endsWith("ers")||n.length>3&&n.endsWith("s")&&!n.endsWith("ss")?n.slice(0,-1):n}function je(e){if(e.length<2)return e;let n=e.at(-1),s=e.at(-2);return n===s&&!"aeiou".includes(n)?e.slice(0,-1):e}var He=4,yn=3,fn=12,pn=48,bn=64,J=10,V=6,gn=24,Sn=320,Ee=6,vn=12,An=1,Mn=4,Ln=7,Dn=12,Ne="source-construct:",Cn=96,Rn=32,Ye=4,wn=32,Tn=8;function $t(e,n,s={}){let a=xn(n),r=ft(n);if(a.length===0)throw new Error("Anchor discovery requires at least one non-trivial repository term.");let o=s.limit??He,t=s.full===!0;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`anchor group limit must be a positive safe integer; received ${o}`);let i=new We(e),d=i.scopedDefinitions(s.scope).filter(g=>!oe(g.symbol)),l=[...d],c=new Map(l.map(g=>[g.symbol,g])),m=new Map;for(let g of d)Qe(m,g,a);let u=ze(e,{scope:s.scope});for(let g of u.files){let pe=ge(e,g.relativePath).filter(_=>!oe(_.symbol));if(pe.length===0)continue;let ne=ln(g.text);for(let _=0;_<ne.length;_+=1){let be=T(ne[_]??""),ae=a.filter(O=>be.has(O));if(ae.length===0)continue;let D=$e(pe,_);if(!(!D||oe(D.symbol)))for(let O of ae)de(m,D,O,"source",g.relativePath,_)}}let h=Ve(m),y=[...m.values()].map(g=>Ae(g,h,r)).sort(R),b=In(u.files,y,a),v=-1;for(let g of b){let B=ge(e,g.relativePath),pe=B.filter(D=>!oe(D.symbol)),ne=Q(e,g.relativePath)?.callables??[],_=new Map,be=D=>{let O=`${D.startLine}\0${D.endLine}\0${D.name}`,Y=_.get(O);if(Y)return Y;let N=Pn(g.relativePath,B,D,()=>v--);return N?(_.set(O,N),l.push(N),c.set(N.symbol,N),Qe(m,N,a),N):null};for(let D of ne){let O=T(D.name);a.some(Y=>O.has(Y))&&be(D)}if(ne.length===0)continue;let ae=ln(g.text);for(let D=0;D<ae.length;D+=1){let O=T(ae[D]??""),Y=a.filter(Re=>O.has(Re));if(Y.length===0)continue;let N=En(ne,D),ce=N?be(N):null;if(!ce)continue;let Ge=Ze(pe,D);if(Ze(Ge?[Ge,ce]:[ce],D)?.symbol===ce.symbol)for(let Re of Y)de(m,ce,Re,"source",g.relativePath,D)}}let S=Ve(m),M=new Map(u.files.map(g=>[g.relativePath,g.text.split(/\r?\n/u)]));for(let g of m.values()){let B=M.get(g.definition.relativePath);B&&(g.sourceCharacters=B.slice(g.definition.startLine,g.definition.endLine+1).join(`
|
|
2
2
|
`).length)}let f=[...m.values()].map(g=>Ae(g,S,r)).sort(R),C=Math.min(f.length,Math.max(fn,o*yn)),A=t?f:re([...f.slice(0,C),...[...f].sort(ke).slice(0,Math.max(pn,C)),...ct(f,a),...lt(f,a,S)]),x=A.length,P=A.map(g=>c.get(g.symbol)).filter(g=>g?.isFunctionLike===!0),H=Fn(l),E=kn(e,i,A,P,c,H,new Set(m.keys()),s.semantic!==!1),W=Nn(E,A,m,S,c),F=Gn(W,S,a),K=Zn(e,i,E,m,S,l,c,s.semantic!==!1),L=[...Xn(e,i,W,c,S,s.semantic!==!1),...F,...W,...K].map(g=>({...g,queryPathMatches:mt(g)})).sort((g,B)=>Z(g,B,S)),k=t?L:ut(L,o,S),p=a.filter(g=>S.has(g)),w=a.filter(g=>!S.has(g)),ee=Math.max(0,f.length-x),fe=Math.max(0,L.length-k.length)+ee,hn=t?f.length:Math.min(f.length,o+He);return{query:n,queryPathFragments:r,normalizedTerms:a,matchedTerms:p,unmatchedTerms:w,groups:k,candidateRoots:f,candidateRootCount:f.length,analyzedRootCount:x,omittedRootCount:ee,omittedGroupCount:fe,scannedFiles:u.files.length,scannedBytes:u.scannedBytes,recoveryCommand:fe===0?null:`codebaseiq anchors ${Ce(n)}${s.scope?` --scope ${Ce(s.scope)}`:""} --limit ${hn}`}}function xn(e){let n=le(e).filter(s=>!Pe.has(s.toLocaleLowerCase())).map(ve).filter(s=>s.length>=3&&!Pe.has(s));return[...new Set(n)]}function Qe(e,n,s){let a=T(n.leaf),r=T(n.relativePath),o=T(n.documentation??"");for(let i of s)a.has(i)&&de(e,n,i,"symbol"),r.has(i)&&de(e,n,i,"path"),o.has(i)&&de(e,n,i,"documentation");let t=e.get(n.symbol);t&&(t.symbolPhraseLength=bt(n.leaf,s))}function de(e,n,s,a,r,o){let t=e.get(n.symbol)??{definition:n,matches:new Map,symbolPhraseLength:0},i=t.matches.get(s)??{sources:new Set,locations:new Map};i.sources.add(a),r!==void 0&&o!==void 0&&i.locations.set(`${r}\0${o}`,{file:r,line:o}),t.matches.set(s,i),e.set(n.symbol,t)}function Ve(e){let n=new Map;for(let s of e.values())for(let a of s.matches.keys())n.set(a,(n.get(a)??0)+1);return n}function Pn(e,n,s,a){let r=n[0]?.documentId;if(r===void 0||n.find(i=>i.isFunctionLike&&i.leaf===s.name&&i.startLine===s.startLine&&i.endLine===s.endLine))return null;let t=a();return{documentId:r,symbolId:t,symbol:`${Ne}${e}:${s.startLine}:${s.endLine}:${s.name}`,relativePath:e,startLine:s.startLine,startChar:0,endLine:s.endLine,endChar:0,leaf:s.name,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}}function In(e,n,s){let a=new Set(n.slice(0,Cn).map(t=>t.file)),r=new Set(s),o=e.map(t=>{let i=T(t.relativePath),d=t.relativePath.slice(t.relativePath.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),l=T(d),c=[...i].filter(u=>r.has(u)).length,m=[...l].filter(u=>r.has(u)).length;return{file:t,score:m*4+c}}).filter(t=>t.score>0).sort((t,i)=>i.score-t.score||I(z(t.file.relativePath))-I(z(i.file.relativePath))||t.file.relativePath.localeCompare(i.file.relativePath)).slice(0,Rn);for(let t of o)a.add(t.file.relativePath);return e.filter(t=>a.has(t.relativePath))}function En(e,n){return e.filter(s=>s.startLine<=n&&s.endLine>=n).sort((s,a)=>s.endLine-s.startLine-(a.endLine-a.startLine)||s.startLine-a.startLine)[0]}function Fn(e){let n=new Map;for(let s of e){if(!G(s))continue;let a=`${s.relativePath}\0${$(s.leaf)}`,r=n.get(a)??[];r.push(s),n.set(a,r)}return n}function Ze(e,n){return e.filter(s=>s.startLine<=n&&s.endLine>=n).sort((s,a)=>s.endLine-s.startLine-(a.endLine-a.startLine)||Number(G(a))-Number(G(s))||s.startLine-a.startLine||s.symbol.localeCompare(a.symbol))[0]}function G(e){return e.symbol.startsWith(Ne)}function U(e){return G(e)?e.leaf:te(e.symbol)}function Ae(e,n,s=[]){let a=e.definition,r=[...e.matches.entries()].map(([l,c])=>({term:l,sources:[...c.sources].sort(gt),locations:[...c.locations.values()].sort(un).slice(0,3)})).sort((l,c)=>l.term.localeCompare(c.term)),o=r.filter(l=>l.sources.some(c=>c!=="source")).map(l=>l.term),t=r.filter(l=>l.sources.includes("symbol")).map(l=>l.term),i=r.reduce((l,c)=>l+1/Math.max(1,n.get(c.term)??1),0),d=r.filter(l=>l.sources.includes("symbol")).reduce((l,c)=>l+1/Math.max(1,n.get(c.term)??1),0);return{symbol:a.symbol,label:U(a),leaf:a.leaf,file:a.relativePath,line:a.startLine,endLine:a.endLine,kind:a.isFunctionLike?"callable":a.isTypeLike?"type":"symbol",fileKind:z(a.relativePath),matches:r,focusLocations:At(e,n),matchedTerms:r.map(l=>l.term),symbolMatchedTerms:t,symbolPhraseLength:e.symbolPhraseLength,identityMatchedTerms:o,rarity:i,symbolRarity:d,queryPathMatches:pt(a.relativePath,s),...e.sourceCharacters===void 0?{}:{sourceCharacters:e.sourceCharacters}}}function kn(e,n,s,a,r,o,t,i){let d=a.filter(b=>!G(b)),l=n.calleeMap(d,{additive:!1,semantic:i}),c=new Map,m=new Map;for(let b of s){let v=r.get(b.symbol),S=v?G(v)?Je(e,v,r,o,1):Me(e,v,l.get(v.symbolId)??[],r,1,t):[];c.set(b.symbol,S);for(let M of S){let f=r.get(M.toSymbol);f?.isFunctionLike&&(!v||!G(v)||G(f))&&m.set(f.symbol,f)}}let u=[...m.values()],h=n.calleeMap(u.filter(b=>!G(b)),{additive:!1,semantic:i}),y=new Map;for(let b of u)y.set(b.symbol,G(b)?Je(e,b,r,o,2):Me(e,b,h.get(b.symbolId)??[],r,2,t));return s.map(b=>{let v=c.get(b.symbol)??[],S=v.flatMap(f=>y.get(f.toSymbol)??[]),M=q([...v,...S]);return{root:b,relations:M,nodeSymbols:new Set([b.symbol,...M.flatMap(f=>[f.fromSymbol,f.toSymbol])])}})}function Me(e,n,s,a,r,o=new Set){let t=new Map;for(let i of s){let d=a.get(i.symbol);if(!d?.isFunctionLike||d.symbol===n.symbol||i.source==="ast-callsite"&&!On(e,n,d,i.callsiteLine))continue;let l=t.get(d.symbol);(!l||yt(i,l)<0)&&t.set(d.symbol,i)}return[...t.entries()].map(([i,d])=>{let l=a.get(i);return{kind:"call",fromSymbol:n.symbol,fromLabel:te(n.symbol),fromFile:n.relativePath,toSymbol:l.symbol,toLabel:te(l.symbol),toFile:l.relativePath,depth:r,strength:Oe(d.source),evidence:d.source,callsiteLine:d.callsiteLine??_n(e,n,l)}}).sort((i,d)=>Number(o.has(d.toSymbol))-Number(o.has(i.toSymbol))||X(i,d)).slice(0,bn)}function Je(e,n,s,a,r){let o=Se(e,n.relativePath,n.startLine,n.endLine).targets.flatMap(t=>{let i=s.get(t.definition.symbol)??t.definition;return!i.isFunctionLike||i.symbol===n.symbol?[]:[{kind:"call",fromSymbol:n.symbol,fromLabel:U(n),fromFile:n.relativePath,toSymbol:i.symbol,toLabel:U(i),toFile:i.relativePath,depth:r,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:t.sourceLine}]});for(let t of xe(e,n.relativePath,{ranges:[{startLine:n.startLine,endLine:n.endLine}],excludeIndexedTargets:!1}).targets){let i=[...a.get(`${t.targetFile}\0${$(t.calleeLeaf)}`)??[],...ge(e,t.targetFile).filter(d=>d.isFunctionLike&&$(d.leaf)===t.calleeLeaf)].find(d=>d.startLine===t.targetStartLine&&d.endLine===t.targetEndLine);!i||i.symbol===n.symbol||o.push({kind:"call",fromSymbol:n.symbol,fromLabel:U(n),fromFile:n.relativePath,toSymbol:i.symbol,toLabel:U(i),toFile:i.relativePath,depth:r,strength:t.strength==="exact"?"exact":"derived",evidence:"ast-member-import-candidate",callsiteLine:t.line})}for(let t of Q(e,n.relativePath)?.callSites??[]){if(t.line<n.startLine||t.line>n.endLine||t.memberAccess)continue;let i=(a.get(`${n.relativePath}\0${$(t.calleeLeaf)}`)??[]).filter(l=>l.symbol!==n.symbol);if(i.length!==1)continue;let d=i[0];o.push({kind:"call",fromSymbol:n.symbol,fromLabel:U(n),fromFile:n.relativePath,toSymbol:d.symbol,toLabel:U(d),toFile:d.relativePath,depth:r,strength:"derived",evidence:"ast-callsite",callsiteLine:t.line})}return q(o).sort(X)}function _n(e,n,s){let a=$(s.leaf);return Q(e,n.relativePath)?.callSites.find(r=>r.line>=n.startLine&&r.line<=n.endLine&&$(r.calleeLeaf)===a)?.line??null}function On(e,n,s,a){if(a===void 0)return!1;let r=$(s.leaf);return Q(e,n.relativePath)?.callSites.some(o=>o.line===a&&$(o.calleeLeaf)===r)??!1}function $(e){return e.replace(/^#/u,"").replace(/\(\)$/u,"")}function Nn(e,n,s,a,r){let o=new Map(n.map((c,m)=>[c.symbol,m])),t=n.map((c,m)=>m),i=c=>{let m=c;for(;t[m]!==m;)m=t[m];for(;t[c]!==c;){let u=t[c];t[c]=m,c=u}return m},d=(c,m)=>{let u=i(c),h=i(m);u!==h&&(t[h]=u)};for(let c of e){let m=o.get(c.root.symbol);if(m!==void 0)for(let u of c.nodeSymbols){let h=o.get(u);h!==void 0&&d(m,h)}}let l=new Map;for(let c=0;c<n.length;c+=1){let m=i(c),u=l.get(m)??[];u.push(n[c]),l.set(m,u)}return[...l.values()].map((c,m)=>{let u=new Set(c.map(f=>f.symbol)),h=q(e.filter(f=>u.has(f.root.symbol)).flatMap(f=>f.relations)).sort(X),y=new Map(c.map(f=>[f.symbol,f]));for(let f of new Set(h.flatMap(C=>[C.fromSymbol,C.toSymbol]))){let C=s.get(f);if(C)y.has(f)||y.set(f,Ae(C,a));else{let A=r.get(f);A&&y.set(f,mn(A))}}let b=st(c,h,y),v=c.filter(f=>h.some(C=>C.fromSymbol===f.symbol)).length,S=[...new Set(c.flatMap(f=>f.matchedTerms))].sort(),M=rt(h,b,u,y);return{id:`anchor-set:${m+1}:${ue(c[0])}`,kind:"connected-flow",roots:[...c].sort(R),keyAnchors:b,candidateOwnerCount:b.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[],matchedTerms:S,relations:M,relationCount:h.length,orchestrationRootCount:v,omittedRelations:Math.max(0,h.length-J),systemMapCommand:ye(b,h,S)}})}function Gn(e,n,s){let a=new Map(s.map((o,t)=>[o,t])),r=[];for(let o=0;o<e.length;o+=1){let t=e[o],i=en(t);if(i.size!==0)for(let d=o+1;d<e.length;d+=1){let l=e[d],c=en(l),m=[...i].filter(A=>c.has(A));if(m.length===0||![...i].some(A=>!c.has(A))||![...c].some(A=>!i.has(A)))continue;let u=$n(t,l);if(u.length<2)continue;let h=q([...t.relations,...l.relations]).sort(X),y=h.slice(0,J),b=re([...t.roots,...l.roots]).sort(R),v=[...new Set([...t.matchedTerms,...l.matchedTerms])].sort(),S=m.sort((A,x)=>(a.get(A)??Number.MAX_SAFE_INTEGER)-(a.get(x)??Number.MAX_SAFE_INTEGER)||A.localeCompare(x)),M=+(t.relationCount>0)+ +(l.relationCount>0),f=+((t.orchestrationRootCount??0)>0)+ +((l.orchestrationRootCount??0)>0),C=Math.min(...S.map(A=>n.get(A)??Number.MAX_SAFE_INTEGER));r.push({sharedOrder:Math.min(...S.map(A=>a.get(A)??Number.MAX_SAFE_INTEGER)),sharedFrequency:C,connectedSides:M,orchestrationSides:f,group:{id:`parallel-paths:${ue(t.roots[0])}:${ue(l.roots[0])}`,kind:"parallel-paths",roots:b,keyAnchors:u,candidateOwnerCount:u.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[...t.upstreamEntries,...l.upstreamEntries],matchedTerms:v,relations:y,relationCount:h.length,parallelConnectedSides:M,parallelOrchestrationSides:f,parallelSharedPathTerms:S,parallelSharedPathFrequency:C,orchestrationRootCount:(t.orchestrationRootCount??0)+(l.orchestrationRootCount??0),omittedRelations:Math.max(0,h.length-y.length),systemMapCommand:ye(u,h,v)}})}}return r.sort((o,t)=>o.sharedFrequency-t.sharedFrequency||t.orchestrationSides-o.orchestrationSides||t.connectedSides-o.connectedSides||o.sharedOrder-t.sharedOrder||t.group.matchedTerms.length-o.group.matchedTerms.length||Z(o.group,t.group,n)).slice(0,Dn).map(o=>o.group)}function en(e){return new Set(e.roots.flatMap(n=>n.matches.filter(s=>s.sources.includes("path")).map(s=>s.term)))}function $n(e,n){return re([nn(e),nn(n)].filter(s=>s!==void 0))}function nn(e){let n=new Set(e.keyAnchors.map(a=>a.symbol)),s=new Map;for(let a of e.relations)!n.has(a.fromSymbol)||!n.has(a.toSymbol)||s.set(a.fromSymbol,(s.get(a.fromSymbol)??0)+1);return[...e.keyAnchors].sort((a,r)=>+((s.get(r.symbol)??0)>0)-+((s.get(a.symbol)??0)>0)||tn(r)-tn(a)||r.identityMatchedTerms.length-a.identityMatchedTerms.length||r.symbolMatchedTerms.length-a.symbolMatchedTerms.length||(s.get(r.symbol)??0)-(s.get(a.symbol)??0)||R(a,r))[0]}function tn(e){return e.matchedTerms.length+e.identityMatchedTerms.length*2+(e.queryPathMatches?.length??0)*4}function Xn(e,n,s,a,r,o){let t=Be(e);if(!t||t.links.length===0||s.length<2)return[];let i=new Map(t.observations.map(h=>[h.id,h])),d=new Map,l=new Map,c=[...s].sort((h,y)=>Z(h,y,r)).slice(0,vn),m=t.links.filter(h=>h.strength!=="candidate").sort((h,y)=>j(y.strength)-j(h.strength)||y.matchedKeyParts.length-h.matchedKeyParts.length||h.id.localeCompare(y.id));for(let h of c)for(let y of m){let b=i.get(y.from),v=i.get(y.to);if(!b||!v||!Kn(h,b,a))continue;let S=qn(h,b,a);if(!S)continue;let M=d.get(v.id)??zn(e,n,v,a,o,Mn);if(d.set(v.id,M),M.reachedSymbols.size===0)continue;let f=s.filter(L=>L.id!==h.id&&Wn(L).some(k=>M.reachedSymbols.has(k))&&Fe(S,L)>=2).sort((L,k)=>Fe(S,k)-Fe(S,L)||Z(L,k,r)).slice(0,An);if(f.length===0)continue;let C=[h.id,b.id,...f.map(L=>L.id).sort()].join("\0");if(l.has(C))continue;let A=new Set(f.flatMap(he)),x=Qn(me(v),A,M.relations);if(x.length===0)continue;let P=Yn(b,v,y.joinRule,y.matchedKeyParts,y.strength),H=q([P,...M.relations,...h.relations,...f.flatMap(L=>L.relations)]),E=Vn([P,...x],H,h,f),W=re([S,...f.flatMap(L=>L.roots)]).sort(R),F=re([S,...f.flatMap(L=>L.keyAnchors)]).slice(0,Ln),K=[...new Set([...S.matchedTerms,...f.flatMap(L=>L.matchedTerms)])].sort(),ie=Bn(e,n,S,a,o);W.length===0||F.length<2||l.set(C,{id:`cross-boundary-set:${ue(S)}:${l.size+1}`,kind:"cross-boundary-flow",roots:W,keyAnchors:F,candidateOwnerCount:F.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:ie,matchedTerms:K,relations:E,relationCount:H.length,omittedRelations:Math.max(0,H.length-E.length),systemMapCommand:ye(F,H,K)})}let u=new Map;for(let[h,y]of l){let b=h.slice(0,h.indexOf("\0")),v=u.get(b);(!v||Z(y,v,r)<0)&&u.set(b,y)}return[...u.values()]}function Kn(e,n,s){let a=new Set(he(e));return n.owner.symbol&&a.has(n.owner.symbol)?!0:[...a].map(r=>s.get(r)).some(r=>r?.relativePath===n.source.file&&r.startLine<=n.source.startLine&&r.endLine>=n.source.endLine)}function qn(e,n,s){let a=re([...e.roots,...e.keyAnchors]);if(n.owner.symbol){let r=a.find(o=>o.symbol===n.owner.symbol);if(r)return r}return a.find(r=>{let o=s.get(r.symbol);return o?.relativePath===n.source.file&&o.startLine<=n.source.startLine&&o.endLine>=n.source.endLine})??null}function he(e){return[...new Set([...e.roots.map(n=>n.symbol),...e.keyAnchors.map(n=>n.symbol),...e.relations.flatMap(n=>[n.fromSymbol,n.toSymbol])])]}function Wn(e){return[...new Set([...e.roots,...e.keyAnchors].map(n=>n.symbol))]}function Fe(e,n){let s=T(e.leaf),a=[...n.roots,...n.keyAnchors].map(o=>T(o.leaf)),r=0;for(let o of a){let t=0;for(let i of s)o.has(i)&&(t+=1);r=Math.max(r,t)}return r}function Bn(e,n,s,a,r){let o=a.get(s.symbol);if(!o?.isFunctionLike)return[];let t=n.callerFileMap([o],{semantic:r,sourceFallback:!0}).get(o.symbolId);if(!t)return[];let i=T(s.leaf);return[...t].filter(d=>d!==s.file&&z(d)!=="test").flatMap(d=>{let l=Q(e,d);return(l?.callSites??[]).filter(c=>$(c.calleeLeaf)===$(s.leaf)).flatMap(c=>{let m=(l?.callables??[]).filter(h=>h.startLine<=c.line&&h.endLine>=c.line).sort((h,y)=>h.endLine-h.startLine-(y.endLine-y.startLine)||h.startLine-y.startLine)[0];if(!m)return[];let u=[...T(m.name)].filter(h=>i.has(h)).length;return u>=2?[{name:m.name,file:d,line:m.startLine,endLine:m.endLine,callsiteLine:c.line,overlap:u}]:[]})}).sort((d,l)=>l.overlap-d.overlap||d.file.localeCompare(l.file)||d.line-l.line).slice(0,1).map(({name:d,file:l,line:c,endLine:m,callsiteLine:u})=>({name:d,file:l,line:c,endLine:m,callsiteLine:u}))}function zn(e,n,s,a,r,o){let t=Un(e,s,a),i=t.map(({definition:u,evidence:h,line:y})=>({kind:"call",fromSymbol:me(s),fromLabel:Le(s),fromFile:s.source.file,toSymbol:u.symbol,toLabel:te(u.symbol),toFile:u.relativePath,depth:1,strength:h==="scip-occurrence-callsite"?"exact":"derived",evidence:h,callsiteLine:y})),d=jn(e,s);i.push(...d.relations);let l=dn([...t.map(u=>u.definition),...d.definitions]),c=l,m=new Set(c.map(u=>u.symbol));for(let u=2;u<=o+1&&c.length>0;u+=1){let h=n.calleeMap(c,{additive:!1,semantic:r}),y=new Map;for(let b of c){let v=Me(e,b,h.get(b.symbolId)??[],a,u);i.push(...v);for(let S of v){let M=a.get(S.toSymbol);M?.isFunctionLike&&!m.has(M.symbol)&&y.set(M.symbol,M)}}c=[...y.values()];for(let b of c)m.add(b.symbol)}return{entryDefinitions:l,relations:q(i),reachedSymbols:new Set([...l.map(u=>u.symbol),...i.flatMap(u=>[u.fromSymbol,u.toSymbol])])}}function Un(e,n,s){let a=n.owner.symbol?s.get(n.owner.symbol):void 0;if(a?.isFunctionLike&&!oe(a.symbol))return[{definition:a,evidence:"scip-occurrence-callsite",line:n.source.startLine}];let r=we(e,n.source.file),o=Te(e,n.source.file,0,Math.max(0,r.length-1),[n.source.startLine]),t=Se(e,n.source.file,o.startLine,o.endLine).targets.map(c=>({definition:c.definition,evidence:"scip-occurrence-callsite",line:c.sourceLine})),i=Q(e,n.source.file),d=qe(e),l=(i?.callSites??[]).flatMap(c=>{if(c.line<o.startLine||c.line>o.endLine)return[];let m=Xe(n.source.file,d.get(c.calleeLeaf)??[]),u=Ke(e,n.source.file,m,c.memberAccess,c.calleeQualifier),h=u?s.get(u.symbol):void 0;return h?.isFunctionLike?[{definition:h,evidence:"ast-callsite",line:c.line}]:[]});return Hn([...t,...l])}function jn(e,n){let s=we(e,n.source.file),a=Te(e,n.source.file,0,Math.max(0,s.length-1),[n.source.startLine]),r=xe(e,n.source.file,{ranges:[a],excludeIndexedTargets:!1}).targets,o=[],t=[];for(let i of r){let d=`source-construct:${i.targetFile}:${i.targetStartLine}:${i.targetEndLine}:${i.calleeLeaf}`;t.push({kind:"call",fromSymbol:me(n),fromLabel:Le(n),fromFile:n.source.file,toSymbol:d,toLabel:i.calleeLeaf,toFile:i.targetFile,depth:1,strength:"derived",evidence:"ast-member-import-candidate",callsiteLine:i.line});let l=Se(e,i.targetFile,i.targetStartLine,i.targetEndLine).targets;for(let c of l)o.push(c.definition),t.push({kind:"call",fromSymbol:d,fromLabel:i.calleeLeaf,fromFile:i.targetFile,toSymbol:c.definition.symbol,toLabel:te(c.definition.symbol),toFile:c.definition.relativePath,depth:2,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:c.sourceLine})}return{definitions:dn(o),relations:q(t)}}function Hn(e){return[...new Map(e.map(n=>[n.definition.symbol,n])).values()]}function dn(e){return[...new Map(e.map(n=>[n.symbol,n])).values()]}function me(e){return e.owner.symbol??e.id}function Le(e){return e.owner.name??`${e.source.file}:${e.source.startLine+1}`}function Yn(e,n,s,a,r){return{kind:"runtime-boundary",fromSymbol:me(e),fromLabel:Le(e),fromFile:e.source.file,toSymbol:me(n),toLabel:Le(n),toFile:n.source.file,depth:1,strength:r,evidence:`runtime-boundary:${s}`,callsiteLine:e.source.startLine,runtimeBoundaryKey:a.map(o=>`${o.name}=${o.value}`).join(" ")}}function Qn(e,n,s){let a=new Map;for(let t of s){let i=a.get(t.fromSymbol)??[];i.push(t),a.set(t.fromSymbol,i)}let r=[{symbol:e,path:[]}],o=new Set([e]);for(;r.length>0;){let t=r.shift();if(t.path.length>0&&n.has(t.symbol))return t.path;for(let i of(a.get(t.symbol)??[]).sort(X))o.has(i.toSymbol)||(o.add(i.toSymbol),r.push({symbol:i.toSymbol,path:[...t.path,i]}))}return[]}function Vn(e,n,s,a){let r=q(e),o=new Set([s,...a].flatMap(t=>[...he(t),...t.keyAnchors.map(i=>i.symbol)]));for(let t of n){if(r.length>=J)break;!o.has(t.fromSymbol)&&!o.has(t.toSymbol)||r.some(i=>i.fromSymbol===t.fromSymbol&&i.toSymbol===t.toSymbol)||r.push(t)}return r.slice(0,J)}function Zn(e,n,s,a,r,o,t,i){let d=s.filter(c=>!c.root.symbol.startsWith(Ne)).map(c=>({root:c.root,relations:c.relations.filter(m=>m.depth===1&&m.fromSymbol===c.root.symbol)}));return Jn(d).flatMap((c,m)=>{let u=new Set(c.map(p=>p.root.symbol)),h=new Map;for(let p of c)for(let w of new Set(p.relations.map(ee=>ee.toSymbol)))h.set(w,(h.get(w)??0)+1);let y=[...h].filter(([,p])=>p>=2).sort(([p,w],[ee,fe])=>fe-w||et(p,ee,a,r,t)).map(([p])=>t.get(p)).filter(p=>p?.isFunctionLike===!0).slice(0,gn);if(y.length===0)return[];let b=n.callerFileMap(y,{semantic:i,sourceFallback:!0}),v=new Set;for(let p of y){v.add(p.relativePath);for(let w of b.get(p.symbolId)??[])v.add(w)}let S=o.filter(p=>p.isFunctionLike&&v.has(p.relativePath)).sort(nt).slice(0,Sn),M=n.calleeMap(S,{additive:!1,semantic:i}),f=new Set(y.map(p=>p.symbol)),C=q(S.flatMap(p=>Me(e,p,M.get(p.symbolId)??[],t,1,f).filter(w=>f.has(w.toSymbol)))),A=new Map;for(let p of C){let w=A.get(p.fromSymbol)??new Set;w.add(p.toSymbol),A.set(p.fromSymbol,w)}let x=new Set([...A].filter(([p,w])=>w.size>=2||u.has(p)).map(([p])=>p)),P=C.filter(p=>x.has(p.fromSymbol));if(x.size<2||P.length===0)return[];let E=[...new Set(P.map(p=>p.toSymbol))].map(p=>De(p,a,r,t)).filter(p=>p!==null).sort(R),W=[...x].map(p=>De(p,a,r,t)).filter(p=>p!==null),F=tt(W,P),K=F.slice(0,Ee),ie=F.slice(Ee);if(E.length===0||K.length===0)return[];let L=[...new Set([...E.flatMap(p=>p.matchedTerms),...c.flatMap(p=>p.root.matchedTerms)])].sort(),k=ot(P,K);return[{id:`effect-owner-set:${m+1}:${ue(E[0])}`,kind:"shared-callee-owners",roots:E,keyAnchors:K,candidateOwnerCount:F.length,omittedCandidateOwners:ie,ownerRecoveryCommands:Mt(ie,Ee),upstreamEntries:[],matchedTerms:L,relations:k,relationCount:P.length,omittedRelations:Math.max(0,P.length-k.length),systemMapCommand:ye(K,P,L)}]})}function Jn(e){let n=e.map((t,i)=>i),s=t=>{for(;n[t]!==t;)n[t]=n[n[t]],t=n[t];return t},a=(t,i)=>{let d=s(t),l=s(i);d!==l&&(n[l]=d)},r=e.map(t=>new Set(t.relations.map(i=>i.toSymbol)));for(let t=0;t<e.length;t+=1)for(let i=t+1;i<e.length;i+=1){let d=0;for(let l of r[t]??[])if((r[i]??new Set).has(l)&&(d+=1),d>=2)break;d>=2&&a(t,i)}let o=new Map;for(let t=0;t<e.length;t+=1){let i=s(t),d=o.get(i)??[];d.push(e[t]),o.set(i,d)}return[...o.values()].filter(t=>t.length>=2)}function et(e,n,s,a,r){let o=De(e,s,a,r),t=De(n,s,a,r);return o?t?R(o,t):-1:t?1:e.localeCompare(n)}function nt(e,n){return I(z(e.relativePath))-I(z(n.relativePath))||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine}function De(e,n,s,a){let r=n.get(e);if(r)return Ae(r,s);let o=a.get(e);return o?mn(o):null}function tt(e,n){let s=new Map;for(let r of n){let o=s.get(r.toSymbol)??new Set;o.add(r.fromSymbol),s.set(r.toSymbol,o)}let a=new Map;for(let r of n){let o=s.get(r.toSymbol)?.size??1;a.set(r.fromSymbol,(a.get(r.fromSymbol)??0)+o*o)}return[...e].sort((r,o)=>Number(r.leaf.startsWith("#"))-Number(o.leaf.startsWith("#"))||o.identityMatchedTerms.length-r.identityMatchedTerms.length||(a.get(o.symbol)??0)-(a.get(r.symbol)??0)||R(r,o))}function ot(e,n){let s=new Map(n.map((t,i)=>[t.symbol,i])),a=n.map(t=>e.filter(i=>i.fromSymbol===t.symbol).sort(X)),r=[],o=0;for(;r.length<J&&a.some(t=>o<t.length);){for(let t of a){let i=t[o];if(i&&r.push(i),r.length>=J)break}o+=1}return r.sort((t,i)=>s.get(t.fromSymbol)-s.get(i.fromSymbol)||X(t,i))}function rt(e,n,s,a){let r=new Map(n.map((i,d)=>[i.symbol,d])),o=new Map;for(let i of e)o.set(i.fromSymbol,(o.get(i.fromSymbol)??0)+1);return[...e].sort((i,d)=>{let l=c=>{let m=0;return r.has(c.fromSymbol)&&(m+=100),s.has(c.toSymbol)&&(m+=60),m+=Math.min(40,(o.get(c.toSymbol)??0)*8),(a.get(c.toSymbol)?.matchedTerms.length??0)>0&&(m+=25),c.fromFile!==c.toFile&&(m+=15),c.strength==="exact"&&(m+=5),m};return l(d)-l(i)||X(i,d)}).slice(0,J).sort((i,d)=>(r.get(i.fromSymbol)??V)-(r.get(d.fromSymbol)??V)||i.depth-d.depth||(i.callsiteLine??Number.MAX_SAFE_INTEGER)-(d.callsiteLine??Number.MAX_SAFE_INTEGER)||X(i,d))}function mn(e){return{symbol:e.symbol,label:U(e),leaf:e.leaf,file:e.relativePath,line:e.startLine,endLine:e.endLine,kind:e.isFunctionLike?"callable":e.isTypeLike?"type":"symbol",fileKind:z(e.relativePath),matches:[],focusLocations:[],matchedTerms:[],symbolMatchedTerms:[],symbolPhraseLength:0,identityMatchedTerms:[],rarity:0,symbolRarity:0}}function st(e,n,s){let a=[...e].sort(R),r=[],o=new Map;for(let c of n)o.set(c.fromSymbol,(o.get(c.fromSymbol)??0)+1);let t=new Set,i=new Set,d=c=>{if(!(!c||r.some(m=>m.symbol===c.symbol))){r.push(c);for(let m of c.matchedTerms)t.add(m);for(let m of c.symbolMatchedTerms)i.add(m)}},l=a.filter(c=>c.symbolPhraseLength>=2&&(o.get(c.symbol)??0)>=2);for(;r.length<Math.min(2,V);){let c=l.filter(m=>!r.some(u=>u.symbol===m.symbol)).sort((m,u)=>u.symbolMatchedTerms.filter(h=>!i.has(h)).length-m.symbolMatchedTerms.filter(h=>!i.has(h)).length||u.symbolPhraseLength-m.symbolPhraseLength||(o.get(u.symbol)??0)-(o.get(m.symbol)??0)||ke(m,u))[0];if(!c||r.length>0&&c.symbolMatchedTerms.every(m=>i.has(m)))break;d(c)}if(d(a[0]),r.length>=2){let c=it(r[0].symbol,r[1].symbol,n,s);for(let m of c?.slice(1,-1)??[]){if(r.length>=V)break;d(s.get(m))}if(r.length<V){let m=new Set(r.map(y=>y.symbol)),u=new Set(n.filter(y=>y.depth===1&&m.has(y.fromSymbol)&&m.has(y.toSymbol)).map(y=>y.fromSymbol)),h=n.filter(y=>y.depth===1&&u.has(y.fromSymbol)&&!m.has(y.toSymbol)).map(y=>({relation:y,candidate:s.get(y.toSymbol)})).filter(y=>y.candidate!==void 0&&y.candidate.symbolPhraseLength>=2&&y.candidate.symbolMatchedTerms.length>=2).sort((y,b)=>(o.get(y.relation.fromSymbol)??0)-(o.get(b.relation.fromSymbol)??0)||ke(y.candidate,b.candidate))[0]?.candidate;d(h)}}else for(;r.length<Math.min(3,V);){let c=a.filter(m=>!r.some(u=>u.symbol===m.symbol)).sort((m,u)=>u.matchedTerms.filter(h=>!t.has(h)).length-m.matchedTerms.filter(h=>!t.has(h)).length||R(m,u))[0];if(!c||c.matchedTerms.every(m=>t.has(m)))break;d(c)}for(;r.length>=2&&r.length<V;){let c=new Set(r.map(u=>u.symbol)),m=[...s.values()].filter(u=>!c.has(u.symbol)&&(o.get(u.symbol)??0)>0&&n.some(h=>c.has(h.fromSymbol)&&h.toSymbol===u.symbol)).sort((u,h)=>h.identityMatchedTerms.length-u.identityMatchedTerms.length||h.symbolMatchedTerms.length-u.symbolMatchedTerms.length||h.matchedTerms.length-u.matchedTerms.length||(o.get(h.symbol)??0)-(o.get(u.symbol)??0)||R(u,h))[0];if(!m)break;d(m)}if(r.length<2){let c=r[0],m=c?a.filter(u=>u.symbol!==c.symbol).map(u=>({root:u,path:at(u.symbol,c.symbol,n)})).filter(u=>u.path!==null).sort((u,h)=>+(h.root.file!==c.file)-+(u.root.file!==c.file)||u.path.length-h.path.length||R(u.root,h.root))[0]?.root:void 0;d(m)}return r}function it(e,n,s,a){let r=new Map;for(let i of s){let d=r.get(i.fromSymbol)??new Set;d.add(i.toSymbol),r.set(i.fromSymbol,d);let l=r.get(i.toSymbol)??new Set;l.add(i.fromSymbol),r.set(i.toSymbol,l)}let o=[{path:[e],cost:0}],t=new Map([[e,0]]);for(;o.length>0;){o.sort((c,m)=>c.cost-m.cost||c.path.length-m.path.length);let{path:i,cost:d}=o.shift(),l=i.at(-1);if(l===n)return i;for(let c of r.get(l)??[]){let m=a.get(c),u=c===n?1:!m||m.matchedTerms.length===0?9:m.symbolPhraseLength>=2?1:m.identityMatchedTerms.length>=2?2:4,h=d+u;h>=(t.get(c)??Number.POSITIVE_INFINITY)||(t.set(c,h),o.push({path:[...i,c],cost:h}))}}return null}function at(e,n,s){let a=new Map;for(let t of s){let i=a.get(t.fromSymbol)??[];i.push(t.toSymbol),a.set(t.fromSymbol,i)}let r=[[e]],o=new Set([e]);for(;r.length>0;){let t=r.shift(),i=t.at(-1);if(i===n)return t;for(let d of a.get(i)??[])o.has(d)||(o.add(d),r.push([...t,d]))}return null}function R(e,n){return(n.queryPathMatches?.length??0)-(e.queryPathMatches?.length??0)||n.identityMatchedTerms.length-e.identityMatchedTerms.length||n.matchedTerms.length-e.matchedTerms.length||n.rarity-e.rarity||se(e.kind)-se(n.kind)||I(e.fileKind)-I(n.fileKind)||e.file.localeCompare(n.file)||e.line-n.line}function ke(e,n){return n.symbolPhraseLength-e.symbolPhraseLength||n.symbolMatchedTerms.length-e.symbolMatchedTerms.length||se(e.kind)-se(n.kind)||n.symbolRarity-e.symbolRarity||R(e,n)}function ct(e,n){return n.flatMap(s=>{let a=e.filter(t=>t.matchedTerms.includes(s)).sort((t,i)=>dt(t,i,s)),r=[],o=new Set;for(let t of a)if(!o.has(t.file)&&(r.push(t),o.add(t.file),r.length>=Ye))return r;for(let t of a)if(!r.some(i=>i.symbol===t.symbol)&&(r.push(t),r.length>=Ye))break;return r})}function lt(e,n,s){let a=new Set(n),r=new Map;for(let o of e){if(o.kind!=="callable")continue;let t=o.file.slice(o.file.lastIndexOf("/")+1).replace(/\.[^.]+$/u,"");if(![...T(t)].some(d=>a.has(d)))continue;let i=r.get(o.file)??[];i.push(o),r.set(o.file,i)}return[...r.entries()].map(([o,t])=>{let i=o.slice(o.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),d=[...T(i)].filter(l=>a.has(l));return{file:o,fileCandidates:t,sharedFrequency:Math.min(...d.map(l=>s.get(l)??Number.MAX_SAFE_INTEGER))}}).sort((o,t)=>I(o.fileCandidates[0].fileKind)-I(t.fileCandidates[0].fileKind)||o.sharedFrequency-t.sharedFrequency||o.file.localeCompare(t.file)).flatMap(({fileCandidates:o})=>[...o].sort(R).slice(0,Tn)).slice(0,wn)}function dt(e,n,s){return on(e,s)-on(n,s)||I(e.fileKind)-I(n.fileKind)||n.symbolPhraseLength-e.symbolPhraseLength||se(e.kind)-se(n.kind)||R(e,n)}function on(e,n){let s=e.matches.find(a=>a.term===n)?.sources??[];return Math.min(...s.map(_e),Number.MAX_SAFE_INTEGER)}function re(e){return[...new Map(e.map(n=>[n.symbol,n])).values()]}function Z(e,n,s){let a=new Set(e.roots.flatMap(o=>o.symbolMatchedTerms)),r=new Set(n.roots.flatMap(o=>o.symbolMatchedTerms));return(n.queryPathMatches?.length??0)-(e.queryPathMatches?.length??0)||cn(e.kind)-cn(n.kind)||sn(e)-sn(n)||an(e)-an(n)||(e.kind==="parallel-paths"&&n.kind==="parallel-paths"?(e.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)-(n.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)||(n.parallelOrchestrationSides??0)-(e.parallelOrchestrationSides??0)||(n.parallelSharedPathTerms?.length??0)-(e.parallelSharedPathTerms?.length??0):0)||rn(n,s)-rn(e,s)||n.matchedTerms.length-e.matchedTerms.length||Math.max(...n.roots.map(o=>o.symbolPhraseLength))-Math.max(...e.roots.map(o=>o.symbolPhraseLength))||r.size-a.size||R(e.roots[0],n.roots[0])||n.roots.length-e.roots.length||e.relationCount-n.relationCount||e.id.localeCompare(n.id)}function rn(e,n){return e.matchedTerms.reduce((s,a)=>s+1/Math.max(1,n.get(a)??1),0)}function mt(e){return[...new Set(e.roots.flatMap(n=>n.queryPathMatches??[]))].sort()}function sn(e){let n=e.keyAnchors.length>0?e.keyAnchors:e.roots;return Math.max(...n.map(s=>I(s.fileKind)))}function an(e){return e.kind==="parallel-paths"?2-(e.parallelConnectedSides??0):e.kind!=="connected-flow"||e.relationCount>0?0:1}function ut(e,n,s){let a=e.slice(0,n);if(n<2||a.some(o=>o.kind==="shared-callee-owners"))return a;let r=e.filter(o=>o.kind==="shared-callee-owners");for(let o of a){if(o.kind==="shared-callee-owners"||o.kind==="parallel-paths")continue;let t=new Set(he(o)),i=r.map(l=>({group:l,overlap:ht(l,t)})).filter(({overlap:l})=>l>0).sort(({group:l,overlap:c},{group:m,overlap:u})=>u-c||Z(l,m,s))[0]?.group;if(!i)continue;let d=a.length-1;for(;d>=0&&a[d]===o;)d-=1;return d<0?a:(a[d]=i,[...a].sort((l,c)=>Z(l,c,s)))}return a}function ht(e,n){return he(e).filter(s=>n.has(s)).length}function cn(e){switch(e){case"cross-boundary-flow":return 0;case"parallel-paths":case"connected-flow":return 1;case"shared-callee-owners":return 2}}function X(e,n){return e.depth-n.depth||j(n.strength)-j(e.strength)||e.fromLabel.localeCompare(n.fromLabel)||e.toLabel.localeCompare(n.toLabel)||(e.callsiteLine??Number.MAX_SAFE_INTEGER)-(n.callsiteLine??Number.MAX_SAFE_INTEGER)}function yt(e,n){return j(Oe(n.source))-j(Oe(e.source))||(e.callsiteLine??Number.MAX_SAFE_INTEGER)-(n.callsiteLine??Number.MAX_SAFE_INTEGER)||e.symbol.localeCompare(n.symbol)}function q(e){let n=new Map;for(let s of e){let a=`${s.fromSymbol}\0${s.toSymbol}`,r=n.get(a);(!r||X(s,r)<0)&&n.set(a,s)}return[...n.values()]}function ft(e){let n=e.match(/[\p{L}\d_.-]+(?:\/[\p{L}\d_.-]+)+/gu)??[];return[...new Set(n.map(s=>s.replace(/[.;:!?]+$/gu,"").toLocaleLowerCase()))]}function pt(e,n){let s=e.replace(/\\/gu,"/").toLocaleLowerCase();return n.filter(a=>{let r=s.indexOf(a);if(r<0)return!1;let o=r===0?"/":s[r-1],t=s[r+a.length];return o==="/"&&(t===void 0||t==="/")})}function bt(e,n){let s=le(e).map(ve),a=0;for(let r=0;r<s.length;r+=1)for(let o=0;o<n.length;o+=1){let t=0;for(;r+t<s.length&&o+t<n.length&&s[r+t]===n[o+t];)t+=1;a=Math.max(a,t)}return a}function ln(e){if(e.length===0)return[];let n=e.split(`
|
|
3
3
|
`);return e.endsWith(`
|
|
4
4
|
`)&&n.pop(),n}function gt(e,n){return _e(e)-_e(n)}function _e(e){switch(e){case"symbol":return 0;case"path":return 1;case"documentation":return 2;case"source":return 3}}function se(e){return e==="callable"?0:e==="type"?1:2}function I(e){switch(e){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function Oe(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function j(e){return e==="exact"?2:1}function un(e,n){return e.file.localeCompare(n.file)||e.line-n.line}function ue(e){return`${e.file}:${e.line+1}`}function ye(e,n=[],s=[]){let a=e.map(t=>`--symbol ${Ce(`${t.file}:${t.line+1}-${t.endLine+1}`)}`),r=new Set(e.map(t=>t.symbol)),o=e.flatMap(t=>(t.sourceCharacters??0)>Ue?St(t,n,s,r).map(i=>`--focus-at ${Ce(`${i.file}:${i.line+1}`)}`):[]);return`codebaseiq system-map ${[...a,...o,"--relation call","--relation runtime-boundary"].join(" ")}`}function St(e,n,s,a){let r=new Set(s),o=n.filter(l=>l.fromSymbol===e.symbol&&l.callsiteLine!==null&&l.callsiteLine>=e.line&&l.callsiteLine<=e.endLine).map(l=>({file:e.file,line:l.callsiteLine,connectsAnchor:a.has(l.toSymbol),overlap:new Set(le(vt(l.toLabel)).flatMap(Ie).filter(c=>r.has(c))).size,strength:l.strength})).filter(l=>l.overlap>0).sort((l,c)=>Number(c.connectsAnchor)-Number(l.connectsAnchor)||c.overlap-l.overlap||l.line-c.line||j(c.strength)-j(l.strength)),t=o.filter(l=>l.connectsAnchor),i=[...t.length>0?t:o,...t.length>0?[]:e.focusLocations.map(l=>({...l,connectsAnchor:!1,overlap:0,strength:"derived"}))],d=[];for(let l of i)if(!d.some(c=>c.file===l.file&&c.line===l.line)&&(d.push({file:l.file,line:l.line}),d.length>=3))break;return d}function vt(e){return e.slice(Math.max(e.lastIndexOf(":"),e.lastIndexOf("."))+1)}function At(e,n){let s=new Map;for(let[o,t]of e.matches)for(let i of t.locations.values()){if(i.file!==e.definition.relativePath||i.line<e.definition.startLine||i.line>e.definition.endLine)continue;let d=`${i.file}\0${i.line}`,l=s.get(d)??{...i,matchedTerms:new Set};l.matchedTerms.add(o),s.set(d,l)}let a=[...s.values()].sort((o,t)=>t.matchedTerms.size-o.matchedTerms.size||[...t.matchedTerms].reduce((i,d)=>i+1/Math.max(1,n.get(d)??1),0)-[...o.matchedTerms].reduce((i,d)=>i+1/Math.max(1,n.get(d)??1),0)||un(o,t)),r=[];for(let o of a)if(!r.some(t=>t.file===o.file&&Math.abs(t.line-o.line)<8)&&(r.push(o),r.length>=3))break;return r.map(o=>({file:o.file,line:o.line,matchedTerms:[...o.matchedTerms].sort()}))}function Mt(e,n){let s=[];for(let a=0;a<e.length;a+=n)s.push(ye(e.slice(a,a+n)));return s}function Ce(e){return`'${e.replaceAll("'",`'"'"'`)}'`}export{$t as a,xn as b};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-CSPDQLLU.js.map
|