codebaseiq 0.1.0 → 0.2.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 +47 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-DQMDCD24.js → chunk-27PHVDKL.js} +2 -2
- package/dist/{chunk-ZMI2JSX2.js → chunk-2DMVFAY7.js} +2 -2
- package/dist/{chunk-5PUWMSDU.js → chunk-2E6BTWER.js} +2 -2
- package/dist/{chunk-YESXMKX3.js → chunk-2F5ERMNI.js} +2 -2
- package/dist/chunk-2VKB5CMA.js +60 -0
- package/dist/{chunk-NNJ2KZZG.js → chunk-327YK6TB.js} +4 -4
- package/dist/chunk-347TXATM.js +2 -0
- package/dist/{chunk-VEXUL62T.js → chunk-35YYZD3D.js} +2 -2
- package/dist/chunk-36WRYYTE.js +3 -0
- package/dist/chunk-37TKC6MB.js +2 -0
- package/dist/{chunk-FAJQ7LWY.js → chunk-3AC56WAR.js} +2 -2
- package/dist/{chunk-JE3WZ6II.js → chunk-3NUZVLR7.js} +2 -2
- package/dist/{chunk-UZGZB3VB.js → chunk-3XFJUWJE.js} +2 -2
- package/dist/{chunk-OVTS4DKB.js → chunk-4AOOSCZ7.js} +2 -2
- package/dist/{chunk-LU3BMVH2.js → chunk-4IFISPQW.js} +2 -2
- package/dist/chunk-4NHWNAWQ.js +11 -0
- package/dist/chunk-4O52YNKL.js +5 -0
- package/dist/{chunk-HPJRBHVT.js → chunk-54K6556S.js} +2 -2
- package/dist/{chunk-HRWGYWRJ.js → chunk-57GCCPLS.js} +2 -2
- package/dist/{chunk-J77SU6VA.js → chunk-57KEZDPT.js} +2 -2
- package/dist/{chunk-OFBE4NGP.js → chunk-57KFVPVZ.js} +2 -2
- package/dist/{chunk-WOQBZPIF.js → chunk-5BDK6QC3.js} +2 -2
- package/dist/{chunk-7MGU3HPH.js → chunk-5IO2APSS.js} +2 -2
- package/dist/chunk-5NJPH3QZ.js +61 -0
- package/dist/{chunk-GW6Z3WGY.js → chunk-5WXOEJ4G.js} +2 -2
- package/dist/chunk-5XEVXVTK.js +3 -0
- package/dist/{chunk-RR7SX44N.js → chunk-6OVNYYY4.js} +2 -2
- package/dist/{chunk-ZV3JV5G5.js → chunk-6SDEQTVY.js} +2 -2
- package/dist/{chunk-EF2R3WNQ.js → chunk-6URCE5QY.js} +2 -2
- package/dist/{chunk-UCD3H3UZ.js → chunk-6ZV5EDUT.js} +2 -2
- package/dist/{chunk-C6SBF2WH.js → chunk-77GHPR2R.js} +2 -2
- package/dist/{chunk-YVCIMIOC.js → chunk-7R64XY4Y.js} +2 -2
- package/dist/{chunk-VXYS3FZD.js → chunk-7Z7HCZ7J.js} +2 -2
- package/dist/{chunk-CO5R3UNA.js → chunk-A67HT5FR.js} +2 -2
- package/dist/{chunk-UDS562V4.js → chunk-A7XQT7MH.js} +2 -2
- package/dist/{chunk-RDBI2RXU.js → chunk-ACZDU5GK.js} +2 -2
- package/dist/{chunk-FETNQCFO.js → chunk-AM5SUGHF.js} +2 -2
- package/dist/{chunk-NNOKTMZT.js → chunk-B2E3HZ2A.js} +2 -2
- package/dist/{chunk-CVYSU6BX.js → chunk-BH5CE4LN.js} +2 -2
- package/dist/chunk-BLKYYQ7C.js +543 -0
- package/dist/{chunk-4WKDMDEW.js → chunk-BX2U3QQV.js} +2 -2
- package/dist/{chunk-ZKX2FRS6.js → chunk-CANBLFVQ.js} +2 -2
- package/dist/{chunk-SMRBZ6EC.js → chunk-CCRZLRWJ.js} +2 -2
- package/dist/chunk-CDWSLAPN.js +21 -0
- package/dist/chunk-CIVYHK7U.js +22 -0
- package/dist/{chunk-L57ZKWVG.js → chunk-CMXW7MFV.js} +2 -2
- package/dist/{chunk-T3DGWPXM.js → chunk-CSZOQ7YO.js} +2 -2
- package/dist/{chunk-ZZXSWSN6.js → chunk-CWMHWD56.js} +2 -2
- package/dist/{chunk-6NW7MU72.js → chunk-CZEIHYMP.js} +2 -2
- package/dist/{chunk-DO6WQD2T.js → chunk-D62CTZX6.js} +2 -2
- package/dist/{chunk-XWUOUWYI.js → chunk-DFPAZXLU.js} +2 -2
- package/dist/{chunk-MOVBWNIP.js → chunk-DKJXK3HA.js} +2 -2
- package/dist/{chunk-XMQ23E27.js → chunk-DLC6JDN7.js} +2 -2
- package/dist/chunk-DUKHVPU5.js +4 -0
- package/dist/{chunk-ID63777H.js → chunk-DVYG3JTA.js} +2 -2
- package/dist/{chunk-NE6IU5ZD.js → chunk-EFFMFK7C.js} +2 -2
- package/dist/{chunk-I2T2LLK2.js → chunk-EM5UHLAM.js} +2 -2
- package/dist/chunk-EN4AHLL3.js +3 -0
- package/dist/chunk-EXMVF3JR.js +3 -0
- package/dist/{chunk-SWHMHUKF.js → chunk-FEBLLMTL.js} +2 -2
- package/dist/chunk-FIXYHQ3W.js +3 -0
- package/dist/{chunk-RKEJ6VTF.js → chunk-FLLXYUOL.js} +2 -2
- package/dist/{chunk-KWVHSKHK.js → chunk-FPDL2TUB.js} +2 -2
- package/dist/chunk-FQA3KIFX.js +17 -0
- package/dist/chunk-FWY2PRIF.js +3 -0
- package/dist/chunk-FY5V4V4F.js +2 -0
- package/dist/chunk-G2XUZCF2.js +88 -0
- package/dist/{chunk-QHRNXP3C.js → chunk-GXVDTHFC.js} +2 -2
- package/dist/{chunk-6MUIJMVL.js → chunk-H3CKAL6P.js} +2 -2
- package/dist/chunk-H5QXP63L.js +2 -0
- package/dist/{chunk-VUIYB2V3.js → chunk-HBQGKMM3.js} +2 -2
- package/dist/{chunk-PYAB5SM6.js → chunk-HBXZAGY6.js} +2 -2
- package/dist/{chunk-NNO6A2PO.js → chunk-HCMQZPEO.js} +2 -2
- package/dist/{chunk-Q65CQ4XL.js → chunk-HHBBGWES.js} +2 -2
- package/dist/{chunk-GTXSJDCO.js → chunk-HIEXRDJF.js} +2 -2
- package/dist/{chunk-4FC325IF.js → chunk-HYKSLTAR.js} +2 -2
- package/dist/{chunk-XLQ3GLWZ.js → chunk-I2KP4AGR.js} +2 -2
- package/dist/chunk-I5FCDTK2.js +2 -0
- package/dist/{chunk-QKPLA6IC.js → chunk-I645ZF75.js} +2 -2
- package/dist/{chunk-FDGD5AB5.js → chunk-IBM3F2BJ.js} +2 -2
- package/dist/{chunk-Q72QSKXC.js → chunk-IEL6Q5W3.js} +38 -38
- package/dist/{chunk-NCZUNH3E.js → chunk-IGQQUENU.js} +12 -12
- package/dist/chunk-IGYAZPRX.js +4 -0
- package/dist/chunk-IOVPAZWP.js +3 -0
- package/dist/{chunk-OL6KJP3N.js → chunk-IVJJNVSX.js} +2 -2
- package/dist/{chunk-AKB7V7TV.js → chunk-IWAMYGPN.js} +2 -2
- package/dist/chunk-IYBIBMPF.js +90 -0
- package/dist/{chunk-IOP6FWIM.js → chunk-J24VICI5.js} +2 -2
- package/dist/{chunk-C7QOQX32.js → chunk-JN5LIBT3.js} +2 -2
- package/dist/{chunk-O6QTXQPJ.js → chunk-JOALNFY3.js} +2 -2
- package/dist/{chunk-GCHRX4YW.js → chunk-JUO3Z644.js} +2 -2
- package/dist/{chunk-BJ6SQAEN.js → chunk-JXHLB7TP.js} +2 -2
- package/dist/{chunk-IJ4HMYBE.js → chunk-JYX5UZSZ.js} +2 -2
- package/dist/chunk-K2O7SBAU.js +2 -0
- package/dist/{chunk-OLF4MA5W.js → chunk-K5G7SPAG.js} +2 -2
- package/dist/{chunk-YSNONTJ2.js → chunk-KDYQQJ6X.js} +2 -2
- package/dist/{chunk-7NVGT435.js → chunk-KM4QRWI5.js} +2 -2
- package/dist/{chunk-HKQUXIFO.js → chunk-KNV5VFDV.js} +2 -2
- package/dist/chunk-L3YSDLNB.js +2 -0
- package/dist/{chunk-EZNMUY67.js → chunk-LAGDJXFY.js} +2 -2
- package/dist/{chunk-ENCCHKM6.js → chunk-LY2NB5XR.js} +4 -4
- package/dist/chunk-M4EVGA5S.js +14 -0
- package/dist/chunk-M7LAIM77.js +127 -0
- package/dist/{chunk-BVAJLC5A.js → chunk-MRGTCMDK.js} +2 -2
- package/dist/{chunk-OZYRSMSH.js → chunk-MT5W4DUG.js} +2 -2
- package/dist/{chunk-VE5AVNMP.js → chunk-MTMF4N7F.js} +2 -2
- package/dist/chunk-N3Q3AWGW.js +545 -0
- package/dist/{chunk-TXXOEMZJ.js → chunk-NDGTJHQN.js} +2 -2
- package/dist/chunk-NIO346UL.js +2 -0
- package/dist/chunk-NJA4MMBD.js +2 -0
- package/dist/{chunk-7FND7D7N.js → chunk-NK76RSB6.js} +2 -2
- package/dist/{chunk-H3LGFZVK.js → chunk-NTRW52UR.js} +2 -2
- package/dist/{chunk-JOIRNPPY.js → chunk-OJFLPVBP.js} +2 -2
- package/dist/{chunk-KMITESMT.js → chunk-OMBRP7BB.js} +2 -2
- package/dist/{chunk-UP3BUZR5.js → chunk-OVKZM2XI.js} +2 -2
- package/dist/{chunk-MVB3DAEY.js → chunk-PARCKE3Q.js} +2 -2
- package/dist/{chunk-CAUCPUOF.js → chunk-PFPHS4NO.js} +2 -2
- package/dist/chunk-PHPQ24UG.js +22 -0
- package/dist/chunk-PLZXWZHY.js +77 -0
- package/dist/{chunk-34WBMAYK.js → chunk-PNVZIJ57.js} +2 -2
- package/dist/{chunk-SYDJMPES.js → chunk-QKVTWODE.js} +2 -2
- package/dist/{chunk-FW53T7EB.js → chunk-QLTFXVUI.js} +2 -2
- package/dist/{chunk-PBI2LFKH.js → chunk-QMGWSEPL.js} +2 -2
- package/dist/{chunk-CQP3THUZ.js → chunk-QVHZB75Z.js} +2 -2
- package/dist/{chunk-6BQ3DSPK.js → chunk-QVWDQTMG.js} +2 -2
- package/dist/{chunk-ST7V3SKN.js → chunk-RCPZOPV6.js} +2 -2
- package/dist/chunk-RJWAB4VR.js +345 -0
- package/dist/chunk-RRPK327J.js +20 -0
- package/dist/chunk-RVYLJDXC.js +21 -0
- package/dist/chunk-RWKEXCHU.js +3 -0
- package/dist/{chunk-L4NRUAGJ.js → chunk-S5SKXCND.js} +2 -2
- package/dist/{chunk-RBAS5ZHI.js → chunk-S64NCE2Z.js} +2 -2
- package/dist/{chunk-WMPRTGH2.js → chunk-SF34QLK2.js} +2 -2
- package/dist/{chunk-ANFVSJWQ.js → chunk-SJZQ2PTZ.js} +2 -2
- package/dist/{chunk-4XTAUQFD.js → chunk-SRY26ITJ.js} +2 -2
- package/dist/chunk-SV2LEFVM.js +2 -0
- package/dist/{chunk-7XAN6GKB.js → chunk-T3YFIJ5P.js} +2 -2
- package/dist/chunk-T55YPJGB.js +3 -0
- package/dist/chunk-TAJ6UGCO.js +21 -0
- package/dist/{chunk-PIOMTC27.js → chunk-TUTSO7UZ.js} +2 -2
- package/dist/{chunk-FQKZWM4L.js → chunk-U24M5RQM.js} +5 -5
- package/dist/{chunk-XME3HPXZ.js → chunk-U2XX3BT4.js} +2 -2
- package/dist/{chunk-SZD2KF7Q.js → chunk-UWB5WMC2.js} +2 -2
- package/dist/{chunk-6CS3UQTN.js → chunk-VCL7FK3E.js} +2 -2
- package/dist/{chunk-N3IQCBCF.js → chunk-VCWAJPXQ.js} +2 -2
- package/dist/{chunk-LZYFLFEH.js → chunk-VG55NFXF.js} +2 -2
- package/dist/{chunk-PTAWHLVJ.js → chunk-VLTUX4IF.js} +2 -2
- package/dist/{chunk-JEJLSICM.js → chunk-VVCBMH5O.js} +2 -2
- package/dist/{chunk-JSOYNVWH.js → chunk-VYZQZ4ZN.js} +2 -2
- package/dist/chunk-W3FK73MD.js +8 -0
- package/dist/{chunk-UNBY47BC.js → chunk-W6C6QTXJ.js} +2 -2
- package/dist/chunk-WH5SYOMD.js +2 -0
- package/dist/chunk-WJOQC4P7.js +7 -0
- package/dist/chunk-WO47BIPY.js +3 -0
- package/dist/chunk-WOOTEWQT.js +239 -0
- package/dist/{chunk-UBGWN7I4.js → chunk-X5I2BQGX.js} +2 -2
- package/dist/{chunk-PX4RYAAK.js → chunk-XNUWRTYM.js} +2 -2
- package/dist/{chunk-ICFDQHAM.js → chunk-XUJM6474.js} +2 -2
- package/dist/chunk-XYLV727H.js +21 -0
- package/dist/{chunk-TRRC4ZJ7.js → chunk-YFQPWKHR.js} +2 -2
- package/dist/{chunk-NEDP5RFQ.js → chunk-YIOQJ45A.js} +2 -2
- package/dist/{chunk-Y6KHROC3.js → chunk-YXJ4IAHH.js} +2 -2
- package/dist/chunk-YYFV32WR.js +3 -0
- package/dist/{chunk-BH5F2Q4O.js → chunk-ZB3V5QM7.js} +2 -2
- package/dist/chunk-ZJZQ7Q2Q.js +3 -0
- package/dist/{chunk-EMNIHCRB.js → chunk-ZNQCR656.js} +2 -2
- package/dist/{chunk-TIIC3ZE7.js → chunk-ZOEDRCR4.js} +2 -2
- package/dist/cli-context-TSADTXLB.js +2 -0
- package/dist/cli-context-XEPPF4RX.js +3 -0
- package/dist/cli-program-KJGQEM72.js +7 -0
- package/dist/cli.js +1 -1
- package/dist/{code-DlqpBDd0.d.ts → code-CDe-mIjx.d.ts} +1 -1
- package/dist/code-viewer-YGDON6SY.js +12 -0
- package/dist/code-viewer-ZCTHXQ5C.js +11 -0
- package/dist/command-descriptors-5VAB2MZX.js +335 -0
- package/dist/command-descriptors-EAHKIRAG.js +337 -0
- package/dist/{config-types-BNoC96J3.d.ts → config-types-D6X5S68_.d.ts} +50 -0
- package/dist/{db-D7sauVFH.d.ts → db-DmRNdCtm.d.ts} +1 -1
- package/dist/direct-navigation-B3SGOOBW.js +2 -0
- package/dist/direct-navigation-ZL362KXF.js +3 -0
- package/dist/{graph-evidence-BIFqyisO.d.ts → graph-evidence-Bs54NWws.d.ts} +1 -1
- package/dist/{health-DJaZXg8I.d.ts → health-BnzbSLCE.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/invocation-command-descriptors-CSUGUHTT.js +2 -0
- package/dist/invocation-command-descriptors-PPVZOIE5.js +3 -0
- package/dist/output-continuation-command-FTVVBVSN.js +2 -0
- package/dist/output-continuation-command-ITPRC3YV.js +3 -0
- package/dist/project-reindex-7HZSLLLY.js +3 -0
- package/dist/project-reindex-NGM3DYBN.js +2 -0
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/anchors.d.ts +2 -2
- package/dist/queries/anchors.js +1 -1
- package/dist/queries/architecture.d.ts +2 -2
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +3 -3
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +2 -2
- package/dist/queries/context.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/dependence-slice.d.ts +3 -3
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +2 -2
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -2
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +3 -3
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +2 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +5 -5
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/reference-neighborhood.d.ts +2 -2
- package/dist/queries/reference-neighborhood.js +1 -1
- package/dist/queries/reference-reachability.d.ts +2 -2
- package/dist/queries/reference-reachability.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/source-inspection.d.ts +4 -4
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -2
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system-map.d.ts +2 -2
- package/dist/queries/system-map.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +2 -2
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/value-flow.d.ts +3 -3
- package/dist/queries/value-flow.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.d.ts +3 -3
- package/dist/reindex.js +31 -31
- package/dist/runtime.d.ts +24 -4
- package/dist/runtime.js +3 -3
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-B7N3haxa.d.ts → scip-cli-BRFKkHQn.d.ts} +1 -1
- package/dist/sentinel-ensure-command-KYYULCFU.js +2 -0
- package/dist/sentinel-ensure-command-RIZA3RY7.js +3 -0
- package/dist/sentinel-hook.js +39 -0
- package/dist/sentinel-worker.js +16 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +6 -6
- package/docs/COMMAND_REFERENCE.md +5 -3
- package/docs/schemas/project-config.schema.json +159 -0
- package/package.json +9 -5
- package/skills/codebaseiq/SKILL.md +1 -1
- package/skills/concrete-plan/SKILL.md +1 -1
- package/ui/view/api.js +450 -0
- package/ui/view/app.js +394 -0
- package/ui/view/builder.js +323 -0
- package/ui/view/file-panel.js +170 -0
- package/ui/view/focus.js +379 -0
- package/ui/view/index.html +54 -0
- package/ui/view/map.js +424 -0
- package/ui/view/styles.css +1125 -0
- package/dist/chunk-2X7V4HS4.js +0 -88
- package/dist/chunk-3IER7Q6H.js +0 -12
- package/dist/chunk-3JSXXYTZ.js +0 -345
- package/dist/chunk-476NR5B7.js +0 -2
- package/dist/chunk-5VKBFZZU.js +0 -3
- package/dist/chunk-ADTBPVUZ.js +0 -21
- package/dist/chunk-BFFZDZQV.js +0 -2
- package/dist/chunk-BMYOV5GP.js +0 -77
- package/dist/chunk-C74PPYLA.js +0 -3
- package/dist/chunk-CWONGW6P.js +0 -3
- package/dist/chunk-DDZ7VHWV.js +0 -20
- package/dist/chunk-DR2LURYU.js +0 -3
- package/dist/chunk-ECQBG7PW.js +0 -564
- package/dist/chunk-FM5BPL4V.js +0 -60
- package/dist/chunk-G6XFR4ZL.js +0 -4
- package/dist/chunk-GTIYTDRE.js +0 -562
- package/dist/chunk-HOA5YGOH.js +0 -3
- package/dist/chunk-KUW32IRO.js +0 -2
- package/dist/chunk-LTA3BRZX.js +0 -2
- package/dist/chunk-NAUD7LCA.js +0 -2
- package/dist/chunk-OGTFJ3XD.js +0 -2
- package/dist/chunk-Q5ELPRKQ.js +0 -2
- package/dist/chunk-QCN62RTF.js +0 -3
- package/dist/chunk-QW7EP6WI.js +0 -21
- package/dist/chunk-RU65DDUP.js +0 -215
- package/dist/chunk-SELM5MER.js +0 -2
- package/dist/chunk-SNNWPCN7.js +0 -4
- package/dist/chunk-TFZB6XTM.js +0 -239
- package/dist/chunk-UXM43C7T.js +0 -3
- package/dist/chunk-VFY6Y2H6.js +0 -61
- package/dist/chunk-WE5RZHZ7.js +0 -5
- package/dist/chunk-Z54RD7VL.js +0 -3
- package/dist/cli-context-3SNLDYBM.js +0 -3
- package/dist/cli-context-T3B7W6GG.js +0 -2
- package/dist/cli-program-YNOXO72B.js +0 -7
- package/dist/command-descriptors-6AOUKWW7.js +0 -346
- package/dist/command-descriptors-ZFKJSRUP.js +0 -344
- package/dist/direct-navigation-DP4LVMRX.js +0 -3
- package/dist/direct-navigation-FLUS3BT6.js +0 -2
- package/dist/invocation-command-descriptors-QT2JMY5J.js +0 -3
- package/dist/invocation-command-descriptors-YN4QJEAX.js +0 -2
- package/dist/output-continuation-command-2V2SL4TD.js +0 -2
- package/dist/output-continuation-command-65J5IP3O.js +0 -3
- package/dist/project-reindex-5JOKXAXT.js +0 -2
- package/dist/project-reindex-UQBIKO4M.js +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,53 @@ names are separate packages, and no `scip-query` version is superseded in place.
|
|
|
9
9
|
Entries at 0.20.0 and below record the predecessor package's history, retained
|
|
10
10
|
for continuity; they document releases of `scip-query`, not of `codebaseiq`.
|
|
11
11
|
|
|
12
|
+
## [0.2.0] — 2026-10-04
|
|
13
|
+
|
|
14
|
+
### Added (reuse before writing, a trailing sentinel, and a code map)
|
|
15
|
+
|
|
16
|
+
- **`codebaseiq reuse` finds existing code before you write new code.** Give it
|
|
17
|
+
probes (`--term retry|reattempt`, `--calls setTimeout`, `--returns promise`) or
|
|
18
|
+
a description, and it buckets existing symbols into reuse, rework, and compose,
|
|
19
|
+
with the observed facts behind each. A description is turned into probes by a
|
|
20
|
+
configured agent CLI (`--mode agent`, the default) or ranked by an
|
|
21
|
+
OpenAI-compatible embeddings endpoint such as LM Studio, llama.cpp, or Ollama
|
|
22
|
+
(`--mode embeddings`); `--mode auto` walks the configured chain and reports
|
|
23
|
+
every fallback. Results are labeled heuristic candidates, never a locator.
|
|
24
|
+
- **An opt-in trailing sentinel watches agent edits** (`codebaseiq setup
|
|
25
|
+
--sentinel`). It parses each edited file directly, without waiting for a
|
|
26
|
+
reindex, and reports a new function whose body equals an existing one; at
|
|
27
|
+
Stop it reports new code nothing imports or calls outside tests. It starts in
|
|
28
|
+
shadow mode (logged, never shown) until a finding family passes a measured
|
|
29
|
+
promotion gate (`npm run calibrate:sentinel`, `npm run
|
|
30
|
+
calibrate:sentinel-review`, then `codebaseiq setup --sentinel-live <family>`).
|
|
31
|
+
Hooks are installed for Claude Code and Codex.
|
|
32
|
+
- **`codebaseiq view` opens a local code map.** Folders and files are drawn with
|
|
33
|
+
their dependencies rolled up per level, cycles flagged; clicking into a symbol
|
|
34
|
+
shows its callers, callees, contracts, data, state, and runtime relationships,
|
|
35
|
+
with a source excerpt and an editor link. A builder drawer runs the same
|
|
36
|
+
search as `reuse`. `codebaseiq view --focus <symbol>` reuses an open viewer.
|
|
37
|
+
- **Per-developer builder settings live in `.codebaseiq.local.json`.** The
|
|
38
|
+
committed `.codebaseiq.json` cannot choose agent commands, API-key
|
|
39
|
+
variables, or remote endpoints; a local file Git tracks is ignored.
|
|
40
|
+
|
|
41
|
+
### Fixes
|
|
42
|
+
|
|
43
|
+
- **The architecture policy gate passes again.** The CLI program, query lane,
|
|
44
|
+
and resident host now have boundary mappings, so the gate (and the Stop hook
|
|
45
|
+
that runs it) no longer fails on unmapped files and stale allowances.
|
|
46
|
+
- **Background `git status` reads no longer rewrite the worktree index.** Git
|
|
47
|
+
reads run with `GIT_OPTIONAL_LOCKS=0`, so they stop triggering the watcher's
|
|
48
|
+
git-event polling.
|
|
49
|
+
- **A `daemon` config block no longer warns as an unknown key.**
|
|
50
|
+
- **A deep cache folder no longer breaks the index on Windows.** Once a
|
|
51
|
+
database or temporary directory path passed 260 characters, every query
|
|
52
|
+
failed with "unable to open database file" and shared generations stopped
|
|
53
|
+
publishing. Those paths now use the Windows long-path form.
|
|
54
|
+
- **Embedding endpoints get the task prefixes their model expects.** An
|
|
55
|
+
endpoint serving nomic-embed-text, e5, bge (English), or mxbai-embed-large
|
|
56
|
+
now uses that model's query and document prefixes unless it sets its own,
|
|
57
|
+
which ranks noticeably better.
|
|
58
|
+
|
|
12
59
|
## [0.1.0] — 2026-09-22
|
|
13
60
|
|
|
14
61
|
First release under the `codebaseiq` name. The entries in this section cover
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as t}from"./chunk-
|
|
1
|
+
import{e as t}from"./chunk-5NJPH3QZ.js";import"./chunk-YUKYB54I.js";import"./chunk-FWY2PRIF.js";import"./chunk-4NHWNAWQ.js";import"./chunk-2VKB5CMA.js";import"./chunk-4O52YNKL.js";import{writeFileSync as s}from"fs";import{workerData as o}from"worker_threads";var r=o;try{let e=t({projectRoot:r.projectRoot,dbPath:r.dbPath,tsconfig:r.tsconfig,vueFiles:r.vueFiles,tasks:r.tasks});s(r.resultPath,JSON.stringify({version:1,runId:r.runId,workerId:r.workerId,taskIds:r.taskIds,ok:!0,result:e}))}catch(e){s(r.resultPath,JSON.stringify({version:1,runId:r.runId,workerId:r.workerId,taskIds:r.taskIds,ok:!1,error:e instanceof Error?e.message:String(e)}))}
|
|
2
2
|
//# sourceMappingURL=augment-vue-worker.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-RVYLJDXC.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-27PHVDKL.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as n}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as n}from"./chunk-WOOTEWQT.js";function s(o,r,t,e){return n({projectRoot:o,languages:e.languages?.length?e.languages:r.languages,outputScip:t.indexPath,outputDb:t.dbPath,pnpmWorkspaces:r.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:r.indexer?.typescript?.projectMode,typescriptProjects:r.indexer?.typescript?.projects,clojureConfigPath:r.indexer?.clojure?.configPath,skipIfUnchanged:e.force!==!0,allowPartial:e.allowPartial===!0,skipAutoInstall:e.skipAutoInstall===!0,installMissing:e.installMissing===!0,trustProjectTools:e.trustProjectTools===!0,indexerConcurrency:e.indexerConcurrency??r.indexerConcurrency,trigger:e.trigger,...e.onStatus?{onStatus:e.onStatus}:{}})}export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-2DMVFAY7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-OJFLPVBP.js";import{f as d}from"./chunk-57KEZDPT.js";import{d as r,u as a}from"./chunk-AM5SUGHF.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-JOIRNPPY.js";import{f as d}from"./chunk-J77SU6VA.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-2E6BTWER.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as D}from"./chunk-
|
|
1
|
+
import{a as D}from"./chunk-GXVDTHFC.js";import{c as C}from"./chunk-NK76RSB6.js";import{a as I}from"./chunk-OJFLPVBP.js";import{e as P}from"./chunk-57KEZDPT.js";import{b as F}from"./chunk-3XFJUWJE.js";import{f as M,g as S}from"./chunk-JN5LIBT3.js";import{d as g}from"./chunk-AM5SUGHF.js";function oe(e,n={}){let t=new C(e).productionCallableDefinitions({scope:n.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=L(e,t),l=n.search?.trim().toLocaleLowerCase();return t.map(s=>j(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!l||$(s).includes(l)).sort(G)}function re(e,n,o={}){let t=F(e,n);if(!t.match)return{kind:"missing",query:n};if(t.total>1)return{kind:"ambiguous",query:n,total:t.total,candidates:[{symbol:t.match.symbol,shortName:g(t.match.symbol),relativePath:t.match.relativePath,startLine:t.match.startLine},...t.candidates]};let r=new C(e),l=r.definitionsForFile(t.match.relativePath).find(a=>a.symbol===t.match.symbol);if(!l?.isFunctionLike)return{kind:"not-entry",query:n,symbol:t.match.symbol,shortName:g(t.match.symbol),file:t.match.relativePath,reason:"The resolved symbol is not a callable definition."};let s=L(e,[l]),f=j(e,l,s.get(l.symbolId)??[]);if(!f)return{kind:"not-entry",query:n,symbol:l.symbol,shortName:g(l.symbol),file:l.relativePath,reason:"The callable is neither an external root nor an uncalled callable on a detected entry surface."};let m=K(e,r,l),i=new Set(o.expand??[]),c=z(m,i),d=new Set(c.regions.filter(a=>a.expanded).map(a=>a.id)),p=[...i].filter(a=>!d.has(a)).sort();return{kind:"matched",query:n,entry:f.result,regions:c.regions,regionEdges:c.regionEdges,unmatchedExpansions:p,coverage:{completeWithinIndexedStaticCallEdges:!0,completeWithinSelectedStaticEvidence:!0,candidateReachabilityIncluded:m.edges.some(a=>a.evidenceStrength==="candidate"),dynamicDispatchRepresented:!1,symbolCount:m.symbols.length,symbolEdgeCount:m.edges.length,exactSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="exact").length,candidateSymbolEdgeCount:m.edges.filter(a=>a.evidenceStrength==="candidate").length,regionCount:c.regions.length,regionEdgeCount:c.regionEdges.length,externalCallCount:m.externalCalls.length}}}function L(e,n){let o=n.filter(t=>B(e,t.relativePath)||S(e,t.symbol,t.relativePath).length>0);return P(e,o,{semantic:!1,semanticEvidence:I})}function j(e,n,o){let t=T(e,n),r=t.length>0,l=B(e,n.relativePath)&&o.length===0;if(!r&&!l)return null;let s=[...t];return l&&s.push("entry-surface-without-indexed-caller"),{definition:n,result:{symbol:n.symbol,shortName:g(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,documentation:n.documentation,confidence:r?"root":"candidate",evidence:s,indexedCallerCount:o.length}}}function B(e,n){return M(e,n)||/(?:^|\/)entry\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(n)}function T(e,n){let o=S(e,n.symbol,n.relativePath),t=[];return w(o,["package-surface-file","transitive-package-surface"])&&D(e,n)&&t.push("package-public-export"),o.includes("rust-public-library")&&t.push("rust-public-library"),o.includes("framework-entrypoint")&&t.push("framework-dispatched-export"),w(o,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&t.push("configured-entry-root"),t}function w(e,n){return n.some(o=>e.includes(o))}function $(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
|
|
2
2
|
`).toLocaleLowerCase()}function G(e,n){return N(e.confidence)-N(n.confidence)||e.file.localeCompare(n.file)||e.startLine-n.startLine||e.symbol.localeCompare(n.symbol)}function N(e){return e==="root"?0:1}function K(e,n,o){let t=new Map([[o.symbol,0]]),r=new Map,l=new Map([[o.symbol,o]]),s=new Map,f=new Map,m=[o];for(;m.length>0;){let i=n.calleeMap(m,{additive:!1,semantic:!1}),c=[];for(let d of m){let p=t.get(d.symbol)??0;r.set(d.symbol,k(d,p));for(let a of i.get(d.symbolId)??[]){let y=W(n,a,l);if(!y){let R=O(d,a);f.set(J(R),R);continue}let u=p+1,h=t.get(y.symbol);(h===void 0||u<h)&&t.set(y.symbol,u),r.set(y.symbol,k(y,Math.min(u,h??u)));let v=q(d,y,a);s.set(H(v),v),h===void 0&&c.push(y)}}m=c}return{symbols:[...r.values()].sort(Q),edges:[...s.values()].sort(U),externalCalls:[...f.values()].sort(V)}}function W(e,n,o){let t=o.get(n.symbol);if(t)return t;let r=e.definitionsForFile(n.file).find(l=>l.symbol===n.symbol)??null;return r&&o.set(r.symbol,r),r}function k(e,n){return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,depth:n}}function q(e,n,o){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),toFile:n.relativePath,source:o.source,evidenceStrength:o.source==="scip-chunk"?"candidate":"exact"}}function O(e,n){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),reportedFile:n.file,source:n.source,evidenceStrength:n.source==="scip-chunk"?"candidate":"exact"}}function z(e,n){let o=b(e.symbols,i=>i.file),t=b(e.edges.filter(i=>i.fromFile===i.toFile),i=>i.fromFile),r=b(e.externalCalls,i=>i.fromFile),l=A(e.edges.filter(i=>i.fromFile!==i.toFile)),s=b(l,i=>i.toRegionId),f=b(l,i=>i.fromRegionId);return{regions:[...o.entries()].map(([i,c])=>{let d=x(i),p=n.has(d),a=t.get(i)??[],y=r.get(i)??[];return{id:d,file:i,minDepth:Math.min(...c.map(u=>u.depth)),symbolCount:c.length,internalEdgeCount:a.length,externalCallCount:y.length,incomingRegionIds:E((s.get(d)??[]).map(u=>u.fromRegionId)),outgoingRegionIds:E((f.get(d)??[]).map(u=>u.toRegionId)),expanded:p,symbols:p?c:[],internalEdges:p?a:[],externalCalls:p?y:[]}}).sort((i,c)=>i.minDepth-c.minDepth||i.file.localeCompare(c.file)),regionEdges:l}}function A(e){let n=new Map;for(let o of e){let t=`${o.fromFile}\0${o.toFile}`,r=n.get(t)??[];r.push(o),n.set(t,r)}return[...n.values()].map(o=>{let t=o[0];return{fromRegionId:x(t.fromFile),fromFile:t.fromFile,toRegionId:x(t.toFile),toFile:t.toFile,callCount:o.length,exactCallCount:o.filter(r=>r.evidenceStrength==="exact").length,candidateCallCount:o.filter(r=>r.evidenceStrength==="candidate").length,fromSymbols:E(o.map(r=>r.fromShortName)),toSymbols:E(o.map(r=>r.toShortName)),evidence:E(o.map(r=>r.source))}}).sort((o,t)=>o.fromFile.localeCompare(t.fromFile)||o.toFile.localeCompare(t.toFile))}function b(e,n){let o=new Map;for(let t of e){let r=n(t),l=o.get(r)??[];l.push(t),o.set(r,l)}return o}function x(e){return`file:${e}`}function E(e){return[...new Set(e)].sort()}function H(e){return`${e.fromSymbol}\0${e.toSymbol}`}function J(e){return`${e.fromSymbol}\0${e.toSymbol}`}function Q(e,n){return e.depth-n.depth||e.file.localeCompare(n.file)||e.symbol.localeCompare(n.symbol)}function U(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}function V(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}export{oe as a,re as b};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-2F5ERMNI.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import{a as p,g as m}from"./chunk-4O52YNKL.js";import F from"ignore";import{existsSync as h,readdirSync as D}from"fs";import{dirname as d,isAbsolute as b,join as l,relative as T,resolve as $}from"path";function M(e){let t=F();return x(e,t)||t.add(P),{isIgnored:r=>f(t,e,r),filter:r=>r.filter(i=>!f(t,e,i))}}function x(e,t){let n=new Set,r=(s,a)=>{if(!(n.has(s)||!h(s)))try{let g=m(s,{maxBytes:p,inputKind:"gitignore file"});t.add(a?w(g,a):g),n.add(s)}catch{}},i=d(e),o=0;for(;i!==d(i)&&o<5&&(r(l(i,".gitignore"),""),!h(l(i,".git")));)i=d(i),o++;return y(e,"",t,r),n.size>0}function y(e,t,n,r){let i=t?l(e,t):e;r(l(i,".gitignore"),t);let o;try{o=D(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;f(n,e,`${a}/`)||y(e,a,n,r)}}function w(e,t){let n=t.replaceAll("\\","/").replace(/\/+$/,"");return e.split(/\r?\n/).map(r=>I(r,n)).join(`
|
|
2
|
+
`)}function I(e,t){let n=e.trimStart();if(!n||n.startsWith("#"))return e;let r=e.slice(0,e.length-n.length),i=n.startsWith("!"),o=i?n.slice(1):n;if(!o||o.startsWith("#"))return e;let s=o.startsWith("/"),a=s?o.slice(1):o,A=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${t}/${a}`:`${t}/**/${a}`;return`${r}${i?"!":""}${A}`}var P=`
|
|
3
|
+
# Dependencies
|
|
4
|
+
node_modules/
|
|
5
|
+
vendor/
|
|
6
|
+
.bundle/
|
|
7
|
+
|
|
8
|
+
# Build output
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
out/
|
|
12
|
+
target/
|
|
13
|
+
bin/
|
|
14
|
+
obj/
|
|
15
|
+
|
|
16
|
+
# Python
|
|
17
|
+
__pycache__/
|
|
18
|
+
*.pyc
|
|
19
|
+
*.pyo
|
|
20
|
+
.venv/
|
|
21
|
+
venv/
|
|
22
|
+
.env/
|
|
23
|
+
env/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
|
|
26
|
+
# Rust
|
|
27
|
+
target/
|
|
28
|
+
|
|
29
|
+
# Java / Kotlin / Scala
|
|
30
|
+
*.class
|
|
31
|
+
.gradle/
|
|
32
|
+
.mvn/
|
|
33
|
+
|
|
34
|
+
# C# / .NET
|
|
35
|
+
bin/
|
|
36
|
+
obj/
|
|
37
|
+
packages/
|
|
38
|
+
|
|
39
|
+
# Go
|
|
40
|
+
vendor/
|
|
41
|
+
|
|
42
|
+
# Dart
|
|
43
|
+
.dart_tool/
|
|
44
|
+
build/
|
|
45
|
+
|
|
46
|
+
# PHP
|
|
47
|
+
vendor/
|
|
48
|
+
|
|
49
|
+
# IDE / OS
|
|
50
|
+
.idea/
|
|
51
|
+
.vscode/
|
|
52
|
+
*.swp
|
|
53
|
+
*.swo
|
|
54
|
+
.DS_Store
|
|
55
|
+
Thumbs.db
|
|
56
|
+
|
|
57
|
+
# Type definitions (often noise in queries)
|
|
58
|
+
*.d.ts
|
|
59
|
+
`;function f(e,t,n){let r=R(t,n);if(!r)return!1;try{return e.ignores(r)}catch{return!1}}function R(e,t){if(!t||t===".")return null;if(!b(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let n=b(t)?t:$(e,t),r=T(e,n).replaceAll("\\","/");return!r||r==="."||r.startsWith("..")?null:r}import{mkdtempSync as S}from"fs";import{win32 as G}from"path";var W=259,N=8,E=6,c="\\\\?\\",u=`${c}UNC\\`;function v(e,t,n){if(n!=="win32"||e.startsWith(c))return;let r=G.resolve(e);if(!(r.length+t<=W))return r.startsWith("\\\\")?`${u}${r.slice(2)}`:`${c}${r}`}function q(e,t=process.platform){return e===""||e===":memory:"?e:v(e,N,t)??e}function K(e,t=process.platform){let n=v(e,E,t);if(!n)return S(e);let r=S(n);return r.startsWith(u)?`\\\\${r.slice(u.length)}`:r.slice(c.length)}var C=[],_=[];function j(e){e.groups.length>0&&C.push(e)}function Q(e){_.push(e)}function Y(e){let t=[];for(let n of _)try{n.close(e)}catch(r){t.push(r)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Multiple database-owned resources failed to close.")}function V(e,t){let n=new Set(t.groups);for(let r of C)r.groups.some(i=>n.has(i))&&(t.file!==void 0&&r.clearFile?r.clearFile(e,t.file):r.clearAll(e))}export{q as a,K as b,j as c,Q as d,Y as e,V as f,M as g};
|
|
60
|
+
//# sourceMappingURL=chunk-2VKB5CMA.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isAbsolute as Z,relative as _e}from"path";var g=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function L(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Vt(e){return e.replace(/\\/g,"/")}function Ht(e,t){return L(e)===L(t)}function Q(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let o=/^\/([A-Za-z]):(\/|$)/.exec(n);o&&(n=`/${o[1].toUpperCase()}:${n.slice(3)}`);let i=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${i}`}function Xt(e,t){return Q(e)===Q(t)}function _(e,t){let r=_e(e,t);return r===""||!r.startsWith("..")&&!Z(r)}function ee(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(Z(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=L(e);if(t.split("/").some(n=>n===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}function Me(e,t,r=[]){let n=N(e);if(oe.has(n)||r.some(i=>R(n,i))||t.some(i=>se(n,i)))return"config";if(t.some(ce)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let o=ae(n);return t.some(i=>(ue[i]??[]).includes(o))?"source":"other"}function Kt(e,t,r){let n=N(e);if(oe.has(n)||r?.some(i=>R(n,i))||se(n,t)||ce(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let o=ae(n);return(ue[t]??[]).includes(o)}function Yt(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!te(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!te(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(M)?null:t}function Qt(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),o=new Set([...r.keys(),...n.keys()]),i=[];for(let a of[...o].sort()){let u=r.get(a),c=n.get(a),b=Me(a,t.languages);!u&&c?i.push({kind:"added",path:a,inputKind:b,after:c}):u&&!c?i.push({kind:"deleted",path:a,inputKind:b,before:u}):u&&c&&(u.hash!==c.hash||u.size!==c.size)&&i.push({kind:"modified",path:a,inputKind:b,before:u,after:c})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(re(e?.files??[])||re(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ne)&&s.add("unreadable-input"),{version:1,changes:i,projectIdentityChanged:e?!Te(e,t):!0,uncertainty:[...s].sort()}}function te(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function re(e){return new Set(e.map(t=>t.path)).size!==e.length}function M(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ne(e){return e.hash==="unreadable"||e.size<0}function Te(e,t){return ne(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&ne(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function ne(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((o,i)=>o===n[i])}var oe=new Set([".codebaseiq.json"]),Be={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},Ge={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},ie=new Map;function se(e,t){return Be[t].some(r=>R(e,r))||Ge[t].some(r=>R(e,r))}function R(e,t){let r=N(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,o=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return o===r;let i=ie.get(r);if(!i){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");i=new RegExp(`^${s}$`),ie.set(r,i)}return i.test(o)}function N(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function ae(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ce(e){return e==="typescript"||e==="javascript"}var ue={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function er(e){return typeof e=="string"&&e.length>0}function tr(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function rr(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function nr(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var pe=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];var T=2,m=3;var B=new Set(pe);function dr(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){return{kind:"malformed",reason:`invalid JSON: ${He(s)}`}}if(!f(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let r=t.version;if(!Number.isInteger(r))return{kind:"malformed",reason:"version must be an integer"};if(r!==T&&r!==m)return{kind:"unsupported",version:r,direction:r<T?"older":"future"};let n=$e(t,r);if(n)return{kind:"malformed",reason:n};let o=t,i={metadata:o,capabilities:We(o)};return r===T?{kind:"legacy",...i,metadata:o}:{kind:"supported",...i,metadata:o}}function pr(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function lr(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===m?t.sqliteLayoutVersion:void 0})}function We(e){let t=e.fingerprint!==void 0,r=f(e.fingerprint),n=e.indexedLanguages!==void 0,o=e.status==="complete",i=e.version===m?e:null;return{usableForQuery:n,usableForEvidenceCache:t,publishableGeneration:o&&r&&n,stableGenerationIdentity:o&&t&&typeof e.updatedAt=="string",languageShardReuse:!!i?.languageFingerprints,typescriptProjectShardReuse:!!i?.typescriptProjectShards}}function $e(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!de(e.updatedAt))return"updatedAt must be a valid timestamp";for(let r of["requestedLanguages","indexedLanguages"])if(e[r]!==void 0&&!Ue(e[r]))return`${r} must contain unique supported languages`;return e.skipped!==void 0&&!ze(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===m&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===m&&e.languageFingerprints!==void 0&&!qe(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===m&&e.typescriptProjectShards!==void 0&&!Ve(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function gr(e){return e.version===m&&e.sqliteLayoutVersion===1}function Ue(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&B.has(t))?!1:new Set(e).size===e.length}function ze(e){return Array.isArray(e)&&e.every(t=>f(t)&&typeof t.language=="string"&&B.has(t.language)&&typeof t.reason=="string")}function qe(e){return f(e)&&Object.entries(e).every(([t,r])=>B.has(t)&&f(r))}function Ve(e){return f(e)&&Object.values(e).every(t=>f(t)&&Array.isArray(t.files)&&t.files.every(M))}function He(e){return e instanceof Error?e.message:String(e)}import{closeSync as G,fstatSync as E,openSync as W,readFileSync as Xe,readSync as le}from"fs";import{createHash as Je}from"crypto";var ge=8*1024*1024,Ke=64*1024*1024,Ye=512*1024*1024,Qe=256*1024*1024,y=class extends Error{constructor(r,n,o,i,s){let a=o==="too-large"?`is ${i} bytes; the safety limit is ${s} bytes`:o==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=o;this.observedBytes=i;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function fe(e,t){z(t.maxBytes);let r=String(e),n=W(e,"r");try{let o=E(n);be(o,t,r);let i=Xe(n),s=E(n);if(s.dev!==o.dev||s.ino!==o.ino||s.size!==o.size||i.byteLength!==o.size)throw new y(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return i}finally{G(n)}}function ye(e,t,r="utf8"){return fe(e,t).toString(r)}function $(e,t){return ye(e,{maxBytes:ge,inputKind:t})}function U(e,t){z(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),o=0;for(;;){let i=le(e,n,0,n.length,null);if(i===0)break;if(o+=i,!Number.isSafeInteger(o)||o>t.maxBytes)throw new y(t.inputKind,`file descriptor ${e}`,"too-large",o,t.maxBytes);r.push(Buffer.from(n.subarray(0,i)))}return Buffer.concat(r,o)}function Ze(e,t,r="utf8"){return U(e,t).toString(r)}function me(e,t){let r=W(e,"r");try{return U(r,t)}finally{G(r)}}function et(e,t,r="utf8"){return me(e,t).toString(r)}function he(e,t,r){z(t.maxBytes);let n=String(e),o=W(e,"r");try{let i=E(o);be(i,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,i.size))),a=0;for(;a<i.size;){let c=le(o,s,0,Math.min(s.length,i.size-a),a);if(c===0)break;r(s.subarray(0,c)),a+=c}let u=E(o);if(u.dev!==i.dev||u.ino!==i.ino||u.size!==i.size||a!==i.size)throw new y(t.inputKind,n,"changed-during-read",u.size,t.maxBytes);return a}finally{G(o)}}function tt(e,t){let r=Je("sha256");return he(e,t,n=>r.update(n)),r.digest("hex")}function be(e,t,r){if(!e.isFile())throw new y(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new y(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function z(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}import{createHash as we,randomUUID as dt}from"crypto";import{chmodSync as je,existsSync as h,linkSync as pt,lstatSync as D,readdirSync as H,realpathSync as p,unlinkSync as lt,writeSync as gt}from"fs";import{homedir as ft}from"os";import{basename as yt,dirname as A,isAbsolute as Re,join as d,resolve as v}from"path";import{closeSync as rt,existsSync as nt,fsyncSync as it,mkdirSync as ot,openSync as st}from"fs";import{dirname as Se}from"path";function xe(e,t,r,n){let o=0;for(;o<t.length;){let i=r.writeFile(e,t,o,t.length-o);if(!Number.isSafeInteger(i)||i<=0||i>t.length-o)throw new Error(`${n} write did not make valid forward progress`);o+=i}}function q(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var S=Object.freeze({platform:process.platform,pathExists:e=>nt(e),makeDirectory:e=>ot(e,{recursive:!0}),openFile:(e,t,r)=>st(e,t,r),syncFile:e=>it(e),closeFile:e=>rt(e)});function Ce(e,t=S){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let i=Se(n);if(i===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=i}let o="synced";for(let i of r.reverse())t.makeDirectory(i),o=j(o,w(Se(i),t));return o}function w(e,t=S){let r;try{r=t.openFile(e,"r")}catch(n){if(q(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(q(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function j(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createRequire as at}from"module";var ct=at(import.meta.url),ke=ut().version;function ut(){for(let e of["../package.json","../../package.json"])try{return ct(e)}catch{}return{version:"0.0.0"}}var Pe=1,k=".codebaseiq-cache-owner.json",mt=16*1024,De=Object.freeze({...S,randomToken:()=>dt(),linkFile:(e,t)=>pt(e,t),removeFile:e=>lt(e),writeFile:(e,t,r,n)=>gt(e,t,r,n)});function P(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function l(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function ht(e,t){let r=p(e);return St(r,bt(r,t))}function bt(e,t){let r=p(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?v(n):t?.dbPath?kt(r,t.dbPath):xt(r)}function Ae(){let e=process.env.XDG_CACHE_HOME;return d(e||d(ft(),".cache"),"codebaseiq")}function xt(e){let t=v(e);try{t=p(t)}catch{}let r=we("sha256").update(t).digest("hex").slice(0,12);return d(Ae(),"projects",r)}function Tr(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=d(Ae(),"repositories",e);return Fe(t),p(t)}function Br(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Gr(e,t){let r=ht(e,t);return{cacheDir:r,dbPath:d(r,"index.db"),indexPath:d(r,"index.scip"),metaPath:d(r,"meta.json")}}function St(e,t,r=De){return Ct(e,t,r).cacheDir}function Ct(e,t,r=De){let n=p(e),o=h(t)?"synced":Fe(t,r),i=p(t),s=d(i,k);if(h(s))return V(n,i),X(s),C(i),{kind:"existing",cacheDir:i};Ee(i),Pt(i),Ee(i);let u=`${JSON.stringify({schemaVersion:Pe,canonicalProjectRoot:n,canonicalCacheDir:i,creatorVersion:ke},null,2)}
|
|
2
|
-
`;try{let c=Dt(s,u,r),b=j(o,c);return{kind:"published",cacheDir:i,achievedDurability:b==="synced"?"directory-durable":"file-flushed",directorySync:b}}catch(c){if(vt(c))return V(n,i),{kind:"existing",cacheDir:i};throw c}}function V(e,t){let r=p(e),n=p(t);return Et(n,r,n)}function
|
|
3
|
-
`).map(u=>u.trim());if(t.length!==5)return;let[r,n,o,i,s]=t;if(!r||!n||!o||!i||!s||!J.test(i)||!J.test(s))return;let a=x(r);return{root:a,gitDir:x(I(a,n)),commonDir:x(I(a,o)),headCommit:i,treeOid:s}}function
|
|
4
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{isAbsolute as Z,relative as _e}from"path";var g=class extends Error{constructor(r,n){super(`refusing unsafe project file path ${JSON.stringify(r)} (${n})`);this.relativePath=r;this.reason=n;this.name="UnsafeProjectPathError"}relativePath;reason;code="CODEBASEIQ_UNSAFE_PROJECT_PATH"};function L(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Ht(e){return e.replace(/\\/g,"/")}function Xt(e,t){return L(e)===L(t)}function Q(e){let t=e.trim();if(!/^file:/i.test(t))return t;let r;try{r=new URL(t)}catch{return t}if(r.protocol!=="file:")return t;let n;try{n=decodeURIComponent(r.pathname)}catch{return t}for(n=n.replace(/\\/g,"/");n.length>1&&n.endsWith("/");)n=n.slice(0,-1);let o=/^\/([A-Za-z]):(\/|$)/.exec(n);o&&(n=`/${o[1].toUpperCase()}:${n.slice(3)}`);let i=n.split("/").map(s=>encodeURIComponent(s).replace(/%3A/gi,":")).join("/");return`file://${r.host}${i}`}function Jt(e,t){return Q(e)===Q(t)}function _(e,t){let r=_e(e,t);return r===""||!r.startsWith("..")&&!Z(r)}function ee(e){if(!e)throw new g(e,"empty-path");if(e.includes("\0"))throw new g(e,"nul-byte");if(Z(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new g(e,"absolute-path");let t=L(e);if(t.split("/").some(n=>n===".."))throw new g(e,"parent-traversal");if(!t||t===".")throw new g(e,"empty-path");return t}function Me(e,t,r=[]){let n=N(e);if(oe.has(n)||r.some(i=>k(n,i))||t.some(i=>se(n,i)))return"config";if(t.some(ce)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return"ambient";let o=ae(n);return t.some(i=>(ue[i]??[]).includes(o))?"source":"other"}function Yt(e,t,r){let n=N(e);if(oe.has(n)||r?.some(i=>k(n,i))||se(n,t)||ce(t)&&/\.d\.(?:ts|mts|cts)$/.test(n.toLowerCase()))return!0;let o=ae(n);return(ue[t]??[]).includes(o)}function Qt(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!te(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!te(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(M)?null:t}function Zt(e,t){let r=new Map((e?.files??[]).map(a=>[a.path,a])),n=new Map(t.files.map(a=>[a.path,a])),o=new Set([...r.keys(),...n.keys()]),i=[];for(let a of[...o].sort()){let u=r.get(a),c=n.get(a),b=Me(a,t.languages);!u&&c?i.push({kind:"added",path:a,inputKind:b,after:c}):u&&!c?i.push({kind:"deleted",path:a,inputKind:b,before:u}):u&&c&&(u.hash!==c.hash||u.size!==c.size)&&i.push({kind:"modified",path:a,inputKind:b,before:u,after:c})}let s=new Set;return e||s.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&s.add("snapshot-version-changed"),(re(e?.files??[])||re(t.files))&&s.add("duplicate-input-path"),[...e?.files??[],...t.files].some(Ne)&&s.add("unreadable-input"),{version:1,changes:i,projectIdentityChanged:e?!Te(e,t):!0,uncertainty:[...s].sort()}}function te(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function re(e){return new Set(e.map(t=>t.path)).size!==e.length}function M(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function Ne(e){return e.hash==="unreadable"||e.size<0}function Te(e,t){return ne(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&ne(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function ne(e,t){if(e.length!==t.length)return!1;let r=[...e].sort(),n=[...t].sort();return r.every((o,i)=>o===n[i])}var oe=new Set([".codebaseiq.json"]),Be={typescript:["tsconfig.json"],javascript:["package.json"],java:["pom.xml","build.gradle"],scala:["build.sbt"],kotlin:["build.gradle.kts"],rust:["Cargo.toml"],python:["pyproject.toml","setup.py"],ruby:["Gemfile"],go:["go.mod"],cpp:["CMakeLists.txt","Makefile"],c:["CMakeLists.txt","Makefile"],csharp:["*.csproj","*.sln"],vb:["*.vbproj","*.sln"],dart:["pubspec.yaml"],php:["composer.json"],clojure:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"]},Ge={typescript:["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],javascript:["package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lock","bun.lockb","tsconfig.json","tsconfig.*.json","jsconfig.json","jsconfig.*.json"],java:["build.gradle.kts","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],scala:["plugins.sbt","build.properties"],kotlin:["pom.xml","build.gradle","settings.gradle","settings.gradle.kts","gradle.properties","gradle.lockfile","gradle-wrapper.properties"],rust:["Cargo.lock","rust-project.json","rust-toolchain","rust-toolchain.toml"],python:["setup.cfg","requirements*.txt","Pipfile","Pipfile.lock","poetry.lock","uv.lock"],ruby:["Gemfile.lock","gems.locked"],go:["go.sum","go.work","go.work.sum"],cpp:["compile_commands.json"],c:["compile_commands.json"],csharp:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],vb:["Directory.Build.props","Directory.Build.targets","Directory.Packages.props","packages.lock.json","NuGet.Config","global.json"],dart:["pubspec.lock","analysis_options.yaml"],php:["composer.lock"],clojure:[]},ie=new Map;function se(e,t){return Be[t].some(r=>k(e,r))||Ge[t].some(r=>k(e,r))}function k(e,t){let r=N(t).replace(/^\.\//,"");if(!r)return!1;let n=e.split("/").at(-1)??e,o=r.includes("/")?e:n;if(!r.includes("*")&&!r.includes("?"))return o===r;let i=ie.get(r);if(!i){let s=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]");i=new RegExp(`^${s}$`),ie.set(r,i)}return i.test(o)}function N(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function ae(e){return e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:""}function ce(e){return e==="typescript"||e==="javascript"}var ue={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs",".vue"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function tr(e){return typeof e=="string"&&e.length>0}function rr(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}function nr(e){return typeof e=="string"&&e.length>0&&e.length<=256&&!/[\0\r\n]/u.test(e)}function ir(e){return typeof e=="number"&&Number.isFinite(e)&&e>=0}var pe=["typescript","javascript","java","scala","kotlin","rust","python","ruby","go","cpp","c","csharp","vb","dart","php","clojure"];var T=2,m=3;var B=new Set(pe);function pr(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(s){return{kind:"malformed",reason:`invalid JSON: ${He(s)}`}}if(!f(t))return{kind:"malformed",reason:"metadata must be a JSON object"};let r=t.version;if(!Number.isInteger(r))return{kind:"malformed",reason:"version must be an integer"};if(r!==T&&r!==m)return{kind:"unsupported",version:r,direction:r<T?"older":"future"};let n=$e(t,r);if(n)return{kind:"malformed",reason:n};let o=t,i={metadata:o,capabilities:We(o)};return r===T?{kind:"legacy",...i,metadata:o}:{kind:"supported",...i,metadata:o}}function lr(e){return e.kind==="legacy"||e.kind==="supported"?e.metadata:null}function gr(e){if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.stableGenerationIdentity)return null;let t=e.metadata;return JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages,scipCompanion:t.scipCompanion,sqliteLayoutVersion:t.version===m?t.sqliteLayoutVersion:void 0})}function We(e){let t=e.fingerprint!==void 0,r=f(e.fingerprint),n=e.indexedLanguages!==void 0,o=e.status==="complete",i=e.version===m?e:null;return{usableForQuery:n,usableForEvidenceCache:t,publishableGeneration:o&&r&&n,stableGenerationIdentity:o&&t&&typeof e.updatedAt=="string",languageShardReuse:!!i?.languageFingerprints,typescriptProjectShardReuse:!!i?.typescriptProjectShards}}function $e(e,t){if(e.status!=="complete"&&e.status!=="partial")return"status must be complete or partial";if(e.updatedAt!==void 0&&!de(e.updatedAt))return"updatedAt must be a valid timestamp";for(let r of["requestedLanguages","indexedLanguages"])if(e[r]!==void 0&&!Ue(e[r]))return`${r} must contain unique supported languages`;return e.skipped!==void 0&&!ze(e.skipped)?"skipped must contain supported language/reason pairs":e.scipCompanion!==void 0&&e.scipCompanion!=="current"&&e.scipCompanion!=="deferred"?"scipCompanion must be current or deferred":t===m&&e.sqliteLayoutVersion!==void 0&&(!Number.isSafeInteger(e.sqliteLayoutVersion)||e.sqliteLayoutVersion<1)?"sqliteLayoutVersion must be a positive safe integer":t===m&&e.languageFingerprints!==void 0&&!qe(e.languageFingerprints)?"languageFingerprints must map supported languages to fingerprint objects":t===m&&e.typescriptProjectShards!==void 0&&!Ve(e.typescriptProjectShards)?"typescriptProjectShards must map project names to file fingerprints":null}function fr(e){return e.version===m&&e.sqliteLayoutVersion===1}function Ue(e){return!Array.isArray(e)||!e.every(t=>typeof t=="string"&&B.has(t))?!1:new Set(e).size===e.length}function ze(e){return Array.isArray(e)&&e.every(t=>f(t)&&typeof t.language=="string"&&B.has(t.language)&&typeof t.reason=="string")}function qe(e){return f(e)&&Object.entries(e).every(([t,r])=>B.has(t)&&f(r))}function Ve(e){return f(e)&&Object.values(e).every(t=>f(t)&&Array.isArray(t.files)&&t.files.every(M))}function He(e){return e instanceof Error?e.message:String(e)}import{closeSync as G,fstatSync as E,openSync as W,readFileSync as Xe,readSync as le}from"fs";import{createHash as Je}from"crypto";var ge=8*1024*1024,Ke=64*1024*1024,Ye=512*1024*1024,Qe=256*1024*1024,y=class extends Error{constructor(r,n,o,i,s){let a=o==="too-large"?`is ${i} bytes; the safety limit is ${s} bytes`:o==="not-regular"?"is not a regular file":"changed while it was being read";super(`${r} ${JSON.stringify(n)} ${a}`);this.inputKind=r;this.inputPath=n;this.reason=o;this.observedBytes=i;this.limitBytes=s;this.name="BoundedFileReadError"}inputKind;inputPath;reason;observedBytes;limitBytes;code="CODEBASEIQ_BOUNDED_FILE_READ"};function fe(e,t){z(t.maxBytes);let r=String(e),n=W(e,"r");try{let o=E(n);be(o,t,r);let i=Xe(n),s=E(n);if(s.dev!==o.dev||s.ino!==o.ino||s.size!==o.size||i.byteLength!==o.size)throw new y(t.inputKind,r,"changed-during-read",s.size,t.maxBytes);return i}finally{G(n)}}function ye(e,t,r="utf8"){return fe(e,t).toString(r)}function $(e,t){return ye(e,{maxBytes:ge,inputKind:t})}function U(e,t){z(t.maxBytes);let r=[],n=Buffer.allocUnsafe(64*1024),o=0;for(;;){let i=le(e,n,0,n.length,null);if(i===0)break;if(o+=i,!Number.isSafeInteger(o)||o>t.maxBytes)throw new y(t.inputKind,`file descriptor ${e}`,"too-large",o,t.maxBytes);r.push(Buffer.from(n.subarray(0,i)))}return Buffer.concat(r,o)}function Ze(e,t,r="utf8"){return U(e,t).toString(r)}function me(e,t){let r=W(e,"r");try{return U(r,t)}finally{G(r)}}function et(e,t,r="utf8"){return me(e,t).toString(r)}function he(e,t,r){z(t.maxBytes);let n=String(e),o=W(e,"r");try{let i=E(o);be(i,t,n);let s=Buffer.allocUnsafe(Math.min(1024*1024,Math.max(1,i.size))),a=0;for(;a<i.size;){let c=le(o,s,0,Math.min(s.length,i.size-a),a);if(c===0)break;r(s.subarray(0,c)),a+=c}let u=E(o);if(u.dev!==i.dev||u.ino!==i.ino||u.size!==i.size||a!==i.size)throw new y(t.inputKind,n,"changed-during-read",u.size,t.maxBytes);return a}finally{G(o)}}function tt(e,t){let r=Je("sha256");return he(e,t,n=>r.update(n)),r.digest("hex")}function be(e,t,r){if(!e.isFile())throw new y(t.inputKind,r,"not-regular",Number(e.size),t.maxBytes);if(e.size>t.maxBytes)throw new y(t.inputKind,r,"too-large",Number(e.size),t.maxBytes)}function z(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}import{createHash as we,randomUUID as dt}from"crypto";import{chmodSync as je,existsSync as h,linkSync as pt,lstatSync as D,readdirSync as H,realpathSync as p,unlinkSync as lt,writeSync as gt}from"fs";import{homedir as ft}from"os";import{basename as yt,dirname as A,isAbsolute as ke,join as d,resolve as v}from"path";import{closeSync as rt,existsSync as nt,fsyncSync as it,mkdirSync as ot,openSync as st}from"fs";import{dirname as Se}from"path";function xe(e,t,r,n){let o=0;for(;o<t.length;){let i=r.writeFile(e,t,o,t.length-o);if(!Number.isSafeInteger(i)||i<=0||i>t.length-o)throw new Error(`${n} write did not make valid forward progress`);o+=i}}function q(e,t){if(t!=="win32")return!1;let r=e.code;return r==="EACCES"||r==="EBADF"||r==="EINVAL"||r==="EISDIR"||r==="EPERM"}var S=Object.freeze({platform:process.platform,pathExists:e=>nt(e),makeDirectory:e=>ot(e,{recursive:!0}),openFile:(e,t,r)=>st(e,t,r),syncFile:e=>it(e),closeFile:e=>rt(e)});function Ce(e,t=S){let r=[],n=e;for(;!t.pathExists(n);){r.push(n);let i=Se(n);if(i===n)throw new Error(`Cannot establish a durable directory path without an existing ancestor: ${e}`);n=i}let o="synced";for(let i of r.reverse())t.makeDirectory(i),o=j(o,w(Se(i),t));return o}function w(e,t=S){let r;try{r=t.openFile(e,"r")}catch(n){if(q(n,t.platform))return"unsupported";throw n}try{t.syncFile(r)}catch(n){try{t.closeFile(r)}catch{}if(q(n,t.platform))return"unsupported";throw n}return t.closeFile(r),"synced"}function j(...e){return e.every(t=>t==="not-requested")?"not-requested":e.includes("unsupported")?"unsupported":"synced"}import{createRequire as at}from"module";var ct=at(import.meta.url),Re=ut().version;function ut(){for(let e of["../package.json","../../package.json"])try{return ct(e)}catch{}return{version:"0.0.0"}}var Pe=1,R=".codebaseiq-cache-owner.json",mt=16*1024,De=Object.freeze({...S,randomToken:()=>dt(),linkFile:(e,t)=>pt(e,t),removeFile:e=>lt(e),writeFile:(e,t,r,n)=>gt(e,t,r,n)});function P(e,t){return Object.assign(new Error(`refusing unsafe project dbPath ${JSON.stringify(e)} (${t}); use a repository-relative directory that remains inside the checkout`),{name:"UnsafeCachePathError",code:"CODEBASEIQ_UNSAFE_CACHE_PATH",configuredPath:e,reason:t})}function l(e,t){return Object.assign(new Error(`refusing unowned cache directory ${JSON.stringify(e)} (${t}); move unrelated data elsewhere or choose a new empty dbPath`),{name:"CacheOwnershipError",code:"CODEBASEIQ_CACHE_OWNERSHIP",cacheDir:e,reason:t})}function ht(e,t){let r=p(e);return St(r,bt(r,t))}function bt(e,t){let r=p(e),n=process.env.CODEBASEIQ_CACHE_DIR;return n?v(n):t?.dbPath?Rt(r,t.dbPath):xt(r)}function Ae(){let e=process.env.XDG_CACHE_HOME;return d(e||d(ft(),".cache"),"codebaseiq")}function xt(e){let t=v(e);try{t=p(t)}catch{}let r=we("sha256").update(t).digest("hex").slice(0,12);return d(Ae(),"projects",r)}function Br(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);let t=d(Ae(),"repositories",e);return Fe(t),p(t)}function Gr(e){return process.env.CODEBASEIQ_SHARED_CACHE!=="0"&&!process.env.CODEBASEIQ_CACHE_DIR&&!process.env.CODEBASEIQ_INDEX_DB&&!e?.dbPath}function Wr(e,t){let r=ht(e,t);return{cacheDir:r,dbPath:d(r,"index.db"),indexPath:d(r,"index.scip"),metaPath:d(r,"meta.json")}}function St(e,t,r=De){return Ct(e,t,r).cacheDir}function Ct(e,t,r=De){let n=p(e),o=h(t)?"synced":Fe(t,r),i=p(t),s=d(i,R);if(h(s))return V(n,i),X(s),C(i),{kind:"existing",cacheDir:i};Ee(i),Pt(i),Ee(i);let u=`${JSON.stringify({schemaVersion:Pe,canonicalProjectRoot:n,canonicalCacheDir:i,creatorVersion:Re},null,2)}
|
|
2
|
+
`;try{let c=Dt(s,u,r),b=j(o,c);return{kind:"published",cacheDir:i,achievedDurability:b==="synced"?"directory-durable":"file-flushed",directorySync:b}}catch(c){if(vt(c))return V(n,i),{kind:"existing",cacheDir:i};throw c}}function V(e,t){let r=p(e),n=p(t);return Et(n,r,n)}function $r(e,t){return h(d(t,R))?(V(e,t),ve(t),!0):!1}function Rt(e,t){let r;try{r=ee(t)}catch(s){throw s instanceof g?P(t,s.reason):s}let n=v(e,...r.split("/"));if(n===e||!_(e,n))throw P(t,"outside-project");let o=kt(n),i=p(o);if(!_(e,i)&&i!==e)throw P(t,"symlink-escape");return n}function kt(e){let t=e;for(;!h(t);){let r=A(t);if(r===t)throw P(e,"no-existing-ancestor");t=r}return t}function Et(e,t,r){let n=d(e,R);if(!h(n)||D(n).isSymbolicLink())throw l(e,"missing regular ownership record");let o=D(n);if(!o.isFile()||o.size>mt)throw l(e,"invalid ownership record file");let i=$(n,"cache ownership record"),s=wt(i,e);if(s.canonicalProjectRoot!==t)throw l(e,"ownership record belongs to a different project");if(s.canonicalCacheDir!==r)throw l(e,"ownership record names a different cache directory");return{record:s,ownerSha256:we("sha256").update(i).digest("hex"),physicalCacheDir:e}}function wt(e,t){try{let r=JSON.parse(e);if(r.schemaVersion!==Pe||typeof r.canonicalProjectRoot!="string"||typeof r.canonicalCacheDir!="string"||typeof r.creatorVersion!="string"||!ke(r.canonicalProjectRoot)||!ke(r.canonicalCacheDir))throw new Error("invalid fields");return r}catch(r){throw l(t,`malformed ownership record: ${r instanceof Error?r.message:String(r)}`)}}function Ee(e){let t=H(e).filter(r=>r!==R&&!jt(r));if(t.length>0)throw l(e,`unrecognized existing entries: ${t.slice(0,3).join(", ")}`)}function jt(e){return e.startsWith(`${R}.tmp-`)||[".codebaseiq-generations","affected-shadow-latest.json","affected-shadow.jsonl","agent-hooks","augment-vue-meta.json","cache-lifecycle.lock","evidence.db","evidence.db-shm","evidence.db-wal","health-report-cache.json","index.db","index.db-shm","index.db-wal","index.lock","index.scip","language-indexes","meta.json","reindex-activity.jsonl","shared-cache.json","typescript-index","typescript-scip-fragments","typescript-scip-overlays","typescript-semantic","watch-activity.json","watch-refresh-requests","watch-state.json","watch.lock"].includes(e)?!0:/^(?:reindex-|rust-|typescript-)/.test(e)}function Pt(e){for(let t of H(e)){let r=d(e,t);try{let n=D(r);if(n.isSymbolicLink())throw l(e,`legacy cache entry ${t} is a symlink`);if(n.isDirectory())C(r);else if(n.isFile())X(r);else throw l(e,`legacy cache entry ${t} is not a file or directory`)}catch(n){if(Ie(n))continue;throw n}}C(e)}function ve(e,t=!1){try{let r=D(e);if(r.isSymbolicLink())throw l(e,"managed cache tree contains a symlink");if(r.isFile()){X(e);return}if(!r.isDirectory())throw l(e,"managed cache tree contains a special file");C(e);for(let n of H(e))ve(d(e,n),!0)}catch(r){if(t&&Ie(r))return;throw r}}function Ie(e){let t=e?.code;return t==="ENOENT"||t==="ENOTDIR"}function Fe(e,t=S){let r=Ce(e,t);return C(e),r}function Dt(e,t,r){let n=`${e}.tmp-${process.pid}-${r.randomToken()}`,o,i=!1;try{o=r.openFile(n,"wx",384),i=!0,xe(o,Buffer.from(t),r,"cache ownership record"),r.syncFile(o),r.closeFile(o),o=void 0,r.linkFile(n,e);let s=w(A(e),r);return r.removeFile(n),i=!1,j(s,w(A(e),r))}finally{if(o!==void 0)try{r.closeFile(o)}catch{}if(i)try{r.removeFile(n)}catch{}}}function C(e){process.platform!=="win32"&&je(e,448)}function X(e){process.platform!=="win32"&&je(e,384)}function At(e){if(h(e))return p(e);let t=[],r=e;for(;;){let n=A(r);if(n===r)return e;if(t.unshift(yt(r)),h(n))return d(p(n),...t);r=n}}function Ur(e){return At(v(e))}function vt(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="EEXIST"}import{spawnSync as It}from"child_process";import{createHash as Ft}from"crypto";import{existsSync as Ot,lstatSync as Lt,realpathSync as _t}from"fs";import{dirname as Mt,isAbsolute as Nt,join as Tt,resolve as F}from"path";function Bt(){return{...process.env,GIT_OPTIONAL_LOCKS:"0",LC_ALL:"C"}}var O={run(e,t){let r=Oe(e,t);return r.kind==="success"?r.output:void 0},runResult:Oe},Gt=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],J=/^[0-9a-f]{40,64}$/;function Jr(e,t,r=O){if(!t||t.startsWith("-")||/[\0\r\n]/.test(t))throw new Error(`Invalid Git revision ${JSON.stringify(t)}.`);let n=r.runResult(e,["rev-parse","--verify","--end-of-options",`${t}^{commit}`]);if(n.kind!=="success"||!J.test(n.output))throw new Error(`Git revision ${JSON.stringify(t)} does not resolve to exactly one commit.`);return n.output}function Kr(e,t=O){let r=t.runResult(e,Gt);if(r.kind==="success"){let n=Wt(r.output);if(n)return $t(n,t)}return Ut(e,t)}function Wt(e){let t=e.split(`
|
|
3
|
+
`).map(u=>u.trim());if(t.length!==5)return;let[r,n,o,i,s]=t;if(!r||!n||!o||!i||!s||!J.test(i)||!J.test(s))return;let a=x(r);return{root:a,gitDir:x(I(a,n)),commonDir:x(I(a,o)),headCommit:i,treeOid:s}}function $t(e,t){let r=t.run(e.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...Le(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:Y("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.length===0}}function Ut(e,t){let r=zt(e,t);if(r.kind!=="worktree")return;let n=r.identity,o=n.projectRoot,i=t.run(o,["rev-parse","--git-common-dir"])?.trim();if(!i)return;let s=x(I(o,i)),a=K(t.run(o,["rev-parse","--verify","HEAD"])),u=K(t.run(o,["rev-parse","--verify","HEAD^{tree}"])),c=t.run(o,["status","--porcelain=v1","-z","--untracked-files=all"]);if(c!==void 0)return{...n,commonDir:s,repositoryId:Y("repository",s),headCommit:a,treeOid:u,clean:c.length===0}}function zt(e,t=O){let r=t.runResult(e,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let o=x(n),i=t.run(o,["rev-parse","--absolute-git-dir"])?.trim();if(!i)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=x(I(o,i));return{kind:"worktree",identity:Le(o,s)}}function Le(e,t){return{projectRoot:e,gitDir:t,worktreeId:Y("worktree",`${e}\0${t}`)}}function Yr(e,t,r=O){return K(r.run(e,t))}function I(e,t){return Nt(t)?t:F(e,t)}function x(e){try{return _t(e)}catch{return F(e)}}function Y(e,t){return Ft("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function K(e){return e?.trim()||void 0}function Oe(e,t){let r=It("git",["-C",e,...t],{encoding:"utf-8",env:Bt(),maxBuffer:52428800,stdio:["ignore","pipe","pipe"],windowsHide:!0,timeout:3e4,killSignal:"SIGKILL"});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let o=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,i=r.error?.code;return(/not a git repository/i.test(o)||i==="ENOENT"&&Ot(F(e)))&&!qt(e)?{kind:"not-repository"}:{kind:"error",message:o}}function qt(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=F(e);for(;;){try{return Lt(Tt(t,".git")),!0}catch(n){let o=n.code;if(o!=="ENOENT"&&o!=="ENOTDIR")return!0}let r=Mt(t);if(r===t)return!1;t=r}}export{g as a,L as b,Ht as c,Xt as d,Q as e,Jt as f,_ as g,ee as h,Me as i,Yt as j,Qt as k,Zt as l,Be as m,f as n,de as o,tr as p,rr as q,nr as r,ir as s,pe as t,m as u,pr as v,lr as w,gr as x,We as y,fr as z,ge as A,Ke as B,Ye as C,Qe as D,y as E,fe as F,ye as G,$ as H,Ze as I,et as J,he as K,tt as L,xe as M,q as N,S as O,Ce as P,w as Q,j as R,Re as S,bt as T,Ae as U,xt as V,Br as W,Gr as X,Wr as Y,$r as Z,Ur as _,Bt as $,O as aa,Jr as ba,Kr as ca,Yr as da,I as ea,x as fa};
|
|
4
|
+
//# sourceMappingURL=chunk-327YK6TB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as C}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as C}from"./chunk-NK76RSB6.js";import{a as k}from"./chunk-OJFLPVBP.js";import{f as w,m as P,n as Q}from"./chunk-VCL7FK3E.js";import{o as T}from"./chunk-BH5CE4LN.js";import{d as x}from"./chunk-AM5SUGHF.js";import{f as g}from"./chunk-JOALNFY3.js";import{z as b}from"./chunk-RVYLJDXC.js";function Y(e,n={}){let{samples:o=50,scope:s,maxDisagreements:u=5}=n,c=new C(e),l=F(c.productionCallableDefinitions({scope:s,minLoc:2,requireFunctionLikeSymbol:!0}),o),a=U(e,l);if(l.length===0||!a)return{available:!1,sampleSize:l.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:M(),callees:M()},r=[],m=0,d=a==="semantic"?P(e,l):{rows:new Map,incompleteSymbolIds:new Set,unavailableSymbolIds:new Set},y=a==="semantic"?Q(e,l):{rows:new Map,incompleteSymbolIds:new Set,unavailableSymbolIds:new Set},O=a==="source"?N(e,c,l):null;for(let i of l){let p=S(i,a==="semantic"?(d.rows.get(i.symbolId)??[]).map(f=>f.file):[...O?.referencesBySymbolId.get(i.symbolId)??[]]),E=S(i,a==="semantic"?(y.rows.get(i.symbolId)??[]).map(f=>f.file):[...O?.calleesBySymbolId.get(i.symbolId)??[]]),A=a!=="semantic"||!d.incompleteSymbolIds.has(i.symbolId)&&!d.unavailableSymbolIds.has(i.symbolId),D=a!=="semantic"||!y.incompleteSymbolIds.has(i.symbolId)&&!y.unavailableSymbolIds.has(i.symbolId);A&&D&&(m+=1);let R=S(i,T(e,i,{semanticEvidence:k}).map(f=>f.file)),B=S(i,(c.calleeMap([i],{semantic:!1}).get(i.symbolId)??[]).map(f=>f.file)),K=h(a,"references"),z=h(a,"callees");A?j(t.references,i,"references",R,p,K,r):t.references.skippedOracleUnavailable+=1,D?j(t.callees,i,"callees",B,E,z,r):t.callees.skippedOracleUnavailable+=1}return r.sort((i,p)=>p.cheapOnly.length+p.oracleOnly.length-(i.cheapOnly.length+i.oracleOnly.length)),{available:!0,sampleSize:l.length,oracleCoverage:l.length>0?v(m/l.length):0,oracleKind:a,scores:["references","callees"].map(i=>q(i,t[i],a)),topDisagreements:r.slice(0,u)}}function M(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0,skippedOraclePartial:0,skippedOracleUnavailable:0}}function F(e,n){let o=[...e].sort((c,l)=>c.symbolId-l.symbolId);if(o.length<=n)return o;let s=o.length/n,u=[];for(let c=0;c<n;c++)u.push(o[Math.floor(c*s)]);return u}function U(e,n){let o=n[0];if(!o)return null;if(I(e,o))return"source";try{if(w(e).capability("semantic-references",o.relativePath).available)return"semantic"}catch{}return n.some(s=>I(e,s))?"source":null}function S(e,n){let o=new Set;for(let s of n)s!==e.relativePath&&o.add(s);return o}function j(e,n,o,s,u,c,l){if(!c&&u.size===0){e.skippedOraclePartial+=1;return}e.comparedSymbols+=1,e.cheapTotal+=s.size,e.oracleTotal+=u.size;let a=[],t=[];for(let r of s)u.has(r)?e.agreed+=1:a.push(r);for(let r of u)s.has(r)||t.push(r);(a.length>0||t.length>0)&&l.push({symbol:x(n.symbol),question:o,cheapOnly:a,oracleOnly:t})}var _={references:!0,callees:!1};function q(e,n,o){let s=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.cheapTotal-n.agreed,c=h(o,e);return{question:e,comparedSymbols:n.comparedSymbols,precision:c&&n.cheapTotal>0?v(n.agreed/n.cheapTotal):null,recall:v(s),unverified:u,skippedOraclePartial:n.skippedOraclePartial,skippedOracleUnavailable:n.skippedOracleUnavailable}}function h(e,n){return e==="semantic"?_[n]:!1}function I(e,n){return b(n.relativePath)==="clojure"&&g(e,n.relativePath)!==null}function N(e,n,o){let s=new Map,u=new Map,c=o.filter(t=>I(e,t)),l=new Map;for(let t of c){let r=l.get(t.leaf)??[];r.push(t),l.set(t.leaf,r)}for(let t of n.sourceFiles()){if(b(t)!=="clojure")continue;let r=g(e,t);if(r)for(let m of r.fileIdentifiers)for(let d of l.get(m)??[])L(s,d.symbolId,t)}let a=new Map;for(let t of n.scopedDefinitions()){if(b(t.relativePath)!=="clojure")continue;let r=a.get(t.leaf)??[];r.push(t),a.set(t.leaf,r)}for(let t of c){let r=g(e,t.relativePath);if(r){for(let m of r.callSites)if(!(m.line<t.startLine||m.line>t.endLine))for(let d of a.get(m.calleeLeaf)??[])L(u,t.symbolId,d.relativePath)}}return{referencesBySymbolId:s,calleesBySymbolId:u}}function L(e,n,o){let s=e.get(n);if(s){s.add(o);return}e.set(n,new Set([o]))}function v(e){return Math.round(e*1e3)/1e3}export{Y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-35YYZD3D.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as fe}from"./chunk-TAJ6UGCO.js";import{A as me,z as M}from"./chunk-BLKYYQ7C.js";import{c as ce,h as le}from"./chunk-HBXZAGY6.js";import{X as D,Y as he,b as H,c as z}from"./chunk-IGQQUENU.js";import{B as N,D as ge}from"./chunk-WJOQC4P7.js";import{d as se}from"./chunk-IYBIBMPF.js";import{K as de,L as ue,V as pe,a as j,k as oe,l as k}from"./chunk-XYLV727H.js";import{g as ae}from"./chunk-2VKB5CMA.js";import{j as w,r as W}from"./chunk-ACZDU5GK.js";import{a as V,c as Y,d as J}from"./chunk-6URCE5QY.js";import{H as K,I as Z,J as R,K as ee,M as te,N as re,P,R as ne,T as O,V as ie,W as T,X as _,h as C,n as X}from"./chunk-4O52YNKL.js";import{statSync as ye}from"fs";import{basename as He,isAbsolute as ze,join as L,relative as Xe}from"path";import{fileURLToPath as Je}from"url";import{watch as Ke}from"chokidar";import Ze from"ignore";var Ee=5e3,Re=class{projectRoot;config;watchConfig;outputDb;languages;pnpmWorkspaces;typescriptProjectMode;typescriptProjects;clojureConfigPath;indexerConcurrency;onStatus;onReindexComplete;onReindexError;onRefreshSuppressed;onFileChanged;onBulkChange;onError;reindexRunner;subscriptionFactory;budgetInspector;clock;activeOperation=null;stopPromise=null;stopInProgress=!1;status={state:"idle"};debounceTimer=null;cooldownTimer=null;budgetTimer=null;dirty=!1;changedFiles=0;pendingTrigger=null;reindexInFlight=!1;lastReindexEnd=0;fileChangeTimer=null;pendingFileChanges=new Set;bulkChangePending=!1;fsWatchers=[];sourcePollingFallbackStarted=!1;gitPollTimer=null;lastGitState=null;gitignoreFilter;extraIgnore;stopped=!1;observationEpoch=0;changeSequence=0;constructor(e){this.projectRoot=e.projectRoot,this.config=e.config,this.watchConfig=ge(e.config),this.outputDb=e.outputDb??L(Z(this.projectRoot,e.config),"index.db"),this.languages=e.languages,this.pnpmWorkspaces=e.config.indexer?.typescript?.pnpmWorkspaces??!1,this.typescriptProjectMode=e.config.indexer?.typescript?.projectMode,this.typescriptProjects=e.config.indexer?.typescript?.projects,this.clojureConfigPath=e.config.indexer?.clojure?.configPath,this.indexerConcurrency=e.config.indexerConcurrency,this.onStatus=e.onStatus??(()=>{}),this.onReindexComplete=e.onReindexComplete??(()=>{}),this.onReindexError=e.onReindexError??(()=>{}),this.onRefreshSuppressed=e.onRefreshSuppressed??(()=>{}),this.onFileChanged=e.onFileChanged,this.onBulkChange=e.onBulkChange;let r=e.onError??(n=>console.error(n.message));this.onError=n=>{this.observationEpoch+=1,r(n)},this.clock=e.clock??it,Ie.set(this,gt(e.stopTimeoutMs??Ee,"watcher stop timeout")),this.reindexRunner=e.reindexRunner??pt(),this.subscriptionFactory=e.subscriptionFactory??ot,this.budgetInspector=e.budgetInspector??le,Pe.set(this,{gitReader:e.gitReader??ne,languages:Te(e.languages??e.config.languages),stagedIndexEntries:null,gitSignalPaths:null,lastGitSignal:null}),this.gitignoreFilter=ae(e.projectRoot),this.extraIgnore=Ze(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){if(this.stopInProgress)throw new Error("Cannot restart a watcher while its previous ownership is still draining.");this.stopped=!1,this.stopPromise=null,G(this).errors=[],this.sourcePollingFallbackStarted=!1,this.observationEpoch+=1,this.setStatus({state:"idle"}),this.startGitStatePolling();try{this.startSourceWatcher()}catch(e){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(e)}`))}}stop(){if(this.stopPromise)return this.stopPromise;this.stopped=!0,this.stopInProgress=!0;let e=this.fsWatchers;this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.clearBudgetTimer(),this.clearGitPollTimer(),this.clearFileChangeWindow();let r=this.activeOperation;r&&this.setStatus({state:"draining",startedAt:this.wallNow(),reason:"waiting for the active reindex worker to exit"});let n=[...G(this).closures],i=tt(this),s=this.clock.now()+i;return this.stopPromise=this.finishStop(e,n,r,s,i).catch(a=>{throw this.stopInProgress=!1,a}),this.stopPromise}observation(){return{epoch:this.observationEpoch,changeSequence:this.changeSequence}}requestRefresh(e,r={}){if(!this.stopped){if(!r.immediate||this.reindexInFlight||this.status.state==="cooldown"||this.status.state==="budget-paused"){this.scheduleReindex(e);return}this.pendingTrigger=Se(this.pendingTrigger,e),this.changedFiles+=1,this.changeSequence+=1,this.clearDebounceTimer(),this.triggerReindex()}}startSourceWatcher(e=!1){let r=this.subscriptionFactory(this.projectRoot,{ignoreInitial:!0,ignored:(n,i)=>this.isIgnoredWatchPath(n,i?.isDirectory()??!1),usePolling:e,...e?{interval:500,binaryInterval:1e3}:{}});r.on("all",(n,i)=>{!this.stopped&&n!=="addDir"&&n!=="unlinkDir"&&this.handleFileChange(i)}),r.on("error",n=>this.handleSourceWatcherError(r,n,e)),this.fsWatchers.push(r)}handleSourceWatcherError(e,r,n){if(n||this.sourcePollingFallbackStarted||!ht(r)||this.stopped){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(r)}`));return}this.observationEpoch+=1,this.sourcePollingFallbackStarted=!0,this.fsWatchers=this.fsWatchers.filter(i=>i!==e),rt(G(this),e,i=>this.onError(i));try{this.startSourceWatcher(!0)}catch(i){this.onError(new Error(`Failed to watch ${this.projectRoot}: ${String(i)}`))}}isIgnoredWatchPath(e,r){let n=this.relativeWatchPath(e);if(!n)return!1;let i=r?`${n}/`:n;return i===".git/"||i.startsWith(".git/")?!0:this.gitignoreFilter.isIgnored(i)||this.extraIgnore.ignores(i)}handleFileChange(e){let r=this.relativeWatchPath(e);!r||r===".."||r.startsWith("../")||r===".git"||r.startsWith(".git/")||this.gitignoreFilter.isIgnored(r)||this.extraIgnore.ignores(r)||r.endsWith("index.db")||r.endsWith("index.scip")||r.endsWith("index.db.tmp")||He(r).startsWith(ce)||(r===".codebaseiq.json"&&Ce(this,this.projectRoot),we(this,r)&&(this.noteFileChange(r),this.scheduleReindex({kind:"watch-source",detail:r})))}noteFileChange(e){!this.onFileChanged&&!this.onBulkChange||(this.bulkChangePending||(this.pendingFileChanges.add(e),this.pendingFileChanges.size>at&&(this.pendingFileChanges.clear(),this.bulkChangePending=!0)),this.fileChangeTimer??=this.clock.setTimeout(()=>this.flushFileChangeWindow(),st))}flushFileChangeWindow(){if(this.fileChangeTimer=null,this.stopped)return;let e=[...this.pendingFileChanges],r=this.bulkChangePending;this.pendingFileChanges.clear(),this.bulkChangePending=!1;try{r?this.onBulkChange?.():this.onFileChanged?.(e)}catch{}}clearFileChangeWindow(){this.fileChangeTimer&&(this.clock.clearTimeout(this.fileChangeTimer),this.fileChangeTimer=null),this.pendingFileChanges.clear(),this.bulkChangePending=!1}relativeWatchPath(e){let r=ze(e)?e:L(this.projectRoot,e);return Xe(this.projectRoot,r).replaceAll("\\","/")}scheduleReindex(e){if(this.pendingTrigger=Se(this.pendingTrigger,e),this.changedFiles++,this.changeSequence+=1,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}if(this.status.state==="budget-paused"){this.dirty=!0,this.setStatus({...this.status,dirty:!0});return}this.clearDebounceTimer();let r=this.wallNow()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:r}),this.debounceTimer=this.clock.setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let e=this.inspectBudget();if(e.state==="paused"){this.dirty=!0;let a=Math.max(this.wallNow()+1,e.until);this.setStatus({state:"budget-paused",until:a,dirty:!0,reason:e.detail,rebuilt:e.rebuilt,estimatedWriteBytes:e.estimatedWriteBytes}),this.clearBudgetTimer(),this.budgetTimer=this.clock.setTimeout(()=>{this.budgetTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},Math.min(2147483647,Math.max(1,a-this.wallNow())));return}let r=this.clock.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&r<this.watchConfig.cooldownMs){let a=this.watchConfig.cooldownMs-r;this.dirty=!0;let o=this.wallNow()+a;this.setStatus({state:"cooldown",until:o,dirty:!0}),this.cooldownTimer=this.clock.setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},a);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let n=this.pendingTrigger??{kind:"watch-source"};this.pendingTrigger=null;let i=this.wallNow();this.setStatus({state:"indexing",startedAt:i});let s=this.reindexRunner.start(this.reindexRequest(n));this.activeOperation=s,s.completion.then(a=>{if(this.reindexInFlight=!1,this.lastReindexEnd=this.clock.now(),this.stopped)return;let o=!1;try{o=this.onReindexComplete(a,n)===!0}catch(l){this.onError(l instanceof Error?l:new Error(String(l)))}if(this.dirty&&!this.stopped){if(o){let c=this.pendingTrigger??{kind:"unknown"};this.dirty=!1,this.changedFiles=0,this.pendingTrigger=null,this.onRefreshSuppressed(c),this.setStatus({state:"idle"});return}let l=this.wallNow()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:l,dirty:!0}),this.cooldownTimer=this.clock.setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(a=>{if(this.reindexInFlight=!1,this.lastReindexEnd=this.clock.now(),this.stopped)return;let o=a instanceof Error?a:new Error(String(a));this.onReindexError(o,n),this.onError(o),this.setStatus({state:"idle"})}).finally(()=>{this.activeOperation===s&&(this.activeOperation=null)})}async finishStop(e,r,n,i,s){let a=[],o=e.map(async p=>{try{await p.close()}catch(m){a.push(`watch subscription close failed: ${String(m)}`)}});o.push(...r),n&&o.push((async()=>{try{let p=await n.cancel();p.state==="degraded"&&a.push(p.reason)}catch(p){a.push(`reindex cancellation failed: ${p instanceof Error?p.message:String(p)}`)}})());let l=o.length,c=o.map(p=>p.finally(()=>{l-=1})),u=await et(c,i,this.clock),d=G(this);return a.push(...d.errors),d.errors=[],u?this.stopInProgress=!1:(a.push(`watch shutdown exceeded the ${s}ms deadline with ${l} operation(s) still pending`),Promise.all(c).then(()=>{this.stopInProgress=!1})),a.length>0?(this.setStatus({state:"draining",startedAt:this.wallNow(),reason:a.join("; ")}),{state:"degraded",reasons:a}):(this.setStatus({state:"idle"}),{state:"stopped"})}wallNow(){return this.clock.wallNow?.()??this.clock.now()}inspectBudget(){try{return this.budgetInspector(this.outputDb,this.watchConfig.resourceBudget,new Date(this.wallNow()))}catch(e){return{state:"paused",reason:"activity-evidence",until:this.wallNow()+this.watchConfig.resourceBudget.windowMs,rebuilt:0,estimatedWriteBytes:0,detail:`reindex activity evidence could not be read: ${e instanceof Error?e.message:String(e)}`}}}reindexRequest(e){return{projectRoot:this.projectRoot,config:this.config,languages:this.languages,pnpmWorkspaces:this.pnpmWorkspaces,typescriptProjectMode:this.typescriptProjectMode,typescriptProjects:this.typescriptProjects,clojureConfigPath:this.clojureConfigPath,indexerConcurrency:this.indexerConcurrency,trigger:e}}setStatus(e){this.status=e,this.onStatus(e)}clearDebounceTimer(){this.debounceTimer&&(this.clock.clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(this.clock.clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}clearBudgetTimer(){this.budgetTimer&&(this.clock.clearTimeout(this.budgetTimer),this.budgetTimer=null)}startGitStatePolling(){if(this.lastGitState=this.readGitState(),!this.lastGitState)return;let e=y(this);e.gitSignalPaths=this.resolveGitSignalPaths(),e.lastGitSignal=this.gitActivitySignal(),e.stagedIndexEntries=xe(this.projectRoot,e.gitReader),this.gitPollTimer=this.clock.setInterval(()=>this.pollGitState(),this.watchConfig.gitPollMs),this.gitPollTimer.unref?.()}resolveGitSignalPaths(){let e=y(this).gitReader,r=T(this.projectRoot,["rev-parse","--git-dir"],e),n=T(this.projectRoot,["rev-parse","--git-common-dir"],e);if(!r)return null;let i=_(this.projectRoot,r),s=n?_(this.projectRoot,n):i,a=this.lastGitState?.indexPath;return[L(i,"HEAD"),L(s,"packed-refs"),L(s,"refs","heads"),...a?[a]:[]]}gitActivitySignal(){let e=y(this).gitSignalPaths;if(!e)return null;let r="";for(let n of e)try{let i=ye(n);r+=`${n}:${i.mtimeMs}:${i.size};`}catch{r+=`${n}:absent;`}return r}pollGitState(){let e=this.gitActivitySignal();if(e!==null){if(e===y(this).lastGitSignal)return;y(this).lastGitSignal=e}let r=this.lastGitState,n=this.readGitState();if(!r||!n||this.stopped){this.lastGitState=n;return}this.lastGitState=n;let i=r.head!==n.head,s=r.indexPath!==n.indexPath||r.indexMtimeMs!==n.indexMtimeMs||r.indexSize!==n.indexSize;if(!i&&!s)return;let a=y(this),o=a.stagedIndexEntries,l=xe(this.projectRoot,a.gitReader);a.stagedIndexEntries=l;let c=ft(this.projectRoot,a.gitReader,r,n,o,l,i,s),u=null;c!==null&&(c.includes(".codebaseiq.json")&&Ce(this,this.projectRoot),u=c.filter(d=>we(this,d)),u.length===0)||(i&&s?this.scheduleReindex({kind:"watch-git-state",detail:F("HEAD and index changed",u)}):i?this.scheduleReindex({kind:"watch-git-head",detail:F("HEAD changed",u)}):s&&this.scheduleReindex({kind:"watch-git-index",detail:F(n.indexPath??"index changed",u)}))}readGitState(){let e=y(this).gitReader,r=T(this.projectRoot,["rev-parse","--git-path","index"],e);if(!r)return null;let n=_(this.projectRoot,r),i={head:T(this.projectRoot,["rev-parse","--verify","HEAD"],e),indexPath:n};try{let s=ye(n);i.indexMtimeMs=s.mtimeMs,i.indexSize=s.size}catch{i.indexMtimeMs=void 0,i.indexSize=void 0}return i}clearGitPollTimer(){this.gitPollTimer&&(this.clock.clearInterval(this.gitPollTimer),this.gitPollTimer=null)}};async function et(t,e,r){if(t.length===0)return!0;let n=Promise.all(t).then(()=>!0),i=Math.max(0,e-r.now()),s=null,a=new Promise(l=>{s=r.setTimeout(()=>l(!1),i)}),o=await Promise.race([n,a]);return o&&s&&r.clearTimeout(s),o}var ve=new WeakMap,Ie=new WeakMap,Pe=new WeakMap;function G(t){let e=ve.get(t);if(e)return e;let r={closures:new Set,errors:[]};return ve.set(t,r),r}function tt(t){return Ie.get(t)??Ee}function y(t){let e=Pe.get(t);if(!e)throw new Error("Watcher input state was not initialized.");return e}function rt(t,e,r){let n=Promise.resolve().then(()=>e.close()).catch(i=>{let s=`watch subscription close failed during polling fallback: ${String(i)}`;t.errors.push(s),r(new Error(s))});t.closures.add(n),n.then(()=>t.closures.delete(n))}function nt(t,e=Y){let{projectRoot:r,config:n,languages:i,pnpmWorkspaces:s,typescriptProjectMode:a,typescriptProjects:o,clojureConfigPath:l,indexerConcurrency:c,trigger:u}=t,d=N(r),p=Object.keys(d).length>0?d:n,m=re(r,p),f=p.indexer?.typescript,g=p.indexer?.clojure,I=e(process.pid);if(!I)throw new Error(`Could not establish watcher process identity for reindex worker ownership (pid ${process.pid}).`);return{workerPath:Je(new URL("./reindex-worker.js",import.meta.url)),env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:r,SCIP_REINDEX_OUTPUT_SCIP:m.indexPath,SCIP_REINDEX_OUTPUT_DB:m.dbPath,SCIP_REINDEX_LANGUAGES:(p.languages??i)?.join(",")??"",SCIP_REINDEX_INDEXER_CONCURRENCY:String(p.indexerConcurrency??c??""),SCIP_REINDEX_PNPM_WORKSPACES:f?.pnpmWorkspaces??s?"1":"",SCIP_REINDEX_TYPESCRIPT_CONFIG:JSON.stringify({projectMode:f?.projectMode??a,projects:f?.projects??o??[]}),SCIP_REINDEX_CLOJURE_CONFIG_PATH:g?.configPath??l??"",SCIP_REINDEX_TRIGGER_KIND:u.kind,SCIP_REINDEX_TRIGGER_DETAIL:u.detail??"",SCIP_REINDEX_PROCESS_GROUP_LEADER:"1",SCIP_REINDEX_PARENT_IDENTITY:JSON.stringify(I)}}}var it={now:J,wallNow:()=>Date.now(),setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},ot=(t,e)=>Ke(t,e),st=120,at=200,ct=15*6e4,lt=1e3,dt=64*1024;function ut(){return{stdoutTail:"",stderrTail:"",stdoutTruncated:!1,stderrTruncated:!1}}function be(t,e){let r=t instanceof Error?t.message:String(t),n=e.stderrTail.trim()||e.stdoutTail.trim();return n?`${r}
|
|
2
|
+
${n}`:r}function pt(t={}){let e=t.timeoutMs??ct,r=t.terminationGraceMs??lt,n=t.maxOutputBytes??dt,i=t.resolveLaunch??nt;return{start(s){let a=i(s),o=new AbortController,l=ut(),c=!1,u=z({command:process.execPath,args:[...process.execArgv,a.workerPath],label:"watch reindex worker",env:a.env,timeoutMs:e,terminationGraceMs:r,maxStdoutBytes:n,maxStderrBytes:n,outputLimitBehavior:"truncate-tail",signal:o.signal,detached:!0}).then(d=>{if(l={stdoutTail:d.stdout,stderrTail:d.stderr,stdoutTruncated:d.stdoutTruncated,stderrTruncated:d.stderrTruncated},d.status!==0)throw new Error(be(new Error(`Reindex worker exited with ${d.signal?`signal ${d.signal}`:`code ${d.status}`}`),l));return d.durationMs}).catch(d=>{throw d instanceof H&&(l={stdoutTail:d.stdout,stderrTail:d.stderr,stdoutTruncated:d.stdoutTruncated,stderrTruncated:d.stderrTruncated}),new Error(be(d,l),{cause:d})}).finally(()=>{c=!0});return{completion:u,async cancel(){c||o.abort();try{await u}catch{}return{state:"exited",diagnostics:l}},diagnostics:()=>l}}}}function Se(t,e){return t?t.kind===e.kind?t.detail===e.detail?t:{kind:t.kind,detail:"multiple changes"}:{kind:"watch-git-state",detail:`${t.kind}, ${e.kind}`}:e}function ht(t){return t instanceof Error&&"code"in t&&t.code==="EMFILE"||String(t).includes("EMFILE: too many open files")}function gt(t,e){if(!Number.isSafeInteger(t)||t<=0)throw new Error(`${e} must be a positive integer.`);return t}function Te(t){return t&&t.length>0?[...t]:j}function Ce(t,e){try{y(t).languages=Te(N(e).languages)}catch{y(t).languages=j}}function we(t,e){return X(e,y(t).languages)!=="other"}function ft(t,e,r,n,i,s,a,o){let l=new Set;if(a){if(!r.head||!n.head)return null;let c=e.runResult(t,["diff","--name-only","-z","--no-renames","--relative",r.head,n.head,"--"]);if(c.kind!=="success")return null;for(let u of mt(c.output))l.add(u)}if(o){if(i===null||s===null)return null;for(let c of Rt(i,s))l.add(c)}return[...l].sort()}function xe(t,e){let r=e.runResult(t,["diff","--cached","--raw","-z","--no-renames","--relative","--"]);return r.kind==="success"?yt(r.output):null}function mt(t){return t.split("\0").filter(e=>e.length>0)}function yt(t){let e=t.split("\0");if(e.at(-1)===""&&e.pop(),e.length%2!==0)return null;let r=new Map;for(let n=0;n<e.length;n+=2){let i=e[n],s=e[n+1];if(!i.startsWith(":")||!s)return null;r.set(s,i)}return r}function Rt(t,e){return[...new Set([...t.keys(),...e.keys()])].filter(n=>t.get(n)!==e.get(n))}function F(t,e){return e===null?`${t}; changed paths unavailable`:e.length===0?t:e.length===1?e[0]:`${e.length} compiler inputs changed`}import{existsSync as E,lstatSync as b,readdirSync as Ae,realpathSync as ke,rmSync as v,statSync as _e}from"fs";import{join as h,resolve as A,sep as We}from"path";var vt=3600*1e3,bt=2*1024*1024*1024,B=300*1e3,St="gc-state.json",Ct="gc.lock",wt="projects-gc-state.json",xt="projects-gc.lock",Et=1440*60*1e3;function It(t){let e=t.leases.filter(o=>o.managed&&!o.live&&!o.busy),r=Ge(t.leases,t.locks),n={};for(let o of t.generations)r.has(o.generationId)||(n[o.generationId]=o.unreferencedAt??t.nowMs);let i=t.generations.filter(o=>!r.has(o.generationId)).sort((o,l)=>n[o.generationId]-n[l.generationId]||o.generationId.localeCompare(l.generationId)),s=new Set;for(let o of i)t.nowMs-n[o.generationId]>=t.policy.generationTtlMs&&s.add(o.generationId);let a=t.generations.filter(o=>!s.has(o.generationId)).reduce((o,l)=>o+l.size,0);for(let o of i){if(a<=t.policy.budgetBytes)break;s.has(o.generationId)||(s.add(o.generationId),a-=o.size)}for(let o of s)delete n[o];return{deleteWorktrees:e,deleteGenerations:t.generations.filter(o=>s.has(o.generationId)),deleteLocks:t.locks.filter(o=>!o.live),deleteTemporaries:t.temporaries.filter(o=>!o.live),protectedGenerationIds:[...r].sort(),unreferencedSince:n}}function Ge(t,e){let r=new Set(t.filter(n=>n.managed&&(n.live||n.busy)).flatMap(n=>[n.lease.baseGenerationId,n.lease.activeGenerationId]).filter(n=>n!==void 0));for(let n of e)n.live&&r.add(n.generationId);return r}function lr(t,e,r={}){if(!te())return{kind:"disabled"};let n=O(t);if(!n)return{kind:"unavailable"};let i=h(R(),"repositories",n.repositoryId),s=(r.now??Date.now)(),a=E(i)?je(t,i,n.repositoryId,e,s,r):{kind:"unavailable"};return kt(t,n.repositoryId,e,s,r),Pt(s,r),a}function Pt(t,e){let r=h(R(),"projects"),n={examined:0,reclaimed:0};if(!E(r))return n;let i=h(r,wt),s=Ne(i);if(!e.force&&s!==void 0&&t-s<B)return n;let a=k(h(r,xt));if(!a)return n;try{for(let o of x(r)){let l=h(r,o),c;try{c=b(l)}catch{continue}if(!(!c.isDirectory()||c.isSymbolicLink())&&(n.examined+=1,!!Tt(l,t)))try{v(l,{recursive:!0,force:!0}),n.reclaimed+=1}catch{}}W(i,{version:1,lastSweepAt:new Date(t).toISOString()},{spacing:2,trailingNewline:!0})}finally{a.release()}return n}function Tt(t,e){let r=h(t,K),n;try{let a=JSON.parse(C(r,"cache-ownership"));if(typeof a.canonicalProjectRoot!="string"||a.canonicalProjectRoot.length===0)return!1;n=a.canonicalProjectRoot}catch{return!1}if(E(n))return!1;try{if(e-b(t).mtimeMs<Et)return!1}catch{return!1}let i=he(D(t).statePath);if(i&&w(i.pid))return!1;let s=k(h(t,"cache-lifecycle.lock"));return s===null?!1:(s.release(),!0)}function je(t,e,r,n,i,s){let a=h(e,"gc-state.json"),o=De(a);if(!s.force&&o&&i-Date.parse(o.lastSweepAt)<B)return{kind:"throttled",sweptAt:o.lastSweepAt};let l=oe(e,{now:()=>i});if(!l)return{kind:"busy"};try{let c=Oe(t,e,r,o?.unreferencedSince??{}),u=It({nowMs:i,...c,policy:{generationTtlMs:s.policy?.generationTtlMs??vt,budgetBytes:s.policy?.budgetBytes??bt}}),d=0,p=0;for(let g of u.deleteWorktrees){if(!Q(g.lease))continue;if(!E(g.lease.localCacheDir)){v(g.leasePath,{force:!0}),p+=1;continue}if(!At(g.lease))continue;let I=k(h(g.lease.localCacheDir,"cache-lifecycle.lock"));if(I)try{if($(g.lease,!0))continue;try{fe({projectRoot:g.lease.projectRoot,cacheDir:g.lease.localCacheDir,cliVersion:n})}catch{continue}if($(g.lease,!0))continue;v(g.lease.localCacheDir,{recursive:!0,force:!0}),v(g.leasePath,{force:!0}),p+=1}finally{I.release()}}for(let g of u.deleteLocks)v(g.path,{force:!0});for(let g of u.deleteTemporaries)v(g.path,{recursive:!0,force:!0});for(let g of u.deleteGenerations)v(g.path,{recursive:!0,force:!0}),d+=g.size;se(h(e,"evidence.db"));let m={kind:"swept",sweptAt:new Date(i).toISOString(),deletedWorktrees:p,deletedGenerations:u.deleteGenerations.length,deletedBytes:d,protectedGenerations:u.protectedGenerationIds.length},f={version:1,lastSweepAt:m.sweptAt,unreferencedSince:u.unreferencedSince,lastResult:m};return W(a,f,{spacing:2,trailingNewline:!0}),m}catch(c){return{kind:"failed",error:c instanceof Error?c.message:String(c)}}finally{l.release()}}function kt(t,e,r,n,i){let s=h(R(),"repositories");if(!E(s))return;let a=h(s,St),o=Ne(a);if(!i.force&&o!==void 0&&n-o<B)return;let l=k(h(s,Ct));if(l)try{for(let c of x(s)){if(c===e||!/^[a-f0-9]{24}$/.test(c))continue;let u=h(s,c),d;try{d=b(u)}catch{continue}if(!d.isDirectory()||d.isSymbolicLink())continue;let p=_t(u)??t;je(p,u,c,r,n,i)}W(a,{version:1,lastSweepAt:new Date(n).toISOString()},{spacing:2,trailingNewline:!0})}finally{l.release()}}function dr(t,e,r){let n=de(t,r.dbPath,e);if(n)return{state:"bypassed",reason:n,localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let i=O(t);if(!i)return{state:"unavailable",reason:"Git worktree identity is unavailable",localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let s=h(R(),"repositories",i.repositoryId),a=U(h(s,"worktrees",`${i.worktreeId}.json`)),o=De(h(s,"gc-state.json")),l=Oe(t,s,i.repositoryId,o?.unreferencedSince??{}),c=Ge(l.leases,l.locks),u=l.generations.filter(f=>!c.has(f.generationId)),d=l.generations.reduce((f,g)=>f+g.size,0),p=ue(t,e),m=0;return p&&(m=Lt(p)),{state:"managed",repositoryId:i.repositoryId,worktreeId:i.worktreeId,localCacheDir:r.cacheDir,...a?{baseGenerationId:a.baseGenerationId,activeGenerationId:a.activeGenerationId,lastAction:a.lastAction,reason:a.lastReason,lastSeenAt:a.lastSeenAt}:{},generations:l.generations.length,generationBytes:d,protectedGenerations:l.generations.filter(f=>c.has(f.generationId)).length,unreferencedGenerations:u.length,unreferencedBytes:u.reduce((f,g)=>f+g.size,0),temporaryGenerations:l.temporaries.length,sharedEvidence:{path:p,exists:m>0,bytes:m},cleanup:o?.lastResult}}function Lt(t){return[t,`${t}-wal`,`${t}-shm`].reduce((e,r)=>{try{return e+_e(r).size}catch{return e}},0)}function Oe(t,e,r,n){let i=new Set(ie(t).map(c=>A(c.path))),s=[];for(let c of x(h(e,"worktrees"))){if(!c.endsWith(".json"))continue;let u=h(e,"worktrees",c),d=U(u);if(!d)continue;let p=A(d.projectRoot);s.push({leasePath:u,lease:d,managed:d.repositoryId===r&&Q(d),live:i.has(p)||E(p),busy:$(d)})}let a=[];for(let c of x(h(e,"locks"))){let u=/^([a-f0-9]{64})\.lock$/.exec(c);if(!u)continue;let d=h(e,"locks",c),p=q(d),m=p!==void 0&&w(p),f=u[1];a.push({generationId:f,path:d,live:m})}let o=[],l=[];for(let c of x(h(e,"generations"))){let u=/^\.tmp-(\d+)-/.exec(c);if(u){let m=h(e,"generations",c),f=Number(u[1]);try{l.push({path:m,size:Le(m),live:Number.isSafeInteger(f)&&w(f)})}catch{}continue}if(!/^[a-f0-9]{64}$/.test(c))continue;let d=h(e,"generations",c),p;try{p=b(d)}catch{continue}!p.isDirectory()||p.isSymbolicLink()||o.push({generationId:c,path:d,size:Le(d),...n[c]===void 0?{}:{unreferencedAt:n[c]}})}return{leases:s,generations:o,locks:a,temporaries:l}}function Q(t){if(t.ownershipChecksum!==pe(t)||P(t.localCacheDir)!==P(ee(t.projectRoot)))return!1;let e=P(h(R(),"projects"));return P(t.localCacheDir).startsWith(`${e}${We}`)}function At(t){if(!Q(t))return!1;let e=A(R()),r=A(h(e,"projects")),n=A(t.localCacheDir);try{let i=b(e),s=b(r),a=b(n);if(!i.isDirectory()||i.isSymbolicLink()||!s.isDirectory()||s.isSymbolicLink()||!a.isDirectory()||a.isSymbolicLink())return!1;let o=ke(r);return ke(n).startsWith(`${o}${We}`)}catch{return!1}}function _t(t){for(let e of x(h(t,"worktrees"))){if(!e.endsWith(".json"))continue;let r=U(h(t,"worktrees",e));if(r)return r.projectRoot}}function $(t,e=!1){for(let n of e?["index.lock"]:["index.lock","cache-lifecycle.lock"]){let i=q(h(t.localCacheDir,n));if(i!==void 0&&w(i))return!0}let r=q(D(t.localCacheDir).lockPath);return r!==void 0&&w(r)}function U(t){try{let e=JSON.parse(C(t,"worktree cache lease"));return e.version!==1||typeof e.repositoryId!="string"||typeof e.worktreeId!="string"||typeof e.projectRoot!="string"||e.treeOid!==void 0&&typeof e.treeOid!="string"||typeof e.localCacheDir!="string"||e.baseGenerationId!==void 0&&typeof e.baseGenerationId!="string"||e.activeGenerationId!==void 0&&typeof e.activeGenerationId!="string"||typeof e.ownershipChecksum!="string"||!/^[a-f0-9]{64}$/.test(e.ownershipChecksum)||typeof e.lastAction!="string"||e.lastReason!==void 0&&typeof e.lastReason!="string"||typeof e.lastSeenAt!="string"?null:e}catch{return null}}function q(t){try{let e=JSON.parse(C(t,"watch lock record"));return typeof e.pid=="number"&&Number.isSafeInteger(e.pid)&&e.pid>0?e.pid:void 0}catch{return}}function De(t){try{let e=JSON.parse(C(t,"repository cache GC state"));return e.version!==1||typeof e.lastSweepAt!="string"||!Number.isFinite(Date.parse(e.lastSweepAt))||!e.unreferencedSince||typeof e.unreferencedSince!="object"||!e.lastResult?null:e}catch{return null}}function Ne(t){try{let e=JSON.parse(C(t,"global repository cache GC state"));if(e.version!==1||typeof e.lastSweepAt!="string")return;let r=Date.parse(e.lastSweepAt);return Number.isFinite(r)?r:void 0}catch{return}}function x(t){try{return Ae(t)}catch{return[]}}function Le(t){let e=0,r=[t];for(;r.length>0;){let n=r.pop();for(let i of Ae(n,{withFileTypes:!0})){let s=h(n,i.name);i.isDirectory()?r.push(s):i.isFile()&&(e+=_e(s).size)}}return e}import{createHash as Me}from"crypto";import{tmpdir as Wt,userInfo as Gt}from"os";import{join as Fe}from"path";var S=1,mr=1*1024*1024,yr=64*1024*1024,Rr=12e4,vr=["NO_COLOR","FORCE_COLOR","CLICOLOR","CLICOLOR_FORCE","TERM","CODEBASEIQ_DEBUG"];function br(t){let e=$e(),r=Me("sha256").update(`${e}\0${t}`).digest("hex");return process.platform==="win32"?`\\\\.\\pipe\\codebaseiq-lane-${r.slice(0,32)}`:Fe(jt(),`lane-${r.slice(0,24)}.sock`)}function jt(){let t=$e(),e=Me("sha256").update(t).digest("hex").slice(0,16);return Fe(Wt(),`codebaseiq-${e}`)}function $e(){try{return Gt().username}catch{return`uid-${typeof process.getuid=="function"?process.getuid():"unknown"}`}}function Sr(t,e){let r=Buffer.from(JSON.stringify(t),"utf8");if(r.byteLength>e)throw new Error(`query-lane frame of ${r.byteLength} bytes exceeds the ${e}-byte limit`);let n=Buffer.allocUnsafe(4+r.byteLength);return n.writeUInt32LE(r.byteLength,0),r.copy(n,4),n}function Cr(t,e,r){let n=Buffer.alloc(0),i=!1,s=a=>{i||(i=!0,r(new Error(a)))};return{push(a){if(!i)for(n=n.byteLength===0?a:Buffer.concat([n,a]);n.byteLength>=4;){let o=n.readUInt32LE(0);if(o>t){s(`query-lane frame of ${o} bytes exceeds the ${t}-byte limit`);return}if(n.byteLength<4+o)return;let l=n.subarray(4,4+o);n=n.subarray(4+o);let c;try{c=JSON.parse(l.toString("utf8"))}catch{s("query-lane frame carried invalid JSON");return}if(e(c),i)return}}}}function wr(t){if(!t||typeof t!="object")return null;let e=t;return e.protocolVersion!==S||typeof e.projectRoot!="string"||e.projectRoot.length===0?null:e.kind==="ping"?{protocolVersion:S,kind:"ping",projectRoot:e.projectRoot}:e.kind!=="execute"||!Array.isArray(e.argv)||!e.argv.every(r=>typeof r=="string")||typeof e.cwd!="string"||e.deadlineMs!==void 0&&!Number.isFinite(e.deadlineMs)||e.envAllowlist!==void 0&&(typeof e.envAllowlist!="object"||e.envAllowlist===null||Array.isArray(e.envAllowlist)||!Object.values(e.envAllowlist).every(r=>typeof r=="string"))||e.tty!==void 0&&(typeof e.tty!="object"||e.tty===null||typeof e.tty.isTTY!="boolean"||e.tty.columns!==void 0&&!Number.isFinite(e.tty.columns))||e.clientInvocation!==void 0&&(typeof e.clientInvocation!="object"||e.clientInvocation===null||typeof e.clientInvocation.execPath!="string"||e.clientInvocation.execPath.length===0||e.clientInvocation.scriptPath!==void 0&&typeof e.clientInvocation.scriptPath!="string")?null:{...e,kind:"execute"}}function xr(t){if(!t||typeof t!="object")return null;let e=t;if(e.protocolVersion!==S)return null;if(e.ok===!1)return e.code!=="unsupported"&&e.code!=="invalid-request"&&e.code!=="wrong-project"&&e.code!=="busy"&&e.code!=="stale-index"&&e.code!=="ineligible-command"&&e.code!=="execution-error"||typeof e.message!="string"?null:{ok:!1,protocolVersion:S,code:e.code,message:e.message};if(e.ok!==!0)return null;if(e.kind==="accepted"){let n=e.serverPid;return typeof n!="number"||!Number.isInteger(n)||n<=0?null:{ok:!0,kind:"accepted",protocolVersion:S,serverPid:n}}if(e.kind==="executed"){let n=e;return typeof n.serverPid!="number"||!Number.isInteger(n.serverPid)||n.serverPid<=0||typeof n.exitCode!="number"||!Number.isInteger(n.exitCode)||typeof n.stdout!="string"||typeof n.stderr!="string"||typeof n.generation!="string"||!/^[a-f0-9]{64}$/.test(n.generation)||typeof n.durationMs!="number"||!Number.isFinite(n.durationMs)?null:{ok:!0,kind:"executed",protocolVersion:S,serverPid:n.serverPid,exitCode:n.exitCode,stdout:n.stdout,stderr:n.stderr,generation:n.generation,durationMs:n.durationMs}}if(e.kind!=="pong"||typeof e.serverPid!="number"||!Number.isInteger(e.serverPid)||e.serverPid<=0||typeof e.cliVersion!="string"||typeof e.projectRoot!="string"||e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration))return null;let r;if(e.processIdentity!==void 0){let n=V(e.processIdentity);if(!n||n.pid!==e.serverPid)return null;r=n}return{ok:!0,kind:"pong",protocolVersion:S,serverPid:e.serverPid,...r?{processIdentity:r}:{},cliVersion:e.cliVersion,projectRoot:e.projectRoot,...e.indexGeneration!==void 0?{indexGeneration:e.indexGeneration}:{}}}var qe=[{question:"Who can call or reach this?",family:"execution",direction:"incoming"},{question:"What can this call or reach?",family:"execution",direction:"outgoing"},{question:"Where can this value come from?",family:"dataflow",direction:"incoming"},{question:"Where can this value go?",family:"dataflow",direction:"outgoing"},{question:"Which producer and consumer rendezvous?",family:"runtime",direction:"both"},{question:"What resource is observed or changed?",family:"state",direction:"both"},{question:"What occurs before or after this?",family:"temporal",direction:"both"},{question:"What interface constrains this?",family:"contract",direction:"both"},{question:"Are these observations the same entity?",family:"identity",direction:"both"},{question:"What contains or owns this?",family:"ownership",direction:"both"},{question:"What does this statically rely on?",family:"dependencies",direction:"outgoing"}],Be={execution:{establishes:"Static may-call reachability between resolved program constructs.",nonClaims:["A may-call edge does not prove that a runtime invocation occurred."]},runtime:{establishes:"A source-grounded handoff between producer and consumer participants through a runtime mechanism.",nonClaims:["An unresolved or candidate join does not prove a runtime handoff."]},dataflow:{establishes:"A value, definition, argument, parameter, return, or statically resolved value may flow to another construct.",nonClaims:["Current partial providers do not establish general interprocedural definition-use coverage."]},state:{establishes:"A construct reads, writes, creates, deletes, or otherwise changes an identified state resource.",nonClaims:["A state edge does not prove transactionality, durability, or exclusive ownership unless qualified."]},temporal:{establishes:"One observed construct is locally ordered before or after another under the reported source evidence.",nonClaims:["Source order does not imply cross-process happens-before or durability."]},contract:{establishes:"A program construct implements, constrains, or is typed by an identified contract.",nonClaims:["Contract identity does not prove runtime invocation or conformance outside reported checks."]},identity:{establishes:"Two observations refer to the same compiler-owned or source-owned program entity.",nonClaims:["Shared identity does not establish execution or value transfer."]},ownership:{establishes:"A source construct, symbol, runtime observation, or state resource is contained or owned by another program entity.",nonClaims:["Structural ownership does not establish lifetime, singleton scope, or runtime execution unless qualified."]},dependencies:{establishes:"A file, module, or symbol statically relies on another indexed entity.",nonClaims:["A dependency edge does not establish that the depended-on code executes."]}};function Qe(t){return M.flatMap(e=>e.relations.filter(r=>r.family===t).map(r=>({...r,providerId:e.id,providerLabel:e.label})))}function Ue(t){return[...new Set(M.filter(e=>e.relations.some(r=>r.family===t)).map(e=>e.label))]}var Tr=me.map(t=>({family:t,...Be[t],providers:Ue(t),relations:Qe(t)}));function Ve(t){return{family:t,...Be[t],providers:Ue(t),relations:Qe(t)}}var Ar=["search","outline","entrypoints","evidence","inspect","code"];function _r(){return qe.map(t=>{let e=Ve(t.family);return{...t,establishes:e.establishes,evidenceStrengths:Ye(e.relations.flatMap(r=>r.evidenceStrengths)),supportCeilings:Ye(e.relations.map(r=>r.supportCeiling)),nonClaim:e.nonClaims.join(" ")}})}function Ye(t){return[...new Set(t)]}export{Re as a,lr as b,dr as c,S as d,mr as e,yr as f,Rr as g,vr as h,br as i,Sr as j,Cr as k,wr as l,xr as m,Tr as n,Ar as o,_r as p};
|
|
3
|
+
//# sourceMappingURL=chunk-36WRYYTE.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var s=new Set(["code","outline","refs"]),c=["--symbol","--at","--search","--view","--edge","--direction","--subtype","--connecting","--inventory-only","--fold","--depth","--max-edges"];function d(e){if(e[2]!=="evidence")return;let t=e[3];if(!t||t.startsWith("-"))return;if(e.slice(4).some(i=>c.some(r=>i===r||i.startsWith(`${r}=`)))){e.splice(3,1,"--symbol",t);return}e[2]="evidence-source"}function a(e){return e!==void 0&&s.has(e)}async function p(e){if(e==="continue"){let{outputContinuationCommandDescriptor:n}=await import("./output-continuation-command-FTVVBVSN.js");return[n]}if(e==="__sentinel-ensure-service"){let{sentinelEnsureCommandDescriptor:n}=await import("./sentinel-ensure-command-KYYULCFU.js");return[n]}if(a(e)){let{directNavigationQueryCommandDescriptors:n}=await import("./direct-navigation-B3SGOOBW.js"),o=n.find(i=>i.id===e);if(!o)throw new Error(`Direct navigation command descriptor is unavailable: ${e}`);return[o]}let{commandDescriptors:t}=await import("./command-descriptors-5VAB2MZX.js");return t}export{d as a,a as b,p as c};
|
|
2
|
+
//# sourceMappingURL=chunk-37TKC6MB.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{H as P,I as ye,a as ae,b as le,d as _,r as U,s as H,t as pe,v as de,w as B,z as me}from"./chunk-M7LAIM77.js";import{d as E,e as ue}from"./chunk-DRENNWRG.js";import{q as fe}from"./chunk-IYBIBMPF.js";import{a as ce,e as O}from"./chunk-4NHWNAWQ.js";import{a as A,i as x}from"./chunk-R2NOK63J.js";import{aa as se,da as K,h as re}from"./chunk-4O52YNKL.js";import{existsSync as j}from"fs";import b from"path";var z=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function V(r,t){let e=t?b.dirname(b.join(r,t)):r,o=b.resolve(r);for(;e.startsWith(o);){for(let s of z){let c=b.join(e,s);if(j(c))return c}let i=b.dirname(e);if(i===e)break;e=i}for(let i of z){let s=b.join(r,i);if(j(s))return s}return null}function ge(r){let t=r.config.projectRoot,n=new Set(Ee(t,r.config.semantic?.typescript?.tsconfigs)),e=O(r,{includeIgnored:!1,extensions:U});for(let o of e){let i=V(t,o);i&&n.add(b.resolve(i))}if(n.size===0){let o=V(t);o&&n.add(b.resolve(o))}return[...n].filter(o=>!he(t,o)).sort((o,i)=>o.localeCompare(i))}function Ee(r,t=[]){let n=new Set;for(let e of t){let o=b.isAbsolute(e)?e:b.join(r,e);j(o)&&n.add(b.resolve(o))}for(let e of je(r))for(let o of z){let i=b.join(e,o);j(i)&&n.add(b.resolve(i))}if(n.size===0){let e=V(r);e&&n.add(b.resolve(e))}return[...n].filter(e=>!he(r,e)).sort((e,o)=>e.localeCompare(o))}function je(r){let t=b.join(r,"package.json");if(!j(t))return[];let n;try{n=JSON.parse(re(t,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(o=>le(r,o))}function he(r,t){let n=b.relative(r,t).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as u}from"perf_hooks";function k(r,t,n){if(r.has(t))return r.get(t);let e=n();return r.set(t,e),e}import Ie from"path";import{realpathSync as Se}from"fs";function Ae(r,t){return r.getReferences().map(n=>{let e=n.getNode();return $(e,t)})}function Oe(r){let t=r;return typeof t.findReferences=="function"?t.findReferences():[]}function Me(r,t,n,e){let o=[];for(let i of Oe(r))for(let s of Ae(i,e))s.file===t.relativePath&&s.line>=t.startLine&&s.line<=t.endLine||o.push(s);for(let i of n)o.push(i);return L(o)}function Fe(r,t,n,e){let o=[],i=n?.getStart();for(let s of r.getReferences()){let c=s.getNode();w(e,c.getSourceFile().getFilePath())===t&&(i!==void 0&&c.getStart()===i||o.push({location:$(c,e),node:c}))}return o}function $(r,t){let n=r.getSourceFile(),e=n.getLineAndColumnAtPos(r.getStart());return{file:w(t,n.getFilePath())??n.getBaseName(),line:e.line-1,column:e.column-1}}function q(r,t,n){let e=r.getSourceFile(),o=G(e,r),i=r.getText(),s=new RegExp(`\\b${fe(i)}\\b`,"g"),c=e.getFullText().split(`
|
|
2
2
|
`),a=[];for(let l=0;l<c.length;l++){if(l===o)continue;let f=c[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(f))!==null;)a.push({file:t,line:l,column:p.index})}return L(a.filter(l=>w(n,Ie.join(n,l.file))===t))}function Y(r){for(let t=r;t;t=t.getParent()){let n=t.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function G(r,t){return r.getLineAndColumnAtPos(t.getStart()).line-1}function L(r){let t=new Set,n=[];for(let e of r){let o=`${e.file}:${e.line}:${e.column}`;t.has(o)||(t.add(o),n.push(e))}return n}function w(r,t){let n=r||process.cwd(),e=be(n,t);if(e)return e;try{return be(Se(n),Se(t))}catch{return null}}function be(r,t){let n=Ie.relative(r,t).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function xe(r,t,n,e){let o=Ue(t,e);return o.size===0?new Map:He(r,n,o)}function Ue(r,t){let n=new Map;for(let e of P(r,t)){let o=E(e.symbol)??e.leaf;if(!o)continue;let i=n.get(o);i||(i=[],n.set(o,i)),i.push(e)}return n}function He(r,t,n){let e=new Map,o=new Map;return t.forEachDescendant(i=>{for(let s of Be(r,i)){let c=n.get(s);if(!c)continue;let a=G(t,i);for(let l of c){if(a<l.startLine-1||a>l.endLine+1)continue;let f=Math.abs(a-l.startLine),p=o.get(l.symbolId);p!==void 0&&p<=f||(o.set(l.symbolId,f),e.set(l.symbolId,i))}}}),e}function Be(r,t){let n=[],e=o=>{o&&!n.includes(o)&&n.push(o)};if("getNameNode"in t&&typeof t.getNameNode=="function"){let o=t.getNameNode();e(o?.getText())}if("getName"in t&&typeof t.getName=="function"){let o=t.getName();e(o)}return r.Node.isIdentifier(t)&&e(t.getText()),n}var $e=ce("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ke(r,t,n,e){let o=Q(r,t),i=J(o.get(e)??[],n);if(i)return i;let s=[];for(let c of o.values())for(let a of c)((a.leaf||E(a.symbol)||"").includes(e)||a.symbol.includes(e))&&s.push(a);return J(s,n)}function X(r,t,n,e){return J(Q(r,t).get(e)??[],n)}function Te(r,t){let n=new Map;for(let[e,o]of Q(r,t)){let i=o[0];i&&n.set(e,i)}return n}function Q(r,t){return $e.get(r,t,()=>{let n=new Map;for(let e of P(r,t)){let o=e.leaf||E(e.symbol);if(!o)continue;let i=n.get(o);i||(i=[],n.set(o,i)),i.push({...e,leaf:o})}for(let e of n.values())e.sort((o,i)=>o.startLine-i.startLine||o.endLine-i.endLine||o.symbolId-i.symbolId);return n})}function J(r,t){let n=null,e=Number.POSITIVE_INFINITY;for(let o of r){let i=Math.abs(o.startLine-t);(i<e||i===e&&n&&o.startLine<n.startLine)&&(n=o,e=i)}return n}import We from"path";import{realpathSync as Ke}from"fs";function De(r,t){let n=new Map,e=null,o=null,i=()=>(o??=O(r,{extensions:U}),o),s=()=>(e??=x("typescript.source-file-index",()=>_e(r.config.projectRoot,t,i()),()=>({projects:t.length,indexedDocuments:i().length})),e),c=a=>H(a)?k(n,a,()=>{let l=Ce(r.config.projectRoot,a);if(!l)return null;for(let{project:f,sourceFiles:p}of s()){let d=p.get(l)??null;if(d||(d=f.addSourceFileAtPathIfExists(l)??null,d&&Z(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:a=>c(a)?.sourceFile??null,sourceFileMatch:c,indexedTypeScriptLikeDocuments:i}}function _e(r,t,n){let e=t.map(({project:o})=>{let i=new Map;for(let s of o.getSourceFiles())Z(i,s);return{project:o,sourceFiles:i}});for(let o of n){let i=Ce(r,o);if(i)for(let s of e){if(s.sourceFiles.has(i))break;let c=s.project.addSourceFileAtPathIfExists(i)??null;if(c){Z(s.sourceFiles,c);break}}}return e}function Z(r,t){let n=ee(t.getFilePath());r.set(n,t);try{r.set(ee(Ke(n)),t)}catch(e){if(!K(e))throw e}}function Ce(r,t){try{return ee(se(r,t,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!K(n))throw n;return null}}function ee(r){return We.resolve(r)}function te(r,t){for(let n of r)if(t===n.name||t.startsWith(`${n.name}/`))return n.name;return null}function Ne(r){let t=`${r.relativeDir}/src`;return[`${t}/index.ts`,`${t}/index.tsx`,`${t}/index.mts`,`${t}/index.cts`]}function ne(r,t){try{return r()}catch{t?.();return}}var ze=32;function Yt(r,t){let n=x("typescript.provider.load",()=>pe());if(!n)return B("ts-morph is not installed");let e=x("typescript.provider.tsconfig-discovery",()=>ge(r));if(e.length===0)return B("no tsconfig found");try{let o=x("typescript.provider.project-bundles",()=>de(n,e),()=>({tsconfigs:e.length}));return Ve(r,n,o)}catch(o){return B(o instanceof Error?o.message:String(o),e[0],e)}}function Ve(r,t,n,e={}){return x("typescript.provider.construct",()=>new oe(r,t,n),()=>({tsconfigs:n.length,reusedProjects:e.reusedProjects===!0}))}var oe=class{constructor(t,n,e){this.db=t;this.tsMorph=n;this.projects=e;this.workspacePackages=ae(t.config.projectRoot),this.sourceFiles=De(t,e)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(t=>t.tsconfigPath)}}importUsage(t){return k(this.importUsageCache,t,()=>{let n=this.sourceFiles.sourceFile(t);if(!n)return[];let e=Ye();return x("typescript.import-usage.file",()=>this.importUsageForSourceFile(t,n,e),()=>({file:t,...e}))})}referencesFor(t){return k(this.referencesCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);return this.referencesForDefinitionNode(t,n)})}referencesForDefinitions(t,n={}){let e=new Map,o=A(),i=[];for(let f of t){let p=this.referencesCache.get(f.symbolId);p?e.set(f.symbolId,p):i.push(f)}if(i.length===0)return e;let s=i,c=n.exact?[]:i.filter(f=>!ve(f));if(c.length>=ze){let f=this.referencesForDefinitionsBySymbolScan(c);if(f.incompleteFiles.size===0)for(let p of c){let d=f.references.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}if(s=i.filter(p=>ve(p)),s.length===0)return e}let a=new Map;for(let f of s){let p=a.get(f.relativePath);p?p.push(f):a.set(f.relativePath,[f])}let l=[];for(let[f,p]of a){let d=Pe();x("typescript.references-map.file",()=>{let h=this.definitionNodesForFile(f);for(let m of p){o&&(d.cacheMisses+=1);let I=h.get(m.symbolId)??null;o&&(I?d.nodeHits+=1:d.nodeMisses+=1);try{let g=this.referencesForDefinitionNode(m,I,o?d:void 0);this.referencesCache.set(m.symbolId,g),e.set(m.symbolId,g)}catch{d.preciseSearchFailures+=1,l.push(m)}}},()=>({relativePath:f,definitions:p.length,...Le(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);if(f.incompleteFiles.size===0)for(let p of l){let d=f.references.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),e.set(p.symbolId,d)}}return e}referenceFragmentsForFiles(t){let n=ye(this.db).filter(s=>H(s.relativePath)),e=t.filter(s=>this.sourceFiles.sourceFile(s)!==null),o=this.referencesForDefinitionsBySymbolScan(n,e),i=e.filter(s=>!o.incompleteFiles.has(s));return me(n,o.references,i)}referencesForDefinitionsBySymbolScan(t,n){let e=A(),o=Pe(),i=new Map,s=new Set,c=new Set(t.map(l=>l.symbolId)),a=new Map(t.map(l=>[l.symbolId,l]));for(let l of t)i.set(l.symbolId,[]);return x("typescript.references-map.inverted-scan",()=>{let l=e?u.now():0,f=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let y of t){let S=f.get(y.symbolId)??[];if(S.length>0){let T=i.get(y.symbolId)??[];T.push(...S),i.set(y.symbolId,T)}e&&(o.packageReferenceCount+=S.length)}e&&(o.packageRefsMs+=u.now()-l);let p=new Map,d=new Map,h=this.hierarchyTargetsForDefinitions(t),m=new Set(t.map(y=>y.leaf).filter(Boolean)),I=e?u.now():0;for(let y of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(y))continue;let S=this.sourceFiles.sourceFile(y);if(!S)continue;e&&(o.scanFiles+=1),this.addReferencesFromSourceFileScan(S,y,c,a,h,m,p,d,i,e?o:void 0)||s.add(y)}e&&(o.scanMs+=u.now()-I);let g=e?u.now():0;this.addHierarchyMemberReferences(t,i,e?o:void 0),e&&(o.hierarchyMs+=u.now()-g);for(let[y,S]of i){let T=L(S);i.set(y,T),e&&(o.referenceCount+=T.length)}},()=>({definitions:t.length,...Le(o)})),{references:i,incompleteFiles:s}}addReferencesFromSourceFileScan(t,n,e,o,i,s,c,a,l,f){let p=this.compilerCheckerForSourceFile(t),d=t.compilerNode,h=Xe(t),m=!0,I=g=>{if(this.tsMorph.ts.isIdentifier(g)){if(f&&(f.identifiers+=1),!s.has(g.text)&&!h.has(g.text)){this.tsMorph.ts.forEachChild(g,I);return}let y=this.compilerReferenceSymbol(p,g,f,()=>{m=!1});if(y){let S;c.has(y)?S=c.get(y)??null:(S=this.referenceDefinitionFromCompilerSymbol(y),c.set(y,S)),f&&(S?f.targetHits+=1:f.targetMisses+=1);let T=k(a,y,()=>this.compilerSymbolKeys(y)),R=null,D=null,v=S&&e.has(S.symbolId)?o.get(S.symbolId):void 0;if(v&&(R=W(d,g),!Re(v,n,R))){let N=d.getLineAndCharacterOfPosition(g.getStart(d));D={file:n,line:N.line,column:N.character};let C=l.get(v.symbolId)??[];C.push(D),l.set(v.symbolId,C),f&&(f.requestedHits+=1)}for(let N of T)for(let C of i.get(N)?.values()??[]){if(R??=W(d,g),Re(C,n,R))continue;if(!D){let F=d.getLineAndCharacterOfPosition(g.getStart(d));D={file:n,line:F.line,column:F.character}}let M=l.get(C.symbolId)??[];M.push(D),l.set(C.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(g,I)};return I(d),m}hierarchyTargetsForDefinitions(t){let n=new Map;for(let e of t){let o=this.nodeForDefinition(e),i=o?.compilerNode;if(!i||!this.isHierarchyMethod(i))continue;let s=i.parent;if(!this.isHierarchyContainer(s))continue;let c=this.compilerCheckerForSourceFile(o.getSourceFile()),a=c.getSymbolAtLocation(i.name);if(a)for(let l of this.hierarchyMemberSymbols(c,s,a))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(e.symbolId,e),n.set(f,p)}}return n}hierarchyMemberSymbols(t,n,e){let o=new Set,i=new Set,s=(c,a,l)=>{if(!i.has(c)){i.add(c),o.add(a);for(let f of l){let p=f.getProperty(e.name);p&&s(f,p,this.hierarchyAncestorTypesForType(t,f))}}};return s(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}addHierarchyMemberReferences(t,n,e){let o=new Map;for(let i of t){let s=this.nodeForDefinition(i),c=s?.compilerNode;if(!c||!this.isHierarchyMethod(c))continue;let a=c.parent;if(!this.isHierarchyContainer(a))continue;let l=this.compilerCheckerForSourceFile(s.getSourceFile()),f=l.getSymbolAtLocation(c.name);if(!f)continue;let p=c.getSourceFile(),d=p.getLineAndCharacterOfPosition(c.name.getStart(p)),h={definition:i,location:{file:i.relativePath,line:d.line,column:d.character}},m=n.get(i.symbolId)??[];for(let g of this.hierarchyMemberSymbols(l,a,f))if(g!==f)for(let y of this.compilerSymbolLocations(g))m.push(y),e&&(e.hierarchyReferences+=1);n.set(i.symbolId,m);let I=this.hierarchyRootMemberSymbols(l,a,f);for(let g of I){let y=o.get(g)??new Map;y.set(i.symbolId,h),o.set(g,y)}e&&(e.hierarchyDefinitions+=1)}for(let i of o.values())if(!(i.size<2)){e&&(e.hierarchyFamilies+=1);for(let{definition:s}of i.values()){let c=n.get(s.symbolId)??[];for(let a of i.values())a.definition.symbolId!==s.symbolId&&(c.push(a.location),e&&(e.hierarchyReferences+=1));n.set(s.symbolId,c)}}}hierarchyRootMemberSymbols(t,n,e){let o=new Set,i=new Set,s=(c,a,l)=>{if(i.has(c))return;i.add(c);let f=!1;for(let p of l){let d=p.getProperty(e.name);d&&(f=!0,s(p,d,this.hierarchyAncestorTypesForType(t,p)))}if(!f)for(let p of this.compilerSymbolKeys(a))o.add(p)};return s(t.getTypeAtLocation(n),e,this.hierarchyAncestorTypes(t,n)),o}compilerSymbolKeys(t){return(t.declarations??[]).map(n=>{let e=n.getSourceFile();return`${e.fileName}\0${n.getStart(e)}\0${t.name}`})}compilerSymbolLocations(t){let n=[];for(let e of t.declarations??[]){let o=e.getSourceFile(),i=w(this.db.config.projectRoot,o.fileName);if(!i)continue;let s=e.name,c=o.getLineAndCharacterOfPosition((s??e).getStart(o));n.push({file:i,line:c.line,column:c.character})}return n}baseTypes(t,n){try{return t.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(t,n){let e=new Set(this.hierarchyAncestorTypesForType(t,t.getTypeAtLocation(n)));for(let o of n.heritageClauses??[])for(let i of o.types)e.add(t.getTypeAtLocation(i));return[...e]}hierarchyAncestorTypesForType(t,n){let e=new Set(this.baseTypes(t,n));for(let o of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(o))for(let i of o.heritageClauses??[])for(let s of i.types)e.add(t.getTypeAtLocation(s));return[...e]}isHierarchyMethod(t){return this.tsMorph.ts.isMethodDeclaration(t)||this.tsMorph.ts.isMethodSignature(t)}isHierarchyContainer(t){return this.tsMorph.ts.isClassDeclaration(t)||this.tsMorph.ts.isClassExpression(t)||this.tsMorph.ts.isInterfaceDeclaration(t)}compilerReferenceSymbol(t,n,e,o){e&&(e.symbolLookups+=1);let i=ne(()=>t.getSymbolAtLocation(n),o);if(i){if((i.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return i;try{return e&&(e.aliasResolutions+=1),t.getAliasedSymbol(i)}catch{return o?.(),i}}}calleesFor(t){if(this.calleesCache.has(t.symbolId))return this.calleesCache.get(t.symbolId)??[];let n=k(this.fileCalleesCache,t.relativePath,()=>this.calleeMapForFile(t.relativePath));if(n.incompleteSymbolIds.has(t.symbolId))throw new Error(`TypeScript callee evidence is incomplete for ${t.symbol}.`);let e=n.callees.get(t.symbolId)??[];return this.calleesCache.set(t.symbolId,e),e}calleesForDefinitions(t){let n=new Map,e=new Map;for(let o of t){if(this.calleesCache.has(o.symbolId)){n.set(o.symbolId,this.calleesCache.get(o.symbolId)??[]);continue}let i=e.get(o.relativePath);i?i.push(o):e.set(o.relativePath,[o])}for(let[o,i]of e){let s=this.fileCalleesCache.get(o),c=new Set(i.map(l=>l.symbolId)),a=s??this.calleeMapForFile(o,c);for(let l of i){if(a.incompleteSymbolIds.has(l.symbolId))continue;let f=a.callees.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(t,n,e){let o=e?u.now():0,i=this.packageImportReferencesForDefinition(t);if(e&&(e.packageRefsMs+=u.now()-o,e.packageReferenceCount+=i.length),!n)return i;let s=e?u.now():0,c=Me(n,t,i,this.db.config.projectRoot);return e&&(e.semanticRefsMs+=u.now()-s,e.referenceCount+=c.length),c}signatureFor(t){return k(this.signatureCache,t.symbolId,()=>{let n=this.nodeForDefinition(t);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let e=n.getType().getCallSignatures()[0];if(!e)return null;let o=e.getParameters().map(s=>{let c=s.getDeclarations()[0],a=c?s.getTypeAtLocation(c).getText(c):s.getValueDeclaration()?.getType().getText()??"unknown";return we(a)}),i=e.getReturnType().getText(n);return`(${o.join(",")})=>${we(i)}`})}importUsageForSourceFile(t,n,e){let o=[],i=new Map;for(let s of n.getImportDeclarations()){e.declarations+=1;let c=_(this.db,t,s.getModuleSpecifierValue()),a=s.getImportClause()?.isTypeOnly()??!1;for(let l of ie(s)){e.entries+=1;let f=a?null:l.identifier?.getSymbol()?.compilerSymbol??null;!a&&l.identifier&&(f?e.bindingSymbols+=1:e.missingBindingSymbols+=1);let p={sourcePath:c,entry:l,typeOnlyDeclaration:a,bindingSymbol:f,references:[]};if(o.push(p),a||!l.localName||!f)continue;let d=i.get(l.localName);d?d.push(p):i.set(l.localName,[p])}}return i.size>0&&n.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let c=i.get(s.getText());if(!c||Ge(s))return;e.scannedIdentifiers+=1;let a=s.getSymbol()?.compilerSymbol;if(e.symbolLookups+=1,!!a){for(let l of c)if(l.bindingSymbol===a){l.references.push({location:$(s,this.db.config.projectRoot),node:s}),e.matchedReferences+=1;break}}}),o.map(s=>s.typeOnlyDeclaration?qe(t,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(e.fallbackEntries+=1,this.valueImportUsageForEntry(t,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(t,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(t,n,e){let o;try{o=e.identifier?e.identifier.findReferences():[]}catch{let s=e.identifier?q(e.identifier,t,this.db.config.projectRoot):[];return{importer:t,sourcePath:n,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:e.isTypeOnly,isUsed:e.isTypeOnly||s.length>0,isTypeUsed:e.isTypeOnly,isValueUsed:!e.isTypeOnly&&s.length>0,references:s}}let i=[];for(let s of o)for(let c of Fe(s,t,e.identifier,this.db.config.projectRoot))i.push(c);return this.valueImportUsageFromLocations(t,n,e,i)}valueImportUsageFromLocations(t,n,e,o){let i=o.some(a=>!Y(a.node)),s=o.some(a=>Y(a.node)),c=e.isTypeOnly;return{importer:t,sourcePath:n,importedName:e.importedName,localName:e.localName,kind:e.kind,isTypeOnly:c,isUsed:c||o.length>0,isTypeUsed:c||s,isValueUsed:i,references:o.map(a=>a.location)}}packageImportReferencesForDefinition(t){return this.packageImportReferences().get(t.symbolId)??[]}packageImportReferencesForFiles(t){let n=new Map,e=new Set;for(let i of t){let s=this.sourceFiles.sourceFile(i);if(s)for(let c of s.getImportDeclarations()){let a=te(this.workspacePackages,c.getModuleSpecifierValue());a&&e.add(a)}}if(e.size===0)return n;let o=this.packageExportsForNames(e);for(let i of t)this.addPackageImportReferencesForDocument(n,o,i);for(let[i,s]of n)n.set(i,L(s));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let t=new Map,n=this.packageExports();for(let e of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(t,n,e);for(let[e,o]of t)t.set(e,L(o));return this.packageImportReferenceIndex=t,t}addPackageImportReferencesForDocument(t,n,e){if(this.db.isIgnored(e))return;let o=this.sourceFiles.sourceFileMatch(e);if(o)for(let i of o.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(t,n,e,i)}addPackageImportReferencesForDeclaration(t,n,e,o){let i=te(this.workspacePackages,o.getModuleSpecifierValue());if(!i)return;let s=n.get(i);if(s)for(let c of ie(o)){if(c.kind!=="named"||!c.identifier)continue;let a=s.get(c.importedName);if(!a||a.size===0)continue;let l=q(c.identifier,e,this.db.config.projectRoot);l.length>0&&tt(t,a,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(t=>t.name))),this.packageExportIndex)}packageExportsForNames(t){let n=new Map;for(let e of this.workspacePackages){if(!t.has(e.name))continue;let o=new Map;for(let i of Ne(e))this.collectPackageExports(e,i,o,new Set);o.size>0&&n.set(e.name,o)}return n}collectPackageExports(t,n,e,o){if(o.has(n))return;o.add(n);let i=this.sourceFiles.sourceFile(n);if(i)for(let s of i.getExportDeclarations()){let c=s.getModuleSpecifierValue(),a=c?_(this.db,n,c):n;if(!a||!a.startsWith(`${t.relativeDir}/src/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(t,a,e,o);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,h=this.indexedDefinitionByLeaf(a,p);if(!h)continue;let m=e.get(d);m||(m=new Set,e.set(d,m)),m.add(h.symbolId)}}}indexedDefinitionByLeaf(t,n){return k(this.indexedDefinitionLeafCache,t,()=>Te(this.db,t)).get(n)??null}nodeForDefinition(t){return k(this.definitionNodeCache,t.symbolId,()=>this.definitionNodesForFile(t.relativePath).get(t.symbolId)??null)}definitionNodesForFile(t){return k(this.fileDefinitionNodeCache,t,()=>{let n=this.sourceFiles.sourceFile(t);return n?xe(this.tsMorph,this.db,n,t):new Map})}referenceDefinitionFromCompilerSymbol(t){return this.definitionFromCompilerSymbol(t,void 0,!0)}definitionFromCompilerSymbol(t,n,e=!1){let o=t.name,i=n?u.now():0,s=t.declarations??[];n&&(n.declarationsMs+=u.now()-i,n.declarationChecks+=s.length);for(let c of s){let a=n?u.now():0,l=c.getSourceFile(),f=w(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(c.getStart(l)).line;if(n&&(n.declarationLocationMs+=u.now()-a),!f||this.db.isIgnored(f))continue;let d=n?u.now():0,h=this.compilerDeclarationName(c),m=e?X(this.db,f,p,o)??(h&&h!==o?X(this.db,f,p,h):null):ke(this.db,f,p,o);if(n&&(n.indexedLookupMs+=u.now()-d),m)return{symbolId:m.symbolId,symbol:m.symbol,file:m.relativePath,line:m.startLine}}return null}compilerDeclarationName(t){let n=t.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(t,n){let e=A(),o=0,i=0,s=0,c=0,a=0,l=0,f=0,p=0,d=e?Ze():void 0;return x("typescript.callee-map.file",()=>{let h=e?u.now():0,m=this.sourceFiles.sourceFile(t);if(e&&(a=Math.round(u.now()-h)),!m)return{callees:new Map,incompleteSymbolIds:new Set};let I=e?u.now():0,g=P(this.db,t).sort((M,F)=>M.startLine-F.startLine||F.endLine-M.endLine);if(e&&(l=Math.round(u.now()-I)),o=g.length,g.length===0)return{callees:new Map,incompleteSymbolIds:new Set};let y=new Map,S=new Set,T=e?u.now():0,R=this.compilerCheckerForSourceFile(m),D=m.compilerNode;e&&(f=Math.round(u.now()-T));let v=new Map,N=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){e&&(i+=1);let F=this.semanticCalleeForCallNode(R,D,g,M,v,n,S,d);F&&(e&&(s+=1),Je(y,F.callerId,F.target))}this.tsMorph.ts.forEachChild(M,N)},C=e?u.now():0;N(D),e&&(p=Math.round(u.now()-C));for(let[M,F]of y)y.set(M,nt(F));return c=y.size,{callees:y,incompleteSymbolIds:S}},()=>({relativePath:t,definitions:o,callNodes:i,resolvedCallees:s,outputRows:c,requestedDefinitions:n?.size??o,sourceFileLookupMs:a,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?et(d):{}}))}semanticCalleeForCallNode(t,n,e,o,i,s,c,a){let l=a?u.now():0,f=Qe(e,W(n,o));if(a&&(a.callerLookupMs+=u.now()-l),!f)return null;if(s&&!s.has(f.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let p=o.expression,d=this.compilerSymbolForExpression(t,p,a);d.incomplete&&c?.add(f.symbolId);let h=d.symbol,m=null;if(h)if(a&&(a.targetSymbolHits+=1),i.has(h))a&&(a.compilerSymbolCacheHits+=1),m=i.get(h)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let I=a?u.now():0;m=this.definitionFromCompilerSymbol(h,a),a&&(a.targetLookupMs+=u.now()-I),i.set(h,m)}else a&&(a.targetMisses+=1);return m?{callerId:f.symbolId,target:{symbol:m.symbol,file:m.file,line:m.line,callsiteLine:W(n,o)}}:null}compilerSymbolForExpression(t,n,e){let o=!1,i=e?u.now():0,s=ne(()=>t.getSymbolAtLocation(n),()=>{o=!0});if(e&&(e.expressionSymbolMs+=u.now()-i),s)return{symbol:s,incomplete:!1};e&&(e.typeFallbacks+=1);let c=!1,a=e?u.now():0,l=ne(()=>t.getTypeAtLocation(n).getSymbol(),()=>{c=!0});return e&&(e.typeSymbolMs+=u.now()-a),{symbol:l,incomplete:!l&&(o||c)}}compilerCheckerForSourceFile(t){let n=t.getProject(),e=this.compilerCheckerCache.get(n);return e||(e=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,e)),e}};function ie(r){let t=[],n=r.getDefaultImport();n&&t.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});let e=r.getNamespaceImport();e&&t.push({identifier:e,importedName:"*",localName:e.getText(),kind:"namespace",isTypeOnly:r.getImportClause()?.isTypeOnly()??!1});for(let o of r.getNamedImports()){let i=o.getNameNode(),c=o.getAliasNode()??(i.getKindName()==="Identifier"?i:null);t.push({identifier:c,importedName:i.getText(),localName:c?.getText()??i.getText(),kind:"named",isTypeOnly:o.isTypeOnly()||(r.getImportClause()?.isTypeOnly()??!1)})}return t.length===0&&t.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),t}function qe(r,t,n){return{importer:r,sourcePath:t,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Ye(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function Ge(r){for(let t=r;t;t=t.getParent())if(t.getKindName()==="ImportDeclaration")return!0;return!1}function Je(r,t,n){let e=r.get(t);e||(e=[],r.set(t,e)),e.push(n)}function Xe(r){let t=new Set;for(let n of r.getImportDeclarations())for(let e of ie(n))e.localName&&t.add(e.localName);return t}function Qe(r,t){let n=null;for(let e of r)t<e.startLine||t>e.endLine||(!n||e.startLine>=n.startLine)&&(n=e);return n}function W(r,t){return r.getLineAndCharacterOfPosition(t.getStart(r)).line}function Re(r,t,n){return t===r.relativePath&&n>=r.startLine&&n<=r.endLine}function ve(r){return r.symbol.includes("#")?ue(r.symbol)==="type"&&r.relativePath.endsWith(".d.ts"):!1}function Ze(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function et(r){return{...r,callerLookupMs:Math.round(r.callerLookupMs),expressionSymbolMs:Math.round(r.expressionSymbolMs),typeSymbolMs:Math.round(r.typeSymbolMs),targetLookupMs:Math.round(r.targetLookupMs),declarationsMs:Math.round(r.declarationsMs),declarationLocationMs:Math.round(r.declarationLocationMs),indexedLookupMs:Math.round(r.indexedLookupMs)}}function Pe(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0,preciseSearchFailures:0,hierarchyDefinitions:0,hierarchyFamilies:0,hierarchyReferences:0,hierarchyMs:0}}function Le(r){return{...r,scanMs:Math.round(r.scanMs),packageRefsMs:Math.round(r.packageRefsMs),semanticRefsMs:Math.round(r.semanticRefsMs),hierarchyMs:Math.round(r.hierarchyMs)}}function tt(r,t,n){for(let e of t){let o=r.get(e)??[];o.push(...n),r.set(e,o)}}function nt(r){let t=new Set,n=[];for(let e of r){let o=`${e.symbol}|${e.file}|${e.line}|${e.callsiteLine??""}`;t.has(o)||(t.add(o),n.push(e))}return n}function we(r){return r.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{ge as a,Ee as b,Yt as c,Ve as d};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-3AC56WAR.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as P}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as P}from"./chunk-JXHLB7TP.js";import{a as d}from"./chunk-GXVDTHFC.js";import{a as y}from"./chunk-DGXRDLV5.js";import{a as v}from"./chunk-B75HZHUP.js";import{c as b}from"./chunk-NK76RSB6.js";import{a as p}from"./chunk-BGBBVSH4.js";import{a as g,h}from"./chunk-JN5LIBT3.js";import{d as c,h as u}from"./chunk-AM5SUGHF.js";import{h as f,i as m}from"./chunk-JOALNFY3.js";import{basename as x,extname as S}from"path";function z(i,e){let{scope:r,maxLoc:n=15,limit:o=30,scanLimit:l}=e??{},a=new b(i);return y({candidates:()=>E(i,a,r,n),orderCandidates:v,scanLimit:l,profile:{name:"passthrough-candidates"},prepare:t=>a.calleeEvidenceMap(t,{semantic:e?.semantic!==!1}),evaluate:(t,s)=>s.incompleteSymbolIds.has(t.symbolId)||s.unavailableSymbolIds.has(t.symbolId)?null:L(i,t,s.rows.get(t.symbolId)??[]),orderResults:(t,s)=>t.loc-s.loc||t.file.localeCompare(s.file),limit:o})}function L(i,e,r){let n=C(r);if(n.size!==1||!f(i,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...n.entries()][0],l=I(i,e,o),a=T(i,e),t=l.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:c(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e),forwardsTo:o.symbol,forwardsToShort:c(o.symbol),forwardsToFile:o.file,actionTier:t,boundaryEvidence:l,publicFacadeEvidence:a,recommendation:D(t,l,a)}}function I(i,e,r){return P(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:c(e.symbol)},{label:"callee name",value:c(r.symbol)},{label:"passthrough module",value:x(e.relativePath,S(e.relativePath))},{label:"callee module",value:x(r.file,S(r.file))}])}function D(i,e,r){if(i==="signal"){if(r.length>0)return`Review the public API before inlining; public-facade evidence: ${r.slice(0,2).join("; ")}.`;let n=e.filter(w);return n.length>0?`Review the public API before inlining; public-surface evidence: ${n.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(i,e){return d(i,e)?g(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:h(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function w(i){return i.includes("public surface")}function C(i){let e=i.some(n=>u(n.symbol))?i.filter(n=>u(n.symbol)):i,r=new Map;for(let n of e)r.has(n.symbol)||r.set(n.symbol,n);return r}function E(i,e,r,n){return e.productionCallableDefinitions({scope:r,minLoc:3,maxLoc:n,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(o=>!m(i,o))}export{z as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3NUZVLR7.js.map
|