scip-query 0.23.0 → 0.26.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 +491 -2
- package/README.md +111 -122
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-PRVFAGTQ.js +2 -0
- package/dist/call-graph-DVPAQV2F.js +2 -0
- package/dist/call-graph-evidence-CUtj8V2I.d.ts +19 -0
- package/dist/chunk-2FSBGL5P.js +2 -0
- package/dist/chunk-2HLAFUCY.js +2 -0
- package/dist/chunk-2IWUT6CJ.js +3 -0
- package/dist/chunk-2KNN7GTQ.js +2 -0
- package/dist/chunk-2LHXRE2B.js +8 -0
- package/dist/{chunk-EG2CPZMJ.js → chunk-2YXE77TJ.js} +2 -2
- package/dist/chunk-36SGVCGX.js +2 -0
- package/dist/chunk-3ABBFPTP.js +2 -0
- package/dist/chunk-3IVFU4FD.js +3 -0
- package/dist/chunk-3JIQS44J.js +7 -0
- package/dist/chunk-3ZRB6DNK.js +7 -0
- package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
- package/dist/{chunk-6I6L7Z62.js → chunk-4BHGBMNO.js} +2 -2
- package/dist/chunk-4BP3UBDG.js +2 -0
- package/dist/chunk-4D6RO7G4.js +2 -0
- package/dist/chunk-4FEWQ6RH.js +2 -0
- package/dist/chunk-4IGEOBG7.js +2 -0
- package/dist/chunk-4QZXBUKC.js +2 -0
- package/dist/chunk-4WBDEVX2.js +4 -0
- package/dist/chunk-4WCUBZU3.js +8 -0
- package/dist/chunk-4WTUBQ36.js +40 -0
- package/dist/chunk-4XQ4O6IM.js +3 -0
- package/dist/chunk-55UQAMZO.js +4 -0
- package/dist/chunk-5D2LVK7O.js +125 -0
- package/dist/chunk-5IYJ56TT.js +2 -0
- package/dist/chunk-5PLMJC7Q.js +2 -0
- package/dist/chunk-5TNQJUR2.js +5 -0
- package/dist/chunk-62BDNPMI.js +2 -0
- package/dist/chunk-64DZ5TXR.js +7 -0
- package/dist/chunk-65245JCM.js +2 -0
- package/dist/chunk-6FFVZZL4.js +2 -0
- package/dist/chunk-6KO5JHAR.js +2 -0
- package/dist/chunk-6LRXOOSX.js +2 -0
- package/dist/chunk-6LSEIIF7.js +2 -0
- package/dist/chunk-6YMNWD3H.js +6 -0
- package/dist/chunk-72AD6ZRR.js +5 -0
- package/dist/chunk-73AAKPUC.js +4 -0
- package/dist/chunk-76CZ77DF.js +2 -0
- package/dist/chunk-7VPEEAAG.js +2 -0
- package/dist/chunk-7WTPQ4NX.js +14 -0
- package/dist/chunk-7Y5T6XDP.js +2 -0
- package/dist/chunk-A2IIGFMJ.js +5 -0
- package/dist/chunk-AB5KCTEV.js +2 -0
- package/dist/chunk-AC566WBP.js +6 -0
- package/dist/chunk-AGWFSTXC.js +3 -0
- package/dist/chunk-AOSIYPTA.js +2 -0
- package/dist/chunk-AUVEWPIF.js +2 -0
- package/dist/chunk-B56T42J3.js +25 -0
- package/dist/chunk-BIQEF5NE.js +2 -0
- package/dist/chunk-BL6XJKTA.js +3 -0
- package/dist/chunk-BMKOQJRI.js +2 -0
- package/dist/chunk-BOZ4EXBB.js +3 -0
- package/dist/chunk-BUTWYEPH.js +2 -0
- package/dist/chunk-BZB4QPIP.js +2 -0
- package/dist/{chunk-ILTDAWEF.js → chunk-CE357GEE.js} +4 -4
- package/dist/chunk-CFN45HFP.js +2 -0
- package/dist/chunk-CFYMZFXT.js +368 -0
- package/dist/chunk-CN5EH7O3.js +2 -0
- package/dist/chunk-D254DNNQ.js +4 -0
- package/dist/chunk-D3FDISIC.js +2 -0
- package/dist/chunk-D3NX5XIE.js +3 -0
- package/dist/chunk-DA7RPPDF.js +3 -0
- package/dist/chunk-DDMC3FON.js +3 -0
- package/dist/chunk-DIO3FUSG.js +2 -0
- package/dist/chunk-DJ2NNSUK.js +3 -0
- package/dist/chunk-DKYQIM3C.js +18 -0
- package/dist/{chunk-JTQVMR42.js → chunk-DOOEL2IV.js} +2 -2
- package/dist/chunk-DVFP6PZI.js +2 -0
- package/dist/chunk-E3FDPXZK.js +2 -0
- package/dist/chunk-E7YNJLCB.js +2 -0
- package/dist/chunk-EFGW5JPH.js +2 -0
- package/dist/chunk-EJVTR244.js +13 -0
- package/dist/chunk-EOV7RTRZ.js +2 -0
- package/dist/chunk-ETOIKRHO.js +2 -0
- package/dist/chunk-EYK3ZAO2.js +3 -0
- package/dist/chunk-F2V2LPET.js +52 -0
- package/dist/chunk-F4LUHJTF.js +2 -0
- package/dist/chunk-F4PUT6IT.js +2 -0
- package/dist/chunk-F56GCXXS.js +5 -0
- package/dist/chunk-FC2EVQRM.js +2 -0
- package/dist/chunk-FL7NBMHP.js +3 -0
- package/dist/chunk-FMRN2TRL.js +3 -0
- package/dist/chunk-FVULPZDF.js +20 -0
- package/dist/chunk-GCKCF5FL.js +43 -0
- package/dist/chunk-GH2PYF46.js +2 -0
- package/dist/chunk-GHJAGXIP.js +2 -0
- package/dist/{chunk-WIWY3CRX.js → chunk-GMVSHUKZ.js} +2 -2
- package/dist/chunk-GS6KDO4R.js +2 -0
- package/dist/chunk-GUUBXNN7.js +2 -0
- package/dist/chunk-GVWX5T43.js +80 -0
- package/dist/chunk-GZKFETP5.js +2 -0
- package/dist/chunk-H4EQHO6J.js +9 -0
- package/dist/chunk-H73WY2RM.js +2 -0
- package/dist/chunk-H75GSPRV.js +60 -0
- package/dist/chunk-HDR3AHSV.js +61 -0
- package/dist/chunk-HQBSL74Y.js +2 -0
- package/dist/chunk-HRRFKWPZ.js +2 -0
- package/dist/chunk-HXENDJC6.js +2 -0
- package/dist/chunk-IIBAZNSW.js +21 -0
- package/dist/chunk-INLMWEUU.js +12 -0
- package/dist/chunk-IWQPAF4F.js +2 -0
- package/dist/chunk-IZJ6YUKP.js +35 -0
- package/dist/chunk-J2TMAIN5.js +60 -0
- package/dist/chunk-J5FJMODQ.js +142 -0
- package/dist/chunk-J7HZPIO3.js +2 -0
- package/dist/chunk-JEVRKFRL.js +2 -0
- package/dist/chunk-JFXSGAEB.js +30 -0
- package/dist/chunk-JVRTHGFS.js +3 -0
- package/dist/chunk-JYWEX7RR.js +360 -0
- package/dist/chunk-K3YL22N6.js +2 -0
- package/dist/chunk-K4CN7GXK.js +12 -0
- package/dist/chunk-K5TBVXU4.js +30 -0
- package/dist/chunk-KDDIE2DP.js +9 -0
- package/dist/chunk-KHWRRPV4.js +2 -0
- package/dist/chunk-KI6NBKDY.js +14 -0
- package/dist/chunk-KU3QRSTH.js +2 -0
- package/dist/chunk-KZBJWZJB.js +2 -0
- package/dist/chunk-L7GFM3NP.js +3 -0
- package/dist/chunk-LMO6PK3V.js +35 -0
- package/dist/chunk-LN4YXJJU.js +2 -0
- package/dist/chunk-LOVIZBJ4.js +43 -0
- package/dist/chunk-LPCRK4A2.js +11 -0
- package/dist/chunk-MMHZKBFA.js +2 -0
- package/dist/{chunk-M2O5NY6W.js → chunk-MOQQBQRD.js} +2 -2
- package/dist/chunk-N2WN6I3L.js +2 -0
- package/dist/chunk-N3ORQT7L.js +2 -0
- package/dist/chunk-NAZ3RAIW.js +2 -0
- package/dist/chunk-NDUNO5JQ.js +2 -0
- package/dist/chunk-NEIWRNAZ.js +4 -0
- package/dist/chunk-NJJMVD65.js +2 -0
- package/dist/chunk-NLOQOBXI.js +20 -0
- package/dist/chunk-NOLZOVCU.js +2 -0
- package/dist/chunk-NOWINRRN.js +2 -0
- package/dist/chunk-NZAXKGRL.js +16 -0
- package/dist/chunk-O2C4UILI.js +2 -0
- package/dist/chunk-O3RHA6ZT.js +3 -0
- package/dist/chunk-O4UZSPPI.js +3 -0
- package/dist/chunk-OGFV2BUX.js +2 -0
- package/dist/chunk-OZCJXZK6.js +499 -0
- package/dist/chunk-P6ODM7BY.js +2 -0
- package/dist/{chunk-XBGWL66K.js → chunk-PAVGPRHJ.js} +2 -2
- package/dist/chunk-PH52RA7D.js +2 -0
- package/dist/chunk-PKN354TH.js +3 -0
- package/dist/chunk-PWOASWEG.js +11 -0
- package/dist/chunk-QIWXRW72.js +2 -0
- package/dist/chunk-QJRMOK5N.js +2 -0
- package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
- package/dist/chunk-QXEUDXBT.js +3 -0
- package/dist/chunk-QYUVVBMR.js +6 -0
- package/dist/chunk-QZ7KQZRN.js +2 -0
- package/dist/chunk-R6LQBUDH.js +2 -0
- package/dist/chunk-RBS42E55.js +20 -0
- package/dist/chunk-RSJKPCFX.js +26 -0
- package/dist/chunk-S6CZA3MV.js +2 -0
- package/dist/chunk-STMVAHJP.js +2 -0
- package/dist/chunk-SYVPTTVW.js +2 -0
- package/dist/chunk-T3I6NHBH.js +2 -0
- package/dist/chunk-T6DK3ZP7.js +2 -0
- package/dist/chunk-TKD34PHN.js +4 -0
- package/dist/chunk-TNNQFH7W.js +2 -0
- package/dist/chunk-TNV7SSUF.js +2 -0
- package/dist/chunk-TO7ZR3EH.js +8 -0
- package/dist/chunk-TOU3CHK4.js +2 -0
- package/dist/chunk-TRBI4UKT.js +2 -0
- package/dist/chunk-TZCVNCAN.js +4 -0
- package/dist/chunk-U4LZA5LL.js +3 -0
- package/dist/chunk-U5RIG3JP.js +3 -0
- package/dist/chunk-UP5KXN2I.js +2 -0
- package/dist/chunk-UQFR3NDH.js +5 -0
- package/dist/chunk-UXYXF7GV.js +2 -0
- package/dist/chunk-VB3GOKOS.js +2 -0
- package/dist/chunk-VF5JZICY.js +2 -0
- package/dist/chunk-VTY3VK6E.js +2 -0
- package/dist/chunk-VX2O4RIS.js +2 -0
- package/dist/chunk-WKPV2TDZ.js +2 -0
- package/dist/chunk-WOFQ5DTB.js +2 -0
- package/dist/chunk-WS4C6TCK.js +2 -0
- package/dist/chunk-WXU3DGPU.js +2 -0
- package/dist/chunk-X6RMKHJQ.js +81 -0
- package/dist/{chunk-4ILJCCXV.js → chunk-XHMN6ZX7.js} +2 -2
- package/dist/chunk-XHTVFLWW.js +2 -0
- package/dist/chunk-XKIDJCIK.js +2 -0
- package/dist/chunk-XTYTYZPT.js +2 -0
- package/dist/chunk-Y2JHHTTA.js +2 -0
- package/dist/chunk-YGVRMGYN.js +4 -0
- package/dist/chunk-YNQCGEQE.js +2 -0
- package/dist/chunk-YOQVEXVE.js +14 -0
- package/dist/chunk-YRT2WLYY.js +2 -0
- package/dist/chunk-YTAP5Y2G.js +2 -0
- package/dist/chunk-YTYWI7VB.js +2 -0
- package/dist/chunk-YULZRALL.js +2 -0
- package/dist/chunk-Z33WQG4Q.js +2 -0
- package/dist/chunk-ZGTYGDMF.js +16 -0
- package/dist/chunk-ZHMRSZFD.js +43 -0
- package/dist/chunk-ZHSP366W.js +10 -0
- package/dist/chunk-ZIBYCYKK.js +7 -0
- package/dist/{chunk-GAS2LJMP.js → chunk-ZLADLUE6.js} +3 -3
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-HYO3NP5Q.js → chunk-ZR4HBC2H.js} +2 -2
- package/dist/cli-main.js +6 -6
- package/dist/cli.js +1 -1
- package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
- package/dist/code-IL5WH3NZ.js +2 -0
- package/dist/code-result-json-ANTBEDFP.js +4 -0
- package/dist/command-descriptors-HEEMDHTU.js +222 -0
- package/dist/deps-EOWFC6FD.js +2 -0
- package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
- package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
- package/dist/files-K4AI3JUM.js +2 -0
- package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
- package/dist/{health-CPp2Jf1Z.d.ts → health-BtfmNrfa.d.ts} +58 -74
- package/dist/hierarchy-6W5NDIFI.js +2 -0
- package/dist/imports-WH365QY4.js +2 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/members-K3PHMF5S.js +2 -0
- package/dist/methods-E7KVMBX4.js +2 -0
- package/dist/output-continuation-command-BJSY67SN.js +3 -0
- package/dist/output-pagination-UZJ5ACIX.js +24 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-EP24WT4X.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +15 -4
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +3 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -0
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +3 -3
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +20 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity.d.ts +6 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +1 -7
- package/dist/queries/context.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dead.d.ts +2 -0
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/dependence-slice.d.ts +46 -22
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +1 -7
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +29 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -4
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +121 -61
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- 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 +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -0
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +17 -65
- package/dist/queries/index.js +1 -1
- package/dist/queries/locality-candidates.d.ts +4 -4
- 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.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -6
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +9 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +19 -3
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +22 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +17 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +4 -14
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +4 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/review.d.ts +188 -0
- package/dist/queries/review.js +2 -0
- package/dist/queries/similar-files.d.ts +7 -10
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +19 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice-cohesion.d.ts +205 -0
- package/dist/queries/slice-cohesion.js +2 -0
- package/dist/queries/source-inspection.d.ts +6 -202
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -3
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stats.d.ts +1 -0
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +4 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -7
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +3 -15
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +4 -4
- package/dist/refs-CCBJG7WK.js +2 -0
- package/dist/refs-pagination-DRNLVU4S.js +2 -0
- package/dist/reindex-worker.js +79 -29
- package/dist/reindex.js +45 -45
- package/dist/repository-cache-worker.js +2 -0
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +3 -4
- 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/service-queries-2WAJI7R6.js +6 -0
- package/dist/source-inspection-91U9zdO3.d.ts +341 -0
- package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
- package/dist/stats-G7DIV6VU.js +2 -0
- package/dist/surface-IO55UALI.js +2 -0
- package/dist/system-ZBMSHJXU.js +2 -0
- package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
- package/dist/typescript-indexer.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +3 -3
- package/docs/AGENT_GUIDE.md +19 -128
- package/docs/CLI_JSON_OUTPUT.md +21 -17
- package/docs/COMMAND_REFERENCE.md +34 -49
- package/docs/CURRENT_COMMANDS.md +123 -0
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
- package/docs/DETECTOR_GUIDE.md +55 -12
- package/docs/PRODUCT_VISION.md +135 -0
- package/docs/PROPERTY_TESTING.md +73 -0
- package/docs/REVIEW.md +76 -0
- package/docs/SKILLS.md +51 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
- package/docs/accuracy-audit-checklist.md +70 -13
- package/docs/analyzer-inventory.md +2 -2
- package/docs/locality-analyzer-design.md +9 -9
- package/package.json +18 -80
- package/scripts/evidence-product-contract.mjs +7 -3
- package/scripts/record-review-coverage.mjs +118 -0
- package/scripts/scip-windows-provenance.mjs +29 -19
- package/skills/scip-architecture-review/SKILL.md +57 -0
- package/skills/scip-architecture-review/agents/openai.yaml +4 -0
- package/skills/scip-architecture-review/references/design-checks.md +17 -0
- package/skills/scip-explore/SKILL.md +15 -59
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/external-evidence.md +2 -2
- package/skills/scip-explore/references/information-model.md +26 -29
- package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
- package/skills/scip-integrity-audit/SKILL.md +53 -181
- package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
- package/skills/scip-plan/SKILL.md +39 -65
- package/skills/scip-plan/agents/openai.yaml +2 -2
- package/skills/scip-query/SKILL.md +28 -81
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-query/references/command-guide.md +169 -0
- package/skills/scip-setup/SKILL.md +4 -2
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/by-kind-XI2CSWEY.js +0 -2
- package/dist/call-graph-UONR6JR5.js +0 -2
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2E7CX53V.js +0 -2
- package/dist/chunk-2GRUZAQF.js +0 -43
- package/dist/chunk-2LDBDR6J.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2R3V3PSD.js +0 -4
- package/dist/chunk-2WC2OEDO.js +0 -4
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D3QG236.js +0 -2
- package/dist/chunk-3FHOF22C.js +0 -21
- package/dist/chunk-3JKSW6LJ.js +0 -2
- package/dist/chunk-3L2ZBPEX.js +0 -133
- package/dist/chunk-3PJABJSU.js +0 -2
- package/dist/chunk-3SVF22I5.js +0 -2
- package/dist/chunk-3WR4E3A3.js +0 -3
- package/dist/chunk-4FTZ4P5G.js +0 -2
- package/dist/chunk-4UX2F3JX.js +0 -2
- package/dist/chunk-4WNW27SX.js +0 -2
- package/dist/chunk-5ENOG4VP.js +0 -61
- package/dist/chunk-64BFSI5I.js +0 -2
- package/dist/chunk-66DVSJQG.js +0 -455
- package/dist/chunk-6HFCYNYE.js +0 -9
- package/dist/chunk-6PQNKL3G.js +0 -3
- package/dist/chunk-6V5CNXL6.js +0 -2
- package/dist/chunk-6VVV4WRR.js +0 -4
- package/dist/chunk-7BWFZPPZ.js +0 -2
- package/dist/chunk-7CYG22FH.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7IWV2EG3.js +0 -3
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-AFHTBORT.js +0 -2
- package/dist/chunk-AVRYW5OZ.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B5D7QPBE.js +0 -4
- package/dist/chunk-BBCIS4DX.js +0 -16
- package/dist/chunk-BDUVI7TO.js +0 -3
- package/dist/chunk-BE7ZZTMC.js +0 -2
- package/dist/chunk-BHVUJOCQ.js +0 -3
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BQGB4HBD.js +0 -2
- package/dist/chunk-BRV7PIFF.js +0 -2
- package/dist/chunk-CEEZJXEF.js +0 -2
- package/dist/chunk-CIYLO6SI.js +0 -7
- package/dist/chunk-CJZXN4NU.js +0 -2
- package/dist/chunk-CNO7TOKL.js +0 -2
- package/dist/chunk-COF23M5F.js +0 -2
- package/dist/chunk-CWFP7GM5.js +0 -2
- package/dist/chunk-D2DHWI3D.js +0 -2
- package/dist/chunk-D4N5SQ2M.js +0 -4
- package/dist/chunk-DBRSYFXR.js +0 -2
- package/dist/chunk-DHUIOLDT.js +0 -2
- package/dist/chunk-DIRJWYBM.js +0 -6
- package/dist/chunk-DIUFNHRJ.js +0 -35
- package/dist/chunk-DRENNWRG.js +0 -2
- package/dist/chunk-DTZCKZEU.js +0 -4
- package/dist/chunk-DULC3QFP.js +0 -5
- package/dist/chunk-DYGHBZ2N.js +0 -16
- package/dist/chunk-E5R6AQ73.js +0 -40
- package/dist/chunk-E73UNJTF.js +0 -38
- package/dist/chunk-EKV5HX33.js +0 -2
- package/dist/chunk-EQHFIL6T.js +0 -3
- package/dist/chunk-ESIQ66Z7.js +0 -2
- package/dist/chunk-EVFUMY4R.js +0 -3
- package/dist/chunk-F7DY272B.js +0 -2
- package/dist/chunk-FBN2FGXG.js +0 -2
- package/dist/chunk-FDLOBR6P.js +0 -4
- package/dist/chunk-FESCRNVV.js +0 -5
- package/dist/chunk-FFRKR4EQ.js +0 -2
- package/dist/chunk-FGA2U4OR.js +0 -8
- package/dist/chunk-FIQRSHVM.js +0 -2
- package/dist/chunk-FPYLNQPT.js +0 -2
- package/dist/chunk-FRUSVINH.js +0 -2
- package/dist/chunk-GSP44ENC.js +0 -2
- package/dist/chunk-GUFSG5TX.js +0 -2
- package/dist/chunk-GYIZ4NXB.js +0 -2
- package/dist/chunk-GZIUDL6G.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HCXEQRFF.js +0 -18
- package/dist/chunk-HEHOQQKH.js +0 -2
- package/dist/chunk-HKGFPJ4T.js +0 -4
- package/dist/chunk-HLZTEXRA.js +0 -2
- package/dist/chunk-HOENASQM.js +0 -3
- package/dist/chunk-HVF5VBG6.js +0 -2
- package/dist/chunk-I55I7XXP.js +0 -2
- package/dist/chunk-IDFEUFKS.js +0 -2
- package/dist/chunk-IHGQTTVW.js +0 -2
- package/dist/chunk-IICPE7B2.js +0 -20
- package/dist/chunk-IL676XCC.js +0 -18
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-IZDPJ2QI.js +0 -2
- package/dist/chunk-J66VOFW6.js +0 -5
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JGKUET5J.js +0 -3
- package/dist/chunk-JS4PGXMV.js +0 -3
- package/dist/chunk-JWTGMPIT.js +0 -80
- package/dist/chunk-JYR66JN5.js +0 -5
- package/dist/chunk-KFOYCQAJ.js +0 -9
- package/dist/chunk-KLFEXGQA.js +0 -2
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KYSDI3GE.js +0 -5
- package/dist/chunk-L6PJPETJ.js +0 -29
- package/dist/chunk-LDVT66YM.js +0 -2
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-LMZ5PRUV.js +0 -2
- package/dist/chunk-LQRQN2XA.js +0 -2
- package/dist/chunk-LXABEJX3.js +0 -2
- package/dist/chunk-MNV5FSBW.js +0 -3
- package/dist/chunk-MPQ4OTBM.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV3CDXPI.js +0 -38
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N2ZSIIGR.js +0 -117
- package/dist/chunk-N5B2NILC.js +0 -5
- package/dist/chunk-NJITK2GP.js +0 -2
- package/dist/chunk-NOGJXYFO.js +0 -2
- package/dist/chunk-NOYBFVJA.js +0 -554
- package/dist/chunk-NWQXSFFU.js +0 -3
- package/dist/chunk-ODDUPDP7.js +0 -13
- package/dist/chunk-OLIWTZI3.js +0 -3
- package/dist/chunk-OLNV6I6U.js +0 -2
- package/dist/chunk-OR2E3AGZ.js +0 -2
- package/dist/chunk-OSR2GEHQ.js +0 -2
- package/dist/chunk-OSSESPDX.js +0 -3
- package/dist/chunk-OWOOWNJ5.js +0 -7
- package/dist/chunk-P42EIXTA.js +0 -2
- package/dist/chunk-PJFGPYTU.js +0 -2
- package/dist/chunk-PP7KNN7L.js +0 -2
- package/dist/chunk-PU7T5QYQ.js +0 -2
- package/dist/chunk-PWWAJSKV.js +0 -74
- package/dist/chunk-PZL5T7SU.js +0 -73
- package/dist/chunk-QBE3YX64.js +0 -23
- package/dist/chunk-QGVTFRY2.js +0 -7
- package/dist/chunk-QOJONDS7.js +0 -2
- package/dist/chunk-QU5XRYB5.js +0 -4
- package/dist/chunk-QUU5OBVK.js +0 -11
- package/dist/chunk-RBLQNW26.js +0 -20
- package/dist/chunk-RTQ7NEKG.js +0 -81
- package/dist/chunk-SQXRS7BG.js +0 -4
- package/dist/chunk-SSK6LDPC.js +0 -2
- package/dist/chunk-SZHGTCPP.js +0 -7
- package/dist/chunk-T4N4P2K5.js +0 -16
- package/dist/chunk-TA3QKLLU.js +0 -2
- package/dist/chunk-TEBQMNVI.js +0 -43
- package/dist/chunk-TPFHAQ2G.js +0 -2
- package/dist/chunk-TQPCBMWT.js +0 -5
- package/dist/chunk-TQZV7KV4.js +0 -2
- package/dist/chunk-TRNAEQ6P.js +0 -3
- package/dist/chunk-TY7CRN3Z.js +0 -2
- package/dist/chunk-UHFYCMZO.js +0 -35
- package/dist/chunk-UICY4GTQ.js +0 -7
- package/dist/chunk-UVGEWT4Y.js +0 -26
- package/dist/chunk-UXW33INU.js +0 -29
- package/dist/chunk-VMPRET3I.js +0 -5
- package/dist/chunk-VNLGKHS6.js +0 -6
- package/dist/chunk-VQILFTEH.js +0 -2
- package/dist/chunk-VUPHCS7Y.js +0 -57
- package/dist/chunk-VVZSBTSU.js +0 -23
- package/dist/chunk-VZRNID6A.js +0 -2
- package/dist/chunk-W5OXRYGE.js +0 -7
- package/dist/chunk-W6STWDQI.js +0 -57
- package/dist/chunk-W7CXK74K.js +0 -2
- package/dist/chunk-WB3WYIRE.js +0 -4
- package/dist/chunk-WDNVY4E7.js +0 -20
- package/dist/chunk-WK46TNUM.js +0 -3
- package/dist/chunk-WNTFFKAX.js +0 -12
- package/dist/chunk-WOIKCX6A.js +0 -2
- package/dist/chunk-WUN6KBHV.js +0 -2
- package/dist/chunk-WYCTJDVR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XDQMU3BT.js +0 -2
- package/dist/chunk-XFA4SSO3.js +0 -3
- package/dist/chunk-XGZEP6GR.js +0 -8
- package/dist/chunk-XPDPNWTQ.js +0 -368
- package/dist/chunk-XRYABF57.js +0 -8
- package/dist/chunk-YBGKCQIS.js +0 -2
- package/dist/chunk-YEN6CYC7.js +0 -16
- package/dist/chunk-YF5IB2LF.js +0 -2
- package/dist/chunk-YI2AWIHC.js +0 -3
- package/dist/chunk-YPWBKGFU.js +0 -2
- package/dist/chunk-YPWHBBIS.js +0 -2
- package/dist/chunk-YSH6U3L4.js +0 -3
- package/dist/chunk-YU5DZUZI.js +0 -10
- package/dist/chunk-YWO5DDRC.js +0 -16
- package/dist/chunk-Z4CDXYNQ.js +0 -2
- package/dist/chunk-ZF5KHH7C.js +0 -2
- package/dist/chunk-ZOHS7AQV.js +0 -21
- package/dist/chunk-ZTI4SBFV.js +0 -3
- package/dist/code-MI6F2TTU.js +0 -2
- package/dist/code-result-json-FXALY4HE.js +0 -2
- package/dist/command-descriptors-P34VABY5.js +0 -343
- package/dist/dataflow-4KEMJPC6.js +0 -2
- package/dist/dependence-slice-R7FPWD5M.js +0 -2
- package/dist/deps-7EMQUYUT.js +0 -2
- package/dist/direct-navigation-6YO234F2.js +0 -3
- package/dist/entry-map-KOOLR26E.js +0 -2
- package/dist/files-OPIPJIGZ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-QPD2CAER.js +0 -2
- package/dist/imports-M6HUXRXC.js +0 -2
- package/dist/members-I5MEFOCT.js +0 -2
- package/dist/methods-5JYGGHXA.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-UPQAAKBP.js +0 -3
- package/dist/output-pagination-3OFL2MJV.js +0 -19
- package/dist/project-reindex-UKKQ5PLS.js +0 -3
- package/dist/queries/anchors.d.ts +0 -123
- package/dist/queries/anchors.js +0 -2
- package/dist/queries/complexity-hotspots.d.ts +0 -40
- package/dist/queries/complexity-hotspots.js +0 -2
- package/dist/queries/convergence.d.ts +0 -33
- package/dist/queries/convergence.js +0 -2
- package/dist/queries/dataflow.d.ts +0 -77
- package/dist/queries/dataflow.js +0 -2
- package/dist/queries/deep-chains.d.ts +0 -5
- package/dist/queries/deep-chains.js +0 -2
- package/dist/queries/extract-candidates.d.ts +0 -52
- package/dist/queries/extract-candidates.js +0 -2
- package/dist/queries/isolated.d.ts +0 -24
- package/dist/queries/isolated.js +0 -2
- package/dist/queries/plan-context.d.ts +0 -33
- package/dist/queries/plan-context.js +0 -2
- package/dist/queries/reference-neighborhood.d.ts +0 -4
- package/dist/queries/reference-neighborhood.js +0 -2
- package/dist/queries/reference-reachability.d.ts +0 -48
- package/dist/queries/reference-reachability.js +0 -2
- package/dist/queries/self-audit.d.ts +0 -63
- package/dist/queries/self-audit.js +0 -2
- package/dist/queries/similar-chains.d.ts +0 -48
- package/dist/queries/similar-chains.js +0 -2
- package/dist/queries/slice.d.ts +0 -4
- package/dist/queries/slice.js +0 -2
- package/dist/queries/stale-abstractions.d.ts +0 -72
- package/dist/queries/stale-abstractions.js +0 -2
- package/dist/queries/system-map.d.ts +0 -449
- package/dist/queries/system-map.js +0 -2
- package/dist/queries/trace.js +0 -2
- package/dist/queries/twin-ab.d.ts +0 -66
- package/dist/queries/twin-ab.js +0 -2
- package/dist/queries/value-flow.d.ts +0 -43
- package/dist/queries/value-flow.js +0 -2
- package/dist/queries/wrapper-candidates.d.ts +0 -34
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-PSU4JZZW.js +0 -2
- package/dist/refs-pagination-JG6CJMRC.js +0 -2
- package/dist/slice-HYRATV64.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-VTGDYWF5.js +0 -2
- package/dist/symbol-resolution-WD5EU5JE.js +0 -2
- package/dist/system-LRQNFOR2.js +0 -2
- package/dist/trace-F4B6OLL4.js +0 -2
- package/dist/value-flow-VRPZY72V.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
package/dist/chunk-W7CXK74K.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as B,b as J,c as y,e as b,f as O,h as T,k as _,l as z}from"./chunk-NWQXSFFU.js";import{y as N}from"./chunk-WB3WYIRE.js";import{b as U}from"./chunk-TEBQMNVI.js";import{h as d}from"./chunk-FESCRNVV.js";import{c as j,h as v,i as g,r as A,t as P,v as $,y as m}from"./chunk-JWTGMPIT.js";var ce={references:T,referenceMap:_,callerMap:(t,s)=>b(t).callerMap(s),calleeMap:q};function q(t,s){let a=$(),i=new Map,o=O(t,s),r=[],n=[],u=0,c=0,p=0,f=0,E=0,k=0,H=0;for(let{definition:e,callees:l}of o.hits)E+=1,l.length>0&&(k+=1,H+=l.length,i.set(e.symbolId,l));let h=K(t,o.hits);if(h.entries.length>0&&m("semantic.callees.prefetch-cache-write",()=>P(t,h.entries),()=>({entries:h.entries.length,sourceMissing:h.sourceMissing,skippedUnsupportedLanguage:h.skippedUnsupportedLanguage})),m("semantic.callees.cache-scan",()=>{for(let[e,l]of B(o.misses)){if(!y(e)){a&&(u+=l.length);continue}let R=d(t,e);if(!R){a&&(c+=l.length),n.push(...l);continue}let x=g(t,e,R),C=G(t,e);if(!C){n.push(...l);continue}let Y=A(t,e,x,C);for(let D of l){let L=Y.get(D.symbol)??null;if(L!==null){let M=V(L);if(M){a&&(p+=1),M.length>0&&i.set(D.symbolId,M);continue}a&&(f+=1)}r.push({def:D,contentHash:x,depsDigest:C})}}},()=>({definitions:s.length,skippedUnsupportedLanguage:u,sourceMissing:c,cacheHits:p,parseFailures:f,misses:r.length,unkeyed:n.length,inMemoryHits:E,inMemoryRows:k,inMemoryCalleeCount:H,resultRows:i.size,missSample:r.slice(0,8).map(e=>`${e.def.relativePath}#${e.def.symbol}`),unkeyedSample:n.slice(0,4).map(e=>`${e.relativePath}#${e.symbol}`)})),r.length===0&&n.length===0)return i;let I=[...n,...r.map(e=>e.def)],w=0,F=m("semantic.callees.compute-misses",()=>{let e=z(t,I);return w=e.size,e},()=>({definitions:I.length,misses:r.length,unkeyed:n.length,rows:w}));for(let[e,l]of F)i.set(e,l);let S=r.filter(e=>b(t).capability("semantic-callees",e.def.relativePath).available).map(e=>({relativePath:e.def.relativePath,symbol:e.def.symbol,contentHash:e.contentHash,depsDigest:e.depsDigest,payload:JSON.stringify(F.get(e.def.symbolId)??[])}));return S.length>0?m("semantic.callees.cache-write",()=>P(t,S),()=>({entries:S.length})):m("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:r.length})),i}function K(t,s){let a=[],i=new Map,o=0,r=0;for(let{definition:n,callees:u}of s){if(!y(n.relativePath)){r+=1;continue}if(!i.has(n.relativePath)){let p=d(t,n.relativePath),f=p?G(t,n.relativePath):null;i.set(n.relativePath,p&&f?{contentHash:g(t,n.relativePath,p),depsDigest:f}:null)}let c=i.get(n.relativePath);if(!c){o+=1;continue}a.push({relativePath:n.relativePath,symbol:n.symbol,contentHash:c.contentHash,depsDigest:c.depsDigest,payload:JSON.stringify(u)})}return{entries:a,sourceMissing:o,skippedUnsupportedLanguage:r}}var Q="typescript-callees-v2-callsite-line";function G(t,s){let a=y(s);if(a==="typescript")return N(t,s,Q)?.key??null;let i=X(t,s);return a==="rust"?v(JSON.stringify({kind:"semantic-callees",language:a,engine:J(t.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:i})):i}function V(t){try{return JSON.parse(t)}catch{return null}}var W=j("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(t,s){return W.get(t,s,()=>{let i=[...U(t).get(s)??[]].sort().map(o=>`${o}:${g(t,o,d(t,o))}`);return v(i.join("|"))})}export{ce as a};
|
|
2
|
-
//# sourceMappingURL=chunk-W7CXK74K.js.map
|
package/dist/chunk-WB3WYIRE.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as L,b as fe,e as ye,h as X,k as we,m as ve}from"./chunk-TRNAEQ6P.js";import{b as N}from"./chunk-TEBQMNVI.js";import{B as Fe,a as Me}from"./chunk-ZOHS7AQV.js";import{c as Re,e as Ie}from"./chunk-FESCRNVV.js";import{b as Se,d as xe,h as Y,y as Z}from"./chunk-JWTGMPIT.js";import{G as me,J as x,S as ge,T,U as G,g as ae,i as ce,o as de,q as c,u as le,v as ue,wa as be,x as pe,xa as he}from"./chunk-N5B2NILC.js";import{execFileSync as Te}from"child_process";import{createHash as nt}from"crypto";import{existsSync as C,statSync as rt}from"fs";import{createRequire as it}from"module";import{platform as ot}from"os";import{dirname as Pe,join as A}from"path";var st=it(import.meta.url),Rn={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function Q(t){return[t.indexerBinary,...t.binaryAliases??[]]}function at(t){let e=Q(t);return e.length===1?e[0]:e.join(" or ")}function ee(t){for(let e of Q(t)){let n=ve(e);if(n)return n}return dt(t)}function In(t){return ee(t)!==null||ct(t)}function ct(t){return Ae(t)!==null}function dt(t){let e=Ae(t);if(!e)return null;let r=JSON.parse(x(e,"indexer package manifest")).bin;if(!r)return null;if(typeof r=="string")return A(Pe(e),r);for(let i of Q(t)){let o=r[i];if(o)return A(Pe(e),o)}return null}function Ae(t){if(!t.bundledNpmPackage)return null;try{return st.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function lt(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return r}return null}function ut(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return Be(e,n,r)}return null}function Fn(t,e){let n=pt(t,e);if(!n||n.canonicalPath!==e.canonicalPath||n.sha256!==e.sha256||n.size!==e.size||n.mtimeMs!==e.mtimeMs||n.device!==e.device||n.inode!==e.inode||n.executable!==e.executable)throw new Error(`refusing changed project-local indexer ${e.relativePath}; review the current file and rerun with --trust-project-tools`)}function pt(t,e){try{return Be(t,e.relativePath,e.configuredPath)}catch{return null}}function Be(t,e,n){let r={maxBytes:268435456,inputKind:"project-local indexer"},i=be(t,e,r),o=he(t,e,r),s=rt(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:e,sha256:nt("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function ft(t,e,n={}){return(n.trustProjectTools?ut(t,e)?.canonicalPath:null)??ee(t)}function wn(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||te(n,e))return e;let r=Ee(n,e);return r?{...e,DOTNET_ROOT:r}:e}function vn(t,e,n={}){let r=at(t),i=e?ft(t,e,n):ee(t);if(!i)return{language:t.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl,...e&<(t,e)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:r,installed:!0,runnable:!0,resolvedBinary:i};let o=mt(i);return{language:t.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:t.installUrl,note:o.note}}function mt(t){if(te(t,process.env))return{runnable:!0};let e=Ee(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=De(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function Ee(t,e){for(let n of De(e))if(te(t,{...e,DOTNET_ROOT:n}))return n;return null}function De(t){let e=[],n=t.DOTNET_ROOT;if(n&&C(n)&&e.push(n),ot()==="darwin"&&we("brew"))try{let r=Te("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:t,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=A(r,"libexec");C(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function te(t,e){try{return Te(t,["--version"],{stdio:"pipe",env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}import{getHeapStatistics as Ft}from"v8";var yt=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function O(t){let e=t.toLowerCase();return yt.some(n=>e.endsWith(n))}function q(t){let e=_(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(d=>[d.path,d])),i=t.snapshot.files.filter(d=>{let m=ae(d.path,["typescript"]);return m==="config"||m==="ambient"}).map(d=>d.path),o=_([...e,...i]),s=o.find(d=>!r.has(d)),a=new Set(t.snapshot.files.map(d=>d.path)).size!==t.snapshot.files.length,l=!s&&o.some(d=>ke(r.get(d))),u=Y(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:_(t.snapshot.typescriptProjects),membership:e})),p,f;return{identityFor(d,m){if(!n.has(d))return R("target-outside-project");if(a)return R("duplicate-input-path");if(s)return R("missing-input-fingerprint");if(l)return R("unreadable-input");let h=[],S,V;if(t.graph===null)h.push("dependency-graph-unavailable"),V="whole-project",S=o;else{let P=d===p&&f?f:gt(d,t.graph);if(p=d,f=P,P.find(K=>!r.has(K)))return R("missing-input-fingerprint");if(S=_([...P,...i]),S.some(K=>ke(r.get(K))))return R("unreadable-input");V="dependency-closure"}let tt=S.map(P=>bt(r.get(P)));return{version:1,key:Y(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:m,projectIdentity:u,inputs:tt})),mode:V,inputFiles:S,reasons:h}}}}function gt(t,e){let n=new Set,r=[t];for(let i=0;i<r.length;i+=1){let o=r[i];if(!(o===void 0||n.has(o))){n.add(o);for(let s of[...e.get(o)??[]].sort())n.has(s)||r.push(s)}}return[...n].sort()}function bt(t){return t.semanticHash===void 0?{path:t.path,size:t.size,hash:t.hash}:{path:t.path,semanticHash:t.semanticHash}}function ke(t){return t.size<0||t.hash==="unreadable"}function R(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function _(t){return[...new Set(t)].sort()}import{createRequire as ht}from"module";var je=ht(import.meta.url),B,$;function St(){if(B!==void 0)return B;try{B=je("ts-morph")}catch{B=null}return B}function W(){if($)return $;let t=St();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=je("ts-morph/package.json").version??"unknown"}catch{}return $=`ts-morph:${e}:typescript:${t.ts.version}`,$}function kn(t,e){return e.map(n=>({tsconfigPath:n,project:new t.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function jn(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var xt=xe("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function H(t,e,n){let r=xt.get(t,()=>Mt(t));if(!r)return null;let i=`${n}\0${e}`,o=r.identities.get(i);if(o)return o;let s=r.builder.identityFor(e,n);return r.identities.set(i,s),s}function I(t){return Me(t,{includeIgnored:!1}).filter(O).sort()}function Mt(t){try{if(!t.generation.metadataRaw)return null;let e=pe(t.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let n=ce(e.metadata.fingerprint);return n?{builder:q({projectFiles:I(t),snapshot:n,graph:N(t),engineIdentity:W()}),identities:new Map}:null}catch{return null}}function Ce(t,e){let n=ne(t);for(let r of e.values())n.add(r);return n.finish()}function ne(t){let e=new Map(t.map(r=>[r.symbol,r])),n=new Map(t.map(r=>[r.symbolId,[]]));return{add(r){for(let i of r){let o=e.get(i.targetSymbol);o&&n.get(o.symbolId).push(i.location)}},finish(){for(let[r,i]of n)n.set(r,Rt(i));return n}}}function Oe(t,e,n){let r=Ne(t,e),i=Ne(t,n),o=[...r].filter(f=>!i.has(f)).sort(),s=[...i].filter(f=>!r.has(f)).sort(),a=Le(t,e),l=Le(t,n),u=[...a].filter(f=>!l.has(f)).sort(),p=[...l].filter(f=>!a.has(f)).sort();return{passed:o.length===0&&s.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:s,callerFiles:{passed:u.length===0&&p.length===0,expectedCount:a.size,actualCount:l.size,missing:u,extra:p}}}function Le(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function Un(t,e,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of t)for(let s of e.get(o.symbolId)??[])r.has(s.file)&&i.get(s.file).push({targetSymbol:o.symbol,location:s});for(let[o,s]of i)i.set(o,It(s));return i}function Ne(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function Rt(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort(_e)}function It(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||_e(n.location,r.location))}function _e(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var J="typescript-reference-fragment-v2",qe=128,D=Re({kind:"typescript-reference-fragments",invalidation:Ie("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:Et});function or(t,e,n,r=t,i,o=new Set(n.keys())){let s=I(t),a=q({projectFiles:s,snapshot:e,graph:i??N(t),engineIdentity:W()}),l=[],u=0;for(let[f,d]of n){let m=a.identityFor(f,J).key;if(!m){u+=1;continue}l.push({relativePath:f,contentHash:m,value:[...d]})}let p=s.filter(f=>!o.has(f)&&!n.has(f)).length;return D.writeBatch(r,l),{affectedFiles:l.length,carriedFiles:p,skippedAffectedFiles:u}}function sr(t,e,n,r){let i=e.filter(s=>O(s.relativePath));if(i.length===0)return E("no TypeScript definitions");let o=E("shadow did not run");return Z("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=E("TypeScript reference fragment provider is unavailable"),o;let a=I(t),l=new Set(a),u=new Map;for(let m of $e(a)){let h=s.referenceFragmentsForFiles(m);if(m.some(S=>!h.has(S)))return o=E("TypeScript reference fragment provider returned an incomplete batch"),o;for(let S of m)u.set(S,h.get(S)??[])}let p=Ce(i,u),f=Oe(i,wt(n,l),p);if(!f.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...f},o;let d=[];for(let m of a){let h=H(t,m,J);h?.key&&d.push({relativePath:m,contentHash:h.key,value:u.get(m)??[]})}return D.writeBatch(t,d),o={state:"passing",files:a.length,keyedFiles:d.length,writtenFiles:d.length,...f},o}catch(s){return o=E(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function wt(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function ar(t,e,n){if(e.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,o=0,s=0,a=0;return Z("typescript.reference-fragments.materialize",()=>{try{let l=I(t);i=l.length;let u=ne(e),p=[];for(let d of l){let m=H(t,d,J);if(!m?.key)return null;let h=D.read(t,d,m.key);h===null?(s+=1,p.push({file:d,contentHash:m.key})):(o+=1,u.add(h))}return s===0?(r="hit",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):At(t,p,n,d=>{for(let{fragments:m}of d)u.add(m);a+=d.length})?(r="computed",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):null}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function $e(t){let e=[];for(let n=0;n<t.length;n+=qe)e.push(t.slice(n,n+qe));return e}var vt=.75;function Pt(t){return{heapUsedFraction:()=>{let e=Ft();return e.heap_size_limit>0?e.used_heap_size/e.heap_size_limit:0},collect:Fe,release:()=>Se(t,{groups:["semantic-provider"]})}}function Tt(t,e=vt){return t.heapUsedFraction()<e||t.collect()&&t.heapUsedFraction()<e?!1:(t.release(),!0)}function At(t,e,n,r,i=Pt(t)){for(let o of $e(e)){let s=Bt(t,o,n);if(!s)return!1;r(s),Tt(i)}return!0}function Bt(t,e,n){let r=e.map(({file:s})=>s),i=n(r[0]);if(!i.availability().available||!i.referenceFragmentsForFiles)return null;let o=i.referenceFragmentsForFiles(r);return r.some(s=>!o.has(s))?null:(D.writeBatch(t,e.map(({file:s,contentHash:a})=>({relativePath:s,contentHash:a,value:o.get(s)??[]}))),r.map(s=>({file:s,fragments:o.get(s)??[]})))}function cr(t){let e=I(t),n=0;for(let r of e){let i=H(t,r,J);if(!i?.key)return null;D.has(t,r,i.key)||(n+=1)}return{files:e.length,missing:n}}function E(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function Et(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(Dt)?null:e}catch{return null}}function Dt(t){if(!t||typeof t!="object")return!1;let e=t,n=e.location;return typeof e.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{createHash as jt,randomUUID as Ve}from"crypto";import{closeSync as mr,existsSync as v,fstatSync as yr,lstatSync as j,mkdirSync as gr,openSync as br,readdirSync as w,readSync as hr,renameSync as Ke,rmSync as M}from"fs";import{basename as U,dirname as Lt,join as y}from"path";function We(t){return re(t,kt)}function re(t,e){return Array.isArray(t)?`[${t.map(n=>re(n,e)).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([n],[r])=>e(n,r)).map(([n,r])=>`${JSON.stringify(n)}:${re(r,e)}`).join(",")}}`:JSON.stringify(t)}function kt(t,e){return t.localeCompare(e)}var Nt=1,Ct=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),F=class extends Error{constructor(n,r,i,o){let s=n==="item-too-large"?`request is ${o} bytes; per-item limit is ${i.maxItemBytes}`:n==="item-capacity"?`mailbox has ${r.totalItems} retained items; limit is ${i.maxItems}`:n==="byte-capacity"?`mailbox retains ${r.totalBytes} bytes and the request adds ${o}; limit is ${i.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=n;this.status=r;this.limits=i;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},Ot=".owner.json",_t={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function wr(t){return{rootDir:t,pendingDir:y(t,"pending"),inflightDir:y(t,"inflight"),responseDir:y(t,"responses"),deadLetterDir:y(t,"dead-letter"),legacyRequestDir:y(t,"requests")}}function qt(t={}){let e={...Ct,...t};for(let[n,r]of Object.entries(e))if(!Number.isFinite(r)||r<=0||!Number.isInteger(r))throw new Error(`Mailbox limit ${n} must be a positive integer.`);return e}function Ge(t){let e=[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir].map(n=>ge(n));return G(...e)}function vr(t,e){return jt("sha256").update(We({namespace:t,payload:e})).digest("hex")}function Xe(t){if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${t}`}function Pr(t,e,n={}){let r=qt(n.limits),i=n.nowMs??Date.now(),o=Ge(t);return Kt(e),Wt(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??ye,n.durability??"durable",()=>{$t(t,i,r);let s=y(t.pendingDir,`${e.id}.json`),a=y(t.responseDir,`${e.id}.json`),l=He(t,e.id);if(l){let d=Je(l,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:d.deadlineAtMs??e.deadlineAtMs}}let u=`${JSON.stringify(e)}
|
|
2
|
-
`,p=Buffer.byteLength(u),f=Ye(t);if(p>r.maxItemBytes)throw new F("item-too-large",f,r,p);if(f.totalItems+1>r.maxItems)throw new F("item-capacity",f,r,p);if(f.totalBytes+p>r.maxBytes)throw new F("byte-capacity",f,r,p);n.onBeforePublish?.();try{let d=n.durability??"durable",m=X(s,u,{durability:d}),h=d==="durable"?G(o,m.directorySync):"not-requested";return{disposition:"accepted",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:m.achievedDurability,directorySync:h}}catch(d){if(d.code!=="EEXIST")throw d;let m=He(t,e.id);if(!m)throw d;let h=Je(m,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:h.deadlineAtMs??e.deadlineAtMs}}})}function $t(t,e,n,r=_t){let i={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of oe(t.inflightDir)){if(o<=0)break;let a=y(t.responseDir,`${s.requestId}.json`);if(v(a)){M(s.path,{force:!0}),i.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||zt(t,s.ownerId,r)!=="dead")continue;let l=y(t.pendingDir,s.originalFile);try{Ke(s.path,l),i.reclaimed++}catch(u){if(u.code!=="EEXIST")throw u;M(s.path,{force:!0})}T(Lt(s.path)),T(t.pendingDir),o--}o=Ue(t.responseDir,o,(s,a)=>a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=Ue(t.deadLetterDir,o,(s,a)=>a+n.deadLetterRetentionMs,e,()=>{i.deadLettersRemoved++});for(let s of[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir]){if(o<=0)break;for(let a of Ze(s)){if(o<=0)break;if(!U(a).includes(".tmp-"))continue;let l;try{l=j(a).mtimeMs}catch(u){if(u.code==="ENOENT")continue;throw u}l+n.temporaryRetentionMs>e||(M(a,{force:!0}),i.temporaryFilesRemoved++,o--)}}return Gt(t.inflightDir),i}function Ye(t){Ge(t);let e=[...k(t.pendingDir).map(l=>({path:l,pending:!0})),...k(t.legacyRequestDir).map(l=>({path:l,pending:!0}))],n=oe(t.inflightDir).map(l=>({path:l.path,pending:!1})),r=k(t.responseDir).map(l=>({path:l,pending:!1})),i=k(t.deadLetterDir).map(l=>({path:l,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let l of e){let u=se(l.path);if(!u){s++;continue}let p=u.enqueuedAtMs;if(p===void 0)try{p=j(l.path).mtimeMs}catch(f){if(f.code==="ENOENT")continue;throw f}a=a===void 0?p:Math.min(a,p)}return{pending:e.length,inflight:n.length,responses:r.length,deadLetters:i.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((l,u)=>l+Xt(u.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function Wt(t,e,n,r,i,o){let s=y(t.rootDir,".admission.lock"),a=`${process.pid}-${Ve()}`,l=r()+Math.max(0,n);for(;!Ht(t.rootDir,s,a,i);){if(Jt(s),r()>=l)throw new F("admission-busy",Ye(t),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{ie(s).ownerToken===a&&(M(s,{recursive:!0,force:!0}),i==="durable"&&T(t.rootDir))}catch{}}}function Ht(t,e,n,r){let i=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
3
|
-
`;try{return X(e,i,{durability:r}),!0}catch(o){if(o.code==="EEXIST")return!1;try{ie(e).ownerToken===n&&(M(e,{force:!0}),r==="durable"&&T(t))}catch{}throw o}}function Jt(t){let e=null;try{let r=ie(t);typeof r.ownerToken=="string"&&Number.isSafeInteger(r.pid)&&Number(r.pid)>0&&(e=Number(r.pid))}catch{}if(e===null||Ut(e))return;let n=`${t}.stale-${Ve()}`;try{Ke(t,n)}catch(r){let i=r.code;if(i==="ENOENT"||i==="EEXIST")return;throw r}M(n,{recursive:!0,force:!0})}function ie(t){try{return JSON.parse(x(t,"mailbox lock record"))}catch(e){if(e.code!=="EISDIR"&&!(e instanceof me&&e.reason==="not-regular"))throw e;return JSON.parse(x(y(t,"owner.json"),"mailbox lock owner record"))}}function Ut(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function zt(t,e,n){let r=Vt(y(t.inflightDir,Qe(e),Ot));if(!r)return"unknown";if(!n.isProcessAlive(r.pid))return"dead";if(!r.processIdentity)return"live";let i=n.readProcessIdentity(r.pid);return i?fe(r.processIdentity,i)?"live":"dead":"unknown"}function Vt(t){try{let e=JSON.parse(x(t,"mailbox owner record"));if(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)return null;let n=e.processIdentity===void 0?null:L(e.processIdentity);return e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,ownerId:e.ownerId,pid:e.pid,...n?{processIdentity:n}:{}}}catch{return null}}function He(t,e){for(let n of[y(t.pendingDir,`${e}.json`),y(t.legacyRequestDir,`${e}.json`),y(t.responseDir,`${e}.json`)])if(v(n))return n;for(let n of oe(t.inflightDir))if(n.requestId===e)return n.path;return null}function Je(t,e,n){let r=se(t);if(r?.operationKey===e)return r;if(U(t)===`${Xe(e)}.json`)return{id:n,operationKey:e};throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`)}function Kt(t){if(t.mailboxVersion!==Nt||t.id!==Xe(t.operationKey)||!t.clientId.trim()||!Number.isFinite(t.enqueuedAtMs)||!Number.isFinite(t.deadlineAtMs)||t.deadlineAtMs<t.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function oe(t){if(!v(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=ze(n.name);if(r===null)continue;let i=y(t,n.name);for(let o of w(i,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=ze(s[1]),l=Number(s[2]);if(a===null||U(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(l))continue;let u=y(i,o.name),p=se(u)??{id:U(a,".json")},f;try{f=j(u)}catch(d){if(d.code==="ENOENT")continue;throw d}e.push({requestId:p.id,ownerId:r,path:u,originalFile:a,claimedAtMs:f.mtimeMs,claimExpiresAtMs:l,byteLength:f.size,...p.operationKey?{operationKey:p.operationKey}:{},...p.clientId?{clientId:p.clientId}:{},...p.enqueuedAtMs===void 0?{}:{enqueuedAtMs:p.enqueuedAtMs},...p.deadlineAtMs===void 0?{}:{deadlineAtMs:p.deadlineAtMs},legacy:p.operationKey===void 0})}}return e.sort((n,r)=>n.claimedAtMs-r.claimedAtMs||n.path.localeCompare(r.path))}function se(t){try{let e=JSON.parse(x(t,"mailbox record"));return typeof e.id!="string"||!e.id?null:{id:e.id,...typeof e.operationKey=="string"?{operationKey:e.operationKey}:{},...typeof e.clientId=="string"?{clientId:e.clientId}:{},...typeof e.enqueuedAtMs=="number"?{enqueuedAtMs:e.enqueuedAtMs}:{},...typeof e.deadlineAtMs=="number"?{deadlineAtMs:e.deadlineAtMs}:{}}}catch{return null}}function Ue(t,e,n,r,i){for(let o of k(t)){if(e<=0)break;let s;try{s=j(o)}catch(a){if(a.code==="ENOENT")continue;throw a}n(o,s.mtimeMs)>r||(M(o,{force:!0}),i(),e--)}return e}function k(t){return v(t)?w(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(t,e.name)).sort():[]}function Ze(t){if(!v(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){let r=y(t,n.name);n.isFile()?e.push(r):n.isDirectory()&&e.push(...Ze(r))}return e.sort()}function Gt(t){if(v(t))for(let e of w(t,{withFileTypes:!0})){if(!e.isDirectory())continue;let n=y(t,e.name);w(n).some(r=>r.endsWith(".claim"))||M(n,{recursive:!0,force:!0})}}function Xt(t){try{return j(t).size}catch{return 0}}function Qe(t){return Buffer.from(t,"utf8").toString("base64url")}function ze(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return Qe(e)===t?e:null}catch{return null}}import{join as z}from"path";var jr=1e4,Yt="watch.lock",Zt="watch-state.json",Qt="watch-activity.json",en="watch-refresh-requests";function Lr(t){return{lockPath:z(t,Yt),statePath:z(t,Zt),activityPath:z(t,Qt),refreshRequestsPath:z(t,en)}}function Nr(t){try{return tn(JSON.parse(x(t,"watch service state")))}catch{return null}}function tn(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!g(e.startedAt)||!g(e.heartbeatAt)||!g(e.lastActivityAt)||!nn(e.watcher)||e.idleDeadlineAt!==void 0&&!g(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=L(e.processIdentity);if(!n||n.pid!==e.pid)return null;e.processIdentity=n}return e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!rn(e.lastError)||e.lastRefresh!==void 0&&!on(e.lastRefresh)||e.reindexActivity!==void 0&&!sn(e.reindexActivity)||e.refreshRequests!==void 0&&!cn(e.refreshRequests)||e.typescriptSemantic!==void 0&&!dn(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!ln(e.typescriptIndex)?null:e}function g(t){return de(t)}function nn(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return b(e.changedFiles)&&b(e.reindexAt);case"indexing":return b(e.startedAt);case"cooldown":return b(e.until)&&typeof e.dirty=="boolean";case"budget-paused":return b(e.until)&&typeof e.dirty=="boolean"&&typeof e.reason=="string"&&c(e.rebuilt)&&c(e.estimatedWriteBytes);case"draining":return b(e.startedAt)&&typeof e.reason=="string";default:return!1}}function rn(t){if(!t||typeof t!="object")return!1;let e=t;return g(e.at)&&typeof e.message=="string"}function on(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&g(e.startedAt)&&g(e.completedAt)&&b(e.durationMs)}function sn(t){if(!t||typeof t!="object")return!1;let e=t;return e.confidence!==void 0&&e.confidence!=="complete"&&e.confidence!=="partial"&&e.confidence!=="unavailable"||e.recordsRead!==void 0&&!c(e.recordsRead)||e.invalidRecords!==void 0&&!c(e.invalidRecords)||e.skippedRecords!==void 0&&!c(e.skippedRecords)||e.readErrors!==void 0&&!c(e.readErrors)||e.ignoredPartialTailBytes!==void 0&&!c(e.ignoredPartialTailBytes)||!g(e.windowStartedAt)||!g(e.windowEndedAt)||!c(e.runs)||!c(e.rebuilt)||e.fullRebuilds!==void 0&&!c(e.fullRebuilds)||!c(e.reused)||!c(e.failed)||!c(e.suppressed)||!b(e.estimatedLogicalOutputBytes)||e.estimatedWriteBytes!==void 0&&!c(e.estimatedWriteBytes)||e.reflinkedBytes!==void 0&&!c(e.reflinkedBytes)||e.fallbackCopiedBytes!==void 0&&!c(e.fallbackCopiedBytes)||e.oldestRebuildAt!==void 0&&!g(e.oldestRebuildAt)||e.oldestWriteAt!==void 0&&!g(e.oldestWriteAt)||e.languageAttribution!==void 0&&e.languageAttribution!=="complete"&&e.languageAttribution!=="partial"&&e.languageAttribution!=="unavailable"||e.attributedRuns!==void 0&&!c(e.attributedRuns)||e.unattributedRuns!==void 0&&!c(e.unattributedRuns)||e.invalidLanguageDetails!==void 0&&!c(e.invalidLanguageDetails)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"||Array.isArray(e.byTrigger)||e.byLanguage!==void 0&&!an(e.byLanguage)?!1:Object.values(e.byTrigger).every(n=>n===void 0||c(n))}function an(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;for(let[e,n]of Object.entries(t)){if(!ue.includes(e)||!n||typeof n!="object")return!1;let r=n;if(!c(r.runs)||!c(r.rebuilt)||!c(r.reused)||!c(r.producedOutputBytes)||!le(r.durationMs)||r.rebuilt+r.reused!==r.runs)return!1}return!0}function cn(t){if(!t||typeof t!="object")return!1;let e=t;return c(e.pending)&&c(e.claimed)&&c(e.completed)&&c(e.expired)&&c(e.invalid)&&(e.oldestPendingAt===void 0||g(e.oldestPendingAt))}function dn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&b(e.requests)&&b(e.sessionsCreated)&&b(e.sessionsReused)&&b(e.sessionsRefreshed)&&b(e.sessionsReplaced)&&b(e.projectsCreated)&&(e.lastRequestAt===void 0||g(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||g(e.busyUntil))&&(e.mailbox===void 0||et(e.mailbox))}function ln(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&c(e.requests)&&c(e.sessionsCreated)&&c(e.sessionsReplaced)&&(e.sessionsEvicted===void 0||c(e.sessionsEvicted))&&(e.activeSessions===void 0||c(e.activeSessions))&&(e.maxActiveSessions===void 0||c(e.maxActiveSessions))&&(e.heapUsedBytes===void 0||c(e.heapUsedBytes))&&(e.heapLimitBytes===void 0||c(e.heapLimitBytes))&&(e.softMemoryLimitBytes===void 0||c(e.softMemoryLimitBytes))&&(e.retireRequested===void 0||typeof e.retireRequested=="boolean")&&c(e.initializations)&&c(e.programUpdates)&&c(e.documentsEmitted)&&c(e.documentsRemoved)&&(e.lastRequestAt===void 0||g(e.lastRequestAt))&&(e.lastDurationMs===void 0||b(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||g(e.busyUntil))&&(e.mailbox===void 0||et(e.mailbox))}function et(t){if(!t||typeof t!="object")return!1;let e=t;return c(e.pending)&&c(e.inflight)&&c(e.responses)&&c(e.deadLetters)&&c(e.invalid)&&c(e.totalItems)&&b(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||g(e.oldestPendingAt))}function b(t){return typeof t=="number"&&Number.isFinite(t)}export{Rn as a,at as b,ee as c,In as d,lt as e,ut as f,Fn as g,wn as h,vn as i,We as j,Nt as k,wr as l,vr as m,Xe as n,Pr as o,jr as p,Lr as q,Nr as r,yt as s,O as t,St as u,kn as v,jn as w,Un as x,H as y,or as z,sr as A,ar as B,cr as C};
|
|
4
|
-
//# sourceMappingURL=chunk-WB3WYIRE.js.map
|
package/dist/chunk-WDNVY4E7.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{o as l,t as d,w as u}from"./chunk-5ENOG4VP.js";import{f as c}from"./chunk-N5B2NILC.js";import h from"better-sqlite3";var m=["busy_timeout = 5000","query_only = ON","temp_store = MEMORY","cache_size = -64000","mmap_size = 268435456"],o=class{constructor(t,e){this.connection=t;this.releaseGenerationReader=e}connection;releaseGenerationReader;active=!0;initialize(t){try{for(let e of m)this.connection.pragma(e);t(this.connection)}catch(e){try{this.close()}catch(n){throw new AggregateError([e,n],"SQLite initialization and rollback both failed.",{cause:n})}throw e}}close(){if(!this.active)return;this.active=!1;let t,e;try{this.connection.close()}catch(n){t=n}try{this.releaseGenerationReader()}catch(n){e=n}if(t!==void 0&&e!==void 0)throw new AggregateError([t,e],"SQLite connection close and generation-reader release both failed.");if(t!==void 0)throw t;if(e!==void 0)throw e}},b=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],p=class{db;config;generation;pathFilter;connection;connectionOwnership;statementCache=new Map;constructor(t,e){this.config=t,this.pathFilter=e??null;let n=S(t),i=new o(n.db,n.release);try{i.initialize(y),this.generation=n.generation,this.connection=n.db,this.connectionOwnership=i,this.db=g(n.db)}catch(r){try{i.close()}catch(s){throw new AggregateError([r,s],"SQLite construction and rollback both failed.",{cause:s})}throw r}}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
|
|
2
|
-
EXISTS (
|
|
3
|
-
SELECT 1
|
|
4
|
-
FROM defn_enclosing_ranges local_der
|
|
5
|
-
JOIN documents local_d ON local_der.document_id = local_d.id
|
|
6
|
-
WHERE local_der.symbol_id = gs.id
|
|
7
|
-
${this.pathExclusionsFor("local_d").trimStart()}
|
|
8
|
-
)
|
|
9
|
-
OR EXISTS (
|
|
10
|
-
SELECT 1
|
|
11
|
-
FROM mentions local_m
|
|
12
|
-
JOIN chunks local_c ON local_m.chunk_id = local_c.id
|
|
13
|
-
JOIN documents local_d ON local_c.document_id = local_d.id
|
|
14
|
-
WHERE local_m.symbol_id = gs.id
|
|
15
|
-
AND local_m.role = 1
|
|
16
|
-
${this.pathExclusionsFor("local_d").trimStart()}
|
|
17
|
-
)
|
|
18
|
-
)`}get pathExclusions(){return this.pathExclusionsFor("d")}get symbolNoise(){return this.symbolNoiseFor("gs")}pathExclusionsFor(...t){return t.flatMap(e=>b.flatMap(n=>[`AND ${e}.relative_path NOT LIKE '${n}/%'`,`AND ${e}.relative_path NOT LIKE '%/${n}/%'`])).join(`
|
|
19
|
-
`)}symbolNoiseFor(t){return`AND ${t}.symbol NOT LIKE '%().(%' AND ${t}.symbol NOT LIKE '%typeLiteral%'`}all(t,...e){return this.statement(t).all(...e)}get(t,...e){return this.statement(t).get(...e)}close(){this.statementCache.clear(),this.connectionOwnership.close()}statement(t){let e=this.statementCache.get(t);return e||(e=this.connection.prepare(t),this.statementCache.set(t,e)),e}};function g(a){return Object.freeze({prepare(t){let e=a.prepare(t);if(!e.readonly||!e.reader)throw new Error("ScipDatabase.db only permits read-only statements that return rows.");return f(e)}})}function f(a){let t={get:(...e)=>a.get(...e),all:(...e)=>a.all(...e),iterate:(...e)=>a.iterate(...e),pluck(e){return e===void 0?a.pluck():a.pluck(e),t},expand(e){return e===void 0?a.expand():a.expand(e),t},raw(e){return e===void 0?a.raw():a.raw(e),t},bind(...e){return a.bind(...e),t},columns:()=>a.columns(),safeIntegers(e){return e===void 0?a.safeIntegers():a.safeIntegers(e),t}};return Object.freeze(t)}function y(a){if(!a.prepare("SELECT 1 AS present FROM sqlite_master WHERE type = 'table' AND name = 'documents'").get())return;let e=a.prepare("SELECT relative_path FROM documents").iterate();for(let n of e)c(n.relative_path)}function S(a){for(let t=0;t<4;t+=1){let e=l(a),n=e.generation,i;try{i=new h(n.databasePath,{readonly:!0,fileMustExist:!0})}catch(r){throw e.release(),r}if(n.source==="immutable")return{db:i,generation:n,release:e.release};try{let r=d(a);if(n.databaseFileIdentity===u(n.databasePath)&&r.source==="legacy"&&r.identity===n.identity&&r.databaseFileIdentity===n.databaseFileIdentity&&r.metadataRaw===n.metadataRaw)return{db:i,generation:n,release:e.release}}catch(r){throw i.close(),e.release(),r}i.close(),e.release()}throw new Error("SQLite index publication changed repeatedly while opening a coherent generation.")}export{p as a};
|
|
20
|
-
//# sourceMappingURL=chunk-WDNVY4E7.js.map
|
package/dist/chunk-WK46TNUM.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as H,b as O,c as pe,e as de,f as U,j as ue}from"./chunk-TQZV7KV4.js";import{T as v,U as ye,c as se,d as ae,e as ce,f as le,g as _,n as fe}from"./chunk-3L2ZBPEX.js";import{a as A}from"./chunk-YXPUP5G2.js";import{d as w,e as me}from"./chunk-DRENNWRG.js";import{d as oe}from"./chunk-RTQ7NEKG.js";import{c as ie}from"./chunk-IW5XQG5G.js";import{a as j,e as I}from"./chunk-HGFDYOVB.js";import{$ as K,W as re}from"./chunk-KYSDI3GE.js";import{h as ne}from"./chunk-7F45LJKI.js";import{existsSync as E}from"fs";import b from"path";var W=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function z(o,e){let t=e?b.dirname(b.join(o,e)):o,r=b.resolve(o);for(;t.startsWith(r);){for(let s of W){let a=b.join(t,s);if(E(a))return a}let i=b.dirname(t);if(i===t)break;t=i}for(let i of W){let s=b.join(o,i);if(E(s))return s}return null}function ge(o){let e=o.config.projectRoot,n=new Set(He(e,o.config.semantic?.typescript?.tsconfigs)),t=A(o,{includeIgnored:!1,extensions:H});for(let r of t){let i=z(e,r);i&&n.add(b.resolve(i))}if(n.size===0){let r=z(e);r&&n.add(b.resolve(r))}return[...n].filter(r=>!he(e,r)).sort((r,i)=>r.localeCompare(i))}function He(o,e=[]){let n=new Set;for(let t of e){let r=b.isAbsolute(t)?t:b.join(o,t);E(r)&&n.add(b.resolve(r))}for(let t of Oe(o))for(let r of W){let i=b.join(t,r);E(i)&&n.add(b.resolve(i))}if(n.size===0){let t=z(o);t&&n.add(b.resolve(t))}return[...n].filter(t=>!he(o,t)).sort((t,r)=>t.localeCompare(r))}function Oe(o){let e=b.join(o,"package.json");if(!E(e))return[];let n;try{n=JSON.parse(ne(e,"project package manifest"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(r=>le(o,r))}function he(o,e){let n=b.relative(o,e).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{performance as m}from"perf_hooks";function x(o,e,n){if(o.has(e))return o.get(e);let t=n();return o.set(e,t),t}import Me from"path";import{realpathSync as Se}from"fs";function Ue(o,e){return o.getReferences().map(n=>{let t=n.getNode();return B(t,e)})}function Be(o){let e=o;return typeof e.findReferences=="function"?e.findReferences():[]}function Ie(o,e,n,t){let r=[];for(let i of Be(o))for(let s of Ue(i,t))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||r.push(s);for(let i of n)r.push(i);return P(r)}function xe(o,e,n,t){let r=[],i=n?.getStart();for(let s of o.getReferences()){let a=s.getNode();L(t,a.getSourceFile().getFilePath())===e&&(i!==void 0&&a.getStart()===i||r.push({location:B(a,t),node:a}))}return r}function B(o,e){let n=o.getSourceFile(),t=n.getLineAndColumnAtPos(o.getStart());return{file:L(e,n.getFilePath())??n.getBaseName(),line:t.line-1,column:t.column-1}}function Fe(o,e,n){let t=o.getSourceFile(),r=q(t,o),i=o.getText(),s=new RegExp(`\\b${fe(i)}\\b`,"g"),a=t.getFullText().split(`
|
|
2
|
-
`),c=[];for(let l=0;l<a.length;l++){if(l===r)continue;let f=a[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(f))!==null;)c.push({file:e,line:l,column:p.index})}return P(c.filter(l=>L(n,Me.join(n,l.file))===e))}function V(o){for(let e=o;e;e=e.getParent()){let n=e.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function q(o,e){return o.getLineAndColumnAtPos(e.getStart()).line-1}function P(o){let e=new Set,n=[];for(let t of o){let r=`${t.file}:${t.line}:${t.column}`;e.has(r)||(e.add(r),n.push(t))}return n}function L(o,e){let n=o||process.cwd(),t=be(n,e);if(t)return t;try{return be(Se(n),Se(e))}catch{return null}}function be(o,e){let n=Me.relative(o,e).replace(/\\/g,"/");return!n||n===".."||n.startsWith("../")?null:n}function Te(o,e,n,t){let r=$e(e,t);return r.size===0?new Map:Ke(o,n,r)}function $e(o,e){let n=new Map;for(let t of v(o,e)){let r=w(t.symbol)??t.leaf;if(!r)continue;let i=n.get(r);i||(i=[],n.set(r,i)),i.push(t)}return n}function Ke(o,e,n){let t=new Map,r=new Map;return e.forEachDescendant(i=>{for(let s of _e(o,i)){let a=n.get(s);if(!a)continue;let c=q(e,i);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let f=Math.abs(c-l.startLine),p=r.get(l.symbolId);p!==void 0&&p<=f||(r.set(l.symbolId,f),t.set(l.symbolId,i))}}}),t}function _e(o,e){let n=[],t=r=>{r&&!n.includes(r)&&n.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();t(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();t(r)}return o.Node.isIdentifier(e)&&t(e.getText()),n}var We=ie("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ke(o,e,n,t){let r=J(o,e),i=Y(r.get(t)??[],n);if(i)return i;let s=[];for(let a of r.values())for(let c of a)((c.leaf||w(c.symbol)||"").includes(t)||c.symbol.includes(t))&&s.push(c);return Y(s,n)}function G(o,e,n,t){return Y(J(o,e).get(t)??[],n)}function De(o,e){let n=new Map;for(let[t,r]of J(o,e)){let i=r[0];i&&n.set(t,i)}return n}function J(o,e){return We.get(o,e,()=>{let n=new Map;for(let t of v(o,e)){let r=t.leaf||w(t.symbol);if(!r)continue;let i=n.get(r);i||(i=[],n.set(r,i)),i.push({...t,leaf:r})}for(let t of n.values())t.sort((r,i)=>r.startLine-i.startLine||r.endLine-i.endLine||r.symbolId-i.symbolId);return n})}function Y(o,e){let n=null,t=Number.POSITIVE_INFINITY;for(let r of o){let i=Math.abs(r.startLine-e);(i<t||i===t&&n&&r.startLine<n.startLine)&&(n=r,t=i)}return n}import ze from"path";import{realpathSync as Ve}from"fs";function Re(o,e){let n=new Map,t=null,r=null,i=()=>(r??=A(o,{extensions:H}),r),s=()=>(t??=I("typescript.source-file-index",()=>qe(o.config.projectRoot,e,i()),()=>({projects:e.length,indexedDocuments:i().length})),t),a=c=>O(c)?x(n,c,()=>{let l=Ne(o.config.projectRoot,c);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&&X(p,d)),d)return{project:f,sourceFile:d}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:i}}function qe(o,e,n){let t=e.map(({project:r})=>{let i=new Map;for(let s of r.getSourceFiles())X(i,s);return{project:r,sourceFiles:i}});for(let r of n){let i=Ne(o,r);if(i)for(let s of t){if(s.sourceFiles.has(i))break;let a=s.project.addSourceFileAtPathIfExists(i)??null;if(a){X(s.sourceFiles,a);break}}}return t}function X(o,e){let n=Q(e.getFilePath());o.set(n,e);try{o.set(Q(Ve(n)),e)}catch(t){if(!K(t))throw t}}function Ne(o,e){try{return Q(re(o,e,{inputKind:"indexed TypeScript source file"}).absolutePath)}catch(n){if(!K(n))throw n;return null}}function Q(o){return ze.resolve(o)}function Z(o,e){for(let n of o)if(e===n.name||e.startsWith(`${n.name}/`))return n.name;return null}function Ce(o){let e=`${o.relativeDir}/src`;return[`${e}/index.ts`,`${e}/index.tsx`,`${e}/index.mts`,`${e}/index.cts`]}var Ye=32;function tn(o,e){let n=I("typescript.provider.load",()=>pe());if(!n)return U("ts-morph is not installed");let t=I("typescript.provider.tsconfig-discovery",()=>ge(o));if(t.length===0)return U("no tsconfig found");try{let r=I("typescript.provider.project-bundles",()=>de(n,t),()=>({tsconfigs:t.length}));return Ge(o,n,r)}catch(r){return U(r instanceof Error?r.message:String(r),t[0],t)}}function Ge(o,e,n,t={}){return I("typescript.provider.construct",()=>new ee(o,e,n),()=>({tsconfigs:n.length,reusedProjects:t.reusedProjects===!0}))}var ee=class{constructor(e,n,t){this.db=e;this.tsMorph=n;this.projects=t;this.workspacePackages=ce(e.config.projectRoot),this.sourceFiles=Re(e,t)}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(e=>e.tsconfigPath)}}importUsage(e){return x(this.importUsageCache,e,()=>{let n=this.sourceFiles.sourceFile(e);if(!n)return[];let t=Xe();return I("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,n,t),()=>({file:e,...t}))})}referencesFor(e){return x(this.referencesCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,n)})}referencesForDefinitions(e,n={}){let t=new Map,r=j(),i=[];for(let f of e){let p=this.referencesCache.get(f.symbolId);p?t.set(f.symbolId,p):i.push(f)}if(i.length===0)return t;let s=i,a=n.exact?[]:i.filter(f=>!Pe(f));if(a.length>=Ye){let f=this.referencesForDefinitionsBySymbolScan(a);for(let p of a){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),t.set(p.symbolId,d)}if(s=i.filter(p=>Pe(p)),s.length===0)return t}let c=new Map;for(let f of s){let p=c.get(f.relativePath);p?p.push(f):c.set(f.relativePath,[f])}let l=[];for(let[f,p]of c){let d=Le();I("typescript.references-map.file",()=>{let S=this.definitionNodesForFile(f);for(let y of p){r&&(d.cacheMisses+=1);let h=S.get(y.symbolId)??null;r&&(h?d.nodeHits+=1:d.nodeMisses+=1);try{let u=this.referencesForDefinitionNode(y,h,r?d:void 0);this.referencesCache.set(y.symbolId,u),t.set(y.symbolId,u)}catch{d.preciseSearchFailures+=1,l.push(y)}}},()=>({relativePath:f,definitions:p.length,...Ee(d)}))}if(l.length>0){let f=this.referencesForDefinitionsBySymbolScan(l);for(let p of l){let d=f.get(p.symbolId)??[];this.referencesCache.set(p.symbolId,d),t.set(p.symbolId,d)}}return t}referenceFragmentsForFiles(e){let n=ye(this.db).filter(i=>O(i.relativePath)),t=e.filter(i=>this.sourceFiles.sourceFile(i)!==null),r=this.referencesForDefinitionsBySymbolScan(n,t);return ue(n,r,t)}referencesForDefinitionsBySymbolScan(e,n){let t=j(),r=Le(),i=new Map,s=new Set(e.map(c=>c.symbolId)),a=new Map(e.map(c=>[c.symbolId,c]));for(let c of e)i.set(c.symbolId,[]);return I("typescript.references-map.inverted-scan",()=>{let c=t?m.now():0,l=n?this.packageImportReferencesForFiles(n):this.packageImportReferences();for(let u of e){let g=l.get(u.symbolId)??[];if(g.length>0){let T=i.get(u.symbolId)??[];T.push(...g),i.set(u.symbolId,T)}t&&(r.packageReferenceCount+=g.length)}t&&(r.packageRefsMs+=m.now()-c);let f=new Map,p=new Map,d=this.hierarchyTargetsForDefinitions(e),S=new Set(e.map(u=>u.leaf).filter(Boolean)),y=t?m.now():0;for(let u of n??this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(u))continue;let g=this.sourceFiles.sourceFile(u);g&&(t&&(r.scanFiles+=1),this.addReferencesFromSourceFileScan(g,u,s,a,d,S,f,p,i,t?r:void 0))}t&&(r.scanMs+=m.now()-y);let h=t?m.now():0;this.addHierarchyMemberReferences(e,i,t?r:void 0),t&&(r.hierarchyMs+=m.now()-h);for(let[u,g]of i){let T=P(g);i.set(u,T),t&&(r.referenceCount+=T.length)}},()=>({definitions:e.length,...Ee(r)})),i}addReferencesFromSourceFileScan(e,n,t,r,i,s,a,c,l,f){let p=this.compilerCheckerForSourceFile(e),d=e.compilerNode,S=et(e),y=h=>{if(this.tsMorph.ts.isIdentifier(h)){if(f&&(f.identifiers+=1),!s.has(h.text)&&!S.has(h.text)){this.tsMorph.ts.forEachChild(h,y);return}let u=this.compilerReferenceSymbol(p,h,f);if(u){let g;a.has(u)?g=a.get(u)??null:(g=this.referenceDefinitionFromCompilerSymbol(u),a.set(u,g)),f&&(g?f.targetHits+=1:f.targetMisses+=1);let T=x(c,u,()=>this.compilerSymbolKeys(u)),N=null,k=null,C=g&&t.has(g.symbolId)?r.get(g.symbolId):void 0;if(C&&(N=$(d,h),!ve(C,n,N))){let R=d.getLineAndCharacterOfPosition(h.getStart(d));k={file:n,line:R.line,column:R.character};let D=l.get(C.symbolId)??[];D.push(k),l.set(C.symbolId,D),f&&(f.requestedHits+=1)}for(let R of T)for(let D of i.get(R)?.values()??[]){if(N??=$(d,h),ve(D,n,N))continue;if(!k){let F=d.getLineAndCharacterOfPosition(h.getStart(d));k={file:n,line:F.line,column:F.character}}let M=l.get(D.symbolId)??[];M.push(k),l.set(D.symbolId,M),f&&(f.requestedHits+=1)}}}this.tsMorph.ts.forEachChild(h,y)};y(d)}hierarchyTargetsMemo=null;hierarchyTargetsForDefinitions(e){let n=ot(e);if(this.hierarchyTargetsMemo?.key===n)return this.hierarchyTargetsMemo.targets;let t=oe(this.db),r=`definitions:${n}`,i=!1,s=I("typescript.references-map.hierarchy-targets",()=>{if(t){let c=we.read(this.db,r,t);if(c&&c.projectRoot===this.db.config.projectRoot)return i=!0,it(c,e)}let a=this.computeHierarchyTargets(e);return t&&we.write(this.db,r,t,{version:Ae,projectRoot:this.db.config.projectRoot,entries:[...a].map(([c,l])=>[c,[...l.values()].map(f=>f.symbol)])}),a},()=>({definitions:e.length,hit:i}));return this.hierarchyTargetsMemo={key:n,targets:s},s}computeHierarchyTargets(e){let n=new Map;for(let t of e){let r=this.nodeForDefinition(t),i=r?.compilerNode;if(!i||!this.isHierarchyMethod(i))continue;let s=i.parent;if(!this.isHierarchyContainer(s))continue;let a=this.compilerCheckerForSourceFile(r.getSourceFile()),c=a.getSymbolAtLocation(i.name);if(c)for(let l of this.hierarchyMemberSymbols(a,s,c))for(let f of this.compilerSymbolKeys(l)){let p=n.get(f)??new Map;p.set(t.symbolId,t),n.set(f,p)}}return n}hierarchyMemberSymbols(e,n,t){let r=new Set,i=new Set,s=(a,c,l)=>{if(!i.has(a)){i.add(a),r.add(c);for(let f of l){let p=f.getProperty(t.name);p&&s(f,p,this.hierarchyAncestorTypesForType(e,f))}}};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),r}addHierarchyMemberReferences(e,n,t){let r=new Map;for(let i of e){let s=this.nodeForDefinition(i),a=s?.compilerNode;if(!a||!this.isHierarchyMethod(a))continue;let c=a.parent;if(!this.isHierarchyContainer(c))continue;let l=this.compilerCheckerForSourceFile(s.getSourceFile()),f=l.getSymbolAtLocation(a.name);if(!f)continue;let p=a.getSourceFile(),d=p.getLineAndCharacterOfPosition(a.name.getStart(p)),S={definition:i,location:{file:i.relativePath,line:d.line,column:d.character}},y=n.get(i.symbolId)??[];for(let u of this.hierarchyMemberSymbols(l,c,f))if(u!==f)for(let g of this.compilerSymbolLocations(u))y.push(g),t&&(t.hierarchyReferences+=1);n.set(i.symbolId,y);let h=this.hierarchyRootMemberSymbols(l,c,f);for(let u of h){let g=r.get(u)??new Map;g.set(i.symbolId,S),r.set(u,g)}t&&(t.hierarchyDefinitions+=1)}for(let i of r.values())if(!(i.size<2)){t&&(t.hierarchyFamilies+=1);for(let{definition:s}of i.values()){let a=n.get(s.symbolId)??[];for(let c of i.values())c.definition.symbolId!==s.symbolId&&(a.push(c.location),t&&(t.hierarchyReferences+=1));n.set(s.symbolId,a)}}}hierarchyRootMemberSymbols(e,n,t){let r=new Set,i=new Set,s=(a,c,l)=>{if(i.has(a))return;i.add(a);let f=!1;for(let p of l){let d=p.getProperty(t.name);d&&(f=!0,s(p,d,this.hierarchyAncestorTypesForType(e,p)))}if(!f)for(let p of this.compilerSymbolKeys(c))r.add(p)};return s(e.getTypeAtLocation(n),t,this.hierarchyAncestorTypes(e,n)),r}compilerSymbolKeys(e){return(e.declarations??[]).map(n=>{let t=n.getSourceFile();return`${t.fileName}\0${n.getStart(t)}\0${e.name}`})}compilerSymbolLocations(e){let n=[];for(let t of e.declarations??[]){let r=t.getSourceFile(),i=L(this.db.config.projectRoot,r.fileName);if(!i)continue;let s=t.name,a=r.getLineAndCharacterOfPosition((s??t).getStart(r));n.push({file:i,line:a.line,column:a.character})}return n}baseTypes(e,n){try{return e.getBaseTypes(n)??[]}catch{return[]}}hierarchyAncestorTypes(e,n){let t=new Set(this.hierarchyAncestorTypesForType(e,e.getTypeAtLocation(n)));for(let r of n.heritageClauses??[])for(let i of r.types)t.add(e.getTypeAtLocation(i));return[...t]}hierarchyAncestorTypesForType(e,n){let t=new Set(this.baseTypes(e,n));for(let r of n.getSymbol()?.declarations??[])if(this.isHierarchyContainer(r))for(let i of r.heritageClauses??[])for(let s of i.types)t.add(e.getTypeAtLocation(s));return[...t]}isHierarchyMethod(e){return this.tsMorph.ts.isMethodDeclaration(e)||this.tsMorph.ts.isMethodSignature(e)}isHierarchyContainer(e){return this.tsMorph.ts.isClassDeclaration(e)||this.tsMorph.ts.isClassExpression(e)||this.tsMorph.ts.isInterfaceDeclaration(e)}compilerReferenceSymbol(e,n,t){t&&(t.symbolLookups+=1);let r=e.getSymbolAtLocation(n);if(r){if((r.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return r;try{return t&&(t.aliasResolutions+=1),e.getAliasedSymbol(r)}catch{return r}}}calleesFor(e){return x(this.calleesCache,e.symbolId,()=>x(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}calleesForDefinitions(e){let n=new Map,t=new Map;for(let r of e){let i=t.get(r.relativePath);i?i.push(r):t.set(r.relativePath,[r])}for(let[r,i]of t){let s=this.fileCalleesCache.get(r),a=new Set(i.map(l=>l.symbolId)),c=s??this.calleeMapForFile(r,a);for(let l of i){let f=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,f),n.set(l.symbolId,f)}}return n}referencesForDefinitionNode(e,n,t){let r=t?m.now():0,i=this.packageImportReferencesForDefinition(e);if(t&&(t.packageRefsMs+=m.now()-r,t.packageReferenceCount+=i.length),!n)return i;let s=t?m.now():0,a=Ie(n,e,i,this.db.config.projectRoot);return t&&(t.semanticRefsMs+=m.now()-s,t.referenceCount+=a.length),a}signatureFor(e){return x(this.signatureCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);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 t=n.getType().getCallSignatures()[0];if(!t)return null;let r=t.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return je(c)}),i=t.getReturnType().getText(n);return`(${r.join(",")})=>${je(i)}`})}importUsageForSourceFile(e,n,t){let r=[],i=new Map;for(let s of n.getImportDeclarations()){t.declarations+=1;let a=_(this.db,e,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let l of te(s)){t.entries+=1;let f=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(f?t.bindingSymbols+=1:t.missingBindingSymbols+=1);let p={sourcePath:a,entry:l,typeOnlyDeclaration:c,bindingSymbol:f,references:[]};if(r.push(p),c||!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 a=i.get(s.getText());if(!a||Qe(s))return;t.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(t.symbolLookups+=1,!!c){for(let l of a)if(l.bindingSymbol===c){l.references.push({location:B(s,this.db.config.projectRoot),node:s}),t.matchedReferences+=1;break}}}),r.map(s=>s.typeOnlyDeclaration?Je(e,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(t.fallbackEntries+=1,this.valueImportUsageForEntry(e,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(e,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(e,n,t){let r=t.identifier?t.identifier.findReferences():[],i=[];for(let s of r)for(let a of xe(s,e,t.identifier,this.db.config.projectRoot))i.push(a);return this.valueImportUsageFromLocations(e,n,t,i)}valueImportUsageFromLocations(e,n,t,r){let i=r.some(c=>!V(c.node)),s=r.some(c=>V(c.node)),a=t.isTypeOnly;return{importer:e,sourcePath:n,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:a,isUsed:a||r.length>0,isTypeUsed:a||s,isValueUsed:i,references:r.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferencesForFiles(e){let n=new Map,t=new Set;for(let i of e){let s=this.sourceFiles.sourceFile(i);if(s)for(let a of s.getImportDeclarations()){let c=Z(this.workspacePackages,a.getModuleSpecifierValue());c&&t.add(c)}}if(t.size===0)return n;let r=this.packageExportsForNames(t);for(let i of e)this.addPackageImportReferencesForDocument(n,r,i);for(let[i,s]of n)n.set(i,P(s));return n}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,n=this.packageExports();for(let t of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,n,t);for(let[t,r]of e)e.set(t,P(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,n,t){if(this.db.isIgnored(t))return;let r=this.sourceFiles.sourceFileMatch(t);if(r)for(let i of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,n,t,i)}addPackageImportReferencesForDeclaration(e,n,t,r){let i=Z(this.workspacePackages,r.getModuleSpecifierValue());if(!i)return;let s=n.get(i);if(s)for(let a of te(r)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=Fe(a.identifier,t,this.db.config.projectRoot);l.length>0&&st(e,c,l)}}packageExports(){return this.packageExportIndex?this.packageExportIndex:(this.packageExportIndex=this.packageExportsForNames(new Set(this.workspacePackages.map(e=>e.name))),this.packageExportIndex)}packageExportsForNames(e){let n=new Map;for(let t of this.workspacePackages){if(!e.has(t.name))continue;let r=new Map;for(let i of Ce(t))this.collectPackageExports(t,i,r,new Set);r.size>0&&n.set(t.name,r)}return n}collectPackageExports(e,n,t,r){if(r.has(n))return;r.add(n);let i=this.sourceFiles.sourceFile(n);if(i)for(let s of i.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?_(this.db,n,a):n;if(!c||!c.startsWith(`${e.relativeDir}/src/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,t,r);continue}for(let f of l){let p=f.getNameNode().getText(),d=f.getAliasNode()?.getText()??p,S=this.indexedDefinitionByLeaf(c,p);if(!S)continue;let y=t.get(d);y||(y=new Set,t.set(d,y)),y.add(S.symbolId)}}}indexedDefinitionByLeaf(e,n){return x(this.indexedDefinitionLeafCache,e,()=>De(this.db,e)).get(n)??null}nodeForDefinition(e){return x(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return x(this.fileDefinitionNodeCache,e,()=>{let n=this.sourceFiles.sourceFile(e);return n?Te(this.tsMorph,this.db,n,e):new Map})}referenceDefinitionFromCompilerSymbol(e){return this.definitionFromCompilerSymbol(e,void 0,!0)}definitionFromCompilerSymbol(e,n,t=!1){let r=e.name,i=n?m.now():0,s=e.declarations??[];n&&(n.declarationsMs+=m.now()-i,n.declarationChecks+=s.length);for(let a of s){let c=n?m.now():0,l=a.getSourceFile(),f=L(this.db.config.projectRoot,l.fileName),p=l.getLineAndCharacterOfPosition(a.getStart(l)).line;if(n&&(n.declarationLocationMs+=m.now()-c),!f||this.db.isIgnored(f))continue;let d=n?m.now():0,S=this.compilerDeclarationName(a),y=t?G(this.db,f,p,r)??(S&&S!==r?G(this.db,f,p,S):null):ke(this.db,f,p,r);if(n&&(n.indexedLookupMs+=m.now()-d),y)return{symbolId:y.symbolId,symbol:y.symbol,file:y.relativePath,line:y.startLine}}return null}compilerDeclarationName(e){let n=e.name;return n&&this.tsMorph.ts.isIdentifier(n)?n.text:null}calleeMapForFile(e,n){let t=j(),r=0,i=0,s=0,a=0,c=0,l=0,f=0,p=0,d=t?nt():void 0;return I("typescript.callee-map.file",()=>{let S=t?m.now():0,y=this.sourceFiles.sourceFile(e);if(t&&(c=Math.round(m.now()-S)),!y)return new Map;let h=t?m.now():0,u=v(this.db,e).sort((M,F)=>M.startLine-F.startLine||F.endLine-M.endLine);if(t&&(l=Math.round(m.now()-h)),r=u.length,u.length===0)return new Map;let g=new Map,T=t?m.now():0,N=this.compilerCheckerForSourceFile(y),k=y.compilerNode;t&&(f=Math.round(m.now()-T));let C=new Map,R=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){t&&(i+=1);let F=this.semanticCalleeForCallNode(N,k,u,M,C,n,d);F&&(t&&(s+=1),Ze(g,F.callerId,F.target))}this.tsMorph.ts.forEachChild(M,R)},D=t?m.now():0;R(k),t&&(p=Math.round(m.now()-D));for(let[M,F]of g)g.set(M,at(F));return a=g.size,g},()=>({relativePath:e,definitions:r,callNodes:i,resolvedCallees:s,outputRows:a,requestedDefinitions:n?.size??r,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:f,traversalMs:p,...d?rt(d):{}}))}semanticCalleeForCallNode(e,n,t,r,i,s,a){let c=a?m.now():0,l=tt(t,$(n,r));if(a&&(a.callerLookupMs+=m.now()-c),!l)return null;if(s&&!s.has(l.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let f=r.expression,p=this.compilerSymbolForExpression(e,f,a),d=null;if(p)if(a&&(a.targetSymbolHits+=1),i.has(p))a&&(a.compilerSymbolCacheHits+=1),d=i.get(p)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let S=a?m.now():0;d=this.definitionFromCompilerSymbol(p,a),a&&(a.targetLookupMs+=m.now()-S),i.set(p,d)}else a&&(a.targetMisses+=1);return d?{callerId:l.symbolId,target:{symbol:d.symbol,file:d.file,line:d.line,callsiteLine:$(n,r)}}:null}compilerSymbolForExpression(e,n,t){let r=t?m.now():0,i=e.getSymbolAtLocation(n);if(t&&(t.expressionSymbolMs+=m.now()-r),i)return i;t&&(t.typeFallbacks+=1);let s=t?m.now():0,a=e.getTypeAtLocation(n).getSymbol();return t&&(t.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(e){let n=e.getProject(),t=this.compilerCheckerCache.get(n);return t||(t=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,t)),t}};function te(o){let e=[],n=o.getDefaultImport();n&&e.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:o.getImportClause()?.isTypeOnly()??!1});let t=o.getNamespaceImport();t&&e.push({identifier:t,importedName:"*",localName:t.getText(),kind:"namespace",isTypeOnly:o.getImportClause()?.isTypeOnly()??!1});for(let r of o.getNamedImports()){let i=r.getNameNode(),a=r.getAliasNode()??(i.getKindName()==="Identifier"?i:null);e.push({identifier:a,importedName:i.getText(),localName:a?.getText()??i.getText(),kind:"named",isTypeOnly:r.isTypeOnly()||(o.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Je(o,e,n){return{importer:o,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function Xe(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function Qe(o){for(let e=o;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function Ze(o,e,n){let t=o.get(e);t||(t=[],o.set(e,t)),t.push(n)}function et(o){let e=new Set;for(let n of o.getImportDeclarations())for(let t of te(n))t.localName&&e.add(t.localName);return e}function tt(o,e){let n=null;for(let t of o)e<t.startLine||e>t.endLine||(!n||t.startLine>=n.startLine)&&(n=t);return n}function $(o,e){return o.getLineAndCharacterOfPosition(e.getStart(o)).line}function ve(o,e,n){return e===o.relativePath&&n>=o.startLine&&n<=o.endLine}function Pe(o){return o.symbol.includes("#")?me(o.symbol)==="type"&&o.relativePath.endsWith(".d.ts"):!1}function nt(){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 rt(o){return{...o,callerLookupMs:Math.round(o.callerLookupMs),expressionSymbolMs:Math.round(o.expressionSymbolMs),typeSymbolMs:Math.round(o.typeSymbolMs),targetLookupMs:Math.round(o.targetLookupMs),declarationsMs:Math.round(o.declarationsMs),declarationLocationMs:Math.round(o.declarationLocationMs),indexedLookupMs:Math.round(o.indexedLookupMs)}}function Le(){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}}var Ae=1,we=se({kind:"typescript-hierarchy-targets",invalidation:ae("typescript-hierarchy-targets"),serialize:o=>JSON.stringify(o),deserialize:o=>{try{let e=JSON.parse(o);return e.version!==Ae||typeof e.projectRoot!="string"||!Array.isArray(e.entries)?null:e}catch{return null}}});function it(o,e){let n=new Map(e.map(r=>[r.symbol,r])),t=new Map;for(let[r,i]of o.entries){let s=new Map;for(let a of i){let c=n.get(a);c&&s.set(c.symbolId,c)}s.size>0&&t.set(r,s)}return t}function ot(o){let e=2166136261;for(let n of o)e^=n.symbolId,e=Math.imul(e,16777619)>>>0;return`${o.length}:${e.toString(16)}`}function Ee(o){return{...o,scanMs:Math.round(o.scanMs),packageRefsMs:Math.round(o.packageRefsMs),semanticRefsMs:Math.round(o.semanticRefsMs),hierarchyMs:Math.round(o.hierarchyMs)}}function st(o,e,n){for(let t of e){let r=o.get(t)??[];r.push(...n),o.set(t,r)}}function at(o){let e=new Set,n=[];for(let t of o){let r=`${t.symbol}|${t.file}|${t.line}|${t.callsiteLine??""}`;e.has(r)||(e.add(r),n.push(t))}return n}function je(o){return o.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}export{ge as a,tn as b,Ge as c};
|
|
3
|
-
//# sourceMappingURL=chunk-WK46TNUM.js.map
|
package/dist/chunk-WNTFFKAX.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{c as Re,f as ir,g as te,h as or,i as Y,j as ar,k as Ae,l as it,m as L,n as sr,p as cr,q as ne,r as Le,s as De,v as z,w as ie}from"./chunk-5ENOG4VP.js";import{c as tr,d as rr,e as ve,f as Te,i as Pe,j as C,k as ke,m as yr,n as hr,o as Sr}from"./chunk-TRNAEQ6P.js";import{h as M,y as oe}from"./chunk-JWTGMPIT.js";import{C as T,D as ee,E as R,F as xe,G as rt,H as v,I as P,Ia as at,J as _,N as er,O as we,P as nr,Q as nt,S as Ee,T as $,U as re,V as dr,W as lr,b as Qe,f as Ze,g as Yt,i as Kt,j as Xt,k as Ie,la as ur,na as fr,o as Qt,oa as pr,pa as gr,q as et,qa as mr,ta as ot,u as N,v as tt,x as Zt}from"./chunk-N5B2NILC.js";import{spawn as ni}from"child_process";import{platform as br}from"os";import{performance as Ir}from"perf_hooks";var bs={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},se=class extends Error{constructor(r,n,i,o={}){super(i,o.cause===void 0?void 0:{cause:o.cause});this.kind=r;this.label=n;this.name="BoundedProcessError",this.timedOut=o.timedOut??!1,this.reaped=o.reaped??!1,this.stdout=o.stdout??"",this.stderr=o.stderr??"",this.stdoutTruncated=o.stdoutTruncated??!1,this.stderrTruncated=o.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function ae(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function xr(e,t,r,n){let i=Math.max(0,n-r);i>0&&e.push(t.subarray(0,i))}function wr(e,t,r){let n=Buffer.concat([...e,t]);e.length=0,e.push(n.subarray(Math.max(0,n.length-r)))}function Is(e){ae(e.timeoutMs,"timeoutMs"),ae(e.maxStdoutBytes,"maxStdoutBytes"),ae(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;ae(t,"terminationGraceMs");let r=e.terminationForceMs??t;return ae(r,"terminationForceMs"),new Promise((n,i)=>{let o=Ir.now(),a=br()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",s=br()!=="win32"&&!a,c;try{c=ni(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:s?!0:e.detached,stdio:["pipe","pipe","pipe"]})}catch(S){let w=S instanceof Error?S.message:String(S);i(new se("spawn",e.label,`${e.label} could not start: ${w}`,{cause:S,reaped:!0}));return}let d=[],l=[],p=0,u=0,b=!1,g=!1,h=null,y=!1,k=c.pid===void 0?null:hr(c.pid,s),F=()=>{clearTimeout(Ht),e.signal?.removeEventListener("abort",Ye)},He=S=>{if(y||!h)return;y=!0,F();let w=Buffer.concat(d).toString("utf8"),Ke=Buffer.concat(l).toString("utf8"),Xe=S.reaped||!S.detail?"":` Process-tree cleanup failed: ${S.detail}`;i(new se(h.kind,e.label,`${h.message}${Xe}`,{timedOut:h.timedOut,reaped:S.reaped,stdout:w,stderr:Ke,stdoutTruncated:b,stderrTruncated:g}))},Z=S=>{if(!(h||y)){if(h=S,!k){He({reaped:c.pid===void 0,reason:c.pid===void 0?"terminated":"identity-unavailable"});return}Sr(k,{gracefulMs:t,forceMs:r}).then(He,w=>{He({reaped:!1,reason:"signal-failed",detail:w instanceof Error?w.message:String(w)})})}},Ht=setTimeout(()=>{Z({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);Ht.unref();let Ye=()=>{Z({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",Ye,{once:!0}),e.signal?.aborted&&Ye(),c.stdout.on("data",S=>{let w=Buffer.isBuffer(S)?S:Buffer.from(S);e.outputLimitBehavior==="truncate-tail"?wr(d,w,e.maxStdoutBytes):xr(d,w,p,e.maxStdoutBytes),p+=w.length,p>e.maxStdoutBytes&&(b=!0,e.outputLimitBehavior!=="truncate-tail"&&Z({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),c.stderr.on("data",S=>{let w=Buffer.isBuffer(S)?S:Buffer.from(S);e.outputLimitBehavior==="truncate-tail"?wr(l,w,e.maxStderrBytes):xr(l,w,u,e.maxStderrBytes),u+=w.length,u>e.maxStderrBytes&&(g=!0,e.outputLimitBehavior!=="truncate-tail"&&Z({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),c.on("error",S=>{if(!y&&!h){if(c.pid===void 0){F(),y=!0,i(new se("spawn",e.label,`${e.label} could not start: ${S.message}`,{cause:S,reaped:!0}));return}Z({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${S.message}`})}}),c.on("close",(S,w)=>{if(y||h)return;y=!0,F();let Ke=Buffer.concat(d).toString("utf8"),Xe=Buffer.concat(l).toString("utf8");n({status:S,signal:w,stdout:Ke,stderr:Xe,timedOut:!1,durationMs:Ir.now()-o,stdoutTruncated:b,stderrTruncated:g})}),e.input===void 0?c.stdin.end():c.stdin.end(e.input)})}import{execFileSync as Be}from"child_process";import{createRequire as wi}from"module";import{chmodSync as vi,existsSync as Dr}from"fs";import{platform as j,arch as Ge}from"os";import{dirname as Ri,join as kr}from"path";import{createHash as Er,randomUUID as ii}from"crypto";import{closeSync as Ce,createReadStream as oi,existsSync as ai,fsyncSync as si,mkdirSync as ci,openSync as ct,renameSync as di,unlinkSync as li,writeSync as ui}from"fs";import{homedir as fi}from"os";import{dirname as Tr,join as st}from"path";var pi=3e5,gi=256*1024*1024;function Pr(e,t=process.env){let r=t.SCIP_QUERY_CACHE_DIR??(t.XDG_CACHE_HOME?st(t.XDG_CACHE_HOME,"scip-query"):st(fi(),".cache","scip-query"));return st(r,e)}var x=class extends Error{constructor(r,n,i={}){super(n,i.cause===void 0?void 0:{cause:i.cause});this.kind=r;this.name="VerifiedBinaryFetchError"}kind};async function Ar(e){let{cachePath:t,url:r,expectedSha256:n}=e,i=e.timeoutMs??pi,o=e.maxBytes??gi,a=e.lockWaitMs??i;mi(i,o,a);let s=yi(r,i,e.signal);try{let c=await vr(t,n,o,s.controller.signal);if(c)return{status:"cached",path:t,sha256:c};ci(Tr(t),{recursive:!0});let d=await or(`${t}.fetch.lock`,{waitMs:a,pollMs:25,signal:s.controller.signal});if(!d)throw new x("lock-timeout",`timed out waiting ${a}ms for verified binary cache ownership at ${t}`);try{let l=await vr(t,n,o,s.controller.signal);return l?{status:"cached",path:t,sha256:l}:await hi(e,s.controller,o)}finally{d.release()}}catch(c){throw s.controller.signal.aborted?K(s.controller.signal,r):c instanceof x?c:new x("stream",`failed to download ${r}: ${Lr(c)}`,{cause:c})}finally{clearTimeout(s.timeout),s.detachExternalAbort(),s.controller.signal.aborted||s.controller.abort()}}function mi(e,t,r){if(!Number.isFinite(e)||e<=0)throw new TypeError("timeoutMs must be a positive finite number.");if(!Number.isSafeInteger(t)||t<=0)throw new TypeError("maxBytes must be a positive safe integer.");if(!Number.isFinite(r)||r<0)throw new TypeError("lockWaitMs must be a non-negative finite number.")}function yi(e,t,r){let n=new AbortController,i=()=>{n.abort(new x("aborted",`download of ${e} was aborted`,{cause:r?.reason}))};r?.addEventListener("abort",i,{once:!0}),r?.aborted&&i();let o=setTimeout(()=>{n.abort(new x("timeout",`download of ${e} timed out after ${t}ms`))},t);return o.unref(),{controller:n,timeout:o,detachExternalAbort:()=>r?.removeEventListener("abort",i)}}async function vr(e,t,r,n){if(!ai(e))return null;let i=Er("sha256"),o=0;try{for await(let s of oi(e,{signal:n})){let c=Buffer.isBuffer(s)?s:Buffer.from(s);if(o+=c.length,o>r)return null;i.update(c)}}catch{if(n.aborted)throw K(n,e);return null}let a=i.digest("hex");return a===t?a:null}async function hi(e,t,r){let n=e.fetchImpl??fetch,i;try{i=await Rr(n(e.url,{signal:t.signal}),t.signal)}catch(d){throw t.signal.aborted?K(t.signal,e.url):new x("stream",`failed to download ${e.url}: ${Lr(d)}`,{cause:d})}if(!i.ok){let d=new x("http",`failed to download ${e.url}: HTTP ${i.status}`);throw t.abort(d),d}let o=Si(i,r,e.url);if(!i.body)throw new x("stream",`downloaded ${e.url} response has no readable body`);let a=`${e.cachePath}.tmp-${process.pid}-${ii()}`,s,c=!1;try{s=ct(a,"wx",384),c=!0;let d=i.body.getReader(),l=Er("sha256"),p=0;for(;;){let{done:b,value:g}=await Rr(d.read(),t.signal);if(b)break;if(!(g instanceof Uint8Array))throw new x("stream",`downloaded ${e.url} produced a non-byte stream chunk`);if(p+=g.byteLength,p>r||o!==void 0&&p>o){let y=new x("length",`downloaded ${e.url} exceeded its ${o??r} byte limit`);throw t.abort(y),y}let h=Buffer.from(g.buffer,g.byteOffset,g.byteLength);l.update(h),nr(s,h,{writeFile:e.writeImpl??ui},"verified binary staging")}if(o!==void 0&&p!==o)throw new x("length",`downloaded ${e.url} length mismatch: declared ${o} bytes, received ${p}`);let u=l.digest("hex");if(u!==e.expectedSha256)throw new x("checksum",`downloaded ${e.url} checksum mismatch: expected ${e.expectedSha256}, got ${u}`);Ce(s),s=void 0;try{bi(a,e.cachePath,e.renameImpl??di,e.syncImpl??si)}catch(b){throw new x("install",`failed to install verified binary at ${e.cachePath}`,{cause:b})}return c=!1,{status:"downloaded",path:e.cachePath,sha256:u}}catch(d){throw t.signal.aborted?K(t.signal,e.url):d instanceof x?d:new x("install",`failed to stage verified binary at ${e.cachePath}`,{cause:d})}finally{if(s!==void 0)try{Ce(s)}catch{}if(c)try{li(a)}catch{}}}function Si(e,t,r){let n=e.headers?.get("content-length");if(n==null)return;if(!/^\d+$/.test(n))throw new x("length",`downloaded ${r} has an invalid Content-Length header`);let i=Number(n);if(!Number.isSafeInteger(i)||i<0)throw new x("length",`downloaded ${r} has an invalid Content-Length header`);if(i>t)throw new x("length",`downloaded ${r} declares ${i} bytes, above the ${t} byte limit`);return i}function bi(e,t,r,n){Ii(e,n),r(e,t),xi(Tr(t),n)}function Ii(e,t){let r=ct(e,"r");try{t(r)}finally{Ce(r)}}function xi(e,t){let r;try{r=ct(e,"r")}catch(n){if(nt(n,process.platform))return;throw n}try{t(r)}catch(n){if(!nt(n,process.platform))throw n}finally{Ce(r)}}function Rr(e,t){return t.aborted?Promise.reject(K(t,"operation")):new Promise((r,n)=>{let i=()=>{t.removeEventListener("abort",i),n(K(t,"operation"))};t.addEventListener("abort",i,{once:!0}),e.then(o=>{t.removeEventListener("abort",i),r(o)},o=>{t.removeEventListener("abort",i),n(o)})})}function K(e,t){return e.reason instanceof Error?e.reason:new x("aborted",`verified binary operation for ${t} was aborted`)}function Lr(e){return e instanceof Error?e.message:String(e)}var E="v0.8.1",dt="https://github.com/sourcegraph/scip",Oe=`github.com/sourcegraph/scip/cmd/scip@${E}`,Cr=wi(import.meta.url),Ei={"scip-darwin-amd64.tar.gz":"39f18be957d350bcd9ed5cb12d7781b0e237a5cb2429a107feaf9ce2d1dcd5d5","scip-darwin-arm64.tar.gz":"5b3f4a2fb1dc10c599cb3422ed0406a739060e4ac0b1222c0f43630dd0dd8221","scip-linux-amd64.tar.gz":"16b79ed98f893abd530cfa63f333527f1351008b4a23e02b9e522e34d1da6596","scip-linux-arm64.tar.gz":"876dfb680119dd6e5713077c49b27701102d598bdeba94c809173276d399c7e2"},Or="SCIP_QUERY_SCIP_BIN";function _s(e=process.env){return e.SCIP_QUERY_SQLITE_CONVERTER==="scip-cli"}function Ti(e){let t=e.env[Or];if(t&&e.fileExists(t))return{source:"env",path:t};let r=e.resolveCached?.()??null;if(r)return{source:"cache",path:r};if(e.isOnPath("scip"))return{source:"path",path:"scip"};if(e.platform==="win32"){let n=e.resolveSidecar(e.arch);if(n&&e.fileExists(n))return{source:"sidecar",path:n}}return null}function Pi(e){for(let t of e==="arm64"?["arm64","x64"]:[e])try{return Cr.resolve(`scip-query-scip-windows/scip-win32-${t}.exe`)}catch{}return null}function lt(e=process.env){return Ai(e)?.path??null}function Ai(e=process.env){let t=Ti({platform:j(),arch:Ge(),env:e,isOnPath:ke,fileExists:Dr,resolveSidecar:Pi,resolveCached:()=>Li(e)});return t?.source==="path"?{source:"path",path:yr("scip")??t.path}:t}function Br(e=process.env){return Pr(kr("scip",E,"scip"),e)}function Li(e){let t=Br(e);return Dr(t)?t:null}function Di(e){return e!==null&&e.includes(E.replace(/^v/,""))}function Ms(){return lt()!==null}function ki(){let e=lt();if(!e)return null;try{return Be(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}function Ci(e=j(),t=Ge()){let r=Gr(e,t);if(!r)return null;let n=Ei[r.filename];return n?{...r,sha256:n}:null}function Gr(e=j(),t=Ge()){let r,n,i;switch(e){case"darwin":r="darwin",i="tar.gz";break;case"linux":r="linux",i="tar.gz";break;default:return null}switch(t){case"arm64":n="arm64";break;case"x64":n="amd64";break;default:return null}let o=`scip-${r}-${n}.${i}`;return{url:`${dt}/releases/download/${E}/${o}`,filename:o}}function Fs(){let e=Gr();if(console.log("\nThe `scip` CLI is required but not found on PATH.\n"),j()==="darwin"||j()==="linux")console.log(`Let scip-query install the reviewed release (${E}, digest-verified) into its cache:`),console.log(` scip-query setup --install-missing
|
|
2
|
-
`),console.log("Or install it with Go:"),console.log(` go install ${Oe}
|
|
3
|
-
`),console.log("Or download that exact release manually:");else if(j()==="win32"){let t=Oi();console.log("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(` npm install -g ${t}`),console.log(`Or set ${Or} to a local scip.exe path.
|
|
4
|
-
`),console.log("Upstream release page:")}else console.log("Download from:");console.log(e?` ${e.url}
|
|
5
|
-
`:` ${dt}/releases/tag/${E}
|
|
6
|
-
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function Oi(){let t=Cr("../../package.json").optionalDependencies?.["scip-query-scip-windows"];if(!t||!/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(t))throw new Error("scip-query package metadata does not declare an exact Windows sidecar version.");return`scip-query-scip-windows@${t}`}var Bi={fetch:Ar,extract:(e,t)=>{Be("tar",["-xzf",e,"-C",t,"scip"],{stdio:"pipe",timeout:12e4,killSignal:"SIGKILL"})},markExecutable:e=>vi(e,493),probeVersion:e=>_i(e),env:process.env};async function Gi(e,t={}){let r={...Bi,...t},n=Ci();if(!n)return e(`No reviewed scip ${E} release archive is published for ${j()}/${Ge()}.`),null;let i=Br(r.env),o=Ri(i),a=kr(o,n.filename);e(`Downloading reviewed scip ${E} (${n.filename}, sha256 ${n.sha256.slice(0,12)}\u2026).`);try{let c=await r.fetch({cachePath:a,url:n.url,expectedSha256:n.sha256});r.extract(c.path,o),r.markExecutable(i)}catch(c){return e(`Could not install scip ${E}: ${c instanceof Error?c.message:String(c)}`),null}let s=r.probeVersion(i);return Di(s)?(e(`Installed reviewed scip ${E} at ${i}.`),i):(e(`Installed scip at ${i} did not report ${E} (reported: ${s??"unavailable"}).`),null)}function _i(e){try{return Be(e,["--version"],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}).toString().trim()}catch{return null}}async function Ns(e,t={}){if(j()!=="win32"&&await Gi(e,t)!==null)return!0;if(ke("go")){e(`Installing immutable ${Oe} via go install into the Go bin directory (GOBIN or GOPATH/bin); expected executable: scip.`);try{if(Be("go",["install",Oe],{stdio:"inherit",timeout:3e5,env:process.env}),ke("scip")){let r=lt(),n=ki();if(r&&n&&n.includes(E))return e(`Successfully installed ${Oe}; resolved executable: ${r}; reported version: ${n}.`),!0;e(`go install completed, but the resolved scip executable did not report ${E} (executable: ${r??"unresolved"}; version: ${n??"unavailable"}).`)}}catch(r){let n=r instanceof Error?r.message:String(r);e(`go install failed: ${n}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${dt}/releases/tag/${E}`),!1}var _r=class extends Error{constructor(t){super(t),this.name="ReindexLockUnavailableError"}};import{execFileSync as Mi}from"child_process";import{existsSync as Fi,readdirSync as Mr}from"fs";import{extname as Fr,join as Nr}from"path";var $r=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),Ni=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"clojure",files:["deps.edn","project.clj","bb.edn","shadow-cljs.edn"],extensions:[".clj",".cljs",".cljc"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function Vs(e){let t=[],r=$i(e),n=zi(e);for(let i of Ni){if(ji(e,i.files)){t.push(i.language);continue}if(Wi(r,i.globs)){t.push(i.language);continue}Vi(n,i.extensions)&&t.push(i.language)}if(t.includes("typescript")&&ut(t,"javascript"),t.includes("cpp")&&t.includes("c")){let i=n.has(".c"),o=[".cc",".cpp",".cxx"].some(a=>n.has(a));i&&!o?ut(t,"cpp"):i||ut(t,"c")}return t}function $i(e){try{return Mr(e)}catch{return[]}}function ji(e,t){return t?.length?t.some(r=>Fi(Nr(e,r))):!1}function Wi(e,t){return t?.length?e.some(r=>t.some(n=>qi(r,n))):!1}function qi(e,t){if(t==="*")return!0;if(!t.includes("*"))return e===t;let[r,n]=t.split("*");return e.startsWith(r??"")&&e.endsWith(n??"")}function zi(e){let t=Ji(e);if(t)return t;let r=new Set,n=[e];for(;n.length>0;){let i=n.pop();if(!i)continue;let o;try{o=Mr(i,{withFileTypes:!0})}catch{continue}for(let a of o){if(a.name.startsWith(".")&&!a.name.endsWith("proj")&&!a.name.endsWith("sln")&&a.isDirectory())continue;let s=Nr(i,a.name);if(a.isDirectory()){$r.has(a.name)||n.push(s);continue}let c=Fr(a.name).toLowerCase();c&&r.add(c)}}return r}function Ji(e){try{let t=dr(e,26214400,()=>Mi("git",["-C",e,"ls-files","-co","-v","-z","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:52428800,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"})),r=new Set;for(let n of lr(t)){if(n.split("/").some(o=>$r.has(o)))continue;let i=Fr(n).toLowerCase();i&&r.add(i)}return r}catch{return null}}function Vi(e,t){return t?.length?t.some(r=>e.has(r)):!1}function ut(e,t){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}import{closeSync as Wr,openSync as Qi,renameSync as Zi,rmSync as eo,writeSync as to}from"fs";import{create as qr,fromBinary as ro,toBinary as no}from"@bufbuild/protobuf";import{DocumentSchema as pt,IndexSchema as io,SymbolRole as mt}from"@c4312/scip";var A=class extends Error{},Ui=0,Hi=1,jr=2,Yi=5;function ft(e,t,r){let n=0,i=0;for(;t<r;){let o=e[t];if(t+=1,i<53)n+=(o&127)*2**i;else if((o&127)!==0)throw new A("varint exceeds the safe integer range");if((o&128)===0)return{value:n,pos:t};if(i+=7,i>63)throw new A("varint is longer than 64 bits")}throw new A("varint runs past the end of the buffer")}function*D(e,t=0,r=e.length){let n=t;for(;n<r;){let i=n,o=ft(e,n,r);n=o.pos;let a=Math.floor(o.value/8),s=o.value%8;if(a===0)throw new A("field number 0 is invalid");let c=n,d=0;if(s===Ui){let l=ft(e,n,r);d=l.value,n=l.pos}else if(s===jr){let l=ft(e,n,r);if(c=l.pos,n=l.pos+l.value,n>r)throw new A("length-delimited field runs past the end of the buffer")}else if(s===Hi)n+=8;else if(s===Yi)n+=4;else throw new A(`unsupported wire type ${s}`);if(n>r)throw new A("field value runs past the end of the buffer");yield{fieldNumber:a,wireType:s,fieldStart:i,valueStart:c,valueEnd:n,fieldEnd:n,varint:d}}}function ce(e){if(!Number.isSafeInteger(e)||e<0)throw new A(`cannot encode varint ${e}`);let t=[],r=e;do{let n=r%128;r=Math.floor(r/128),r>0&&(n|=128),t.push(n)}while(r>0);return Uint8Array.from(t)}function _e(e){return ce(e*8+jr)}var Ki=1,Xi=3;function de(e){let t=new TextDecoder,r;for(let n of D(e))if(!(n.fieldNumber!==Ki||n.wireType!==2))for(let i of D(e,n.valueStart,n.valueEnd)){if(i.fieldNumber!==Xi||i.wireType!==2)continue;let o=t.decode(e.subarray(i.valueStart,i.valueEnd));o&&(r=o)}return r}var gt=2,oo=3,ao=1,so=2,co=3,lo=1,uo=2,fo=3;function tc(e){let t;try{t=v(e,{inputKind:"SCIP sanitization input",maxBytes:R})}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}try{return po(t,e)}catch(r){if(r instanceof A)return{removedDefinitionOccurrences:0,touchedDocuments:0};throw r}}function po(e,t){let r=new TextDecoder,n=new Set;for(let a of D(e))if(a.wireType===2)if(a.fieldNumber===gt)for(let s of D(e,a.valueStart,a.valueEnd))s.wireType===2&&(s.fieldNumber===ao?Ze(r.decode(e.subarray(s.valueStart,s.valueEnd))):s.fieldNumber===co&&zr(e,s,r,n));else a.fieldNumber===oo&&zr(e,a,r,n);let i=0,o=[];for(let a of D(e)){if(a.wireType!==2||a.fieldNumber!==gt)continue;let s=go(e,a,r,n);s>0&&(i+=s,o.push(a))}return i===0?{removedDefinitionOccurrences:0,touchedDocuments:0}:(mo(e,t,o,n),{removedDefinitionOccurrences:i,touchedDocuments:o.length})}function zr(e,t,r,n){for(let i of D(e,t.valueStart,t.valueEnd)){if(i.wireType!==2||i.fieldNumber!==lo)continue;let o=r.decode(e.subarray(i.valueStart,i.valueEnd));o&&n.add(o)}}function go(e,t,r,n){let i=0;for(let o of D(e,t.valueStart,t.valueEnd)){if(o.wireType!==2||o.fieldNumber!==so)continue;let a="",s=0;for(let c of D(e,o.valueStart,o.valueEnd))c.fieldNumber===uo&&c.wireType===2?a=r.decode(e.subarray(c.valueStart,c.valueEnd)):c.fieldNumber===fo&&c.wireType===0&&(s=c.varint);(s&mt.Definition)!==0&&!n.has(a)&&(i+=1)}return i}function mo(e,t,r,n){let i=`${t}.sanitize-tmp`,o=Qi(i,"w",384);try{let a=0;for(let s of r){le(o,e.subarray(a,s.fieldStart));let c=ro(pt,e.subarray(s.valueStart,s.valueEnd));c.occurrences=c.occurrences.filter(l=>(l.symbolRoles&mt.Definition)===0||n.has(l.symbol));let d=no(pt,c);le(o,_e(gt)),le(o,ce(d.byteLength)),le(o,d),a=s.fieldEnd}le(o,e.subarray(a))}catch(a){throw Wr(o),eo(i,{force:!0}),a}Wr(o),Zi(i,t)}function le(e,t){let r=0;for(;r<t.byteLength;)r+=to(e,t,r,t.byteLength-r)}function Jr(e){let t=new Set;for(let o of e.documents){Ze(o.relativePath);for(let a of o.symbols)a.symbol&&t.add(a.symbol)}for(let o of e.externalSymbols)o.symbol&&t.add(o.symbol);let r=0,n=0,i=[];for(let o of e.documents){let a=o.occurrences.filter(s=>(s.symbolRoles&mt.Definition)===0||t.has(s.symbol)?!0:(r+=1,!1));if(a.length===o.occurrences.length){i.push(o);continue}n+=1,i.push(qr(pt,{language:o.language,relativePath:o.relativePath,occurrences:a,symbols:o.symbols,text:o.text,positionEncoding:o.positionEncoding}))}return{index:r===0?e:qr(io,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:r,touchedDocuments:n}}import{closeSync as fe,openSync as yt,readSync as yo,renameSync as ho,rmSync as Hr,statSync as So,writeFileSync as Yr,writeSync as Kr}from"fs";import{create as ht,fromBinary as bo,toBinary as Io}from"@bufbuild/protobuf";import{deserializeSCIP as Xr,serializeSCIP as Qr,DocumentSchema as xo,IndexSchema as wo,MetadataSchema as Vr,SymbolInformationSchema as vo}from"@c4312/scip";function Zr(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let t=Ro(e),r=Eo(e.flatMap(i=>i.documents??[])),n=tn(e.flatMap(i=>i.externalSymbols??[]));return ht(wo,{metadata:t,documents:r,externalSymbols:n})}function lc(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let r=e.map(i=>Xr(v(i,{inputKind:"SCIP merge input",maxBytes:R}))),n=Zr(r);return Yr(t,Qr(n)),{documentCount:n.documents.length,externalSymbolCount:n.externalSymbols.length,inputCount:e.length}}function uc(e,t){if(e.length===0)throw new Error("Cannot concatenate zero SCIP files");let r=0;for(let o of e)if(r+=So(o).size,r>R)throw new Error(`Concatenated SCIP output exceeds the ${R}-byte artifact limit. Reduce the indexed project scope or use compatible cached generations.`);let n=Buffer.allocUnsafe(1024*1024),i=yt(t,"w",384);try{for(let o of e){let a=yt(o,"r");try{let s=0;for(;(s=yo(a,n,0,n.byteLength,null))>0;){let c=0;for(;c<s;)c+=Kr(i,n,c,s-c)}}finally{fe(a)}}}catch(o){throw fe(i),Hr(t,{force:!0}),o}fe(i)}function fc(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let r=oe("reindex.publish.scip-output.deserialize",()=>e.map(o=>Xr(v(o,{inputKind:"SCIP merge input",maxBytes:R})))),n=oe("reindex.publish.scip-output.merge",()=>Zr(r)),i=oe("reindex.publish.scip-output.sanitize",()=>Jr(n));return oe("reindex.publish.scip-output.serialize",()=>Yr(t,Qr(i.index))),{documentCount:i.index.documents.length,externalSymbolCount:i.index.externalSymbols.length,inputCount:e.length,removedDefinitionOccurrences:i.removedDefinitionOccurrences,touchedDocuments:i.touchedDocuments}}var Ur=1;function en(e,t,r){let n=v(e,{inputKind:"SCIP normalization input",maxBytes:R}),i=de(n),o=[];for(let c of D(n))c.fieldNumber===Ur&&c.wireType===2&&o.push(c);if(o.length===0)throw new Error("Cannot rebase a SCIP index without metadata");if((i??"")!==t)throw new Error(`Cannot rebase SCIP project root: expected ${t}, got ${i??""}`);let a=`${e}.rebase-tmp`,s=yt(a,"w",384);try{let c=0;for(let d of o){ue(s,n.subarray(c,d.fieldStart));let l=bo(Vr,n.subarray(d.valueStart,d.valueEnd));l.projectRoot=r;let p=Io(Vr,l);ue(s,_e(Ur)),ue(s,ce(p.byteLength)),ue(s,p),c=d.fieldEnd}ue(s,n.subarray(c))}catch(c){throw fe(s),Hr(a,{force:!0}),c}fe(s),ho(a,e)}function ue(e,t){let r=0;for(;r<t.byteLength;)r+=Kr(e,t,r,t.byteLength-r)}function Ro(e){let t=e[0]?.metadata;if(!t)return;let r=t.projectRoot;for(let n of e.slice(1)){let i=n.metadata?.projectRoot;if(r&&i&&i!==r)throw new Error(`Cannot merge SCIP indexes with different project roots: ${r} vs ${i}`)}return t}function Eo(e){let t=new Map;for(let r of e){let n=t.get(r.relativePath);if(!n){t.set(r.relativePath,r);continue}t.set(r.relativePath,ht(xo,{language:n.language||r.language,relativePath:n.relativePath||r.relativePath,occurrences:To([...n.occurrences,...r.occurrences]),symbols:tn([...n.symbols,...r.symbols]),text:Ao(n.text,r.text),positionEncoding:n.positionEncoding||r.positionEncoding}))}return[...t.values()]}function To(e){let t=new Set,r=[];for(let n of e){let i=JSON.stringify(n);t.has(i)||(t.add(i),r.push(n))}return r}function tn(e){let t=new Map;for(let r of e){let n=t.get(r.symbol);if(!n){t.set(r.symbol,r);continue}t.set(r.symbol,ht(vo,{symbol:n.symbol,documentation:Lo([...n.documentation,...r.documentation]),relationships:Po([...n.relationships,...r.relationships]),kind:n.kind||r.kind,displayName:n.displayName||r.displayName,enclosingSymbol:n.enclosingSymbol||r.enclosingSymbol,signatureDocumentation:n.signatureDocumentation??r.signatureDocumentation}))}return[...t.values()]}function Po(e){let t=new Set,r=[];for(let n of e){let i=[n.symbol,n.isReference?"1":"0",n.isImplementation?"1":"0",n.isTypeDefinition?"1":"0",n.isDefinition?"1":"0"].join("|");t.has(i)||(t.add(i),r.push(n))}return r}function Ao(e,t){return e?t?e.length>=t.length?e:t:e:t}function Lo(e){return[...new Set(e)]}import{existsSync as cn,statSync as zo}from"fs";import{dirname as un,join as fn}from"path";import{appendFileSync as Do,existsSync as ko,mkdirSync as Co,renameSync as Oo,rmSync as Bo,statSync as Go,truncateSync as _o}from"fs";import{basename as Mo,dirname as Fo}from"path";var Me=".previous",No=".rotation.lock",$o=2e3,St=class extends Error{constructor(r,n){super(`Timed out after ${n}ms waiting for rotating JSONL lock: ${r}`);this.lockPath=r;this.timeoutMs=n;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},bt=class extends Error{constructor(r){super(`Rotating JSONL lock ownership changed before release: ${r}`);this.lockPath=r;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},rn=Object.freeze({monotonicNow:ve,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let r=Re(e,{kind:"rotating-jsonl",detail:{target:Mo(t)}});return r.kind==="acquired"?{kind:"acquired",lock:r.lock}:{kind:"contended"}},makeDirectory(e){Co(e,{recursive:!0})},exists:ko,readBytes(e){return v(e,{maxBytes:xe,inputKind:"rotating JSONL segment"})},size(e){return Go(e).size},truncate:_o,remove(e){Bo(e,{force:!0})},rename:Oo,append:Do});function nn(e,t,r){let n=r.runtime??rn,i=JSON.stringify(t);if(i===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let o=Buffer.from(`${i}
|
|
7
|
-
`),a=Math.max(1,Math.floor(r.maxSegmentBytes),o.length);return an(e,r.lockTimeoutMs,n,()=>{n.makeDirectory(Fo(e));let s=jo(e,xe,n);r.onPhase?.("tail-repaired");let c=`${e}${r.previousSuffix??Me}`,d=!1,l=!1;return n.exists(e)&&n.size(e)+o.length>a&&(n.exists(c)&&(n.remove(c),l=!0),r.onPhase?.("previous-pruned"),n.rename(e,c),d=!0,r.onPhase?.("current-rotated")),n.append(e,o),r.onPhase?.("record-appended"),{lineBytes:o.length,segmentLimitBytes:a,repairedTailBytes:s,rotated:d,prunedPrevious:l}})}function on(e,t={}){let r=t.runtime??rn,n=Wo(t.maxSegmentBytes);return an(e,t.lockTimeoutMs,r,()=>{let i=[],o=0,a=`${e}${t.previousSuffix??Me}`;for(let s of[a,e]){if(!r.exists(s))continue;let c=qo(sn(s,n,r));i.push(...c.lines),o+=c.partialTailBytes}return{lines:i,ignoredPartialTailBytes:o}})}function an(e,t,r,n){let i=`${e}${No}`,o=Math.max(0,t??$o),a=r.monotonicNow()+o,s;for(;;){let u=r.tryAcquireLock(i,e);if(u.kind==="acquired"){s=u.lock;break}let b=a-r.monotonicNow();if(b<=0)throw new St(i,o);r.wait(Math.min(5,b))}let c=!1,d,l;try{l=n()}catch(u){c=!0,d=u}let p=!1;try{p=s.release()}catch(u){if(!c)throw u}if(c)throw d;if(!p)throw new bt(i);return l}function jo(e,t,r){if(!r.exists(e))return 0;let n=sn(e,t,r);if(n.length===0||n[n.length-1]===10)return 0;let i=n.lastIndexOf(10),o=i<0?0:i+1;return r.truncate(e,o),n.length-o}function Wo(e){let t=e??xe;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function sn(e,t,r){let n=r.size(e);if(n>t)throw new rt("rotating JSONL segment",e,"too-large",n,t);let i=r.readBytes(e),o=r.size(e);if(o!==n||i.byteLength!==n)throw new rt("rotating JSONL segment",e,"changed-during-read",o,t);return i}function qo(e){let t=e.lastIndexOf(10),r=t<0?0:t+1;return{lines:e.subarray(0,r).toString("utf8").split(`
|
|
8
|
-
`).filter(i=>i.length>0),partialTailBytes:e.length-r}}var Jo="reindex-activity.jsonl",Fe=Me,Vo=1024*1024,Uo=1440*60*1e3,dn=e=>_(e,"reindex activity segment");function xt(e){return fn(un(e),Jo)}function pn(e){if(e.reused)return 0;let r=(e.shards?.some(n=>!n.reused&&n.strategy==="incremental")??!1?0:It(e.indexPath))+It(e.dbPath);for(let n of e.shards??[]){if(n.reused)continue;let i=n.producedOutputBytes??n.outputBytes;i!==null&&(r+=i)}return r}function Ho(e){let t=pn(e),r=e.writeTelemetry;return r?Math.max(0,t-r.reflinkedBytes)+r.fallbackCopiedBytes+(r.incrementalWrittenBytes??0):t}function Tc(e,t){let r=t.lastRefresh;if(!r)return{state:"failed",reason:"reindex result has no refresh metadata"};let n=pn(t);return gn(xt(e),{version:1,event:"run",recordedAt:r.completedAt,trigger:r.trigger,result:r.result,durationMs:r.durationMs,estimatedLogicalOutputBytes:n,estimatedWriteBytes:Ho(t),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,incrementalWrittenBytes:t.writeTelemetry?.incrementalWrittenBytes??0,byLanguage:na(t)})}function Pc(e,t){return gn(xt(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function Yo(e,t,r=Vo,n){nn(e,t,{maxSegmentBytes:r,previousSuffix:Fe,...n?{runtime:n}:{}})}function Ko(e,t=new Date,r=Uo,n=dn){let i=t.getTime(),o=i-r,a={confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(o).toISOString(),windowEndedAt:t.toISOString(),runs:0,rebuilt:0,fullRebuilds:0,reused:0,failed:0,suppressed:0,estimatedLogicalOutputBytes:0,estimatedWriteBytes:0,reflinkedBytes:0,fallbackCopiedBytes:0,languageAttribution:"complete",attributedRuns:0,unattributedRuns:0,invalidLanguageDetails:0,byLanguage:{},byTrigger:{},automatic:{runs:0,rebuilt:0,fullRebuilds:0,estimatedWriteBytes:0}},s=a.automatic,c=xt(e),d=[];if(n===dn){if(!cn(c)&&!cn(`${c}${Fe}`))return a;try{let l=on(c,{previousSuffix:Fe});d=l.lines,a.ignoredPartialTailBytes=l.ignoredPartialTailBytes}catch{a.readErrors+=1,a.confidence="unavailable"}}else{let l=0;for(let p of[`${c}${Fe}`,c])try{d.push(...da(n(p))),l+=1}catch{a.readErrors+=1}l===0?a.confidence="unavailable":a.readErrors>0&&(a.confidence="partial")}for(let l of d){a.recordsRead+=1;let p=Xo(l);if(!p){a.invalidRecords+=1,a.confidence!=="unavailable"&&(a.confidence="partial");continue}let{record:u}=p,b=Date.parse(u.recordedAt);if(b<o||b>i){a.skippedRecords+=1;continue}if(a.invalidLanguageDetails=(a.invalidLanguageDetails??0)+p.invalidLanguageDetails,a.byTrigger[u.trigger.kind]=(a.byTrigger[u.trigger.kind]??0)+1,u.event==="suppressed"){a.suppressed+=1;continue}a.runs+=1,a[u.result]+=1,a.estimatedLogicalOutputBytes+=u.estimatedLogicalOutputBytes;let g=Qo(u);a.estimatedWriteBytes=(a.estimatedWriteBytes??0)+g,a.reflinkedBytes=(a.reflinkedBytes??0)+(u.reflinkedBytes??0),a.fallbackCopiedBytes=(a.fallbackCopiedBytes??0)+(u.fallbackCopiedBytes??0),u.result!=="failed"&&(p.hasLanguageDetails?a.attributedRuns=(a.attributedRuns??0)+1:a.unattributedRuns=(a.unattributedRuns??0)+1);for(let[y,k]of mn(u.byLanguage)){let F=(a.byLanguage??={})[y]??=sa();F.runs+=1,F[k.result]+=1,F.producedOutputBytes+=k.producedOutputBytes,F.durationMs+=k.durationMs}let h=ta(u);h&&a.oldestRebuildAt===void 0&&(a.oldestRebuildAt=u.recordedAt),h&&(a.fullRebuilds=(a.fullRebuilds??0)+1),g>0&&a.oldestWriteAt===void 0&&(a.oldestWriteAt=u.recordedAt),Zo(u.trigger)&&(s.runs+=1,u.result==="rebuilt"&&(s.rebuilt+=1),h&&(s.fullRebuilds+=1,s.oldestRebuildAt??=u.recordedAt),s.estimatedWriteBytes+=g,g>0&&(s.oldestWriteAt??=u.recordedAt))}return a.ignoredPartialTailBytes>0&&a.confidence!=="unavailable"&&(a.confidence="partial"),a.languageAttribution=ca(a),a}function gn(e,t){try{return Yo(e,t),{state:"recorded"}}catch(r){return{state:"failed",reason:r instanceof Error?r.message:String(r)}}}function Xo(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let r=t;if(r.version!==1||!Qt(r.recordedAt)||!r.trigger||!ra(r.trigger.kind))return null;if(r.event==="suppressed")return r.reason==="completed-index-is-fresh"?{record:r,hasLanguageDetails:!1,invalidLanguageDetails:0}:null;if(r.event!=="run"||r.result!=="rebuilt"&&r.result!=="reused"&&r.result!=="failed"||!N(r.durationMs)||!N(r.estimatedLogicalOutputBytes)||r.estimatedWriteBytes!==void 0&&!N(r.estimatedWriteBytes)||r.reflinkedBytes!==void 0&&!N(r.reflinkedBytes)||r.fallbackCopiedBytes!==void 0&&!N(r.fallbackCopiedBytes)||r.incrementalWrittenBytes!==void 0&&!N(r.incrementalWrittenBytes))return null;let n=r,{byLanguage:i,...o}=n,a=ia(i);return{record:{...o,...a.byLanguage?{byLanguage:a.byLanguage}:{}},hasLanguageDetails:a.hasLanguageDetails,invalidLanguageDetails:a.invalidLanguageDetails}}catch{return null}}function Qo(e){return e.reflinkedBytes===void 0?e.estimatedWriteBytes??e.estimatedLogicalOutputBytes:Math.max(0,e.estimatedLogicalOutputBytes-e.reflinkedBytes)+(e.fallbackCopiedBytes??0)+(e.incrementalWrittenBytes??0)}function Ac(e,t,r=new Date){return t.enabled?ea(Ko(e,r,t.windowMs),t,r.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function Zo(e){return e.kind.startsWith("watch-")}function ea(e,t,r){let n=e.automatic??{fullRebuilds:e.fullRebuilds??e.rebuilt,estimatedWriteBytes:e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,oldestRebuildAt:e.oldestRebuildAt,oldestWriteAt:e.oldestWriteAt},i=n.estimatedWriteBytes,o=n.fullRebuilds,a={rebuilt:o,estimatedWriteBytes:i};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:r+t.windowMs,...a,detail:`reindex activity evidence is ${e.confidence}`}:o>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:ln(n.oldestRebuildAt,t.windowMs,r),...a,detail:`${o}/${t.maxRebuilds} expensive full rebuild slots consumed by automatic refreshes`}:i>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:ln(n.oldestWriteAt,t.windowMs,r),...a,detail:`${i}/${t.maxEstimatedWriteBytes} estimated write bytes consumed by automatic refreshes`}:{state:"allowed",...a}:{state:"allowed",...a}}function ta(e){if(e.result!=="rebuilt")return!1;let t=mn(e.byLanguage);return t.length===0?!0:t.some(([,r])=>r.result==="rebuilt"&&r.strategy!=="incremental"&&r.strategy!=="reused")}function ln(e,t,r){let n=e?Date.parse(e):Number.NaN;return Number.isFinite(n)&&n+t>r?n+t:r+t}function ra(e){return e==="manual-cli"||e==="setup"||e==="watch-source"||e==="watch-startup"||e==="watch-demand"||e==="watch-git-head"||e==="watch-git-index"||e==="watch-git-state"||e==="unknown"}function It(e){try{return zo(e).size}catch{return 0}}function na(e){let t={};for(let r of e.languages){let n=(e.shards??[]).filter(d=>d.language===r),i=n.find(d=>d.id===r),o=e.reused||(i?i.reused:n.length>0&&n.every(d=>d.reused)),a=It(fn(un(e.dbPath),"language-indexes",`${r}.scip`)),s=a>0?a:i?.outputBytes??a,c=o?0:i?.durationMs??n.filter(d=>!d.reused).reduce((d,l)=>d+l.durationMs,0);t[r]={result:o?"reused":"rebuilt",strategy:o?"reused":i?.strategy??"full",...i?.strategy==="full"&&(i.fallbackReason??i.missReason)?{fallbackReason:i.fallbackReason??i.missReason}:{},outputBytes:s,producedOutputBytes:o?0:i?.producedOutputBytes??s,durationMs:c}}return t}function ia(e){if(e===void 0)return{hasLanguageDetails:!1,invalidLanguageDetails:0};if(!e||typeof e!="object"||Array.isArray(e))return{hasLanguageDetails:!1,invalidLanguageDetails:1};let t={},r=0;for(let[i,o]of Object.entries(e)){if(!aa(i)||!oa(o)){r+=1;continue}t[i]=o}let n=Object.keys(t).length>0;return{...n?{byLanguage:t}:{},hasLanguageDetails:n,invalidLanguageDetails:r}}function oa(e){if(!e||typeof e!="object")return!1;let t=e;return(t.result==="rebuilt"||t.result==="reused")&&(t.strategy===void 0||t.strategy==="reused"||t.strategy==="incremental"||t.strategy==="full")&&(t.fallbackReason===void 0||typeof t.fallbackReason=="string")&&et(t.outputBytes)&&et(t.producedOutputBytes)&&N(t.durationMs)&&(t.result!=="reused"||t.producedOutputBytes===0&&t.durationMs===0)&&t.producedOutputBytes<=t.outputBytes}function aa(e){return tt.includes(e)}function mn(e){return e?tt.flatMap(t=>{let r=e[t];return r?[[t,r]]:[]}):[]}function sa(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function ca(e){let t=e.invalidLanguageDetails??0,r=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":r===0?"unavailable":"partial"}function da(e){return e.endsWith(`
|
|
9
|
-
`)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
|
|
10
|
-
`)+1))),e.split(`
|
|
11
|
-
`).filter(t=>t.length>0)}import la from"better-sqlite3";var ua=25,fa=new Set(["typescript","javascript"]);function Oc(e,t,r){let n=null;try{n=new la(e,{readonly:!0,fileMustExist:!0});let i=new Set(n.prepare("SELECT relative_path FROM documents").pluck().all().map(Qe)),o=pa(t,r),a=new Set([...o.values()].flatMap(l=>[...l])),s=[...a].filter(l=>!i.has(l)).sort();if(s.length===0)return{state:"complete",expectedDocumentCount:a.size,actualDocumentCount:i.size};let c=new Set(s),d=r.filter(l=>[...o.get(l)??[]].some(p=>c.has(p)));return{state:"incomplete",expectedDocumentCount:a.size,actualDocumentCount:i.size,missingDocumentCount:s.length,missingPaths:s.slice(0,ua),affectedLanguages:d}}catch(i){return{state:"unavailable",reason:i instanceof Error?i.message:String(i)}}finally{n?.close()}}function pa(e,t){let r=new Map,n=t.filter(i=>fa.has(i));for(let i of n)r.set(i,new Set);for(let i of e.files){let o=Qe(i.path);for(let a of n)Yt(o,[a])==="source"&&r.get(a).add(o)}return r}import{existsSync as hn,readdirSync as Sn,rmSync as bn}from"fs";import{join as X}from"path";import{create as xn,fromBinary as wn,toBinary as qc}from"@bufbuild/protobuf";import{deserializeSCIP as wt,DocumentSchema as vn,IndexSchema as Rn,serializeSCIP as En}from"@c4312/scip";import{existsSync as ga,mkdirSync as ma,renameSync as ya,writeFileSync as ha}from"fs";import{join as Sa}from"path";function yn(e){ma(e.blobDir,{recursive:!0});let t=Sa(e.blobDir,`${e.blobHash}.scipdoc`);if(ga(t)){let n=v(t,{maxBytes:ee,inputKind:e.inputKind});if(n.byteLength!==e.bytes.byteLength||M(n)!==e.blobHash)throw new Error(`existing ${e.inputKind} is corrupt: ${e.relativePath}`);return}let r=`${t}.${process.pid}.${Date.now()}.tmp`;ha(r,e.bytes),ya(r,t)}var vt=1,pe="typescript-scip-fragments";function Uc(e){let t=new Set,r=[];for(let o of e){let a=Ne(o.relativePath);if(t.has(a))throw new Error(`duplicate TypeScript fragment replacement: ${a}`);if(t.add(a),o.bytes===null)throw new Error(`affected TypeScript mini index cannot contain a deleted document: ${a}`);let s=wn(vn,o.bytes);if(s.relativePath!==a)throw new Error(`TypeScript fragment path mismatch: expected ${a}, got ${s.relativePath}`);r.push(s)}let n=En(xn(Rn,{documents:r,externalSymbols:[]})),i=wt(n);if(i.documents.length!==r.length||i.externalSymbols.length!==0)throw new Error("affected TypeScript SCIP index failed structural verification");return n}function ba(e){let t=X(e,pe);return{rootDir:t,blobDir:X(t,"blobs"),generationDir:X(t,"generations")}}function Tn(e){let t=Ia(e);return xa(t.baseIndex,t.completeDocuments,"assembled")}function Ia(e){let t=wt(e.baseIndexBytes);Ea(t.metadata,Ta(e)),Ra(t.externalSymbols);let r=new Map;for(let s of e.fragments){let c=Ne(s.relativePath);if(r.has(c))throw new Error(`duplicate TypeScript fragment replacement: ${c}`);r.set(c,s)}if(r.size===0)throw new Error("TypeScript index assembly requires at least one replacement");let n=new Set,i=[],o=[],a=[];for(let s of t.documents){let c=Ne(s.relativePath);if(n.has(c))throw new Error(`duplicate TypeScript SCIP document path: ${c}`);n.add(c);let d=r.get(c);if(!d){i.push(s);continue}if(r.delete(c),d.bytes===null){a.push(c);continue}let l=In(c,d.bytes);i.push(l),o.push(l)}for(let s of[...r.keys()].sort()){let c=r.get(s);if(c.bytes===null)continue;if(n.has(s))throw new Error(`duplicate TypeScript SCIP document path: ${s}`);n.add(s);let d=In(s,c.bytes);i.push(d),o.push(d)}return{baseIndex:t,completeDocuments:i,affectedDocuments:o,deletedAffectedPaths:a}}function In(e,t){let r=wn(vn,t);if(r.relativePath!==e)throw new Error(`TypeScript fragment path mismatch: expected ${e}, got ${r.relativePath}`);return r}function xa(e,t,r){let n=En(xn(Rn,{metadata:e.metadata,documents:t,externalSymbols:[]})),i=wt(n);if(i.documents.length!==t.length||i.externalSymbols.length!==0)throw new Error(`${r} TypeScript SCIP index failed structural verification`);return n}function Hc(e,t){let r=ba(e);if(!hn(r.generationDir))return;let n=new Set(t.map(a=>va(a))),i=Sn(r.generationDir).filter(a=>a.endsWith(".json")),o=new Set;for(let a of i.filter(s=>n.has(s))){let s=wa(P(X(r.generationDir,a),{maxBytes:T,inputKind:"TypeScript fragment manifest"}));for(let c of s.documents)o.add(`${c.blobHash}.scipdoc`)}for(let a of i)n.has(a)||bn(X(r.generationDir,a),{force:!0});if(hn(r.blobDir))for(let a of Sn(r.blobDir))o.has(a)||bn(X(r.blobDir,a),{force:!0})}function wa(e){let t=JSON.parse(e);if(t.version!==vt||typeof t.producerIdentity!="string"||typeof t.projectIdentity!="string"||typeof t.generationIdentity!="string"||typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))||!Array.isArray(t.documents))throw new Error("invalid TypeScript fragment generation manifest");let r=new Set;for(let n of t.documents){if(!n||typeof n.relativePath!="string"||typeof n.blobHash!="string"||!/^[a-f0-9]{64}$/.test(n.blobHash)||typeof n.byteLength!="number"||!Number.isInteger(n.byteLength)||n.byteLength<0||typeof n.documentIdentity!="string"||!n.documentIdentity)throw new Error("invalid TypeScript fragment record");if(Ne(n.relativePath),r.has(n.relativePath))throw new Error("duplicate TypeScript fragment record");r.add(n.relativePath)}return t}function va(e){if(!e)throw new Error("TypeScript fragment generation identity must be non-empty");return`${M(e)}.json`}function Ra(e){if(e.length>0)throw new Error("scip-typescript emitted external symbols; incremental document assembly is unsupported")}function Ea(e,t){if(!e||typeof e!="object")throw new Error("TypeScript SCIP shard has no producer metadata");let r=e,n=r.toolInfo??r.tool_info;if(!n||typeof n!="object")throw new Error("TypeScript SCIP shard has no producer tool identity");let i=n;if(i.name!=="scip-typescript"||i.version!==t)throw new Error("TypeScript SCIP shard producer identity changed")}function Ta(e){let t=e.packageVersion??e.runtime?.packageVersion;if(!t)throw new Error("scip-typescript package version is unavailable");return t}function Ne(e){if(!e||e.startsWith("/")||e.startsWith("\\")||e.includes("\\"))throw new Error(`invalid TypeScript SCIP document path: ${e}`);let t=e.split("/");if(t.includes("")||t.includes(".")||t.includes(".."))throw new Error(`invalid TypeScript SCIP document path: ${e}`);return e}import{existsSync as $e,readdirSync as Rt,rmSync as Pn}from"fs";import{join as O}from"path";var je=1,ge="typescript-scip-overlays",An="typescript-project-v3:";function nd(e){let t=Dn(e.cacheDir,e.previousGenerationIdentity);if(!t&&!e.baseShardCurrent)throw new Error("deferred TypeScript SCIP base has no matching overlay generation");if(t?.producerIdentity!==void 0&&t.producerIdentity!==e.producerIdentity)throw new Error("TypeScript overlay producer identity changed");let r=e.allowLegacyProjectIdentityMigration===!0&&t!==null&&!t.projectIdentity.startsWith(An)&&e.projectIdentity.startsWith(An);if(t&&t.projectIdentity!==e.projectIdentity&&!e.allowProjectIdentityChange&&!r)throw new Error("TypeScript overlay project identity changed");let n=new Map((t?.overlays??[]).map(a=>[a.relativePath,a])),i=new Set;for(let a of e.fragments){let s=Pt(a.relativePath);if(i.has(s))throw new Error(`duplicate TypeScript overlay: ${s}`);i.add(s),n.set(s,Pa(e.cacheDir,a))}if(i.size===0)throw new Error("TypeScript overlay generation requires affected documents");let o={version:je,producerIdentity:e.producerIdentity,projectIdentity:e.projectIdentity,baseGenerationIdentity:t?.baseGenerationIdentity??e.previousGenerationIdentity,generationIdentity:e.nextGenerationIdentity,createdAt:(e.now??(()=>new Date))().toISOString(),overlays:[...n.values()].sort((a,s)=>a.relativePath.localeCompare(s.relativePath))};return Aa(e.cacheDir,o),o}function id(e){let t=Dn(e.cacheDir,e.generationIdentity);if(!t)throw new Error("TypeScript overlay generation is unavailable");let r=t.overlays.map(n=>{if(n.blobHash===null)return{relativePath:n.relativePath,bytes:null,occurrences:0,symbols:0,referenceFragments:[]};let i=v(O(me(e.cacheDir),"blobs",`${n.blobHash}.scipdoc`),{maxBytes:ee,inputKind:"TypeScript overlay blob"});if(i.byteLength!==n.byteLength||M(i)!==n.blobHash)throw new Error(`TypeScript overlay blob is corrupt: ${n.relativePath}`);return{relativePath:n.relativePath,bytes:i,occurrences:0,symbols:0,referenceFragments:[]}});return Tn({packageVersion:e.packageVersion,baseIndexBytes:e.baseIndexBytes,fragments:r})}function od(e,t){let r=me(e),n=O(r,"generations");if(!$e(n))return;let i=new Set(t.map(Tt)),o=new Set;for(let s of Rt(n).filter(c=>i.has(c))){let c=Et(P(O(n,s),{maxBytes:T,inputKind:"TypeScript overlay manifest"}));for(let d of c.overlays)d.blobHash&&o.add(`${d.blobHash}.scipdoc`)}for(let s of Rt(n))i.has(s)||Pn(O(n,s),{force:!0});let a=O(r,"blobs");if($e(a))for(let s of Rt(a))o.has(s)||Pn(O(a,s),{force:!0})}function Dn(e,t){let r=O(me(e),"generations",Tt(t));if(!$e(r))return null;let n=Et(P(r,{maxBytes:T,inputKind:"TypeScript overlay manifest"}));if(n.generationIdentity!==t)throw new Error("TypeScript overlay generation identity does not match its path");return n}function Pa(e,t){let r=Pt(t.relativePath);if(t.bytes===null)return{relativePath:r,blobHash:null,byteLength:0};let n=Buffer.from(t.bytes),i=M(n);return yn({blobDir:O(me(e),"blobs"),blobHash:i,bytes:n,relativePath:r,inputKind:"TypeScript overlay blob"}),{relativePath:r,blobHash:i,byteLength:n.byteLength}}function Aa(e,t){let r=O(me(e),"generations",Tt(t.generationIdentity));if($e(r)){let n=Et(P(r,{maxBytes:T,inputKind:"TypeScript overlay manifest"}));if(Ln(n)!==Ln(t))throw new Error(`TypeScript overlay generation is immutable: ${t.generationIdentity}`);return}Pe(r,t,{spacing:2,trailingNewline:!0})}function Et(e){let t=JSON.parse(e);if(t.version!==je||typeof t.producerIdentity!="string"||!t.producerIdentity||typeof t.projectIdentity!="string"||!t.projectIdentity||typeof t.baseGenerationIdentity!="string"||!t.baseGenerationIdentity||typeof t.generationIdentity!="string"||!t.generationIdentity||typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))||!Array.isArray(t.overlays))throw new Error("invalid TypeScript overlay manifest");let r=new Set;for(let n of t.overlays){if(!n||typeof n.relativePath!="string"||n.blobHash!==null&&(typeof n.blobHash!="string"||!/^[a-f0-9]{64}$/.test(n.blobHash))||!Number.isInteger(n.byteLength)||n.byteLength<0||n.blobHash===null&&n.byteLength!==0)throw new Error("invalid TypeScript overlay record");if(Pt(n.relativePath),r.has(n.relativePath))throw new Error("duplicate TypeScript overlay record");r.add(n.relativePath)}return t}function me(e){return O(e,ge)}function Tt(e){if(!e)throw new Error("TypeScript overlay generation identity must be non-empty");return`${M(e)}.json`}function Ln(e){return M(JSON.stringify({version:e.version,producerIdentity:e.producerIdentity,projectIdentity:e.projectIdentity,baseGenerationIdentity:e.baseGenerationIdentity,generationIdentity:e.generationIdentity,overlays:e.overlays}))}function Pt(e){if(!e||e.startsWith("/")||e.includes("\\")||e.split("/").some(t=>!t||t==="."))throw new Error(`invalid TypeScript overlay path: ${e}`);if(e.split("/").includes(".."))throw new Error(`invalid TypeScript overlay path: ${e}`);return e}import{createHash as Ot}from"crypto";import{closeSync as La,existsSync as I,mkdirSync as Da,openSync as ka,readSync as Ca,readdirSync as Bt,renameSync as kt,rmSync as ye,statSync as J}from"fs";import{basename as Gt,dirname as B,join as m,relative as kn}from"path";var Oa=Object.freeze({maxGenerations:2,maxLogicalBytes:2*1024*1024*1024});function On(e){let t=L(e.outputDb),r=Fa(e);e.onStage?.("after-recovery-retained");let n=e.preserveOutputScip?e.outputScip:e.tempOutputScip,i=Na(e,r),o=Mt({generationRoot:t,databasePath:e.tempOutputDb,indexPath:I(n)?n:void 0,verifiedIndexArtifact:i,metadataPath:I(e.tempMetaPath)?e.tempMetaPath:void 0}),a=(e.now??(()=>new Date))().toISOString(),s={version:Y,currentGeneration:o.identity,artifactSet:"immutable-v1",...r?{previousGeneration:r}:{},...e.publication?{publication:e.publication}:{},publishedAt:a},c=C(m(t,"state.json"),s,{spacing:2,trailingNewline:!0});e.onStage?.("after-pointer-handoff"),e.preserveOutputScip||Dt(e.tempOutputScip,e.outputScip),e.onStage?.("after-scip-handoff"),Dt(e.tempOutputDb,e.outputDb),e.onStage?.("after-database-handoff"),Dt(e.tempMetaPath,e.metaPath),e.onStage?.("after-metadata-handoff");let d=o.identity,l={...s,stableMirrors:_t(e.outputDb,e.outputScip)};C(m(t,"state.json"),l,{spacing:2,trailingNewline:!0});let p=Bn(e.outputDb,{now:e.now}),u=re(o.directorySync,c.directorySync);return{currentGeneration:d,...r?{previousGeneration:r}:{},retention:p,achievedDurability:u==="synced"?"directory-durable":"file-flushed",directorySync:u}}function Ba(e,t,r,n=()=>new Date){if(!I(e))return null;let i=ne(e),o=m(L(e),"state.json");if(i?.artifactSet==="immutable-v1"&&Le(e,i.currentGeneration))return i;let a=L(e),s=!i&&I(o)?ja(r,e,t):void 0;if(s&&!De(a,s))return null;let c=Mt({generationRoot:a,databasePath:e,indexPath:I(t)?t:void 0,metadataPath:I(r)?r:void 0,forcedIdentity:i?.currentGeneration??s}),d={version:Y,currentGeneration:c.identity,artifactSet:"immutable-v1",stableMirrors:_t(e,t),...i?.previousGeneration?{previousGeneration:i.previousGeneration}:{},...i?.publication?{publication:i.publication}:{},publishedAt:i?.publishedAt??n().toISOString()};return C(m(a,"state.json"),d,{spacing:2,trailingNewline:!0}),d}function hd(e,t,r=()=>new Date){if(!I(e)||!I(t))throw new Error("metadata-only generation refresh requires stable database and metadata files");let n=ne(e),i=L(e),o=Mt({generationRoot:i,databasePath:e,indexPath:I(m(B(e),"index.scip"))?m(B(e),"index.scip"):void 0,metadataPath:t}),a=n&&n.currentGeneration!==o.identity?_n(e,n.currentGeneration):void 0,s={version:Y,currentGeneration:o.identity,artifactSet:"immutable-v1",stableMirrors:_t(e,m(B(e),"index.scip")),...a?{previousGeneration:a}:{},...n?.publication?{publication:n.publication}:{},publishedAt:r().toISOString()};return C(m(L(e),"state.json"),s,{spacing:2,trailingNewline:!0}),Bn(e,{now:r}),s}function Bn(e,t={}){let r=Ga(t.limits),i=(t.now??(()=>new Date))().toISOString(),o=te(sr(e),{waitMs:0});if(!o)return{state:"deferred",generationCount:0,logicalBytes:0,protectedGenerations:0,activeReaderLeases:0,staleReaderLeasesRemoved:0,malformedReaderLeases:0,removedGenerations:0,removedLogicalBytes:0,limits:r,at:i,reason:"another process owns local generation retention"};try{let a=ne(e),s=_a(e),c=cr(e,s.map(y=>y.identity),{isProcessAlive:t.isProcessAlive??rr,readProcessIdentity:t.readProcessIdentity??tr}),d=new Set(c.protectedGenerations);a?.currentGeneration&&d.add(a.currentGeneration),a?.previousGeneration?.generationIdentity&&d.add(a.previousGeneration.generationIdentity);let l=s.length,p=s.reduce((y,k)=>y+k.logicalBytes,0),u=0,b=0;for(let y of s){if(l<=r.maxGenerations&&p<=r.maxLogicalBytes)break;d.has(y.identity)||(t.onBeforeRemove?.(y.identity),ye(y.path,{recursive:!0,force:!0}),l-=1,p-=y.logicalBytes,u+=1,b+=y.logicalBytes)}let g=l>r.maxGenerations||p>r.maxLogicalBytes,h={state:g?"protected":u>0?"collected":"within-bounds",generationCount:l,logicalBytes:p,protectedGenerations:d.size,activeReaderLeases:c.activeLeases,staleReaderLeasesRemoved:c.staleLeasesRemoved,malformedReaderLeases:c.malformedLeases,removedGenerations:u,removedLogicalBytes:b,limits:r,at:i,...g?{reason:c.malformedLeases>0?"malformed reader ownership evidence fails closed":"retention bounds cannot be met without deleting a protected generation"}:{}};return Cn(e,h),h}catch(a){let s={state:"error",generationCount:0,logicalBytes:0,protectedGenerations:0,activeReaderLeases:0,staleReaderLeasesRemoved:0,malformedReaderLeases:0,removedGenerations:0,removedLogicalBytes:0,limits:r,at:i,reason:a instanceof Error?a.message:String(a)};try{Cn(e,s)}catch{}return s}finally{o.release()}}function Ga(e={}){let t={...Oa,...e};if(!Number.isSafeInteger(t.maxGenerations)||t.maxGenerations<2)throw new Error("Local SQLite generation retention must keep at least current and previous generations.");if(!Number.isSafeInteger(t.maxLogicalBytes)||t.maxLogicalBytes<=0)throw new Error("Local SQLite generation byte retention must be a positive safe integer.");return t}function _a(e){let t=L(e);return I(t)?Bt(t,{withFileTypes:!0}).filter(r=>r.isDirectory()&&/^[a-f0-9]{64}$/.test(r.name)).map(r=>{let n=m(t,r.name),i=De(t,r.name),o=i?i.database.size+(i.index?.size??0)+(i.metadata?.size??0):Gn(n);return{identity:r.name,path:n,logicalBytes:o,modifiedAtMs:J(n).mtimeMs}}).sort((r,n)=>r.modifiedAtMs-n.modifiedAtMs||r.identity.localeCompare(n.identity)):[]}function Gn(e){let t=0;for(let r of Bt(e,{withFileTypes:!0})){let n=m(e,r.name);r.isDirectory()?t+=Gn(n):r.isFile()&&(t+=J(n).size)}return t}function Cn(e,t){Pe(m(L(e),"gc.json"),t,{spacing:2,trailingNewline:!0})}function qe(e,t=m(B(e),"meta.json")){let r=m(L(e),"state.json");if(!I(r))return{state:"legacy",statePath:r};let n=ne(e);if(!n)return{state:"invalid",statePath:r,reason:"generation state is malformed"};try{let i=Le(e,n.currentGeneration),o=i!==null,a=i?Ma(e,t,i,n):!1,s=n.previousGeneration?I(m(B(e),n.previousGeneration.databasePath)):!0;return!a||!o||!s?{state:"drifted",statePath:r,currentMatches:a,recoveryExists:s,generation:n,reason:o?a?"retained recovery database is missing":"stable database or metadata no longer matches the published generation":"published immutable generation is missing"}:{state:"current",statePath:r,currentMatches:a,recoveryExists:s,generation:n}}catch(i){return{state:"drifted",statePath:r,currentMatches:!1,recoveryExists:!1,generation:n,reason:i instanceof Error?i.message:String(i)}}}function Ma(e,t,r,n){if(n.stableMirrors&&(n.stableMirrors.databaseFileIdentity!==ie(e)||n.stableMirrors.indexFileIdentity!==void 0&&n.stableMirrors.indexFileIdentity!==ie(m(B(e),"index.scip")))||!Ct(e,r.database))return!1;let i=m(B(e),"index.scip");if(r.index&&!Ct(i,r.index))return!1;if(!r.metadata)return!I(t);if(!I(t))return!1;let o=m(L(e),r.identity,r.metadata.file);return I(o)&&z(_(t,"reindex metadata"))===z(_(o,"immutable reindex metadata"))}function Ct(e,t){return I(e)&&J(e).isFile()&&J(e).size===t.size}function Fa(e){let t=Ba(e.outputDb,e.outputScip,e.metaPath);return t?_n(e.outputDb,t.currentGeneration):void 0}function Na(e,t){if(!e.preserveOutputScip)return;if(!t)throw new Error("deferred SCIP publication requires an accepted immutable generation");let r=qe(e.outputDb,e.metaPath);if(r.state!=="current"||r.generation.currentGeneration!==t.generationIdentity){let i=r.state==="current"?"generation identity changed":"reason"in r?r.reason:`generation state is ${r.state}`;throw new Error(`deferred SCIP publication requires a verified accepted companion: ${i}`)}let n=Le(e.outputDb,t.generationIdentity);if(!n?.index||!Ct(e.outputScip,n.index))throw new Error("deferred SCIP publication requires the verified accepted index artifact");return n.index}function _t(e,t){return{databaseFileIdentity:ie(e),...I(t)?{indexFileIdentity:ie(t)}:{}}}function _n(e,t){let r=m(L(e),t),n=m(r,Gt(e)),i=m(r,"meta.json");return{generationIdentity:t,databasePath:kn(B(e),n),...I(i)?{metadataPath:kn(B(e),i)}:{}}}function $a(e){if(I(e))for(let t of Bt(e,{withFileTypes:!0}))t.isDirectory()&&t.name.endsWith(".tmp")&&ye(m(e,t.name),{recursive:!0,force:!0})}function ja(e,t,r=m(B(t),"index.scip")){let n=Ot("sha256").update("sqlite-generation-artifacts-v1\0");return n.update(We(t)),I(r)&&n.update(`\0${We(r)}`),I(e)&&n.update(`\0${z(_(e,"reindex metadata"))}`),n.digest("hex")}function Mt(e){let t=At(e.databasePath),r=e.indexPath?e.verifiedIndexArtifact?qa(e.indexPath,e.verifiedIndexArtifact):At(e.indexPath):void 0,n=e.metadataPath?At(e.metadataPath):void 0,i=e.forcedIdentity??Wa(t,r,e.metadataPath),o=m(e.generationRoot,i),a=m(o,it);if(I(a)){let d=De(e.generationRoot,i);if(d&&Mn(o,d.database,t)&&Ja(o,d.index,r)&&Va(o,d.metadata,e.metadataPath))return{identity:i,directorySync:$(e.generationRoot)};throw new Error(`SQLite generation ${i} already exists with different or corrupt artifacts.`)}let s=[Ee(e.generationRoot)];$a(e.generationRoot);let c=`${o}.${process.pid}.${Date.now()}.tmp`;ye(c,{recursive:!0,force:!0}),Da(c,{recursive:!0});try{s.push(Lt(e.databasePath,m(c,t.file))),r&&e.indexPath&&s.push(Lt(e.indexPath,m(c,r.file))),n&&e.metadataPath&&s.push(Lt(e.metadataPath,m(c,n.file)));let d=C(m(c,it),{version:ar,identity:i,database:t,...r?{index:r}:{},...n?{metadata:n}:{}},{spacing:2,trailingNewline:!0});d.directorySync!=="not-requested"&&s.push(d.directorySync),s.push($(c)),kt(c,o),s.push($(e.generationRoot))}finally{ye(c,{recursive:!0,force:!0})}return{identity:i,directorySync:re(...s)}}function Wa(e,t,r){let n=Ot("sha256").update("sqlite-generation-artifacts-v1\0");return n.update(e.sha256),t&&n.update(`\0${t.sha256}`),r&&n.update(`\0${z(_(r,"reindex metadata"))}`),n.digest("hex")}function At(e){return{file:Gt(e),size:J(e).size,sha256:We(e)}}function qa(e,t){if(t.file!==Gt(e)||J(e).size!==t.size)throw new Error(`verified SQLite generation artifact changed before publication: ${e}`);return t}function We(e){let t=Ot("sha256"),r=ka(e,"r"),n=Buffer.allocUnsafe(1024*1024);try{for(;;){let i=za(r,n);if(i===0)break;t.update(n.subarray(0,i))}}finally{La(r)}return t.digest("hex")}function za(e,t){let r=0;for(;r<t.length;){let n=Ca(e,t,r,t.length-r,null);if(r+=n,n===0)break}return r}function Lt(e,t){return Te(e,t,{mode:292})}function Mn(e,t,r){let n=m(e,t.file);return t.file===r.file&&t.size===r.size&&t.sha256===r.sha256&&I(n)&&J(n).size===t.size&&We(n)===t.sha256}function Ja(e,t,r){return!t||!r?t===r:Mn(e,t,r)}function Va(e,t,r){if(!t||!r)return t===void 0&&r===void 0;let n=m(e,t.file);return I(n)&&z(_(n,"stored reindex metadata"))===z(_(r,"candidate reindex metadata"))}function Dt(e,t){ye(`${t}.tmp-replace`,{force:!0}),kt(e,`${t}.tmp-replace`),kt(`${t}.tmp-replace`,t)}import{createHash as Vn,randomUUID as Za}from"crypto";import{existsSync as q,lstatSync as $t,mkdirSync as Q,mkdtempSync as Un,readdirSync as Hn,realpathSync as Yn,renameSync as U,rmSync as W,statSync as Ue}from"fs";import{dirname as jt,join as f,resolve as V}from"path";import{setTimeout as es}from"timers/promises";import{pathToFileURL as jn}from"url";import ts from"better-sqlite3";import{lstatSync as Ua,readdirSync as Ha}from"fs";import{join as Ya,relative as Ka,resolve as Ft,sep as Xa}from"path";var he=1,Nt="language-indexes",Fn=["index.db","index.scip","meta.json"],Nn=[Nt,pe,ge];function ze(e){let t=[];for(let r of Fn)Qa(e,r),t.push(r);for(let r of Nn)$n(e,r,t);return{version:he,files:t.sort()}}function Je(e){if(!e||e.includes("\0")||e.startsWith("/")||e.includes("\\"))throw new Error(`invalid index artifact path: ${e||"<empty>"}`);let t=e.split("/");if(t.some(n=>!n||n==="."||n===".."))throw new Error(`invalid index artifact path: ${e}`);let r=t[0];if(!Fn.includes(e)&&!Nn.includes(r))throw new Error(`index artifact path is not shareable: ${e}`);return e}function G(e,t){let r=Je(t),n=Ft(e),i=Ft(n,...r.split("/"));if(i!==n&&!i.startsWith(`${n}${Xa}`))throw new Error(`index artifact escapes cache: ${t}`);return i}function $n(e,t,r){let n=Ya(e,t),i;try{i=Ha(n,{withFileTypes:!0,encoding:"utf8"})}catch{return}for(let o of i){let a=`${t}/${o.name}`;if(o.isSymbolicLink())throw new Error(`index artifact cannot be a symlink: ${a}`);o.isDirectory()?$n(e,a,r):o.isFile()&&r.push(Je(a))}}function Qa(e,t){let r=G(e,t),n;try{n=Ua(r)}catch{throw new Error(`required index artifact is missing: ${t}`)}if(!n.isFile()||n.isSymbolicLink())throw new Error(`required index artifact is not a regular file: ${t}`);if(Ka(Ft(e),r).startsWith(".."))throw new Error(`index artifact escapes cache: ${t}`)}var Wt=1,Wn="SCIP_QUERY_SHARED_CACHE",rs=2,Ve=JSON.stringify({cliVersion:ur,artifactCatalogVersion:he,postIndexAugmentationSchemaVersion:rs,sqliteGenerationStoreVersion:Y,typescriptFragmentStoreVersion:vt,typescriptOverlayStoreVersion:je}),qt="manifest.json",Kn="shared-cache.json";var zt=[Nt,pe,ge];function ns(e,t){if(!e.clean||!e.treeOid)return;let r=ri(JSON.stringify({version:Wt,repositoryId:e.repositoryId,treeOid:e.treeOid,fingerprint:Xt(t),producerIdentity:Ve}));return{repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:e.treeOid,fingerprint:t,producerIdentity:Ve,generationId:r,repositoryCacheDir:gr(e.repositoryId)}}function Hd(e,t,r){if(!gs(r))return!1;let n=ns(e,r);if(!n)return!1;try{let i=ds(t);if(!i||i.repositoryId!==e.repositoryId||i.worktreeId!==e.worktreeId)return!1;let o=JSON.parse(P(f(n.repositoryCacheDir,"worktrees",`${i.worktreeId}.json`),{inputKind:"worktree cache lease",maxBytes:T}));return o.version!==1||o.repositoryId!==i.repositoryId||o.worktreeId!==i.worktreeId||V(o.projectRoot)!==V(e.projectRoot)||o.treeOid!==e.treeOid||V(o.localCacheDir)!==V(t)||o.ownershipChecksum!==Jt(o)||o.baseGenerationId!==n.generationId||o.activeGenerationId!==n.generationId?!1:H(n,!1)!==null}catch{return!1}}function Yd(e,t,r){if(process.env[Wn]==="0")return`${Wn}=0`;if(!mr(r))return"explicit cache or database override";if(ot(jt(t))!==ot(pr(e))||t!==f(jt(t),"index.db"))return"index database is outside the managed worktree cache"}function H(e,t=!0){let r=Vt(e),n;try{n=Xn(P(f(r,qt),{inputKind:"shared-generation manifest",maxBytes:T}))}catch{return null}if(n.generationId!==e.generationId||n.repositoryId!==e.repositoryId||n.treeOid!==e.treeOid||n.producerIdentity!==e.producerIdentity||!Ie(n.fingerprint,e.fingerprint)||!ss(r))return null;if(!t)return n;try{for(let i of n.artifacts){let o=G(r,i.path),a=Ue(o);if(!a.isFile()||a.size!==i.size||we(o,{inputKind:"shared-generation artifact",maxBytes:R})!==i.sha256)return null}}catch{return null}return n}function Kd(e,t,r,n){if(!e.treeOid)return null;let i=at(t,r),o=f(fr(),"repositories",e.repositoryId),a;try{let d=$t(o);if(!d.isDirectory()||d.isSymbolicLink())return null;a=Yn(o)}catch{return null}let s=f(a,"generations"),c=[];try{for(let d of Hn(s)){if(!/^[a-f0-9]{64}$/.test(d))continue;let l=f(s,d),p;try{p=$t(l)}catch{continue}if(!(!p.isDirectory()||p.isSymbolicLink()))try{let u=Xn(P(f(l,qt),{inputKind:"shared-generation baseline manifest",maxBytes:T}));u.generationId===d&&u.repositoryId===e.repositoryId&&u.producerIdentity===Ve&&cs(u.fingerprint,i)&&c.push(u)}catch{continue}}}catch{return null}c.sort((d,l)=>{let p=d.treeOid===e.treeOid?0:1,u=l.treeOid===e.treeOid?0:1;if(p!==u)return p-u;if(n){let g=Jn(d.fingerprint,n)-Jn(l.fingerprint,n);if(g!==0)return g}return Date.parse(l.createdAt)-Date.parse(d.createdAt)||d.generationId.localeCompare(l.generationId)});for(let d of c){let l={repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:d.treeOid,fingerprint:d.fingerprint,producerIdentity:d.producerIdentity,generationId:d.generationId,repositoryCacheDir:a},p=H(l);if(p)return{snapshot:l,manifest:p}}return null}function Xd(e){let t=te(f(e.snapshot.repositoryCacheDir,"locks",`${e.snapshot.generationId}.publish.lock`));if(!t)throw new Error(`shared generation publication is already in progress for ${e.snapshot.generationId}`);try{return is(e)}finally{t.release()}}function is(e){let t=H(e.snapshot);if(t)return qn(e.snapshot,t);if(!ti(e.sourceCacheDir,e.sourceProjectRoot,e.snapshot.fingerprint))throw new Error("source index is incomplete, incompatible, or corrupt");let r=zn(e.sourceCacheDir);if(!r)throw new Error("source index artifacts are incomplete");let n=ze(e.sourceCacheDir),i=f(e.snapshot.repositoryCacheDir,"generations"),o=[Ee(i)],a=Un(f(i,`.tmp-${process.pid}-`));try{let s=[];for(let g of n.files){let h=G(e.sourceCacheDir,g),y=G(a,g);o.push(be(h,y,292)),e.onPublicationStage?.("after-artifact-flushed",g);let k=Ue(y).size;s.push({path:g,size:k,sha256:we(y,{inputKind:"staged shared-generation artifact",maxBytes:R})})}let c=de(v(f(a,"index.scip"),{inputKind:"staged shared SCIP index",maxBytes:R}));if(!c)throw new Error("shared SCIP generation has no project root metadata");let d=Ut(e.sourceProjectRoot);if(c!==d)throw new Error("shared SCIP generation root does not match its source worktree");if(zn(e.sourceCacheDir)!==r||e.sourceStillValid&&!e.sourceStillValid())throw new Error("source index changed while staging a shared generation");let l={version:Wt,artifactCatalogVersion:he,generationId:e.snapshot.generationId,repositoryId:e.snapshot.repositoryId,treeOid:e.snapshot.treeOid,fingerprint:e.snapshot.fingerprint,producerIdentity:e.snapshot.producerIdentity,sourceProjectRoot:e.sourceProjectRoot,scipProjectRoot:c,createdAt:(e.now??(()=>new Date))().toISOString(),artifacts:s.sort((g,h)=>g.path.localeCompare(h.path))},p=C(f(a,qt),l,{spacing:2,trailingNewline:!0});p.directorySync!=="not-requested"&&o.push(p.directorySync),e.onPublicationStage?.("after-manifest-flushed"),o.push($(a)),e.onPublicationStage?.("after-staging-directory-synced");let u=Vt(e.snapshot);try{if(q(u)&&!H(e.snapshot)){let g=`${u}.corrupt-${process.pid}-${Date.now()}`;U(u,g),W(g,{recursive:!0,force:!0})}U(a,u)}catch(g){let h=H(e.snapshot);if(h)return qn(e.snapshot,h);throw g}e.onPublicationStage?.("after-generation-renamed"),o.push($(i)),e.onPublicationStage?.("after-generations-directory-synced");let b=re(...o);return{kind:"published",manifest:l,achievedDurability:b==="synced"?"directory-durable":"file-flushed",directorySync:b}}finally{W(a,{recursive:!0,force:!0})}}function qn(e,t){let r=$(f(e.repositoryCacheDir,"generations"));return{kind:"existing",manifest:t,achievedDurability:r==="synced"?"directory-durable":"file-flushed",directorySync:r}}function Qd(e){let t=Vt(e.snapshot);Q(e.targetCacheDir,{recursive:!0});let r=te(f(e.targetCacheDir,"cache-lifecycle.lock"),{waitMs:e.lockWaitMs??3e4});if(!r)throw new Error("timed out waiting for another cache hydration");let n,i,o=!1;try{n=Un(f(e.targetCacheDir,".shared-hydrate-")),ps(e.manifest,e.snapshot);for(let c of e.manifest.artifacts){let d=G(t,c.path),l=G(n,c.path);if(be(d,l),Ue(l).size!==c.size||we(l,{inputKind:"hydrated shared-generation artifact",maxBytes:R})!==c.sha256)throw new Error(`shared artifact is corrupt: ${c.path}`)}let a=Ut(e.targetProjectRoot);if(a!==e.manifest.scipProjectRoot)for(let c of e.manifest.artifacts)c.path.endsWith(".scip")&&en(G(n,c.path),e.manifest.scipProjectRoot,a);if(!ti(n,e.targetProjectRoot,e.snapshot.fingerprint,!1))throw new Error("staged shared generation failed completeness or integrity validation");i=ls(e.targetCacheDir,n),o=!0,us(n,e.targetCacheDir,i),On({tempOutputScip:f(n,"index.scip"),tempOutputDb:f(n,"index.db"),tempMetaPath:f(n,"meta.json"),outputScip:f(e.targetCacheDir,"index.scip"),outputDb:f(e.targetCacheDir,"index.db"),metaPath:f(e.targetCacheDir,"meta.json"),now:e.now});let s=qe(f(e.targetCacheDir,"index.db"),f(e.targetCacheDir,"meta.json"));if(s.state==="invalid"||s.state==="drifted")throw new Error(`hydrated SQLite generation failed validation: ${s.reason}`);e.persistLease!==!1&&os(e.snapshot,e.targetCacheDir,e.action??"attached",e.now)}catch(a){throw o&&i&&fs(e.targetCacheDir,i),a}finally{n&&W(n,{recursive:!0,force:!0}),r.release()}}async function Zd(e,t={}){let r=t.timeoutMs??3e4,n=t.pollMs??100,i=t.now??ve,o=i()+r,a=f(e.repositoryCacheDir,"locks"),s=f(a,`${e.generationId}.lock`),c=d=>{if(!d||typeof d!="object"||Array.isArray(d))return null;let l=d.pid;return typeof l=="number"&&Number.isSafeInteger(l)&&l>0?{pid:l}:null};for(;i()<=o;){if(H(e))return{kind:"generation-ready"};let d=Re(s,{kind:"shared-generation-build",detail:{generationId:e.generationId},parseLegacy:c});if(d.kind==="acquired")return{kind:"owner",release:()=>d.lock.release()};let l=o-i();if(l<=0)break;await es(Math.min(n,l))}return H(e)?{kind:"generation-ready"}:{kind:"timeout"}}function os(e,t,r,n=void 0){let i={version:1,repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:e.treeOid,localCacheDir:t,baseGenerationId:e.generationId,activeGenerationId:e.generationId,lastAction:r,lastSeenAt:(n??(()=>new Date))().toISOString()},o={...i,ownershipChecksum:Jt(i)};return Zn(e.repositoryCacheDir,o,!0),o}function el(e,t,r=void 0){let n={version:1,repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:e.treeOid,localCacheDir:t,baseGenerationId:e.generationId,lastAction:"overlay",lastReason:`private cache forked from shared baseline ${e.generationId}`,lastSeenAt:(r??(()=>new Date))().toISOString()},i={...n,ownershipChecksum:Jt(n)};return Zn(e.repositoryCacheDir,i,!0),i}function Jt(e){return ri(JSON.stringify({version:1,repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:V(e.projectRoot),localCacheDir:V(e.localCacheDir)}))}function Xn(e){let t=JSON.parse(e);if(t.version!==Wt||t.artifactCatalogVersion!==he||typeof t.generationId!="string"||!/^[a-f0-9]{64}$/.test(t.generationId)||typeof t.repositoryId!="string"||!/^[a-f0-9]{24}$/.test(t.repositoryId)||typeof t.treeOid!="string"||!t.treeOid||typeof t.producerIdentity!="string"||t.producerIdentity!==Ve||typeof t.sourceProjectRoot!="string"||typeof t.scipProjectRoot!="string"||typeof t.createdAt!="string"||!Number.isFinite(Date.parse(t.createdAt))||!t.fingerprint||!Array.isArray(t.artifacts))throw new Error("invalid shared generation manifest");let r=new Set;for(let n of t.artifacts){if(!n||typeof n.path!="string"||typeof n.size!="number"||n.size<0||typeof n.sha256!="string"||!/^[a-f0-9]{64}$/.test(n.sha256))throw new Error("invalid shared generation artifact");if(Je(n.path),r.has(n.path))throw new Error(`duplicate shared generation artifact: ${n.path}`);r.add(n.path)}for(let n of["index.db","index.scip","meta.json"])if(!r.has(n))throw new Error(`shared generation is missing ${n}`);return t}function be(e,t,r=384){return Te(e,t,{mode:r})}function as(e,t,r){Q(e,{recursive:!0}),C(f(e,Kn),{version:1,repositoryId:t,worktreeId:r},{spacing:2,trailingNewline:!0})}function zn(e){try{let t=ze(e),r=Vn("sha256");for(let n of t.files){let i=G(e,n),o=Ue(i).size;r.update(n).update("\0").update(String(o)).update("\0"),er(i,{inputKind:"source-generation artifact",maxBytes:R},a=>r.update(a)),r.update("\0")}return r.digest("hex")}catch{return null}}function Qn(e){try{let t=Zt(P(f(e,"meta.json"),{inputKind:"reindex metadata",maxBytes:T}));return(t.kind==="legacy"||t.kind==="supported")&&t.capabilities.publishableGeneration?t.metadata:void 0}catch{return}}function ss(e){return Qn(e)?.scipCompanion!=="deferred"}function cs(e,t){let r=at(e.languages,e);return JSON.stringify(r)===JSON.stringify(t)}function Jn(e,t){let r=new Map(e.files.map(o=>[o.path,`${o.size}\0${o.hash}`])),n=new Map(t.files.map(o=>[o.path,`${o.size}\0${o.hash}`])),i=0;for(let[o,a]of r)n.get(o)!==a&&(i+=1);for(let o of n.keys())r.has(o)||(i+=1);return i}function Vt(e){return f(e.repositoryCacheDir,"generations",e.generationId)}function ds(e){let t=JSON.parse(P(f(e,Kn),{inputKind:"worktree cache pointer",maxBytes:T}));return t.version!==1||typeof t.repositoryId!="string"||!/^[a-f0-9]{24}$/.test(t.repositoryId)||typeof t.worktreeId!="string"||!/^[a-f0-9]{24}$/.test(t.worktreeId)?null:{version:t.version,repositoryId:t.repositoryId,worktreeId:t.worktreeId}}function Zn(e,t,r){let n=ir(e,{waitMs:5e3});if(!n)throw new Error("repository cache cleanup is busy");try{if(r){let o=t.activeGenerationId??t.baseGenerationId;if(!o||!q(f(e,"generations",o)))throw new Error("shared generation disappeared before its lease was attached")}let i=f(e,"worktrees");Q(i,{recursive:!0}),C(f(i,`${t.worktreeId}.json`),t,{spacing:2,trailingNewline:!0}),as(t.localCacheDir,t.repositoryId,t.worktreeId)}finally{n.release()}}function ls(e,t){let r=f(t,".rollback"),n=new Map,i=new Map;Q(r,{recursive:!0});for(let s of["index.scip","index.db","meta.json"]){let c=f(e,s),d=q(c);n.set(s,d),d&&be(c,f(r,"stable",s))}for(let s of zt){let c=f(e,s),d=q(c);if(d){let l=$t(c);if(!l.isDirectory()||l.isSymbolicLink())throw new Error(`managed artifact path is not a directory: ${s}`)}i.set(s,d)}let o=f(e,Ae),a=q(o);return a&&ei(o,f(r,"sqlite-generations")),{root:r,stableFiles:n,managedDirectories:i,generationStoreExisted:a}}function us(e,t,r){for(let n of zt){let i=f(t,n);if(r.managedDirectories.get(n)){let a=f(r.root,"managed",n);Q(jt(a),{recursive:!0}),U(i,a)}let o=f(e,n);q(o)&&U(o,i)}}function fs(e,t){for(let i of zt){let o=f(e,i),a=f(t.root,"managed",i);t.managedDirectories.get(i)?q(a)&&(W(o,{recursive:!0,force:!0}),U(a,o)):W(o,{recursive:!0,force:!0})}for(let[i,o]of t.stableFiles){let a=f(e,i);if(!o){W(a,{force:!0});continue}let s=`${a}.shared-restore-${Za()}`;be(f(t.root,"stable",i),s),W(a,{force:!0}),U(s,a)}let r=f(e,Ae);W(r,{recursive:!0,force:!0});let n=f(t.root,"sqlite-generations");t.generationStoreExisted&&q(n)&&U(n,r)}function ei(e,t){Q(t,{recursive:!0});for(let r of Hn(e,{withFileTypes:!0})){let n=f(e,r.name),i=f(t,r.name);if(r.isSymbolicLink())throw new Error(`managed cache backup cannot contain a symlink: ${n}`);r.isDirectory()?ei(n,i):r.isFile()&&be(n,i)}}function ps(e,t){if(e.generationId!==t.generationId||e.repositoryId!==t.repositoryId||e.treeOid!==t.treeOid||e.producerIdentity!==t.producerIdentity||!Ie(e.fingerprint,t.fingerprint))throw new Error("shared generation manifest does not match the requested snapshot")}function ti(e,t,r,n=!0,i=!0){try{let o=Qn(e);if(!o||o.scipCompanion==="deferred"||!Ie(Kt(o.fingerprint),r)||JSON.stringify([...o.indexedLanguages??[]].sort())!==JSON.stringify([...r.languages].sort()))return Se("source validation rejected metadata"),!1;let a=ze(e),s=qe(f(e,"index.db"),f(e,"meta.json"));if(n?s.state!=="current":s.state==="invalid"||s.state==="drifted")return Se(`source validation rejected SQLite generation state ${s.state}`),!1;let c=new ts(f(e,"index.db"),{readonly:!0,fileMustExist:!0});try{if(i){if(c.pragma("quick_check(1)",{simple:!0})!=="ok")return!1}else c.pragma("schema_version",{simple:!0})}finally{c.close()}let d=Ut(t),p=(i?a.files.filter(u=>u.endsWith(".scip")):["index.scip"]).every(u=>{let b=de(v(G(e,u),{inputKind:"shared SCIP validation artifact",maxBytes:R}));return b!==d&&Se(`source validation rejected SCIP root for ${u}: ${String(b)}`),b===d});return p||Se("source validation rejected SCIP project roots"),p}catch(o){return Se(`source validation failed: ${o instanceof Error?o.message:String(o)}`),!1}}function Se(e){process.env.SCIP_QUERY_DEBUG&&console.error(`shared-cache: ${e}`)}function Ut(e){try{return jn(Yn(e)).href}catch{return jn(V(e)).href}}function gs(e){if(!e||typeof e!="object")return!1;let t=e;return t.version===3&&Array.isArray(t.languages)&&typeof t.pnpmWorkspaces=="boolean"&&(t.typescriptProjectMode==="single"||t.typescriptProjectMode==="workspace")&&Array.isArray(t.typescriptProjects)&&Array.isArray(t.files)&&t.files.every(r=>r!==null&&typeof r=="object"&&typeof r.path=="string"&&typeof r.size=="number"&&typeof r.hash=="string"&&(r.semanticHash===void 0||typeof r.semanticHash=="string"))}function ri(e){return Vn("sha256").update(e).digest("hex")}export{bs as a,se as b,Is as c,E as d,_s as e,lt as f,Ai as g,Di as h,Ms as i,ki as j,Fs as k,Gi as l,Ns as m,_r as n,Me as o,nn as p,Vs as q,D as r,ce as s,_e as t,tc as u,Zr as v,lc as w,uc as x,fc as y,Jo as z,Tc as A,Pc as B,Ac as C,Oc as D,Uc as E,Hc as F,nd as G,id as H,od as I,On as J,Ba as K,hd as L,qe as M,ns as N,Hd as O,Yd as P,H as Q,Kd as R,Xd as S,Qd as T,Zd as U,os as V,el as W};
|
|
12
|
-
//# sourceMappingURL=chunk-WNTFFKAX.js.map
|
package/dist/chunk-WOIKCX6A.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as c}from"./chunk-N2ZSIIGR.js";import{x as a}from"./chunk-ODDUPDP7.js";var D=4;function m(e,i,t,r={}){return p(e,i,t,r.maxReexportDepth??D,0,new Set)}function p(e,i,t,r,s,o){let f=`${i}\0${t}`;if(o.has(f)||s>r)return[];o.add(f);let u=c(e,i).filter(n=>n.leaf===t);return u.length>0?u:a(e,i).flatMap(n=>n.sourcePath?n.kind==="named"&&!n.names.includes(t)?[]:p(e,n.sourcePath,t,r,s+1,new Set(o)):[])}export{m as a};
|
|
2
|
-
//# sourceMappingURL=chunk-WOIKCX6A.js.map
|
package/dist/chunk-WUN6KBHV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as o}from"./chunk-BOJ5SVE2.js";import{y as u}from"./chunk-JWTGMPIT.js";function P(e){let t=m(e.profile?.name),r=()=>{let d=e.candidates(),a=e.filterCandidate?d.filter(e.filterCandidate):d,C=e.orderCandidates?[...a].sort(e.orderCandidates):a,i=o(C,e.scanLimit);t={pipeline:e.profile?.name,loadedCandidates:d.length,filteredCandidates:a.length,scannedCandidates:i.length,evaluatedCandidates:0,matchedResults:0,emittedResults:0,scanLimitApplied:i.length<a.length,resultLimitApplied:!1};let f=e.prepare?.(i)??void 0,n=[];for(let c of i){t.evaluatedCandidates+=1;let s=e.evaluate(c,f);s&&n.push(s)}t.matchedResults=n.length,e.orderResults&&n.sort(e.orderResults);let l=typeof e.limit=="number"?n.slice(0,e.limit):n;return t.emittedResults=l.length,t.resultLimitApplied=l.length<n.length,e.onProfile?.({...t}),l};return e.profile?u(`candidate-pipeline:${e.profile.name}`,r,()=>({...p(e.profile?.metadata),...t})):r()}function m(e){return{pipeline:e,loadedCandidates:0,filteredCandidates:0,scannedCandidates:0,evaluatedCandidates:0,matchedResults:0,emittedResults:0,scanLimitApplied:!1,resultLimitApplied:!1}}function p(e){return typeof e=="function"?e():e??{}}export{P as a};
|
|
2
|
-
//# sourceMappingURL=chunk-WUN6KBHV.js.map
|
package/dist/chunk-WYCTJDVR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as N,c as y,d as b,e as O,g as T,h as _,i as z}from"./chunk-CEEZJXEF.js";import{a as B}from"./chunk-OSR2GEHQ.js";import{b as U}from"./chunk-2GRUZAQF.js";import{d as J}from"./chunk-SSK6LDPC.js";import{i as d}from"./chunk-3L2ZBPEX.js";import{b as v,c as g,m as $,o as P}from"./chunk-RTQ7NEKG.js";import{c as A}from"./chunk-IW5XQG5G.js";import{a as j,e as m}from"./chunk-HGFDYOVB.js";var ce={references:T,referenceMap:_,callerMap:(t,s)=>b(t).callerMap(s),calleeMap:q};function q(t,s){let a=j(),i=new Map,o=O(t,s),r=[],n=[],u=0,c=0,p=0,f=0,E=0,k=0,H=0;for(let{definition:e,callees:l}of o.hits)E+=1,l.length>0&&(k+=1,H+=l.length,i.set(e.symbolId,l));let h=K(t,o.hits);if(h.entries.length>0&&m("semantic.callees.prefetch-cache-write",()=>P(t,h.entries),()=>({entries:h.entries.length,sourceMissing:h.sourceMissing,skippedUnsupportedLanguage:h.skippedUnsupportedLanguage})),m("semantic.callees.cache-scan",()=>{for(let[e,l]of N(o.misses)){if(!y(e)){a&&(u+=l.length);continue}let R=d(t,e);if(!R){a&&(c+=l.length),n.push(...l);continue}let x=g(t,e,R),C=G(t,e);if(!C){n.push(...l);continue}let Y=$(t,e,x,C);for(let D of l){let L=Y.get(D.symbol)??null;if(L!==null){let M=V(L);if(M){a&&(p+=1),M.length>0&&i.set(D.symbolId,M);continue}a&&(f+=1)}r.push({def:D,contentHash:x,depsDigest:C})}}},()=>({definitions:s.length,skippedUnsupportedLanguage:u,sourceMissing:c,cacheHits:p,parseFailures:f,misses:r.length,unkeyed:n.length,inMemoryHits:E,inMemoryRows:k,inMemoryCalleeCount:H,resultRows:i.size,missSample:r.slice(0,8).map(e=>`${e.def.relativePath}#${e.def.symbol}`),unkeyedSample:n.slice(0,4).map(e=>`${e.relativePath}#${e.symbol}`)})),r.length===0&&n.length===0)return i;let I=[...n,...r.map(e=>e.def)],w=0,F=m("semantic.callees.compute-misses",()=>{let e=z(t,I);return w=e.size,e},()=>({definitions:I.length,misses:r.length,unkeyed:n.length,rows:w}));for(let[e,l]of F)i.set(e,l);let S=r.filter(e=>b(t).capability("semantic-callees",e.def.relativePath).available).map(e=>({relativePath:e.def.relativePath,symbol:e.def.symbol,contentHash:e.contentHash,depsDigest:e.depsDigest,payload:JSON.stringify(F.get(e.def.symbolId)??[])}));return S.length>0?m("semantic.callees.cache-write",()=>P(t,S),()=>({entries:S.length})):m("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:r.length})),i}function K(t,s){let a=[],i=new Map,o=0,r=0;for(let{definition:n,callees:u}of s){if(!y(n.relativePath)){r+=1;continue}if(!i.has(n.relativePath)){let p=d(t,n.relativePath),f=p?G(t,n.relativePath):null;i.set(n.relativePath,p&&f?{contentHash:g(t,n.relativePath,p),depsDigest:f}:null)}let c=i.get(n.relativePath);if(!c){o+=1;continue}a.push({relativePath:n.relativePath,symbol:n.symbol,contentHash:c.contentHash,depsDigest:c.depsDigest,payload:JSON.stringify(u)})}return{entries:a,sourceMissing:o,skippedUnsupportedLanguage:r}}var Q="typescript-callees-v2-callsite-line";function G(t,s){let a=y(s);if(a==="typescript")return B(t,s,Q)?.key??null;let i=X(t,s);return a==="rust"?v(JSON.stringify({kind:"semantic-callees",language:a,engine:J(t.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:i})):i}function V(t){try{return JSON.parse(t)}catch{return null}}var W=A("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(t,s){return W.get(t,s,()=>{let i=[...U(t).get(s)??[]].sort().map(o=>`${o}:${g(t,o,d(t,o))}`);return v(i.join("|"))})}export{ce as a,q as b};
|
|
2
|
-
//# sourceMappingURL=chunk-WYCTJDVR.js.map
|
package/dist/chunk-WYPL7GF7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as l}from"./chunk-3AF4TUFK.js";import{d as u}from"./chunk-JFMEXGFE.js";function a(e,r){return e.reason instanceof Error?e.reason:new Error(r)}function y(e,r){if(e?.aborted)throw a(e,r)}import{join as m}from"path";var w=e=>{if(!e||typeof e!="object"||Array.isArray(e))return null;let r=e.pid;return typeof r=="number"&&Number.isSafeInteger(r)&&r>0?{pid:r}:null};function h(e,r={}){return L(m(e,"gc.lock"),r)}function L(e,r={}){let i=r.waitMs??0,t=r.pollMs??10,o=r.now??u,n=o()+i;do{let c=b(e,r.directoryDurability);if(c)return d(c);let s=n-o();if(s<=0)return null;f(Math.min(t,s))}while(o()<=n);return null}async function D(e,r={}){let i=r.waitMs??0,t=r.pollMs??10,o=r.now??u,n=o()+i;do{y(r.signal,"Lock acquisition was aborted.");let c=b(e,r.directoryDurability);if(c)return d(c);let s=n-o();if(s<=0)return null;await k(Math.min(t,s),r.signal)}while(o()<=n);return null}function b(e,r){let i=l(e,{kind:"generic",parseLegacy:w,...r?{directoryDurability:r}:{}});return i.kind==="acquired"?i.lock:null}function d(e){return{release:()=>{e.release()}}}function f(e){let r=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(r,0,0,e)}function k(e,r){return r?.aborted?Promise.reject(a(r,"Lock acquisition was aborted.")):new Promise((i,t)=>{let o=setTimeout(()=>{r?.removeEventListener("abort",n),i()},e),n=()=>{clearTimeout(o),r?.removeEventListener("abort",n),t(r?a(r,"Lock acquisition was aborted."):new Error("Lock acquisition was aborted."))};r?.addEventListener("abort",n,{once:!0})})}export{a,y as b,h as c,L as d,D as e};
|
|
2
|
-
//# sourceMappingURL=chunk-WYPL7GF7.js.map
|
package/dist/chunk-XDAUYDFT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var a=[{id:"general-interprocedural-value-flow",families:["dataflow"],capability:"Whole-program definition-use flow through arbitrary calls and returns is unavailable.",consequence:"Missing dataflow edges cannot establish that a value never crosses an unmodeled call.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"heap-aliasing",families:["dataflow","state"],capability:"Heap points-to and cross-instance alias analysis are unavailable.",consequence:"Missing field or state edges cannot establish that two references never reach the same object.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"exceptional-flow",families:["execution","dataflow","temporal"],capability:"Interprocedural exception propagation and finally completion flow are unavailable.",consequence:"Normal-path reachability and ordering do not establish behavior after a throw or rejection.",recoverWith:["dependence-slice","inspect","code"]},{id:"reflection",families:["execution","runtime","identity","dependencies"],capability:"Reflective lookup, dynamic loading, and name-computed invocation are unavailable without exact evidence.",consequence:"Missing static edges cannot establish that a construct is unreachable through reflection.",recoverWith:["search","inspect","code"]},{id:"generated-dispatch",families:["execution","runtime","identity"],capability:"Dispatch tables or names created only by generated or unavailable source are unavailable.",consequence:"Missing dispatch edges cannot establish that no generated consumer exists.",recoverWith:["search","inspect","code"]},{id:"unsupported-framework-adapters",families:["runtime","dataflow","state","temporal"],capability:"Framework runtime crossings without a registered source adapter are unavailable.",consequence:"Missing boundary edges cannot establish that no producer, consumer, state effect, or ordering exists.",recoverWith:["search","inspect","code"]}];function s(t){let i=new Set(t);return a.filter(n=>n.families.some(r=>i.has(r)))}function u(t){return s(t).map(i=>`[${i.id}] ${i.capability} ${i.consequence} Recover selected paths with: ${i.recoverWith.map(n=>`scip-query ${n}`).join(", ")}.`)}var c=["incoming","outgoing","both"];function e(t,i,n,r={}){return{family:t,subtype:i,...r.match?{match:r.match}:{},directions:c,evidenceStrengths:r.strengths??["exact","derived","mixed"],supportCeiling:r.supportCeiling??"partial",establishes:n,nonClaims:r.nonClaims??[],recoverWith:r.recoverWith??["inspect","code"]}}var l=["predicate-consequence","predicate-alternative","predicate-fallthrough","predicate-case","predicate-default","predicate-return","predicate-throw","loop-iteration","loop-exit","exception-handler","finally-cleanup","handler-return","handler-throw"],d=["captured-value-to-state","constant-to-state","expression-to-state","property-to-state","return-to-state","value-to-state"],p=["await-completion-before","awaits-completion","inside-lock-scope","lexical-successor"],h=[{id:"indexed-program-identity",label:"SCIP/compiler identity and source ownership",requirements:["indexed-graph"],relations:[e("execution","call","The source construct may call the resolved target.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["Static may-call reachability does not prove that an invocation occurred at runtime."],recoverWith:["call-graph","inspect","code"]}),e("execution","result-callback","The referenced callable can produce the result consumed by this path.",{nonClaims:["A callback relationship does not prove invocation order or runtime selection."],recoverWith:["call-graph","inspect","code"]}),e("contract","uses-contract-symbol","The source construct refers to the identified contract symbol.",{supportCeiling:"exact",nonClaims:["Contract identity does not prove runtime invocation or behavioral conformance."],recoverWith:["hierarchy","inspect","code"]}),e("identity","references","The occurrence resolves to the identified compiler-owned symbol.",{supportCeiling:"exact",nonClaims:["A reference does not establish execution or value transfer."],recoverWith:["refs","trace","inspect"]}),e("ownership","contains","The owner contains the identified program construct.",{supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),e("ownership","contains-","The owner contains the identified program construct.",{match:"prefix",supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),e("ownership","owns-","The owner owns the identified source or runtime observation.",{match:"prefix",supportCeiling:"exact",nonClaims:["Observation ownership does not establish singleton lifetime or exclusive ownership."],recoverWith:["inspect","code"]}),e("dependencies","imports","The source file or module statically imports the indexed target.",{nonClaims:["An import does not establish that imported code executes."],recoverWith:["imports","deps","code"]}),e("dependencies","imports-external","The source region statically imports an external package.",{nonClaims:["An external import does not establish which package behavior executes."],recoverWith:["imports","code"]})]},{id:"runtime-boundary-join",label:"source-grounded runtime-boundary joins",requirements:["indexed-graph","source-facts"],relations:[e("runtime","runtime-handoff","A producer and consumer share a source-grounded runtime rendezvous.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["A candidate or unresolved join does not prove a runtime handoff."],recoverWith:["evidence","inspect","code"]}),e("runtime","discriminator-dispatch","A serialized discriminator selects the reported consumer.",{strengths:["exact","derived","mixed"],nonClaims:["The dispatch edge does not prove delivery, retry, or successful handling."],recoverWith:["evidence","inspect","code"]}),e("dataflow","serialized-discriminator-transfer","The producer serializes the discriminator consumed by dispatch.",{strengths:["exact","derived","mixed"],nonClaims:["This edge does not establish the flow of every payload field."],recoverWith:["value-flow","inspect","code"]}),e("temporal","enqueue-before-consume","The reported enqueue precedes a possible consume through the queue.",{strengths:["exact","derived","mixed"],nonClaims:["Queue order does not establish delivery time, uniqueness, retry count, or durability."],recoverWith:["evidence","inspect","code"]})]},{id:"parser-control-dependence",label:"parser-proved intraprocedural control dependence",requirements:["indexed-graph","source-facts"],relations:[...l.map(t=>e("execution",t,"The outcome is control-dependent on the reported predicate or handler.",{strengths:["exact"],nonClaims:["Local control dependence does not establish that the containing function executes."],recoverWith:["dependence-slice","inspect","code"]})),e("execution","returns","The selected construct contains the reported return terminal.",{strengths:["exact"],nonClaims:["A local return terminal does not establish that the containing callable executes."],recoverWith:["inspect","code"]}),e("execution","throws","The selected construct contains the reported throw terminal.",{strengths:["exact"],nonClaims:["A local throw terminal does not establish propagation, handling, or callable execution."],recoverWith:["inspect","code"]})]},{id:"bounded-static-value-flow",label:"compiler callsites and bounded static value evaluation",requirements:["indexed-graph","source-facts"],relations:["argument-to-parameter","constant-to-parameter","property-to-parameter","return-to-parameter","return-to-call-result"].map(t=>e("dataflow",t,"The reported value may reach the target through the evidenced callsite transfer.",{strengths:["exact","derived","mixed"],nonClaims:["This provider does not establish general local definition-use, alias, field, or heap flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}))},{id:"typescript-local-dependence",label:"TypeScript compiler identities, control-flow graph, and reaching definitions",requirements:["typescript-semantic"],relations:[e("dataflow","definition-to-use","The definition reaches the reported read on a feasible local control-flow path.",{strengths:["exact"],nonClaims:["Local reaching definitions do not establish heap aliasing, exceptional flow, or the runtime order of closure invocation."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("dataflow","value-to-definition","The reported right-hand-side read supplies the assigned local definition.",{strengths:["exact"],nonClaims:["A local assignment edge does not establish field or heap points-to flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("dataflow","closure-capture","The nested callable reads the reported binding from an enclosing callable.",{strengths:["candidate"],supportCeiling:"candidate",nonClaims:["Closure capture does not establish whether or when the nested callable executes."],recoverWith:["call-graph","inspect","code"]}),e("dataflow","field-definition-to-use","The reported same-owner field definition can reach the field read.",{strengths:["exact","candidate"],nonClaims:["Field-name identity does not establish whole-program heap aliasing or cross-instance flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("execution","control-dependence","Execution of the reported statement depends on the outcome of the predicate.",{strengths:["exact"],nonClaims:["Intraprocedural control dependence does not establish that the containing callable executes."],recoverWith:["dependence-slice","inspect","code"]})]},{id:"parser-state-temporal",label:"parser-proved local state and temporal facts",requirements:["indexed-graph","source-facts"],relations:[...d.map(t=>e("dataflow",t,"The reported source value is assigned into the identified state resource.",{strengths:["exact"],nonClaims:["The edge does not establish alias, heap, or later read flow."],recoverWith:["value-flow","inspect","code"]})),...["writes-resource","deletes-resource","reads-resource","enqueues-resource","consumes-resource"].map(t=>e("state",t,"The reported construct performs the named operation on the identified resource.",{strengths:["exact"],nonClaims:["A state operation does not establish transactionality, durability, or exclusive ownership."],recoverWith:["evidence","inspect","code"]})),...p.map(t=>e("temporal",t,"The reported source constructs have the named local ordering relationship.",{strengths:["exact"],nonClaims:["Local source order does not establish cross-process happens-before or durable completion."],recoverWith:["evidence","inspect","code"]}))]}];function m(t,i){let n=h.flatMap(r=>r.relations.filter(o=>o.family===t&&(o.match==="prefix"?i.startsWith(o.subtype):i===o.subtype)).map(o=>({provider:r,relation:o})));if(n.length>1)throw new Error(`Ambiguous graph relation provider for ${t}/${i}: ${n.map(r=>r.provider.id).join(", ")}`);return n[0]??null}export{u as a,m as b};
|
|
2
|
-
//# sourceMappingURL=chunk-XDAUYDFT.js.map
|
package/dist/chunk-XDQMU3BT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-OR2E3AGZ.js";import{f as o}from"./chunk-N5B2NILC.js";function g(e,r){return s(e).filter(t=>c({pattern:r,relativePath:t})).map(t=>({relativePath:t}))}function c(e,r){let t=typeof e=="string"?{pattern:e,relativePath:r}:e;if(typeof t.pattern!="string"||typeof t.relativePath!="string")throw new TypeError("pathMatchesGlob requires pattern and relativePath.");let n=o(t.pattern),a=o(t.relativePath);if(!/[*?]/.test(n))return a.includes(n);let l=n.includes("/")?n:`**/${n}`;return i(l.split("/"),a.split("/"))}function i(e,r){if(e.length===0)return r.length===0;let[t,...n]=e;return t==="**"?i(n,r)||r.length>0&&i(e,r.slice(1)):r.length===0||!f(t??"",r[0]??"")?!1:i(n,r.slice(1))}function f(e,r){let t="^";for(let n of e)n==="*"?t+="[^/]*":n==="?"?t+="[^/]":t+=p(n);return t+="$",new RegExp(t).test(r)}function p(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,c as b};
|
|
2
|
-
//# sourceMappingURL=chunk-XDQMU3BT.js.map
|
package/dist/chunk-XFA4SSO3.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-3TNRNKAT.js";import{a as D}from"./chunk-WIWY3CRX.js";import{c as C}from"./chunk-CJZXN4NU.js";import{a as I}from"./chunk-W7CXK74K.js";import{c as P}from"./chunk-E73UNJTF.js";import{b as F}from"./chunk-OSSESPDX.js";import{f as M,g as S}from"./chunk-XRYABF57.js";import{d as g}from"./chunk-N2ZSIIGR.js";function re(e,n={}){let t=new C(e).productionCallableDefinitions({scope:n.scope,requireCallableSymbol:!0,includeSuppressed:!0}),r=L(e,t),l=n.search?.trim().toLocaleLowerCase();return t.map(s=>j(e,s,r.get(s.symbolId)??[])).filter(s=>s!==null).map(s=>s.result).filter(s=>!l||T(s).includes(l)).sort(G)}function ie(e,n,o={}){let t=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=$(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 $(e,n){let o=S(e,n.symbol,n.relativePath),t=[];return w(o,["package-surface-file","transitive-package-surface"])&&D(e,n)&&t.push("package-public-export"),o.includes("rust-public-library")&&t.push("rust-public-library"),o.includes("framework-entrypoint")&&t.push("framework-dispatched-export"),w(o,["configured-file","configured-path-prefix","configured-qualified-var","configured-symbol-pattern"])&&t.push("configured-entry-root"),t}function w(e,n){return n.some(o=>e.includes(o))}function T(e){return[e.symbol,e.shortName,e.file,e.documentation??"",...e.evidence].join(`
|
|
2
|
-
`).toLocaleLowerCase()}function G(e,n){return N(e.confidence)-N(n.confidence)||e.file.localeCompare(n.file)||e.startLine-n.startLine||e.symbol.localeCompare(n.symbol)}function N(e){return e==="root"?0:1}function K(e,n,o){let t=new Map([[o.symbol,0]]),r=new Map,l=new Map([[o.symbol,o]]),s=new Map,f=new Map,m=[o];for(;m.length>0;){let i=n.calleeMap(m,{additive:!1,semantic:!1}),c=[];for(let d of m){let p=t.get(d.symbol)??0;r.set(d.symbol,k(d,p));for(let a of i.get(d.symbolId)??[]){let y=W(n,a,l);if(!y){let R=O(d,a);f.set(J(R),R);continue}let u=p+1,h=t.get(y.symbol);(h===void 0||u<h)&&t.set(y.symbol,u),r.set(y.symbol,k(y,Math.min(u,h??u)));let v=q(d,y,a);s.set(H(v),v),h===void 0&&c.push(y)}}m=c}return{symbols:[...r.values()].sort(Q),edges:[...s.values()].sort(U),externalCalls:[...f.values()].sort(V)}}function W(e,n,o){let t=o.get(n.symbol);if(t)return t;let r=e.definitionsForFile(n.file).find(l=>l.symbol===n.symbol)??null;return r&&o.set(r.symbol,r),r}function k(e,n){return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,depth:n}}function q(e,n,o){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),toFile:n.relativePath,source:o.source,evidenceStrength:o.source==="scip-chunk"?"candidate":"exact"}}function O(e,n){return{fromSymbol:e.symbol,fromShortName:g(e.symbol),fromFile:e.relativePath,toSymbol:n.symbol,toShortName:g(n.symbol),reportedFile:n.file,source:n.source,evidenceStrength:n.source==="scip-chunk"?"candidate":"exact"}}function z(e,n){let o=b(e.symbols,i=>i.file),t=b(e.edges.filter(i=>i.fromFile===i.toFile),i=>i.fromFile),r=b(e.externalCalls,i=>i.fromFile),l=A(e.edges.filter(i=>i.fromFile!==i.toFile)),s=b(l,i=>i.toRegionId),f=b(l,i=>i.fromRegionId);return{regions:[...o.entries()].map(([i,c])=>{let d=x(i),p=n.has(d),a=t.get(i)??[],y=r.get(i)??[];return{id:d,file:i,minDepth:Math.min(...c.map(u=>u.depth)),symbolCount:c.length,internalEdgeCount:a.length,externalCallCount:y.length,incomingRegionIds:E((s.get(d)??[]).map(u=>u.fromRegionId)),outgoingRegionIds:E((f.get(d)??[]).map(u=>u.toRegionId)),expanded:p,symbols:p?c:[],internalEdges:p?a:[],externalCalls:p?y:[]}}).sort((i,c)=>i.minDepth-c.minDepth||i.file.localeCompare(c.file)),regionEdges:l}}function A(e){let n=new Map;for(let o of e){let t=`${o.fromFile}\0${o.toFile}`,r=n.get(t)??[];r.push(o),n.set(t,r)}return[...n.values()].map(o=>{let t=o[0];return{fromRegionId:x(t.fromFile),fromFile:t.fromFile,toRegionId:x(t.toFile),toFile:t.toFile,callCount:o.length,exactCallCount:o.filter(r=>r.evidenceStrength==="exact").length,candidateCallCount:o.filter(r=>r.evidenceStrength==="candidate").length,fromSymbols:E(o.map(r=>r.fromShortName)),toSymbols:E(o.map(r=>r.toShortName)),evidence:E(o.map(r=>r.source))}}).sort((o,t)=>o.fromFile.localeCompare(t.fromFile)||o.toFile.localeCompare(t.toFile))}function x(e){return`file:${e}`}function E(e){return[...new Set(e)].sort()}function H(e){return`${e.fromSymbol}\0${e.toSymbol}`}function J(e){return`${e.fromSymbol}\0${e.toSymbol}`}function Q(e,n){return e.depth-n.depth||e.file.localeCompare(n.file)||e.symbol.localeCompare(n.symbol)}function U(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}function V(e,n){return e.fromFile.localeCompare(n.fromFile)||e.fromSymbol.localeCompare(n.fromSymbol)||e.toSymbol.localeCompare(n.toSymbol)}export{re as a,ie as b};
|
|
3
|
-
//# sourceMappingURL=chunk-XFA4SSO3.js.map
|
package/dist/chunk-XGZEP6GR.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as B,c as D,i as L,k as H}from"./chunk-HCXEQRFF.js";import{j as E,o as T}from"./chunk-TQPCBMWT.js";import{d as A}from"./chunk-KMVGRIO2.js";import{c as _}from"./chunk-CJZXN4NU.js";import{d as C,e as y}from"./chunk-N2ZSIIGR.js";import{a as N}from"./chunk-ODDUPDP7.js";var J=5;function se(e,n={}){let{base:i="HEAD",minContainment:r=.7,minCallees:s=3,minSiteCoverage:t=.4,maxHelpers:m=Number.POSITIVE_INFINITY,limit:c=20,scanLimit:d}=n,g=n.semantic!==!1,l=n.diffPlan??D(e,{base:i}),a={available:l.note!==B,base:i,changedFiles:l.changedFiles,helpersChecked:0,skipped:[],findings:[],...l.note?{note:l.note}:{}};if(!a.available||l.changedFiles.length===0)return a;let v=new _(e),x=new Set(l.changedFiles),j=new Map(l.renamedFiles.map(o=>[o.to,o.from]));if(n.baseContentAt&&n.baseContentResultAt)throw new Error("Specify only one of baseContentAt or baseContentResultAt.");let $=n.baseContentResultAt?n.baseContentResultAt:n.baseContentAt?Q(n.baseContentAt):L({projectRoot:e.config.projectRoot,base:i,preloadPaths:H(l)}),f=Z(v,x,j,$);if(f.unavailable)return a.available=!1,a.note=`Base content unavailable: ${f.unavailable.reason}`,a;if(f.definitions.length===0)return a;let k=f.definitions.slice(0,m);f.definitions.length>m&&(a.note=`helper scoring capped at ${m} of ${f.definitions.length} new symbols`);let z=v.calleeMap(k,{semantic:g}),q=k.map(o=>({def:o,callees:T((z.get(o.symbolId)??[]).map(p=>p.symbol))})),V=E(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,s),scanLimit:d,semantic:g}),M);for(let{def:o,callees:p}of q){let u=C(o.symbol);if(p.size<s){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:`fewer than ${s} meaningful callees \u2014 too small to score`});continue}let P=G(),w=Y(p,P);if(w===0){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let S=ee(e,o.symbolId);if(S.length===0){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}a.helpersChecked+=1;let I=K({candidateIndex:P,changed:x,helperCallees:p,helperFile:o.relativePath,helperSymbol:o.symbol,minContainment:r,minSiteCoverage:t,migratedFiles:S});I.length!==0&&(I.sort((h,b)=>O(b.migrationScope)-O(h.migrationScope)||b.containment-h.containment||b.siteCoverage-h.siteCoverage||h.file.localeCompare(b.file)),a.findings.push({helperSymbol:o.symbol,helperShortName:u,helperFile:o.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:w,migratedFiles:S.sort(),leftovers:I.slice(0,J)}))}return a.findings.sort((o,p)=>(p.leftovers[0]?.containment??0)-(o.leftovers[0]?.containment??0)||o.helperFile.localeCompare(p.helperFile)),a.findings=a.findings.slice(0,c),a}function K(e){let n=[],i=U(e.helperSymbol,e.helperFile,e.migratedFiles),r=new Set;for(let s of e.helperCallees)for(let t of e.candidateIndex.candidateIndexesByCallee.get(s)??[])r.add(t);for(let s of r){let t=e.candidateIndex.corpus[s];if(t.symbol===e.helperSymbol||e.changed.has(t.file)||t.callees.has(e.helperSymbol))continue;let m=A(e.helperCallees,t.callees);if(m<e.minContainment)continue;let c=[...e.helperCallees].filter(l=>t.callees.has(l)),d=t.callees.size===0?0:c.length/t.callees.size;if(d<e.minSiteCoverage||!c.some(l=>(e.candidateIndex.docFreq.get(l)??0)<=e.candidateIndex.ubiquityThreshold))continue;let g=W(i,t.symbol,t.file);n.push({symbol:t.symbol,shortName:C(t.symbol),file:t.file,...g,containment:m,siteCoverage:d,uniqueSiteCalleeCount:Math.max(0,t.callees.size-c.length),sharedCallees:c.map(C).sort()})}return n}function O(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,n,i){let r=new Set([...F(n),...R(y(e))]);for(let s of i)for(let t of F(s))r.add(t);return r}function W(e,n,i){let r=new Set([...F(i),...R(y(n))]);if(e.size===0||r.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let s=[...r].filter(t=>e.has(t)).sort();return s.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${s.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function F(e){return R(e.replace(/\.[^.]+$/,""))}function R(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1&&!X.has(n))}function Y(e,n){let i=0;for(let r of e)(n.docFreq.get(r)??0)<=n.ubiquityThreshold&&(i+=1);return i}function Z(e,n,i,r){let s=[];for(let t of e.productionCallableDefinitions({files:[...n],requireFunctionLikeSymbol:!0})){if(!n.has(t.relativePath))continue;let m=i.get(t.relativePath)??t.relativePath,c=r(m);if(c.state==="unavailable")return{definitions:[],unavailable:c};(c.state==="absent"||!new RegExp(`\\b${N(t.leaf)}\\b`).test(c.content))&&s.push(t)}return{definitions:s}}function Q(e){return n=>{let i=e(n);return i===null?{state:"absent"}:{state:"present",content:i}}}function ee(e,n){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
${e.pathExclusionsFor("ref_d")}`,n).map(r=>r.relative_path)}export{se as a};
|
|
8
|
-
//# sourceMappingURL=chunk-XGZEP6GR.js.map
|