codebaseiq 0.3.0 → 0.4.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 +80 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-7GAK2F3H.js → chunk-23AD24QZ.js} +12 -12
- package/dist/chunk-24TEZJST.js +2 -0
- package/dist/{chunk-356EZBIP.js → chunk-26EDDGAX.js} +2 -2
- package/dist/{chunk-O2M3VNDY.js → chunk-26EZWQ24.js} +2 -2
- package/dist/{chunk-U33PMPNW.js → chunk-2L3NCI52.js} +2 -2
- package/dist/{chunk-MSI3K7PJ.js → chunk-2QJAVISG.js} +2 -2
- package/dist/{chunk-4LK5OIPW.js → chunk-2ZBZRYX4.js} +2 -2
- package/dist/chunk-33AXWMO2.js +2 -0
- package/dist/{chunk-EQNMD62X.js → chunk-37K55EG3.js} +2 -2
- package/dist/{chunk-ITSJMNUD.js → chunk-3EFZ5KQ4.js} +2 -2
- package/dist/{chunk-D7DOB27N.js → chunk-3F23W57G.js} +2 -2
- package/dist/{chunk-BGGB5N53.js → chunk-3GKKCVKK.js} +2 -2
- package/dist/{chunk-MQW6SJ4P.js → chunk-3SYRGMCL.js} +2 -2
- package/dist/{chunk-PFC44E6D.js → chunk-3VDL7GTY.js} +2 -2
- package/dist/{chunk-7JELP5YE.js → chunk-3XBZ5PKL.js} +2 -2
- package/dist/{chunk-75KJGYX7.js → chunk-42PXSE74.js} +2 -2
- package/dist/{chunk-FEIZXBLH.js → chunk-4GIERC2P.js} +2 -2
- package/dist/{chunk-W7YLRXZE.js → chunk-4UXDBRIF.js} +2 -2
- package/dist/chunk-4XMZYLW5.js +2 -0
- package/dist/{chunk-6BF3VYEF.js → chunk-55NUXP2V.js} +2 -2
- package/dist/chunk-5AJQCOZZ.js +21 -0
- package/dist/{chunk-5DSL3NT2.js → chunk-5NUPFZFA.js} +2 -2
- package/dist/{chunk-RJVAPMHF.js → chunk-65QIFIF6.js} +2 -2
- package/dist/{chunk-36JC5BG2.js → chunk-66Q5VLH6.js} +2 -2
- package/dist/{chunk-D7AZAOZX.js → chunk-6CQPIIS7.js} +2 -2
- package/dist/{chunk-GV2CEZCW.js → chunk-6CTSFS7R.js} +2 -2
- package/dist/{chunk-Q4XEU3UH.js → chunk-6EBUAKJT.js} +2 -2
- package/dist/chunk-6I55VYFG.js +4 -0
- package/dist/chunk-6NUURWPF.js +3 -0
- package/dist/{chunk-MHWMEZDA.js → chunk-6P5QMOM7.js} +2 -2
- package/dist/{chunk-LZSQ6X7E.js → chunk-6S5FE4ZF.js} +2 -2
- package/dist/chunk-74LRKLNC.js +22 -0
- package/dist/chunk-75A23IID.js +3 -0
- package/dist/chunk-75VNTSO6.js +7 -0
- package/dist/chunk-7HBBVZJ6.js +3 -0
- package/dist/{chunk-VWYGCMV5.js → chunk-7PPBMBH6.js} +2 -2
- package/dist/{chunk-3RSBGWGL.js → chunk-7WG57A5X.js} +2 -2
- package/dist/{chunk-FWQGH2N2.js → chunk-7XHZX6FX.js} +2 -2
- package/dist/{chunk-RIYJ4L33.js → chunk-A5HJ3CJW.js} +2 -2
- package/dist/{chunk-LONKINMJ.js → chunk-AJ5HVC5Z.js} +2 -2
- package/dist/{chunk-ZAFGY22Q.js → chunk-AYRHOFLV.js} +2 -2
- package/dist/chunk-AZDY3EKD.js +93 -0
- package/dist/{chunk-CW6AXOLR.js → chunk-AZZNG5Z2.js} +2 -2
- package/dist/chunk-BEKCTUPY.js +3 -0
- package/dist/{chunk-CR3OG6SQ.js → chunk-BKKX2OU5.js} +2 -2
- package/dist/{chunk-5LL4KEHO.js → chunk-BQKRYKDD.js} +2 -2
- package/dist/{chunk-FOZ74V56.js → chunk-BVDQU2XJ.js} +2 -2
- package/dist/chunk-C3PPB2T5.js +5 -0
- package/dist/chunk-CABIZQXQ.js +21 -0
- package/dist/{chunk-M2Y6PCFE.js → chunk-CAH322MC.js} +2 -2
- package/dist/{chunk-EIBGSU2R.js → chunk-CBOOHUK4.js} +2 -2
- package/dist/chunk-CFIICAOM.js +2 -0
- package/dist/{chunk-XMJ53WG4.js → chunk-CPWYEPWQ.js} +2 -2
- package/dist/{chunk-LQHYYIOB.js → chunk-CRT7I7RJ.js} +2 -2
- package/dist/{chunk-IZDPGOZR.js → chunk-CZVSQQDU.js} +2 -2
- package/dist/{chunk-TNJGTQWO.js → chunk-D3KE26FS.js} +2 -2
- package/dist/{chunk-GP7C5VAE.js → chunk-DNRHRVKS.js} +2 -2
- package/dist/{chunk-SGMNWYTH.js → chunk-DOQLO74K.js} +2 -2
- package/dist/{chunk-AURCQHSG.js → chunk-DP3EJ6XL.js} +2 -2
- package/dist/{chunk-C7QWUBR2.js → chunk-DQZF7MP6.js} +2 -2
- package/dist/{chunk-E52K4L2W.js → chunk-DTM4EHD2.js} +2 -2
- package/dist/{chunk-YRKP7PM7.js → chunk-DUM7GR6B.js} +2 -2
- package/dist/{chunk-I22IZYDI.js → chunk-DZ4QOIRY.js} +2 -2
- package/dist/{chunk-EXZ7VLRY.js → chunk-E3R6TJ5T.js} +2 -2
- package/dist/chunk-E4DP45YU.js +3 -0
- package/dist/{chunk-PUVNH4PO.js → chunk-E5U6N5WI.js} +2 -2
- package/dist/chunk-E7T22WET.js +21 -0
- package/dist/{chunk-QEOWONKY.js → chunk-ED7ZAZ5V.js} +2 -2
- package/dist/{chunk-RCIGX23V.js → chunk-EDMG5CSO.js} +2 -2
- package/dist/{chunk-IHSLIIL3.js → chunk-EOSUV7H5.js} +2 -2
- package/dist/{chunk-FQTIFWLR.js → chunk-ESWVTSHU.js} +2 -2
- package/dist/{chunk-6VREELBC.js → chunk-ETZBIG6K.js} +2 -2
- package/dist/chunk-EYSJHKX6.js +3 -0
- package/dist/{chunk-Q23IMHXS.js → chunk-F4AGM7ZE.js} +37 -37
- package/dist/{chunk-FTTV7IRX.js → chunk-FPUJRBHL.js} +50 -50
- package/dist/{chunk-CCIYWXX6.js → chunk-G2UU6PQP.js} +2 -2
- package/dist/{chunk-C6WKPKCF.js → chunk-G3KRXNNT.js} +2 -2
- package/dist/{chunk-TEANKHUU.js → chunk-G3ZBP72R.js} +2 -2
- package/dist/{chunk-NBCQZSGR.js → chunk-GC4I33OD.js} +2 -2
- package/dist/{chunk-NDKOVQFG.js → chunk-GLXEWYQY.js} +2 -2
- package/dist/{chunk-AEXQYQD7.js → chunk-GRHNPFHT.js} +2 -2
- package/dist/{chunk-NBZKSTXP.js → chunk-GWESWURK.js} +2 -2
- package/dist/{chunk-Q3ZCQY2Y.js → chunk-GXOFPAIR.js} +2 -2
- package/dist/{chunk-USOAJHY7.js → chunk-H4FGIFEU.js} +2 -2
- package/dist/{chunk-LKUTSP4G.js → chunk-HOGS6JFP.js} +2 -2
- package/dist/{chunk-UQE4XFSA.js → chunk-HSJLK5MC.js} +2 -2
- package/dist/{chunk-BWL3PMPT.js → chunk-HTPEUJ42.js} +2 -2
- package/dist/{chunk-3RR2K7EZ.js → chunk-IBPXUGJV.js} +2 -2
- package/dist/{chunk-BFBIMTCJ.js → chunk-ITA3N7G6.js} +2 -2
- package/dist/chunk-JG5OWAEB.js +22 -0
- package/dist/{chunk-2PRONPAS.js → chunk-JGJKRTTB.js} +2 -2
- package/dist/{chunk-TJWVT4DO.js → chunk-JGXLB7PR.js} +2 -2
- package/dist/{chunk-K7JLSGCJ.js → chunk-JKUF2UG6.js} +3 -3
- package/dist/{chunk-CIYA2KZN.js → chunk-JOYASZRF.js} +2 -2
- package/dist/{chunk-U7NUXDQO.js → chunk-K3PFL5QQ.js} +2 -2
- package/dist/{chunk-WK2IQJPK.js → chunk-KAXBWTSX.js} +2 -2
- package/dist/{chunk-5ZI2PPI7.js → chunk-KHHAGHAW.js} +2 -2
- package/dist/{chunk-UW6KD57C.js → chunk-KJLUQVBG.js} +2 -2
- package/dist/{chunk-WWCV4E6J.js → chunk-KOVUXHIZ.js} +2 -2
- package/dist/chunk-KPMMOAV5.js +4 -0
- package/dist/{chunk-GDHWOA57.js → chunk-LKJZNGMA.js} +2 -2
- package/dist/{chunk-3VJ3OCRE.js → chunk-LMPOC372.js} +2 -2
- package/dist/{chunk-F3QSL4W2.js → chunk-LTPNP6D5.js} +2 -2
- package/dist/{chunk-MVRGB4KJ.js → chunk-M3IBH6C3.js} +9 -9
- package/dist/{chunk-PHNCEUXX.js → chunk-MAGBSB6E.js} +2 -2
- package/dist/{chunk-QMOZZ2VX.js → chunk-MFMHD36E.js} +2 -2
- package/dist/{chunk-LMTSB3TB.js → chunk-MJX2J5QE.js} +2 -2
- package/dist/{chunk-PTQPPPG2.js → chunk-N26LGGSF.js} +2 -2
- package/dist/{chunk-J7AMBVWF.js → chunk-NB2DAVPP.js} +2 -2
- package/dist/{chunk-JYI7CV25.js → chunk-NJDXNYLG.js} +2 -2
- package/dist/{chunk-BRQL7AFJ.js → chunk-NMKQOIYZ.js} +2 -2
- package/dist/{chunk-ICUL7XRT.js → chunk-NRNVMB2R.js} +2 -2
- package/dist/{chunk-DDN2F6GB.js → chunk-O5BWFNIH.js} +2 -2
- package/dist/{chunk-HVFB3PME.js → chunk-O7PCDZ5B.js} +2 -2
- package/dist/{chunk-KPZGTB2O.js → chunk-OAJYNPRU.js} +2 -2
- package/dist/{chunk-2EDX3JT5.js → chunk-OFUC6R46.js} +2 -2
- package/dist/chunk-OSZ7PW5K.js +5 -0
- package/dist/{chunk-B3UYV66Z.js → chunk-OZ2M2X7A.js} +2 -2
- package/dist/{chunk-6O3KXIDL.js → chunk-OZI44VCR.js} +2 -2
- package/dist/{chunk-XN3EKMLI.js → chunk-PCKIKOUA.js} +2 -2
- package/dist/{chunk-NCJILOAK.js → chunk-PFMQRHC6.js} +2 -2
- package/dist/chunk-PVKSZBX5.js +82 -0
- package/dist/{chunk-NEWHKGVD.js → chunk-QANCT4MO.js} +2 -2
- package/dist/{chunk-ZNH33XIB.js → chunk-QEWN7BLP.js} +2 -2
- package/dist/{chunk-OQUCBKOI.js → chunk-QFJ46F6F.js} +2 -2
- package/dist/{chunk-2E6OUPCF.js → chunk-QPQWR6CW.js} +2 -2
- package/dist/{chunk-YTJHCGYB.js → chunk-QX4HDF2I.js} +2 -2
- package/dist/{chunk-J3GLP7Q5.js → chunk-R2F2CTBA.js} +2 -2
- package/dist/{chunk-2OMXFE64.js → chunk-R7PXHYMY.js} +2 -2
- package/dist/{chunk-F74LZWCE.js → chunk-RGBZDOUO.js} +2 -2
- package/dist/{chunk-362QOSFD.js → chunk-RNPG5P4P.js} +2 -2
- package/dist/{chunk-D62CTZX6.js → chunk-RS6UYNEP.js} +2 -2
- package/dist/{chunk-VGWZ4MOY.js → chunk-RVBRPBLQ.js} +2 -2
- package/dist/{chunk-5IZRKWTZ.js → chunk-RWAZCEJD.js} +2 -2
- package/dist/{chunk-ZQ62NNKN.js → chunk-RWDIONS7.js} +2 -2
- package/dist/{chunk-HQA7EBSK.js → chunk-S3CJYDXP.js} +2 -2
- package/dist/{chunk-GL6UTNUB.js → chunk-S6UTKCBT.js} +2 -2
- package/dist/chunk-SLLFJXTW.js +27 -0
- package/dist/{chunk-TOTWJZIX.js → chunk-T3KTMLQT.js} +2 -2
- package/dist/{chunk-67VJAYVR.js → chunk-TB575ZGO.js} +2 -2
- package/dist/{chunk-YHPG3S2U.js → chunk-TG4GMU73.js} +2 -2
- package/dist/{chunk-CVHOQONG.js → chunk-THKM7OXM.js} +2 -2
- package/dist/{chunk-GVAF222T.js → chunk-TNLOX4TN.js} +2 -2
- package/dist/{chunk-HENP2O4A.js → chunk-UHFZDQZJ.js} +2 -2
- package/dist/{chunk-YT4DVWUV.js → chunk-UUMAM5LM.js} +2 -2
- package/dist/{chunk-JX6ZWDOS.js → chunk-UUT5P3V7.js} +2 -2
- package/dist/{chunk-Z6RL7XOE.js → chunk-VEPK6M5C.js} +2 -2
- package/dist/{chunk-C7OUW52M.js → chunk-VPCHKZ3I.js} +2 -2
- package/dist/{chunk-GIDCP7KV.js → chunk-VZY3XOBU.js} +2 -2
- package/dist/{chunk-XQAVQVIL.js → chunk-W6E6ME7G.js} +2 -2
- package/dist/{chunk-XQPPURLQ.js → chunk-WGYZBS5S.js} +2 -2
- package/dist/{chunk-GUFPEFBG.js → chunk-WUP24Q4U.js} +2 -2
- package/dist/chunk-WXUHXSLN.js +2 -0
- package/dist/{chunk-HINZQKSY.js → chunk-X4YZD2MP.js} +2 -2
- package/dist/chunk-XARPGCTL.js +2 -0
- package/dist/{chunk-5FWR5HLG.js → chunk-XDQ6QJF5.js} +20 -20
- package/dist/{chunk-JCMFBF4Z.js → chunk-XRH7R5SX.js} +2 -2
- package/dist/{chunk-BBP7HVBJ.js → chunk-XVJ2E7W7.js} +2 -2
- package/dist/{chunk-D53LWANR.js → chunk-Y7GFAU5N.js} +2 -2
- package/dist/{chunk-T6MQNNAC.js → chunk-YBDLHFZZ.js} +2 -2
- package/dist/{chunk-ZB4C5TTR.js → chunk-YI3CJPOY.js} +2 -2
- package/dist/chunk-YMAGXBLT.js +3 -0
- package/dist/{chunk-MZNMASFM.js → chunk-YRAGNEBZ.js} +2 -2
- package/dist/chunk-YXZAAQHZ.js +3 -0
- package/dist/chunk-Z2L5H2HF.js +3 -0
- package/dist/{chunk-JSNTHRLQ.js → chunk-ZHK7TVAJ.js} +2 -2
- package/dist/chunk-ZJNV27DZ.js +4 -0
- package/dist/{chunk-GQLDYCWS.js → chunk-ZQ6GAIUV.js} +2 -2
- package/dist/{chunk-TPO7XC5Z.js → chunk-ZQE2QYAC.js} +2 -2
- package/dist/chunk-ZUQ2MDFT.js +2 -0
- package/dist/cli-context-4R2LREXQ.js +3 -0
- package/dist/cli-context-6X7JYARX.js +2 -0
- package/dist/cli-failure-RECEHOM2.js +3 -0
- package/dist/cli-program-MXA3WTAO.js +7 -0
- package/dist/cli.js +1 -1
- package/dist/{code-viewer-VHLBLIUM.js → code-viewer-C6HE4DFC.js} +2 -2
- package/dist/{code-viewer-KIXEYQNJ.js → code-viewer-XHSSAMBX.js} +2 -2
- package/dist/{command-descriptors-YCLATF5I.js → command-descriptors-NWW34Z54.js} +171 -171
- package/dist/{command-descriptors-F5P2V3NW.js → command-descriptors-XHK3PK2I.js} +116 -116
- package/dist/{command-panels-SZONPMLJ.js → command-panels-OXMCJ2QZ.js} +2 -2
- package/dist/direct-navigation-236VXYBZ.js +3 -0
- package/dist/direct-navigation-36YSILY6.js +2 -0
- package/dist/index.js +1 -1
- package/dist/invocation-command-descriptors-35JULLNR.js +3 -0
- package/dist/invocation-command-descriptors-FEWSFUO2.js +2 -0
- package/dist/output-continuation-command-MJBVH3A5.js +2 -0
- package/dist/output-continuation-command-TBXIOPHQ.js +3 -0
- package/dist/project-reindex-5TCGOVSK.js +2 -0
- package/dist/project-reindex-BUNTSYKM.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.js +30 -30
- package/dist/runtime.js +1 -1
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/sentinel-ensure-command-3MZCLPQY.js +2 -0
- package/dist/sentinel-ensure-command-LEWHIRLL.js +3 -0
- package/dist/sentinel-worker.js +1 -1
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +6 -6
- package/docs/COMMAND_REFERENCE.md +2 -2
- package/docs/SECURITY_MODEL.md +3 -0
- package/package.json +1 -1
- package/skills/codebaseiq/SKILL.md +15 -3
- package/dist/chunk-23C5AD3B.js +0 -2
- package/dist/chunk-2I2UHZET.js +0 -2
- package/dist/chunk-5IC2WZAL.js +0 -22
- package/dist/chunk-5T44HG5Y.js +0 -88
- package/dist/chunk-6JMAVFL4.js +0 -3
- package/dist/chunk-6WAPPQ5F.js +0 -82
- package/dist/chunk-7UCDGXRW.js +0 -8
- package/dist/chunk-AQI4N64O.js +0 -22
- package/dist/chunk-DAKIGMIK.js +0 -21
- package/dist/chunk-DUKHVPU5.js +0 -4
- package/dist/chunk-DVWO7RBC.js +0 -2
- package/dist/chunk-FH5WG4LE.js +0 -2
- package/dist/chunk-GQXXOS55.js +0 -2
- package/dist/chunk-GWYZVVKY.js +0 -21
- package/dist/chunk-JFIA2JI3.js +0 -3
- package/dist/chunk-JLZLLLW5.js +0 -3
- package/dist/chunk-MEUHIDI3.js +0 -7
- package/dist/chunk-OFGOOL6U.js +0 -3
- package/dist/chunk-P4NVCOM7.js +0 -2
- package/dist/chunk-SMDIEDM4.js +0 -27
- package/dist/chunk-SX72EVMY.js +0 -3
- package/dist/chunk-T5X7DK6C.js +0 -3
- package/dist/chunk-T75DS2E6.js +0 -21
- package/dist/chunk-TJBOJUVN.js +0 -3
- package/dist/chunk-UC2FD2PS.js +0 -4
- package/dist/chunk-UQYQBLJX.js +0 -5
- package/dist/chunk-Z35GOVEH.js +0 -2
- package/dist/cli-context-FJL2JHOE.js +0 -3
- package/dist/cli-context-PQNWHMCQ.js +0 -2
- package/dist/cli-program-UO7PZD6V.js +0 -7
- package/dist/direct-navigation-4XJTXIDT.js +0 -2
- package/dist/direct-navigation-J5MVYYAD.js +0 -3
- package/dist/invocation-command-descriptors-RWV4VAI4.js +0 -2
- package/dist/invocation-command-descriptors-U76PN7IY.js +0 -3
- package/dist/output-continuation-command-BL25S26S.js +0 -3
- package/dist/output-continuation-command-BTETTXEC.js +0 -2
- package/dist/project-reindex-CRJU3IFG.js +0 -2
- package/dist/project-reindex-TQFCOA2O.js +0 -3
- package/dist/sentinel-ensure-command-OSWGCFFL.js +0 -3
- package/dist/sentinel-ensure-command-SPW7XQLB.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{x as c,y as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{x as c,y as l}from"./chunk-23AD24QZ.js";function h(e,a,i,r,n,o){let t=new Set;d(e,a,i,r)&&t.add(n);for(let s of o)s.value&&p(t,s.label,s.value);return[...t].slice(0,6)}function p(e,a,i){let r=u(i);a.endsWith("name")&&y(r)&&e.add(`${a} has type-guard boundary shape`);for(let n of r){let o=f.get(n);o&&e.add(`${a} has ${o} term: ${n}`)}}function d(e,a,i,r){if(i<=0)return!1;let n=c(e,a);if(n.length===0)return!1;for(let o=i-1;o>=0&&o>=i-5;o-=1){let t=(n[o]??"").trim();if(t!==""){if(l(t)===r)return!0;if(!t.startsWith("//")&&!t.startsWith("*")&&!t.startsWith("/*")&&!t.startsWith("@")&&!t.startsWith("#"))return!1}}return!1}function u(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function y(e){return e.some(a=>g.has(a))&&e.some(a=>m.has(a))}var f=new Map([["access","access policy"],["accessible","access policy"],["adapter","adapter"],["adapters","adapter"],["allow","access policy"],["allowed","access policy"],["animation","animation calculation"],["api","api surface"],["apply","settings/application"],["audit","side-effect boundary"],["auth","authorization"],["authorize","authorization"],["audio","audio side-effect"],["can","access policy"],["capabilities","capability boundary"],["capability","capability boundary"],["boundary","boundary"],["begin","lifecycle"],["bridge","bridge"],["bridges","bridge"],["cache","state cache"],["chase","gameplay action"],["command","command boundary"],["context","context policy"],["cooldown","temporal state"],["cooldowns","temporal state"],["controller","controller"],["controllers","controller"],["diagnostic","diagnostics"],["diagnostics","diagnostics"],["effect","side-effect boundary"],["effects","side-effect boundary"],["energy","gameplay calculation"],["expired","temporal state"],["facade","facade"],["facades","facade"],["fire","gameplay action"],["gateway","gateway"],["gateways","gateway"],["guard","guard"],["guards","guard"],["haptic","haptic side-effect"],["haptics","haptic side-effect"],["head","sequence boundary"],["history","state history"],["input","input boundary"],["jump","gameplay action"],["keyboard","input boundary"],["log","side-effect boundary"],["logger","side-effect boundary"],["lock","coordination boundary"],["middleware","middleware"],["multiplier","gameplay calculation"],["mute","audio side-effect"],["normalize","normalization"],["normalise","normalization"],["normalizer","normalization"],["oscillate","animation calculation"],["oscillation","animation calculation"],["overlap","collision predicate"],["performance","diagnostics"],["permission","access policy"],["permissions","access policy"],["policy","policy"],["pool","state pool"],["pooled","state pool"],["pools","state pool"],["predict","prediction"],["presenter","presenter"],["presenters","presenter"],["projectile","gameplay entity"],["provider","provider boundary"],["providers","provider boundary"],["public","public surface"],["quality","settings/application"],["rate","calculation"],["register","registry"],["registry","registry"],["relay","relay"],["relays","relay"],["reseed","state lifecycle"],["reset","state lifecycle"],["respond","response boundary"],["response","response boundary"],["resolve","resolution"],["resolver","resolution"],["route","route boundary"],["routes","route boundary"],["run","lifecycle"],["sample","diagnostics"],["score","gameplay calculation"],["scope","scope policy"],["scroll","position state"],["scrolled","position state"],["seed","state lifecycle"],["seeded","state lifecycle"],["segment","segment boundary"],["segments","segment boundary"],["setting","settings/application"],["settings","settings/application"],["spawn","gameplay lifecycle"],["spawning","gameplay lifecycle"],["speed","gameplay calculation"],["surface","public surface"],["tail","sequence boundary"],["tick","temporal state"],["transaction","transaction"],["transactional","transaction"],["transform","transformation"],["transformer","transformation"],["translate","translation"],["translator","translation"],["try","fallible action"],["validate","validation"],["validation","validation"],["validator","validation"],["visual","diagnostics"],["window","settings/application"],["socket","transport boundary"],["websocket","transport boundary"]]),g=new Set(["can","has","is","should"]),m=new Set(["access","api","auth","collision","expired","input","keyboard","overlap","permission","permissions","policy","projectile","response","route","routes","scope"]);export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-MFMHD36E.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-DOQLO74K.js";import{b as a}from"./chunk-NRNVMB2R.js";import{existsSync as c}from"fs";import{isAbsolute as p,join as u}from"path";function g(e,t){let o=l(e,t,{allowMultiple:!1})[0]?.relativePath;return o||s(e,t)}function x(e,t){return l(e,t,{allowMultiple:!0}).map(o=>o.relativePath)}function s(e,t){if(!t)return null;let o=t.replace(/\\/g,"/").replace(/^\.\//,""),r=p(o)&&o.startsWith(e.config.projectRoot)?o.slice(e.config.projectRoot.length).replace(/^\/+/,""):o,n=u(e.config.projectRoot,r);return c(n)?r:null}function l(e,t,o){let r=a(e,t,o);if(r.length===0){if(s(e,t))return[];let n=i(e,t);return!n||e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,score:700}]}return r}export{g as a,x as b};
|
|
2
|
+
//# sourceMappingURL=chunk-MJX2J5QE.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as G,D as P,a as y,b as ce,i as k,j as le,t as B,u as de,w as j,x as ue,y as b}from"./chunk-
|
|
1
|
+
import{A as G,D as P,a as y,b as ce,i as k,j as le,t as B,u as de,w as j,x as ue,y as b}from"./chunk-ZUQ2MDFT.js";import{c as oe,d as re,e as ie,g as se,i as ae,k as E}from"./chunk-5AJQCOZZ.js";import{eb as g,fb as ne,gb as C,ib as x,n as ee,p as te,w as S}from"./chunk-AJ5HVC5Z.js";import{A as H,C as Z,n as N,o as L,q as M,z as Y}from"./chunk-PVKSZBX5.js";import{c as W}from"./chunk-W6E6ME7G.js";import{c as T,g as Q}from"./chunk-DRENNWRG.js";import{G as X}from"./chunk-ZJNV27DZ.js";function ge(e,n,t){if(!Number.isSafeInteger(t.limit)||t.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=N(e,n);if(!o)return{rows:[],hasMore:!1,producer:t.producer??"source-keyset",semanticEnrichment:!1};if(t.producer==="complete-only"||t.semantic===!0||o.relativePath.endsWith(".rb"))return F(e,n,t);let i=Y(e,o);if(!i)return F(e,n,t);let s=fe(e,o),c=Te(e,s),a=[],l=t.producer==="source-keyset";for(let u of c){if(t.after&&u<t.after.relativePath)continue;t.instrumentation?.fileScanned?.(u);let f=H(e,i,u);f.length>0&&(l=!0);let d=new Set(f);s?.relativePath===u&&d.add(s.line);for(let m of[...d].sort((p,Ae)=>p-Ae)){let p={relativePath:u,line:m};if(!(t.after&&R(p,t.after)<=0)&&(a.push(p),t.instrumentation?.rowAccepted?.(p),l&&a.length>t.limit))return me(a,t.limit)}}return l?me(a,t.limit):F(e,n,t,s)}function R(e,n){return(e.relativePath<n.relativePath?-1:e.relativePath>n.relativePath?1:0)||e.line-n.line}function me(e,n){return{rows:e.slice(0,n),hasMore:e.length>n,producer:"source-keyset",semanticEnrichment:!1}}function F(e,n,t,o){let r=N(e,n),i=t.semantic===!0||r?.relativePath.endsWith(".rb")?S(e,n,{semantic:t.semantic}):De(e,n,o),s=Me(i).filter(c=>!t.after||R(c,t.after)>0);for(let c of s.slice(0,t.limit+1))t.instrumentation?.rowAccepted?.(c);return{rows:s.slice(0,t.limit),hasMore:s.length>t.limit,producer:"complete-only",semanticEnrichment:t.semantic===!0}}function De(e,n,t){let o=N(e,n);if(!o)return[];let r=t===void 0?fe(e,o):t,i=Z(e,o).map(s=>({relativePath:s.file,line:s.line}));return r?[r,...i]:i}function fe(e,n){return!Q(n.symbol)&&!e.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function Te(e,n){let t=W(e);return!n||t.includes(n.relativePath)?t:[...t,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Me(e){let n=new Map;for(let t of e)n.set(`${t.relativePath}\0${t.line}`,t);return[...n.values()].sort(R)}import{InvalidArgumentError as v}from"commander";var St=X,Be=/^[+-]?\d+$/u,je=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,xt=(e=>V(e,"an integer")),pe=(e=>{let n=V(e,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${e}".`);return n}),he=(e=>{let n=V(e,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${e}".`);return n}),Et=(e=>{if(!je.test(e))throw new v(`Expected a number, got "${e}".`);let n=Number(e);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${e}".`);return n});function V(e,n){if(!Be.test(e))throw new v(`Expected ${n}, got "${e}".`);let t=Number(e);if(!Number.isSafeInteger(t))throw new v(`Expected ${n}, got "${e}".`);return t}function h(e,n,t,...o){return o.length>0?{flags:e,description:n,parser:t,defaultValue:o[0]}:{flags:e,description:n,parser:t}}function Ge(){return h("--json","Output as JSON for programmatic consumption")}function Fe(){return h("--compact","Emit minified one-line JSON (use with --json)")}function Ve(){return h("--result-only","Emit only the command-owned result (use with --json)")}function Ce(e=[]){return I(e)}function I(e=[]){let n=[Ge(),Ve(),Fe()],t=new Set(n.map(o=>o.flags));return[...e.filter(o=>!t.has(o.flags)),...n]}function $(e,n=[]){return{category:e,examples:n}}function Pt(e,n){return{origin:"mixed",observedSources:e,producerValidation:{status:"not-evaluated"},families:n}}function $t(e,n){return{origin:e,observedSources:n,producerValidation:{status:"not-evaluated"}}}function wt(e,n,t){return{id:e,selector:n,origin:{kind:"fixed",origin:t}}}function Ot(e,n,t,o){return{id:e,selector:n,origin:{kind:"result-field",field:t,values:o}}}function w(e,n,t,o,r,i,s){return{answers:typeof e=="string"?[e]:e,returns:typeof n=="string"?[n]:n,inputs:t,coverage:o,operation:i,semantic:s,...r?{scope:r}:{}}}function Nt(e,n,t,o,r,i=y){let s=typeof e=="string"?[e]:e,c=typeof n=="string"?[n]:n;return w(s,c,t,o,r,i,K(s.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function ye(e,n,t,o,r,i=y){let s=typeof e=="string"?[e]:e,c=typeof n=="string"?[n]:n;return w(s,c,t,o,r,i,Ke(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function be(e,n,t={ranking:"identity-only"}){return{kind:"locator",locates:e,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...t}}function Lt(e){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...e}}function Re(e,n,t,o={}){return{kind:"source-read",reads:e,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...t?{compatibility:t}:{},...o}}function K(e,n,t,o,r={}){return{kind:"analysis",analysis:e,resultMeaning:n,nonClaims:t,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Ke(e,n,t,o={}){return{kind:"maintenance",effect:e,nonClaims:n,outputCost:"variable",frontierClosure:[],...t?{compatibility:t}:{},...o}}function J(e){return Buffer.from(JSON.stringify(e),"utf8").toString("base64url")}function A(e){return e.generation.identity}function U(e){return"after"in e?J({version:2,...e}):J({version:1,...e})}function ve(e,n){let t=_e(e);if(!Je(t)&&!Ue(t))throw new Error("Invalid result cursor. Run the command again without --cursor.");return ze(t,n),t}function Je(e){if(!e||typeof e!="object")return!1;let n=e;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ue(e){if(!e||typeof e!="object")return!1;let n=e,t=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!t&&typeof t.relativePath=="string"&&t.relativePath.length>0&&Number.isSafeInteger(t.line)&&(t.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function _e(e){try{return JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function ze(e,n){if(e.command!==n.command||e.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(e.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function Se(e,n){let t=L(e,n),o=qe(t);for(let r of o)console.log(r)}function xe(e,n,t="No results found for resolved symbol."){return L(e,n).match?t:z(n,M(e,n,5))}function _(e,n,t,o){return{...D(e,n),[o]:t}}function D(e,n){let t=L(e,n);return t.match?{matched:!0,resolved:{symbol:t.match.symbol,shortName:T(t.match.symbol),relativePath:t.match.relativePath},otherMatches:t.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:t.total}:{matched:!1,suggestions:M(e,n,5)}}function z(e,n){let t=`No definition matched '${e}'.`;return n.length>0?`${t} Suggestions: ${n.join(", ")}`:t}function qe(e){if(!e.match||e.total<=1)return[];let n=e.match,t=Math.max(0,e.total-1),o=[`Resolved: ${T(n.symbol)} (${n.relativePath}) -- ${t} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=e.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(i=>`${i.shortName} (${i.relativePath}:${g(i.startLine)})`).join("; ")}`),o.push(""),o}var We=k(({db:e,args:n,opts:t})=>{let o=B(n,0),r=b(t,"signatures"),i=ee(e,o);if(b(t,"json")){P("outline",n,t,i);return}if(console.log(`\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550
|
|
2
2
|
file=${JSON.stringify(o)}; signatures=${r?"shown":"hidden"}`),i.length===0){console.log(`
|
|
3
3
|
\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550
|
|
4
4
|
No compiler-owned constructs were found for ${JSON.stringify(o)}.`),console.log(`
|
|
@@ -27,4 +27,4 @@ ${p}continue with --cursor ${d.cursor}`)}});function Ye(e,n,t){let o=S(e,n,{sema
|
|
|
27
27
|
`),o=0,r=0;for(let i=0;i<t.length;i++){let s=t[i].length+12;i>o&&r+s>Ee&&(n.push(`${e.relativePath}:${g(e.startLine+o)}-${g(e.startLine+i-1)}`),o=i,r=0),r+=s}return n.push(`${e.relativePath}:${g(e.startLine+o)}-${g(e.endLine)}`),n}function Pe(e,n){return{requested:n.length,matched:n.filter(t=>t.status==="matched").length,ambiguous:n.filter(t=>t.status==="ambiguous").length,missing:n.filter(t=>t.status==="missing").length,entries:[...n],bindingClosure:e.bindingClosure}}function $e(e,n){return["codebaseiq","code",...e.map(O),...n.members==="all"?["--members","all"]:[],...n.context>0?["--context",String(n.context)]:[]].join(" ")}function dt(e,n,t){if(!t)return D(e,n);let o={file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:g(t.startLine),endLine:g(t.endLine)},...t.freshness?{freshness:t.freshness}:{},lines:t.source.split(`
|
|
28
28
|
`).map((s,c)=>({line:g(t.startLine+c),text:s}))},r=D(e,n),i=r.totalMatches??0;return!r.matched||!r.resolved||i<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:i}}}function ut(e){return{requested:e.requested,matched:e.matched,ambiguous:e.ambiguous,missing:e.missing,entries:e.entries.map(n=>({selector:n.selector,status:n.status,kind:n.kind,totalCandidates:n.totalCandidates,sources:n.results.map(t=>({file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:g(t.startLine),endLine:g(t.endLine)},...t.freshness?{freshness:t.freshness}:{},lines:t.source.split(`
|
|
29
29
|
`).map((o,r)=>({line:g(t.startLine+r),text:o}))})),definitions:n.definitions,...n.fileCoverage?{fileCoverage:n.fileCoverage}:{},...n.rangeCoverage?{rangeCoverage:n.rangeCoverage}:{},candidates:n.candidates,omittedCandidates:n.omittedCandidates,suggestions:n.suggestions,...n.reason?{reason:n.reason}:{}})),literalValues:e.bindingClosure.inline}}function O(e){return`'${e.replaceAll("'","'\\''")}'`}var Zt=[{id:"session",command:"session",description:"Show evidence already delivered in this agent exploration session",options:[h("--reset","Clear this agent exploration-session ledger")],agent:ye("Which indexed source ranges and graph facts have already been delivered in this exploration session?","prior command ordinals, exact source ranges, and content-bound graph receipts",[],"complete","repository",ce("repository-observation",[{when:{kind:"option",name:"reset",equals:!0},role:"mutation"}])),renderShape:"custom",docs:$("Navigation"),handler:et},{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:Ce([h("--full","Run unbounded semantic analysis on large indexes"),h("-n, --limit <n>","Maximum reference sites to return",he),h("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{operation:y,answers:["Which files reference this symbol?","Is this symbol used anywhere, or only defined?"],returns:["referencing file paths","reference line numbers grouped by file"],inputs:["symbol"],coverage:"bounded",semantic:K("Resolve the exact reference sites attributed to one compiler symbol identity.","Referencing file paths and reference line numbers grouped by file.",["Reference sites do not establish runtime execution, data flow, or task relevance."]),contrasts:[{command:"imported-by",distinction:"imported-by lists files importing the symbol; refs covers every reference site, imported or not."},{command:"affected",distinction:"refs is one hop out; affected is the transitive closure of what could break."}]},renderShape:"grouped-by-file",docs:$("Navigation",["codebaseiq refs login"]),handler:Qe},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:{...w("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete",void 0,y,be(["file","symbol","construct"],["File ownership and nesting do not establish execution or task relevance."],{ranking:"identity-only",manualInput:"One exact current project file path.",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay."})),contrasts:[{command:"search",distinction:"outline enumerates constructs in one known file; search locates exact text across current project text."},{command:"code",distinction:"outline returns identities and ranges; code materializes exact source for selected identities."}]},options:I([h("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:$("Navigation"),handler:We},{id:"code",command:"code <selectors...>",description:"Read exact definitions, ranges with local call closure, or file export surfaces",agent:{...w("What exact source defines these symbols, ranges, or file surfaces?","per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",[["symbol","file"]],"complete",void 0,y,Re(["construct","exact-source"],["Source materialization does not establish callers, runtime reachability, or task relevance by itself."],void 0,{manualInput:"One or more exact symbols, file:line ranges, or file paths.",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed."})),resultUnits:{kind:"field",field:"code"},contrasts:[{command:"inspect",distinction:"code materializes complete exact source; inspect batches bounded behavior or source gaps."},{command:"outline",distinction:"code reads selected implementations; outline enumerates file structure without reading every body."}]},options:I([h("-C, --context <n>","Extra lines of context above/below",pe,0),h("--members <exported|all>","For file selectors, return the exported surface or the complete file",void 0,"exported")]),renderShape:"custom",docs:$("Navigation",["codebaseiq code parseRequest handleRequest","codebaseiq code src/api.ts src/web.ts"]),handler:Xe}];export{St as a,xt as b,pe as c,he as d,Et as e,h as f,Fe as g,Ce as h,I as i,$ as j,Pt as k,$t as l,wt as m,Ot as n,w as o,Nt as p,ye as q,be as r,Lt as s,Re as t,K as u,Se as v,xe as w,_ as x,D as y,Zt as z};
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
30
|
+
//# sourceMappingURL=chunk-N26LGGSF.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as O}from"./chunk-ELNRLMC5.js";import{d as S}from"./chunk-
|
|
1
|
+
import{d as O}from"./chunk-ELNRLMC5.js";import{d as S}from"./chunk-DOQLO74K.js";import{A as T,c as A,e as b,t as F}from"./chunk-TNLOX4TN.js";import{a as D,b as P,f as h,p as I}from"./chunk-RGBZDOUO.js";import{K as _,z as k}from"./chunk-NRNVMB2R.js";import{g,h as w,w as m}from"./chunk-23AD24QZ.js";import{b as C,d as p}from"./chunk-6I55VYFG.js";function L(e,n,t,r={}){if(!t)return[];let i=m(e,n);return i?i.indexOf(t)===-1?[]:(x(e,n).get(t)??[]).filter(s=>!Y(s,r)):[]}function Y(e,n){return typeof n.excludeStartLine=="number"&&typeof n.excludeEndLine=="number"&&e>=n.excludeStartLine&&e<=n.excludeEndLine}var W=g("file-identifiers",{clearGroups:["whole-project","source-file"]});function $(e,n){let t=h(e,n);return t?t.fileIdentifiers:W.get(e,n,()=>new Set(x(e,n).keys()))}var V=g("file-ident-lines",{clearGroups:["whole-project","source-file"]});function x(e,n){let t=h(e,n);return t?t.identifierLineMap:V.get(e,n,()=>q(e,n))}var X=g("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function he(e,n){let t=h(e,n);return t?t.identifiersByLine:X.get(e,n,()=>{let r=x(e,n),i=0;for(let s of r.values()){let a=s[s.length-1];a!==void 0&&a>i&&(i=a)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,a]of r)for(let c of a)o[c].add(s);return o})}function q(e,n){let t=new Map,r=(a,c)=>{let l=t.get(a);if(!l){t.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)},i=m(e,n);if(!i)return t;let o=P(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let a=0;a<o.length;a+=1){let c=o[a]??"";for(let l of c.matchAll(s))l[1]&&r(l[1],a)}return t}function Ne(e,n){let t=z(e);return t?n.filter(r=>z(r.file)===t):n}function Me(e,n,t,r,i){let o=t.find(s=>s.file===n);if(o)return o;if(r){let s=i?.match(/^[A-Za-z_$][\w$]*/u)?.[0];if(!s)return null;let a=I(e,n),c=new Set(a.filter(f=>f.localName===s||f.importedName===s).map(f=>f.sourcePath).filter(f=>!!f));for(let f of t)for(let E of c)if(p(E,f.file))return f;let l=K(m(e,n)??"",s);if(l.size===0)return null;let u=new Set(a.filter(f=>l.has(f.localName??f.importedName)).map(f=>f.sourcePath).filter(f=>!!f)),d=t.filter(f=>l.has(A(f.symbol)??"")&&[...u].some(E=>p(E,f.file)));return d.length===1?d[0]:null}return t.length===1?t[0]:null}function K(e,n){let t=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new Set,i=[new RegExp(`\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*)`,"gu"),new RegExp(`\\b${t}\\s*=\\s*(?:new\\s+)?([A-Za-z_$][\\w$]*)\\s*\\(`,"gu")];for(let o of i)for(let s of e.matchAll(o))r.add(s[1]);return r.size===1?r:new Set}function z(e){let n=k(e);return n?n==="typescript"||n==="tsx"||n==="javascript"?"javascript-family":n:null}var Q=w("global-leaf-index",{clearGroups:["whole-project"]});function v(e){return Q.get(e,()=>{let n=e.all(`SELECT gs.id, gs.symbol,
|
|
2
2
|
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
3
3
|
FROM global_symbols gs
|
|
4
4
|
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
@@ -13,4 +13,4 @@ import{d as O}from"./chunk-ELNRLMC5.js";import{d as S}from"./chunk-SGMNWYTH.js";
|
|
|
13
13
|
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
14
14
|
WHERE 1 = 1
|
|
15
15
|
${e.symbolNoiseFor("gs")}`),t=new Map;for(let r of n){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=b(r.symbol);if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.some(s=>s.symbolId===r.id)||o.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return t})}var ee=g("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function j(e,n){let t=C(n);return ee.get(e,t,()=>te(e,t))}function te(e,n){let t=new Map;for(let r of I(e,n)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&B(t,i,r.sourcePath),r.kind==="namespace")for(let o of r.usedMembers)B(t,o,r.sourcePath)}return t}function B(e,n,t){let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var G=/[A-Za-z_$][A-Za-z0-9_$]*/g,Z=/^[A-Za-z_$][A-Za-z0-9_$]*$/,ne=512;function N(e){let n=[],t=!1;for(let r of e)r&&(t=!0,Z.test(r)||n.push(r));return{candidateNames:e,hasUsableCandidate:t,nonIdentifierNames:n}}function H(e,n){let t=re(n)?n:N(n);if(t.candidateNames.size===0||!t.hasUsableCandidate)return!0;if(t.candidateNames.size<=ne){for(let i of t.candidateNames)if(i){if(Z.test(i)){if(ie(i).test(e))return!0;continue}if(e.includes(i))return!0}return!1}G.lastIndex=0;let r;for(;(r=G.exec(e))!==null;)if(t.candidateNames.has(r[0]))return!0;for(let i of t.nonIdentifierNames)if(e.includes(i))return!0;return!1}function re(e){return"candidateNames"in e}function ie(e){return new RegExp(`(?<![A-Za-z_$0-9])${D(e)}(?![A-Za-z_$0-9])`)}function M(e,n,t){let r=v(e).get(t);if(!r||r.length===0)return[];if(r.length===1)return[y(r[0])];let i=r.filter(c=>c.file===n);if(i.length>0)return i.map(y);let o=j(e,n),s=o.get(t);if(s)for(let c of s){let l=r.filter(u=>p(c,u.file));if(l.length>0)return l.map(y)}let a=new Set;for(let c of o.values())for(let l of c)a.add(l);for(let c of a){let l=r.filter(u=>p(c,u.file));if(l.length>0&&l.length===r.length)return l.map(y)}return[]}function Je(e,n,t){let r=M(e,n,t);if(r.length>0)return r;let i=v(e).get(t);return!i||i.length===0?[]:i.map(y)}function U(e,n,t={}){let r=oe(e,n);if(!r)return[];let i=S(e,n);if(t.semantic!==!1&&t.semanticEvidence){let s=t.semanticEvidence.references(e,{...i,leaf:r.identifier,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let a=new Map;for(let c of s){let l=a.get(c.file)??[];l.push(c.line),a.set(c.file,l)}return R(e,a)}}let o=new Map;for(let s of _(e)){let a=se(e,r,s);a.length>0&&o.set(s,a)}return R(e,o)}function oe(e,n){let t=S(e,n);if(!t)return null;let r=b(t.symbol);return r?{symbolId:t.symbolId,relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,identifier:r}:null}function se(e,n,t){let r=m(e,t);return!r||r.indexOf(n.identifier)===-1?[]:t!==n.relativePath&&!M(e,t,n.identifier).some(o=>o.symbolId===n.symbolId)?[]:L(e,t,n.identifier,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{})}function Ye(e,n,t={}){let r=new Map;for(let c of n){if(!c.leaf)continue;let l=r.get(c.leaf)??[];l.push(c),r.set(c.leaf,l)}if(r.size===0)return new Map;let i=new Set(n.map(c=>c.symbolId)),o=new Set(r.keys()),s=N(o),a=new Map;for(let c of _(e)){if(t.skipPath?.(c)||!H(m(e,c),s))continue;let l=$(e,c);if(l.size!==0){for(let u of l)if(r.has(u))for(let d of M(e,c,u)){if(!i.has(d.symbolId)||c===d.relativePath)continue;let f=a.get(d.symbolId);f||(f=new Set,a.set(d.symbolId,f)),f.add(c)}}}return a}function y(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function R(e,n){let t=[],r=new Set;for(let[i,o]of n){let s=F(e,i);for(let a of o){let c=T(s,a),l=`${i}|${a}|${c?.symbol??""}`;r.has(l)||(r.add(l),t.push({file:i,line:a,enclosingSymbol:c?.symbol??null}))}}return t}function ae(e,n){return ce(e,[n]).get(n.symbolId)??[]}function ce(e,n){let t=n.map(o=>({symbolId:o.symbolId,prelude:pe(e,o)})).filter(o=>o.prelude!==null),r=ue(e,t.map(o=>o.symbolId)),i=new Map;for(let{symbolId:o,prelude:s}of t){let a=fe(e,r.get(o)??new Map,s.match,s.identifier);i.set(o,R(e,a))}return i}function et(e,n,t={}){return le(e,n,t).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function le(e,n,t={}){let r=U(e,n,{semantic:t.semantic,semanticEvidence:t.semanticEvidence}),i=r.length>0?J(r,"source-attribution"):J(ae(e,n),"scip-reference-chunk");return t.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function J(e,n){return e.map(t=>({...t,provenance:n}))}function fe(e,n,t,r){let i=new Map;for(let[o,s]of n)i.set(o,me(e,o,s,t,r));return i}function ue(e,n){let t=new Map;for(let r of O(e,n)){if(e.isIgnored(r.relative_path))continue;let i=t.get(r.symbol_id);i||(i=new Map,t.set(r.symbol_id,i));let o=i.get(r.relative_path);o||(o=[],i.set(r.relative_path,o)),o.push({start_line:r.chunk_start,end_line:r.chunk_end})}return t}function me(e,n,t,r,i){let o=n===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?L(e,n,i,o):[];return t.flatMap(a=>de(s,a))}function de(e,n){let t=e.filter(r=>r>=n.start_line&&r<=n.end_line);return t.length>0?t:[n.start_line]}function pe(e,n){let t=S(e,n);return t?{match:t,identifier:b(t.symbol)||null}:null}export{L as a,x as b,he as c,Ne as d,Me as e,v as f,N as g,H as h,j as i,M as j,Je as k,Ye as l,ae as m,ce as n,et as o,le as p};
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-NB2DAVPP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as U}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as U}from"./chunk-GWESWURK.js";import{c as T}from"./chunk-UHFZDQZJ.js";import{a as R}from"./chunk-DOQLO74K.js";import{d as x}from"./chunk-TNLOX4TN.js";import{a as v}from"./chunk-NRNVMB2R.js";import{b}from"./chunk-6I55VYFG.js";import{posix as p}from"path";var G=20,O=1,q=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),K=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Ae(e,n={}){let t=D(n.limit,G),i=D(n.minConsumers,O),r=new T(e),s=r.fileDependencyGraph(n.scope),o=fe(v(e,{includeIgnored:!1})),a=ye(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?J(e,r,n.target):Q(e,n.scope,n.scanLimit)).map(l=>V(e,r,s,l,n,o,a)).filter(l=>l.consumerFiles.length>=i||n.target).sort(ge).slice(0,t)}function J(e,n,t){let i=ee(e,t);if(i)return[P(i)];let r=R(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ne(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:x(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function Q(e,n,t){let i=v(e,{scope:n,includeIgnored:!1}),r=D(t,i.length);return i.slice(0,r).map(s=>P(s))}function V(e,n,t,i,r,s,o){let a=i.definition?X(e,n,i.definition,r.semantic):null,c=a?.files??Z(t,i.unit.file),u=i.definition?a.coverage==="complete"?c.length>0?"exact":"none":a.coverage:c.length>0?"file-level":"none",l=u==="incomplete"||u==="unavailable"||u==="incomplete-and-unavailable",y=i.unit.file,g=d(p.dirname(y)),f=ie(c),j=te(g),z=C([...F(g),...f?F(f):[]]),S=l?"repository-level-review":re(i.unit,g,f,c),h=l?{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:`Compiler-resolved consumer evidence is ${u}; no relocation destination is safe to score.`}:oe(S,i.unit,g,f,c,s,o),A=ue(i.unit,u,f,c,g,h.whyNoSuggestedHome),_=de(i.unit,g,f,c,h.suggestedHome,h.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:y,currentDirectory:g,directoryAncestry:j,consumerFiles:c,consumerCoverage:u,nearestCommonOwner:f,boundaryMarkers:z,recommendedTier:S,suggestedHome:h.suggestedHome,destinationConfidence:h.confidence,whyNoSuggestedHome:h.whyNoSuggestedHome,counterevidence:l?[...A,"Known consumer files are retained, but missing compiler evidence can hide additional owners."]:A,reasons:_,recommendation:l?"Retain the current location until compiler-resolved consumer evidence is complete.":me(S,h.suggestedHome,u)}}function X(e,n,t,i){let r=U(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}).get(t.symbolId),s=r?.semanticIncomplete?r.semanticUnavailable?"incomplete-and-unavailable":"incomplete":r?.semanticUnavailable?"unavailable":"complete";return{files:W(r?.files.map(o=>o.file)??[]),coverage:s}}function Z(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return W(t)}function ee(e,n){let t=b(n),i=v(e,{includeIgnored:!1}),r=i.find(o=>o===t);if(r)return r;let s=i.find(o=>o.endsWith(`/${t}`));return s||(i.find(o=>o.includes(t))??null)}function ne(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:x(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function P(e){return{unit:{kind:"file",file:e,shortName:p.basename(e)}}}function te(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:k(r)})}return n}function F(e){return e==="."?[]:H(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function k(e){return C(H(e).map(({marker:n})=>n))}function H(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=q.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function ie(e){if(e.length===0)return null;let n=e.map(i=>d(p.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),s=[],o=Math.min(t.length,r.length);for(let a=0;a<o&&t[a]===r[a];a+=1)s.push(t[a]);t=s}return t.length===0?".":t.join("/")}function re(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":I(t,"package")?"package-level-shared":I(t,"app")?"app-level-shared":$(t,["feature","domain","module"])||$(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function oe(e,n,t,i,r,s,o){let a=se(e,i);if(a)return m(a);let c=he(n.file),u=ae(e,t,c,r,o);if(u)return u;let l=i;if(d(t)===d(l))return m(`${t} is already the nearest common owner for its consumers.`);let y=ce(l,t,c,o);return y||le(l,t,c,s,o)}function se(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function ae(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?L(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=d(p.dirname(i[0])),o=B(n,t,s,r);return o?m(o):L(s)}return null}function ce(e,n,t,i){return ve(e)?M(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function le(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=M(s,n,t,r,`Proposed home ${s} is outside source root ${t}.`);return o.confidence==="withheld"||i.has(s)?o:m(`${s} does not exist in the indexed project.`)}function M(e,n,t,i,r){if(!E(e,t))return m(r);let s=B(n,t,e,i);return s?m(s):L(e)}function L(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ue(e,n,t,i,r,s){let o=["Report-only signal; review ownership before moving files."];return n==="none"&&o.push("No consumers were found in the current index."),n==="file-level"&&o.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&o.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&o.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&o.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&o.push("Candidate already lives under the nearest common owner."),s&&o.push(`No exact suggested home: ${s}`),o}function de(e,n,t,i,r,s){let o=[];return o.push(`${e.shortName} currently lives in ${n}.`),t?o.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):o.push("No consumer owner could be inferred from the current index."),r?o.push(`Suggested home is ${r}.`):s&&o.push(`No exact suggested home: ${s}`),o}function me(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function ge(e,n){return N(n)-N(e)||e.candidatePath.localeCompare(n.candidatePath)}function N(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-exact-consumers"&&(n*=.05),n}function fe(e){let n=new Set(["."]);for(let t of e){let i=d(p.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=d(p.dirname(i))}return n}function he(e){let n=w(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function E(e,n){let t=d(e),i=d(n);return i==="."||t===i||t.startsWith(`${i}/`)}function pe(e,n,t){let i=w(e),r=w(n);return(E(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function B(e,n,t,i){return d(e)===d(t)||!pe(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function ye(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=be(i);r&&n.add(r)}return n}function be(e){let n=e.trim().toLowerCase();return n===""?null:n}function I(e,n){return k(e).includes(n)}function $(e,n){let t=k(e);return n.some(i=>t.includes(i))}function ve(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?K.has(t):!1}function d(e){let n=b(e);return n===""?".":n}function w(e){let n=b(e);return n==="."?[]:n.split("/").filter(Boolean)}function D(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function W(e){return C([...e]).sort((n,t)=>n.localeCompare(t))}function C(e){return[...new Set(e)]}export{Ae as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NJDXNYLG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as r}from"./chunk-6I55VYFG.js";function _(t){let s=r(t);return i(s)?"test":u(s)?"worker":n(s)?"entry":f(s)?"barrel":"source"}function i(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function u(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function n(t){let s=t.split("/"),e=s[s.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:s.length<=2:!1}function f(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}export{_ as a};
|
|
2
|
+
//# sourceMappingURL=chunk-NMKQOIYZ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as L,h as X,i as F,j as _e,k as Fe,l as Le,r as Pe,s as y,t as Ee,v as Ae,w as g,x as we}from"./chunk-
|
|
1
|
+
import{g as L,h as X,i as F,j as _e,k as Fe,l as Le,r as Pe,s as y,t as Ee,v as Ae,w as g,x as we}from"./chunk-23AD24QZ.js";import{H,c as v}from"./chunk-6I55VYFG.js";import{basename as Re}from"path";var It=L("indexed-document-paths",{clearGroups:["whole-project"]});function O(e,t={}){let n=Vt(t);return[...It.get(e,n,()=>{let o=t.scope?"AND relative_path LIKE ?":"",s=t.like?"AND relative_path LIKE ?":"",i=[...t.scope?[`%${t.scope}%`]:[],...t.like?[t.like]:[]],a=e.all(`SELECT relative_path
|
|
2
2
|
FROM documents
|
|
3
3
|
WHERE 1 = 1
|
|
4
4
|
${e.pathExclusionsFor("documents")}
|
|
@@ -18,4 +18,4 @@ import{g as L,h as X,i as F,j as _e,k as Fe,l as Le,r as Pe,s as y,t as Ee,v as
|
|
|
18
18
|
`)))}var Eo=new Set(["in","key","of"]),Ao=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),wo=F("vue-component-behavior-profiles");function At(e,t={}){let n=W(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>Te(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function Te(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=wo.get(e,n,r,()=>Ro(e,n,r));return Vo(o)}function Ro(e,t,n){let r=R(e,t),o=oe(e,t),s=re(r),i=$o(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,C,$)=>$.indexOf(m)===C).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,C,$)=>$.indexOf(m)===C).sort(),l=n?n.split(`
|
|
19
19
|
`).length:0,p=E(r.template),u=s.lineCount,N=r.styles.reduce((m,C)=>m+E(C),0),B=r.customBlocks.reduce((m,C)=>m+E(C),0),{lines:ie,paths:ae}=Io(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:Bo(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:p,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:B,delegatedComposableLines:ie,delegatedComposablePaths:ae}}function Io(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=Pt(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
|
|
20
20
|
`).length:0)},0),paths:o}}function Vo(e){let t=jo(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function jo(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function Bo(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(Ao.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function $o(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Oo(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of wt(n.value))t.add(r);return[...t].sort()}function Oo(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?wt(t[1]??""):[]}function wt(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];Eo.has(r)||t.push(r)}return t}function bi(e){return{capability:(t,n)=>Do(t,n),reactProfiles:(t={})=>et(e,t),reactProfilesForFile:t=>me(e,t),vueProfiles:(t={})=>At(e,t),vueProfileForFile:t=>Te(e,t),vueTemplateFacts:t=>oe(e,t),vueScriptFacts:t=>re(R(e,t))}}function Do(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{O as a,Mo as b,dt as c,Vr as d,q as e,ht as f,St as g,yt as h,xt as i,vt as j,Nt as k,Ct as l,bt as m,se as n,ai as o,oo as p,Pt as q,xo as r,vo as s,No as t,Co as u,bo as v,ko as w,To as x,ci as y,D as z,ce as A,pe as B,ze as C,as as D,Y as E,Q as F,it as G,ut as H,ds as I,Je as J,W as K,gs as L,bi as M};
|
|
21
|
-
//# sourceMappingURL=chunk-
|
|
21
|
+
//# sourceMappingURL=chunk-NRNVMB2R.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as z}from"./chunk-P5XHIJHI.js";import{e as be,m as ge,u as he}from"./chunk-EQNMD62X.js";import{c as we,h as Ae}from"./chunk-2PRONPAS.js";import{a as Ie,e as De,i as Me}from"./chunk-DRENNWRG.js";import{a as S,c as fe,d as M,e as p,f as X,h as Re,j,t as x,u as k,v as Ee,x as q,y as K,z as ke}from"./chunk-D7DOB27N.js";import{a as C,i as G,k as v}from"./chunk-R2NOK63J.js";import{a as A,c as me,d as ye,e as F}from"./chunk-6O3KXIDL.js";import{a as pe,b as E,g as w,ga as Se,m as J}from"./chunk-UQYQBLJX.js";import{createHash as cn}from"crypto";import{resolve as dn}from"path";var b=3;function V(e){return cn("sha256").update(x({kind:"codebaseiq-durable-rust-mailbox",protocolVersion:b,sessionDir:dn(e)})).digest("hex")}function pn(e,n){if(!S(e)||typeof e.id!="string"||!e.id)return T("Durable Rust semantic helper received an invalid mailbox request.");if(e.id!==n.claimRequestId)return T("Durable Rust semantic request identity does not match its mailbox path.");if(e.protocolVersion===void 0){if(e.mailboxVersion!==void 0||e.operationKey!==void 0||e.clientId!==void 0||e.enqueuedAtMs!==void 0||e.deadlineAtMs!==void 0||e.sessionIdentity!==void 0)return T("Durable Rust semantic helper received a partially versioned request without a protocol version.");let s=xe(e.request);if(!s)return T("Durable Rust semantic helper received an invalid legacy request kind or payload.");let i=n.nowMs+Math.max(1,s.timeoutMs);return{ok:!0,compatibility:"legacy-v2",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:q("rust-semantic-v2",{id:e.id,request:s}),clientId:"legacy-v2",enqueuedAtMs:n.nowMs,deadlineAtMs:i,sessionIdentity:n.sessionIdentity,request:s}}}let t=fn(e,n);if(!t.ok)return t;if(e.protocolVersion!==b)return{ok:!1,code:"unsupported-protocol",error:`Durable Rust semantic helper does not support mailbox protocol ${String(e.protocolVersion)}.`,responseIdentity:t.responseIdentity};let r=xe(e.request);return r?t.operationKey!==q("rust-semantic-v3",r)?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a mismatched mailbox operation identity.",responseIdentity:t.responseIdentity}:t.deadlineAtMs-t.enqueuedAtMs!==r.timeoutMs?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a deadline that does not match the request timeout.",responseIdentity:t.responseIdentity}:t.deadlineAtMs<n.nowMs?{ok:!1,code:"expired-request",error:"Durable Rust semantic request expired before processing.",responseIdentity:t.responseIdentity}:{ok:!0,compatibility:t.priorSessionIdentity?"prior-v3":"current-v3",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:t.operationKey,clientId:t.clientId,enqueuedAtMs:t.enqueuedAtMs,deadlineAtMs:t.deadlineAtMs,sessionIdentity:n.sessionIdentity,request:r}}:{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received an invalid request kind or payload.",responseIdentity:t.responseIdentity}}function te(e,n){return S(e)?e.protocolVersion!==b?Ce(e.protocolVersion===void 0?"helper wrote a prior uncorrelated response protocol":`helper wrote unsupported response protocol ${String(e.protocolVersion)}`):e.mailboxVersion!==k||e.id!==n.requestId||e.operationKey!==n.operationKey||e.sessionIdentity!==n.sessionIdentity||e.deadlineAtMs!==n.deadlineAtMs?Ce("helper wrote an incompatible response identity"):typeof e.completedAtMs!="number"||!Number.isFinite(e.completedAtMs)||e.completedAtMs>n.deadlineAtMs||n.nowMs>n.deadlineAtMs?{ok:!1,code:"expired-request",error:"helper response arrived after the durable request deadline"}:e.ok===!1?typeof e.error!="string"||!In(e.errorCode)?ee("helper wrote an invalid rejection response"):{ok:!1,code:e.errorCode,error:e.error}:e.ok!==!0||e.session!=="created"&&e.session!=="reused"&&e.session!=="invalidated"||!Sn(e.response,n.requestKind)?ee("helper wrote an invalid success response"):{ok:!0,session:e.session,response:e.response}:ee("helper wrote an invalid response object")}function fn(e,n){if(e.mailboxVersion!==k||typeof e.protocolVersion!="number"||!Number.isInteger(e.protocolVersion)||typeof e.operationKey!="string"||!ve(e.operationKey)||e.id!==K(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs||e.sessionIdentity!==void 0&&(typeof e.sessionIdentity!="string"||!ve(e.sessionIdentity))||e.sessionIdentity===void 0&&e.protocolVersion!==b)return T("Durable Rust semantic helper received an invalid mailbox lifecycle.");let t={id:n.claimRequestId,sessionIdentity:n.sessionIdentity,deadlineAtMs:e.deadlineAtMs};return e.sessionIdentity!==void 0&&e.sessionIdentity!==n.sessionIdentity?{ok:!1,code:"malformed-request",error:"Durable Rust semantic request belongs to a different mailbox session.",responseIdentity:t}:{ok:!0,responseIdentity:t,operationKey:e.operationKey,clientId:e.clientId,enqueuedAtMs:e.enqueuedAtMs,deadlineAtMs:e.deadlineAtMs,priorSessionIdentity:e.sessionIdentity===void 0}}function xe(e){return!S(e)||typeof e.identityKey!="string"||!e.identityKey||!X(e.timeoutMs)||e.workerEnvironment!==void 0&&!fe(e.workerEnvironment)?null:e.kind==="semantic"&&Rn(e.request)?{kind:"semantic",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:e.kind==="import-definitions"&&mn(e.request)?{kind:"import-definitions",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:null}function Rn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!Te(e.definitions)?!1:Z(e.referenceDefinitions)&&Z(e.calleeDefinitions)&&Z(e.signatureDefinitions)&&I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.referenceRetryTimeoutMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)&&ne(e.includeReferences)&&ne(e.includeCallees)&&ne(e.includeSignatures)}function mn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!M(e.file)||!Array.isArray(e.positions)||!e.positions.every(n=>S(n)&&M(n.id)&&M(n.file)&&p(n.line)&&p(n.column))?!1:I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)}function Te(e){return Array.isArray(e)&&e.every(yn)}function Z(e){return e===void 0||Te(e)}function yn(e){return S(e)&&p(e.symbolId)&&p(e.documentId)&&p(e.startLine)&&qe(e.startChar)&&p(e.endLine)&&qe(e.endChar)&&typeof e.symbol=="string"&&typeof e.relativePath=="string"&&typeof e.leaf=="string"&&(e.parentTypeName===null||typeof e.parentTypeName=="string")&&typeof e.isFunctionLike=="boolean"&&typeof e.isTypeLike=="boolean"&&(e.kind===null||Number.isSafeInteger(e.kind))&&(e.documentation===null||typeof e.documentation=="string")&&(e.enclosingSymbol===null||typeof e.enclosingSymbol=="string")}function Sn(e,n){return!S(e)||typeof e.available!="boolean"||e.available===!1&&(typeof e.reason!="string"||e.reason.length===0)||e.available===!0&&e.reason!==void 0?!1:n==="import-definitions"?Array.isArray(e.sourcePaths)&&e.sourcePaths.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&(t[1]===null||typeof t[1]=="string")):_e(e.references,bn)&&(e.incompleteReferenceSymbolIds===void 0||Array.isArray(e.incompleteReferenceSymbolIds)&&e.incompleteReferenceSymbolIds.every(t=>Number.isSafeInteger(t)))&&(e.callees===void 0||_e(e.callees,gn))&&(e.signatures===void 0||Array.isArray(e.signatures)&&e.signatures.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&(t[1]===null||typeof t[1]=="string")))}function _e(e,n){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&Array.isArray(t[1])&&t[1].every(n))}function bn(e){return S(e)&&typeof e.file=="string"&&p(e.line)&&p(e.column)}function gn(e){return S(e)&&typeof e.symbol=="string"&&typeof e.file=="string"&&p(e.line)&&(e.callsiteLine===void 0||p(e.callsiteLine))}function In(e){return e==="unsupported-protocol"||e==="malformed-request"||e==="expired-request"||e==="handler-error"}function T(e){return{ok:!1,code:"malformed-request",error:e}}function ee(e){return{ok:!1,code:"malformed-response",error:e}}function Ce(e){return{ok:!1,code:"incompatible-response",error:e}}function ve(e){return/^[a-f0-9]{64}$/.test(e)}function Pe(e){return e===void 0||X(e)}function qe(e){return e===void 0||p(e)}function I(e){return e===void 0||Re(e)}function ne(e){return e===void 0||typeof e=="boolean"}import{spawn as xn}from"child_process";import{createHash as _n,randomUUID as Cn}from"crypto";import{existsSync as $e,realpathSync as vn,rmSync as qn}from"fs";import{tmpdir as Tn}from"os";import{resolve as _}from"path";import{execFileSync as hn}from"child_process";var Be=new WeakMap,Dn="SCIP_RUST_SCIP_OCCURRENCE_REFERENCE_MODE";function yt(e,n){let t=new Map,r=H(),s=n.filter(u=>Oe(u,r));if(s.length===0)return t;let i=Ne(e,s.map(u=>u.symbol));for(let u of s){let l=i.get(u.symbol);l&&t.set(u.symbolId,l)}return t}function St(e,n){return Oe(n,H())?Ne(e,[n.symbol]).get(n.symbol)??null:null}function Oe(e,n="safe"){if(!e.symbol.startsWith("rust-analyzer ")||!e.relativePath.endsWith(".rs")||Me(e.symbol)||/impl#\[[^\]]+\]\[Default\]default\(\)\.$/.test(e.symbol))return!1;if(n==="all")return!0;let t=De(e.symbol);if(t==="method")return!0;if(t!=="term")return!1;let r=Ie(e.symbol);return"kind"in r?!1:!Mn(r)}function Mn(e){for(let n=0;n<e.descriptors.length-1;n+=1)if(e.descriptors[n]?.suffix==="type")return!0;return!1}function Ne(e,n){let t=Be.get(e);t||(t=new Map,Be.set(e,t));let r=[...new Set(n)].filter(s=>!t.has(s));if(r.length>0){let s=he(e,r);for(let i of r){let u=s?.get(i);t.set(i,u?Ae(u.filter(({relativePath:l})=>!e.isIgnored(l)).map(({relativePath:l,occurrence:d})=>({file:l,line:d.range[0],column:d.range[1]}))):null)}}return new Map(n.map(s=>[s,t.get(s)??null]))}function H(){return process.env[Dn]==="all"?"all":"safe"}function Ue(e){let n=ge(be,e),t=n.runnable;return t?{available:!0,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,note:"rust-analyzer semantic reference queries are enabled."}:{available:!1,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,reason:"rust-analyzer is not runnable; Rust semantic checks will use SCIP/source evidence only."}}var We=new Map;function re(e){let t=Ue(e).resolvedBinary??null;return{engine:"rust-analyzer",resolvedBinary:t,version:t?En(e,t):"unavailable"}}function Et(e){return{...re(e),scipOccurrenceReferenceMode:H()}}function En(e,n){let t=`${e}\0${n}`,r=We.get(t);if(r)return r;let s;try{s=hn(n,["--version"],{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:2e3}).trim()}catch{s="unknown"}return We.set(t,s),s}import{createHash as kn}from"crypto";var wn=new Set(["Cargo.lock","Cargo.toml","rust-project.json","rust-toolchain","rust-toolchain.toml"]);function Le(e){let n=Se(e,{includePath:An});return kn("sha256").update(JSON.stringify(n)).digest("hex")}function An(e){let n=e.replaceAll("\\","/"),t=n.split("/").at(-1)??n;return n.endsWith(".rs")||wn.has(t)?!0:n===".cargo/config"||n===".cargo/config.toml"||n.endsWith("/.cargo/config")||n.endsWith("/.cargo/config.toml")}var Pn=5e3,Ye=10,Bn=3e4;function Fe(e,n,t,r=Ze){let s=r.engineIdentity(e),i={protocolVersion:b,projectRoot:r.canonicalProjectRoot(e),projectFingerprint:r.projectFingerprint(e),engine:{engine:s.engine,resolvedBinary:s.resolvedBinary,version:s.version},workerFingerprint:r.fileFingerprint(n),environment:Qe(r.environment())};return{key:ie(x(i)),...i}}var je=class{constructor(n,t=Un){this.createRequester=n;this.applyEnvironment=t}createRequester;applyEnvironment;requester=null;identityKey=null;semanticResponseCache=null;handle(n){this.applyEnvironment(n.workerEnvironment??{});let t;if(this.requester?this.identityKey!==n.identityKey?(this.semanticResponseCache=null,this.requester.shutdown(),this.requester=this.createRequester(),this.identityKey=n.identityKey,t="invalidated"):t="reused":(this.requester=this.createRequester(),this.identityKey=n.identityKey,t="created"),n.kind==="semantic"){let r=On(n.request),s=t==="reused"&&r!==null&&this.semanticResponseCache?.identityKey===n.identityKey&&this.semanticResponseCache.requestKey===r?this.semanticResponseCache.response:null;if(s)return Ke(!0,n.request.definitions.length),{session:t,response:s};let i=this.requester.requestSemantic(n.request,n.timeoutMs);return r!==null&&Nn(i)&&(this.semanticResponseCache={identityKey:n.identityKey,requestKey:r,response:i}),Ke(!1,n.request.definitions.length),{session:t,response:i}}return{session:t,response:this.requester.requestImportDefinitions(n.request,n.timeoutMs)}}shutdown(){this.requester?.shutdown(),this.requester=null,this.identityKey=null,this.semanticResponseCache=null}};function On(e){if(e.includeReferences===!1||e.includeCallees!==!0||e.includeSignatures===!0||(e.referenceDefinitions?.length??0)===0||(e.calleeDefinitions?.length??0)===0)return null;let{readinessDeadlineMs:n,...t}=e;return ie(x(t))}function Nn(e){return e.available&&Array.isArray(e.callees)&&(e.incompleteReferenceSymbolIds?.length??0)===0}function Ke(e,n){C()&&v({type:"span",name:"rust.semantic.durable-session.response-cache",durationMs:0,ok:!0,hit:e,definitions:n})}function P(e,n,t,r){if(e.protocolVersion!==b||!t(e.pid))return!1;if(!e.processIdentity)return!0;let s=r?.(e.pid);return s!=null&&ye(e.processIdentity,s)}function se(e,n,t){let r;try{r=J(n,{maxBytes:E,inputKind:"Rust semantic engine artifact"})}catch{r="missing"}let s=ie(x({projectRoot:_(e),serverPath:_(n),serverFingerprint:r})).slice(0,20);return _(t,`codebaseiq-rust-session-${s}`)}function ze(e){let n=e===void 0?Number.NaN:Number(e);return Number.isInteger(n)&&n>=0?n:0}function Qe(e){return Object.fromEntries(Object.entries(e).filter(([n])=>Xe(n)).sort(([n],[t])=>n.localeCompare(t)).map(([n,t])=>[n,t??null]))}function Je(e,n){let t=n.runtime??Kn,r=n.identityRuntime??Ze,s=se(e,n.serverPath,n.tempRoot??Tn()),i=!1,u=(l,d)=>{if(i)throw new Error("Durable Rust semantic session was already disposed.");return Ln(s,n.serverPath,n.semanticWorkerPath,l,d,t,n.mailboxLimits)};return{requestSemantic(l,d){let R=Fe(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"semantic",identityKey:R.key,workerEnvironment:He(),request:{...o,referenceRetryTimeoutMs:Wn(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,l.referenceRetryTimeoutMs),settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},requestImportDefinitions(l,d){let R=Fe(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"import-definitions",identityKey:R.key,workerEnvironment:He(),request:{...o,settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},shutdown(){i=!0}}}function Un(e){for(let n of Object.keys(process.env))Ge(n)&&delete process.env[n];for(let[n,t]of Object.entries(e))t!==null&&(process.env[n]=t)}function Wn(e,n){return n!==void 0?n:e===void 0?Bn:void 0}function Ln(e,n,t,r,s,i,u={}){let l=i.now(),d=l+s,R=(i.monotonicNow??A)(),c=R+s,o=q("rust-semantic-v3",r),a=K(o),f=Ee(e),m=V(e),y=ke(f,{mailboxVersion:k,protocolVersion:b,id:a,operationKey:o,clientId:i.randomId(),enqueuedAtMs:l,deadlineAtMs:d,sessionIdentity:m,request:r},{nowMs:l,limits:u});for(Ve(e,n,t,c,i);(i.monotonicNow??A)()<=c;){if($e(y.responsePath)){let D=Fn(w(y.responsePath,{maxBytes:u.maxItemBytes??E,inputKind:"durable Rust semantic mailbox response"}),{requestId:a,operationKey:o,sessionIdentity:m,deadlineAtMs:y.authoritativeDeadlineAtMs,requestKind:r.kind,nowMs:i.now()});if(!D.ok)throw new Error(D.error);return C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:(i.monotonicNow??A)()-R,ok:!0,session:D.session,kind:r.kind}),D.response}let h=B(e);(!h||!P(h,i.now(),i.isProcessAlive,i.readProcessIdentity))&&Ve(e,n,t,c,i),i.sleep(Ye)}throw new Error(`Durable Rust semantic session timed out after ${(s/1e3).toFixed(0)}s.`)}function Ve(e,n,t,r,s){let i=B(e);if(i&&P(i,s.now(),s.isProcessAlive,s.readProcessIdentity))return;qn(_(e,"server.json"),{force:!0}),s.spawnServer(n,e,t);let u=s.monotonicNow??A,l=Math.min(r,u()+Pn);for(;u()<=l;){let d=B(e);if(d&&P(d,s.now(),s.isProcessAlive,s.readProcessIdentity))return;s.sleep(Ye)}throw new Error("Durable Rust semantic session helper did not become ready within 5s.")}function B(e){try{let n=JSON.parse(w(_(e,"server.json"),{maxBytes:pe,inputKind:"durable Rust session state"}));if(typeof n.protocolVersion!="number"||n.sessionIdentity!==void 0&&(typeof n.sessionIdentity!="string"||n.sessionIdentity!==V(e))||typeof n.pid!="number"||typeof n.heartbeatAtMs!="number"||n.busyUntilMs!==void 0&&typeof n.busyUntilMs!="number"||n.mailbox!==void 0&&!jn(n.mailbox))return null;let t=n.processIdentity===void 0?null:me(n.processIdentity);return n.processIdentity!==void 0&&(!t||t.pid!==n.pid)?null:{protocolVersion:n.protocolVersion,...n.sessionIdentity===void 0?{}:{sessionIdentity:n.sessionIdentity},pid:n.pid,...t?{processIdentity:t}:{},heartbeatAtMs:n.heartbeatAtMs,...n.busyUntilMs===void 0?{}:{busyUntilMs:n.busyUntilMs},...n.mailbox===void 0?{}:{mailbox:n.mailbox}}}catch{return null}}function Fn(e,n){try{return te(JSON.parse(e),n)}catch(t){return{ok:!1,code:"malformed-response",error:`helper wrote malformed JSON: ${t instanceof Error?t.message:String(t)}`}}}function jn(e){if(!e||typeof e!="object")return!1;let n=e;return p(n.pending)&&p(n.inflight)&&p(n.responses)&&p(n.deadLetters)&&p(n.invalid)&&p(n.totalItems)&&typeof n.totalBytes=="number"&&Number.isFinite(n.totalBytes)&&n.totalBytes>=0&&(n.oldestPendingAt===void 0||Number.isFinite(Date.parse(n.oldestPendingAt)))}function He(){return Object.fromEntries(Object.entries(process.env).filter(([e])=>Ge(e)).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,n??null]))}function Xe(e){return e==="HOME"||e==="PATH"||e.startsWith("CARGO_")||e.startsWith("RA_")||e.startsWith("RUST")}function Ge(e){return Xe(e)||e.startsWith("SCIP_RUST_")||e==="CODEBASEIQ_PROFILE"||e==="CODEBASEIQ_PROFILE_CACHE_STATE"||e==="CODEBASEIQ_PROFILE_COMMAND"||e==="CODEBASEIQ_PROFILE_OUT"||e==="CODEBASEIQ_PROFILE_RUN_ID"||e==="CODEBASEIQ_PROFILE_WORKLOAD_IDENTITY"||e==="CODEBASEIQ_PROFILE_WORKLOAD_IDENTITY_KIND"||e==="CODEBASEIQ_PROFILE_MIN_MS"}var Ze={canonicalProjectRoot(e){try{return vn(e)}catch{return _(e)}},projectFingerprint(e){return Le(e)},engineIdentity:re,fileFingerprint(e){return J(e,{maxBytes:E,inputKind:"Rust semantic engine artifact"})},environment(){return Qe(process.env)}},Kn={now:Date.now,monotonicNow:A,randomId:Cn,isProcessAlive:j,readProcessIdentity:F,spawnServer(e,n,t){if(!$e(e))throw new Error(`Durable Rust semantic session helper was not found at ${e}. Run npm run build first.`);xn(process.execPath,[e,n,t],{detached:!0,stdio:"ignore",windowsHide:!0}).unref()},sleep(e){let n=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(n,0,0,e)}};function ie(e){return _n("sha256").update(e).digest("hex")}import{existsSync as zn,mkdtempSync as en,rmSync as ae}from"fs";import{tmpdir as ce}from"os";import{join as ue}from"path";import{fileURLToPath as L,pathToFileURL as Vn}from"url";import{SHARE_ENV as Hn,Worker as $n}from"worker_threads";function $(e,n,t=new Set){let r=new Map;for(let s of e)t.has(s.symbolId)||r.set(s.symbolId,n.get(s.symbolId)??[]);return r}function oe(e,n,t){let r=z(process.env.SCIP_RUST_SEMANTIC_BATCH_TIMEOUT_MS)??0;if(r>0)return r;let s=Math.max(1,Math.ceil(e/Math.max(1,t)));return Math.max(12e4,3e4+s*n)}var nn=15e3,tn=8,sn=5e3,Yn=64,Qn=96,de=class{constructor(n,t,r={}){this.projectRoot=n;this.status=t;this.opts=r;this.requester=r.requester??Zn(n,process.env.SCIP_RUST_SEMANTIC_DURABLE_SESSION)}projectRoot;status;opts;requester;referencesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:N(t),references:U(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!0});return{...O(r),resolvedBinary:t.resolvedBinary,references:$(n,new Map(r.references),new Set(r.incompleteReferenceSymbolIds??[]))}}catch(r){return this.opts.fallbackReferenceResolver?.referencesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),references:U(n)}}}calleesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:N(t),callees:W(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!0});return{...O(r),resolvedBinary:t.resolvedBinary,callees:le(n,new Map(r.callees??[]))}}catch(r){return this.opts.fallbackCalleeResolver?.calleesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),callees:W(n)}}}referencesAndCalleesForDefinitions(n,t){let r=this.status(this.projectRoot);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:N(r),references:U(n),callees:W(t)};let s=[...n,...t];try{let i=this.requestSession(r.resolvedBinary,s,{includeReferences:n.length>0,includeCallees:t.length>0,referenceDefinitions:n,calleeDefinitions:t});return{...O(i),resolvedBinary:r.resolvedBinary,references:$(n,new Map(i.references),new Set(i.incompleteReferenceSymbolIds??[])),callees:le(t,new Map(i.callees??[]))}}catch(i){return this.fallbackReferencesAndCallees(r,n,t,i)}}signaturesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:N(t),signatures:rn(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!1,includeSignatures:!0});return{...O(r),resolvedBinary:t.resolvedBinary,signatures:st(n,new Map(r.signatures??[]))}}catch(r){return this.opts.fallbackSignatureResolver?.signaturesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),signatures:rn(n)}}}importDefinitionsForFile(n,t){let r=this.status(this.projectRoot);if(t.length===0)return r.available?{available:!0,resolvedBinary:r.resolvedBinary,sourcePaths:new Map}:{available:!1,reason:r.reason,resolvedBinary:r.resolvedBinary,sourcePaths:new Map};if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:N(r),sourcePaths:new Map(t.map(s=>[s.id,null]))};try{let s=this.requestImportDefinitions(r.resolvedBinary,n,t);return{...O(s),resolvedBinary:r.resolvedBinary,sourcePaths:new Map(s.sourcePaths)}}catch(s){return{available:!1,resolvedBinary:r.resolvedBinary,reason:s instanceof Error?s.message:String(s),sourcePaths:new Map(t.map(i=>[i.id,null]))}}}dispose(){this.requester.shutdown()}requestSession(n,t,r){let s=Y(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,nn),i=Q(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),u=Y(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,tn),l=Q(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),d=r.referenceDefinitions?[...r.referenceDefinitions]:void 0,R=r.calleeDefinitions?[...r.calleeDefinitions]:void 0,c=r.signatureDefinitions?[...r.signatureDefinitions]:void 0,o=Jn(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,...r}),a={projectRoot:this.projectRoot,rustAnalyzerBinary:n,definitions:[...t],...d?{referenceDefinitions:d}:{},...R?{calleeDefinitions:R}:{},...c?{signatureDefinitions:c}:{},requestTimeoutMs:s,...r.includeReferences!==!1&&i>0?{referenceRetryTimeoutMs:i}:{},diagnosticsTimeoutMs:l,settleDelayMs:o,concurrency:u,includeReferences:r.includeReferences,includeCallees:r.includeCallees,includeSignatures:r.includeSignatures},f=it(a);return G("rust.semantic.session.request",()=>this.requester.requestSemantic(a,oe(f,ot(s,a.referenceRetryTimeoutMs),u)),()=>({definitions:t.length,operationDefinitions:f,referenceDefinitions:a.referenceDefinitions?.length,calleeDefinitions:a.calleeDefinitions?.length,signatureDefinitions:a.signatureDefinitions?.length,references:a.includeReferences!==!1,callees:a.includeCallees===!0,signatures:a.includeSignatures===!0,referenceRetryTimeoutMs:a.referenceRetryTimeoutMs}))}fallbackReferencesAndCallees(n,t,r,s){let i=t.length===0?{available:!0,resolvedBinary:n.resolvedBinary,references:U(t)}:this.opts.fallbackReferenceResolver?.referencesForDefinitions(t),u=r.length===0?{available:!0,resolvedBinary:n.resolvedBinary,callees:W(r)}:this.opts.fallbackCalleeResolver?.calleesForDefinitions(r);if(i&&u){let l={resolvedBinary:i.resolvedBinary??u.resolvedBinary??n.resolvedBinary,references:$(t,i.references),callees:le(r,u.callees)};return i.available&&u.available?{available:!0,...l}:{available:!1,reason:(i.available?void 0:i.reason)??(u.available?void 0:u.reason)??"Rust semantic fallback was unavailable.",...l}}return{available:!1,resolvedBinary:n.resolvedBinary,reason:s instanceof Error?s.message:String(s),references:U(t),callees:W(r)}}requestImportDefinitions(n,t,r){let s=Y(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,nn),i=Y(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,tn),u=Q(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),l=Q(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,sn),d={projectRoot:this.projectRoot,rustAnalyzerBinary:n,file:t,positions:[...r],requestTimeoutMs:s,diagnosticsTimeoutMs:u,settleDelayMs:l,concurrency:i};return G("rust.semantic.import-definitions.session.request",()=>this.requester.requestImportDefinitions(d,oe(r.length,s,i)),()=>({file:t,positions:r.length}))}};function O(e){return e.available?{available:!0}:{available:!1,reason:e.reason}}function N(e){return e.available?"rust-analyzer binary path is unavailable.":e.reason}function ur(e,n,t={}){return new de(e,n,t)}function Jn(e,n){let t=ln(e);if(t!==null)return t;let r=n.includeReferences!==!1;return r&&n.includeCallees!==!0&&n.includeSignatures!==!0&&n.definitionCount<=Yn||r&&n.includeCallees===!0&&n.includeSignatures!==!0&&n.definitionCount<=Qn?0:sn}function on(e){let n=e?.trim().toLowerCase(),t=n==="0"||n==="false"||n==="off"||n==="worker",r=n==="1"||n==="true"||n==="on"||n==="durable",s=n===void 0||n==="";return{transport:t||!s&&!r?"worker":"durable",source:s?"default":"environment",fallback:"worker",valid:s||t||r,optOut:"SCIP_RUST_SEMANTIC_DURABLE_SESSION=0"}}function Xn(e){return on(e).transport}function lr(e,n){let t=on(n);if(t.transport==="worker")return{...t,state:"per-command"};let r=L(un()),s=se(e,r,ce()),i=B(s);return i?{...t,state:P(i,Date.now(),j,F)?"live":"stale",pid:i.pid,heartbeatAtMs:i.heartbeatAtMs,...i.busyUntilMs===void 0?{}:{busyUntilMs:i.busyUntilMs}}:{...t,state:"stopped"}}function Gn(e,n){let t=null,r=!1,s=!1,i=!1,u=()=>t??=n(),l=()=>{s||(e.shutdown(),s=!0)},d=(c,o,a)=>{let f=rt(c);r=!0;try{l()}catch{}C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:a,ok:!1,kind:o,session:"worker-fallback",reason:f})},R=(c,o,a)=>{if(i)throw new Error("Rust semantic failover session was already disposed.");if(r)return a(u());let f=performance.now();try{return o(e)}catch(m){d(m,c,performance.now()-f)}return a(u())};return{requestSemantic(c,o){return R("semantic",a=>a.requestSemantic(c,o),a=>a.requestSemantic(c,o))},requestImportDefinitions(c,o){return R("import-definitions",a=>a.requestImportDefinitions(c,o),a=>a.requestImportDefinitions(c,o))},shutdown(){if(i)return;i=!0;let c=[];try{l()}catch(o){c.push(o)}try{t?.shutdown()}catch(o){c.push(o)}if(c.length>0)throw c[0]}}}function Zn(e,n,t={worker:()=>et(),durable:()=>Je(e,{serverPath:L(un()),semanticWorkerPath:L(an())})}){return Xn(n)==="durable"?Gn(t.durable(),t.worker):t.worker()}function et(e={}){let n=null,t=null,r=1,s=!1,i=null,u=null,l=o=>{o&&ae(o,{recursive:!0,force:!0})},d=()=>{if(i)return;let o=n,a=t;n=null,t=null;let f=o?o.terminate():Promise.resolve(0);i=Promise.allSettled([f,we(a,{gracefulMs:1e3,forceMs:1e3})]).then(([m,y])=>{let D=(y.status==="fulfilled"?y.value:[{reaped:!1,detail:String(y.reason)}]).filter(g=>!g.reaped);if(m.status==="rejected"||D.length>0){u=new Error(`Rust semantic worker cleanup did not complete; ownership evidence remains at ${a??"unknown"}.`);return}l(a)}).finally(()=>{i=null})},R=()=>{if(n)return n;if(i)throw new Error("The previous Rust semantic session worker is still terminating; retry the request.");if(u)throw u;let o=e.semanticWorkerPath?Vn(e.semanticWorkerPath):an();if(!zn(L(o)))throw new Error(`Rust semantic session worker was not found at ${L(o)}. Run npm run build before using built semantic Rust queries.`);return t=en(ue(ce(),"codebaseiq-rust-session-")),n=new $n(o,e.shareEnvironment?{env:Hn}:void 0),n.unref(),n},c=()=>{let o=t??en(ue(ce(),"codebaseiq-rust-session-"));return t=o,ue(o,`${r++}.json`)};return{requestSemantic(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"semantic",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=nt(w(m,{maxBytes:E,inputKind:"Rust semantic worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{ae(m,{force:!0})}},requestImportDefinitions(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"import-definitions",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic import-definition session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=tt(w(m,{maxBytes:E,inputKind:"Rust import-definition worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{ae(m,{force:!0})}},shutdown(){if(s)return;if(s=!0,!n){l(t),t=null;return}let o=c(),a=new SharedArrayBuffer(4),f=new Int32Array(a);n.postMessage({kind:"shutdown",responsePath:o,sharedBuffer:a}),Atomics.wait(f,0,0,5e3),d()}}}function nt(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function tt(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function rt(e){let n=e instanceof Error?`${e.name} ${e.message}`.toLowerCase():String(e).toLowerCase();return n.includes("readiness")?"readiness":n.includes("timeout")||n.includes("timed out")?"timeout":n.includes("helper")?"helper":"request"}function U(e){return new Map(e.map(n=>[n.symbolId,[]]))}function W(e){return new Map(e.map(n=>[n.symbolId,[]]))}function rn(e){return new Map(e.map(n=>[n.symbolId,null]))}function le(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??[]]))}function st(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??null]))}function it(e){let n=0;return e.includeReferences!==!1&&(n+=(e.referenceDefinitions??e.definitions).length),e.includeCallees===!0&&(n+=(e.calleeDefinitions??e.definitions).length),e.includeSignatures===!0&&(n+=(e.signatureDefinitions??e.definitions).length),Math.max(1,n)}function ot(e,n){return n&&n>0?Math.max(e,n):e}function an(){return new URL("./rust-semantic-session-worker.js",import.meta.url)}function un(){return new URL("./rust-semantic-session-server.js",import.meta.url)}function Y(e,n){return z(e)??n}function Q(e,n){return ln(e)??n}function ln(e){if(!e)return null;let n=Number(e);return Number.isInteger(n)&&n>=0?n:null}export{yt as a,St as b,Ue as c,Et as d,b as e,V as f,pn as g,je as h,$ as i,oe as j,ur as k,Jn as l,lr as m,et as n,ot as o};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as z}from"./chunk-P5XHIJHI.js";import{e as be,m as ge,u as he}from"./chunk-37K55EG3.js";import{c as we,h as Ae}from"./chunk-JGJKRTTB.js";import{a as Ie,e as De,i as Me}from"./chunk-DRENNWRG.js";import{a as S,c as fe,d as M,e as p,f as X,h as Re,j,t as x,u as k,v as Ee,x as q,y as K,z as ke}from"./chunk-3F23W57G.js";import{a as C,i as G,k as v}from"./chunk-R2NOK63J.js";import{a as A,c as me,d as ye,e as F}from"./chunk-OZI44VCR.js";import{a as pe,b as E,g as w,ka as Se,m as J}from"./chunk-C3PPB2T5.js";import{createHash as cn}from"crypto";import{resolve as dn}from"path";var b=3;function V(e){return cn("sha256").update(x({kind:"codebaseiq-durable-rust-mailbox",protocolVersion:b,sessionDir:dn(e)})).digest("hex")}function pn(e,n){if(!S(e)||typeof e.id!="string"||!e.id)return T("Durable Rust semantic helper received an invalid mailbox request.");if(e.id!==n.claimRequestId)return T("Durable Rust semantic request identity does not match its mailbox path.");if(e.protocolVersion===void 0){if(e.mailboxVersion!==void 0||e.operationKey!==void 0||e.clientId!==void 0||e.enqueuedAtMs!==void 0||e.deadlineAtMs!==void 0||e.sessionIdentity!==void 0)return T("Durable Rust semantic helper received a partially versioned request without a protocol version.");let s=xe(e.request);if(!s)return T("Durable Rust semantic helper received an invalid legacy request kind or payload.");let i=n.nowMs+Math.max(1,s.timeoutMs);return{ok:!0,compatibility:"legacy-v2",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:q("rust-semantic-v2",{id:e.id,request:s}),clientId:"legacy-v2",enqueuedAtMs:n.nowMs,deadlineAtMs:i,sessionIdentity:n.sessionIdentity,request:s}}}let t=fn(e,n);if(!t.ok)return t;if(e.protocolVersion!==b)return{ok:!1,code:"unsupported-protocol",error:`Durable Rust semantic helper does not support mailbox protocol ${String(e.protocolVersion)}.`,responseIdentity:t.responseIdentity};let r=xe(e.request);return r?t.operationKey!==q("rust-semantic-v3",r)?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a mismatched mailbox operation identity.",responseIdentity:t.responseIdentity}:t.deadlineAtMs-t.enqueuedAtMs!==r.timeoutMs?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a deadline that does not match the request timeout.",responseIdentity:t.responseIdentity}:t.deadlineAtMs<n.nowMs?{ok:!1,code:"expired-request",error:"Durable Rust semantic request expired before processing.",responseIdentity:t.responseIdentity}:{ok:!0,compatibility:t.priorSessionIdentity?"prior-v3":"current-v3",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:t.operationKey,clientId:t.clientId,enqueuedAtMs:t.enqueuedAtMs,deadlineAtMs:t.deadlineAtMs,sessionIdentity:n.sessionIdentity,request:r}}:{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received an invalid request kind or payload.",responseIdentity:t.responseIdentity}}function te(e,n){return S(e)?e.protocolVersion!==b?Ce(e.protocolVersion===void 0?"helper wrote a prior uncorrelated response protocol":`helper wrote unsupported response protocol ${String(e.protocolVersion)}`):e.mailboxVersion!==k||e.id!==n.requestId||e.operationKey!==n.operationKey||e.sessionIdentity!==n.sessionIdentity||e.deadlineAtMs!==n.deadlineAtMs?Ce("helper wrote an incompatible response identity"):typeof e.completedAtMs!="number"||!Number.isFinite(e.completedAtMs)||e.completedAtMs>n.deadlineAtMs||n.nowMs>n.deadlineAtMs?{ok:!1,code:"expired-request",error:"helper response arrived after the durable request deadline"}:e.ok===!1?typeof e.error!="string"||!In(e.errorCode)?ee("helper wrote an invalid rejection response"):{ok:!1,code:e.errorCode,error:e.error}:e.ok!==!0||e.session!=="created"&&e.session!=="reused"&&e.session!=="invalidated"||!Sn(e.response,n.requestKind)?ee("helper wrote an invalid success response"):{ok:!0,session:e.session,response:e.response}:ee("helper wrote an invalid response object")}function fn(e,n){if(e.mailboxVersion!==k||typeof e.protocolVersion!="number"||!Number.isInteger(e.protocolVersion)||typeof e.operationKey!="string"||!ve(e.operationKey)||e.id!==K(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs||e.sessionIdentity!==void 0&&(typeof e.sessionIdentity!="string"||!ve(e.sessionIdentity))||e.sessionIdentity===void 0&&e.protocolVersion!==b)return T("Durable Rust semantic helper received an invalid mailbox lifecycle.");let t={id:n.claimRequestId,sessionIdentity:n.sessionIdentity,deadlineAtMs:e.deadlineAtMs};return e.sessionIdentity!==void 0&&e.sessionIdentity!==n.sessionIdentity?{ok:!1,code:"malformed-request",error:"Durable Rust semantic request belongs to a different mailbox session.",responseIdentity:t}:{ok:!0,responseIdentity:t,operationKey:e.operationKey,clientId:e.clientId,enqueuedAtMs:e.enqueuedAtMs,deadlineAtMs:e.deadlineAtMs,priorSessionIdentity:e.sessionIdentity===void 0}}function xe(e){return!S(e)||typeof e.identityKey!="string"||!e.identityKey||!X(e.timeoutMs)||e.workerEnvironment!==void 0&&!fe(e.workerEnvironment)?null:e.kind==="semantic"&&Rn(e.request)?{kind:"semantic",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:e.kind==="import-definitions"&&mn(e.request)?{kind:"import-definitions",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:null}function Rn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!Te(e.definitions)?!1:Z(e.referenceDefinitions)&&Z(e.calleeDefinitions)&&Z(e.signatureDefinitions)&&I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.referenceRetryTimeoutMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)&&ne(e.includeReferences)&&ne(e.includeCallees)&&ne(e.includeSignatures)}function mn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!M(e.file)||!Array.isArray(e.positions)||!e.positions.every(n=>S(n)&&M(n.id)&&M(n.file)&&p(n.line)&&p(n.column))?!1:I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)}function Te(e){return Array.isArray(e)&&e.every(yn)}function Z(e){return e===void 0||Te(e)}function yn(e){return S(e)&&p(e.symbolId)&&p(e.documentId)&&p(e.startLine)&&qe(e.startChar)&&p(e.endLine)&&qe(e.endChar)&&typeof e.symbol=="string"&&typeof e.relativePath=="string"&&typeof e.leaf=="string"&&(e.parentTypeName===null||typeof e.parentTypeName=="string")&&typeof e.isFunctionLike=="boolean"&&typeof e.isTypeLike=="boolean"&&(e.kind===null||Number.isSafeInteger(e.kind))&&(e.documentation===null||typeof e.documentation=="string")&&(e.enclosingSymbol===null||typeof e.enclosingSymbol=="string")}function Sn(e,n){return!S(e)||typeof e.available!="boolean"||e.available===!1&&(typeof e.reason!="string"||e.reason.length===0)||e.available===!0&&e.reason!==void 0?!1:n==="import-definitions"?Array.isArray(e.sourcePaths)&&e.sourcePaths.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&(t[1]===null||typeof t[1]=="string")):_e(e.references,bn)&&(e.incompleteReferenceSymbolIds===void 0||Array.isArray(e.incompleteReferenceSymbolIds)&&e.incompleteReferenceSymbolIds.every(t=>Number.isSafeInteger(t)))&&(e.callees===void 0||_e(e.callees,gn))&&(e.signatures===void 0||Array.isArray(e.signatures)&&e.signatures.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&(t[1]===null||typeof t[1]=="string")))}function _e(e,n){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&Array.isArray(t[1])&&t[1].every(n))}function bn(e){return S(e)&&typeof e.file=="string"&&p(e.line)&&p(e.column)}function gn(e){return S(e)&&typeof e.symbol=="string"&&typeof e.file=="string"&&p(e.line)&&(e.callsiteLine===void 0||p(e.callsiteLine))}function In(e){return e==="unsupported-protocol"||e==="malformed-request"||e==="expired-request"||e==="handler-error"}function T(e){return{ok:!1,code:"malformed-request",error:e}}function ee(e){return{ok:!1,code:"malformed-response",error:e}}function Ce(e){return{ok:!1,code:"incompatible-response",error:e}}function ve(e){return/^[a-f0-9]{64}$/.test(e)}function Pe(e){return e===void 0||X(e)}function qe(e){return e===void 0||p(e)}function I(e){return e===void 0||Re(e)}function ne(e){return e===void 0||typeof e=="boolean"}import{spawn as xn}from"child_process";import{createHash as _n,randomUUID as Cn}from"crypto";import{existsSync as $e,realpathSync as vn,rmSync as qn}from"fs";import{tmpdir as Tn}from"os";import{resolve as _}from"path";import{execFileSync as hn}from"child_process";var Be=new WeakMap,Dn="SCIP_RUST_SCIP_OCCURRENCE_REFERENCE_MODE";function yt(e,n){let t=new Map,r=H(),s=n.filter(u=>Oe(u,r));if(s.length===0)return t;let i=Ne(e,s.map(u=>u.symbol));for(let u of s){let l=i.get(u.symbol);l&&t.set(u.symbolId,l)}return t}function St(e,n){return Oe(n,H())?Ne(e,[n.symbol]).get(n.symbol)??null:null}function Oe(e,n="safe"){if(!e.symbol.startsWith("rust-analyzer ")||!e.relativePath.endsWith(".rs")||Me(e.symbol)||/impl#\[[^\]]+\]\[Default\]default\(\)\.$/.test(e.symbol))return!1;if(n==="all")return!0;let t=De(e.symbol);if(t==="method")return!0;if(t!=="term")return!1;let r=Ie(e.symbol);return"kind"in r?!1:!Mn(r)}function Mn(e){for(let n=0;n<e.descriptors.length-1;n+=1)if(e.descriptors[n]?.suffix==="type")return!0;return!1}function Ne(e,n){let t=Be.get(e);t||(t=new Map,Be.set(e,t));let r=[...new Set(n)].filter(s=>!t.has(s));if(r.length>0){let s=he(e,r);for(let i of r){let u=s?.get(i);t.set(i,u?Ae(u.filter(({relativePath:l})=>!e.isIgnored(l)).map(({relativePath:l,occurrence:d})=>({file:l,line:d.range[0],column:d.range[1]}))):null)}}return new Map(n.map(s=>[s,t.get(s)??null]))}function H(){return process.env[Dn]==="all"?"all":"safe"}function Ue(e){let n=ge(be,e),t=n.runnable;return t?{available:!0,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,note:"rust-analyzer semantic reference queries are enabled."}:{available:!1,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,reason:"rust-analyzer is not runnable; Rust semantic checks will use SCIP/source evidence only."}}var We=new Map;function re(e){let t=Ue(e).resolvedBinary??null;return{engine:"rust-analyzer",resolvedBinary:t,version:t?En(e,t):"unavailable"}}function Et(e){return{...re(e),scipOccurrenceReferenceMode:H()}}function En(e,n){let t=`${e}\0${n}`,r=We.get(t);if(r)return r;let s;try{s=hn(n,["--version"],{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:2e3}).trim()}catch{s="unknown"}return We.set(t,s),s}import{createHash as kn}from"crypto";var wn=new Set(["Cargo.lock","Cargo.toml","rust-project.json","rust-toolchain","rust-toolchain.toml"]);function Le(e){let n=Se(e,{includePath:An});return kn("sha256").update(JSON.stringify(n)).digest("hex")}function An(e){let n=e.replaceAll("\\","/"),t=n.split("/").at(-1)??n;return n.endsWith(".rs")||wn.has(t)?!0:n===".cargo/config"||n===".cargo/config.toml"||n.endsWith("/.cargo/config")||n.endsWith("/.cargo/config.toml")}var Pn=5e3,Ye=10,Bn=3e4;function Fe(e,n,t,r=Ze){let s=r.engineIdentity(e),i={protocolVersion:b,projectRoot:r.canonicalProjectRoot(e),projectFingerprint:r.projectFingerprint(e),engine:{engine:s.engine,resolvedBinary:s.resolvedBinary,version:s.version},workerFingerprint:r.fileFingerprint(n),environment:Qe(r.environment())};return{key:ie(x(i)),...i}}var je=class{constructor(n,t=Un){this.createRequester=n;this.applyEnvironment=t}createRequester;applyEnvironment;requester=null;identityKey=null;semanticResponseCache=null;handle(n){this.applyEnvironment(n.workerEnvironment??{});let t;if(this.requester?this.identityKey!==n.identityKey?(this.semanticResponseCache=null,this.requester.shutdown(),this.requester=this.createRequester(),this.identityKey=n.identityKey,t="invalidated"):t="reused":(this.requester=this.createRequester(),this.identityKey=n.identityKey,t="created"),n.kind==="semantic"){let r=On(n.request),s=t==="reused"&&r!==null&&this.semanticResponseCache?.identityKey===n.identityKey&&this.semanticResponseCache.requestKey===r?this.semanticResponseCache.response:null;if(s)return Ke(!0,n.request.definitions.length),{session:t,response:s};let i=this.requester.requestSemantic(n.request,n.timeoutMs);return r!==null&&Nn(i)&&(this.semanticResponseCache={identityKey:n.identityKey,requestKey:r,response:i}),Ke(!1,n.request.definitions.length),{session:t,response:i}}return{session:t,response:this.requester.requestImportDefinitions(n.request,n.timeoutMs)}}shutdown(){this.requester?.shutdown(),this.requester=null,this.identityKey=null,this.semanticResponseCache=null}};function On(e){if(e.includeReferences===!1||e.includeCallees!==!0||e.includeSignatures===!0||(e.referenceDefinitions?.length??0)===0||(e.calleeDefinitions?.length??0)===0)return null;let{readinessDeadlineMs:n,...t}=e;return ie(x(t))}function Nn(e){return e.available&&Array.isArray(e.callees)&&(e.incompleteReferenceSymbolIds?.length??0)===0}function Ke(e,n){C()&&v({type:"span",name:"rust.semantic.durable-session.response-cache",durationMs:0,ok:!0,hit:e,definitions:n})}function P(e,n,t,r){if(e.protocolVersion!==b||!t(e.pid))return!1;if(!e.processIdentity)return!0;let s=r?.(e.pid);return s!=null&&ye(e.processIdentity,s)}function se(e,n,t){let r;try{r=J(n,{maxBytes:E,inputKind:"Rust semantic engine artifact"})}catch{r="missing"}let s=ie(x({projectRoot:_(e),serverPath:_(n),serverFingerprint:r})).slice(0,20);return _(t,`codebaseiq-rust-session-${s}`)}function ze(e){let n=e===void 0?Number.NaN:Number(e);return Number.isInteger(n)&&n>=0?n:0}function Qe(e){return Object.fromEntries(Object.entries(e).filter(([n])=>Xe(n)).sort(([n],[t])=>n.localeCompare(t)).map(([n,t])=>[n,t??null]))}function Je(e,n){let t=n.runtime??Kn,r=n.identityRuntime??Ze,s=se(e,n.serverPath,n.tempRoot??Tn()),i=!1,u=(l,d)=>{if(i)throw new Error("Durable Rust semantic session was already disposed.");return Ln(s,n.serverPath,n.semanticWorkerPath,l,d,t,n.mailboxLimits)};return{requestSemantic(l,d){let R=Fe(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"semantic",identityKey:R.key,workerEnvironment:He(),request:{...o,referenceRetryTimeoutMs:Wn(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,l.referenceRetryTimeoutMs),settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},requestImportDefinitions(l,d){let R=Fe(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"import-definitions",identityKey:R.key,workerEnvironment:He(),request:{...o,settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},shutdown(){i=!0}}}function Un(e){for(let n of Object.keys(process.env))Ge(n)&&delete process.env[n];for(let[n,t]of Object.entries(e))t!==null&&(process.env[n]=t)}function Wn(e,n){return n!==void 0?n:e===void 0?Bn:void 0}function Ln(e,n,t,r,s,i,u={}){let l=i.now(),d=l+s,R=(i.monotonicNow??A)(),c=R+s,o=q("rust-semantic-v3",r),a=K(o),f=Ee(e),m=V(e),y=ke(f,{mailboxVersion:k,protocolVersion:b,id:a,operationKey:o,clientId:i.randomId(),enqueuedAtMs:l,deadlineAtMs:d,sessionIdentity:m,request:r},{nowMs:l,limits:u});for(Ve(e,n,t,c,i);(i.monotonicNow??A)()<=c;){if($e(y.responsePath)){let D=Fn(w(y.responsePath,{maxBytes:u.maxItemBytes??E,inputKind:"durable Rust semantic mailbox response"}),{requestId:a,operationKey:o,sessionIdentity:m,deadlineAtMs:y.authoritativeDeadlineAtMs,requestKind:r.kind,nowMs:i.now()});if(!D.ok)throw new Error(D.error);return C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:(i.monotonicNow??A)()-R,ok:!0,session:D.session,kind:r.kind}),D.response}let h=B(e);(!h||!P(h,i.now(),i.isProcessAlive,i.readProcessIdentity))&&Ve(e,n,t,c,i),i.sleep(Ye)}throw new Error(`Durable Rust semantic session timed out after ${(s/1e3).toFixed(0)}s.`)}function Ve(e,n,t,r,s){let i=B(e);if(i&&P(i,s.now(),s.isProcessAlive,s.readProcessIdentity))return;qn(_(e,"server.json"),{force:!0}),s.spawnServer(n,e,t);let u=s.monotonicNow??A,l=Math.min(r,u()+Pn);for(;u()<=l;){let d=B(e);if(d&&P(d,s.now(),s.isProcessAlive,s.readProcessIdentity))return;s.sleep(Ye)}throw new Error("Durable Rust semantic session helper did not become ready within 5s.")}function B(e){try{let n=JSON.parse(w(_(e,"server.json"),{maxBytes:pe,inputKind:"durable Rust session state"}));if(typeof n.protocolVersion!="number"||n.sessionIdentity!==void 0&&(typeof n.sessionIdentity!="string"||n.sessionIdentity!==V(e))||typeof n.pid!="number"||typeof n.heartbeatAtMs!="number"||n.busyUntilMs!==void 0&&typeof n.busyUntilMs!="number"||n.mailbox!==void 0&&!jn(n.mailbox))return null;let t=n.processIdentity===void 0?null:me(n.processIdentity);return n.processIdentity!==void 0&&(!t||t.pid!==n.pid)?null:{protocolVersion:n.protocolVersion,...n.sessionIdentity===void 0?{}:{sessionIdentity:n.sessionIdentity},pid:n.pid,...t?{processIdentity:t}:{},heartbeatAtMs:n.heartbeatAtMs,...n.busyUntilMs===void 0?{}:{busyUntilMs:n.busyUntilMs},...n.mailbox===void 0?{}:{mailbox:n.mailbox}}}catch{return null}}function Fn(e,n){try{return te(JSON.parse(e),n)}catch(t){return{ok:!1,code:"malformed-response",error:`helper wrote malformed JSON: ${t instanceof Error?t.message:String(t)}`}}}function jn(e){if(!e||typeof e!="object")return!1;let n=e;return p(n.pending)&&p(n.inflight)&&p(n.responses)&&p(n.deadLetters)&&p(n.invalid)&&p(n.totalItems)&&typeof n.totalBytes=="number"&&Number.isFinite(n.totalBytes)&&n.totalBytes>=0&&(n.oldestPendingAt===void 0||Number.isFinite(Date.parse(n.oldestPendingAt)))}function He(){return Object.fromEntries(Object.entries(process.env).filter(([e])=>Ge(e)).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,n??null]))}function Xe(e){return e==="HOME"||e==="PATH"||e.startsWith("CARGO_")||e.startsWith("RA_")||e.startsWith("RUST")}function Ge(e){return Xe(e)||e.startsWith("SCIP_RUST_")||e==="CODEBASEIQ_PROFILE"||e==="CODEBASEIQ_PROFILE_CACHE_STATE"||e==="CODEBASEIQ_PROFILE_COMMAND"||e==="CODEBASEIQ_PROFILE_OUT"||e==="CODEBASEIQ_PROFILE_RUN_ID"||e==="CODEBASEIQ_PROFILE_WORKLOAD_IDENTITY"||e==="CODEBASEIQ_PROFILE_WORKLOAD_IDENTITY_KIND"||e==="CODEBASEIQ_PROFILE_MIN_MS"}var Ze={canonicalProjectRoot(e){try{return vn(e)}catch{return _(e)}},projectFingerprint(e){return Le(e)},engineIdentity:re,fileFingerprint(e){return J(e,{maxBytes:E,inputKind:"Rust semantic engine artifact"})},environment(){return Qe(process.env)}},Kn={now:Date.now,monotonicNow:A,randomId:Cn,isProcessAlive:j,readProcessIdentity:F,spawnServer(e,n,t){if(!$e(e))throw new Error(`Durable Rust semantic session helper was not found at ${e}. Run npm run build first.`);xn(process.execPath,[e,n,t],{detached:!0,stdio:"ignore",windowsHide:!0}).unref()},sleep(e){let n=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(n,0,0,e)}};function ie(e){return _n("sha256").update(e).digest("hex")}import{existsSync as zn,mkdtempSync as en,rmSync as ae}from"fs";import{tmpdir as ce}from"os";import{join as ue}from"path";import{fileURLToPath as L,pathToFileURL as Vn}from"url";import{SHARE_ENV as Hn,Worker as $n}from"worker_threads";function $(e,n,t=new Set){let r=new Map;for(let s of e)t.has(s.symbolId)||r.set(s.symbolId,n.get(s.symbolId)??[]);return r}function oe(e,n,t){let r=z(process.env.SCIP_RUST_SEMANTIC_BATCH_TIMEOUT_MS)??0;if(r>0)return r;let s=Math.max(1,Math.ceil(e/Math.max(1,t)));return Math.max(12e4,3e4+s*n)}var nn=15e3,tn=8,sn=5e3,Yn=64,Qn=96,de=class{constructor(n,t,r={}){this.projectRoot=n;this.status=t;this.opts=r;this.requester=r.requester??Zn(n,process.env.SCIP_RUST_SEMANTIC_DURABLE_SESSION)}projectRoot;status;opts;requester;referencesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:N(t),references:U(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!0});return{...O(r),resolvedBinary:t.resolvedBinary,references:$(n,new Map(r.references),new Set(r.incompleteReferenceSymbolIds??[]))}}catch(r){return this.opts.fallbackReferenceResolver?.referencesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),references:U(n)}}}calleesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:N(t),callees:W(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!0});return{...O(r),resolvedBinary:t.resolvedBinary,callees:le(n,new Map(r.callees??[]))}}catch(r){return this.opts.fallbackCalleeResolver?.calleesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),callees:W(n)}}}referencesAndCalleesForDefinitions(n,t){let r=this.status(this.projectRoot);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:N(r),references:U(n),callees:W(t)};let s=[...n,...t];try{let i=this.requestSession(r.resolvedBinary,s,{includeReferences:n.length>0,includeCallees:t.length>0,referenceDefinitions:n,calleeDefinitions:t});return{...O(i),resolvedBinary:r.resolvedBinary,references:$(n,new Map(i.references),new Set(i.incompleteReferenceSymbolIds??[])),callees:le(t,new Map(i.callees??[]))}}catch(i){return this.fallbackReferencesAndCallees(r,n,t,i)}}signaturesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:N(t),signatures:rn(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!1,includeSignatures:!0});return{...O(r),resolvedBinary:t.resolvedBinary,signatures:st(n,new Map(r.signatures??[]))}}catch(r){return this.opts.fallbackSignatureResolver?.signaturesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),signatures:rn(n)}}}importDefinitionsForFile(n,t){let r=this.status(this.projectRoot);if(t.length===0)return r.available?{available:!0,resolvedBinary:r.resolvedBinary,sourcePaths:new Map}:{available:!1,reason:r.reason,resolvedBinary:r.resolvedBinary,sourcePaths:new Map};if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:N(r),sourcePaths:new Map(t.map(s=>[s.id,null]))};try{let s=this.requestImportDefinitions(r.resolvedBinary,n,t);return{...O(s),resolvedBinary:r.resolvedBinary,sourcePaths:new Map(s.sourcePaths)}}catch(s){return{available:!1,resolvedBinary:r.resolvedBinary,reason:s instanceof Error?s.message:String(s),sourcePaths:new Map(t.map(i=>[i.id,null]))}}}dispose(){this.requester.shutdown()}requestSession(n,t,r){let s=Y(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,nn),i=Q(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),u=Y(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,tn),l=Q(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),d=r.referenceDefinitions?[...r.referenceDefinitions]:void 0,R=r.calleeDefinitions?[...r.calleeDefinitions]:void 0,c=r.signatureDefinitions?[...r.signatureDefinitions]:void 0,o=Jn(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,...r}),a={projectRoot:this.projectRoot,rustAnalyzerBinary:n,definitions:[...t],...d?{referenceDefinitions:d}:{},...R?{calleeDefinitions:R}:{},...c?{signatureDefinitions:c}:{},requestTimeoutMs:s,...r.includeReferences!==!1&&i>0?{referenceRetryTimeoutMs:i}:{},diagnosticsTimeoutMs:l,settleDelayMs:o,concurrency:u,includeReferences:r.includeReferences,includeCallees:r.includeCallees,includeSignatures:r.includeSignatures},f=it(a);return G("rust.semantic.session.request",()=>this.requester.requestSemantic(a,oe(f,ot(s,a.referenceRetryTimeoutMs),u)),()=>({definitions:t.length,operationDefinitions:f,referenceDefinitions:a.referenceDefinitions?.length,calleeDefinitions:a.calleeDefinitions?.length,signatureDefinitions:a.signatureDefinitions?.length,references:a.includeReferences!==!1,callees:a.includeCallees===!0,signatures:a.includeSignatures===!0,referenceRetryTimeoutMs:a.referenceRetryTimeoutMs}))}fallbackReferencesAndCallees(n,t,r,s){let i=t.length===0?{available:!0,resolvedBinary:n.resolvedBinary,references:U(t)}:this.opts.fallbackReferenceResolver?.referencesForDefinitions(t),u=r.length===0?{available:!0,resolvedBinary:n.resolvedBinary,callees:W(r)}:this.opts.fallbackCalleeResolver?.calleesForDefinitions(r);if(i&&u){let l={resolvedBinary:i.resolvedBinary??u.resolvedBinary??n.resolvedBinary,references:$(t,i.references),callees:le(r,u.callees)};return i.available&&u.available?{available:!0,...l}:{available:!1,reason:(i.available?void 0:i.reason)??(u.available?void 0:u.reason)??"Rust semantic fallback was unavailable.",...l}}return{available:!1,resolvedBinary:n.resolvedBinary,reason:s instanceof Error?s.message:String(s),references:U(t),callees:W(r)}}requestImportDefinitions(n,t,r){let s=Y(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,nn),i=Y(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,tn),u=Q(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),l=Q(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,sn),d={projectRoot:this.projectRoot,rustAnalyzerBinary:n,file:t,positions:[...r],requestTimeoutMs:s,diagnosticsTimeoutMs:u,settleDelayMs:l,concurrency:i};return G("rust.semantic.import-definitions.session.request",()=>this.requester.requestImportDefinitions(d,oe(r.length,s,i)),()=>({file:t,positions:r.length}))}};function O(e){return e.available?{available:!0}:{available:!1,reason:e.reason}}function N(e){return e.available?"rust-analyzer binary path is unavailable.":e.reason}function ur(e,n,t={}){return new de(e,n,t)}function Jn(e,n){let t=ln(e);if(t!==null)return t;let r=n.includeReferences!==!1;return r&&n.includeCallees!==!0&&n.includeSignatures!==!0&&n.definitionCount<=Yn||r&&n.includeCallees===!0&&n.includeSignatures!==!0&&n.definitionCount<=Qn?0:sn}function on(e){let n=e?.trim().toLowerCase(),t=n==="0"||n==="false"||n==="off"||n==="worker",r=n==="1"||n==="true"||n==="on"||n==="durable",s=n===void 0||n==="";return{transport:t||!s&&!r?"worker":"durable",source:s?"default":"environment",fallback:"worker",valid:s||t||r,optOut:"SCIP_RUST_SEMANTIC_DURABLE_SESSION=0"}}function Xn(e){return on(e).transport}function lr(e,n){let t=on(n);if(t.transport==="worker")return{...t,state:"per-command"};let r=L(un()),s=se(e,r,ce()),i=B(s);return i?{...t,state:P(i,Date.now(),j,F)?"live":"stale",pid:i.pid,heartbeatAtMs:i.heartbeatAtMs,...i.busyUntilMs===void 0?{}:{busyUntilMs:i.busyUntilMs}}:{...t,state:"stopped"}}function Gn(e,n){let t=null,r=!1,s=!1,i=!1,u=()=>t??=n(),l=()=>{s||(e.shutdown(),s=!0)},d=(c,o,a)=>{let f=rt(c);r=!0;try{l()}catch{}C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:a,ok:!1,kind:o,session:"worker-fallback",reason:f})},R=(c,o,a)=>{if(i)throw new Error("Rust semantic failover session was already disposed.");if(r)return a(u());let f=performance.now();try{return o(e)}catch(m){d(m,c,performance.now()-f)}return a(u())};return{requestSemantic(c,o){return R("semantic",a=>a.requestSemantic(c,o),a=>a.requestSemantic(c,o))},requestImportDefinitions(c,o){return R("import-definitions",a=>a.requestImportDefinitions(c,o),a=>a.requestImportDefinitions(c,o))},shutdown(){if(i)return;i=!0;let c=[];try{l()}catch(o){c.push(o)}try{t?.shutdown()}catch(o){c.push(o)}if(c.length>0)throw c[0]}}}function Zn(e,n,t={worker:()=>et(),durable:()=>Je(e,{serverPath:L(un()),semanticWorkerPath:L(an())})}){return Xn(n)==="durable"?Gn(t.durable(),t.worker):t.worker()}function et(e={}){let n=null,t=null,r=1,s=!1,i=null,u=null,l=o=>{o&&ae(o,{recursive:!0,force:!0})},d=()=>{if(i)return;let o=n,a=t;n=null,t=null;let f=o?o.terminate():Promise.resolve(0);i=Promise.allSettled([f,we(a,{gracefulMs:1e3,forceMs:1e3})]).then(([m,y])=>{let D=(y.status==="fulfilled"?y.value:[{reaped:!1,detail:String(y.reason)}]).filter(g=>!g.reaped);if(m.status==="rejected"||D.length>0){u=new Error(`Rust semantic worker cleanup did not complete; ownership evidence remains at ${a??"unknown"}.`);return}l(a)}).finally(()=>{i=null})},R=()=>{if(n)return n;if(i)throw new Error("The previous Rust semantic session worker is still terminating; retry the request.");if(u)throw u;let o=e.semanticWorkerPath?Vn(e.semanticWorkerPath):an();if(!zn(L(o)))throw new Error(`Rust semantic session worker was not found at ${L(o)}. Run npm run build before using built semantic Rust queries.`);return t=en(ue(ce(),"codebaseiq-rust-session-")),n=new $n(o,e.shareEnvironment?{env:Hn}:void 0),n.unref(),n},c=()=>{let o=t??en(ue(ce(),"codebaseiq-rust-session-"));return t=o,ue(o,`${r++}.json`)};return{requestSemantic(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"semantic",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=nt(w(m,{maxBytes:E,inputKind:"Rust semantic worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{ae(m,{force:!0})}},requestImportDefinitions(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"import-definitions",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic import-definition session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=tt(w(m,{maxBytes:E,inputKind:"Rust import-definition worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{ae(m,{force:!0})}},shutdown(){if(s)return;if(s=!0,!n){l(t),t=null;return}let o=c(),a=new SharedArrayBuffer(4),f=new Int32Array(a);n.postMessage({kind:"shutdown",responsePath:o,sharedBuffer:a}),Atomics.wait(f,0,0,5e3),d()}}}function nt(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function tt(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function rt(e){let n=e instanceof Error?`${e.name} ${e.message}`.toLowerCase():String(e).toLowerCase();return n.includes("readiness")?"readiness":n.includes("timeout")||n.includes("timed out")?"timeout":n.includes("helper")?"helper":"request"}function U(e){return new Map(e.map(n=>[n.symbolId,[]]))}function W(e){return new Map(e.map(n=>[n.symbolId,[]]))}function rn(e){return new Map(e.map(n=>[n.symbolId,null]))}function le(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??[]]))}function st(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??null]))}function it(e){let n=0;return e.includeReferences!==!1&&(n+=(e.referenceDefinitions??e.definitions).length),e.includeCallees===!0&&(n+=(e.calleeDefinitions??e.definitions).length),e.includeSignatures===!0&&(n+=(e.signatureDefinitions??e.definitions).length),Math.max(1,n)}function ot(e,n){return n&&n>0?Math.max(e,n):e}function an(){return new URL("./rust-semantic-session-worker.js",import.meta.url)}function un(){return new URL("./rust-semantic-session-server.js",import.meta.url)}function Y(e,n){return z(e)??n}function Q(e,n){return ln(e)??n}function ln(e){if(!e)return null;let n=Number(e);return Number.isInteger(n)&&n>=0?n:null}export{yt as a,St as b,Ue as c,Et as d,b as e,V as f,pn as g,je as h,$ as i,oe as j,ur as k,Jn as l,lr as m,et as n,ot as o};
|
|
2
|
+
//# sourceMappingURL=chunk-O5BWFNIH.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as y}from"./chunk-UHFZDQZJ.js";import{b as h,e as b}from"./chunk-DOQLO74K.js";import{d as u,e as i,g as c}from"./chunk-TNLOX4TN.js";import{f as m}from"./chunk-RGBZDOUO.js";import{z as l}from"./chunk-NRNVMB2R.js";import{basename as f}from"path";function g(t,o){let n=o.className,e=h(t,n);return e.match?e.total>1?{kind:"ambiguous",query:n,total:e.total,candidates:[p(e.match),...e.candidates]}:{kind:"matched",query:n,owner:L(e.match),methods:M(t,e.match)}:{kind:"missing",query:n,suggestions:b(t,n,5)}}function j(t,o){let n=g(t,{className:o});if(n.kind==="missing")throw new Error(`No class definition matched '${o}'.`);if(n.kind==="ambiguous"){let e=n.candidates.map(s=>`${s.relativePath}:${s.startLine+1}`).join(", ");throw new Error(`Class '${o}' is ambiguous across ${n.total} definitions (${e}). Qualify it with a path or exact SCIP symbol identity.`)}return n.methods}function M(t,o){let n=i(o.symbol),s=new y(t).definitionsForFile(o.relativePath).filter(r=>c(r.symbol)),a=s.filter(r=>r.parentTypeName===n||r.symbol.includes(n)),d=(a.length>0?a:S(f(o.relativePath))===n?s.filter(r=>r.symbol.includes("<invalid-global-code>")):[]).map(r=>({startLine:r.startLine,endLine:r.endLine,name:i(r.symbol)}));return l(o.relativePath)!=="clojure"?d:R(d,w(t,o))}function p(t){return{symbol:t.symbol,shortName:u(t.symbol),relativePath:t.relativePath,startLine:t.startLine}}function L(t){return{...p(t),endLine:t.endLine}}function S(t){return t.replace(/\.[^.]+$/,"")}function w(t,o){let n=i(o.symbol);return n?(m(t,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===n).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function R(t,o){let n=new Map;for(let e of[...t,...o])n.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...n.values()].sort((e,s)=>e.startLine-s.startLine||e.endLine-s.endLine)}export{g as a,j as b};
|
|
2
|
+
//# sourceMappingURL=chunk-O7PCDZ5B.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R,b as P}from"./chunk-IRQOAM5G.js";import{a as C,c as B,e as a,f}from"./chunk-OTOKVOJ3.js";import{a as v,b as h,c as k}from"./chunk-NMTSZXCL.js";import{M as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R,b as P}from"./chunk-IRQOAM5G.js";import{a as C,c as B,e as a,f}from"./chunk-OTOKVOJ3.js";import{a as v,b as h,c as k}from"./chunk-NMTSZXCL.js";import{M as g}from"./chunk-NRNVMB2R.js";function D(e,o={}){let{minSimilarity:r=.62,minTokens:n=8,limit:l=20,scope:m,scanLimit:d,filePattern:p,focusFiles:u}=o,c=g(e).reactProfiles({scope:m,minJsxTokens:n,scanLimit:d}).filter(t=>t.kind==="component").map(t=>({file:t.file,component:t.name,tokens:t.jsxTokens,profile:t})),s=R(c,t=>t.tokens);return P({profiles:c,limit:l,filePattern:p,focusFiles:u,candidateIndex:s,profile:{name:"react-component-duplicates"},compare:(t,i)=>y(t,i,r),sort:(t,i)=>i.similarity-t.similarity||t.fileA.localeCompare(i.fileA)||t.componentA.localeCompare(i.componentA)||t.fileB.localeCompare(i.fileB)||t.componentB.localeCompare(i.componentB)})}function y(e,o,r){let n=v(e.tokens,o.tokens);if(n.size<6||!T(n))return null;let l=k(e.tokens,o.tokens);if(l<r)return null;let m=a(n,"component:"),d=a(n,"native:"),p=a(n,"prop:"),u=a(n,"event:"),c=a(n,"binding:"),s=b({sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c});return{fileA:e.file,componentA:e.component,fileB:o.file,componentB:o.component,similarity:l,tokenCountA:e.tokens.size,tokenCountB:o.tokens.size,sharedTokens:f(n),sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c,evidenceClass:s.evidenceClass,actionTier:s.actionTier,evidenceClassReasons:s.reasons,recommendation:s.recommendation,uniqueToA:f(h(e.tokens,o.tokens)).slice(0,25),uniqueToB:f(h(o.tokens,e.tokens)).slice(0,25),locA:e.profile.loc,locB:o.profile.loc}}function T(e){let o=0,r=0;for(let n of e)n.startsWith("component:")&&(o+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("native:")||n.startsWith("jsx:"))&&(r+=1);return B([{name:"component",count:o},{name:"shape",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{shape:4},reason:"shared JSX structure"}]).pass}function b(e){return C({genericWords:w,primitiveGroups:[{values:e.sharedNativeTags,reasonPrefix:"shared native tags",bucket:"generic"},{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"}],recommendation:A})}function A(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific UI primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var w=new Set(["actions","app","button","card","children","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{D as a};
|
|
2
|
+
//# sourceMappingURL=chunk-OAJYNPRU.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var s=new Set(["code","outline","refs"]),c=["--symbol","--at","--search","--view","--edge","--direction","--subtype","--connecting","--inventory-only","--fold","--depth","--max-edges"];function d(e){if(e[2]!=="evidence")return;let t=e[3];if(!t||t.startsWith("-"))return;if(e.slice(4).some(i=>c.some(r=>i===r||i.startsWith(`${r}=`)))){e.splice(3,1,"--symbol",t);return}e[2]="evidence-source"}function a(e){return e!==void 0&&s.has(e)}async function p(e){if(e==="continue"){let{outputContinuationCommandDescriptor:n}=await import("./output-continuation-command-
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var s=new Set(["code","outline","refs"]),c=["--symbol","--at","--search","--view","--edge","--direction","--subtype","--connecting","--inventory-only","--fold","--depth","--max-edges"];function d(e){if(e[2]!=="evidence")return;let t=e[3];if(!t||t.startsWith("-"))return;if(e.slice(4).some(i=>c.some(r=>i===r||i.startsWith(`${r}=`)))){e.splice(3,1,"--symbol",t);return}e[2]="evidence-source"}function a(e){return e!==void 0&&s.has(e)}async function p(e){if(e==="continue"){let{outputContinuationCommandDescriptor:n}=await import("./output-continuation-command-TBXIOPHQ.js");return[n]}if(e==="__sentinel-ensure-service"){let{sentinelEnsureCommandDescriptor:n}=await import("./sentinel-ensure-command-LEWHIRLL.js");return[n]}if(a(e)){let{directNavigationQueryCommandDescriptors:n}=await import("./direct-navigation-236VXYBZ.js"),o=n.find(i=>i.id===e);if(!o)throw new Error(`Direct navigation command descriptor is unavailable: ${e}`);return[o]}let{commandDescriptors:t}=await import("./command-descriptors-NWW34Z54.js");return t}export{d as a,a as b,p as c};
|
|
3
|
+
//# sourceMappingURL=chunk-OFUC6R46.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{E as F,Gb as q,Lb as V,Mb as L,Sa as M,Y as O,Z as A,_ as w,db as $,eb as N,jb as T,ob as j,r as k,ta as D,xa as _}from"./chunk-AZDY3EKD.js";import{j as v,s as m}from"./chunk-KPMMOAV5.js";import{existsSync as S,statSync as me}from"fs";import{join as ge}from"path";import{existsSync as G}from"fs";function B(e,n,t){let r=new Date().toISOString();if(!G(t.dbPath))return{state:"missing",checkedAt:r,metaPath:t.metaPath,reason:"No SQLite index database exists.",remedy:"Run: codebaseiq reindex"};if(!G(t.metaPath))return{state:"unknown",checkedAt:r,metaPath:t.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: codebaseiq reindex"};try{let o=F(m(t.metaPath,"reindex metadata"));if(o.kind==="unsupported")return{state:"unknown",checkedAt:r,metaPath:t.metaPath,reason:`Reindex metadata version ${o.version} is unsupported by this codebaseiq build.`,remedy:"Upgrade codebaseiq or run: codebaseiq reindex"};if(o.kind==="malformed")return{state:"unknown",checkedAt:r,metaPath:t.metaPath,reason:`Could not decode reindex metadata: ${o.reason}`,remedy:"Run: codebaseiq reindex"};let i=o.metadata,s=n.languages??N(e),d=ne(e,s,n),c=[...i.indexedLanguages??[]].sort(),a=o.capabilities.publishableGeneration&&JSON.stringify(i.fingerprint)===JSON.stringify(d)&&JSON.stringify(c)===JSON.stringify(d.languages),p=T(t.dbPath,t.metaPath),R=p.state==="invalid"||p.state==="drifted",y=a&&!R,E=y?void 0:te(i.fingerprint,d);return{state:y?"fresh":"stale",checkedAt:r,metaPath:t.metaPath,updatedAt:i.updatedAt,lastRefresh:i.lastRefresh,...E?{changedFiles:E}:{},reason:R?`SQLite generation requires repair: ${p.reason}`:a?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:y?void 0:"Run: codebaseiq reindex"}}catch(o){return{state:"unknown",checkedAt:r,metaPath:t.metaPath,reason:`Could not read reindex metadata: ${o instanceof Error?o.message:String(o)}`,remedy:"Run: codebaseiq reindex"}}}function te(e,n){let t=e?.files;if(!Array.isArray(t))return;let r=new Map;for(let i of t)typeof i?.path=="string"&&r.set(i.path,`${String(i.size)}:${String(i.hash)}`);let o=new Set;for(let i of n.files)r.get(i.path)!==`${i.size}:${i.hash}`&&o.add(i.path),r.delete(i.path);for(let i of r.keys())o.add(i);return[...o].sort()}var g=!1,U,l=null;function De(e){g=!0,U=e?{headCommit:e.headCommit,treeOid:e.treeOid,clean:e.clean}:void 0,l=null}function _e(){g=!1,U=void 0,l=null}function Me(){l=null}function ne(e,n,t){let r=g?re(e,n,t):null;if(r&&l?.key===r)return l.value;let o=0,i=M("freshness.fingerprint",()=>{let s=$(e,n,K(t));return o=s.files.length,s},()=>({files:o,memoScope:g}));return r&&(l={key:r,value:i}),i}function K(e){return{pnpmWorkspaces:e.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:e.indexer?.typescript?.projectMode,typescriptProjects:e.indexer?.typescript?.projects,clojureConfigPath:e.indexer?.clojure?.configPath}}function re(e,n,t){return JSON.stringify([v(e),[...n].sort(),K(t)])}var b=20,H;function $e(e){H=e}function Ne(){return H}function Te(e){let n=[...e.changedFiles??[]],t=new Map(n.map(s=>[s,[s,s.replaceAll("/","\\")]])),r=Math.max(0,...n.map(s=>s.length)),o=new Set,i="";return{observe(s){if(n.length===0)return;let d=i+s;for(let[c,a]of t)!o.has(c)&&a.some(p=>d.includes(p))&&o.add(c);i=d.slice(-r)},render(){let s=["","\u2550\u2550\u2550 STALE OVERLAY \u2550\u2550\u2550"],d=e.indexUpdatedAt?` built ${e.indexUpdatedAt}`:"";if(e.changedFiles===void 0)s.push(` Answered from a ${e.state} index${d} without reindexing (${e.reason}).`),s.push(" The files changed since then are unknown; treat every result as possibly stale.");else{s.push(` Answered from the index${d} without reindexing; ${n.length} file(s) changed since then.`);let c=n.filter(p=>o.has(p)),a=n.filter(p=>!o.has(p));c.length>0&&s.push(` Stale results: these cited files changed after indexing: ${W(c)}`),a.length>0&&s.push(` Changed files this result does not cite (callers or references in them may be missing): ${W(a)}`)}return s.push(" Exact evidence for changed files needs: codebaseiq reindex"),`${s.join(`
|
|
3
|
+
`)}
|
|
4
|
+
`}}}function W(e){let n=e.slice(0,b).join(", ");return e.length>b?`${n} (+${e.length-b} more)`:n}import{join as ie}from"path";var Ue=4;var oe="typescript-semantic";function Ke(e){let n=ie(e,oe),t=j(n);return{...t,requestDir:t.legacyRequestDir}}function J(e){return O(e)}import{existsSync as se,readdirSync as ae}from"fs";import{createHash as de}from"crypto";import{join as C}from"path";function P(e){let n=0,t=0,r=0,o=0,i=0,s=[];for(let a of e)switch(a.state){case"legacy":n+=1;break;case"current":t+=1;break;case"unsupported-older":r+=1,s.push(x(a));break;case"unsupported-future":o+=1,s.push(x(a));break;case"malformed":i+=1,s.push(x(a));break}let d=n+t,c=r+o+i;return{complete:c===0,total:e.length,accepted:d,legacy:n,current:t,unsupportedOlder:r,unsupportedFuture:o,malformed:i,omitted:c,issues:s}}function x(e){if(e.state==="legacy"||e.state==="current")throw new Error(`accepted record ${e.path} cannot become a compatibility issue`);return{path:e.path,state:e.state,reason:e.reason??e.state}}var X=C(".codebaseiq","suppressions"),Y="codebaseiq-suppression",Q=1,h=2;function ce(e){return C(e,X)}function pe(e){if(e.id&&e.id.trim()!=="")return`${e.id.trim()}.json`;let n=`${e.check??""}\0${e.file??""}`;return`CHECK-${de("sha256").update(n).digest("hex").slice(0,12).toUpperCase()}.json`}function ue(e){return pe(e).slice(0,-5)}function le(e,n){if(typeof e!="object"||e===null||Array.isArray(e))return{state:"malformed",error:"not a suppression object"};let t=e;if(t.schemaVersion===void 0&&(t.kind!==void 0||t.suppressionIdentity!==void 0||t.writer!==void 0))return{state:"malformed",error:"suppression envelope metadata requires schemaVersion"};if(t.schemaVersion!==void 0){if(!Number.isSafeInteger(t.schemaVersion))return{state:"malformed",error:"schemaVersion must be a positive safe integer"};if(t.schemaVersion!==Q&&t.schemaVersion!==h)return{state:t.schemaVersion>h?"unsupported-future":"unsupported-older",error:`unsupported schemaVersion ${String(t.schemaVersion)}`};if(t.kind!==void 0&&t.kind!==Y)return{state:"malformed",error:`kind must be ${Y}`}}if(t.schemaVersion===Q&&t.decision!==void 0)return{state:"malformed",error:"schemaVersion 1 cannot carry automated adjudication metadata"};if(t.schemaVersion===h&&!D(t.decision))return{state:"malformed",error:"schemaVersion 2 requires a valid automated adjudication decision"};if(typeof t.reason!="string"||t.reason.trim()==="")return{state:"malformed",error:"missing reason"};if(!t.id&&!t.check)return{state:"malformed",error:"needs an id or a check"};let r=fe(t);if(t.schemaVersion===void 0)return{state:"legacy",suppression:r,record:t,schemaVersion:0};let o=ue(r);return t.suppressionIdentity!==o||n!==void 0&&t.suppressionIdentity!==n?{state:"malformed",error:"suppressionIdentity does not match the suppression target or filename"}:!t.writer||t.writer.tool!=="codebaseiq"||typeof t.writer.version!="string"||t.writer.version.trim()===""?{state:"malformed",error:"missing valid writer metadata"}:typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))?{state:"malformed",error:"missing valid createdAt timestamp"}:t.updatedAt!==void 0&&(typeof t.updatedAt!="string"||!Number.isFinite(Date.parse(t.updatedAt)))?{state:"malformed",error:"invalid updatedAt timestamp"}:{state:t.schemaVersion===h?"current":"legacy",suppression:r,record:t,schemaVersion:t.schemaVersion}}function z(e){let n=ce(e);if(!se(n))return{suppressions:[],compatibility:P([]),warnings:[]};let t=[],r=[];for(let i of ae(n).sort()){if(!i.endsWith(".json"))continue;let s=C(n,i),d=`${X}/${i}`,c;try{c=JSON.parse(m(s,"suppression record"))}catch{r.push({path:d,state:"malformed",reason:"malformed JSON"});continue}let a=le(c,i.slice(0,-5));if("error"in a){r.push({path:d,state:a.state,reason:a.error});continue}r.push({path:d,state:a.state}),t.push(a.suppression)}let o=P(r);return{suppressions:t,compatibility:o,warnings:o.issues.map(i=>`${i.path}: ${i.reason} \u2014 ignored`)}}function fe(e){return{...typeof e.id=="string"?{id:e.id}:{},...typeof e.check=="string"?{check:e.check}:{},...typeof e.file=="string"?{file:e.file}:{},reason:e.reason,...typeof e.expiresAt=="string"?{expiresAt:e.expiresAt}:{},...typeof e.createdAt=="string"?{createdAt:e.createdAt}:{},...e.decision?{decision:e.decision}:{}}}function Z(){return process.env.CODEBASEIQ_PROJECT_ROOT??process.cwd()}var f,u;function lt(e){f=e}function ft(){return u}function ee(e=Z(),n=void 0){if(n===void 0&&f?.projectRoot===e&&!(f.dbPathSource==="root-fallback"&&S(f.paths.dbPath)))return f;let t=_(e),r=k(e,t),o=process.env.CODEBASEIQ_INDEX_DB;if(o)return{projectRoot:e,config:t,paths:r,dbPath:o,dbPathSource:"env",gitContext:n};if(S(r.dbPath))return{projectRoot:e,config:t,paths:r,dbPath:r.dbPath,dbPathSource:"configured",gitContext:n};let i=ge(e,"index.db");return{projectRoot:e,config:t,paths:r,dbPath:i,dbPathSource:"root-fallback",rootFallbackWarning:Pe(i,r.dbPath),gitContext:n}}function mt(e){return ee(e).dbPath}function gt(e,n,t,r={}){return S(t.dbPath)&&r.gitContext?.clean===!1&&r.watcherGeneration!==void 0&&J(t.dbPath)===r.watcherGeneration?L(e,n,t,r.gitContext):B(e,n,t).state==="fresh"?{kind:"local-fresh"}:V(e,n,t,r.gitContext)}function he(e){return!e.startsWith("__")&&!ye.has(e)}function ht(e){return he(e)&&!Se.has(e)}var Se=new Set(["reuse","hook-architecture-stop"]),ye=new Set(["capabilities","check-deps","config-validate","doctor","init","install-skills","reindex","setup","setup-agent","status","suppress","uninstall","view","watch"]);function be(){return xe(Z(),{warnOnRootFallback:!0})}function xe(e,n={}){let{config:t,paths:r,dbPath:o,dbPathSource:i,rootFallbackWarning:s,gitContext:d}=ee(e);if(!S(o))throw new Error("No index.db found. Run: codebaseiq reindex");n.warnOnRootFallback&&i==="root-fallback"&&s&&console.error(s);let c=z(e).suppressions,a={dbPath:o,indexPath:process.env.CODEBASEIQ_INDEX_SCIP??r.indexPath,projectRoot:e,collaborationDomainId:t.collaborationDomainId,sharedEvidenceDbPath:q(e,t,d),entryRoots:t.entryRoots,semantic:t.semantic,suppressions:[...t.suppressions??[],...c],declaredCouplings:t.declaredCouplings,locality:t.locality,architecture:t.architecture,coverageContracts:t.coverageContracts,docs:t.docs},p=w(e);return new A(a,p)}function Pe(e,n){let t="unknown time";try{t=me(e).mtime.toISOString()}catch{}return`warning: using legacy project-root index.db (${e}, modified ${t}) because the configured index was not found at ${n}. This fallback may be stale; run 'codebaseiq reindex' to refresh the configured index.`}var I;function St(e){I=e}function yt(e){if(I){let r=I(),o=u;u=r;try{return e(r)}finally{u=o}}let n=be(),t=u;u=n;try{return e(n)}finally{u=t,n.close()}}function bt(e,n){return n.concat([e])}function Ce(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(1)} GB`}function xt(e){switch(e.state){case"idle":return"Watching (idle)";case"waiting":{let n=Math.round((e.reindexAt-Date.now())/1e3);return`${e.changedFiles} file(s) changed, reindexing in ${n}s...`}case"indexing":return`Reindexing... (${Math.round((Date.now()-e.startedAt)/1e3)}s)`;case"cooldown":return`Cooldown (${Math.round((e.until-Date.now())/1e3)}s)${e.dirty?" \u2014 changes pending":""}`;case"budget-paused":return`Automatic reindex paused by resource budget (${Math.max(0,Math.round((e.until-Date.now())/1e3))}s; ${e.reason}; ${e.rebuilt} rebuilds, ${Ce(e.estimatedWriteBytes)} estimated writes)${e.dirty?" \u2014 changes pending":""}`;case"draining":return`Stopping safely \u2014 ${e.reason}`;default:return Ie(e)}}function Ie(e){throw new Error(`Unhandled watcher status: ${JSON.stringify(e)}`)}export{B as a,De as b,_e as c,Me as d,$e as e,Ne as f,Te as g,Ue as h,Ke as i,Y as j,Q as k,h as l,ce as m,pe as n,ue as o,le as p,z as q,Z as r,lt as s,ft as t,ee as u,mt as v,gt as w,he as x,ht as y,be as z,xe as A,Pe as B,St as C,yt as D,bt as E,Ce as F,xt as G};
|
|
5
|
+
//# sourceMappingURL=chunk-OSZ7PW5K.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as m}from"./chunk-
|
|
2
|
+
import{b as m}from"./chunk-RNPG5P4P.js";var p=new Set(m),d=new Map(m.map((n,e)=>[n,e])),c=new Set(["Navigation","Graph","Impact","Exploration"]),u=new Set(["Cleanup","Health"]),y=new Set(["Indexing","Core","Maintenance"]);function h(n){if(n.hidden||n.agent?.semantic?.compatibility==="deprecated")return"compatibility";if(p.has(n.id))return"primary-exploration";let e=n.docs?.category;if(e&&c.has(e))return"specialized-analysis";if(e&&u.has(e))return"quality-cleanup";if(e&&y.has(e))return"maintenance";if(e==="Formal Models")return"formal-modeling";throw new Error(`Visible command ${n.id} has no cockpit panel (docs category: ${e??"missing"}).`)}function f(n,e={}){return[{id:"primary-exploration",title:"Primary exploration",purpose:"Locate exact referents, project chosen relationships, and read only named implementation gaps."},{id:"specialized-analysis",title:"Specialized analysis",purpose:"Run a named graph, impact, or structural analysis when that exact analysis answers the task."},{id:"quality-cleanup",title:"Quality and cleanup",purpose:"Evaluate repository quality, cleanup candidates, and configured architecture findings."},{id:"maintenance",title:"Maintenance",purpose:"Build, inspect, configure, and maintain the project index and local integrations."},{id:"formal-modeling",title:"Formal modeling",purpose:"Create, verify, and check explicit state-machine models and traces."},{id:"compatibility",title:"Compatibility and deprecated controls",purpose:"Preserved invocation surfaces for existing consumers; do not choose these for new workflows."}].map(i=>({...i,commands:n.filter(t=>h(t)===i.id).sort((t,a)=>i.id==="primary-exploration"?(d.get(t.id)??Number.MAX_SAFE_INTEGER)-(d.get(a.id)??Number.MAX_SAFE_INTEGER):0)})).filter(i=>i.commands.length>0&&(e.includeCompatibility||i.id!=="compatibility"))}function C(n,e,s={}){let o=[`Usage: ${n.name()} [options] [command]`,"",n.description(),"","Options:"],i=n.options.map(a=>a.flags),t=Math.max(...i.map(a=>a.length),0);for(let a of n.options)o.push(` ${a.flags.padEnd(t)} ${a.description}`);o.push(` ${"-h, --help".padEnd(t)} Display this grouped command help`);for(let a of f(e,s)){o.push("",`${a.title}:`,` ${a.purpose}`);let l=Math.max(...a.commands.map(r=>r.command.length),0);for(let r of a.commands)o.push(` ${r.command.padEnd(l)} ${r.description}`)}return s.includeCompatibility||o.push("","Run `codebaseiq --help-all` to include compatibility and deprecated controls."),o.push("Run `codebaseiq <command> --help` for one control's options and examples.",""),o.join(`
|
|
3
3
|
`)}export{h as a,f as b,C as c};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-OZ2M2X7A.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{k as o}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{k as o}from"./chunk-C3PPB2T5.js";function I(){return performance.now()}function T(){return Date.now()}var f=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function l(r){if(!r||typeof r!="object"||Array.isArray(r))return null;let t=r;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!f.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function c(r,t){return r.version===t.version&&r.pid===t.pid&&r.platform===t.platform&&r.startToken===t.startToken}import{execFileSync as m}from"child_process";import{platform as d}from"os";var s=new WeakMap,u=1e3,i=16*1024;function k(r,t=P){if(!Number.isSafeInteger(r)||r<=0)return null;if(r===process.pid){let n=s.get(t);if(n)return n}try{let n=p(r,t);if(!n)return null;let e={version:1,pid:r,platform:t.platform,startToken:n};return r===process.pid&&s.set(t,e),e}catch{return null}}function p(r,t){if(t.platform==="linux"||t.platform==="android")return y(t.readFile(`/proc/${r}/stat`));if(t.platform==="win32"){let n=`([DateTimeOffset](Get-Process -Id ${r} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return a(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",n]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?a(t.run("ps",["-p",String(r),"-o","lstart="])):null}function y(r){let t=r.lastIndexOf(")");if(t<0)return null;let e=r.slice(t+1).trim().split(/\s+/)[19];return e&&/^\d+$/.test(e)?e:null}function a(r){let t=r.trim();return t===""?null:t}var P={platform:d(),readFile(r){return o(r,{maxBytes:i,inputKind:"process identity pseudo-file"})},run(r,t){return m(r,[...t],{encoding:"utf8",timeout:u,maxBuffer:i,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"],windowsHide:!0})}};export{I as a,T as b,l as c,c as d,k as e};
|
|
2
|
+
//# sourceMappingURL=chunk-OZI44VCR.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as f,I as h,K as x,L as b,i as m,k as d}from"./chunk-
|
|
1
|
+
import{H as f,I as h,K as x,L as b,i as m,k as d}from"./chunk-XDQ6QJF5.js";import{createHash as N}from"crypto";var y=2,S=200,C=new Set(["string","template_string","string_literal","raw_string_literal","char_literal","concatenated_string"]),A={class_declaration:"name",abstract_class_declaration:"name",class:"name",class_definition:"name",trait_item:"name",impl_item:"type",mod_item:"name"},L=m({kind:"callable-units",invalidation:d("callable-units"),serialize:t=>JSON.stringify({version:y,...t}),deserialize:t=>{try{let e=JSON.parse(t);return e.version!==y?null:{language:e.language,contentHash:e.contentHash,units:e.units}}catch{return null}}});function U(t){return N("sha256").update(t).digest("hex")}function j(t,e,r){let s=U(r),n=L.read(t,e,s);if(n&&n.contentHash===s)return n;let o=f(t,e,r);if(!o)return null;let i={language:o.language,contentHash:s,units:E(o.tree,o.language)};return L.write(t,e,s,i),i}function E(t,e){let r=[],s=new Map,n=[],o=i=>{let l=b(i,e),u=l?.functionNode.childForFieldName("body");if(l&&u){let a=`${n.join(".")}#${l.name}`,g=s.get(a)??0;s.set(a,g+1),r.push(H(l.name,[...n],g,l.definitionNode,u,e)),n.push(l.name);for(let p of i.children)o(p);n.pop();return}let c=T(i);c&&n.push(c);for(let a of i.children)o(a);c&&n.pop()};return o(t.rootNode),r}function H(t,e,r,s,n,o){let i=[],l=[],u=new Set,c=a=>{if(x(a))return;let g=h(a,o);if(g&&u.add(g.calleeLeaf),C.has(a.type)){i.push(a.text.replace(/\r\n/g,`
|
|
2
2
|
`)),l.push("\0L");return}if(a.childCount===0){i.push(a.text),l.push(a.text);return}for(let p of a.children)c(p)};return c(n),{name:t,container:e,ordinal:r,startLine:s.startPosition.row,endLine:s.endPosition.row,bodyStartLine:n.startPosition.row,bodyLines:n.text.split(/\r?\n/).filter(a=>a.trim().length>0).length,tokenCount:i.length,signature:v(s,n),exactHash:_(i),shapeHash:_(l),calleeLeaves:[...u].sort(),exported:F(s)}}function T(t){let e=A[t.type];return e?t.childForFieldName(e)?.text??null:null}function v(t,e){let r=t.text.lastIndexOf(e.text),n=(r>=0?t.text.slice(0,r):w(t.text)).replace(/\s+/g," ").trim().replace(/[=:]?\s*$/,"").trim();return n.length>S?`${n.slice(0,S-1)}\u2026`:n}function w(t){let e=t.indexOf(`
|
|
3
3
|
`);return e>=0?t.slice(0,e):t}function F(t){if(t.namedChildren.some(r=>r.type==="visibility_modifier"&&r.text.startsWith("pub")))return!0;let e=t;for(let r=0;e&&r<3;r++,e=e.parent)if(e.type==="export_statement")return!0;return!1}function _(t){return N("sha256").update(t.join("")).digest("hex").slice(0,24)}export{j as a};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-PCKIKOUA.js.map
|