scip-query 0.20.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/README.md +255 -884
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-CI3O6PQG.js +2 -0
- package/dist/call-graph-6QTUTXH7.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-7PIO7NKH.js → chunk-2COFMIVK.js} +2 -2
- package/dist/chunk-2H4IAJHO.js +2 -0
- package/dist/chunk-2I3RSUWX.js +16 -0
- package/dist/chunk-2RP27XLR.js +2 -0
- package/dist/chunk-2ZBMOQGG.js +3 -0
- package/dist/{chunk-HX4GQPZP.js → chunk-32A42O5B.js} +3 -3
- package/dist/chunk-35ELD3RM.js +2 -0
- package/dist/chunk-35IW3P4H.js +2 -0
- package/dist/{chunk-DQGFVPUV.js → chunk-3653GTR7.js} +3 -3
- package/dist/chunk-3EX7DNBC.js +2 -0
- package/dist/chunk-3FQ3KMCD.js +2 -0
- package/dist/{chunk-5E4WNAVD.js → chunk-3PII3JI5.js} +2 -2
- package/dist/chunk-3TNRNKAT.js +2 -0
- package/dist/chunk-3VLJ2DCA.js +2 -0
- package/dist/{chunk-XSRF6Q77.js → chunk-46JLFIGA.js} +2 -2
- package/dist/chunk-4DCKBY6T.js +5 -0
- package/dist/chunk-4EXFZP6H.js +2 -0
- package/dist/chunk-4IIMPWMR.js +29 -0
- package/dist/chunk-4ILHWBYF.js +2 -0
- package/dist/chunk-4N6QSEMZ.js +10 -0
- package/dist/chunk-4OE2JO6I.js +2 -0
- package/dist/{chunk-7BAVHKMJ.js → chunk-4S4DF62J.js} +9 -9
- package/dist/chunk-4UUCUASK.js +554 -0
- package/dist/chunk-5236NQV3.js +2 -0
- package/dist/chunk-54EOGFBR.js +2 -0
- package/dist/{chunk-LY4WC4AD.js → chunk-5H7IWVXJ.js} +2 -2
- package/dist/chunk-5IZTXSOL.js +117 -0
- package/dist/{chunk-AZJQQKDD.js → chunk-5SE323LF.js} +2 -2
- package/dist/chunk-5ZJH6DDE.js +2 -0
- package/dist/chunk-63MBA7EG.js +3 -0
- package/dist/chunk-6BJ7SOY7.js +2 -0
- package/dist/chunk-6GJAP4OE.js +2 -0
- package/dist/chunk-6IEVHGWG.js +26 -0
- package/dist/chunk-6SWA6B24.js +7 -0
- package/dist/chunk-6T7H2AFY.js +3 -0
- package/dist/chunk-73Z33VFI.js +4 -0
- package/dist/chunk-7COHFNJK.js +38 -0
- package/dist/chunk-7HU2IJ2T.js +3 -0
- package/dist/chunk-7IOAZRVL.js +60 -0
- package/dist/chunk-7KCZELVM.js +2 -0
- package/dist/chunk-7PPYXENX.js +2 -0
- package/dist/chunk-7TWP3MCP.js +2 -0
- package/dist/chunk-AA7K3XLM.js +21 -0
- package/dist/chunk-AJVMVE7X.js +7 -0
- package/dist/chunk-ANWGXPPN.js +4 -0
- package/dist/chunk-APLKXICZ.js +3 -0
- package/dist/{chunk-JDOEX4E6.js → chunk-AQDWTCDC.js} +2 -2
- package/dist/chunk-AUP6YI5M.js +2 -0
- package/dist/chunk-B7ECWJAZ.js +2 -0
- package/dist/{chunk-ZHXX42OH.js → chunk-BATIVRU2.js} +4 -4
- package/dist/chunk-BBEDPVPB.js +4 -0
- package/dist/chunk-BBWPOMGU.js +2 -0
- package/dist/chunk-BD6CV7PN.js +2 -0
- package/dist/{chunk-XKWKXZKW.js → chunk-BHE44MHT.js} +2 -2
- package/dist/chunk-BOJ5SVE2.js +2 -0
- package/dist/chunk-BZYSGZRK.js +2 -0
- package/dist/chunk-CA5RE6H7.js +2 -0
- package/dist/chunk-CKDOY6JA.js +2 -0
- package/dist/chunk-CN2WGM7D.js +2 -0
- package/dist/chunk-COTMS5KM.js +3 -0
- package/dist/chunk-CSDDOUA4.js +3 -0
- package/dist/chunk-CT5SI2I4.js +2 -0
- package/dist/chunk-D5EKVZPI.js +2 -0
- package/dist/{chunk-FKSELJQF.js → chunk-D5W4UZY5.js} +2 -2
- package/dist/{chunk-RUJURYSV.js → chunk-DEUGHURX.js} +2 -2
- package/dist/chunk-DHKBIOXF.js +7 -0
- package/dist/chunk-DMQ7ZKJG.js +81 -0
- package/dist/chunk-DMUGTKMD.js +2 -0
- package/dist/chunk-DOPCR5BY.js +2 -0
- package/dist/chunk-DRENNWRG.js +2 -0
- package/dist/chunk-E4EJBGDZ.js +2 -0
- package/dist/chunk-E7BJXRNV.js +2 -0
- package/dist/chunk-EA4SH4U5.js +5 -0
- package/dist/{chunk-L7AW2QB5.js → chunk-EKZRF57O.js} +2 -2
- package/dist/chunk-ELNRLMC5.js +29 -0
- package/dist/chunk-F4FNK44D.js +2 -0
- package/dist/chunk-F7WQ337U.js +308 -0
- package/dist/chunk-FEQIQ26E.js +2 -0
- package/dist/chunk-FGB567HK.js +23 -0
- package/dist/chunk-FHV7NMFU.js +29 -0
- package/dist/chunk-FN6EJM6Q.js +2 -0
- package/dist/chunk-FTSQNONX.js +2 -0
- package/dist/chunk-FUG6RPYY.js +6 -0
- package/dist/chunk-G2F6T5BV.js +2 -0
- package/dist/chunk-G6OGPXJW.js +9 -0
- package/dist/chunk-GFLTPNWV.js +3 -0
- package/dist/chunk-GTDP2SKQ.js +2 -0
- package/dist/chunk-H46QMB7E.js +2 -0
- package/dist/chunk-H5EXS3HM.js +2 -0
- package/dist/chunk-HEOMG7IM.js +8 -0
- package/dist/chunk-HG5YI7PV.js +2 -0
- package/dist/{chunk-7SQQWSY3.js → chunk-HGKEAP7F.js} +2 -2
- package/dist/chunk-HUZNZ3H2.js +2 -0
- package/dist/chunk-HWLCBKFE.js +2 -0
- package/dist/chunk-I3U2FN2T.js +13 -0
- package/dist/{chunk-JAYYFEQY.js → chunk-I7PFL5P3.js} +2 -2
- package/dist/{chunk-2HPVVXM5.js → chunk-ICHBVITH.js} +2 -2
- package/dist/chunk-ICUQONOG.js +38 -0
- package/dist/chunk-IDPLC3FI.js +5 -0
- package/dist/{chunk-A73XVBCR.js → chunk-IGKKTHJR.js} +2 -2
- package/dist/chunk-IOKWFRFQ.js +4 -0
- package/dist/chunk-IPAL6DP2.js +3 -0
- package/dist/chunk-IUJ3ZFEE.js +7 -0
- package/dist/chunk-IXJ26KJJ.js +16 -0
- package/dist/chunk-IYV2YBHM.js +2 -0
- package/dist/chunk-JVZNWJBH.js +2 -0
- package/dist/chunk-K5MZYZV7.js +3 -0
- package/dist/{chunk-3G66UZBH.js → chunk-KFK7GF5C.js} +2 -2
- package/dist/chunk-KTRGJLY7.js +18 -0
- package/dist/chunk-KW6B5OL4.js +2 -0
- package/dist/chunk-KWARB5FZ.js +2 -0
- package/dist/chunk-LHTT5C3Z.js +2 -0
- package/dist/chunk-LPGDO2XA.js +3 -0
- package/dist/chunk-LXLD46LH.js +21 -0
- package/dist/chunk-MEI3PTUK.js +2 -0
- package/dist/chunk-MJNV7OCG.js +5 -0
- package/dist/chunk-MO226P4Q.js +4 -0
- package/dist/{chunk-3CLX5EOX.js → chunk-MOBF2GH6.js} +2 -2
- package/dist/chunk-MXNGIEPU.js +3 -0
- package/dist/chunk-MYUKI5VN.js +4 -0
- package/dist/{chunk-TFRAYKN6.js → chunk-N5C65OFK.js} +2 -2
- package/dist/{chunk-PXY7F6Y4.js → chunk-O2RM7E7L.js} +5 -5
- package/dist/chunk-OFUBXBYX.js +3 -0
- package/dist/chunk-OFY4HTMI.js +2 -0
- package/dist/chunk-OIRWZIYL.js +38 -0
- package/dist/chunk-OIVZ7PW6.js +438 -0
- package/dist/chunk-ORBKAUCH.js +4 -0
- package/dist/chunk-OUB4J26T.js +2 -0
- package/dist/chunk-OVPS2ILI.js +20 -0
- package/dist/chunk-PHSPBQM6.js +5 -0
- package/dist/{chunk-JVYA47YU.js → chunk-PIZY2GX6.js} +2 -2
- package/dist/chunk-PNISDVYC.js +3 -0
- package/dist/chunk-PQOL42AW.js +2 -0
- package/dist/chunk-PUVZNFVY.js +11 -0
- package/dist/chunk-PZEI2TVL.js +4 -0
- package/dist/{chunk-ZK26BAQL.js → chunk-Q2J2VZZT.js} +2 -2
- package/dist/chunk-Q7HB7BFJ.js +2 -0
- package/dist/{chunk-ZTETIQ35.js → chunk-QBANU5BQ.js} +2 -2
- package/dist/chunk-QD7IFBCR.js +10 -0
- package/dist/chunk-QDCCHMVZ.js +2 -0
- package/dist/chunk-QLQBZOJH.js +3 -0
- package/dist/{chunk-PQCI4SQX.js → chunk-QXR5QPSF.js} +2 -2
- package/dist/chunk-R2MOKIVO.js +2 -0
- package/dist/{chunk-EN3O7VJA.js → chunk-RFWAUHVW.js} +2 -2
- package/dist/chunk-RGCJ4646.js +16 -0
- package/dist/{chunk-BPAPWKP6.js → chunk-S3RTPPLQ.js} +8 -8
- package/dist/chunk-S73HBCGI.js +11 -0
- package/dist/chunk-SDPA5DKN.js +210 -0
- package/dist/chunk-SEUJVWT2.js +3 -0
- package/dist/chunk-SF7X6QNW.js +2 -0
- package/dist/chunk-SKUMCCC5.js +2 -0
- package/dist/chunk-SSSJO4RG.js +2 -0
- package/dist/chunk-SWFAFA4G.js +49 -0
- package/dist/chunk-SYUNTKO2.js +2 -0
- package/dist/chunk-T6FRID7Y.js +3 -0
- package/dist/chunk-TGWNNMPF.js +3 -0
- package/dist/chunk-TM5XEDDR.js +4 -0
- package/dist/chunk-TNOHGHZQ.js +2 -0
- package/dist/chunk-U2GPTA5U.js +3 -0
- package/dist/{chunk-SXP2MBJH.js → chunk-U7DR7MJD.js} +2 -2
- package/dist/chunk-U7LRSQG6.js +3 -0
- package/dist/chunk-UL4VJUMD.js +2 -0
- package/dist/chunk-UNORWZIJ.js +16 -0
- package/dist/chunk-UQ7XPRWU.js +2 -0
- package/dist/{chunk-6SHPK5ZE.js → chunk-URMZLV2N.js} +2 -2
- package/dist/chunk-URTX2BEA.js +6 -0
- package/dist/chunk-UZFCZ7SJ.js +2 -0
- package/dist/{chunk-KMKTIO2G.js → chunk-V7LQZTTZ.js} +2 -2
- package/dist/chunk-VETXXOYU.js +3 -0
- package/dist/chunk-VGRUM7JI.js +3 -0
- package/dist/{chunk-WXZLAAWK.js → chunk-VNKYRJKN.js} +2 -2
- package/dist/chunk-VWLIOEEF.js +11 -0
- package/dist/chunk-WB6LGCFB.js +6 -0
- package/dist/{chunk-W4ETQAXM.js → chunk-WK4FD4PG.js} +2 -2
- package/dist/{chunk-O64IZ6UX.js → chunk-WKPZCQLI.js} +2 -2
- package/dist/chunk-WSG3DK5H.js +2 -0
- package/dist/chunk-WULAPQUD.js +38 -0
- package/dist/chunk-WZQFY5S7.js +4 -0
- package/dist/chunk-X434XZAI.js +2 -0
- package/dist/chunk-X7PJJYKX.js +29 -0
- package/dist/chunk-XDAUYDFT.js +2 -0
- package/dist/chunk-XITQLISP.js +2 -0
- package/dist/chunk-XRXCANFQ.js +4 -0
- package/dist/chunk-XVDMJMES.js +3 -0
- package/dist/chunk-XXJ7WL3F.js +35 -0
- package/dist/chunk-Y4XQ7LES.js +9 -0
- package/dist/chunk-YIEFEPG6.js +16 -0
- package/dist/chunk-YRVERHJR.js +49 -0
- package/dist/{chunk-CJST5ETY.js → chunk-YUFWLWIC.js} +2 -2
- package/dist/chunk-YUKYB54I.js +1 -0
- package/dist/chunk-Z3GCK3PD.js +3 -0
- package/dist/chunk-ZBNL3QCY.js +4 -0
- package/dist/chunk-ZD3Z54IW.js +2 -0
- package/dist/chunk-ZDVDSDFG.js +4 -0
- package/dist/{chunk-32LVLCLN.js → chunk-ZHSARYVS.js} +3 -3
- package/dist/{chunk-BDCC2NPY.js → chunk-ZW44MCJM.js} +2 -2
- package/dist/{chunk-N5W4YZMK.js → chunk-ZYREOING.js} +2 -2
- package/dist/cli-main.js +8 -0
- package/dist/cli.js +1 -3
- package/dist/code-CczEvHui.d.ts +121 -0
- package/dist/code-EQL6ZBLH.js +2 -0
- package/dist/code-result-json-6E4J6LGZ.js +2 -0
- package/dist/command-descriptors-QH3G2OVD.js +346 -0
- package/dist/{config-types-jVM3D7MA.d.ts → config-types-Cm-VSEBb.d.ts} +189 -23
- package/dist/dataflow-2BLMUZBP.js +2 -0
- package/dist/{db-B5PM5yNk.d.ts → db-LKJXAlNS.d.ts} +1 -1
- package/dist/dependence-slice-MGAJDZXB.js +2 -0
- package/dist/deps-GQMUYVKW.js +2 -0
- package/dist/direct-navigation-6RUJKLAV.js +3 -0
- package/dist/entry-map-V2NQP5JU.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-VM53I4IU.js +2 -0
- package/dist/graph-evidence-CbUPCSKV.d.ts +126 -0
- package/dist/graph-exploration-contract-CqDsnPQL.d.ts +7 -0
- package/dist/{health-Do5TKSJI.d.ts → health-Wl5G_LRt.d.ts} +33 -34
- package/dist/hierarchy-D553WRSZ.js +2 -0
- package/dist/imports-DOZAJWLW.js +2 -0
- package/dist/index.d.ts +4 -31
- package/dist/index.js +1 -1
- package/dist/members-HE67475K.js +2 -0
- package/dist/methods-K5JK4PPH.js +2 -0
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +90 -0
- package/dist/output-continuation-command-LKBUTNRL.js +3 -0
- package/dist/output-pagination-VAWOGX4R.js +19 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-4ARU6QCM.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-NBHKL4UQ.js +2 -0
- package/dist/refs-pagination-BBVTIHMH.js +2 -0
- package/dist/reindex-worker.js +27 -45
- package/dist/reindex.d.ts +62 -42
- package/dist/reindex.js +32 -33
- package/dist/repository-text-C0Q8VYdN.d.ts +19 -0
- package/dist/runtime.d.ts +286 -7
- 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-CppzF5MK.d.ts} +33 -2
- package/dist/slice-U6S6LBSB.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-C7SS5CDQ.js +2 -0
- package/dist/symbol-resolution-3FVEKDTJ.js +2 -0
- package/dist/system-6K2NOO5C.js +2 -0
- package/dist/trace-II5K2TMH.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/value-flow-MKFUUE5B.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 +27 -45
- package/docs/schemas/suppression-record.schema.json +1 -34
- package/package.json +65 -8
- package/skills/concrete-plan/SKILL.md +8 -0
- package/skills/concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-explore/SKILL.md +3 -85
- package/skills/scip-explore/agents/openai.yaml +3 -3
- 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 +77 -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/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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as f}from"./chunk-ZBNL3QCY.js";import{a as L}from"./chunk-VGRUM7JI.js";import{G as l,v as a}from"./chunk-SDPA5DKN.js";import{c as i,d as b,e as u,k as c}from"./chunk-DRENNWRG.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
|
|
2
|
+
//# sourceMappingURL=chunk-SSSJO4RG.js.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import{a as U}from"./chunk-3EX7DNBC.js";import{b as Qe}from"./chunk-OUB4J26T.js";import{q as et}from"./chunk-2I3RSUWX.js";import{c as X}from"./chunk-GFLTPNWV.js";import{A as T,B as Ke,C as q,D as R,E as Xe,G as Ze,H as We,I as Ye,M as Je,N as V,V as I,aa as ce,p as j,t as le,v as ue,w as Ge,x as B,y as $}from"./chunk-SDPA5DKN.js";import{b as J}from"./chunk-VWLIOEEF.js";function de(e){let t=e.replaceAll("\\","/");return Qe(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{createHash as _t}from"crypto";import{createHash as tn}from"crypto";var pe=8;function Z(e,t,n){return $e(tt(e,t,Re(n),0,new Set))}function Ee(e,t,n){return Be(e,t,n,0,new Set)}function tt(e,t,n,r,i){if(r>pe)return[];let o=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return o?nt(e,t,o[1],o[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?rt(e,t,n,r,i):[]}function nt(e,t,n,r,i,o){let a=[];for(let s of Be(e,t,n,i+1,new Set(o))){let l=T(s.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let c=u.childForFieldName("key")??u.namedChild(0);if(qt(c)!==r)continue;let d=u.childForFieldName("value")??u.namedChild(1);d&&a.push(...tt(e,s.definition.relativePath,Re(d.text),i+1,new Set(o)));continue}if(/(?:method|function)/u.test(u.type)){if((u.childForFieldName("name")??u.namedChild(0))?.text!==r)continue;let d=jt(e,s.definition.relativePath,r,u);a.push(...d.length>0?d:[Mt(s.definition,r,u)]);continue}if(u.type==="spread_element"){let c=u.namedChild(0);if(!c)continue;for(let d of Be(e,s.definition.relativePath,Re(c.text),i+1,new Set(o)))a.push(...nt(e,d.definition.relativePath,d.definition.leaf,r,i+1,new Set(o)))}}}return $e(a)}function Mt(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 Be(e,t,n,r,i){return r>pe||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:rt(e,t,n,r,i).flatMap(o=>{let a=R(e,o.relativePath)?.rootNode,s=a?zt(a,o.leaf):null;return s?[{definition:o,initializer:s}]:[]})}function rt(e,t,n,r,i){if(r>pe)return[];let o=`${t}\0${n}`;if(i.has(o))return[];i.add(o);let a=I(e,t).filter(u=>u.leaf===n);if(a.length>0)return a;let s=Vt(e,t,n);if(s.length>0)return s;let l=V(e,t).find(u=>u.localName===n&&u.sourcePath);if(l?.sourcePath){let u=l.kind==="namespace"||l.importedName==="default"?n:l.importedName;return Fe(e,l.sourcePath,u,r+1,new Set(i))}return Fe(e,t,n,r+1,new Set(i))}function Vt(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(Ze(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 Fe(e,t,n,r,i){if(r>pe)return[];let o=I(e,t).filter(a=>a.leaf===n);return o.length>0?o:$e(Je(e,t).flatMap(a=>a.sourcePath?a.kind==="named"&&!a.names.includes(n)?[]:Fe(e,a.sourcePath,n,r+1,new Set(i)):[]))}function jt(e,t,n,r){return I(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function zt(e,t){let n=null;return B(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 qt(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function Re(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function $e(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}var Ut=8;function L(e,t){return t?W(e,t,0,new Set):null}function W(e,t,n,r){if(n>Ut)return A(t,"value-evaluation-depth");let i=T(t),o=Wt(i);if(o)return Yt(e.file,i,o.term,o.value,o.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let l=i.namedChildren.map(u=>W(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 Jt(e.file,i,u,c,l.some(d=>d.precision!=="literal")?"constrained-pattern":"literal",l)}}let a=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(a))return Xt(e,a,i,n,r);let s=Qt(i);return s?Zt(e,s.base,s.properties,i,n,r):i.type==="call_expression"||i.type==="call"?Ht(e,i,n,r):A(i,`unsupported-expression:${i.type}`)}function Ht(e,t,n,r){let o=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",a=Gt(e,o);if(a.length!==1)return A(t,a.length===0?"call-target-unresolved":"call-target-ambiguous");let s=a[0],l=`${s.relativePath}\0${s.symbol}`;if(r.has(l))return A(t,"call-return-cycle");let u=R(e.db,s.relativePath)?.rootNode;if(!u)return A(t,"call-target-unparsed");let c=$(u,s.startLine,s.endLine);if(!c)return A(t,"call-target-syntax-unavailable");let d=Kt(c);if(!d)return A(t,"call-return-not-single-expression");let p=new Set(r);p.add(l);let m=W({db:e.db,file:s.relativePath,root:u},d,n+1,p);return m?me(t,"bounded-call-return",m,s.symbol):A(t,"call-return-unresolved")}function Gt(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=I(e.db,e.file).filter(a=>a.isFunctionLike&&a.leaf===t);if(i.length>0)return i;let o=V(e.db,e.file).find(a=>a.localName===t&&a.sourcePath&&a.kind!=="namespace");return o?.sourcePath?U(e.db,o.sourcePath,o.importedName==="default"?t:o.importedName).filter(a=>a.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=V(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?U(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function Kt(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return it(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function it(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)it(e,r,n)}}function Xt(e,t,n,r,i){let o=`${e.file}\0${t}`;if(i.has(o))return A(n,"value-cycle");i.add(o);let a=Te(e.root,t);if(a){let y=W(e,a,r+1,i);return y?me(n,"local-constant",y):A(n,"non-foldable-local")}let s=V(e.db,e.file).find(y=>y.localName===t&&y.sourcePath);if(!s?.sourcePath)return k(n,t,"unresolved-identifier");if(s.kind==="namespace")return k(n,t,"namespace-import-requires-property");let l=s.importedName==="default"?t:s.importedName,u=U(e.db,s.sourcePath,l);if(u.length!==1)return k(n,t,u.length===0?"import-definition-missing":"import-definition-ambiguous");let c=u[0],d=R(e.db,c.relativePath)?.rootNode;if(!d)return k(n,c.symbol,"import-definition-unparsed");let p=Te(d,c.leaf);if(!p)return k(n,c.symbol,"import-definition-non-value");let m=W({db:e.db,file:c.relativePath,root:d},p,r+1,i);return m?me(n,"imported-constant",m,c.symbol):k(n,c.symbol,"import-value-unresolved")}function Zt(e,t,n,r,i,o){let a=V(e.db,e.file).find(m=>m.localName===t&&m.sourcePath),s=e.file,l=t,u;if(a?.sourcePath){a.kind==="namespace"?(l=n[0]??"",n=n.slice(1)):l=a.importedName==="default"?t:a.importedName;let m=U(e.db,a.sourcePath,l);if(m.length!==1)return k(r,`${t}.${n.join(".")}`,m.length===0?"member-definition-missing":"member-definition-ambiguous");s=m[0].relativePath,l=m[0].leaf,u=m[0].symbol}let c=s===e.file?e.root:R(e.db,s)?.rootNode;if(!c)return k(r,u??t,"member-definition-unparsed");let d=Te(c,l);if(!d)return k(r,u??t,"member-base-non-value");for(let m of n){let y=T(d);if(d=en(y,m),!d)return k(r,u??`${t}.${n.join(".")}`,`member-property-missing:${m}`)}let p=W({db:e.db,file:s,root:c},d,i+1,o);return p?me(r,"member-constant",p,u):k(r,u??t,"member-value-unresolved")}function Wt(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=[],o=0,a=/\$\{([^}]*)\}/gu;for(let s of r.matchAll(a)){let l=s.index??0;l>o&&i.push({kind:"literal",value:r.slice(o,l)}),i.push({kind:"unknown",reason:`template-hole:${s[1]?.trim()||"expression"}`}),o=l+s[0].length}return o<r.length&&i.push({kind:"literal",value:r.slice(o)}),{term:{kind:"pattern",language:"template",value:r.replace(a,"{}")},value:r.replace(a,"{}"),precision:"constrained-pattern"}}function Yt(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:fe("direct-literal","direct",e,t)}}function Jt(e,t,n,r,i,o){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...fe("constant-concatenation","mechanically-derived",e,t),inputFactIds:o.flatMap(a=>a.derivation.inputFactIds),sourceSpans:o.flatMap(a=>a.derivation.sourceSpans)}}}function me(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 k(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:fe(n,"heuristic","",e)}}function A(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:fe(t,"heuristic","",e)}}function fe(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 Qt(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 Te(e,t){let n=null;return B(e,r=>{if(n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t)return;let o=r.parent;!o||o.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(o.text)||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function en(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 pt=new Set(["delete","get","head","options","patch","post","put"]),nn=/(?:^|\.)(?:app|router|server)$/u,rn=new Set(["findFirst","findMany","findUnique","from","get","select"]),on=new Set(["create","delete","insert","remove","update","upsert"]),an=new Set(["execute","query","raw"]),ot=/(?:\b(?:name|id)|['"`](?:name|id)['"`])\s*:/u,at=/(?:^\s*|[,{]\s*)(?:async\s+)?['"`]?(?:execute|handler|invoke|run)['"`]?\s*(?::|\([^)]*\)\s*\{)/mu,st=/\b[A-Za-z_$][\w$-]*[_-][\w$-]*\s*\(/u,lt=/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s+[A-Za-z_$][\w$-]*\s*\(/iu,_e=[cn(),un(),sn(),dn(),mn(),fn(),hn()],Le=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function sn(){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=ln(e.source),n=[];return z(e.root,"call_expression",r=>{let i=ne(r);if(!i)return;let o=t.direct.get(i),a=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),s=a&&t.namespaces.has(a[1])?a[2]:null,l=o??s;if(!l||!Le.has(l))return;let u=H(r),c=E(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},d=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(x(e,r,"builtin.node-child-process",d,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...c}],"exact","node-child-process-import"))}),n}}}function ln(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&&Le.has(c[1])&&t.set(c[2]??c[1],c[1])}let o=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(o))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&&Le.has(c[1])&&t.set(c[2]??c[1],c[1])}let a=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let l of e.matchAll(a))n.add(l[1]);let s=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(s))n.add(l[1]);return{direct:t,namespaces:n}}function N(e,t,n,r){let i=Q(r,"runtime-boundaries.context.ast",t,()=>R(e,t)?.rootNode);if(!i)return null;let o=n??j(e,t),a,s,l,u=()=>(s!==void 0||(s=Q(r,"runtime-boundaries.context.callable-sites",t,()=>{let c=ue(t);return(c?Ye(i,c):null)??We(e,t)})),s);return{db:e,file:t,source:o,root:i,get constants(){return l??=Q(r,"runtime-boundaries.context.constants",t,()=>Nn(i)),l},ownerAt:c=>{let p=(a??=Q(r,"runtime-boundaries.context.definitions",t,()=>I(e,t,{rangeCorrectionEvidence:{source:o,callables:u()}},(f,h)=>Q(r,`runtime-boundaries.context.definitions.${f}`,t,h)))).filter(f=>f.startLine<=c&&f.endLine>=c).sort((f,h)=>f.endLine-f.startLine-(h.endLine-h.startLine)||f.startLine-h.startLine)[0];if(p)return{file:t,symbol:p.symbol,name:p.leaf,startLine:p.startLine,endLine:p.endLine};let y=(u()??[]).filter(f=>f.startLine<=c&&f.endLine>=c).sort((f,h)=>f.endLine-f.startLine-(h.endLine-h.startLine)||f.startLine-h.startLine)[0];return{file:t,symbol:null,name:y?.name??null,startLine:y?.startLine??c,endLine:y?.endLine??c}}}}function Q(e,t,n,r){return e?e(t,r,{file:n}):r()}function un(){return{id:"builtin.effect-httpapi",supports:e=>ee(e,"HttpApiEndpoint").size>0||ee(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=ee(e.source,"HttpApiEndpoint"),r=ee(e.source,"HttpApiGroup"),i=ee(e.source,"HttpApiBuilder");return z(e.root,"call_expression",o=>{let a=mt(o);if(!a)return;let s=H(o);if(n.has(a.receiver)&&pt.has(a.member)){let f=E(s[0],e),h=E(s[1],e),C=ct(o,r,"make",0,e);if(!f||!h||!C)return;let F=a.member.toUpperCase();t.push(x(e,o,"builtin.effect-httpapi","http.handle",[{name:"method",value:F,evidence:"literal"},{name:"path",...h}],O([{name:"path",...h}]),"effect-httpapi-endpoint-declaration")),t.push(x(e,o,"builtin.effect-httpapi","framework.declare",ke(C,f),O(ke(C,f)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(a.member))return;let l=ct(o,i,"group",1,e),u=E(s[0],e),c=s[1];if(!l||!u||!c)return;let d=ke(l,u),p=Z(e.db,e.file,c.text),m=x(e,o,"builtin.effect-httpapi","framework.handle",d,p.length===1?O(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 ke(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function ee(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let o of e.matchAll(r)){let a=o[2]??"";if(ut(a))for(let s of(o[1]??"").split(",")){let l=s.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 o of e.matchAll(i)){let a=o[2]??"";a.endsWith(`/${t}`)&&ut(a)&&n.add(o[1])}return n}function ut(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function ct(e,t,n,r,i){let o=e.parent;for(;o;){if(o.type==="call_expression"){let a=dt(o,t,n,r,i);if(a)return a;let s=o.childForFieldName("function")??o.namedChild(0),l=null;if(s&&Oe(s,u=>{!l&&u.type==="call_expression"&&(l=dt(u,t,n,r,i))}),l)return l}o=o.parent}return null}function dt(e,t,n,r,i){let o=mt(e);return!o||o.member!==n||!t.has(o.receiver)?null:E(H(e)[r],i)}function mt(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 cn(){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)||te(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return z(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||!te(e.source,["fastapi","flask"]))return;t.push(x(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=ne(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",o=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",a=H(n);if(i==="route"&&te(e.source,["axum"])){let p=E(a[0],e),m=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(a[1]?.text??"")?.[1];if(!p||!m)return;t.push(x(e,n,"builtin.http","http.handle",[{name:"method",value:m.toUpperCase(),evidence:"literal"},{name:"path",...p}],O([{name:"path",...p}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let p=E(a[0],e);if(!p)return;let y=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(a[1]?.text??"")?.[1]?.toUpperCase()??(a[1]?null:"GET"),f=[...y?[{name:"method",value:y,evidence:"literal"}]:[],{name:"path",...p}];t.push(x(e,n,"builtin.http","http.request",f,y?O(f):"candidate","call-expression"));return}if(!pt.has(i))return;let s=E(a[0],e);if(!s)return;let l=i.toUpperCase();if(nn.test(o)&&te(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(x(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...s}],O([{name:"path",...s}]),"framework-adapter"));return}let c=bn(e.source,["axios"]),d=o.split(".")[0]??"";c.has(d)&&t.push(x(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...s}],O([{name:"path",...s}]),"client-adapter"))}),t}}}function dn(){return{id:"builtin.capability-registry",supports:e=>ot.test(e)&&at.test(e)||st.test(e)||lt.test(e),extract:e=>{let t=[],n=new Set,r=[];return ot.test(e.source)&&at.test(e.source)&&r.push("pair"),(st.test(e.source)||lt.test(e.source))&&r.push("string","string_literal","template_string"),z(e.root,r,i=>{if(i.type==="pair"){let a=i.childForFieldName("key")??i.namedChild(0),s=i.childForFieldName("value")??i.namedChild(1),l=a?.text.replace(/^['"`]|['"`]$/gu,"");if(l!=="name"&&l!=="id")return;let u=ft(s,e),c=In(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(x(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 o=i.text.replace(/^['"`]|['"`]$/gu,"");for(let a of o.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let s=a[1];if(!pn(o,s,a.index))continue;let l=`reference\0${s}\0${i.startPosition.row}`;n.has(l)||(n.add(l),t.push(x(e,i,"builtin.capability-registry","registry.reference",[{name:"key",value:s,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function pn(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 mn(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return z(e.root,["pair","call_expression"],n=>{if(n.type==="pair"){let o=Cn(n);if(!o)return;let a=n.childForFieldName("key")??n.namedChild(0),s=n.childForFieldName("value")??n.namedChild(1),l=ft(a,e);if(!l||!s||!yt(s))return;let u=Ae(s)?"exact":"candidate";t.push(x(e,n,"builtin.registry","registry.handle",[{name:"registry",value:o,evidence:"identifier"},{name:"key",...l}],O([{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(x(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 fn(){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=Pn(e.root);return z(e.root,"call_expression",r=>{let i=ne(r);if(!i)return;let o=i.split("."),a=o.at(-1)??"",s=H(r),l=s[0]?.text??"",u=wn(a,l);if(!u)return;let c=ht(o,n);if(!c)return;let d=yn(s[0],e)??Bn(l),p=Fn(c,o,a,d);if(!p)return;let m=a==="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(x(e,r,"builtin.persistence",u,[{name:"resource",...p}],O([{name:"resource",...p}]),m))}),t}}}function yn(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:E(e,t)}function hn(){return{id:"builtin.queue",supports:e=>te(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return z(e.root,"call_expression",n=>{let r=ne(n);if(!r)return;let i=r.split(".").at(-1)??"",o=H(n),a=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!a)return;let s=i==="send"||i==="subscribe"?Sn(o[0],"topic",e):E(o[0],e);s&&t.push(x(e,n,"builtin.queue",a,[{name:"address",...s}],O([{name:"address",...s}]),"framework-adapter"))}),t}}}function x(e,t,n,r,i,o,a){let s=e.ownerAt(t.startPosition.row),l=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${tn("sha256").update(l).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:s,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:a,strength:o,protocol:r.split(".")[0]??r,role:gn(r),executionDomain:vn(e.file),derivation:{kind:o==="candidate"?"heuristic":o==="derived"?"mechanically-derived":"direct",rule:a,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:de(e.file)}}function gn(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 vn(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function te(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 bn(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),o=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 a of e.matchAll(o)){let s=a[1]??a[2];s&&n.add(s)}}return n}function ye(e,t,n,r,i,o,a){return x(e,t,n,r,i,o,a)}function ne(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function H(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function E(e,t){let n=L(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function Sn(e,t,n){if(!e)return null;let r=e.namedChildren.find(o=>o.type!=="pair"?!1:(o.childForFieldName("key")??o.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return E(i,n)}function ft(e,t){if(!e)return null;let n=E(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 O(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function xn(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 Nn(e){let t=new Map;return Oe(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 o=xn(i);o!==null&&t.set(r.text,o)}),t}function Cn(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 Ae(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function yt(e){return Ae(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function In(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),o=n.childForFieldName("value")??n.namedChild(1),a=i?.text.replace(/^['"`]|['"`]$/gu,"");if(a&&["execute","handler","invoke","run"].includes(a)&&o&&yt(o))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 ht(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 wn(e,t){if(rn.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 Pn(e){let t=new Set;return z(e,"call_expression",n=>{let r=ne(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!ht(i)))for(let o of H(n)){if(!Ae(o))continue;let s=(o.childForFieldName("parameters")??o.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=s?Ke(s):null;l&&t.add(l)}}),t}function Bn(e){let t=gt(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function Fn(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let o=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return o?{value:o,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=gt(r.value);return i?{value:i,evidence:r.evidence}:null}function gt(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function Oe(e,t){t(e);for(let n of e.namedChildren)Oe(n,t)}function z(e,t,n){for(let r of e.descendantsOfType(t))n(r)}var Rn=J("resolved-call-syntax",{clearGroups:[]}),En=J("resolved-call-sites",{clearGroups:[]});function re(e,t){return En.get(e,t.symbolId,()=>$n(e,t))}function $n(e,t){let n=[],r=[],i=new Set,o=new Set;for(let a of et(e,t,{semantic:!1})){i.add(a.file);let s=Rn.get(e,a.file,()=>Tn(e,a.file));if(!s){r.push({callee:t,file:a.file,line:a.line,reason:"ast-unavailable",candidates:0,referenceProvenance:a.provenance});continue}let l=(s.byLeaf.get(t.leaf)??[]).filter(({callNode:d})=>d.startPosition.row<=a.line&&d.endPosition.row>=a.line);if(l.length!==1){r.push({callee:t,file:a.file,line:a.line,reason:l.length===0?"call-not-found":"ambiguous-call",candidates:l.length,referenceProvenance:a.provenance});continue}let u=l[0],c=`${a.file}\0${u.callNode.startIndex}\0${u.callNode.endIndex}`;o.has(c)||(o.add(c),n.push({callee:t,caller:ce(I(e,a.file),u.callNode.startPosition.row),file:a.file,line:a.line,startLine:u.callNode.startPosition.row,endLine:u.callNode.endPosition.row,targetText:u.targetNode.text,callNode:u.callNode,targetNode:u.targetNode,arguments:u.arguments,referenceProvenance:a.provenance}))}return{sites:n,unresolved:r,filesVisited:i.size}}function Tn(e,t){let n=R(e,t)?.rootNode;if(!n)return null;let r=new Map;return vt(n,i=>{if(i.type!=="call_expression"&&i.type!=="call")return;let o=i.childForFieldName("function")??i.namedChild(0);if(!o)return;let a=Xe(o);if(!a)return;let s=i.childForFieldName("arguments")??i.namedChildren.find(c=>c.type==="arguments"),l={callNode:i,targetNode:o,arguments:s?.namedChildren??[]},u=r.get(a);u?u.push(l):r.set(a,[l])}),{byLeaf:r}}function vt(e,t){t(e);for(let n of e.namedChildren)vt(n,t)}var kn=J("call-parameter-value-flow",{clearGroups:[]});function ie(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return kn.get(e,n,()=>Ln(e,t))}function oe(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 Ln(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=R(e,t.caller.relativePath)?.rootNode,i=r?$(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 o=q(i),a=[],s=[];return t.arguments.forEach((l,u)=>{let c=l.text.trim(),d=o.indexOf(c);d>=0?a.push({calleePosition:u,callerPosition:d,argumentText:c,proof:n}):s.push({calleePosition:u,argumentText:c,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:a,unknown:s}}var _n=8,An=8;function St(e,t){let n=[],r=On(e,n),i=r.summaries,o=Dn(e,t,i,n),a=Mn(e,t,n);return{observations:Wn([...o.observations,...a]),bodySummaries:i.size,discriminatorSummaries:o.summaries,filesInspected:r.filesInspected,errors:n}}function On(e,t){let n=new Map,r=[],i=X(e);for(let o of i){let a=j(e,o);if(!/\bJSON\.stringify\s*\(/u.test(a)||!/\bbody\s*:/u.test(a))continue;let s=N(e,o);if(s)for(let[l,u]of Vn(s)){let c={definition:l,parameterIndexes:u,depth:0,proofSpans:[{file:o,startLine:l.startLine,endLine:l.endLine}]};n.set(l.symbol,c),r.push(c)}}for(;r.length>0;){let o=r.shift();if(!(o.depth>=_n))try{for(let a of re(e,o.definition).sites){if(!N(e,a.file))continue;let l=a.caller;if(!l)continue;let u=oe(ie(e,a),o.parameterIndexes);if(u.length===0)continue;let c={definition:l,parameterIndexes:wt(u),depth:o.depth+1,proofSpans:[...o.proofSpans,{file:a.file,startLine:a.startLine,endLine:a.endLine}]};Un(n,c)&&r.push(n.get(l.symbol))}}catch(a){t.push(`builtin.carrier body summary failed for ${o.definition.relativePath}: ${Ve(a)}`)}}return{summaries:n,filesInspected:i.length}}function Dn(e,t,n,r){let i=new Map,o=[],a=[];for(let s of t){if(s.action!=="http.request"||s.strength==="candidate"||s.sourceScope!=="production")continue;let l=xt(s);if(!l)continue;let u=N(e,s.source.file);if(!u)continue;let c=Nt(u.root,s.source.startLine),d=c.find(F=>F.startPosition.row===s.source.startLine)??c[0];if(!d)continue;let p=Me(d);if(!p)continue;let m=Z(e,s.source.file,p.text);if(m.length!==1)continue;let y=n.get(m[0].symbol);if(!y)continue;let f=s.owner.symbol?I(e,s.owner.file).find(F=>F.symbol===s.owner.symbol):null;if(!f)continue;let h=Hn(u,f),C=he(d);for(let F of y.parameterIndexes){let D=Kn(u,C[F]);if(D)for(let v of Xn(D)){let w=Ct(v),_=It(v);if(!w||!_)continue;let M=h.indexOf(_.text.trim());if(M>=0){let P={definition:f,carrier:l,field:w,parameterIndex:M,depth:0,proofObservationIds:[s.id],proofSpans:[s.source,{file:s.source.file,startLine:v.startPosition.row,endLine:v.endPosition.row}]},S=bt(P);i.has(S)||(i.set(S,P),o.push(P));continue}let b=L(u,_);!b||b.evidence==="expression"||a.push(De(u,v,"carrier.publish",l,w,b.value,[s.id]))}}}for(;o.length>0;){let s=o.shift();if(!(s.depth>=An))try{for(let l of re(e,s.definition).sites){let u=N(e,l.file);if(!u)continue;let c=l.callNode,d=he(c)[s.parameterIndex];if(!d)continue;let p=L(u,d);p&&p.evidence!=="expression"&&a.push(De(u,c,"carrier.publish",s.carrier,s.field,p.value,s.proofObservationIds));let m=l.caller;if(!m)continue;let y=ie(e,l).transfers.find(C=>C.calleePosition===s.parameterIndex)?.callerPosition;if(y===void 0)continue;let f={...s,definition:m,parameterIndex:y,depth:s.depth+1,proofSpans:[...s.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},h=bt(f);i.has(h)||(i.set(h,f),o.push(f))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${s.definition.relativePath}: ${Ve(l)}`)}}return{observations:a,summaries:i.size}}function Mn(e,t,n){let r=[],i=t.filter(o=>o.action==="registry.handle"&&o.strength!=="candidate"&&o.sourceScope==="production");for(let o of t){if(o.action!=="http.handle"||o.strength==="candidate"||o.sourceScope!=="production")continue;let a=xt(o);if(!a)continue;let s=N(e,o.source.file);if(!s)continue;let l=Nt(s.root,o.source.startLine)[0];if(l)for(let u of he(l).slice(1)){let c=Z(e,o.source.file,u.text);for(let d of c)try{let p=N(e,d.relativePath);if(!p)continue;let m=$(p.root,d.startLine,d.endLine);if(!m)continue;B(m,y=>{if(y.type!=="call_expression")return;let f=Me(y);if(!f)return;let h=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(f.text.trim());if(!h)return;let C=h[1],F=h[2],D=zn(e,p,d,F);if(!D)return;let v=qn(e,d.relativePath,C);for(let w of i){let _=w.keyParts.find(S=>S.name==="registry")?.value,M=w.keyParts.find(S=>S.name==="key")?.value;if(!_||!M||!v.some(S=>S.file===w.source.file&&S.binding===_))continue;let b=N(e,w.source.file),P=b?Gn(b.root,w.source.startLine):null;!b||!P||r.push(De(b,P,"carrier.consume",a,D,M,[o.id,w.id]))}})}catch(p){n.push(`builtin.carrier consumer analysis failed for ${d.relativePath}: ${Ve(p)}`)}}}return r}function Vn(e){let t=I(e.db,e.file),n=new Map;return B(e.root,r=>{if(r.type!=="pair"||Ct(r)?.toLowerCase()!=="body")return;let i=It(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let o=ce(t,r.startPosition.row),a=jn(r);if(!o||!a)return;let s=q(a),l=new Set;Zn(i,s,l);let u=n.get(o.symbol)??new Set;s.forEach((c,d)=>{c&&l.has(c)&&u.add(d)}),u.size>0&&n.set(o.symbol,u)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[[r,[...i].sort((o,a)=>o-a)]]:[]})}function jn(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 zn(e,t,n,r){let i=$(t.root,n.startLine,n.endLine);if(!i)return null;let o=new RegExp(`\\.body\\??\\.${le(r)}\\b`,"u");if(o.test(i.text))return r;let a=null;if(B(i,c=>{if(a||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*${le(r)}\\s*(?:[,}]|$)`,"u").test(d.text)||p.type==="call_expression"&&(a=Me(p)?.text??null)}),!a)return null;let s=Z(e,n.relativePath,a);if(s.length!==1)return null;let l=N(e,s[0].relativePath),u=l?$(l.root,s[0].startLine,s[0].endLine):null;return u&&o.test(u.text)&&new RegExp(`\\b${le(r)}\\s*[,}]`,"u").test(u.text)?r:null}function qn(e,t,n){let r=[];for(let i of Ee(e,t,n)){let o=T(i.initializer);if(o.type==="call_expression")for(let a of he(o)){let s=a.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))for(let l of Ee(e,i.definition.relativePath,s))r.push({file:l.definition.relativePath,binding:l.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function De(e,t,n,r,i,o,a){let l=ye(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:o,evidence:"constant",term:{kind:"literal",value:o}}],"derived","http-body-registry-discriminator");return l.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...a],sourceSpans:[l.source]},l}function xt(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 Un(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=wt([...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 bt(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function Hn(e,t){let n=$(e.root,t.startLine,t.endLine);return n?q(n):[]}function Gn(e,t){let n=null;return B(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function Nt(e,t){let n=[];return B(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 Me(e){return e.childForFieldName("function")??e.namedChild(0)}function he(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Kn(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return T(t);let r=null;return B(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?T(r):T(t)}function Xn(e){let t=T(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function Ct(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function It(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function Zn(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 wt(e){return[...new Set(e)].sort((t,n)=>t-n)}function Wn(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Ve(e){return e instanceof Error?e.message:String(e)}import{createHash as Yn}from"crypto";function Pt(e,t){let n=new Map;for(let o of t){if(o.action!=="http.handle"||o.sourceScope!=="production")continue;let a=n.get(o.source.file)??[];a.push(o),n.set(o.source.file,a)}let r=[],i=Jn(e);for(let o of i.mounts)for(let a of o.targetFiles)for(let s of n.get(a)??[]){let l=s.keyParts.find(p=>p.name==="path");if(!l||l.evidence==="expression")continue;let u=er(o.prefix.value,l.value),c=s.keyParts.map(p=>p.name==="path"?{name:"path",value:u,evidence:"constant",term:{kind:"concat",parts:[o.prefix.term??{kind:"literal",value:o.prefix.value},l.term??{kind:"literal",value:l.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[s.id],sourceSpans:[s.source,{file:o.file,startLine:o.line,endLine:o.line},...o.prefix.derivation?.sourceSpans??[],...l.derivation?.sourceSpans??[]]}}:p),d=`${s.id}\0${o.file}\0${o.line}\0${u}`;r.push({...s,id:`boundary:${Yn("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:[s.id],sourceSpans:[s.source,{file:o.file,startLine:o.line,endLine:o.line}]},resolution:"unresolved"}),s.strength="candidate",s.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function Jn(e){let t=[],n=X(e);for(let r of n){let i=j(e,r);if(!tr(i))continue;let o=N(e,r);o&&Bt(o.root,a=>{if(a.type!=="call_expression")return;let s=a.childForFieldName("function")??a.namedChild(0);if(!s||!s.text.replace(/\s+/gu,"").endsWith(".use"))return;let l=nr(a);if(l.length<2)return;let u=L(o,l[0]);if(!u||u.evidence==="expression")return;let c=Qn(e,r,l[1]);c.length!==0&&t.push({file:r,line:a.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:c})})}return{mounts:t,filesInspected:n.length}}function Qn(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let o=V(e,t).find(l=>l.localName===i&&l.sourcePath);if(!o?.sourcePath)return[t];if(o.kind==="namespace")return[o.sourcePath];let a=o.importedName==="default"?i:o.importedName,s=U(e,o.sourcePath,a);return[...new Set(s.map(l=>l.relativePath))]}function er(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function tr(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function nr(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Bt(e,t){t(e);for(let n of e.namedChildren)Bt(n,t)}import{createHash as rr}from"crypto";function ge(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}var je=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),ir=8;function Et(e,t){let n=new Map,r=[],i=[],o=new Set,a=[],s=[];for(let l of t){if(l.action!=="http.request"||!l.owner.symbol||l.evidence!=="call-expression"&&l.evidence!=="client-adapter")continue;let u=I(e,l.owner.file).find(m=>m.symbol===l.owner.symbol);if(!u)continue;let c=N(e,u.relativePath);if(!c)continue;let d=Ft(c,u),p={definition:u,...d,constantMethods:l.keyParts.flatMap(m=>m.name==="method"&&m.evidence!=="expression"&&je.has(m.value.toUpperCase())?[m.value.toUpperCase()]:[]),depth:0,proofObservationIds:[l.id],proofSpans:[l.source]};Rt(n,p)&&r.push(n.get(u.symbol))}for(;r.length>0;){let l=r.shift();if(!(l.depth>=ir))try{let u=re(e,l.definition);s.push(...u.unresolved.map(c=>or(l,c)));for(let c of u.sites){let d=N(e,c.file);if(!d)continue;o.add(c.file);let p=c.callNode,m=ar(l,p,d);m&&i.push(m);let y=c.caller;if(!y)continue;let f=Ft(d,y),h=sr(e,l,c),C={definition:y,pathParameterIndexes:ve([...f.pathParameterIndexes,...h.pathParameterIndexes]),methodParameterIndexes:ve([...f.methodParameterIndexes,...h.methodParameterIndexes]),constantMethods:Y([...l.constantMethods,...f.constantMethods]),depth:l.depth+1,proofObservationIds:Y([...l.proofObservationIds,...m?[m.id]:[]]),proofSpans:[...l.proofSpans,{file:c.file,startLine:c.startLine,endLine:c.endLine}]};Rt(n,C)&&r.push(n.get(y.symbol))}}catch(u){a.push(`builtin.http-summary failed for ${l.definition.relativePath}:${l.definition.startLine+1}: ${u instanceof Error?u.message:String(u)}`)}}return{observations:i,frontiers:ge(s),summaries:n.size,filesInspected:o.size,errors:a}}function or(e,t){let n=Y([...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:${rr("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:de(t.file)}}function ar(e,t,n){let r=$t(t),i=e.pathParameterIndexes.flatMap(d=>{let p=L(n,r[d]);return p&&p.evidence!=="expression"&&ur(p.value)?[{index:d,value:p}]:[]}),o=e.methodParameterIndexes.flatMap(d=>{let p=L(n,r[d]),m=p?.value.toUpperCase();return p&&m&&p.evidence!=="expression"&&je.has(m)?[{index:d,value:{...p,value:m}}]:[]}),a=Y([...e.constantMethods,...o.map(d=>d.value.value)]);if(i.length!==1||a.length!==1)return null;let s=i[0].value,l=o.find(d=>d.value.value===a[0])?.value,u=[{name:"method",value:a[0],evidence:l?"constant":"literal",term:l?.term??{kind:"literal",value:a[0]},derivation:l?.derivation},{name:"path",value:s.value,evidence:"constant",term:s.term,derivation:s.derivation}],c=ye(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 Ft(e,t){let n=$(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=q(n),i=new Set,o=new Set,a=new Set;return B(n,s=>{if(s.type==="call_expression"&&((s.childForFieldName("function")??s.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let m=$t(s);ae(m[0],r,i);let y=lr(m[1],"method");if(y){ae(y,r,o);let f=L(e,y),h=f?.value.toUpperCase();h&&f?.evidence!=="expression"&&je.has(h)&&a.add(h)}else ae(m[1],r,o)}if(s.type!=="pair")return;let l=s.childForFieldName("key")??s.namedChild(0),u=s.childForFieldName("value")??s.namedChild(1),c=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(c==="url"||c==="path"||c==="endpoint")&&ae(u,r,i),(c==="init"||c==="requestinit"||c==="options")&&ae(u,r,o)}),{pathParameterIndexes:r.flatMap((s,l)=>s&&i.has(s)?[l]:[]),methodParameterIndexes:r.flatMap((s,l)=>s&&o.has(s)?[l]:[]),constantMethods:[...a].sort()}}function sr(e,t,n){let r=ie(e,n);return{pathParameterIndexes:oe(r,t.pathParameterIndexes),methodParameterIndexes:oe(r,t.methodParameterIndexes)}}function Rt(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=ve([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=ve([...n.methodParameterIndexes,...t.methodParameterIndexes]),o=Y([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||o.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:o,depth:Math.min(n.depth,t.depth),proofObservationIds:Y([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function lr(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 ae(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 $t(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function ur(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function ve(e){return[...new Set(e)].sort((t,n)=>t-n)}function Y(e){return[...new Set(e)].sort()}import{createHash as cr}from"crypto";function Lt(e){let t=Tt(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=Tt(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?ze(r).flatMap(i=>{let o=t.get(i)?.[0];return o?[kt(r,o,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?ze(r).flatMap(i=>{let o=n.get(i)?.[0];return o?[kt(r,o,i,"queue.consume")]:[]}):[])}function Tt(e){let t=new Map;for(let n of e)for(let r of ze(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 ze(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function kt(e,t,n,r){let i=`database:${n}`,o=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",a=[e.id,r,i,o].join("\0");return{...e,id:`boundary:${cr("sha256").update(a).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:o,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 qe="runtime-boundaries-v15",xe=[{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}],dr=64;function pr(e,t={}){let n=X(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map(gr)),o=t.previousGraph?.fileCoverage,a=i.size>0&&t.previousGraph?.extractorVersion===qe&&o!==void 0&&o.length===t.previousGraph.coverage.filesScanned,s=a?o.filter(g=>r.has(g.file)&&!i.has(g.file)):[],l=new Set(s.flatMap(g=>g.observationIds)),u=a?t.previousGraph.observations.filter(g=>l.has(g.id)&&r.has(g.source.file)):[],c=a?n.filter(g=>i.has(g)):n,d=[],p=o?.reduce((g,Pe)=>g+Pe.observationIds.length,0)??0,m=performance.now(),y=mr(e,c,t.profileSpan);G(d,"direct-extraction",m,c.length,y.observations.length,{filesVisited:c.length,filesReused:s.length,factsReused:u.length,factsInvalidated:Math.max(0,p-u.length)});let f=[...s,...y.fileCoverage].sort((g,Pe)=>g.file.localeCompare(Pe.file)),h=hr(f),C=f.flatMap(g=>g.extractionErrors),F=se([...u,...y.observations]),D=se([...F,...Lt(F)]);m=performance.now();let v=Et(e,D);G(d,"http-summary",m,D.length,v.observations.length,{filesVisited:v.filesInspected}),h.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:v.filesInspected,observations:v.observations.length,errors:v.errors.length}),C.push(...v.errors);let w=se([...D,...v.observations]);m=performance.now();let _=Pt(e,w);G(d,"http-mount",m,w.length,_.observations.length,{filesVisited:_.filesInspected});let M=se([...w,..._.observations]);m=performance.now();let b=St(e,M);G(d,"carrier",m,M.length,b.observations.length,{filesVisited:b.filesInspected}),h.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:b.bodySummaries,observations:b.observations.length,errors:b.errors.length}),C.push(...b.errors);let P=se([...M,...b.observations]);m=performance.now();let S=vr(P);G(d,"relations",m,P.length,S.length),m=performance.now();let Ue=Sr(P,S);G(d,"links",m,S.length,Ue.length),xr(P,S),m=performance.now();let He=ge([...Nr(P,S),...v.frontiers]);return G(d,"frontiers",m,P.length,He.length),{schemaVersion:2,extractorVersion:qe,observations:P,relationGroups:S,links:Ue,frontiers:He,coverage:{filesScanned:n.length,filesWithAst:f.filter(g=>g.hasAst).length,filesWithoutAst:f.filter(g=>!g.hasAst).length,...a?{filesReused:s.length}:{},extractors:[...h.values()],extractionErrors:C,phases:d},fileCoverage:f}}function G(e,t,n,r,i,o={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...o})}function mr(e,t,n){let r=[],i=[];for(let o of t){let a=j(e,o),s=_e.filter(c=>c.supports(a)),l=s.length>0?N(e,o,a,n):null,u={file:o,hasAst:l!==null||yr(o,a),observationIds:[],extractors:[],extractionErrors:[]};if(l)for(let c of s){let d={id:c.id,applicableFiles:1,observations:0,errors:0};try{let p=fr(n,`runtime-boundaries.extractor.${c.id}`,o,()=>c.extract(l));d.observations=p.length,r.push(...p),u.observationIds.push(...p.map(m=>m.id))}catch(p){d.errors=1,u.extractionErrors.push(`${c.id} failed for ${o}: ${p instanceof Error?p.message:String(p)}`)}u.extractors.push(d)}i.push(u)}return{observations:r,fileCoverage:i}}function fr(e,t,n,r){return e?e(t,r,{file:n}):r()}function yr(e,t){return t?Ge(e)?/<script\b/iu.test(t):ue(e)!==null:!1}function hr(e){let t=new Map(_e.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 gr(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function vr(e){let t=new Map;for(let n of xe){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 o=Ir(i,n.keyNames);if(!o)continue;let a=o.map(d=>`${d.name}=${Ot(d.name,d.value)}`).join("\0"),s=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${s}\0${a}`,u=`boundary-group:${_t("sha256").update(l).digest("hex").slice(0,16)}`,c=t.get(u)??{id:u,protocol:n.protocol,joinRule:n.id,normalizedKey:a,keyParts:o,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(br).sort(Pr)}function br(e){return{...e,producerIds:be(e.producerIds),consumerIds:be(e.consumerIds),declarationIds:be(e.declarationIds),derivation:{...e.derivation,inputFactIds:be(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function Sr(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let o=xe.find(s=>s.id===i.joinRule);if(!o?.traversable)continue;let a=o.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(a.length===0||i.consumerIds.length===0)&&!(o.requireUniquePair&&(a.length!==1||i.consumerIds.length!==1))&&!(o.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(a.length*i.consumerIds.length>dr))for(let s of a)for(let l of i.consumerIds){let u=n.get(s),c=n.get(l);if(!u||!c||wr(u,c))continue;let d=u.strength==="derived"||c.strength==="derived"?"derived":"exact",p=`${i.joinRule}\0${s}\0${l}`,m={id:`boundary-link:${_t("sha256").update(p).digest("hex").slice(0,16)}`,from:s,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:d,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[s,l],sourceSpans:[u.source,c.source]}};r.set(m.id,m)}}return[...r.values()].sort(Br)}function xr(e,t){let n=new Set(t.filter(At).flatMap(Se)),r=new Set(t.filter(Cr).flatMap(Se));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function Nr(e,t){let n=new Set(e.filter(o=>o.strength!=="candidate").map(o=>`${o.action}\0${o.source.file}\0${o.source.startLine}\0${o.source.endLine}`)),r=new Set(t.flatMap(Se)),i=new Set(t.filter(At).flatMap(Se));return e.filter(o=>o.sourceScope==="production").filter(o=>o.strength!=="candidate"||!n.has(`${o.action}\0${o.source.file}\0${o.source.startLine}\0${o.source.endLine}`)).filter(o=>!i.has(o.id)).map(o=>{let a=o.keyParts.filter(l=>l.evidence==="expression"||l.value.length===0).map(l=>l.name),s=a.length>0?`${o.extractor} observed ${o.action}, but ${a.join(", ")} remained symbolic or unknown.`:o.resolution==="ambiguous"?`${o.extractor} established the address for ${o.action}, but more than one indexed peer has the same runtime key.`:r.has(o.id)?`${o.extractor} established the address for ${o.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${o.extractor} observed ${o.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:o.id,reason:s,missingKeyParts:a,sourceScope:o.sourceScope}}).sort((o,a)=>o.observationId.localeCompare(a.observationId))}function Se(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function At(e){let t=xe.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 Cr(e){let t=xe.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 Ir(e,t){let n=[];for(let r of t){let i=e.keyParts.find(o=>o.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:Ot(r,i.value)})}return n}function Ot(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 wr(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function se(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 be(e){return[...new Set(e)].sort()}function Pr(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function Br(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}import Fr from"better-sqlite3";var Ce="scip_query_runtime_boundaries",K="scip_query_runtime_observations",Ie="scip_query_runtime_relation_groups",we="scip_query_runtime_relation_participants";function Rr(e,t){let n=new Fr(e);try{n.exec(`
|
|
2
|
+
CREATE TABLE IF NOT EXISTS ${Ce} (
|
|
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
|
+
`),$r(n),n.transaction(()=>{n.prepare(`INSERT OR REPLACE INTO ${Ce} (singleton, schema_version, extractor_version, payload) VALUES (1, ?, ?, ?)`).run(t.schemaVersion,t.extractorVersion,JSON.stringify(t)),n.prepare(`DELETE FROM ${K}`).run(),n.prepare(`DELETE FROM ${we}`).run(),n.prepare(`DELETE FROM ${Ie}`).run();let r=n.prepare(`INSERT INTO ${K}
|
|
9
|
+
(id, protocol, action, role, strength, source_scope, resolution, file, start_line, end_line, owner_symbol, payload)
|
|
10
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let a of t.observations)r.run(a.id,a.protocol,a.action,a.role,a.strength,a.sourceScope,a.resolution,a.source.file,a.source.startLine,a.source.endLine,a.owner.symbol,JSON.stringify(a));let i=n.prepare(`INSERT INTO ${Ie} (id, protocol, join_rule, normalized_key, payload) VALUES (?, ?, ?, ?, ?)`),o=n.prepare(`INSERT INTO ${we} (group_id, observation_id, participant_role) VALUES (?, ?, ?)`);for(let a of t.relationGroups){i.run(a.id,a.protocol,a.joinRule,a.normalizedKey,JSON.stringify(a));for(let s of a.producerIds)o.run(a.id,s,"producer");for(let s of a.consumerIds)o.run(a.id,s,"consumer");for(let s of a.declarationIds)o.run(a.id,s,"declaration")}})()}finally{n.close()}}function Er(e,t={}){if(!Tr(e,K))return Dt(e)?.observations??[];let n=[],r=[];return Ne(n,r,"protocol",t.protocols),Ne(n,r,"action",t.actions),Ne(n,r,"source_scope",t.sourceScopes),Ne(n,r,"file",t.files),e.all(`SELECT payload FROM ${K}${n.length>0?` WHERE ${n.join(" AND ")}`:""} ORDER BY file, start_line, id`,...r).flatMap(o=>kr(o.payload))}function $r(e){e.exec(`
|
|
11
|
+
CREATE TABLE IF NOT EXISTS ${K} (
|
|
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 ${K}(protocol, action, source_scope);
|
|
27
|
+
CREATE INDEX IF NOT EXISTS idx_runtime_observations_file_line
|
|
28
|
+
ON ${K}(file, start_line);
|
|
29
|
+
|
|
30
|
+
CREATE TABLE IF NOT EXISTS ${Ie} (
|
|
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 ${Ie}(protocol, join_rule, normalized_key);
|
|
39
|
+
|
|
40
|
+
CREATE TABLE IF NOT EXISTS ${we} (
|
|
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 ${we}(observation_id, participant_role);
|
|
48
|
+
`)}function Tr(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function Ne(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function kr(e){try{return[JSON.parse(e)]}catch{return[]}}function Dt(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",Ce))return null;let n=e.get(`SELECT schema_version, payload FROM ${Ce} 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}}export{de as a,L as b,re as c,ie as d,qe as e,pr as f,Rr as g,Er as h,Dt as i};
|
|
49
|
+
//# sourceMappingURL=chunk-SWFAFA4G.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as p}from"./chunk-JVZNWJBH.js";import{a as y}from"./chunk-6BJ7SOY7.js";import{a as h}from"./chunk-ICUQONOG.js";import{o as u}from"./chunk-RGCJ4646.js";import{a as S,c as b}from"./chunk-LPGDO2XA.js";import{A as d,d as m}from"./chunk-5IZTXSOL.js";function x(e,o,r={}){let{direction:c="backward",maxDepth:s=3}=r,l=S(e,o);return l?c==="backward"?k(e,l,s,{semantic:r.semantic!==!1}):D(e,l,{semantic:r.semantic!==!1}):null}function j(e,o,r={}){return x(e,o,r)}function k(e,o,r,c){let s=[],l=new Set([o.symbol]),t=[o];for(let n=1;n<=r&&t.length!==0;n++){let i=[];for(let g of t){let w=h(e,g,{semantic:c.semantic,semanticEvidence:y});for(let a of w){if(l.has(a.symbol))continue;l.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function D(e,o,r){let c=new Set,s=[],l=new p(e);for(let t of u(e,o,{semantic:r.semantic,semanticEvidence:y})){if(s.length>=30)break;let n=t.enclosingSymbol??d(l.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{x as a,j as b};
|
|
2
|
+
//# sourceMappingURL=chunk-SYUNTKO2.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as m}from"./chunk-Q7HB7BFJ.js";import{a as p}from"./chunk-3VLJ2DCA.js";import{$ as d,da as P,ea as h,g as f}from"./chunk-4DCKBY6T.js";import{realpathSync as c}from"fs";import{basename as x,dirname as L,join as T,relative as I,sep as O}from"path";import{fileURLToPath as S,pathToFileURL as y}from"url";function F(n,e){return e==="."||e==="./"?y(c(n)).href:y(d(n,e).absolutePath).href}function b(n,e){let r=S(e);return I(c(n),v(r)).split(O).join("/")}function v(n){try{return c(n)}catch{try{return T(c(L(n)),x(n))}catch{return n}}}function H(n,e,r){return{textDocument:{uri:F(n,e.relativePath)},position:z(n,e),context:{includeDeclaration:r}}}function z(n,e){let r={line:e.startLine,character:e.startChar??0};try{return M(P(n,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(t){if(!h(t))throw t;return r}}function M(n,e,r={line:e.startLine,character:e.startChar??0}){let t=n.split(/\r?\n/),o=t[e.startLine];if(o===void 0||e.leaf.length===0)return r;let i=Math.max(0,Math.min(r.character,o.length)),s=o.indexOf(e.leaf,i);if(s>=0)return{line:e.startLine,character:u(s,e.leaf)};let a=o.indexOf(e.leaf);if(a>=0)return{line:e.startLine,character:u(a,e.leaf)};let l=D(t,e.startLine,e.leaf);return l||r}function u(n,e){return n+Math.max(0,e.length-2)}function D(n,e,r){for(let t of[-1,1,-2,2]){let o=e+t;if(o<0||o>=n.length)continue;let i=n[o].indexOf(r);if(i>=0)return{line:o,character:u(i,r)}}return null}function K(n,e){return e.map(r=>({file:b(n,r.uri),line:r.range.start.line,column:r.range.start.character}))}function X(n){let e=new Map;for(let r of n)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,t)=>{let o=r.file.localeCompare(t.file);return o!==0?o:r.line!==t.line?r.line-t.line:r.column-t.column})}import{randomUUID as E}from"crypto";import{readdirSync as $,rmSync as j,writeFileSync as A}from"fs";import{join as g}from"path";var R="rust-analyzer-owner-",w=".json",U=16*1024;function Z(n,e){if(!n||!e.rootIdentity)return null;let r=g(n,`${R}${e.rootPid}-${E()}${w}`),t={version:1,rootIdentity:e.rootIdentity,ownsProcessGroup:e.ownsProcessGroup};return A(r,`${JSON.stringify(t)}
|
|
2
|
+
`,{encoding:"utf8",mode:384,flag:"wx"}),r}function ee(n){n&&j(n,{force:!0})}async function re(n,e){if(!n)return[];let r;try{r=$(n)}catch{return[]}let t=r.filter(s=>s.startsWith(R)&&s.endsWith(w)).map(s=>g(n,s)),o=[],i=[];for(let s of t){let a=C(s);a?i.push(a):o.push({reaped:!1,reason:"identity-unavailable",detail:`Rust analyzer ownership record ${s} could not be validated.`})}return o.push(...await Promise.all(i.map(s=>m(s,e)))),o}function C(n){try{let e=f(n,{maxBytes:U,inputKind:"rust-analyzer process ownership record"}),r=JSON.parse(e),t=p(r.rootIdentity);return r.version!==1||!t||typeof r.ownsProcessGroup!="boolean"?null:{rootPid:t.pid,rootIdentity:t,ownsProcessGroup:r.ownsProcessGroup,knownMembers:new Map([[t.pid,t]])}}catch{return null}}export{Z as a,ee as b,re as c,F as d,b as e,H as f,K as g,X as h};
|
|
3
|
+
//# sourceMappingURL=chunk-T6FRID7Y.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as R}from"./chunk-6BJ7SOY7.js";import{o as h}from"./chunk-RGCJ4646.js";import{a as g}from"./chunk-LPGDO2XA.js";import{h as d}from"./chunk-5IZTXSOL.js";import{a as m}from"./chunk-AA7K3XLM.js";import{x as p}from"./chunk-DMQ7ZKJG.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
|
|
2
|
+
`);for(let o=0;o<c.length;o++){let f=c[o]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:o})}}return e}function S(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{D as a};
|
|
3
|
+
//# sourceMappingURL=chunk-TGWNNMPF.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as ye}from"./chunk-35IW3P4H.js";import{h as I,l as W}from"./chunk-I3U2FN2T.js";import{C as O}from"./chunk-AA7K3XLM.js";import{e as me,x as pe,z as G}from"./chunk-DMQ7ZKJG.js";var Pe=12,Te=20,re=200,oe=800,Ae=.9,Oe=64,De=me("behavior-construct-ranges"),Se={if_statement:"branch",conditional_expression:"branch",ternary_expression:"branch",switch_statement:"branch",switch_expression:"branch",switch_case:"branch",case_statement:"branch",match_statement:"branch",match_expression:"branch",match_arm:"branch",for_statement:"loop",for_in_statement:"loop",for_of_statement:"loop",while_statement:"loop",do_statement:"loop",await_expression:"await",return_statement:"return",throw_statement:"throw",raise_statement:"throw",assignment_expression:"mutation",augmented_assignment_expression:"mutation",assignment:"mutation",pair:"shape",field_initializer:"shape",spread_element:"spread",dictionary_splat:"spread",catch_clause:"catch",except_clause:"catch",finally_clause:"finally"},Z=["anchor","signature","binding","branch","loop","call","await","return","throw","mutation","shape","spread","catch","finally"],ge=[...Z,"lifecycle"],Ce=["loop","await","throw","mutation","spread","catch","finally","lifecycle"],Ie=new Set(["onBeforeMount","onBeforeUnmount","onMounted","onUnmounted","useEffect","useInsertionEffect","useLayoutEffect"]);var _e=new Set(["object","object_pattern","dictionary","field_declaration_list","struct_expression","struct_pattern"]);function mt(e,n,t,o,r=[],s={}){let a=O(e,n);if(!a)return null;let h=G(e,n),c=Ne(e,n,t,o,r),l=te(e,n,c.startLine,c.endLine),u=l?.startLine??t,p=l?.endLine??o,N=(l?D(a.rootNode,c.startLine,c.endLine):null)??I(a.rootNode,u,p);if(!N)return null;let b=Le(N,h,u,p,r);if(!b||b.lines.length===0||b.lines.some(S=>S.text.length>oe))return null;let m=tt(h,u,p),C=nt(b);if((s.requireSavings??!0)&&C>=m*Ae)return null;let v=Z.filter(S=>b.lines.some(x=>x.signals.includes(S)));return{...l?{callable:{name:l.name,startLine:l.startLine,endLine:l.endLine}}:{},representation:"outline",constructKind:b.constructKind,signature:b.signature,lines:b.lines,signals:v,testCases:ye(n)==="test"?st(h,u,p):[],coverage:{sourceStatements:b.sourceStatements,representedStatements:b.sourceStatements,copiedStatements:b.copiedStatements,omittedStatements:0},rawCharacters:m,outlineCharacters:C,candidateLines:b.sourceStatements,omittedLines:0}}function pt(e,n,t,o,r){if(r.length===0)return[];let s=O(e,n);if(!s)return[];let a=G(e,n),h=Ne(e,n,t,o,r),c=te(e,n,h.startLine,h.endLine),l=c?.startLine??t,u=c?.endLine??o,p=(c?D(s.rootNode,h.startLine,h.endLine):null)??I(s.rootNode,l,u);if(!p)return[];let N=Le(p,a,l,u,r);return N?N.lines.filter(b=>b.text.length<=oe&&b.signals.some(m=>["branch","loop","catch","finally"].includes(m))&&r.some(m=>m>=b.line&&m<=b.endLine)):[]}function yt(e,n,t,o){let r=O(e,n);if(!r)return null;let s=D(r.rootNode,t,o)??I(r.rootNode,t,o);if(!s)return null;let a=[],h=ae(s),c=[];return se(s,s,l=>{if(k.has(l.type)||ke.has(l.type)){$e(a,c,l);return}if(ee.has(l.type)){qe(a,c,l);return}if(z.has(l.type)){ze(a,c,l);return}j.has(l.type)&&je(a,l)}),{facts:Ue(a),terminals:we(h),unsupported:c}}function Ne(e,n,t,o,r=[]){let s=r.filter(u=>u>=t&&u<=o),a=De.get(e,n,pe(e,n)??"",()=>new Map),h=`${t}:${o}:${s.join(",")}`,c=a.get(h);if(c)return a.delete(h),a.set(h,c),{startLine:c[0],endLine:c[1]};let l=Me(e,n,t,o,s);if(a.set(h,[l.startLine,l.endLine]),a.size>Oe){let u=a.keys().next().value;u!==void 0&&a.delete(u)}return l}function Me(e,n,t,o,r){let s=O(e,n),a=[];if(r.length>0&&s){let u=[],p=r[0],N=p;for(let m of r)p=Math.min(p,m),N=Math.max(N,m);Ee(s.rootNode,p,N,m=>{Ve(m)&&m.startPosition.row>=t&&m.endPosition.row<=o&&r.every(C=>m.startPosition.row<=C&&m.endPosition.row>=C)&&u.push(m),P.has(m.type)&&m.startPosition.row>=t&&m.endPosition.row<=o&&r.every(C=>m.startPosition.row<=C&&m.endPosition.row>=C)&&a.push(m)});let b=u.sort((m,C)=>m.endPosition.row-m.startPosition.row-(C.endPosition.row-C.startPosition.row)||m.startPosition.row-C.startPosition.row)[0];if(b)return{startLine:b.startPosition.row,endLine:b.endPosition.row}}let h=te(e,n,t,o);if(h)return{startLine:h.startLine,endLine:h.endLine};if(r.length===0)return{startLine:t,endLine:o};let c=(W(e,n)?.callables??[]).filter(u=>u.startLine>=t&&u.endLine<=o&&r.every(p=>u.startLine<=p&&u.endLine>=p)).sort((u,p)=>u.endLine-u.startLine-(p.endLine-p.startLine)||u.startLine-p.startLine)[0];if(!s)return c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o};let l=a.sort((u,p)=>u.endPosition.row-u.startPosition.row-(p.endPosition.row-p.startPosition.row)||u.startPosition.row-p.startPosition.row)[0];return l?{startLine:l.startPosition.row,endLine:l.endPosition.row}:c?{startLine:c.startLine,endLine:c.endLine}:{startLine:t,endLine:o}}function bt(e,n,t,o,r={}){if(o-t+1<(r.minimumBodyLines??Te))return null;let a=Re(e,n,t,o,[],!1);if(!a)return null;let h=a.candidates.map(S=>({...S,signals:S.signals.filter(x=>x!=="anchor"&&x!=="signature")})).filter(S=>S.signals.length>0);if(h.length===0)return null;let c=it(h),l=h.filter(S=>S.text.length<=re);if(l.length===0)return null;let u=Ce.filter(S=>(c[S]??0)>0),p=u.filter(S=>S!=="await"),N=a.shapes.reduce((S,x)=>S+x.fields.length,0);if(p.length===0&&!((c.await??0)>0&&N>0)&&N<3)return null;let b=at(l,c),m=new Map;for(let S of u){let x=b.find(f=>f.signals.includes(S));x&&m.set(x.line,x)}if(m.size===0){let S=b.find(x=>x.signals.includes("branch"));S&&m.set(S.line,S)}let C=Math.min(10,Math.max(1,r.maxLines??m.size)),v=new Map;for(let S of m.values()){if(v.size>=C)break;v.set(S.line,S)}return v.size>=h.length&&a.shapes.length===0?null:{owner:a.callable?.name??null,startLine:t,endLine:o,lines:[...v.values()].sort((S,x)=>S.line-x.line),shapes:a.shapes,signalCounts:c,candidateLines:h.length,omittedLines:h.length-v.size}}function St(e,n,t,o){let r=Re(e,n,t,o,[],!1);return r?new Map(r.candidates.map(s=>[s.line,s.signals.filter(a=>a!=="lifecycle")])):new Map}var P=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),B=new Set(["block","body","compound_statement","declaration_list","statement_block"]),k=new Set(["if_expression","if_statement","unless","unless_statement"]),ke=new Set(["conditional_expression","ternary_expression"]),ee=new Set(["do_statement","enhanced_for_statement","for_expression","for_in_statement","for_of_statement","for_statement","loop_expression","while_statement"]),z=new Set(["match_expression","match_statement","switch_expression","switch_statement"]),ve=new Set(["case_statement","match_arm","switch_case","switch_default"]),j=new Set(["try_expression","try_statement"]),X=new Set(["catch_clause","except_clause","rescue"]),$=new Set(["ensure","finally_clause"]),Y=new Set(["else","else_clause"]),xe=new Set(["raise_statement","return_statement","throw_statement"]),Ye=new Set(["block_comment","comment","line_comment"]);function $e(e,n,t){let o=t.childForFieldName("condition")??le(t),r=t.childForFieldName("consequence")??t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),s=t.childForFieldName("alternative")??t.namedChildren.find(c=>Y.has(c.type));if(!o||!r){n.push(ce(t,"conditional-fields-unresolved"));return}let a=F(o,"predicate",o.text),h=F(r,be(r),"consequence");if(E(e,a,h,"predicate-consequence",{branchRole:"consequence"}),J(e,a,r,"consequence"),s){let c=F(s,be(s),"alternative");E(e,a,c,"predicate-alternative",{branchRole:"alternative"}),J(e,a,s,"alternative");return}E(e,a,ie(a,"otherwise continue"),"predicate-fallthrough",{branchRole:"fallthrough"})}function qe(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(a=>B.has(a.type));if(!o){n.push(ce(t,"loop-body-unresolved"));return}let r=t.childForFieldName("condition"),s=F(r??t,"predicate",r?.text??R(t,o));E(e,s,F(o,"outcome","iteration"),"loop-iteration",{branchRole:"iteration"}),J(e,s,o,"iteration"),E(e,s,ie(s,"loop exits"),"loop-exit",{branchRole:"exit"})}function ze(e,n,t){let o=t.childForFieldName("body")??t.namedChildren.find(c=>B.has(c.type)),r=t.childForFieldName("value")??t.childForFieldName("condition")??t.childForFieldName("subject")??le(t),s=Ke(o??t);if(!r||s.length===0){n.push(ce(t,"switch-cases-unresolved"));return}let a=F(r,"predicate",r.text),h=!1;for(let c of s){let l=We(c);h||=l;let u=R(c,c.namedChildren.find(p=>Q(p)));E(e,a,F(c,"outcome",u||(l?"default":"case")),l?"predicate-default":"predicate-case",{branchRole:l?"default":"case"}),J(e,a,c,l?"default":"case")}h||E(e,a,ie(a,"no case matched"),"predicate-fallthrough",{branchRole:"fallthrough"})}function je(e,n){let t=F(n,"scope","try");for(let o of Ge(n)){let r=$.has(o.type),s=F(o,"handler",r?"finally":R(o,U(o)));E(e,t,s,r?"finally-cleanup":"exception-handler",{branchRole:r?"finally":"catch"}),He(e,s,o,r?"finally":"catch")}}function He(e,n,t,o){for(let r of ae(t)){let s=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,s==="throw"?"handler-throw":"handler-return",{branchRole:o,terminalKind:s})}}function J(e,n,t,o){for(let r of ae(t)){let s=r.label.startsWith("throw")||r.label.startsWith("raise")?"throw":"return";E(e,n,r,s==="throw"?"predicate-throw":"predicate-return",{branchRole:o,terminalKind:s})}}function E(e,n,t,o,r){e.push({controller:n,outcome:t,subtype:o,attributes:r})}function F(e,n,t){return{kind:n,label:q(t).slice(0,oe),startLine:e.startPosition.row,endLine:e.endPosition.row,implicit:!1}}function ie(e,n){return{...e,kind:"outcome",label:n,implicit:!0}}function be(e){return xe.has(e.type)?"terminal":"outcome"}function ae(e){let n=[];return se(e,e,t=>{xe.has(t.type)&&n.push(F(t,"terminal",t.text))}),we(n)}function se(e,n,t){t(n);for(let o of n.namedChildren)o!==e&&P.has(o.type)||se(e,o,t)}function Ke(e){let n=[],t=o=>{for(let r of o.namedChildren)z.has(r.type)||(ve.has(r.type)?n.push(r):t(r))};return t(e),n}function Ge(e){let n=[],t=o=>{for(let r of o.namedChildren)j.has(r.type)||(X.has(r.type)||$.has(r.type)?n.push(r):P.has(r.type)||t(r))};return t(e),n}function We(e){let n=R(e,e.namedChildren.find(t=>Q(t))).trim();return e.type==="switch_default"||/^(?:default\b|_\s*=>)/u.test(n)}function ce(e,n){return{startLine:e.startPosition.row,endLine:e.endPosition.row,reason:n}}function Ue(e){let n=new Map;for(let t of e)n.set(`${t.controller.startLine}\0${t.controller.endLine}\0${t.outcome.startLine}\0${t.outcome.endLine}\0${t.subtype}\0${t.outcome.label}`,t);return[...n.values()]}function we(e){let n=new Map;for(let t of e)n.set(`${t.startLine}\0${t.endLine}\0${t.kind}\0${t.label}`,t);return[...n.values()]}function Ve(e){return P.has(e.type)||ee.has(e.type)||z.has(e.type)||j.has(e.type)||X.has(e.type)||$.has(e.type)}function Le(e,n,t,o,r){let a=D(e,t,o)??e,h=U(a),c=[],l=0,u=0,p=(i,d,y,g,w=!1,A=!0)=>{let K=w?y.trim():q(y);if(!K)return;let T=Math.max(t,i.startPosition.row),de=Math.min(o,i.endPosition.row);c.push({line:T,endLine:Math.max(T,de),depth:d,signals:Z.filter(he=>g.includes(he)||he==="anchor"&&r.some(fe=>fe>=T&&fe<=de)),text:K,copied:w}),A&&(l+=1,w&&(u+=1))},N=(i,d)=>{for(let y of i.namedChildren)_(y,d)},b=(i,d)=>{if(k.has(i.type)){m(i,d,"else if");return}if(Y.has(i.type)){let y=i.namedChildren.find(w=>k.has(w.type));if(y){m(y,d,"else if");return}p(i,d,"else",["branch"],!1,!1);let g=U(i)??i.namedChildren.find(w=>B.has(w.type));if(g)_(g,d+1);else for(let w of i.namedChildren)_(w,d+1);return}p(i,d,"else",["branch"],!1,!1),_(i,d+1)},m=(i,d,y=i.type.startsWith("unless")?"unless":"if")=>{let g=i.childForFieldName("condition")??le(i),w=i.childForFieldName("consequence")??i.childForFieldName("body")??i.namedChildren.find(T=>B.has(T.type)),A=i.childForFieldName("alternative")??i.namedChildren.find(T=>Y.has(T.type)),K=g?g.text:R(i,w);p(i,d,`${y} ${Ze(K)}`,M(g,["branch"])),w&&_(w,d+1),A&&b(A,d)},C=(i,d)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,d,R(i,y),M(i,["loop"])),y&&_(y,d+1)},v=(i,d)=>{let y=i.childForFieldName("body")??i.namedChildren.find(g=>B.has(g.type));p(i,d,R(i,y),M(i,["branch"])),y&&_(y,d+1)},S=(i,d)=>{let y=i.namedChildren.find(g=>Q(g));p(i,d,R(i,y),["branch"],!1,!1);for(let g of i.namedChildren)(g===y||Q(g))&&_(g,d+1)},x=(i,d)=>{p(i,d,"try",[],!1);for(let y of i.namedChildren)B.has(y.type)?_(y,d+1):(X.has(y.type)||$.has(y.type))&&_(y,d)},f=(i,d,y)=>{let g=i.childForFieldName("body")??i.namedChildren.find(A=>B.has(A.type)),w=y==="finally"?"finally":R(i,g);p(i,d,w,[y],!1,!1),g&&_(g,d+1)},L=(i,d)=>{let y=U(i);p(i,d,R(i,y),M(i,["binding"])),y&&_(y,d+1)},_=(i,d)=>{if(i.startPosition.row>o||i.endPosition.row<t||Ye.has(i.type)||i.type==="empty_statement")return;if(B.has(i.type)){N(i,d);return}if(k.has(i.type)){m(i,d);return}if(ee.has(i.type)){C(i,d);return}if(z.has(i.type)){v(i,d);return}if(ve.has(i.type)){S(i,d);return}if(j.has(i.type)){x(i,d);return}if(X.has(i.type)){f(i,d,"catch");return}if($.has(i.type)){f(i,d,"finally");return}if(Y.has(i.type)){b(i,d);return}if(P.has(i.type)){L(i,d);return}let g=!Be(i)||et(i);p(i,d,i.text,M(i),g)};return _(h&&h!==a?h:a,0),l===0?null:{constructKind:Qe(a),signature:Je(a,h,n,t),lines:c,sourceStatements:l,copiedStatements:u}}function D(e,n,t){let o=e.namedChildren.filter(r=>r.startPosition.row<=n&&r.endPosition.row>=t);for(let r of o.sort(Xe)){let s=D(r,n,t);if(s)return s}return P.has(e.type)&&e.startPosition.row<=n&&e.endPosition.row>=t?e:null}function Xe(e,n){return e.endPosition.row-e.startPosition.row-(n.endPosition.row-n.startPosition.row)||e.startPosition.row-n.startPosition.row}function U(e){return e.childForFieldName("body")??e.childForFieldName("consequence")??e.namedChildren.find(n=>B.has(n.type))??null}function Je(e,n,t,o){let r=R(e,n);return r||(t[o]??e.text).trim()}function Qe(e){return e.type.includes("constructor")?"constructor":e.type.includes("method")||e.type==="method"?ne(e,new Set(["class_body","class_declaration","class_definition"]))?"class method":"object method":e.type==="arrow_function"||e.type==="function_expression"||e.type==="lambda"?ne(e,new Set(["object","pair"]))?"object member":"function value":e.type.includes("function")?ne(e,P)?"nested function":"module function":"source construct"}function ne(e,n){let t=e.parent;for(;t;){if(n.has(t.type))return!0;t=t.parent}return!1}function le(e){return e.namedChildren.find(n=>!B.has(n.type)&&!Y.has(n.type))??null}function R(e,n){if(!n)return q(e.text);let t=Math.max(0,n.startIndex-e.startIndex);return q(e.text.slice(0,t)).replace(/[:{]\s*$/u,"").trim()}function Ze(e){let n=q(e);return n.startsWith("(")&&n.endsWith(")")?n.slice(1,-1).trim():n}function q(e){return e.trim().replace(/\r?\n[\t ]*/gu," ")}function M(e,n=[]){let t=new Set(n);return e&&H(e,o=>{let r=Se[o.type];r&&t.add(r),o.type==="call_expression"&&(t.add("call"),Fe(o)&&t.add("shape")),ue.has(o.type)&&t.add("binding")}),Z.filter(o=>t.has(o))}function et(e){let n=!1;return H(e,t=>{n||!t.text.includes(`
|
|
2
|
+
`)||/(?:string|template|heredoc|raw_string)/u.test(t.type)&&(n=!0)}),n}function Q(e){return B.has(e.type)||k.has(e.type)||ee.has(e.type)||z.has(e.type)||j.has(e.type)||P.has(e.type)||Be(e)}function Be(e){return/(?:statement|declaration|expression|assignment|return|throw|raise|break|continue|yield|with_item)$/u.test(e.type)||ue.has(e.type)}function tt(e,n,t){let o=0;for(let r=n;r<=t;r+=1)o+=(e[r]?.length??0)+10;return o}function nt(e){return e.constructKind.length+e.signature.length+80+e.lines.reduce((n,t)=>n+t.text.length+t.depth*2+10,0)}function Re(e,n,t,o,r,s){let a=O(e,n);if(!a)return null;let h=G(e,n),c=te(e,n,t,o),l=s?c?.startLine??t:t,u=s?c?.endLine??o:o,N=(c?.startLine===l&&c.endLine===u?D(a.rootNode,l,u):null)??I(a.rootNode,l,u);if(!N)return null;let b=new Map,m=new Map,C=new Map,v=(f,L)=>{if(f<l||f>u)return;let _=b.get(f)??new Set;_.add(L),b.set(f,_)};c&&v(c.startLine,"signature");for(let f of r)v(f,"anchor");H(N,f=>{let L=Se[f.type];if(L&&v(f.startPosition.row,L),L==="shape"&&rt(m,f,N,l,u),f.type==="call_expression"){let i=(f.childForFieldName("function")??f.namedChild(0))?.text.split(".").at(-1);if(Fe(f)){v(f.startPosition.row,"shape");let d=V(f.text);d.length<=re&&C.set(f.startPosition.row,d)}if(i&&Ie.has(i)){v(f.startPosition.row,"lifecycle");let d=V(f.text);d.length<=re&&C.set(f.startPosition.row,d)}}ue.has(f.type)&&v(f.startPosition.row,"binding")});let S=W(e,n);for(let f of S?.callSites??[])f.line<l||f.line>u||(v(f.line,"call"),f.calleeLeaf==="catch"&&v(f.line,"catch"));let x=[...b.entries()].sort(([f],[L])=>f-L).map(([f,L])=>({line:f,signals:ge.filter(_=>L.has(_)),text:C.get(f)??V(h[f]??"")})).filter(f=>f.text.length>0||f.signals.includes("anchor"));return{...c?{callable:c}:{},rangeStart:l,rangeEnd:u,sourceLines:h,candidates:x,shapes:[...m.values()].sort((f,L)=>f.startLine-L.startLine)}}function rt(e,n,t,o,r){if(n.startPosition.row<o||n.endPosition.row>r)return;let s=n.childForFieldName("key")??n.childForFieldName("name")??n.namedChild(0),a=V(s?.text??"");if(!a||a.includes(`
|
|
3
|
+
`)||a.length>60)return;let h=ot(n,t);if(h.startPosition.row<o||h.endPosition.row>r)return;let c=`${h.startPosition.row}:${h.endPosition.row}`,l=e.get(c)??{startLine:h.startPosition.row,endLine:h.endPosition.row,fields:[]};l.fields.some(u=>u.name===a&&u.line===n.startPosition.row)||l.fields.push({name:a,line:n.startPosition.row}),e.set(c,l)}function ot(e,n){let t=e.parent;for(;t&&t!==n.parent;){if(_e.has(t.type))return t;if(t===n)break;t=t.parent}return e.parent??e}function te(e,n,t,o){return W(e,n)?.callables.filter(r=>r.startLine<=t&&r.endLine>=o).sort((r,s)=>r.endLine-r.startLine-(s.endLine-s.startLine)||r.startLine-s.startLine)[0]}function H(e,n){n(e);for(let t of e.namedChildren)H(t,n)}function Ee(e,n,t,o){o(e);for(let r of e.namedChildren)r.startPosition.row>n||r.endPosition.row<t||Ee(r,n,t,o)}function V(e){return e.trim().replace(/\s+/gu," ")}function Fe(e){if(e.type!=="call_expression")return!1;let n=e.childForFieldName("arguments")??e.namedChildren.find(o=>o.type==="arguments"||o.type==="argument_list");if(!n)return!1;let t=!1;return H(n,o=>{_e.has(o.type)&&(t=!0)}),t}function it(e){let n={};for(let t of ge){let o=e.filter(r=>r.signals.includes(t)).length;o>0&&(n[t]=o)}return n}function at(e,n){let t=new Map;for(let s of e){let a=s.signals.join(",");t.set(a,(t.get(a)??0)+1)}let o=new Set(Ce),r=s=>{let a=t.get(s.signals.join(","))??1,h=Math.min(...s.signals.map(u=>n[u]??1)),c=s.signals.some(u=>o.has(u))?3:1,l=Math.max(0,s.signals.length-1)*1e3;return c*(1e3/a+1e3/h)+l};return[...e].sort((s,a)=>r(a)-r(s)||a.line-s.line)}var ue=new Set(["lexical_declaration","variable_declarator","const_item","static_item","let_declaration","assignment"]);function st(e,n,t){let o=[],r=/\b(?:describe|it|test)(?:\.(?:only|skip|todo))?\s*\(\s*(['"`])([^'"`]+)\1/u;for(let s=n;s<=t;s+=1){let a=r.exec(e[s]??"")?.[2];if(!(!a||o.includes(a))&&(o.push(a),o.length>=Pe))break}return o}export{mt as a,pt as b,yt as c,Ne as d,bt as e,St as f};
|
|
4
|
+
//# sourceMappingURL=chunk-TM5XEDDR.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as x,e as m,f as P,g as k,i as b,k as j}from"./chunk-7HU2IJ2T.js";import{f as T,v}from"./chunk-MO226P4Q.js";import{createHash as A}from"crypto";import{isUtf8 as K}from"buffer";import{TextDecoder as _}from"util";var O=new _("utf-8",{fatal:!0});function H(e){return j(e.config.projectRoot)}function V(e,t){let i=T(t),n;try{n=m(e.config.projectRoot,i,{inputKind:"repository text file"})}catch(o){if(b(o)||o instanceof x)return null;throw o}let r=W(n);return r===null?null:w(i,n,r,E(e),L(e))}function X(e,t={}){let i=[],n=C(e,t,r=>i.push(r));return{files:i,candidateFiles:n.candidateFiles,scannedBytes:n.scannedBytes,skippedBinaryPaths:n.skippedBinaryPaths,skippedUnreadablePaths:n.skippedUnreadablePaths,skippedOversizedPaths:n.skippedOversizedPaths}}function C(e,t,i){let n=H(e).filter(s=>!t.scope||s.includes(t.scope)),r=E(e),o=L(e),u=[],S=[],B=[],f=0,d=0,h={aligned:0,stale:0,unavailable:0},l=t.literalBytes?Buffer.isBuffer(t.literalBytes)?[t.literalBytes]:[...t.literalBytes]:[],F=l.length>0?Buffer.allocUnsafe(1024*1024):void 0;for(let s of n){let c,p,g=[],y=o.has(s);try{if(l.length>0){let a=l.length===1?P(e.config.projectRoot,s,l[0],{inputKind:"repository text file",computeSha256:y,scratchBuffer:F}):k(e.config.projectRoot,s,l,{inputKind:"repository text file",computeSha256:y,scratchBuffer:F});if(!a.isUtf8Text){u.push(s);continue}f+=a.byteLength,d+=1,p=a.sha256;let z=R(s,p,r,o);if(h[z.state]+=1,g="matchedLiteralIndexes"in a?a.matchedLiteralIndexes:a.includesLiteral?[0]:[],g.length===0||!a.bytes)continue;c=a.bytes}else c=m(e.config.projectRoot,s,{inputKind:"repository text file"})}catch(a){if(a instanceof x){B.push(s);continue}if(b(a))continue;S.push(s);continue}if(l.length===0&&!I(c)){u.push(s);continue}if(l.length===0){f+=c.byteLength,d+=1,p=y?M(c):void 0;let a=R(s,p,r,o);h[a.state]+=1}if(t.includeBytes&&!t.includeBytes(s,c))continue;let U=O.decode(c);i(w(s,c,U,r,o,p),g)}return{candidateFiles:n.length,scannedTextFiles:d,semanticFiles:h,scannedBytes:f,skippedBinaryPaths:u,skippedUnreadablePaths:S,skippedOversizedPaths:B}}function w(e,t,i,n,r,o){let u=o??M(t);return{relativePath:e,text:i,bytes:t.byteLength,freshness:{exactText:{state:"current",basis:"working-tree-read",sha256:u},semantic:R(e,u,n,r)}}}function R(e,t,i,n){if(!n.has(e))return{state:"unavailable",basis:"no-compiler-document"};let r=i.get(e);return!r||!t?{state:"unavailable",basis:"fingerprint-unavailable"}:{state:r===t?"aligned":"stale",basis:"indexed-input-fingerprint"}}function L(e){return new Set(e.all(`SELECT documents.relative_path FROM documents WHERE 1 = 1 ${e.pathExclusionsFor("documents")}`).map(t=>t.relative_path))}function E(e){let t=new Map;if(!e.generation.metadataRaw)return t;let i=v(e.generation.metadataRaw);if(i.kind!=="legacy"&&i.kind!=="supported")return t;let n=i.metadata.fingerprint;if(!D(n)||!Array.isArray(n.files))return t;for(let r of n.files)!D(r)||typeof r.path!="string"||typeof r.hash!="string"||t.set(r.path,r.hash);return t}function W(e){return I(e)?O.decode(e):null}function I(e){return!e.includes(0)&&K(e)}function M(e){return A("sha256").update(e).digest("hex")}function D(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}export{H as a,V as b,X as c,C as d};
|
|
2
|
+
//# sourceMappingURL=chunk-TNOHGHZQ.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as ue}from"./chunk-URMZLV2N.js";import{b as le}from"./chunk-BOJ5SVE2.js";import{c as T}from"./chunk-JVZNWJBH.js";import{a as N}from"./chunk-6BJ7SOY7.js";import{i as ce}from"./chunk-63MBA7EG.js";import{b as I}from"./chunk-ICUQONOG.js";import{i as ae}from"./chunk-RGCJ4646.js";import{a as re,b as se,c as oe}from"./chunk-ELNRLMC5.js";import{e as te,f as ne,h as ie}from"./chunk-HEOMG7IM.js";import{b as ee}from"./chunk-35IW3P4H.js";import{C as E,d as $,e as G,g as J,h as K,i as q,j as V,k as X,s as Y,x as Q}from"./chunk-5IZTXSOL.js";import{w as Z}from"./chunk-I3U2FN2T.js";import{C as x,a as S,z as H}from"./chunk-AA7K3XLM.js";import{b as w,h as U,r as b,u as j,w as W,x as P,z}from"./chunk-DMQ7ZKJG.js";import{d as L}from"./chunk-MO226P4Q.js";var _=new WeakMap,de=j({kind:"definition-exclusions",invalidation:W("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:Ie});function fe(e,t){let n=H(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let i=P(e,t);if(!i)return[];let o=U(e,t,i),c=de.read(e,t,o);if(c)return c;let u=n==="rust"?Be(e,t):Ae(e,t);return de.write(e,t,o,u),u}function Ie(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(Ne);return n.some(s=>s===null)?null:n}catch{return null}}function Ne(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"||t.containerName!==void 0&&typeof t.containerName!="string")return null;let n=t.disposition===void 0?Ve(t.reason):t.disposition;return n!=="exclude"&&n!=="implicit-usage"?null:{startLine:t.startLine,endLine:t.endLine,reason:t.reason,disposition:n,...t.containerName?{containerName:t.containerName}:{}}}var pe=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),Te=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,ke=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Ae(e,t){let n=P(e,t);if(!n||!Fe(n))return[];let s=x(e,t);if(!s)return[];let i=_.get(s);if(i)return i;let o=!1,c=s.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let r=d.namedChild(0);if(!r)continue;let a=r.type==="member_expression"?r.namedChild(r.namedChildCount-1)?.text:r.text;if(a&&pe.has(a)){o=!0;break}}let u=[];o&&u.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)",disposition:"exclude"});for(let l of c.namedChildren){let d=null,r=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,r=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,r=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let f=a.namedChild(0)?.text,p=a.namedChild(1);f&&(p?.type==="arrow_function"||p?.type==="function_expression")&&(d=f,r=a)}}d&&/^use[A-Z]/.test(d)&&r&&u.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...ye(s,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),_.set(s,u),u}function Fe(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of pe)if(e.includes(n)){t=!0;break}return t&&Te.test(e)?!0:e.includes("use")&&ke.test(e)}var Me=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Oe(e){return Me.test(e)}function ye(e,t,n){let s=[],i=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===o.startIndex&&u[d].type===o.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let r=u[d];if(n.has(r.type)){if(Oe(r.text)){s.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment",disposition:"exclude"});break}continue}if(!(r.type==="attribute_item"||r.type==="inner_attribute_item"))break}}for(let c of o.namedChildren)i(c)};return i(e.rootNode),s}function Be(e,t){let n=x(e,t);if(!n)return[];let s=_.get(n);if(s)return s;let i=[],o=Ue(n);return o?(_.set(n,o),o):(be(n.rootNode,i,!1,!1),i.push(...ye(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),i.push(...Ke(n.rootNode)),_.set(n,i),i)}function Ue(e){return Xe(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function be(e,t,n,s){let i=n,o=s;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)",disposition:"implicit-usage"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)",disposition:"implicit-usage"})),e.type==="function_item"||e.type==="function_signature_item"?je(e,t,n,s):s&&Je(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)",disposition:"implicit-usage"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?We(e,t,n):e.type==="mod_item"&&k(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(i=!0);for(let c of e.namedChildren)be(c,t,i,o)}function je(e,t,n,s){let i=k(e),o=null;s?o={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(o={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of i){if(ge(c)){o={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=$e(c);if(u){o=u;break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o.reason,disposition:o.disposition})}function We(e,t,n){let s=k(e),i=e.namedChildren.find(o=>o.type==="type_identifier")?.text;s.some(Ge)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:i}),s.some(ge)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:i}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:i})}function k(e){let t=e.parent;if(!t)return[];let n=t.children,s=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){s=o;break}if(s<=0)return[];let i=[];for(let o=s-1;o>=0;o-=1){let c=n[o];if(c.type==="attribute_item"||c.type==="inner_attribute_item")i.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return i}var ze=new Set(["test","bench","tokio::test","async_std::test"]),He=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),Ze=new Set(["allow","warn","deny","forbid","cfg","cfg_attr","doc","inline","cold","must_use","deprecated","repr","derive","automatically_derived","non_exhaustive","path","link","link_section","global_allocator","panic_handler"]);function $e(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=qe(e);return t?ze.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:He.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:Ze.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function Ge(e){return/#\[\s*derive\s*\(/.test(e)}function ge(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Je(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ke(e){let t=Ye(e);if(t.size===0)return[];let n=[];for(let s of e.descendantsOfType("mod_item")){let i=s.childForFieldName("name")?.text;i&&t.has(i)&&n.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:i})}return n}function qe(e){let t=/^#!?\[\s*([A-Za-z_][A-Za-z0-9_]*(?:\s*::\s*[A-Za-z_][A-Za-z0-9_]*)*)/.exec(e);return t?t[1].replace(/\s+/g,""):null}function Ve(e){return e==="#[tauri::command]"||e==="#[command]"||e==="#[wasm_bindgen]"||e==="#[no_mangle]"||e==="#[napi]"||e==="#[pyfunction]"||e==="#[pymethod]"||e==="#[pyo3]"||e==="#[doc(hidden)]"||e.startsWith("trait ")||e.startsWith("#[derive(<reflective>)]")||e.startsWith("#[derive(...)]")||e.startsWith('serde `with = "')||e.startsWith('attribute `with = "')||e.startsWith("Rust attribute macro #[")||e.startsWith("Rust ABI/export attribute #[")?"implicit-usage":"exclude"}function Xe(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var me=/\bwith\s*=\s*"([^"]+)"/g;function Ye(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){me.lastIndex=0;let s;for(;(s=me.exec(n.text))!==null;){let i=s[1],o=i.split("::").pop()??i;o&&t.add(o)}}return t}function he(e){let t=A(e);return(n,s,i,o)=>t(n,s,i,o)?.disposition==="exclude"}function A(e){let t=new Map,n=s=>{let i=t.get(s);if(i)return i;let o=fe(e,s),c=new Map;for(let u of o){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return i={ranges:o,containers:c},t.set(s,i),i};return(s,i,o,c)=>{let u=n(s),l=[];for(let r of u.ranges)i>=r.startLine&&i<=r.endLine&&l.push(r);let d=new Set;c&&d.add(c);for(let r of E(o))d.add(r);for(let r of d){let a=u.containers.get(r);a&&l.push(...a)}return Qe(l)}}function Qe(e){if(e.length===0)return null;let n=e.find(s=>s.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function vt(e,t={}){w(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function xe(e,t,n={}){w(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function _e(e,t){if(t.isIgnoredPath(e.relativePath))return y("ignored-file");if(q(e.symbol))return y("module-like-symbol");if(!R(e.symbol))return y("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&R(e.enclosingSymbol))return y("nested-non-callable-value");if(!t.includeTests&&!et(e.relativePath))return y("test-file");if(!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName))return y("excluded-file-region");let n=G(e.symbol);if(n==="<constructor>")return y("implicit-constructor");if(e.symbol.startsWith("scip-python ")){if(n==="__all__")return y("python-runtime-metadata");if(/^__[^_].*__$/.test(n))return y("python-protocol-member")}return t.isDeclarationOnlyCallable()?y("declaration-only-callable"):t.isFrameworkContractCallable()?y("framework-contract-member"):V(e.symbol)?y("rust-trait-impl-member"):X(e.symbol)?y("rust-test-module"):!t.includeMembers&&!tt(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}}function et(e){return ee(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function R(e){return K(e)||e.endsWith("().")||e.endsWith(".")}function tt(e){return J(e.symbol)||E(e.symbol).length===0}function Se(){return new Map}function Ee(e,t,n){let s=new Map;for(let i of re(e,n))e.isIgnored(i.relative_path)||t.has(i.relative_path)||v(s,i.symbol_id,i.relative_path,i.ref_count,"scip-mention");return s}function Re(e,t,n,s={}){let i=new Set;if(s.conservative||n.size===0){for(let o of oe(e,t))i.add(o.symbol_id);return i}for(let o of se(e,t))e.isIgnored(o.relative_path)||n.has(o.relative_path)||i.add(o.symbol_id);return i}function F(e,t){let n=e.get(t);if(!n)return!1;for(let s of n.values())if(s.occurrences>0)return!0;return!1}function C(e,t,n){let s=e.get(t);if(!s)return!1;for(let[i,o]of s)if(i!==n&&o.occurrences>0)return!0;return!1}function Ce(e){return e?.occurrences??0}function v(e,t,n,s,i="source-fallback"){if(s<=0)return;let o=De(e,t,n);o.occurrences+=s,o.sources.add(i)}function ve(e,t,n,s,i){if(s<=0)return;let o=De(e,t,n);o.occurrences=Math.max(s,o.occurrences),o.sources.add(i)}function De(e,t,n){let s=e.get(t);s||(s=new Map,e.set(t,s));let i=s.get(n);return i||(i={occurrences:0,sources:new Set},s.set(n,i)),i}var nt=1e3,it=300;function Qt(e,t={}){let{scope:n,minLoc:s=1,includeTests:i=!1,skipBarrels:o=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,r=0,a=b("dead.candidates",()=>{let m=le(rt(e,{scope:n,minLoc:s,includeTests:i,includeMembers:c}),l);return r=m.length,m},()=>({definitions:r})),f=0,p=o?b("dead.inactive-barrels",()=>{let m=new Set(te(e));return f=m.size,m},()=>({paths:f})):new Set,M=0,g=u?Se():b("dead.mention-reference-counts",()=>{let m=Ee(e,p,a.map(D=>D.symbolId));return M=m.size,m},()=>({definitions:a.length,symbolsWithReferences:M})),O=0,we=u?b("dead.mentioned-symbol-ids",()=>{let m=Re(e,a.map(D=>D.symbolId),p,{conservative:p.size===0});return O=m.size,m},()=>({definitions:a.length,referencedSymbols:O})):new Set,h=u?a.filter(m=>!we.has(m.symbolId)):a.filter(m=>!C(g,m.symbolId,m.relativePath));u?b("dead.source-fallback.dead-code-only",()=>dt(e,h,g,{inactiveBarrelPaths:p}),()=>({definitions:h.length,testReferencesIncluded:!0})):b("dead.source-fallback.ast",()=>ut(e,h,g,{inactiveBarrelPaths:p}),()=>({definitions:h.length,testReferencesIncluded:!0}));let B=u?h.filter(m=>!F(g,m.symbolId)):h.filter(m=>!C(g,m.symbolId,m.relativePath));b("dead.caller-map-supplement",()=>yt(e,B,g,{inactiveBarrelPaths:p,includeSemantic:!u&&d}),()=>({definitions:B.length,semantic:!u&&d}));let Pe=u?h.filter(m=>!F(g,m.symbolId)):a;return lt(e,at(Pe,g))}function rt(e,t){let n=he(e),s=[];for(let i of Q(e,{scope:t.scope,symbolMatches:R,sqlPrefilter:"function-like"}))_e(i,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>ot(e,i),isFrameworkContractCallable:()=>ue(e,i)}).accepted&&s.push(i);return s}var st=["method_signature","abstract_method_signature","call_signature","construct_signature"];function ot(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=x(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...st]).some(i=>i.startPosition.row<=t.startLine&&i.endPosition.row>=t.endLine);let s=z(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
|
|
2
|
+
`).trim();return s.endsWith(";")&&!s.includes("=>")&&!s.includes("{")}function at(e,t){return e.map(n=>ct(n,t)).filter(n=>n.cross_file_refs===0).sort((n,s)=>s.loc-n.loc||n.relative_path.localeCompare(s.relative_path)||n.start_line-s.start_line)}function ct(e,t){let n=t.get(e.symbolId)??new Map,s=Ce(n.get(e.relativePath)),i=0;for(let[o,c]of n)o!==e.relativePath&&(i+=c.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,parent_type_name:e.parentTypeName,same_file_refs:s,cross_file_refs:i}}function lt(e,t){let n=A(e),s=[],i=0,o=0,c=0,u=0,l=0,d=0;for(let r of t){if(e.isIgnored(r.relative_path))continue;if(ne(e,r.relative_path)){u++;continue}if(ie(e,r.symbol,r.relative_path)){l++;continue}let a=n(r.relative_path,r.start_line,r.symbol,r.parent_type_name),f=a?.disposition==="implicit-usage"?a.reason:void 0,p=f?"implicit-usage":r.same_file_refs===0?"dead-code":"file-internal";p==="dead-code"?i++:p==="file-internal"?o++:c++,d+=r.loc,s.push({relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line,loc:r.loc,symbol:r.symbol,shortName:$(r.symbol),sameFileRefs:r.same_file_refs,kind:p,...f?{implicitUsageReason:f}:{}})}return{symbols:s,counts:{total:s.length,deadCode:i,fileInternal:o,implicitUsage:c,loc:d},applicability:{entrySurfaceExcluded:u,externalRootExcluded:l,implicitUsageSignals:c},totalCount:s.length,deadCodeCount:i,fileInternalCount:o,implicitUsageCount:c,totalLoc:d}}function ut(e,t,n,s){if(t.length===0)return;let i=new T(e),o=new Set(t.map(l=>l.symbolId)),c=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(i.sourceFiles());for(let l of S(e))u.add(l);i.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:l=>s.inactiveBarrelPaths.has(l)},l=>{o.has(l.target.symbolId)&&(ft(e,l)||v(n,l.target.symbolId,l.sourceFile,pt(l),"source-fallback"))})}function dt(e,t,n,s){if(t.length===0)return;let i=new T(e),o=Y(t),c=new Set(i.sourceFiles());for(let r of S(e))c.add(r);let u=new Set(o.keys()),l=new Map,d=r=>{let a=l.get(r);return a||(a=ae(e,r),l.set(r,a)),a};i.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:r=>s.inactiveBarrelPaths.has(r),resolveTargets:({sourceFile:r,name:a,kind:f})=>{let p=o.get(a);return p?mt(r,a,p,()=>d(r),{permissive:f!=="cross-language-dispatch"}):[]},afterPath:r=>{l.delete(r),xe(e,r)}},r=>{let a=r.kind==="identifier"&&r.sourceFile===r.target.relativePath?Math.max(0,r.occurrences-1):r.occurrences;r.kind==="identifier"&&Le(e,{sourceFile:r.sourceFile,name:r.name,target:r.target,occurrences:a})||v(n,r.target.symbolId,r.sourceFile,a,"source-fallback")})}function mt(e,t,n,s,i){let o=n.filter(d=>d.relativePath===e);if(o.length>0)return o;if(!i.permissive&&n.length===1)return[...n];let c=s(),u=c.get(t);if(u)for(let d of u){let r=n.filter(a=>L(d,a.relativePath));if(r.length>0)return r}let l=new Set;for(let d of c.values())for(let r of d)l.add(r);for(let d of l){let r=n.filter(a=>L(d,a.relativePath));if(r.length>0&&r.length===n.length)return r}return i.permissive?[...n]:[]}function ft(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Le(e,t)}function pt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Le(e,t){return t.occurrences>1?!1:Z(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function yt(e,t,n,s){let i=s.includeSemantic!==!1,o=i&&t.length>=nt&&S(e).length>=it,c=(r,a)=>{a===r.relativePath||e.isIgnored(a)||s.inactiveBarrelPaths.has(a)||ve(n,r.symbolId,a,1,"caller-map")};if(o?b("dead.caller-map.per-symbol-non-semantic",()=>{for(let r of t){let a=I(e,r,{semantic:!1,semanticEvidence:N});for(let f of a)c(r,f.file)}},()=>({definitions:t.length,semantic:!1})):b("dead.caller-map.per-symbol",()=>{for(let r of t){let a=I(e,r,{semantic:i,semanticEvidence:N});if(a.length!==0)for(let f of a)c(r,f.file)}},()=>({definitions:t.length,semantic:i})),!o)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let r=t.filter(a=>!C(n,a.symbolId,a.relativePath));return u=r.length,r},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=ce(e,l);for(let r of l){let a=d.get(r.symbolId);if(a)for(let f of a)c(r,f)}}export{vt as a,Qt as b};
|
|
3
|
+
//# sourceMappingURL=chunk-U2GPTA5U.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-7COHFNJK.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-U7DR7MJD.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as Z,c as q}from"./chunk-FEQIQ26E.js";import{f as _}from"./chunk-TM5XEDDR.js";import{e as B}from"./chunk-BOJ5SVE2.js";import{c as Y}from"./chunk-JVZNWJBH.js";import{d as Q,f as V}from"./chunk-RGCJ4646.js";import{t as T}from"./chunk-5IZTXSOL.js";import{l as O}from"./chunk-I3U2FN2T.js";import{z as M}from"./chunk-DMQ7ZKJG.js";var ae=6;function ee(e,n,t){return`${e}\0${n}\0${t??n}`}function Ee(e,n,t,a={}){let o=a.limit??ae;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${o}`);let u=a.sourceAllowed??(()=>!0),d=new Map(n.nodes.map(c=>[c.id,c])),f=new Set(t.steps.map(c=>c.nodeId)),r=new Set(t.steps.flatMap(c=>{let g=z(d.get(c.nodeId));return g?[g]:[]})),h=new Set;for(let c of t.steps)for(let g of c.behavior?.supportingDeclarations??[])r.add(g.symbol),h.add(ee(g.file,g.line,g.endLine));let b=c=>c.symbol!==null&&r.has(c.symbol)||h.has(ee(c.file,c.line,c.endLine)),y=new Map(t.steps.flatMap(c=>{if(!c.location)return[];let g=z(d.get(c.nodeId));if(!g)return[];let w=T(e,c.location.file).find(R=>R.symbol===g);return w?[[c.id,w]]:[]})),x=new Y(e).calleeMap([...y.values()],{additive:!1,semantic:!0}),l=[],i=new Set,C=new Set,m=0,A=0,L=0,S=0,I=0,p=0,s=0,N=0;for(let c of t.steps){if(!c.location||!c.behavior)continue;let g=ce(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b});l.push(...g.candidates),p+=g.upstreamCandidates,N+=g.runtimeCandidates,s+=g.resultCandidates;let w=de(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},i);l.push(...w);let R=ue(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},{evidencedCallsiteKeys:i,consideredCandidateKeys:C,calleeMap:x,stepDefinition:y.get(c.id)});l.push(...R.candidates),m+=R.scannedBehaviorSteps,A+=R.visibleCallsites,L+=R.identityCandidateCallsites,S+=R.ambiguousCallsites,I+=R.unresolvedCallsites}return oe(e,l,t.steps,o,{scannedBehaviorSteps:m,visibleCallsites:A,graphEvidencedCallsites:i.size,identityCandidateCallsites:L,ambiguousCallsites:S,unresolvedCallsites:I,upstreamCandidates:p,resultCandidates:s,runtimeCandidates:N},a.selectionTerms)}function ce(e,n){let t=[],a=0,o=0,u=0;if(!e.location||!e.behavior)return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u};let d=n.topology.edges.filter(r=>["call","runtime-boundary"].includes(r.kind)&&(r.fromNodeId===e.nodeId||r.toNodeId===e.nodeId)&&r.disposition!=="excluded"&&r.disposition!=="unsupported");for(let r of d){let h=r.toNodeId===e.nodeId,b=h?r.fromNodeId:r.toNodeId;if(n.returnedNodeIds.has(b))continue;let y=n.nodeById.get(b);if(!y?.location||!n.sourceAllowed(y.location.file))continue;let x=r.kind==="call"?G(n.db,y):X(y);if(!x||n.alternativeAlreadyReturned(x))continue;let l=H(r,y.location.file)??y.location,i=M(n.db,l.file)[l.line]?.trim(),C=h?"upstream":"downstream",m=r.kind==="runtime-boundary"?h?"runtime-producer":"runtime-consumer":h?"caller":"callee",A=W(r.evidence),L=K(y);t.push({anchor:{id:E(e.id,l.line,y.id),status:A,source:"graph-relation",direction:C,causalRole:m,relationKind:r.kind,fromStepId:e.id,fromLabel:e.label,callsite:{file:l.file,line:l.line,endLine:l.endLine??l.line,text:i||`${y.label} \u2192 ${e.label}`,signals:["call"],calleeLeaf:L},alternatives:[x],alternativeCount:1,evidence:r.evidence}}),h&&(a+=1),r.kind==="runtime-boundary"&&(u+=1)}let f=n.topology.edges.filter(r=>r.kind==="reference"&&r.fromNodeId===e.nodeId&&r.disposition!=="excluded"&&r.disposition!=="unsupported"&&!n.returnedNodeIds.has(r.toNodeId));for(let r of f){let h=n.nodeById.get(r.toNodeId);if(!h?.location||!n.sourceAllowed(h.location.file))continue;let b=G(n.db,h);if(!b||n.alternativeAlreadyReturned(b))continue;let y=K(h),x=H(r,e.location.file)?.line,l=e.behavior.lines.find(m=>(x===void 0||x>=m.line&&x<=m.endLine)&&m.text.includes(y));if(!l)continue;let i=le(l.signals),C=W(r.evidence);t.push({anchor:{id:E(e.id,l.line,h.id),status:C,source:"graph-relation",direction:"downstream",causalRole:i,relationKind:"reference",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:l.line,endLine:l.endLine,text:l.text,signals:l.signals,calleeLeaf:y},alternatives:[b],alternativeCount:1,evidence:r.evidence}}),i==="result-callback"&&(o+=1)}return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u}}function de(e,n,t){let a=[];if(!e.location)return a;let o=q(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line),u=M(n.db,e.location.file),d=_(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line);for(let f of o.targets){if(!n.sourceAllowed(f.definition.relativePath))continue;let r=k(e.location.file,f.sourceLine,f.calleeLeaf);if(t.has(r))continue;t.add(r);let h=U(d.get(f.sourceLine)),b={symbol:f.definition.symbol,label:f.definition.leaf,file:f.definition.relativePath,line:f.definition.startLine,endLine:f.definition.endLine};n.alternativeAlreadyReturned(b)||a.push({anchor:{id:E(e.id,f.sourceLine,f.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:f.sourceLine,endLine:f.sourceLine,text:u[f.sourceLine]?.trim()||`${f.calleeLeaf}()`,signals:h,calleeLeaf:f.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:f.definition.symbol,location:{file:e.location.file,line:f.sourceLine}}]}})}return a}function ue(e,n,t){let a={candidates:[],scannedBehaviorSteps:0,visibleCallsites:0,identityCandidateCallsites:0,ambiguousCallsites:0,unresolvedCallsites:0};if(!e.location||!e.behavior)return a;let o=e.behavior.lines.filter(i=>i.signals.includes("call"));if(o.length===0)return a;let u=[],d=0,f=0,r=0,h=(O(n.db,e.location.file)?.callSites??[]).filter(i=>o.some(C=>i.line>=C.line&&i.line<=C.endLine)),b=n.topology.edges.filter(i=>i.kind==="call"&&i.fromNodeId===e.nodeId&&i.disposition!=="excluded"&&i.disposition!=="unsupported"),y=new Map;for(let i of b){let C=n.nodeById.get(i.toNodeId);if(!C)continue;let m=K(C);y.set(m,(y.get(m)??0)+1)}let x=me(n.db,t.stepDefinition?t.calleeMap.get(t.stepDefinition.symbolId)??[]:[]),l=he(x);for(let i of x){if(!n.sourceAllowed(i.alternative.file)||n.alternativeAlreadyReturned(i.alternative))continue;let C=B(i.alternative.label),m=te(h,o,C,i.row.callsiteLine,l.get(C)===1);if(!m)continue;let A=$(o,m.line,C);if(!A)continue;let L=k(e.location.file,m.line,C);if(t.evidencedCallsiteKeys.has(L))continue;t.evidencedCallsiteKeys.add(L);let S=se(i.row.source);u.push({anchor:{id:E(e.id,m.line,i.alternative.symbol??i.alternative.file),status:S,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:A.line,endLine:A.endLine,text:A.text,signals:A.signals,calleeLeaf:C},alternatives:[i.alternative],alternativeCount:1,evidence:[{method:i.row.source,strength:S,identity:i.row.symbol,location:{file:e.location.file,line:m.line}}]}})}for(let i of b){if(n.returnedNodeIds.has(i.toNodeId))continue;let C=n.nodeById.get(i.toNodeId);if(!C?.location||!n.sourceAllowed(C.location.file))continue;let m=K(C),A=i.evidence.find(N=>{let c=N.location;return c!==null&&c.file===e.location?.file&&c.line>=0})?.location?.line,L=te(h,o,m,A,y.get(m)===1);if(!L)continue;let S=$(o,L.line,m);if(!S)continue;let I=k(e.location.file,L.line,m);if(t.evidencedCallsiteKeys.has(I))continue;t.evidencedCallsiteKeys.add(I);let p=X(C);if(!p||n.alternativeAlreadyReturned(p))continue;let s=W(i.evidence);u.push({anchor:{id:E(e.id,L.line,C.id),status:s,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:S.line,endLine:S.endLine,text:S.text,signals:S.signals,calleeLeaf:m},alternatives:[p],alternativeCount:1,evidence:i.evidence}})}for(let i of h){let C=k(e.location.file,i.line,i.calleeLeaf);if(t.evidencedCallsiteKeys.has(C))continue;let m=$(o,i.line,i.calleeLeaf);if(!m)continue;let A=Q(e.location.file,V(n.db).get(i.calleeLeaf)??[]).flatMap(p=>T(n.db,p.file).filter(s=>s.symbol===p.symbol&&s.isFunctionLike)).filter(p=>n.sourceAllowed(p.relativePath)&&!n.alternativeAlreadyReturned({symbol:p.symbol,label:p.leaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})),L=D(A.map(p=>({symbol:p.symbol,label:p.leaf??i.calleeLeaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})));if(L.length===0){r+=1;continue}let S=`${e.id}\0${i.line}\0${i.calleeLeaf}`;if(t.consideredCandidateKeys.has(S))continue;t.consideredCandidateKeys.add(S);let I=L.length>1;I?f+=1:d+=1,u.push({anchor:{id:E(e.id,i.line,i.calleeLeaf),status:I?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:m.line,endLine:m.endLine,text:m.text,signals:m.signals,calleeLeaf:i.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}return{candidates:u,scannedBehaviorSteps:1,visibleCallsites:h.length,identityCandidateCallsites:d,ambiguousCallsites:f,unresolvedCallsites:r}}function ke(e,n,t){let a=new Map(n.nodes.map(o=>[o.id,o]));for(let o of t.steps)if(!(!o.behavior||!o.location))for(let u of n.edges){if(u.kind!=="reference"||u.fromNodeId!==o.nodeId||u.disposition==="excluded"||u.disposition==="unsupported")continue;let d=a.get(u.toNodeId);if(!d?.location||!G(e,d))continue;let f=K(d),r=H(u,o.location.file)?.line,h=o.behavior.lines.find(b=>(r===void 0||r>=b.line&&r<=b.endLine)&&b.text.includes(f));!h||le(h.signals)!=="result-callback"||u.semantics?.some(({family:b,subtype:y})=>b==="control"&&y==="result-callback")||(u.semantics=[...u.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function le(e){return e.includes("call")&&e.some(n=>["return","mutation","shape","spread","binding"].includes(n))?"result-callback":"callable-reference"}function Me(e,n,t={}){let a=t.limit??ae;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let o=t.sourceAllowed??(()=>!0),u=[],d=n.map((l,i)=>({id:l.id,nodeId:l.id,order:i,role:"anchor",kind:"source-construct",label:l.label,location:{file:l.file,line:l.startLine,endLine:l.endLine},behavior:null})),f=n.map(l=>({file:l.file,startLine:l.startLine,endLine:l.endLine})),r=0,h=0,b=0,y=0,x=0;for(let l of n){let i=M(e,l.file),m=(O(e,l.file)?.callSites??[]).filter(s=>s.line>=l.startLine&&s.line<=l.endLine);r+=m.length;let A=_(e,l.file,l.startLine,l.endLine),L=q(e,l.file,l.startLine,l.endLine),S=new Set;for(let s of L.targets){if(!o(s.definition.relativePath)||f.some(w=>w.file===s.definition.relativePath&&w.startLine<=s.definition.startLine&&w.endLine>=s.definition.endLine))continue;let N=k(l.file,s.sourceLine,s.calleeLeaf);S.add(N);let c=U(A.get(s.sourceLine)),g={symbol:s.definition.symbol,label:s.definition.leaf,file:s.definition.relativePath,line:s.definition.startLine,endLine:s.definition.endLine};u.push({anchor:{id:E(l.id,s.sourceLine,s.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:s.sourceLine,endLine:s.sourceLine,text:i[s.sourceLine]?.trim()||`${s.calleeLeaf}()`,signals:c,calleeLeaf:s.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:s.definition.symbol,location:{file:l.file,line:s.sourceLine}}]}})}h+=L.resolvedCallsites;let I=Z(e,l.file,{ranges:[{startLine:l.startLine,endLine:l.endLine}]}),p=new Map;for(let s of I.targets){let N=m.find(w=>w.line===s.line)?.calleeLeaf??s.calleeLeaf,c=k(l.file,s.line,N),g=p.get(c)??[];g.push(s),p.set(c,g)}for(let[s,N]of p){if(S.has(s))continue;S.add(s);let c=N.filter(v=>o(v.targetFile)&&!f.some(j=>j.file===v.targetFile&&j.startLine<=v.targetStartLine&&j.endLine>=v.targetEndLine));if(c.length===0)continue;let g=c[0],w=m.find(v=>v.line===g.line)?.calleeLeaf??g.calleeLeaf,R=U(A.get(g.line)),P=D(c.map(v=>({symbol:v.targetSymbol??null,label:v.calleeLeaf,file:v.targetFile,line:v.targetStartLine,endLine:v.targetEndLine}))),J=c.some(v=>(v.resolutionAlternativeCount??0)>1)?"candidate":c.every(v=>v.strength==="exact")?"exact":"derived";u.push({anchor:{id:E(l.id,g.line,P.map(v=>`${v.file}:${v.line}`).join("|")),status:P.length>1?"ambiguous":J,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:g.line,endLine:g.line,text:i[g.line]?.trim()||`${g.calleeLeaf}()`,signals:R,calleeLeaf:w},alternatives:P.slice(0,3),alternativeCount:P.length,evidence:c.map(v=>({method:v.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":v.resolution==="factory-callback-member"?"ast-factory-callback-callsite":v.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:J,identity:v.targetSymbol??`${v.targetFile}:${v.targetStartLine}-${v.targetEndLine}`,location:{file:l.file,line:g.line}}))}})}h+=p.size;for(let s of m){let N=k(l.file,s.line,s.calleeLeaf);S.has(N)||(x+=1)}}return oe(e,u,d,a,{scannedBehaviorSteps:n.length,visibleCallsites:r,graphEvidencedCallsites:h,identityCandidateCallsites:b,ambiguousCallsites:y,unresolvedCallsites:x,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function oe(e,n,t,a,o,u=[]){let d=ge(n).sort(re),f=d.filter(i=>fe(e,i)).slice(0,a),r=new Set(f.map(i=>i.anchor.id)),h=d.filter(i=>!r.has(i.anchor.id)),b=f.map(i=>i.anchor),y=h.map(i=>i.anchor),x=D(b.flatMap(i=>i.alternativeCount===1?i.alternatives:[])),l=D(y.flatMap(i=>i.alternativeCount===1?i.alternatives:[]));return{anchors:b,withheldAnchors:y,candidateAnchors:d.length,omittedAnchors:Math.max(0,d.length-b.length),...o,inspectCommand:x.length===0?null:`scip-query inspect ${x.map(ie).join(" ")} --view behavior`,remainingInspectCommands:pe(l,8).map(i=>`scip-query inspect ${i.map(ie).join(" ")} --view behavior`)}}function re(e,n){let t=e.anchor.alternatives[0],a=n.anchor.alternatives[0];return F(e.anchor.status)-F(n.anchor.status)||(e.anchor.direction??"").localeCompare(n.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(n.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(n.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(n.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(n.anchor.callsite.file)||e.anchor.callsite.line-n.anchor.callsite.line||(t?.file??"").localeCompare(a?.file??"")||(t?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(n.anchor.id)}function fe(e,n){if(n.anchor.alternativeCount!==1)return!0;let t=n.anchor.alternatives[0],a=t.endLine??t.line;return M(e,t.file).slice(t.line,a+1).join(`
|
|
2
|
+
`).length<=2e4}function U(e){return e?.includes("call")?[...e]:["call",...e??[]]}function me(e,n){let t=new Map;for(let a of n){let o=T(e,a.file).find(f=>f.symbol===a.symbol&&f.isFunctionLike);if(!o)continue;let u={symbol:o.symbol,label:o.leaf,file:o.relativePath,line:o.startLine,endLine:o.endLine},d=t.get(o.symbol);!d||ne(a.source)>ne(d.row.source)?t.set(o.symbol,{row:{...a,...a.callsiteLine===void 0&&d?.row.callsiteLine!==void 0?{callsiteLine:d.row.callsiteLine}:{}},alternative:u}):d.row.callsiteLine===void 0&&a.callsiteLine!==void 0&&t.set(o.symbol,{...d,row:{...d.row,callsiteLine:a.callsiteLine}})}return[...t.values()]}function he(e){let n=new Map;for(let t of e){let a=B(t.alternative.label);n.set(a,(n.get(a)??0)+1)}return n}function se(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function ne(e){return se(e)==="exact"?2:1}function $(e,n,t){return e.find(a=>n>=a.line&&n<=a.endLine&&a.text.includes(t))??e.find(a=>n>=a.line&&n<=a.endLine)??null}function te(e,n,t,a,o){if(a!==void 0)return e.find(d=>d.line===a&&d.calleeLeaf===t&&$(n,d.line,t)!==null)??null;let u=e.filter(d=>d.calleeLeaf===t&&$(n,d.line,d.calleeLeaf)!==null);return o&&u.length===1?u[0]:null}function K(e){let n=e.attributes.leaf;if(typeof n=="string"&&n.length>0)return B(n);let t=e.label.slice(e.label.lastIndexOf(":")+1);return B(t)}function z(e){if(e?.kind!=="symbol"||!e.id.startsWith("symbol:"))return null;try{return decodeURIComponent(e.id.slice(7))}catch{return null}}function X(e){return e.location?{symbol:z(e),label:e.label,file:e.location.file,line:e.location.line,endLine:e.location.endLine??null}:null}function G(e,n){let t=X(n);return t?.symbol&&T(e,t.file).some(o=>o.symbol===t.symbol&&o.isFunctionLike)?t:null}function H(e,n){return e.evidence.find(t=>t.location?.file===n)?.location??e.evidence.find(t=>t.location!==null)?.location??null}function W(e){let n={exact:5,derived:4,mixed:3,candidate:2,unknown:1};return e.reduce((t,a)=>n[a.strength]>n[t]?a.strength:t,"unknown")}function ge(e){let n=new Map;for(let t of e){let o=t.anchor.alternatives[0]?.symbol??`${t.anchor.callsite.file}:${t.anchor.callsite.line}:${t.anchor.callsite.calleeLeaf}`,u=n.get(o);(!u||be(t,u)<0)&&n.set(o,t)}return[...n.values()]}function be(e,n){return F(e.anchor.status)-F(n.anchor.status)||e.anchor.alternativeCount-n.anchor.alternativeCount||re(e,n)}function F(e){return{exact:0,derived:1,mixed:2,candidate:3,unknown:4,ambiguous:5}[e]}function D(e){let n=new Map;for(let t of e)n.set(t.symbol??`${t.file}:${t.line}`,t);return[...n.values()].sort((t,a)=>t.file.localeCompare(a.file)||t.line-a.line||t.label.localeCompare(a.label))}function ie(e){return`--at ${ve(`${e.file}:${e.line+1}`)}`}function pe(e,n){let t=[];for(let a=0;a<e.length;a+=n)t.push(e.slice(a,a+n));return t}function ve(e){return`'${e.replaceAll("'","'\\''")}'`}function k(e,n,t){return`${e}\0${n}\0${t}`}function E(e,n,t){return["next-anchor",e,String(n),t].map(encodeURIComponent).join(":")}export{Ee as a,ke as b,Me as c};
|
|
3
|
+
//# sourceMappingURL=chunk-U7LRSQG6.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{M as c}from"./chunk-AA7K3XLM.js";import{A as p,d as a,x as u}from"./chunk-DMQ7ZKJG.js";var g=a("suppression-inventory",{clearGroups:["whole-project"]});function C(t){return g.get(t,()=>y(t))}function y(t){let e={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,twin:0,uncategorized:0},n=new Map,i=0;for(let r of c(t)){let o=u(t,r);if(!(!o||!o.includes("scip-query")))for(let f of o.split(/\r?\n/)){let s=p(f);if(s===null)continue;i+=1,n.set(r,(n.get(r)??0)+1);let d=l(s);e[d]+=1}}for(let r of t.config.suppressions??[])r.expiresAt&&Date.parse(r.expiresAt)<=Date.now()||(i+=1,r.file&&n.set(r.file,(n.get(r.file)??0)+1),e[l(r.check)]+=1);return{total:i,byCategory:e,byFile:n}}function l(t){if(!t)return"uncategorized";let e=t.toLowerCase();return e==="dead-code"||e==="new-dead"?"dead":e.includes("twin")?"twin":e.includes("similar")||e.includes("duplicate")?"similar":e.includes("wrapper")?"wrapper":e.includes("passthrough")?"passthrough":e.includes("drift")?"drift":e.includes("extract")?"extract":e.includes("stale")?"stale":"uncategorized"}export{C as a};
|
|
2
|
+
//# sourceMappingURL=chunk-UL4VJUMD.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{a as V,b as C}from"./chunk-GFLTPNWV.js";import{a as F}from"./chunk-7IOAZRVL.js";import{a as v,b,da as k,g as m}from"./chunk-4DCKBY6T.js";import Re from"better-sqlite3";import{existsSync as nn}from"fs";import{dirname as rn,join as on,resolve as Se}from"path";import H from"better-sqlite3";import{execFileSync as W}from"child_process";import{existsSync as B,readdirSync as G}from"fs";import{extname as R,join as U}from"path";function De(e={}){return{id:"auxiliary-documents",facts:["auxiliary-document"],run:n=>K({projectRoot:n.projectRoot,dbPath:n.dbPath,extensions:e.extensions,onStatus:n.onStatus})}}function K(e){let n=new Set((e.extensions??V).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!B(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=F(e.projectRoot),t=J(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new H(e.dbPath);try{let i=Y(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
2
|
+
VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let f of l){if(i.has(f))continue;let p=k(e.projectRoot,f,{inputKind:"auxiliary source file"}),$=s.run(q(f),f,p);d+=Number($.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function J(e,n){let r=X(e,n);if(r)return r;let t=[],o=i=>{let s=i?U(e,i):e,a;try{a=G(s,{withFileTypes:!0})}catch{return}for(let u of a){if(C.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(R(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function X(e,n){try{return W("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
3
|
+
`).filter(t=>t&&n.has(R(t).toLowerCase())).sort()}catch{return null}}function Y(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function q(e){return R(e).toLowerCase()===".vue"?"vue":R(e).replace(/^\./,"").toLowerCase()||"source"}import{writeFileSync as _e}from"fs";function je(e,n){let r=performance.now(),t=e.run(n);return{stageId:e.id,facts:e.facts,durationMs:performance.now()-r,result:t}}function z(){return{"missing-source-file":0,"missing-service-script":0,"no-definition":0,"same-file-definition":0,"unindexed-definition":0}}function S(){return{skippedReferences:0,skippedReferenceReasons:z(),skippedReferenceSamples:[]}}function I(e,n){e.skippedReferences+=n.skippedReferences;for(let r of Object.keys(e.skippedReferenceReasons)){e.skippedReferenceReasons[r]+=n.skippedReferenceReasons[r];for(let t of n.skippedReferenceSamples.filter(o=>o.reason===r))e.skippedReferenceSamples.filter(i=>i.reason===r&&i.sourceFile===t.sourceFile).length<2&&e.skippedReferenceSamples.push(t)}}import{createRequire as Q}from"module";import{existsSync as Z}from"fs";import{dirname as T,extname as ee,join as L,relative as ne,resolve as Ue}from"path";import{pathToFileURL as te}from"url";function E(e,n){let{vueCore:r,ts:t,volarTs:o}=re(e),{parsed:i,vueOptions:s}=oe(r,t,n),a=T(n),u=r.createVueLanguagePlugin(t,i.options,s,p=>p),c=ie(r,t,u),l=se(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,p=>p,l),f=t.createLanguageService(d);return{ts:t,language:c,languageService:f,fileNames:i.fileNames,configDir:a}}function re(e){let n=Q(te(L(e,"package.json")).href);return{vueCore:h(n,"@vue/language-core",e),ts:h(n,"typescript",e),volarTs:h(n,"@volar/typescript",e)}}function oe(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,T(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function ie(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!Z(i))return;let s=m(i,{maxBytes:b,inputKind:"Vue language-service source file"});t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??le(i))});return t.current=o,o}function se(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function h(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function P(e,n,r){let t=ae(e);return o=>{if(!o.name)return null;let i=g(n,o.fileName),s=r.get(o.fileName);if(!s)return null;let a=r.positionAt(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.starts.find(d=>d.line===a.line&&d.displayName===o.name);if(c)return c.symbolId;let l=u.containingByLine.get(a.line);return l&&l.displayName===o.name?l.symbolId:ue(u.starts,a.line,2,o.name)}}function ae(e){let n=e.prepare(`
|
|
4
|
+
SELECT
|
|
5
|
+
d.relative_path AS relativePath,
|
|
6
|
+
der.start_line AS startLine,
|
|
7
|
+
der.end_line AS endLine,
|
|
8
|
+
der.symbol_id AS symbolId,
|
|
9
|
+
gs.display_name AS displayName
|
|
10
|
+
FROM defn_enclosing_ranges der
|
|
11
|
+
JOIN documents d ON d.id = der.document_id
|
|
12
|
+
JOIN global_symbols gs ON gs.id = der.symbol_id
|
|
13
|
+
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
14
|
+
`).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId,displayName:t.displayName});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,{symbolId:t.symbolId,displayName:t.displayName})}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function ue(e,n,r,t){let o=0,i=e.length-1;for(;o<=i;){let a=Math.floor((o+i)/2);e[a].line<n?o=a+1:i=a-1}let s=null;for(let a of[i,o]){let u=e[a];if(!u||u.displayName!==t)continue;let c=Math.abs(u.line-n);c>r||(!s||c<s.distance)&&(s={distance:c,symbolId:u.symbolId})}return s?.symbolId??null}function A(e,n){let r=ge(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=fe(t,r,n,i);return o.set(i,s),s}}}function O(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(y(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*w(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function D(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function y(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function ce(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function N(e,n){return g(e,n).startsWith("node_modules/")}function g(e,n){return ne(e,n).replaceAll("\\","/")}function le(e){switch(ee(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function M(){let e=new Map;return{get(n){if(e.has(n))return e.get(n)??null;try{let r=m(n,{maxBytes:b,inputKind:"Vue source file"}),t={text:r,lineStarts:de(r)};return e.set(n,t),t}catch{return e.set(n,null),null}},positionAt:ce}}function de(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function ge(e){try{let n=JSON.parse(m(L(e,"package.json"),{maxBytes:v,inputKind:"project package manifest"}));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function fe(e,n,r,t){let o=g(r,t),i=pe(n.name,n.version,o);return e.get(i)?.id??null}function pe(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}function un(e){let n=Se(e.projectRoot,e.tsconfig),r=new Re(e.dbPath,{readonly:!0});try{let t=be({db:r,projectRoot:e.projectRoot,configPath:n,vueSymbolLookup:A(r,e.projectRoot)});return he({vueFiles:e.vueFiles??[],tasks:e.tasks,...t})}finally{r.close()}}function be(e){let n=M();return{projectRoot:e.projectRoot,context:E(e.projectRoot,e.configPath),symbolLookup:P(e.db,e.projectRoot,n),vueSymbolLookup:e.vueSymbolLookup,sourceReader:n}}function he(e){let n=[],r=S(),t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=ye(e,o);n.push(...i.occurrences),I(r,i)}return{occurrences:n,...r}}function ye(e,n){let r=e.sourceReader.get(n.fileName);if(!r)return _(e.projectRoot,n,"missing-source-file");let t=e.context.language.scripts.get(n.fileName),o=t?.generated?.languagePlugin.typescript?.getServiceScript(t.generated.root)?.code;if(!t||!o)return _(e.projectRoot,n,"missing-service-script");let i=e.context.language.maps.get(o,t),s=g(e.projectRoot,n.fileName),a=[...w(r.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Ce(a),processedStarts:new Set};return xe({...e,fileName:n.fileName,sourceInfo:r,sourceFile:s,map:i,tokenContext:u})}function xe(e){let n=[],r=S();for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start)||ve(e.sourceInfo.text,t.start))continue;let o=D(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(l=>!N(e.projectRoot,l.fileName));if(!s){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"no-definition");continue}let a=g(e.projectRoot,s.fileName),u=ke(e.sourceFile,t.text,a);if(u){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,u);continue}let c=O(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(c===null){x(r,e.sourceReader,e.sourceInfo,e.sourceFile,t,"unindexed-definition");continue}j(n,e.sourceReader,e.sourceInfo,e.sourceFile,t,a,c),e.tokenContext.processedStarts.add(t.start),Ve(n,e,t,o,a,c)}return{occurrences:n,...r}}function ve(e,n){let r=e.lastIndexOf(`
|
|
15
|
+
`,n-1)+1,t=e.slice(r,n);return/\bfrom\s+['"][^'"]*$/.test(t)||/\bimport\s*\(\s*['"][^'"]*$/.test(t)}function ke(e,n,r){return r===e?"same-file-definition":r.endsWith(".vue")&&n!==r.split("/").at(-1)?.replace(/\.vue$/,"")?"unindexed-definition":null}function _(e,n,r){let t=S();return n.countFileSkip&&(t.skippedReferences=1,t.skippedReferenceReasons[r]=1,t.skippedReferenceSamples.push({sourceFile:g(e,n.fileName),sourceLine:0,sourceStartChar:0,sourceEndChar:0,token:"",reason:r})),{occurrences:[],...t}}function x(e,n,r,t,o,i){if(e.skippedReferences++,e.skippedReferenceReasons[i]++,e.skippedReferenceSamples.filter(a=>a.reason===i&&a.sourceFile===t).length>=2)return;let s=n.positionAt(r,o.start);e.skippedReferenceSamples.push({sourceFile:t,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+o.text.length,token:o.text,reason:i})}function Ve(e,n,r,t,o,i){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let s of Fe(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(s))continue;let a=n.tokenContext.tokenByStart.get(s);a&&(j(e,n.sourceReader,n.sourceInfo,n.sourceFile,a,o,i),n.tokenContext.processedStarts.add(s))}}function j(e,n,r,t,o,i,s){let a=n.positionAt(r,o.start);e.push({sourceFile:t,sourceLine:a.line,sourceStartChar:a.character,sourceEndChar:a.character+o.text.length,sourceToken:o.text,definitionFile:i,symbolId:s})}function Ce(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function Fe(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=Ie(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function Ie(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=y(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}export{De as a,je as b,un as c};
|
|
16
|
+
//# sourceMappingURL=chunk-UNORWZIJ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i}from"./chunk-HUZNZ3H2.js";import{a as t}from"./chunk-7COHFNJK.js";function a(e,o){let r=i(e,o);return r?t(e,"forward",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}function p(e,o){let r=i(e,o);return r?t(e,"reverse",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}export{a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-UQ7XPRWU.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{C as s}from"./chunk-AA7K3XLM.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-URMZLV2N.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{a as re}from"./chunk-X7PJJYKX.js";import{a as ie}from"./chunk-73Z33VFI.js";import{b as w}from"./chunk-SYUNTKO2.js";import{a as oe}from"./chunk-UL4VJUMD.js";import{b as ne}from"./chunk-BBEDPVPB.js";import{a as ee,b as te}from"./chunk-UQ7XPRWU.js";import{b as V}from"./chunk-5236NQV3.js";import{f as W}from"./chunk-PIZY2GX6.js";import{a as K}from"./chunk-HWLCBKFE.js";import{a as X}from"./chunk-PUVZNFVY.js";import{b as Z}from"./chunk-Q2J2VZZT.js";import{a as Y}from"./chunk-DEUGHURX.js";import{d as J}from"./chunk-FUG6RPYY.js";import{b as q}from"./chunk-HUZNZ3H2.js";import{a as Q}from"./chunk-IXJ26KJJ.js";import{a as D}from"./chunk-IDPLC3FI.js";import{a as H}from"./chunk-QD7IFBCR.js";import{a as z,c as G}from"./chunk-LPGDO2XA.js";import{b as j}from"./chunk-35IW3P4H.js";import{e as P,t as A}from"./chunk-5IZTXSOL.js";import{r as $}from"./chunk-DMQ7ZKJG.js";function se(e){let t=new Set(e.filter(o=>o.definition?.isFunctionLike).map(o=>`${o.role}:${o.definition.relativePath}`));return e.flatMap(o=>o.definition?!o.definition.isFunctionLike&&t.has(`${o.role}:${o.definition.relativePath}`)?[]:[{definition:o.definition,role:o.role}]:[])}var fe=6,I=10,M=3,B=8,ye=.7,le=24,_=200,de=12,ae=80,ce=600;function Je(e,t,o={}){let l=o.impactDepth??3,m=o.sliceDepth??3,u=o.semantic,c=Ee(t)?he(e,t):null,a=c?c.primary?.symbol??null:t,r=a!==null,d=r?f("trace",a,()=>ne(e,a,{semantic:u,referenceContext:de}),i=>({definitions:i.definitions.length,references:i.referencedBy.length})):{definitions:[],referencedBy:[],claimSupport:null},b=r?f("call-graph",a,()=>K(e,a,{semantic:u}),i=>({callers:i?.callers.length??0,callees:i?.callees.length??0})):null,n=r?f("complexity",a,()=>Q(e,a,{semantic:u}),i=>({callees:i?.calleeCount??0})):null,p=r?f("dataflow",a,()=>V(e,a,{semantic:u}),i=>({references:i?.usageSites.length??0,producers:i?.producers.length??0,consumers:i?.consumers.length??0})):null,s=r?f("backward-slice",a,()=>w(e,a,{direction:"backward",maxDepth:m,semantic:u}),i=>({maxDepth:m,connectedSymbols:i?.connectedSymbols.length??0})):null,C=r?f("forward-slice",a,()=>w(e,a,{direction:"forward",maxDepth:m,semantic:u}),i=>({maxDepth:m,connectedSymbols:i?.connectedSymbols.length??0})):null,h=r?f("affected",a,()=>H(e,a,{maxDepth:l,scope:o.scope}),i=>({maxDepth:l,affectedSymbols:i.length})):[],S=r?f("reuse-candidates",a,()=>D(e,a,{minSimilarity:.4,limit:5,semantic:u,sourceCandidateMode:"target-pruned"}),i=>({candidates:i.length,direct:i.filter(pe=>pe.actionTier==="direct").length})):[],y=r?z(e,a)?.symbol??null:null,g=r?f("affected-consumer-reuse",a,()=>Se(d,y,i=>D(e,i,{minSimilarity:.4,limit:I,semantic:u,sourceCandidateMode:"target-pruned"}),{consumerLimit:fe,perConsumerSearchLimit:I,perConsumerCandidateLimit:M,candidateLimit:B}),i=>({totalConsumers:i.coverage.totalConsumers,analyzedConsumers:i.coverage.analyzedConsumers,candidates:i.candidates.length})):Le(),x=f("change-surface",t,()=>X(e,t,{semantic:u}),i=>({symbols:i?.symbols.length??0,externalConsumers:i?.totalExternalConsumers??0})),R=f("system",t,()=>ie(e,t),i=>({files:i.files.length,symbols:i.symbols.length})),L=R.files.length===1,N=f("deps",t,()=>L?R.dependsOn.map(i=>({relativePath:i,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):ee(e,t),i=>({files:i.length,reusedSystem:L})),k=f("rdeps",t,()=>L?R.dependedOnBy.map(i=>({relativePath:i,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):te(e,t),i=>({files:i.length,reusedSystem:L})),F=f("surface",t,()=>re(e,t),i=>({consumers:i.length})),T={symbol:d.definitions.length>0||d.referencedBy.length>0||b!==null||n!==null||p!==null||s!==null||C!==null||h.length>0,file:x!==null||N.length>0||k.length>0,module:R.files.length>0||R.symbols.length>0||F.length>0},E=[];c&&!c.primary&&c.callableCount>1&&E.push(`File target has ${c.callableCount} callable symbols; use one callable name for compiler-resolved flow.`);let O=[...new Set(d.referencedBy.map(i=>i.relativePath))];O.length>0&&O.every(i=>j(i)==="test")&&E.push("Only test references were found for this target. For replacement or retirement work, map the currently wired owner or one production entry point before planning; this target does not describe the live affected surface."),!T.symbol&&!T.file&&!T.module&&E.push("No symbol, file, or module matched target.");let U=x?.file??d.definitions[0]?.relativePath??null;return{target:t,...c?.primary?{primaryCallable:{symbol:c.primary.symbol,shortName:P(c.primary.symbol),file:c.primary.relativePath}}:{},matched:T,history:f("history",U??t,()=>Te(e,U,o.gitHead)),trace:Ce(d),callGraph:b,complexity:n,dataflow:p,backwardSlice:s,forwardSlice:C,affected:h,changeSurface:x,deps:N,rdeps:k,system:R,surface:F,reuseCandidates:S,affectedConsumerReuse:g,sourcePacket:be(e,y,d,g,S),warnings:E}}function Ce(e){return{definitions:e.definitions,referencedBy:e.referencedBy.map(t=>({relativePath:t.relativePath,line:t.line,enclosingSymbol:t.enclosingSymbol,enclosingShort:t.enclosingShort}))}}function he(e,t){let o=q(e,t);if(o.length!==1)return{primary:null,callableCount:0};let l=A(e,o[0]).filter(c=>c.isFunctionLike),m=l.filter(c=>c.enclosingSymbol===null),u=m.length>0?m:l;return{primary:u.length===1?u[0]:null,callableCount:u.length}}function be(e,t,o,l,m){let u=[...t?[{definition:ue(e,t),role:"target"}]:[],...[...l.candidates.map(n=>n.candidate),...m].map(n=>({definition:ue(e,n.symbolB),role:"reuse-candidate"}))],c=new Map;for(let n of se(u)){if(c.has(n.definition.symbol))continue;let p=n.role==="target"?_:ae,s=n.definition.endLine<=n.definition.startLine?J(e,n.definition.relativePath,n.definition.startLine,p):null,C=s?.unitType?s.source:W(e,n.definition);if(!C)continue;let h=C.split(`
|
|
2
|
+
`),S=Math.min(h.length,p),y=s?.unitType?s.startLine:n.definition.startLine;c.set(n.definition.symbol,{role:n.role,symbol:n.definition.symbol,shortName:P(n.definition.symbol),file:n.definition.relativePath,startLine:y,endLine:y+S-1,source:h.slice(0,S).join(`
|
|
3
|
+
`),omittedLines:(s?.unitType?s.omittedLines:0)+Math.max(0,h.length-S)})}let a=new Map;for(let n of o.referencedBy){if(n.source===void 0||n.source===null||n.sourceStartLine===void 0||n.sourceStartLine===null||n.sourceEndLine===void 0||n.sourceEndLine===null)continue;let p=`${n.relativePath}:${n.sourceStartLine}-${n.sourceEndLine}`,s=a.get(p);if(s){s.focusLines=[...new Set([...s.focusLines??[],n.line])].sort((C,h)=>C-h);continue}a.set(p,{role:"consumer",symbol:n.enclosingSymbol??`${n.relativePath}:${n.line}`,shortName:n.enclosingShort,file:n.relativePath,startLine:n.sourceStartLine,endLine:n.sourceEndLine,source:n.source,omittedLines:0,focusLines:[n.line]})}let r=[...[...c.values()].filter(n=>n.role==="target"),...a.values(),...[...c.values()].filter(n=>n.role==="reuse-candidate")],d=[],b=ce;for(let n of r){if(d.length>=le||b<=0)break;let p=n.source.split(`
|
|
4
|
+
`),s=Math.min(p.length,b);d.push({...n,endLine:n.startLine+s-1,source:p.slice(0,s).join(`
|
|
5
|
+
`),omittedLines:n.omittedLines+Math.max(0,p.length-s),...n.focusLines?{focusLines:n.focusLines.filter(C=>C<=n.startLine+s-1)}:{}}),b-=s}return{slices:d,candidateSlices:r.length,omittedSlices:Math.max(0,r.length-d.length),maxSlices:le,maxLinesPerSlice:_,maxTotalLines:ce,targetLineLimit:_,consumerContextLines:de,reuseLineLimit:ae}}function ue(e,t){let o=G(e,t);return o?A(e,o.relativePath).find(l=>l.symbol===t)??null:null}function Se(e,t,o,l={}){let m=v(l.consumerLimit,fe),u=v(l.perConsumerSearchLimit,I),c=v(l.perConsumerCandidateLimit,M),a=v(l.candidateLimit,B),r=ge(e),d=r.slice(0,m),b=new Set(r.map(s=>s.symbol));t&&b.add(t);let n=new Map;for(let s of d){let C=o(s.symbol).slice(0,u),h=0;for(let S of C){let y=Re(S,s.symbol);if(!y||b.has(y.symbolB))continue;let g=n.get(y.symbolB);if(g?(g.consumers.some(x=>x.symbol===s.symbol)||g.consumers.push(s),y.similarity>g.candidate.similarity&&(g.candidate=y)):n.set(y.symbolB,{candidate:y,consumers:[s]}),h+=1,h>=c)break}}let p=[...n.values()].filter(s=>s.candidate.actionTier==="direct"||s.candidate.similarity>=ye||s.consumers.length>1).sort(xe).slice(0,a);return{candidates:p,coverage:{totalConsumers:r.length,analyzedConsumers:d.length,omittedConsumers:Math.max(0,r.length-d.length),perConsumerSearchLimit:u,perConsumerCandidateLimit:c,candidateLimit:a,returnedCandidates:p.length}}}function ge(e){let t=new Map;for(let o of e.referencedBy){if(!o.enclosingSymbol)continue;let l=t.get(o.enclosingSymbol);if(l){l.referenceCount+=1;continue}t.set(o.enclosingSymbol,{symbol:o.enclosingSymbol,shortName:P(o.enclosingSymbol)||o.enclosingShort,file:o.relativePath,referenceCount:1})}return[...t.values()].sort((o,l)=>l.referenceCount-o.referenceCount||o.symbol.localeCompare(l.symbol))}function Re(e,t){return e.symbolA===t?e:e.symbolB!==t?null:{...e,symbolA:e.symbolB,shortNameA:e.shortNameB,fileA:e.fileB,symbolB:e.symbolA,shortNameB:e.shortNameA,fileB:e.fileA,uniqueToA:e.uniqueToB,uniqueToB:e.uniqueToA}}function xe(e,t){let o=me(t.candidate.actionTier)-me(e.candidate.actionTier);if(o!==0)return o;let l=t.consumers.length-e.consumers.length;if(l!==0)return l;let m=t.candidate.similarity-e.candidate.similarity;return m!==0?m:e.candidate.symbolB.localeCompare(t.candidate.symbolB)}function me(e){return e==="direct"?1:0}function v(e,t){return typeof e=="number"&&Number.isFinite(e)?Math.max(1,Math.floor(e)):t}function Le(){return{candidates:[],coverage:{totalConsumers:0,analyzedConsumers:0,omittedConsumers:0,perConsumerSearchLimit:I,perConsumerCandidateLimit:M,candidateLimit:B,returnedCandidates:0}}}function f(e,t,o,l=()=>({})){let m;return $(`context.${e}`,()=>(m=o(),m),()=>({target:t,...l(m)}))}function Te(e,t,o){let l={available:!1,file:t,churn:null,coChangePartners:[],suppressionsInFile:0};if(!t)return l;let m=Y(e,o?{head:o}:{}),u=f("history.churn",t,()=>m.fileChurn(),r=>({files:r?.size??0}));if(!u)return l;let c=f("history.co-change",t,()=>Z(e,t,{limit:5,...o?{head:o}:{}}),r=>({commits:r.commitsAnalyzed,partners:r.findings.length})),a=f("history.suppressions",t,()=>oe(e).byFile.get(t)??0,r=>({suppressions:r}));return{available:!0,file:t,churn:u.get(t)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:c.findings.map(r=>({file:r.fileA===t?r.fileB:r.fileA,together:r.together,confidence:r.confidence,subjectContext:r.subjectContext})),suppressionsInFile:a}}function Ee(e){return e.includes("/")||e.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(e)}export{Je as a,Se as b};
|
|
6
|
+
//# sourceMappingURL=chunk-URTX2BEA.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as f}from"./chunk-DOPCR5BY.js";import{b as l,e as n,i as c}from"./chunk-H5EXS3HM.js";import{a as d}from"./chunk-3VLJ2DCA.js";import{h as u}from"./chunk-4DCKBY6T.js";import{join as o}from"path";var L=6,q=1e4,y="watch.lock",m="watch-state.json",b="watch-activity.json",S="watch-refresh-requests";function C(t){return{lockPath:o(t,y),statePath:o(t,m),activityPath:o(t,b),refreshRequestsPath:o(t,S)}}function j(t){try{return g(JSON.parse(u(t,"watch service state")))}catch{return null}}function g(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!r(e.startedAt)||!r(e.heartbeatAt)||!r(e.lastActivityAt)||!h(e.watcher)||e.idleDeadlineAt!==void 0&&!r(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let i=d(e.processIdentity);if(!i||i.pid!==e.pid)return null;e.processIdentity=i}return e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!R(e.lastError)||e.lastRefresh!==void 0&&!A(e.lastRefresh)||e.reindexActivity!==void 0&&!v(e.reindexActivity)||e.refreshRequests!==void 0&&!E(e.refreshRequests)||e.typescriptSemantic!==void 0&&!w(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!T(e.typescriptIndex)?null:e}function r(t){return l(t)}function h(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return s(e.changedFiles)&&s(e.reindexAt);case"indexing":return s(e.startedAt);case"cooldown":return s(e.until)&&typeof e.dirty=="boolean";case"budget-paused":return s(e.until)&&typeof e.dirty=="boolean"&&typeof e.reason=="string"&&n(e.rebuilt)&&n(e.estimatedWriteBytes);case"draining":return s(e.startedAt)&&typeof e.reason=="string";default:return!1}}function R(t){if(!t||typeof t!="object")return!1;let e=t;return r(e.at)&&typeof e.message=="string"}function A(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&r(e.startedAt)&&r(e.completedAt)&&s(e.durationMs)}function v(t){if(!t||typeof t!="object")return!1;let e=t;return e.confidence!==void 0&&e.confidence!=="complete"&&e.confidence!=="partial"&&e.confidence!=="unavailable"||e.recordsRead!==void 0&&!n(e.recordsRead)||e.invalidRecords!==void 0&&!n(e.invalidRecords)||e.skippedRecords!==void 0&&!n(e.skippedRecords)||e.readErrors!==void 0&&!n(e.readErrors)||e.ignoredPartialTailBytes!==void 0&&!n(e.ignoredPartialTailBytes)||!r(e.windowStartedAt)||!r(e.windowEndedAt)||!n(e.runs)||!n(e.rebuilt)||e.fullRebuilds!==void 0&&!n(e.fullRebuilds)||!n(e.reused)||!n(e.failed)||!n(e.suppressed)||!s(e.estimatedLogicalOutputBytes)||e.estimatedWriteBytes!==void 0&&!n(e.estimatedWriteBytes)||e.reflinkedBytes!==void 0&&!n(e.reflinkedBytes)||e.fallbackCopiedBytes!==void 0&&!n(e.fallbackCopiedBytes)||e.oldestRebuildAt!==void 0&&!r(e.oldestRebuildAt)||e.oldestWriteAt!==void 0&&!r(e.oldestWriteAt)||e.languageAttribution!==void 0&&e.languageAttribution!=="complete"&&e.languageAttribution!=="partial"&&e.languageAttribution!=="unavailable"||e.attributedRuns!==void 0&&!n(e.attributedRuns)||e.unattributedRuns!==void 0&&!n(e.unattributedRuns)||e.invalidLanguageDetails!==void 0&&!n(e.invalidLanguageDetails)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"||Array.isArray(e.byTrigger)||e.byLanguage!==void 0&&!x(e.byLanguage)?!1:Object.values(e.byTrigger).every(i=>i===void 0||n(i))}function x(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;for(let[e,i]of Object.entries(t)){if(!f.includes(e)||!i||typeof i!="object")return!1;let a=i;if(!n(a.runs)||!n(a.rebuilt)||!n(a.reused)||!n(a.producedOutputBytes)||!c(a.durationMs)||a.rebuilt+a.reused!==a.runs)return!1}return!0}function E(t){if(!t||typeof t!="object")return!1;let e=t;return n(e.pending)&&n(e.claimed)&&n(e.completed)&&n(e.expired)&&n(e.invalid)&&(e.oldestPendingAt===void 0||r(e.oldestPendingAt))}function w(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&s(e.requests)&&s(e.sessionsCreated)&&s(e.sessionsReused)&&s(e.sessionsRefreshed)&&s(e.sessionsReplaced)&&s(e.projectsCreated)&&(e.lastRequestAt===void 0||r(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||r(e.busyUntil))&&(e.mailbox===void 0||p(e.mailbox))}function T(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&n(e.requests)&&n(e.sessionsCreated)&&n(e.sessionsReplaced)&&(e.sessionsEvicted===void 0||n(e.sessionsEvicted))&&(e.activeSessions===void 0||n(e.activeSessions))&&(e.maxActiveSessions===void 0||n(e.maxActiveSessions))&&(e.heapUsedBytes===void 0||n(e.heapUsedBytes))&&(e.heapLimitBytes===void 0||n(e.heapLimitBytes))&&(e.softMemoryLimitBytes===void 0||n(e.softMemoryLimitBytes))&&(e.retireRequested===void 0||typeof e.retireRequested=="boolean")&&n(e.initializations)&&n(e.programUpdates)&&n(e.documentsEmitted)&&n(e.documentsRemoved)&&(e.lastRequestAt===void 0||r(e.lastRequestAt))&&(e.lastDurationMs===void 0||s(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||r(e.busyUntil))&&(e.mailbox===void 0||p(e.mailbox))}function p(t){if(!t||typeof t!="object")return!1;let e=t;return n(e.pending)&&n(e.inflight)&&n(e.responses)&&n(e.deadLetters)&&n(e.invalid)&&n(e.totalItems)&&s(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||r(e.oldestPendingAt))}function s(t){return typeof t=="number"&&Number.isFinite(t)}export{L as a,q as b,C as c,j as d,r as e};
|
|
2
|
+
//# sourceMappingURL=chunk-UZFCZ7SJ.js.map
|