scip-query 0.21.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-4IYG2SKW.js +2 -0
- package/dist/call-graph-WQNXMNNN.js +2 -0
- package/dist/{chunk-5QM7QT5B.js → chunk-25GWKRUZ.js} +2 -2
- package/dist/chunk-2BTJALUS.js +454 -0
- package/dist/{chunk-4ZCLDH6T.js → chunk-2KVU55CW.js} +2 -2
- package/dist/{chunk-CQVDALWQ.js → chunk-2OXVP5U5.js} +2 -2
- package/dist/{chunk-I2LY3KN7.js → chunk-2RE5OCHZ.js} +2 -2
- package/dist/{chunk-5J3A6RBZ.js → chunk-2XCGSDIT.js} +2 -2
- package/dist/{chunk-4KIPF45P.js → chunk-2YC7YNKT.js} +2 -2
- package/dist/{chunk-ZNW5A5VX.js → chunk-3QXC54FQ.js} +2 -2
- package/dist/{chunk-SGSPCEFC.js → chunk-3TJY6M3B.js} +2 -2
- package/dist/chunk-42W3LFUK.js +13 -0
- package/dist/chunk-44T4DUAA.js +2 -0
- package/dist/{chunk-YBWE6J32.js → chunk-4GAQ6FI4.js} +2 -2
- package/dist/{chunk-OU6SDWAM.js → chunk-4HE7MVWD.js} +2 -2
- package/dist/{chunk-QN2AI3D2.js → chunk-4TQU4TX2.js} +2 -2
- package/dist/{chunk-OMVNRPST.js → chunk-56NQAEPJ.js} +2 -2
- package/dist/{chunk-O4PZFAXA.js → chunk-57N6LN2A.js} +2 -2
- package/dist/{chunk-7MUHSZGN.js → chunk-5H5WTJSD.js} +2 -2
- package/dist/{chunk-J4HUBIVF.js → chunk-5YRQIE2B.js} +2 -2
- package/dist/{chunk-3XQLJG7V.js → chunk-5ZMBRQFC.js} +2 -2
- package/dist/{chunk-H2RBDP5S.js → chunk-6HRZQLOI.js} +2 -2
- package/dist/{chunk-PJBYDCBQ.js → chunk-6NC3YSPY.js} +2 -2
- package/dist/{chunk-MLTSTKXD.js → chunk-6VEFRPTD.js} +2 -2
- package/dist/{chunk-JLZWYDCZ.js → chunk-7C26EKLZ.js} +2 -2
- package/dist/{chunk-LXMW6ZAX.js → chunk-7IQXARSQ.js} +2 -2
- package/dist/chunk-7JYHQAH2.js +22 -0
- package/dist/{chunk-YA72ZUKO.js → chunk-7KSO2OAP.js} +2 -2
- package/dist/{chunk-YT4IQBET.js → chunk-7U2YQSDE.js} +2 -2
- package/dist/{chunk-XDOEHEET.js → chunk-7XA3OM44.js} +2 -2
- package/dist/{chunk-BCTCADNB.js → chunk-7XZGZBSQ.js} +2 -2
- package/dist/{chunk-3KXFB2FM.js → chunk-7YQOCABQ.js} +2 -2
- package/dist/chunk-A77SCPW2.js +3 -0
- package/dist/chunk-AK3PYTIK.js +5 -0
- package/dist/{chunk-6X4KO5A7.js → chunk-AMIMMNA4.js} +2 -2
- package/dist/{chunk-PWEQ6CZZ.js → chunk-AQ2PORIO.js} +2 -2
- package/dist/{chunk-E6N6YTVM.js → chunk-ARVO6TTW.js} +2 -2
- package/dist/{chunk-U7DOYZDH.js → chunk-AUY5BL74.js} +2 -2
- package/dist/{chunk-B3AREUQK.js → chunk-AYPDH2LU.js} +2 -2
- package/dist/{chunk-HR5JYLVV.js → chunk-AZS7YPCB.js} +2 -2
- package/dist/{chunk-ZQUNCTEZ.js → chunk-BDGTPN27.js} +2 -2
- package/dist/{chunk-DZNWXJN2.js → chunk-BDHFVH2M.js} +2 -2
- package/dist/{chunk-743MEVFJ.js → chunk-BECZLYNU.js} +2 -2
- package/dist/{chunk-4IASLUOP.js → chunk-BJT7LSPK.js} +2 -2
- package/dist/{chunk-X5MWO4DM.js → chunk-BTVKZGWT.js} +2 -2
- package/dist/{chunk-HYU4W353.js → chunk-BUTEIZKP.js} +2 -2
- package/dist/{chunk-UXNXOMXJ.js → chunk-BVFYEEBH.js} +2 -2
- package/dist/{chunk-UM56ZET4.js → chunk-BWVQP3LB.js} +2 -2
- package/dist/chunk-BYDAFMSR.js +57 -0
- package/dist/{chunk-P3UFF22M.js → chunk-C76O5MDS.js} +2 -2
- package/dist/chunk-C7IJMOFP.js +134 -0
- package/dist/{chunk-IM23CSG5.js → chunk-CBBHFNLX.js} +2 -2
- package/dist/{chunk-IZKJQQCQ.js → chunk-CKRWA452.js} +2 -2
- package/dist/{chunk-YLNCTPOI.js → chunk-CLG6DWVS.js} +2 -2
- package/dist/{chunk-DXEJ4FLZ.js → chunk-D2MVJSP4.js} +8 -8
- package/dist/chunk-D35XIZGN.js +2 -0
- package/dist/{chunk-AQF35NGT.js → chunk-DEAB5TGT.js} +2 -2
- package/dist/{chunk-7G2WIVIX.js → chunk-DJAO2OZJ.js} +2 -2
- package/dist/{chunk-PRLU3I7G.js → chunk-DKM723YF.js} +4 -4
- package/dist/{chunk-RSUH7G5T.js → chunk-DPWKKNKI.js} +2 -2
- package/dist/chunk-E44IVWIJ.js +367 -0
- package/dist/{chunk-W7HN6V4E.js → chunk-EDMB6SSO.js} +2 -2
- package/dist/{chunk-YCXQQ3YB.js → chunk-EELG7D3Q.js} +2 -2
- package/dist/{chunk-T2PBOVDI.js → chunk-EELPBR7E.js} +2 -2
- package/dist/{chunk-PAZSBPJR.js → chunk-EETGXQY7.js} +2 -2
- package/dist/{chunk-DUDUIT5P.js → chunk-ENWQWA2R.js} +2 -2
- package/dist/{chunk-QH5Q6M5C.js → chunk-ERCYGVAM.js} +2 -2
- package/dist/{chunk-ZGDHC5AT.js → chunk-EWWY2ZFL.js} +2 -2
- package/dist/{chunk-LJMWILX6.js → chunk-F24G5NBE.js} +2 -2
- package/dist/{chunk-XNF5T4T2.js → chunk-F24QUEQP.js} +2 -2
- package/dist/{chunk-IH3K5J6K.js → chunk-FBCVASUG.js} +2 -2
- package/dist/{chunk-EPLE5O5O.js → chunk-FELGD32K.js} +2 -2
- package/dist/{chunk-PU6XDQ2X.js → chunk-FFJQZG6J.js} +5 -5
- package/dist/{chunk-JGMD6JGB.js → chunk-FGNCOQUX.js} +2 -2
- package/dist/chunk-FKGQOTKD.js +2 -0
- package/dist/{chunk-27OUNZW5.js → chunk-GDRJB3SB.js} +2 -2
- package/dist/chunk-GH5YSGZL.js +5 -0
- package/dist/{chunk-IHGK3SZ7.js → chunk-GIQ6CSL4.js} +2 -2
- package/dist/{chunk-ITF3CWS5.js → chunk-GPGRZJ3R.js} +2 -2
- package/dist/{chunk-EJHNTAEE.js → chunk-GQIDEID3.js} +2 -2
- package/dist/{chunk-UEQORB2A.js → chunk-GRX7JOXQ.js} +2 -2
- package/dist/{chunk-6QN4FYQW.js → chunk-GVOMSPGL.js} +2 -2
- package/dist/{chunk-NT4NVEHU.js → chunk-GY7CCCEZ.js} +2 -2
- package/dist/{chunk-BVR44XXB.js → chunk-H7CG6LOE.js} +2 -2
- package/dist/{chunk-67FK5KGV.js → chunk-HCVJR2V4.js} +2 -2
- package/dist/{chunk-FOP7HD6H.js → chunk-HG722PO7.js} +2 -2
- package/dist/{chunk-YR7VRWNX.js → chunk-HISEUIL2.js} +2 -2
- package/dist/{chunk-Y2S4YNLH.js → chunk-HXOU4XNH.js} +2 -2
- package/dist/{chunk-DZA7MQMU.js → chunk-I6UTXNHU.js} +2 -2
- package/dist/{chunk-QZCACNV5.js → chunk-IJMD6BRI.js} +2 -2
- package/dist/{chunk-QGVUPYBC.js → chunk-IKVNEGTW.js} +2 -2
- package/dist/chunk-IMKZEXZG.js +2 -0
- package/dist/{chunk-LGVTIZPV.js → chunk-ISIQLPJ2.js} +2 -2
- package/dist/{chunk-BYXWXLKM.js → chunk-ISWFRGJ6.js} +2 -2
- package/dist/chunk-IW5XQG5G.js +2 -0
- package/dist/{chunk-ZMS4YCY7.js → chunk-IXESDH3J.js} +2 -2
- package/dist/{chunk-K63CAPS2.js → chunk-JAT6C3VX.js} +2 -2
- package/dist/{chunk-U2MNECDU.js → chunk-JFQBRL3J.js} +2 -2
- package/dist/{chunk-4SZJF4GK.js → chunk-JHH5SCZ3.js} +2 -2
- package/dist/{chunk-AAOEROT3.js → chunk-JJ62MTQH.js} +2 -2
- package/dist/chunk-JT6XX7QY.js +8 -0
- package/dist/{chunk-OY7PCALC.js → chunk-JUN5DOAK.js} +2 -2
- package/dist/{chunk-DXYMTQZ4.js → chunk-K3XFWJI2.js} +2 -2
- package/dist/{chunk-ZP2WUVZ5.js → chunk-KFVSJX25.js} +2 -2
- package/dist/{chunk-ND3BWIVN.js → chunk-KQHJEU6V.js} +2 -2
- package/dist/{chunk-KGKCJFWZ.js → chunk-KZYID5KV.js} +2 -2
- package/dist/{chunk-2LJLEM5B.js → chunk-LO5JSW2C.js} +2 -2
- package/dist/{chunk-CNT4ND5O.js → chunk-LRI5OMPE.js} +2 -2
- package/dist/{chunk-FCGMQETU.js → chunk-LXQUF2RP.js} +2 -2
- package/dist/{chunk-FSPENGSU.js → chunk-MHIEP7EG.js} +2 -2
- package/dist/{chunk-LIWIV26I.js → chunk-MSR2QRUE.js} +2 -2
- package/dist/chunk-N7FP5H5U.js +57 -0
- package/dist/{chunk-527HV7JY.js → chunk-NEIQPFBI.js} +2 -2
- package/dist/chunk-NK3JMP22.js +2 -0
- package/dist/{chunk-DK6MB565.js → chunk-NRBNAECH.js} +2 -2
- package/dist/{chunk-4HQYNZ3P.js → chunk-NVSZNESQ.js} +2 -2
- package/dist/{chunk-QLWZUFDT.js → chunk-OJNK5ALA.js} +2 -2
- package/dist/{chunk-MRXBLYRE.js → chunk-OPSAW5DT.js} +2 -2
- package/dist/{chunk-4TOU7HHQ.js → chunk-OTSPRVNW.js} +2 -2
- package/dist/{chunk-IQMGNIGY.js → chunk-OXYAWIEA.js} +2 -2
- package/dist/chunk-OZETODHH.js +2 -0
- package/dist/chunk-PBUH2P5S.js +3 -0
- package/dist/{chunk-5BJPJUXF.js → chunk-PIFTZEEM.js} +2 -2
- package/dist/{chunk-C52Q3JEQ.js → chunk-PLJUQFQN.js} +2 -2
- package/dist/{chunk-NODZYYGC.js → chunk-PLYUVM4F.js} +2 -2
- package/dist/{chunk-47WX6UC4.js → chunk-PXXYQK55.js} +2 -2
- package/dist/{chunk-SBFDPHKH.js → chunk-Q55NF3ZG.js} +2 -2
- package/dist/{chunk-N4EFQIRX.js → chunk-Q5TA4OY4.js} +2 -2
- package/dist/{chunk-HW7FASEL.js → chunk-Q6T2CAJL.js} +2 -2
- package/dist/chunk-Q7GBK5T7.js +81 -0
- package/dist/{chunk-CXT3GZSQ.js → chunk-QKT4UI2Y.js} +2 -2
- package/dist/{chunk-DGM2RJ3I.js → chunk-QLBSG7U5.js} +2 -2
- package/dist/chunk-QWKHW6VZ.js +2 -0
- package/dist/{chunk-3T5U2EQ2.js → chunk-R6M456QG.js} +2 -2
- package/dist/{chunk-RZWBTKXO.js → chunk-RDULNRSJ.js} +2 -2
- package/dist/{chunk-YKHL4J3G.js → chunk-RHHCLWQ6.js} +2 -2
- package/dist/{chunk-YF25RQER.js → chunk-RNKPYYYE.js} +2 -2
- package/dist/{chunk-XKM5D2XS.js → chunk-RPL3ARU7.js} +2 -2
- package/dist/{chunk-XFRHBAIT.js → chunk-RYOYJMGF.js} +2 -2
- package/dist/chunk-SB25YMEQ.js +2 -0
- package/dist/{chunk-SRIZDEWX.js → chunk-SVHTMVA4.js} +2 -2
- package/dist/{chunk-AFRS7WJU.js → chunk-SWK4XPUS.js} +2 -2
- package/dist/{chunk-YDTK77JP.js → chunk-T6QD2ZQB.js} +2 -2
- package/dist/{chunk-Z2QB75BS.js → chunk-TAYD3AE7.js} +2 -2
- package/dist/chunk-TD7VKJ2Y.js +117 -0
- package/dist/{chunk-K2DZCH2K.js → chunk-TH6IC56G.js} +2 -2
- package/dist/{chunk-FIO44MVK.js → chunk-TKDNDQA7.js} +2 -2
- package/dist/{chunk-Q4MRRB3C.js → chunk-TNG2FYS5.js} +2 -2
- package/dist/chunk-TQZV7KV4.js +2 -0
- package/dist/{chunk-NSDPPUDY.js → chunk-TUQIPUDS.js} +2 -2
- package/dist/chunk-TUSPIVZ3.js +4 -0
- package/dist/{chunk-RNKRYK6B.js → chunk-U2N2KE7A.js} +2 -2
- package/dist/{chunk-G47MFF47.js → chunk-UAQ4T73O.js} +2 -2
- package/dist/{chunk-5KIJMEPC.js → chunk-UDY7MIAW.js} +2 -2
- package/dist/{chunk-MLTKGHD2.js → chunk-URSGGIZX.js} +2 -2
- package/dist/{chunk-IGBQVEHE.js → chunk-UT7TADJX.js} +2 -2
- package/dist/{chunk-Z67JOKRE.js → chunk-V4NG5OMS.js} +105 -105
- package/dist/{chunk-OA2BO4DR.js → chunk-VMWUV6WB.js} +2 -2
- package/dist/{chunk-PX6QNUYF.js → chunk-VTCIYFEK.js} +2 -2
- package/dist/{chunk-6DO3VBLV.js → chunk-VU6LIWHT.js} +2 -2
- package/dist/{chunk-CTO3TRX7.js → chunk-VUSKPCUB.js} +2 -2
- package/dist/{chunk-V6XENWOF.js → chunk-VXJJTQYE.js} +2 -2
- package/dist/{chunk-BM4OTGSY.js → chunk-VZ7NXSHV.js} +2 -2
- package/dist/{chunk-ARGPDW2Y.js → chunk-WHADK6OS.js} +2 -2
- package/dist/chunk-WN3TCGJ4.js +2 -0
- package/dist/{chunk-GBZCVYWA.js → chunk-WOOAY3PA.js} +2 -2
- package/dist/{chunk-FLSVYEPL.js → chunk-WSLEJSFR.js} +2 -2
- package/dist/{chunk-BMKTDJI6.js → chunk-WYZIHUPZ.js} +2 -2
- package/dist/{chunk-WZ7V4BQV.js → chunk-XE33FV5W.js} +2 -2
- package/dist/{chunk-JO6FK3Q5.js → chunk-XFMVKFSF.js} +2 -2
- package/dist/{chunk-3YETOKNO.js → chunk-XGGBK66W.js} +2 -2
- package/dist/{chunk-BZCRHP46.js → chunk-XJX6LGHL.js} +2 -2
- package/dist/{chunk-OFZVFIDF.js → chunk-XN22RGSR.js} +2 -2
- package/dist/{chunk-VJAD5WX5.js → chunk-XSWYJCAK.js} +2 -2
- package/dist/{chunk-WV6R37XV.js → chunk-XU75YQN4.js} +2 -2
- package/dist/{chunk-UBETC3Q2.js → chunk-Y2VM4CJC.js} +2 -2
- package/dist/{chunk-7YZGSLW6.js → chunk-Y334QQU5.js} +2 -2
- package/dist/{chunk-TP2X2C2Y.js → chunk-YAGYMBEX.js} +2 -2
- package/dist/{chunk-KBIC6JHJ.js → chunk-YIHNPKWD.js} +2 -2
- package/dist/{chunk-5Z2H76VD.js → chunk-YXPUP5G2.js} +2 -2
- package/dist/{chunk-G6VV7ROY.js → chunk-Z2AWCTN6.js} +2 -2
- package/dist/{chunk-O3EX5STE.js → chunk-Z2PZVKPR.js} +2 -2
- package/dist/{chunk-OG5UK2K7.js → chunk-ZAZGGSM3.js} +2 -2
- package/dist/{chunk-GTZFKDP3.js → chunk-ZGW4HLPD.js} +2 -2
- package/dist/chunk-ZOXKSQQB.js +2 -0
- package/dist/{chunk-KFFQURUZ.js → chunk-ZPASRBLF.js} +2 -2
- package/dist/{chunk-WZRNEVYC.js → chunk-ZYM4HOFA.js} +2 -2
- package/dist/{chunk-FUUDUAKM.js → chunk-ZZ3Z7D56.js} +2 -2
- package/dist/cli-main.js +2 -2
- package/dist/code-EQJFDT6I.js +2 -0
- package/dist/code-result-json-7UWIWBOO.js +2 -0
- package/dist/{command-descriptors-6INSCKLW.js → command-descriptors-ORNTVNYV.js} +89 -89
- package/dist/dataflow-6VL54GX5.js +2 -0
- package/dist/dependence-slice-DT2NUHD2.js +2 -0
- package/dist/deps-DB7H5IKC.js +2 -0
- package/dist/direct-navigation-O3LUAYWQ.js +3 -0
- package/dist/entry-map-6K62RV3D.js +2 -0
- package/dist/files-MSLD7MO6.js +2 -0
- package/dist/hierarchy-IVBXAKFA.js +2 -0
- package/dist/imports-FRAVZ3Y2.js +2 -0
- package/dist/index.js +1 -1
- package/dist/members-KJOJDYGO.js +2 -0
- package/dist/methods-2AYABBT3.js +2 -0
- package/dist/output-continuation-command-JHMPH6NC.js +3 -0
- package/dist/project-reindex-HYO4WD7Z.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +11 -0
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +2 -2
- package/dist/refs-ARMA6XUJ.js +2 -0
- package/dist/{refs-pagination-SRCUOYRD.js → refs-pagination-VUGIWN6U.js} +2 -2
- package/dist/reindex-worker.js +64 -22
- package/dist/reindex.js +74 -32
- package/dist/runtime.js +1 -1
- 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/slice-YOB5YFAM.js +2 -0
- package/dist/surface-VY5EFWTW.js +2 -0
- package/dist/{symbol-resolution-SVSMX4RN.js → symbol-resolution-DGQN4XIV.js} +2 -2
- package/dist/system-2KQ3QD2P.js +2 -0
- package/dist/trace-HTIPTXAE.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-5FV3VQI7.js +2 -0
- package/dist/watch-server.js +3 -3
- package/package.json +1 -1
- package/dist/by-kind-XXGZGNZ6.js +0 -2
- package/dist/call-graph-VGY3R4L3.js +0 -2
- package/dist/chunk-3XZELASU.js +0 -2
- package/dist/chunk-63TFRBMB.js +0 -2
- package/dist/chunk-6LS3IG2I.js +0 -13
- package/dist/chunk-7Z4GMCHM.js +0 -117
- package/dist/chunk-ANCHW2R4.js +0 -57
- package/dist/chunk-C7WSQA6A.js +0 -21
- package/dist/chunk-DNPETNXT.js +0 -2
- package/dist/chunk-E7CJ6O72.js +0 -2
- package/dist/chunk-FYCH2EYQ.js +0 -2
- package/dist/chunk-GSHTVE56.js +0 -3
- package/dist/chunk-JSHDCVUM.js +0 -81
- package/dist/chunk-L7WRUNKJ.js +0 -2
- package/dist/chunk-LFWB7TOJ.js +0 -2
- package/dist/chunk-MFBVUQJZ.js +0 -2
- package/dist/chunk-MR4ZKWO6.js +0 -57
- package/dist/chunk-NP4JFCLE.js +0 -133
- package/dist/chunk-NQXWWE6S.js +0 -8
- package/dist/chunk-O2VY47Y5.js +0 -325
- package/dist/chunk-SIGVQT43.js +0 -2
- package/dist/chunk-UAQQR55F.js +0 -2
- package/dist/chunk-VRJG7N3I.js +0 -453
- package/dist/chunk-WCIKJ2E3.js +0 -3
- package/dist/chunk-WEXQYJY3.js +0 -5
- package/dist/chunk-WOPZX5GM.js +0 -2
- package/dist/chunk-XDQX6LDT.js +0 -4
- package/dist/chunk-XIPGCT3D.js +0 -5
- package/dist/chunk-Z2KGMIL4.js +0 -2
- package/dist/code-AXLJBZ6T.js +0 -2
- package/dist/code-result-json-CTZHAQXJ.js +0 -2
- package/dist/dataflow-AFXY423Q.js +0 -2
- package/dist/dependence-slice-2G4X6VSJ.js +0 -2
- package/dist/deps-LMCAV5DO.js +0 -2
- package/dist/direct-navigation-2ONV22Y2.js +0 -3
- package/dist/entry-map-ZOC3VXO5.js +0 -2
- package/dist/files-WJQJLHMH.js +0 -2
- package/dist/hierarchy-ASNIHAX4.js +0 -2
- package/dist/imports-JICEKDKK.js +0 -2
- package/dist/members-C5H2K3MS.js +0 -2
- package/dist/methods-KZOZHSD4.js +0 -2
- package/dist/output-continuation-command-NX3RH3TP.js +0 -3
- package/dist/project-reindex-A2SXUH2H.js +0 -3
- package/dist/refs-ZOORVRQC.js +0 -2
- package/dist/slice-NOTBWA7S.js +0 -2
- package/dist/surface-BTBCLKNA.js +0 -2
- package/dist/system-2EIUFP6B.js +0 -2
- package/dist/trace-BB2GHQPG.js +0 -2
- package/dist/value-flow-OA7AHSUG.js +0 -2
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{a as Z}from"./chunk-JFQBRL3J.js";import{p as gt}from"./chunk-AYPDH2LU.js";import{d as ht}from"./chunk-KK7GPALL.js";import{b as yt}from"./chunk-Q6T2CAJL.js";import{A as xe,t as _}from"./chunk-TD7VKJ2Y.js";import{a as ge,f as be,g as k,h as D,j as M,k as lt,l as X,m as dt,q as pt,r as ft,w as mt,x as j}from"./chunk-42W3LFUK.js";import{A as st,C as O,D as ut,G as ct,N as Se,z as ve}from"./chunk-7JYHQAH2.js";import{A as ot,B as he,C as Me,c as Q,i as re,w as ie,y as ae}from"./chunk-Q7GBK5T7.js";function Re(e){let t=e.replaceAll("\\","/");return yt(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}import mn from"better-sqlite3";var Ne="scip_query_runtime_boundaries",W="scip_query_runtime_observations",Be="scip_query_runtime_relation_groups",Ie="scip_query_runtime_relation_participants";function yn(e,t){let n=new mn(e);try{n.exec(`
|
|
2
|
+
CREATE TABLE IF NOT EXISTS ${Ne} (
|
|
3
|
+
singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
|
|
4
|
+
schema_version INTEGER NOT NULL,
|
|
5
|
+
extractor_version TEXT NOT NULL,
|
|
6
|
+
payload TEXT NOT NULL
|
|
7
|
+
)
|
|
8
|
+
`),gn(n),n.transaction(()=>{n.prepare(`INSERT OR REPLACE INTO ${Ne} (singleton, schema_version, extractor_version, payload) VALUES (1, ?, ?, ?)`).run(t.schemaVersion,t.extractorVersion,JSON.stringify(t)),n.prepare(`DELETE FROM ${W}`).run(),n.prepare(`DELETE FROM ${Ie}`).run(),n.prepare(`DELETE FROM ${Be}`).run();let r=n.prepare(`INSERT INTO ${W}
|
|
9
|
+
(id, protocol, action, role, strength, source_scope, resolution, file, start_line, end_line, owner_symbol, payload)
|
|
10
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let s of t.observations)r.run(s.id,s.protocol,s.action,s.role,s.strength,s.sourceScope,s.resolution,s.source.file,s.source.startLine,s.source.endLine,s.owner.symbol,JSON.stringify(s));let i=n.prepare(`INSERT INTO ${Be} (id, protocol, join_rule, normalized_key, payload) VALUES (?, ?, ?, ?, ?)`),a=n.prepare(`INSERT INTO ${Ie} (group_id, observation_id, participant_role) VALUES (?, ?, ?)`);for(let s of t.relationGroups){i.run(s.id,s.protocol,s.joinRule,s.normalizedKey,JSON.stringify(s));for(let o of s.producerIds)a.run(s.id,o,"producer");for(let o of s.consumerIds)a.run(s.id,o,"consumer");for(let o of s.declarationIds)a.run(s.id,o,"declaration")}})()}finally{n.close()}}function hn(e,t={}){if(!vn(e,W))return vt(e)?.observations??[];let n=[],r=[];return Ce(n,r,"protocol",t.protocols),Ce(n,r,"action",t.actions),Ce(n,r,"source_scope",t.sourceScopes),Ce(n,r,"file",t.files),e.all(`SELECT payload FROM ${W}${n.length>0?` WHERE ${n.join(" AND ")}`:""} ORDER BY file, start_line, id`,...r).flatMap(a=>bn(a.payload))}function gn(e){e.exec(`
|
|
11
|
+
CREATE TABLE IF NOT EXISTS ${W} (
|
|
12
|
+
id TEXT PRIMARY KEY,
|
|
13
|
+
protocol TEXT NOT NULL,
|
|
14
|
+
action TEXT NOT NULL,
|
|
15
|
+
role TEXT NOT NULL,
|
|
16
|
+
strength TEXT NOT NULL,
|
|
17
|
+
source_scope TEXT NOT NULL,
|
|
18
|
+
resolution TEXT NOT NULL,
|
|
19
|
+
file TEXT NOT NULL,
|
|
20
|
+
start_line INTEGER NOT NULL,
|
|
21
|
+
end_line INTEGER NOT NULL,
|
|
22
|
+
owner_symbol TEXT,
|
|
23
|
+
payload TEXT NOT NULL
|
|
24
|
+
);
|
|
25
|
+
CREATE INDEX IF NOT EXISTS idx_runtime_observations_protocol_action_scope
|
|
26
|
+
ON ${W}(protocol, action, source_scope);
|
|
27
|
+
CREATE INDEX IF NOT EXISTS idx_runtime_observations_file_line
|
|
28
|
+
ON ${W}(file, start_line);
|
|
29
|
+
|
|
30
|
+
CREATE TABLE IF NOT EXISTS ${Be} (
|
|
31
|
+
id TEXT PRIMARY KEY,
|
|
32
|
+
protocol TEXT NOT NULL,
|
|
33
|
+
join_rule TEXT NOT NULL,
|
|
34
|
+
normalized_key TEXT NOT NULL,
|
|
35
|
+
payload TEXT NOT NULL
|
|
36
|
+
);
|
|
37
|
+
CREATE INDEX IF NOT EXISTS idx_runtime_groups_protocol_key
|
|
38
|
+
ON ${Be}(protocol, join_rule, normalized_key);
|
|
39
|
+
|
|
40
|
+
CREATE TABLE IF NOT EXISTS ${Ie} (
|
|
41
|
+
group_id TEXT NOT NULL,
|
|
42
|
+
observation_id TEXT NOT NULL,
|
|
43
|
+
participant_role TEXT NOT NULL,
|
|
44
|
+
PRIMARY KEY (group_id, observation_id, participant_role)
|
|
45
|
+
);
|
|
46
|
+
CREATE INDEX IF NOT EXISTS idx_runtime_participants_observation
|
|
47
|
+
ON ${Ie}(observation_id, participant_role);
|
|
48
|
+
`)}function vn(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function Ce(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function bn(e){try{return[JSON.parse(e)]}catch{return[]}}function vt(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",Ne))return null;let n=e.get(`SELECT schema_version, payload FROM ${Ne} WHERE singleton = 1`);if(!n||n.schema_version!==2)return null;try{let r=JSON.parse(n.payload);return r.schemaVersion===2&&Array.isArray(r.observations)&&Array.isArray(r.relationGroups)&&Array.isArray(r.links)?r:null}catch{return null}}import{createHash as me}from"crypto";import{setImmediate as Wr}from"timers/promises";import{createRequire as Yr}from"module";import{createHash as An}from"crypto";var Pe=8;function ee(e,t,n){return je(bt(e,t,Ue(n),0,new Set))}function ze(e,t,n){return He(e,t,n,0,new Set)}function bt(e,t,n,r,i){if(r>Pe)return[];let a=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return a?St(e,t,a[1],a[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?xt(e,t,n,r,i):[]}function St(e,t,n,r,i,a){let s=[];for(let o of He(e,t,n,i+1,new Set(a))){let l=M(o.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let d=u.childForFieldName("key")??u.namedChild(0);if(Nn(d)!==r)continue;let c=u.childForFieldName("value")??u.namedChild(1);c&&s.push(...bt(e,o.definition.relativePath,Ue(c.text),i+1,new Set(a)));continue}if(/(?:method|function)/u.test(u.type)){if((u.childForFieldName("name")??u.namedChild(0))?.text!==r)continue;let c=Rn(e,o.definition.relativePath,r,u);s.push(...c.length>0?c:[Sn(o.definition,r,u)]);continue}if(u.type==="spread_element"){let d=u.namedChild(0);if(!d)continue;for(let c of He(e,o.definition.relativePath,Ue(d.text),i+1,new Set(a)))s.push(...St(e,c.definition.relativePath,c.definition.leaf,r,i+1,new Set(a)))}}}return je(s)}function Sn(e,t,n){return{documentId:e.documentId,symbolId:-1,symbol:`source-callable:${e.relativePath}:${n.startPosition.row}:${t}`,relativePath:e.relativePath,startLine:n.startPosition.row,startChar:n.startPosition.column,endLine:n.endPosition.row,endChar:n.endPosition.column,leaf:t,parentTypeName:e.leaf,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:e.symbol}}function He(e,t,n,r,i){return r>Pe||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:xt(e,t,n,r,i).flatMap(a=>{let s=O(e,a.relativePath)?.rootNode,o=s?Cn(s,a.leaf):null;return o?[{definition:a,initializer:o}]:[]})}function xt(e,t,n,r,i){if(r>Pe)return[];let a=`${t}\0${n}`;if(i.has(a))return[];i.add(a);let s=_(e,t).filter(u=>u.leaf===n);if(s.length>0)return s;let o=xn(e,t,n);if(o.length>0)return o;let l=j(e,t).find(u=>u.localName===n&&u.sourcePath);if(l?.sourcePath){let u=l.kind==="namespace"||l.importedName==="default"?n:l.importedName;return Ve(e,l.sourcePath,u,r+1,new Set(i))}return Ve(e,t,n,r+1,new Set(i))}function xn(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(dt(e,t)?.callables??[]).filter(i=>i.name===n).map(i=>({documentId:r,symbolId:-1,symbol:`source-callable:${t}:${i.startLine}:${n}`,relativePath:t,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:n,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}))}function Ve(e,t,n,r,i){if(r>Pe)return[];let a=_(e,t).filter(s=>s.leaf===n);return a.length>0?a:je(mt(e,t).flatMap(s=>s.sourcePath?s.kind==="named"&&!s.names.includes(n)?[]:Ve(e,s.sourcePath,n,r+1,new Set(i)):[]))}function Rn(e,t,n,r){return _(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function Cn(e,t){let n=null;return k(e,r=>{n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Nn(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function Ue(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function je(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}var Bn=8;function V(e,t){return t?te(e,t,0,new Set):null}function te(e,t,n,r){if(n>Bn)return U(t,"value-evaluation-depth");let i=M(t),a=Tn(i);if(a)return _n(e.file,i,a.term,a.value,a.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let l=i.namedChildren.map(u=>te(e,u,n+1,new Set(r)));if(l.length>=2&&l.every(u=>u!==null)){let u={kind:"concat",parts:l.map(c=>c.term)},d=l.map(c=>c.value).join("");return $n(e.file,i,u,d,l.some(c=>c.precision!=="literal")?"constrained-pattern":"literal",l)}}let s=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))return En(e,s,i,n,r);let o=Ln(i);return o?Fn(e,o.base,o.properties,i,n,r):i.type==="call_expression"||i.type==="call"?In(e,i,n,r):U(i,`unsupported-expression:${i.type}`)}function In(e,t,n,r){let a=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",s=Pn(e,a);if(s.length!==1)return U(t,s.length===0?"call-target-unresolved":"call-target-ambiguous");let o=s[0],l=`${o.relativePath}\0${o.symbol}`;if(r.has(l))return U(t,"call-return-cycle");let u=O(e.db,o.relativePath)?.rootNode;if(!u)return U(t,"call-target-unparsed");let d=D(u,o.startLine,o.endLine);if(!d)return U(t,"call-target-syntax-unavailable");let c=wn(d);if(!c)return U(t,"call-return-not-single-expression");let p=new Set(r);p.add(l);let f=te({db:e.db,file:o.relativePath,root:u},c,n+1,p);return f?we(t,"bounded-call-return",f,o.symbol):U(t,"call-return-unresolved")}function Pn(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=_(e.db,e.file).filter(s=>s.isFunctionLike&&s.leaf===t);if(i.length>0)return i;let a=j(e.db,e.file).find(s=>s.localName===t&&s.sourcePath&&s.kind!=="namespace");return a?.sourcePath?Z(e.db,a.sourcePath,a.importedName==="default"?t:a.importedName).filter(s=>s.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=j(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?Z(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function wn(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return Ct(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function Ct(e,t,n){if(!(t!==e&&(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function"))){if(t.type==="return_statement"){n.push(t);return}for(let r of t.namedChildren)Ct(e,r,n)}}function En(e,t,n,r,i){let a=`${e.file}\0${t}`;if(i.has(a))return U(n,"value-cycle");i.add(a);let s=Ge(e.root,t);if(s){let g=te(e,s,r+1,i);return g?we(n,"local-constant",g):U(n,"non-foldable-local")}let o=j(e.db,e.file).find(g=>g.localName===t&&g.sourcePath);if(!o?.sourcePath)return H(n,t,"unresolved-identifier");if(o.kind==="namespace")return H(n,t,"namespace-import-requires-property");let l=o.importedName==="default"?t:o.importedName,u=Z(e.db,o.sourcePath,l);if(u.length!==1)return H(n,t,u.length===0?"import-definition-missing":"import-definition-ambiguous");let d=u[0],c=O(e.db,d.relativePath)?.rootNode;if(!c)return H(n,d.symbol,"import-definition-unparsed");let p=Ge(c,d.leaf);if(!p)return H(n,d.symbol,"import-definition-non-value");let f=te({db:e.db,file:d.relativePath,root:c},p,r+1,i);return f?we(n,"imported-constant",f,d.symbol):H(n,d.symbol,"import-value-unresolved")}function Fn(e,t,n,r,i,a){let s=j(e.db,e.file).find(f=>f.localName===t&&f.sourcePath),o=e.file,l=t,u;if(s?.sourcePath){s.kind==="namespace"?(l=n[0]??"",n=n.slice(1)):l=s.importedName==="default"?t:s.importedName;let f=Z(e.db,s.sourcePath,l);if(f.length!==1)return H(r,`${t}.${n.join(".")}`,f.length===0?"member-definition-missing":"member-definition-ambiguous");o=f[0].relativePath,l=f[0].leaf,u=f[0].symbol}let d=o===e.file?e.root:O(e.db,o)?.rootNode;if(!d)return H(r,u??t,"member-definition-unparsed");let c=Ge(d,l);if(!c)return H(r,u??t,"member-base-non-value");for(let f of n){let g=M(c);if(c=On(g,f),!c)return H(r,u??`${t}.${n.join(".")}`,`member-property-missing:${f}`)}let p=te({db:e.db,file:o,root:d},c,i+1,a);return p?we(r,"member-constant",p,u):H(r,u??t,"member-value-unresolved")}function Tn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);if(n!=="`"||!r.includes("${"))return{term:{kind:"literal",value:r},value:r,precision:"literal"};let i=[],a=0,s=/\$\{([^}]*)\}/gu;for(let o of r.matchAll(s)){let l=o.index??0;l>a&&i.push({kind:"literal",value:r.slice(a,l)}),i.push({kind:"unknown",reason:`template-hole:${o[1]?.trim()||"expression"}`}),a=l+o[0].length}return a<r.length&&i.push({kind:"literal",value:r.slice(a)}),{term:{kind:"pattern",language:"template",value:r.replace(s,"{}")},value:r.replace(s,"{}"),precision:"constrained-pattern"}}function _n(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:Ee("direct-literal","direct",e,t)}}function $n(e,t,n,r,i,a){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...Ee("constant-concatenation","mechanically-derived",e,t),inputFactIds:a.flatMap(s=>s.derivation.inputFactIds),sourceSpans:a.flatMap(s=>s.derivation.sourceSpans)}}}function we(e,t,n,r){return n.evidence==="expression"?{...n,derivation:{kind:"heuristic",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}:{...n,evidence:"constant",derivation:{kind:"mechanically-derived",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}}function H(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:Ee(n,"heuristic","",e)}}function U(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:Ee(t,"heuristic","",e)}}function Ee(e,t,n,r){return{kind:t,rule:e,ruleVersion:"1",inputFactIds:[],sourceSpans:n?[{file:n,startLine:r.startPosition.row,endLine:r.endPosition.row}]:[]}}function Ln(e){let t=e.text.replace(/\s+/gu,"");if(!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/u.test(t))return null;let[n,...r]=t.split(".");return n?{base:n,properties:r}:null}var Rt=new WeakMap;function kn(e){let t=Rt.get(e);if(t)return t;let n=new Map;return k(e,r=>{if(r.type!=="variable_declarator")return;let a=(r.childForFieldName("name")??r.namedChild(0))?.text.trim();if(!a||n.has(a))return;let s=r.parent;if(!s||s.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(s.text))return;let o=r.childForFieldName("value")??r.namedChild(1);o&&n.set(a,o)}),Rt.set(e,n),n}function Ge(e,t){return kn(e).get(t)??null}function On(e,t){for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")!==t))return n.childForFieldName("value")??n.namedChild(1);return null}var Dn=new WeakMap,Tt=new Set(["delete","get","head","options","patch","post","put"]),Mn=/(?:^|\.)(?:app|router|server)$/u,Hn=new Set(["findFirst","findMany","findUnique","from","get","select"]),Vn=new Set(["create","delete","insert","remove","update","upsert"]),Un=new Set(["execute","query","raw"]),Nt=/(?:\b(?:name|id)|['"`](?:name|id)['"`])\s*:/u,Bt=/(?:^\s*|[,{]\s*)(?:async\s+)?['"`]?(?:execute|handler|invoke|run)['"`]?\s*(?::|\([^)]*\)\s*\{)/mu,It=/\b[A-Za-z_$][\w$-]*[_-][\w$-]*\s*\(/u,Pt=/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s+[A-Za-z_$][\w$-]*\s*\(/iu,Xe=[qn(),Gn(),zn(),Kn(),Zn(),Wn(),Jn()],Ke=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function zn(){return{id:"builtin.node-child-process",supports:e=>/(?:from\s*|require\s*\(\s*)['"](?:node:)?child_process['"]/u.test(e)&&/\b(?:exec|execFile|execFileSync|execSync|fork|spawn|spawnSync)\s*\(/u.test(e),extract:e=>{let t=jn(e.source),n=[];return q(e.root,"call_expression",r=>{let i=ue(r);if(!i)return;let a=t.direct.get(i),s=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),o=s&&t.namespaces.has(s[1])?s[2]:null,l=a??o;if(!l||!Ke.has(l))return;let u=Y(r),d=A(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},c=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(T(e,r,"builtin.node-child-process",c,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...d}],"exact","node-child-process-import"))}),n}}}function jn(e){let t=new Map,n=new Set,r=String.raw`['"](?:node:)?child_process['"]`,i=new RegExp(String.raw`\bimport\s*\{([^}]*)\}\s*from\s*${r}`,"gu");for(let l of e.matchAll(i))for(let u of(l[1]??"").split(",")){let d=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(u);d&&Ke.has(d[1])&&t.set(d[2]??d[1],d[1])}let a=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(a))for(let u of(l[1]??"").split(",")){let d=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(u);d&&Ke.has(d[1])&&t.set(d[2]??d[1],d[1])}let s=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let l of e.matchAll(s))n.add(l[1]);let o=new RegExp(String.raw`\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(o))n.add(l[1]);return{direct:t,namespaces:n}}function L(e,t,n,r){let i=oe(r,"runtime-boundaries.context.ast",t,()=>n===void 0?O(e,t):ut(e,t,n));if(!i)return null;let a=i.rootNode;n!==void 0&&Dn.set(a,i);let s=n??he(e,t),o,l,u,d=()=>(l!==void 0||(l=oe(r,"runtime-boundaries.context.callable-sites",t,()=>{let c=ve(t);return(c?ft(a,c):null)??pt(e,t)})),l);return{db:e,file:t,source:s,root:a,get constants(){return u??=oe(r,"runtime-boundaries.context.constants",t,()=>ir(a)),u},ownerAt:c=>{let f=(o??=oe(r,"runtime-boundaries.context.definitions",t,()=>_(e,t,{rangeCorrectionEvidence:{source:s,callables:d()}},(m,y)=>oe(r,`runtime-boundaries.context.definitions.${m}`,t,y)))).filter(m=>m.startLine<=c&&m.endLine>=c).sort((m,y)=>m.endLine-m.startLine-(y.endLine-y.startLine)||m.startLine-y.startLine)[0];if(f)return{file:t,symbol:f.symbol,name:f.leaf,startLine:f.startLine,endLine:f.endLine};let b=(d()??[]).filter(m=>m.startLine<=c&&m.endLine>=c).sort((m,y)=>m.endLine-m.startLine-(y.endLine-y.startLine)||m.startLine-y.startLine)[0];return{file:t,symbol:null,name:b?.name??null,startLine:b?.startLine??c,endLine:b?.endLine??c}}}}function oe(e,t,n,r){return e?e(t,r,{file:n}):r()}function Gn(){return{id:"builtin.effect-httpapi",supports:e=>se(e,"HttpApiEndpoint").size>0||se(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=se(e.source,"HttpApiEndpoint"),r=se(e.source,"HttpApiGroup"),i=se(e.source,"HttpApiBuilder");return q(e.root,"call_expression",a=>{let s=_t(a);if(!s)return;let o=Y(a);if(n.has(s.receiver)&&Tt.has(s.member)){let b=A(o[0],e),m=A(o[1],e),y=Et(a,r,"make",0,e);if(!b||!m||!y)return;let v=s.member.toUpperCase();t.push(T(e,a,"builtin.effect-httpapi","http.handle",[{name:"method",value:v,evidence:"literal"},{name:"path",...m}],z([{name:"path",...m}]),"effect-httpapi-endpoint-declaration")),t.push(T(e,a,"builtin.effect-httpapi","framework.declare",qe(y,b),z(qe(y,b)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(s.member))return;let l=Et(a,i,"group",1,e),u=A(o[0],e),d=o[1];if(!l||!u||!d)return;let c=qe(l,u),p=ee(e.db,e.file,d.text),f=T(e,a,"builtin.effect-httpapi","framework.handle",c,p.length===1?z(c):"candidate","effect-httpapi-handler-registration"),g=p[0];p.length===1&&g&&(f.owner={file:g.relativePath,symbol:g.symbol,name:g.leaf,startLine:g.startLine,endLine:g.endLine}),t.push(f)}),t}}}function qe(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function se(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(r)){let s=a[2]??"";if(wt(s))for(let o of(a[1]??"").split(",")){let l=o.trim().replace(/^type\s+/u,""),u=/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/u.exec(l);u?.[1]===t&&n.add(u[2]??u[1])}}let i=/\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(i)){let s=a[2]??"";s.endsWith(`/${t}`)&&wt(s)&&n.add(a[1])}return n}function wt(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function Et(e,t,n,r,i){let a=e.parent;for(;a;){if(a.type==="call_expression"){let s=Ft(a,t,n,r,i);if(s)return s;let o=a.childForFieldName("function")??a.namedChild(0),l=null;if(o&&We(o,u=>{!l&&u.type==="call_expression"&&(l=Ft(u,t,n,r,i))}),l)return l}a=a.parent}return null}function Ft(e,t,n,r,i){let a=_t(e);return!a||a.member!==n||!t.has(a.receiver)?null:A(Y(e)[r],i)}function _t(e){let t=e.childForFieldName("function")??e.namedChild(0);if(!t||!["member_expression","subscript_expression"].includes(t.type))return null;let n=t.childForFieldName("object")??t.namedChild(0),r=t.childForFieldName("property")??t.childForFieldName("index")??t.namedChild(1);return!n||!r?null:{receiver:n.text.replace(/\s+/gu,""),member:r.text.replace(/^['"`]|['"`]$/gu,"")}}function qn(){return{id:"builtin.http",supports:e=>/\bfetch\s*\(|\baxios\b|\b(?:app|router|server)\s*\.\s*(?:get|post|put|patch|delete|options|head)\s*\(/u.test(e)||le(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return q(e.root,["decorator","call_expression"],n=>{if(n.type==="decorator"){let p=/^@[^\s(]+\.(get|post|put|patch|delete|options|head)\s*\(\s*(['"`])([^'"`]+)\2/iu.exec(n.text.trim());if(!p||!le(e.source,["fastapi","flask"]))return;t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:p[1].toUpperCase(),evidence:"literal"},{name:"path",value:p[3],evidence:"literal"}],"exact","framework-decorator"));return}if(n.type!=="call_expression")return;let r=ue(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",a=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",s=Y(n);if(i==="route"&&le(e.source,["axum"])){let p=A(s[0],e),f=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(s[1]?.text??"")?.[1];if(!p||!f)return;t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:f.toUpperCase(),evidence:"literal"},{name:"path",...p}],z([{name:"path",...p}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let p=A(s[0],e);if(!p)return;let g=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(s[1]?.text??"")?.[1]?.toUpperCase()??(s[1]?null:"GET"),b=[...g?[{name:"method",value:g,evidence:"literal"}]:[],{name:"path",...p}];t.push(T(e,n,"builtin.http","http.request",b,g?z(b):"candidate","call-expression"));return}if(!Tt.has(i))return;let o=A(s[0],e);if(!o)return;let l=i.toUpperCase();if(Mn.test(a)&&le(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],z([{name:"path",...o}]),"framework-adapter"));return}let d=tr(e.source,["axios"]),c=a.split(".")[0]??"";d.has(c)&&t.push(T(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],z([{name:"path",...o}]),"client-adapter"))}),t}}}function Kn(){return{id:"builtin.capability-registry",supports:e=>Nt.test(e)&&Bt.test(e)||It.test(e)||Pt.test(e),extract:e=>{let t=[],n=new Set,r=[];return Nt.test(e.source)&&Bt.test(e.source)&&r.push("pair"),(It.test(e.source)||Pt.test(e.source))&&r.push("string","string_literal","template_string"),q(e.root,r,i=>{if(i.type==="pair"){let s=i.childForFieldName("key")??i.namedChild(0),o=i.childForFieldName("value")??i.namedChild(1),l=s?.text.replace(/^['"`]|['"`]$/gu,"");if(l!=="name"&&l!=="id")return;let u=$t(o,e),d=or(i);if(!u||u.evidence!=="literal"||!d)return;let c=`handle\0${u.value}\0${d.startPosition.row}`;if(n.has(c))return;n.add(c),t.push(T(e,d,"builtin.capability-registry","registry.handle",[{name:"key",...u}],"exact","capability-descriptor"));return}if(!["string","string_literal","template_string"].includes(i.type))return;let a=i.text.replace(/^['"`]|['"`]$/gu,"");for(let s of a.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let o=s[1];if(!Xn(a,o,s.index))continue;let l=`reference\0${o}\0${i.startPosition.row}`;n.has(l)||(n.add(l),t.push(T(e,i,"builtin.capability-registry","registry.reference",[{name:"key",value:o,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function Xn(e,t,n){if(t.includes("_")||t.includes("-"))return!0;let r=e.slice(Math.max(0,n-64),n);return/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s*$/iu.test(r)}function Zn(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return q(e.root,["pair","call_expression"],n=>{if(n.type==="pair"){let a=ar(n);if(!a)return;let s=n.childForFieldName("key")??n.namedChild(0),o=n.childForFieldName("value")??n.namedChild(1),l=$t(s,e);if(!l||!o||!Lt(o))return;let u=Ze(o)?"exact":"candidate";t.push(T(e,n,"builtin.registry","registry.handle",[{name:"registry",value:a,evidence:"identifier"},{name:"key",...l}],z([{name:"key",...l}],u),"object-member"));return}if(n.type!=="call_expression")return;let r=n.childForFieldName("function")??n.namedChild(0);if(!r)return;let i=/^([A-Za-z_$][\w$]*)\s*\[\s*(['"`])([^'"`]+)\2\s*\]$/u.exec(r.text.trim());i&&t.push(T(e,n,"builtin.registry","registry.dispatch",[{name:"registry",value:i[1],evidence:"identifier"},{name:"key",value:i[3],evidence:"literal"}],"exact","indexed-access-call"))}),t}}}function Wn(){return{id:"builtin.persistence",supports:e=>/\b(?:db|database|prisma|drizzle|[A-Za-z_$][\w$]*(?:Repository|Repo))\b[^;]{0,1024}?\.\s*(?:findFirst|findMany|findUnique|from|get|select|create|delete|insert|remove|update|upsert|execute|query|raw|transaction)(?:\s*<[^()]{1,512}>)?\s*\(/iu.test(e),extract:e=>{let t=[],n=lr(e.root);return q(e.root,"call_expression",r=>{let i=ue(r);if(!i)return;let a=i.split("."),s=a.at(-1)??"",o=Y(r),l=o[0]?.text??"",u=sr(s,l);if(!u)return;let d=kt(a,n);if(!d)return;let c=Yn(o[0],e)??ur(l),p=cr(d,a,s,c);if(!p)return;let f=s==="insert"?"persistence-insert":u==="database.read"&&/\bFOR\s+UPDATE\s+SKIP\s+LOCKED\b/iu.test(l)?"persistence-skip-locked-claim":"persistence-adapter";t.push(T(e,r,"builtin.persistence",u,[{name:"resource",...p}],z([{name:"resource",...p}]),f))}),t}}}function Yn(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:A(e,t)}function Jn(){return{id:"builtin.queue",supports:e=>le(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return q(e.root,"call_expression",n=>{let r=ue(n);if(!r)return;let i=r.split(".").at(-1)??"",a=Y(n),s=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!s)return;let o=i==="send"||i==="subscribe"?nr(a[0],"topic",e):A(a[0],e);o&&t.push(T(e,n,"builtin.queue",s,[{name:"address",...o}],z([{name:"address",...o}]),"framework-adapter"))}),t}}}function T(e,t,n,r,i,a,s){let o=e.ownerAt(t.startPosition.row),l=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${An("sha256").update(l).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:o,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:s,strength:a,protocol:r.split(".")[0]??r,role:Qn(r),executionDomain:er(e.file),derivation:{kind:a==="candidate"?"heuristic":a==="derived"?"mechanically-derived":"direct",rule:s,ruleVersion:"1",inputFactIds:i.flatMap(u=>u.derivation?.inputFactIds??[]),sourceSpans:[{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},...i.flatMap(u=>u.derivation?.sourceSpans??[])]},valuePrecision:i.some(u=>u.evidence==="expression")?"unknown":i.some(u=>u.evidence==="identifier")?"symbolic":"literal",modality:"may",resolution:"unresolved",sourceScope:Re(e.file)}}function Qn(e){let t=e.split(".").at(-1)??e;return["handle","subscribe","consume","read"].includes(t)?"consumer":["request","publish","send","write","dispatch","reference","invoke","spawn","exec"].includes(t)?"producer":"observe"}function er(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function le(e,t){return t.some(n=>{let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:\\bfrom\\s+${r}\\b|\\buse\\s+${r}\\b|(?:\\bfrom\\s*|\\brequire\\s*\\(\\s*)['"]${r}(?:[/']|"))`,"u").test(e)})}function tr(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),a=new RegExp(`(?:import\\s+([A-Za-z_$][\\w$]*)[^;]*?\\sfrom\\s*|(?:const|let)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\s*\\(\\s*)['"]${i}(?:[/']|")`,"gu");for(let s of e.matchAll(a)){let o=s[1]??s[2];o&&n.add(o)}}return n}function Fe(e,t,n,r,i,a,s){return T(e,t,n,r,i,a,s)}function ue(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function Y(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function A(e,t){let n=V(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function nr(e,t,n){if(!e)return null;let r=e.namedChildren.find(a=>a.type!=="pair"?!1:(a.childForFieldName("key")??a.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return A(i,n)}function $t(e,t){if(!e)return null;let n=A(e,t);if(n?.evidence==="literal"||n?.evidence==="constant")return n;let r=e.text.trim();return/^[A-Za-z_$][\w$]*$/u.test(r)?{value:r,evidence:"identifier",term:{kind:"symbol",symbol:r}}:n}function z(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function rr(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);return n==="`"&&r.includes("${")?null:r}function ir(e){let t=new Map;return We(e,n=>{if(n.type!=="variable_declarator")return;let r=n.childForFieldName("name")??n.namedChild(0),i=n.childForFieldName("value")??n.namedChild(1);if(!r||!i||!/^[A-Za-z_$][\w$]*$/u.test(r.text))return;let a=rr(i);a!==null&&t.set(r.text,a)}),t}function ar(e){let t=e.parent,n=t?.parent??null;for(;n&&["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(n.type);)n=n.parent;if(!t||!n||n.type!=="variable_declarator")return null;let i=(n.childForFieldName("name")??n.namedChild(0))?.text??"";return/(?:handlers?|registry|routes?)$/iu.test(i)?i:null}function Ze(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function Lt(e){return Ze(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function or(e){let t=e.parent;for(;t&&t.type!=="variable_declarator";){if(["object","object_literal","dictionary"].includes(t.type))for(let n of t.namedChildren){if(n.type==="pair"){let i=n.childForFieldName("key")??n.namedChild(0),a=n.childForFieldName("value")??n.namedChild(1),s=i?.text.replace(/^['"`]|['"`]$/gu,"");if(s&&["execute","handler","invoke","run"].includes(s)&&a&&Lt(a))return t}let r=n.childForFieldName("name")??n.namedChild(0);if(r&&["execute","handler","invoke","run"].includes(r.text.replace(/^['"`]|['"`]$/gu,""))&&/(?:function|method)/u.test(n.type))return t}t=t.parent}return null}function kt(e,t=new Set){let n=e.slice(0,-1).map(r=>r.replace(/\([^)]*\)/gu,""));return n.some(r=>/^(?:prisma|drizzle)$/iu.test(r))?"orm":n.some(r=>/(?:Repository|Repo)$/u.test(r))?"repository":n.some(r=>/^(?:db|database)$/iu.test(r)||t.has(r))?"database":null}function sr(e,t){if(Hn.has(e))return"database.read";if(Vn.has(e))return"database.write";if(!Un.has(e))return null;let n=/\b(SELECT|INSERT|UPDATE|DELETE)\b/iu.exec(t)?.[1]?.toUpperCase();return n==="SELECT"?"database.read":n?"database.write":null}function lr(e){let t=new Set;return q(e,"call_expression",n=>{let r=ue(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!kt(i)))for(let a of Y(n)){if(!Ze(a))continue;let o=(a.childForFieldName("parameters")??a.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=o?lt(o):null;l&&t.add(l)}}),t}function ur(e){let t=Ot(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function cr(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let a=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return a?{value:a,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=Ot(r.value);return i?{value:i,evidence:r.evidence}:null}function Ot(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function We(e,t){t(e);for(let n of e.namedChildren)We(n,t)}function q(e,t,n){for(let r of be(e,t))n(r)}var dr=Q("resolved-call-syntax",{clearGroups:[]}),Ye=Q("resolved-call-sites",{clearGroups:[]}),pr=Q("resolved-call-sites-reference-evidence",{clearGroups:[]});function Je(e,t){return Ye.get(e,t.symbolId,()=>Dt(e,t,fr(e,t)))}function At(e,t){let n=[...new Map(t.map(a=>[a.symbolId,a])).values()],r=n.filter(a=>!Ye.has(e,a.symbolId)),i=Mt(e,r);return new Map(n.map(a=>[a.symbolId,Ye.get(e,a.symbolId,()=>Dt(e,a,i.get(a.symbolId)??[]))]))}function Dt(e,t,n){let r=[],i=[],a=new Set,s=new Set;for(let o of n){a.add(o.file);let l=dr.get(e,o.file,()=>yr(e,o.file));if(!l){i.push({callee:t,file:o.file,line:o.startLine,reason:"ast-unavailable",candidates:0,referenceProvenance:o.provenance});continue}let u=(l.byLeaf.get(t.leaf)??[]).filter(({callNode:p})=>p.startPosition.row<=o.endLine&&p.endPosition.row>=o.startLine);if(u.length!==1){i.push({callee:t,file:o.file,line:o.startLine,reason:u.length===0?"call-not-found":"ambiguous-call",candidates:u.length,referenceProvenance:o.provenance});continue}let d=u[0],c=`${o.file}\0${d.callNode.startIndex}\0${d.callNode.endIndex}`;s.has(c)||(s.add(c),r.push({callee:t,caller:xe(_(e,o.file),d.callNode.startPosition.row),file:o.file,line:d.callNode.startPosition.row,startLine:d.callNode.startPosition.row,endLine:d.callNode.endPosition.row,targetText:d.targetNode.text,callNode:d.callNode,targetNode:d.targetNode,arguments:d.arguments,referenceProvenance:o.provenance}))}return{sites:r,unresolved:i,filesVisited:a.size}}function fr(e,t){return Mt(e,[t]).get(t.symbolId)??[]}function Mt(e,t){if(!mr(e))return new Map(t.map(r=>[r.symbolId,gt(e,r,{semantic:!1}).map(i=>({file:i.file,startLine:i.line,endLine:i.line,provenance:i.provenance}))]));let n=new Map;for(let r of ht(e,t.map(i=>i.symbolId))){let i=n.get(r.symbol_id)??[];i.push({file:r.relative_path,startLine:r.chunk_start,endLine:r.chunk_end,provenance:"scip-reference-chunk"}),n.set(r.symbol_id,i)}return new Map(t.map(r=>[r.symbolId,n.get(r.symbolId)??[]]))}function mr(e){return pr.get(e,"project",()=>!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))}function yr(e,t){let n=O(e,t)?.rootNode;if(!n)return null;let r=new Map;for(let i of be(n,["call_expression","call"])){let a=i.childForFieldName("function")??i.namedChild(0);if(!a)continue;let s=ct(a);if(!s)continue;let o=i.childForFieldName("arguments")??i.namedChildren.find(d=>d.type==="arguments"),l={callNode:i,targetNode:a,arguments:o?.namedChildren??[]},u=r.get(s);u?u.push(l):r.set(s,[l])}return{byLeaf:r}}var hr=Q("call-parameter-value-flow",{clearGroups:[]});function ce(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return hr.get(e,n,()=>gr(e,t))}function de(e,t){let n=new Set(t);return[...new Set(e.transfers.flatMap(r=>n.has(r.calleePosition)?[r.callerPosition]:[]))].sort((r,i)=>r-i)}function gr(e,t){let n={file:t.file,startLine:t.startLine,endLine:t.endLine};if(!t.caller)return{callee:t.callee,caller:null,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-unavailable",proof:n}))};let r=O(e,t.caller.relativePath)?.rootNode,i=r?D(r,t.caller.startLine,t.caller.endLine):null;if(!i)return{callee:t.callee,caller:t.caller,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-syntax-unavailable",proof:n}))};let a=X(i),s=[],o=[];return t.arguments.forEach((l,u)=>{let d=l.text.trim(),c=a.indexOf(d);c>=0?s.push({calleePosition:u,callerPosition:c,argumentText:d,proof:n}):o.push({calleePosition:u,argumentText:d,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:s,unknown:o}}var vr=8,br=8;function Vt(e,t,n=[]){let r=[],i=Sr(e,n,r),a=i.summaries,s=xr(e,t,a,r),o=Rr(e,t,r);return{observations:_r([...s.observations,...o]),bodySummaries:a.size,discriminatorSummaries:s.summaries,filesInspected:i.filesInspected,errors:r}}function Sr(e,t,n){let r=new Map,i=[],a=new Map,s=o=>{if(a.has(o))return a.get(o)??null;let l=L(e,o);return a.set(o,l),l};for(let o of t){let l={...o,depth:0,proofSpans:[{file:o.definition.relativePath,startLine:o.definition.startLine,endLine:o.definition.endLine}]};r.set(o.definition.symbol,l),i.push(l)}for(;i.length>0;){let o=i.shift();if(!(o.depth>=vr))try{for(let l of Je(e,o.definition).sites){if(!s(l.file))continue;let d=l.caller;if(!d)continue;let c=de(ce(e,l),o.parameterIndexes);if(c.length===0)continue;let p={definition:d,parameterIndexes:Kt(c),depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]};Ir(r,p)&&i.push(r.get(d.symbol))}}catch(l){n.push(`builtin.carrier body summary failed for ${o.definition.relativePath}: ${tt(l)}`)}}return{summaries:r,filesInspected:new Set(t.map(o=>o.definition.relativePath)).size}}function xr(e,t,n,r){let i=new Map,a=[],s=[];for(let o of t){if(o.action!=="http.request"||o.strength==="candidate"||o.sourceScope!=="production")continue;let l=zt(o);if(!l)continue;let u=L(e,o.source.file);if(!u)continue;let d=jt(u.root,o.source.startLine),c=d.find(v=>v.startPosition.row===o.source.startLine)??d[0];if(!c)continue;let p=et(c);if(!p)continue;let f=ee(e,o.source.file,p.text);if(f.length!==1)continue;let g=n.get(f[0].symbol);if(!g)continue;let b=o.owner.symbol?_(e,o.owner.file).find(v=>v.symbol===o.owner.symbol):null;if(!b)continue;let m=Pr(u,b),y=Te(c);for(let v of g.parameterIndexes){let R=Er(u,y[v]);if(R)for(let x of Fr(R)){let h=Gt(x),S=qt(x);if(!h||!S)continue;let B=m.indexOf(S.text.trim());if(B>=0){let N={definition:b,carrier:l,field:h,parameterIndex:B,depth:0,proofObservationIds:[o.id],proofSpans:[o.source,{file:o.source.file,startLine:x.startPosition.row,endLine:x.endPosition.row}]},F=Ht(N);i.has(F)||(i.set(F,N),a.push(N));continue}let I=V(u,S);!I||I.evidence==="expression"||s.push(Qe(u,x,"carrier.publish",l,h,I.value,[o.id]))}}}for(;a.length>0;){let o=a.shift();if(!(o.depth>=br))try{for(let l of Je(e,o.definition).sites){let u=L(e,l.file);if(!u)continue;let d=l.callNode,c=Te(d)[o.parameterIndex];if(!c)continue;let p=V(u,c);p&&p.evidence!=="expression"&&s.push(Qe(u,d,"carrier.publish",o.carrier,o.field,p.value,o.proofObservationIds));let f=l.caller;if(!f)continue;let g=ce(e,l).transfers.find(y=>y.calleePosition===o.parameterIndex)?.callerPosition;if(g===void 0)continue;let b={...o,definition:f,parameterIndex:g,depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},m=Ht(b);i.has(m)||(i.set(m,b),a.push(b))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${o.definition.relativePath}: ${tt(l)}`)}}return{observations:s,summaries:i.size}}function Rr(e,t,n){let r=[],i=t.filter(a=>a.action==="registry.handle"&&a.strength!=="candidate"&&a.sourceScope==="production");for(let a of t){if(a.action!=="http.handle"||a.strength==="candidate"||a.sourceScope!=="production")continue;let s=zt(a);if(!s)continue;let o=L(e,a.source.file);if(!o)continue;let l=jt(o.root,a.source.startLine)[0];if(l)for(let u of Te(l).slice(1)){let d=ee(e,a.source.file,u.text);for(let c of d)try{let p=L(e,c.relativePath);if(!p)continue;let f=D(p.root,c.startLine,c.endLine);if(!f)continue;k(f,g=>{if(g.type!=="call_expression")return;let b=et(g);if(!b)return;let m=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(b.text.trim());if(!m)return;let y=m[1],v=m[2],R=Nr(e,p,c,v);if(!R)return;let x=Br(e,c.relativePath,y);for(let h of i){let S=h.keyParts.find(F=>F.name==="registry")?.value,B=h.keyParts.find(F=>F.name==="key")?.value;if(!S||!B||!x.some(F=>F.file===h.source.file&&F.binding===S))continue;let I=L(e,h.source.file),N=I?wr(I.root,h.source.startLine):null;!I||!N||r.push(Qe(I,N,"carrier.consume",s,R,B,[a.id,h.id]))}})}catch(p){n.push(`builtin.carrier consumer analysis failed for ${c.relativePath}: ${tt(p)}`)}}}return r}function Ut(e){let t=_(e.db,e.file),n=new Map;return k(e.root,r=>{if(r.type!=="pair"||Gt(r)?.toLowerCase()!=="body")return;let i=qt(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let a=xe(t,r.startPosition.row),s=Cr(r);if(!a||!s)return;let o=X(s),l=new Set;Tr(i,o,l);let u=n.get(a.symbol)??new Set;o.forEach((d,c)=>{d&&l.has(d)&&u.add(c)}),u.size>0&&n.set(a.symbol,u)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[{definition:r,parameterIndexes:[...i].sort((a,s)=>a-s)}]:[]})}function Cr(e){let t=e.parent;for(;t;){if(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function")return t;t=t.parent}return null}function Nr(e,t,n,r){let i=D(t.root,n.startLine,n.endLine);if(!i)return null;let a=new RegExp(`\\.body\\??\\.${ge(r)}\\b`,"u");if(a.test(i.text))return r;let s=null;if(k(i,d=>{if(s||d.type!=="variable_declarator")return;let c=d.childForFieldName("name")??d.namedChild(0),p=d.childForFieldName("value")??d.namedChild(1);!c||!p||!new RegExp(`(?:^|[,{}])\\s*${ge(r)}\\s*(?:[,}]|$)`,"u").test(c.text)||p.type==="call_expression"&&(s=et(p)?.text??null)}),!s)return null;let o=ee(e,n.relativePath,s);if(o.length!==1)return null;let l=L(e,o[0].relativePath),u=l?D(l.root,o[0].startLine,o[0].endLine):null;return u&&a.test(u.text)&&new RegExp(`\\b${ge(r)}\\s*[,}]`,"u").test(u.text)?r:null}function Br(e,t,n){let r=[];for(let i of ze(e,t,n)){let a=M(i.initializer);if(a.type==="call_expression")for(let s of Te(a)){let o=s.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(o))for(let l of ze(e,i.definition.relativePath,o))r.push({file:l.definition.relativePath,binding:l.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function Qe(e,t,n,r,i,a,s){let l=Fe(e,t,"builtin.carrier",n,[{name:"carrier",value:r,evidence:"constant",term:{kind:"literal",value:r}},{name:"field",value:i,evidence:"literal",term:{kind:"literal",value:i}},{name:"value",value:a,evidence:"constant",term:{kind:"literal",value:a}}],"derived","http-body-registry-discriminator");return l.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...s],sourceSpans:[l.source]},l}function zt(e){let t=e.keyParts.find(r=>r.name==="method"&&r.evidence!=="expression")?.value,n=e.keyParts.find(r=>r.name==="path"&&r.evidence!=="expression")?.value;return t&&n?`${t.toUpperCase()} ${n}`:null}function Ir(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=Kt([...n.parameterIndexes,...t.parameterIndexes]);return r.length===n.parameterIndexes.length&&t.depth>=n.depth?!1:(e.set(t.definition.symbol,{...n,parameterIndexes:r,depth:Math.min(n.depth,t.depth),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0)}function Ht(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function Pr(e,t){let n=D(e.root,t.startLine,t.endLine);return n?X(n):[]}function wr(e,t){let n=null;return k(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function jt(e,t){let n=[];return k(e,r=>{r.type==="call_expression"&&r.startPosition.row<=t&&r.endPosition.row>=t&&n.push(r)}),n.sort((r,i)=>r.endIndex-r.startIndex-(i.endIndex-i.startIndex))}function et(e){return e.childForFieldName("function")??e.namedChild(0)}function Te(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Er(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return M(t);let r=null;return k(e.root,i=>{r||i.type!=="variable_declarator"||(i.childForFieldName("name")??i.namedChild(0))?.text.trim()!==n||(r=i.childForFieldName("value")??i.namedChild(1))}),r?M(r):M(t)}function Fr(e){let t=M(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function Gt(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function qt(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function Tr(e,t,n){let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function Kt(e){return[...new Set(e)].sort((t,n)=>t-n)}function _r(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function tt(e){return e instanceof Error?e.message:String(e)}import{createHash as $r}from"crypto";function Xt(e,t){let n=new Map;for(let a of t){if(a.action!=="http.handle"||a.sourceScope!=="production")continue;let s=n.get(a.source.file)??[];s.push(a),n.set(a.source.file,s)}let r=[],i=Lr(e);for(let a of i.mounts)for(let s of a.targetFiles)for(let o of n.get(s)??[]){let l=o.keyParts.find(p=>p.name==="path");if(!l||l.evidence==="expression")continue;let u=Or(a.prefix.value,l.value),d=o.keyParts.map(p=>p.name==="path"?{name:"path",value:u,evidence:"constant",term:{kind:"concat",parts:[a.prefix.term??{kind:"literal",value:a.prefix.value},l.term??{kind:"literal",value:l.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line},...a.prefix.derivation?.sourceSpans??[],...l.derivation?.sourceSpans??[]]}}:p),c=`${o.id}\0${a.file}\0${a.line}\0${u}`;r.push({...o,id:`boundary:${$r("sha256").update(c).digest("hex").slice(0,16)}`,keyParts:d,strength:"derived",evidence:"framework-mount-composition",derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line}]},resolution:"unresolved"}),o.strength="candidate",o.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function Lr(e){let t=[],n=Se(e);for(let r of n){let i=he(e,r);if(!Ar(i))continue;let a=L(e,r);a&&Zt(a.root,s=>{if(s.type!=="call_expression")return;let o=s.childForFieldName("function")??s.namedChild(0);if(!o||!o.text.replace(/\s+/gu,"").endsWith(".use"))return;let l=Dr(s);if(l.length<2)return;let u=V(a,l[0]);if(!u||u.evidence==="expression")return;let d=kr(e,r,l[1]);d.length!==0&&t.push({file:r,line:s.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:d})})}return{mounts:t,filesInspected:n.length}}function kr(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let a=j(e,t).find(l=>l.localName===i&&l.sourcePath);if(!a?.sourcePath)return[t];if(a.kind==="namespace")return[a.sourcePath];let s=a.importedName==="default"?i:a.importedName,o=Z(e,a.sourcePath,s);return[...new Set(o.map(l=>l.relativePath))]}function Or(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function Ar(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function Dr(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Zt(e,t){t(e);for(let n of e.namedChildren)Zt(n,t)}import{createHash as Mr}from"crypto";function _e(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}var Le=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),Hr=8,Wt=ie({kind:"runtime-boundary-http-roles",invalidation:ae("runtime-boundary-http-roles"),serialize:jr,deserialize:Gr});function Qt(e,t,n){let r=n??((m,y)=>y()),i=new Map,a=[],s=[],o=new Set,l=[],u=[],d=new Map,c=new Map,p=new Map,f=m=>{if(d.has(m))return d.get(m)??null;let y=L(e,m);return d.set(m,y),y},g=m=>{let y=c.get(m);if(y)return y;let v=_(e,m);return c.set(m,v),v},b=(m,y)=>{let v=p.get(m.file);if(!v){let h=re(e,m.file,m.source),S=Wt.read(e,m.file,h)??[];v={contentHash:h,roles:new Map(S.map(B=>[B.symbol,B])),dirty:!1},p.set(m.file,v)}let R=v.roles.get(y.symbol);if(R)return R;let x=zr(m,y);return v.roles.set(y.symbol,{symbol:y.symbol,...x}),v.dirty=!0,x};for(r("runtime-boundaries.http-summary.seed",()=>{for(let m of t){if(m.action!=="http.request"||!m.owner.symbol||m.evidence!=="call-expression"&&m.evidence!=="client-adapter")continue;let y=g(m.owner.file).find(h=>h.symbol===m.owner.symbol);if(!y)continue;let v=f(y.relativePath);if(!v)continue;let R=b(v,y),x={definition:y,...R,constantMethods:m.keyParts.flatMap(h=>h.name==="method"&&h.evidence!=="expression"&&Le.has(h.value.toUpperCase())?[h.value.toUpperCase()]:[]),depth:0,proofObservationIds:[m.id],proofSpans:[m.source]};Jt(i,x)&&a.push(i.get(y.symbol))}});a.length>0;){let m=a.splice(0,a.length),y=r("runtime-boundaries.http-summary.resolve-call-sites",()=>At(e,m.map(v=>v.definition)),{batchSize:m.length});r("runtime-boundaries.http-summary.process-call-sites",()=>{for(let v of m)if(!(v.depth>=Hr))try{let R=y.get(v.definition.symbolId);if(!R)continue;u.push(...R.unresolved.map(x=>Vr(v,x)));for(let x of R.sites){let h=f(x.file);if(!h)continue;o.add(x.file);let S=x.callNode,B=Ur(v,S,h);B&&s.push(B);let I=x.caller;if(!I)continue;let N=b(h,I),F=qr(e,v,x),$={definition:I,pathParameterIndexes:$e([...N.pathParameterIndexes,...F.pathParameterIndexes]),methodParameterIndexes:$e([...N.methodParameterIndexes,...F.methodParameterIndexes]),constantMethods:ne([...v.constantMethods,...N.constantMethods]),depth:v.depth+1,proofObservationIds:ne([...v.proofObservationIds,...B?[B.id]:[]]),proofSpans:[...v.proofSpans,{file:x.file,startLine:x.startLine,endLine:x.endLine}]};Jt(i,$)&&a.push(i.get(I.symbol))}}catch(R){l.push(`builtin.http-summary failed for ${v.definition.relativePath}:${v.definition.startLine+1}: ${R instanceof Error?R.message:String(R)}`)}},{batchSize:m.length})}return Wt.writeBatch(e,[...p.entries()].flatMap(([m,y])=>y.dirty?[{relativePath:m,contentHash:y.contentHash,value:[...y.roles.values()].sort((v,R)=>v.symbol.localeCompare(R.symbol))}]:[])),{observations:s,frontiers:_e(u),summaries:i.size,filesInspected:o.size,errors:l}}function Vr(e,t){let n=ne([...e.pathParameterIndexes.length>0?["path"]:[],...e.methodParameterIndexes.length>0&&e.constantMethods.length!==1?["method"]:[]]),r=e.constantMethods.length===1?e.constantMethods[0]:"?",i=`${e.definition.symbol}\0${t.file}\0${t.line}\0${t.reason}`;return{observationId:`frontier:${Mr("sha256").update(i).digest("hex").slice(0,16)}`,kind:"call-resolution",action:"http.request",strength:"candidate",source:{file:t.file,startLine:t.line,endLine:t.line},ownerShortName:null,address:`method=${r??"?"} path=?`,reason:`Compiler identity found a reference to ${e.definition.leaf}, but exact call recovery stopped with ${t.reason} (${t.candidates} syntax candidate(s)); HTTP value propagation did not cross this site.`,missingKeyParts:n.length>0?n:["call"],sourceScope:Re(t.file)}}function Ur(e,t,n){let r=en(t),i=e.pathParameterIndexes.flatMap(c=>{let p=V(n,r[c]);return p&&p.evidence!=="expression"&&Xr(p.value)?[{index:c,value:p}]:[]}),a=e.methodParameterIndexes.flatMap(c=>{let p=V(n,r[c]),f=p?.value.toUpperCase();return p&&f&&p.evidence!=="expression"&&Le.has(f)?[{index:c,value:{...p,value:f}}]:[]}),s=ne([...e.constantMethods,...a.map(c=>c.value.value)]);if(i.length!==1||s.length!==1)return null;let o=i[0].value,l=a.find(c=>c.value.value===s[0])?.value,u=[{name:"method",value:s[0],evidence:l?"constant":"literal",term:l?.term??{kind:"literal",value:s[0]},derivation:l?.derivation},{name:"path",value:o.value,evidence:"constant",term:o.term,derivation:o.derivation}],d=Fe(n,t,"builtin.http-summary","http.request",u,"derived","compiler-resolved-http-summary");return d.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,d.source]},d}function zr(e,t){let n=D(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=X(n),i=new Set,a=new Set,s=new Set;return k(n,o=>{if(o.type==="call_expression"&&((o.childForFieldName("function")??o.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let f=en(o);pe(f[0],r,i);let g=Kr(f[1],"method");if(g){pe(g,r,a);let b=V(e,g),m=b?.value.toUpperCase();m&&b?.evidence!=="expression"&&Le.has(m)&&s.add(m)}else pe(f[1],r,a)}if(o.type!=="pair")return;let l=o.childForFieldName("key")??o.namedChild(0),u=o.childForFieldName("value")??o.namedChild(1),d=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(d==="url"||d==="path"||d==="endpoint")&&pe(u,r,i),(d==="init"||d==="requestinit"||d==="options")&&pe(u,r,a)}),{pathParameterIndexes:r.flatMap((o,l)=>o&&i.has(o)?[l]:[]),methodParameterIndexes:r.flatMap((o,l)=>o&&a.has(o)?[l]:[]),constantMethods:[...s].sort()}}function jr(e){return e.map(t=>[encodeURIComponent(t.symbol),t.pathParameterIndexes.join(","),t.methodParameterIndexes.join(","),t.constantMethods.join(",")].join(" ")).join(`
|
|
49
|
+
`)}function Gr(e){if(!e)return[];let t=[];for(let n of e.split(`
|
|
50
|
+
`)){let r=n.split(" ");if(r.length!==4)return null;let i=Yt(r[1]),a=Yt(r[2]),s=r[3]?r[3].split(","):[];if(i===null||a===null||s.some(o=>!Le.has(o)))return null;t.push({symbol:decodeURIComponent(r[0]),pathParameterIndexes:i,methodParameterIndexes:a,constantMethods:s})}return t}function Yt(e){if(!e)return[];let t=e.split(",").map(Number);return t.every(n=>Number.isSafeInteger(n)&&n>=0)?t:null}function qr(e,t,n){let r=ce(e,n);return{pathParameterIndexes:de(r,t.pathParameterIndexes),methodParameterIndexes:de(r,t.methodParameterIndexes)}}function Jt(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=$e([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=$e([...n.methodParameterIndexes,...t.methodParameterIndexes]),a=ne([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||a.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:a,depth:Math.min(n.depth,t.depth),proofObservationIds:ne([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function Kr(e,t){if(!e)return null;for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase()!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function pe(e,t,n){if(!e)return;let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function en(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Xr(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function $e(e){return[...new Set(e)].sort((t,n)=>t-n)}function ne(e){return[...new Set(e)].sort()}import{createHash as Zr}from"crypto";function rn(e){let t=tn(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=tn(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?nt(r).flatMap(i=>{let a=t.get(i)?.[0];return a?[nn(r,a,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?nt(r).flatMap(i=>{let a=n.get(i)?.[0];return a?[nn(r,a,i,"queue.consume")]:[]}):[])}function tn(e){let t=new Map;for(let n of e)for(let r of nt(n)){let i=t.get(r);i?i.push(n):t.set(r,[n])}for(let n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function nt(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function nn(e,t,n,r){let i=`database:${n}`,a=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",s=[e.id,r,i,a].join("\0");return{...e,id:`boundary:${Zr("sha256").update(s).digest("hex").slice(0,16)}`,extractor:"builtin.database-queue",action:r,keyParts:[{name:"address",value:i,evidence:"identifier",term:{kind:"symbol",symbol:n},derivation:{kind:"mechanically-derived",rule:"database-work-queue.resource",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]}}],evidence:a,strength:"derived",protocol:"queue",role:r==="queue.send"?"producer":"consumer",derivation:{kind:"mechanically-derived",rule:"database-work-queue.insert-skip-locked",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]},valuePrecision:"symbolic",resolution:"unresolved"}}var ye="runtime-boundaries-v19",Jr=Yr(import.meta.url),w=Jr("typescript"),Qr=new Set([w.SyntaxKind.WhitespaceTrivia,w.SyntaxKind.NewLineTrivia,w.SyntaxKind.SingleLineCommentTrivia,w.SyntaxKind.MultiLineCommentTrivia]),ei=new Set([w.SyntaxKind.NoSubstitutionTemplateLiteral,w.SyntaxKind.TemplateHead,w.SyntaxKind.TemplateMiddle,w.SyntaxKind.TemplateTail]),Ae=[{id:"http.method-path",protocol:"http",producerActions:["http.request"],consumerActions:["http.handle"],keyNames:["method","path"],traversable:!0},{id:"registry.identity-key",protocol:"registry",producerActions:["registry.dispatch"],consumerActions:["registry.handle"],keyNames:["registry","key"],traversable:!0},{id:"registry.capability-key",protocol:"registry",producerActions:["registry.reference"],consumerActions:["registry.handle"],keyNames:["key"],traversable:!0,requireUniqueConsumer:!0},{id:"queue.address",protocol:"queue",producerActions:["queue.send"],consumerActions:["queue.consume"],keyNames:["address"],traversable:!0},{id:"carrier.discriminator",protocol:"carrier",producerActions:["carrier.publish"],consumerActions:["carrier.consume"],keyNames:["carrier","field","value"],traversable:!0},{id:"resource.identity",protocol:"database",producerActions:["database.write"],consumerActions:["database.read"],keyNames:["resource"],traversable:!1},{id:"framework.effect-httpapi-operation",protocol:"framework",producerActions:[],consumerActions:["framework.handle"],declarationActions:["framework.declare"],keyNames:["adapter","group","operation"],traversable:!0,linkFrom:"declaration",requireUniquePair:!0}],ti=64,cn="builtin.http-summary",De={HTTP_HANDLE:"http.handle",HTTP_REQUEST:"http.request",REGISTRY_HANDLE:"registry.handle"},rt=new Set(Object.values(De));async function ni(e,t={}){let n=Se(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map(Ci)),a=t.previousGraph?.fileCoverage,s=i.size>0&&t.previousGraph?.extractorVersion===ye&&a!==void 0&&a.length===t.previousGraph.coverage.filesScanned,o=s?a.filter(C=>r.has(C.file)&&!i.has(C.file)):[],l=new Set(o.flatMap(C=>C.observationIds)),u=s?t.previousGraph.observations.filter(C=>l.has(C.id)&&r.has(C.source.file)):[],d=s?n.filter(C=>i.has(C)):n,c=[],p=a?.reduce((C,P)=>C+P.observationIds.length,0)??0,f=performance.now(),g=await gi(e,d,t.profileSpan);G(c,"direct-extraction",f,d.length,g.observations.length,{filesVisited:d.length,filesReused:o.length,factsReused:u.length,factsInvalidated:Math.max(0,p-u.length)});let b=[...o,...g.fileCoverage].sort((C,P)=>C.file.localeCompare(P.file)),m=Ri(b),y=b.flatMap(C=>C.extractionErrors),v=fe([...u,...g.observations]);if(s&&!t.forceDerivedRebuild&&t.previousGraph&&ri(a,g.fileCoverage,i)&&(!ui(e,t.previousGraph,i)||pi(a,g.fileCoverage,i)&&!fi(t.previousGraph,i))){for(let P of t.previousGraph.coverage.extractors)m.has(P.id)||m.set(P.id,P);let C=yi(t.previousGraph.coverage.phases);return c.push(...C),{...t.previousGraph,observations:t.previousGraph.observations,relationGroups:t.previousGraph.relationGroups,links:t.previousGraph.links,frontiers:t.previousGraph.frontiers,coverage:{filesScanned:n.length,filesWithAst:b.filter(P=>P.hasAst).length,filesWithoutAst:b.filter(P=>!P.hasAst).length,filesReused:o.length,extractors:[...m.values()],extractionErrors:t.previousGraph.coverage.extractionErrors,phases:c},fileCoverage:b}}let R=fe([...v,...rn(v)]),x=s&&t.previousGraph!==void 0?ii(t.previousGraph,a,g.fileCoverage,i,v):{reuse:!1,shapeUnchanged:!1,proofFilesUnchanged:!1,seedUnchanged:!1},h=x.reuse;t.profileSpan?.("runtime-boundaries.http-summary.reuse-decision",()=>{},x),f=performance.now();let S;if(h){let C=t.previousGraph.coverage.phases?.find(E=>E.id==="http-summary"),P=t.previousGraph.coverage.extractors.find(E=>E.id==="builtin.wrapper");S={observations:t.previousGraph.observations.filter(E=>E.extractor===cn),frontiers:t.previousGraph.frontiers.filter(E=>E.kind==="call-resolution"&&E.action===De.HTTP_REQUEST),summaries:0,filesInspected:C?.filesVisited??P?.applicableFiles??0,errors:t.previousGraph.coverage.extractionErrors.filter(E=>E.startsWith("builtin.http-summary failed"))},G(c,"http-summary",f,R.length,S.observations.length,{filesVisited:0,filesReused:S.filesInspected,factsReused:S.observations.length+S.frontiers.length,factsInvalidated:0}),P&&m.set(P.id,P)}else S=Qt(e,R,t.profileSpan),G(c,"http-summary",f,R.length,S.observations.length,{filesVisited:S.filesInspected}),m.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:S.filesInspected,observations:S.observations.length,errors:S.errors.length});y.push(...S.errors);let B=fe([...R,...S.observations]);f=performance.now();let I=Xt(e,B);G(c,"http-mount",f,B.length,I.observations.length,{filesVisited:I.filesInspected});let N=fe([...B,...I.observations]);f=performance.now();let F=h&&t.previousGraph!==void 0&&ai(t.previousGraph,a,g.fileCoverage,i),$;if(F){let C=t.previousGraph.coverage.phases?.find(E=>E.id==="carrier"),P=t.previousGraph.coverage.extractors.find(E=>E.id==="builtin.carrier");$={observations:t.previousGraph.observations.filter(E=>E.extractor==="builtin.carrier"),bodySummaries:P?.applicableFiles??0,discriminatorSummaries:0,filesInspected:C?.filesVisited??0,errors:t.previousGraph.coverage.extractionErrors.filter(E=>E.startsWith("builtin.carrier"))},G(c,"carrier",f,N.length,$.observations.length,{filesVisited:0,filesReused:$.filesInspected,factsReused:$.observations.length,factsInvalidated:0}),P&&m.set(P.id,P)}else $=Vt(e,N,b.flatMap(C=>C.bodySummaries??[])),G(c,"carrier",f,N.length,$.observations.length,{filesVisited:$.filesInspected}),m.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:$.bodySummaries,observations:$.observations.length,errors:$.errors.length});y.push(...$.errors);let K=fe([...N,...$.observations]);f=performance.now();let J=Ni(K);G(c,"relations",f,K.length,J.length),f=performance.now();let it=Ii(K,J);G(c,"links",f,J.length,it.length),Pi(K,J),f=performance.now();let at=_e([...wi(K,J),...S.frontiers]);return G(c,"frontiers",f,K.length,at.length),{schemaVersion:2,extractorVersion:ye,observations:K,relationGroups:J,links:it,frontiers:at,coverage:{filesScanned:n.length,filesWithAst:b.filter(C=>C.hasAst).length,filesWithoutAst:b.filter(C=>!C.hasAst).length,...s?{filesReused:o.length}:{},extractors:[...m.values()],extractionErrors:y,phases:c},fileCoverage:b}}function ri(e,t,n){if(!e)return!1;let r=e.filter(a=>n.has(a.file)).filter(an).map(on).sort((a,s)=>a.file.localeCompare(s.file)),i=t.filter(an).map(on).sort((a,s)=>a.file.localeCompare(s.file));return JSON.stringify(r)===JSON.stringify(i)}function an(e){return e.observationIds.length>0||e.extractionErrors.length>0}function on(e){let{syntaxHash:t,shapeHash:n,bodySummaries:r,...i}=e;return i}function ii(e,t,n,r,i){let a=si(t,n,r),s=li(e),l=![...dn(t,n)].some(p=>s.has(p)),u=new Set((t??[]).filter(p=>r.has(p.file)).flatMap(p=>p.observationIds)),d=new Set(n.flatMap(p=>p.observationIds)),c=sn(e.observations,u)===sn(i,d);return{reuse:a&&l&&c,shapeUnchanged:a,proofFilesUnchanged:l,seedUnchanged:c}}function dn(e,t){let n=new Map(e?.map(r=>[r.file,r.syntaxHash])??[]);return new Set(t.filter(r=>r.syntaxHash===void 0||n.get(r.file)!==r.syntaxHash).map(r=>r.file))}function ai(e,t,n,r){if(!t)return!1;let i=t.filter(l=>r.has(l.file)).map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file)),a=n.map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file));if(JSON.stringify(i)!==JSON.stringify(a))return!1;let s=dn(t,n),o=oi(e,"builtin.carrier");return![...s].some(l=>o.has(l))}function oi(e,t){let n=new Set;for(let r of e.observations)if(r.extractor===t){n.add(r.source.file);for(let i of r.derivation.sourceSpans)n.add(i.file)}return n}function si(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.shapeHash]));return t.length===n.size&&t.every(i=>i.shapeHash!==void 0&&r.get(i.file)===i.shapeHash)}function li(e){let t=new Set;for(let n of e.observations)if(n.extractor===cn){t.add(n.source.file);for(let r of n.derivation.sourceSpans)t.add(r.file)}for(let n of e.frontiers)n.kind==="call-resolution"&&n.action===De.HTTP_REQUEST&&n.source&&t.add(n.source.file);return t}function sn(e,t){return JSON.stringify(e.filter(n=>t.has(n.id)&&n.action===De.HTTP_REQUEST&&n.owner.symbol!==null&&(n.evidence==="call-expression"||n.evidence==="client-adapter")).map(n=>({ownerSymbol:n.owner.symbol,evidence:n.evidence,methods:n.keyParts.filter(r=>r.name==="method"&&r.evidence!=="expression").map(r=>r.value.toUpperCase()).sort()})).sort((n,r)=>`${n.ownerSymbol}\0${n.evidence}\0${n.methods.join(",")}`.localeCompare(`${r.ownerSymbol}\0${r.evidence}\0${r.methods.join(",")}`)))}function ui(e,t,n){let r=ci(t),i=di(t);if([...n].some(o=>r.has(o)))return!0;if(i.size===0||n.size===0)return!1;if(!!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))return!0;let s=[...n];for(let o=0;o<s.length;o+=750){let l=s.slice(o,o+750),u=l.map(()=>"?").join(",");if(e.all(`SELECT DISTINCT global_symbol.symbol
|
|
51
|
+
FROM mentions mention
|
|
52
|
+
JOIN chunks reference_chunk ON reference_chunk.id = mention.chunk_id
|
|
53
|
+
JOIN documents reference_document ON reference_document.id = reference_chunk.document_id
|
|
54
|
+
JOIN global_symbols global_symbol ON global_symbol.id = mention.symbol_id
|
|
55
|
+
WHERE mention.role != 1
|
|
56
|
+
AND reference_document.relative_path IN (${u})`,...l).some(c=>i.has(c.symbol)))return!0}return!1}function ci(e){let t=new Set;for(let n of e.observations)if(rt.has(n.action)){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)!n.action||!rt.has(n.action)||!n.source||t.add(n.source.file);return t}function di(e){return new Set(e.observations.flatMap(t=>rt.has(t.action)&&t.owner.symbol?[t.owner.symbol]:[]))}function pi(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.syntaxHash]));return t.length===n.size&&t.every(i=>i.syntaxHash!==void 0&&r.get(i.file)===i.syntaxHash)}function fi(e,t){let n=mi(e);return[...t].some(r=>n.has(r))}function mi(e){let t=new Set;for(let n of e.observations){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)n.source&&t.add(n.source.file);return t}function yi(e){return(e??[]).filter(t=>t.id!=="direct-extraction").map(t=>({...t,durationMs:0,filesVisited:0,filesReused:t.filesVisited??0,factsReused:t.outputFacts,factsInvalidated:0}))}function G(e,t,n,r,i,a={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...a})}var hi=256;async function gi(e,t,n){let r=[],i=[],a=n??((c,p)=>p()),s=[],o=[],l=new Map,u=c=>{let p=l.get(c);if(p!==void 0)return p;let f=re(e,c,Me(e,c));return l.set(c,f),f},d=0;for(let c of t){d+=1,d>=hi&&(d=0,await Wr());let p=a("runtime-boundaries.file.read",()=>Me(e,c)),f=re(e,c,p);l.set(c,f);let g=a("runtime-boundaries.file.direct-product",()=>{let h=un.read(e,c,f);if(!h||h.extractorVersion!==ye)return null;for(let S of h.deps)if(u(S.path)!==S.contentHash)return null;return h});if(g){r.push(...g.observations),i.push(g.coverage);continue}let b=a("runtime-boundaries.file.supports",()=>Xe.filter(h=>h.supports(p))),m=/\bJSON\.stringify\s*\(/u.test(p)&&/\bbody\s*:/u.test(p),y=a("runtime-boundaries.file.hashes",()=>{let h=ln.read(e,c,f);if(h)return h;let S=vi(c,p);return s.push({relativePath:c,contentHash:f,value:S}),S}),v=new Set,R=[],x=ot(h=>v.add(h),()=>{let h=b.length>0||m?L(e,c,p,n):null,S={file:c,hasAst:h!==null||xi(c,p),syntaxHash:y.syntaxHash,shapeHash:y.shapeHash,bodySummaries:h&&m?Ut(h):[],observationIds:[],extractors:[],extractionErrors:[]};if(h)for(let B of b){let I={id:B.id,applicableFiles:1,observations:0,errors:0};try{let N=Si(n,`runtime-boundaries.extractor.${B.id}`,c,()=>B.extract(h));I.observations=N.length,R.push(...N),S.observationIds.push(...N.map(F=>F.id))}catch(N){I.errors=1,S.extractionErrors.push(`${B.id} failed for ${c}: ${N instanceof Error?N.message:String(N)}`)}S.extractors.push(I)}return S});r.push(...R),i.push(x),x.extractionErrors.length===0&&(v.delete(c),o.push({relativePath:c,contentHash:f,value:{extractorVersion:ye,deps:[...v].sort().map(h=>({path:h,contentHash:u(h)})),observations:R,coverage:x}}))}return s.length>0&&ln.writeBatch(e,s),o.length>0&&un.writeBatch(e,o),{observations:r,fileCoverage:i}}var ln=ie({kind:"runtime-boundary-source-hashes",invalidation:ae("runtime-boundary-source-hashes"),serialize:e=>JSON.stringify(e),deserialize:e=>{try{let t=JSON.parse(e);return typeof t.syntaxHash=="string"&&typeof t.shapeHash=="string"?{syntaxHash:t.syntaxHash,shapeHash:t.shapeHash}:null}catch{return null}}}),un=ie({kind:"runtime-boundary-direct-extraction",invalidation:ae("runtime-boundary-direct-extraction"),serialize:e=>JSON.stringify(e),deserialize:e=>{try{let t=JSON.parse(e);return typeof t.extractorVersion!="string"||!Array.isArray(t.deps)||!Array.isArray(t.observations)||typeof t.coverage!="object"||t.coverage===null||!t.deps.every(n=>typeof n=="object"&&n!==null&&typeof n.path=="string"&&typeof n.contentHash=="string")?null:t}catch{return null}}});function vi(e,t){if(!/\.(?:[cm]?[jt]sx?)$/iu.test(e)){let u=me("sha256").update(t).digest("hex");return{syntaxHash:u,shapeHash:u}}let n=/\.[jt]sx$/iu.test(e)?w.LanguageVariant.JSX:w.LanguageVariant.Standard,r=w.createScanner(w.ScriptTarget.Latest,!1,n,t),i=me("sha256"),a=me("sha256"),s=[],o=[0];for(let u=0;u<t.length;u+=1)t.charCodeAt(u)===10&&o.push(u+1);let l=0;for(let u=r.scan();u!==w.SyntaxKind.EndOfFileToken;u=r.scan()){if(u===w.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)===0&&(u=r.reScanTemplateToken(!1)),Qr.has(u))continue;let d=r.getTokenText();for(;o[l+1]!==void 0&&o[l+1]<=r.getTokenPos();)l+=1;i.update(String(u)),i.update("\0"),i.update(d),i.update("\0"),i.update(String(l)),i.update("\0"),a.update(String(u)),a.update("\0"),!ei.has(u)&&!bi(u,d)&&a.update(d),a.update("\0"),a.update(String(l)),a.update("\0"),u===w.SyntaxKind.TemplateHead?s.push(0):u===w.SyntaxKind.TemplateTail?s.pop():u===w.SyntaxKind.OpenBraceToken&&s.length>0?s[s.length-1]+=1:u===w.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)>0&&(s[s.length-1]-=1)}return{syntaxHash:i.digest("hex"),shapeHash:a.digest("hex")}}function bi(e,t){if(e!==w.SyntaxKind.StringLiteral||t.length<2)return!1;let n=t.slice(1,-1);return n.startsWith("/")||n.includes("://")}function Si(e,t,n,r){return e?e(t,r,{file:n}):r()}function xi(e,t){return t?st(e)?/<script\b/iu.test(t):ve(e)!==null:!1}function Ri(e){let t=new Map(Xe.map(n=>[n.id,{id:n.id,applicableFiles:0,observations:0,errors:0}]));for(let n of e)for(let r of n.extractors){let i=t.get(r.id);i&&(i.applicableFiles+=r.applicableFiles,i.observations+=r.observations,i.errors+=r.errors)}return t}function Ci(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function Ni(e){let t=new Map;for(let n of Ae){let r=new Set([...n.producerActions,...n.consumerActions,...n.declarationActions??[]]);for(let i of e){if(!r.has(i.action)||i.strength==="candidate")continue;let a=Fi(i,n.keyNames);if(!a)continue;let s=a.map(c=>`${c.name}=${fn(c.name,c.value)}`).join("\0"),o=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${o}\0${s}`,u=`boundary-group:${me("sha256").update(l).digest("hex").slice(0,16)}`,d=t.get(u)??{id:u,protocol:n.protocol,joinRule:n.id,normalizedKey:s,keyParts:a,producerIds:[],consumerIds:[],declarationIds:[],derivation:{kind:"mechanically-derived",rule:n.id,ruleVersion:"2",inputFactIds:[],sourceSpans:[]}};n.producerActions.includes(i.action)&&d.producerIds.push(i.id),n.consumerActions.includes(i.action)&&d.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&d.declarationIds.push(i.id),d.derivation.inputFactIds.push(i.id),d.derivation.sourceSpans.push(i.source),t.set(u,d)}}return[...t.values()].map(Bi).sort(_i)}function Bi(e){return{...e,producerIds:ke(e.producerIds),consumerIds:ke(e.consumerIds),declarationIds:ke(e.declarationIds),derivation:{...e.derivation,inputFactIds:ke(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function Ii(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let a=Ae.find(o=>o.id===i.joinRule);if(!a?.traversable)continue;let s=a.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(s.length===0||i.consumerIds.length===0)&&!(a.requireUniquePair&&(s.length!==1||i.consumerIds.length!==1))&&!(a.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(s.length*i.consumerIds.length>ti))for(let o of s)for(let l of i.consumerIds){let u=n.get(o),d=n.get(l);if(!u||!d||Ti(u,d))continue;let c=u.strength==="derived"||d.strength==="derived"?"derived":"exact",p=`${i.joinRule}\0${o}\0${l}`,f={id:`boundary-link:${me("sha256").update(p).digest("hex").slice(0,16)}`,from:o,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:c,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[o,l],sourceSpans:[u.source,d.source]}};r.set(f.id,f)}}return[...r.values()].sort($i)}function Pi(e,t){let n=new Set(t.filter(pn).flatMap(Oe)),r=new Set(t.filter(Ei).flatMap(Oe));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function wi(e,t){let n=new Set(e.filter(a=>a.strength!=="candidate").map(a=>`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)),r=new Set(t.flatMap(Oe)),i=new Set(t.filter(pn).flatMap(Oe));return e.filter(a=>a.sourceScope==="production").filter(a=>a.strength!=="candidate"||!n.has(`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)).filter(a=>!i.has(a.id)).map(a=>{let s=a.keyParts.filter(l=>l.evidence==="expression"||l.value.length===0).map(l=>l.name),o=s.length>0?`${a.extractor} observed ${a.action}, but ${s.join(", ")} remained symbolic or unknown.`:a.resolution==="ambiguous"?`${a.extractor} established the address for ${a.action}, but more than one indexed peer has the same runtime key.`:r.has(a.id)?`${a.extractor} established the address for ${a.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${a.extractor} observed ${a.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:a.id,reason:o,missingKeyParts:s,sourceScope:a.sourceScope}}).sort((a,s)=>a.observationId.localeCompare(s.observationId))}function Oe(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function pn(e){let t=Ae.find(r=>r.id===e.joinRule);if(!t)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length===0||e.consumerIds.length===0?!1:!t.requireUniquePair||n.length===1&&e.consumerIds.length===1}function Ei(e){let t=Ae.find(r=>r.id===e.joinRule);if(!t?.requireUniquePair)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length>0&&e.consumerIds.length>0&&(n.length!==1||e.consumerIds.length!==1)}function Fi(e,t){let n=[];for(let r of t){let i=e.keyParts.find(a=>a.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:fn(r,i.value)})}return n}function fn(e,t){if(e==="method")return t.toUpperCase();if(e!=="path")return t;let n=t.startsWith("/")?t:`/${t}`;return n.length>1?n.replace(/\/+$/u,""):n}function Ti(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function fe(e){return[...new Map(e.map(t=>[t.id,t])).values()].sort((t,n)=>t.source.file.localeCompare(n.source.file)||t.source.startLine-n.source.startLine||t.action.localeCompare(n.action))}function ke(e){return[...new Set(e)].sort()}function _i(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function $i(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}export{Re as a,V as b,Je as c,ce as d,ye as e,ni as f,yn as g,hn as h,vt as i};
|
|
57
|
+
//# sourceMappingURL=chunk-N7FP5H5U.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b as I}from"./chunk-
|
|
1
|
+
import{b as I}from"./chunk-ISWFRGJ6.js";import{b as y}from"./chunk-BOJ5SVE2.js";import{b as w}from"./chunk-Q6T2CAJL.js";import{d as k}from"./chunk-42W3LFUK.js";import{N as R}from"./chunk-7JYHQAH2.js";import{B as b}from"./chunk-Q7GBK5T7.js";var C=60;function nt(t,s={}){let{scope:n,limit:e=30,scanLimit:i,rotDays:r=C}=s,c=y(R(t,{extensions:[".ts",".tsx",".js",".jsx",".mjs",".cjs"]}).filter(a=>w(a)==="test").filter(a=>!n||a.includes(n)).filter(a=>!t.isIgnored(a)).sort(),i),o=[],l=[],p=[];for(let a of c){let d=b(t,a);if(!d)continue;let x=k(d),h=K(d);for(let u of j(x,h))h.add(u);let O=P(x);for(let u of O){if(u.skip){l.push(H(t,a,u,r));continue}if(u.kind==="describe")continue;let S=F(d,u.argsStart),m=x.slice(u.argsStart,u.callEnd),M=d.slice(u.argsStart,u.callEnd);_(m,h)||o.push({file:a,startLine:f(d,u.callStart),endLine:f(d,u.callEnd),title:S,severity:/\bawait\b/.test(m)?"low":"high"});let A=B(m,M);A&&p.push({file:a,startLine:f(d,u.callStart),endLine:f(d,u.callEnd),title:S,echoedValue:A})}}return{assertionFree:e?o.slice(0,e):o,skipped:e?l.slice(0,e):l,mockEcho:e?p.slice(0,e):p}}var E=/(?<!\.)\b(?:x(it|test|describe)|(it|test|describe)(?:\.\s*(skip|only|todo|each\s*\([^)]*\)))?)\s*\(/g;function P(t){let s=[];E.lastIndex=0;let n;for(;n=E.exec(t);){let e=n[1],i=e??n[2];if(!i)continue;let r=n[3]?.split(/\s*\(/)[0],c=n.index,o=n.index+n[0].length-1,l=g(t,o);E.lastIndex=o+1,r!=="each"&&s.push({kind:i,skip:e!==void 0||r==="skip"||r==="todo",skipKind:r==="todo"?"todo":"skip",callStart:c,argsStart:o+1,callEnd:l+1})}return s}function g(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0))return e}return t.length-1}function f(t,s){let n=0;for(let e=0;e<s&&e<t.length;e+=1)t[e]===`
|
|
2
2
|
`&&(n+=1);return n}function F(t,s){let n=t.slice(s,s+400),e=/^\s*(['"`])((?:\\.|(?!\1)[\s\S])*)\1/.exec(n);return e?e[2]:"(anonymous)"}var D=new Set(["vitest","chai","jest","@jest/globals","assert","node:assert","node:assert/strict","assert/strict","uvu/assert","expect","chai-as-promised"]),L=/import\s+(?:\*\s+as\s+(\w+)|\{([^}]*)\}|(\w+))\s+from\s+['"]([^'"]+)['"]/g;function K(t){let s=new Set(["expect","assert"]);L.lastIndex=0;let n;for(;n=L.exec(t);){let[,e,i,r,c]=n;if(!(!c||!D.has(c))&&(e&&s.add(e),r&&s.add(r),i))for(let o of i.split(",")){let l=o.trim().replace(/^type\s+/,"");if(!l)continue;let p=/^(\w+)\s+as\s+(\w+)$/.exec(l);s.add(p?p[2]:l)}}return s}function _(t,s){if(/\.should\b/.test(t)||/\bawait\s+(?:[\w$.]+\.)?findBy[A-Z]\w*\s*\(/.test(t)||/\bawait\s+\w*waitFor(?:Text|Value|Condition|Result|Event)\s*\(/.test(t)||/\bthrow\b/.test(t))return!0;for(let n of s){let e=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${e}\\s*(?:<[^<>]*>)?\\s*[.(]`).test(t))return!0}return!1}var v=/\bfunction\s+(\w+)\s*\(/g,V=/\b(?:const|let)\s+(\w+)\s*=\s*(?:async\s*)?\(/g,$=60;function j(t,s){let n=new Set;for(let e of[v,V]){e.lastIndex=0;let i;for(;i=e.exec(t);){let r=i[1],c=i.index+i[0].length-1,o=g(t,c),l=t.indexOf("{",o+1);if(l===-1||l-o>$)continue;let p=Q(t,l),a=t.slice(l+1,p);_(a,s)&&n.add(r)}}return n}function Q(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="{")n+=1;else if(i==="}"&&(n-=1,n===0))return e}return t.length-1}var U=/\bmock(?:ReturnValue|ResolvedValue)(?:Once)?\s*\(/g,T=/\bexpect\s*\(/g,q=/^\s*\.\s*(?:toBe|toEqual|toStrictEqual)\s*\(/,N=/^(?:-?\d+(?:\.\d+)?|(['"`]).+\1)$/;function B(t,s){let n=G(t,s,U);if(n.length===0)return null;let e=Y(t,s);for(let i of e)if(n.includes(i))return i;return null}function G(t,s,n){let e=[];n.lastIndex=0;let i;for(;i=n.exec(t);){let r=i.index+i[0].length-1,c=g(t,r),o=s.slice(r+1,c).trim();N.test(o)&&e.push(o),n.lastIndex=c+1}return e}function Y(t,s){let n=[];T.lastIndex=0;let e;for(;e=T.exec(t);){let i=e.index+e[0].length-1,r=g(t,i),c=t.slice(r+1),o=q.exec(c);if(T.lastIndex=r+1,!o)continue;let l=r+1+o[0].length-1,p=g(t,l),a=s.slice(l+1,p).trim();N.test(a)&&n.push(a)}return n}function H(t,s,n,e){let i=b(t,s),r=F(i,n.argsStart),c=f(i,n.callStart),o=X(t.config.projectRoot,s,c),l=o===null?"unknown":o>=e?"rot":"workflow";return{file:s,startLine:c,title:r,skipKind:n.skipKind,blockKind:n.kind,ageDays:o,rot:l}}function X(t,s,n){let e=n+1;try{let i=I(t,["blame","-L",`${e},${e}`,"--porcelain","--",s]),r=/^author-time (\d+)$/m.exec(i);if(!r)return null;let c=Number(r[1]);return Number.isFinite(c)?Math.max(0,Math.round((Date.now()/1e3-c)/86400)):null}catch{return null}}export{nt as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-NEIQPFBI.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as D}from"./chunk-JFQBRL3J.js";import{d as H,e as J,f as ee,m as Z}from"./chunk-AYPDH2LU.js";import{c as Y,t as T,u as U}from"./chunk-TD7VKJ2Y.js";import{f as R,h as E,m as z,q as N,s as j,x as A}from"./chunk-42W3LFUK.js";import{C as w}from"./chunk-7JYHQAH2.js";import{B as X}from"./chunk-Q7GBK5T7.js";import{E as G,H as K,d as M}from"./chunk-GH5YSGZL.js";var te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,ae=new WeakMap;function qe(t,e){let n=ne.get(t);n||(n=new Map,ne.set(t,n));let r=n.get(e);if(r)return r;let i=w(t,e)?.rootNode;if(!i)return n.set(e,[]),[];let o=new Set;I(i,c=>{if(c.type!=="call_expression")return;let p=c.childForFieldName("function")??c.namedChild(0),s=/^([A-Za-z_$][\w$]*(?:\.Service)?)\.of$/u.exec(p?.text.replace(/\s+/gu,"")??"");s&&o.add(s[1])});let m=A(t,e).filter(c=>!!c.sourcePath),u=new Set;for(let c of o){let p=/^([A-Za-z_$][\w$]*)\.Service$/u.exec(c);if(p){for(let s of m)s.localName===p[1]&&u.add(s.sourcePath);continue}if(c==="Service"){T(t,e).some(s=>s.leaf==="Service")&&u.add(e);for(let s of m)(s.localName??s.importedName)==="Service"&&u.add(s.sourcePath)}}let l=Q([...u]).sort();return n.set(e,l),l}function Ge(t,e,n={}){let i=j(t,e)?.filter(a=>!n.ranges||n.ranges.some(d=>a.line>=d.startLine&&a.line<=d.endLine));if(!i)return{targets:[],unresolvedCallsites:0};let o=A(t,e).filter(a=>!!a.sourcePath),m=Fe(X(t,e)??""),u=w(t,e)?.rootNode??null,l=u?ge(u):se(),c=new Map,p=ee(t),s=[],f=0;for(let a of i){if(!a.memberAccess)continue;let d=H(e,p.get(a.calleeLeaf)??[]);if(n.excludeIndexedTargets!==!1&&J(t,e,d,!0,a.calleeQualifier))continue;let h=a.calleeQualifier,L=$e(t,e,a,o);if(L){s.push(L);continue}let S=pe(t,e,a,o,he(l,a.calleeQualifier,a.line));if(S.length>0){s.push(...S);continue}let x=ye(t,e,a);if(x.length>0){s.push(...x);continue}let y=h?m.get(h)??h:null,P=(y?Q(o.filter(g=>(g.localName??g.importedName)===y).map(g=>g.sourcePath)):[]).flatMap(g=>{let v=c.get(g);return v||(v=N(t,g)??[],c.set(g,v)),v.filter(b=>b.name===a.calleeLeaf).map(b=>({file:g,callable:b}))});if(P.length!==1){f+=1;continue}let _=P[0];s.push({calleeLeaf:a.calleeLeaf,line:a.line,sourceFile:e,targetFile:_.file,targetStartLine:_.callable.startLine,targetEndLine:_.callable.endLine,resolution:"direct-import-receiver",strength:"candidate"})}return{targets:s,unresolvedCallsites:f}}function pe(t,e,n,r,i){let o=n.calleeQualifier;if(!o||!/^[A-Za-z_$][\w$]*$/u.test(o))return[];if(i.size!==1)return[];let m=[...i][0],u=Q(r.filter(p=>p.localName===m||p.importedName===m).map(p=>p.sourcePath));if(u.length!==1)return[];let l=u[0],c=be(t,l,n.calleeLeaf);return c.map(p=>({calleeLeaf:p.name,line:n.line,sourceFile:e,targetFile:p.file,targetStartLine:p.startLine,targetEndLine:p.endLine,serviceFile:l,resolutionAlternativeCount:c.length,resolution:"imported-service-object-member",strength:"candidate"}))}function se(){return{declarations:new Map,callbacks:[]}}function ge(t){let e=se();return I(t,n=>{if(n.type==="variable_declarator"){let l=n.childForFieldName("name")??n.namedChild(0),c=n.childForFieldName("value")??n.namedChild(1);if(l?.type!=="identifier"||!c)return;let p=new Set;if(I(c,s=>{if(s.type!=="member_expression")return;let f=s.childForFieldName("object")??s.namedChild(0),a=s.childForFieldName("property")??s.namedChild(1);f?.type==="identifier"&&a?.text==="Service"&&p.add(f.text)}),p.size===1){let s=e.declarations.get(l.text)??[];s.push({line:n.startPosition.row,alias:[...p][0]}),e.declarations.set(l.text,s)}return}if(!["arrow_function","function_expression","generator_function"].includes(n.type))return;let r=n.childForFieldName("parameters")??n.childForFieldName("parameter");if(!r)return;let i=n.parent;for(;i&&i.type!=="call_expression";)i=i.parent;if(!i)return;let o=i.childForFieldName("function")??i.namedChild(0),m=/^([A-Za-z_$][\w$]*)\.Service\.use$/u.exec(o?.text??"");if(!m)return;let u=new Set;I(r,l=>{l.type==="identifier"&&u.add(l.text)}),u.size!==0&&e.callbacks.push({startLine:n.startPosition.row,endLine:n.endPosition.row,receivers:u,alias:m[1]})}),e}function he(t,e,n){if(!e||!/^[A-Za-z_$][\w$]*$/u.test(e))return new Set;let r=new Set((t.declarations.get(e)??[]).filter(i=>i.line<=n).map(i=>i.alias));for(let i of t.callbacks)i.startLine<=n&&i.endLine>=n&&i.receivers.has(e)&&r.add(i.alias);return r}function ye(t,e,n){let r=n.calleeQualifier;if(!r||!/^[A-Za-z_$][\w$]*$/u.test(r))return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=Le(t,e,i,n.line,n.calleeLeaf,r),m=o?xe(o,r):null;if(!m)return[];if(!Se(m))return[];let u=(N(t,e)??[]).filter(a=>a.startLine<=m.startPosition.row&&a.endLine>=m.endPosition.row).sort((a,d)=>a.endLine-a.startLine-(d.endLine-d.startLine))[0];if(!u)return[];let l=T(t,e).filter(a=>a.isFunctionLike&&a.leaf===u.name);if(l.length!==1)return[];let c=l[0],p=ie.get(t);p||(p=new Map,ie.set(t,p));let s=`${c.symbol}\0${n.calleeLeaf}`,f=p.get(s);if(!f){let a=[];for(let d of Z(t,c)){let h=w(t,d.file)?.rootNode;if(!h)continue;let L=R(h,"call_expression").filter(y=>y.startPosition.row>d.line||y.endPosition.row<d.line?!1:(y.childForFieldName("function")??y.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,"").match(/[A-Za-z_$][\w$]*$/u)?.[0]===c.leaf);if(L.length!==1)continue;let x=L[0].childForFieldName("arguments")?.namedChildren.find(y=>F(y).type==="object");if(x)for(let y of F(x).namedChildren){if(y.type==="shorthand_property_identifier"&&y.text===n.calleeLeaf){a.push(...O(t,d.file,n.calleeLeaf,y,y));continue}if(y.type!=="pair")continue;let $=y.childForFieldName("key")??y.namedChild(0),P=y.childForFieldName("value")??y.namedChild(1);k($?.text)!==n.calleeLeaf||!P||a.push(...O(t,d.file,n.calleeLeaf,P,y))}}f=a.filter((d,h,L)=>L.findIndex(S=>S.file===d.file&&S.startLine===d.startLine&&S.endLine===d.endLine&&S.name===d.name)===h),p.set(s,f)}return f.map(a=>({calleeLeaf:a.name,line:n.line,sourceFile:e,targetFile:a.file,targetStartLine:a.startLine,targetEndLine:a.endLine,resolutionAlternativeCount:f.length,resolution:"factory-callback-member",strength:f.length===1?"exact":"candidate"}))}function Le(t,e,n,r,i,o){let m=re.get(t);m||(m=new Map,re.set(t,m));let u=m.get(e);if(!u){u=new Map;for(let l of R(n,"call_expression")){let c=l.childForFieldName("function")??l.namedChild(0),p=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(c?.text.replace(/\s+/gu,"")??"");if(p)for(let s=l.startPosition.row;s<=l.endPosition.row;s+=1){let f=`${s}\0${p[1]}\0${p[2]}`,a=u.get(f);(!a||l.endIndex-l.startIndex<a.endIndex-a.startIndex)&&u.set(f,l)}}m.set(e,u)}return u.get(`${r}\0${o}\0${i}`)??null}function Se(t){return t.descendantsOfType("return_statement").some(e=>{let n=e.childForFieldName("argument")??e.namedChild(0);return!!(n&&F(n).type==="object")})}function xe(t,e){let n=t.parent;for(;n;){if(/(?:function|method|lambda)/u.test(n.type)||n.type==="arrow_function"){let r=n.childForFieldName("parameters")??n.childForFieldName("parameter"),i=!1;if(r&&I(r,o=>{o.type==="identifier"&&o.text===e&&(i=!0)}),i)return n}n=n.parent}return null}function O(t,e,n,r,i){if(r.type==="identifier")return(N(t,e)??[]).filter(l=>l.name===r.text).map(l=>({...l,file:e}));let o=B(t,e,r.text);if(o.length>0)return o;if(!W(r))return[];let u=(N(t,e)??[]).filter(l=>l.startLine>=i.startPosition.row&&l.endLine<=i.endPosition.row&&(l.name===n||l.name.startsWith("source@"))).sort((l,c)=>l.endLine-l.startLine-(c.endLine-c.startLine))[0];return[u?{...u,file:e}:{name:n,file:e,startLine:i.startPosition.row,endLine:i.endPosition.row}]}function be(t,e,n){let r=ae.get(t);r||(r=new Map,ae.set(t,r));let i=`${e}\0${n}`,o=r.get(i);if(o)return o;let m=ve(t,e).flatMap(u=>Ce(t,u,e,n));return r.set(i,m),m}function Ce(t,e,n,r){let i=w(t,e)?.rootNode,o=N(t,e)??[];if(!i)return[];let m=we(t,e,n);if(m.size===0)return[];let u=new Set,l=[],c=[],p=[];return I(i,f=>{if(Ne(f,m)){if(f.type==="pair"){let a=f.childForFieldName("key")??f.namedChild(0),d=f.childForFieldName("value")??f.namedChild(1);if(k(a?.text)!==r||!d)return;if(d.type==="identifier")u.add(d.text);else if(W(d))l.push({name:r,startLine:f.startPosition.row,endLine:f.endPosition.row});else{let h=Ie(t,e,d.text),L=B(t,e,d.text);if(h.length>0)p.push(...h);else if(L.length>0)p.push(...L);else{let S=Pe(f);S&&c.push(S)}}return}f.type==="shorthand_property_identifier"&&f.text===r&&u.add(r)}}),[...o.filter(f=>u.has(f.name)).map(f=>({...f,file:e})),...l.map(f=>({...f,file:e})),...c.map(f=>({...f,file:e})),...p].filter((f,a,d)=>d.findIndex(h=>h.file===f.file&&h.name===f.name&&h.startLine===f.startLine&&h.endLine===f.endLine)===a)}function Ne(t,e){let n=t,r=null;for(;n;){if(n.type==="object"&&(r=n),n.type==="call_expression"){if(!r)return!1;let i=n.childForFieldName("function")??n.namedChild(0);return i?e.has(i.text.replace(/\.of$/u,""))&&i.text.endsWith(".of"):!1}n=n.parent}return!1}function ve(t,e){let n=te.get(t);n||(n=new Map,te.set(t,n));let r=n.get(e);if(r)return r;let i=new Set([e]),o=T(t,e).filter(u=>u.leaf==="Service"&&u.isTypeLike);for(let u of o)for(let l of Z(t,u))i.add(l.file);let m=[...i].sort();return n.set(e,m),m}function we(t,e,n){let r=new Set;M(e,n)&&r.add("Service");for(let i of A(t,e)){if(!i.sourcePath||!M(i.sourcePath,n))continue;if(i.kind==="namespace"&&i.localName){r.add(`${i.localName}.Service`);continue}(i.importedName==="default"?i.localName:i.importedName)==="Service"?r.add(i.localName??i.importedName):i.localName&&i.importedName!=="default"&&r.add(`${i.localName}.Service`)}return r}function B(t,e,n){let r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!r)return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=oe(i,r[1]),m=o?le(o):null;if(!m)return[];let u=m.childForFieldName("function")??m.namedChild(0),l=u?ce(t,e,u.text):[];if(l.length!==1)return[];let c=l[0],p=w(t,c.relativePath)?.rootNode;if(!p)return[];let s=E(p,c.startLine,c.endLine);if(!s)return[];let f=[];for(let a of s.descendantsOfType("return_statement")){let d=a.childForFieldName("argument")??a.namedChild(0);if(!d)continue;let h=F(d);if(h.type==="object")for(let L of h.namedChildren){if(L.type==="shorthand_property_identifier"&&L.text===r[2]){for(let y of N(t,c.relativePath)??[])y.name===r[2]&&f.push({...y,file:c.relativePath});continue}if(L.type!=="pair")continue;let S=L.childForFieldName("key")??L.namedChild(0),x=L.childForFieldName("value")??L.namedChild(1);if(!(k(S?.text)!==r[2]||!x))if(x.type==="identifier")for(let y of N(t,c.relativePath)??[])y.name===x.text&&f.push({...y,file:c.relativePath});else W(x)&&f.push({name:r[2],startLine:L.startPosition.row,endLine:L.endPosition.row,file:c.relativePath})}}return f.filter((a,d,h)=>h.findIndex(L=>L.file===a.file&&L.name===a.name&&L.startLine===a.startLine&&L.endLine===a.endLine)===d)}function Ie(t,e,n){let r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!r)return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=oe(i,r[1]),m=o?le(o):null,u=m?.childForFieldName("function")??m?.namedChild(0),l=u?ce(t,e,u.text):[];if(l.length!==1||!m)return[];let c=l[0],p=w(t,c.relativePath)?.rootNode;if(!p)return[];let s=E(p,c.startLine,c.endLine);if(!s)return[];let f=new Set,a=s.childForFieldName("parameters")??s.childForFieldName("parameter");if(a&&I(a,g=>{g.type==="identifier"&&f.add(g.text)}),f.size===0)return[];let d=B(t,e,n);if(d.length===0)return[];let h=(N(t,c.relativePath)??[]).filter(g=>g.startLine>=c.startLine&&g.endLine<=c.endLine),L=(j(t,c.relativePath)??[]).filter(g=>g.line>=c.startLine&&g.line<=c.endLine),S=new Set,x=d.map(g=>({name:g.name,startLine:g.startLine,endLine:g.endLine})),y=new Set;for(;x.length>0&&y.size<32;){let g=x.shift(),v=`${g.name}\0${g.startLine}\0${g.endLine}`;if(!y.has(v)){y.add(v);for(let b of L.filter(C=>C.line>=g.startLine&&C.line<=g.endLine)){if(b.memberAccess&&b.calleeQualifier&&f.has(b.calleeQualifier)){S.add(b.calleeLeaf);continue}if(b.memberAccess)continue;let C=h.filter(de=>de.name===b.calleeLeaf);C.length===1&&x.push(C[0])}}}if(S.size===0)return[];let P=m.childForFieldName("arguments")?.namedChildren.find(g=>F(g).type==="object");if(!P)return[];let _=[];for(let g of F(P).namedChildren){if(g.type==="shorthand_property_identifier"&&S.has(g.text)){_.push(...O(t,e,g.text,g,g));continue}if(g.type!=="pair")continue;let v=g.childForFieldName("key")??g.namedChild(0),b=g.childForFieldName("value")??g.namedChild(1),C=k(v?.text);!C||!S.has(C)||!b||_.push(...O(t,e,C,b,g))}return _.filter((g,v,b)=>b.findIndex(C=>C.file===g.file&&C.name===g.name&&C.startLine===g.startLine&&C.endLine===g.endLine)===v)}function oe(t,e){for(let n of R(t,"variable_declarator"))if((n.childForFieldName("name")??n.namedChild(0))?.text===e)return n.childForFieldName("value")??n.namedChild(1);return null}function le(t){return t.type==="call_expression"?t:t.descendantsOfType("call_expression")[0]??null}function ce(t,e,n){let r=n.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,""),i=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(r);if(i){let s=A(t,e).filter(d=>d.localName===i[1]&&d.sourcePath);if(s.length!==1||!s[0].sourcePath)return[];let f=s[0].sourcePath,a=D(t,f,i[2]).filter(d=>d.isFunctionLike);return a.length>0?a:(N(t,f)??[]).filter(d=>d.name===i[2]).map(d=>({...d,relativePath:f}))}if(!/^[A-Za-z_$][\w$]*$/u.test(r))return[];let o=T(t,e).filter(s=>s.leaf===r&&s.isFunctionLike);if(o.length>0)return o;let m=(N(t,e)??[]).filter(s=>s.name===r).map(s=>({...s,relativePath:e}));if(m.length>0)return m;let u=A(t,e).filter(s=>s.localName===r&&s.sourcePath&&s.kind!=="namespace");if(u.length!==1||!u[0].sourcePath)return[];let l=u[0].sourcePath,c=u[0].importedName==="default"?r:u[0].importedName,p=D(t,l,c).filter(s=>s.isFunctionLike);return p.length>0?p:(N(t,l)??[]).filter(s=>s.name===c).map(s=>({...s,relativePath:l}))}function W(t){return["arrow_function","function_expression","generator_function"].includes(t.type)||t.descendantsOfType(["arrow_function","function_expression","generator_function"]).length>0}function Pe(t){let e=t.parent;for(;e;){if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0);if(n?.type==="identifier")return{name:n.text,startLine:e.startPosition.row,endLine:e.endPosition.row}}e=e.parent}return null}function k(t){return t?t.replace(/^(?:['"])(.*)(?:['"])$/u,"$1"):null}function $e(t,e,n,r){let i=/^this\.([A-Za-z_$][\w$]*)$/u.exec(n.calleeQualifier??"");if(!i)return null;let o=w(t,e)?.rootNode;if(!o)return null;let m=_e(o,n.line);if(!m)return null;let u=new Set;if(I(m,h=>{if(h.type!=="assignment_expression")return;let L=h.childForFieldName("left")??h.namedChild(0),S=h.childForFieldName("right")??h.namedChild(h.namedChildCount-1);if(L?.text.replace(/\s+/gu,"")!==`this.${i[1]}`||!S)return;let x=F(S);if(x.type!=="new_expression")return;let $=(x.childForFieldName("constructor")??x.namedChild(0))?.text.match(/[A-Za-z_$][\w$]*$/u)?.[0];$&&u.add($)}),u.size!==1)return null;let l=[...u][0],c=r.filter(h=>h.localName===l);if(c.length!==1)return null;let p=c[0].importedName==="default"?l:c[0].importedName,s=c[0].importedName==="default"?D(t,c[0].sourcePath,l):[],f=s.length===1?s[0].leaf:p,a=T(t,c[0].sourcePath).filter(h=>h.isFunctionLike&&h.leaf===n.calleeLeaf&&Y(h.symbol)===f);if(a.length!==1)return null;let d=a[0];return{calleeLeaf:n.calleeLeaf,line:n.line,sourceFile:e,targetFile:d.relativePath,targetStartLine:d.startLine,targetEndLine:d.endLine,targetSymbol:d.symbol,resolution:"constructed-member-receiver",strength:"exact"}}function _e(t,e){let n=[];return I(t,r=>{["class","class_declaration","class_definition"].includes(r.type)&&r.startPosition.row<=e&&r.endPosition.row>=e&&n.push(r)}),n.sort((r,i)=>r.endPosition.row-r.startPosition.row-(i.endPosition.row-i.startPosition.row))[0]??null}function F(t){let e=t;for(;["parenthesized_expression","as_expression","type_assertion","satisfies_expression"].includes(e.type)&&e.namedChildCount===1;)e=e.namedChild(0);return e}function I(t,e){e(t);for(let n of t.namedChildren)I(n,e)}function Fe(t){let e=new Map,n=/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*;/gu;for(let r of t.matchAll(n)){let i=r[1],o=r[2];i&&o&&e.set(i,o)}return e}function Q(t){let e=[];for(let n of t)e.some(r=>M(r,n))||e.push(n);return e}import{existsSync as Te}from"fs";import{SymbolRole as Me}from"@c4312/scip";import{deserializeSCIP as Ae}from"@c4312/scip";function ue(t,e){return Ae(K(t,{inputKind:e,maxBytes:G}))}var V=new WeakMap;function rt(t,e,n,r){let i=z(t,e),o=(i?.callSites??[]).filter(a=>a.line>=n&&a.line<=r);if(!i||o.length===0)return{available:!!i,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let m=q(t);if(!m)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:o.length};let u=(m.byFile.get(e)??[]).filter(a=>a.sourceLine>=n&&a.sourceLine<=r).map(a=>({...a,calleeLeaf:a.definition.leaf})),l=fe(o.map(a=>({line:a.line,leaf:a.calleeLeaf}))),c=fe(u.map(a=>({line:a.sourceLine,leaf:a.calleeLeaf}))),p=new Set([...l].flatMap(([a,d])=>c.get(a)===d?[a]:[])),s=u.filter(a=>p.has(me(a.sourceLine,a.calleeLeaf))),f=[...p].reduce((a,d)=>a+(l.get(d)??0),0);return{available:!0,targets:s,resolvedCallsites:f,unresolvedCallsites:Math.max(0,o.length-f)}}function it(t,e,n,r){let i=q(t);return i?{available:!0,targets:(i.byFile.get(e)??[]).filter(o=>o.sourceLine>=n&&o.sourceLine<=r)}:{available:!1,targets:[]}}function at(t,e,n,r){let i=q(t);return i?{available:!0,targets:(i.byFile.get(e)??[]).filter(o=>o.sourceLine>=n&&o.sourceLine<=r&&De(t,o.definition)).map(o=>({...o,calleeLeaf:o.definition.leaf}))}:{available:!1,targets:[]}}function q(t){if(V.has(t))return V.get(t)??null;let e=Re(t);return V.set(t,e),e}function Re(t){if(!t.generation.indexPath||!Te(t.generation.indexPath))return null;try{let e=U(t),n=new Map(e.map(o=>[o.symbol,o])),r=ue(t.generation.indexPath,"SCIP source-range call-target index"),i=new Map;for(let o of r.documents??[]){let m=o.relativePath;if(!m||t.isIgnored(m))continue;let u=[];for(let l of o.occurrences??[]){if(!l.symbol||(l.symbolRoles&Me.Definition)!==0)continue;let c=n.get(l.symbol),p=l.range?.[0];!c||!Number.isInteger(p)||u.push({sourceLine:p,definition:c})}i.set(m,u)}return{byFile:i}}catch{return null}}function De(t,e){if(!e.isFunctionLike)return!1;let n=z(t,e.relativePath);return!n||n.callables.some(r=>r.name===e.leaf&&r.startLine===e.startLine&&r.endLine===e.endLine)?!0:Oe(e)}function Oe(t){let e=t.documentation;if(!e)return!1;let n=t.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${n}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(e)||new RegExp(`\\b(?:const|let|var)\\s+${n}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(e)}function fe(t){let e=new Map;for(let n of t){let r=me(n.line,n.leaf);e.set(r,(e.get(r)??0)+1)}return e}function me(t,e){return`${t}\0${e}`}export{qe as a,Ge as b,rt as c,it as d,at as e,De as f};
|
|
2
|
+
//# sourceMappingURL=chunk-NK3JMP22.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as f,g as u}from"./chunk-
|
|
1
|
+
import{a as f,g as u}from"./chunk-AK3PYTIK.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
|
|
2
2
|
`)}function A(n,t){let r=n.trimStart();if(!r||r.startsWith("#"))return n;let e=n.slice(0,n.length-r.length),i=r.startsWith("!"),o=i?r.slice(1):r;if(!o||o.startsWith("#"))return n;let s=o.startsWith("/"),a=s?o.slice(1):o,p=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${t}/${a}`:`${t}/**/${a}`;return`${e}${i?"!":""}${p}`}var F=`
|
|
3
3
|
# Dependencies
|
|
4
4
|
node_modules/
|
|
@@ -57,4 +57,4 @@ Thumbs.db
|
|
|
57
57
|
# Type definitions (often noise in queries)
|
|
58
58
|
*.d.ts
|
|
59
59
|
`;function g(n,t,r){let e=x(t,r);if(!e)return!1;try{return n.ignores(e)}catch{return!1}}function x(n,t){if(!t||t===".")return null;if(!m(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=m(t)?t:S(n,t),e=T(n,r).replaceAll("\\","/");return!e||e==="."||e.startsWith("..")?null:e}export{E as a};
|
|
60
|
-
//# sourceMappingURL=chunk-
|
|
60
|
+
//# sourceMappingURL=chunk-NRBNAECH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-PIFTZEEM.js";import{c as m}from"./chunk-PLYUVM4F.js";import{a as d}from"./chunk-BGBBVSH4.js";import{d as u}from"./chunk-TD7VKJ2Y.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NVSZNESQ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{f as B,g as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{f as B,g as S}from"./chunk-QLBSG7U5.js";import{b as O}from"./chunk-BOJ5SVE2.js";import{a as E}from"./chunk-BGBBVSH4.js";import{c as k}from"./chunk-BECZLYNU.js";import{b as L}from"./chunk-Q6T2CAJL.js";import{d as P}from"./chunk-MTDBHTSF.js";import{d as I,g as z,j as D,u as $}from"./chunk-TD7VKJ2Y.js";import{b as T,s as v,x as A}from"./chunk-42W3LFUK.js";import{H as _,t as p}from"./chunk-Q7GBK5T7.js";import{d as b}from"./chunk-GH5YSGZL.js";var U=new Set(P());function $e(e,t={}){let{includeHomonyms:n=!1,limit:i}=t,s=X(e,t).filter(r=>r.relationship==="divergent"||n&&r.relationship==="homonym");return i?s.slice(0,i):s}function X(e,t={}){let{scope:n,minSimilarity:i=.3,scanLimit:s}=t,r=Q(e,{scope:n,scanLimit:s});return Y(r,{minSimilarity:i,isDelegatePair:De(e)}).filter(a=>!a.members.some(o=>_(e,o.file,o.startLine,"twin")))}function Y(e,t={}){let n=t.minSimilarity??.3,i=t.isDelegatePair,s=e.filter(c=>!V(c.leaf)&&!fe(c.leaf)&&L(c.file)!=="test"&&!D(c.symbol)&&!Z(c.symbol)&&!j(c.symbol,c.leaf)),{recordsByLeaf:r,recordOrder:a}=p("twin-drift.group-by-leaf",()=>q(s),()=>({records:s.length})),o=p("twin-drift.cluster-leaf-names",()=>W([...r.keys()]),()=>({leaves:r.size}));return p("twin-drift.compare-clusters",()=>{let c=[];for(let h of o){let u=J(h,r,a);if(u.length<2||new Set(u.map(f=>f.file)).size<2)continue;let m=null,R=!1,C=!1,y=new Set;for(let f=0;f<u.length;f+=1)for(let w=f+1;w<u.length;w+=1){let d=u[f],g=u[w];if(d.file===g.file||!ge(d,g)||i?.(d,g,u)||i?.(g,d,u))continue;if(R=!0,y.add(d.symbol),y.add(g.symbol),d.normalizedBody===g.normalizedBody){C=!0;continue}let M=oe(d.tokens,g.tokens);(!m||M>m.similarity)&&(m={a:d,b:g,similarity:M})}if(!R)continue;let x=u.filter(f=>y.has(f.symbol)).sort((f,w)=>f.file.localeCompare(w.file)||f.startLine-w.startLine).map(se);if(!m){c.push({leaf:G(h),relationship:C?"identical":"homonym",maxDivergence:0,members:x});continue}let N=m.similarity>=n?"divergent":"homonym";c.push({leaf:G(h),relationship:N,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:x,...N==="divergent"?{firstDivergentTokens:ae(m.a.tokens,m.b.tokens)}:{}})}return c},()=>({clusters:o.length,records:s.length})).sort((c,h)=>h.members.length-c.members.length||h.maxDivergence-c.maxDivergence||c.leaf.localeCompare(h.leaf))}function q(e){let t=new Map,n=new Map;for(let[i,s]of e.entries()){let r=t.get(s.leaf)??[];r.push(s),t.set(s.leaf,r),n.set(s,i)}return{recordsByLeaf:t,recordOrder:n}}function J(e,t,n){let i=[...e].flatMap(s=>t.get(s)??[]);return e.size>1&&i.sort((s,r)=>(n.get(s)??0)-(n.get(r)??0)),i}function Q(e,t){let n=p("twin-drift.load-definitions",()=>$(e,{scope:t.scope}).filter(r=>ee(r)&&!e.isIgnored(r.relativePath)).filter(r=>!k(r.relativePath)));p("twin-drift.sort-definitions",()=>n.sort((r,a)=>r.relativePath.localeCompare(a.relativePath)||r.startLine-a.startLine),()=>({definitions:n.length}));let i=O(n,t.scanLimit),s=p("twin-drift.select-candidates",()=>te(i),()=>({scanned:i.length}));return p("twin-drift.build-records",()=>{let r=[];for(let a of s){let o=ne(e,a);o&&r.push(o)}return r},()=>({candidates:s.length,scanned:i.length}))}function ee(e){return e.isFunctionLike?e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&U.has(e.kind):!0:!1}function te(e){let t=e.filter(r=>r.leaf&&!V(r.leaf)&&!D(r.symbol)&&!Z(r.symbol)&&!j(r.symbol,r.leaf)),n=new Map;for(let r of t){let a=n.get(r.leaf)??[];a.push(r),n.set(r.leaf,a)}let i=W([...n.keys()]),s=new Set;for(let r of i){let a=[...r].flatMap(o=>n.get(o)??[]);if(!(a.length<2)&&!(new Set(a.map(o=>o.relativePath)).size<2)&&!a.every(o=>L(o.relativePath)==="test"))for(let o of a)s.add(o)}return e.filter(r=>s.has(r))}function ne(e,t){if(!t.leaf)return null;let n=B(e,t);if(!n||!z(t.symbol)&&!re(n,t.leaf))return null;let i=T(S(n)),s=i.replace(/\s+/g,"");if(!s||s.length<8)return null;let r=i.match(ie)??[];return r.length===0?null:{leaf:t.leaf,symbol:t.symbol,shortName:I(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:E(t),normalizedBody:s,tokens:r,isThinForwarder:H(i)}}function re(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`\\b(?:const|let|var)\\s+${n}(?:\\s*:[^=]+)?\\s*=\\s*(?:async\\s*)?(?:\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>`,"s").test(e)}var ie=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function se(e){return{symbol:e.symbol,shortName:e.shortName,file:e.file,startLine:e.startLine,endLine:e.endLine,loc:e.loc}}function oe(e,t){let n=new Set(e),i=new Set(t);if(n.size===0&&i.size===0)return 1;if(n.size===0||i.size===0)return 0;let s=0;for(let a of n)i.has(a)&&(s+=1);let r=n.size+i.size-s;return r===0?0:s/r}function ae(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;let s=e.slice(i,i+6).join(" "),r=t.slice(i,i+6).join(" ");return!s&&!r?"(bodies differ only in trailing length)":`A: ${s||"(end)"} | B: ${r||"(end)"}`}function W(e){let t=new Map;for(let a of e)t.set(a,a);let n=a=>{let o=a;for(;t.get(o)!==o;)o=t.get(o);let l=a;for(;t.get(l)!==o;){let c=t.get(l);t.set(l,o),l=c}return o},i=(a,o)=>{let l=n(a),c=n(o);l!==c&&t.set(l,c)},s=new Map;for(let a of e){let o=a.slice(0,2).toLowerCase(),l=s.get(o)??[];l.push(a),s.set(o,l)}for(let a of s.values())for(let o=0;o<a.length;o+=1)for(let l=o+1;l<a.length;l+=1)le(a[o],a[l])&&i(a[o],a[l]);let r=new Map;for(let a of e){let o=n(a),l=r.get(o)??new Set;l.add(a),r.set(o,l)}return[...r.values()]}function le(e,t){return e===t||e.toLowerCase()===t.toLowerCase()?!0:e.length<8||t.length<8||Math.abs(e.length-t.length)>2||ce(e.toLowerCase(),t.toLowerCase())/Math.max(e.length,t.length)<.8?!1:pe(e.toLowerCase(),t.toLowerCase(),2)}function ce(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;return i}function fe(e){return/^[A-Z][A-Z0-9_]*$/.test(e)||/^__[^_].*__$/.test(e)||ue.has(e.toLowerCase())}var ue=new Set(["main","row"]),me=new Set(["app","component","components","feature","features","impl","index","lib","route","routes","shared","src","tsx","typescript","ui"]);function Z(e){return e.startsWith("rust-analyzer ")&&/\/(?:tests?|benches?)\//.test(e)}var de=new Set(["default","new","reset"]);function j(e,t){return e.startsWith("rust-analyzer ")&&de.has(t.toLowerCase())}function ge(e,t){if(e.leaf.toLowerCase()!==t.leaf.toLowerCase()||e.leaf.length>4)return!0;let n=F(e);return[...F(t)].some(i=>n.has(i))}function F(e){let t=e.leaf.toLowerCase();return new Set(`${e.file}/${e.shortName}`.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>2&&n!==t&&!me.has(n)))}function pe(e,t,n){if(Math.abs(e.length-t.length)>n)return!1;let i=Array.from({length:t.length+1},(s,r)=>r);for(let s=1;s<=e.length;s+=1){let r=[s],a=r[0];for(let o=1;o<=t.length;o+=1){let l=e[s-1]===t[o-1]?0:1,c=Math.min(i[o]+1,r[o-1]+1,i[o-1]+l);r.push(c),a=Math.min(a,c)}if(a>n)return!1;i=r}return i[t.length]<=n}function ke(e){return H(T(S(e)))}function H(e){let t=e.trim();if(!t||he.test(t))return!1;let n=be(t);return n.length===0||n.length>2?!1:ye(n[n.length-1])}var he=/\b(?:if|else|for|while|switch|try|catch|do)\b/,we=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function ye(e){let t=e.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return we.test(t)}function be(e){let t=[],n=0,i="";for(let s of e){if(s==="("||s==="["||s==="{"?n+=1:(s===")"||s==="]"||s==="}")&&(n=Math.max(0,n-1)),s===";"&&n===0){t.push(i),i="";continue}i+=s}return i.trim()&&t.push(i),t.map(s=>s.trim()).filter(s=>s.length>0)}var Te=3;function De(e){let t=new Map;return(n,i,s)=>{if(!n.isThinForwarder)return!1;let r=`${n.symbol}\0${i.symbol}`,a=t.get(r);if(a!==void 0)return a;let o=K(e,n,i,s,Te,new Set);return t.set(r,o),o}}function K(e,t,n,i,s,r){if(s<=0||r.has(t.symbol)||(r.add(t.symbol),(v(e,t.file)??[]).filter(l=>l.line>=t.startLine&&l.line<=t.endLine&&l.calleeLeaf===n.leaf).length===0))return!1;let o=new Set(A(e,t.file).filter(l=>l.sourcePath&&(l.kind!=="namespace"||l.usedMembers.includes(n.leaf))).map(l=>l.sourcePath));if([...o].some(l=>b(l,n.file)))return!0;for(let l of i)if(!(l.symbol===t.symbol||l.symbol===n.symbol||!l.isThinForwarder)&&[...o].some(c=>b(c,l.file))&&K(e,l,n,i,s-1,r))return!0;return!1}function V(e){return e.startsWith("<")&&e.endsWith(">")}function G(e){return[...e].sort()[0]}export{$e as a,X as b,Y as c,ke as d,be as e};
|
|
2
|
+
//# sourceMappingURL=chunk-OJNK5ALA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as x}from"./chunk-VXJJTQYE.js";import{b as g}from"./chunk-BOJ5SVE2.js";import{c as k}from"./chunk-PLYUVM4F.js";import{a as n}from"./chunk-BGBBVSH4.js";import{h as v}from"./chunk-PBUH2P5S.js";import{b as L}from"./chunk-Q6T2CAJL.js";import{d as S}from"./chunk-TD7VKJ2Y.js";import{t as a}from"./chunk-Q7GBK5T7.js";function E(c,f={}){let{scope:P,minLoc:F=3,scanLimit:d}=f,l=new k(c),b=f.semantic!==!1,y=0,m=a("isolated.candidates",()=>{let s=g(l.productionCallableDefinitions({scope:P,minLoc:F,excludeEntrySurfaces:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:typeof d=="number"&&d>0}),d).filter(R=>!x(c,R));return y=s.length,s},()=>({definitions:y})),p=0,i=a("isolated.strict-callees",()=>{let e=l.symbolsWithNonSelfCallees(m,{additive:!1,semantic:!1});return p=e.size,e},()=>({definitions:m.length,symbols:p})),r=m.filter(e=>!i.has(e.symbolId)),C=0,N=a("isolated.scip-callers",()=>{let e=l.crossFileCallerMap(r,{semantic:!1});return C=e.size,e},()=>({definitions:r.length,symbols:C})),o=new Set(N.keys());for(let e of l.frameworkReferencedSymbolIds(r))o.add(e);let t=r.filter(e=>!o.has(e.symbolId));if(b&&t.length>0){for(let e of v(c,t).keys())o.add(e);for(let e of l.symbolsWithNonSelfCallees(t,{additive:!1,semantic:!0}))i.add(e);t=t.filter(e=>!o.has(e.symbolId)).filter(e=>!i.has(e.symbolId))}let h=0,W=a("isolated.source-fallback-callers",()=>{let e=l.sourceFallbackCallerFiles(t,{skipPath:s=>L(s)==="test"});return h=e.size,e},()=>({definitions:t.length,symbols:h}));for(let e of W.keys())o.add(e);let u=t.filter(e=>!o.has(e.symbolId)),I=0,M=a("isolated.additive-callees",()=>{let e=l.symbolsWithNonSelfCallees(u,{additive:!0,semantic:b});return I=e.size,e},()=>({definitions:u.length,symbols:I}));for(let e of M)i.add(e);return u.filter(e=>!i.has(e.symbolId)).sort((e,s)=>n(s)-n(e)||e.relativePath.localeCompare(s.relativePath)||e.startLine-s.startLine).map(e=>({symbol:e.symbol,shortName:S(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:n(e)}))}export{E as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OPSAW5DT.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as B}from"./chunk-SV2LEFVM.js";import{a as $}from"./chunk-35NLDRZC.js";import{b as P}from"./chunk-HW7FASEL.js";import{b as j}from"./chunk-YBWE6J32.js";import{t as q}from"./chunk-7Z4GMCHM.js";import{w as v}from"./chunk-6LS3IG2I.js";import{a as U}from"./chunk-C7WSQA6A.js";import{readdirSync as L}from"fs";import{join as I}from"path";function z(e){return V(e).replace(/\/\*\*?$/,"")}function D(e,r){let t=V(r),o=z(t),c=t.endsWith("/**"),s=[],n=(a,l)=>{let g;try{g=L(a,{withFileTypes:!0})}catch{return}for(let p of g){if(p.name.startsWith("."))continue;let u=l?`${l}/${p.name}`:p.name;B(t,u)&&s.push(u),c&&p.isDirectory()&&n(I(a,p.name),u)}};return n(I(e,o),o),s.sort()}function V(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}var G=/\.(test|spec)\.(ts|tsx|js|jsx|mts|cts)$/,T=new Map;function k(e,r,t,o){if(!r?.testPaths?.length)return[];let c=H(r),s=[];for(let n of _(e,r.testPaths)){let a=K(e,n,o),l=a?t(a):null;if(l)for(let g of v(e,n)){let p=g.sourcePath;if(!p)continue;let u=t(p);u&&u!==l&&(c.get(l)?.has(u)||s.push({testFile:n,ownerBoundary:l,importedFile:p,importedBoundary:u,reason:"outside-owner-policy"}))}}return N(s)}function H(e){let r=e.allowedDependencies??{},t=e.boundaries.map(n=>n.name),o=new Map,c=(n,a)=>{for(let l of r[n]??[])a.has(l)||(a.add(l),c(l,a))};for(let n of t){let a=new Set;c(n,a),o.set(n,a)}let s=new Map;for(let n of t){let a=new Set(o.get(n));for(let l of t)l!==n&&o.get(l)?.has(n)&&a.add(l);s.set(n,a)}return s}function _(e,r){let t=`${e.config.projectRoot}\0${r.join("\0")}`,o=T.get(t);if(o)return o;let c=new Set;for(let n of r)for(let a of D(e.config.projectRoot,n))G.test(a)&&c.add(a);let s=[...c].sort();return T.set(t,s),s}function K(e,r,t){let o=r.replace(/^tests\//,"src/").replace(/\.(test|spec)\.(\w+)$/,".$2");if(o!==r&&t(o))return o;let c=r.split("/").pop().replace(/\.(test|spec)\.(\w+)$/,".$2"),s=v(e,r).map(n=>n.sourcePath).filter(n=>!!n&&t(n)&&n.split("/").pop()===c);return s.length===1?s[0]:null}function N(e){let r=new Map;for(let t of e){let o=`${t.testFile}\0${t.importedBoundary}`;r.has(o)||r.set(o,t)}return[...r.values()].sort((t,o)=>t.testFile.localeCompare(o.testFile)||t.importedBoundary.localeCompare(o.importedBoundary))}function O(e,r){let t=(e?.boundaries??[]).filter(o=>o.paths.some(c=>B(c,r)));return t.length===1?t[0].name:null}var C="architecture:";function W(e,r,t,o={}){let c=J(e,r);if(!t||t.boundaries.length===0)return{configured:!1,boundaries:[],edges:[],forbiddenEdges:[],reciprocalPairs:[],cycles:[],coarseBoundaries:[],staleAllowances:[],boundaryLimits:[],fragileEdges:[],testBoundaryViolations:[],coverage:{totalFiles:c.length,mappedFiles:0,unmappedFiles:[],ambiguousFiles:[]},policyCoverage:{declaredRows:0,totalBoundaries:0,missingRows:[],requiresCompletePolicy:!1,requiresCompleteCoverage:!1,requiresMinimalPolicy:!1}};let s=new Map,n=new Map(t.boundaries.map(i=>[i.name,new Set])),a=[],l=[];for(let i of c){let f=t.boundaries.filter(y=>y.paths.some(S=>B(S,i))).map(y=>y.name).sort();if(f.length===0)a.push(i);else if(f.length>1)l.push({file:i,boundaries:f});else{let y=f[0];s.set(i,y),n.get(y).add(i)}}let g=new Map;for(let[i,f]of e){let y=s.get(i);if(y)for(let S of f){let x=s.get(S);if(!x||y===x)continue;let M=F(y,x),w=g.get(M);w||(w={from:y,to:x,fileEdges:[],importers:new Set,importedFiles:new Set},g.set(M,w)),w.fileEdges.push({fromFile:i,toFile:S}),w.importers.add(i),w.importedFiles.add(S)}}let p=[...g.values()].map(i=>Q(i,t)).sort(ie),u=p,E=new Map(u.map(i=>[F(i.from,i.to),i])),R=new Map(t.boundaries.map(i=>[i.name,new Set]));for(let i of u)R.get(i.from).add(i.to);let m=[];for(let i of u){if(i.from>=i.to)continue;let f=E.get(F(i.to,i.from));f&&m.push({boundaries:[i.from,i.to],forward:i,reverse:f})}let{components:A}=$(R),h=A.filter(i=>i.length>1).map(i=>Z(i,u,t.requireAcyclic===!0)).sort((i,f)=>f.boundaries.length-i.boundaries.length||i.boundaries.join("/").localeCompare(f.boundaries.join("/"))),b=t.allowedDependencies??{},d=t.boundaries.map(i=>i.name).filter(i=>!Object.hasOwn(b,i)).sort();return{configured:!0,boundaries:t.boundaries.map(i=>({name:i.name,paths:[...i.paths],fileCount:n.get(i.name).size,dependencyPolicyDeclared:Object.hasOwn(b,i.name)})).sort((i,f)=>i.name.localeCompare(f.name)),edges:p,forbiddenEdges:u.filter(i=>i.policyStatus==="forbidden"),reciprocalPairs:m,cycles:h,staleAllowances:te(t,u),boundaryLimits:oe(t,u,n),fragileEdges:u.filter(i=>i.fragile),testBoundaryViolations:o.testBoundaryViolations??[],coarseBoundaries:ee(e,n,o.isModuleHierarchyFile,t.requireResolvedBoundaries===!0,i=>t.boundaries.find(f=>f.name===i)?.subUnits??"directory"),coverage:{totalFiles:c.length,mappedFiles:s.size,unmappedFiles:a,ambiguousFiles:l},policyCoverage:{declaredRows:t.boundaries.length-d.length,totalBoundaries:t.boundaries.length,missingRows:d,requiresCompletePolicy:t.requireCompletePolicy===!0,requiresCompleteCoverage:t.requireCompleteCoverage===!0,requiresMinimalPolicy:t.requireMinimalPolicy===!0}}}function Fe(e,r={}){let t=j(e,r.scope,{scipEdges:"imports-only",sourceEdges:"imports-and-reexports"}),o=U(e,{includeIgnored:!1}).filter(s=>!r.scope||s.includes(r.scope)),c=new Set(o);return W(t,o,e.config.architecture,{isModuleHierarchyFile:s=>X(e,s),testBoundaryViolations:k(e,e.config.architecture,s=>O(e.config.architecture,s),s=>c.has(s))})}function X(e,r){let t=P(r);return t==="test"||t==="entry"?!0:t!=="barrel"?!1:q(e,r).length===0}function Ee(e){let r=e.forbiddenEdges.map(o=>`${C}forbidden-edge:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);if(e.policyCoverage.requiresCompletePolicy)for(let o of e.policyCoverage.missingRows)r.push(`${C}missing-policy-row:${encodeURIComponent(o)}`);if(e.policyCoverage.requiresCompleteCoverage){for(let o of e.coverage.unmappedFiles)r.push(`${C}unmapped-file:${encodeURIComponent(o)}`);for(let o of e.coverage.ambiguousFiles)r.push(`${C}ambiguous-file:${encodeURIComponent(o.file)}:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`)}if(e.policyCoverage.requiresMinimalPolicy)for(let o of e.staleAllowances)r.push(`${C}stale-allowance:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);for(let o of e.testBoundaryViolations)r.push(`${C}test-boundary:${encodeURIComponent(o.testFile)}:${encodeURIComponent(o.importedBoundary)}`);for(let o of e.boundaryLimits)r.push(`${C}boundary-limit:${o.kind}:${encodeURIComponent(o.boundary)}`);let t=new Map;for(let o of e.coarseBoundaries)o.violatesPolicy&&t.set(o.boundary,(t.get(o.boundary)??0)+1);for(let[o,c]of t){let s=`${C}coarse-boundary:${encodeURIComponent(o)}`;r.push(s);for(let n=2;n<=c;n+=1)r.push(`${s}:component:${n}`)}for(let o of e.cycles)o.violatesPolicy&&r.push(`${C}cycle:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`);return[...new Set(r)].sort()}function Se(e){return!!e&&(Object.keys(e.allowedDependencies??{}).length>0||e.requireCompletePolicy===!0||e.requireCompleteCoverage===!0||e.requireAcyclic===!0||e.requireResolvedBoundaries===!0||e.requireMinimalPolicy===!0||e.maxBoundaryFanOut!==void 0||e.maxBoundaryFiles!==void 0||e.boundaries.some(r=>r.maxFiles!==void 0)||(e.testPaths?.length??0)>0)}function J(e,r){let t=new Set(r);for(let[o,c]of e){t.add(o);for(let s of c)t.add(s)}return[...t].sort()}function Q(e,r){let t=[...e.fileEdges].sort((o,c)=>o.fromFile.localeCompare(c.fromFile)||o.toFile.localeCompare(c.toFile));return{from:e.from,to:e.to,policyStatus:Y(r,e.from,e.to),fileEdgeCount:t.length,importerCount:e.importers.size,importedFileCount:e.importedFiles.size,examples:t.slice(0,5),fragile:t.length===1}}function Y(e,r,t){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,r)?"undeclared":e.allowedDependencies[r].includes(t)?"allowed":"forbidden"}function Z(e,r,t){let o=[...e].sort(),c=new Set(o),s=r.filter(a=>c.has(a.from)&&c.has(a.to)),n=Math.min(...s.map(a=>a.fileEdgeCount));return{boundaries:o,internalEdges:s,narrowestEdges:s.filter(a=>a.fileEdgeCount===n),violatesPolicy:t}}function ee(e,r,t=re,o=!1,c=()=>"directory"){let s=[];for(let[n,a]of r){let l=c(n)==="file"?m=>m:ne,g=[...a].filter(m=>!t(m));if(g.length<2)continue;let p=new Set(g),u=new Map,E=new Map;for(let m of g)E.set(l(m),new Set);for(let m of g)for(let A of e.get(m)??[]){if(!p.has(A))continue;let h=l(m),b=l(A);if(h===b)continue;let d=F(h,b),i=u.get(d);i||(i={from:h,to:b,fileEdges:[]},u.set(d,i)),i.fileEdges.push({fromFile:m,toFile:A}),E.get(h).add(b)}let{components:R}=$(E);for(let m of R){if(m.length<2)continue;let A=new Set(m),h=[...u.values()].filter(d=>A.has(d.from)&&A.has(d.to)).map(d=>({from:d.from,to:d.to,fileEdgeCount:d.fileEdges.length,examples:d.fileEdges.slice(0,5)})).sort((d,i)=>d.from.localeCompare(i.from)||d.to.localeCompare(i.to)),b=Math.min(...h.map(d=>d.fileEdgeCount));s.push({boundary:n,violatesPolicy:o,subUnits:[...m].sort(),internalEdges:h,narrowestEdges:h.filter(d=>d.fileEdgeCount===b)})}}return s.sort((n,a)=>a.subUnits.length-n.subUnits.length||n.boundary.localeCompare(a.boundary))}function te(e,r){let t=new Set(r.map(n=>F(n.from,n.to))),o=e.allowedDependencies??{},c=new Set(e.boundaries.map(n=>n.name)),s=[];for(let[n,a]of Object.entries(o))if(c.has(n))for(let l of a)!c.has(l)||t.has(F(n,l))||s.push({from:n,to:l});return s.sort((n,a)=>n.from.localeCompare(a.from)||n.to.localeCompare(a.to))}function oe(e,r,t){let o=[],c=new Map;for(let s of r)c.set(s.from,(c.get(s.from)??0)+1);for(let s of e.boundaries){if(e.maxBoundaryFanOut!==void 0){let a=c.get(s.name)??0;a>e.maxBoundaryFanOut&&o.push({boundary:s.name,kind:"fan-out",observed:a,limit:e.maxBoundaryFanOut})}let n=s.maxFiles??e.maxBoundaryFiles;if(n!==void 0){let a=t.get(s.name)?.size??0;a>n&&o.push({boundary:s.name,kind:"files",observed:a,limit:n})}}return o.sort((s,n)=>s.boundary.localeCompare(n.boundary)||s.kind.localeCompare(n.kind))}function re(e){let r=P(e);return r==="test"||r==="entry"}function ne(e){let r=e.lastIndexOf("/");return r===-1?".":e.slice(0,r)}function F(e,r){return`${e}\0${r}`}function ie(e,r){return e.from.localeCompare(r.from)||e.to.localeCompare(r.to)}export{D as a,C as b,W as c,Fe as d,Ee as e,Se as f,ee as g};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as B}from"./chunk-SV2LEFVM.js";import{a as $}from"./chunk-35NLDRZC.js";import{b as P}from"./chunk-Q6T2CAJL.js";import{b as j}from"./chunk-4GAQ6FI4.js";import{t as q}from"./chunk-TD7VKJ2Y.js";import{x as v}from"./chunk-42W3LFUK.js";import{a as U}from"./chunk-7JYHQAH2.js";import{readdirSync as L}from"fs";import{join as I}from"path";function z(e){return V(e).replace(/\/\*\*?$/,"")}function D(e,r){let t=V(r),o=z(t),c=t.endsWith("/**"),s=[],n=(a,l)=>{let g;try{g=L(a,{withFileTypes:!0})}catch{return}for(let p of g){if(p.name.startsWith("."))continue;let u=l?`${l}/${p.name}`:p.name;B(t,u)&&s.push(u),c&&p.isDirectory()&&n(I(a,p.name),u)}};return n(I(e,o),o),s.sort()}function V(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+$/,"")}var G=/\.(test|spec)\.(ts|tsx|js|jsx|mts|cts)$/,T=new Map;function k(e,r,t,o){if(!r?.testPaths?.length)return[];let c=H(r),s=[];for(let n of _(e,r.testPaths)){let a=K(e,n,o),l=a?t(a):null;if(l)for(let g of v(e,n)){let p=g.sourcePath;if(!p)continue;let u=t(p);u&&u!==l&&(c.get(l)?.has(u)||s.push({testFile:n,ownerBoundary:l,importedFile:p,importedBoundary:u,reason:"outside-owner-policy"}))}}return N(s)}function H(e){let r=e.allowedDependencies??{},t=e.boundaries.map(n=>n.name),o=new Map,c=(n,a)=>{for(let l of r[n]??[])a.has(l)||(a.add(l),c(l,a))};for(let n of t){let a=new Set;c(n,a),o.set(n,a)}let s=new Map;for(let n of t){let a=new Set(o.get(n));for(let l of t)l!==n&&o.get(l)?.has(n)&&a.add(l);s.set(n,a)}return s}function _(e,r){let t=`${e.config.projectRoot}\0${r.join("\0")}`,o=T.get(t);if(o)return o;let c=new Set;for(let n of r)for(let a of D(e.config.projectRoot,n))G.test(a)&&c.add(a);let s=[...c].sort();return T.set(t,s),s}function K(e,r,t){let o=r.replace(/^tests\//,"src/").replace(/\.(test|spec)\.(\w+)$/,".$2");if(o!==r&&t(o))return o;let c=r.split("/").pop().replace(/\.(test|spec)\.(\w+)$/,".$2"),s=v(e,r).map(n=>n.sourcePath).filter(n=>!!n&&t(n)&&n.split("/").pop()===c);return s.length===1?s[0]:null}function N(e){let r=new Map;for(let t of e){let o=`${t.testFile}\0${t.importedBoundary}`;r.has(o)||r.set(o,t)}return[...r.values()].sort((t,o)=>t.testFile.localeCompare(o.testFile)||t.importedBoundary.localeCompare(o.importedBoundary))}function O(e,r){let t=(e?.boundaries??[]).filter(o=>o.paths.some(c=>B(c,r)));return t.length===1?t[0].name:null}var C="architecture:";function W(e,r,t,o={}){let c=J(e,r);if(!t||t.boundaries.length===0)return{configured:!1,boundaries:[],edges:[],forbiddenEdges:[],reciprocalPairs:[],cycles:[],coarseBoundaries:[],staleAllowances:[],boundaryLimits:[],fragileEdges:[],testBoundaryViolations:[],coverage:{totalFiles:c.length,mappedFiles:0,unmappedFiles:[],ambiguousFiles:[]},policyCoverage:{declaredRows:0,totalBoundaries:0,missingRows:[],requiresCompletePolicy:!1,requiresCompleteCoverage:!1,requiresMinimalPolicy:!1}};let s=new Map,n=new Map(t.boundaries.map(i=>[i.name,new Set])),a=[],l=[];for(let i of c){let f=t.boundaries.filter(y=>y.paths.some(S=>B(S,i))).map(y=>y.name).sort();if(f.length===0)a.push(i);else if(f.length>1)l.push({file:i,boundaries:f});else{let y=f[0];s.set(i,y),n.get(y).add(i)}}let g=new Map;for(let[i,f]of e){let y=s.get(i);if(y)for(let S of f){let x=s.get(S);if(!x||y===x)continue;let M=F(y,x),w=g.get(M);w||(w={from:y,to:x,fileEdges:[],importers:new Set,importedFiles:new Set},g.set(M,w)),w.fileEdges.push({fromFile:i,toFile:S}),w.importers.add(i),w.importedFiles.add(S)}}let p=[...g.values()].map(i=>Q(i,t)).sort(ie),u=p,E=new Map(u.map(i=>[F(i.from,i.to),i])),R=new Map(t.boundaries.map(i=>[i.name,new Set]));for(let i of u)R.get(i.from).add(i.to);let m=[];for(let i of u){if(i.from>=i.to)continue;let f=E.get(F(i.to,i.from));f&&m.push({boundaries:[i.from,i.to],forward:i,reverse:f})}let{components:A}=$(R),h=A.filter(i=>i.length>1).map(i=>Z(i,u,t.requireAcyclic===!0)).sort((i,f)=>f.boundaries.length-i.boundaries.length||i.boundaries.join("/").localeCompare(f.boundaries.join("/"))),b=t.allowedDependencies??{},d=t.boundaries.map(i=>i.name).filter(i=>!Object.hasOwn(b,i)).sort();return{configured:!0,boundaries:t.boundaries.map(i=>({name:i.name,paths:[...i.paths],fileCount:n.get(i.name).size,dependencyPolicyDeclared:Object.hasOwn(b,i.name)})).sort((i,f)=>i.name.localeCompare(f.name)),edges:p,forbiddenEdges:u.filter(i=>i.policyStatus==="forbidden"),reciprocalPairs:m,cycles:h,staleAllowances:te(t,u),boundaryLimits:oe(t,u,n),fragileEdges:u.filter(i=>i.fragile),testBoundaryViolations:o.testBoundaryViolations??[],coarseBoundaries:ee(e,n,o.isModuleHierarchyFile,t.requireResolvedBoundaries===!0,i=>t.boundaries.find(f=>f.name===i)?.subUnits??"directory"),coverage:{totalFiles:c.length,mappedFiles:s.size,unmappedFiles:a,ambiguousFiles:l},policyCoverage:{declaredRows:t.boundaries.length-d.length,totalBoundaries:t.boundaries.length,missingRows:d,requiresCompletePolicy:t.requireCompletePolicy===!0,requiresCompleteCoverage:t.requireCompleteCoverage===!0,requiresMinimalPolicy:t.requireMinimalPolicy===!0}}}function Fe(e,r={}){let t=j(e,r.scope,{scipEdges:"imports-only",sourceEdges:"imports-and-reexports"}),o=U(e,{includeIgnored:!1}).filter(s=>!r.scope||s.includes(r.scope)),c=new Set(o);return W(t,o,e.config.architecture,{isModuleHierarchyFile:s=>X(e,s),testBoundaryViolations:k(e,e.config.architecture,s=>O(e.config.architecture,s),s=>c.has(s))})}function X(e,r){let t=P(r);return t==="test"||t==="entry"?!0:t!=="barrel"?!1:q(e,r).length===0}function Ee(e){let r=e.forbiddenEdges.map(o=>`${C}forbidden-edge:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);if(e.policyCoverage.requiresCompletePolicy)for(let o of e.policyCoverage.missingRows)r.push(`${C}missing-policy-row:${encodeURIComponent(o)}`);if(e.policyCoverage.requiresCompleteCoverage){for(let o of e.coverage.unmappedFiles)r.push(`${C}unmapped-file:${encodeURIComponent(o)}`);for(let o of e.coverage.ambiguousFiles)r.push(`${C}ambiguous-file:${encodeURIComponent(o.file)}:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`)}if(e.policyCoverage.requiresMinimalPolicy)for(let o of e.staleAllowances)r.push(`${C}stale-allowance:${encodeURIComponent(o.from)}:${encodeURIComponent(o.to)}`);for(let o of e.testBoundaryViolations)r.push(`${C}test-boundary:${encodeURIComponent(o.testFile)}:${encodeURIComponent(o.importedBoundary)}`);for(let o of e.boundaryLimits)r.push(`${C}boundary-limit:${o.kind}:${encodeURIComponent(o.boundary)}`);let t=new Map;for(let o of e.coarseBoundaries)o.violatesPolicy&&t.set(o.boundary,(t.get(o.boundary)??0)+1);for(let[o,c]of t){let s=`${C}coarse-boundary:${encodeURIComponent(o)}`;r.push(s);for(let n=2;n<=c;n+=1)r.push(`${s}:component:${n}`)}for(let o of e.cycles)o.violatesPolicy&&r.push(`${C}cycle:${o.boundaries.map(c=>encodeURIComponent(c)).sort().join("|")}`);return[...new Set(r)].sort()}function Se(e){return!!e&&(Object.keys(e.allowedDependencies??{}).length>0||e.requireCompletePolicy===!0||e.requireCompleteCoverage===!0||e.requireAcyclic===!0||e.requireResolvedBoundaries===!0||e.requireMinimalPolicy===!0||e.maxBoundaryFanOut!==void 0||e.maxBoundaryFiles!==void 0||e.boundaries.some(r=>r.maxFiles!==void 0)||(e.testPaths?.length??0)>0)}function J(e,r){let t=new Set(r);for(let[o,c]of e){t.add(o);for(let s of c)t.add(s)}return[...t].sort()}function Q(e,r){let t=[...e.fileEdges].sort((o,c)=>o.fromFile.localeCompare(c.fromFile)||o.toFile.localeCompare(c.toFile));return{from:e.from,to:e.to,policyStatus:Y(r,e.from,e.to),fileEdgeCount:t.length,importerCount:e.importers.size,importedFileCount:e.importedFiles.size,examples:t.slice(0,5),fragile:t.length===1}}function Y(e,r,t){return!e.allowedDependencies||!Object.hasOwn(e.allowedDependencies,r)?"undeclared":e.allowedDependencies[r].includes(t)?"allowed":"forbidden"}function Z(e,r,t){let o=[...e].sort(),c=new Set(o),s=r.filter(a=>c.has(a.from)&&c.has(a.to)),n=Math.min(...s.map(a=>a.fileEdgeCount));return{boundaries:o,internalEdges:s,narrowestEdges:s.filter(a=>a.fileEdgeCount===n),violatesPolicy:t}}function ee(e,r,t=re,o=!1,c=()=>"directory"){let s=[];for(let[n,a]of r){let l=c(n)==="file"?m=>m:ne,g=[...a].filter(m=>!t(m));if(g.length<2)continue;let p=new Set(g),u=new Map,E=new Map;for(let m of g)E.set(l(m),new Set);for(let m of g)for(let A of e.get(m)??[]){if(!p.has(A))continue;let h=l(m),b=l(A);if(h===b)continue;let d=F(h,b),i=u.get(d);i||(i={from:h,to:b,fileEdges:[]},u.set(d,i)),i.fileEdges.push({fromFile:m,toFile:A}),E.get(h).add(b)}let{components:R}=$(E);for(let m of R){if(m.length<2)continue;let A=new Set(m),h=[...u.values()].filter(d=>A.has(d.from)&&A.has(d.to)).map(d=>({from:d.from,to:d.to,fileEdgeCount:d.fileEdges.length,examples:d.fileEdges.slice(0,5)})).sort((d,i)=>d.from.localeCompare(i.from)||d.to.localeCompare(i.to)),b=Math.min(...h.map(d=>d.fileEdgeCount));s.push({boundary:n,violatesPolicy:o,subUnits:[...m].sort(),internalEdges:h,narrowestEdges:h.filter(d=>d.fileEdgeCount===b)})}}return s.sort((n,a)=>a.subUnits.length-n.subUnits.length||n.boundary.localeCompare(a.boundary))}function te(e,r){let t=new Set(r.map(n=>F(n.from,n.to))),o=e.allowedDependencies??{},c=new Set(e.boundaries.map(n=>n.name)),s=[];for(let[n,a]of Object.entries(o))if(c.has(n))for(let l of a)!c.has(l)||t.has(F(n,l))||s.push({from:n,to:l});return s.sort((n,a)=>n.from.localeCompare(a.from)||n.to.localeCompare(a.to))}function oe(e,r,t){let o=[],c=new Map;for(let s of r)c.set(s.from,(c.get(s.from)??0)+1);for(let s of e.boundaries){if(e.maxBoundaryFanOut!==void 0){let a=c.get(s.name)??0;a>e.maxBoundaryFanOut&&o.push({boundary:s.name,kind:"fan-out",observed:a,limit:e.maxBoundaryFanOut})}let n=s.maxFiles??e.maxBoundaryFiles;if(n!==void 0){let a=t.get(s.name)?.size??0;a>n&&o.push({boundary:s.name,kind:"files",observed:a,limit:n})}}return o.sort((s,n)=>s.boundary.localeCompare(n.boundary)||s.kind.localeCompare(n.kind))}function re(e){let r=P(e);return r==="test"||r==="entry"}function ne(e){let r=e.lastIndexOf("/");return r===-1?".":e.slice(0,r)}function F(e,r){return`${e}\0${r}`}function ie(e,r){return e.from.localeCompare(r.from)||e.to.localeCompare(r.to)}export{D as a,C as b,W as c,Fe as d,Ee as e,Se as f,ee as g};
|
|
2
|
+
//# sourceMappingURL=chunk-OTSPRVNW.js.map
|