codebaseiq 0.3.1 → 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 +65 -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-JYRJYXUV.js → chunk-33AXWMO2.js} +2 -2
- package/dist/{chunk-EQNMD62X.js → chunk-37K55EG3.js} +2 -2
- package/dist/{chunk-LCW3PSGL.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-DWBAESVW.js → chunk-3VDL7GTY.js} +2 -2
- package/dist/{chunk-BFANZRQ5.js → chunk-3XBZ5PKL.js} +2 -2
- package/dist/{chunk-K6FNTQQW.js → chunk-42PXSE74.js} +2 -2
- package/dist/{chunk-ALOEHWJS.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-JSB43EX6.js → chunk-55NUXP2V.js} +2 -2
- package/dist/chunk-5AJQCOZZ.js +21 -0
- package/dist/{chunk-L37EQYAX.js → chunk-5NUPFZFA.js} +2 -2
- package/dist/{chunk-PIFYOWS4.js → chunk-65QIFIF6.js} +2 -2
- package/dist/{chunk-SUE7SHZL.js → chunk-66Q5VLH6.js} +2 -2
- package/dist/{chunk-KFTHI2R6.js → chunk-6CQPIIS7.js} +2 -2
- package/dist/{chunk-GV2CEZCW.js → chunk-6CTSFS7R.js} +2 -2
- package/dist/{chunk-SB53KPWA.js → chunk-6EBUAKJT.js} +2 -2
- package/dist/chunk-6I55VYFG.js +4 -0
- package/dist/chunk-6NUURWPF.js +3 -0
- package/dist/{chunk-TEMM2FEL.js → chunk-6P5QMOM7.js} +2 -2
- package/dist/{chunk-3LQJRS4I.js → chunk-6S5FE4ZF.js} +2 -2
- package/dist/chunk-74LRKLNC.js +22 -0
- package/dist/{chunk-NNG6M6XD.js → chunk-75A23IID.js} +2 -2
- package/dist/chunk-75VNTSO6.js +7 -0
- package/dist/chunk-7HBBVZJ6.js +3 -0
- package/dist/{chunk-AGGR2BKS.js → chunk-7PPBMBH6.js} +2 -2
- package/dist/{chunk-DECN422G.js → chunk-7WG57A5X.js} +2 -2
- package/dist/{chunk-ILGTMRMZ.js → chunk-7XHZX6FX.js} +2 -2
- package/dist/{chunk-OKAF4OQS.js → chunk-A5HJ3CJW.js} +2 -2
- package/dist/{chunk-JNXI6NQ7.js → chunk-AJ5HVC5Z.js} +2 -2
- package/dist/{chunk-SZ4P7MF7.js → chunk-AYRHOFLV.js} +2 -2
- package/dist/chunk-AZDY3EKD.js +93 -0
- package/dist/{chunk-SA7G6GJX.js → chunk-AZZNG5Z2.js} +2 -2
- package/dist/chunk-BEKCTUPY.js +3 -0
- package/dist/{chunk-PTR3EOXC.js → chunk-BKKX2OU5.js} +2 -2
- package/dist/{chunk-5LL4KEHO.js → chunk-BQKRYKDD.js} +2 -2
- package/dist/{chunk-UIAUPFBJ.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-UMEPSVKT.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-CB5AVJMM.js → chunk-DNRHRVKS.js} +2 -2
- package/dist/{chunk-SGMNWYTH.js → chunk-DOQLO74K.js} +2 -2
- package/dist/{chunk-DDRA3QKN.js → chunk-DP3EJ6XL.js} +2 -2
- package/dist/{chunk-OWJWOEDU.js → chunk-DQZF7MP6.js} +2 -2
- package/dist/{chunk-VSGOIZMQ.js → chunk-DTM4EHD2.js} +2 -2
- package/dist/{chunk-YRKP7PM7.js → chunk-DUM7GR6B.js} +2 -2
- package/dist/{chunk-HNXRVGMY.js → chunk-DZ4QOIRY.js} +2 -2
- package/dist/{chunk-CSPDQLLU.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-EHPOTEQX.js → chunk-ESWVTSHU.js} +2 -2
- package/dist/{chunk-57OPIQFM.js → chunk-ETZBIG6K.js} +2 -2
- package/dist/chunk-EYSJHKX6.js +3 -0
- package/dist/{chunk-MC46AL7B.js → chunk-F4AGM7ZE.js} +37 -37
- package/dist/{chunk-EOKVZXNF.js → chunk-FPUJRBHL.js} +55 -55
- 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-ELYMY5S2.js → chunk-GC4I33OD.js} +2 -2
- package/dist/{chunk-NDKOVQFG.js → chunk-GLXEWYQY.js} +2 -2
- package/dist/{chunk-CYJS33YX.js → chunk-GRHNPFHT.js} +2 -2
- package/dist/{chunk-QY7QB7I6.js → chunk-GWESWURK.js} +2 -2
- package/dist/{chunk-R4OJGTMP.js → chunk-GXOFPAIR.js} +2 -2
- package/dist/{chunk-OBC7HSSO.js → chunk-H4FGIFEU.js} +2 -2
- package/dist/{chunk-LKUTSP4G.js → chunk-HOGS6JFP.js} +2 -2
- package/dist/{chunk-RIO3JXHM.js → chunk-HSJLK5MC.js} +2 -2
- package/dist/{chunk-BWL3PMPT.js → chunk-HTPEUJ42.js} +2 -2
- package/dist/{chunk-DJKOXMNG.js → chunk-IBPXUGJV.js} +2 -2
- package/dist/{chunk-2XBJRZEM.js → chunk-ITA3N7G6.js} +2 -2
- package/dist/chunk-JG5OWAEB.js +22 -0
- package/dist/{chunk-LSZYMN2A.js → chunk-JGJKRTTB.js} +2 -2
- package/dist/{chunk-TJWVT4DO.js → chunk-JGXLB7PR.js} +2 -2
- package/dist/{chunk-5TZNHP4T.js → chunk-JKUF2UG6.js} +2 -2
- 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-2Z7K66D7.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-O2KWU34K.js → chunk-M3IBH6C3.js} +9 -9
- package/dist/{chunk-UJIXCI3L.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-WO6OFKUC.js → chunk-N26LGGSF.js} +2 -2
- package/dist/{chunk-J7AMBVWF.js → chunk-NB2DAVPP.js} +2 -2
- package/dist/{chunk-MDFT325O.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-JAFDMV5I.js → chunk-O5BWFNIH.js} +2 -2
- package/dist/{chunk-3H2H5ODK.js → chunk-O7PCDZ5B.js} +2 -2
- package/dist/{chunk-KPZGTB2O.js → chunk-OAJYNPRU.js} +2 -2
- package/dist/{chunk-KUKWHP4R.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-I3OK27P7.js → chunk-PFMQRHC6.js} +2 -2
- package/dist/{chunk-K4S2VH42.js → chunk-PVKSZBX5.js} +2 -2
- 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-KLX6NSWT.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-BGYRF5YX.js → chunk-RWAZCEJD.js} +2 -2
- package/dist/{chunk-Z66XYVLZ.js → chunk-RWDIONS7.js} +2 -2
- package/dist/{chunk-CJTKGAGH.js → chunk-S3CJYDXP.js} +2 -2
- package/dist/{chunk-53ELMZRF.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-HJTM3C4Y.js → chunk-TB575ZGO.js} +2 -2
- package/dist/{chunk-YHPG3S2U.js → chunk-TG4GMU73.js} +2 -2
- package/dist/{chunk-N2XDMNVI.js → chunk-THKM7OXM.js} +2 -2
- package/dist/{chunk-GVAF222T.js → chunk-TNLOX4TN.js} +2 -2
- package/dist/{chunk-BPKNP3KZ.js → chunk-UHFZDQZJ.js} +2 -2
- package/dist/{chunk-YT4DVWUV.js → chunk-UUMAM5LM.js} +2 -2
- package/dist/{chunk-TLTSESB4.js → chunk-UUT5P3V7.js} +2 -2
- package/dist/{chunk-W7QDASTN.js → chunk-VEPK6M5C.js} +2 -2
- package/dist/{chunk-XJBK3QDV.js → chunk-VPCHKZ3I.js} +2 -2
- package/dist/{chunk-3ON3A2QV.js → chunk-VZY3XOBU.js} +2 -2
- package/dist/{chunk-XQAVQVIL.js → chunk-W6E6ME7G.js} +2 -2
- package/dist/{chunk-KEJ2HLRW.js → chunk-WGYZBS5S.js} +2 -2
- package/dist/{chunk-5MPBSFZH.js → chunk-WUP24Q4U.js} +2 -2
- package/dist/chunk-WXUHXSLN.js +2 -0
- package/dist/{chunk-F5CJO5JN.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-T2M5HWBQ.js → chunk-XVJ2E7W7.js} +2 -2
- package/dist/{chunk-AXQCHG77.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-5CR4U5X2.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-4GWN76B2.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-AMRXV444.js → code-viewer-C6HE4DFC.js} +2 -2
- package/dist/{code-viewer-EXI5SFFR.js → code-viewer-XHSSAMBX.js} +2 -2
- package/dist/{command-descriptors-ROIOTCCW.js → command-descriptors-NWW34Z54.js} +171 -171
- package/dist/{command-descriptors-H6A4UY72.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-2I2UHZET.js +0 -2
- package/dist/chunk-5T44HG5Y.js +0 -88
- package/dist/chunk-5YBDBY5L.js +0 -2
- package/dist/chunk-6EYESTJM.js +0 -3
- package/dist/chunk-6FXXYYQM.js +0 -22
- package/dist/chunk-7UCDGXRW.js +0 -8
- package/dist/chunk-BIADXGC3.js +0 -22
- package/dist/chunk-CLPCFGRT.js +0 -3
- package/dist/chunk-DUKHVPU5.js +0 -4
- package/dist/chunk-G7GVV2TV.js +0 -27
- package/dist/chunk-KUKKLWJD.js +0 -3
- package/dist/chunk-KWRQVLPX.js +0 -3
- package/dist/chunk-MEUHIDI3.js +0 -7
- package/dist/chunk-OP6BUIV6.js +0 -2
- package/dist/chunk-OQ3DK7FW.js +0 -2
- package/dist/chunk-OT5ISJSR.js +0 -2
- package/dist/chunk-SX72EVMY.js +0 -3
- package/dist/chunk-T75DS2E6.js +0 -21
- package/dist/chunk-UC2FD2PS.js +0 -4
- package/dist/chunk-UQYQBLJX.js +0 -5
- package/dist/chunk-V4NGDIEA.js +0 -21
- package/dist/chunk-XUPFA6GH.js +0 -2
- package/dist/chunk-YPBKBYPS.js +0 -21
- package/dist/chunk-ZMA5HWXY.js +0 -3
- package/dist/cli-context-FJL2JHOE.js +0 -3
- package/dist/cli-context-PQNWHMCQ.js +0 -2
- package/dist/cli-program-SCHOHOQE.js +0 -7
- package/dist/direct-navigation-3JOYP2MO.js +0 -3
- package/dist/direct-navigation-SJMJLBY7.js +0 -2
- package/dist/invocation-command-descriptors-GMZX3UAD.js +0 -2
- package/dist/invocation-command-descriptors-HNMKDEF6.js +0 -3
- package/dist/output-continuation-command-5NWVDQT7.js +0 -2
- package/dist/output-continuation-command-RNEHNYPU.js +0 -3
- package/dist/project-reindex-MIW5CYEG.js +0 -3
- package/dist/project-reindex-VQ23LWDA.js +0 -2
- package/dist/sentinel-ensure-command-H66AZ3VE.js +0 -2
- package/dist/sentinel-ensure-command-R4YAUCJB.js +0 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as C,b as x,c as K,d as $}from"./chunk-
|
|
1
|
+
import{a as C,b as x,c as K,d as $}from"./chunk-GWESWURK.js";import{a as A}from"./chunk-DGXRDLV5.js";import{b as L,c as R}from"./chunk-UHFZDQZJ.js";import{a as y}from"./chunk-BGBBVSH4.js";import{h as M}from"./chunk-GLXEWYQY.js";import{a as k}from"./chunk-NMKQOIYZ.js";import{b as F,d as P,e as g}from"./chunk-TNLOX4TN.js";import{l as T}from"./chunk-RGBZDOUO.js";import{w as I}from"./chunk-23AD24QZ.js";function me(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:a=30,includeLowConfidence:c=!1,scanLimit:o}=e??{},f=e?.semantic!==!1,r=new R(t),d=r.scopedDefinitions(n),b=Q(r,n),l={high:0,medium:1,low:2};return A({candidates:()=>U(t,r,d,{minLoc:i,maxLoc:s}),orderCandidates:(u,m)=>y(m)-y(u)||u.relativePath.localeCompare(m.relativePath),scanLimit:o,profile:{name:"stale-abstractions"},prepare:u=>{let m=W(u),p=O(t,r,u,m,{semantic:f}),S=u.filter(h=>{if(p.incompleteSymbolIds.has(h.symbolId)||p.unavailableSymbolIds.has(h.symbolId)||r.hasSuppressionComment(h))return!1;let D=v(t,h,p.consumerFileMap,m);return D.realConsumers.length<=1&&!D.transitivelyReachable&&j(h,D.realConsumers.length,b)});return{...p,singletonBackedClassIds:H(t,r,d,S,{semantic:f}),candidateIndex:m}},evaluate:(u,m)=>{if(m.incompleteSymbolIds.has(u.symbolId)||m.unavailableSymbolIds.has(u.symbolId)||r.hasSuppressionComment(u)||m.singletonBackedClassIds.has(u.symbolId))return null;let p=v(t,u,m.consumerFileMap,m.candidateIndex);if(p.transitivelyReachable||p.realConsumers.length>1||p.realConsumers.length===0&&p.barrelConsumers>0||!j(p.definition,p.realConsumers.length,b))return null;let S=V(t,p);return!c&&S.confidence==="low"?null:S},orderResults:(u,m)=>l[u.confidence]-l[m.confidence]||m.loc-u.loc||u.file.localeCompare(m.file)||u.startLine-m.startLine,limit:a})}function U(t,e,n,i){return n.filter(s=>s.isTypeLike&&y(s)>=i.minLoc).filter(s=>y(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>!s.relativePath.endsWith(".d.ts")).filter(s=>k(s.relativePath)!=="test").filter(s=>!M(t,s.symbol,s.relativePath)).filter(s=>!X(s.symbol))}function B(t,e,n,i){return x(C(t,e).forDefinitions(n,{semantic:i.semantic,sourceFallback:i.sourceFallback}))}function O(t,e,n,i,s){let a=B(t,e,n,{semantic:!1,sourceFallback:!1}),c=n.filter(l=>{let u=v(t,l,a,i);return u.realConsumers.length<=1&&!(u.realConsumers.length>0&&w(l.relativePath))}),o=C(t,e).forDefinitions(c,{semantic:s.semantic,sourceFallback:!1}),f=new Set([...o.values()].filter(l=>l.semanticIncomplete).map(l=>l.definition.symbolId)),r=new Set([...o.values()].filter(l=>l.semanticUnavailable).map(l=>l.definition.symbolId)),d=s.semantic&&c.length>0?L(a,x(o)):a,b=c.filter(l=>v(t,l,d,i).realConsumers.length<=1);return{consumerFileMap:L(d,B(t,e,b,{semantic:!1,sourceFallback:!0})),incompleteSymbolIds:f,unavailableSymbolIds:r}}function W(t){let e=new Map;for(let n of t){let i=e.get(n.relativePath);i||(i=new Map,e.set(n.relativePath,i));let s=g(n.symbol);s&&i.set(s,n)}return e}function v(t,e,n,i){let a=[...n.get(e.symbolId)??new Set].filter(d=>d!==e.relativePath&&!t.isIgnored(d)),{realConsumers:c,barrelConsumers:o,importOnlyConsumers:f}=K(t,e,a),r=Y(t,e,n,i);return{definition:e,realConsumers:c,barrelConsumers:o+f,transitivelyReachable:r}}function V(t,e){let n=N(t,e.definition.relativePath,e.definition.startLine),i=w(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:s,reason:a}=ne(e.realConsumers.length,n,i),c=z(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:P(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:y(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:a,actionTier:c.actionTier,stalenessKind:c.stalenessKind,recommendation:c.recommendation}}function z(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,i,s){let a=_(t,Z(n),i),c=a.map(d=>d.singleton);if(a.length===0)return new Set;let o=C(t,e).forDefinitions(c,{semantic:s.semantic,sourceFallback:!0}),f=x(o),r=new Set;for(let{singleton:d,classId:b}of a){let l=o.get(d.symbolId);(l?.semanticIncomplete||l?.semanticUnavailable||G(t,d,f))&&r.add(b)}return r}function Z(t){let e=new Map;for(let n of t){let i=g(n.symbol);i&&e.set(E(n.relativePath,i),n)}return e}function _(t,e,n){let i=[];for(let s of n){let a=q(t,e,s);a&&i.push({singleton:a,classId:s.symbolId})}return i}function q(t,e,n){if(N(t,n.relativePath,n.startLine)!=="class")return null;let i=g(n.symbol);if(!i)return null;let s=J(t,n.relativePath,i);return s?e.get(E(n.relativePath,s))??null:null}function G(t,e,n){let i=g(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(a=>a!==e.relativePath&&!t.isIgnored(a)&&!$(t,a,i))}function E(t,e){return`${t}\0${e}`}function J(t,e,n){let i=I(t,e);if(!i)return null;let s=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(a)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=F(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let i=n[n.length-1],s=n[n.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function w(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(w(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,i){let s=T(t,e.relativePath),a=g(e.symbol);if(!a)return!1;let c=i.get(e.relativePath);if(!c)return!1;let o=[...s.get(a)??[]],f=new Set;for(;o.length>0;){let r=o.pop();if(f.has(r))continue;f.add(r);let d=c.get(r);if(!d)continue;let b=n.get(d.symbolId);if(b){for(let l of b)if(l!==e.relativePath&&!t.isIgnored(l))return!0}for(let l of s.get(r)??[])o.push(l)}return!1}function N(t,e,n){let i=I(t,e);if(!i)return"other";let s=i.split(`
|
|
2
2
|
`),a=Math.max(0,n-2),c=Math.min(s.length-1,n+2);for(let o=a;o<=c;o++){let r=(s[o]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(r))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(r))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(r))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(r))return"enum"}return"other"}function ee(t,e){let n=I(t,e.relativePath);if(!n)return!1;let i=g(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${s}\\b`),c=n.split(`
|
|
3
3
|
`);for(let o=0;o<c.length;o++)if(!(o>=e.startLine&&o<=e.endLine)&&a.test(c[o]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{me as a};
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
4
|
+
//# sourceMappingURL=chunk-XVJ2E7W7.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d as x}from"./chunk-DUM7GR6B.js";import{f,g as p}from"./chunk-R7PXHYMY.js";import{a as L}from"./chunk-TG4GMU73.js";import{b as D}from"./chunk-B75HZHUP.js";import{c as E}from"./chunk-UHFZDQZJ.js";import{a as C}from"./chunk-BGBBVSH4.js";import{a as v}from"./chunk-ETZBIG6K.js";import{b as y}from"./chunk-2QJAVISG.js";import{b}from"./chunk-DOQLO74K.js";import{d as m,t as g}from"./chunk-TNLOX4TN.js";import{c as u,f as h}from"./chunk-RGBZDOUO.js";var A=/^(?:validate|verify|check|assert)(?:[A-Z].*)?$/,N=/^(?:is|has)(?:[A-Z].*)?$/,I=/[{,]\s*(?:ok|success|valid|isValid)\s*:\s*false\b/,d=/\breturn\b/g,k=/\bfunction\b|=>|\)\s*(?::\s*[^{;=]+)?\s*\{/,w=/\.(?:addIssue|push)\s*\(/;function M(e,n={}){let{scope:t,limit:o=30,scanLimit:i}=n,c=new E(e),r=D(c.productionCallableDefinitions({scope:t,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),i),s=[];for(let l of r){let a=P(e,l);a&&s.push({symbol:l.symbol,shortName:m(l.symbol),file:l.relativePath,startLine:l.startLine,endLine:l.endLine,loc:C(l),...a})}return s.sort((l,a)=>l.file.localeCompare(a.file)||l.startLine-a.startLine||l.loc-a.loc),o?s.slice(0,o):s}function _(e){return A.test(e)?"imperative":N.test(e)?"predicate":null}function P(e,n){let t=_(n.leaf);if(!t||L(e,n))return null;let o=f(e,n);if(!o||!k.test(o))return null;let i=h(e,n.relativePath)?.callables.find(r=>r.startLine===n.startLine&&r.endLine===n.endLine);if(t==="predicate"&&i?.paramCount===0)return null;if(x(o)){let r=O(e,n);return!r||S(r.body,T(r.snippet))||R(r.body)?null:{nameKind:t,resolvedVia:"one-hop-delegate",delegateTarget:r.shortName}}let c=p(o);return S(c,T(o))||R(c)?null:{nameKind:t,resolvedVia:"direct"}}var F=new Set(["if","for","while","switch","catch","function"]);function R(e){let n=u(e);for(let t of n.matchAll(/\b([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g))if(!F.has(t[1]))return!0;return!1}function T(e){let n=e.indexOf("=>");return n===-1?!1:!/^\s*\{/.test(e.slice(n+2))}function S(e,n){let t=u(e);if(/\bthrow\b/.test(t)||/\.reject\s*\(/.test(t)||I.test(t)||w.test(t))return!0;let o=K(t);if(n&&o.length===0){let i=t.trim();return i!==""&&i!=="true"}for(let i of o)if(i!==""&&i!=="true")return!0;return!1}function K(e){let n=[];d.lastIndex=0;let t;for(;t=d.exec(e);){let o=t.index+t[0].length,i=0,c=e.length;for(let r=o;r<e.length;r+=1){let s=e[r];if(s==="("||s==="["||s==="{")i+=1;else if(s===")"||s==="]"||s==="}"){if(i===0){c=r;break}i-=1}else if(s===";"&&i===0){c=r;break}}n.push(e.slice(o,c).trim()),d.lastIndex=c}return n}function O(e,n){let t=y(e,n,{callableOnly:!0,limit:3,semanticEvidence:v});if(t.semanticIncomplete||t.semanticUnavailable)return null;let o=t.rows,i=[...new Set(o.map(a=>a.symbol))].filter(a=>a!==n.symbol);if(i.length!==1)return null;let r=b(e,i[0]).match;if(!r)return null;let s=g(e,r.relativePath).find(a=>a.symbolId===r.symbolId);if(!s)return null;let l=f(e,s);return l?{body:p(l),snippet:l,shortName:m(s.symbol)}:null}export{M as a};
|
|
2
|
+
//# sourceMappingURL=chunk-Y7GFAU5N.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{a as y}from"./chunk-K3PFL5QQ.js";import{b as f}from"./chunk-DOQLO74K.js";import{c as h,d as w}from"./chunk-SGX43S2L.js";import{d as u,e as m,h as b,p,q as g}from"./chunk-TNLOX4TN.js";import{dirname as $,isAbsolute as k,relative as x,resolve as v}from"path";var C=new Set(w());function R(t,e){return`tests/generated/twin-ab/${d(t)}-vs-${d(e)}.test.ts`}function d(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function P(t,e,a,n){let{refA:l,refB:s,outFile:r}=typeof e=="string"?{refA:e,refB:a,outFile:n}:e;if(typeof l!="string"||typeof s!="string"||typeof r!="string")throw new TypeError("twinAb requires refA, refB, and outFile.");if(!k(r))throw new TypeError("twinAb outFile must be an absolute path.");let i=A(t,l);if(!i.ok)return i;let o=A(t,s);if(!o.ok)return o;let c=i.symbol.paramCount===null||o.symbol.paramCount===null?null:i.symbol.paramCount===o.symbol.paramCount,S=N(i.symbol,o.symbol,t.config.projectRoot,r,c);return{ok:!0,a:i.symbol,b:o.symbol,signatureCompatible:c,testSource:S}}function A(t,e){let n=f(t,e).match;if(!n)return{ok:!1,reason:`${e} does not resolve to an indexed symbol.`};let s=t.get("SELECT kind FROM global_symbols WHERE id = ?",n.symbolId)?.kind??null;if(!(s!==null?C.has(s):b(n.symbol)))return{ok:!1,reason:`${e} resolves to ${u(n.symbol)}${s!==null?` with SCIP kind ${h(s)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!y(t,n))return{ok:!1,reason:`${e} (${u(n.symbol)} at ${n.relativePath}:${n.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let i=t.get("SELECT documentation FROM global_symbols WHERE id = ?",n.symbolId),o=p(g(i?.documentation??null));return{ok:!0,symbol:{ref:e,symbol:n.symbol,shortName:m(n.symbol)||u(n.symbol),file:n.relativePath,startLine:n.startLine,signature:o,paramCount:o?E(o):null}}}function E(t){let e=t.indexOf("(");if(e===-1)return null;let a=0,n=-1;for(let i=e;i<t.length;i+=1){let o=t[i];if(o==="(")a+=1;else if(o===")"&&(a-=1,a===0)){n=i;break}}if(n===-1)return null;let l=t.slice(e+1,n).trim();if(!l)return 0;let s=1,r=0;for(let i of l)i==="("||i==="["||i==="{"?r+=1:i===")"||i==="]"||i==="}"?r=Math.max(0,r-1):i===","&&r===0&&(s+=1);return s}function T(t,e,a){let n=$(e),l=v(t,a),r=x(n,l).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function N(t,e,a,n,l){let s=T(a,n,t.file),r=T(a,n,e.file),i=l===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":l?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
2
|
* Generated by 'codebaseiq twin-ab'. Cleanup integrity scenario.
|
|
3
3
|
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
4
|
* more than one place, feed both the same input and require the same
|
|
@@ -37,4 +37,4 @@ describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${e.shortName}'
|
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
`}export{R as a,P as b};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-YBDLHFZZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-6CTSFS7R.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-YI3CJPOY.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{G as W,H as $,K as R,S as J,U as K,a as S,aa as q,g as m,h as b,ha as U,i as A,j as G}from"./chunk-6I55VYFG.js";import{createRequire as le}from"module";import{existsSync as ue,readdirSync as pe,statSync as fe}from"fs";import u from"path";import{AsyncLocalStorage as ae}from"async_hooks";var ce=new ae;function j(e,t){let n=C(e);if(!n||n.missing.has(t))return;let r=n.files.get(t);if(r)return r;let i=n.readBaseFile?.(t);return i&&n.files.set(t,i),i}function F(e,t){let n=C(e);if(n)return n.missing.has(t)?"missing":n.paths.includes(t)?"present":"missing"}function X(e,t){return C(e)?.fingerprints.get(t)}function P(e){return C(e)?.paths}function C(e){let t=ce.getStore();if(t)return t.projectRoot===U(e)?t:void 0}var ge=le(import.meta.url),Y=new Set([".cache",".git",".next",".nuxt",".turbo",".nx","build","coverage","dist","node_modules","tmp","vendor"]);function de(e,t=[]){let n=u.resolve(e),r=t.flatMap(s=>me(n,s));if(r.length>0)return Q(n,Z(r));let i=he(n),o=Z(i),c=ye(n,o)?[n,...o]:o,a=c.length>0?c:[n];return Q(n,a)}function ee(e,t,n=[]){let r;try{r=ge("ts-morph")}catch{return null}let i=u.resolve(e),o=t==="workspace"?de(i,n):["."],c=new Set;for(let a of o){let s=a==="."?i:u.join(i,a),l=u.join(s,"tsconfig.json"),p=Fe(r.ts,i);if(!p.fileExists(l))return null;let g=r.ts.readConfigFile(l,p.readFile);if(g.error)return null;let f=r.ts.parseJsonConfigFileContent(g.config,p,s);if(f.errors.length>0)return null;for(let h of f.fileNames){let d=u.resolve(h);m(i,d)&&c.add(u.relative(i,d).split(u.sep).join("/"))}}return c}function Q(e,t){return[...new Set(t.map(n=>x(e,n)))].sort((n,r)=>n.localeCompare(r))}function he(e){let t=P(e);if(t)return t.flatMap(i=>{if(i.split("/").some(c=>Y.has(c)))return[];let o=u.join(e,...i.split("/"));return V(e,o)?[u.dirname(o)]:[]});let n=[],r=[e];for(;r.length>0;){let i=r.pop(),o;try{o=pe(i,{withFileTypes:!0})}catch{continue}for(let c of o){let a=u.join(i,c.name);if(c.isDirectory()){!Y.has(c.name)&&!c.name.startsWith(".")&&r.push(a);continue}c.isFile()&&V(e,a)&&n.push(u.dirname(a))}}return n}function me(e,t){let n=t.trim();if(!n)return[];let r=u.resolve(e,n);if(!m(e,r))return[];let i=P(e);if(i){let o=x(e,r);if(i.includes(o)&&M(u.basename(r)))return[u.dirname(r)];let c=o==="."?"":`${o}/`;return i.some(a=>a.startsWith(c))?[r]:[]}try{let o=fe(r);if(o.isDirectory())return[r];if(o.isFile()&&M(u.basename(r)))return[u.dirname(r)]}catch{return[]}return[]}function V(e,t){if(!M(u.basename(t)))return!1;let n=te(e,t);return n?u.basename(t)==="tsconfig.json"||"include"in n||"files"in n||"references"in n:!1}function M(e){return e.startsWith("tsconfig")&&e.endsWith(".json")}function Z(e){let t=[...new Set(e.map(n=>u.resolve(n)))].sort((n,r)=>n.localeCompare(r));return t.length<=1?t:t.filter(n=>!t.some(r=>r!==n&&xe(n,r)))}function ye(e,t){if(t.length===0||t.some(r=>u.resolve(r)===e))return!1;let n=u.join(e,"tsconfig.json");return Pe(e,n)&&Se(e,n)}function Se(e,t){let r=te(e,t)?.include;return Array.isArray(r)?r.some(i=>typeof i=="string"&&i.trim()!==""&&!i.startsWith("!")&&(i.includes("/")||i.includes("**")||!u.extname(i))):!1}function te(e,t){try{let n=JSON.parse(je(e,t));return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function Pe(e,t){let n=x(e,t),r=F(e,n);return r?r==="present":ue(t)}function je(e,t){let n=x(e,t);if(P(e)){let i=j(e,n);if(!i)throw Object.assign(new Error(`Snapshot file ${n} is missing.`),{code:"ENOENT"});return i.content.toString("utf8")}return $(t,"TypeScript project config")}function Fe(e,t){let n=P(t);if(!n)return e.sys;let r=u.resolve(t),i=new Set(n),o=be(r,n),c=e,a=s=>{let l=u.resolve(s);return m(r,l)?x(r,l):null};return{useCaseSensitiveFileNames:e.sys.useCaseSensitiveFileNames,fileExists(s){let l=a(s);return l===null?e.sys.fileExists(s):i.has(l)},readFile(s){let l=a(s);return l===null?e.sys.readFile(s):j(r,l)?.content.toString("utf8")},readDirectory(s,l,p,g,f){let h=u.resolve(s);return m(r,h)?c.matchFiles(h,l,p,g,e.sys.useCaseSensitiveFileNames,r,f,d=>o.get(u.resolve(d))??{files:[],directories:[]},d=>d):e.sys.readDirectory(s,l,p,g,f)}}}function be(e,t){let n=new Map,r=new Map,i=o=>{n.has(o)||n.set(o,new Set),r.has(o)||r.set(o,new Set)};i(e);for(let o of t){let c=o.split("/"),a=e;for(let s=0;s<c.length-1;s+=1){let l=c[s];i(a),r.get(a).add(l),a=u.join(a,l),i(a)}n.get(a).add(c.at(-1))}return new Map([...n].map(([o,c])=>[o,{files:[...c].sort(),directories:[...r.get(o)??[]].sort()}]))}function x(e,t){let n=u.relative(e,t);return n?n.split(u.sep).join("/"):"."}function xe(e,t){let n=u.relative(e,t);return!!n&&!n.startsWith("..")&&!u.isAbsolute(n)}import{execFileSync as De}from"child_process";import{createHash as re}from"crypto";import{closeSync as _e,fstatSync as ie,lstatSync as N,openSync as He,readdirSync as Le,readFileSync as Ae,readlinkSync as Ge,realpathSync as I}from"fs";import{isAbsolute as We,join as D,relative as $e,resolve as Re,sep as Je}from"path";import{execFileSync as k}from"child_process";import{createHash as ve}from"crypto";import{mkdirSync as we,renameSync as Ce,writeFileSync as ze}from"fs";import{basename as Ie,dirname as Te,join as Ee}from"path";var Oe="git-content-hashes.json",Me=32*1024*1024,ke=2e5,z=3e4;function B(){return{env:q(),encoding:"utf8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:z,killSignal:"SIGKILL"}}function ne(e){let t,n;try{t=k("git",["-C",e,"ls-files","-s","-z","--","."],{...B(),timeout:z}),n=k("git",["-C",e,"status","--porcelain=v1","-z","--untracked-files=all","--no-renames","--","."],{...B(),timeout:z})}catch{return null}let r=new Map,i=[];for(let p of t.split("\0")){if(!p)continue;let g=p.indexOf(" "),f=g>0?p.slice(0,g).split(" "):[];if(f.length!==3)continue;let[h,d,w]=f,y=p.slice(g+1);if(h!=="100644"&&h!=="100755"||w!=="0"){r.delete(y);continue}r.set(y,d),Ie(y)===".gitattributes"&&i.push(`${y}:${d}`)}let o=new Set;for(let p of n.split("\0"))p.length>=4&&p[2]===" "&&o.add(p.slice(3));let c=Be(e,i),a=Ee(K(e),Oe),s=Ne(a,c),l=new Map;return{lookup(p){if(o.has(p))return;let g=r.get(p);if(g)return l.get(g)??s.entries[g]},seed(p,g){if(o.has(p))return;let f=r.get(p);!f||s.entries[f]||l.has(f)||l.set(f,g)},persist(){if(l.size===0||J())return;let p=new Set(r.values()),g={};for(let[f,h]of Object.entries(s.entries))p.has(f)&&(g[f]=h);for(let[f,h]of l)g[f]=h;if(!(Object.keys(g).length>ke))try{we(Te(a),{recursive:!0});let f=`${a}.${process.pid}.tmp`;ze(f,JSON.stringify({version:1,salt:c,entries:g})),Ce(f,a)}catch{}}}}function Be(e,t){let n="";try{n=k("git",["-C",e,"config","--get-regexp","^core\\.(autocrlf|eol|safecrlf)$"],{...B(),timeout:z})}catch{}return ve("sha256").update(JSON.stringify([n.trim(),t.sort()])).digest("hex")}function Ne(e,t){let n={version:1,salt:t,entries:{}};try{let r=W(e,{maxBytes:Me,inputKind:"git-content-hash-store"}),i=JSON.parse(r);if(i.version!==1||i.salt!==t||!i.entries||typeof i.entries!="object")return n;let o={};for(let[c,a]of Object.entries(i.entries))/^[0-9a-f]{40,64}$/.test(c)&&a&&typeof a.size=="number"&&Number.isInteger(a.size)&&a.size>=0&&typeof a.hash=="string"&&/^[0-9a-f]{64}$/.test(a.hash)&&(o[c]={size:a.size,hash:a.hash});return{version:1,salt:t,entries:o}}catch{return n}}var T=64*1024*1024,v=class extends Error{constructor(n,r,i,o){super(`${n} ${JSON.stringify(r)} is ${i} bytes; the safety limit is ${o} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=i;this.limitBytes=o;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="CODEBASEIQ_INPUT_TOO_LARGE"};function Ke(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function se(e,t,n={}){let r=b(t),i=I(e),o=Re(i,...r.split("/"));if(!m(i,o)||o===i)throw new S(t,"outside-project");let c=I(o);if(!m(i,c)||c===i)throw new S(t,"outside-project");let a=N(c);if(!a.isFile())throw new S(t,"not-a-file");let s={projectRoot:i,relativePath:r,absolutePath:c,size:a.size,mtimeMs:a.mtimeMs,device:a.dev,inode:a.ino},l=n.maxBytes??T;if(oe(l),s.size>l)throw new v(n.inputKind??"project file",s.relativePath,s.size,l);return s}function qe(e,t,n={}){let r=b(t),i=F(e,r);if(i){if(i==="missing")throw Object.assign(new Error(`Snapshot project file ${JSON.stringify(r)} does not exist.`),{code:"ENOENT"});let s=j(e,r);if(!s)throw new S(r,"changed-during-read");let l=n.maxBytes??T;if(oe(l),s.size>l)throw new v(n.inputKind??"project file",r,s.size,l);return Buffer.from(s.content)}let o=se(e,t,n),c=n.maxBytes??T,a=He(o.absolutePath,"r");try{let s=ie(a);if(!s.isFile()||s.dev!==o.device||s.ino!==o.inode||s.size!==o.size)throw new S(t,"changed-during-read");if(s.size>c)throw new v(n.inputKind??"project file",o.relativePath,s.size,c);let l=Ae(a),p=ie(a);if(p.dev!==s.dev||p.ino!==s.ino||p.size!==s.size||l.byteLength!==s.size)throw new S(t,"changed-during-read");return l}finally{_e(a)}}function Mt(e,t,n={}){return qe(e,t,n).toString("utf8")}function _(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function kt(e,t){try{return se(e,t),!0}catch(n){if(_(n))return!1;throw n}}function oe(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function Ue(e){return(P(e)??et(e)??tt(e)).filter(t=>t&&!H(t)).sort()}function Xe(e,t={}){let n=(t.includePaths??[]).map(b),r=[...new Set([...Ue(e),...n])].filter(s=>!H(s)).filter(s=>!t.language||G(s,t.language,t.markerFiles)).filter(s=>!t.includePath||t.includePath(s)).sort(),i=I(e),o,c=()=>o??=ne(i),a=r.flatMap(s=>{let l=X(e,s);if(l)return[{path:s,size:l.fingerprintSize??l.size,hash:l.sha256}];let p=F(e,s);if(p==="present"){let d=j(e,s);if(d)return[{path:s,size:d.fingerprintSize??d.size,hash:d.sha256}]}let g=p===void 0?c():null,f=g?.lookup(s);if(f)return[{path:s,size:f.size,hash:f.hash}];let h=D(e,s);try{if(N(h).isSymbolicLink()){let E=I(h),O=$e(i,E);if(O===".."||O.startsWith(`..${Je}`)||We(O))throw new Error("external symlink");let L=Ge(h);return[{path:s,size:Buffer.byteLength(L),hash:re("sha256").update("symlink\0").update(L).digest("hex")}]}let d=re("sha256"),w=R(h,{inputKind:"project fingerprint input",maxBytes:T},E=>d.update(E)),y=d.digest("hex");return g?.seed(s,{size:w,hash:y}),[{path:s,size:w,hash:y}]}catch(d){return _(d)?[]:[{path:s,size:-1,hash:"unreadable"}]}});return o?.persist(),a}function Bt(e,t,n){let r=Ve(t,n),i=[...r.typescriptProjects.filter(c=>Qe(e,c)),...r.clojureConfigPath?[r.clojureConfigPath]:[]],o=r.languages.includes("typescript")?ee(e,r.typescriptProjectMode,r.typescriptProjects):null;return{...r,files:Xe(e,{includePath:c=>{let a=A(c,t,i);return a==="other"?!1:a!=="source"||!Ye(c)||!o?!0:o.has(c)},includePaths:i})}}function Ye(e){return/\.(?:[cm]?[jt]sx?|vue)$/iu.test(e)}function Qe(e,t){let n;try{n=b(t)}catch{return!1}let r=F(e,n);if(r)return r==="present";try{return N(D(e,n)).isFile()}catch(i){if(_(i))return!1;throw i}}function Ve(e,t){return{version:3,languages:[...e].sort(),pnpmWorkspaces:t.typescriptProjectMode!=="workspace"&&t.pnpmWorkspaces===!0,typescriptProjectMode:t.typescriptProjectMode??"single",typescriptProjects:Ke(t.typescriptProjects),clojureConfigPath:Ze(t.clojureConfigPath)}}function Ze(e){return e?.trim()||void 0}function et(e){try{return De("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
2
|
+
`).filter(Boolean)}catch{return null}}function tt(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),i=r?D(e,r):e,o;try{o=Le(i,{withFileTypes:!0})}catch{continue}for(let c of o){let a=r?`${r}/${c.name}`:c.name;if(c.isDirectory()){H(a)||n.push(a);continue}t.push(a)}}return t}function H(e){let t=e.split("/");return e==="meta.json"||t[0]===".codebaseiq"&&(t[1]==="events"||t[1]==="ledger"||t[1]==="releases"||t[1]==="suppressions")||t.some(n=>nt.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var nt=new Set([".git","node_modules",".codebaseiq-cache",".codebaseiq-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{de as a,v as b,Ke as c,se as d,qe as e,Mt as f,_ as g,kt as h,Ue as i,Xe as j,Bt as k,Ve as l};
|
|
3
|
+
//# sourceMappingURL=chunk-YMAGXBLT.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R,b as F}from"./chunk-IRQOAM5G.js";import{a as k,b as C,c as V,e as o,f as v}from"./chunk-OTOKVOJ3.js";import{a as B,b as g}from"./chunk-NMTSZXCL.js";import{M as y}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R,b as F}from"./chunk-IRQOAM5G.js";import{a as k,b as C,c as V,e as o,f as v}from"./chunk-OTOKVOJ3.js";import{a as B,b as g}from"./chunk-NMTSZXCL.js";import{M as y}from"./chunk-NRNVMB2R.js";function j(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:t=6,limit:i=20,scope:l,scanLimit:c,filePattern:d,focusFiles:h}=s,u=y(e).vueProfiles({scope:l,minBehaviorTokens:Math.max(3,t),scanLimit:c}).map(r=>({file:r.file,tokens:r.behaviorTokens,profile:r})),n=R(u,r=>r.tokens);return F({profiles:u,limit:i,filePattern:d,focusFiles:h,candidateIndex:n,profile:{name:"vue-composable-candidates"},compare:(r,a)=>T(r,a,m,t),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.fileB.localeCompare(a.fileB)})}function T(e,s,m,t){let i=B(e.tokens,s.tokens);if(i.size<t||!P(i))return null;let l=C(e.tokens,s.tokens);if(l<m)return null;let c=o(i,"composable:"),d=o(i,"store:"),h=o(i,"reactivity:"),u=o(i,"lifecycle:"),n=o(i,"request:"),r=o(i,"function:"),a=o(i,"function-verb:"),b=o(i,"template-binding:"),p=o(i,"template-event:"),f=q({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:n,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:l,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:v(i),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:n,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b,sharedTemplateEvents:p,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:v(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:v(g(s.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:n,sharedLifecycle:u,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function q(e){return k({genericWords:A,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e){let s=0,m=0,t=0,i=0,l=0,c=0,d=0;for(let n of e)n.startsWith("composable:")?s+=1:n.startsWith("store:")?m+=1:n.startsWith("request:")?t+=1:n.startsWith("lifecycle:")?i+=1:n.startsWith("function:")?l+=1:n.startsWith("reactivity:")?c+=1:(n.startsWith("function-verb:")||n.startsWith("template-binding:")||n.startsWith("template-event:"))&&(d+=1);let h=s+m,u=h+t+i+l+d;return V([{name:"requests",count:t},{name:"lifecycle",count:i},{name:"functions",count:l},{name:"reusableHooks",count:h},{name:"reactivity",count:c},{name:"namedBehavior",count:u}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{lifecycle:1,functions:2,namedBehavior:4},reason:"shared lifecycle workflow"},{min:{reusableHooks:2,requests:1,namedBehavior:5},reason:"shared reusable Vue hooks and requests"},{min:{reusableHooks:2,functions:2,namedBehavior:5},reason:"shared reusable Vue hooks and functions"},{min:{functions:2,reactivity:1,namedBehavior:4},reason:"shared reactive functions"}]).pass}function S(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var A=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{j as a};
|
|
2
|
+
//# sourceMappingURL=chunk-YRAGNEBZ.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{b as v}from"./chunk-74LRKLNC.js";import{e as s,fb as E,kb as V,lb as I}from"./chunk-DQZF7MP6.js";import{c as y}from"./chunk-XZEE23VG.js";import{D as S,t as h}from"./chunk-OSZ7PW5K.js";import{l as x,sa as w}from"./chunk-AZDY3EKD.js";var ce={defaultRole:"repository-observation"};function pe(e,n=[]){return{defaultRole:e,...n.length>0?{rules:n}:{}}}function k(e,n){for(let t of e.rules??[]){if(t.when.kind==="option-present"){let r=n.options[t.when.name];if(r!==void 0&&r!==!1)return t.role;continue}if((t.when.kind==="argument"?n.args[t.when.index]:n.options[t.when.name])===t.when.equals)return t.role}return e.defaultRole}function fe(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(n=>n.role)])]}function A(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}import{AsyncLocalStorage as z}from"async_hooks";var U=1,j=1;var F={policyId:"codebaseiq:unresolved-repository-policy",policyVersion:j,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function N(e){return{schemaVersion:U,origin:e.contract.origin,coverage:$(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:w(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??F,...e.contract.families?{families:e.contract.families}:{}}}function $(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}var W="codebaseiq-result";var G=1,Y=1,_=1,L=1;function M(e){let n=e.resultSchemaVersion??Y;if(!X(n))throw new Error("CLI result schema version must be a positive safe integer.");let{producerVersion:t,...o}=e;return{kind:W,schemaVersion:G,producer:{name:"codebaseiq",version:t},resultSchemaVersion:n,...o}}function J(e,n){return JSON.stringify(e,null,n?0:2)}function X(e){return Number.isSafeInteger(e)&&Number(e)>0}var P=Symbol("option-value-source"),T=new Map,D=new Map,B=new Map,H=new z;function Ie(e,n){return H.run(e,n)}function ke(e){T=new Map(e)}function Ae(e){D=new Map(e)}function Ne(e){B=new Map(e)}function m(e){return(...n)=>{let{args:t,opts:o}=le(n);S(r=>{v(r.generation.identity),e({db:r,args:t,opts:o})})}}function R(e,n){return m(t=>{let o=I(t.db,e,d(t.opts,"full"),{quiet:d(t.opts,"json")});n({...t,budget:o})})}function _e(e){return m(n=>c(n,e,{kind:"list"}))}function Le(e){return m(n=>c(n,e,{kind:"table",headers:e.headers,dashWidths:e.dashWidths}))}function Me(e){return m(n=>c(n,e,{kind:"grouped",key:e.key}))}function Z(e){return m(n=>b(n,e))}function Je(e){return Z({commandName:e.commandName,query:e.query,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(n,t)=>s.sectionedReport(e.sections(n,t)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}function ee(e,n){return R(e,t=>b(t,{...n,commandName:n.commandName??e}))}function Pe(e,n){return ee(e,{commandName:n.commandName??e,query:n.query,emptyMessage:n.emptyMessage,heuristicLabel:n.heuristicLabel,before:n.before,render:(t,o)=>s.sectionedReport(n.sections(t,o)),toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,after:n.after})}function Te(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"list"}))}function De(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"grouped",key:n.key}))}function Be(e,n){return String(e[n])}function He(e,n){let t=e[n];return typeof t=="string"?[t]:Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function Q(e,n){let t=e[n];return typeof t=="number"?t:void 0}function d(e,n){return!!e[n]}function Ke(e,n){let t=e[n];return Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Ue(e,n,t){return Q(e,n)??t}function je(e,n,t){let o=Q(e,n),r=o!==void 0&&ne(e,n)!=="default";if(d(e,"full")){if(r)throw new Error("--full cannot be combined with --limit. Use --full for all findings, or --limit N for a capped report.");return Number.MAX_SAFE_INTEGER}return o??t}function ne(e,n){return e[P]?.(n)}function c(e,n,t){b(e,{commandName:n.commandName,query:n.query,emptyMessage:(o,r)=>o.length===0&&n.emptyMessage?n.emptyMessage(r):void 0,heuristicLabel:n.heuristicLabel,render:(o,r)=>{t.kind==="list"?s.list(o,i=>n.format(i,r)):t.kind==="table"?s.table(t.headers,o.map(i=>n.format(i,r)),t.dashWidths):s.groupedByFile(o,i=>n.format(i,r),t.key?i=>t.key(i,r):void 0)},toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,before:n.before,after:n.after})}function b(e,n){let t=n.query(e);if(d(e.opts,"json")){if(!n.commandName)throw new Error("JSON output requires a command name so its result contract can be identified.");oe(n.commandName,e.args,e.opts,n.toJson?n.toJson(t,e):t,{analysisBudget:te(e),coverage:n.coverage?.(t,e),agentResult:n.agentResult?.(t,e),resultSchemaVersion:n.resultSchemaVersion});return}let o=n.emptyMessage?.(t,e);if(o){s.empty(o);return}n.heuristicLabel&&V(n.heuristicLabel),n.before?.(t,e),n.render(t,e),n.after?.(t,e)}function te(e){return e.budget?.analysisBudget}function oe(e,n,t,o,r={}){let i=T.get(e),a=D.get(e),u=B.get(e),p=a?k(a.operation,{args:n,options:t}):void 0,f=H.getStore();if(f!==void 0&&p!==void 0&&f!==p)throw new Error(`Command ${e} changed operation role during execution: selected ${f}, rendered ${p}.`);let g=f??p,O=de(o),C=r.coverage??ae(a,o,r.analysisBudget),l=C&&O&&!C.resolution?{...C,resolution:O}:C;if(l&&ie(l),d(t,"resultOnly")){let K=Object.hasOwn(r,"resultOnly")?r.resultOnly:o;y(JSON.stringify(K,null,d(t,"compact")?0:2));return}let q=M({producerVersion:x,command:e,...g?{operationRole:g}:{},...i?{evidence:i}:{},...r.analysisBudget?{analysisBudget:r.analysisBudget}:{},args:ue(n),options:t,result:o,...l?{coverage:l}:{},...r.agentResult!==void 0?{agentResult:r.agentResult}:{},...re(g,i,r.analysisBudget,l,u,r.observationReceipt),...r.resultSchemaVersion===void 0?{}:{resultSchemaVersion:r.resultSchemaVersion}});y(J(q,d(t,"compact")))}function re(e,n,t,o,r,i){if(!e||!A(e))return{};let a=h(),u=i??(a?E({projectRoot:a.config.projectRoot,db:a,...r?{observedSourceKinds:r.observedSources}:{}}):void 0);return u?{evidenceContext:{schemaVersion:_,operationRole:e,receipt:u,analysisManifest:{schemaVersion:L,...n?{evidence:n}:{},...t?{analysisBudget:t}:{},...o?{coverage:o}:{},...r?{claimQualification:N({contract:r,receipt:u,...o?{coverage:o}:{}})}:{}}}}:{}}function ie(e){if(!Number.isSafeInteger(e.returned)||e.returned<0)throw new Error("Invocation coverage returned count must be a non-negative safe integer.");if(e.complete!==!0&&e.complete!==!1&&e.complete!==null)throw new Error("Invocation coverage complete must be true, false, or null.");if(e.complete===!0){if(!e.totalKnown)throw new Error("Complete invocation coverage must know its total.");if(!Number.isSafeInteger(e.total)||e.total!==e.returned)throw new Error("Complete invocation coverage total must equal returned.");if(e.omitted!==0)throw new Error("Complete invocation coverage cannot omit results.");if(e.omittedIdentities!==void 0)throw new Error("Complete invocation coverage cannot name omitted identities.");if(e.continuation!==void 0)throw new Error("Complete invocation coverage cannot provide a continuation.")}else if(e.totalKnown){if(e.complete!==!1)throw new Error("Known incomplete invocation coverage must set complete to false.");if(!Number.isSafeInteger(e.total)||e.total<e.returned)throw new Error("Known invocation coverage total must be a safe integer at least as large as returned.");let n=e.total-e.returned;if(e.omitted!==n)throw new Error("Known invocation coverage omitted count must equal total minus returned.");if(n===0)throw new Error("Known incomplete invocation coverage must omit at least one result.");if(e.omittedIdentities&&e.omittedIdentities.length!==n)throw new Error("Omitted identity count must equal the disclosed omitted count.")}else{if(e.total!==void 0||e.omitted!==void 0)throw new Error("Unknown invocation coverage cannot claim a total or omitted count.");if(e.omittedIdentities!==void 0)throw new Error("Unknown invocation coverage cannot claim omitted identities.")}if(e.continuation&&(e.continuation.cursor.length===0||e.continuation.indexGeneration.length===0))throw new Error("Invocation coverage continuation requires a cursor and index generation.");if(e.resolution){if(!Number.isSafeInteger(e.resolution.totalCandidates)||e.resolution.totalCandidates<0)throw new Error("Invocation resolution candidate count must be a non-negative safe integer.");if(e.resolution.state==="exact"&&e.resolution.totalCandidates!==1)throw new Error("Exact invocation resolution must name exactly one candidate.");if(e.resolution.state==="missing"&&e.resolution.totalCandidates!==0)throw new Error("Missing invocation resolution cannot name candidates.");if(e.resolution.state==="ambiguous"&&e.resolution.totalCandidates<2)throw new Error("Ambiguous invocation resolution must name at least two candidates.")}}function ae(e,n,t){if(!e)return;let o=se(e,n);return e.coverage==="complete"?{complete:!0,totalKnown:!0,returned:o,total:o,omitted:0}:e.coverage==="sampled"?{complete:!1,totalKnown:!1,returned:o}:e.coverage==="bounded"&&t?{complete:!1,totalKnown:!1,returned:o}:{complete:null,totalKnown:!1,returned:o}}function se(e,n){let t=e.resultUnits??{kind:"report"};if(t.kind==="rows")return Array.isArray(n)?n.length:0;if(t.kind==="field"){if(!n||typeof n!="object")return 0;let o=n[t.field];return Array.isArray(o)?o.length:o==null?0:1}return n==null?0:1}function de(e){if(!e||typeof e!="object"||Array.isArray(e))return;let n=e;if(n.matched===!1)return{state:"missing",totalCandidates:0};if(n.matched!==!0||!Number.isSafeInteger(n.totalMatches))return;let t=n.totalMatches;return t<=0?{state:"missing",totalCandidates:0}:t===1?{state:"exact",totalCandidates:t}:{state:"ambiguous",totalCandidates:t}}function ue(e){return e.filter(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean")}function le(e){if(e.length===0)return{args:[],opts:{}};let n=e[e.length-1];return{args:e.slice(0,-1),opts:me(n)}}function me(e){if(!e||typeof e!="object")return{};let n=e,t=typeof n.optsWithGlobals=="function"?n.optsWithGlobals.bind(n):typeof n.opts=="function"?n.opts.bind(n):null;if(t){let o=t();return!o||typeof o!="object"?{}:(typeof n.getOptionValueSource=="function"&&Object.defineProperty(o,P,{value:r=>n.getOptionValueSource(r),enumerable:!1}),o)}return e}export{ce as a,pe as b,k as c,fe as d,Ie as e,ke as f,Ae as g,Ne as h,m as i,R as j,_e as k,Le as l,Me as m,Z as n,Je as o,ee as p,Pe as q,Te as r,De as s,Be as t,He as u,Qe as v,qe as w,Q as x,d as y,Ke as z,Ue as A,je as B,ne as C,oe as D,le as E,me as F};
|
|
3
|
+
//# sourceMappingURL=chunk-YXZAAQHZ.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var r="CODEBASEIQ_READ_ONLY",t="CODEBASEIQ_ALLOW_STALE";function n(o=process.env){let e=o[r]?.trim().toLowerCase();return e==="1"||e==="true"}function s(o=process.env){let e=o[t]?.trim().toLowerCase();return e==="1"||e==="true"||n(o)}export{r as a,n as b,s as c};
|
|
3
|
+
//# sourceMappingURL=chunk-Z2L5H2HF.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-ETZBIG6K.js";import{f as d}from"./chunk-2QJAVISG.js";import{d as r,u as a}from"./chunk-TNLOX4TN.js";function b(e,i={}){return f(e,i).rows}function f(e,i={}){let{limit:l=30,scope:t}=i,n=t?"AND def_d.relative_path LIKE ?":"",c=t?[`%${t}%`]:[],o=e.all(`SELECT
|
|
2
2
|
gs.symbol,
|
|
3
3
|
COUNT(*) AS ref_count,
|
|
4
4
|
COUNT(DISTINCT ref_d.id) AS file_count,
|
|
@@ -23,4 +23,4 @@ import{a as u}from"./chunk-57OPIQFM.js";import{f as d}from"./chunk-MSI3K7PJ.js";
|
|
|
23
23
|
GROUP BY gs.id
|
|
24
24
|
ORDER BY ref_count DESC
|
|
25
25
|
LIMIT ?`,...c,l).filter(s=>!e.isIgnored(s.defined_in)).map(s=>({symbol:s.symbol,shortName:r(s.symbol),refCount:s.ref_count,fileCount:s.file_count,definedIn:s.defined_in,basis:"scip-cross-file-mentions",countUnit:"reference-occurrences"}));return o.length>0?{rows:o,coverage:{semanticEvidence:{enabled:!1,status:"disabled",incompleteSymbolCount:0,unavailableSymbolCount:0}}}:p(e,t,l)}function I(e,i={}){return b(e,i)}function p(e,i,l){let t=a(e,{scope:i}).filter(o=>!e.isIgnored(o.relativePath)),n=d(e,t,{limit:500,semanticEvidence:u}),c=t.filter(o=>!n.incompleteSymbolIds.has(o.symbolId)&&!n.unavailableSymbolIds.has(o.symbolId)).map(o=>y(o,n.rows.get(o.symbolId)??[])).filter(o=>o.refCount>0).sort((o,s)=>s.refCount-o.refCount||s.fileCount-o.fileCount).slice(0,l),m=n.incompleteSymbolIds.size>0&&n.unavailableSymbolIds.size>0?"incomplete-and-unavailable":n.incompleteSymbolIds.size>0?"incomplete":n.unavailableSymbolIds.size>0?"unavailable":"complete";return{rows:c,coverage:{semanticEvidence:{enabled:!0,status:m,incompleteSymbolCount:n.incompleteSymbolIds.size,unavailableSymbolCount:n.unavailableSymbolIds.size}}}}function y(e,i){let l=i.filter(t=>t.file!==e.relativePath);return{symbol:e.symbol,shortName:r(e.symbol),refCount:l.length,fileCount:new Set(l.map(t=>t.file)).size,definedIn:e.relativePath,basis:"source-backed-incoming-evidence",countUnit:"distinct-incoming-evidence-rows"}}export{b as a,f as b,I as c};
|
|
26
|
-
//# sourceMappingURL=chunk-
|
|
26
|
+
//# sourceMappingURL=chunk-ZHK7TVAJ.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{B as K,x as U}from"./chunk-75VNTSO6.js";import{I as q,L as V,Q as L,R as G,d as O,n as M,o as $,q as N,r as j}from"./chunk-E7T22WET.js";import{g as T}from"./chunk-EDMG5CSO.js";import{c as F,u as b,v as W,x,y as B}from"./chunk-3F23W57G.js";import{i as A}from"./chunk-R2NOK63J.js";import{Q as w,aa as D,h as m,la as _}from"./chunk-C3PPB2T5.js";import{existsSync as S,statSync as Re}from"fs";import{join as Ee}from"path";import{existsSync as H}from"fs";function Y(e,t,n){let r=new Date().toISOString();if(!H(n.dbPath))return{state:"missing",checkedAt:r,metaPath:n.metaPath,reason:"No SQLite index database exists.",remedy:"Run: codebaseiq reindex"};if(!H(n.metaPath))return{state:"unknown",checkedAt:r,metaPath:n.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: codebaseiq reindex"};try{let o=O(m(n.metaPath,"reindex metadata"));if(o.kind==="unsupported")return{state:"unknown",checkedAt:r,metaPath:n.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:n.metaPath,reason:`Could not decode reindex metadata: ${o.reason}`,remedy:"Run: codebaseiq reindex"};let i=o.metadata,s=t.languages??j(e),d=pe(e,s,t),c=[...i.indexedLanguages??[]].sort(),a=o.capabilities.publishableGeneration&&JSON.stringify(i.fingerprint)===JSON.stringify(d)&&JSON.stringify(c)===JSON.stringify(d.languages),p=q(n.dbPath,n.metaPath),v=p.state==="invalid"||p.state==="drifted",y=a&&!v,k=y?void 0:ce(i.fingerprint,d);return{state:y?"fresh":"stale",checkedAt:r,metaPath:n.metaPath,updatedAt:i.updatedAt,lastRefresh:i.lastRefresh,...k?{changedFiles:k}:{},reason:v?`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:n.metaPath,reason:`Could not read reindex metadata: ${o instanceof Error?o.message:String(o)}`,remedy:"Run: codebaseiq reindex"}}}function ce(e,t){let n=e?.files;if(!Array.isArray(n))return;let r=new Map;for(let i of n)typeof i?.path=="string"&&r.set(i.path,`${String(i.size)}:${String(i.hash)}`);let o=new Set;for(let i of t.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,Q,l=null;function Ge(e){g=!0,Q=e?{headCommit:e.headCommit,treeOid:e.treeOid,clean:e.clean}:void 0,l=null}function We(){g=!1,Q=void 0,l=null}function Be(){l=null}function pe(e,t,n){let r=g?ue(e,t,n):null;if(r&&l?.key===r)return l.value;let o=0,i=A("freshness.fingerprint",()=>{let s=_(e,t,X(n));return o=s.files.length,s},()=>({files:o,memoScope:g}));return r&&(l={key:r,value:i}),i}function X(e){return{pnpmWorkspaces:e.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:e.indexer?.typescript?.projectMode,typescriptProjects:e.indexer?.typescript?.projects,clojureConfigPath:e.indexer?.clojure?.configPath}}function ue(e,t,n){return JSON.stringify([D(e),[...t].sort(),X(n)])}var P=20,z;function Ue(e){z=e}function Ke(){return z}function He(e){let t=[...e.changedFiles??[]],n=new Map(t.map(s=>[s,[s,s.replaceAll("/","\\")]])),r=Math.max(0,...t.map(s=>s.length)),o=new Set,i="";return{observe(s){if(t.length===0)return;let d=i+s;for(let[c,a]of n)!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; ${t.length} file(s) changed since then.`);let c=t.filter(p=>o.has(p)),a=t.filter(p=>!o.has(p));c.length>0&&s.push(` Stale results: these cited files changed after indexing: ${J(c)}`),a.length>0&&s.push(` Changed files this result does not cite (callers or references in them may be missing): ${J(a)}`)}return s.push(" Exact evidence for changed files needs: codebaseiq reindex"),`${s.join(`
|
|
2
|
+
`)}
|
|
3
|
+
`}}}function J(e){let t=e.slice(0,P).join(", ");return e.length>P?`${t} (+${e.length-P} more)`:t}import{join as le}from"path";var Z=4,fe=2,me="typescript-semantic";function et(e){let t=le(e,me),n=W(t);return{...n,requestDir:n.legacyRequestDir}}function te(e){return M(e)}function tt(e){let t=JSON.parse(e),n=t.protocolVersion,r=n===fe;if(!r&&n!==Z||typeof t.id!="string"||typeof t.generation!="string"||typeof t.deadlineAtMs!="number"||!Number.isFinite(t.deadlineAtMs)||t.profileEnvironment!==void 0&&!F(t.profileEnvironment)||!t.request||!ge(t.request)||!r&&(t.mailboxVersion!==b||typeof t.operationKey!="string"||!/^[a-f0-9]{64}$/.test(t.operationKey)||t.id!==B(t.operationKey)||typeof t.clientId!="string"||!t.clientId||typeof t.enqueuedAtMs!="number"||!Number.isFinite(t.enqueuedAtMs)||t.deadlineAtMs<t.enqueuedAtMs))throw new Error("TypeScript semantic service received an invalid mailbox request.");if(!r){let i=t,s=x("typescript-semantic-v4",{generation:i.generation,profileEnvironment:i.profileEnvironment,request:i.request});if(i.operationKey!==s)throw new Error("TypeScript semantic service received a mismatched mailbox operation identity.");return i}let o=x("typescript-semantic-v2",{id:t.id,generation:t.generation,request:t.request});return{protocolVersion:Z,mailboxVersion:b,id:t.id,operationKey:o,clientId:"legacy-v2",enqueuedAtMs:t.deadlineAtMs,deadlineAtMs:t.deadlineAtMs,generation:t.generation,...t.profileEnvironment?{profileEnvironment:t.profileEnvironment}:{},request:t.request}}function ge(e){if(!e||typeof e!="object"||!("kind"in e))return!1;let t=e;switch(t.kind){case"availability":return!0;case"import-usage":return typeof t.file=="string";case"reference-fragments":return N(t.files)!==null;case"references":return ee(t.definitions)&&(t.exact===void 0||typeof t.exact=="boolean");case"callees":return ee(t.definitions);case"signature":return ne(t.definition);default:return!1}}function ee(e){return Array.isArray(e)&&e.every(ne)}function ne(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.symbolId=="number"&&typeof t.documentId=="number"&&typeof t.symbol=="string"&&typeof t.relativePath=="string"&&typeof t.leaf=="string"&&typeof t.startLine=="number"&&typeof t.endLine=="number"}import{existsSync as he,readdirSync as Se}from"fs";import{createHash as ye}from"crypto";import{join as R}from"path";function I(e){let t=0,n=0,r=0,o=0,i=0,s=[];for(let a of e)switch(a.state){case"legacy":t+=1;break;case"current":n+=1;break;case"unsupported-older":r+=1,s.push(C(a));break;case"unsupported-future":o+=1,s.push(C(a));break;case"malformed":i+=1,s.push(C(a));break}let d=t+n,c=r+o+i;return{complete:c===0,total:e.length,accepted:d,legacy:t,current:n,unsupportedOlder:r,unsupportedFuture:o,malformed:i,omitted:c,issues:s}}function C(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 oe=R(".codebaseiq","suppressions"),re="codebaseiq-suppression",ie=1,h=2;function be(e){return R(e,oe)}function xe(e){if(e.id&&e.id.trim()!=="")return`${e.id.trim()}.json`;let t=`${e.check??""}\0${e.file??""}`;return`CHECK-${ye("sha256").update(t).digest("hex").slice(0,12).toUpperCase()}.json`}function Pe(e){return xe(e).slice(0,-5)}function Ce(e,t){if(typeof e!="object"||e===null||Array.isArray(e))return{state:"malformed",error:"not a suppression object"};let n=e;if(n.schemaVersion===void 0&&(n.kind!==void 0||n.suppressionIdentity!==void 0||n.writer!==void 0))return{state:"malformed",error:"suppression envelope metadata requires schemaVersion"};if(n.schemaVersion!==void 0){if(!Number.isSafeInteger(n.schemaVersion))return{state:"malformed",error:"schemaVersion must be a positive safe integer"};if(n.schemaVersion!==ie&&n.schemaVersion!==h)return{state:n.schemaVersion>h?"unsupported-future":"unsupported-older",error:`unsupported schemaVersion ${String(n.schemaVersion)}`};if(n.kind!==void 0&&n.kind!==re)return{state:"malformed",error:`kind must be ${re}`}}if(n.schemaVersion===ie&&n.decision!==void 0)return{state:"malformed",error:"schemaVersion 1 cannot carry automated adjudication metadata"};if(n.schemaVersion===h&&!U(n.decision))return{state:"malformed",error:"schemaVersion 2 requires a valid automated adjudication decision"};if(typeof n.reason!="string"||n.reason.trim()==="")return{state:"malformed",error:"missing reason"};if(!n.id&&!n.check)return{state:"malformed",error:"needs an id or a check"};let r=Ie(n);if(n.schemaVersion===void 0)return{state:"legacy",suppression:r,record:n,schemaVersion:0};let o=Pe(r);return n.suppressionIdentity!==o||t!==void 0&&n.suppressionIdentity!==t?{state:"malformed",error:"suppressionIdentity does not match the suppression target or filename"}:!n.writer||n.writer.tool!=="codebaseiq"||typeof n.writer.version!="string"||n.writer.version.trim()===""?{state:"malformed",error:"missing valid writer metadata"}:typeof n.createdAt!="string"||!Number.isFinite(Date.parse(n.createdAt))?{state:"malformed",error:"missing valid createdAt timestamp"}:n.updatedAt!==void 0&&(typeof n.updatedAt!="string"||!Number.isFinite(Date.parse(n.updatedAt)))?{state:"malformed",error:"invalid updatedAt timestamp"}:{state:n.schemaVersion===h?"current":"legacy",suppression:r,record:n,schemaVersion:n.schemaVersion}}function se(e){let t=be(e);if(!he(t))return{suppressions:[],compatibility:I([]),warnings:[]};let n=[],r=[];for(let i of Se(t).sort()){if(!i.endsWith(".json"))continue;let s=R(t,i),d=`${oe}/${i}`,c;try{c=JSON.parse(m(s,"suppression record"))}catch{r.push({path:d,state:"malformed",reason:"malformed JSON"});continue}let a=Ce(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}),n.push(a.suppression)}let o=I(r);return{suppressions:n,compatibility:o,warnings:o.issues.map(i=>`${i.path}: ${i.reason} \u2014 ignored`)}}function Ie(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 ae(){return process.env.CODEBASEIQ_PROJECT_ROOT??process.cwd()}var f,u;function Pt(e){f=e}function Ct(){return u}function de(e=ae(),t=void 0){if(t===void 0&&f?.projectRoot===e&&!(f.dbPathSource==="root-fallback"&&S(f.paths.dbPath)))return f;let n=K(e),r=w(e,n),o=process.env.CODEBASEIQ_INDEX_DB;if(o)return{projectRoot:e,config:n,paths:r,dbPath:o,dbPathSource:"env",gitContext:t};if(S(r.dbPath))return{projectRoot:e,config:n,paths:r,dbPath:r.dbPath,dbPathSource:"configured",gitContext:t};let i=Ee(e,"index.db");return{projectRoot:e,config:n,paths:r,dbPath:i,dbPathSource:"root-fallback",rootFallbackWarning:we(i,r.dbPath),gitContext:t}}function It(e){return de(e).dbPath}function Rt(e,t,n,r={}){return S(n.dbPath)&&r.gitContext?.clean===!1&&r.watcherGeneration!==void 0&&te(n.dbPath)===r.watcherGeneration?G(e,t,n,r.gitContext):Y(e,t,n).state==="fresh"?{kind:"local-fresh"}:L(e,t,n,r.gitContext)}function ve(e){return!e.startsWith("__")&&!Fe.has(e)}function Et(e){return ve(e)&&!ke.has(e)}var ke=new Set(["reuse","hook-architecture-stop"]),Fe=new Set(["capabilities","check-deps","config-validate","doctor","init","install-skills","reindex","setup","setup-agent","status","suppress","uninstall","view","watch"]);function Oe(){return Ae(ae(),{warnOnRootFallback:!0})}function Ae(e,t={}){let{config:n,paths:r,dbPath:o,dbPathSource:i,rootFallbackWarning:s,gitContext:d}=de(e);if(!S(o))throw new Error("No index.db found. Run: codebaseiq reindex");t.warnOnRootFallback&&i==="root-fallback"&&s&&console.error(s);let c=se(e).suppressions,a={dbPath:o,indexPath:process.env.CODEBASEIQ_INDEX_SCIP??r.indexPath,projectRoot:e,collaborationDomainId:n.collaborationDomainId,sharedEvidenceDbPath:V(e,n,d),entryRoots:n.entryRoots,semantic:n.semantic,suppressions:[...n.suppressions??[],...c],declaredCouplings:n.declaredCouplings,locality:n.locality,architecture:n.architecture,coverageContracts:n.coverageContracts,docs:n.docs},p=T(e);return new $(a,p)}function we(e,t){let n="unknown time";try{n=Re(e).mtime.toISOString()}catch{}return`warning: using legacy project-root index.db (${e}, modified ${n}) because the configured index was not found at ${t}. This fallback may be stale; run 'codebaseiq reindex' to refresh the configured index.`}var E;function vt(e){E=e}function kt(e){if(E){let r=E(),o=u;u=r;try{return e(r)}finally{u=o}}let t=Oe(),n=u;u=t;try{return e(t)}finally{u=n,t.close()}}function Ft(e,t){return t.concat([e])}function De(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 Ot(e){switch(e.state){case"idle":return"Watching (idle)";case"waiting":{let t=Math.round((e.reindexAt-Date.now())/1e3);return`${e.changedFiles} file(s) changed, reindexing in ${t}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, ${De(e.estimatedWriteBytes)} estimated writes)${e.dirty?" \u2014 changes pending":""}`;case"draining":return`Stopping safely \u2014 ${e.reason}`;default:return _e(e)}}function _e(e){throw new Error(`Unhandled watcher status: ${JSON.stringify(e)}`)}export{Y as a,Ge as b,We as c,Be as d,Ue as e,Ke as f,He as g,Z as h,et as i,te as j,tt as k,re as l,ie as m,h as n,be as o,xe as p,Pe as q,Ce as r,se as s,ae as t,Pt as u,Ct as v,de as w,It as x,Rt as y,ve as z,Et as A,Oe as B,Ae as C,we as D,vt as E,kt as F,Ft as G,De as H,Ot as I};
|
|
4
|
+
//# sourceMappingURL=chunk-ZJNV27DZ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as z}from"./chunk-
|
|
1
|
+
import{a as z}from"./chunk-LMPOC372.js";import{p as We}from"./chunk-NB2DAVPP.js";import{a as Ze}from"./chunk-NMKQOIYZ.js";import{A as oe,t as I}from"./chunk-TNLOX4TN.js";import{f as ae,o as Xe,p as D}from"./chunk-RGBZDOUO.js";import{A as Ge,C as B,F as Ke,K as H,z as He}from"./chunk-NRNVMB2R.js";import{a as Ue,g as Z,w as M}from"./chunk-23AD24QZ.js";function se(e){let t=e.replaceAll("\\","/");return Ze(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}import Mt from"better-sqlite3";var ue="codebaseiq_runtime_boundaries",j="codebaseiq_runtime_observations",ce="codebaseiq_runtime_relation_groups",de="codebaseiq_runtime_relation_participants";function Vt(e,t){let n=new Mt(Ue(e));try{n.exec(`
|
|
2
2
|
CREATE TABLE IF NOT EXISTS ${ue} (
|
|
3
3
|
singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
|
|
4
4
|
schema_version INTEGER NOT NULL,
|
|
@@ -46,4 +46,4 @@ import{a as z}from"./chunk-3VJ3OCRE.js";import{p as We}from"./chunk-J7AMBVWF.js"
|
|
|
46
46
|
CREATE INDEX IF NOT EXISTS idx_runtime_participants_observation
|
|
47
47
|
ON ${de}(observation_id, participant_role);
|
|
48
48
|
`)}function qt(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function le(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function Ut(e){try{return[JSON.parse(e)]}catch{return[]}}function Ye(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",ue))return null;let n=e.get(`SELECT schema_version, payload FROM ${ue} WHERE singleton = 1`);if(!n||n.schema_version!==2)return null;try{let r=JSON.parse(n.payload);return r.schemaVersion===2&&Array.isArray(r.observations)&&Array.isArray(r.relationGroups)&&Array.isArray(r.links)?r:null}catch{return null}}import{createHash as Ot}from"crypto";import{createHash as cn}from"crypto";var pe=8;function G(e,t,n){return Pe(Je(e,t,we(n),0,new Set))}function Fe(e,t,n){return Ce(e,t,n,0,new Set)}function Je(e,t,n,r,i){if(r>pe)return[];let a=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return a?Qe(e,t,a[1],a[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?et(e,t,n,r,i):[]}function Qe(e,t,n,r,i,a){let o=[];for(let s of Ce(e,t,n,i+1,new Set(a))){let l=Zt(s.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let c=u.childForFieldName("key")??u.namedChild(0);if(Wt(c)!==r)continue;let d=u.childForFieldName("value")??u.namedChild(1);d&&o.push(...Je(e,s.definition.relativePath,we(d.text),i+1,new Set(a)));continue}if(/(?:method|function)/u.test(u.type)){if((u.childForFieldName("name")??u.namedChild(0))?.text!==r)continue;let d=Kt(e,s.definition.relativePath,r,u);o.push(...d.length>0?d:[Ht(s.definition,r,u)]);continue}if(u.type==="spread_element"){let c=u.namedChild(0);if(!c)continue;for(let d of Ce(e,s.definition.relativePath,we(c.text),i+1,new Set(a)))o.push(...Qe(e,d.definition.relativePath,d.definition.leaf,r,i+1,new Set(a)))}}}return Pe(o)}function Ht(e,t,n){return{documentId:e.documentId,symbolId:-1,symbol:`source-callable:${e.relativePath}:${n.startPosition.row}:${t}`,relativePath:e.relativePath,startLine:n.startPosition.row,startChar:n.startPosition.column,endLine:n.endPosition.row,endChar:n.endPosition.column,leaf:t,parentTypeName:e.leaf,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:e.symbol}}function Ce(e,t,n,r,i){return r>pe||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:et(e,t,n,r,i).flatMap(a=>{let o=B(e,a.relativePath)?.rootNode,s=o?Xt(o,a.leaf):null;return s?[{definition:a,initializer:s}]:[]})}function et(e,t,n,r,i){if(r>pe)return[];let a=`${t}\0${n}`;if(i.has(a))return[];i.add(a);let o=I(e,t).filter(u=>u.leaf===n);if(o.length>0)return o;let s=Gt(e,t,n);if(s.length>0)return s;let l=D(e,t).find(u=>u.localName===n&&u.sourcePath);if(l?.sourcePath){let u=l.kind==="namespace"||l.importedName==="default"?n:l.importedName;return Ie(e,l.sourcePath,u,r+1,new Set(i))}return Ie(e,t,n,r+1,new Set(i))}function Gt(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(ae(e,t)?.callables??[]).filter(i=>i.name===n).map(i=>({documentId:r,symbolId:-1,symbol:`source-callable:${t}:${i.startLine}:${n}`,relativePath:t,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:n,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}))}function Ie(e,t,n,r,i){if(r>pe)return[];let a=I(e,t).filter(o=>o.leaf===n);return a.length>0?a:Pe(Xe(e,t).flatMap(o=>o.sourcePath?o.kind==="named"&&!o.names.includes(n)?[]:Ie(e,o.sourcePath,n,r+1,new Set(i)):[]))}function Kt(e,t,n,r){return I(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function Xt(e,t){let n=null;return tt(e,r=>{n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function Zt(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function Wt(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function we(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function Pe(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}function tt(e,t){t(e);for(let n of e.namedChildren)tt(n,t)}var Yt=8;function R(e,t){return t?K(e,t,0,new Set):null}function K(e,t,n,r){if(n>Yt)return _(t,"value-evaluation-depth");let i=rt(t),a=rn(i);if(a)return an(e.file,i,a.term,a.value,a.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let l=i.namedChildren.map(u=>K(e,u,n+1,new Set(r)));if(l.length>=2&&l.every(u=>u!==null)){let u={kind:"concat",parts:l.map(d=>d.term)},c=l.map(d=>d.value).join("");return on(e.file,i,u,c,l.some(d=>d.precision!=="literal")?"constrained-pattern":"literal",l)}}let o=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(o))return tn(e,o,i,n,r);let s=sn(i);return s?nn(e,s.base,s.properties,i,n,r):i.type==="call_expression"||i.type==="call"?Jt(e,i,n,r):_(i,`unsupported-expression:${i.type}`)}function Jt(e,t,n,r){let a=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",o=Qt(e,a);if(o.length!==1)return _(t,o.length===0?"call-target-unresolved":"call-target-ambiguous");let s=o[0],l=`${s.relativePath}\0${s.symbol}`;if(r.has(l))return _(t,"call-return-cycle");let u=B(e.db,s.relativePath)?.rootNode;if(!u)return _(t,"call-target-unparsed");let c=un(u,s.startLine,s.endLine);if(!c)return _(t,"call-target-syntax-unavailable");let d=en(c);if(!d)return _(t,"call-return-not-single-expression");let m=new Set(r);m.add(l);let p=K({db:e.db,file:s.relativePath,root:u},d,n+1,m);return p?me(t,"bounded-call-return",p,s.symbol):_(t,"call-return-unresolved")}function Qt(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=I(e.db,e.file).filter(o=>o.isFunctionLike&&o.leaf===t);if(i.length>0)return i;let a=D(e.db,e.file).find(o=>o.localName===t&&o.sourcePath&&o.kind!=="namespace");return a?.sourcePath?z(e.db,a.sourcePath,a.importedName==="default"?t:a.importedName).filter(o=>o.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=D(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?z(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function en(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return nt(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function nt(e,t,n){if(!(t!==e&&(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function"))){if(t.type==="return_statement"){n.push(t);return}for(let r of t.namedChildren)nt(e,r,n)}}function tn(e,t,n,r,i){let a=`${e.file}\0${t}`;if(i.has(a))return _(n,"value-cycle");i.add(a);let o=Be(e.root,t);if(o){let f=K(e,o,r+1,i);return f?me(n,"local-constant",f):_(n,"non-foldable-local")}let s=D(e.db,e.file).find(f=>f.localName===t&&f.sourcePath);if(!s?.sourcePath)return E(n,t,"unresolved-identifier");if(s.kind==="namespace")return E(n,t,"namespace-import-requires-property");let l=s.importedName==="default"?t:s.importedName,u=z(e.db,s.sourcePath,l);if(u.length!==1)return E(n,t,u.length===0?"import-definition-missing":"import-definition-ambiguous");let c=u[0],d=B(e.db,c.relativePath)?.rootNode;if(!d)return E(n,c.symbol,"import-definition-unparsed");let m=Be(d,c.leaf);if(!m)return E(n,c.symbol,"import-definition-non-value");let p=K({db:e.db,file:c.relativePath,root:d},m,r+1,i);return p?me(n,"imported-constant",p,c.symbol):E(n,c.symbol,"import-value-unresolved")}function nn(e,t,n,r,i,a){let o=D(e.db,e.file).find(p=>p.localName===t&&p.sourcePath),s=e.file,l=t,u;if(o?.sourcePath){o.kind==="namespace"?(l=n[0]??"",n=n.slice(1)):l=o.importedName==="default"?t:o.importedName;let p=z(e.db,o.sourcePath,l);if(p.length!==1)return E(r,`${t}.${n.join(".")}`,p.length===0?"member-definition-missing":"member-definition-ambiguous");s=p[0].relativePath,l=p[0].leaf,u=p[0].symbol}let c=s===e.file?e.root:B(e.db,s)?.rootNode;if(!c)return E(r,u??t,"member-definition-unparsed");let d=Be(c,l);if(!d)return E(r,u??t,"member-base-non-value");for(let p of n){let f=rt(d);if(d=ln(f,p),!d)return E(r,u??`${t}.${n.join(".")}`,`member-property-missing:${p}`)}let m=K({db:e.db,file:s,root:c},d,i+1,a);return m?me(r,"member-constant",m,u):E(r,u??t,"member-value-unresolved")}function rn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);if(n!=="`"||!r.includes("${"))return{term:{kind:"literal",value:r},value:r,precision:"literal"};let i=[],a=0,o=/\$\{([^}]*)\}/gu;for(let s of r.matchAll(o)){let l=s.index??0;l>a&&i.push({kind:"literal",value:r.slice(a,l)}),i.push({kind:"unknown",reason:`template-hole:${s[1]?.trim()||"expression"}`}),a=l+s[0].length}return a<r.length&&i.push({kind:"literal",value:r.slice(a)}),{term:{kind:"pattern",language:"template",value:r.replace(o,"{}")},value:r.replace(o,"{}"),precision:"constrained-pattern"}}function an(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:fe("direct-literal","direct",e,t)}}function on(e,t,n,r,i,a){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...fe("constant-concatenation","mechanically-derived",e,t),inputFactIds:a.flatMap(o=>o.derivation.inputFactIds),sourceSpans:a.flatMap(o=>o.derivation.sourceSpans)}}}function me(e,t,n,r){return n.evidence==="expression"?{...n,derivation:{kind:"heuristic",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}:{...n,evidence:"constant",derivation:{kind:"mechanically-derived",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}}function E(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:fe(n,"heuristic","",e)}}function _(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:fe(t,"heuristic","",e)}}function fe(e,t,n,r){return{kind:t,rule:e,ruleVersion:"1",inputFactIds:[],sourceSpans:n?[{file:n,startLine:r.startPosition.row,endLine:r.endPosition.row}]:[]}}function sn(e){let t=e.text.replace(/\s+/gu,"");if(!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/u.test(t))return null;let[n,...r]=t.split(".");return n?{base:n,properties:r}:null}function Be(e,t){let n=null;return $e(e,r=>{if(n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t)return;let a=r.parent;!a||a.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(a.text)||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function ln(e,t){for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function rt(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function un(e,t,n){let r=null;return $e(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function $e(e,t){t(e);for(let n of e.namedChildren)$e(n,t)}var st=new Set(["delete","get","head","options","patch","post","put"]),dn=/(?:^|\.)(?:app|router|server)$/u,pn=new Set(["findFirst","findMany","findUnique","from","get","select"]),mn=new Set(["create","delete","insert","remove","update","upsert"]),fn=new Set(["execute","query","raw"]),ke=[vn(),gn(),yn(),bn(),Sn(),Nn(),In()],Re=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function yn(){return{id:"builtin.node-child-process",supports:e=>/(?:from\s*|require\s*\(\s*)['"](?:node:)?child_process['"]/u.test(e)&&/\b(?:exec|execFile|execFileSync|execSync|fork|spawn|spawnSync)\s*\(/u.test(e),extract:e=>{let t=hn(e.source),n=[];return k(e.root,r=>{if(r.type!=="call_expression")return;let i=J(r);if(!i)return;let a=t.direct.get(i),o=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),s=o&&t.namespaces.has(o[1])?o[2]:null,l=a??s;if(!l||!Re.has(l))return;let u=q(r),c=$(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},d=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(S(e,r,"builtin.node-child-process",d,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...c}],"exact","node-child-process-import"))}),n}}}function hn(e){let t=new Map,n=new Set,r=String.raw`['"](?:node:)?child_process['"]`,i=new RegExp(String.raw`\bimport\s*\{([^}]*)\}\s*from\s*${r}`,"gu");for(let l of e.matchAll(i))for(let u of(l[1]??"").split(",")){let c=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Re.has(c[1])&&t.set(c[2]??c[1],c[1])}let a=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(a))for(let u of(l[1]??"").split(",")){let c=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(u);c&&Re.has(c[1])&&t.set(c[2]??c[1],c[1])}let o=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let l of e.matchAll(o))n.add(l[1]);let s=new RegExp(String.raw`\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(s))n.add(l[1]);return{direct:t,namespaces:n}}function N(e,t){let n=B(e,t)?.rootNode;if(!n)return null;let r=M(e,t),i=I(e,t),a=ae(e,t)?.callables??[];return{db:e,file:t,source:r,root:n,constants:En(n),ownerAt:o=>{let s=i.filter(u=>u.startLine<=o&&u.endLine>=o).sort((u,c)=>u.endLine-u.startLine-(c.endLine-c.startLine)||u.startLine-c.startLine)[0];if(s)return{file:t,symbol:s.symbol,name:s.leaf,startLine:s.startLine,endLine:s.endLine};let l=a.filter(u=>u.startLine<=o&&u.endLine>=o).sort((u,c)=>u.endLine-u.startLine-(c.endLine-c.startLine)||u.startLine-c.startLine)[0];return{file:t,symbol:null,name:l?.name??null,startLine:l?.startLine??o,endLine:l?.endLine??o}}}}function gn(){return{id:"builtin.effect-httpapi",supports:e=>W(e,"HttpApiEndpoint").size>0||W(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=W(e.source,"HttpApiEndpoint"),r=W(e.source,"HttpApiGroup"),i=W(e.source,"HttpApiBuilder");return k(e.root,a=>{if(a.type!=="call_expression")return;let o=lt(a);if(!o)return;let s=q(a);if(n.has(o.receiver)&&st.has(o.member)){let y=$(s[0],e),h=$(s[1],e),C=at(a,r,"make",0,e);if(!y||!h||!C)return;let P=o.member.toUpperCase();t.push(S(e,a,"builtin.effect-httpapi","http.handle",[{name:"method",value:P,evidence:"literal"},{name:"path",...h}],T([{name:"path",...h}]),"effect-httpapi-endpoint-declaration")),t.push(S(e,a,"builtin.effect-httpapi","framework.declare",Ee(C,y),T(Ee(C,y)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(o.member))return;let l=at(a,i,"group",1,e),u=$(s[0],e),c=s[1];if(!l||!u||!c)return;let d=Ee(l,u),m=G(e.db,e.file,c.text),p=S(e,a,"builtin.effect-httpapi","framework.handle",d,m.length===1?T(d):"candidate","effect-httpapi-handler-registration"),f=m[0];m.length===1&&f&&(p.owner={file:f.relativePath,symbol:f.symbol,name:f.leaf,startLine:f.startLine,endLine:f.endLine}),t.push(p)}),t}}}function Ee(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function W(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(r)){let o=a[2]??"";if(it(o))for(let s of(a[1]??"").split(",")){let l=s.trim().replace(/^type\s+/u,""),u=/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/u.exec(l);u?.[1]===t&&n.add(u[2]??u[1])}}let i=/\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(i)){let o=a[2]??"";o.endsWith(`/${t}`)&&it(o)&&n.add(a[1])}return n}function it(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function at(e,t,n,r,i){let a=e.parent;for(;a;){if(a.type==="call_expression"){let o=ot(a,t,n,r,i);if(o)return o;let s=a.childForFieldName("function")??a.namedChild(0),l=null;if(s&&k(s,u=>{!l&&u.type==="call_expression"&&(l=ot(u,t,n,r,i))}),l)return l}a=a.parent}return null}function ot(e,t,n,r,i){let a=lt(e);return!a||a.member!==n||!t.has(a.receiver)?null:$(q(e)[r],i)}function lt(e){let t=e.childForFieldName("function")??e.namedChild(0);if(!t||!["member_expression","subscript_expression"].includes(t.type))return null;let n=t.childForFieldName("object")??t.namedChild(0),r=t.childForFieldName("property")??t.childForFieldName("index")??t.namedChild(1);return!n||!r?null:{receiver:n.text.replace(/\s+/gu,""),member:r.text.replace(/^['"`]|['"`]$/gu,"")}}function vn(){return{id:"builtin.http",supports:e=>/\bfetch\s*\(|\baxios\b|\b(?:app|router|server)\s*\.\s*(?:get|post|put|patch|delete|options|head)\s*\(/u.test(e)||Y(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return k(e.root,n=>{if(n.type==="decorator"){let m=/^@[^\s(]+\.(get|post|put|patch|delete|options|head)\s*\(\s*(['"`])([^'"`]+)\2/iu.exec(n.text.trim());if(!m||!Y(e.source,["fastapi","flask"]))return;t.push(S(e,n,"builtin.http","http.handle",[{name:"method",value:m[1].toUpperCase(),evidence:"literal"},{name:"path",value:m[3],evidence:"literal"}],"exact","framework-decorator"));return}if(n.type!=="call_expression")return;let r=J(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",a=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",o=q(n);if(i==="route"&&Y(e.source,["axum"])){let m=$(o[0],e),p=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(o[1]?.text??"")?.[1];if(!m||!p)return;t.push(S(e,n,"builtin.http","http.handle",[{name:"method",value:p.toUpperCase(),evidence:"literal"},{name:"path",...m}],T([{name:"path",...m}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let m=$(o[0],e);if(!m)return;let f=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(o[1]?.text??"")?.[1]?.toUpperCase()??(o[1]?null:"GET"),y=[...f?[{name:"method",value:f,evidence:"literal"}]:[],{name:"path",...m}];t.push(S(e,n,"builtin.http","http.request",y,f?T(y):"candidate","call-expression"));return}if(!st.has(i))return;let s=$(o[0],e);if(!s)return;let l=i.toUpperCase();if(dn.test(a)&&Y(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(S(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...s}],T([{name:"path",...s}]),"framework-adapter"));return}let c=Pn(e.source,["axios"]),d=a.split(".")[0]??"";c.has(d)&&t.push(S(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...s}],T([{name:"path",...s}]),"client-adapter"))}),t}}}function bn(){return{id:"builtin.capability-registry",supports:e=>/\b(?:execute|handler|invoke|run)\s*(?:[:(])/u.test(e)||/['"`][^'"`\n]{0,256}\b[A-Za-z_$][\w$-]*\s*\(/u.test(e),extract:e=>{let t=[],n=new Set;return k(e.root,r=>{if(r.type==="pair"){let a=r.childForFieldName("key")??r.namedChild(0),o=r.childForFieldName("value")??r.namedChild(1),s=a?.text.replace(/^['"`]|['"`]$/gu,"");if(s!=="name"&&s!=="id")return;let l=ut(o,e),u=kn(r);if(!l||l.evidence!=="literal"||!u)return;let c=`handle\0${l.value}\0${u.startPosition.row}`;if(n.has(c))return;n.add(c),t.push(S(e,u,"builtin.capability-registry","registry.handle",[{name:"key",...l}],"exact","capability-descriptor"));return}if(!["string","string_literal","template_string"].includes(r.type))return;let i=r.text.replace(/^['"`]|['"`]$/gu,"");for(let a of i.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let o=a[1];if(!xn(i,o,a.index))continue;let s=`reference\0${o}\0${r.startPosition.row}`;n.has(s)||(n.add(s),t.push(S(e,r,"builtin.capability-registry","registry.reference",[{name:"key",value:o,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function xn(e,t,n){if(t.includes("_")||t.includes("-"))return!0;let r=e.slice(Math.max(0,n-64),n);return/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s*$/iu.test(r)}function Sn(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return k(e.root,n=>{if(n.type==="pair"){let a=Rn(n);if(!a)return;let o=n.childForFieldName("key")??n.namedChild(0),s=n.childForFieldName("value")??n.namedChild(1),l=ut(o,e);if(!l||!s||!ct(s))return;let u=Le(s)?"exact":"candidate";t.push(S(e,n,"builtin.registry","registry.handle",[{name:"registry",value:a,evidence:"identifier"},{name:"key",...l}],T([{name:"key",...l}],u),"object-member"));return}if(n.type!=="call_expression")return;let r=n.childForFieldName("function")??n.namedChild(0);if(!r)return;let i=/^([A-Za-z_$][\w$]*)\s*\[\s*(['"`])([^'"`]+)\2\s*\]$/u.exec(r.text.trim());i&&t.push(S(e,n,"builtin.registry","registry.dispatch",[{name:"registry",value:i[1],evidence:"identifier"},{name:"key",value:i[3],evidence:"literal"}],"exact","indexed-access-call"))}),t}}}function Nn(){return{id:"builtin.persistence",supports:e=>/\b(?:db|database|prisma|drizzle|[A-Za-z_$][\w$]*(?:Repository|Repo))\b[^;]{0,1024}?\.\s*(?:findFirst|findMany|findUnique|from|get|select|create|delete|insert|remove|update|upsert|execute|query|raw|transaction)(?:\s*<[^()]{1,512}>)?\s*\(/iu.test(e),extract:e=>{let t=[],n=_n(e.root);return k(e.root,r=>{if(r.type!=="call_expression")return;let i=J(r);if(!i)return;let a=i.split("."),o=a.at(-1)??"",s=q(r),l=s[0]?.text??"",u=Ln(o,l);if(!u)return;let c=dt(a,n);if(!c)return;let d=Cn(s[0],e)??Tn(l),m=On(c,a,o,d);if(!m)return;let p=o==="insert"?"persistence-insert":u==="database.read"&&/\bFOR\s+UPDATE\s+SKIP\s+LOCKED\b/iu.test(l)?"persistence-skip-locked-claim":"persistence-adapter";t.push(S(e,r,"builtin.persistence",u,[{name:"resource",...m}],T([{name:"resource",...m}]),p))}),t}}}function Cn(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:$(e,t)}function In(){return{id:"builtin.queue",supports:e=>Y(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return k(e.root,n=>{if(n.type!=="call_expression")return;let r=J(n);if(!r)return;let i=r.split(".").at(-1)??"",a=q(n),o=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!o)return;let s=i==="send"||i==="subscribe"?Bn(a[0],"topic",e):$(a[0],e);s&&t.push(S(e,n,"builtin.queue",o,[{name:"address",...s}],T([{name:"address",...s}]),"framework-adapter"))}),t}}}function S(e,t,n,r,i,a,o){let s=e.ownerAt(t.startPosition.row),l=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${cn("sha256").update(l).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:s,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:o,strength:a,protocol:r.split(".")[0]??r,role:wn(r),executionDomain:Fn(e.file),derivation:{kind:a==="candidate"?"heuristic":a==="derived"?"mechanically-derived":"direct",rule:o,ruleVersion:"1",inputFactIds:i.flatMap(u=>u.derivation?.inputFactIds??[]),sourceSpans:[{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},...i.flatMap(u=>u.derivation?.sourceSpans??[])]},valuePrecision:i.some(u=>u.evidence==="expression")?"unknown":i.some(u=>u.evidence==="identifier")?"symbolic":"literal",modality:"may",resolution:"unresolved",sourceScope:se(e.file)}}function wn(e){let t=e.split(".").at(-1)??e;return["handle","subscribe","consume","read"].includes(t)?"consumer":["request","publish","send","write","dispatch","reference","invoke","spawn","exec"].includes(t)?"producer":"observe"}function Fn(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function Y(e,t){return t.some(n=>{let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:\\bfrom\\s+${r}\\b|\\buse\\s+${r}\\b|(?:\\bfrom\\s*|\\brequire\\s*\\(\\s*)['"]${r}(?:[/']|"))`,"u").test(e)})}function Pn(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),a=new RegExp(`(?:import\\s+([A-Za-z_$][\\w$]*)[^;]*?\\sfrom\\s*|(?:const|let)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\s*\\(\\s*)['"]${i}(?:[/']|")`,"gu");for(let o of e.matchAll(a)){let s=o[1]??o[2];s&&n.add(s)}}return n}function ye(e,t,n,r,i,a,o){return S(e,t,n,r,i,a,o)}function J(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function q(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function $(e,t){let n=R(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function Bn(e,t,n){if(!e)return null;let r=e.namedChildren.find(a=>a.type!=="pair"?!1:(a.childForFieldName("key")??a.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return $(i,n)}function ut(e,t){if(!e)return null;let n=$(e,t);if(n?.evidence==="literal"||n?.evidence==="constant")return n;let r=e.text.trim();return/^[A-Za-z_$][\w$]*$/u.test(r)?{value:r,evidence:"identifier",term:{kind:"symbol",symbol:r}}:n}function T(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function $n(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);return n==="`"&&r.includes("${")?null:r}function En(e){let t=new Map;return k(e,n=>{if(n.type!=="variable_declarator")return;let r=n.childForFieldName("name")??n.namedChild(0),i=n.childForFieldName("value")??n.namedChild(1);if(!r||!i||!/^[A-Za-z_$][\w$]*$/u.test(r.text))return;let a=$n(i);a!==null&&t.set(r.text,a)}),t}function Rn(e){let t=e.parent,n=t?.parent??null;for(;n&&["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(n.type);)n=n.parent;if(!t||!n||n.type!=="variable_declarator")return null;let i=(n.childForFieldName("name")??n.namedChild(0))?.text??"";return/(?:handlers?|registry|routes?)$/iu.test(i)?i:null}function Le(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function ct(e){return Le(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function kn(e){let t=e.parent;for(;t&&t.type!=="variable_declarator";){if(["object","object_literal","dictionary"].includes(t.type))for(let n of t.namedChildren){if(n.type==="pair"){let i=n.childForFieldName("key")??n.namedChild(0),a=n.childForFieldName("value")??n.namedChild(1),o=i?.text.replace(/^['"`]|['"`]$/gu,"");if(o&&["execute","handler","invoke","run"].includes(o)&&a&&ct(a))return t}let r=n.childForFieldName("name")??n.namedChild(0);if(r&&["execute","handler","invoke","run"].includes(r.text.replace(/^['"`]|['"`]$/gu,""))&&/(?:function|method)/u.test(n.type))return t}t=t.parent}return null}function dt(e,t=new Set){let n=e.slice(0,-1).map(r=>r.replace(/\([^)]*\)/gu,""));return n.some(r=>/^(?:prisma|drizzle)$/iu.test(r))?"orm":n.some(r=>/(?:Repository|Repo)$/u.test(r))?"repository":n.some(r=>/^(?:db|database)$/iu.test(r)||t.has(r))?"database":null}function Ln(e,t){if(pn.has(e))return"database.read";if(mn.has(e))return"database.write";if(!fn.has(e))return null;let n=/\b(SELECT|INSERT|UPDATE|DELETE)\b/iu.exec(t)?.[1]?.toUpperCase();return n==="SELECT"?"database.read":n?"database.write":null}function _n(e){let t=new Set;return k(e,n=>{if(n.type!=="call_expression")return;let r=J(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!dt(i)))for(let a of q(n)){if(!Le(a))continue;let s=(a.childForFieldName("parameters")??a.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=s?pt(s):null;l&&t.add(l)}}),t}function pt(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?pt(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function Tn(e){let t=mt(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function On(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let a=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return a?{value:a,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=mt(r.value);return i?{value:i,evidence:r.evidence}:null}function mt(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function k(e,t){t(e);for(let n of e.namedChildren)k(n,t)}var An=Z("resolved-call-syntax",{clearGroups:[]}),Dn=Z("resolved-call-sites",{clearGroups:[]});function Q(e,t){return Dn.get(e,t.symbolId,()=>Mn(e,t))}function Mn(e,t){let n=[],r=[],i=new Set,a=new Set;for(let o of We(e,t,{semantic:!1})){i.add(o.file);let s=An.get(e,o.file,()=>Vn(e,o.file));if(!s){r.push({callee:t,file:o.file,line:o.line,reason:"ast-unavailable",candidates:0,referenceProvenance:o.provenance});continue}let l=(s.byLeaf.get(t.leaf)??[]).filter(({callNode:d})=>d.startPosition.row<=o.line&&d.endPosition.row>=o.line);if(l.length!==1){r.push({callee:t,file:o.file,line:o.line,reason:l.length===0?"call-not-found":"ambiguous-call",candidates:l.length,referenceProvenance:o.provenance});continue}let u=l[0],c=`${o.file}\0${u.callNode.startIndex}\0${u.callNode.endIndex}`;a.has(c)||(a.add(c),n.push({callee:t,caller:oe(I(e,o.file),u.callNode.startPosition.row),file:o.file,line:o.line,startLine:u.callNode.startPosition.row,endLine:u.callNode.endPosition.row,targetText:u.targetNode.text,callNode:u.callNode,targetNode:u.targetNode,arguments:u.arguments,referenceProvenance:o.provenance}))}return{sites:n,unresolved:r,filesVisited:i.size}}function Vn(e,t){let n=B(e,t)?.rootNode;if(!n)return null;let r=new Map;return ft(n,i=>{if(i.type!=="call_expression"&&i.type!=="call")return;let a=i.childForFieldName("function")??i.namedChild(0);if(!a)return;let o=Ke(a);if(!o)return;let s=i.childForFieldName("arguments")??i.namedChildren.find(c=>c.type==="arguments"),l={callNode:i,targetNode:a,arguments:s?.namedChildren??[]},u=r.get(o);u?u.push(l):r.set(o,[l])}),{byLeaf:r}}function ft(e,t){t(e);for(let n of e.namedChildren)ft(n,t)}var zn=Z("call-parameter-value-flow",{clearGroups:[]});function ee(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return zn.get(e,n,()=>jn(e,t))}function te(e,t){let n=new Set(t);return[...new Set(e.transfers.flatMap(r=>n.has(r.calleePosition)?[r.callerPosition]:[]))].sort((r,i)=>r-i)}function jn(e,t){let n={file:t.file,startLine:t.startLine,endLine:t.endLine};if(!t.caller)return{callee:t.callee,caller:null,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-unavailable",proof:n}))};let r=B(e,t.caller.relativePath)?.rootNode,i=r?qn(r,t.caller.startLine,t.caller.endLine):null;if(!i)return{callee:t.callee,caller:t.caller,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-syntax-unavailable",proof:n}))};let a=Un(i),o=[],s=[];return t.arguments.forEach((l,u)=>{let c=l.text.trim(),d=a.indexOf(c);d>=0?o.push({calleePosition:u,callerPosition:d,argumentText:c,proof:n}):s.push({calleePosition:u,argumentText:c,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:o,unknown:s}}function qn(e,t,n){let r=null;return ht(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function Un(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(yt)??[]}function yt(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?yt(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function ht(e,t){t(e);for(let n of e.namedChildren)ht(n,t)}var Hn=8,Gn=8;function vt(e,t){let n=[],r=Kn(e,n),i=r.summaries,a=Xn(e,t,i,n),o=Zn(e,t,n);return{observations:or([...a.observations,...o]),bodySummaries:i.size,discriminatorSummaries:a.summaries,filesInspected:r.filesInspected,errors:n}}function Kn(e,t){let n=new Map,r=[],i=H(e);for(let a of i){let o=M(e,a);if(!/\bJSON\.stringify\s*\(/u.test(o)||!/\bbody\s*:/u.test(o))continue;let s=N(e,a);if(s)for(let[l,u]of Wn(s)){let c={definition:l,parameterIndexes:u,depth:0,proofSpans:[{file:a,startLine:l.startLine,endLine:l.endLine}]};n.set(l.symbol,c),r.push(c)}}for(;r.length>0;){let a=r.shift();if(!(a.depth>=Hn))try{for(let o of Q(e,a.definition).sites){if(!N(e,o.file))continue;let l=o.caller;if(!l)continue;let u=te(ee(e,o),a.parameterIndexes);if(u.length===0)continue;let c={definition:l,parameterIndexes:wt(u),depth:a.depth+1,proofSpans:[...a.proofSpans,{file:o.file,startLine:o.startLine,endLine:o.endLine}]};er(n,c)&&r.push(n.get(l.symbol))}}catch(o){t.push(`builtin.carrier body summary failed for ${a.definition.relativePath}: ${Ae(o)}`)}}return{summaries:n,filesInspected:i.length}}function Xn(e,t,n,r){let i=new Map,a=[],o=[];for(let s of t){if(s.action!=="http.request"||s.strength==="candidate"||s.sourceScope!=="production")continue;let l=bt(s);if(!l)continue;let u=N(e,s.source.file);if(!u)continue;let c=Nt(u.root,s.source.startLine),d=c.find(P=>P.startPosition.row===s.source.startLine)??c[0];if(!d)continue;let m=Oe(d);if(!m)continue;let p=G(e,s.source.file,m.text);if(p.length!==1)continue;let f=n.get(p[0].symbol);if(!f)continue;let y=s.owner.symbol?I(e,s.owner.file).find(P=>P.symbol===s.owner.symbol):null;if(!y)continue;let h=tr(u,y),C=ge(d);for(let P of f.parameterIndexes){let O=rr(u,C[P]);if(O)for(let v of ir(O)){let w=Ct(v),L=It(v);if(!w||!L)continue;let A=h.indexOf(L.text.trim());if(A>=0){let F={definition:y,carrier:l,field:w,parameterIndex:A,depth:0,proofObservationIds:[s.id],proofSpans:[s.source,{file:s.source.file,startLine:v.startPosition.row,endLine:v.endPosition.row}]},x=gt(F);i.has(x)||(i.set(x,F),a.push(F));continue}let b=R(u,L);!b||b.evidence==="expression"||o.push(Te(u,v,"carrier.publish",l,w,b.value,[s.id]))}}}for(;a.length>0;){let s=a.shift();if(!(s.depth>=Gn))try{for(let l of Q(e,s.definition).sites){let u=N(e,l.file);if(!u)continue;let c=l.callNode,d=ge(c)[s.parameterIndex];if(!d)continue;let m=R(u,d);m&&m.evidence!=="expression"&&o.push(Te(u,c,"carrier.publish",s.carrier,s.field,m.value,s.proofObservationIds));let p=l.caller;if(!p)continue;let f=ee(e,l).transfers.find(C=>C.calleePosition===s.parameterIndex)?.callerPosition;if(f===void 0)continue;let y={...s,definition:p,parameterIndex:f,depth:s.depth+1,proofSpans:[...s.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},h=gt(y);i.has(h)||(i.set(h,y),a.push(y))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${s.definition.relativePath}: ${Ae(l)}`)}}return{observations:o,summaries:i.size}}function Zn(e,t,n){let r=[],i=t.filter(a=>a.action==="registry.handle"&&a.strength!=="candidate"&&a.sourceScope==="production");for(let a of t){if(a.action!=="http.handle"||a.strength==="candidate"||a.sourceScope!=="production")continue;let o=bt(a);if(!o)continue;let s=N(e,a.source.file);if(!s)continue;let l=Nt(s.root,a.source.startLine)[0];if(l)for(let u of ge(l).slice(1)){let c=G(e,a.source.file,u.text);for(let d of c)try{let m=N(e,d.relativePath);if(!m)continue;let p=he(m.root,d.startLine,d.endLine);if(!p)continue;V(p,f=>{if(f.type!=="call_expression")return;let y=Oe(f);if(!y)return;let h=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(y.text.trim());if(!h)return;let C=h[1],P=h[2],O=Jn(e,m,d,P);if(!O)return;let v=Qn(e,d.relativePath,C);for(let w of i){let L=w.keyParts.find(x=>x.name==="registry")?.value,A=w.keyParts.find(x=>x.name==="key")?.value;if(!L||!A||!v.some(x=>x.file===w.source.file&&x.binding===L))continue;let b=N(e,w.source.file),F=b?nr(b.root,w.source.startLine):null;!b||!F||r.push(Te(b,F,"carrier.consume",o,O,A,[a.id,w.id]))}})}catch(m){n.push(`builtin.carrier consumer analysis failed for ${d.relativePath}: ${Ae(m)}`)}}}return r}function Wn(e){let t=I(e.db,e.file),n=new Map;return V(e.root,r=>{if(r.type!=="pair"||Ct(r)?.toLowerCase()!=="body")return;let i=It(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let a=oe(t,r.startPosition.row),o=Yn(r);if(!a||!o)return;let s=xt(o),l=new Set;ar(i,s,l);let u=n.get(a.symbol)??new Set;s.forEach((c,d)=>{c&&l.has(c)&&u.add(d)}),u.size>0&&n.set(a.symbol,u)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[[r,[...i].sort((a,o)=>a-o)]]:[]})}function Yn(e){let t=e.parent;for(;t;){if(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function")return t;t=t.parent}return null}function Jn(e,t,n,r){let i=he(t.root,n.startLine,n.endLine);if(!i)return null;let a=new RegExp(`\\.body\\??\\.${_e(r)}\\b`,"u");if(a.test(i.text))return r;let o=null;if(V(i,c=>{if(o||c.type!=="variable_declarator")return;let d=c.childForFieldName("name")??c.namedChild(0),m=c.childForFieldName("value")??c.namedChild(1);!d||!m||!new RegExp(`(?:^|[,{}])\\s*${_e(r)}\\s*(?:[,}]|$)`,"u").test(d.text)||m.type==="call_expression"&&(o=Oe(m)?.text??null)}),!o)return null;let s=G(e,n.relativePath,o);if(s.length!==1)return null;let l=N(e,s[0].relativePath),u=l?he(l.root,s[0].startLine,s[0].endLine):null;return u&&a.test(u.text)&&new RegExp(`\\b${_e(r)}\\s*[,}]`,"u").test(u.text)?r:null}function Qn(e,t,n){let r=[];for(let i of Fe(e,t,n)){let a=ne(i.initializer);if(a.type==="call_expression")for(let o of ge(a)){let s=o.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))for(let l of Fe(e,i.definition.relativePath,s))r.push({file:l.definition.relativePath,binding:l.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function Te(e,t,n,r,i,a,o){let l=ye(e,t,"builtin.carrier",n,[{name:"carrier",value:r,evidence:"constant",term:{kind:"literal",value:r}},{name:"field",value:i,evidence:"literal",term:{kind:"literal",value:i}},{name:"value",value:a,evidence:"constant",term:{kind:"literal",value:a}}],"derived","http-body-registry-discriminator");return l.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...o],sourceSpans:[l.source]},l}function bt(e){let t=e.keyParts.find(r=>r.name==="method"&&r.evidence!=="expression")?.value,n=e.keyParts.find(r=>r.name==="path"&&r.evidence!=="expression")?.value;return t&&n?`${t.toUpperCase()} ${n}`:null}function er(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=wt([...n.parameterIndexes,...t.parameterIndexes]);return r.length===n.parameterIndexes.length&&t.depth>=n.depth?!1:(e.set(t.definition.symbol,{...n,parameterIndexes:r,depth:Math.min(n.depth,t.depth),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0)}function gt(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function tr(e,t){let n=he(e.root,t.startLine,t.endLine);return n?xt(n):[]}function xt(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(St)??[]}function St(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?St(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function he(e,t,n){let r=null;return V(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function nr(e,t){let n=null;return V(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function Nt(e,t){let n=[];return V(e,r=>{r.type==="call_expression"&&r.startPosition.row<=t&&r.endPosition.row>=t&&n.push(r)}),n.sort((r,i)=>r.endIndex-r.startIndex-(i.endIndex-i.startIndex))}function Oe(e){return e.childForFieldName("function")??e.namedChild(0)}function ge(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function rr(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return ne(t);let r=null;return V(e.root,i=>{r||i.type!=="variable_declarator"||(i.childForFieldName("name")??i.namedChild(0))?.text.trim()!==n||(r=i.childForFieldName("value")??i.namedChild(1))}),ne(r||t)}function ir(e){let t=ne(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function Ct(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function It(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function ne(e){let t=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(t.type)&&t.namedChildren.length>0;)t=t.namedChildren[0];return t}function ar(e,t,n){let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function wt(e){return[...new Set(e)].sort((t,n)=>t-n)}function or(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function _e(e){return e.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")}function Ae(e){return e instanceof Error?e.message:String(e)}function V(e,t){t(e);for(let n of e.namedChildren)V(n,t)}import{createHash as sr}from"crypto";function Ft(e,t){let n=new Map;for(let a of t){if(a.action!=="http.handle"||a.sourceScope!=="production")continue;let o=n.get(a.source.file)??[];o.push(a),n.set(a.source.file,o)}let r=[],i=lr(e);for(let a of i.mounts)for(let o of a.targetFiles)for(let s of n.get(o)??[]){let l=s.keyParts.find(m=>m.name==="path");if(!l||l.evidence==="expression")continue;let u=cr(a.prefix.value,l.value),c=s.keyParts.map(m=>m.name==="path"?{name:"path",value:u,evidence:"constant",term:{kind:"concat",parts:[a.prefix.term??{kind:"literal",value:a.prefix.value},l.term??{kind:"literal",value:l.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[s.id],sourceSpans:[s.source,{file:a.file,startLine:a.line,endLine:a.line},...a.prefix.derivation?.sourceSpans??[],...l.derivation?.sourceSpans??[]]}}:m),d=`${s.id}\0${a.file}\0${a.line}\0${u}`;r.push({...s,id:`boundary:${sr("sha256").update(d).digest("hex").slice(0,16)}`,keyParts:c,strength:"derived",evidence:"framework-mount-composition",derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[s.id],sourceSpans:[s.source,{file:a.file,startLine:a.line,endLine:a.line}]},resolution:"unresolved"}),s.strength="candidate",s.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function lr(e){let t=[],n=H(e);for(let r of n){let i=M(e,r);if(!dr(i))continue;let a=N(e,r);a&&Pt(a.root,o=>{if(o.type!=="call_expression")return;let s=o.childForFieldName("function")??o.namedChild(0);if(!s||!/\.use$/u.test(s.text.replace(/\s+/gu,"")))return;let l=pr(o);if(l.length<2)return;let u=R(a,l[0]);if(!u||u.evidence==="expression")return;let c=ur(e,r,l[1]);c.length!==0&&t.push({file:r,line:o.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:c})})}return{mounts:t,filesInspected:n.length}}function ur(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let a=D(e,t).find(l=>l.localName===i&&l.sourcePath);if(!a?.sourcePath)return[t];if(a.kind==="namespace")return[a.sourcePath];let o=a.importedName==="default"?i:a.importedName,s=z(e,a.sourcePath,o);return[...new Set(s.map(l=>l.relativePath))]}function cr(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function dr(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function pr(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Pt(e,t){t(e);for(let n of e.namedChildren)Pt(n,t)}import{createHash as mr}from"crypto";var De=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),fr=8;function Et(e,t){let n=new Map,r=[],i=[],a=new Set,o=[],s=[];for(let l of t){if(l.action!=="http.request"||!l.owner.symbol||l.evidence!=="call-expression"&&l.evidence!=="client-adapter")continue;let u=I(e,l.owner.file).find(p=>p.symbol===l.owner.symbol);if(!u)continue;let c=N(e,u.relativePath);if(!c)continue;let d=Bt(c,u),m={definition:u,...d,constantMethods:l.keyParts.flatMap(p=>p.name==="method"&&p.evidence!=="expression"&&De.has(p.value.toUpperCase())?[p.value.toUpperCase()]:[]),depth:0,proofObservationIds:[l.id],proofSpans:[l.source]};$t(n,m)&&r.push(n.get(u.symbol))}for(;r.length>0;){let l=r.shift();if(!(l.depth>=fr))try{let u=Q(e,l.definition);s.push(...u.unresolved.map(c=>yr(l,c)));for(let c of u.sites){let d=N(e,c.file);if(!d)continue;a.add(c.file);let m=c.callNode,p=gr(l,m,d);p&&i.push(p);let f=c.caller;if(!f)continue;let y=Bt(d,f),h=vr(e,l,c),C={definition:f,pathParameterIndexes:ve([...y.pathParameterIndexes,...h.pathParameterIndexes]),methodParameterIndexes:ve([...y.methodParameterIndexes,...h.methodParameterIndexes]),constantMethods:X([...l.constantMethods,...y.constantMethods]),depth:l.depth+1,proofObservationIds:X([...l.proofObservationIds,...p?[p.id]:[]]),proofSpans:[...l.proofSpans,{file:c.file,startLine:c.startLine,endLine:c.endLine}]};$t(n,C)&&r.push(n.get(f.symbol))}}catch(u){o.push(`builtin.http-summary failed for ${l.definition.relativePath}:${l.definition.startLine+1}: ${u instanceof Error?u.message:String(u)}`)}}return{observations:i,frontiers:hr(s),summaries:n.size,filesInspected:a.size,errors:o}}function yr(e,t){let n=X([...e.pathParameterIndexes.length>0?["path"]:[],...e.methodParameterIndexes.length>0&&e.constantMethods.length!==1?["method"]:[]]),r=e.constantMethods.length===1?e.constantMethods[0]:"?",i=`${e.definition.symbol}\0${t.file}\0${t.line}\0${t.reason}`;return{observationId:`frontier:${mr("sha256").update(i).digest("hex").slice(0,16)}`,kind:"call-resolution",action:"http.request",strength:"candidate",source:{file:t.file,startLine:t.line,endLine:t.line},ownerShortName:null,address:`method=${r??"?"} path=?`,reason:`Compiler identity found a reference to ${e.definition.leaf}, but exact call recovery stopped with ${t.reason} (${t.candidates} syntax candidate(s)); HTTP value propagation did not cross this site.`,missingKeyParts:n.length>0?n:["call"],sourceScope:se(t.file)}}function hr(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}function gr(e,t,n){let r=kt(t),i=e.pathParameterIndexes.flatMap(d=>{let m=R(n,r[d]);return m&&m.evidence!=="expression"&&Nr(m.value)?[{index:d,value:m}]:[]}),a=e.methodParameterIndexes.flatMap(d=>{let m=R(n,r[d]),p=m?.value.toUpperCase();return m&&p&&m.evidence!=="expression"&&De.has(p)?[{index:d,value:{...m,value:p}}]:[]}),o=X([...e.constantMethods,...a.map(d=>d.value.value)]);if(i.length!==1||o.length!==1)return null;let s=i[0].value,l=a.find(d=>d.value.value===o[0])?.value,u=[{name:"method",value:o[0],evidence:l?"constant":"literal",term:l?.term??{kind:"literal",value:o[0]},derivation:l?.derivation},{name:"path",value:s.value,evidence:"constant",term:s.term,derivation:s.derivation}],c=ye(n,t,"builtin.http-summary","http.request",u,"derived","compiler-resolved-http-summary");return c.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,c.source]},c}function Bt(e,t){let n=Sr(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=xr(n),i=new Set,a=new Set,o=new Set;return Me(n,s=>{if(s.type==="call_expression"&&((s.childForFieldName("function")??s.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let p=kt(s);re(p[0],r,i);let f=br(p[1],"method");if(f){re(f,r,a);let y=R(e,f),h=y?.value.toUpperCase();h&&y?.evidence!=="expression"&&De.has(h)&&o.add(h)}else re(p[1],r,a)}if(s.type!=="pair")return;let l=s.childForFieldName("key")??s.namedChild(0),u=s.childForFieldName("value")??s.namedChild(1),c=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(c==="url"||c==="path"||c==="endpoint")&&re(u,r,i),(c==="init"||c==="requestinit"||c==="options")&&re(u,r,a)}),{pathParameterIndexes:r.flatMap((s,l)=>s&&i.has(s)?[l]:[]),methodParameterIndexes:r.flatMap((s,l)=>s&&a.has(s)?[l]:[]),constantMethods:[...o].sort()}}function vr(e,t,n){let r=ee(e,n);return{pathParameterIndexes:te(r,t.pathParameterIndexes),methodParameterIndexes:te(r,t.methodParameterIndexes)}}function $t(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=ve([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=ve([...n.methodParameterIndexes,...t.methodParameterIndexes]),a=X([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||a.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:a,depth:Math.min(n.depth,t.depth),proofObservationIds:X([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function br(e,t){if(!e)return null;for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase()!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function re(e,t,n){if(!e)return;let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function xr(e){return(e.childForFieldName("parameters")??e.namedChildren.find(n=>/parameters/u.test(n.type)))?.namedChildren.map(Rt)??[]}function Rt(e){if(e.type==="identifier")return e.text;let t=e.childForFieldName("name")??e.childForFieldName("pattern");return t?Rt(t):e.namedChildren.find(n=>n.type==="identifier")?.text??null}function Sr(e,t,n){let r=null;return Me(e,i=>{!/(?:function|method|lambda)/u.test(i.type)&&i.type!=="arrow_function"||i.startPosition.row>t||i.endPosition.row<n||(!r||i.endIndex-i.startIndex<r.endIndex-r.startIndex)&&(r=i)}),r}function kt(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Nr(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function ve(e){return[...new Set(e)].sort((t,n)=>t-n)}function X(e){return[...new Set(e)].sort()}function Me(e,t){t(e);for(let n of e.namedChildren)Me(n,t)}import{createHash as Cr}from"crypto";function Tt(e){let t=Lt(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=Lt(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?Ve(r).flatMap(i=>{let a=t.get(i)?.[0];return a?[_t(r,a,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?Ve(r).flatMap(i=>{let a=n.get(i)?.[0];return a?[_t(r,a,i,"queue.consume")]:[]}):[])}function Lt(e){let t=new Map;for(let n of e)for(let r of Ve(n)){let i=t.get(r);i?i.push(n):t.set(r,[n])}for(let n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function Ve(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function _t(e,t,n,r){let i=`database:${n}`,a=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",o=[e.id,r,i,a].join("\0");return{...e,id:`boundary:${Cr("sha256").update(o).digest("hex").slice(0,16)}`,extractor:"builtin.database-queue",action:r,keyParts:[{name:"address",value:i,evidence:"identifier",term:{kind:"symbol",symbol:n},derivation:{kind:"mechanically-derived",rule:"database-work-queue.resource",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]}}],evidence:a,strength:"derived",protocol:"queue",role:r==="queue.send"?"producer":"consumer",derivation:{kind:"mechanically-derived",rule:"database-work-queue.insert-skip-locked",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]},valuePrecision:"symbolic",resolution:"unresolved"}}var ze="runtime-boundaries-v15",Se=[{id:"http.method-path",protocol:"http",producerActions:["http.request"],consumerActions:["http.handle"],keyNames:["method","path"],traversable:!0},{id:"registry.identity-key",protocol:"registry",producerActions:["registry.dispatch"],consumerActions:["registry.handle"],keyNames:["registry","key"],traversable:!0},{id:"registry.capability-key",protocol:"registry",producerActions:["registry.reference"],consumerActions:["registry.handle"],keyNames:["key"],traversable:!0,requireUniqueConsumer:!0},{id:"queue.address",protocol:"queue",producerActions:["queue.send"],consumerActions:["queue.consume"],keyNames:["address"],traversable:!0},{id:"carrier.discriminator",protocol:"carrier",producerActions:["carrier.publish"],consumerActions:["carrier.consume"],keyNames:["carrier","field","value"],traversable:!0},{id:"resource.identity",protocol:"database",producerActions:["database.write"],consumerActions:["database.read"],keyNames:["resource"],traversable:!1},{id:"framework.effect-httpapi-operation",protocol:"framework",producerActions:[],consumerActions:["framework.handle"],declarationActions:["framework.declare"],keyNames:["adapter","group","operation"],traversable:!0,linkFrom:"declaration",requireUniquePair:!0}],Ir=64;function wr(e,t={}){let n=H(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map($r)),a=t.previousGraph?.fileCoverage,o=i.size>0&&t.previousGraph?.extractorVersion===ze&&a!==void 0&&a.length===t.previousGraph.coverage.filesScanned,s=o?a.filter(g=>r.has(g.file)&&!i.has(g.file)):[],l=new Set(s.flatMap(g=>g.observationIds)),u=o?t.previousGraph.observations.filter(g=>l.has(g.id)&&r.has(g.source.file)):[],c=o?n.filter(g=>i.has(g)):n,d=[],m=a?.reduce((g,Ne)=>g+Ne.observationIds.length,0)??0,p=performance.now(),f=Fr(e,c);U(d,"direct-extraction",p,c.length,f.observations.length,{filesVisited:c.length,filesReused:s.length,factsReused:u.length,factsInvalidated:Math.max(0,m-u.length)});let y=[...s,...f.fileCoverage].sort((g,Ne)=>g.file.localeCompare(Ne.file)),h=Br(y),C=y.flatMap(g=>g.extractionErrors),P=ie([...u,...f.observations]),O=ie([...P,...Tt(P)]);p=performance.now();let v=Et(e,O);U(d,"http-summary",p,O.length,v.observations.length,{filesVisited:v.filesInspected}),h.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:v.filesInspected,observations:v.observations.length,errors:v.errors.length}),C.push(...v.errors);let w=ie([...O,...v.observations]);p=performance.now();let L=Ft(e,w);U(d,"http-mount",p,w.length,L.observations.length,{filesVisited:L.filesInspected});let A=ie([...w,...L.observations]);p=performance.now();let b=vt(e,A);U(d,"carrier",p,A.length,b.observations.length,{filesVisited:b.filesInspected}),h.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:b.bodySummaries,observations:b.observations.length,errors:b.errors.length}),C.push(...b.errors);let F=ie([...A,...b.observations]);p=performance.now();let x=Er(F);U(d,"relations",p,F.length,x.length),p=performance.now();let je=kr(F,x);U(d,"links",p,x.length,je.length),Lr(F,x),p=performance.now();let qe=Or([..._r(F,x),...v.frontiers]);return U(d,"frontiers",p,F.length,qe.length),{schemaVersion:2,extractorVersion:ze,observations:F,relationGroups:x,links:je,frontiers:qe,coverage:{filesScanned:n.length,filesWithAst:y.filter(g=>g.hasAst).length,filesWithoutAst:y.filter(g=>!g.hasAst).length,...o?{filesReused:s.length}:{},extractors:[...h.values()],extractionErrors:C,phases:d},fileCoverage:y}}function U(e,t,n,r,i,a={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...a})}function Fr(e,t){let n=[],r=[];for(let i of t){let a=M(e,i),o=ke.filter(u=>u.supports(a)),s=o.length>0?N(e,i):null,l={file:i,hasAst:s!==null||Pr(i,a),observationIds:[],extractors:[],extractionErrors:[]};if(s)for(let u of o){let c={id:u.id,applicableFiles:1,observations:0,errors:0};try{let d=u.extract(s);c.observations=d.length,n.push(...d),l.observationIds.push(...d.map(m=>m.id))}catch(d){c.errors=1,l.extractionErrors.push(`${u.id} failed for ${i}: ${d instanceof Error?d.message:String(d)}`)}l.extractors.push(c)}r.push(l)}return{observations:n,fileCoverage:r}}function Pr(e,t){return t?Ge(e)?/<script\b/iu.test(t):He(e)!==null:!1}function Br(e){let t=new Map(ke.map(n=>[n.id,{id:n.id,applicableFiles:0,observations:0,errors:0}]));for(let n of e)for(let r of n.extractors){let i=t.get(r.id);i&&(i.applicableFiles+=r.applicableFiles,i.observations+=r.observations,i.errors+=r.errors)}return t}function $r(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function Er(e){let t=new Map;for(let n of Se){let r=new Set([...n.producerActions,...n.consumerActions,...n.declarationActions??[]]);for(let i of e){if(!r.has(i.action)||i.strength==="candidate")continue;let a=Ar(i,n.keyNames);if(!a)continue;let o=a.map(d=>`${d.name}=${Dt(d.name,d.value)}`).join("\0"),s=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${s}\0${o}`,u=`boundary-group:${Ot("sha256").update(l).digest("hex").slice(0,16)}`,c=t.get(u)??{id:u,protocol:n.protocol,joinRule:n.id,normalizedKey:o,keyParts:a,producerIds:[],consumerIds:[],declarationIds:[],derivation:{kind:"mechanically-derived",rule:n.id,ruleVersion:"2",inputFactIds:[],sourceSpans:[]}};n.producerActions.includes(i.action)&&c.producerIds.push(i.id),n.consumerActions.includes(i.action)&&c.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&c.declarationIds.push(i.id),c.derivation.inputFactIds.push(i.id),c.derivation.sourceSpans.push(i.source),t.set(u,c)}}return[...t.values()].map(Rr).sort(Mr)}function Rr(e){return{...e,producerIds:be(e.producerIds),consumerIds:be(e.consumerIds),declarationIds:be(e.declarationIds),derivation:{...e.derivation,inputFactIds:be(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function kr(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let a=Se.find(s=>s.id===i.joinRule);if(!a?.traversable)continue;let o=a.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(o.length===0||i.consumerIds.length===0)&&!(a.requireUniquePair&&(o.length!==1||i.consumerIds.length!==1))&&!(a.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(o.length*i.consumerIds.length>Ir))for(let s of o)for(let l of i.consumerIds){let u=n.get(s),c=n.get(l);if(!u||!c||Dr(u,c))continue;let d=u.strength==="derived"||c.strength==="derived"?"derived":"exact",m=`${i.joinRule}\0${s}\0${l}`,p={id:`boundary-link:${Ot("sha256").update(m).digest("hex").slice(0,16)}`,from:s,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:d,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[s,l],sourceSpans:[u.source,c.source]}};r.set(p.id,p)}}return[...r.values()].sort(Vr)}function Lr(e,t){let n=new Set(t.filter(At).flatMap(xe)),r=new Set(t.filter(Tr).flatMap(xe));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function _r(e,t){let n=new Set(e.filter(a=>a.strength!=="candidate").map(a=>`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)),r=new Set(t.flatMap(xe)),i=new Set(t.filter(At).flatMap(xe));return e.filter(a=>a.sourceScope==="production").filter(a=>a.strength!=="candidate"||!n.has(`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)).filter(a=>!i.has(a.id)).map(a=>{let o=a.keyParts.filter(l=>l.evidence==="expression"||l.value.length===0).map(l=>l.name),s=o.length>0?`${a.extractor} observed ${a.action}, but ${o.join(", ")} remained symbolic or unknown.`:a.resolution==="ambiguous"?`${a.extractor} established the address for ${a.action}, but more than one indexed peer has the same runtime key.`:r.has(a.id)?`${a.extractor} established the address for ${a.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${a.extractor} observed ${a.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:a.id,reason:s,missingKeyParts:o,sourceScope:a.sourceScope}}).sort((a,o)=>a.observationId.localeCompare(o.observationId))}function xe(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function At(e){let t=Se.find(r=>r.id===e.joinRule);if(!t)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length===0||e.consumerIds.length===0?!1:!t.requireUniquePair||n.length===1&&e.consumerIds.length===1}function Tr(e){let t=Se.find(r=>r.id===e.joinRule);if(!t?.requireUniquePair)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length>0&&e.consumerIds.length>0&&(n.length!==1||e.consumerIds.length!==1)}function Or(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}function Ar(e,t){let n=[];for(let r of t){let i=e.keyParts.find(a=>a.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:Dt(r,i.value)})}return n}function Dt(e,t){if(e==="method")return t.toUpperCase();if(e!=="path")return t;let n=t.startsWith("/")?t:`/${t}`;return n.length>1?n.replace(/\/+$/u,""):n}function Dr(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function ie(e){return[...new Map(e.map(t=>[t.id,t])).values()].sort((t,n)=>t.source.file.localeCompare(n.source.file)||t.source.startLine-n.source.startLine||t.action.localeCompare(n.action))}function be(e){return[...new Set(e)].sort()}function Mr(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function Vr(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}export{se as a,R as b,Q as c,ee as d,ze as e,wr as f,Vt as g,zt as h,Ye as i};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
49
|
+
//# sourceMappingURL=chunk-ZQ6GAIUV.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as S}from"./chunk-B75HZHUP.js";import{c as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as S}from"./chunk-B75HZHUP.js";import{c as C}from"./chunk-UHFZDQZJ.js";import{a as g}from"./chunk-ETZBIG6K.js";import{f as v}from"./chunk-2QJAVISG.js";import{d as f}from"./chunk-TNLOX4TN.js";function h(n,t={}){return x(n,t).rows}function x(n,t={}){let{limit:a=20,scope:r,minFanIn:b=2,minFanOut:u=2,scanLimit:l}=t,c=new C(n),s=S(c.productionCallableDefinitions({scope:r,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof l=="number"&&l>0}),l),m=t.semantic!==!1,d=v(n,s,{limit:500,semantic:m,semanticEvidence:g}),e=c.calleeEvidenceMap(s,{semantic:m}),i=new Set([...d.incompleteSymbolIds,...e.incompleteSymbolIds]),p=new Set([...d.unavailableSymbolIds,...e.unavailableSymbolIds]);return{rows:s.filter(o=>!i.has(o.symbolId)&&!p.has(o.symbolId)).map(o=>E(o,d.rows.get(o.symbolId)??[],e.rows.get(o.symbolId)??[])).filter(o=>o.fanIn>=b&&o.fanOut>=u).sort((o,y)=>y.score-o.score||y.fanIn-o.fanIn).slice(0,a),coverage:k(m,i,p)}}function D(n,t={}){return h(n,t)}function k(n,t,a){let r=n?t.size>0&&a.size>0?"incomplete-and-unavailable":t.size>0?"incomplete":a.size>0?"unavailable":"complete":"disabled";return{semanticEvidence:{enabled:n,status:r,incompleteSymbolCount:t.size,unavailableSymbolCount:a.size,excludedSymbolCount:new Set([...t,...a]).size}}}function E(n,t,a){let r=[...new Set(t.map(e=>e.file))].sort(),b=[...new Set(t.filter(e=>e.source!=="caller-map-inversion"||e.callEvidence==="scip-chunk").map(e=>e.file))].sort(),u=new Map;for(let e of a.slice(0,500)){if(e.file===n.relativePath)continue;let i=`${e.symbol}|${e.file}`;u.has(i)||u.set(i,{symbol:e.symbol,shortName:f(e.symbol),file:e.file,evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source})}let l=[...u.values()].sort((e,i)=>e.file.localeCompare(i.file)||e.symbol.localeCompare(i.symbol)),c=r.length,s=l.length,m=c*s,d=l.filter(e=>e.evidenceStrength==="candidate").map(e=>e.symbol);return{symbol:n.symbol,shortName:f(n.symbol),fanIn:c,fanOut:s,callerFiles:r,candidateCallerFiles:b,externalCallees:l.map(({symbol:e,shortName:i,file:p})=>({symbol:e,shortName:i,file:p})),externalCalleeEvidence:l,candidateExternalCallees:d,inputBasis:"mixed-static-call-or-reference-evidence",score:m,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${c} incoming file(s) reference this symbol`,`${s} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${m} (fan-in * fan-out)`,`${b.length} incoming file(s) and ${d.length} outgoing target(s) rely on candidate rather than exact call evidence`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{h as a,x as b,D as c};
|
|
2
|
+
//# sourceMappingURL=chunk-ZQE2QYAC.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as I}from"./chunk-5AJQCOZZ.js";import{bb as v,ib as s,lb as E,mb as V}from"./chunk-AJ5HVC5Z.js";import{c as y}from"./chunk-ZZ3MWF33.js";import{F as S,v as h}from"./chunk-ZJNV27DZ.js";import{w}from"./chunk-75VNTSO6.js";import{G as x}from"./chunk-C3PPB2T5.js";var ce={defaultRole:"repository-observation"};function pe(e,n=[]){return{defaultRole:e,...n.length>0?{rules:n}:{}}}function k(e,n){for(let t of e.rules??[]){if(t.when.kind==="option-present"){let r=n.options[t.when.name];if(r!==void 0&&r!==!1)return t.role;continue}if((t.when.kind==="argument"?n.args[t.when.index]:n.options[t.when.name])===t.when.equals)return t.role}return e.defaultRole}function fe(e){return[...new Set([e.defaultRole,...(e.rules??[]).map(n=>n.role)])]}function A(e){return e==="repository-observation"||e==="repository-preview"||e==="composite"}import{AsyncLocalStorage as z}from"async_hooks";var U=1,j=1;var F={policyId:"codebaseiq:unresolved-repository-policy",policyVersion:j,permission:"not-established",reasons:["No repository action policy was supplied for this claim."]};function N(e){return{schemaVersion:U,origin:e.contract.origin,coverage:$(e.coverage),producerValidation:e.contract.producerValidation,stateAuthority:w(e.receipt,e.receipt),repositoryPolicy:e.repositoryPolicy??F,...e.contract.families?{families:e.contract.families}:{}}}function $(e){return e?e.complete===!0?{state:"complete",returned:e.returned,totalKnown:!0,total:e.total??e.returned,omitted:0}:e.totalKnown?{state:"partial",returned:e.returned,totalKnown:!0,...e.total===void 0?{}:{total:e.total},...e.omitted===void 0?{}:{omitted:e.omitted}}:{state:"unknown",returned:e.returned,totalKnown:!1}:{state:"unknown",returned:0,totalKnown:!1}}var W="codebaseiq-result";var G=1,Y=1,_=1,L=1;function M(e){let n=e.resultSchemaVersion??Y;if(!X(n))throw new Error("CLI result schema version must be a positive safe integer.");let{producerVersion:t,...o}=e;return{kind:W,schemaVersion:G,producer:{name:"codebaseiq",version:t},resultSchemaVersion:n,...o}}function J(e,n){return JSON.stringify(e,null,n?0:2)}function X(e){return Number.isSafeInteger(e)&&Number(e)>0}var P=Symbol("option-value-source"),T=new Map,D=new Map,B=new Map,H=new z;function Ie(e,n){return H.run(e,n)}function ke(e){T=new Map(e)}function Ae(e){D=new Map(e)}function Ne(e){B=new Map(e)}function m(e){return(...n)=>{let{args:t,opts:o}=le(n);S(r=>{I(r.generation.identity),e({db:r,args:t,opts:o})})}}function R(e,n){return m(t=>{let o=V(t.db,e,d(t.opts,"full"),{quiet:d(t.opts,"json")});n({...t,budget:o})})}function _e(e){return m(n=>c(n,e,{kind:"list"}))}function Le(e){return m(n=>c(n,e,{kind:"table",headers:e.headers,dashWidths:e.dashWidths}))}function Me(e){return m(n=>c(n,e,{kind:"grouped",key:e.key}))}function Z(e){return m(n=>b(n,e))}function Je(e){return Z({commandName:e.commandName,query:e.query,emptyMessage:e.emptyMessage,heuristicLabel:e.heuristicLabel,before:e.before,render:(n,t)=>s.sectionedReport(e.sections(n,t)),toJson:e.toJson,coverage:e.coverage,agentResult:e.agentResult,after:e.after})}function ee(e,n){return R(e,t=>b(t,{...n,commandName:n.commandName??e}))}function Pe(e,n){return ee(e,{commandName:n.commandName??e,query:n.query,emptyMessage:n.emptyMessage,heuristicLabel:n.heuristicLabel,before:n.before,render:(t,o)=>s.sectionedReport(n.sections(t,o)),toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,after:n.after})}function Te(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"list"}))}function De(e,n){return R(e,t=>c(t,{...n,commandName:e},{kind:"grouped",key:n.key}))}function Be(e,n){return String(e[n])}function He(e,n){let t=e[n];return typeof t=="string"?[t]:Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function qe(e,n){let t=e[n];return typeof t=="string"?t:void 0}function Q(e,n){let t=e[n];return typeof t=="number"?t:void 0}function d(e,n){return!!e[n]}function Ke(e,n){let t=e[n];return Array.isArray(t)&&t.every(o=>typeof o=="string")?t:[]}function Ue(e,n,t){return Q(e,n)??t}function je(e,n,t){let o=Q(e,n),r=o!==void 0&&ne(e,n)!=="default";if(d(e,"full")){if(r)throw new Error("--full cannot be combined with --limit. Use --full for all findings, or --limit N for a capped report.");return Number.MAX_SAFE_INTEGER}return o??t}function ne(e,n){return e[P]?.(n)}function c(e,n,t){b(e,{commandName:n.commandName,query:n.query,emptyMessage:(o,r)=>o.length===0&&n.emptyMessage?n.emptyMessage(r):void 0,heuristicLabel:n.heuristicLabel,render:(o,r)=>{t.kind==="list"?s.list(o,i=>n.format(i,r)):t.kind==="table"?s.table(t.headers,o.map(i=>n.format(i,r)),t.dashWidths):s.groupedByFile(o,i=>n.format(i,r),t.key?i=>t.key(i,r):void 0)},toJson:n.toJson,coverage:n.coverage,agentResult:n.agentResult,before:n.before,after:n.after})}function b(e,n){let t=n.query(e);if(d(e.opts,"json")){if(!n.commandName)throw new Error("JSON output requires a command name so its result contract can be identified.");oe(n.commandName,e.args,e.opts,n.toJson?n.toJson(t,e):t,{analysisBudget:te(e),coverage:n.coverage?.(t,e),agentResult:n.agentResult?.(t,e),resultSchemaVersion:n.resultSchemaVersion});return}let o=n.emptyMessage?.(t,e);if(o){s.empty(o);return}n.heuristicLabel&&E(n.heuristicLabel),n.before?.(t,e),n.render(t,e),n.after?.(t,e)}function te(e){return e.budget?.analysisBudget}function oe(e,n,t,o,r={}){let i=T.get(e),a=D.get(e),u=B.get(e),p=a?k(a.operation,{args:n,options:t}):void 0,f=H.getStore();if(f!==void 0&&p!==void 0&&f!==p)throw new Error(`Command ${e} changed operation role during execution: selected ${f}, rendered ${p}.`);let g=f??p,O=de(o),C=r.coverage??ae(a,o,r.analysisBudget),l=C&&O&&!C.resolution?{...C,resolution:O}:C;if(l&&ie(l),d(t,"resultOnly")){let K=Object.hasOwn(r,"resultOnly")?r.resultOnly:o;y(JSON.stringify(K,null,d(t,"compact")?0:2));return}let q=M({producerVersion:x,command:e,...g?{operationRole:g}:{},...i?{evidence:i}:{},...r.analysisBudget?{analysisBudget:r.analysisBudget}:{},args:ue(n),options:t,result:o,...l?{coverage:l}:{},...r.agentResult!==void 0?{agentResult:r.agentResult}:{},...re(g,i,r.analysisBudget,l,u,r.observationReceipt),...r.resultSchemaVersion===void 0?{}:{resultSchemaVersion:r.resultSchemaVersion}});y(J(q,d(t,"compact")))}function re(e,n,t,o,r,i){if(!e||!A(e))return{};let a=h(),u=i??(a?v({projectRoot:a.config.projectRoot,db:a,...r?{observedSourceKinds:r.observedSources}:{}}):void 0);return u?{evidenceContext:{schemaVersion:_,operationRole:e,receipt:u,analysisManifest:{schemaVersion:L,...n?{evidence:n}:{},...t?{analysisBudget:t}:{},...o?{coverage:o}:{},...r?{claimQualification:N({contract:r,receipt:u,...o?{coverage:o}:{}})}:{}}}}:{}}function ie(e){if(!Number.isSafeInteger(e.returned)||e.returned<0)throw new Error("Invocation coverage returned count must be a non-negative safe integer.");if(e.complete!==!0&&e.complete!==!1&&e.complete!==null)throw new Error("Invocation coverage complete must be true, false, or null.");if(e.complete===!0){if(!e.totalKnown)throw new Error("Complete invocation coverage must know its total.");if(!Number.isSafeInteger(e.total)||e.total!==e.returned)throw new Error("Complete invocation coverage total must equal returned.");if(e.omitted!==0)throw new Error("Complete invocation coverage cannot omit results.");if(e.omittedIdentities!==void 0)throw new Error("Complete invocation coverage cannot name omitted identities.");if(e.continuation!==void 0)throw new Error("Complete invocation coverage cannot provide a continuation.")}else if(e.totalKnown){if(e.complete!==!1)throw new Error("Known incomplete invocation coverage must set complete to false.");if(!Number.isSafeInteger(e.total)||e.total<e.returned)throw new Error("Known invocation coverage total must be a safe integer at least as large as returned.");let n=e.total-e.returned;if(e.omitted!==n)throw new Error("Known invocation coverage omitted count must equal total minus returned.");if(n===0)throw new Error("Known incomplete invocation coverage must omit at least one result.");if(e.omittedIdentities&&e.omittedIdentities.length!==n)throw new Error("Omitted identity count must equal the disclosed omitted count.")}else{if(e.total!==void 0||e.omitted!==void 0)throw new Error("Unknown invocation coverage cannot claim a total or omitted count.");if(e.omittedIdentities!==void 0)throw new Error("Unknown invocation coverage cannot claim omitted identities.")}if(e.continuation&&(e.continuation.cursor.length===0||e.continuation.indexGeneration.length===0))throw new Error("Invocation coverage continuation requires a cursor and index generation.");if(e.resolution){if(!Number.isSafeInteger(e.resolution.totalCandidates)||e.resolution.totalCandidates<0)throw new Error("Invocation resolution candidate count must be a non-negative safe integer.");if(e.resolution.state==="exact"&&e.resolution.totalCandidates!==1)throw new Error("Exact invocation resolution must name exactly one candidate.");if(e.resolution.state==="missing"&&e.resolution.totalCandidates!==0)throw new Error("Missing invocation resolution cannot name candidates.");if(e.resolution.state==="ambiguous"&&e.resolution.totalCandidates<2)throw new Error("Ambiguous invocation resolution must name at least two candidates.")}}function ae(e,n,t){if(!e)return;let o=se(e,n);return e.coverage==="complete"?{complete:!0,totalKnown:!0,returned:o,total:o,omitted:0}:e.coverage==="sampled"?{complete:!1,totalKnown:!1,returned:o}:e.coverage==="bounded"&&t?{complete:!1,totalKnown:!1,returned:o}:{complete:null,totalKnown:!1,returned:o}}function se(e,n){let t=e.resultUnits??{kind:"report"};if(t.kind==="rows")return Array.isArray(n)?n.length:0;if(t.kind==="field"){if(!n||typeof n!="object")return 0;let o=n[t.field];return Array.isArray(o)?o.length:o==null?0:1}return n==null?0:1}function de(e){if(!e||typeof e!="object"||Array.isArray(e))return;let n=e;if(n.matched===!1)return{state:"missing",totalCandidates:0};if(n.matched!==!0||!Number.isSafeInteger(n.totalMatches))return;let t=n.totalMatches;return t<=0?{state:"missing",totalCandidates:0}:t===1?{state:"exact",totalCandidates:t}:{state:"ambiguous",totalCandidates:t}}function ue(e){return e.filter(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean")}function le(e){if(e.length===0)return{args:[],opts:{}};let n=e[e.length-1];return{args:e.slice(0,-1),opts:me(n)}}function me(e){if(!e||typeof e!="object")return{};let n=e,t=typeof n.optsWithGlobals=="function"?n.optsWithGlobals.bind(n):typeof n.opts=="function"?n.opts.bind(n):null;if(t){let o=t();return!o||typeof o!="object"?{}:(typeof n.getOptionValueSource=="function"&&Object.defineProperty(o,P,{value:r=>n.getOptionValueSource(r),enumerable:!1}),o)}return e}export{ce as a,pe as b,k as c,fe as d,Ie as e,ke as f,Ae as g,Ne as h,m as i,R as j,_e as k,Le as l,Me as m,Z as n,Je as o,ee as p,Pe as q,Te as r,De as s,Be as t,He as u,Qe as v,qe as w,Q as x,d as y,Ke as z,Ue as A,je as B,ne as C,oe as D,le as E,me as F};
|
|
2
|
+
//# sourceMappingURL=chunk-ZUQ2MDFT.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{A as j,B as k,C as l,D as m,E as n,F as o,G as p,r as a,s as b,t as c,u as d,v as e,w as f,x as g,y as h,z as i}from"./chunk-OSZ7PW5K.js";import"./chunk-AZDY3EKD.js";import"./chunk-KPMMOAV5.js";import"./chunk-Z2L5H2HF.js";export{b as activateCliProjectContext,n as collect,c as currentCliDatabase,o as formatBytes,p as formatStatus,i as openDb,j as openProjectDb,f as prepareWorktreeIndex,h as residentQueryLaneEligible,e as resolveActiveDbPath,d as resolveCliProjectContext,a as resolveProjectRoot,k as rootIndexFallbackWarning,l as setResidentDatabaseProvider,g as sharedCachePreparationEligible,m as withDb};
|
|
3
|
+
//# sourceMappingURL=cli-context-4R2LREXQ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as h,B as i,C as j,D as k,E as l,F as m,G as n,H as o,I as p,t as a,u as b,v as c,w as d,x as e,y as f,z as g}from"./chunk-ZJNV27DZ.js";import"./chunk-75VNTSO6.js";import"./chunk-E7T22WET.js";import"./chunk-EDMG5CSO.js";import"./chunk-3F23W57G.js";import"./chunk-R2NOK63J.js";import"./chunk-OZI44VCR.js";import"./chunk-C3PPB2T5.js";export{b as activateCliProjectContext,n as collect,c as currentCliDatabase,o as formatBytes,p as formatStatus,i as openDb,j as openProjectDb,f as prepareWorktreeIndex,h as residentQueryLaneEligible,e as resolveActiveDbPath,d as resolveCliProjectContext,a as resolveProjectRoot,k as rootIndexFallbackWarning,l as setResidentDatabaseProvider,g as sharedCachePreparationEligible,m as withDb};
|
|
2
|
+
//# sourceMappingURL=cli-context-6X7JYARX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{c as X}from"./chunk-OFUC6R46.js";import{a as Y}from"./chunk-EYSJHKX6.js";import{c as Z}from"./chunk-OZ2M2X7A.js";import{a as Q}from"./chunk-7HBBVZJ6.js";import{a as C}from"./chunk-GXOFPAIR.js";import"./chunk-RNPG5P4P.js";import{c as q,d as W,e as B,f as G,g as J,h as K}from"./chunk-YXZAAQHZ.js";import{j as V,l as M,n as L}from"./chunk-74LRKLNC.js";import{o as z,p as H}from"./chunk-JG5OWAEB.js";import"./chunk-DQZF7MP6.js";import"./chunk-B2OB55RR.js";import{a as y,b as U}from"./chunk-XZEE23VG.js";import{D as _,b as j,c as $,e as p,r as k,s as u,u as T,x as I}from"./chunk-OSZ7PW5K.js";import{e as F}from"./chunk-FPUJRBHL.js";import"./chunk-RS6UYNEP.js";import{La as A,Ma as N,Na as S,Oa as D,Pa as R,l as c}from"./chunk-AZDY3EKD.js";import{e as x,s as O}from"./chunk-KPMMOAV5.js";import{b as P}from"./chunk-Z2L5H2HF.js";import{Command as Ne,Help as Se}from"commander";import{Option as de}from"commander";function b(e){return e.evidence?e.evidence:me.has(e.id)?"mixed":e.heuristic?"heuristic":"graph-fact"}var me=new Set(["health","context","co-change"]);function ee(e){if(e.claims){if(e.claims.origin==="mixed"&&!e.claims.families?.length)throw new Error(`Mixed command ${e.id} must declare at least one claim family.`);return e.claims}let t=b(e);if(t==="mixed")throw new Error(`Mixed command ${e.id} must declare claim families.`);let n=e.agent?W(e.agent.operation):[];return n.length>0&&n.every(o=>o==="repository-observation"||o==="repository-preview")?{origin:t==="heuristic"?"heuristic":"compiler-graph",observedSources:["index-generation"],producerValidation:{status:"not-evaluated"}}:{origin:"unknown",observedSources:["process"],producerValidation:{status:"not-evaluated"}}}var te;function ne(){return te||{argv:process.argv.slice(2),execPath:process.execPath,...process.argv[1]!==void 0?{scriptPath:process.argv[1]}:{},cwd:process.cwd()}}function oe(e,t){return G(new Map(t.map(n=>[n.id,b(n)]))),K(new Map(t.map(n=>[n.id,ee(n)]))),J(new Map(t.flatMap(n=>n.agent?[[n.id,{...n.agent,resultUnits:pe(n)}]]:[]))),t.map(n=>{let i=n.hidden?e.command(n.command,{hidden:!0}):e.command(n.command);i.description(n.description),n.helpAfter&&i.addHelpText("after",`
|
|
3
|
+
${n.helpAfter.trim()}
|
|
4
|
+
`);for(let o of n.arguments??[])i.argument(o.name);for(let o of n.options??[])if(o.hidden){let r=new de(o.flags,o.description).hideHelp();o.parser&&r.argParser(o.parser),Object.hasOwn(o,"defaultValue")&&r.default(o.defaultValue),i.addOption(r)}else o.parser&&Object.hasOwn(o,"defaultValue")?i.option(o.flags,o.description,o.parser,o.defaultValue):o.parser?i.option(o.flags,o.description,o.parser):Object.hasOwn(o,"defaultValue")?i.option(o.flags,o.description,o.defaultValue):i.option(o.flags,o.description);return i.action(async(...o)=>{try{let r=i.optsWithGlobals();le(r);let a=ne(),l=()=>n.id===V?n.handler(...o):M({command:n.id,producerVersion:c,invocationPrefix:a.scriptPath?[a.execPath,a.scriptPath]:["codebaseiq"],argv:[...a.argv],cwd:a.cwd,json:r.json===!0,sourceSession:r.session!==!1,reemitSource:r.reemit===!0,...typeof r.outputPageSize=="number"?{pageSize:r.outputPageSize}:{},...typeof r.outputCursor=="string"?{cursor:r.outputCursor}:{}},()=>n.handler(...o)),m=n.agent?q(n.agent.operation,{args:o.slice(0,-1),options:r}):void 0;await(m?B(m,l):l())}catch(r){ue(r)}finally{u(void 0),p(void 0),$()}}),{descriptor:n,command:i}})}function le(e){if(e.resultOnly===!0&&e.json!==!0)throw new Error("--result-only requires --json.");if(e.compact===!0&&e.json!==!0)throw new Error("--compact requires --json.")}function pe(e){let t=e.agent?.resultUnits;if(t?.kind==="field"&&t.field.trim()==="")throw new Error(`Command ${e.id} declares an empty result-unit field.`);return t||(e.renderShape==="list"||e.renderShape==="table"||e.renderShape==="grouped-by-file"?{kind:"rows"}:{kind:"report"})}function ue(e){console.error(U(Y(e))),process.exitCode=1}import{existsSync as fe,mkdirSync as he,writeFileSync as ge}from"fs";import{homedir as Ce}from"os";import{join as v}from"path";var ve=1440*60*1e3,ie="update-check.json",ye="https://registry.npmjs.org/codebaseiq/latest";async function ae(e={}){let t=e.env??process.env;if(t.CODEBASEIQ_UPDATE_CHECK==="0"||t.NO_UPDATE_NOTIFIER||P(t))return;let n=e.cacheDir??Ee(t),i=e.now??Date.now(),o=e.currentVersion??c,r=xe(n),a=r&&i-r.checkedAt<ve?r.latestVersion:await Pe(n,e.fetchLatestVersion??Ae,i);if(!a||!we(a,o))return;(e.writeNotice??(m=>console.error(m)))(be(o,a))}function be(e,t){return[`codebaseiq update available: ${e} -> ${t}.`,"Agent: tell your human to update with: npm install -g codebaseiq@latest",""].join(`
|
|
5
|
+
`)}function we(e,t){let n=re(e),i=re(t);if(!n||!i)return e!==t;for(let o=0;o<n.length;o++){let r=n[o]-i[o];if(r>0)return!0;if(r<0)return!1}return!1}function Ee(e){let t=e.XDG_CACHE_HOME||v(Ce(),".cache");return v(t,"codebaseiq")}function xe(e){let t=v(e,ie);if(!fe(t))return null;try{let n=JSON.parse(O(t,"update notice cache"));return typeof n.checkedAt=="number"&&(typeof n.latestVersion=="string"||n.latestVersion===null)?{checkedAt:n.checkedAt,latestVersion:n.latestVersion}:null}catch{return null}}async function Pe(e,t,n){let i;try{i=await t()}catch{i=null}return Oe(e,{checkedAt:n,latestVersion:i}),i}function Oe(e,t){try{he(e,{recursive:!0}),ge(v(e,ie),`${JSON.stringify(t,null,2)}
|
|
6
|
+
`)}catch{}}async function Ae(){let e=await fetch(ye,{signal:AbortSignal.timeout(1e3)});if(!e.ok)return null;let t=await e.json();return typeof t.version=="string"?t.version:null}function re(e){let t=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}async function ht(e={}){let t=new Ne;e.resident&&t.exitOverride(),e.terminalOutput&&t.configureOutput({writeOut:o=>process.stdout.write(y(o)),writeErr:o=>process.stderr.write(y(o))}),t.name("codebaseiq").description("Language-agnostic code intelligence CLI powered by SCIP indexes").version(c).option("--output-page-size <characters>","Return bounded output pages with an exact continuation command",L).option("--output-cursor <cursor>","Continue a bounded output page").option("--no-session","Disable the explicit exploration evidence ledger").option("--reemit","Recovery only: render source and graph evidence again instead of citing session receipts").option("--help-all","Display every command, including compatibility and deprecated controls");let n=await X(e.invocationCommand);oe(t,n);let i=new Se;return t.configureHelp({formatHelp:(o,r)=>o===t?Z(t,n):i.formatHelp(o,r)}),t.hook("preAction",async(o,r)=>{let a=r.name();if(e.resident){await e.resident.preAction(a);return}let l=I(a),m=z(a);if(!l&&!m){ce(),await se(a);return}let d=k(),f=x(d);j(f);let h=T(d,f);u(h),ce(),await se(a);let{config:w,paths:E}=h;if(l){let s=await Q({commandName:a,projectRoot:d,config:w,paths:E,dbPathSource:h.dbPathSource,dbPath:h.dbPath,gitContext:f});s.freshness&&p({state:s.freshness.state,reason:s.freshness.reason,...s.freshness.updatedAt?{indexUpdatedAt:s.freshness.updatedAt}:{},...s.freshness.changedFiles?{changedFiles:s.freshness.changedFiles}:{}}),process.env.CODEBASEIQ_DEBUG&&console.error(`evidence-freshness: ${s.source}`),s.service.kind==="failed"&&console.error(`warning: codebaseiq watch service did not start: ${s.service.message}`),(s.service.kind==="failed"||s.service.kind==="skipped")&&C(d,c);return}if(!m){C(d,c);return}let g=H({commandName:a,projectRoot:d,cacheDir:E.cacheDir,cliVersion:c,config:w,gitContext:f});g.kind==="failed"&&console.error(`warning: codebaseiq watch service did not start: ${g.message}`),(g.kind==="failed"||g.kind==="skipped")&&C(d,c)}),t.hook("postAction",()=>{u(void 0),p(void 0)}),{program:t,descriptors:n}}async function se(e){e.startsWith("__")||await ae({commandName:e})}function ce(){if(S(),!A()||D())return;let e=null;try{e=_(t=>F(t))}catch{}R({command:N()??`codebaseiq ${process.argv.slice(2).join(" ")}`,toolVersion:c,projectFingerprint:e})}export{ht as createCliProgram};
|
|
7
|
+
//# sourceMappingURL=cli-program-MXA3WTAO.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{b as n}from"./chunk-
|
|
2
|
+
import{b as n}from"./chunk-6NUURWPF.js";import{d as s}from"./chunk-XZEE23VG.js";import"./chunk-RS6UYNEP.js";import"./chunk-KPMMOAV5.js";import"./chunk-Z2L5H2HF.js";import{realpathSync as p}from"fs";import{fileURLToPath as y}from"url";import{constants as c,setPriority as u}from"os";var m="CODEBASEIQ_PROCESS_PRIORITY";function d(r=process.env){let o=r[m]?.trim().toLowerCase();return o==="low"||o==="idle"?o:null}function a(r=process.env,o=u){let e=d(r);if(e===null)return null;let t=e==="idle"?c.priority.PRIORITY_LOW:c.priority.PRIORITY_BELOW_NORMAL;try{o(t)}catch{}return e}if(f()){a(),s();try{await P()}catch(r){let{describeCliFailure:o}=await import("./cli-failure-RECEHOM2.js");console.error(o(r)),process.env.CODEBASEIQ_DEBUG&&r instanceof Error&&r.stack&&console.error(r.stack),process.exitCode=1}}async function P(){let r=process.argv.includes("--help-all");if(!r){let i=await n(process.argv.slice(2));if(i.served)return;process.env.CODEBASEIQ_DEBUG&&console.error(`query-lane: ${i.reason}`)}let{normalizeLegacyEvidenceInvocation:o}=await import("./invocation-command-descriptors-35JULLNR.js");o(process.argv);let{createCliProgram:e}=await import("./cli-program-MXA3WTAO.js"),{program:t,descriptors:l}=await e({...process.argv[2]!==void 0?{invocationCommand:process.argv[2]}:{},terminalOutput:!0});if(r){let{renderRootCommandHelp:i}=await import("./command-panels-OXMCJ2QZ.js");process.stdout.write(i(t,l,{includeCompatibility:!0}));return}await t.parseAsync()}function f(){if(!process.argv[1])return!1;let r=y(import.meta.url);try{return p(r)===p(process.argv[1])}catch{return r===process.argv[1]}}
|
|
3
3
|
//# sourceMappingURL=cli.js.map
|