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,3 +1,3 @@
|
|
|
1
|
-
import{a as de}from"./chunk-4AOOSCZ7.js";import{b as ue}from"./chunk-B75HZHUP.js";import{c as I}from"./chunk-NK76RSB6.js";import{a as le}from"./chunk-OJFLPVBP.js";import{k as ce}from"./chunk-VCL7FK3E.js";import{c as ae}from"./chunk-57KEZDPT.js";import{i as oe}from"./chunk-BH5CE4LN.js";import{a as ie,b as re,c as se}from"./chunk-ELNRLMC5.js";import{e as ee,f as te,h as ne}from"./chunk-JN5LIBT3.js";import{a as Q}from"./chunk-ZOEDRCR4.js";import{C as S,d as Z,e as $,g as G,h as J,i as q,j as V,k as K,s as X,x as Y}from"./chunk-AM5SUGHF.js";import{p as H}from"./chunk-JOALNFY3.js";import{C as x,a as L,z}from"./chunk-RVYLJDXC.js";import{f as w,l as B,t as U,v as j,w as P,x as W}from"./chunk-PLZXWZHY.js";import{d as y}from"./chunk-3LCDIREB.js";import{d as D}from"./chunk-327YK6TB.js";var _=new WeakMap,me=U({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:Ne});function pe(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let i=P(e,t);if(!i)return[];let o=B(e,t,i),c=me.read(e,t,o);if(c)return c;let u=n==="rust"?Ue(e,t):Fe(e,t);return me.write(e,t,o,u),u}function Ne(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(Te);return n.some(s=>s===null)?null:n}catch{return null}}function Te(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"||t.containerName!==void 0&&typeof t.containerName!="string")return null;let n=t.disposition===void 0?Xe(t.reason):t.disposition;return n!=="exclude"&&n!=="implicit-usage"?null:{startLine:t.startLine,endLine:t.endLine,reason:t.reason,disposition:n,...t.containerName?{containerName:t.containerName}:{}}}var be=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),ke=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Ae=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Fe(e,t){let n=P(e,t);if(!n||!Me(n))return[];let s=x(e,t);if(!s)return[];let i=_.get(s);if(i)return i;let o=!1,c=s.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let r=d.namedChild(0);if(!r)continue;let a=r.type==="member_expression"?r.namedChild(r.namedChildCount-1)?.text:r.text;if(a&&be.has(a)){o=!0;break}}let u=[];o&&u.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)",disposition:"exclude"});for(let l of c.namedChildren){let d=null,r=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,r=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,r=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let p=a.namedChild(0)?.text,f=a.namedChild(1);p&&(f?.type==="arrow_function"||f?.type==="function_expression")&&(d=p,r=a)}}d&&/^use[A-Z]/.test(d)&&r&&u.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...ye(s,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),_.set(s,u),u}function Me(e){if(e.includes("codebaseiq"))return!0;let t=!1;for(let n of be)if(e.includes(n)){t=!0;break}return t&&ke.test(e)?!0:e.includes("use")&&Ae.test(e)}var Oe=/codebaseiq[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Be(e){return Oe.test(e)}function ye(e,t,n){let s=[],i=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===o.startIndex&&u[d].type===o.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let r=u[d];if(n.has(r.type)){if(Be(r.text)){s.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"codebaseiq suppression comment",disposition:"exclude"});break}continue}if(!(r.type==="attribute_item"||r.type==="inner_attribute_item"))break}}for(let c of o.namedChildren)i(c)};return i(e.rootNode),s}function Ue(e,t){let n=x(e,t);if(!n)return[];let s=_.get(n);if(s)return s;let i=[],o=je(n);return o?(_.set(n,o),o):(ge(n.rootNode,i,!1,!1),i.push(...ye(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),i.push(...Ve(n.rootNode)),_.set(n,i),i)}function je(e){return Ye(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function ge(e,t,n,s){let i=n,o=s;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)",disposition:"implicit-usage"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)",disposition:"implicit-usage"})),e.type==="function_item"||e.type==="function_signature_item"?We(e,t,n,s):s&&qe(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)",disposition:"implicit-usage"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?ze(e,t,n):e.type==="mod_item"&&N(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(i=!0);for(let c of e.namedChildren)ge(c,t,i,o)}function We(e,t,n,s){let i=N(e),o=null;s?o={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(o={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of i){if(he(c)){o={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=Ge(c);if(u){o=u;break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o.reason,disposition:o.disposition})}function ze(e,t,n){let s=N(e),i=e.namedChildren.find(o=>o.type==="type_identifier")?.text;s.some(Je)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:i}),s.some(he)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:i}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:i})}function N(e){let t=e.parent;if(!t)return[];let n=t.children,s=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){s=o;break}if(s<=0)return[];let i=[];for(let o=s-1;o>=0;o-=1){let c=n[o];if(c.type==="attribute_item"||c.type==="inner_attribute_item")i.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return i}var He=new Set(["test","bench","tokio::test","async_std::test"]),Ze=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),$e=new Set(["allow","warn","deny","forbid","cfg","cfg_attr","doc","inline","cold","must_use","deprecated","repr","derive","automatically_derived","non_exhaustive","path","link","link_section","global_allocator","panic_handler"]);function Ge(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=Ke(e);return t?He.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:Ze.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:$e.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function Je(e){return/#\[\s*derive\s*\(/.test(e)}function he(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function qe(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ve(e){let t=Qe(e);if(t.size===0)return[];let n=[];for(let s of e.descendantsOfType("mod_item")){let i=s.childForFieldName("name")?.text;i&&t.has(i)&&n.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:i})}return n}function Ke(e){let t=/^#!?\[\s*([A-Za-z_][A-Za-z0-9_]*(?:\s*::\s*[A-Za-z_][A-Za-z0-9_]*)*)/.exec(e);return t?t[1].replace(/\s+/g,""):null}function Xe(e){return e==="#[tauri::command]"||e==="#[command]"||e==="#[wasm_bindgen]"||e==="#[no_mangle]"||e==="#[napi]"||e==="#[pyfunction]"||e==="#[pymethod]"||e==="#[pyo3]"||e==="#[doc(hidden)]"||e.startsWith("trait ")||e.startsWith("#[derive(<reflective>)]")||e.startsWith("#[derive(...)]")||e.startsWith('serde `with = "')||e.startsWith('attribute `with = "')||e.startsWith("Rust attribute macro #[")||e.startsWith("Rust ABI/export attribute #[")?"implicit-usage":"exclude"}function Ye(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var fe=/\bwith\s*=\s*"([^"]+)"/g;function Qe(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){fe.lastIndex=0;let s;for(;(s=fe.exec(n.text))!==null;){let i=s[1],o=i.split("::").pop()??i;o&&t.add(o)}}return t}function xe(e){let t=T(e);return(n,s,i,o)=>t(n,s,i,o)?.disposition==="exclude"}function T(e){let t=new Map,n=s=>{let i=t.get(s);if(i)return i;let o=pe(e,s),c=new Map;for(let u of o){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return i={ranges:o,containers:c},t.set(s,i),i};return(s,i,o,c)=>{let u=n(s),l=[];for(let r of u.ranges)i>=r.startLine&&i<=r.endLine&&l.push(r);let d=new Set;c&&d.add(c);for(let r of S(o))d.add(r);for(let r of d){let a=u.containers.get(r);a&&l.push(...a)}return et(l)}}function et(e){if(e.length===0)return null;let n=e.find(s=>s.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function Ct(e,t={}){w(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function _e(e,t,n={}){w(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function Se(e,t){if(t.isIgnoredPath(e.relativePath))return b("ignored-file");if(q(e.symbol))return b("module-like-symbol");if(!E(e.symbol))return b("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&E(e.enclosingSymbol))return b("nested-non-callable-value");if(!t.includeTests&&!tt(e.relativePath))return b("test-file");if(!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName))return b("excluded-file-region");let n=$(e.symbol);if(n==="<constructor>")return b("implicit-constructor");if(e.symbol.startsWith("scip-python ")){if(n==="__all__")return b("python-runtime-metadata");if(/^__[^_].*__$/.test(n))return b("python-protocol-member")}return t.isDeclarationOnlyCallable()?b("declaration-only-callable"):t.isFrameworkContractCallable()?b("framework-contract-member"):V(e.symbol)?b("rust-trait-impl-member"):K(e.symbol)?b("rust-test-module"):!t.includeMembers&&!nt(e)?b("member"):e.endLine-e.startLine+1<t.minLoc?b("below-min-loc"):{accepted:!0}}function tt(e){return Q(e)!=="test"}function b(e){return{accepted:!1,rejectionReason:e}}function E(e){return J(e)||e.endsWith("().")||e.endsWith(".")}function nt(e){return G(e.symbol)||S(e.symbol).length===0}function Ee(){return new Map}function Re(e,t,n){let s=new Map;for(let i of ie(e,n))e.isIgnored(i.relative_path)||t.has(i.relative_path)||C(s,i.symbol_id,i.relative_path,i.ref_count,"scip-mention");return s}function Ce(e,t,n,s={}){let i=new Set;if(s.conservative||n.size===0){for(let o of se(e,t))i.add(o.symbol_id);return i}for(let o of re(e,t))e.isIgnored(o.relative_path)||n.has(o.relative_path)||i.add(o.symbol_id);return i}function k(e,t){let n=e.get(t);if(!n)return!1;for(let s of n.values())if(s.occurrences>0)return!0;return!1}function R(e,t,n){let s=e.get(t);if(!s)return!1;for(let[i,o]of s)if(i!==n&&o.occurrences>0)return!0;return!1}function ve(e){return e?.occurrences??0}function C(e,t,n,s,i="source-fallback"){if(s<=0)return;let o=we(e,t,n);o.occurrences+=s,o.sources.add(i)}function De(e,t,n,s,i){if(s<=0)return;let o=we(e,t,n);o.occurrences=Math.max(s,o.occurrences),o.sources.add(i)}function we(e,t,n){let s=e.get(t);s||(s=new Map,e.set(t,s));let i=s.get(n);return i||(i={occurrences:0,sources:new Set},s.set(n,i)),i}function Yt(e,t={}){let{scope:n,minLoc:s=1,includeTests:i=!1,skipBarrels:o=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,r=0,a=y("dead.candidates",()=>{let m=ue(it(e,{scope:n,minLoc:s,includeTests:i,includeMembers:c}),l);return r=m.length,m},()=>({definitions:r})),p=0,f=o?y("dead.inactive-barrels",()=>{let m=new Set(ee(e));return p=m.size,m},()=>({paths:p})):new Set,A=0,g=u?Ee():y("dead.mention-reference-counts",()=>{let m=Re(e,f,a.map(v=>v.symbolId));return A=m.size,m},()=>({definitions:a.length,symbolsWithReferences:A})),F=0,Pe=u?y("dead.mentioned-symbol-ids",()=>{let m=Ce(e,a.map(v=>v.symbolId),f,{conservative:f.size===0});return F=m.size,m},()=>({definitions:a.length,referencedSymbols:F})):new Set,h=u?a.filter(m=>!Pe.has(m.symbolId)):a.filter(m=>!R(g,m.symbolId,m.relativePath));u?y("dead.source-fallback.dead-code-only",()=>ut(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0})):y("dead.source-fallback.ast",()=>lt(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0}));let M=u?h.filter(m=>!k(g,m.symbolId)):h.filter(m=>!R(g,m.symbolId,m.relativePath)),O=new Set;y("dead.caller-map-supplement",()=>{O=pt(e,M,g,{inactiveBarrelPaths:f,includeSemantic:!u&&d})},()=>({definitions:M.length,semantic:!u&&d}));let Ie=u?h.filter(m=>!k(g,m.symbolId)):a.filter(m=>!O.has(m.symbolId));return ct(e,ot(Ie,g))}function it(e,t){let n=xe(e),s=[];for(let i of Y(e,{scope:t.scope,symbolMatches:E,sqlPrefilter:"function-like"}))Se(i,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>st(e,i),isFrameworkContractCallable:()=>de(e,i)}).accepted&&s.push(i);return s}var rt=["method_signature","abstract_method_signature","call_signature","construct_signature"];function st(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=x(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...rt]).some(i=>i.startPosition.row<=t.startLine&&i.endPosition.row>=t.endLine);let s=W(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
|
|
1
|
+
import{a as de}from"./chunk-YHPG3S2U.js";import{b as ue}from"./chunk-B75HZHUP.js";import{c as I}from"./chunk-BPKNP3KZ.js";import{a as le}from"./chunk-57OPIQFM.js";import{k as ce}from"./chunk-KLX6NSWT.js";import{c as ae}from"./chunk-MSI3K7PJ.js";import{i as oe}from"./chunk-J7AMBVWF.js";import{a as ie,b as re,c as se}from"./chunk-ELNRLMC5.js";import{e as ee,f as te,h as ne}from"./chunk-NDKOVQFG.js";import{a as Q}from"./chunk-BRQL7AFJ.js";import{C as S,d as Z,e as $,g as G,h as J,i as q,j as V,k as K,s as X,x as Y}from"./chunk-GVAF222T.js";import{p as H}from"./chunk-F74LZWCE.js";import{C as x,a as L,z}from"./chunk-ICUL7XRT.js";import{f as w,l as B,t as U,v as j,w as P,x as W}from"./chunk-7GAK2F3H.js";import{d as y}from"./chunk-3LCDIREB.js";import{d as D}from"./chunk-UC2FD2PS.js";var _=new WeakMap,me=U({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:Ne});function pe(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let i=P(e,t);if(!i)return[];let o=B(e,t,i),c=me.read(e,t,o);if(c)return c;let u=n==="rust"?Ue(e,t):Fe(e,t);return me.write(e,t,o,u),u}function Ne(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(Te);return n.some(s=>s===null)?null:n}catch{return null}}function Te(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"||t.containerName!==void 0&&typeof t.containerName!="string")return null;let n=t.disposition===void 0?Xe(t.reason):t.disposition;return n!=="exclude"&&n!=="implicit-usage"?null:{startLine:t.startLine,endLine:t.endLine,reason:t.reason,disposition:n,...t.containerName?{containerName:t.containerName}:{}}}var be=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),ke=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Ae=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Fe(e,t){let n=P(e,t);if(!n||!Me(n))return[];let s=x(e,t);if(!s)return[];let i=_.get(s);if(i)return i;let o=!1,c=s.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let r=d.namedChild(0);if(!r)continue;let a=r.type==="member_expression"?r.namedChild(r.namedChildCount-1)?.text:r.text;if(a&&be.has(a)){o=!0;break}}let u=[];o&&u.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)",disposition:"exclude"});for(let l of c.namedChildren){let d=null,r=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,r=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,r=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let p=a.namedChild(0)?.text,f=a.namedChild(1);p&&(f?.type==="arrow_function"||f?.type==="function_expression")&&(d=p,r=a)}}d&&/^use[A-Z]/.test(d)&&r&&u.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...ye(s,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),_.set(s,u),u}function Me(e){if(e.includes("codebaseiq"))return!0;let t=!1;for(let n of be)if(e.includes(n)){t=!0;break}return t&&ke.test(e)?!0:e.includes("use")&&Ae.test(e)}var Oe=/codebaseiq[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Be(e){return Oe.test(e)}function ye(e,t,n){let s=[],i=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===o.startIndex&&u[d].type===o.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let r=u[d];if(n.has(r.type)){if(Be(r.text)){s.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"codebaseiq suppression comment",disposition:"exclude"});break}continue}if(!(r.type==="attribute_item"||r.type==="inner_attribute_item"))break}}for(let c of o.namedChildren)i(c)};return i(e.rootNode),s}function Ue(e,t){let n=x(e,t);if(!n)return[];let s=_.get(n);if(s)return s;let i=[],o=je(n);return o?(_.set(n,o),o):(ge(n.rootNode,i,!1,!1),i.push(...ye(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),i.push(...Ve(n.rootNode)),_.set(n,i),i)}function je(e){return Ye(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function ge(e,t,n,s){let i=n,o=s;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)",disposition:"implicit-usage"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)",disposition:"implicit-usage"})),e.type==="function_item"||e.type==="function_signature_item"?We(e,t,n,s):s&&qe(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)",disposition:"implicit-usage"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?ze(e,t,n):e.type==="mod_item"&&N(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(i=!0);for(let c of e.namedChildren)ge(c,t,i,o)}function We(e,t,n,s){let i=N(e),o=null;s?o={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(o={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of i){if(he(c)){o={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=Ge(c);if(u){o=u;break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o.reason,disposition:o.disposition})}function ze(e,t,n){let s=N(e),i=e.namedChildren.find(o=>o.type==="type_identifier")?.text;s.some(Je)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:i}),s.some(he)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:i}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:i})}function N(e){let t=e.parent;if(!t)return[];let n=t.children,s=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){s=o;break}if(s<=0)return[];let i=[];for(let o=s-1;o>=0;o-=1){let c=n[o];if(c.type==="attribute_item"||c.type==="inner_attribute_item")i.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return i}var He=new Set(["test","bench","tokio::test","async_std::test"]),Ze=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),$e=new Set(["allow","warn","deny","forbid","cfg","cfg_attr","doc","inline","cold","must_use","deprecated","repr","derive","automatically_derived","non_exhaustive","path","link","link_section","global_allocator","panic_handler"]);function Ge(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=Ke(e);return t?He.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:Ze.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:$e.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function Je(e){return/#\[\s*derive\s*\(/.test(e)}function he(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function qe(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ve(e){let t=Qe(e);if(t.size===0)return[];let n=[];for(let s of e.descendantsOfType("mod_item")){let i=s.childForFieldName("name")?.text;i&&t.has(i)&&n.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:i})}return n}function Ke(e){let t=/^#!?\[\s*([A-Za-z_][A-Za-z0-9_]*(?:\s*::\s*[A-Za-z_][A-Za-z0-9_]*)*)/.exec(e);return t?t[1].replace(/\s+/g,""):null}function Xe(e){return e==="#[tauri::command]"||e==="#[command]"||e==="#[wasm_bindgen]"||e==="#[no_mangle]"||e==="#[napi]"||e==="#[pyfunction]"||e==="#[pymethod]"||e==="#[pyo3]"||e==="#[doc(hidden)]"||e.startsWith("trait ")||e.startsWith("#[derive(<reflective>)]")||e.startsWith("#[derive(...)]")||e.startsWith('serde `with = "')||e.startsWith('attribute `with = "')||e.startsWith("Rust attribute macro #[")||e.startsWith("Rust ABI/export attribute #[")?"implicit-usage":"exclude"}function Ye(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var fe=/\bwith\s*=\s*"([^"]+)"/g;function Qe(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){fe.lastIndex=0;let s;for(;(s=fe.exec(n.text))!==null;){let i=s[1],o=i.split("::").pop()??i;o&&t.add(o)}}return t}function xe(e){let t=T(e);return(n,s,i,o)=>t(n,s,i,o)?.disposition==="exclude"}function T(e){let t=new Map,n=s=>{let i=t.get(s);if(i)return i;let o=pe(e,s),c=new Map;for(let u of o){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return i={ranges:o,containers:c},t.set(s,i),i};return(s,i,o,c)=>{let u=n(s),l=[];for(let r of u.ranges)i>=r.startLine&&i<=r.endLine&&l.push(r);let d=new Set;c&&d.add(c);for(let r of S(o))d.add(r);for(let r of d){let a=u.containers.get(r);a&&l.push(...a)}return et(l)}}function et(e){if(e.length===0)return null;let n=e.find(s=>s.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function Ct(e,t={}){w(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function _e(e,t,n={}){w(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function Se(e,t){if(t.isIgnoredPath(e.relativePath))return b("ignored-file");if(q(e.symbol))return b("module-like-symbol");if(!E(e.symbol))return b("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&E(e.enclosingSymbol))return b("nested-non-callable-value");if(!t.includeTests&&!tt(e.relativePath))return b("test-file");if(!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName))return b("excluded-file-region");let n=$(e.symbol);if(n==="<constructor>")return b("implicit-constructor");if(e.symbol.startsWith("scip-python ")){if(n==="__all__")return b("python-runtime-metadata");if(/^__[^_].*__$/.test(n))return b("python-protocol-member")}return t.isDeclarationOnlyCallable()?b("declaration-only-callable"):t.isFrameworkContractCallable()?b("framework-contract-member"):V(e.symbol)?b("rust-trait-impl-member"):K(e.symbol)?b("rust-test-module"):!t.includeMembers&&!nt(e)?b("member"):e.endLine-e.startLine+1<t.minLoc?b("below-min-loc"):{accepted:!0}}function tt(e){return Q(e)!=="test"}function b(e){return{accepted:!1,rejectionReason:e}}function E(e){return J(e)||e.endsWith("().")||e.endsWith(".")}function nt(e){return G(e.symbol)||S(e.symbol).length===0}function Ee(){return new Map}function Re(e,t,n){let s=new Map;for(let i of ie(e,n))e.isIgnored(i.relative_path)||t.has(i.relative_path)||C(s,i.symbol_id,i.relative_path,i.ref_count,"scip-mention");return s}function Ce(e,t,n,s={}){let i=new Set;if(s.conservative||n.size===0){for(let o of se(e,t))i.add(o.symbol_id);return i}for(let o of re(e,t))e.isIgnored(o.relative_path)||n.has(o.relative_path)||i.add(o.symbol_id);return i}function k(e,t){let n=e.get(t);if(!n)return!1;for(let s of n.values())if(s.occurrences>0)return!0;return!1}function R(e,t,n){let s=e.get(t);if(!s)return!1;for(let[i,o]of s)if(i!==n&&o.occurrences>0)return!0;return!1}function ve(e){return e?.occurrences??0}function C(e,t,n,s,i="source-fallback"){if(s<=0)return;let o=we(e,t,n);o.occurrences+=s,o.sources.add(i)}function De(e,t,n,s,i){if(s<=0)return;let o=we(e,t,n);o.occurrences=Math.max(s,o.occurrences),o.sources.add(i)}function we(e,t,n){let s=e.get(t);s||(s=new Map,e.set(t,s));let i=s.get(n);return i||(i={occurrences:0,sources:new Set},s.set(n,i)),i}function Yt(e,t={}){let{scope:n,minLoc:s=1,includeTests:i=!1,skipBarrels:o=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,r=0,a=y("dead.candidates",()=>{let m=ue(it(e,{scope:n,minLoc:s,includeTests:i,includeMembers:c}),l);return r=m.length,m},()=>({definitions:r})),p=0,f=o?y("dead.inactive-barrels",()=>{let m=new Set(ee(e));return p=m.size,m},()=>({paths:p})):new Set,A=0,g=u?Ee():y("dead.mention-reference-counts",()=>{let m=Re(e,f,a.map(v=>v.symbolId));return A=m.size,m},()=>({definitions:a.length,symbolsWithReferences:A})),F=0,Pe=u?y("dead.mentioned-symbol-ids",()=>{let m=Ce(e,a.map(v=>v.symbolId),f,{conservative:f.size===0});return F=m.size,m},()=>({definitions:a.length,referencedSymbols:F})):new Set,h=u?a.filter(m=>!Pe.has(m.symbolId)):a.filter(m=>!R(g,m.symbolId,m.relativePath));u?y("dead.source-fallback.dead-code-only",()=>ut(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0})):y("dead.source-fallback.ast",()=>lt(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0}));let M=u?h.filter(m=>!k(g,m.symbolId)):h.filter(m=>!R(g,m.symbolId,m.relativePath)),O=new Set;y("dead.caller-map-supplement",()=>{O=pt(e,M,g,{inactiveBarrelPaths:f,includeSemantic:!u&&d})},()=>({definitions:M.length,semantic:!u&&d}));let Ie=u?h.filter(m=>!k(g,m.symbolId)):a.filter(m=>!O.has(m.symbolId));return ct(e,ot(Ie,g))}function it(e,t){let n=xe(e),s=[];for(let i of Y(e,{scope:t.scope,symbolMatches:E,sqlPrefilter:"function-like"}))Se(i,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>st(e,i),isFrameworkContractCallable:()=>de(e,i)}).accepted&&s.push(i);return s}var rt=["method_signature","abstract_method_signature","call_signature","construct_signature"];function st(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=x(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...rt]).some(i=>i.startPosition.row<=t.startLine&&i.endPosition.row>=t.endLine);let s=W(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
|
|
2
2
|
`).trim();return s.endsWith(";")&&!s.includes("=>")&&!s.includes("{")}function ot(e,t){return e.map(n=>at(n,t)).filter(n=>n.cross_file_refs===0).sort((n,s)=>s.loc-n.loc||n.relative_path.localeCompare(s.relative_path)||n.start_line-s.start_line)}function at(e,t){let n=t.get(e.symbolId)??new Map,s=ve(n.get(e.relativePath)),i=0;for(let[o,c]of n)o!==e.relativePath&&(i+=c.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,parent_type_name:e.parentTypeName,same_file_refs:s,cross_file_refs:i}}function ct(e,t){let n=T(e),s=[],i=0,o=0,c=0,u=0,l=0,d=0;for(let r of t){if(e.isIgnored(r.relative_path))continue;if(te(e,r.relative_path)){u++;continue}if(ne(e,r.symbol,r.relative_path)){l++;continue}let a=n(r.relative_path,r.start_line,r.symbol,r.parent_type_name),p=a?.disposition==="implicit-usage"?a.reason:void 0,f=p?"implicit-usage":r.same_file_refs===0?"dead-code":"file-internal";f==="dead-code"?i++:f==="file-internal"?o++:c++,d+=r.loc,s.push({relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line,loc:r.loc,symbol:r.symbol,shortName:Z(r.symbol),sameFileRefs:r.same_file_refs,kind:f,...p?{implicitUsageReason:p}:{}})}return{symbols:s,counts:{total:s.length,deadCode:i,fileInternal:o,implicitUsage:c,loc:d},applicability:{entrySurfaceExcluded:u,externalRootExcluded:l,implicitUsageSignals:c},totalCount:s.length,deadCodeCount:i,fileInternalCount:o,implicitUsageCount:c,totalLoc:d}}function lt(e,t,n,s){if(t.length===0)return;let i=new I(e),o=new Set(t.map(l=>l.symbolId)),c=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(i.sourceFiles());for(let l of L(e))u.add(l);i.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:l=>s.inactiveBarrelPaths.has(l)},l=>{o.has(l.target.symbolId)&&(mt(e,l)||C(n,l.target.symbolId,l.sourceFile,ft(l),"source-fallback"))})}function ut(e,t,n,s){if(t.length===0)return;let i=new I(e),o=X(t),c=new Set(i.sourceFiles());for(let r of L(e))c.add(r);let u=new Set(o.keys()),l=new Map,d=r=>{let a=l.get(r);return a||(a=oe(e,r),l.set(r,a)),a};i.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:r=>s.inactiveBarrelPaths.has(r),resolveTargets:({sourceFile:r,name:a,kind:p})=>{let f=o.get(a);return f?dt(r,a,f,()=>d(r),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:r=>{l.delete(r),_e(e,r)}},r=>{let a=r.kind==="identifier"&&r.sourceFile===r.target.relativePath?Math.max(0,r.occurrences-1):r.occurrences;r.kind==="identifier"&&Le(e,{sourceFile:r.sourceFile,name:r.name,target:r.target,occurrences:a})||C(n,r.target.symbolId,r.sourceFile,a,"source-fallback")})}function dt(e,t,n,s,i){let o=n.filter(d=>d.relativePath===e);if(o.length>0)return o;if(!i.permissive&&n.length===1)return[...n];let c=s(),u=c.get(t);if(u)for(let d of u){let r=n.filter(a=>D(d,a.relativePath));if(r.length>0)return r}let l=new Set;for(let d of c.values())for(let r of d)l.add(r);for(let d of l){let r=n.filter(a=>D(d,a.relativePath));if(r.length>0&&r.length===n.length)return r}return i.permissive?[...n]:[]}function mt(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Le(e,t)}function ft(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Le(e,t){return t.occurrences>1?!1:H(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function pt(e,t,n,s){let i=new Set,o=s.includeSemantic!==!1,c=(r,a)=>{a===r.relativePath||e.isIgnored(a)||s.inactiveBarrelPaths.has(a)||De(n,r.symbolId,a,1,"caller-map")};if(y("dead.caller-map.per-symbol-non-semantic",()=>{for(let r of t){let a=ae(e,r,{semantic:!1,semanticEvidence:le});for(let p of a)c(r,p.file)}},()=>({definitions:t.length,semantic:!1})),!o)return i;let u=0,l=y("dead.caller-map.semantic-candidates",()=>{let r=t.filter(a=>!R(n,a.symbolId,a.relativePath));return u=r.length,r},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return i;let d=ce(e,l);for(let r of d.incompleteSymbolIds)i.add(r);for(let r of d.unavailableSymbolIds)i.add(r);for(let r of l){let a=d.callers.get(r.symbolId);if(a)for(let p of a)c(r,p)}return i}export{Ct as a,Yt as b};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-TEMM2FEL.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c,e as p,g as u,i as b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c,e as p,g as u,i as b}from"./chunk-SX72EVMY.js";import{h as x,v as m}from"./chunk-UC2FD2PS.js";import{createHash as P}from"crypto";import{TextDecoder as k}from"util";var D=new k("utf-8",{fatal:!0});function j(e){return b(e.config.projectRoot)}function I(e,t){let r=x(t),i;try{i=p(e.config.projectRoot,r,{inputKind:"repository text file"})}catch(s){if(u(s)||s instanceof c)return null;throw s}let n=T(i);return n===null?null:F(r,i,n,v(e),S(e))}function L(e,t={}){let r=j(e).filter(o=>!t.scope||o.includes(t.scope)),i=v(e),n=S(e),s=[],l=[],f=[],d=[],g=0;for(let o of r){let a;try{a=p(e.config.projectRoot,o,{inputKind:"repository text file"})}catch(y){if(y instanceof c){d.push(o);continue}if(u(y))continue;f.push(o);continue}let h=T(a);if(h===null){l.push(o);continue}g+=a.byteLength,s.push(F(o,a,h,i,n))}return{files:s,candidateFiles:r.length,scannedBytes:g,skippedBinaryPaths:l,skippedUnreadablePaths:f,skippedOversizedPaths:d}}function F(e,t,r,i,n){let s=P("sha256").update(t).digest("hex");return{relativePath:e,text:r,bytes:t.byteLength,freshness:{exactText:{state:"current",basis:"working-tree-read",sha256:s},semantic:w(e,s,i,n)}}}function w(e,t,r,i){if(!i.has(e))return{state:"unavailable",basis:"no-compiler-document"};let n=r.get(e);return n?{state:n===t?"aligned":"stale",basis:"indexed-input-fingerprint"}:{state:"unavailable",basis:"fingerprint-unavailable"}}function S(e){return new Set(e.all(`SELECT documents.relative_path FROM documents WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`).map(t=>t.relative_path))}function v(e){let t=new Map;if(!e.generation.metadataRaw)return t;let r=m(e.generation.metadataRaw);if(r.kind!=="legacy"&&r.kind!=="supported")return t;let i=r.metadata.fingerprint;if(!R(i)||!Array.isArray(i.files))return t;for(let n of i.files)!R(n)||typeof n.path!="string"||typeof n.hash!="string"||t.set(n.path,n.hash);return t}function T(e){if(e.includes(0))return null;try{return D.decode(e)}catch{return null}}function R(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}export{j as a,I as b,L as c};
|
|
2
|
+
//# sourceMappingURL=chunk-TJWVT4DO.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as L}from"./chunk-DGXRDLV5.js";import{c as M}from"./chunk-
|
|
1
|
+
import{a as L}from"./chunk-DGXRDLV5.js";import{c as M}from"./chunk-UMEPSVKT.js";import{c as w}from"./chunk-BPKNP3KZ.js";import{a as I}from"./chunk-57OPIQFM.js";import{f as E}from"./chunk-KLX6NSWT.js";import{f as x}from"./chunk-MSI3K7PJ.js";import{d as f}from"./chunk-SGX43S2L.js";import{d as C}from"./chunk-GVAF222T.js";import{f as h}from"./chunk-F74LZWCE.js";var H=new Set(f());function U(e,t){return P(e,t).rows}function P(e,t){let{scope:l,minLoc:o=10,limit:s=30,scanLimit:a}=t??{},c=new w(e),r=t?.semantic!==!1,u=B(r,new Set,new Set);return{rows:L({candidates:()=>c.productionCallableDefinitions({scope:l,minLoc:o,requireFunctionLikeSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof a=="number"&&a>0}),scanLimit:a,filterCandidate:R,profile:{name:"complexity-hotspots"},prepare:n=>{let i=z(e,n);(r?E(e):null)?.materializeReferences(n,{prefetchCallees:!0});let m=x(e,n,{semantic:r,semanticEvidence:I}),y=c.calleeEvidenceMap(n,{semantic:r}),g=new Set([...m.incompleteSymbolIds,...y.incompleteSymbolIds]),v=new Set([...m.unavailableSymbolIds,...y.unavailableSymbolIds]);u=B(r,g,v);let D=new Map(n.map(p=>[p.symbolId,p]));return{callerMap:new Map([...m.rows].map(([p,F])=>[p,new Set(F.filter(d=>d.file!==D.get(p)?.relativePath).map(d=>d.file))])),calleeMap:y.rows,incompleteSymbolIds:g,unavailableSymbolIds:v,languageByFile:i,clojureCallableIds:k(e,n,i),branchEstimates:M(e,n)}},evaluate:(n,i)=>i.incompleteSymbolIds.has(n.symbolId)||i.unavailableSymbolIds.has(n.symbolId)?null:j(n,i,o),orderResults:(n,i)=>i.score-n.score||i.loc-n.loc,limit:s}),coverage:u}}function B(e,t,l){let o=new Set([...t,...l]).size,s=e?t.size>0&&l.size>0?"incomplete-and-unavailable":t.size>0?"incomplete":l.size>0?"unavailable":"complete":"disabled";return{semanticEvidence:{enabled:e,status:s,incompleteSymbolCount:t.size,unavailableSymbolCount:l.size,excludedSymbolCount:o}}}function R(e){return e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&H.has(e.kind):!0}function j(e,t,l){if(t.languageByFile.get(e.relativePath)==="clojure"&&!t.clojureCallableIds.has(e.symbolId))return null;let o=e.endLine-e.startLine+1;if(o<l)return null;let s=t.callerMap.get(e.symbolId)?.size??0,a=t.calleeMap.get(e.symbolId)??[],c=new Set,r=new Set;for(let b of a){let m=`${b.symbol}|${b.file}`;c.add(m),b.file!==e.relativePath&&r.add(m)}let u=r.size,S=c.size,n=t.branchEstimates.get(e.symbolId)??{branches:0,estimateBasis:"regex-fallback"},i=n.branches+1;return{symbol:e.symbol,shortName:C(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o,fanIn:s,fanOut:u,calleeCount:S,branches:n.branches,estimateBasis:n.estimateBasis,score:Math.round(o/50*(s/5)*Math.max(u/5,1)*Math.max(i/5,1)*100)/100}}function z(e,t){let l=[...new Set(t.map(a=>a.relativePath))];if(l.length===0)return new Map;let o=l.map(()=>"?").join(", "),s=e.all(`SELECT relative_path, language
|
|
2
2
|
FROM documents
|
|
3
3
|
WHERE relative_path IN (${o})`,...l);return new Map(s.map(a=>[a.relative_path,a.language?.toLowerCase()??null]))}function k(e,t,l){let o=new Set,s=new Map;for(let a of t){if(l.get(a.relativePath)!=="clojure")continue;let c=s.get(a.relativePath);c||(c=new Set((h(e,a.relativePath)?.callables??[]).map(r=>`${r.name}:${r.startLine}`)),s.set(a.relativePath,c)),c.has(`${a.leaf}:${a.startLine}`)&&o.add(a.symbolId)}return o}export{U as a,P as b};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-TLTSESB4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as f}from"./chunk-OTOKVOJ3.js";import{M as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as f}from"./chunk-OTOKVOJ3.js";import{M as d}from"./chunk-ICUL7XRT.js";function S(n,e={}){let{minComponentLines:o=300,minFileLines:i=800,minJsxTokens:u=80,minBehaviorTokens:s=40,limit:a=20,scope:m,scanLimit:c,filePattern:p}=e;return d(n).reactProfiles({scope:m,scanLimit:c}).filter(t=>t.kind==="component").filter(t=>!p||t.file.includes(p)||t.name.includes(p)).map(t=>C(t,{minComponentLines:o,minFileLines:i,minJsxTokens:u,minBehaviorTokens:s})).filter(t=>t!==null).sort((t,r)=>r.componentLines-t.componentLines||r.fileLines-t.fileLines||t.file.localeCompare(r.file)).slice(0,a)}function C(n,e){let o=Math.max(80,Math.floor(e.minComponentLines/2)),i=f(n,x({minComponentLines:e.minComponentLines,minFileLines:e.minFileLines,minJsxTokens:e.minJsxTokens,minBehaviorTokens:e.minBehaviorTokens,substantialComponentLines:o}),"component"),{reasons:u}=i;if(u.length===0)return null;let s=i.dominantPressure,a=i.pressureKinds,m=b(n),c=R(s,a,m);return{file:n.file,component:n.name,componentLines:n.loc,fileLines:n.fileLines,jsxTokens:n.jsxTokens.size,behaviorTokens:n.behaviorTokens.size,dominantPressure:s,pressureKinds:a,contextKind:m,recommendationKind:c,recommendation:v(c,m),reasons:u,loc:n.loc}}function x(n){return[{axis:"component",value:e=>e.loc,qualifies:(e,o)=>o>=n.minComponentLines,reason:(e,o)=>`${o} component line(s)`},{axis:"file",value:e=>e.fileLines,qualifies:(e,o)=>o>=n.minFileLines&&e.loc>=n.substantialComponentLines,reason:(e,o)=>`${o} file line(s)`},{axis:"jsx-structure",value:e=>e.jsxTokens.size,weightedValue:(e,o)=>o*3,qualifies:(e,o)=>o>=n.minJsxTokens,reason:(e,o)=>`${o} JSX structure token(s)`},{axis:"hook-behavior",value:e=>e.behaviorTokens.size,weightedValue:(e,o)=>o*4,qualifies:(e,o)=>o>=n.minBehaviorTokens,reason:(e,o)=>`${o} behavior token(s)`}]}function b(n){let e=n.file.split(/[\\/]+/).filter(Boolean),o=e.slice(0,-1).map(r=>r.toLowerCase()),i=(e.at(-1)??n.name).replace(/\.[^.]+$/,""),s=o.findIndex(r=>k.has(r))>=0,a=o.some(r=>h.has(r));if(L(i)||L(n.name))return"component";let c=T.has(i.toLowerCase()),p=/(?:Page|Route|Screen)$/.test(n.name),l=s&&/View$/.test(n.name),t=!a&&i.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()===n.name.replace(/[^A-Za-z0-9]+/g,"").toLowerCase()&&/(?:Page|Route|Screen|View)$/.test(i);return c||p||l||t?"route-page":"component"}function L(n){let e=n.split(/[^A-Za-z0-9]+/).filter(Boolean).map(o=>o.toLowerCase());return e.at(-1)&&g.has(e.at(-1))?!0:[...g].some(o=>n.endsWith(P(o)))}function R(n,e,o){return n==="hook-behavior"?"behavior-extraction":o==="route-page"?"route-page-decomposition":e.includes("hook-behavior")?"behavior-extraction":e.includes("jsx-structure")?"jsx-decomposition":e.includes("file")?"file-decomposition":n==="jsx-structure"?"jsx-decomposition":n==="file"&&!e.includes("component")?"file-decomposition":"component-decomposition"}function v(n,e){switch(n){case"behavior-extraction":return"Extract independent state, effects, requests, or handlers into hooks, controllers, or feature modules.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"jsx-decomposition":return e==="route-page"?"Split page JSX into named layout sections before extracting behavior.":"Split repeated JSX sections into named presentational components.";case"file-decomposition":return"Review file-level decomposition; split colocated panels or helpers before changing behavior.";case"component-decomposition":return"Review component boundaries around props, state ownership, and independently changing UI sections."}}var h=new Set(["component","components","panel","panels","partial","partials"]),g=new Set(["banner","button","card","dialog","drawer","filter","form","grid","header","item","list","menu","modal","nav","panel","picker","rail","row","section","selector","shell","sidebar","table","toolbar"]),k=new Set(["landing","page","pages","route","routes","screen","screens","view","views"]),T=new Set(["page","route","screen"]);function P(n){return n.charAt(0).toUpperCase()+n.slice(1)}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-TNJGTQWO.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-
|
|
1
|
+
import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-CCIYWXX6.js";import{a as G}from"./chunk-QDCCHMVZ.js";import{l as F,r as O,s as L,t as z,v as $,w as T}from"./chunk-7GAK2F3H.js";import{d as X,f as U,h as S}from"./chunk-SX72EVMY.js";import{a as H,d as K}from"./chunk-3LCDIREB.js";function I(t,n){let e=et(t,n)??it(t,n)??rt(t,n)??ot(t,n);return st(t,e,n)}function et(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=N(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(N(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function N(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function it(t,n){if(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function rt(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(E(o)!==null)break;if(B(o)!==null)return null;e-=1}if(e<0)return null;let i=E(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=E(o);if(s!==null){if(s<=i)break;r+=1;continue}if(B(o)!==null)break;r+=1}return{start:e,end:r}}function E(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function ot(t,n){let e=t[n]??"";if(W(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&V(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&V(t[r]??"");)r+=1;return{start:i,end:r}}function V(t){return B(t)===null}function B(t){return t.trim().length===0?"blank":W(t)?"heading":N(t)?"fence":w(t)?"table":E(t)!==null?"list":null}function W(t){return/^#{1,6}\s+/.test(t.trim())}function st(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
|
|
2
2
|
`).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function A(t,n){return n.filter(e=>t.includes(e))}var ct=/<!--\s*codebaseiq:\s*snapshot\s*-->/i;function Z(t,n){if((t.config.docs?.snapshotPaths??[]).some(r=>G(r,n)))return!0;let i=T(t,n);return i.length>0&&ct.test(i)}var J={classifyCitation:lt,citationContexts:dt,citationKindLabel:ft,citationRemediation:gt,referenceTargets:ht,hasLineAnchoredCitation:at};function at(t){return t.some(n=>(n.lineReferences?.length??0)>0)}function lt(t){let n=t.join(`
|
|
3
3
|
`).toLowerCase(),e=[],i=A(n,[".codebaseiq","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(i.length>0)return e.push(`configuration/example terms near citation: ${i.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:e};let r=A(n,["accepted","intentional","intentionally","retained","historical"]);if(r.length>0)return e.push(`intentional-record terms near citation: ${r.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:e};let o=A(n,["command","cli","usage","example","run","workflow"]);return o.length>0?(e.push(`guide/reference terms near citation: ${o.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:e}):(e.push(t.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:e})}function dt(t,n,e){let i=T(t,n);if(!i&&!S(t.config.projectRoot,n))return[];let r=i.split(/\r?\n/),o=e.flatMap(ut),s=[];for(let c=0;c<r.length;c+=1){let a=r[c]??"";o.some(d=>a.includes(d))&&s.push(I(r,c))}return s}function ut(t){let n=t.split("/");return[t,`./${t}`,n.slice(-3).join("/"),n.slice(-2).join("/")].filter((e,i,r)=>e.length>0&&r.indexOf(e)===i)}function ft(t){switch(t){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function gt(t,n){switch(t){case"behavioral-claim":return`Re-read ${n} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${n} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${n} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${n} is still meant to name this file.`}}function ht(t,n,e){let i=q(e),r=new Set;for(let o of n)mt(t,o,i.get(o)??[])&&r.add(o);return r}function mt(t,n,e){if(!pt.test(n)||!S(t.config.projectRoot,n))return!0;if(e.length===0)return!1;let i=U(t.config.projectRoot,n,{inputKind:"changed source file"}).split(/\r?\n/),r=yt(i);for(let o of e)for(let s=o.startLine;s<=o.endLine;s+=1)if((i[s]??"").trim()!==""&&!r.has(s))return!0;return!1}var pt=/\.(?:[cm]?[jt]sx?)$/i;function yt(t){let n=new Set,e=!1;for(let i=0;i<t.length;i+=1){let r=t[i].trim();!e&&Ct(r)&&(e=!0),e&&(n.add(i),r.endsWith(";")&&(e=!1))}return n}function Ct(t){return/^import(?:\s|$)/.test(t)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(t)}var Q=z({kind:"doc-path-evidence",invalidation:$("doc-path-evidence"),serialize:jt,deserialize:Lt}),v=/\.(?:md|mdx|rst|txt)$/i;function bt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var Dt=3,St=/([A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6})(?::([1-9][0-9]*))?\b/g;function en(t,n={}){let{doc:e,limit:i=20,minCoupling:r=Dt,includeSnapshotExcluded:o=!1}=n,s=At(t,n.historyMode??"bounded");if(!s)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let a of s.docFiles){if(e!==void 0&&!a.includes(e)||e===void 0&&!Y(t,a)||e!==void 0&&!S(t.config.projectRoot,a))continue;let d=Z(t,a);if(d&&!o)continue;let{value:p,estimated:y}=xt(t,a,s.changeTimes.get(a)),g=Rt(t,a),u=new Map,{resolved:l,broken:h,citations:D}=wt(t,a,s.tracked,s.trackedBySuffix,s.everSeenInHistory),x=new Map(D.map(f=>[f.file,f]));for(let f of l){if(f===a||v.test(f))continue;let C=(s.changeTimes.get(f)??[]).filter(b=>b>p).length;if(C===0)continue;let m=x.get(f);u.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:C,...P("reference",g,m?.contexts),citationContexts:m?.contexts,citedLines:m?.lineReferences})}for(let[f,C]of s.coupling.get(a)??[]){if(C<r||!s.tracked.has(f))continue;let m=(s.changeTimes.get(f)??[]).filter(M=>M>p).length;if(m===0)continue;let b=u.get(f);b?(b.evidence="both",b.coChanges=C,Object.assign(b,P("both",g,b.citationContexts))):u.set(f,{file:f,evidence:"co-change",coChanges:C,changesSinceDocUpdate:m,...P("co-change",g)})}if(u.size===0&&h.length===0)continue;let R=[...u.values()].sort((f,C)=>C.changesSinceDocUpdate-f.changesSinceDocUpdate);c.push({doc:a,docLastChangedAt:p,staleness:R.reduce((f,C)=>f+C.changesSinceDocUpdate,0)+h.length*10,subjects:R.slice(0,8),brokenReferences:h,...d?{snapshotExcluded:!0}:{},...y?{docLastChangedAtEstimated:!0}:{}})}return c.sort((a,d)=>d.staleness-a.staleness),{available:!0,commitsAnalyzed:s.historyCommitCount,docsScanned:s.docFiles.length,findings:c.slice(0,i)}}function xt(t,n,e){if(e&&e.length>0)return{value:Math.max(...e),estimated:!1};try{return{value:Math.floor(X(t.config.projectRoot,n).mtimeMs/1e3),estimated:!0}}catch(i){if(S(t.config.projectRoot,n))throw i;return{value:0,estimated:!1}}}function Rt(t,n){let e=T(t,n).slice(0,6e3);if(!e)return{docIntent:"unknown",reasons:["doc text unavailable"]};let i=`${n}
|
|
4
4
|
${e}`.toLowerCase(),r=A(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=A(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function P(t,n,e=[]){let i=t==="co-change"||e.length===0?null:J.classifyCitation(e);return{actionTier:Tt(t,n.docIntent,i?.actionTier),docIntent:n.docIntent,docIntentReasons:n.reasons,...i?{citationKind:i.citationKind,citationKindReasons:i.reasons}:{}}}function Tt(t,n,e){return n==="historical-note"?"support":e||(t==="co-change"?"signal":"direct")}function At(t,n){let e=_(t,{historyMode:n}),i=e.commitHistory();if(!i)return null;let r=e.trackedFiles()??new Set,o=new Map,s=new Map,c=new Set;for(let a of i.commits){let d=[...new Set(a.files)],p=d.filter(g=>v.test(g)),y=d.filter(g=>!v.test(g));for(let g of d){c.add(g);let u=o.get(g)??[];u.push(a.timestamp),o.set(g,u)}for(let g of p){let u=s.get(g);u||(u=new Map,s.set(g,u));for(let l of y)u.set(l,(u.get(l)??0)+1)}}return{changeTimes:o,coupling:s,docFiles:[...r].filter(a=>v.test(a)),everSeenInHistory:c,historyCommitCount:i.commits.length,tracked:r,trackedBySuffix:tt(r)}}function rn(t,n){if(n.size===0)return[];let e=H(),i=0,r=0,o=0,s=0,c=0,a=0;return K("doc-reference.docs-citing-files",()=>{let d=_(t).trackedFiles()??new Set;i=d.size;let p=tt(d),y=Mt(n,p),g=[];for(let u of d){if(!Y(t,u))continue;e&&(r+=1);let l=T(t,u);if(!l&&!S(t.config.projectRoot,u)){e&&(o+=1);continue}if(!It(l,y)){e&&(s+=1);continue}let h=nt(t,u,l);if(!h)continue;e&&(c+=1);let D=vt(h.candidates,n,y,d,p);if(D.size===0)continue;let x=[...new Set([...D.values()].flatMap(m=>[...m]))],R=Et(h.contextsByCandidate,x),f=[...D].map(([m,b])=>({file:m,contexts:k([...b].flatMap(M=>R.get(M)??[])).slice(0,3),lineReferences:j([...b].flatMap(M=>h.lineReferencesByCandidate.get(M)??[]))})).filter(m=>m.contexts.length>0),C=[...D.keys()];if(C.length>0){e&&(a+=1);let m=C.sort();g.push({doc:u,cited:m,citations:f,citedClaims:k(f.flatMap(b=>b.contexts)).slice(0,3)})}}return g},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:a}))}function Y(t,n){return v.test(n)&&!bt(n)&&S(t.config.projectRoot,n)}function tt(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function Mt(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function vt(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(n.has(s))c=s;else if(i.has(s))c=s;else{let d=r.get(s);d?.length===1&&(c=d[0])}if(!c||!n.has(c))continue;let a=o.get(c)??new Set;a.add(s),o.set(c,a)}return o}function wt(t,n,e,i,r){let o=new Set,s=new Set,c=nt(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let a=c.candidates,d=c.contextsByCandidate,p=c.lineReferencesByCandidate,y=new Map,g=new Map,u=(l,h)=>{let D=d.get(h);if(D&&D.length>0){let R=y.get(l)??[];R.push(...D),y.set(l,k(R).slice(0,3))}let x=p.get(h);x&&x.length>0&&g.set(l,j([...g.get(l)??[],...x]))};for(let l of a){if(e.has(l)){o.add(l),u(l,l);continue}let h=i.get(l);if(h&&h.length===1){o.add(h[0]),u(h[0],l);continue}h&&h.length>1||r.has(l)&&s.add(l)}return{resolved:o,broken:[...s],citations:[...y].map(([l,h])=>({file:l,contexts:h,lineReferences:g.get(l)}))}}function Et(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function nt(t,n,e){let i=e;if(i===void 0&&(i=T(t,n),!i&&!S(t.config.projectRoot,n)))return null;let r=F(t,n,i),o=Q.read(t,n,r);if(o)return o;let s=kt(i);return Q.write(t,n,r,s),s}function It(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function kt(t){let n=t.split(/\r?\n/),e=new Set,i=new Map,r=new Map;for(let o=0;o<n.length;o+=1){let s=n[o]??"";for(let c of s.matchAll(St)){let a=(c[1]??"").replace(/^\.?\//,"");if(a.length===0)continue;e.add(a);let d=c[2]?Number(c[2]):null;d!==null&&Number.isSafeInteger(d)&&r.set(a,j([...r.get(a)??[],d]));let p=I(n,o);if(p.length===0)continue;let y=i.get(a)??[];y.push(p),i.set(a,k(y).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i,lineReferencesByCandidate:r}}function jt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()],lineReferencesByCandidate:[...t.lineReferencesByCandidate.entries()]};return JSON.stringify(n)}function Lt(t){try{let n=JSON.parse(t);if(!O(n))return null;let e=L(n.candidates),i=Nt(n.contextsByCandidate),r=_t(n.lineReferencesByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i),lineReferencesByCandidate:new Map(r??[])}}catch{return null}}function _t(t){if(t===void 0)return[];if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||!Array.isArray(e[1]))return null;let i=[];for(let r of e[1]){if(typeof r!="number"||!Number.isSafeInteger(r))return null;i.push(r)}n.push([e[0],j(i)])}return n}function Nt(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=L(e[1]);if(!i)return null;n.push([e[0],i])}return n}function k(t){let n=[];for(let e of new Set(t))n.some(i=>Bt(i,e))||n.push(e);return n}function j(t){return[...new Set(t)].sort((n,e)=>n-e)}function Bt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{bt as a,en as b,rn as c};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-TOTWJZIX.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{a as f}from"./chunk-SGMNWYTH.js";import{b as d,d as m}from"./chunk-GVAF222T.js";function u(e,r){let c=f(e,r);if(!c)return[];let t=e.get(`SELECT symbol, enclosing_symbol FROM global_symbols
|
|
2
2
|
WHERE id = ? LIMIT 1`,c.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],n=t.enclosing_symbol,i=1,y=new Set([t.symbol]);for(;n&&!y.has(n)&&i<20;){y.add(n);let s=e.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",n);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:i}),n=s.enclosing_symbol,i++}if(o.length>1)return o;let b=d(t.symbol);if("kind"in b)return o;let l=b.descriptors;if(l.length<=1)return o;let h=[o[0]];for(let s=l.length-2,p=1;s>=0;s--,p++){let g=l.slice(0,s+1).map(a=>a.suffix==="method"?`${a.name}()`:a.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");h.push({symbol:g,shortName:g,depth:p})}return h}function N(e,r){return u(e,r)}export{u as a,N as b};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-U33PMPNW.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e as i}from"./chunk-
|
|
1
|
+
import{e as i}from"./chunk-GVAF222T.js";import{a as o}from"./chunk-F74LZWCE.js";import{x as s}from"./chunk-7GAK2F3H.js";function u(r,e){let t=s(r,e.relativePath);if(t.length===0)return!1;let n=i(e.symbol);if(!n)return!1;let c=t.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
|
|
2
2
|
`),a=o(n);return new RegExp(`^\\s*export\\s+(?:default\\s+)?(?:(?:async\\s+)?function\\s+${a}\\b|(?:abstract\\s+)?class\\s+${a}\\b|(?:interface|type|enum|namespace|module)\\s+${a}\\b|(?:const|let|var)\\s+${a}\\b)`,"m").test(c)?!0:p(t,n)}function p(r,e){if(!e)return!1;let t=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${o(e)}\\b`);return r.some(n=>t.test(n))}export{u as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-U7NUXDQO.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{isAbsolute as Z,relative as _e}from"path";var g=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function L(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Ht(e){return e.replace(/\\/g,"/")}function Xt(e,t){return L(e)===L(t)}function Q(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let o=/^\/([A-Za-z]):(\/|$)/.exec(n);o&&(n=`/${o[1].toUpperCase()}:${n.slice(3)}`);let i=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${i}`}function Jt(e,t){return Q(e)===Q(t)}function _(e,t){let r=_e(e,t);return r===""||!r.startsWith("..")&&!Z(r)}function ee(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(Z(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=L(e);if(t.split("/").some(n=>n===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}function Me(e,t,r=[]){let n=N(e);if(oe.has(n)||r.some(i=>k(n,i))||t.some(i=>se(n,i)))return"config";if(t.some(ce)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let o=ae(n);return t.some(i=>(ue[i]??[]).includes(o))?"source":"other"}function Yt(e,t,r){let n=N(e);if(oe.has(n)||r?.some(i=>k(n,i))||se(n,t)||ce(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let o=ae(n);return(ue[t]??[]).includes(o)}function Qt(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!te(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!te(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(M)?null:t}function Zt(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),o=new Set([...r.keys(),...n.keys()]),i=[];for(let a of[...o].sort()){let u=r.get(a),c=n.get(a),b=Me(a,t.languages);!u&&c?i.push({kind:"added",path:a,inputKind:b,after:c}):u&&!c?i.push({kind:"deleted",path:a,inputKind:b,before:u}):u&&c&&(u.hash!==c.hash||u.size!==c.size)&&i.push({kind:"modified",path:a,inputKind:b,before:u,after:c})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(re(e?.files??[])||re(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ne)&&s.add("unreadable-input"),{version:1,changes:i,projectIdentityChanged:e?!Te(e,t):!0,uncertainty:[...s].sort()}}function te(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function re(e){return new Set(e.map(t=>t.path)).size!==e.length}function M(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ne(e){return e.hash==="unreadable"||e.size<0}function Te(e,t){return ne(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&ne(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function ne(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((o,i)=>o===n[i])}var oe=new Set([".codebaseiq.json"]),Be={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln","*.slnx"],vb:["*.vbproj","*.sln","*.slnx"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},Ge={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},ie=new Map;function se(e,t){return Be[t].some(r=>k(e,r))||Ge[t].some(r=>k(e,r))}function k(e,t){let r=N(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,o=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return o===r;let i=ie.get(r);if(!i){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");i=new RegExp(`^${s}$`),ie.set(r,i)}return i.test(o)}function N(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function ae(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ce(e){return e==="typescript"||e==="javascript"}var ue={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function tr(e){return typeof e=="string"&&e.length>0}function rr(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function nr(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function ir(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var pe=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];var T=2,m=3;var B=new Set(pe);function pr(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){return{kind:"malformed",reason:`invalid JSON: ${He(s)}`}}if(!f(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let r=t.version;if(!Number.isInteger(r))return{kind:"malformed",reason:"version must be an integer"};if(r!==T&&r!==m)return{kind:"unsupported",version:r,direction:r<T?"older":"future"};let n=$e(t,r);if(n)return{kind:"malformed",reason:n};let o=t,i={metadata:o,capabilities:We(o)};return r===T?{kind:"legacy",...i,metadata:o}:{kind:"supported",...i,metadata:o}}function lr(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function gr(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===m?t.sqliteLayoutVersion:void 0})}function We(e){let t=e.fingerprint!==void 0,r=f(e.fingerprint),n=e.indexedLanguages!==void 0,o=e.status==="complete",i=e.version===m?e:null;return{usableForQuery:n,usableForEvidenceCache:t,publishableGeneration:o&&r&&n,stableGenerationIdentity:o&&t&&typeof e.updatedAt=="string",languageShardReuse:!!i?.languageFingerprints,typescriptProjectShardReuse:!!i?.typescriptProjectShards}}function $e(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!de(e.updatedAt))return"updatedAt must be a valid timestamp";for(let r of["requestedLanguages","indexedLanguages"])if(e[r]!==void 0&&!Ue(e[r]))return`${r} must contain unique supported languages`;return e.skipped!==void 0&&!ze(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===m&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===m&&e.languageFingerprints!==void 0&&!qe(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===m&&e.typescriptProjectShards!==void 0&&!Ve(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function fr(e){return e.version===m&&e.sqliteLayoutVersion===2}function Ue(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&B.has(t))?!1:new Set(e).size===e.length}function ze(e){return Array.isArray(e)&&e.every(t=>f(t)&&typeof t.language=="string"&&B.has(t.language)&&typeof t.reason=="string")}function qe(e){return f(e)&&Object.entries(e).every(([t,r])=>B.has(t)&&f(r))}function Ve(e){return f(e)&&Object.values(e).every(t=>f(t)&&Array.isArray(t.files)&&t.files.every(M))}function He(e){return e instanceof Error?e.message:String(e)}import{closeSync as G,fstatSync as E,openSync as W,readFileSync as Xe,readSync as le}from"fs";import{createHash as Je}from"crypto";var ge=8*1024*1024,Ke=64*1024*1024,Ye=512*1024*1024,Qe=256*1024*1024,y=class extends Error{constructor(r,n,o,i,s){let a=o==="too-large"?`is ${i} bytes; the safety limit is ${s} bytes`:o==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=o;this.observedBytes=i;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function fe(e,t){z(t.maxBytes);let r=String(e),n=W(e,"r");try{let o=E(n);be(o,t,r);let i=Xe(n),s=E(n);if(s.dev!==o.dev||s.ino!==o.ino||s.size!==o.size||i.byteLength!==o.size)throw new y(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return i}finally{G(n)}}function ye(e,t,r="utf8"){return fe(e,t).toString(r)}function $(e,t){return ye(e,{maxBytes:ge,inputKind:t})}function U(e,t){z(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),o=0;for(;;){let i=le(e,n,0,n.length,null);if(i===0)break;if(o+=i,!Number.isSafeInteger(o)||o>t.maxBytes)throw new y(t.inputKind,`file descriptor ${e}`,"too-large",o,t.maxBytes);r.push(Buffer.from(n.subarray(0,i)))}return Buffer.concat(r,o)}function Ze(e,t,r="utf8"){return U(e,t).toString(r)}function me(e,t){let r=W(e,"r");try{return U(r,t)}finally{G(r)}}function et(e,t,r="utf8"){return me(e,t).toString(r)}function he(e,t,r){z(t.maxBytes);let n=String(e),o=W(e,"r");try{let i=E(o);be(i,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,i.size))),a=0;for(;a<i.size;){let c=le(o,s,0,Math.min(s.length,i.size-a),a);if(c===0)break;r(s.subarray(0,c)),a+=c}let u=E(o);if(u.dev!==i.dev||u.ino!==i.ino||u.size!==i.size||a!==i.size)throw new y(t.inputKind,n,"changed-during-read",u.size,t.maxBytes);return a}finally{G(o)}}function tt(e,t){let r=Je("sha256");return he(e,t,n=>r.update(n)),r.digest("hex")}function be(e,t,r){if(!e.isFile())throw new y(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new y(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function z(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}import{createHash as we,randomUUID as dt}from"crypto";import{chmodSync as je,existsSync as h,linkSync as pt,lstatSync as D,readdirSync as H,realpathSync as p,unlinkSync as lt,writeSync as gt}from"fs";import{homedir as ft}from"os";import{basename as yt,dirname as A,isAbsolute as ke,join as d,resolve as v}from"path";import{closeSync as rt,existsSync as nt,fsyncSync as it,mkdirSync as ot,openSync as st}from"fs";import{dirname as Se}from"path";function xe(e,t,r,n){let o=0;for(;o<t.length;){let i=r.writeFile(e,t,o,t.length-o);if(!Number.isSafeInteger(i)||i<=0||i>t.length-o)throw new Error(`${n} write did not make valid forward progress`);o+=i}}function q(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var S=Object.freeze({platform:process.platform,pathExists:e=>nt(e),makeDirectory:e=>ot(e,{recursive:!0}),openFile:(e,t,r)=>st(e,t,r),syncFile:e=>it(e),closeFile:e=>rt(e)});function Ce(e,t=S){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let i=Se(n);if(i===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=i}let o="synced";for(let i of r.reverse())t.makeDirectory(i),o=j(o,w(Se(i),t));return o}function w(e,t=S){let r;try{r=t.openFile(e,"r")}catch(n){if(q(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(q(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function j(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createRequire as at}from"module";var ct=at(import.meta.url),Re=ut().version;function ut(){for(let e of["../package.json","../../package.json"])try{return ct(e)}catch{}return{version:"0.0.0"}}var Pe=1,R=".codebaseiq-cache-owner.json",mt=16*1024,De=Object.freeze({...S,randomToken:()=>dt(),linkFile:(e,t)=>pt(e,t),removeFile:e=>lt(e),writeFile:(e,t,r,n)=>gt(e,t,r,n)});function P(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function l(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function ht(e,t){let r=p(e);return St(r,bt(r,t))}function bt(e,t){let r=p(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?v(n):t?.dbPath?Rt(r,t.dbPath):xt(r)}function Ae(){let e=process.env.XDG_CACHE_HOME;return d(e||d(ft(),".cache"),"codebaseiq")}function xt(e){let t=v(e);try{t=p(t)}catch{}let r=we("sha256").update(t).digest("hex").slice(0,12);return d(Ae(),"projects",r)}function Br(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=d(Ae(),"repositories",e);return Fe(t),p(t)}function Gr(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Wr(e,t){let r=ht(e,t);return{cacheDir:r,dbPath:d(r,"index.db"),indexPath:d(r,"index.scip"),metaPath:d(r,"meta.json")}}function St(e,t,r=De){return Ct(e,t,r).cacheDir}function Ct(e,t,r=De){let n=p(e),o=h(t)?"synced":Fe(t,r),i=p(t),s=d(i,R);if(h(s))return V(n,i),X(s),C(i),{kind:"existing",cacheDir:i};Ee(i),Pt(i),Ee(i);let u=`${JSON.stringify({schemaVersion:Pe,canonicalProjectRoot:n,canonicalCacheDir:i,creatorVersion:Re},null,2)}
|
|
2
|
+
`;try{let c=Dt(s,u,r),b=j(o,c);return{kind:"published",cacheDir:i,achievedDurability:b==="synced"?"directory-durable":"file-flushed",directorySync:b}}catch(c){if(vt(c))return V(n,i),{kind:"existing",cacheDir:i};throw c}}function V(e,t){let r=p(e),n=p(t);return Et(n,r,n)}function $r(e,t){return h(d(t,R))?(V(e,t),ve(t),!0):!1}function Rt(e,t){let r;try{r=ee(t)}catch(s){throw s instanceof g?P(t,s.reason):s}let n=v(e,...r.split("/"));if(n===e||!_(e,n))throw P(t,"outside-project");let o=kt(n),i=p(o);if(!_(e,i)&&i!==e)throw P(t,"symlink-escape");return n}function kt(e){let t=e;for(;!h(t);){let r=A(t);if(r===t)throw P(e,"no-existing-ancestor");t=r}return t}function Et(e,t,r){let n=d(e,R);if(!h(n)||D(n).isSymbolicLink())throw l(e,"missing regular ownership record");let o=D(n);if(!o.isFile()||o.size>mt)throw l(e,"invalid ownership record file");let i=$(n,"cache ownership record"),s=wt(i,e);if(s.canonicalProjectRoot!==t)throw l(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==r)throw l(e,"ownership record names a different cache directory");return{record:s,ownerSha256:we("sha256").update(i).digest("hex"),physicalCacheDir:e}}function wt(e,t){try{let r=JSON.parse(e);if(r.schemaVersion!==Pe||typeof r.canonicalProjectRoot!="string"||typeof r.canonicalCacheDir!="string"||typeof r.creatorVersion!="string"||!ke(r.canonicalProjectRoot)||!ke(r.canonicalCacheDir))throw new Error("invalid fields");return r}catch(r){throw l(t,`malformed ownership record: ${r instanceof Error?r.message:String(r)}`)}}function Ee(e){let t=H(e).filter(r=>r!==R&&!jt(r));if(t.length>0)throw l(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function jt(e){return e.startsWith(`${R}.tmp-`)||[".codebaseiq-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function Pt(e){for(let t of H(e)){let r=d(e,t);try{let n=D(r);if(n.isSymbolicLink())throw l(e,`legacy cache entry ${t} is a symlink`);if(n.isDirectory())C(r);else if(n.isFile())X(r);else throw l(e,`legacy cache entry ${t} is not a file or directory`)}catch(n){if(Ie(n))continue;throw n}}C(e)}function ve(e,t=!1){try{let r=D(e);if(r.isSymbolicLink())throw l(e,"managed cache tree contains a symlink");if(r.isFile()){X(e);return}if(!r.isDirectory())throw l(e,"managed cache tree contains a special file");C(e);for(let n of H(e))ve(d(e,n),!0)}catch(r){if(t&&Ie(r))return;throw r}}function Ie(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function Fe(e,t=S){let r=Ce(e,t);return C(e),r}function Dt(e,t,r){let n=`${e}.tmp-${process.pid}-${r.randomToken()}`,o,i=!1;try{o=r.openFile(n,"wx",384),i=!0,xe(o,Buffer.from(t),r,"cache ownership record"),r.syncFile(o),r.closeFile(o),o=void 0,r.linkFile(n,e);let s=w(A(e),r);return r.removeFile(n),i=!1,j(s,w(A(e),r))}finally{if(o!==void 0)try{r.closeFile(o)}catch{}if(i)try{r.removeFile(n)}catch{}}}function C(e){process.platform!=="win32"&&je(e,448)}function X(e){process.platform!=="win32"&&je(e,384)}function At(e){if(h(e))return p(e);let t=[],r=e;for(;;){let n=A(r);if(n===r)return e;if(t.unshift(yt(r)),h(n))return d(p(n),...t);r=n}}function Ur(e){return At(v(e))}function vt(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as It}from"child_process";import{createHash as Ft}from"crypto";import{existsSync as Ot,lstatSync as Lt,realpathSync as _t}from"fs";import{dirname as Mt,isAbsolute as Nt,join as Tt,resolve as F}from"path";function Bt(){return{...process.env,GIT_OPTIONAL_LOCKS:"0",LC_ALL:"C"}}var O={run(e,t){let r=Oe(e,t);return r.kind==="success"?r.output:void 0},runResult:Oe},Gt=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],J=/^[0-9a-f]{40,64}$/;function Jr(e,t,r=O){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let n=r.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(n.kind!=="success"||!J.test(n.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return n.output}function Kr(e,t=O){let r=t.runResult(e,Gt);if(r.kind==="success"){let n=Wt(r.output);if(n)return $t(n,t)}return Ut(e,t)}function Wt(e){let t=e.split(`
|
|
3
|
+
`).map(u=>u.trim());if(t.length!==5)return;let[r,n,o,i,s]=t;if(!r||!n||!o||!i||!s||!J.test(i)||!J.test(s))return;let a=x(r);return{root:a,gitDir:x(I(a,n)),commonDir:x(I(a,o)),headCommit:i,treeOid:s}}function $t(e,t){let r=t.run(e.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...Le(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:Y("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.length===0}}function Ut(e,t){let r=zt(e,t);if(r.kind!=="worktree")return;let n=r.identity,o=n.projectRoot,i=t.run(o,["rev-parse","--git-common-dir"])?.trim();if(!i)return;let s=x(I(o,i)),a=K(t.run(o,["rev-parse","--verify","HEAD"])),u=K(t.run(o,["rev-parse","--verify","HEAD^{tree}"])),c=t.run(o,["status","--porcelain=v1","-z","--untracked-files=all"]);if(c!==void 0)return{...n,commonDir:s,repositoryId:Y("repository",s),headCommit:a,treeOid:u,clean:c.length===0}}function zt(e,t=O){let r=t.runResult(e,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let o=x(n),i=t.run(o,["rev-parse","--absolute-git-dir"])?.trim();if(!i)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=x(I(o,i));return{kind:"worktree",identity:Le(o,s)}}function Le(e,t){return{projectRoot:e,gitDir:t,worktreeId:Y("worktree",`${e}\0${t}`)}}function Yr(e,t,r=O){return K(r.run(e,t))}function I(e,t){return Nt(t)?t:F(e,t)}function x(e){try{return _t(e)}catch{return F(e)}}function Y(e,t){return Ft("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function K(e){return e?.trim()||void 0}function Oe(e,t){let r=It("git",["-C",e,...t],{encoding:"utf-8",env:Bt(),maxBuffer:52428800,stdio:["ignore","pipe","pipe"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let o=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,i=r.error?.code;return(/not a git repository/i.test(o)||i==="ENOENT"&&Ot(F(e)))&&!qt(e)?{kind:"not-repository"}:{kind:"error",message:o}}function qt(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=F(e);for(;;){try{return Lt(Tt(t,".git")),!0}catch(n){let o=n.code;if(o!=="ENOENT"&&o!=="ENOTDIR")return!0}let r=Mt(t);if(r===t)return!1;t=r}}export{g as a,L as b,Ht as c,Xt as d,Q as e,Jt as f,_ as g,ee as h,Me as i,Yt as j,Qt as k,Zt as l,Be as m,f as n,de as o,tr as p,rr as q,nr as r,ir as s,pe as t,m as u,pr as v,lr as w,gr as x,We as y,fr as z,ge as A,Ke as B,Ye as C,Qe as D,y as E,fe as F,ye as G,$ as H,Ze as I,et as J,he as K,tt as L,xe as M,q as N,S as O,Ce as P,w as Q,j as R,Re as S,bt as T,Ae as U,xt as V,Br as W,Gr as X,Wr as Y,$r as Z,Ur as _,Bt as $,O as aa,Jr as ba,Kr as ca,Yr as da,I as ea,x as fa};
|
|
4
|
+
//# sourceMappingURL=chunk-UC2FD2PS.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{b as k}from"./chunk-
|
|
1
|
+
import{b as k}from"./chunk-TEMM2FEL.js";import{c as D}from"./chunk-BPKNP3KZ.js";import{m as S}from"./chunk-J7AMBVWF.js";import{f as v,h as L}from"./chunk-NDKOVQFG.js";import{d as h,t as y}from"./chunk-GVAF222T.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
|
|
2
2
|
FROM global_symbols gs
|
|
3
3
|
JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
4
4
|
JOIN documents d ON d.id = der.document_id
|
|
5
5
|
WHERE gs.symbol = ?
|
|
6
6
|
LIMIT 1`,n);return s?y(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=y(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-UIAUPFBJ.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as Q,b as ee,c as ne}from"./chunk-QVHZB75Z.js";import{a as Z}from"./chunk-XUJM6474.js";import{c as Y}from"./chunk-PARCKE3Q.js";import{a as X,b as z,c as W}from"./chunk-YXJ4IAHH.js";import{a as J,d as w}from"./chunk-VLTUX4IF.js";import{a as K}from"./chunk-HIEXRDJF.js";import{a as H,d as V}from"./chunk-VVCBMH5O.js";import{h as G}from"./chunk-U24M5RQM.js";import{a as x}from"./chunk-ZOEDRCR4.js";import{p as q}from"./chunk-JOALNFY3.js";import{x as U}from"./chunk-PLZXWZHY.js";import{createHash as ue}from"crypto";var le=6,ve=12,be=48,Ce=2e4,te=12,L=Number.MAX_SAFE_INTEGER,ye=["definition","callers","callees"],_={search:12,"exact-source":24,definition:24,caller:8,callee:8,"production-reference":6,"test-reference":2,dependency:6,consumer:6};function tn(e,t){if(t.cursor)throw new Error("Inspect no longer accepts semantic packet cursors. Run the original inspect selectors again.");let n=xe(t),r=we(e,n),i=r.candidates.sort((c,p)=>M(c,p));n.view==="behavior"&&Pe(e,i),Re(e,i),n.view==="behavior"&&Ee(e,i);let o=Q(i.map(c=>O(c,n.view)),n.evidenceBudgets,(c,p)=>M(c.candidate,p.candidate)),{selected:u,omitted:a}=ee(o.selected,n.maxUnits,n.maxCharacters,(c,p)=>M(c.candidate,p.candidate),n.view==="source"),d=u.map(c=>c.candidate),s=[...o.omitted,...a].map(c=>c.candidate),l=d.map(Ae),m=z(d.map(c=>c.kind==="source"?c.bindingClosure:void 0),d.filter(c=>c.kind==="source").map(c=>({relativePath:c.relativePath,startLine:c.startLine,endLine:c.endLine}))),h=l.reduce((c,p)=>c+(p.kind==="source"?qe(p.source):0),0),g=l.reduce((c,p)=>c+(p.kind==="source"?p.source.length:0),0),y=l.reduce((c,p)=>c+he(p,n.view),0),v=l.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).map(De),b=i.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).length,fe=l.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).length,P=r.searches.map(c=>Me(c,i,d)),ge=Fe(s),N=r.locations.every(c=>c.matched)&&r.evidence.every(c=>c.kind==="matched")&&r.searches.every(c=>Te(c.textCoverage))&&s.every(c=>!c.roles.some(p=>p==="location"||p==="definition")),A=P.reduce((c,p)=>c+p.omittedMatches,0),R=s.length===0&&A===0,$=R?void 0:me(n,!0),D=$e(n,s),Se=Le(R,N,s.length+A,D,P,$),j=i.filter(c=>n.view==="behavior"&&c.kind==="source"&&c.roles.some(p=>p==="location"||p==="definition"||p==="search")).map(c=>({id:`inspect:${c.relativePath}:${c.startLine}-${c.endLine}`,label:c.ownerShort??`${c.relativePath}:${c.startLine+1}`,file:c.relativePath,startLine:c.startLine,endLine:c.endLine})),B=j.length>0?Y(e,j):void 0;return{searches:P,evidence:r.evidence,locations:r.locations,slices:v,candidateSlices:b,omittedSlices:b-fe,maxSlices:b,maxTotalLines:h,units:l,candidateUnits:i.length,omittedUnits:s.length,maxUnits:n.maxUnits,maxCharacters:n.maxCharacters,returnedLines:h,returnedCharacters:g,returnedViewCharacters:y,view:n.view,omissionGroups:D,packetCoverage:{mode:R?"complete":"bounded",candidateUnits:i.length,returnedUnits:l.length,omittedUnits:s.length,omittedByRole:ge,exactSelectorsComplete:N,maxUnits:n.maxUnits,maxCharacters:n.maxCharacters,channels:Oe(i,d,n.evidenceBudgets,n.view),...$?{expansionCommand:$}:{}},stoppingSummary:Se,...B&&B.candidateAnchors>0?{causalFrontier:B}:{},bindingClosure:m,continuation:null}}function Le(e,t,n,r,i,o){let u=f([...r.map(a=>a.drillCommand),...i.flatMap(a=>a.exactFollowup?[a.exactFollowup]:[]),...o?[o]:[]]);return e&&t?{queryStatus:"selection-complete",status:"stop-ready",openEvidence:0,guidance:"All evidence requested by this inspect query was materialized.",drillCommands:[]}:t?{queryStatus:"frontier-accounted",status:"relevance-check-required",openEvidence:n,guidance:"Withheld evidence is accounted for by recoverable groups; drill the groups relevant to the current decision.",drillCommands:u}:{queryStatus:"coverage-incomplete",status:"exact-evidence-withheld",openEvidence:n,guidance:"A requested identity, exact source unit, or current-text coverage requirement is unresolved; drill before relying on it.",drillCommands:u}}function xe(e){let t=F(e.searches),n=F(e.symbols),r=F(e.locations),i=t.length+n.length+r.length;if(i===0)throw new Error("inspect requires at least one --search, --symbol, or --at selector.");if(i>24)throw new RangeError(`inspect accepts at most ${24} selectors; received ${i}.`);let o=e.evidence??{};if(e.unitLines!==void 0&&C(e.unitLines,"unitLines"),e.totalLines!==void 0&&C(e.totalLines,"totalLines"),e.sliceLimit!==void 0&&C(e.sliceLimit,"sliceLimit"),e.maxCharacters!==void 0&&C(e.maxCharacters,"maxCharacters"),e.maxUnits!==void 0&&C(e.maxUnits,"maxUnits"),e.view!==void 0&&e.view!=="source"&&e.view!=="behavior")throw new Error(`Unknown inspect view: ${String(e.view)}. Use source or behavior.`);if(e.full&&(e.searchLimit!==void 0||e.maxUnits!==void 0||e.maxCharacters!==void 0||e.evidenceBudgets!==void 0))throw new Error("full inspect cannot be combined with searchLimit, maxUnits, maxCharacters, or evidenceBudgets.");let u=e.full??!1;return{searches:t,symbols:n,locations:r,...e.scope?.trim()?{scope:e.scope.trim()}:{},context:ae(e.context??le,"context"),searchLimit:C(e.searchLimit??(u?L:ve),"searchLimit"),maxUnits:C(u?L:e.maxUnits??be,"maxUnits"),maxCharacters:C(u?L:e.maxCharacters??Ce,"maxCharacters"),evidenceBudgets:u?Ue():Ie(e.evidenceBudgets??_),view:e.view??"source",evidence:{...o.parts?{parts:[...o.parts]}:n.length>0?{parts:[...ye]}:{},...o.referenceContext!==void 0?{referenceContext:ae(o.referenceContext,"referenceContext")}:{},relatedSourceLines:o.relatedSourceLines??60,...o.semantic!==void 0?{semantic:o.semantic}:{}}}}function Ie(e){let t={..._};for(let[n,r]of Object.entries(e)){if(!(n in t))throw new Error(`Unknown inspect evidence channel: ${n}.`);if(!Number.isSafeInteger(r)||(r??-1)<0)throw new RangeError(`Evidence budget ${n} must be a non-negative safe integer; received ${r}.`);t[n]=r}return t}function Ue(){return Object.fromEntries(Object.keys(_).map(e=>[e,L]))}function we(e,t){let n=[],r=0,i=t.searches.map(s=>{let l=ne(e,s,{scope:t.scope,context:0,limit:t.searchLimit,ranking:"structural"});return{pattern:s,result:l,matches:l.matches}}),o=Math.max(0,...i.map(s=>s.matches.length));for(let s=0;s<o;s+=1)for(let l of i){let m=l.matches[s];if(!m)continue;let h=w(e,m.relativePath,m.focusLine,L,t.context);h&&I(e,n,h,"search",`search:${l.pattern}`,m.ownerSymbol,m.ownerShort,1,r++)}let u=i.map(({pattern:s,result:l})=>{let m=l.omittedMatches>0?de(s,t.scope):void 0,h=l.fileCoverage??[],g=_e(s,h,t.scope);return{pattern:s,matchingLines:l.matchingLines,returnedMatches:l.matches.length,omittedMatches:l.omittedMatches,matchingFiles:h.length,returnedFiles:h.filter(y=>y.returnedMatches>0).length,omittedFiles:h.filter(y=>y.returnedMatches===0).length,candidateUnits:0,selectedUnits:0,omittedUnits:0,scopeHints:g.slice(0,te),omittedScopeHints:Math.max(0,g.length-te),textCoverage:l.textCoverage,...m?{exactFollowup:m}:{}}}),a=t.locations.map(s=>{let l=je(s),m=l?K(e,l.path):null,h=m?w(e,m,l.line-1,L,t.context):null;return h&&I(e,n,h,"location",`at:${s}`,null,null,0,r++),{target:s,matched:h!==null}}),d=t.symbols.map(s=>Z(e,s,t.evidence));for(let s of d)if(s.kind==="matched"){if(s.definition){let l=w(e,s.definition.relativePath,s.definition.startLine,L,t.context);l&&I(e,n,l,"definition",`definition:${s.shortName}`,s.symbol,s.shortName,0,r++)}for(let l of s.referenceWindows){let m=l.references[0];I(e,n,{...l,focusLine:m?.line??l.startLine,unitType:null,unitStartLine:l.startLine,unitEndLine:l.endLine,omittedLines:0},"reference",`reference:${s.shortName}`,m?.enclosingSymbol??null,m?.enclosingShort??null,x(l.relativePath)==="test"?5:4,r++,l.references.map(h=>h.line),s.symbol)}for(let l of s.callers)re(e,n,l,"caller",s,2,r++);for(let l of s.callees)re(e,n,l,"callee",s,3,r++);for(let l of s.dependencies)oe(e,n,"dependency",s.file,l.relativePath,s.symbol,t.context,6,r++);for(let l of s.consumers)oe(e,n,"consumer",l.relativePath,s.file,s.symbol,t.context,7,r++)}return{searches:u,evidence:d,locations:a,candidates:n}}function M(e,t){return e.priority-t.priority||t.roles.length-e.roles.length||t.reasons.length-e.reasons.length||ie(x(e.relativePath))-ie(x(t.relativePath))||e.sequence-t.sequence}function ie(e){switch(e){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function O(e,t){return{candidate:e,priority:e.priority,sequence:e.sequence,relativePath:e.relativePath,fileKind:x(e.relativePath),evidenceCharacters:he(e,t),roles:e.roles,reasons:e.reasons,symbols:e.symbols,behaviorSignals:e.kind==="source"?e.behavior?.signals??[]:[],channel:T(e)}}function T(e){let t=e.roles;return t.includes("location")?"exact-source":t.includes("definition")?"definition":t.includes("caller")?"caller":t.includes("callee")?"callee":t.includes("reference")?x(e.relativePath)==="test"?"test-reference":"production-reference":t.includes("dependency")?"dependency":t.includes("consumer")?"consumer":"search"}function Ee(e,t){let n=t.filter(i=>i.kind==="source"),r=G(e,{files:f(n.map(i=>i.relativePath))});for(let i of n){i.behavior=H(e,i.relativePath,i.startLine,i.endLine,i.focusLines)??void 0;let o=r.filter(a=>a.source.file===i.relativePath&&a.source.startLine<=i.endLine&&a.source.endLine>=i.startLine),u=o.filter(a=>!ke(a,o)).map(a=>({observationId:a.id,protocol:a.protocol,action:a.action,role:a.role,strength:a.strength,resolution:a.resolution,line:a.source.startLine,endLine:a.source.endLine,keyParts:a.keyParts.map(d=>({name:d.name,value:d.value,evidence:d.evidence})),derivation:{kind:a.derivation.kind,rule:a.derivation.rule,sourceSpans:a.derivation.sourceSpans.length}}));i.runtimeFacts=u.length>0?u:void 0}}function ke(e,t){if(e.strength!=="candidate"||e.protocol!=="http")return!1;let n=e.keyParts.find(i=>i.name==="path")?.value,r=e.keyParts.find(i=>i.name==="method")?.value;return n?t.some(i=>{if(i===e||i.action!==e.action||i.role!==e.role||i.source.startLine!==e.source.startLine||i.derivation.rule!=="http.mount-prefix")return!1;let o=i.keyParts.find(a=>a.name==="path")?.value,u=i.keyParts.find(a=>a.name==="method")?.value;return!!(o&&o!==n&&o.endsWith(n)&&(!r||r===u))}):!1}function Pe(e,t){for(let n of t){if(n.kind!=="source")continue;let r=V(e,n.relativePath,n.startLine,n.endLine,n.focusLines);r.startLine===n.startLine&&r.endLine===n.endLine||(n.startLine=r.startLine,n.endLine=r.endLine,n.source=U(e,n.relativePath).slice(r.startLine,r.endLine+1).join(`
|
|
1
|
+
import{a as Q,b as ee,c as ne}from"./chunk-IHSLIIL3.js";import{a as Z}from"./chunk-DDRA3QKN.js";import{c as Y}from"./chunk-BGYRF5YX.js";import{a as X,b as z,c as W}from"./chunk-JCMFBF4Z.js";import{a as J,d as w}from"./chunk-VGWZ4MOY.js";import{a as K}from"./chunk-LMTSB3TB.js";import{a as H,d as V}from"./chunk-BGGB5N53.js";import{h as G}from"./chunk-GQLDYCWS.js";import{a as x}from"./chunk-BRQL7AFJ.js";import{p as q}from"./chunk-F74LZWCE.js";import{x as U}from"./chunk-7GAK2F3H.js";import{createHash as ue}from"crypto";var le=6,ve=12,be=48,Ce=2e4,te=12,L=Number.MAX_SAFE_INTEGER,ye=["definition","callers","callees"],_={search:12,"exact-source":24,definition:24,caller:8,callee:8,"production-reference":6,"test-reference":2,dependency:6,consumer:6};function tn(e,t){if(t.cursor)throw new Error("Inspect no longer accepts semantic packet cursors. Run the original inspect selectors again.");let n=xe(t),r=we(e,n),i=r.candidates.sort((c,p)=>M(c,p));n.view==="behavior"&&Pe(e,i),Re(e,i),n.view==="behavior"&&Ee(e,i);let o=Q(i.map(c=>O(c,n.view)),n.evidenceBudgets,(c,p)=>M(c.candidate,p.candidate)),{selected:u,omitted:a}=ee(o.selected,n.maxUnits,n.maxCharacters,(c,p)=>M(c.candidate,p.candidate),n.view==="source"),d=u.map(c=>c.candidate),s=[...o.omitted,...a].map(c=>c.candidate),l=d.map(Ae),m=z(d.map(c=>c.kind==="source"?c.bindingClosure:void 0),d.filter(c=>c.kind==="source").map(c=>({relativePath:c.relativePath,startLine:c.startLine,endLine:c.endLine}))),h=l.reduce((c,p)=>c+(p.kind==="source"?qe(p.source):0),0),g=l.reduce((c,p)=>c+(p.kind==="source"?p.source.length:0),0),y=l.reduce((c,p)=>c+he(p,n.view),0),v=l.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).map(De),b=i.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).length,fe=l.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).length,P=r.searches.map(c=>Me(c,i,d)),ge=Fe(s),N=r.locations.every(c=>c.matched)&&r.evidence.every(c=>c.kind==="matched")&&r.searches.every(c=>Te(c.textCoverage))&&s.every(c=>!c.roles.some(p=>p==="location"||p==="definition")),A=P.reduce((c,p)=>c+p.omittedMatches,0),R=s.length===0&&A===0,$=R?void 0:me(n,!0),D=$e(n,s),Se=Le(R,N,s.length+A,D,P,$),j=i.filter(c=>n.view==="behavior"&&c.kind==="source"&&c.roles.some(p=>p==="location"||p==="definition"||p==="search")).map(c=>({id:`inspect:${c.relativePath}:${c.startLine}-${c.endLine}`,label:c.ownerShort??`${c.relativePath}:${c.startLine+1}`,file:c.relativePath,startLine:c.startLine,endLine:c.endLine})),B=j.length>0?Y(e,j):void 0;return{searches:P,evidence:r.evidence,locations:r.locations,slices:v,candidateSlices:b,omittedSlices:b-fe,maxSlices:b,maxTotalLines:h,units:l,candidateUnits:i.length,omittedUnits:s.length,maxUnits:n.maxUnits,maxCharacters:n.maxCharacters,returnedLines:h,returnedCharacters:g,returnedViewCharacters:y,view:n.view,omissionGroups:D,packetCoverage:{mode:R?"complete":"bounded",candidateUnits:i.length,returnedUnits:l.length,omittedUnits:s.length,omittedByRole:ge,exactSelectorsComplete:N,maxUnits:n.maxUnits,maxCharacters:n.maxCharacters,channels:Oe(i,d,n.evidenceBudgets,n.view),...$?{expansionCommand:$}:{}},stoppingSummary:Se,...B&&B.candidateAnchors>0?{causalFrontier:B}:{},bindingClosure:m,continuation:null}}function Le(e,t,n,r,i,o){let u=f([...r.map(a=>a.drillCommand),...i.flatMap(a=>a.exactFollowup?[a.exactFollowup]:[]),...o?[o]:[]]);return e&&t?{queryStatus:"selection-complete",status:"stop-ready",openEvidence:0,guidance:"All evidence requested by this inspect query was materialized.",drillCommands:[]}:t?{queryStatus:"frontier-accounted",status:"relevance-check-required",openEvidence:n,guidance:"Withheld evidence is accounted for by recoverable groups; drill the groups relevant to the current decision.",drillCommands:u}:{queryStatus:"coverage-incomplete",status:"exact-evidence-withheld",openEvidence:n,guidance:"A requested identity, exact source unit, or current-text coverage requirement is unresolved; drill before relying on it.",drillCommands:u}}function xe(e){let t=F(e.searches),n=F(e.symbols),r=F(e.locations),i=t.length+n.length+r.length;if(i===0)throw new Error("inspect requires at least one --search, --symbol, or --at selector.");if(i>24)throw new RangeError(`inspect accepts at most ${24} selectors; received ${i}.`);let o=e.evidence??{};if(e.unitLines!==void 0&&C(e.unitLines,"unitLines"),e.totalLines!==void 0&&C(e.totalLines,"totalLines"),e.sliceLimit!==void 0&&C(e.sliceLimit,"sliceLimit"),e.maxCharacters!==void 0&&C(e.maxCharacters,"maxCharacters"),e.maxUnits!==void 0&&C(e.maxUnits,"maxUnits"),e.view!==void 0&&e.view!=="source"&&e.view!=="behavior")throw new Error(`Unknown inspect view: ${String(e.view)}. Use source or behavior.`);if(e.full&&(e.searchLimit!==void 0||e.maxUnits!==void 0||e.maxCharacters!==void 0||e.evidenceBudgets!==void 0))throw new Error("full inspect cannot be combined with searchLimit, maxUnits, maxCharacters, or evidenceBudgets.");let u=e.full??!1;return{searches:t,symbols:n,locations:r,...e.scope?.trim()?{scope:e.scope.trim()}:{},context:ae(e.context??le,"context"),searchLimit:C(e.searchLimit??(u?L:ve),"searchLimit"),maxUnits:C(u?L:e.maxUnits??be,"maxUnits"),maxCharacters:C(u?L:e.maxCharacters??Ce,"maxCharacters"),evidenceBudgets:u?Ue():Ie(e.evidenceBudgets??_),view:e.view??"source",evidence:{...o.parts?{parts:[...o.parts]}:n.length>0?{parts:[...ye]}:{},...o.referenceContext!==void 0?{referenceContext:ae(o.referenceContext,"referenceContext")}:{},relatedSourceLines:o.relatedSourceLines??60,...o.semantic!==void 0?{semantic:o.semantic}:{}}}}function Ie(e){let t={..._};for(let[n,r]of Object.entries(e)){if(!(n in t))throw new Error(`Unknown inspect evidence channel: ${n}.`);if(!Number.isSafeInteger(r)||(r??-1)<0)throw new RangeError(`Evidence budget ${n} must be a non-negative safe integer; received ${r}.`);t[n]=r}return t}function Ue(){return Object.fromEntries(Object.keys(_).map(e=>[e,L]))}function we(e,t){let n=[],r=0,i=t.searches.map(s=>{let l=ne(e,s,{scope:t.scope,context:0,limit:t.searchLimit,ranking:"structural"});return{pattern:s,result:l,matches:l.matches}}),o=Math.max(0,...i.map(s=>s.matches.length));for(let s=0;s<o;s+=1)for(let l of i){let m=l.matches[s];if(!m)continue;let h=w(e,m.relativePath,m.focusLine,L,t.context);h&&I(e,n,h,"search",`search:${l.pattern}`,m.ownerSymbol,m.ownerShort,1,r++)}let u=i.map(({pattern:s,result:l})=>{let m=l.omittedMatches>0?de(s,t.scope):void 0,h=l.fileCoverage??[],g=_e(s,h,t.scope);return{pattern:s,matchingLines:l.matchingLines,returnedMatches:l.matches.length,omittedMatches:l.omittedMatches,matchingFiles:h.length,returnedFiles:h.filter(y=>y.returnedMatches>0).length,omittedFiles:h.filter(y=>y.returnedMatches===0).length,candidateUnits:0,selectedUnits:0,omittedUnits:0,scopeHints:g.slice(0,te),omittedScopeHints:Math.max(0,g.length-te),textCoverage:l.textCoverage,...m?{exactFollowup:m}:{}}}),a=t.locations.map(s=>{let l=je(s),m=l?K(e,l.path):null,h=m?w(e,m,l.line-1,L,t.context):null;return h&&I(e,n,h,"location",`at:${s}`,null,null,0,r++),{target:s,matched:h!==null}}),d=t.symbols.map(s=>Z(e,s,t.evidence));for(let s of d)if(s.kind==="matched"){if(s.definition){let l=w(e,s.definition.relativePath,s.definition.startLine,L,t.context);l&&I(e,n,l,"definition",`definition:${s.shortName}`,s.symbol,s.shortName,0,r++)}for(let l of s.referenceWindows){let m=l.references[0];I(e,n,{...l,focusLine:m?.line??l.startLine,unitType:null,unitStartLine:l.startLine,unitEndLine:l.endLine,omittedLines:0},"reference",`reference:${s.shortName}`,m?.enclosingSymbol??null,m?.enclosingShort??null,x(l.relativePath)==="test"?5:4,r++,l.references.map(h=>h.line),s.symbol)}for(let l of s.callers)re(e,n,l,"caller",s,2,r++);for(let l of s.callees)re(e,n,l,"callee",s,3,r++);for(let l of s.dependencies)oe(e,n,"dependency",s.file,l.relativePath,s.symbol,t.context,6,r++);for(let l of s.consumers)oe(e,n,"consumer",l.relativePath,s.file,s.symbol,t.context,7,r++)}return{searches:u,evidence:d,locations:a,candidates:n}}function M(e,t){return e.priority-t.priority||t.roles.length-e.roles.length||t.reasons.length-e.reasons.length||ie(x(e.relativePath))-ie(x(t.relativePath))||e.sequence-t.sequence}function ie(e){switch(e){case"entry":case"source":case"worker":return 0;case"barrel":return 1;case"test":return 2}}function O(e,t){return{candidate:e,priority:e.priority,sequence:e.sequence,relativePath:e.relativePath,fileKind:x(e.relativePath),evidenceCharacters:he(e,t),roles:e.roles,reasons:e.reasons,symbols:e.symbols,behaviorSignals:e.kind==="source"?e.behavior?.signals??[]:[],channel:T(e)}}function T(e){let t=e.roles;return t.includes("location")?"exact-source":t.includes("definition")?"definition":t.includes("caller")?"caller":t.includes("callee")?"callee":t.includes("reference")?x(e.relativePath)==="test"?"test-reference":"production-reference":t.includes("dependency")?"dependency":t.includes("consumer")?"consumer":"search"}function Ee(e,t){let n=t.filter(i=>i.kind==="source"),r=G(e,{files:f(n.map(i=>i.relativePath))});for(let i of n){i.behavior=H(e,i.relativePath,i.startLine,i.endLine,i.focusLines)??void 0;let o=r.filter(a=>a.source.file===i.relativePath&&a.source.startLine<=i.endLine&&a.source.endLine>=i.startLine),u=o.filter(a=>!ke(a,o)).map(a=>({observationId:a.id,protocol:a.protocol,action:a.action,role:a.role,strength:a.strength,resolution:a.resolution,line:a.source.startLine,endLine:a.source.endLine,keyParts:a.keyParts.map(d=>({name:d.name,value:d.value,evidence:d.evidence})),derivation:{kind:a.derivation.kind,rule:a.derivation.rule,sourceSpans:a.derivation.sourceSpans.length}}));i.runtimeFacts=u.length>0?u:void 0}}function ke(e,t){if(e.strength!=="candidate"||e.protocol!=="http")return!1;let n=e.keyParts.find(i=>i.name==="path")?.value,r=e.keyParts.find(i=>i.name==="method")?.value;return n?t.some(i=>{if(i===e||i.action!==e.action||i.role!==e.role||i.source.startLine!==e.source.startLine||i.derivation.rule!=="http.mount-prefix")return!1;let o=i.keyParts.find(a=>a.name==="path")?.value,u=i.keyParts.find(a=>a.name==="method")?.value;return!!(o&&o!==n&&o.endsWith(n)&&(!r||r===u))}):!1}function Pe(e,t){for(let n of t){if(n.kind!=="source")continue;let r=V(e,n.relativePath,n.startLine,n.endLine,n.focusLines);r.startLine===n.startLine&&r.endLine===n.endLine||(n.startLine=r.startLine,n.endLine=r.endLine,n.source=U(e,n.relativePath).slice(r.startLine,r.endLine+1).join(`
|
|
2
2
|
`),n.unitStartLine=r.startLine,n.unitEndLine=r.endLine,n.omittedLines=0)}}function Re(e,t){for(let n of t)n.kind==="source"&&(n.bindingClosure=X(e,n.relativePath,n.startLine,n.endLine))}function $e(e,t){let n=new Map;for(let r of t){let i=k(r.relativePath),o=T(r),u=[...r.roles].sort().join(","),a=r.kind==="path"?r.relationship:"",d=`${i}|${o}|${u}|${a}`,s=n.get(d)??[];s.push(r),n.set(d,s)}return[...n.entries()].map(([r,i])=>{let o=i[0],u=f(i.flatMap(d=>[...d.roles])).sort(),a=f(i.flatMap(d=>d.kind==="source"?d.behavior?.signals??[]:[])).sort();return{id:`g-${ue("sha256").update(r).digest("hex").slice(0,8)}`,scope:k(o.relativePath),channel:T(o),roles:u,behaviorSignals:a,candidateUnits:i.length,sourceCharacters:i.reduce((d,s)=>d+(s.kind==="source"?s.source.length:0),0),anchors:i.map(d=>({relativePath:d.relativePath,line:d.kind==="source"?d.focusLine:0,ownerShort:d.kind==="source"?d.ownerShort:null,roles:[...d.roles],behaviorSignals:d.kind==="source"?[...d.behavior?.signals??[]]:[]})),drillCommand:Be(e,i)}}).sort((r,i)=>i.candidateUnits-r.candidateUnits||i.sourceCharacters-r.sourceCharacters||r.scope.localeCompare(i.scope)||r.id.localeCompare(i.id))}function Be(e,t){let n=f(t.flatMap(o=>o.reasons.filter(u=>u.startsWith("search:")).map(u=>u.slice(7)))),r=k(t[0].relativePath);if(n.length>0&&t.every(o=>o.kind==="source"&&o.roles.includes("search"))){let o=["codebaseiq inspect"];for(let u of n)o.push(`--search ${S(u)}`);return o.push(`--scope ${S(r)}`,"--full"),e.view==="behavior"&&o.push("--view behavior"),o.join(" ")}let i=t.filter(o=>o.kind==="source");if(i.length>0&&i.length<=24){let o=["codebaseiq inspect"];for(let u of i)o.push(`--at ${S(`${u.relativePath}:${u.focusLine+1}`)}`);return e.view==="behavior"&&o.push("--view behavior"),o.join(" ")}return t.length===1&&t[0].kind==="path"?t[0].exactFollowup:me(e,!0)}function Me(e,t,n){let r=`search:${e.pattern}`,i=t.filter(a=>a.reasons.includes(r)).length,o=new Set(n),u=t.filter(a=>a.reasons.includes(r)&&o.has(a)).length;return{...e,candidateUnits:i,selectedUnits:u,omittedUnits:i-u}}function Fe(e){let t={};for(let n of e)for(let r of n.roles)t[r]=(t[r]??0)+1;return t}function Oe(e,t,n,r){let i=e.map(u=>O(u,r).channel),o=t.map(u=>O(u,r).channel);return Object.fromEntries(Object.keys(n).map(u=>{let a=i.filter(s=>s===u).length,d=o.filter(s=>s===u).length;return[u,{candidateUnits:a,returnedUnits:d,omittedUnits:a-d,maxUnits:n[u]}]}))}function Te(e){return!!(e&&e.skippedUnreadablePaths.length===0&&e.skippedOversizedPaths.length===0)}function _e(e,t,n){let r=new Map;for(let i of t){let o=k(i.relativePath),u=r.get(o)??{matchingLines:0,returnedMatches:0};u.matchingLines+=i.matchingLines,u.returnedMatches+=i.returnedMatches,r.set(o,u)}return[...r.entries()].map(([i,o])=>({scope:i,...o,exactFollowup:de(e,i||n)})).sort((i,o)=>o.matchingLines-i.matchingLines||o.returnedMatches-i.returnedMatches||i.scope.localeCompare(o.scope))}function k(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(0,t)}function de(e,t){return`codebaseiq inspect --search ${S(e)}${t?` --scope ${S(t)}`:""} --full`}function me(e,t){let n=["codebaseiq inspect"];for(let r of e.searches)n.push(`--search ${S(r)}`);for(let r of e.symbols)n.push(`--symbol ${S(r)}`);for(let r of e.locations)n.push(`--at ${S(r)}`);return e.scope&&n.push(`--scope ${S(e.scope)}`),e.context!==le&&n.push(`--context ${e.context}`),e.evidence.parts&&n.push(`--include ${S(e.evidence.parts.join(","))}`),t&&n.push("--full"),e.view==="behavior"&&n.push("--view behavior"),n.join(" ")}function re(e,t,n,r,i,o,u){I(e,t,{...n,unitType:null,unitStartLine:n.startLine,unitEndLine:n.endLine+n.omittedLines},r,`${r}:${i.shortName}`,n.symbol,n.shortName,o,u,[n.focusLine],i.symbol)}function oe(e,t,n,r,i,o,u,a,d){let s=`${r} -> ${i}`,l=q(e,r).filter(b=>b.sourcePath===i),m=U(e,r),h=Ne(m,l,i),g=h===null?null:J(e,r,h,Math.min(u,4));if(g){I(e,t,{...g,unitType:null,unitStartLine:g.startLine,unitEndLine:g.endLine,omittedLines:0},n,`${n}:${s}`,null,null,a,d,[g.focusLine],o);return}let y=`codebaseiq inspect --search ${S(pe(i))} --scope ${S(r)}`,v=t.find(b=>b.kind==="path"&&b.relativePath===r&&b.relationship===s);if(v){v.roles=f([...v.roles,n]),v.reasons=f([...v.reasons,`${n}:${s}`]),v.symbols=f([...v.symbols,o]),v.priority=Math.min(v.priority,a);return}t.push({kind:"path",roles:[n],relativePath:r,relationship:s,reasons:[`${n}:${s}`],symbols:[o],exactFollowup:y,priority:a,sequence:d})}function Ne(e,t,n){let r=f(t.flatMap(d=>[d.importedName,d.localName??""]).filter(d=>d.length>1)),i=pe(n).replace(/\.[^.]+$/u,""),o=f([...r,i]).filter(Boolean),u=/\b(?:from|import|include|require|use)\b/u,a=e.findIndex(d=>u.test(d)&&o.some(s=>d.includes(s)));return a>=0?a:null}function I(e,t,n,r,i,o,u,a,d,s=[n.focusLine],l){let m=t.find(h=>h.kind==="source"&&h.relativePath===n.relativePath&&h.startLine<=n.endLine&&n.startLine<=h.endLine);if(m){let h=Math.min(m.startLine,n.startLine),g=Math.max(m.endLine,n.endLine);m.startLine=h,m.endLine=g,m.source=U(e,n.relativePath).slice(h,g+1).join(`
|
|
3
3
|
`),m.focusLine=Math.min(m.focusLine,n.focusLine),m.focusLines=ce([...m.focusLines,...s]),m.unitStartLine=Math.min(m.unitStartLine,n.unitStartLine),m.unitEndLine=Math.max(m.unitEndLine,n.unitEndLine),m.omittedLines=Math.max(m.omittedLines,n.omittedLines),m.reasons=f([...m.reasons,i]),m.roles=f([...m.roles,r]),m.symbols=f([...m.symbols,...l?[l]:[]]),!m.ownerSymbol&&o&&(m.ownerSymbol=o),!m.ownerShort&&u&&(m.ownerShort=u),m.priority=Math.min(m.priority,a);return}t.push({kind:"source",...n,reasons:[i],focusLines:ce(s),ownerSymbol:o,ownerShort:u,roles:[r],symbols:l?[l]:[],priority:a,sequence:d})}function Ae(e){if(e.kind==="path"){let{priority:o,sequence:u,...a}=e;return{...a,id:se(a)}}let{priority:t,sequence:n,bindingClosure:r,...i}=e;return{...i,id:se(i),omittedCharacters:0}}function De(e){let{kind:t,id:n,roles:r,symbols:i,omittedCharacters:o,behavior:u,runtimeFacts:a,...d}=e;return d}function se(e){return ue("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}function je(e){let t=e.match(/^(.+\.\w+):(\d+)$/u);if(!t)return null;let n=Number(t[2]);return Number.isSafeInteger(n)&&n>0?{path:t[1],line:n}:null}function F(e){return f((e??[]).map(t=>t.trim()).filter(Boolean))}function f(e){return[...new Set(e)]}function ce(e){return f(e).sort((t,n)=>t-n)}function qe(e){return e.length===0?0:e.split(`
|
|
4
4
|
`).length}function he(e,t){if(e.kind==="path")return e.relationship.length+e.exactFollowup.length;let n="bindingClosure"in e?W(e.bindingClosure):0,r=(e.runtimeFacts??[]).reduce((i,o)=>i+o.action.length+o.derivation.rule.length+o.keyParts.reduce((u,a)=>u+a.name.length+a.value.length+4,0)+24,0);return t!=="behavior"?e.source.length+n:e.behavior?e.behavior.lines.reduce((i,o)=>i+o.text.length+o.signals.join(",").length+12,0)+e.behavior.testCases.reduce((i,o)=>i+o.length+2,0)+r+n:e.source.length+n+r}function pe(e){return e.split("/").at(-1)??e}function S(e){return`'${e.replaceAll("'","'\\''")}'`}function C(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new RangeError(`${t} must be a positive safe integer; received ${e}`);return e}function ae(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer; received ${e}`);return e}export{tn as a};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-UJIXCI3L.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as x}from"./chunk-
|
|
1
|
+
import{c as x}from"./chunk-BPKNP3KZ.js";import{a as S}from"./chunk-SGMNWYTH.js";import{d as g}from"./chunk-GVAF222T.js";import{b as p}from"./chunk-F74LZWCE.js";import{C as u}from"./chunk-ICUL7XRT.js";import{f as h,g as y}from"./chunk-SX72EVMY.js";function U(e,t,s={}){let n=S(e,t);if(!n)return null;let o=new x(e),a=w(e,n),r=n.endLine-n.startLine+1,i=o.calleeEvidenceMap([n],{additive:!0,semantic:s.semantic}),l=i.rows.get(n.symbolId)??[],c=new Set(l.map(L=>L.symbol)),m=i.incompleteSymbolIds.has(n.symbolId),b=i.unavailableSymbolIds.has(n.symbolId),N=s.semantic===!1?"disabled":m&&b?"incomplete-and-unavailable":m?"incomplete":b?"unavailable":"complete",d=!m&&!b;return{symbol:n.symbol,shortName:g(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:a.branches,estimateBasis:a.estimateBasis,cyclomaticEstimate:a.branches+1,calleeCount:d?c.size:null,fanIn:C(e,n.symbolId),fanOut:d?D(l,n.relativePath):null,coverage:{semanticEvidence:N}}}function w(e,t){let s=u(e,t.relativePath);if(s){let n=v(s.rootNode,t.startLine,t.endLine);if(n)return{branches:M(n),estimateBasis:"ast"}}return{branches:P(E(e,t.relativePath,t.startLine,t.endLine),_(e,t.relativePath)),estimateBasis:"regex-fallback"}}function W(e,t){let s=new Map,n=new Map;for(let o of t){let a=n.get(o.relativePath)??[];a.push(o),n.set(o.relativePath,a)}for(let[o,a]of n){let r=u(e,o),i=r===null?[]:a.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),l=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});O(r.rootNode,i,s)}for(let c of a)l.has(c.symbolId)||s.set(c.symbolId,I(e,c))}return s}function I(e,t){return{branches:P(E(e,t.relativePath,t.startLine,t.endLine),_(e,t.relativePath)),estimateBasis:"regex-fallback"}}function _(e,t){return e.get("SELECT language FROM documents WHERE relative_path = ?",t)?.language??"unknown"}function E(e,t,s,n){try{return h(e.config.projectRoot,t,{inputKind:"indexed source file"}).split(`
|
|
2
2
|
`).slice(s,n+1).join(`
|
|
3
3
|
`)}catch(o){if(!y(o))throw o;return""}}function C(e,t){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS c
|
|
4
4
|
FROM mentions m
|
|
@@ -13,4 +13,4 @@ import{c as x}from"./chunk-NK76RSB6.js";import{a as S}from"./chunk-3XFJUWJE.js";
|
|
|
13
13
|
WHERE m.symbol_id = ?
|
|
14
14
|
AND m.role != 1
|
|
15
15
|
AND sym_def.document_id != c.document_id`,t)?.c??0}function D(e,t){return new Set(e.filter(s=>s.file!==t).map(s=>s.symbol)).size}function M(e){let t=0;return f(e,s=>{t+=B(s)}),t}function O(e,t,s){let n=[...t].sort((o,a)=>o.startLine-a.startLine||a.endLine-o.endLine);f(e,o=>{let a=B(o);if(a===0)return;let r=o.startPosition.row,i=o.endPosition.row;for(let l of n){if(l.startLine>r)break;if(l.endLine<i)continue;let c=s.get(l.symbolId);c&&(c.branches+=a)}})}function f(e,t){t(e);for(let s of e.namedChildren)f(s,t)}function v(e,t,s){if(e.startPosition.row>t||e.endPosition.row<s)return null;for(let n of e.namedChildren){let o=v(n,t,s);if(o)return o}return e}var F=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function B(e){return F.has(e.type)?1:e.type==="binary_expression"&&e.parent?.type!=="binary_expression"&&(e.text.includes("&&")||e.text.includes("||"))?R(e.text):0}function R(e){return(e.match(/&&|\|\|/g)??[]).length}function P(e,t){let s=p(e),n=0,o=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let a of o){let r=s.match(a);r&&(n+=r.length)}if(t==="python"){let a=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(t==="rust"){let a=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(t==="ruby"){let a=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}else if(t==="go"){let a=[/\bselect\b/g,/\bdefer\b/g];for(let r of a){let i=s.match(r);i&&(n+=i.length)}}return n}export{U as a,w as b,W as c,M as d};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-UMEPSVKT.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{closeSync as te,fstatSync as N,openSync as re,readFileSync as yt,readSync as ke}from"fs";import{createHash as St}from"crypto";var Fe=8*1024*1024,Ee=64*1024*1024,xt=512*1024*1024,bt=256*1024*1024,j=class extends Error{constructor(r,n,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function ve(e,t){ie(t.maxBytes);let r=String(e),n=re(e,"r");try{let i=N(n);De(i,t,r);let o=yt(n),s=N(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new j(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{te(n)}}function I(e,t,r="utf8"){return ve(e,t).toString(r)}function D(e,t){return I(e,{maxBytes:Fe,inputKind:t})}function Pt(e,t){return I(e,{maxBytes:Ee,inputKind:t})}function ne(e,t){ie(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=ke(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new j(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function jt(e,t,r="utf8"){return ne(e,t).toString(r)}function Ie(e,t){let r=re(e,"r");try{return ne(r,t)}finally{te(r)}}function wt(e,t,r="utf8"){return Ie(e,t).toString(r)}function z(e,t,r){ie(t.maxBytes);let n=String(e),i=re(e,"r");try{let o=N(i);De(o,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=ke(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;r(s.subarray(0,u)),a+=u}let c=N(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new j(t.inputKind,n,"changed-during-read",c.size,t.maxBytes);return a}finally{te(i)}}function Ct(e,t){let r=St("sha256");return z(e,t,n=>r.update(n)),r.digest("hex")}function De(e,t,r){if(!e.isFile())throw new j(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new j(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function ie(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function oe(e,t,r=[]){let n=se(e);if(Be.has(n)||r.some(o=>M(n,o))||t.some(o=>Le(n,o)))return"config";if(t.some(ze)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let i=Ne(n);return t.some(o=>(Me[o]??[]).includes(i))?"source":"other"}function _e(e,t,r){let n=se(e);if(Be.has(n)||r?.some(o=>M(n,o))||Le(n,t)||ze(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let i=Ne(n);return(Me[t]??[]).includes(i)}function wn(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!Re(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!Re(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(kt)?null:t}function Cn(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),i=new Set([...r.keys(),...n.keys()]),o=[];for(let a of[...i].sort()){let c=r.get(a),u=n.get(a),l=oe(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:l,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:l,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:l,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(Oe(e?.files??[])||Oe(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ft)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Et(e,t):!0,uncertainty:[...s].sort()}}function Re(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Oe(e){return new Set(e.map(t=>t.path)).size!==e.length}function kt(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ft(e){return e.hash==="unreadable"||e.size<0}function Et(e,t){return Ae(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&Ae(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Ae(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((i,o)=>i===n[o])}var Be=new Set([".codebaseiq.json"]),vt={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},It={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Te=new Map;function Le(e,t){return vt[t].some(r=>M(e,r))||It[t].some(r=>M(e,r))}function M(e,t){let r=se(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,i=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return i===r;let o=Te.get(r);if(!o){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Te.set(r,o)}return o.test(i)}function se(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ne(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ze(e){return e==="typescript"||e==="javascript"}var Me={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{createRequire as Dt}from"module";var Rt=Dt(import.meta.url),Ge=Ot().version;function Ot(){for(let e of["../package.json","../../package.json"])try{return Rt(e)}catch{}return{version:"0.0.0"}}import{createHash as Xe,randomUUID as zt}from"crypto";import{chmodSync as Ye,existsSync as k,linkSync as Mt,lstatSync as H,readdirSync as le,realpathSync as x,unlinkSync as Gt,writeSync as Wt}from"fs";import{homedir as $t}from"os";import{basename as Ht,dirname as U,isAbsolute as qe,join as y,resolve as J}from"path";import{closeSync as At,existsSync as Tt,fsyncSync as _t,mkdirSync as Bt,openSync as Lt}from"fs";import{dirname as $e}from"path";function We(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function ae(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var R=Object.freeze({platform:process.platform,pathExists:e=>Tt(e),makeDirectory:e=>Bt(e,{recursive:!0}),openFile:(e,t,r)=>Lt(e,t,r),syncFile:e=>_t(e),closeFile:e=>At(e)});function He(e,t=R){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=$e(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=W(i,G($e(o),t));return i}function G(e,t=R){let r;try{r=t.openFile(e,"r")}catch(n){if(ae(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(ae(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function W(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{isAbsolute as Je,relative as Nt}from"path";var m=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function ce(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Tn(e){return e.replace(/\\/g,"/")}function _n(e,t){return ce(e)===ce(t)}function Ue(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let i=/^\/([A-Za-z]):(\/|$)/.exec(n);i&&(n=`/${i[1].toUpperCase()}:${n.slice(3)}`);let o=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${o}`}function Bn(e,t){return Ue(e)===Ue(t)}function S(e,t){let r=Nt(e,t);return r===""||!r.startsWith("..")&&!Je(r)}function C(e){if(!e)throw new m(e,"empty-path");if(e.includes("\0"))throw new m(e,"nul-byte");if(Je(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new m(e,"absolute-path");let t=ce(e);if(t.split("/").some(n=>n===".."))throw new m(e,"parent-traversal");if(!t||t===".")throw new m(e,"empty-path");return t}var Ve=1,A=".codebaseiq-cache-owner.json",Ut=16*1024,Qe=Object.freeze({...R,randomToken:()=>zt(),linkFile:(e,t)=>Mt(e,t),removeFile:e=>Gt(e),writeFile:(e,t,r,n)=>Wt(e,t,r,n)});function $(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function b(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Jt(e,t){let r=x(e);return Kt(r,de(r,t))}function de(e,t){let r=x(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?J(n):t?.dbPath?Yt(r,t.dbPath):qt(r)}function Ze(){let e=process.env.XDG_CACHE_HOME;return y(e||y($t(),".cache"),"codebaseiq")}function qt(e){let t=J(e);try{t=x(t)}catch{}let r=Xe("sha256").update(t).digest("hex").slice(0,12);return y(Ze(),"projects",r)}function qn(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(Ze(),"repositories",e);return rt(t),x(t)}function Kn(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Xn(e,t){let r=Jt(e,t);return{cacheDir:r,dbPath:y(r,"index.db"),indexPath:y(r,"index.scip"),metaPath:y(r,"meta.json")}}function Kt(e,t,r=Qe){return Xt(e,t,r).cacheDir}function Xt(e,t,r=Qe){let n=x(e),i=k(t)?"synced":rt(t,r),o=x(t),s=y(o,A);if(k(s))return ue(n,o),pe(s),O(o),{kind:"existing",cacheDir:o};Ke(o),tr(o),Ke(o);let c=`${JSON.stringify({schemaVersion:Ve,canonicalProjectRoot:n,canonicalCacheDir:o,creatorVersion:Ge},null,2)}
|
|
1
|
+
import{closeSync as te,fstatSync as N,openSync as re,readFileSync as yt,readSync as ke}from"fs";import{createHash as St}from"crypto";var Fe=8*1024*1024,Ee=64*1024*1024,xt=512*1024*1024,bt=256*1024*1024,j=class extends Error{constructor(r,n,i,o,s){let a=i==="too-large"?`is ${o} bytes; the safety limit is ${s} bytes`:i==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=i;this.observedBytes=o;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function ve(e,t){ie(t.maxBytes);let r=String(e),n=re(e,"r");try{let i=N(n);De(i,t,r);let o=yt(n),s=N(n);if(s.dev!==i.dev||s.ino!==i.ino||s.size!==i.size||o.byteLength!==i.size)throw new j(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return o}finally{te(n)}}function I(e,t,r="utf8"){return ve(e,t).toString(r)}function D(e,t){return I(e,{maxBytes:Fe,inputKind:t})}function Pt(e,t){return I(e,{maxBytes:Ee,inputKind:t})}function ne(e,t){ie(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),i=0;for(;;){let o=ke(e,n,0,n.length,null);if(o===0)break;if(i+=o,!Number.isSafeInteger(i)||i>t.maxBytes)throw new j(t.inputKind,`file descriptor ${e}`,"too-large",i,t.maxBytes);r.push(Buffer.from(n.subarray(0,o)))}return Buffer.concat(r,i)}function jt(e,t,r="utf8"){return ne(e,t).toString(r)}function Ie(e,t){let r=re(e,"r");try{return ne(r,t)}finally{te(r)}}function wt(e,t,r="utf8"){return Ie(e,t).toString(r)}function z(e,t,r){ie(t.maxBytes);let n=String(e),i=re(e,"r");try{let o=N(i);De(o,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,o.size))),a=0;for(;a<o.size;){let u=ke(i,s,0,Math.min(s.length,o.size-a),a);if(u===0)break;r(s.subarray(0,u)),a+=u}let c=N(i);if(c.dev!==o.dev||c.ino!==o.ino||c.size!==o.size||a!==o.size)throw new j(t.inputKind,n,"changed-during-read",c.size,t.maxBytes);return a}finally{te(i)}}function Ct(e,t){let r=St("sha256");return z(e,t,n=>r.update(n)),r.digest("hex")}function De(e,t,r){if(!e.isFile())throw new j(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new j(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function ie(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function oe(e,t,r=[]){let n=se(e);if(Be.has(n)||r.some(o=>M(n,o))||t.some(o=>Le(n,o)))return"config";if(t.some(ze)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let i=Ne(n);return t.some(o=>(Me[o]??[]).includes(i))?"source":"other"}function _e(e,t,r){let n=se(e);if(Be.has(n)||r?.some(o=>M(n,o))||Le(n,t)||ze(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let i=Ne(n);return(Me[t]??[]).includes(i)}function wn(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!Re(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!Re(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(kt)?null:t}function Cn(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),i=new Set([...r.keys(),...n.keys()]),o=[];for(let a of[...i].sort()){let c=r.get(a),u=n.get(a),l=oe(a,t.languages);!c&&u?o.push({kind:"added",path:a,inputKind:l,after:u}):c&&!u?o.push({kind:"deleted",path:a,inputKind:l,before:c}):c&&u&&(c.hash!==u.hash||c.size!==u.size)&&o.push({kind:"modified",path:a,inputKind:l,before:c,after:u})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(Oe(e?.files??[])||Oe(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ft)&&s.add("unreadable-input"),{version:1,changes:o,projectIdentityChanged:e?!Et(e,t):!0,uncertainty:[...s].sort()}}function Re(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function Oe(e){return new Set(e.map(t=>t.path)).size!==e.length}function kt(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ft(e){return e.hash==="unreadable"||e.size<0}function Et(e,t){return Ae(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&Ae(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function Ae(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((i,o)=>i===n[o])}var Be=new Set([".codebaseiq.json"]),vt={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln","*.slnx"],vb:["*.vbproj","*.sln","*.slnx"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},It={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},Te=new Map;function Le(e,t){return vt[t].some(r=>M(e,r))||It[t].some(r=>M(e,r))}function M(e,t){let r=se(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,i=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return i===r;let o=Te.get(r);if(!o){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");o=new RegExp(`^${s}$`),Te.set(r,o)}return o.test(i)}function se(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ne(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ze(e){return e==="typescript"||e==="javascript"}var Me={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{createRequire as Dt}from"module";var Rt=Dt(import.meta.url),Ge=Ot().version;function Ot(){for(let e of["../package.json","../../package.json"])try{return Rt(e)}catch{}return{version:"0.0.0"}}import{createHash as Xe,randomUUID as zt}from"crypto";import{chmodSync as Ye,existsSync as k,linkSync as Mt,lstatSync as H,readdirSync as le,realpathSync as x,unlinkSync as Gt,writeSync as Wt}from"fs";import{homedir as $t}from"os";import{basename as Ht,dirname as U,isAbsolute as qe,join as y,resolve as J}from"path";import{closeSync as At,existsSync as Tt,fsyncSync as _t,mkdirSync as Bt,openSync as Lt}from"fs";import{dirname as $e}from"path";function We(e,t,r,n){let i=0;for(;i<t.length;){let o=r.writeFile(e,t,i,t.length-i);if(!Number.isSafeInteger(o)||o<=0||o>t.length-i)throw new Error(`${n} write did not make valid forward progress`);i+=o}}function ae(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var R=Object.freeze({platform:process.platform,pathExists:e=>Tt(e),makeDirectory:e=>Bt(e,{recursive:!0}),openFile:(e,t,r)=>Lt(e,t,r),syncFile:e=>_t(e),closeFile:e=>At(e)});function He(e,t=R){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let o=$e(n);if(o===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=o}let i="synced";for(let o of r.reverse())t.makeDirectory(o),i=W(i,G($e(o),t));return i}function G(e,t=R){let r;try{r=t.openFile(e,"r")}catch(n){if(ae(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(ae(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function W(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{isAbsolute as Je,relative as Nt}from"path";var m=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function ce(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Tn(e){return e.replace(/\\/g,"/")}function _n(e,t){return ce(e)===ce(t)}function Ue(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let i=/^\/([A-Za-z]):(\/|$)/.exec(n);i&&(n=`/${i[1].toUpperCase()}:${n.slice(3)}`);let o=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${o}`}function Bn(e,t){return Ue(e)===Ue(t)}function S(e,t){let r=Nt(e,t);return r===""||!r.startsWith("..")&&!Je(r)}function C(e){if(!e)throw new m(e,"empty-path");if(e.includes("\0"))throw new m(e,"nul-byte");if(Je(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new m(e,"absolute-path");let t=ce(e);if(t.split("/").some(n=>n===".."))throw new m(e,"parent-traversal");if(!t||t===".")throw new m(e,"empty-path");return t}var Ve=1,A=".codebaseiq-cache-owner.json",Ut=16*1024,Qe=Object.freeze({...R,randomToken:()=>zt(),linkFile:(e,t)=>Mt(e,t),removeFile:e=>Gt(e),writeFile:(e,t,r,n)=>Wt(e,t,r,n)});function $(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function b(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function Jt(e,t){let r=x(e);return Kt(r,de(r,t))}function de(e,t){let r=x(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?J(n):t?.dbPath?Yt(r,t.dbPath):qt(r)}function Ze(){let e=process.env.XDG_CACHE_HOME;return y(e||y($t(),".cache"),"codebaseiq")}function qt(e){let t=J(e);try{t=x(t)}catch{}let r=Xe("sha256").update(t).digest("hex").slice(0,12);return y(Ze(),"projects",r)}function qn(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=y(Ze(),"repositories",e);return rt(t),x(t)}function Kn(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Xn(e,t){let r=Jt(e,t);return{cacheDir:r,dbPath:y(r,"index.db"),indexPath:y(r,"index.scip"),metaPath:y(r,"meta.json")}}function Kt(e,t,r=Qe){return Xt(e,t,r).cacheDir}function Xt(e,t,r=Qe){let n=x(e),i=k(t)?"synced":rt(t,r),o=x(t),s=y(o,A);if(k(s))return ue(n,o),pe(s),O(o),{kind:"existing",cacheDir:o};Ke(o),tr(o),Ke(o);let c=`${JSON.stringify({schemaVersion:Ve,canonicalProjectRoot:n,canonicalCacheDir:o,creatorVersion:Ge},null,2)}
|
|
2
2
|
`;try{let u=rr(s,c,r),l=W(i,u);return{kind:"published",cacheDir:o,achievedDurability:l==="synced"?"directory-durable":"file-flushed",directorySync:l}}catch(u){if(ir(u))return ue(n,o),{kind:"existing",cacheDir:o};throw u}}function ue(e,t){let r=x(e),n=x(t);return Qt(n,r,n)}function Yn(e,t){return k(y(t,A))?(ue(e,t),et(t),!0):!1}function Yt(e,t){let r;try{r=C(t)}catch(s){throw s instanceof m?$(t,s.reason):s}let n=J(e,...r.split("/"));if(n===e||!S(e,n))throw $(t,"outside-project");let i=Vt(n),o=x(i);if(!S(e,o)&&o!==e)throw $(t,"symlink-escape");return n}function Vt(e){let t=e;for(;!k(t);){let r=U(t);if(r===t)throw $(e,"no-existing-ancestor");t=r}return t}function Qt(e,t,r){let n=y(e,A);if(!k(n)||H(n).isSymbolicLink())throw b(e,"missing regular ownership record");let i=H(n);if(!i.isFile()||i.size>Ut)throw b(e,"invalid ownership record file");let o=D(n,"cache ownership record"),s=Zt(o,e);if(s.canonicalProjectRoot!==t)throw b(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==r)throw b(e,"ownership record names a different cache directory");return{record:s,ownerSha256:Xe("sha256").update(o).digest("hex"),physicalCacheDir:e}}function Zt(e,t){try{let r=JSON.parse(e);if(r.schemaVersion!==Ve||typeof r.canonicalProjectRoot!="string"||typeof r.canonicalCacheDir!="string"||typeof r.creatorVersion!="string"||!qe(r.canonicalProjectRoot)||!qe(r.canonicalCacheDir))throw new Error("invalid fields");return r}catch(r){throw b(t,`malformed ownership record: ${r instanceof Error?r.message:String(r)}`)}}function Ke(e){let t=le(e).filter(r=>r!==A&&!er(r));if(t.length>0)throw b(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function er(e){return e.startsWith(`${A}.tmp-`)||[".codebaseiq-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function tr(e){for(let t of le(e)){let r=y(e,t);try{let n=H(r);if(n.isSymbolicLink())throw b(e,`legacy cache entry ${t} is a symlink`);if(n.isDirectory())O(r);else if(n.isFile())pe(r);else throw b(e,`legacy cache entry ${t} is not a file or directory`)}catch(n){if(tt(n))continue;throw n}}O(e)}function et(e,t=!1){try{let r=H(e);if(r.isSymbolicLink())throw b(e,"managed cache tree contains a symlink");if(r.isFile()){pe(e);return}if(!r.isDirectory())throw b(e,"managed cache tree contains a special file");O(e);for(let n of le(e))et(y(e,n),!0)}catch(r){if(t&&tt(r))return;throw r}}function tt(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function rt(e,t=R){let r=He(e,t);return O(e),r}function rr(e,t,r){let n=`${e}.tmp-${process.pid}-${r.randomToken()}`,i,o=!1;try{i=r.openFile(n,"wx",384),o=!0,We(i,Buffer.from(t),r,"cache ownership record"),r.syncFile(i),r.closeFile(i),i=void 0,r.linkFile(n,e);let s=G(U(e),r);return r.removeFile(n),o=!1,W(s,G(U(e),r))}finally{if(i!==void 0)try{r.closeFile(i)}catch{}if(o)try{r.removeFile(n)}catch{}}}function O(e){process.platform!=="win32"&&Ye(e,448)}function pe(e){process.platform!=="win32"&&Ye(e,384)}function nr(e){if(k(e))return x(e);let t=[],r=e;for(;;){let n=U(r);if(n===r)return e;if(t.unshift(Ht(r)),k(n))return y(x(n),...t);r=n}}function Vn(e){return nr(J(e))}function ir(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as or}from"child_process";import{createHash as sr}from"crypto";import{existsSync as ar,lstatSync as cr,realpathSync as ur}from"fs";import{dirname as lr,isAbsolute as dr,join as pr,resolve as K}from"path";function he(){return{...process.env,GIT_OPTIONAL_LOCKS:"0",LC_ALL:"C"}}var T={run(e,t){let r=nt(e,t);return r.kind==="success"?r.output:void 0},runResult:nt},fr=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],fe=/^[0-9a-f]{40,64}$/;function ni(e,t,r=T){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let n=r.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(n.kind!=="success"||!fe.test(n.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return n.output}function ii(e,t=T){let r=t.runResult(e,fr);if(r.kind==="success"){let n=gr(r.output);if(n)return hr(n,t)}return mr(e,t)}function gr(e){let t=e.split(`
|
|
3
3
|
`).map(c=>c.trim());if(t.length!==5)return;let[r,n,i,o,s]=t;if(!r||!n||!i||!o||!s||!fe.test(o)||!fe.test(s))return;let a=P(r);return{root:a,gitDir:P(q(a,n)),commonDir:P(q(a,i)),headCommit:o,treeOid:s}}function hr(e,t){let r=t.run(e.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...it(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:me("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.length===0}}function mr(e,t){let r=yr(e,t);if(r.kind!=="worktree")return;let n=r.identity,i=n.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=P(q(i,o)),a=ge(t.run(i,["rev-parse","--verify","HEAD"])),c=ge(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),u=t.run(i,["status","--porcelain=v1","-z","--untracked-files=all"]);if(u!==void 0)return{...n,commonDir:s,repositoryId:me("repository",s),headCommit:a,treeOid:c,clean:u.length===0}}function yr(e,t=T){let r=t.runResult(e,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let i=P(n),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=P(q(i,o));return{kind:"worktree",identity:it(i,s)}}function it(e,t){return{projectRoot:e,gitDir:t,worktreeId:me("worktree",`${e}\0${t}`)}}function oi(e,t=T){let r=t.run(e,["worktree","list","--porcelain","-z"]);return r===void 0?[]:Sr(r)}function Sr(e){let t=[],r;for(let n of e.split("\0")){if(n===""){r&&t.push(r),r=void 0;continue}let i=n.indexOf(" "),o=i<0?n:n.slice(0,i),s=i<0?"":n.slice(i+1);if(o==="worktree"){r&&t.push(r),r={path:P(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}r&&(o==="HEAD"?r.head=s:o==="branch"?r.branch=s:o==="detached"?r.detached=!0:o==="bare"?r.bare=!0:o==="prunable"?r.prunable=!0:o==="locked"&&(r.locked=!0))}return r&&t.push(r),t}function si(e,t,r=T){return ge(r.run(e,t))}function q(e,t){return dr(t)?t:K(e,t)}function P(e){try{return ur(e)}catch{return K(e)}}function me(e,t){return sr("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function ge(e){return e?.trim()||void 0}function nt(e,t){let r=or("git",["-C",e,...t],{encoding:"utf-8",env:he(),maxBuffer:52428800,stdio:["ignore","pipe","pipe"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let i=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&ar(K(e)))&&!xr(e)?{kind:"not-repository"}:{kind:"error",message:i}}function xr(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=K(e);for(;;){try{return cr(pr(t,".git")),!0}catch(n){let i=n.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let r=lr(t);if(r===t)return!1;t=r}}import{execFileSync as Xr}from"child_process";import{createHash as ft}from"crypto";import{closeSync as Yr,fstatSync as gt,lstatSync as be,openSync as Vr,readdirSync as Qr,readFileSync as Zr,readlinkSync as en,realpathSync as V}from"fs";import{isAbsolute as tn,join as Pe,relative as rn,resolve as nn,sep as on}from"path";import{execFileSync as ye}from"child_process";import{createHash as br}from"crypto";import{mkdirSync as Pr,renameSync as jr,writeFileSync as wr}from"fs";import{basename as Cr,dirname as kr,join as Fr}from"path";var Er="git-content-hashes.json",vr=32*1024*1024,Ir=2e5,X=3e4;function Se(){return{env:he(),encoding:"utf8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:X,killSignal:"SIGKILL"}}function ot(e){let t,r;try{t=ye("git",["-C",e,"ls-files","-s","-z","--","."],{...Se(),timeout:X}),r=ye("git",["-C",e,"status","--porcelain=v1","-z","--untracked-files=all","--no-renames","--","."],{...Se(),timeout:X})}catch{return null}let n=new Map,i=[];for(let l of t.split("\0")){if(!l)continue;let f=l.indexOf(" "),p=f>0?l.slice(0,f).split(" "):[];if(p.length!==3)continue;let[h,g,L]=p,w=l.slice(f+1);if(h!=="100644"&&h!=="100755"||L!=="0"){n.delete(w);continue}n.set(w,g),Cr(w)===".gitattributes"&&i.push(`${w}:${g}`)}let o=new Set;for(let l of r.split("\0"))l.length>=4&&l[2]===" "&&o.add(l.slice(3));let s=Dr(e,i),a=Fr(de(e),Er),c=Rr(a,s),u=new Map;return{lookup(l){if(o.has(l))return;let f=n.get(l);if(f)return u.get(f)??c.entries[f]},seed(l,f){if(o.has(l))return;let p=n.get(l);!p||c.entries[p]||u.has(p)||u.set(p,f)},persist(){if(u.size===0)return;let l=new Set(n.values()),f={};for(let[p,h]of Object.entries(c.entries))l.has(p)&&(f[p]=h);for(let[p,h]of u)f[p]=h;if(!(Object.keys(f).length>Ir))try{Pr(kr(a),{recursive:!0});let p=`${a}.${process.pid}.tmp`;wr(p,JSON.stringify({version:1,salt:s,entries:f})),jr(p,a)}catch{}}}}function Dr(e,t){let r="";try{r=ye("git",["-C",e,"config","--get-regexp","^core\\.(autocrlf|eol|safecrlf)$"],{...Se(),timeout:X})}catch{}return br("sha256").update(JSON.stringify([r.trim(),t.sort()])).digest("hex")}function Rr(e,t){let r={version:1,salt:t,entries:{}};try{let n=I(e,{maxBytes:vr,inputKind:"git-content-hash-store"}),i=JSON.parse(n);if(i.version!==1||i.salt!==t||!i.entries||typeof i.entries!="object")return r;let o={};for(let[s,a]of Object.entries(i.entries))/^[0-9a-f]{40,64}$/.test(s)&&a&&typeof a.size=="number"&&Number.isInteger(a.size)&&a.size>=0&&typeof a.hash=="string"&&/^[0-9a-f]{64}$/.test(a.hash)&&(o[s]={size:a.size,hash:a.hash});return{version:1,salt:t,entries:o}}catch{return r}}import{AsyncLocalStorage as Or}from"async_hooks";var Ar=new Or;function E(e,t){let r=Y(e);if(!r||r.missing.has(t))return;let n=r.files.get(t);if(n)return n;let i=r.readBaseFile?.(t);return i&&r.files.set(t,i),i}function v(e,t){let r=Y(e);if(r)return r.missing.has(t)?"missing":r.paths.includes(t)?"present":"missing"}function st(e,t){return Y(e)?.fingerprints.get(t)}function F(e){return Y(e)?.paths}function Y(e){let t=Ar.getStore();if(t)return t.projectRoot===P(e)?t:void 0}import{createRequire as Tr}from"module";import{existsSync as _r,readdirSync as Br,statSync as Lr}from"fs";import d from"path";var Nr=Tr(import.meta.url),at=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function zr(e,t=[]){let r=d.resolve(e),n=t.flatMap(c=>Gr(r,c));if(n.length>0)return ct(r,lt(n));let i=Mr(r),o=lt(i),s=Wr(r,o)?[r,...o]:o,a=s.length>0?s:[r];return ct(r,a)}function dt(e,t,r=[]){let n;try{n=Nr("ts-morph")}catch{return null}let i=d.resolve(e),o=t==="workspace"?zr(i,r):["."],s=new Set;for(let a of o){let c=a==="."?i:d.join(i,a),u=d.join(c,"tsconfig.json"),l=Jr(n.ts,i);if(!l.fileExists(u))return null;let f=n.ts.readConfigFile(u,l.readFile);if(f.error)return null;let p=n.ts.parseJsonConfigFileContent(f.config,l,c);if(p.errors.length>0)return null;for(let h of p.fileNames){let g=d.resolve(h);S(i,g)&&s.add(d.relative(i,g).split(d.sep).join("/"))}}return s}function ct(e,t){return[...new Set(t.map(r=>_(e,r)))].sort((r,n)=>r.localeCompare(n))}function Mr(e){let t=F(e);if(t)return t.flatMap(i=>{if(i.split("/").some(s=>at.has(s)))return[];let o=d.join(e,...i.split("/"));return ut(e,o)?[d.dirname(o)]:[]});let r=[],n=[e];for(;n.length>0;){let i=n.pop(),o;try{o=Br(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=d.join(i,s.name);if(s.isDirectory()){!at.has(s.name)&&!s.name.startsWith(".")&&n.push(a);continue}s.isFile()&&ut(e,a)&&r.push(d.dirname(a))}}return r}function Gr(e,t){let r=t.trim();if(!r)return[];let n=d.resolve(e,r);if(!S(e,n))return[];let i=F(e);if(i){let o=_(e,n);if(i.includes(o)&&xe(d.basename(n)))return[d.dirname(n)];let s=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(s))?[n]:[]}try{let o=Lr(n);if(o.isDirectory())return[n];if(o.isFile()&&xe(d.basename(n)))return[d.dirname(n)]}catch{return[]}return[]}function ut(e,t){if(!xe(d.basename(t)))return!1;let r=pt(e,t);return r?d.basename(t)==="tsconfig.json"||"include"in r||"files"in r||"references"in r:!1}function xe(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function lt(e){let t=[...new Set(e.map(r=>d.resolve(r)))].sort((r,n)=>r.localeCompare(n));return t.length<=1?t:t.filter(r=>!t.some(n=>n!==r&&Kr(r,n)))}function Wr(e,t){if(t.length===0||t.some(n=>d.resolve(n)===e))return!1;let r=d.join(e,"tsconfig.json");return Hr(e,r)&&$r(e,r)}function $r(e,t){let n=pt(e,t)?.include;return Array.isArray(n)?n.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!d.extname(i))):!1}function pt(e,t){try{let r=JSON.parse(Ur(e,t));return r&&typeof r=="object"&&!Array.isArray(r)?r:null}catch{return null}}function Hr(e,t){let r=_(e,t),n=v(e,r);return n?n==="present":_r(t)}function Ur(e,t){let r=_(e,t);if(F(e)){let i=E(e,r);if(!i)throw Object.assign(new Error(`Snapshot file ${r} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return D(t,"TypeScript project config")}function Jr(e,t){let r=F(t);if(!r)return e.sys;let n=d.resolve(t),i=new Set(r),o=qr(n,r),s=e,a=c=>{let u=d.resolve(c);return S(n,u)?_(n,u):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(c){let u=a(c);return u===null?e.sys.fileExists(c):i.has(u)},readFile(c){let u=a(c);return u===null?e.sys.readFile(c):E(n,u)?.content.toString("utf8")},readDirectory(c,u,l,f,p){let h=d.resolve(c);return S(n,h)?s.matchFiles(h,u,l,f,e.sys.useCaseSensitiveFileNames,n,p,g=>o.get(d.resolve(g))??{files:[],directories:[]},g=>g):e.sys.readDirectory(c,u,l,f,p)}}}function qr(e,t){let r=new Map,n=new Map,i=o=>{r.has(o)||r.set(o,new Set),n.has(o)||n.set(o,new Set)};i(e);for(let o of t){let s=o.split("/"),a=e;for(let c=0;c<s.length-1;c+=1){let u=s[c];i(a),n.get(a).add(u),a=d.join(a,u),i(a)}r.get(a).add(s.at(-1))}return new Map([...r].map(([o,s])=>[o,{files:[...s].sort(),directories:[...n.get(o)??[]].sort()}]))}function _(e,t){let r=d.relative(e,t);return r?r.split(d.sep).join("/"):"."}function Kr(e,t){let r=d.relative(e,t);return!!r&&!r.startsWith("..")&&!d.isAbsolute(r)}var Q=64*1024*1024,B=class extends Error{constructor(r,n,i,o){super(`${r} ${JSON.stringify(n)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=r;this.inputPath=n;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="CODEBASEIQ_INPUT_TOO_LARGE"};function sn(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,r)=>t.localeCompare(r))}function ht(e,t,r={}){let n=C(t),i=V(e),o=nn(i,...n.split("/"));if(!S(i,o)||o===i)throw new m(t,"outside-project");let s=V(o);if(!S(i,s)||s===i)throw new m(t,"outside-project");let a=be(s);if(!a.isFile())throw new m(t,"not-a-file");let c={projectRoot:i,relativePath:n,absolutePath:s,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},u=r.maxBytes??Q;if(mt(u),c.size>u)throw new B(r.inputKind??"project file",c.relativePath,c.size,u);return c}function an(e,t,r={}){let n=C(t),i=v(e,n);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(n)} does not exist.`),{code:"ENOENT"});let c=E(e,n);if(!c)throw new m(n,"changed-during-read");let u=r.maxBytes??Q;if(mt(u),c.size>u)throw new B(r.inputKind??"project file",n,c.size,u);return Buffer.from(c.content)}let o=ht(e,t,r),s=r.maxBytes??Q,a=Vr(o.absolutePath,"r");try{let c=gt(a);if(!c.isFile()||c.dev!==o.device||c.ino!==o.inode||c.size!==o.size)throw new m(t,"changed-during-read");if(c.size>s)throw new B(r.inputKind??"project file",o.relativePath,c.size,s);let u=Zr(a),l=gt(a);if(l.dev!==c.dev||l.ino!==c.ino||l.size!==c.size||u.byteLength!==c.size)throw new m(t,"changed-during-read");return u}finally{Yr(a)}}function Bi(e,t,r={}){return an(e,t,r).toString("utf8")}function je(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function Li(e,t){try{return ht(e,t),!0}catch(r){if(je(r))return!1;throw r}}function mt(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function cn(e){return(F(e)??gn(e)??hn(e)).filter(t=>t&&!we(t)).sort()}function un(e,t={}){let r=(t.includePaths??[]).map(C),n=[...new Set([...cn(e),...r])].filter(c=>!we(c)).filter(c=>!t.language||_e(c,t.language,t.markerFiles)).filter(c=>!t.includePath||t.includePath(c)).sort(),i=V(e),o,s=()=>o??=ot(i),a=n.flatMap(c=>{let u=st(e,c);if(u)return[{path:c,size:u.fingerprintSize??u.size,hash:u.sha256}];let l=v(e,c);if(l==="present"){let g=E(e,c);if(g)return[{path:c,size:g.fingerprintSize??g.size,hash:g.sha256}]}let f=l===void 0?s():null,p=f?.lookup(c);if(p)return[{path:c,size:p.size,hash:p.hash}];let h=Pe(e,c);try{if(be(h).isSymbolicLink()){let Z=V(h),ee=rn(i,Z);if(ee===".."||ee.startsWith(`..${on}`)||tn(ee))throw new Error("external symlink");let Ce=en(h);return[{path:c,size:Buffer.byteLength(Ce),hash:ft("sha256").update("symlink\0").update(Ce).digest("hex")}]}let g=ft("sha256"),L=z(h,{inputKind:"project fingerprint input",maxBytes:Q},Z=>g.update(Z)),w=g.digest("hex");return f?.seed(c,{size:L,hash:w}),[{path:c,size:L,hash:w}]}catch(g){return je(g)?[]:[{path:c,size:-1,hash:"unreadable"}]}});return o?.persist(),a}function Ni(e,t,r){let n=pn(t,r),i=[...n.typescriptProjects.filter(s=>dn(e,s)),...n.clojureConfigPath?[n.clojureConfigPath]:[]],o=n.languages.includes("typescript")?dt(e,n.typescriptProjectMode,n.typescriptProjects):null;return{...n,files:un(e,{includePath:s=>{let a=oe(s,t,i);return a==="other"?!1:a!=="source"||!ln(s)||!o?!0:o.has(s)},includePaths:i})}}function ln(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function dn(e,t){let r;try{r=C(t)}catch{return!1}let n=v(e,r);if(n)return n==="present";try{return be(Pe(e,r)).isFile()}catch(i){if(je(i))return!1;throw i}}function pn(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:sn(t.typescriptProjects),clojureConfigPath:fn(t.clojureConfigPath)}}function fn(e){return e?.trim()||void 0}function gn(e){try{return Xr("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
4
4
|
`).filter(Boolean)}catch{return null}}function hn(e){let t=[],r=[""];for(;r.length>0;){let n=r.pop(),i=n?Pe(e,n):e,o;try{o=Qr(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=n?`${n}/${s.name}`:s.name;if(s.isDirectory()){we(a)||r.push(a);continue}t.push(a)}}return t}function we(e){let t=e.split("/");return e==="meta.json"||t[0]===".codebaseiq"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(r=>mn.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var mn=new Set([".git","node_modules",".codebaseiq-cache",".codebaseiq-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{Fe as a,Ee as b,xt as c,bt as d,j as e,ve as f,I as g,D as h,Pt as i,jt as j,wt as k,z as l,Ct as m,oe as n,wn as o,Cn as p,kt as q,vt as r,We as s,ae as t,R as u,He as v,G as w,W as x,m as y,ce as z,Tn as A,_n as B,Ue as C,Bn as D,S as E,C as F,Ge as G,A as H,de as I,Ze as J,qt as K,qn as L,Kn as M,Xn as N,Yn as O,Vn as P,he as Q,T as R,ni as S,ii as T,yr as U,oi as V,si as W,q as X,P as Y,zr as Z,B as _,sn as $,ht as aa,an as ba,Bi as ca,je as da,Li as ea,cn as fa,un as ga,Ni as ha,pn as ia};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-UQYQBLJX.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as o}from"./chunk-
|
|
1
|
+
import{a as o}from"./chunk-356EZBIP.js";import{b as i}from"./chunk-LMTSB3TB.js";import{y as l}from"./chunk-GVAF222T.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
|
|
2
2
|
WHERE relative_path IN (${a})
|
|
3
3
|
ORDER BY relative_path`,...s).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)),p=l(e,n,{onlyDocumented:!0,sort:!0}).map(({relativePath:t,...f})=>f),m=o(e,"forward",s).filter(t=>!e.isIgnored(t)),d=o(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:n,symbols:p,dependsOn:m,dependedOnBy:d}}function g(e,r){return y(e,r)}export{y as a,g as b};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-UW6KD57C.js.map
|