scip-query 0.20.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +81 -0
- package/README.md +255 -884
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-XXGZGNZ6.js +2 -0
- package/dist/call-graph-VGY3R4L3.js +2 -0
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +11 -0
- package/dist/change-analysis-types-CCtoCHbC.d.ts +9 -0
- package/dist/chunk-26CT72HM.js +2 -0
- package/dist/chunk-27OUNZW5.js +3 -0
- package/dist/chunk-2LJLEM5B.js +2 -0
- package/dist/chunk-3KXFB2FM.js +2 -0
- package/dist/chunk-3T5U2EQ2.js +2 -0
- package/dist/chunk-3TNRNKAT.js +2 -0
- package/dist/{chunk-PXY7F6Y4.js → chunk-3XQLJG7V.js} +5 -5
- package/dist/chunk-3XZELASU.js +2 -0
- package/dist/chunk-3YETOKNO.js +4 -0
- package/dist/chunk-47WX6UC4.js +2 -0
- package/dist/{chunk-7SQQWSY3.js → chunk-4HQYNZ3P.js} +2 -2
- package/dist/chunk-4IASLUOP.js +3 -0
- package/dist/{chunk-KMKTIO2G.js → chunk-4KIPF45P.js} +2 -2
- package/dist/chunk-4SZJF4GK.js +2 -0
- package/dist/chunk-4TOU7HHQ.js +2 -0
- package/dist/chunk-4ZCLDH6T.js +11 -0
- package/dist/{chunk-DQGFVPUV.js → chunk-527HV7JY.js} +3 -3
- package/dist/{chunk-ZTETIQ35.js → chunk-5BJPJUXF.js} +2 -2
- package/dist/chunk-5J3A6RBZ.js +16 -0
- package/dist/chunk-5KIJMEPC.js +2 -0
- package/dist/{chunk-JDOEX4E6.js → chunk-5QM7QT5B.js} +2 -2
- package/dist/chunk-5Z2H76VD.js +11 -0
- package/dist/chunk-63TFRBMB.js +2 -0
- package/dist/chunk-67FK5KGV.js +3 -0
- package/dist/chunk-6DO3VBLV.js +2 -0
- package/dist/chunk-6LS3IG2I.js +13 -0
- package/dist/chunk-6QN4FYQW.js +2 -0
- package/dist/chunk-6X4KO5A7.js +11 -0
- package/dist/chunk-743MEVFJ.js +8 -0
- package/dist/chunk-7G2WIVIX.js +2 -0
- package/dist/chunk-7KCZELVM.js +2 -0
- package/dist/chunk-7MUHSZGN.js +3 -0
- package/dist/chunk-7YZGSLW6.js +3 -0
- package/dist/chunk-7Z4GMCHM.js +117 -0
- package/dist/{chunk-32LVLCLN.js → chunk-AAOEROT3.js} +3 -3
- package/dist/chunk-AFRS7WJU.js +26 -0
- package/dist/chunk-ANCHW2R4.js +57 -0
- package/dist/{chunk-SXP2MBJH.js → chunk-AQF35NGT.js} +2 -2
- package/dist/chunk-ARGPDW2Y.js +6 -0
- package/dist/chunk-B3AREUQK.js +16 -0
- package/dist/chunk-BCTCADNB.js +2 -0
- package/dist/chunk-BM4OTGSY.js +3 -0
- package/dist/chunk-BMKTDJI6.js +16 -0
- package/dist/chunk-BOJ5SVE2.js +2 -0
- package/dist/{chunk-WXZLAAWK.js → chunk-BVR44XXB.js} +2 -2
- package/dist/{chunk-RUJURYSV.js → chunk-BYXWXLKM.js} +2 -2
- package/dist/chunk-BZCRHP46.js +3 -0
- package/dist/chunk-BZYSGZRK.js +2 -0
- package/dist/chunk-C52Q3JEQ.js +2 -0
- package/dist/chunk-C7WSQA6A.js +21 -0
- package/dist/{chunk-BDCC2NPY.js → chunk-CNT4ND5O.js} +2 -2
- package/dist/chunk-CQVDALWQ.js +2 -0
- package/dist/chunk-CTO3TRX7.js +2 -0
- package/dist/chunk-CXT3GZSQ.js +2 -0
- package/dist/{chunk-JVYA47YU.js → chunk-DGM2RJ3I.js} +2 -2
- package/dist/{chunk-7PIO7NKH.js → chunk-DK6MB565.js} +2 -2
- package/dist/chunk-DNPETNXT.js +2 -0
- package/dist/chunk-DRENNWRG.js +2 -0
- package/dist/chunk-DUDUIT5P.js +2 -0
- package/dist/chunk-DXEJ4FLZ.js +21 -0
- package/dist/chunk-DXYMTQZ4.js +2 -0
- package/dist/chunk-DZA7MQMU.js +6 -0
- package/dist/{chunk-ZHXX42OH.js → chunk-DZNWXJN2.js} +4 -4
- package/dist/{chunk-CJST5ETY.js → chunk-E6N6YTVM.js} +2 -2
- package/dist/chunk-E7CJ6O72.js +2 -0
- package/dist/chunk-EJHNTAEE.js +2 -0
- package/dist/chunk-EPLE5O5O.js +2 -0
- package/dist/chunk-F4FNK44D.js +2 -0
- package/dist/chunk-FCGMQETU.js +2 -0
- package/dist/chunk-FIO44MVK.js +3 -0
- package/dist/chunk-FLSVYEPL.js +2 -0
- package/dist/chunk-FOP7HD6H.js +3 -0
- package/dist/chunk-FSPENGSU.js +4 -0
- package/dist/chunk-FUUDUAKM.js +2 -0
- package/dist/chunk-FYCH2EYQ.js +2 -0
- package/dist/{chunk-5E4WNAVD.js → chunk-G47MFF47.js} +2 -2
- package/dist/chunk-G6VV7ROY.js +2 -0
- package/dist/chunk-GBZCVYWA.js +2 -0
- package/dist/chunk-GSHTVE56.js +3 -0
- package/dist/chunk-GTZFKDP3.js +2 -0
- package/dist/{chunk-2HPVVXM5.js → chunk-H2RBDP5S.js} +2 -2
- package/dist/chunk-H5EXS3HM.js +2 -0
- package/dist/chunk-HR5JYLVV.js +4 -0
- package/dist/chunk-HW7FASEL.js +2 -0
- package/dist/chunk-HYU4W353.js +10 -0
- package/dist/{chunk-FKSELJQF.js → chunk-I2LY3KN7.js} +2 -2
- package/dist/chunk-IGBQVEHE.js +2 -0
- package/dist/{chunk-3G66UZBH.js → chunk-IH3K5J6K.js} +2 -2
- package/dist/chunk-IHGK3SZ7.js +29 -0
- package/dist/chunk-IM23CSG5.js +2 -0
- package/dist/chunk-IQMGNIGY.js +2 -0
- package/dist/chunk-ITF3CWS5.js +2 -0
- package/dist/chunk-IZKJQQCQ.js +3 -0
- package/dist/chunk-J4HUBIVF.js +5 -0
- package/dist/{chunk-AZJQQKDD.js → chunk-JGMD6JGB.js} +2 -2
- package/dist/chunk-JLZWYDCZ.js +4 -0
- package/dist/chunk-JO6FK3Q5.js +2 -0
- package/dist/chunk-JSHDCVUM.js +81 -0
- package/dist/chunk-K2DZCH2K.js +2 -0
- package/dist/chunk-K63CAPS2.js +23 -0
- package/dist/chunk-KBIC6JHJ.js +2 -0
- package/dist/chunk-KFFQURUZ.js +2 -0
- package/dist/chunk-KFOYCQAJ.js +9 -0
- package/dist/chunk-KGKCJFWZ.js +6 -0
- package/dist/chunk-KK7GPALL.js +28 -0
- package/dist/chunk-L7WRUNKJ.js +2 -0
- package/dist/{chunk-W4ETQAXM.js → chunk-LFWB7TOJ.js} +2 -2
- package/dist/chunk-LGVTIZPV.js +61 -0
- package/dist/chunk-LIWIV26I.js +29 -0
- package/dist/chunk-LJMWILX6.js +3 -0
- package/dist/{chunk-BPAPWKP6.js → chunk-LXMW6ZAX.js} +8 -8
- package/dist/chunk-MFBVUQJZ.js +2 -0
- package/dist/{chunk-O64IZ6UX.js → chunk-MLTKGHD2.js} +2 -2
- package/dist/chunk-MLTSTKXD.js +5 -0
- package/dist/chunk-MR4ZKWO6.js +57 -0
- package/dist/{chunk-EN3O7VJA.js → chunk-MRXBLYRE.js} +2 -2
- package/dist/chunk-MXNGIEPU.js +3 -0
- package/dist/chunk-N4EFQIRX.js +20 -0
- package/dist/chunk-ND3BWIVN.js +7 -0
- package/dist/chunk-NODZYYGC.js +2 -0
- package/dist/chunk-NP4JFCLE.js +133 -0
- package/dist/chunk-NQXWWE6S.js +8 -0
- package/dist/chunk-NSDPPUDY.js +7 -0
- package/dist/chunk-NT4NVEHU.js +18 -0
- package/dist/chunk-O2VY47Y5.js +325 -0
- package/dist/chunk-O3EX5STE.js +5 -0
- package/dist/chunk-O4PZFAXA.js +3 -0
- package/dist/chunk-OA2BO4DR.js +2 -0
- package/dist/chunk-OFZVFIDF.js +3 -0
- package/dist/{chunk-PQCI4SQX.js → chunk-OG5UK2K7.js} +2 -2
- package/dist/chunk-OMVNRPST.js +2 -0
- package/dist/{chunk-7BAVHKMJ.js → chunk-OU6SDWAM.js} +9 -9
- package/dist/{chunk-LY4WC4AD.js → chunk-OY7PCALC.js} +2 -2
- package/dist/{chunk-A73XVBCR.js → chunk-P3UFF22M.js} +2 -2
- package/dist/chunk-PAZSBPJR.js +3 -0
- package/dist/chunk-PJBYDCBQ.js +38 -0
- package/dist/chunk-PRLU3I7G.js +79 -0
- package/dist/chunk-PU6XDQ2X.js +16 -0
- package/dist/{chunk-3CLX5EOX.js → chunk-PWEQ6CZZ.js} +2 -2
- package/dist/{chunk-XSRF6Q77.js → chunk-PX6QNUYF.js} +2 -2
- package/dist/chunk-Q4MRRB3C.js +3 -0
- package/dist/chunk-QGVUPYBC.js +35 -0
- package/dist/chunk-QH5Q6M5C.js +2 -0
- package/dist/chunk-QLWZUFDT.js +2 -0
- package/dist/chunk-QN2AI3D2.js +3 -0
- package/dist/{chunk-JAYYFEQY.js → chunk-QZCACNV5.js} +2 -2
- package/dist/chunk-RNKRYK6B.js +4 -0
- package/dist/chunk-RSUH7G5T.js +29 -0
- package/dist/chunk-RZWBTKXO.js +5 -0
- package/dist/chunk-SBFDPHKH.js +4 -0
- package/dist/{chunk-HX4GQPZP.js → chunk-SGSPCEFC.js} +3 -3
- package/dist/chunk-SIGVQT43.js +2 -0
- package/dist/chunk-SRIZDEWX.js +4 -0
- package/dist/chunk-SV2LEFVM.js +2 -0
- package/dist/chunk-T2PBOVDI.js +3 -0
- package/dist/chunk-TP2X2C2Y.js +3 -0
- package/dist/chunk-U2MNECDU.js +2 -0
- package/dist/chunk-U7DOYZDH.js +2 -0
- package/dist/chunk-UAQQR55F.js +2 -0
- package/dist/chunk-UBETC3Q2.js +2 -0
- package/dist/chunk-UEQORB2A.js +2 -0
- package/dist/chunk-UM56ZET4.js +38 -0
- package/dist/chunk-UXNXOMXJ.js +2 -0
- package/dist/{chunk-6SHPK5ZE.js → chunk-V6XENWOF.js} +2 -2
- package/dist/chunk-VJAD5WX5.js +2 -0
- package/dist/chunk-VRJG7N3I.js +453 -0
- package/dist/chunk-W7HN6V4E.js +7 -0
- package/dist/chunk-WCIKJ2E3.js +3 -0
- package/dist/chunk-WEXQYJY3.js +5 -0
- package/dist/chunk-WOPZX5GM.js +2 -0
- package/dist/chunk-WRQXLNYE.js +9 -0
- package/dist/{chunk-XKWKXZKW.js → chunk-WV6R37XV.js} +2 -2
- package/dist/{chunk-N5W4YZMK.js → chunk-WZ7V4BQV.js} +2 -2
- package/dist/chunk-WZRNEVYC.js +2 -0
- package/dist/chunk-X5MWO4DM.js +7 -0
- package/dist/chunk-XDAUYDFT.js +2 -0
- package/dist/{chunk-L7AW2QB5.js → chunk-XDOEHEET.js} +2 -2
- package/dist/chunk-XDQX6LDT.js +4 -0
- package/dist/chunk-XFRHBAIT.js +2 -0
- package/dist/chunk-XIPGCT3D.js +5 -0
- package/dist/chunk-XKM5D2XS.js +16 -0
- package/dist/chunk-XNF5T4T2.js +4 -0
- package/dist/chunk-Y2S4YNLH.js +3 -0
- package/dist/chunk-YA72ZUKO.js +2 -0
- package/dist/chunk-YBWE6J32.js +43 -0
- package/dist/chunk-YCXQQ3YB.js +2 -0
- package/dist/chunk-YDTK77JP.js +43 -0
- package/dist/chunk-YF25RQER.js +4 -0
- package/dist/chunk-YKHL4J3G.js +2 -0
- package/dist/chunk-YLNCTPOI.js +4 -0
- package/dist/chunk-YR7VRWNX.js +2 -0
- package/dist/chunk-YT4IQBET.js +3 -0
- package/dist/chunk-YUKYB54I.js +1 -0
- package/dist/chunk-Z2KGMIL4.js +2 -0
- package/dist/chunk-Z2QB75BS.js +3 -0
- package/dist/chunk-Z67JOKRE.js +554 -0
- package/dist/chunk-ZGDHC5AT.js +2 -0
- package/dist/chunk-ZMS4YCY7.js +2 -0
- package/dist/chunk-ZNW5A5VX.js +3 -0
- package/dist/{chunk-TFRAYKN6.js → chunk-ZP2WUVZ5.js} +2 -2
- package/dist/chunk-ZQUNCTEZ.js +2 -0
- package/dist/cli-main.js +8 -0
- package/dist/cli.js +1 -3
- package/dist/code-AXLJBZ6T.js +2 -0
- package/dist/code-B17qEMbt.d.ts +121 -0
- package/dist/code-result-json-CTZHAQXJ.js +2 -0
- package/dist/command-descriptors-6INSCKLW.js +342 -0
- package/dist/{config-types-jVM3D7MA.d.ts → config-types-B9B60MiR.d.ts} +199 -23
- package/dist/dataflow-AFXY423Q.js +2 -0
- package/dist/{db-B5PM5yNk.d.ts → db-BwIVAYNB.d.ts} +1 -1
- package/dist/dependence-slice-2G4X6VSJ.js +2 -0
- package/dist/deps-LMCAV5DO.js +2 -0
- package/dist/direct-navigation-2ONV22Y2.js +3 -0
- package/dist/entry-map-ZOC3VXO5.js +2 -0
- package/dist/exploration-topology-BG4v30HZ.d.ts +256 -0
- package/dist/file-dep-graph-Bqg3t3Px.d.ts +4 -0
- package/dist/file-kind-BKCVMNUf.d.ts +10 -0
- package/dist/files-WJQJLHMH.js +2 -0
- package/dist/graph-evidence-Bjyky2V4.d.ts +126 -0
- package/dist/graph-exploration-contract-CqDsnPQL.d.ts +7 -0
- package/dist/{health-Do5TKSJI.d.ts → health-CPp2Jf1Z.d.ts} +33 -34
- package/dist/hierarchy-ASNIHAX4.js +2 -0
- package/dist/imports-JICEKDKK.js +2 -0
- package/dist/index.d.ts +4 -31
- package/dist/index.js +1 -1
- package/dist/members-C5H2K3MS.js +2 -0
- package/dist/methods-KZOZHSD4.js +2 -0
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
- package/dist/output-continuation-command-NX3RH3TP.js +3 -0
- package/dist/output-pagination-3OFL2MJV.js +19 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-A2SXUH2H.js +3 -0
- package/dist/queries/affected.d.ts +22 -4
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +123 -0
- package/dist/queries/anchors.js +2 -0
- package/dist/queries/architecture.d.ts +3 -2
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +26 -7
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +17 -3
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +5 -26
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +145 -0
- package/dist/queries/context.js +2 -0
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +8 -3
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +34 -7
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +40 -14
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +3 -3
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +4 -38
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.d.ts +47 -0
- package/dist/queries/dependence-slice.js +2 -0
- package/dist/queries/dependency-depth.d.ts +49 -0
- package/dist/queries/dependency-depth.js +2 -0
- package/dist/queries/deps.d.ts +4 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +4 -4
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +121 -0
- package/dist/queries/entry-map.js +2 -0
- package/dist/queries/evidence.d.ts +70 -0
- package/dist/queries/evidence.js +2 -0
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +18 -5
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +4 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +5 -3
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +11 -5
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +4 -4
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +56 -136
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +3 -3
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +5 -9
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +27 -64
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.d.ts +4 -0
- package/dist/queries/reference-neighborhood.js +2 -0
- package/dist/queries/reference-reachability.d.ts +48 -0
- package/dist/queries/reference-reachability.js +2 -0
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +3 -36
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.d.ts +209 -0
- package/dist/queries/source-inspection.js +2 -0
- package/dist/queries/source-search.d.ts +13 -0
- package/dist/queries/source-search.js +2 -0
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +13 -4
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +449 -0
- package/dist/queries/system-map.js +2 -0
- package/dist/queries/system.d.ts +5 -3
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +47 -3
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +3 -3
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +3 -3
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.d.ts +43 -0
- package/dist/queries/value-flow.js +2 -0
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/query-service-fastpath.js +6 -0
- package/dist/query-service-server.js +5 -0
- package/dist/refs-ZOORVRQC.js +2 -0
- package/dist/refs-pagination-SRCUOYRD.js +2 -0
- package/dist/reindex-worker.js +85 -86
- package/dist/reindex.d.ts +64 -42
- package/dist/reindex.js +93 -77
- package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
- package/dist/runtime.d.ts +287 -8
- package/dist/runtime.js +4 -3
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-BnEwZRLJ.d.ts → scip-cli-H-n59izO.d.ts} +33 -2
- package/dist/slice-NOTBWA7S.js +2 -0
- package/dist/source-search-types-Dwz8KeuW.d.ts +79 -0
- package/dist/source-snippet-_wrcgmZc.d.ts +15 -0
- package/dist/stats-OOJ74B32.js +2 -0
- package/dist/surface-BTBCLKNA.js +2 -0
- package/dist/symbol-resolution-SVSMX4RN.js +2 -0
- package/dist/system-2EIUFP6B.js +2 -0
- package/dist/trace-BB2GHQPG.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-OA7AHSUG.js +2 -0
- package/dist/watch-server.js +3 -2
- package/docs/AGENT_GUIDE.md +133 -476
- package/docs/AI_FAILURE_MODES.md +30 -301
- package/docs/API.md +1 -1
- package/docs/API_EVOLUTION.md +6 -0
- package/docs/CLI_JSON_OUTPUT.md +207 -29
- package/docs/COMMAND_REFERENCE.md +255 -154
- package/docs/CONFIGURATION_WRITE_SAFETY.md +14 -13
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +84 -0
- package/docs/DETECTOR_GUIDE.md +46 -138
- package/docs/DURABILITY.md +7 -1
- package/docs/INDEX_GENERATIONS.md +6 -0
- package/docs/LOCK_PROTOCOL.md +8 -0
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +13 -3
- package/docs/SECURITY_MODEL.md +39 -42
- package/docs/accuracy-audit-checklist.md +4 -0
- package/docs/accuracy-hardening-goal.md +9 -2
- package/docs/analyzer-inventory.md +59 -264
- package/docs/analyzer-validation-protocol.md +62 -170
- package/docs/architecture-coherence-vision.md +18 -12
- package/docs/locality-analyzer-design.md +1 -1
- package/docs/schemas/cli-json-envelope.schema.json +212 -27
- package/docs/schemas/cli-json-export-receipt.schema.json +25 -0
- package/docs/schemas/cli-output-page.schema.json +1 -1
- package/docs/schemas/observation-receipt.schema.json +164 -0
- package/docs/schemas/project-config.schema.json +37 -45
- package/docs/schemas/suppression-record.schema.json +1 -34
- package/package.json +69 -11
- package/skills/concrete-plan/SKILL.md +8 -0
- package/skills/concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-explore/SKILL.md +49 -61
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/delegated-exploration.md +51 -0
- package/skills/scip-explore/references/external-evidence.md +72 -0
- package/skills/scip-explore/references/information-model.md +51 -0
- package/skills/scip-explore/scripts/capture-evidence.mjs +666 -0
- package/skills/scip-integrity-audit/SKILL.md +185 -0
- package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
- package/skills/scip-plan/SKILL.md +67 -49
- package/skills/scip-plan/agents/openai.yaml +3 -3
- package/skills/scip-query/SKILL.md +98 -77
- package/skills/scip-query/agents/openai.yaml +3 -3
- package/skills/scip-setup/SKILL.md +10 -102
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/chunk-26QA6FAI.js +0 -8
- package/dist/chunk-2KAZEZ6M.js +0 -2
- package/dist/chunk-3ORVDL3H.js +0 -2
- package/dist/chunk-46XGSFNI.js +0 -2
- package/dist/chunk-4MAK2HOY.js +0 -6
- package/dist/chunk-4TURLRL5.js +0 -16
- package/dist/chunk-4UQVNCQE.js +0 -2
- package/dist/chunk-55Q3WLZX.js +0 -2
- package/dist/chunk-5I5G2QOX.js +0 -3
- package/dist/chunk-6LDJQXAH.js +0 -2
- package/dist/chunk-6O5TICIZ.js +0 -3
- package/dist/chunk-7O5IKBTZ.js +0 -16
- package/dist/chunk-7S5E7KWT.js +0 -2
- package/dist/chunk-7WPLAODU.js +0 -5
- package/dist/chunk-AFHORGLH.js +0 -42
- package/dist/chunk-AIE7TFJW.js +0 -9
- package/dist/chunk-AQOFWNQJ.js +0 -1
- package/dist/chunk-B2PX5I6M.js +0 -2
- package/dist/chunk-B75HZHUP.js +0 -2
- package/dist/chunk-B7PBSLZN.js +0 -2
- package/dist/chunk-BBW6JFHN.js +0 -2
- package/dist/chunk-BNXCIFVY.js +0 -2
- package/dist/chunk-BS2NMXQZ.js +0 -4
- package/dist/chunk-C3KV2II6.js +0 -2
- package/dist/chunk-C43RDDP4.js +0 -20
- package/dist/chunk-DAFAHMNB.js +0 -42
- package/dist/chunk-DQLPXMH6.js +0 -8
- package/dist/chunk-EKZTZXHZ.js +0 -117
- package/dist/chunk-EW2NTSFA.js +0 -18
- package/dist/chunk-F3Z4OUDS.js +0 -8
- package/dist/chunk-FJH2NW7J.js +0 -66
- package/dist/chunk-FTFP6O3L.js +0 -11
- package/dist/chunk-FYLK2DEJ.js +0 -2
- package/dist/chunk-GH74ASD6.js +0 -11
- package/dist/chunk-GMXWZP2B.js +0 -2
- package/dist/chunk-GOUBFH5O.js +0 -3
- package/dist/chunk-HLF2TX6R.js +0 -2
- package/dist/chunk-HX7M4BDI.js +0 -30
- package/dist/chunk-HZ72SESS.js +0 -128
- package/dist/chunk-IB2N4FIY.js +0 -10
- package/dist/chunk-IZYYAFN5.js +0 -2
- package/dist/chunk-JFGGXWQF.js +0 -947
- package/dist/chunk-JN4NMBEX.js +0 -8
- package/dist/chunk-JW56N3KI.js +0 -4
- package/dist/chunk-JZ2OXNWB.js +0 -2
- package/dist/chunk-KFZNKUNT.js +0 -2
- package/dist/chunk-L5GJNV2T.js +0 -8
- package/dist/chunk-L7JDSCDF.js +0 -4
- package/dist/chunk-LU47HG23.js +0 -14
- package/dist/chunk-LVY7NPF7.js +0 -2
- package/dist/chunk-MKCDWWGV.js +0 -4
- package/dist/chunk-MNE7YG56.js +0 -2
- package/dist/chunk-MRXBEXSY.js +0 -26
- package/dist/chunk-MV7OWDUX.js +0 -2
- package/dist/chunk-NGEXCJJW.js +0 -11
- package/dist/chunk-NIW6JDC5.js +0 -29
- package/dist/chunk-PBUQFCNB.js +0 -16
- package/dist/chunk-POAVPHH7.js +0 -2
- package/dist/chunk-QZ4JVECJ.js +0 -2
- package/dist/chunk-RDO52JGY.js +0 -2
- package/dist/chunk-RJT3TUUZ.js +0 -2
- package/dist/chunk-RVLDN63O.js +0 -4
- package/dist/chunk-RXOXSKY3.js +0 -2
- package/dist/chunk-S7OYBOCK.js +0 -2
- package/dist/chunk-SMNXQT5Z.js +0 -3
- package/dist/chunk-SRAFT254.js +0 -2
- package/dist/chunk-T7YQSHPQ.js +0 -3
- package/dist/chunk-UJCOIXDY.js +0 -2
- package/dist/chunk-UJPRPGCO.js +0 -13
- package/dist/chunk-WCCFZ7V7.js +0 -113
- package/dist/chunk-WUPW3UN3.js +0 -3
- package/dist/chunk-X54AGLVX.js +0 -2
- package/dist/chunk-Y2MVPNKY.js +0 -5
- package/dist/chunk-YKUU5AIC.js +0 -3
- package/dist/chunk-YLCJLTPL.js +0 -2
- package/dist/chunk-YTQVETEO.js +0 -2
- package/dist/chunk-Z4N3MZYA.js +0 -38
- package/dist/chunk-ZJOOT3BG.js +0 -2
- package/dist/chunk-ZK26BAQL.js +0 -2
- package/dist/command-descriptors-DSS46KXI.js +0 -642
- package/dist/diff-gate-types-B0QYpDv1.d.ts +0 -11
- package/dist/direct-navigation-6YHV6IB5.js +0 -3
- package/dist/queries/diff-gate.d.ts +0 -253
- package/dist/queries/diff-gate.js +0 -2
- package/docs/COMMITTED_RECORD_COMPATIBILITY.md +0 -154
- package/docs/analyzer-validation-ledger.md +0 -516
- package/docs/schemas/outcome-event-record.schema.json +0 -95
- package/skills/_shared/SKILL.md +0 -101
- package/skills/_shared/agents/openai.yaml +0 -4
- package/skills/_shared/references/agent-contract-catalog.md +0 -105
- package/skills/_shared/references/command-catalog.md +0 -118
- package/skills/_shared/references/detector-precision-and-diffgate.md +0 -59
- package/skills/_shared/references/evidence-and-dead-code.md +0 -25
- package/skills/scip-audit/SKILL.md +0 -77
- package/skills/scip-audit/agents/openai.yaml +0 -4
- package/skills/scip-audit/references/claims.md +0 -98
- package/skills/scip-audit/references/cleanup.md +0 -100
- package/skills/scip-audit/references/directory.md +0 -222
- package/skills/scip-audit/references/frontend.md +0 -130
- package/skills/scip-audit/references/integrity.md +0 -154
- package/skills/scip-audit/references/maintainability.md +0 -162
- package/skills/scip-audit/references/twin-drift.md +0 -104
- package/skills/scip-diagnose/SKILL.md +0 -52
- package/skills/scip-diagnose/agents/openai.yaml +0 -4
- package/skills/scip-diagnose/references/debug.md +0 -117
- package/skills/scip-diagnose/references/probe-reachability.md +0 -77
- package/skills/scip-diagnose/references/root-cause.md +0 -145
- package/skills/scip-diagnose/references/triage.md +0 -119
- package/skills/scip-explore/references/diagrams.md +0 -40
- package/skills/scip-explore/references/language-playbook.md +0 -49
- package/skills/scip-improve/SKILL.md +0 -56
- package/skills/scip-improve/agents/openai.yaml +0 -4
- package/skills/scip-improve/references/cleanup-batches.md +0 -53
- package/skills/scip-improve/references/directory-moves.md +0 -53
- package/skills/scip-improve/references/doc-reconcile.md +0 -30
- package/skills/scip-improve/references/frontend-extraction.md +0 -39
- package/skills/scip-improve/references/maintainability-mechanism.md +0 -43
- package/skills/scip-improve/references/twin-drift.md +0 -35
- package/skills/scip-plan/references/api-impact.md +0 -19
- package/skills/scip-plan/references/conductor.md +0 -41
- package/skills/scip-plan/references/high-assurance.md +0 -43
- package/skills/scip-plan/references/hyper-optimization.md +0 -50
- package/skills/scip-plan/references/tla-model.md +0 -88
- package/skills/scip-setup/references/bootstrap-workflow.md +0 -119
- package/skills/scip-setup/references/language-verification.md +0 -61
- package/skills/scip-setup/references/lifecycle-commands.md +0 -119
- package/skills/scip-setup/references/per-repo-triage.md +0 -24
- package/skills/scip-verify/SKILL.md +0 -229
- package/skills/scip-verify/agents/openai.yaml +0 -4
- package/skills/scip-verify/references/calibrate-detectors.md +0 -170
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
* Generated by 'scip-query twin-ab'.
|
|
1
|
+
import{a as y}from"./chunk-Z2QB75BS.js";import{b as f}from"./chunk-7MUHSZGN.js";import{c as h,d as w}from"./chunk-MTDBHTSF.js";import{d as u,e as m,h as b,p,q as g}from"./chunk-7Z4GMCHM.js";import{dirname as $,isAbsolute as k,relative as x,resolve as v}from"path";var C=new Set(w());function R(t,e){return`tests/generated/twin-ab/${d(t)}-vs-${d(e)}.test.ts`}function d(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function P(t,e,a,n){let{refA:l,refB:s,outFile:r}=typeof e=="string"?{refA:e,refB:a,outFile:n}:e;if(typeof l!="string"||typeof s!="string"||typeof r!="string")throw new TypeError("twinAb requires refA, refB, and outFile.");if(!k(r))throw new TypeError("twinAb outFile must be an absolute path.");let i=A(t,l);if(!i.ok)return i;let o=A(t,s);if(!o.ok)return o;let c=i.symbol.paramCount===null||o.symbol.paramCount===null?null:i.symbol.paramCount===o.symbol.paramCount,S=N(i.symbol,o.symbol,t.config.projectRoot,r,c);return{ok:!0,a:i.symbol,b:o.symbol,signatureCompatible:c,testSource:S}}function A(t,e){let n=f(t,e).match;if(!n)return{ok:!1,reason:`${e} does not resolve to an indexed symbol.`};let s=t.get("SELECT kind FROM global_symbols WHERE id = ?",n.symbolId)?.kind??null;if(!(s!==null?C.has(s):b(n.symbol)))return{ok:!1,reason:`${e} resolves to ${u(n.symbol)}${s!==null?` with SCIP kind ${h(s)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!y(t,n))return{ok:!1,reason:`${e} (${u(n.symbol)} at ${n.relativePath}:${n.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let i=t.get("SELECT documentation FROM global_symbols WHERE id = ?",n.symbolId),o=p(g(i?.documentation??null));return{ok:!0,symbol:{ref:e,symbol:n.symbol,shortName:m(n.symbol)||u(n.symbol),file:n.relativePath,startLine:n.startLine,signature:o,paramCount:o?E(o):null}}}function E(t){let e=t.indexOf("(");if(e===-1)return null;let a=0,n=-1;for(let i=e;i<t.length;i+=1){let o=t[i];if(o==="(")a+=1;else if(o===")"&&(a-=1,a===0)){n=i;break}}if(n===-1)return null;let l=t.slice(e+1,n).trim();if(!l)return 0;let s=1,r=0;for(let i of l)i==="("||i==="["||i==="{"?r+=1:i===")"||i==="]"||i==="}"?r=Math.max(0,r-1):i===","&&r===0&&(s+=1);return s}function T(t,e,a){let n=$(e),l=v(t,a),r=x(n,l).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function N(t,e,a,n,l){let s=T(a,n,t.file),r=T(a,n,e.file),i=l===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":l?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
|
+
* Generated by 'scip-query twin-ab'. Cleanup integrity scenario.
|
|
3
3
|
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
4
|
* more than one place, feed both the same input and require the same
|
|
5
5
|
* answer. Disagreement between twins means at least one is wrong \u2014
|
|
@@ -37,4 +37,4 @@ describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${e.shortName}'
|
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
`}export{R as a,P as b};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-AAOEROT3.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{a as d}from"./chunk-G6VV7ROY.js";import{b as l}from"./chunk-UM56ZET4.js";import{d as r,u as m}from"./chunk-7Z4GMCHM.js";function u(o,t={}){let{limit:i=30,scope:e}=t,n=e?"AND def_d.relative_path LIKE ?":"",f=e?[`%${e}%`]:[],c=o.all(`SELECT
|
|
2
|
+
gs.symbol,
|
|
3
|
+
COUNT(*) AS ref_count,
|
|
4
|
+
COUNT(DISTINCT ref_d.id) AS file_count,
|
|
5
|
+
def_d.relative_path AS defined_in
|
|
6
|
+
FROM mentions m
|
|
7
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
8
|
+
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
9
|
+
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
10
|
+
JOIN (
|
|
11
|
+
SELECT m2.symbol_id, c2.document_id
|
|
12
|
+
FROM mentions m2
|
|
13
|
+
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
14
|
+
WHERE m2.role = 1
|
|
15
|
+
GROUP BY m2.symbol_id
|
|
16
|
+
) sym_def ON sym_def.symbol_id = gs.id
|
|
17
|
+
JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
18
|
+
WHERE m.role != 1
|
|
19
|
+
AND def_d.id != ref_d.id
|
|
20
|
+
${o.pathExclusionsFor("def_d")}
|
|
21
|
+
${o.symbolNoiseFor("gs")}
|
|
22
|
+
${n}
|
|
23
|
+
GROUP BY gs.id
|
|
24
|
+
ORDER BY ref_count DESC
|
|
25
|
+
LIMIT ?`,...f,i).filter(s=>!o.isIgnored(s.defined_in)).map(s=>({symbol:s.symbol,shortName:r(s.symbol),refCount:s.ref_count,fileCount:s.file_count,definedIn:s.defined_in,basis:"scip-cross-file-mentions",countUnit:"reference-occurrences"}));return c.length>0?c:a(o,e,i)}function C(o,t={}){return u(o,t)}function a(o,t,i){return m(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>p(o,e)).filter(e=>e.refCount>0).sort((e,n)=>n.refCount-e.refCount||n.fileCount-e.fileCount).slice(0,i)}function p(o,t){let e=l(o,t,{limit:500,semanticEvidence:d}).filter(n=>n.file!==t.relativePath);return{symbol:t.symbol,shortName:r(t.symbol),refCount:e.length,fileCount:new Set(e.map(n=>n.file)).size,definedIn:t.relativePath,basis:"source-backed-incoming-evidence",countUnit:"distinct-incoming-evidence-rows"}}export{u as a,C as b};
|
|
26
|
+
//# sourceMappingURL=chunk-AFRS7WJU.js.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{a as Z}from"./chunk-U2MNECDU.js";import{p as yt}from"./chunk-B3AREUQK.js";import{d as ft}from"./chunk-KK7GPALL.js";import{b as mt}from"./chunk-HW7FASEL.js";import{A as he,t as T}from"./chunk-7Z4GMCHM.js";import{a as me,f as k,g as D,i as M,j as ot,k as X,l as ut,p as ct,q as dt,v as pt,w as j}from"./chunk-6LS3IG2I.js";import{A as at,C as O,D as st,F as lt,M as ye,z as fe}from"./chunk-C7WSQA6A.js";import{A as it,c as Q,i as tt,w as nt,y as rt,z as pe}from"./chunk-JSHDCVUM.js";function ge(e){let t=e.replaceAll("\\","/");return mt(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 cn from"better-sqlite3";var be="scip_query_runtime_boundaries",W="scip_query_runtime_observations",Se="scip_query_runtime_relation_groups",xe="scip_query_runtime_relation_participants";function dn(e,t){let n=new cn(e);try{n.exec(`
|
|
2
|
+
CREATE TABLE IF NOT EXISTS ${be} (
|
|
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
|
+
`),mn(n),n.transaction(()=>{n.prepare(`INSERT OR REPLACE INTO ${be} (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 ${xe}`).run(),n.prepare(`DELETE FROM ${Se}`).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 ${Se} (id, protocol, join_rule, normalized_key, payload) VALUES (?, ?, ?, ?, ?)`),a=n.prepare(`INSERT INTO ${xe} (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 pn(e,t={}){if(!fn(e,W))return ht(e)?.observations??[];let n=[],r=[];return ve(n,r,"protocol",t.protocols),ve(n,r,"action",t.actions),ve(n,r,"source_scope",t.sourceScopes),ve(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=>yn(a.payload))}function mn(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 ${Se} (
|
|
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 ${Se}(protocol, join_rule, normalized_key);
|
|
39
|
+
|
|
40
|
+
CREATE TABLE IF NOT EXISTS ${xe} (
|
|
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 ${xe}(observation_id, participant_role);
|
|
48
|
+
`)}function fn(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function ve(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function yn(e){try{return[JSON.parse(e)]}catch{return[]}}function ht(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",be))return null;let n=e.get(`SELECT schema_version, payload FROM ${be} 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 de}from"crypto";import{createRequire as zr}from"module";import{createHash as $n}from"crypto";var Re=8;function ee(e,t,n){return De(gt(e,t,Oe(n),0,new Set))}function Ae(e,t,n){return Le(e,t,n,0,new Set)}function gt(e,t,n,r,i){if(r>Re)return[];let a=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return a?vt(e,t,a[1],a[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?bt(e,t,n,r,i):[]}function vt(e,t,n,r,i,a){let s=[];for(let o of Le(e,t,n,i+1,new Set(a))){let l=M(o.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let c=u.childForFieldName("key")??u.namedChild(0);if(Sn(c)!==r)continue;let d=u.childForFieldName("value")??u.namedChild(1);d&&s.push(...gt(e,o.definition.relativePath,Oe(d.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 d=vn(e,o.definition.relativePath,r,u);s.push(...d.length>0?d:[hn(o.definition,r,u)]);continue}if(u.type==="spread_element"){let c=u.namedChild(0);if(!c)continue;for(let d of Le(e,o.definition.relativePath,Oe(c.text),i+1,new Set(a)))s.push(...vt(e,d.definition.relativePath,d.definition.leaf,r,i+1,new Set(a)))}}}return De(s)}function hn(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 Le(e,t,n,r,i){return r>Re||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:bt(e,t,n,r,i).flatMap(a=>{let s=O(e,a.relativePath)?.rootNode,o=s?bn(s,a.leaf):null;return o?[{definition:a,initializer:o}]:[]})}function bt(e,t,n,r,i){if(r>Re)return[];let a=`${t}\0${n}`;if(i.has(a))return[];i.add(a);let s=T(e,t).filter(u=>u.leaf===n);if(s.length>0)return s;let o=gn(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 ke(e,l.sourcePath,u,r+1,new Set(i))}return ke(e,t,n,r+1,new Set(i))}function gn(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(ut(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 ke(e,t,n,r,i){if(r>Re)return[];let a=T(e,t).filter(s=>s.leaf===n);return a.length>0?a:De(pt(e,t).flatMap(s=>s.sourcePath?s.kind==="named"&&!s.names.includes(n)?[]:ke(e,s.sourcePath,n,r+1,new Set(i)):[]))}function vn(e,t,n,r){return T(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function bn(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 Sn(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function Oe(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function De(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}var xn=8;function V(e,t){return t?te(e,t,0,new Set):null}function te(e,t,n,r){if(n>xn)return U(t,"value-evaluation-depth");let i=M(t),a=Pn(i);if(a)return wn(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(d=>d.term)},c=l.map(d=>d.value).join("");return En(e.file,i,u,c,l.some(d=>d.precision!=="literal")?"constrained-pattern":"literal",l)}}let s=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))return Bn(e,s,i,n,r);let o=Fn(i);return o?In(e,o.base,o.properties,i,n,r):i.type==="call_expression"||i.type==="call"?Rn(e,i,n,r):U(i,`unsupported-expression:${i.type}`)}function Rn(e,t,n,r){let a=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",s=Cn(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 c=D(u,o.startLine,o.endLine);if(!c)return U(t,"call-target-syntax-unavailable");let d=Nn(c);if(!d)return U(t,"call-return-not-single-expression");let p=new Set(r);p.add(l);let m=te({db:e.db,file:o.relativePath,root:u},d,n+1,p);return m?Ce(t,"bounded-call-return",m,o.symbol):U(t,"call-return-unresolved")}function Cn(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=T(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 Nn(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return St(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function St(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)St(e,r,n)}}function Bn(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=Me(e.root,t);if(s){let y=te(e,s,r+1,i);return y?Ce(n,"local-constant",y):U(n,"non-foldable-local")}let o=j(e.db,e.file).find(y=>y.localName===t&&y.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 c=u[0],d=O(e.db,c.relativePath)?.rootNode;if(!d)return H(n,c.symbol,"import-definition-unparsed");let p=Me(d,c.leaf);if(!p)return H(n,c.symbol,"import-definition-non-value");let m=te({db:e.db,file:c.relativePath,root:d},p,r+1,i);return m?Ce(n,"imported-constant",m,c.symbol):H(n,c.symbol,"import-value-unresolved")}function In(e,t,n,r,i,a){let s=j(e.db,e.file).find(m=>m.localName===t&&m.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 m=Z(e.db,s.sourcePath,l);if(m.length!==1)return H(r,`${t}.${n.join(".")}`,m.length===0?"member-definition-missing":"member-definition-ambiguous");o=m[0].relativePath,l=m[0].leaf,u=m[0].symbol}let c=o===e.file?e.root:O(e.db,o)?.rootNode;if(!c)return H(r,u??t,"member-definition-unparsed");let d=Me(c,l);if(!d)return H(r,u??t,"member-base-non-value");for(let m of n){let y=M(d);if(d=Tn(y,m),!d)return H(r,u??`${t}.${n.join(".")}`,`member-property-missing:${m}`)}let p=te({db:e.db,file:o,root:c},d,i+1,a);return p?Ce(r,"member-constant",p,u):H(r,u??t,"member-value-unresolved")}function Pn(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 wn(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:Ne("direct-literal","direct",e,t)}}function En(e,t,n,r,i,a){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...Ne("constant-concatenation","mechanically-derived",e,t),inputFactIds:a.flatMap(s=>s.derivation.inputFactIds),sourceSpans:a.flatMap(s=>s.derivation.sourceSpans)}}}function Ce(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:Ne(n,"heuristic","",e)}}function U(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:Ne(t,"heuristic","",e)}}function Ne(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 Fn(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}function Me(e,t){let n=null;return k(e,r=>{if(n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t)return;let a=r.parent;!a||a.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(a.text)||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Tn(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 _n=new WeakMap,wt=new Set(["delete","get","head","options","patch","post","put"]),Ln=/(?:^|\.)(?:app|router|server)$/u,kn=new Set(["findFirst","findMany","findUnique","from","get","select"]),On=new Set(["create","delete","insert","remove","update","upsert"]),An=new Set(["execute","query","raw"]),xt=/(?:\b(?:name|id)|['"`](?:name|id)['"`])\s*:/u,Rt=/(?:^\s*|[,{]\s*)(?:async\s+)?['"`]?(?:execute|handler|invoke|run)['"`]?\s*(?::|\([^)]*\)\s*\{)/mu,Ct=/\b[A-Za-z_$][\w$-]*[_-][\w$-]*\s*\(/u,Nt=/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s+[A-Za-z_$][\w$-]*\s*\(/iu,Ue=[Vn(),Hn(),Dn(),Un(),jn(),zn(),Kn()],Ve=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function Dn(){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=Mn(e.source),n=[];return q(e.root,"call_expression",r=>{let i=oe(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||!Ve.has(l))return;let u=Y(r),c=A(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},d=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(E(e,r,"builtin.node-child-process",d,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...c}],"exact","node-child-process-import"))}),n}}}function Mn(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 c=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Ve.has(c[1])&&t.set(c[2]??c[1],c[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 c=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Ve.has(c[1])&&t.set(c[2]??c[1],c[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=re(r,"runtime-boundaries.context.ast",t,()=>n===void 0?O(e,t):st(e,t,n)?.tree);if(!i)return null;let a=i.rootNode;n!==void 0&&_n.set(a,i);let s=n??pe(e,t),o,l,u,c=()=>(l!==void 0||(l=re(r,"runtime-boundaries.context.callable-sites",t,()=>{let d=fe(t);return(d?dt(a,d):null)??ct(e,t)})),l);return{db:e,file:t,source:s,root:a,get constants(){return u??=re(r,"runtime-boundaries.context.constants",t,()=>Qn(a)),u},ownerAt:d=>{let m=(o??=re(r,"runtime-boundaries.context.definitions",t,()=>T(e,t,{rangeCorrectionEvidence:{source:s,callables:c()}},(f,h)=>re(r,`runtime-boundaries.context.definitions.${f}`,t,h)))).filter(f=>f.startLine<=d&&f.endLine>=d).sort((f,h)=>f.endLine-f.startLine-(h.endLine-h.startLine)||f.startLine-h.startLine)[0];if(m)return{file:t,symbol:m.symbol,name:m.leaf,startLine:m.startLine,endLine:m.endLine};let v=(c()??[]).filter(f=>f.startLine<=d&&f.endLine>=d).sort((f,h)=>f.endLine-f.startLine-(h.endLine-h.startLine)||f.startLine-h.startLine)[0];return{file:t,symbol:null,name:v?.name??null,startLine:v?.startLine??d,endLine:v?.endLine??d}}}}function re(e,t,n,r){return e?e(t,r,{file:n}):r()}function Hn(){return{id:"builtin.effect-httpapi",supports:e=>ie(e,"HttpApiEndpoint").size>0||ie(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=ie(e.source,"HttpApiEndpoint"),r=ie(e.source,"HttpApiGroup"),i=ie(e.source,"HttpApiBuilder");return q(e.root,"call_expression",a=>{let s=Et(a);if(!s)return;let o=Y(a);if(n.has(s.receiver)&&wt.has(s.member)){let v=A(o[0],e),f=A(o[1],e),h=It(a,r,"make",0,e);if(!v||!f||!h)return;let g=s.member.toUpperCase();t.push(E(e,a,"builtin.effect-httpapi","http.handle",[{name:"method",value:g,evidence:"literal"},{name:"path",...f}],G([{name:"path",...f}]),"effect-httpapi-endpoint-declaration")),t.push(E(e,a,"builtin.effect-httpapi","framework.declare",He(h,v),G(He(h,v)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(s.member))return;let l=It(a,i,"group",1,e),u=A(o[0],e),c=o[1];if(!l||!u||!c)return;let d=He(l,u),p=ee(e.db,e.file,c.text),m=E(e,a,"builtin.effect-httpapi","framework.handle",d,p.length===1?G(d):"candidate","effect-httpapi-handler-registration"),y=p[0];p.length===1&&y&&(m.owner={file:y.relativePath,symbol:y.symbol,name:y.leaf,startLine:y.startLine,endLine:y.endLine}),t.push(m)}),t}}}function He(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function ie(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(Bt(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}`)&&Bt(s)&&n.add(a[1])}return n}function Bt(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function It(e,t,n,r,i){let a=e.parent;for(;a;){if(a.type==="call_expression"){let s=Pt(a,t,n,r,i);if(s)return s;let o=a.childForFieldName("function")??a.namedChild(0),l=null;if(o&&je(o,u=>{!l&&u.type==="call_expression"&&(l=Pt(u,t,n,r,i))}),l)return l}a=a.parent}return null}function Pt(e,t,n,r,i){let a=Et(e);return!a||a.member!==n||!t.has(a.receiver)?null:A(Y(e)[r],i)}function Et(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 Vn(){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)||ae(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||!ae(e.source,["fastapi","flask"]))return;t.push(E(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=oe(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"&&ae(e.source,["axum"])){let p=A(s[0],e),m=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(s[1]?.text??"")?.[1];if(!p||!m)return;t.push(E(e,n,"builtin.http","http.handle",[{name:"method",value:m.toUpperCase(),evidence:"literal"},{name:"path",...p}],G([{name:"path",...p}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let p=A(s[0],e);if(!p)return;let y=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(s[1]?.text??"")?.[1]?.toUpperCase()??(s[1]?null:"GET"),v=[...y?[{name:"method",value:y,evidence:"literal"}]:[],{name:"path",...p}];t.push(E(e,n,"builtin.http","http.request",v,y?G(v):"candidate","call-expression"));return}if(!wt.has(i))return;let o=A(s[0],e);if(!o)return;let l=i.toUpperCase();if(Ln.test(a)&&ae(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(E(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],G([{name:"path",...o}]),"framework-adapter"));return}let c=Wn(e.source,["axios"]),d=a.split(".")[0]??"";c.has(d)&&t.push(E(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],G([{name:"path",...o}]),"client-adapter"))}),t}}}function Un(){return{id:"builtin.capability-registry",supports:e=>xt.test(e)&&Rt.test(e)||Ct.test(e)||Nt.test(e),extract:e=>{let t=[],n=new Set,r=[];return xt.test(e.source)&&Rt.test(e.source)&&r.push("pair"),(Ct.test(e.source)||Nt.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=Ft(o,e),c=tr(i);if(!u||u.evidence!=="literal"||!c)return;let d=`handle\0${u.value}\0${c.startPosition.row}`;if(n.has(d))return;n.add(d),t.push(E(e,c,"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(!Gn(a,o,s.index))continue;let l=`reference\0${o}\0${i.startPosition.row}`;n.has(l)||(n.add(l),t.push(E(e,i,"builtin.capability-registry","registry.reference",[{name:"key",value:o,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function Gn(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 jn(){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=er(n);if(!a)return;let s=n.childForFieldName("key")??n.namedChild(0),o=n.childForFieldName("value")??n.namedChild(1),l=Ft(s,e);if(!l||!o||!Tt(o))return;let u=Ge(o)?"exact":"candidate";t.push(E(e,n,"builtin.registry","registry.handle",[{name:"registry",value:a,evidence:"identifier"},{name:"key",...l}],G([{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(E(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 zn(){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=rr(e.root);return q(e.root,"call_expression",r=>{let i=oe(r);if(!i)return;let a=i.split("."),s=a.at(-1)??"",o=Y(r),l=o[0]?.text??"",u=nr(s,l);if(!u)return;let c=$t(a,n);if(!c)return;let d=qn(o[0],e)??ir(l),p=ar(c,a,s,d);if(!p)return;let m=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(E(e,r,"builtin.persistence",u,[{name:"resource",...p}],G([{name:"resource",...p}]),m))}),t}}}function qn(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 Kn(){return{id:"builtin.queue",supports:e=>ae(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=oe(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"?Yn(a[0],"topic",e):A(a[0],e);o&&t.push(E(e,n,"builtin.queue",s,[{name:"address",...o}],G([{name:"address",...o}]),"framework-adapter"))}),t}}}function E(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:${$n("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:Xn(r),executionDomain:Zn(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:ge(e.file)}}function Xn(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 Zn(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function ae(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 Wn(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 Be(e,t,n,r,i,a,s){return E(e,t,n,r,i,a,s)}function oe(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 Yn(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 Ft(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 G(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function Jn(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 Qn(e){let t=new Map;return je(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=Jn(i);a!==null&&t.set(r.text,a)}),t}function er(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 Ge(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function Tt(e){return Ge(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function tr(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&&Tt(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 $t(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 nr(e,t){if(kn.has(e))return"database.read";if(On.has(e))return"database.write";if(!An.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 rr(e){let t=new Set;return q(e,"call_expression",n=>{let r=oe(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!$t(i)))for(let a of Y(n)){if(!Ge(a))continue;let o=(a.childForFieldName("parameters")??a.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=o?ot(o):null;l&&t.add(l)}}),t}function ir(e){let t=_t(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function ar(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=_t(r.value);return i?{value:i,evidence:r.evidence}:null}function _t(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function je(e,t){t(e);for(let n of e.namedChildren)je(n,t)}function q(e,t,n){for(let r of e.descendantsOfType(t))n(r)}var or=Q("resolved-call-syntax",{clearGroups:[]}),ze=Q("resolved-call-sites",{clearGroups:[]}),sr=Q("resolved-call-sites-reference-evidence",{clearGroups:[]});function qe(e,t){return ze.get(e,t.symbolId,()=>kt(e,t,lr(e,t)))}function Lt(e,t){let n=[...new Map(t.map(a=>[a.symbolId,a])).values()],r=n.filter(a=>!ze.has(e,a.symbolId)),i=Ot(e,r);return new Map(n.map(a=>[a.symbolId,ze.get(e,a.symbolId,()=>kt(e,a,i.get(a.symbolId)??[]))]))}function kt(e,t,n){let r=[],i=[],a=new Set,s=new Set;for(let o of n){a.add(o.file);let l=or.get(e,o.file,()=>cr(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 c=u[0],d=`${o.file}\0${c.callNode.startIndex}\0${c.callNode.endIndex}`;s.has(d)||(s.add(d),r.push({callee:t,caller:he(T(e,o.file),c.callNode.startPosition.row),file:o.file,line:c.callNode.startPosition.row,startLine:c.callNode.startPosition.row,endLine:c.callNode.endPosition.row,targetText:c.targetNode.text,callNode:c.callNode,targetNode:c.targetNode,arguments:c.arguments,referenceProvenance:o.provenance}))}return{sites:r,unresolved:i,filesVisited:a.size}}function lr(e,t){return Ot(e,[t]).get(t.symbolId)??[]}function Ot(e,t){if(!ur(e))return new Map(t.map(r=>[r.symbolId,yt(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 ft(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 ur(e){return sr.get(e,"project",()=>!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))}function cr(e,t){let n=O(e,t)?.rootNode;if(!n)return null;let r=new Map;return At(n,i=>{if(i.type!=="call_expression"&&i.type!=="call")return;let a=i.childForFieldName("function")??i.namedChild(0);if(!a)return;let s=lt(a);if(!s)return;let o=i.childForFieldName("arguments")??i.namedChildren.find(c=>c.type==="arguments"),l={callNode:i,targetNode:a,arguments:o?.namedChildren??[]},u=r.get(s);u?u.push(l):r.set(s,[l])}),{byLeaf:r}}function At(e,t){t(e);for(let n of e.namedChildren)At(n,t)}var dr=Q("call-parameter-value-flow",{clearGroups:[]});function se(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return dr.get(e,n,()=>pr(e,t))}function le(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 pr(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 c=l.text.trim(),d=a.indexOf(c);d>=0?s.push({calleePosition:u,callerPosition:d,argumentText:c,proof:n}):o.push({calleePosition:u,argumentText:c,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:s,unknown:o}}var mr=8,fr=8;function Mt(e,t,n=[]){let r=[],i=yr(e,n,r),a=i.summaries,s=hr(e,t,a,r),o=gr(e,t,r);return{observations:Pr([...s.observations,...o]),bodySummaries:a.size,discriminatorSummaries:s.summaries,filesInspected:i.filesInspected,errors:r}}function yr(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>=mr))try{for(let l of qe(e,o.definition).sites){if(!s(l.file))continue;let c=l.caller;if(!c)continue;let d=le(se(e,l),o.parameterIndexes);if(d.length===0)continue;let p={definition:c,parameterIndexes:zt(d),depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]};xr(r,p)&&i.push(r.get(c.symbol))}}catch(l){n.push(`builtin.carrier body summary failed for ${o.definition.relativePath}: ${Ze(l)}`)}}return{summaries:r,filesInspected:new Set(t.map(o=>o.definition.relativePath)).size}}function hr(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=Vt(o);if(!l)continue;let u=L(e,o.source.file);if(!u)continue;let c=Ut(u.root,o.source.startLine),d=c.find(g=>g.startPosition.row===o.source.startLine)??c[0];if(!d)continue;let p=Xe(d);if(!p)continue;let m=ee(e,o.source.file,p.text);if(m.length!==1)continue;let y=n.get(m[0].symbol);if(!y)continue;let v=o.owner.symbol?T(e,o.owner.file).find(g=>g.symbol===o.owner.symbol):null;if(!v)continue;let f=Rr(u,v),h=Ie(d);for(let g of y.parameterIndexes){let R=Nr(u,h[g]);if(R)for(let x of Br(R)){let b=Gt(x),C=jt(x);if(!b||!C)continue;let P=f.indexOf(C.text.trim());if(P>=0){let F={definition:v,carrier:l,field:b,parameterIndex:P,depth:0,proofObservationIds:[o.id],proofSpans:[o.source,{file:o.source.file,startLine:x.startPosition.row,endLine:x.endPosition.row}]},$=Dt(F);i.has($)||(i.set($,F),a.push(F));continue}let w=V(u,C);!w||w.evidence==="expression"||s.push(Ke(u,x,"carrier.publish",l,b,w.value,[o.id]))}}}for(;a.length>0;){let o=a.shift();if(!(o.depth>=fr))try{for(let l of qe(e,o.definition).sites){let u=L(e,l.file);if(!u)continue;let c=l.callNode,d=Ie(c)[o.parameterIndex];if(!d)continue;let p=V(u,d);p&&p.evidence!=="expression"&&s.push(Ke(u,c,"carrier.publish",o.carrier,o.field,p.value,o.proofObservationIds));let m=l.caller;if(!m)continue;let y=se(e,l).transfers.find(h=>h.calleePosition===o.parameterIndex)?.callerPosition;if(y===void 0)continue;let v={...o,definition:m,parameterIndex:y,depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},f=Dt(v);i.has(f)||(i.set(f,v),a.push(v))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${o.definition.relativePath}: ${Ze(l)}`)}}return{observations:s,summaries:i.size}}function gr(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=Vt(a);if(!s)continue;let o=L(e,a.source.file);if(!o)continue;let l=Ut(o.root,a.source.startLine)[0];if(l)for(let u of Ie(l).slice(1)){let c=ee(e,a.source.file,u.text);for(let d of c)try{let p=L(e,d.relativePath);if(!p)continue;let m=D(p.root,d.startLine,d.endLine);if(!m)continue;k(m,y=>{if(y.type!=="call_expression")return;let v=Xe(y);if(!v)return;let f=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(v.text.trim());if(!f)return;let h=f[1],g=f[2],R=br(e,p,d,g);if(!R)return;let x=Sr(e,d.relativePath,h);for(let b of i){let C=b.keyParts.find($=>$.name==="registry")?.value,P=b.keyParts.find($=>$.name==="key")?.value;if(!C||!P||!x.some($=>$.file===b.source.file&&$.binding===C))continue;let w=L(e,b.source.file),F=w?Cr(w.root,b.source.startLine):null;!w||!F||r.push(Ke(w,F,"carrier.consume",s,R,P,[a.id,b.id]))}})}catch(p){n.push(`builtin.carrier consumer analysis failed for ${d.relativePath}: ${Ze(p)}`)}}}return r}function Ht(e){let t=T(e.db,e.file),n=new Map;return k(e.root,r=>{if(r.type!=="pair"||Gt(r)?.toLowerCase()!=="body")return;let i=jt(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let a=he(t,r.startPosition.row),s=vr(r);if(!a||!s)return;let o=X(s),l=new Set;Ir(i,o,l);let u=n.get(a.symbol)??new Set;o.forEach((c,d)=>{c&&l.has(c)&&u.add(d)}),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 vr(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 br(e,t,n,r){let i=D(t.root,n.startLine,n.endLine);if(!i)return null;let a=new RegExp(`\\.body\\??\\.${me(r)}\\b`,"u");if(a.test(i.text))return r;let s=null;if(k(i,c=>{if(s||c.type!=="variable_declarator")return;let d=c.childForFieldName("name")??c.namedChild(0),p=c.childForFieldName("value")??c.namedChild(1);!d||!p||!new RegExp(`(?:^|[,{}])\\s*${me(r)}\\s*(?:[,}]|$)`,"u").test(d.text)||p.type==="call_expression"&&(s=Xe(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${me(r)}\\s*[,}]`,"u").test(u.text)?r:null}function Sr(e,t,n){let r=[];for(let i of Ae(e,t,n)){let a=M(i.initializer);if(a.type==="call_expression")for(let s of Ie(a)){let o=s.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(o))for(let l of Ae(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 Ke(e,t,n,r,i,a,s){let l=Be(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 Vt(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 xr(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=zt([...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 Dt(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function Rr(e,t){let n=D(e.root,t.startLine,t.endLine);return n?X(n):[]}function Cr(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 Ut(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 Xe(e){return e.childForFieldName("function")??e.namedChild(0)}function Ie(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Nr(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 Br(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 jt(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function Ir(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 zt(e){return[...new Set(e)].sort((t,n)=>t-n)}function Pr(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Ze(e){return e instanceof Error?e.message:String(e)}import{createHash as wr}from"crypto";function qt(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=Er(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=Tr(a.prefix.value,l.value),c=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),d=`${o.id}\0${a.file}\0${a.line}\0${u}`;r.push({...o,id:`boundary:${wr("sha256").update(d).digest("hex").slice(0,16)}`,keyParts:c,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 Er(e){let t=[],n=ye(e);for(let r of n){let i=pe(e,r);if(!$r(i))continue;let a=L(e,r);a&&Kt(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=_r(s);if(l.length<2)return;let u=V(a,l[0]);if(!u||u.evidence==="expression")return;let c=Fr(e,r,l[1]);c.length!==0&&t.push({file:r,line:s.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:c})})}return{mounts:t,filesInspected:n.length}}function Fr(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 Tr(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function $r(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function _r(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Kt(e,t){t(e);for(let n of e.namedChildren)Kt(n,t)}import{createHash as Lr}from"crypto";function Pe(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}var Ee=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),kr=8,Xt=nt({kind:"runtime-boundary-http-roles",invalidation:rt("runtime-boundary-http-roles"),serialize:Mr,deserialize:Hr});function Yt(e,t,n){let r=n??((f,h)=>h()),i=new Map,a=[],s=[],o=new Set,l=[],u=[],c=new Map,d=new Map,p=new Map,m=f=>{if(c.has(f))return c.get(f)??null;let h=L(e,f);return c.set(f,h),h},y=f=>{let h=d.get(f);if(h)return h;let g=T(e,f);return d.set(f,g),g},v=(f,h)=>{let g=p.get(f.file);if(!g){let b=tt(e,f.file,f.source),C=Xt.read(e,f.file,b)??[];g={contentHash:b,roles:new Map(C.map(P=>[P.symbol,P])),dirty:!1},p.set(f.file,g)}let R=g.roles.get(h.symbol);if(R)return R;let x=Dr(f,h);return g.roles.set(h.symbol,{symbol:h.symbol,...x}),g.dirty=!0,x};for(r("runtime-boundaries.http-summary.seed",()=>{for(let f of t){if(f.action!=="http.request"||!f.owner.symbol||f.evidence!=="call-expression"&&f.evidence!=="client-adapter")continue;let h=y(f.owner.file).find(b=>b.symbol===f.owner.symbol);if(!h)continue;let g=m(h.relativePath);if(!g)continue;let R=v(g,h),x={definition:h,...R,constantMethods:f.keyParts.flatMap(b=>b.name==="method"&&b.evidence!=="expression"&&Ee.has(b.value.toUpperCase())?[b.value.toUpperCase()]:[]),depth:0,proofObservationIds:[f.id],proofSpans:[f.source]};Wt(i,x)&&a.push(i.get(h.symbol))}});a.length>0;){let f=a.splice(0,a.length),h=r("runtime-boundaries.http-summary.resolve-call-sites",()=>Lt(e,f.map(g=>g.definition)),{batchSize:f.length});r("runtime-boundaries.http-summary.process-call-sites",()=>{for(let g of f)if(!(g.depth>=kr))try{let R=h.get(g.definition.symbolId);if(!R)continue;u.push(...R.unresolved.map(x=>Or(g,x)));for(let x of R.sites){let b=m(x.file);if(!b)continue;o.add(x.file);let C=x.callNode,P=Ar(g,C,b);P&&s.push(P);let w=x.caller;if(!w)continue;let F=v(b,w),$=Vr(e,g,x),_={definition:w,pathParameterIndexes:we([...F.pathParameterIndexes,...$.pathParameterIndexes]),methodParameterIndexes:we([...F.methodParameterIndexes,...$.methodParameterIndexes]),constantMethods:ne([...g.constantMethods,...F.constantMethods]),depth:g.depth+1,proofObservationIds:ne([...g.proofObservationIds,...P?[P.id]:[]]),proofSpans:[...g.proofSpans,{file:x.file,startLine:x.startLine,endLine:x.endLine}]};Wt(i,_)&&a.push(i.get(w.symbol))}}catch(R){l.push(`builtin.http-summary failed for ${g.definition.relativePath}:${g.definition.startLine+1}: ${R instanceof Error?R.message:String(R)}`)}},{batchSize:f.length})}return Xt.writeBatch(e,[...p.entries()].flatMap(([f,h])=>h.dirty?[{relativePath:f,contentHash:h.contentHash,value:[...h.roles.values()].sort((g,R)=>g.symbol.localeCompare(R.symbol))}]:[])),{observations:s,frontiers:Pe(u),summaries:i.size,filesInspected:o.size,errors:l}}function Or(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:${Lr("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:ge(t.file)}}function Ar(e,t,n){let r=Jt(t),i=e.pathParameterIndexes.flatMap(d=>{let p=V(n,r[d]);return p&&p.evidence!=="expression"&&Gr(p.value)?[{index:d,value:p}]:[]}),a=e.methodParameterIndexes.flatMap(d=>{let p=V(n,r[d]),m=p?.value.toUpperCase();return p&&m&&p.evidence!=="expression"&&Ee.has(m)?[{index:d,value:{...p,value:m}}]:[]}),s=ne([...e.constantMethods,...a.map(d=>d.value.value)]);if(i.length!==1||s.length!==1)return null;let o=i[0].value,l=a.find(d=>d.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}],c=Be(n,t,"builtin.http-summary","http.request",u,"derived","compiler-resolved-http-summary");return c.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,c.source]},c}function Dr(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 m=Jt(o);ue(m[0],r,i);let y=Ur(m[1],"method");if(y){ue(y,r,a);let v=V(e,y),f=v?.value.toUpperCase();f&&v?.evidence!=="expression"&&Ee.has(f)&&s.add(f)}else ue(m[1],r,a)}if(o.type!=="pair")return;let l=o.childForFieldName("key")??o.namedChild(0),u=o.childForFieldName("value")??o.namedChild(1),c=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(c==="url"||c==="path"||c==="endpoint")&&ue(u,r,i),(c==="init"||c==="requestinit"||c==="options")&&ue(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 Mr(e){return e.map(t=>[encodeURIComponent(t.symbol),t.pathParameterIndexes.join(","),t.methodParameterIndexes.join(","),t.constantMethods.join(",")].join(" ")).join(`
|
|
49
|
+
`)}function Hr(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=Zt(r[1]),a=Zt(r[2]),s=r[3]?r[3].split(","):[];if(i===null||a===null||s.some(o=>!Ee.has(o)))return null;t.push({symbol:decodeURIComponent(r[0]),pathParameterIndexes:i,methodParameterIndexes:a,constantMethods:s})}return t}function Zt(e){if(!e)return[];let t=e.split(",").map(Number);return t.every(n=>Number.isSafeInteger(n)&&n>=0)?t:null}function Vr(e,t,n){let r=se(e,n);return{pathParameterIndexes:le(r,t.pathParameterIndexes),methodParameterIndexes:le(r,t.methodParameterIndexes)}}function Wt(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=we([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=we([...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 Ur(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 ue(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 Jt(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Gr(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function we(e){return[...new Set(e)].sort((t,n)=>t-n)}function ne(e){return[...new Set(e)].sort()}import{createHash as jr}from"crypto";function tn(e){let t=Qt(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=Qt(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?We(r).flatMap(i=>{let a=t.get(i)?.[0];return a?[en(r,a,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?We(r).flatMap(i=>{let a=n.get(i)?.[0];return a?[en(r,a,i,"queue.consume")]:[]}):[])}function Qt(e){let t=new Map;for(let n of e)for(let r of We(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 We(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function en(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:${jr("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",qr=zr(import.meta.url),B=qr("typescript"),Kr=new Set([B.SyntaxKind.WhitespaceTrivia,B.SyntaxKind.NewLineTrivia,B.SyntaxKind.SingleLineCommentTrivia,B.SyntaxKind.MultiLineCommentTrivia]),Xr=new Set([B.SyntaxKind.NoSubstitutionTemplateLiteral,B.SyntaxKind.TemplateHead,B.SyntaxKind.TemplateMiddle,B.SyntaxKind.TemplateTail]),$e=[{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}],Zr=64,on="builtin.http-summary",_e={HTTP_HANDLE:"http.handle",HTTP_REQUEST:"http.request",REGISTRY_HANDLE:"registry.handle"},Je=new Set(Object.values(_e));function Wr(e,t={}){let n=ye(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map(hi)),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(S=>r.has(S.file)&&!i.has(S.file)):[],l=new Set(o.flatMap(S=>S.observationIds)),u=s?t.previousGraph.observations.filter(S=>l.has(S.id)&&r.has(S.source.file)):[],c=s?n.filter(S=>i.has(S)):n,d=[],p=a?.reduce((S,N)=>S+N.observationIds.length,0)??0,m=performance.now(),y=ci(e,c,t.profileSpan);z(d,"direct-extraction",m,c.length,y.observations.length,{filesVisited:c.length,filesReused:o.length,factsReused:u.length,factsInvalidated:Math.max(0,p-u.length)});let v=[...o,...y.fileCoverage].sort((S,N)=>S.file.localeCompare(N.file)),f=yi(v),h=v.flatMap(S=>S.extractionErrors),g=ce([...u,...y.observations]);if(s&&!t.forceDerivedRebuild&&t.previousGraph&&Yr(a,y.fileCoverage,i)&&(!ri(e,t.previousGraph,i)||oi(a,y.fileCoverage,i)&&!si(t.previousGraph,i))){for(let N of t.previousGraph.coverage.extractors)f.has(N.id)||f.set(N.id,N);let S=ui(t.previousGraph.coverage.phases);return d.push(...S),{...t.previousGraph,observations:t.previousGraph.observations,relationGroups:t.previousGraph.relationGroups,links:t.previousGraph.links,frontiers:t.previousGraph.frontiers,coverage:{filesScanned:n.length,filesWithAst:v.filter(N=>N.hasAst).length,filesWithoutAst:v.filter(N=>!N.hasAst).length,filesReused:o.length,extractors:[...f.values()],extractionErrors:t.previousGraph.coverage.extractionErrors,phases:d},fileCoverage:v}}let R=ce([...g,...tn(g)]),x=s&&t.previousGraph!==void 0?Jr(t.previousGraph,a,y.fileCoverage,i,g):{reuse:!1,shapeUnchanged:!1,proofFilesUnchanged:!1,seedUnchanged:!1},b=x.reuse;t.profileSpan?.("runtime-boundaries.http-summary.reuse-decision",()=>{},x),m=performance.now();let C;if(b){let S=t.previousGraph.coverage.phases?.find(I=>I.id==="http-summary"),N=t.previousGraph.coverage.extractors.find(I=>I.id==="builtin.wrapper");C={observations:t.previousGraph.observations.filter(I=>I.extractor===on),frontiers:t.previousGraph.frontiers.filter(I=>I.kind==="call-resolution"&&I.action===_e.HTTP_REQUEST),summaries:0,filesInspected:S?.filesVisited??N?.applicableFiles??0,errors:t.previousGraph.coverage.extractionErrors.filter(I=>I.startsWith("builtin.http-summary failed"))},z(d,"http-summary",m,R.length,C.observations.length,{filesVisited:0,filesReused:C.filesInspected,factsReused:C.observations.length+C.frontiers.length,factsInvalidated:0}),N&&f.set(N.id,N)}else C=Yt(e,R,t.profileSpan),z(d,"http-summary",m,R.length,C.observations.length,{filesVisited:C.filesInspected}),f.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:C.filesInspected,observations:C.observations.length,errors:C.errors.length});h.push(...C.errors);let P=ce([...R,...C.observations]);m=performance.now();let w=qt(e,P);z(d,"http-mount",m,P.length,w.observations.length,{filesVisited:w.filesInspected});let F=ce([...P,...w.observations]);m=performance.now();let $=b&&t.previousGraph!==void 0&&Qr(t.previousGraph,a,y.fileCoverage,i),_;if($){let S=t.previousGraph.coverage.phases?.find(I=>I.id==="carrier"),N=t.previousGraph.coverage.extractors.find(I=>I.id==="builtin.carrier");_={observations:t.previousGraph.observations.filter(I=>I.extractor==="builtin.carrier"),bodySummaries:N?.applicableFiles??0,discriminatorSummaries:0,filesInspected:S?.filesVisited??0,errors:t.previousGraph.coverage.extractionErrors.filter(I=>I.startsWith("builtin.carrier"))},z(d,"carrier",m,F.length,_.observations.length,{filesVisited:0,filesReused:_.filesInspected,factsReused:_.observations.length,factsInvalidated:0}),N&&f.set(N.id,N)}else _=Mt(e,F,v.flatMap(S=>S.bodySummaries??[])),z(d,"carrier",m,F.length,_.observations.length,{filesVisited:_.filesInspected}),f.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:_.bodySummaries,observations:_.observations.length,errors:_.errors.length});h.push(..._.errors);let K=ce([...F,..._.observations]);m=performance.now();let J=gi(K);z(d,"relations",m,K.length,J.length),m=performance.now();let Qe=bi(K,J);z(d,"links",m,J.length,Qe.length),Si(K,J),m=performance.now();let et=Pe([...xi(K,J),...C.frontiers]);return z(d,"frontiers",m,K.length,et.length),{schemaVersion:2,extractorVersion:Ye,observations:K,relationGroups:J,links:Qe,frontiers:et,coverage:{filesScanned:n.length,filesWithAst:v.filter(S=>S.hasAst).length,filesWithoutAst:v.filter(S=>!S.hasAst).length,...s?{filesReused:o.length}:{},extractors:[...f.values()],extractionErrors:h,phases:d},fileCoverage:v}}function Yr(e,t,n){if(!e)return!1;let r=e.filter(a=>n.has(a.file)).filter(nn).map(rn).sort((a,s)=>a.file.localeCompare(s.file)),i=t.filter(nn).map(rn).sort((a,s)=>a.file.localeCompare(s.file));return JSON.stringify(r)===JSON.stringify(i)}function nn(e){return e.observationIds.length>0||e.extractionErrors.length>0}function rn(e){let{syntaxHash:t,shapeHash:n,bodySummaries:r,...i}=e;return i}function Jr(e,t,n,r,i){let a=ti(t,n,r),s=ni(e),l=![...sn(t,n)].some(p=>s.has(p)),u=new Set((t??[]).filter(p=>r.has(p.file)).flatMap(p=>p.observationIds)),c=new Set(n.flatMap(p=>p.observationIds)),d=an(e.observations,u)===an(i,c);return{reuse:a&&l&&d,shapeUnchanged:a,proofFilesUnchanged:l,seedUnchanged:d}}function sn(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 Qr(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=sn(t,n),o=ei(e,"builtin.carrier");return![...s].some(l=>o.has(l))}function ei(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 ti(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 ni(e){let t=new Set;for(let n of e.observations)if(n.extractor===on){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===_e.HTTP_REQUEST&&n.source&&t.add(n.source.file);return t}function an(e,t){return JSON.stringify(e.filter(n=>t.has(n.id)&&n.action===_e.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 ri(e,t,n){let r=ii(t),i=ai(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(d=>i.has(d.symbol)))return!0}return!1}function ii(e){let t=new Set;for(let n of e.observations)if(Je.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||!Je.has(n.action)||!n.source||t.add(n.source.file);return t}function ai(e){return new Set(e.observations.flatMap(t=>Je.has(t.action)&&t.owner.symbol?[t.owner.symbol]:[]))}function oi(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 si(e,t){let n=li(e);return[...t].some(r=>n.has(r))}function li(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 ui(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 z(e,t,n,r,i,a={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...a})}function ci(e,t,n){let r=[],i=[];for(let a of t){let s=it(e,a),o=Ue.filter(p=>p.supports(s)),l=/\bJSON\.stringify\s*\(/u.test(s)&&/\bbody\s*:/u.test(s),u=o.length>0||l?L(e,a,s,n):null,c=di(a,s),d={file:a,hasAst:u!==null||fi(a,s),syntaxHash:c.syntaxHash,shapeHash:c.shapeHash,bodySummaries:u&&l?Ht(u):[],observationIds:[],extractors:[],extractionErrors:[]};if(u)for(let p of o){let m={id:p.id,applicableFiles:1,observations:0,errors:0};try{let y=mi(n,`runtime-boundaries.extractor.${p.id}`,a,()=>p.extract(u));m.observations=y.length,r.push(...y),d.observationIds.push(...y.map(v=>v.id))}catch(y){m.errors=1,d.extractionErrors.push(`${p.id} failed for ${a}: ${y instanceof Error?y.message:String(y)}`)}d.extractors.push(m)}i.push(d)}return{observations:r,fileCoverage:i}}function di(e,t){if(!/\.(?:[cm]?[jt]sx?)$/iu.test(e)){let u=de("sha256").update(t).digest("hex");return{syntaxHash:u,shapeHash:u}}let n=/\.[jt]sx$/iu.test(e)?B.LanguageVariant.JSX:B.LanguageVariant.Standard,r=B.createScanner(B.ScriptTarget.Latest,!1,n,t),i=de("sha256"),a=de("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!==B.SyntaxKind.EndOfFileToken;u=r.scan()){if(u===B.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)===0&&(u=r.reScanTemplateToken(!1)),Kr.has(u))continue;let c=r.getTokenText();for(;o[l+1]!==void 0&&o[l+1]<=r.getTokenPos();)l+=1;i.update(String(u)),i.update("\0"),i.update(c),i.update("\0"),i.update(String(l)),i.update("\0"),a.update(String(u)),a.update("\0"),!Xr.has(u)&&!pi(u,c)&&a.update(c),a.update("\0"),a.update(String(l)),a.update("\0"),u===B.SyntaxKind.TemplateHead?s.push(0):u===B.SyntaxKind.TemplateTail?s.pop():u===B.SyntaxKind.OpenBraceToken&&s.length>0?s[s.length-1]+=1:u===B.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)>0&&(s[s.length-1]-=1)}return{syntaxHash:i.digest("hex"),shapeHash:a.digest("hex")}}function pi(e,t){if(e!==B.SyntaxKind.StringLiteral||t.length<2)return!1;let n=t.slice(1,-1);return n.startsWith("/")||n.includes("://")}function mi(e,t,n,r){return e?e(t,r,{file:n}):r()}function fi(e,t){return t?at(e)?/<script\b/iu.test(t):fe(e)!==null:!1}function yi(e){let t=new Map(Ue.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 hi(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function gi(e){let t=new Map;for(let n of $e){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=Ci(i,n.keyNames);if(!a)continue;let s=a.map(d=>`${d.name}=${un(d.name,d.value)}`).join("\0"),o=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${o}\0${s}`,u=`boundary-group:${de("sha256").update(l).digest("hex").slice(0,16)}`,c=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)&&c.producerIds.push(i.id),n.consumerActions.includes(i.action)&&c.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&c.declarationIds.push(i.id),c.derivation.inputFactIds.push(i.id),c.derivation.sourceSpans.push(i.source),t.set(u,c)}}return[...t.values()].map(vi).sort(Bi)}function vi(e){return{...e,producerIds:Fe(e.producerIds),consumerIds:Fe(e.consumerIds),declarationIds:Fe(e.declarationIds),derivation:{...e.derivation,inputFactIds:Fe(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function bi(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let a=$e.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>Zr))for(let o of s)for(let l of i.consumerIds){let u=n.get(o),c=n.get(l);if(!u||!c||Ni(u,c))continue;let d=u.strength==="derived"||c.strength==="derived"?"derived":"exact",p=`${i.joinRule}\0${o}\0${l}`,m={id:`boundary-link:${de("sha256").update(p).digest("hex").slice(0,16)}`,from:o,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:d,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[o,l],sourceSpans:[u.source,c.source]}};r.set(m.id,m)}}return[...r.values()].sort(Ii)}function Si(e,t){let n=new Set(t.filter(ln).flatMap(Te)),r=new Set(t.filter(Ri).flatMap(Te));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function xi(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(Te)),i=new Set(t.filter(ln).flatMap(Te));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 Te(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function ln(e){let t=$e.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 Ri(e){let t=$e.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 Ci(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:un(r,i.value)})}return n}function un(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 Ni(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function ce(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 Fe(e){return[...new Set(e)].sort()}function Bi(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function Ii(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}export{ge as a,V as b,qe as c,se as d,Ye as e,Wr as f,dn as g,pn as h,ht as i};
|
|
57
|
+
//# sourceMappingURL=chunk-ANCHW2R4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-YBWE6J32.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-AQF35NGT.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as x}from"./chunk-GBZCVYWA.js";import{C as b}from"./chunk-C7WSQA6A.js";import{C as p}from"./chunk-JSHDCVUM.js";var y=new Set(["call","call_expression","command","command_call","function_call_expression","invocation_expression","macro_invocation","method_call","method_invocation","new_expression","object_creation_expression"]);function h(e,t,n,r){if(!Number.isSafeInteger(n)||n<0)return null;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`contextLines must be a non-negative safe integer; received ${r}`);let i=p(e,t);if(i.length===0||n>=i.length)return null;let o=Math.max(0,n-r),c=Math.min(i.length-1,n+r);return{relativePath:t,startLine:o,endLine:c,focusLine:n,source:i.slice(o,c+1).join(`
|
|
2
|
+
`)}}function F(e,t,n,r,i){let o=h(e,t,n,r);if(!o)return null;let c=b(e,t)?.rootNode??null;if(!c)return{...o,kind:"bounded-context"};let s=_(c,n,i);if(s.length!==1)return{...o,kind:s.length===0?"non-call-reference":"bounded-context"};let l=s[0],a=p(e,t),u=Math.max(0,l.startPosition.row),S=l.endPosition.column===0?l.endPosition.row-1:l.endPosition.row,d=Math.min(a.length-1,Math.max(u,S));return{relativePath:t,startLine:u,endLine:d,focusLine:n,source:a.slice(u,d+1).join(`
|
|
3
|
+
`),kind:"complete-call-expression"}}function L(e,t,n,r,i){if(!Number.isSafeInteger(i)||i<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${i}`);let o=p(e,t);if(o.length===0||n<0||n>=o.length)return null;let c=Math.min(o.length-1,r,n+i-1);return{relativePath:t,startLine:n,endLine:c,focusLine:n,source:o.slice(n,c+1).join(`
|
|
4
|
+
`)}}function k(e,t,n,r,i=6){if(!Number.isSafeInteger(r)||r<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${r}`);let o=p(e,t);if(o.length===0||n<0||n>=o.length)return null;let c=x(e,t,n);if(!c){let m=h(e,t,n,i);return m?{...m,unitType:null,unitStartLine:m.startLine,unitEndLine:m.endLine,omittedLines:0}:null}let s=c.startLine,l=c.endLine,a=l-s+1,u=Math.min(a,r),S=n-s-Math.floor(u/2),d=Math.max(0,Math.min(a-u,S)),f=s+d,g=f+u-1;return{relativePath:t,startLine:f,endLine:g,focusLine:n,source:o.slice(f,g+1).join(`
|
|
5
|
+
`),unitType:c.type,unitStartLine:s,unitEndLine:l,omittedLines:a-u}}function _(e,t,n){let r=[];return N(e,t,n,r),r.filter(i=>!r.some(o=>o!==i&&o.startIndex>=i.startIndex&&o.endIndex<=i.endIndex))}function N(e,t,n,r){if(M(e,t)){y.has(e.type)&&w(e)===n&&r.push(e);for(let i of e.namedChildren)N(i,t,n,r)}}function w(e){let t=e.childForFieldName("function")??e.childForFieldName("constructor")??e.childForFieldName("method")??e.childForFieldName("name")??e.namedChild(0);return t?t.text.match(/[\p{L}_$][\p{L}\p{N}_$!?-]*/gu)?.at(-1)??null:null}function M(e,t){return e.startPosition.row<=t&&e.endPosition.row>=t}export{h as a,F as b,L as c,k as d};
|
|
6
|
+
//# sourceMappingURL=chunk-ARGPDW2Y.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{d as z}from"./chunk-KK7GPALL.js";import{d as y}from"./chunk-7MUHSZGN.js";import{A as $,c as E,e as b,t as O}from"./chunk-7Z4GMCHM.js";import{a as A,b as F,l as L,w as R}from"./chunk-6LS3IG2I.js";import{M as v,z as T}from"./chunk-C7WSQA6A.js";import{c as h,d as k,z as p}from"./chunk-JSHDCVUM.js";import{b as P,d as g}from"./chunk-WEXQYJY3.js";function _(e,n,t,r={}){if(!t)return[];let i=p(e,n);return i?i.indexOf(t)===-1?[]:(N(e,n).get(t)??[]).filter(s=>!X(s,r)):[]}function X(e,n){return typeof n.excludeStartLine=="number"&&typeof n.excludeEndLine=="number"&&e>=n.excludeStartLine&&e<=n.excludeEndLine}var q=h("file-identifiers",{clearGroups:["whole-project","source-file"]});function B(e,n){let t=L(e,n);return t?t.fileIdentifiers:q.get(e,n,()=>new Set(N(e,n).keys()))}var K=h("file-ident-lines",{clearGroups:["whole-project","source-file"]});function N(e,n){let t=L(e,n);return t?t.identifierLineMap:K.get(e,n,()=>ee(e,n))}var Q=h("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function Re(e,n){let t=L(e,n);return t?t.identifiersByLine:Q.get(e,n,()=>{let r=N(e,n),i=0;for(let s of r.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of r)for(let a of c)o[a].add(s);return o})}function ee(e,n){let t=new Map,r=(c,a)=>{let l=t.get(c);if(!l){t.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=p(e,n);if(!i)return t;let o=F(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&r(l[1],c)}return t}function we(e,n){let t=j(e);return t?n.filter(r=>j(r.file)===t):n}function De(e,n,t,r,i){let o=R(e,n);if(r){let f=i?.match(/^[A-Za-z_$][\w$]*/u)?.[0];if(!f)return null;let d=new Set(o.filter(u=>u.localName===f||u.importedName===f).map(u=>u.sourcePath).filter(u=>!!u));for(let u of t)for(let S of d)if(g(S,u.file))return u;if(f==="this"||f==="self"||f==="cls"){let u=t.filter(S=>S.file===n&&E(S.symbol)!==null);if(u.length===1)return u[0]}let m=te(p(e,n)??"",f);if(m.size===0)return null;let V=new Set(o.filter(u=>m.has(u.localName??u.importedName)).map(u=>u.sourcePath).filter(u=>!!u)),D=t.filter(u=>m.has(E(u.symbol)??"")&&(u.file===n||[...V].some(S=>g(S,u.file))));return D.length===1?D[0]:null}let s=t.filter(f=>E(f.symbol)===null),c=s.find(f=>f.file===n);if(c)return c;let a=b(t[0].symbol),l=o.filter(f=>f.kind!=="namespace"&&f.kind!=="side-effect"&&(f.localName===a||f.localName===null&&f.importedName===a));if(l.length>0){let f=s.filter(d=>l.some(m=>m.sourcePath!==null&&g(m.sourcePath,d.file)));return f.length===1?f[0]:null}return s.length===1?s[0]:null}function te(e,n){let t=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new Set,i=[new RegExp(`\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*)`,"gu"),new RegExp(`\\b${t}\\s*=\\s*(?:new\\s+)?([A-Za-z_$][\\w$]*)\\s*\\(`,"gu")];for(let o of i)for(let s of e.matchAll(o))r.add(s[1]);return r.size===1?r:new Set}function j(e){let n=T(e);return n?n==="typescript"||n==="tsx"||n==="javascript"?"javascript-family":n:null}var ne=k("global-leaf-index",{clearGroups:["whole-project"]});function M(e){return ne.get(e,()=>{let n=e.all(`SELECT gs.id, gs.symbol,
|
|
2
|
+
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
3
|
+
FROM global_symbols gs
|
|
4
|
+
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
5
|
+
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
6
|
+
LEFT JOIN (
|
|
7
|
+
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
8
|
+
FROM mentions m
|
|
9
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
+
JOIN documents d ON c.document_id = d.id
|
|
11
|
+
WHERE m.role = 1
|
|
12
|
+
GROUP BY m.symbol_id
|
|
13
|
+
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
14
|
+
WHERE 1 = 1
|
|
15
|
+
${e.symbolNoiseFor("gs")}`),t=new Map;for(let r of n){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=b(r.symbol);if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.some(s=>s.symbolId===r.id)||o.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return t})}var re=h("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function Z(e,n){let t=P(n);return re.get(e,t,()=>ie(e,t))}function ie(e,n){let t=new Map;for(let r of R(e,n)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&G(t,i,r.sourcePath),r.kind==="namespace")for(let o of r.usedMembers)G(t,o,r.sourcePath)}return t}function G(e,n,t){let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var H=/[A-Za-z_$][A-Za-z0-9_$]*/g,U=/^[A-Za-z_$][A-Za-z0-9_$]*$/,oe=512;function C(e){let n=[],t=!1;for(let r of e)r&&(t=!0,U.test(r)||n.push(r));return{candidateNames:e,hasUsableCandidate:t,nonIdentifierNames:n}}function J(e,n){let t=se(n)?n:C(n);if(t.candidateNames.size===0||!t.hasUsableCandidate)return!0;if(t.candidateNames.size<=oe){for(let i of t.candidateNames)if(i){if(U.test(i)){if(ae(i).test(e))return!0;continue}if(e.includes(i))return!0}return!1}H.lastIndex=0;let r;for(;(r=H.exec(e))!==null;)if(t.candidateNames.has(r[0]))return!0;for(let i of t.nonIdentifierNames)if(e.includes(i))return!0;return!1}function se(e){return"candidateNames"in e}function ae(e){return new RegExp(`(?<![A-Za-z_$0-9])${A(e)}(?![A-Za-z_$0-9])`)}function w(e,n,t){let r=M(e).get(t);if(!r||r.length===0)return[];if(r.length===1)return[I(r[0])];let i=r.filter(a=>a.file===n);if(i.length>0)return i.map(I);let o=Z(e,n),s=o.get(t);if(s)for(let a of s){let l=r.filter(f=>g(a,f.file));if(l.length>0)return l.map(I)}let c=new Set;for(let a of o.values())for(let l of a)c.add(l);for(let a of c){let l=r.filter(f=>g(a,f.file));if(l.length>0&&l.length===r.length)return l.map(I)}return[]}function Ve(e,n,t){let r=w(e,n,t);if(r.length>0)return r;let i=M(e).get(t);return!i||i.length===0?[]:i.map(I)}function Y(e,n,t={}){let r=ce(e,n);if(!r)return[];let i=y(e,n);if(t.semantic!==!1&&t.semanticEvidence){let s=t.semanticEvidence.references(e,{...i,leaf:r.identifier,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let c=new Map;for(let a of s){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return x(e,c)}}let o=new Map;for(let s of v(e)){let c=le(e,r,s);c.length>0&&o.set(s,c)}return x(e,o)}function ce(e,n){let t=y(e,n);if(!t)return null;let r=b(t.symbol);return r?{symbolId:t.symbolId,relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,identifier:r}:null}function le(e,n,t){let r=p(e,t);return!r||r.indexOf(n.identifier)===-1?[]:t!==n.relativePath&&!w(e,t,n.identifier).some(o=>o.symbolId===n.symbolId)?[]:_(e,t,n.identifier,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{})}function Xe(e,n,t={}){let r=new Map;for(let a of n){if(!a.leaf)continue;let l=r.get(a.leaf)??[];l.push(a),r.set(a.leaf,l)}if(r.size===0)return new Map;let i=new Set(n.map(a=>a.symbolId)),o=new Set(r.keys()),s=C(o),c=new Map;for(let a of v(e)){if(t.skipPath?.(a)||!J(p(e,a),s))continue;let l=B(e,a);if(l.size!==0){for(let f of l)if(r.has(f))for(let d of w(e,a,f)){if(!i.has(d.symbolId)||a===d.relativePath)continue;let m=c.get(d.symbolId);m||(m=new Set,c.set(d.symbolId,m)),m.add(a)}}}return c}function I(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function x(e,n){let t=[],r=new Set;for(let[i,o]of n){let s=O(e,i);for(let c of o){let a=$(s,c),l=`${i}|${c}|${a?.symbol??""}`;r.has(l)||(r.add(l),t.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return t}function fe(e,n){return ue(e,[n]).get(n.symbolId)??[]}function ue(e,n){let t=n.map(o=>({symbolId:o.symbolId,prelude:Se(e,o)})).filter(o=>o.prelude!==null),r=pe(e,t.map(o=>o.symbolId)),i=new Map;for(let{symbolId:o,prelude:s}of t){let c=de(e,r.get(o)??new Map,s.match,s.identifier);i.set(o,x(e,c))}return i}function rt(e,n,t={}){return me(e,n,t).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function me(e,n,t={}){let r=Y(e,n,{semantic:t.semantic,semanticEvidence:t.semanticEvidence}),i=r.length>0?W(r,"source-attribution"):W(fe(e,n),"scip-reference-chunk");return t.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function W(e,n){return e.map(t=>({...t,provenance:n}))}function de(e,n,t,r){let i=new Map;for(let[o,s]of n)i.set(o,ge(e,o,s,t,r));return i}function pe(e,n){let t=new Map;for(let r of z(e,n)){if(e.isIgnored(r.relative_path))continue;let i=t.get(r.symbol_id);i||(i=new Map,t.set(r.symbol_id,i));let o=i.get(r.relative_path);o||(o=[],i.set(r.relative_path,o)),o.push({start_line:r.chunk_start,end_line:r.chunk_end})}return t}function ge(e,n,t,r,i){let o=n===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?_(e,n,i,o):[];return t.flatMap(c=>be(s,c))}function be(e,n){let t=e.filter(r=>r>=n.start_line&&r<=n.end_line);return t.length>0?t:[n.start_line]}function Se(e,n){let t=y(e,n);return t?{match:t,identifier:b(t.symbol)||null}:null}export{_ as a,N as b,Re as c,we as d,De as e,M as f,C as g,J as h,Z as i,w as j,Ve as k,Xe as l,fe as m,ue as n,rt as o,me as p};
|
|
16
|
+
//# sourceMappingURL=chunk-B3AREUQK.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as b,b as y}from"./chunk-JGMD6JGB.js";import{a as R,b as H,c as B,e as h,f as k}from"./chunk-B3X6KU75.js";import{a as p,b as g}from"./chunk-KMVGRIO2.js";import{O as v}from"./chunk-C7WSQA6A.js";function V(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:i=6,limit:o=20,scope:c,scanLimit:n,filePattern:d,focusFiles:f}=s,l=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,i),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),t=b(l,r=>r.tokens);return y({profiles:l,limit:o,filePattern:d,focusFiles:f,candidateIndex:t,profile:{name:"react-hook-candidates"},compare:(r,a)=>C(r,a,m,i),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.componentA.localeCompare(a.componentA)||r.fileB.localeCompare(a.fileB)||r.componentB.localeCompare(a.componentB)})}function C(e,s,m,i){let o=p(e.tokens,s.tokens);if(o.size<i||!E(o))return null;let c=H(e.tokens,s.tokens);if(c<m)return null;let n=h(o,"hook:"),d=h(o,"react-hook:"),f=h(o,"effect:"),l=h(o,"state:"),t=h(o,"request:"),r=h(o,"handler:"),a=h(o,"handler-verb:"),u=A({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:k(o),sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){return R({genericWords:q,stripPrefixes:w,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:S})}function S(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,m=0,i=0,o=0,c=0,n=0,d=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?m+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?c+=1:t.startsWith("state:")?n+=1:t.startsWith("state-hook:")&&(d+=1);let f=n+d,l=s+m+i+o+c+f;return B([{name:"requests",count:o},{name:"customHooks",count:s},{name:"namedStates",count:n},{name:"handlers",count:c},{name:"effects",count:i},{name:"reactHooks",count:m},{name:"namedBehavior",count:l}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var q=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),w=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BCTCADNB.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as b}from"./chunk-3TNRNKAT.js";import{a as D}from"./chunk-OFZVFIDF.js";import{a as F,b as S,d as C}from"./chunk-SRIZDEWX.js";import{c as P}from"./chunk-PJBYDCBQ.js";import{a as I}from"./chunk-ZMS4YCY7.js";import{b as M}from"./chunk-T2PBOVDI.js";import{c as g}from"./chunk-DRENNWRG.js";function re(e,n={}){let t=new C(e).productionCallableDefinitions({scope:n.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=L(e,t),l=n.search?.trim().toLocaleLowerCase();return t.map(s=>j(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!l||T(s).includes(l)).sort(G)}function ie(e,n,o={}){let t=M(e,n);if(!t.match)return{kind:"missing",query:n};if(t.total>1)return{kind:"ambiguous",query:n,total:t.total,candidates:[{symbol:t.match.symbol,shortName:g(t.match.symbol),relativePath:t.match.relativePath,startLine:t.match.startLine},...t.candidates]};let r=new C(e),l=r.definitionsForFile(t.match.relativePath).find(a=>a.symbol===t.match.symbol);if(!l?.isFunctionLike)return{kind:"not-entry",query:n,symbol:t.match.symbol,shortName:g(t.match.symbol),file:t.match.relativePath,reason:"The resolved symbol is not a callable definition."};let s=L(e,[l]),f=j(e,l,s.get(l.symbolId)??[]);if(!f)return{kind:"not-entry",query:n,symbol:l.symbol,shortName:g(l.symbol),file:l.relativePath,reason:"The callable is neither an external root nor an uncalled callable on a detected entry surface."};let m=K(e,r,l),i=new Set(o.expand??[]),c=z(m,i),d=new Set(c.regions.filter(a=>a.expanded).map(a=>a.id)),p=[...i].filter(a=>!d.has(a)).sort();return{kind:"matched",query:n,entry:f.result,regions:c.regions,regionEdges:c.regionEdges,unmatchedExpansions:p,coverage:{completeWithinIndexedStaticCallEdges:!0,completeWithinSelectedStaticEvidence:!0,candidateReachabilityIncluded:m.edges.some(a=>a.evidenceStrength==="candidate"),dynamicDispatchRepresented:!1,symbolCount:m.symbols.length,symbolEdgeCount:m.edges.length,exactSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="exact").length,candidateSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="candidate").length,regionCount:c.regions.length,regionEdgeCount:c.regionEdges.length,externalCallCount:m.externalCalls.length}}}function L(e,n){let o=n.filter(t=>B(e,t.relativePath)||S(e,t.symbol,t.relativePath).length>0);return P(e,o,{semantic:!1,semanticEvidence:I})}function j(e,n,o){let t=$(e,n),r=t.length>0,l=B(e,n.relativePath)&&o.length===0;if(!r&&!l)return null;let s=[...t];return l&&s.push("entry-surface-without-indexed-caller"),{definition:n,result:{symbol:n.symbol,shortName:g(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,documentation:n.documentation,confidence:r?"root":"candidate",evidence:s,indexedCallerCount:o.length}}}function B(e,n){return F(e,n)||/(?:^|\/)entry\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(n)}function $(e,n){let o=S(e,n.symbol,n.relativePath),t=[];return w(o,["package-surface-file","transitive-package-surface"])&&D(e,n)&&t.push("package-public-export"),o.includes("rust-public-library")&&t.push("rust-public-library"),o.includes("framework-entrypoint")&&t.push("framework-dispatched-export"),w(o,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&t.push("configured-entry-root"),t}function w(e,n){return n.some(o=>e.includes(o))}function T(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
|
|
2
|
+
`).toLocaleLowerCase()}function G(e,n){return N(e.confidence)-N(n.confidence)||e.file.localeCompare(n.file)||e.startLine-n.startLine||e.symbol.localeCompare(n.symbol)}function N(e){return e==="root"?0:1}function K(e,n,o){let t=new Map([[o.symbol,0]]),r=new Map,l=new Map([[o.symbol,o]]),s=new Map,f=new Map,m=[o];for(;m.length>0;){let i=n.calleeMap(m,{additive:!1,semantic:!1}),c=[];for(let d of m){let p=t.get(d.symbol)??0;r.set(d.symbol,k(d,p));for(let a of i.get(d.symbolId)??[]){let y=W(n,a,l);if(!y){let R=O(d,a);f.set(J(R),R);continue}let u=p+1,h=t.get(y.symbol);(h===void 0||u<h)&&t.set(y.symbol,u),r.set(y.symbol,k(y,Math.min(u,h??u)));let v=q(d,y,a);s.set(H(v),v),h===void 0&&c.push(y)}}m=c}return{symbols:[...r.values()].sort(Q),edges:[...s.values()].sort(U),externalCalls:[...f.values()].sort(V)}}function W(e,n,o){let t=o.get(n.symbol);if(t)return t;let r=e.definitionsForFile(n.file).find(l=>l.symbol===n.symbol)??null;return r&&o.set(r.symbol,r),r}function k(e,n){return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,depth:n}}function q(e,n,o){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),toFile:n.relativePath,source:o.source,evidenceStrength:o.source==="scip-chunk"?"candidate":"exact"}}function O(e,n){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),reportedFile:n.file,source:n.source,evidenceStrength:n.source==="scip-chunk"?"candidate":"exact"}}function z(e,n){let o=b(e.symbols,i=>i.file),t=b(e.edges.filter(i=>i.fromFile===i.toFile),i=>i.fromFile),r=b(e.externalCalls,i=>i.fromFile),l=A(e.edges.filter(i=>i.fromFile!==i.toFile)),s=b(l,i=>i.toRegionId),f=b(l,i=>i.fromRegionId);return{regions:[...o.entries()].map(([i,c])=>{let d=x(i),p=n.has(d),a=t.get(i)??[],y=r.get(i)??[];return{id:d,file:i,minDepth:Math.min(...c.map(u=>u.depth)),symbolCount:c.length,internalEdgeCount:a.length,externalCallCount:y.length,incomingRegionIds:E((s.get(d)??[]).map(u=>u.fromRegionId)),outgoingRegionIds:E((f.get(d)??[]).map(u=>u.toRegionId)),expanded:p,symbols:p?c:[],internalEdges:p?a:[],externalCalls:p?y:[]}}).sort((i,c)=>i.minDepth-c.minDepth||i.file.localeCompare(c.file)),regionEdges:l}}function A(e){let n=new Map;for(let o of e){let t=`${o.fromFile}\0${o.toFile}`,r=n.get(t)??[];r.push(o),n.set(t,r)}return[...n.values()].map(o=>{let t=o[0];return{fromRegionId:x(t.fromFile),fromFile:t.fromFile,toRegionId:x(t.toFile),toFile:t.toFile,callCount:o.length,exactCallCount:o.filter(r=>r.evidenceStrength==="exact").length,candidateCallCount:o.filter(r=>r.evidenceStrength==="candidate").length,fromSymbols:E(o.map(r=>r.fromShortName)),toSymbols:E(o.map(r=>r.toShortName)),evidence:E(o.map(r=>r.source))}}).sort((o,t)=>o.fromFile.localeCompare(t.fromFile)||o.toFile.localeCompare(t.toFile))}function x(e){return`file:${e}`}function E(e){return[...new Set(e)].sort()}function H(e){return`${e.fromSymbol}\0${e.toSymbol}`}function J(e){return`${e.fromSymbol}\0${e.toSymbol}`}function Q(e,n){return e.depth-n.depth||e.file.localeCompare(n.file)||e.symbol.localeCompare(n.symbol)}function U(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}function V(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}export{re as a,ie as b};
|
|
3
|
+
//# sourceMappingURL=chunk-BM4OTGSY.js.map
|