scip-query 0.24.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 +247 -1
- package/README.md +111 -124
- 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-BociKRpF.d.ts → call-graph-evidence-CUtj8V2I.d.ts} +1 -1
- 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-E65ELFKU.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-BHKK5RJY.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-6ILKOOGH.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-OHIV323X.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-2GJSD5GY.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-A4WEAK35.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-GHNPACNP.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-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-4FR6GQIT.js → chunk-VF5JZICY.js} +2 -2
- 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-ATXPTSEI.js → chunk-X6RMKHJQ.js} +7 -7
- package/dist/{chunk-44IETFOU.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-ZLADLUE6.js +3 -0
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-MZPXPSUJ.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/{health-BI2a9WPy.d.ts → health-BtfmNrfa.d.ts} +5 -79
- 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 +1 -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.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.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 +1 -1
- 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 +15 -64
- 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.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.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 +1 -1
- 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 +27 -23
- 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 +34 -0
- package/docs/analyzer-inventory.md +2 -2
- 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-H3P6BR5G.js +0 -2
- package/dist/call-graph-VTG2CUOQ.js +0 -2
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2BMSSRBH.js +0 -2
- package/dist/chunk-2M2LSIMY.js +0 -7
- package/dist/chunk-2N6WBNDC.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2USA3S3P.js +0 -3
- package/dist/chunk-2VAHDDLM.js +0 -133
- package/dist/chunk-2XWIUW5Z.js +0 -455
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D4BOXW6.js +0 -20
- package/dist/chunk-3LO4FST5.js +0 -16
- package/dist/chunk-3WTY4LP2.js +0 -3
- package/dist/chunk-3Z5AMSK6.js +0 -29
- package/dist/chunk-4KBTHJLP.js +0 -2
- package/dist/chunk-5BIKR67W.js +0 -2
- package/dist/chunk-5PROPLHI.js +0 -2
- package/dist/chunk-5V7EPTII.js +0 -2
- package/dist/chunk-62LPZCBQ.js +0 -3
- package/dist/chunk-64O2JHQA.js +0 -2
- package/dist/chunk-6D4F5VWG.js +0 -10
- package/dist/chunk-6ERFBC3X.js +0 -3
- package/dist/chunk-6MFXCMZC.js +0 -2
- package/dist/chunk-6O7FACKB.js +0 -2
- package/dist/chunk-6TS3KOXR.js +0 -2
- package/dist/chunk-76QOU4PK.js +0 -3
- package/dist/chunk-7DUI77BN.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7F7T6DCR.js +0 -2
- package/dist/chunk-7H6VHWWJ.js +0 -2
- package/dist/chunk-7HXT6YLU.js +0 -5
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-7R4V5ES6.js +0 -6
- package/dist/chunk-7RIRIADH.js +0 -7
- package/dist/chunk-7ZLWLOGT.js +0 -2
- package/dist/chunk-AADQLOQ4.js +0 -38
- package/dist/chunk-AN76MGUE.js +0 -2
- package/dist/chunk-ANLNLY66.js +0 -2
- package/dist/chunk-AX7IDVFT.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B7MPDEAK.js +0 -3
- package/dist/chunk-BBB5FBX4.js +0 -2
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BJWFVAA5.js +0 -2
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BKZYTLGE.js +0 -35
- package/dist/chunk-BL6DCHQP.js +0 -2
- package/dist/chunk-BOW7SSQH.js +0 -43
- package/dist/chunk-C4RHHCKL.js +0 -7
- package/dist/chunk-C7C6AKAT.js +0 -117
- package/dist/chunk-CD6M6LS2.js +0 -16
- package/dist/chunk-CFE6PSG6.js +0 -2
- package/dist/chunk-CFNIGQMT.js +0 -2
- package/dist/chunk-CKBUBRYD.js +0 -2
- package/dist/chunk-CZW5MZ5B.js +0 -2
- package/dist/chunk-DBBZ63ZX.js +0 -2
- package/dist/chunk-DBN7DMJB.js +0 -18
- package/dist/chunk-DUULLZHZ.js +0 -3
- package/dist/chunk-DV5Y5NOS.js +0 -2
- package/dist/chunk-DZOIKCTM.js +0 -3
- package/dist/chunk-E4PKTOL3.js +0 -2
- package/dist/chunk-E7QR35ST.js +0 -2
- package/dist/chunk-EFSXAINW.js +0 -2
- package/dist/chunk-EHVEIEQN.js +0 -18
- package/dist/chunk-EHYDXE3Z.js +0 -2
- package/dist/chunk-EP63Y6LD.js +0 -2
- package/dist/chunk-EPX6NQN6.js +0 -4
- package/dist/chunk-ETC674NS.js +0 -5
- package/dist/chunk-F5GSBHC6.js +0 -3
- package/dist/chunk-FH3DGXC6.js +0 -2
- package/dist/chunk-FI7VGOR4.js +0 -16
- package/dist/chunk-FJF6VO2P.js +0 -2
- package/dist/chunk-FLMTCX5R.js +0 -2
- package/dist/chunk-FVFDOIM3.js +0 -2
- package/dist/chunk-G2HU5WRN.js +0 -2
- package/dist/chunk-G4ALYS4J.js +0 -2
- package/dist/chunk-G56I7K4W.js +0 -26
- package/dist/chunk-GC4DG2V5.js +0 -2
- package/dist/chunk-GG45PK4S.js +0 -4
- package/dist/chunk-GINH3YQU.js +0 -20
- package/dist/chunk-GTZZVLKJ.js +0 -2
- package/dist/chunk-GXXW5ZHH.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HAXXKRTD.js +0 -4
- package/dist/chunk-HEZWBAZY.js +0 -2
- package/dist/chunk-HMEWLMML.js +0 -2
- package/dist/chunk-HOBOVYPO.js +0 -11
- package/dist/chunk-HRFQ6GW5.js +0 -8
- package/dist/chunk-HX4X7KG3.js +0 -2
- package/dist/chunk-HYT2R7LX.js +0 -4
- package/dist/chunk-IKQVBVQL.js +0 -40
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-J6GLBBRK.js +0 -4
- package/dist/chunk-J7A4PWFX.js +0 -3
- package/dist/chunk-JCSAZ35V.js +0 -2
- package/dist/chunk-JDU2IV3A.js +0 -2
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JFMI5SGB.js +0 -4
- package/dist/chunk-JJP37RGX.js +0 -57
- package/dist/chunk-JZ2A7LDM.js +0 -5
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KNLQGXVH.js +0 -80
- package/dist/chunk-KVQCECPR.js +0 -2
- package/dist/chunk-KXXORBZ2.js +0 -4
- package/dist/chunk-L5KYH6U3.js +0 -35
- package/dist/chunk-L6XHYJPZ.js +0 -21
- package/dist/chunk-L7KTFEAV.js +0 -43
- package/dist/chunk-LDXHR5EL.js +0 -23
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-MHGDSBFX.js +0 -2
- package/dist/chunk-MLQVVDG3.js +0 -74
- package/dist/chunk-MOKUWRHO.js +0 -3
- package/dist/chunk-MPYAPMNE.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV6SPXCR.js +0 -7
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N55KIE46.js +0 -2
- package/dist/chunk-NB4D3BNM.js +0 -2
- package/dist/chunk-NGKBOT6G.js +0 -23
- package/dist/chunk-NJGKXKQF.js +0 -2
- package/dist/chunk-NJQISBL4.js +0 -8
- package/dist/chunk-NJT3ZEKY.js +0 -16
- package/dist/chunk-NKMKZP6A.js +0 -2
- package/dist/chunk-NODFZ6ED.js +0 -2
- package/dist/chunk-NSM5IEVW.js +0 -2
- package/dist/chunk-NTGUVNR2.js +0 -3
- package/dist/chunk-NU3KFF2O.js +0 -57
- package/dist/chunk-NWLVNU66.js +0 -557
- package/dist/chunk-NYKZMCRC.js +0 -4
- package/dist/chunk-O6BUXZEH.js +0 -6
- package/dist/chunk-ODPDP7A4.js +0 -3
- package/dist/chunk-OIAPEKMT.js +0 -3
- package/dist/chunk-OIOC5EHF.js +0 -3
- package/dist/chunk-ONPPQM4G.js +0 -2
- package/dist/chunk-OUHEZBYI.js +0 -2
- package/dist/chunk-OVGYW7UD.js +0 -29
- package/dist/chunk-OYKU4B3Y.js +0 -2
- package/dist/chunk-POBJ6FR2.js +0 -5
- package/dist/chunk-PSZPMMWN.js +0 -2
- package/dist/chunk-PXTRBKRK.js +0 -3
- package/dist/chunk-Q5JRIHT3.js +0 -4
- package/dist/chunk-Q7ATHARX.js +0 -2
- package/dist/chunk-Q7CSKIDM.js +0 -5
- package/dist/chunk-QBQE7ZJ5.js +0 -3
- package/dist/chunk-QH22UIXP.js +0 -5
- package/dist/chunk-QXCKQTKR.js +0 -60
- package/dist/chunk-RBAD4GJ2.js +0 -13
- package/dist/chunk-RMDPFPNW.js +0 -2
- package/dist/chunk-ROPJDEJZ.js +0 -4
- package/dist/chunk-RVZC6TJE.js +0 -2
- package/dist/chunk-S4QZBKSR.js +0 -3
- package/dist/chunk-SCPMZ73U.js +0 -2
- package/dist/chunk-SIAP5RGI.js +0 -73
- package/dist/chunk-SIX4RFR3.js +0 -3
- package/dist/chunk-SKKXTABJ.js +0 -16
- package/dist/chunk-SSRFUQBD.js +0 -2
- package/dist/chunk-SYVJEEUJ.js +0 -3
- package/dist/chunk-T3CZAZSI.js +0 -8
- package/dist/chunk-T6DWDI5E.js +0 -3
- package/dist/chunk-T6HRIROJ.js +0 -7
- package/dist/chunk-TAA7HXHE.js +0 -2
- package/dist/chunk-TJ2JQYT3.js +0 -2
- package/dist/chunk-TULNMD5T.js +0 -368
- package/dist/chunk-U2FPY5XA.js +0 -3
- package/dist/chunk-U3SXIMII.js +0 -38
- package/dist/chunk-U6KCHXJ4.js +0 -2
- package/dist/chunk-UH3XSKS5.js +0 -9
- package/dist/chunk-UIFUZVCC.js +0 -2
- package/dist/chunk-UXKURIVI.js +0 -2
- package/dist/chunk-V2RBODHL.js +0 -2
- package/dist/chunk-VBKUWB6N.js +0 -2
- package/dist/chunk-VBV6ALJE.js +0 -2
- package/dist/chunk-VDGFWCQV.js +0 -2
- package/dist/chunk-VDSDOEWF.js +0 -2
- package/dist/chunk-VZPWVCLN.js +0 -20
- package/dist/chunk-WDSFQDPN.js +0 -2
- package/dist/chunk-WFA35BGR.js +0 -7
- package/dist/chunk-WLMP3OCW.js +0 -2
- package/dist/chunk-WSA52GOR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-X3YVZAKZ.js +0 -5
- package/dist/chunk-X6OGVFIT.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XKXTR6ZI.js +0 -9
- package/dist/chunk-Y5DFAW5W.js +0 -4
- package/dist/chunk-YSYPDRD5.js +0 -3
- package/dist/chunk-ZFVPWH62.js +0 -5
- package/dist/chunk-ZGIHTH27.js +0 -2
- package/dist/chunk-ZGIQN2SX.js +0 -2
- package/dist/chunk-ZHG4WAHR.js +0 -12
- package/dist/chunk-ZKB2XUEN.js +0 -4
- package/dist/chunk-ZLMXIQLC.js +0 -21
- package/dist/chunk-ZMCQIHI4.js +0 -2
- package/dist/code-TAVIKWJI.js +0 -2
- package/dist/code-result-json-5FEFQCAQ.js +0 -2
- package/dist/command-descriptors-7BKH53Y3.js +0 -343
- package/dist/dataflow-GFBTVDH3.js +0 -2
- package/dist/dependence-slice-GWGQCODG.js +0 -2
- package/dist/deps-4QHVDPYA.js +0 -2
- package/dist/direct-navigation-4UBC6HNW.js +0 -3
- package/dist/entry-map-QCTF4RVY.js +0 -2
- package/dist/files-M2UBF5HJ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-2UIHRLW4.js +0 -2
- package/dist/imports-WIE3YZOB.js +0 -2
- package/dist/members-YKD636DA.js +0 -2
- package/dist/methods-VDF4IMYG.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-4UMDOOLO.js +0 -3
- package/dist/output-pagination-2GME6OPY.js +0 -19
- package/dist/project-reindex-XEQTRCV5.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 -79
- 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 -69
- 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 -49
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-JNK5CLM7.js +0 -2
- package/dist/refs-pagination-6BLRYGMV.js +0 -2
- package/dist/slice-PHPVNCWX.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-MQX5MPIV.js +0 -2
- package/dist/symbol-resolution-DBLVXLBC.js +0 -2
- package/dist/system-JOPKV4OG.js +0 -2
- package/dist/trace-I2P2YFH4.js +0 -2
- package/dist/value-flow-JJVMF7NP.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
- package/skills/conductor/SKILL.md +0 -110
- package/skills/conductor/agents/openai.yaml +0 -4
- package/skills/principal-maintainability-review/SKILL.md +0 -273
- package/skills/principal-maintainability-review/agents/openai.yaml +0 -4
- package/skills/scip-calibrate/SKILL.md +0 -102
- package/skills/scip-calibrate/agents/openai.yaml +0 -4
- package/skills/scip-claim-audit/SKILL.md +0 -113
- package/skills/scip-claim-audit/agents/openai.yaml +0 -4
- package/skills/scip-probe-reachability/SKILL.md +0 -93
- package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
- package/skills/scip-root-cause/SKILL.md +0 -160
- package/skills/scip-root-cause/agents/openai.yaml +0 -4
- package/skills/scip-system-compression/SKILL.md +0 -252
- package/skills/scip-system-compression/agents/openai.yaml +0 -4
- package/skills/scip-system-compression/references/compression-atlas.md +0 -116
- package/skills/scip-system-compression/references/compression-patterns.md +0 -87
- package/skills/scip-twin-drift/SKILL.md +0 -109
- package/skills/scip-twin-drift/agents/openai.yaml +0 -4
package/dist/chunk-RBAD4GJ2.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{A as G,B as Q,D as Qe,E as D,F as oe,G as Ze,H as be,I as et,J as ie,L as tt,e as qe,f as Ve,g as P,h as ze,i as We,j as He,k as q,l as Ke,m as K,n as Je,o as Xe,p as Ye,q as F,s as J,t as A,u as ge,v as Se,w as h,x as he,y as Ge,z as xe}from"./chunk-ZLMXIQLC.js";import{a as ye,c as X,e as Y,h as L}from"./chunk-ETC674NS.js";import{a as Ue,c as U,f as se,i as H}from"./chunk-KNLQGXVH.js";import{Ba as $e,Ca as Be,c as W}from"./chunk-JZ2A7LDM.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qt(e){return e.replace(/'''[\s\S]*?'''/g,w).replace(/"""[\s\S]*?"""/g,w).replace(/#.*$/gm,w).replace(/\/\/.*$/gm,w).replace(/\/\*[\s\S]*?\*\//g,w).replace(/`(?:\\[\s\S]|[^`])*`/g,w).replace(/'(?:\\.|[^'\\\r\n])*'/g,w).replace(/"(?:\\.|[^"\\\r\n])*"/g,w)}function gs(e){return rt(e,{maskStrings:!1})}function Ss(e){return rt(e,{maskStrings:!0})}function rt(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
|
|
2
|
-
`,n),a=i===-1?s:i;t+=Ne(e,n,a),n=a;continue}if(e[n]==="/"&&e[n+1]==="*"){let i=e.indexOf("*/",n+2),a=i===-1?s:i+2;t+=Ne(e,n,a),n=a;continue}let o=e[n];if(o==="`"||o==="'"||o==='"'){let i=o,a=n+1;for(;a<s;){if(e[a]==="\\"){a+=2;continue}if(e[a]===i){a+=1;break}if(i!=="`"&&e[a]===`
|
|
3
|
-
`)break;a+=1}t+=r.maskStrings?Ne(e,n,a):e.slice(n,a),n=a;continue}t+=o,n+=1}return t}function Ne(e,r,t){let n="";for(let s=r;s<t;s+=1)n+=e[s]===`
|
|
4
|
-
`?`
|
|
5
|
-
`:" ";return n}function w(e){return e.replace(/[^\r\n]/g," ")}var hs=se("stripped-lines",{clearGroups:["whole-project","source-file"]});Ue({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{ae=null,Z=""},clearFile:()=>{ae=null,Z=""}});var ae=null,Z="";function Vt(e){return ae===e||(ae=e,Z=qt(e)),Z}function k(e,r,t){let n=Vt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function V(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function Ie(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}var nt=new WeakMap,st=new Set(["call_expression","call","decorator","pair","string","string_literal","template_string","variable_declarator"]);function zt(e,r){let t=Array.isArray(r)?r:[r];if(!t.every(o=>st.has(o)))return e.descendantsOfType(r);let n=Wt(e);return t.length===1?n.get(t[0])??[]:t.flatMap(o=>n.get(o)??[]).sort((o,i)=>o.startIndex-i.startIndex)}function _e(e,r){let t=e.walk(),n=0,s=!1;for(;!s;){if(r(t),t.gotoFirstChild()){n+=1;continue}for(;;){if(n===0){s=!0;break}if(t.gotoNextSibling())break;t.gotoParent(),n-=1}}}function Wt(e){let r=nt.get(e);if(r)return r;let t=new Map;return _e(e,n=>{let s=n.nodeType;if(!st.has(s))return;let o=t.get(s);o?o.push(n.currentNode):t.set(s,[n.currentNode])}),nt.set(e,t),t}function it(e,r){r(e);for(let t of e.namedChildren)it(t,r)}var Ht=/(?:function|method|lambda)/u,ot=new WeakMap;function Kt(e){let r=ot.get(e);if(r)return r;let t=[];return _e(e,n=>{if(!n.nodeIsNamed)return;let s=n.nodeType;(s==="arrow_function"||Ht.test(s))&&t.push(n.currentNode)}),ot.set(e,t),t}function Jt(e,r,t){let n=null;for(let s of Kt(e))s.startPosition.row>r||s.endPosition.row<t||(!n||s.endIndex-s.startIndex<n.endIndex-n.startIndex)&&(n=s);return n}function at(e,r,t){if(e.startPosition.row>r||e.endPosition.row<t)return null;for(let n of e.namedChildren){let s=at(n,r,t);if(s)return s}return e}function Xt(e){let r=e;for(;["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(r.type)&&r.namedChildren.length>0;)r=r.namedChildren[0];return r}function Ce(e){if(e.type==="identifier")return e.text;let r=e.childForFieldName("name")??e.childForFieldName("pattern");return r?Ce(r):e.namedChildren.find(t=>t.type==="identifier")?.text??null}function Yt(e){return(e.childForFieldName("parameters")??e.namedChildren.find(t=>/parameters/u.test(t.type)))?.namedChildren.map(Ce)??[]}var Gt=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function ct(e){return Gt.has(e.type)?1:e.type==="binary_expression"&&e.parent?.type!=="binary_expression"&&(e.text.includes("&&")||e.text.includes("||"))?Qt(e.text):0}function Qt(e){return(e.match(/&&|\|\|/g)??[]).length}var Zt=new Set(["identifier","type_identifier","field_identifier"]),er=new Set(["identifier"]),tr=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),rr=new Set(["rust","python"]),nr=/\{([^{}]*)\}/g,sr=/\b([A-Za-z_][\w]*)\b/g;function lt(e,r){return or(r).has(e.type)}function pt(e,r){return rr.has(r)&&e.type==="string_content"}function Pe(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function or(e){return e==="rust"?Zt:e==="python"?er:tr}function ut(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(nr)){let s=n[1]??"";for(let o of s.matchAll(sr))o[1]&&r(o[1],t)}}var ir=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],ar=/^#!?\[\s*serde\s*\(/,cr=/^#!?\[\s*schemars\s*\(/,lr=/^#!?\[\s*validate\s*\(/,pr=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function mt(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=be(n);if(!s||!pr.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function dt(e,r){let t=ar.test(e),n=cr.test(e),s=lr.test(e);if(!(!t&&!n&&!s))for(let o of ir){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&r.add(c)}}}function ft(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=p=>{s.has(p.type)&&p.text!==a&&n(p.text,a);for(let l of p.children)c(l)};for(let p of i.children)c(p)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(p=>p.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(p=>p.type==="field_declaration_list"||p.type==="enum_variant_list"||p.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(l=>l.type==="identifier")?.text;if(!a)continue;let c=i.childForFieldName("superclasses");c&&o(c,a);let p=i.namedChildren.find(l=>l.type==="block");if(p)for(let l of p.descendantsOfType("type"))for(let u of l.descendantsOfType("identifier"))u.text!==a&&n(u.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var ur=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),Te=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function gt(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(p,l)=>{let u=s.get(p);if(!u){s.set(p,[l]);return}u[u.length-1]!==l&&u.push(l)};for(;a<e.length;){let p=e[a];if(p===`
|
|
6
|
-
`){i+=1,a+=1;continue}if(/\s|,/.test(p)){a+=1;continue}if(p===";"){a=le(e,a);continue}if(p==='"'){let f=te(e,a,i);i=f.line,a=f.index;continue}if(p==="("||p==="["||p==="{"){o.push({kind:p,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(p===")"||p==="]"||p==="}"){let f=o.pop();f&&(f.endLine=i,mr(f,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(f)),a+=1;continue}if(Ee(p)){a+=1;continue}let l=i,u=a;for(;a<e.length&&!Re(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let d={text:m,line:l};dr(o[o.length-1],d),c(N(m),l)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:xr(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function mr(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=ur.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(fr(e,r),!n||Te.has(t.text)||Te.has(n)||n.startsWith(":"))return;let o=hr(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function dr(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function fr(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of ce(e))ee(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of ce(e))ee(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of ce(e))ee(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of ce(e)){n&&ee(r,n,"extension",s,"extension-method");let o=Sr(e,s.startLine);o&&o!==n&&ee(r,o,"extension",s,"extension-method")}}}function ce(e){return e.children.filter(gr)}function gr(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!Te.has(r)&&!r.startsWith(":"))}function ee(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function Sr(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function hr(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function le(e,r){let t=r;for(;t<e.length&&e[t]!==`
|
|
7
|
-
`;)t+=1;return t}function te(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
|
|
8
|
-
`&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Ee(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Re(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function xr(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var St=9,br=se("source-facts",{clearGroups:["whole-project","source-file"]}),Fe=X({kind:"source-facts",invalidation:Y("source-facts"),serialize:Cr,deserialize:Pr});function E(e,r){return Nr(e,r).facts}function Nr(e,r){let t=L(e,r);if(!t)return{facts:null};let n=Ir(e,r,t);return n?br.get(e,r,t,()=>_r(e,r,n,t)):{facts:null}}function Ir(e,r,t){return Q(r)?Qe(e,r,t)?.language??null:G(r)}function _r(e,r,t,n){let s=H(e,r,n),o=Fe.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=gt(n);return Fe.write(e,r,s,c),{facts:c}}let i=D(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=Fr(i,t);return Fe.write(e,r,s,a),{facts:a}}function Cr(e){let r={version:St,language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function Pr(e){try{let r=JSON.parse(e);if(r.version!==St||r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:Pe(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function Tr(e,r,t,n){let s=E(e,r);return s?Rr(s,t,n)?.isLiteralPassthrough??!0:!0}function Er(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:E(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function Rr(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function Fr(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,u)=>{let m=i.get(l);if(!m){i.set(l,[u]);return}m[m.length-1]!==u&&m.push(u)},c=[],p=l=>{let u=ie(l,r);u&&(u.branches=0,t.push(u),c.push(u));let m=ct(l);if(m>0)for(let f of c)f.branches=(f.branches??0)+m;let d=Ze(l,r);d&&n.push(d),mt(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&dt(l.text,s),lt(l,r)&&a(l.text,l.startPosition.row),pt(l,r)&&ut(l,a);for(let f of l.children)p(f);u&&c.pop()};return p(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:ft(e,r),identifierLineMap:i,identifiersByLine:Pe(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var ht=new Set(["rust","typescript","tsx","javascript","python","clojure"]),Ar=new Set(["rust","typescript","tsx","javascript","python"]);function Lr(e,r){let t=E(e,r);return!t||!ht.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function wr(e,r){if(!Ar.has(r))return null;let t=[];for(let n of e.descendantsOfType([...et(r)])){let s=ie(n,r);s&&t.push({name:s.name,startLine:s.startLine,endLine:s.endLine})}return t}function kr(e,r){let t=E(e,r);return!t||!ht.has(t.language)?null:t.callSites}function jr(e,r){return E(e,r)?.typeContainerMap??new Map}function Dr(e,r,t={}){let n=E(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as xt}from"path";var Or=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function S(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&Or.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function T(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??h(e,n,Ye(r)),kind:"named",used:x(t,o),usedMembers:[]}}function g(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function R(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function M(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function v(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=k(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function _(e,r,t,n,s){let o=oe(e,r,s);if(o){let i=t(o);if(i)return i}return n()}function pe(e,r,t,n,s){let o=oe(e,r,s),i=G(r),a=i?t[i]:void 0;return o&&a?a(o):n()}function yt(e,r,t){return _(e,r,n=>vr(e,r,n),()=>Mr(e,r,t),t)}function Mr(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=xt(o).replace(/\.[^.]+$/,"");return[R(o,i,Se(e,r,o),x(s,i))]})}function vr(e,r,t){let n=S(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(l=>l.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=xt(i).replace(/\.[^.]+$/,"");s.push(g(i,a,Se(e,r,i),n))}return s}var $r=new Set([":require",":require-macros",":use"]),we=String.raw`A-Za-z0-9_$*+!?.<>=-`;function Nt(e,r,t){let n=Yr(t);if(!n)return[];let s=Xr(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=C(i.children[0]);if(a){if($r.has(a)){for(let c of qr(i.children.slice(1)))o.push(...Ur(e,c,s));continue}if(a===":import")for(let c of zr(i.children.slice(1)))o.push(c)}}return o}function Br(e){return e.type==="list"&&C(e.children[0])==="ns"}function Ur(e,r,t){let n=Ge(e,r.namespace),s=r.alias??r.namespace,o=Hr(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||Kr(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:Jr(t,a),usedMembers:[]});return i}function qr(e){return e.flatMap(r=>ue(r,null))}function ue(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:Le(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&C(e.children[0])===null?e.children.flatMap(t=>ue(t,r)):Vr(e,r);if(e.type==="list"&&e.children.length>0){let t=C(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>ue(n,Le(r,t))):e.children.flatMap(n=>ue(n,r))}return[]}function Vr(e,r){let t=C(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:Le(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=C(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=C(i),s+=1;continue}o===":refer"&&i&&(C(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(C).filter(Wr)),s+=1)}return[n]}function zr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(R(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=C(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=C(s);o&&r.push(R(`${n}.${o}`,o,null,!0))}}return r}function Le(e,r){return e?`${e}.${r}`:r}function C(e){return e?.type==="atom"?e.text:null}function Wr(e){return!!(e&&!e.startsWith(":"))}function Hr(e,r){let t=new Set,n=new RegExp(`${ke()}${O(r)}\\s*/\\s*([${we}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function Kr(e,r){return new RegExp(`${ke()}${O(r)}\\s*/`,"m").test(e)}function Jr(e,r){return new RegExp(`${ke()}${O(r)}(?![${we}])`,"m").test(e)}function ke(){return`(?<![${we}])`}function Xr(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
|
|
9
|
-
`?`
|
|
10
|
-
`:" ",s+=1;continue}let o=e[s];if(o===";"){let i=le(e,s);n+=bt(e.slice(s,i)),s=i;continue}if(o==='"'){let i=te(e,s,0).index;n+=bt(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Yr(e){let r=0;for(;r<e.length&&(r=je(e,r),!(r>=e.length));){let t=me(e,r);if(!t){r+=1;continue}if(Br(t.form))return t.form;r=t.index}return null}function me(e,r){let t=je(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Gr(e,t);if(e.startsWith("#_",t)){let s=me(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Ee(e[t]);)t+=1;let n=e[t];return n?n==="("?Ae(e,t,"list",")"):n==="["?Ae(e,t,"vector","]"):n==="{"?Ae(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:te(e,t,0).index},index:te(e,t,0).index}:Zr(e,t):null}function Gr(e,r){let t=e.startsWith("#?@",r)?3:2,n=me(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Qr(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Qr(e){let r=[];for(let t=0;t<e.length;t+=2){let n=C(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Ae(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=je(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=me(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Zr(e,r){let t=r;for(;t<e.length&&!Re(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function je(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=le(e,t);continue}break}return t}function bt(e){return e.replace(/[^\r\n]/g," ")}function It(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=k(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:he(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?V(c,i):[]})}return n}function _t(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:he(e,r,o)})}return n}function Ct(e,r,t){return pe(e,r,{csharp:n=>tn(e,r,n),vb:n=>en(e,r,n)},()=>{let n=Xe(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),p=!!c,l=(p?c:a)?.trim()??i,u=l.split(".").pop()??l,m=p?a?.trim()??u:u;return[T(e,r,o,l,u,m,h(e,l,q))]})},t)}function en(e,r,t){let n=S(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,p=a.text,l=p.split(".").pop()??p,u=c?.text??l;s.push(g(l,u,h(e,p,q),n,c?"namespace":"named"))}return s}function tn(e,r,t){let n=S(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let p=c.text,l=p.split(".").pop()??p,u=a?.text??l;s.push(g(l,u,h(e,p,q),n,a?"namespace":"named"))}return s}var rn=U("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Pt(e,r){return rn.get(e,r,()=>{let t=new Set,n=L(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function De(e,r,t){return _(e,r,n=>sn(e,r,n),()=>nn(e,r,t),t)}function nn(e,r,t){return Sn(t).flatMap(n=>hn(e,r,n.clause,n.specifier,n.start,n.end,t))}function sn(e,r,t){let n=on(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...an(e,r,t,o,n));return s}function on(e,r,t){let n=S(t,new Set(["import_statement"]));if(Q(r))for(let s of Pt(e,r))n.add(s);return n}function an(e,r,t,n,s){let o=mn(n);if(!o)return[];let i=F(e,r,o),a=b(n,"import_clause");return a?cn(t,a,i,s,dn(n.text)):[M("*",i)]}function cn(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(ln(i.text,t,n,s));else if(i.type==="namespace_import"){let a=pn(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...un(i,t,n,s));return o}function ln(e,r,t,n){return g("default",e,r,t,"default",{isTypeOnly:n})}function pn(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=gn(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function un(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,p=a?.text??c;s.push(g(c,p,r,t,"named",{isTypeOnly:n||fn(o.text)}))}return s}function mn(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function dn(e){return/^\s*import\s+type\b/.test(e)}function fn(e){return/^\s*type\b/.test(e.trim())}function gn(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Sn(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function hn(e,r,t,n,s,o,i){let a=F(e,r,n),c=k(i,s,o);return t?xn(t).map(l=>({...l,sourcePath:a})).map(l=>{if(l.kind==="namespace"){let u=V(c,l.localName);return v(l.importedName,l.sourcePath,{localName:l.localName,usedMembers:u,used:u.length>0||x(c,l.localName),isTypeOnly:l.isTypeOnly})}return l.kind==="side-effect"?M(l.importedName,l.sourcePath):R(l.importedName,l.localName??"",l.sourcePath,l.localName?x(c,l.localName):!1,l.kind,[],{isTypeOnly:l.isTypeOnly})}):[M("*",a)]}function xn(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=yn(n),i=[];return s&&i.push(...Tt(s,t)),o&&i.push(...Tt(o,t)),i}function Tt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,p]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(p??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function yn(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function Oe(e,r,t){let n=D(e,r);return n?Pn(e,r,n):bn(e,r,t)}function bn(e,r,t){return[...Nn(e,r,t),...In(e,r,t),..._n(e,r,t)]}function Nn(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Cn(u.trim())).filter(u=>!!u),p=z(t,o.index),l=z(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:F(e,r,a),names:c,startLine:p,endLine:l})}return n}function In(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=z(t,o.index),c=z(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:F(e,r,i),names:o[1]?[o[1]]:[],startLine:a,endLine:c})}return n}function _n(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=z(t,o.index),c=z(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:F(e,r,i),names:[],startLine:a,endLine:c})}return n}function Cn(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function z(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Pn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=Tn(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=En(s,o,i,a);n.push(c)}return n}function Tn(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return F(e,r,s.text)}function En(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),p=a.namedChild(1);c&&i.push((p??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}let o=b(e,"namespace_export");if(o){let i=o.namedChildren.find(a=>a.type==="identifier"||a.type==="type_identifier")?.text;return{kind:"star-as",sourcePath:r,names:i?[i]:[],startLine:t,endLine:n}}return{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function Et(e,r,t){return pe(e,r,{java:n=>Rn(e,r,n),kotlin:n=>Fn(e,r,n),scala:n=>An(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?Ln(e,r,o,s):[]}),t)}function Rn(e,r,t){let n=S(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let p=c.text;if(i){s.push(v("*",h(e,p,P)));continue}let l=p.split(".").pop()??p;s.push(g(l,l,h(e,p,P),n))}return s}function Fn(e,r,t){let n=S(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),c=o.namedChildren.find(d=>d.type==="import_alias");if(a){s.push(v("*",h(e,i.text,P)));continue}let p=i.text,l=p.split(".").pop()??p,m=c?.namedChild(0)?.text??l;s.push(g(l,m,h(e,p,P),n))}return s}function An(e,r,t){let n=S(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",h(e,c,P)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,d]=u.namedChildren;if(!m)continue;let f=m.text,$=d?.text??f;if(f==="_")continue;s.push(g(f,$,h(e,`${c}.${f}`,P),n))}else if(u.type==="identifier"){let m=u.text;s.push(g(m,m,h(e,`${c}.${m}`,P),n))}continue}let p=a[a.length-1]?.text??c,l=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(g(p,p,h(e,l&&a.length>1?`${l}.${p}`:c,P),n))}return s}function Ln(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,p]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),l=c?.trim();if(!l||l==="_")return[];let u=(p??l.split(".").pop()??l).trim(),m=l==="_"?s:`${s}.${l}`.replace(/\.\./g,".");return[T(e,r,n,m,l,u)]})}return[T(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function Ft(e,r,t){return _(e,r,n=>wn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,p]=a.split(/\s+as\s+/i),l=c?.trim()??a,u=l.split("\\").pop()??l,m=(p??u).trim();return[T(e,r,s,l,u,m,h(e,l.replace(/\\/g,"."),K))]}):[]}),t)}function wn(e,r,t){let n=S(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(g(a,c,h(e,i.replace(/\\/g,"."),K),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(p=>p.type==="namespace_name")?.text??"";for(let p of a.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:l,localName:u,qualified:m}=Rt(p,c);l&&o(m,l,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:p,localName:l,qualified:u}=Rt(c,"");p&&o(u,p,l)}}return s}function Rt(e,r){let t=e.namedChildren.find(p=>p.type==="qualified_name"),n=e.namedChildren.filter(p=>p.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function Lt(e,r,t){return _(e,r,n=>kn(e,r,n),()=>Dn(t).flatMap(n=>Mn(e,r,n,t)),t)}function kn(e,r,t){let n=S(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=At(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=jn(i);if(a===null)continue;let c=J(e,r,a);for(let p=1;p<o.namedChildCount;p+=1){let l=o.namedChild(p);if(l.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=At(l);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function At(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function jn(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function Dn(e){let r=e.split(`
|
|
11
|
-
`),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,p=a+o.length,l=Ie(o);for(;s+1<r.length&&(l>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
|
|
12
|
-
${m}`,p+=1+m.length,l+=Ie(m),n+=m.length+1}let u=On(c);u&&t.push({...u,start:a,end:p})}return t}function On(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function Mn(e,r,t,n){let s=k(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let p=c.trim().replace(/,$/,"");if(!p)return[];let[l,u]=p.split(/\s+as\s+/),m=l.trim(),d=(u??m.split(".")[0]??m).trim(),f=J(e,r,m),$=V(s,d);return[{importedName:m,localName:d,sourcePath:f,kind:"namespace",used:x(s,d)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let p=c.trim().replace(/,$/,"");if(!p)continue;if(p==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[l,u]=p.split(/\s+as\s+/),m=(u??l).trim();a.push({importedName:l.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as vn}from"path";function wt(e,r,t){return _(e,r,n=>Bn(e,r,n),()=>$n(e,r,t),t)}function $n(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?ge(e,r,i):null;if(a){let c=kt(i);return[R(c,c,a,x(s,c))]}return[M(i,a)]})}function Bn(e,r,t){let n=S(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let p=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!p||p.type!=="string")continue;let u=p.namedChildren.find(d=>d.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?ge(e,r,u):null;if(m){let d=kt(u);s.push(g(d,d,m,n))}else s.push(M(u,m))}return s}function kt(e){return tt(vn(e).replace(/\.[^.]+$/,""),/_/)}function jt(e,r,t){return _(e,r,n=>Un(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?qn(e,r,o,s):[]}),t)}function Un(e,r,t){let n=S(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of re(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=A(e,r,a.qualifiedName)??A(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(g(a.importedName,a.localName,c,n))}}return s}function re(e,r){switch(e.type){case"identifier":case"super":case"crate":{let t=e.text;return[{qualifiedName:de(r,t),importedName:t,localName:t}]}case"self":{let t=r.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:r||"self",importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:de(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=de(r,t.text),o=[];for(let i of n.namedChildren)o.push(...re(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...re(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=re(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:de(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function de(e,r){return e?r?`${e}::${r}`:e:r}function qn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let l=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let d=m.trim();if(!d)return[];if(d==="self"){let fe=l.split("::").filter(Boolean).pop();return fe?[T(e,r,n,l,fe,fe)]:[]}let[f,$]=d.split(/\s+as\s+/),B=f?.trim();if(!B)return[];let Bt=($??B.split("::").pop()??B).trim(),Ut=`${l}::${B}`.replace(/::::/g,"::");return[T(e,r,n,Ut,B.split("::").pop()??B,Bt,A(e,r,l))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),p=A(e,r,a)??A(e,r,a.split("::").slice(0,-1).join("::"));return[T(e,r,n,a,a.split("::").pop()??a,c,p)]}function Dt(e,r,t){let n=D(e,r);if(n)return Vn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Wn(e,r,i))}return s}function Vn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!zn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of re(o,""))i.importedName&&n.push(Me(e,r,i.qualifiedName))}return n}function zn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Wn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),p=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[Me(e,r,p)]})}return[Me(e,r,n)]}function Me(e,r,t){return{specifier:t,sourcePath:A(e,r,t)??A(e,r,t.split("::").slice(0,-1).join("::"))}}function j({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function Ot(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var Hn={language:"javascript",extensions:qe,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:De,parseReExports:Oe},Kn=j({language:"python",extensions:Ve,imports:"ast-with-regex-fallback",parseImports:Lt}),Jn=j({language:"jvm",extensions:P,imports:"ast-dispatch-with-regex-fallback",parseImports:Et}),Xn={language:"rust",extensions:ze,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:jt,parseExports:Dt},Yn=j({language:"ruby",extensions:We,imports:"ast-with-regex-fallback",parseImports:wt}),Gn=j({language:"c/cpp",extensions:He,imports:"ast-with-regex-fallback",parseImports:yt}),Qn=j({language:"dotnet",extensions:q,imports:"ast-dispatch-with-regex-fallback",parseImports:Ct}),Zn={language:"dart",extensions:Ke,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:It,parseExports:_t},es=j({language:"php",extensions:K,imports:"ast-with-regex-fallback",parseImports:Ft}),ts=j({language:"clojure",extensions:Je,imports:"regex-only",parseImports:Nt}),rs=[Hn,Kn,Jn,Xn,Yn,Gn,Qn,Zn,es,ts];function ne(e){return Ot(rs,e)}var ve={clearGroups:["whole-project","source-file"]},ns=U("source-imports",ve),ss=U("source-exports",ve),os=U("source-reexports",ve),Mt=X({kind:"source-imports",invalidation:Y("source-imports"),serialize:as,deserialize:cs}),vt=X({kind:"source-reexports",invalidation:Y("source-reexports"),serialize:ls,deserialize:ps});function Li(e,r){let t=W(r);return os.get(e,t,()=>{let n=ne(t);if(!n?.parseReExports)return[];let s=L(e,t);if(!s)return[];let o=H(e,t,s),i=xe(e),a=vt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return vt.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function is(e,r){let t=W(r);return ns.get(e,t,()=>{let n=ne(t);if(!n)return[];let s=L(e,t);return s?$t(e,t,s,n):[]})}function wi(e,r){let t=W(r),n=ne(t);if(!n)return[];let s;try{s=$e(e.config.projectRoot,t,{inputKind:"indexed source file"})}catch(o){if(Be(o))return[];throw o}return $t(e,t,s,n)}function $t(e,r,t,n){let s=H(e,r,t),o=xe(e),i=Mt.read(e,r,s);if(i?.resolutionFingerprint===o)return i.imports;let a=n.parseImports(e,r,t);return Mt.write(e,r,s,{parserVersion:2,resolutionFingerprint:o,imports:a}),a}function ki(e,r,t){let n=is(e,r).filter(s=>s.kind==="named"&&s.isTypeOnly!==!0&&s.localName===t&&s.sourcePath!==null);return n.length===1?n[0]:null}function ji(e,r){let t=W(r);return ss.get(e,t,()=>{let n=ne(t);if(!n?.parseExports)return[];let s=L(e,t);return s?n.parseExports(e,t,s):[]})}function as(e){return JSON.stringify(e)}function cs(e){try{let r=JSON.parse(e);return!ye(r)||r.parserVersion!==2||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{parserVersion:2,resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function ls(e){return JSON.stringify(e)}function ps(e){try{let r=JSON.parse(e);return!ye(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,qt as b,gs as c,Ss as d,Ie as e,zt as f,it as g,Jt as h,at as i,Xt as j,Ce as k,Yt as l,ct as m,E as n,Nr as o,Tr as p,Er as q,Lr as r,wr as s,kr as t,jr as u,Dr as v,de as w,Li as x,is as y,wi as z,ki as A,ji as B};
|
|
13
|
-
//# sourceMappingURL=chunk-RBAD4GJ2.js.map
|
package/dist/chunk-RMDPFPNW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as _t,d as j}from"./chunk-WYPL7GF7.js";import{b as k}from"./chunk-ATXPTSEI.js";import{d as Se,f as Ct}from"./chunk-CKBUBRYD.js";import{b as Ft}from"./chunk-3AF4TUFK.js";import{a as xe,b as V,c as G}from"./chunk-T3CZAZSI.js";import{a as be}from"./chunk-B3PYOSCX.js";import{e as X}from"./chunk-HGFDYOVB.js";import{a as Pt,b as Tt,c as ye,d as Lt}from"./chunk-JFMEXGFE.js";import{B as Ne,D as jt,E as Nt,G as qt,a as Gt,c as Dt,d as At,e as he,ha as qe,j as Ie,k as O,l as Z,n as Me,r as Fe,s as kt,v as Ot,w as Mt,x as _e,y as je}from"./chunk-7HXT6YLU.js";import{a as v,b as J,c as S,f as I,g as R,h as b,k as Et,l as H}from"./chunk-7F45LJKI.js";import{createHash as en,randomUUID as tn}from"crypto";import{existsSync as Y,mkdirSync as rn,readdirSync as nn,rmSync as Bt,statSync as Wt}from"fs";import{basename as on,dirname as we,join as w}from"path";var N=1,ze=1,te=".scipquery-generations",ve="manifest.json",zt="readers",an="gc.lock",sn=128,ee=new Map,Ut={pid:process.pid,now:()=>new Date,randomToken:()=>tn(),isProcessAlive:be,readProcessIdentity:ye};function h(e){return w(we(e),te)}function Ue(e){return w(h(e),an)}function Po(e,t=Ut){let r=j(Ue(e.dbPath),{waitMs:5e3,directoryDurability:"recoverable"});if(!r)throw new Error("SQLite generation retention is busy; retry opening the index.");let n;try{let i=ln(e);if(i.source!=="immutable")return{generation:i,release(){}};let o=t.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(o))throw new Error("SQLite generation reader token is unsafe.");let a=w(h(e.dbPath),zt);rn(a,{recursive:!0}),n=w(a,`${t.pid}-${o}.json`);let s=t.readProcessIdentity(t.pid);V(n,{version:1,token:o,generationIdentity:i.identity,pid:t.pid,...s?{processIdentity:s}:{},acquiredAt:t.now().toISOString()},{spacing:2,trailingNewline:!0});let c=!1;return{generation:i,release(){c||!n||(c=!0,Bt(n,{force:!0}))}}}finally{r.release()}}function Ht(e,t,r=Ut,n={}){let i=w(h(e),zt);if(!Y(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,a=0,s=0,c=0;for(let d of nn(i,{withFileTypes:!0})){if(!d.isFile()||!d.name.endsWith(".json"))continue;let l=w(i,d.name),f;try{f=cn(JSON.parse(b(l,"SQLite generation reader lease")))}catch{f=null}if(!f){c+=1;for(let m of t)o.add(m);continue}if(!dn(f,r)){n.removeStale!==!1&&(Bt(l,{force:!0}),s+=1);continue}a+=1,o.add(f.generationIdentity)}return{protectedGenerations:o,activeLeases:a,staleLeasesRemoved:s,malformedLeases:c}}function cn(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e,r=t.processIdentity===void 0?null:Pt(t.processIdentity);return t.version!==1||typeof t.token!="string"||t.token.trim()===""||typeof t.generationIdentity!="string"||!/^[a-f0-9]{64}$/.test(t.generationIdentity)||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.acquiredAt!="string"||!Number.isFinite(Date.parse(t.acquiredAt))||t.processIdentity!==void 0&&(!r||r.pid!==t.pid)?null:{version:1,token:t.token,generationIdentity:t.generationIdentity,pid:t.pid,...r?{processIdentity:r}:{},acquiredAt:t.acquiredAt}}function dn(e,t){if(!t.isProcessAlive(e.pid))return!1;if(!e.processIdentity)return!0;let r=t.readProcessIdentity(e.pid);return r===null||Tt(e.processIdentity,r)}function q(e){try{let t=JSON.parse(b(w(h(e),"state.json"),"SQLite generation state"));return mn(t)?t:null}catch{return null}}function re(e,t){return ne(h(e),t)}function ne(e,t){try{let r=JSON.parse(b(w(e,t,ve),"SQLite generation manifest"));return pn(r,t)?r:null}catch{return null}}function ln(e){let t=q(e.dbPath);if(t){let r=un(e,t.currentGeneration);if(r)return r;if(t.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${t.currentGeneration} is missing or invalid.`)}if(Y(w(we(e.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return fn(e,t?.currentGeneration)}function To(e){let t=q(e);if(t)return t.currentGeneration;try{let r=w(we(e),"meta.json"),n=Y(r)?b(r,"reindex metadata"):void 0;return Vt(e,n)}catch{return null}}function M(e){return Ct(Se(e))??e}function un(e,t){try{let r=w(h(e.dbPath),t),n=re(e.dbPath,t);if(!n)return null;let i=$e(r,n.database),o=n.index?$e(r,n.index):void 0,a=n.metadata?$e(r,n.metadata):void 0;return!Be(i,n.database)||n.index&&(!o||!Be(o,n.index))||n.metadata&&(!a||!Be(a,n.metadata))?null:{identity:t,databasePath:i,...o?{indexPath:o}:{},...a?{metadataPath:a,metadataRaw:b(a,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function fn(e,t){let r=$(e.dbPath),n=w(we(e.dbPath),"meta.json"),i=Y(n)?b(n,"reindex metadata"):void 0,o=Y(e.indexPath)?e.indexPath:void 0;return{identity:t??Vt(e.dbPath,i),databasePath:e.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:n,metadataRaw:i},source:"legacy",databaseFileIdentity:r}}function Vt(e,t){let r=en("sha256").update("sqlite-generation-legacy-v1\0");return t!==void 0&&r.update(M(t)),r.update(`\0${$(e)}`),r.digest("hex")}function $(e){let t=Wt(e);return`${t.dev}:${t.ino}:${t.size}:${t.mtimeMs}`}function $e(e,t){if(on(t.file)!==t.file||t.file==="."||t.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return w(e,t.file)}function Be(e,t){if(!Y(e))return!1;let r=$t(e);if(!r||r.size!==t.size)return!1;let n=`${e}\0${t.sha256}\0${r.identity}`;if(ee.has(n))return!0;let i=H(e,{inputKind:"immutable SQLite generation artifact",maxBytes:t.size}),o=$t(e);if(!o||o.identity!==r.identity||i!==t.sha256)return!1;for(ee.set(n,!0);ee.size>sn;){let a=ee.keys().next().value;if(a===void 0)break;ee.delete(a)}return!0}function $t(e){let t=Wt(e,{bigint:!0});return t.isFile()?{identity:`${t.dev}:${t.ino}:${t.size}:${t.mtimeNs}:${t.ctimeNs}`,size:Number(t.size)}:null}function pn(e,t){return e.version===ze&&e.identity===t&&We(e.database)&&(e.index===void 0||We(e.index))&&(e.metadata===void 0||We(e.metadata))}function We(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.file=="string"&&!!t.file&&Number.isSafeInteger(t.size)&&(t.size??-1)>=0&&typeof t.sha256=="string"&&/^[a-f0-9]{64}$/.test(t.sha256)}function mn(e){return e.version===N&&typeof e.currentGeneration=="string"&&!!e.currentGeneration&&typeof e.publishedAt=="string"&&Number.isFinite(Date.parse(e.publishedAt))&&(e.artifactSet===void 0||e.artifactSet==="immutable-v1")&&gn(e.stableMirrors)&&yn(e.previousGeneration)&&hn(e.publication)}function gn(e){if(e===void 0)return!0;if(!e||typeof e!="object")return!1;let t=e;return typeof t.databaseFileIdentity=="string"&&!!t.databaseFileIdentity&&(t.indexFileIdentity===void 0||typeof t.indexFileIdentity=="string"&&!!t.indexFileIdentity)}function yn(e){if(e===void 0)return!0;if(!e||typeof e!="object")return!1;let t=e;return typeof t.generationIdentity=="string"&&!!t.generationIdentity&&typeof t.databasePath=="string"&&!!t.databasePath&&(t.metadataPath===void 0||typeof t.metadataPath=="string"&&!!t.metadataPath)}function hn(e){if(e===void 0)return!0;if(!e||typeof e!="object")return!1;let t=e,r=[t.converterDurationMs,t.affectedDocumentCount,t.changedDocumentCount,t.producerDurationMs,t.materializationDurationMs,t.patchDurationMs].filter(n=>n!==void 0);return(t.mode==="incremental"||t.mode==="full")&&t.validation==="passed"&&t.converterDurationMs!==void 0&&r.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>=0)&&(t.scipCompanion===void 0||t.scipCompanion==="current"||t.scipCompanion==="deferred")&&(t.typescriptOverlayGeneration===void 0||typeof t.typescriptOverlayGeneration=="string"&&!!t.typescriptOverlayGeneration)&&(t.scipCompanion!=="deferred"||!!t.typescriptOverlayGeneration)&&(t.fallbackReason===void 0||typeof t.fallbackReason=="string")}import{execFileSync as Sn}from"child_process";import{existsSync as In,readdirSync as Yt}from"fs";import{extname as Qt,join as Kt}from"path";var Jt=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),bn=[{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 ko(e){let t=[],r=xn(e),n=En(e);for(let i of bn){if(wn(e,i.files)){t.push(i.language);continue}if(vn(r,i.globs)){t.push(i.language);continue}Tn(n,i.extensions)&&t.push(i.language)}if(t.includes("typescript")&&He(t,"javascript"),t.includes("cpp")&&t.includes("c")){let i=n.has(".c"),o=[".cc",".cpp",".cxx"].some(a=>n.has(a));i&&!o?He(t,"cpp"):i||He(t,"c")}return t}function xn(e){try{return Yt(e)}catch{return[]}}function wn(e,t){return t?.length?t.some(r=>In(Kt(e,r))):!1}function vn(e,t){return t?.length?e.some(r=>t.some(n=>Rn(r,n))):!1}function Rn(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 En(e){let t=Pn(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=Yt(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=Kt(i,a.name);if(a.isDirectory()){Jt.has(a.name)||n.push(s);continue}let c=Qt(a.name).toLowerCase();c&&r.add(c)}}return r}function Pn(e){try{let t=jt(e,26214400,()=>Sn("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 Nt(t)){if(n.split("/").some(o=>Jt.has(o)))continue;let i=Qt(n).toLowerCase();i&&r.add(i)}return r}catch{return null}}function Tn(e,t){return t?.length?t.some(r=>e.has(r)):!1}function He(e,t){let r=e.indexOf(t);r!==-1&&e.splice(r,1)}import{closeSync as Zt,openSync as kn,renameSync as On,rmSync as Mn,writeSync as Fn}from"fs";import{create as er,fromBinary as _n,toBinary as jn}from"@bufbuild/protobuf";import{DocumentSchema as Ye,IndexSchema as Nn,SymbolRole as Ke}from"@c4312/scip";var E=class extends Error{},Gn=0,Dn=1,Xt=2,An=5;function Ve(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 E("varint exceeds the safe integer range");if((o&128)===0)return{value:n,pos:t};if(i+=7,i>63)throw new E("varint is longer than 64 bits")}throw new E("varint runs past the end of the buffer")}function*P(e,t=0,r=e.length){let n=t;for(;n<r;){let i=n,o=Ve(e,n,r);n=o.pos;let a=Math.floor(o.value/8),s=o.value%8;if(a===0)throw new E("field number 0 is invalid");let c=n,d=0;if(s===Gn){let l=Ve(e,n,r);d=l.value,n=l.pos}else if(s===Xt){let l=Ve(e,n,r);if(c=l.pos,n=l.pos+l.value,n>r)throw new E("length-delimited field runs past the end of the buffer")}else if(s===Dn)n+=8;else if(s===An)n+=4;else throw new E(`unsupported wire type ${s}`);if(n>r)throw new E("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 ie(e){if(!Number.isSafeInteger(e)||e<0)throw new E(`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 Re(e){return ie(e*8+Xt)}var Cn=1,Ln=3;function oe(e){let t=new TextDecoder,r;for(let n of P(e))if(!(n.fieldNumber!==Cn||n.wireType!==2))for(let i of P(e,n.valueStart,n.valueEnd)){if(i.fieldNumber!==Ln||i.wireType!==2)continue;let o=t.decode(e.subarray(i.valueStart,i.valueEnd));o&&(r=o)}return r}var Qe=2,qn=3,$n=1,Bn=2,Wn=3,zn=1,Un=2,Hn=3;function Bo(e){let t;try{t=I(e,{inputKind:"SCIP sanitization input",maxBytes:S})}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}try{return Vn(t,e)}catch(r){if(r instanceof E)return{removedDefinitionOccurrences:0,touchedDocuments:0};throw r}}function Vn(e,t){let r=new TextDecoder,n=new Set;for(let a of P(e))if(a.wireType===2)if(a.fieldNumber===Qe)for(let s of P(e,a.valueStart,a.valueEnd))s.wireType===2&&(s.fieldNumber===$n?Fe(r.decode(e.subarray(s.valueStart,s.valueEnd))):s.fieldNumber===Wn&&tr(e,s,r,n));else a.fieldNumber===qn&&tr(e,a,r,n);let i=0,o=[];for(let a of P(e)){if(a.wireType!==2||a.fieldNumber!==Qe)continue;let s=Yn(e,a,r,n);s>0&&(i+=s,o.push(a))}return i===0?{removedDefinitionOccurrences:0,touchedDocuments:0}:(Qn(e,t,o,n),{removedDefinitionOccurrences:i,touchedDocuments:o.length})}function tr(e,t,r,n){for(let i of P(e,t.valueStart,t.valueEnd)){if(i.wireType!==2||i.fieldNumber!==zn)continue;let o=r.decode(e.subarray(i.valueStart,i.valueEnd));o&&n.add(o)}}function Yn(e,t,r,n){let i=0;for(let o of P(e,t.valueStart,t.valueEnd)){if(o.wireType!==2||o.fieldNumber!==Bn)continue;let a="",s=0;for(let c of P(e,o.valueStart,o.valueEnd))c.fieldNumber===Un&&c.wireType===2?a=r.decode(e.subarray(c.valueStart,c.valueEnd)):c.fieldNumber===Hn&&c.wireType===0&&(s=c.varint);(s&Ke.Definition)!==0&&!n.has(a)&&(i+=1)}return i}function Qn(e,t,r,n){let i=`${t}.sanitize-tmp`,o=kn(i,"w",384);try{let a=0;for(let s of r){ae(o,e.subarray(a,s.fieldStart));let c=_n(Ye,e.subarray(s.valueStart,s.valueEnd));c.occurrences=c.occurrences.filter(l=>(l.symbolRoles&Ke.Definition)===0||n.has(l.symbol));let d=jn(Ye,c);ae(o,Re(Qe)),ae(o,ie(d.byteLength)),ae(o,d),a=s.fieldEnd}ae(o,e.subarray(a))}catch(a){throw Zt(o),Mn(i,{force:!0}),a}Zt(o),On(i,t)}function ae(e,t){let r=0;for(;r<t.byteLength;)r+=Fn(e,t,r,t.byteLength-r)}function rr(e){let t=new Set;for(let o of e.documents){Fe(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&Ke.Definition)===0||t.has(s.symbol)?!0:(r+=1,!1));if(a.length===o.occurrences.length){i.push(o);continue}n+=1,i.push(er(Ye,{language:o.language,relativePath:o.relativePath,occurrences:a,symbols:o.symbols,text:o.text,positionEncoding:o.positionEncoding}))}return{index:r===0?e:er(Nn,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:r,touchedDocuments:n}}import{closeSync as ce,openSync as Je,readSync as Kn,renameSync as Jn,rmSync as or,statSync as Xn,writeFileSync as ar,writeSync as sr}from"fs";import{create as Xe,fromBinary as Zn,toBinary as ei}from"@bufbuild/protobuf";import{deserializeSCIP as cr,serializeSCIP as dr,DocumentSchema as ti,IndexSchema as ri,MetadataSchema as nr,SymbolInformationSchema as ni}from"@c4312/scip";function lr(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let t=ii(e),r=oi(e.flatMap(i=>i.documents??[])),n=fr(e.flatMap(i=>i.externalSymbols??[]));return Xe(ri,{metadata:t,documents:r,externalSymbols:n})}function Jo(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let r=e.map(i=>cr(I(i,{inputKind:"SCIP merge input",maxBytes:S}))),n=lr(r);return ar(t,dr(n)),{documentCount:n.documents.length,externalSymbolCount:n.externalSymbols.length,inputCount:e.length}}function Xo(e,t){if(e.length===0)throw new Error("Cannot concatenate zero SCIP files");let r=0;for(let o of e)if(r+=Xn(o).size,r>S)throw new Error(`Concatenated SCIP output exceeds the ${S}-byte artifact limit. Reduce the indexed project scope or use compatible cached generations.`);let n=Buffer.allocUnsafe(1024*1024),i=Je(t,"w",384);try{for(let o of e){let a=Je(o,"r");try{let s=0;for(;(s=Kn(a,n,0,n.byteLength,null))>0;){let c=0;for(;c<s;)c+=sr(i,n,c,s-c)}}finally{ce(a)}}}catch(o){throw ce(i),or(t,{force:!0}),o}ce(i)}function Zo(e,t){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let r=X("reindex.publish.scip-output.deserialize",()=>e.map(o=>cr(I(o,{inputKind:"SCIP merge input",maxBytes:S})))),n=X("reindex.publish.scip-output.merge",()=>lr(r)),i=X("reindex.publish.scip-output.sanitize",()=>rr(n));return X("reindex.publish.scip-output.serialize",()=>ar(t,dr(i.index))),{documentCount:i.index.documents.length,externalSymbolCount:i.index.externalSymbols.length,inputCount:e.length,removedDefinitionOccurrences:i.removedDefinitionOccurrences,touchedDocuments:i.touchedDocuments}}var ir=1;function ur(e,t,r){let n=I(e,{inputKind:"SCIP normalization input",maxBytes:S}),i=oe(n),o=[];for(let c of P(n))c.fieldNumber===ir&&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=Je(a,"w",384);try{let c=0;for(let d of o){se(s,n.subarray(c,d.fieldStart));let l=Zn(nr,n.subarray(d.valueStart,d.valueEnd));l.projectRoot=r;let f=ei(nr,l);se(s,Re(ir)),se(s,ie(f.byteLength)),se(s,f),c=d.fieldEnd}se(s,n.subarray(c))}catch(c){throw ce(s),or(a,{force:!0}),c}ce(s),Jn(a,e)}function se(e,t){let r=0;for(;r<t.byteLength;)r+=sr(e,t,r,t.byteLength-r)}function ii(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 oi(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,Xe(ti,{language:n.language||r.language,relativePath:n.relativePath||r.relativePath,occurrences:ai([...n.occurrences,...r.occurrences]),symbols:fr([...n.symbols,...r.symbols]),text:ci(n.text,r.text),positionEncoding:n.positionEncoding||r.positionEncoding}))}return[...t.values()]}function ai(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 fr(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,Xe(ni,{symbol:n.symbol,documentation:di([...n.documentation,...r.documentation]),relationships:si([...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 si(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 ci(e,t){return e?t?e.length>=t.length?e:t:e:t}function di(e){return[...new Set(e)]}import li from"better-sqlite3";var ui=25,fi=new Set(["typescript","javascript"]);function ia(e,t,r){let n=null;try{n=new li(e,{readonly:!0,fileMustExist:!0});let i=new Set(n.prepare("SELECT relative_path FROM documents").pluck().all().map(Me)),o=pi(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(f=>c.has(f)));return{state:"incomplete",expectedDocumentCount:a.size,actualDocumentCount:i.size,missingDocumentCount:s.length,missingPaths:s.slice(0,ui),affectedLanguages:d}}catch(i){return{state:"unavailable",reason:i instanceof Error?i.message:String(i)}}finally{n?.close()}}function pi(e,t){let r=new Map,n=t.filter(i=>fi.has(i));for(let i of n)r.set(i,new Set);for(let i of e.files){let o=Me(i.path);for(let a of n)Gt(o,[a])==="source"&&r.get(a).add(o)}return r}import{existsSync as mr,readdirSync as gr,rmSync as yr}from"fs";import{join as Q}from"path";import{create as Sr,fromBinary as Ir,toBinary as ma}from"@bufbuild/protobuf";import{deserializeSCIP as Ze,DocumentSchema as br,IndexSchema as xr,serializeSCIP as wr}from"@c4312/scip";import{existsSync as mi,mkdirSync as gi,renameSync as yi,writeFileSync as hi}from"fs";import{join as Si}from"path";function pr(e){gi(e.blobDir,{recursive:!0});let t=Si(e.blobDir,`${e.blobHash}.scipdoc`);if(mi(t)){let n=I(t,{maxBytes:J,inputKind:e.inputKind});if(n.byteLength!==e.bytes.byteLength||k(n)!==e.blobHash)throw new Error(`existing ${e.inputKind} is corrupt: ${e.relativePath}`);return}let r=`${t}.${process.pid}.${Date.now()}.tmp`;hi(r,e.bytes),yi(r,t)}var et=1,de="typescript-scip-fragments";function Sa(e){let t=new Set,r=[];for(let o of e){let a=Ee(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=Ir(br,o.bytes);if(s.relativePath!==a)throw new Error(`TypeScript fragment path mismatch: expected ${a}, got ${s.relativePath}`);r.push(s)}let n=wr(Sr(xr,{documents:r,externalSymbols:[]})),i=Ze(n);if(i.documents.length!==r.length||i.externalSymbols.length!==0)throw new Error("affected TypeScript SCIP index failed structural verification");return n}function Ii(e){let t=Q(e,de);return{rootDir:t,blobDir:Q(t,"blobs"),generationDir:Q(t,"generations")}}function vr(e){let t=bi(e);return xi(t.baseIndex,t.completeDocuments,"assembled")}function bi(e){let t=Ze(e.baseIndexBytes);Ei(t.metadata,Pi(e)),Ri(t.externalSymbols);let r=new Map;for(let s of e.fragments){let c=Ee(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=Ee(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=hr(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=hr(s,c.bytes);i.push(d),o.push(d)}return{baseIndex:t,completeDocuments:i,affectedDocuments:o,deletedAffectedPaths:a}}function hr(e,t){let r=Ir(br,t);if(r.relativePath!==e)throw new Error(`TypeScript fragment path mismatch: expected ${e}, got ${r.relativePath}`);return r}function xi(e,t,r){let n=wr(Sr(xr,{metadata:e.metadata,documents:t,externalSymbols:[]})),i=Ze(n);if(i.documents.length!==t.length||i.externalSymbols.length!==0)throw new Error(`${r} TypeScript SCIP index failed structural verification`);return n}function Ia(e,t){let r=Ii(e);if(!mr(r.generationDir))return;let n=new Set(t.map(a=>vi(a))),i=gr(r.generationDir).filter(a=>a.endsWith(".json")),o=new Set;for(let a of i.filter(s=>n.has(s))){let s=wi(R(Q(r.generationDir,a),{maxBytes:v,inputKind:"TypeScript fragment manifest"}));for(let c of s.documents)o.add(`${c.blobHash}.scipdoc`)}for(let a of i)n.has(a)||yr(Q(r.generationDir,a),{force:!0});if(mr(r.blobDir))for(let a of gr(r.blobDir))o.has(a)||yr(Q(r.blobDir,a),{force:!0})}function wi(e){let t=JSON.parse(e);if(t.version!==et||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(Ee(n.relativePath),r.has(n.relativePath))throw new Error("duplicate TypeScript fragment record");r.add(n.relativePath)}return t}function vi(e){if(!e)throw new Error("TypeScript fragment generation identity must be non-empty");return`${k(e)}.json`}function Ri(e){if(e.length>0)throw new Error("scip-typescript emitted external symbols; incremental document assembly is unsupported")}function Ei(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 Pi(e){let t=e.packageVersion??e.runtime?.packageVersion;if(!t)throw new Error("scip-typescript package version is unavailable");return t}function Ee(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 Pe,readdirSync as tt,rmSync as Rr}from"fs";import{join as D}from"path";var Te=1,le="typescript-scip-overlays",Er="typescript-project-v3:";function Ga(e){let t=Tr(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(Er)&&e.projectIdentity.startsWith(Er);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=it(a.relativePath);if(i.has(s))throw new Error(`duplicate TypeScript overlay: ${s}`);i.add(s),n.set(s,Ti(e.cacheDir,a))}if(i.size===0)throw new Error("TypeScript overlay generation requires affected documents");let o={version:Te,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 Gi(e.cacheDir,o),o}function Da(e){let t=Tr(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=I(D(ue(e.cacheDir),"blobs",`${n.blobHash}.scipdoc`),{maxBytes:J,inputKind:"TypeScript overlay blob"});if(i.byteLength!==n.byteLength||k(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 vr({packageVersion:e.packageVersion,baseIndexBytes:e.baseIndexBytes,fragments:r})}function Aa(e,t){let r=ue(e),n=D(r,"generations");if(!Pe(n))return;let i=new Set(t.map(nt)),o=new Set;for(let s of tt(n).filter(c=>i.has(c))){let c=rt(R(D(n,s),{maxBytes:v,inputKind:"TypeScript overlay manifest"}));for(let d of c.overlays)d.blobHash&&o.add(`${d.blobHash}.scipdoc`)}for(let s of tt(n))i.has(s)||Rr(D(n,s),{force:!0});let a=D(r,"blobs");if(Pe(a))for(let s of tt(a))o.has(s)||Rr(D(a,s),{force:!0})}function Tr(e,t){let r=D(ue(e),"generations",nt(t));if(!Pe(r))return null;let n=rt(R(r,{maxBytes:v,inputKind:"TypeScript overlay manifest"}));if(n.generationIdentity!==t)throw new Error("TypeScript overlay generation identity does not match its path");return n}function Ti(e,t){let r=it(t.relativePath);if(t.bytes===null)return{relativePath:r,blobHash:null,byteLength:0};let n=Buffer.from(t.bytes),i=k(n);return pr({blobDir:D(ue(e),"blobs"),blobHash:i,bytes:n,relativePath:r,inputKind:"TypeScript overlay blob"}),{relativePath:r,blobHash:i,byteLength:n.byteLength}}function Gi(e,t){let r=D(ue(e),"generations",nt(t.generationIdentity));if(Pe(r)){let n=rt(R(r,{maxBytes:v,inputKind:"TypeScript overlay manifest"}));if(Pr(n)!==Pr(t))throw new Error(`TypeScript overlay generation is immutable: ${t.generationIdentity}`);return}V(r,t,{spacing:2,trailingNewline:!0})}function rt(e){let t=JSON.parse(e);if(t.version!==Te||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(it(n.relativePath),r.has(n.relativePath))throw new Error("duplicate TypeScript overlay record");r.add(n.relativePath)}return t}function ue(e){return D(e,le)}function nt(e){if(!e)throw new Error("TypeScript overlay generation identity must be non-empty");return`${k(e)}.json`}function Pr(e){return k(JSON.stringify({version:e.version,producerIdentity:e.producerIdentity,projectIdentity:e.projectIdentity,baseGenerationIdentity:e.baseGenerationIdentity,generationIdentity:e.generationIdentity,overlays:e.overlays}))}function it(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 lt}from"crypto";import{closeSync as Di,existsSync as g,mkdirSync as Ai,openSync as Ci,readSync as Li,readdirSync as ut,renameSync as ct,rmSync as fe,statSync as B}from"fs";import{basename as ft,dirname as A,join as p,relative as Gr}from"path";var ki=Object.freeze({maxGenerations:2,maxLogicalBytes:2*1024*1024*1024});function Ar(e){let t=h(e.outputDb),r=ji(e);e.onStage?.("after-recovery-retained");let n=e.preserveOutputScip?e.outputScip:e.tempOutputScip,i=Ni(e,r),o=mt({generationRoot:t,databasePath:e.tempOutputDb,indexPath:g(n)?n:void 0,verifiedIndexArtifact:i,metadataPath:g(e.tempMetaPath)?e.tempMetaPath:void 0}),a=(e.now??(()=>new Date))().toISOString(),s={version:N,currentGeneration:o.identity,artifactSet:"immutable-v1",...r?{previousGeneration:r}:{},...e.publication?{publication:e.publication}:{},publishedAt:a},c=G(p(t,"state.json"),s,{spacing:2,trailingNewline:!0});e.onStage?.("after-pointer-handoff"),e.preserveOutputScip||st(e.tempOutputScip,e.outputScip),e.onStage?.("after-scip-handoff"),st(e.tempOutputDb,e.outputDb),e.onStage?.("after-database-handoff"),st(e.tempMetaPath,e.metaPath),e.onStage?.("after-metadata-handoff");let d=o.identity,l={...s,stableMirrors:pt(e.outputDb,e.outputScip)};G(p(t,"state.json"),l,{spacing:2,trailingNewline:!0});let f=Cr(e.outputDb,{now:e.now}),m=Z(o.directorySync,c.directorySync);return{currentGeneration:d,...r?{previousGeneration:r}:{},retention:f,achievedDurability:m==="synced"?"directory-durable":"file-flushed",directorySync:m}}function Oi(e,t,r,n=()=>new Date){if(!g(e))return null;let i=q(e),o=p(h(e),"state.json");if(i?.artifactSet==="immutable-v1"&&re(e,i.currentGeneration))return i;let a=h(e),s=!i&&g(o)?$i(r,e,t):void 0;if(s&&!ne(a,s))return null;let c=mt({generationRoot:a,databasePath:e,indexPath:g(t)?t:void 0,metadataPath:g(r)?r:void 0,forcedIdentity:i?.currentGeneration??s}),d={version:N,currentGeneration:c.identity,artifactSet:"immutable-v1",stableMirrors:pt(e,t),...i?.previousGeneration?{previousGeneration:i.previousGeneration}:{},...i?.publication?{publication:i.publication}:{},publishedAt:i?.publishedAt??n().toISOString()};return G(p(a,"state.json"),d,{spacing:2,trailingNewline:!0}),d}function Ba(e,t,r=()=>new Date){if(!g(e)||!g(t))throw new Error("metadata-only generation refresh requires stable database and metadata files");let n=q(e),i=h(e),o=mt({generationRoot:i,databasePath:e,indexPath:g(p(A(e),"index.scip"))?p(A(e),"index.scip"):void 0,metadataPath:t}),a=n&&n.currentGeneration!==o.identity?kr(e,n.currentGeneration):void 0,s={version:N,currentGeneration:o.identity,artifactSet:"immutable-v1",stableMirrors:pt(e,p(A(e),"index.scip")),...a?{previousGeneration:a}:{},...n?.publication?{publication:n.publication}:{},publishedAt:r().toISOString()};return G(p(h(e),"state.json"),s,{spacing:2,trailingNewline:!0}),Cr(e,{now:r}),s}function Cr(e,t={}){let r=Mi(t.limits),i=(t.now??(()=>new Date))().toISOString(),o=j(Ue(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=q(e),s=Fi(e),c=Ht(e,s.map(x=>x.identity),{isProcessAlive:t.isProcessAlive??be,readProcessIdentity:t.readProcessIdentity??ye}),d=new Set(c.protectedGenerations);a?.currentGeneration&&d.add(a.currentGeneration),a?.previousGeneration?.generationIdentity&&d.add(a.previousGeneration.generationIdentity);let l=s.length,f=s.reduce((x,Oe)=>x+Oe.logicalBytes,0),m=0,T=0;for(let x of s){if(l<=r.maxGenerations&&f<=r.maxLogicalBytes)break;d.has(x.identity)||(t.onBeforeRemove?.(x.identity),fe(x.path,{recursive:!0,force:!0}),l-=1,f-=x.logicalBytes,m+=1,T+=x.logicalBytes)}let y=l>r.maxGenerations||f>r.maxLogicalBytes,L={state:y?"protected":m>0?"collected":"within-bounds",generationCount:l,logicalBytes:f,protectedGenerations:d.size,activeReaderLeases:c.activeLeases,staleReaderLeasesRemoved:c.staleLeasesRemoved,malformedReaderLeases:c.malformedLeases,removedGenerations:m,removedLogicalBytes:T,limits:r,at:i,...y?{reason:c.malformedLeases>0?"malformed reader ownership evidence fails closed":"retention bounds cannot be met without deleting a protected generation"}:{}};return Dr(e,L),L}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{Dr(e,s)}catch{}return s}finally{o.release()}}function Mi(e={}){let t={...ki,...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 Fi(e){let t=h(e);return g(t)?ut(t,{withFileTypes:!0}).filter(r=>r.isDirectory()&&/^[a-f0-9]{64}$/.test(r.name)).map(r=>{let n=p(t,r.name),i=ne(t,r.name),o=i?i.database.size+(i.index?.size??0)+(i.metadata?.size??0):Lr(n);return{identity:r.name,path:n,logicalBytes:o,modifiedAtMs:B(n).mtimeMs}}).sort((r,n)=>r.modifiedAtMs-n.modifiedAtMs||r.identity.localeCompare(n.identity)):[]}function Lr(e){let t=0;for(let r of ut(e,{withFileTypes:!0})){let n=p(e,r.name);r.isDirectory()?t+=Lr(n):r.isFile()&&(t+=B(n).size)}return t}function Dr(e,t){V(p(h(e),"gc.json"),t,{spacing:2,trailingNewline:!0})}function De(e,t=p(A(e),"meta.json")){let r=p(h(e),"state.json");if(!g(r))return{state:"legacy",statePath:r};let n=q(e);if(!n)return{state:"invalid",statePath:r,reason:"generation state is malformed"};try{let i=re(e,n.currentGeneration),o=i!==null,a=i?_i(e,t,i,n):!1,s=n.previousGeneration?g(p(A(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 _i(e,t,r,n){if(n.stableMirrors&&(n.stableMirrors.databaseFileIdentity!==$(e)||n.stableMirrors.indexFileIdentity!==void 0&&n.stableMirrors.indexFileIdentity!==$(p(A(e),"index.scip")))||!dt(e,r.database))return!1;let i=p(A(e),"index.scip");if(r.index&&!dt(i,r.index))return!1;if(!r.metadata)return!g(t);if(!g(t))return!1;let o=p(h(e),r.identity,r.metadata.file);return g(o)&&M(b(t,"reindex metadata"))===M(b(o,"immutable reindex metadata"))}function dt(e,t){return g(e)&&B(e).isFile()&&B(e).size===t.size}function ji(e){let t=Oi(e.outputDb,e.outputScip,e.metaPath);return t?kr(e.outputDb,t.currentGeneration):void 0}function Ni(e,t){if(!e.preserveOutputScip)return;if(!t)throw new Error("deferred SCIP publication requires an accepted immutable generation");let r=De(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=re(e.outputDb,t.generationIdentity);if(!n?.index||!dt(e.outputScip,n.index))throw new Error("deferred SCIP publication requires the verified accepted index artifact");return n.index}function pt(e,t){return{databaseFileIdentity:$(e),...g(t)?{indexFileIdentity:$(t)}:{}}}function kr(e,t){let r=p(h(e),t),n=p(r,ft(e)),i=p(r,"meta.json");return{generationIdentity:t,databasePath:Gr(A(e),n),...g(i)?{metadataPath:Gr(A(e),i)}:{}}}function qi(e){if(g(e))for(let t of ut(e,{withFileTypes:!0}))t.isDirectory()&&t.name.endsWith(".tmp")&&fe(p(e,t.name),{recursive:!0,force:!0})}function $i(e,t,r=p(A(t),"index.scip")){let n=lt("sha256").update("sqlite-generation-artifacts-v1\0");return n.update(Ge(t)),g(r)&&n.update(`\0${Ge(r)}`),g(e)&&n.update(`\0${M(b(e,"reindex metadata"))}`),n.digest("hex")}function mt(e){let t=ot(e.databasePath),r=e.indexPath?e.verifiedIndexArtifact?Wi(e.indexPath,e.verifiedIndexArtifact):ot(e.indexPath):void 0,n=e.metadataPath?ot(e.metadataPath):void 0,i=e.forcedIdentity??Bi(t,r,e.metadataPath),o=p(e.generationRoot,i),a=p(o,ve);if(g(a)){let d=ne(e.generationRoot,i);if(d&&Or(o,d.database,t)&&Ui(o,d.index,r)&&Hi(o,d.metadata,e.metadataPath))return{identity:i,directorySync:O(e.generationRoot)};throw new Error(`SQLite generation ${i} already exists with different or corrupt artifacts.`)}let s=[Ie(e.generationRoot)];qi(e.generationRoot);let c=`${o}.${process.pid}.${Date.now()}.tmp`;fe(c,{recursive:!0,force:!0}),Ai(c,{recursive:!0});try{s.push(at(e.databasePath,p(c,t.file))),r&&e.indexPath&&s.push(at(e.indexPath,p(c,r.file))),n&&e.metadataPath&&s.push(at(e.metadataPath,p(c,n.file)));let d=G(p(c,ve),{version:ze,identity:i,database:t,...r?{index:r}:{},...n?{metadata:n}:{}},{spacing:2,trailingNewline:!0});d.directorySync!=="not-requested"&&s.push(d.directorySync),s.push(O(c)),ct(c,o),s.push(O(e.generationRoot))}finally{fe(c,{recursive:!0,force:!0})}return{identity:i,directorySync:Z(...s)}}function Bi(e,t,r){let n=lt("sha256").update("sqlite-generation-artifacts-v1\0");return n.update(e.sha256),t&&n.update(`\0${t.sha256}`),r&&n.update(`\0${M(b(r,"reindex metadata"))}`),n.digest("hex")}function ot(e){return{file:ft(e),size:B(e).size,sha256:Ge(e)}}function Wi(e,t){if(t.file!==ft(e)||B(e).size!==t.size)throw new Error(`verified SQLite generation artifact changed before publication: ${e}`);return t}function Ge(e){let t=lt("sha256"),r=Ci(e,"r"),n=Buffer.allocUnsafe(1024*1024);try{for(;;){let i=zi(r,n);if(i===0)break;t.update(n.subarray(0,i))}}finally{Di(r)}return t.digest("hex")}function zi(e,t){let r=0;for(;r<t.length;){let n=Li(e,t,r,t.length-r,null);if(r+=n,n===0)break}return r}function at(e,t){return xe(e,t,{mode:292})}function Or(e,t,r){let n=p(e,t.file);return t.file===r.file&&t.size===r.size&&t.sha256===r.sha256&&g(n)&&B(n).size===t.size&&Ge(n)===t.sha256}function Ui(e,t,r){return!t||!r?t===r:Or(e,t,r)}function Hi(e,t,r){if(!t||!r)return t===void 0&&r===void 0;let n=p(e,t.file);return g(n)&&M(b(n,"stored reindex metadata"))===M(b(r,"candidate reindex metadata"))}function st(e,t){fe(`${t}.tmp-replace`,{force:!0}),ct(e,`${t}.tmp-replace`),ct(`${t}.tmp-replace`,t)}import{createHash as Wr,randomUUID as Zi}from"crypto";import{existsSync as _,lstatSync as ht,mkdirSync as K,mkdtempSync as zr,readdirSync as Ur,realpathSync as Hr,renameSync as z,rmSync as F,statSync as ke}from"fs";import{dirname as St,join as u,resolve as W}from"path";import{setTimeout as eo}from"timers/promises";import{pathToFileURL as jr}from"url";import to from"better-sqlite3";import{lstatSync as Vi,readdirSync as Yi}from"fs";import{join as Qi,relative as Ki,resolve as gt,sep as Ji}from"path";var pe=1,yt="language-indexes",Mr=["index.db","index.scip","meta.json"],Fr=[yt,de,le];function Ae(e){let t=[];for(let r of Mr)Xi(e,r),t.push(r);for(let r of Fr)_r(e,r,t);return{version:pe,files:t.sort()}}function Ce(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(!Mr.includes(e)&&!Fr.includes(r))throw new Error(`index artifact path is not shareable: ${e}`);return e}function C(e,t){let r=Ce(t),n=gt(e),i=gt(n,...r.split("/"));if(i!==n&&!i.startsWith(`${n}${Ji}`))throw new Error(`index artifact escapes cache: ${t}`);return i}function _r(e,t,r){let n=Qi(e,t),i;try{i=Yi(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()?_r(e,a,r):o.isFile()&&r.push(Ce(a))}}function Xi(e,t){let r=C(e,t),n;try{n=Vi(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(Ki(gt(e),r).startsWith(".."))throw new Error(`index artifact escapes cache: ${t}`)}var It=1,Nr="SCIP_QUERY_SHARED_CACHE",ro=2,Le=JSON.stringify({cliVersion:kt,artifactCatalogVersion:pe,postIndexAugmentationSchemaVersion:ro,sqliteGenerationStoreVersion:N,typescriptFragmentStoreVersion:et,typescriptOverlayStoreVersion:Te}),bt="manifest.json",Vr="shared-cache.json";var xt=[yt,de,le];function no(e,t){if(!e.clean||!e.treeOid)return;let r=Zr(JSON.stringify({version:It,repositoryId:e.repositoryId,treeOid:e.treeOid,fingerprint:At(t),producerIdentity:Le}));return{repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:e.projectRoot,treeOid:e.treeOid,fingerprint:t,producerIdentity:Le,generationId:r,repositoryCacheDir:_e(e.repositoryId)}}function xs(e,t,r){if(!go(r))return!1;let n=no(e,r);if(!n)return!1;try{let i=lo(t);if(!i||i.repositoryId!==e.repositoryId||i.worktreeId!==e.worktreeId)return!1;let o=JSON.parse(R(u(n.repositoryCacheDir,"worktrees",`${i.worktreeId}.json`),{inputKind:"worktree cache lease",maxBytes:v}));return o.version!==1||o.repositoryId!==i.repositoryId||o.worktreeId!==i.worktreeId||W(o.projectRoot)!==W(e.projectRoot)||o.treeOid!==e.treeOid||W(o.localCacheDir)!==W(t)||o.ownershipChecksum!==wt(o)||o.baseGenerationId!==n.generationId||o.activeGenerationId!==n.generationId?!1:U(n,!1)!==null}catch{return!1}}function ws(e,t,r){if(process.env[Nr]==="0")return`${Nr}=0`;if(!je(r))return"explicit cache or database override";if(Ne(St(t))!==Ne(Mt(e))||t!==u(St(t),"index.db"))return"index database is outside the managed worktree cache"}function vs(e,t,r){if(!je(t))return;let n=r??qt(e);return n?u(_e(n.repositoryId),"evidence.db"):void 0}function U(e,t=!0){let r=vt(e),n;try{n=Yr(R(u(r,bt),{inputKind:"shared-generation manifest",maxBytes:v}))}catch{return null}if(n.generationId!==e.generationId||n.repositoryId!==e.repositoryId||n.treeOid!==e.treeOid||n.producerIdentity!==e.producerIdentity||!he(n.fingerprint,e.fingerprint)||!so(r))return null;if(!t)return n;try{for(let i of n.artifacts){let o=C(r,i.path),a=ke(o);if(!a.isFile()||a.size!==i.size||H(o,{inputKind:"shared-generation artifact",maxBytes:S})!==i.sha256)return null}}catch{return null}return n}function Rs(e,t,r,n){if(!e.treeOid)return null;let i=qe(t,r),o=u(Ot(),"repositories",e.repositoryId),a;try{let d=ht(o);if(!d.isDirectory()||d.isSymbolicLink())return null;a=Hr(o)}catch{return null}let s=u(a,"generations"),c=[];try{for(let d of Ur(s)){if(!/^[a-f0-9]{64}$/.test(d))continue;let l=u(s,d),f;try{f=ht(l)}catch{continue}if(!(!f.isDirectory()||f.isSymbolicLink()))try{let m=Yr(R(u(l,bt),{inputKind:"shared-generation baseline manifest",maxBytes:v}));m.generationId===d&&m.repositoryId===e.repositoryId&&m.producerIdentity===Le&&co(m.fingerprint,i)&&c.push(m)}catch{continue}}}catch{return null}c.sort((d,l)=>{let f=d.treeOid===e.treeOid?0:1,m=l.treeOid===e.treeOid?0:1;if(f!==m)return f-m;if(n){let y=Br(d.fingerprint,n)-Br(l.fingerprint,n);if(y!==0)return y}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},f=U(l);if(f)return{snapshot:l,manifest:f}}return null}function Es(e){let t=j(u(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 io(e)}finally{t.release()}}function io(e){let t=U(e.snapshot);if(t)return qr(e.snapshot,t);if(!Xr(e.sourceCacheDir,e.sourceProjectRoot,e.snapshot.fingerprint))throw new Error("source index is incomplete, incompatible, or corrupt");let r=$r(e.sourceCacheDir);if(!r)throw new Error("source index artifacts are incomplete");let n=Ae(e.sourceCacheDir),i=u(e.snapshot.repositoryCacheDir,"generations"),o=[Ie(i)],a=zr(u(i,`.tmp-${process.pid}-`));try{let s=[];for(let y of n.files){let L=C(e.sourceCacheDir,y),x=C(a,y);o.push(ge(L,x,292)),e.onPublicationStage?.("after-artifact-flushed",y);let Oe=ke(x).size;s.push({path:y,size:Oe,sha256:H(x,{inputKind:"staged shared-generation artifact",maxBytes:S})})}let c=oe(I(u(a,"index.scip"),{inputKind:"staged shared SCIP index",maxBytes:S}));if(!c)throw new Error("shared SCIP generation has no project root metadata");let d=Rt(e.sourceProjectRoot);if(c!==d)throw new Error("shared SCIP generation root does not match its source worktree");if($r(e.sourceCacheDir)!==r||e.sourceStillValid&&!e.sourceStillValid())throw new Error("source index changed while staging a shared generation");let l={version:It,artifactCatalogVersion:pe,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((y,L)=>y.path.localeCompare(L.path))},f=G(u(a,bt),l,{spacing:2,trailingNewline:!0});f.directorySync!=="not-requested"&&o.push(f.directorySync),e.onPublicationStage?.("after-manifest-flushed"),o.push(O(a)),e.onPublicationStage?.("after-staging-directory-synced");let m=vt(e.snapshot);try{if(_(m)&&!U(e.snapshot)){let y=`${m}.corrupt-${process.pid}-${Date.now()}`;z(m,y),F(y,{recursive:!0,force:!0})}z(a,m)}catch(y){let L=U(e.snapshot);if(L)return qr(e.snapshot,L);throw y}e.onPublicationStage?.("after-generation-renamed"),o.push(O(i)),e.onPublicationStage?.("after-generations-directory-synced");let T=Z(...o);return{kind:"published",manifest:l,achievedDurability:T==="synced"?"directory-durable":"file-flushed",directorySync:T}}finally{F(a,{recursive:!0,force:!0})}}function qr(e,t){let r=O(u(e.repositoryCacheDir,"generations"));return{kind:"existing",manifest:t,achievedDurability:r==="synced"?"directory-durable":"file-flushed",directorySync:r}}function Ps(e){let t=vt(e.snapshot);K(e.targetCacheDir,{recursive:!0});let r=j(u(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=zr(u(e.targetCacheDir,".shared-hydrate-")),mo(e.manifest,e.snapshot);for(let c of e.manifest.artifacts){let d=C(t,c.path),l=C(n,c.path);if(ge(d,l),ke(l).size!==c.size||H(l,{inputKind:"hydrated shared-generation artifact",maxBytes:S})!==c.sha256)throw new Error(`shared artifact is corrupt: ${c.path}`)}let a=Rt(e.targetProjectRoot);if(a!==e.manifest.scipProjectRoot)for(let c of e.manifest.artifacts)c.path.endsWith(".scip")&&ur(C(n,c.path),e.manifest.scipProjectRoot,a);if(!Xr(n,e.targetProjectRoot,e.snapshot.fingerprint,!1))throw new Error("staged shared generation failed completeness or integrity validation");i=uo(e.targetCacheDir,n),o=!0,fo(n,e.targetCacheDir,i),Ar({tempOutputScip:u(n,"index.scip"),tempOutputDb:u(n,"index.db"),tempMetaPath:u(n,"meta.json"),outputScip:u(e.targetCacheDir,"index.scip"),outputDb:u(e.targetCacheDir,"index.db"),metaPath:u(e.targetCacheDir,"meta.json"),now:e.now});let s=De(u(e.targetCacheDir,"index.db"),u(e.targetCacheDir,"meta.json"));if(s.state==="invalid"||s.state==="drifted")throw new Error(`hydrated SQLite generation failed validation: ${s.reason}`);e.persistLease!==!1&&oo(e.snapshot,e.targetCacheDir,e.action??"attached",e.now)}catch(a){throw o&&i&&po(e.targetCacheDir,i),a}finally{n&&F(n,{recursive:!0,force:!0}),r.release()}}async function Ts(e,t={}){let r=t.timeoutMs??3e4,n=t.pollMs??100,i=t.now??Lt,o=i()+r,a=u(e.repositoryCacheDir,"locks"),s=u(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(U(e))return{kind:"generation-ready"};let d=Ft(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 eo(Math.min(n,l))}return U(e)?{kind:"generation-ready"}:{kind:"timeout"}}function oo(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:wt(i)};return Kr(e.repositoryCacheDir,o,!0),o}function Gs(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:wt(n)};return Kr(e.repositoryCacheDir,i,!0),i}function wt(e){return Zr(JSON.stringify({version:1,repositoryId:e.repositoryId,worktreeId:e.worktreeId,projectRoot:W(e.projectRoot),localCacheDir:W(e.localCacheDir)}))}function Yr(e){let t=JSON.parse(e);if(t.version!==It||t.artifactCatalogVersion!==pe||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!==Le||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(Ce(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 ge(e,t,r=384){return xe(e,t,{mode:r})}function ao(e,t,r){K(e,{recursive:!0}),G(u(e,Vr),{version:1,repositoryId:t,worktreeId:r},{spacing:2,trailingNewline:!0})}function $r(e){try{let t=Ae(e),r=Wr("sha256");for(let n of t.files){let i=C(e,n),o=ke(i).size;r.update(n).update("\0").update(String(o)).update("\0"),Et(i,{inputKind:"source-generation artifact",maxBytes:S},a=>r.update(a)),r.update("\0")}return r.digest("hex")}catch{return null}}function Qr(e){try{let t=Se(R(u(e,"meta.json"),{inputKind:"reindex metadata",maxBytes:v}));return(t.kind==="legacy"||t.kind==="supported")&&t.capabilities.publishableGeneration?t.metadata:void 0}catch{return}}function so(e){return Qr(e)?.scipCompanion!=="deferred"}function co(e,t){let r=qe(e.languages,e);return JSON.stringify(r)===JSON.stringify(t)}function Br(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 u(e.repositoryCacheDir,"generations",e.generationId)}function lo(e){let t=JSON.parse(R(u(e,Vr),{inputKind:"worktree cache pointer",maxBytes:v}));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 Kr(e,t,r){let n=_t(e,{waitMs:5e3});if(!n)throw new Error("repository cache cleanup is busy");try{if(r){let o=t.activeGenerationId??t.baseGenerationId;if(!o||!_(u(e,"generations",o)))throw new Error("shared generation disappeared before its lease was attached")}let i=u(e,"worktrees");K(i,{recursive:!0}),G(u(i,`${t.worktreeId}.json`),t,{spacing:2,trailingNewline:!0}),ao(t.localCacheDir,t.repositoryId,t.worktreeId)}finally{n.release()}}function uo(e,t){let r=u(t,".rollback"),n=new Map,i=new Map;K(r,{recursive:!0});for(let s of["index.scip","index.db","meta.json"]){let c=u(e,s),d=_(c);n.set(s,d),d&&ge(c,u(r,"stable",s))}for(let s of xt){let c=u(e,s),d=_(c);if(d){let l=ht(c);if(!l.isDirectory()||l.isSymbolicLink())throw new Error(`managed artifact path is not a directory: ${s}`)}i.set(s,d)}let o=u(e,te),a=_(o);return a&&Jr(o,u(r,"sqlite-generations")),{root:r,stableFiles:n,managedDirectories:i,generationStoreExisted:a}}function fo(e,t,r){for(let n of xt){let i=u(t,n);if(r.managedDirectories.get(n)){let a=u(r.root,"managed",n);K(St(a),{recursive:!0}),z(i,a)}let o=u(e,n);_(o)&&z(o,i)}}function po(e,t){for(let i of xt){let o=u(e,i),a=u(t.root,"managed",i);t.managedDirectories.get(i)?_(a)&&(F(o,{recursive:!0,force:!0}),z(a,o)):F(o,{recursive:!0,force:!0})}for(let[i,o]of t.stableFiles){let a=u(e,i);if(!o){F(a,{force:!0});continue}let s=`${a}.shared-restore-${Zi()}`;ge(u(t.root,"stable",i),s),F(a,{force:!0}),z(s,a)}let r=u(e,te);F(r,{recursive:!0,force:!0});let n=u(t.root,"sqlite-generations");t.generationStoreExisted&&_(n)&&z(n,r)}function Jr(e,t){K(t,{recursive:!0});for(let r of Ur(e,{withFileTypes:!0})){let n=u(e,r.name),i=u(t,r.name);if(r.isSymbolicLink())throw new Error(`managed cache backup cannot contain a symlink: ${n}`);r.isDirectory()?Jr(n,i):r.isFile()&&ge(n,i)}}function mo(e,t){if(e.generationId!==t.generationId||e.repositoryId!==t.repositoryId||e.treeOid!==t.treeOid||e.producerIdentity!==t.producerIdentity||!he(e.fingerprint,t.fingerprint))throw new Error("shared generation manifest does not match the requested snapshot")}function Xr(e,t,r,n=!0,i=!0){try{let o=Qr(e);if(!o||o.scipCompanion==="deferred"||!he(Dt(o.fingerprint),r)||JSON.stringify([...o.indexedLanguages??[]].sort())!==JSON.stringify([...r.languages].sort()))return me("source validation rejected metadata"),!1;let a=Ae(e),s=De(u(e,"index.db"),u(e,"meta.json"));if(n?s.state!=="current":s.state==="invalid"||s.state==="drifted")return me(`source validation rejected SQLite generation state ${s.state}`),!1;let c=new to(u(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=Rt(t),f=(i?a.files.filter(m=>m.endsWith(".scip")):["index.scip"]).every(m=>{let T=oe(I(C(e,m),{inputKind:"shared SCIP validation artifact",maxBytes:S}));return T!==d&&me(`source validation rejected SCIP root for ${m}: ${String(T)}`),T===d});return f||me("source validation rejected SCIP project roots"),f}catch(o){return me(`source validation failed: ${o instanceof Error?o.message:String(o)}`),!1}}function me(e){process.env.SCIP_QUERY_DEBUG&&console.error(`shared-cache: ${e}`)}function Rt(e){try{return jr(Hr(e)).href}catch{return jr(W(e)).href}}function go(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 Zr(e){return Wr("sha256").update(e).digest("hex")}export{Po as a,ln as b,To as c,$ as d,ko as e,P as f,ie as g,Re as h,Bo as i,Jo as j,Xo as k,Zo as l,ia as m,Sa as n,Ia as o,Ga as p,Da as q,Aa as r,Ar as s,Oi as t,Ba as u,De as v,no as w,xs as x,ws as y,vs as z,U as A,Rs as B,Es as C,Ps as D,Ts as E,oo as F,Gs as G,wt as H};
|
|
2
|
-
//# sourceMappingURL=chunk-RMDPFPNW.js.map
|
package/dist/chunk-ROPJDEJZ.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as y}from"./chunk-A4WEAK35.js";import{a as v}from"./chunk-BJWFVAA5.js";import{p as S}from"./chunk-SKKXTABJ.js";import{a as b}from"./chunk-F5GSBHC6.js";import{d as u,e as f,j as m,r as p,s as g}from"./chunk-C7C6AKAT.js";import{h as d}from"./chunk-ETC674NS.js";function q(e,t,i={}){let n=T(e,t,i);return{definitions:n.definitions,referencedBy:n.referencedBy.map(r=>({relativePath:r.relativePath,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingShort}))}}function T(e,t,i={}){let n=R(e,t,i);return{definitions:n.definitions,referencedBy:n.referencedBy}}function R(e,t,i={}){let n=b(e,t);if(!n)return{definitions:[],referencedBy:[],referenceEvidence:[],claimSupport:null};let r=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),c=g(r?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:K(c,r?.display_name??null,n.symbol),source:B(e,n.relativePath,n.startLine,n.endLine)}],h=i.referenceContext??2,s=S(e,n,{semantic:i.semantic,semanticEvidence:v}).map(l=>{let a=y(e,l.file,l.line,h,f(n.symbol));return{relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?u(l.enclosingSymbol):"(top-level)",provenance:l.provenance,sourceStartLine:a?.startLine??null,sourceEndLine:a?.endLine??null,source:a?.source??null,sourceKind:a?.kind??"unavailable"}}),E=s.map(x);return{definitions:o,referencedBy:E,referenceEvidence:s.map(l=>({relativePath:l.relativePath,line:l.line,provenance:l.provenance,sourceKind:l.sourceKind})),claimSupport:P(s)}}function x(e){return{relativePath:e.relativePath,line:e.line,enclosingSymbol:e.enclosingSymbol,enclosingShort:e.enclosingShort,sourceStartLine:e.sourceStartLine,sourceEndLine:e.sourceEndLine,source:e.source}}function P(e){let t="resolved source-attributed or SCIP-indexed references to this exact symbol",i=["Dynamic dispatch, reflection, generated calls, and unindexed source are outside this scope."],n=e.filter(c=>c.sourceKind!=="complete-call-expression"&&c.sourceKind!=="non-call-reference"),r="direct, statically visible call expressions among the resolved reference sites";return{referenceAbsence:{status:"eligible",scope:t,limitations:i},callsitePredicates:n.length===0?{status:"eligible",scope:r,limitations:i}:{status:"ineligible",scope:r,reason:`${n.length} reference site(s) lack one unambiguous complete call expression.`,followup:L(n)}}}function L(e){let t=[...new Set(e.map(i=>`${i.relativePath}:${i.line+1}`))];return t.length===0||t.length>24?null:`scip-query inspect ${t.map(i=>`--at ${C(i)}`).join(" ")} --view behavior`}function C(e){return`'${e.replaceAll("'","'\\''")}'`}function B(e,t,i,n){let r=d(e,t);if(!r)return null;let o=r.split(`
|
|
2
|
-
`).slice(i,n+1).join(`
|
|
3
|
-
`).trimEnd();return o.length>0?o:null}function K(e,t,i){let n=p(e);if(n&&!A(n))return n;let r=(t??"").trim();return r?m(i)&&!r.endsWith("()")?`${r}()`:r:u(i)}function A(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{q as a,T as b,R as c};
|
|
4
|
-
//# sourceMappingURL=chunk-ROPJDEJZ.js.map
|
package/dist/chunk-RVZC6TJE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-2USA3S3P.js";import{b as i}from"./chunk-YXPUP5G2.js";import{existsSync as h}from"fs";import{isAbsolute as p,join as g}from"path";function D(e,n){let t=l(e,n,{allowMultiple:!1})[0]?.relativePath;return t||d(e,n)}function P(e,n){return l(e,n,{allowMultiple:!0}).map(t=>t.relativePath)}function S(e,n){let t=l(e,n,{allowMultiple:!0});return t.length===1?t[0].relativePath:null}function d(e,n){if(!n)return null;let t=n.replace(/\\/g,"/").replace(/^\.\//,""),r=p(t)&&t.startsWith(e.config.projectRoot)?t.slice(e.config.projectRoot.length).replace(/^\/+/,""):t,o=g(e.config.projectRoot,r);return h(o)?r:null}function l(e,n,t){let r=d(e,n);if(r)return i(e,r,t).filter(a=>a.relativePath===r);let o=n.replace(/\\/g,"/").replace(/^\.\//,""),s=p(o)||o.includes("/"),c=i(e,n,{...t,requirePathMatch:s});if(c.length===0){if(s)return[];let a=u(e,n);return!a||e.isIgnored(a.relativePath)?[]:[{relativePath:a.relativePath,score:700}]}return c}export{D as a,P as b,S as c};
|
|
2
|
-
//# sourceMappingURL=chunk-RVZC6TJE.js.map
|
package/dist/chunk-S4QZBKSR.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-3TNRNKAT.js";import{a as D}from"./chunk-2GJSD5GY.js";import{c as C}from"./chunk-2BMSSRBH.js";import{a as I}from"./chunk-BJWFVAA5.js";import{h as P}from"./chunk-U3SXIMII.js";import{b as F}from"./chunk-F5GSBHC6.js";import{f as M,g as S}from"./chunk-NJQISBL4.js";import{d as g}from"./chunk-C7C6AKAT.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-S4QZBKSR.js.map
|
package/dist/chunk-SCPMZ73U.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{O as c}from"./chunk-ZLMXIQLC.js";import{h as u,l as p}from"./chunk-ETC674NS.js";import{d as a}from"./chunk-KNLQGXVH.js";var g=a("suppression-inventory",{clearGroups:["whole-project"]});function C(t){return g.get(t,()=>y(t))}function y(t){let e={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,twin:0,uncategorized:0},n=new Map,i=0;for(let r of c(t)){let o=u(t,r);if(!(!o||!o.includes("scip-query")))for(let f of o.split(/\r?\n/)){let s=p(f);if(s===null)continue;i+=1,n.set(r,(n.get(r)??0)+1);let d=l(s);e[d]+=1}}for(let r of t.config.suppressions??[])r.expiresAt&&Date.parse(r.expiresAt)<=Date.now()||(i+=1,r.file&&n.set(r.file,(n.get(r.file)??0)+1),e[l(r.check)]+=1);return{total:i,byCategory:e,byFile:n}}function l(t){if(!t)return"uncategorized";let e=t.toLowerCase();return e==="dead-code"||e==="new-dead"?"dead":e.includes("twin")?"twin":e.includes("similar")||e.includes("duplicate")?"similar":e.includes("wrapper")?"wrapper":e.includes("passthrough")?"passthrough":e.includes("drift")?"drift":e.includes("extract")?"extract":e.includes("stale")?"stale":"uncategorized"}export{C as a};
|
|
2
|
-
//# sourceMappingURL=chunk-SCPMZ73U.js.map
|
package/dist/chunk-SIAP5RGI.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-NSM5IEVW.js";import{a as r}from"./chunk-F5GSBHC6.js";import{b as l}from"./chunk-BOW7SSQH.js";import{d as m}from"./chunk-C7C6AKAT.js";function N(n,t){let e=r(n,t);if(!e)return[];let s=n.get(`SELECT COUNT(DISTINCT c.document_id) AS file_count
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN (
|
|
5
|
-
SELECT m2.symbol_id, c2.document_id
|
|
6
|
-
FROM mentions m2
|
|
7
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
8
|
-
WHERE m2.role = 1
|
|
9
|
-
GROUP BY m2.symbol_id
|
|
10
|
-
) sym_def ON sym_def.symbol_id = m.symbol_id
|
|
11
|
-
WHERE m.symbol_id = ?
|
|
12
|
-
AND m.role != 1
|
|
13
|
-
AND sym_def.document_id != c.document_id`,e.symbolId);return[{name:m(e.symbol),count:s?.file_count??0,symbol:e.symbol,definedIn:e.relativePath}]}function a(n,t){let e=c(n,t);return e?n.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
|
|
14
|
-
FROM mentions m
|
|
15
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
16
|
-
JOIN documents d ON c.document_id = d.id
|
|
17
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
18
|
-
JOIN (
|
|
19
|
-
SELECT m2.symbol_id, c2.document_id
|
|
20
|
-
FROM mentions m2
|
|
21
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
22
|
-
WHERE m2.role = 1
|
|
23
|
-
GROUP BY m2.symbol_id
|
|
24
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
25
|
-
JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
26
|
-
WHERE d.relative_path = ?
|
|
27
|
-
AND m.role != 1
|
|
28
|
-
AND def_d.id != d.id
|
|
29
|
-
GROUP BY d.id
|
|
30
|
-
ORDER BY symbol_count DESC`,e).filter(i=>!n.isIgnored(i.relative_path)).map(i=>({name:i.relative_path,count:i.symbol_count,file:i.relative_path,basis:"external-symbol-references"})):[]}function u(n,t){let e=c(n,t);if(!e)return[];let o=l(n).get(e);return!o||o.size===0?[]:[{name:e,count:o.size,file:e,basis:"file-dependency-edges"}]}function g(n,t){let e=a(n,t);return e.length>0?e:u(n,t)}function I(n,t={}){return _(n,t).map(e=>({name:m(e.symbol),count:e.file_count,symbol:e.symbol,definedIn:e.defined_in}))}function _(n,t){let{limit:e=30,scope:s}=t,o=s?"AND def_d.relative_path LIKE ?":"",i=s?[`%${s}%`]:[];return n.all(`SELECT gs.symbol,
|
|
31
|
-
COUNT(DISTINCT c.document_id) AS file_count,
|
|
32
|
-
def_d.relative_path AS defined_in
|
|
33
|
-
FROM mentions m
|
|
34
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
35
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
36
|
-
JOIN (
|
|
37
|
-
SELECT m2.symbol_id, c2.document_id
|
|
38
|
-
FROM mentions m2
|
|
39
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
40
|
-
WHERE m2.role = 1
|
|
41
|
-
GROUP BY m2.symbol_id
|
|
42
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
43
|
-
JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
44
|
-
WHERE m.role != 1
|
|
45
|
-
AND def_d.id != c.document_id
|
|
46
|
-
${n.pathExclusionsFor("def_d")}
|
|
47
|
-
${n.symbolNoiseFor("gs")}
|
|
48
|
-
${o}
|
|
49
|
-
GROUP BY gs.id
|
|
50
|
-
HAVING file_count > 1
|
|
51
|
-
ORDER BY file_count DESC
|
|
52
|
-
LIMIT ?`,...i,e)}function R(n,t={}){let{limit:e=30,scope:s}=t,o=s?"AND d.relative_path LIKE ?":"",i=s?[`%${s}%`]:[];return n.all(`SELECT d.relative_path, COUNT(DISTINCT gs.id) AS symbol_count
|
|
53
|
-
FROM mentions m
|
|
54
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
55
|
-
JOIN documents d ON c.document_id = d.id
|
|
56
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
57
|
-
JOIN (
|
|
58
|
-
SELECT m2.symbol_id, c2.document_id
|
|
59
|
-
FROM mentions m2
|
|
60
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
61
|
-
WHERE m2.role = 1
|
|
62
|
-
GROUP BY m2.symbol_id
|
|
63
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
64
|
-
JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
65
|
-
WHERE m.role != 1
|
|
66
|
-
AND def_d.id != d.id
|
|
67
|
-
${n.pathExclusionsFor("d")}
|
|
68
|
-
${n.symbolNoiseFor("gs")}
|
|
69
|
-
${o}
|
|
70
|
-
GROUP BY d.id
|
|
71
|
-
ORDER BY symbol_count DESC
|
|
72
|
-
LIMIT ?`,...i,e).filter(d=>!n.isIgnored(d.relative_path)).map(d=>({name:d.relative_path,count:d.symbol_count}))}export{N as a,a as b,u as c,g as d,I as e,R as f};
|
|
73
|
-
//# sourceMappingURL=chunk-SIAP5RGI.js.map
|
package/dist/chunk-SIX4RFR3.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as R}from"./chunk-BJWFVAA5.js";import{o as h}from"./chunk-SKKXTABJ.js";import{a as g}from"./chunk-F5GSBHC6.js";import{j as d}from"./chunk-C7C6AKAT.js";import{a as m}from"./chunk-ZLMXIQLC.js";import{h as p}from"./chunk-ETC674NS.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
|
|
2
|
-
`);for(let o=0;o<c.length;o++){let f=c[o]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:o})}}return e}function S(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{D as a};
|
|
3
|
-
//# sourceMappingURL=chunk-SIX4RFR3.js.map
|
package/dist/chunk-SKKXTABJ.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{d as z}from"./chunk-KK7GPALL.js";import{d as y}from"./chunk-F5GSBHC6.js";import{C as $,c as E,e as b,v as O}from"./chunk-C7C6AKAT.js";import{a as A,b as F,n as L,y as R}from"./chunk-RBAD4GJ2.js";import{A as T,O as v}from"./chunk-ZLMXIQLC.js";import{h as p}from"./chunk-ETC674NS.js";import{c as h,d as k}from"./chunk-KNLQGXVH.js";import{b as P,d as g}from"./chunk-JZ2A7LDM.js";function _(e,n,t,r={}){if(!t)return[];let i=p(e,n);return i?i.indexOf(t)===-1?[]:(N(e,n).get(t)??[]).filter(s=>!X(s,r)):[]}function X(e,n){return typeof n.excludeStartLine=="number"&&typeof n.excludeEndLine=="number"&&e>=n.excludeStartLine&&e<=n.excludeEndLine}var q=h("file-identifiers",{clearGroups:["whole-project","source-file"]});function B(e,n){let t=L(e,n);return t?t.fileIdentifiers:q.get(e,n,()=>new Set(N(e,n).keys()))}var K=h("file-ident-lines",{clearGroups:["whole-project","source-file"]});function N(e,n){let t=L(e,n);return t?t.identifierLineMap:K.get(e,n,()=>ee(e,n))}var Q=h("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function Re(e,n){let t=L(e,n);return t?t.identifiersByLine:Q.get(e,n,()=>{let r=N(e,n),i=0;for(let s of r.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of r)for(let a of c)o[a].add(s);return o})}function ee(e,n){let t=new Map,r=(c,a)=>{let l=t.get(c);if(!l){t.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=p(e,n);if(!i)return t;let o=F(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&r(l[1],c)}return t}function we(e,n){let t=j(e);return t?n.filter(r=>j(r.file)===t):n}function De(e,n,t,r,i){let o=R(e,n);if(r){let f=i?.match(/^[A-Za-z_$][\w$]*/u)?.[0];if(!f)return null;let d=new Set(o.filter(u=>u.localName===f||u.importedName===f).map(u=>u.sourcePath).filter(u=>!!u));for(let u of t)for(let S of d)if(g(S,u.file))return u;if(f==="this"||f==="self"||f==="cls"){let u=t.filter(S=>S.file===n&&E(S.symbol)!==null);if(u.length===1)return u[0]}let m=te(p(e,n)??"",f);if(m.size===0)return null;let V=new Set(o.filter(u=>m.has(u.localName??u.importedName)).map(u=>u.sourcePath).filter(u=>!!u)),D=t.filter(u=>m.has(E(u.symbol)??"")&&(u.file===n||[...V].some(S=>g(S,u.file))));return D.length===1?D[0]:null}let s=t.filter(f=>E(f.symbol)===null),c=s.find(f=>f.file===n);if(c)return c;let a=b(t[0].symbol),l=o.filter(f=>f.kind!=="namespace"&&f.kind!=="side-effect"&&(f.localName===a||f.localName===null&&f.importedName===a));if(l.length>0){let f=s.filter(d=>l.some(m=>m.sourcePath!==null&&g(m.sourcePath,d.file)));return f.length===1?f[0]:null}return s.length===1?s[0]:null}function te(e,n){let t=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new Set,i=[new RegExp(`\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*)`,"gu"),new RegExp(`\\b${t}\\s*=\\s*(?:new\\s+)?([A-Za-z_$][\\w$]*)\\s*\\(`,"gu")];for(let o of i)for(let s of e.matchAll(o))r.add(s[1]);return r.size===1?r:new Set}function j(e){let n=T(e);return n?n==="typescript"||n==="tsx"||n==="javascript"?"javascript-family":n:null}var ne=k("global-leaf-index",{clearGroups:["whole-project"]});function M(e){return ne.get(e,()=>{let n=e.all(`SELECT gs.id, gs.symbol,
|
|
2
|
-
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
3
|
-
FROM global_symbols gs
|
|
4
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
5
|
-
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
6
|
-
LEFT JOIN (
|
|
7
|
-
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
8
|
-
FROM mentions m
|
|
9
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
-
JOIN documents d ON c.document_id = d.id
|
|
11
|
-
WHERE m.role = 1
|
|
12
|
-
GROUP BY m.symbol_id
|
|
13
|
-
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
14
|
-
WHERE 1 = 1
|
|
15
|
-
${e.symbolNoiseFor("gs")}`),t=new Map;for(let r of n){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=b(r.symbol);if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.some(s=>s.symbolId===r.id)||o.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return t})}var re=h("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function Z(e,n){let t=P(n);return re.get(e,t,()=>ie(e,t))}function ie(e,n){let t=new Map;for(let r of R(e,n)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&G(t,i,r.sourcePath),r.kind==="namespace")for(let o of r.usedMembers)G(t,o,r.sourcePath)}return t}function G(e,n,t){let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}var H=/[A-Za-z_$][A-Za-z0-9_$]*/g,U=/^[A-Za-z_$][A-Za-z0-9_$]*$/,oe=512;function C(e){let n=[],t=!1;for(let r of e)r&&(t=!0,U.test(r)||n.push(r));return{candidateNames:e,hasUsableCandidate:t,nonIdentifierNames:n}}function J(e,n){let t=se(n)?n:C(n);if(t.candidateNames.size===0||!t.hasUsableCandidate)return!0;if(t.candidateNames.size<=oe){for(let i of t.candidateNames)if(i){if(U.test(i)){if(ae(i).test(e))return!0;continue}if(e.includes(i))return!0}return!1}H.lastIndex=0;let r;for(;(r=H.exec(e))!==null;)if(t.candidateNames.has(r[0]))return!0;for(let i of t.nonIdentifierNames)if(e.includes(i))return!0;return!1}function se(e){return"candidateNames"in e}function ae(e){return new RegExp(`(?<![A-Za-z_$0-9])${A(e)}(?![A-Za-z_$0-9])`)}function w(e,n,t){let r=M(e).get(t);if(!r||r.length===0)return[];if(r.length===1)return[I(r[0])];let i=r.filter(a=>a.file===n);if(i.length>0)return i.map(I);let o=Z(e,n),s=o.get(t);if(s)for(let a of s){let l=r.filter(f=>g(a,f.file));if(l.length>0)return l.map(I)}let c=new Set;for(let a of o.values())for(let l of a)c.add(l);for(let a of c){let l=r.filter(f=>g(a,f.file));if(l.length>0&&l.length===r.length)return l.map(I)}return[]}function Ve(e,n,t){let r=w(e,n,t);if(r.length>0)return r;let i=M(e).get(t);return!i||i.length===0?[]:i.map(I)}function Y(e,n,t={}){let r=ce(e,n);if(!r)return[];let i=y(e,n);if(t.semantic!==!1&&t.semanticEvidence){let s=t.semanticEvidence.references(e,{...i,leaf:r.identifier,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let c=new Map;for(let a of s){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return x(e,c)}}let o=new Map;for(let s of v(e)){let c=le(e,r,s);c.length>0&&o.set(s,c)}return x(e,o)}function ce(e,n){let t=y(e,n);if(!t)return null;let r=b(t.symbol);return r?{symbolId:t.symbolId,relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,identifier:r}:null}function le(e,n,t){let r=p(e,t);return!r||r.indexOf(n.identifier)===-1?[]:t!==n.relativePath&&!w(e,t,n.identifier).some(o=>o.symbolId===n.symbolId)?[]:_(e,t,n.identifier,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{})}function Xe(e,n,t={}){let r=new Map;for(let a of n){if(!a.leaf)continue;let l=r.get(a.leaf)??[];l.push(a),r.set(a.leaf,l)}if(r.size===0)return new Map;let i=new Set(n.map(a=>a.symbolId)),o=new Set(r.keys()),s=C(o),c=new Map;for(let a of v(e)){if(t.skipPath?.(a)||!J(p(e,a),s))continue;let l=B(e,a);if(l.size!==0){for(let f of l)if(r.has(f))for(let d of w(e,a,f)){if(!i.has(d.symbolId)||a===d.relativePath)continue;let m=c.get(d.symbolId);m||(m=new Set,c.set(d.symbolId,m)),m.add(a)}}}return c}function I(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function x(e,n){let t=[],r=new Set;for(let[i,o]of n){let s=O(e,i);for(let c of o){let a=$(s,c),l=`${i}|${c}|${a?.symbol??""}`;r.has(l)||(r.add(l),t.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return t}function fe(e,n){return ue(e,[n]).get(n.symbolId)??[]}function ue(e,n){let t=n.map(o=>({symbolId:o.symbolId,prelude:Se(e,o)})).filter(o=>o.prelude!==null),r=pe(e,t.map(o=>o.symbolId)),i=new Map;for(let{symbolId:o,prelude:s}of t){let c=de(e,r.get(o)??new Map,s.match,s.identifier);i.set(o,x(e,c))}return i}function rt(e,n,t={}){return me(e,n,t).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function me(e,n,t={}){let r=Y(e,n,{semantic:t.semantic,semanticEvidence:t.semanticEvidence}),i=r.length>0?W(r,"source-attribution"):W(fe(e,n),"scip-reference-chunk");return t.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function W(e,n){return e.map(t=>({...t,provenance:n}))}function de(e,n,t,r){let i=new Map;for(let[o,s]of n)i.set(o,ge(e,o,s,t,r));return i}function pe(e,n){let t=new Map;for(let r of z(e,n)){if(e.isIgnored(r.relative_path))continue;let i=t.get(r.symbol_id);i||(i=new Map,t.set(r.symbol_id,i));let o=i.get(r.relative_path);o||(o=[],i.set(r.relative_path,o)),o.push({start_line:r.chunk_start,end_line:r.chunk_end})}return t}function ge(e,n,t,r,i){let o=n===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?_(e,n,i,o):[];return t.flatMap(c=>be(s,c))}function be(e,n){let t=e.filter(r=>r>=n.start_line&&r<=n.end_line);return t.length>0?t:[n.start_line]}function Se(e,n){let t=y(e,n);return t?{match:t,identifier:b(t.symbol)||null}:null}export{_ as a,N as b,Re as c,we as d,De as e,M as f,C as g,J as h,Z as i,w as j,Ve as k,Xe as l,fe as m,ue as n,rt as o,me as p};
|
|
16
|
-
//# sourceMappingURL=chunk-SKKXTABJ.js.map
|
package/dist/chunk-SSRFUQBD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as P,b as y}from"./chunk-V2RBODHL.js";import{a as C,c as b,e as r,f}from"./chunk-B3X6KU75.js";import{a as g,b as h,c as k}from"./chunk-KMVGRIO2.js";import{Q as v}from"./chunk-ZLMXIQLC.js";function L(e,i={}){let{minSimilarity:o=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=B(e,{scope:l,minTokens:n,scanLimit:u}),p=P(s,t=>t.tokens);return y({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,o),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function B(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(o=>({file:o.file,tokens:o.templateTokens,loc:T(o)}))}function T(e){return e.totalLines}function V(e,i,o){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<o)return null;let l=r(n,"component:"),u=r(n,"prop:"),m=r(n,"event:"),d=r(n,"directive:"),s=r(n,"slot:"),p=r(n,"id:"),t=S({sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p});return{fileA:e.file,fileB:i.file,similarity:c,tokenCountA:e.tokens.size,tokenCountB:i.tokens.size,sharedTokens:f(n),sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p,evidenceClass:t.evidenceClass,actionTier:t.actionTier,evidenceClassReasons:t.reasons,recommendation:t.recommendation,uniqueToA:f(h(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(h(i.tokens,e.tokens)).slice(0,25),locA:e.loc,locB:i.loc}}function R(e){let i=0,o=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(o+=1);return b([{name:"component",count:i},{name:"behavior",count:o}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return C({genericWords:x,primitiveGroups:[{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"},{values:e.sharedDirectives,reasonPrefix:"shared directives",bucket:"generic"},{values:e.sharedSlots,reasonPrefix:"shared slots",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedIdentifiers,label:"shared identifier",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific Vue primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{L as a};
|
|
2
|
-
//# sourceMappingURL=chunk-SSRFUQBD.js.map
|
package/dist/chunk-SYVJEEUJ.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as P,b as k,c as S,d as I,e as E,i as z}from"./chunk-QBQE7ZJ5.js";import{J as u,O as Q,P as $,Q as v,x as _,z as C}from"./chunk-JZ2A7LDM.js";function F(t,e){return t.reason instanceof Error?t.reason:new Error(e)}function j(t,e){if(t?.aborted)throw F(t,e)}import{randomUUID as oe}from"crypto";import{closeSync as se,fsyncSync as ae,linkSync as ce,mkdirSync as de,openSync as le,statSync as ue,unlinkSync as fe,writeSync as ye}from"fs";import{dirname as x}from"path";var G="scip-query-process-lock",A=1,w=Object.freeze({wallNow:()=>Date.now(),isProcessAlive:I,readProcessIdentity:S,randomToken:()=>oe(),makeDirectory:t=>de(t,{recursive:!0}),openFile:(t,e,r)=>le(t,e,r),writeFile:(t,e,r,n)=>ye(t,e,r,n),syncFile:t=>ae(t),closeFile:t=>se(t),linkFile:(t,e)=>ce(t,e),readFile:t=>u(t,"process lock record"),statFile:t=>{let e=ue(t);return{dev:e.dev,ino:e.ino,size:e.size,mtimeMs:e.mtimeMs}},removeFile:t=>fe(t)});function B(t,e){let r=e.runtime??w;r.makeDirectory(x(t));let n;for(let i=0;i<2;i+=1)try{return{kind:"acquired",lock:J(t,e,r),...n?{reclaimed:n}:{}}}catch(o){if(o.code!=="EEXIST")throw o;let s=m(t,{parseLegacy:e.parseLegacy,runtime:r});if(i===0&&me(t,s,{creationGraceMs:e.creationGraceMs,parseLegacy:e.parseLegacy,runtime:r})){n=s;continue}return{kind:"contended",observation:s}}return{kind:"contended",observation:m(t,{parseLegacy:e.parseLegacy,runtime:r})}}function m(t,e={}){let r=e.runtime??w,n,i;try{n=r.statFile(t),i=r.readFile(t)}catch(c){return c.code==="ENOENT"?{state:"missing"}:{state:"malformed"}}let o;try{o=JSON.parse(i)}catch{return{state:"malformed",raw:i,identity:n}}let s=pe(o);if(s)return{state:"valid",raw:i,identity:n,record:s,owner:ke(s),parsed:o};let a=e.parseLegacy?.(o)??null;return a?{state:"legacy",raw:i,identity:n,owner:a,parsed:o}:{state:"malformed",raw:i,identity:n,parsed:o}}function pe(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t;if(e.protocol!==G||e.version!==A||typeof e.kind!="string"||e.kind.trim()===""||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.token!="string"||e.token.trim()===""||typeof e.startedAt!="string"||!Number.isFinite(Date.parse(e.startedAt))||e.detail!==void 0&&(typeof e.detail!="object"||e.detail===null||Array.isArray(e.detail)))return null;let r=e.processIdentity===void 0?null:P(e.processIdentity);return e.processIdentity!==void 0&&(!r||r.pid!==e.pid)?null:{protocol:G,version:A,kind:e.kind,pid:e.pid,token:e.token,...r?{processIdentity:r}:{},startedAt:e.startedAt,...e.detail?{detail:e.detail}:{}}}function me(t,e,r={}){let n=r.runtime??w;if(!q(e,n))return!1;let i=ge(`${t}.reclaim`,n);if(!i)return!1;try{let o=m(t,{parseLegacy:r.parseLegacy,runtime:n});return!V(e,o)||!q(o,n)?!1:O(t,n)}finally{i.release()}}function J(t,e,r){let n=e.directoryDurability??"durable",i=e.pid??process.pid,o=r.randomToken(),s=e.processIdentity===void 0?r.readProcessIdentity(i):e.processIdentity,a={protocol:G,version:A,kind:e.kind,pid:i,token:o,...s?{processIdentity:s}:{},startedAt:new Date(r.wallNow()).toISOString(),...e.detail?{detail:e.detail}:{}},c=`${t}.${o}.candidate`,y=r.openFile(c,"wx",384),p;try{$(y,Buffer.from(`${JSON.stringify(a)}
|
|
2
|
-
`),r,"process lock"),r.syncFile(y)}catch(l){p=l}try{r.closeFile(y)}catch(l){p??=l}if(p!==void 0)throw h(c,r),p;try{r.linkFile(c,t)}catch(l){throw h(c,r),l}if(h(c,r),n==="durable")try{H(x(t),r)}catch(l){throw be(t,a,r),l}let f=!1;return{path:t,record:a,release:()=>f?!1:(f=!0,K(t,a,r,n))}}function be(t,e,r=w){return K(t,e,r,"durable")}function K(t,e,r,n){let i=m(t,{runtime:r});return i.state!=="valid"||!i.record||i.record.pid!==e.pid||i.record.token!==e.token||e.processIdentity&&(!i.record.processIdentity||!k(e.processIdentity,i.record.processIdentity))?!1:O(t,r,n)}function ge(t,e){for(let r=0;r<2;r+=1)try{return J(t,{kind:"reclaim-guard",runtime:e},e)}catch(n){if(n.code!=="EEXIST")return null;let i=m(t,{runtime:e});if(r>0||!q(i,e))return null;let o=m(t,{runtime:e});if(!V(i,o)||!O(t,e))return null}return null}function q(t,e){if(t.state==="missing")return!1;if(t.owner){if(!e.isProcessAlive(t.owner.pid))return!0;if(!t.owner.processIdentity)return!1;let r=e.readProcessIdentity(t.owner.pid);return r!==null&&!k(t.owner.processIdentity,r)}return!1}function V(t,e){return t.state===e.state&&t.raw===e.raw&&t.identity!==void 0&&e.identity!==void 0&&t.identity.dev===e.identity.dev&&t.identity.ino===e.identity.ino&&t.identity.size===e.identity.size&&t.identity.mtimeMs===e.identity.mtimeMs}function ke(t){return{pid:t.pid,...t.processIdentity?{processIdentity:t.processIdentity}:{}}}function H(t,e){let r;try{r=e.openFile(t,"r")}catch(n){if(v(n,process.platform))return;throw n}try{e.syncFile(r)}catch(n){if(!v(n,process.platform))throw n}finally{e.closeFile(r)}}function O(t,e,r="durable"){try{return e.removeFile(t),r==="durable"&&H(x(t),e),!0}catch{return!1}}function h(t,e){try{e.removeFile(t)}catch{}}import{join as Le}from"path";var Pe=t=>{if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t.pid;return typeof e=="number"&&Number.isSafeInteger(e)&&e>0?{pid:e}:null};function at(t,e={}){return D(Le(t,"gc.lock"),e)}function D(t,e={}){let r=e.waitMs??0,n=e.pollMs??10,i=e.now??E,o=i()+r;do{let s=U(t,e.directoryDurability);if(s)return W(s);let a=o-i();if(a<=0)return null;Se(Math.min(n,a))}while(i()<=o);return null}async function ct(t,e={}){let r=e.waitMs??0,n=e.pollMs??10,i=e.now??E,o=i()+r;do{j(e.signal,"Lock acquisition was aborted.");let s=U(t,e.directoryDurability);if(s)return W(s);let a=o-i();if(a<=0)return null;await Ie(Math.min(n,a),e.signal)}while(i()<=o);return null}function U(t,e){let r=B(t,{kind:"generic",parseLegacy:Pe,...e?{directoryDurability:e}:{}});return r.kind==="acquired"?r.lock:null}function W(t){return{release:()=>{t.release()}}}function Se(t){let e=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(e,0,0,t)}function Ie(t,e){return e?.aborted?Promise.reject(F(e,"Lock acquisition was aborted.")):new Promise((r,n)=>{let i=setTimeout(()=>{e?.removeEventListener("abort",o),r()},t),o=()=>{clearTimeout(i),e?.removeEventListener("abort",o),n(e?F(e,"Lock acquisition was aborted."):new Error("Lock acquisition was aborted."))};e?.addEventListener("abort",o,{once:!0})})}import{createHash as Fe,randomUUID as we}from"crypto";import{existsSync as b,mkdirSync as Re,readdirSync as Ee,rmSync as Y,statSync as Z}from"fs";import{basename as ve,dirname as R,join as d}from"path";var he=1,Ge=1,Ae=".scipquery-generations",qe="manifest.json",ee="readers",xe="gc.lock",Oe=128,L=new Map,te={pid:process.pid,now:()=>new Date,randomToken:()=>we(),isProcessAlive:I,readProcessIdentity:S};function g(t){return d(R(t),Ae)}function De(t){return d(g(t),xe)}function Pt(t,e=te){let r=D(De(t.dbPath),{waitMs:5e3,directoryDurability:"recoverable"});if(!r)throw new Error("SQLite generation retention is busy; retry opening the index.");let n;try{let i=Ce(t);if(i.source!=="immutable")return{generation:i,release(){}};let o=e.randomToken();if(!/^[A-Za-z0-9._-]+$/.test(o))throw new Error("SQLite generation reader token is unsafe.");let s=d(g(t.dbPath),ee);Re(s,{recursive:!0}),n=d(s,`${e.pid}-${o}.json`);let a=e.readProcessIdentity(e.pid);z(n,{version:1,token:o,generationIdentity:i.identity,pid:e.pid,...a?{processIdentity:a}:{},acquiredAt:e.now().toISOString()},{spacing:2,trailingNewline:!0});let c=!1;return{generation:i,release(){c||!n||(c=!0,Y(n,{force:!0}))}}}finally{r.release()}}function St(t,e,r=te,n={}){let i=d(g(t),ee);if(!b(i))return{protectedGenerations:new Set,activeLeases:0,staleLeasesRemoved:0,malformedLeases:0};let o=new Set,s=0,a=0,c=0;for(let y of Ee(i,{withFileTypes:!0})){if(!y.isFile()||!y.name.endsWith(".json"))continue;let p=d(i,y.name),f;try{f=Me(JSON.parse(u(p,"SQLite generation reader lease")))}catch{f=null}if(!f){c+=1;for(let l of e)o.add(l);continue}if(!Ne(f,r)){n.removeStale!==!1&&(Y(p,{force:!0}),a+=1);continue}s+=1,o.add(f.generationIdentity)}return{protectedGenerations:o,activeLeases:s,staleLeasesRemoved:a,malformedLeases:c}}function Me(t){if(!t||typeof t!="object"||Array.isArray(t))return null;let e=t,r=e.processIdentity===void 0?null:P(e.processIdentity);return e.version!==1||typeof e.token!="string"||e.token.trim()===""||typeof e.generationIdentity!="string"||!/^[a-f0-9]{64}$/.test(e.generationIdentity)||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0||typeof e.acquiredAt!="string"||!Number.isFinite(Date.parse(e.acquiredAt))||e.processIdentity!==void 0&&(!r||r.pid!==e.pid)?null:{version:1,token:e.token,generationIdentity:e.generationIdentity,pid:e.pid,...r?{processIdentity:r}:{},acquiredAt:e.acquiredAt}}function Ne(t,e){if(!e.isProcessAlive(t.pid))return!1;if(!t.processIdentity)return!0;let r=e.readProcessIdentity(t.pid);return r===null||k(t.processIdentity,r)}function re(t){try{let e=JSON.parse(u(d(g(t),"state.json"),"SQLite generation state"));return Be(e)?e:null}catch{return null}}function Te(t,e){return _e(g(t),e)}function _e(t,e){try{let r=JSON.parse(u(d(t,e,qe),"SQLite generation manifest"));return je(r,e)?r:null}catch{return null}}function Ce(t){let e=re(t.dbPath);if(e){let r=$e(t,e.currentGeneration);if(r)return r;if(e.artifactSet==="immutable-v1")throw new Error(`Published SQLite generation ${e.currentGeneration} is missing or invalid.`)}if(b(d(R(t.dbPath),"index.lock")))throw new Error("Legacy SQLite publication is in progress; retry after the reindex lock is released.");return ze(t,e?.currentGeneration)}function It(t){let e=re(t);if(e)return e.currentGeneration;try{let r=d(R(t),"meta.json"),n=b(r)?u(r,"reindex metadata"):void 0;return ne(t,n)}catch{return null}}function Qe(t){return C(_(t))??t}function $e(t,e){try{let r=d(g(t.dbPath),e),n=Te(t.dbPath,e);if(!n)return null;let i=M(r,n.database),o=n.index?M(r,n.index):void 0,s=n.metadata?M(r,n.metadata):void 0;return!N(i,n.database)||n.index&&(!o||!N(o,n.index))||n.metadata&&(!s||!N(s,n.metadata))?null:{identity:e,databasePath:i,...o?{indexPath:o}:{},...s?{metadataPath:s,metadataRaw:u(s,"reindex metadata")}:{},source:"immutable"}}catch{return null}}function ze(t,e){let r=ie(t.dbPath),n=d(R(t.dbPath),"meta.json"),i=b(n)?u(n,"reindex metadata"):void 0,o=b(t.indexPath)?t.indexPath:void 0;return{identity:e??ne(t.dbPath,i),databasePath:t.dbPath,...o?{indexPath:o}:{},...i===void 0?{}:{metadataPath:n,metadataRaw:i},source:"legacy",databaseFileIdentity:r}}function ne(t,e){let r=Fe("sha256").update("sqlite-generation-legacy-v1\0");return e!==void 0&&r.update(Qe(e)),r.update(`\0${ie(t)}`),r.digest("hex")}function ie(t){let e=Z(t);return`${e.dev}:${e.ino}:${e.size}:${e.mtimeMs}`}function M(t,e){if(ve(e.file)!==e.file||e.file==="."||e.file==="..")throw new Error("SQLite generation manifest contains an unsafe artifact path");return d(t,e.file)}function N(t,e){if(!b(t))return!1;let r=X(t);if(!r||r.size!==e.size)return!1;let n=`${t}\0${e.sha256}\0${r.identity}`;if(L.has(n))return!0;let i=Q(t,{inputKind:"immutable SQLite generation artifact",maxBytes:e.size}),o=X(t);if(!o||o.identity!==r.identity||i!==e.sha256)return!1;for(L.set(n,!0);L.size>Oe;){let s=L.keys().next().value;if(s===void 0)break;L.delete(s)}return!0}function X(t){let e=Z(t,{bigint:!0});return e.isFile()?{identity:`${e.dev}:${e.ino}:${e.size}:${e.mtimeNs}:${e.ctimeNs}`,size:Number(e.size)}:null}function je(t,e){return t.version===Ge&&t.identity===e&&T(t.database)&&(t.index===void 0||T(t.index))&&(t.metadata===void 0||T(t.metadata))}function T(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.file=="string"&&!!e.file&&Number.isSafeInteger(e.size)&&(e.size??-1)>=0&&typeof e.sha256=="string"&&/^[a-f0-9]{64}$/.test(e.sha256)}function Be(t){return t.version===he&&typeof t.currentGeneration=="string"&&!!t.currentGeneration&&typeof t.publishedAt=="string"&&Number.isFinite(Date.parse(t.publishedAt))&&(t.artifactSet===void 0||t.artifactSet==="immutable-v1")&&Je(t.stableMirrors)&&Ke(t.previousGeneration)&&Ve(t.publication)}function Je(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.databaseFileIdentity=="string"&&!!e.databaseFileIdentity&&(e.indexFileIdentity===void 0||typeof e.indexFileIdentity=="string"&&!!e.indexFileIdentity)}function Ke(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t;return typeof e.generationIdentity=="string"&&!!e.generationIdentity&&typeof e.databasePath=="string"&&!!e.databasePath&&(e.metadataPath===void 0||typeof e.metadataPath=="string"&&!!e.metadataPath)}function Ve(t){if(t===void 0)return!0;if(!t||typeof t!="object")return!1;let e=t,r=[e.converterDurationMs,e.affectedDocumentCount,e.changedDocumentCount,e.producerDurationMs,e.materializationDurationMs,e.patchDurationMs].filter(n=>n!==void 0);return(e.mode==="incremental"||e.mode==="full")&&e.validation==="passed"&&e.converterDurationMs!==void 0&&r.every(n=>typeof n=="number"&&Number.isFinite(n)&&n>=0)&&(e.scipCompanion===void 0||e.scipCompanion==="current"||e.scipCompanion==="deferred")&&(e.typescriptOverlayGeneration===void 0||typeof e.typescriptOverlayGeneration=="string"&&!!e.typescriptOverlayGeneration)&&(e.scipCompanion!=="deferred"||!!e.typescriptOverlayGeneration)&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}export{F as a,j as b,B as c,m as d,me as e,at as f,D as g,ct as h,he as i,Ge as j,Ae as k,qe as l,g as m,De as n,Pt as o,St as p,re as q,Te as r,_e as s,Ce as t,It as u,Qe as v,ie as w};
|
|
3
|
-
//# sourceMappingURL=chunk-SYVJEEUJ.js.map
|
package/dist/chunk-T3CZAZSI.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as ee,b as q,d as v}from"./chunk-JFMEXGFE.js";import{i as te,j as h,k as f,l as p}from"./chunk-7HXT6YLU.js";import{e as Q,g as Z,h as F,n as P}from"./chunk-7F45LJKI.js";import{randomUUID as Le}from"crypto";import{closeSync as Ne,existsSync as Oe,fsyncSync as ke,linkSync as qe,mkdirSync as Pe,openSync as $e,renameSync as Ce,unlinkSync as Te,writeSync as _e}from"fs";import{dirname as ne}from"path";import{chmodSync as Ie,constants as Fe,copyFileSync as Re}from"fs";import{dirname as Ee}from"path";var ie=Object.freeze({...te,copyFile:(e,t)=>Re(e,t,Fe.COPYFILE_FICLONE),chmodFile:(e,t)=>Ie(e,t)});function ve(e,t,i={}){let n=i.runtime??ie,r=Ee(t),o=h(r,n);n.copyFile(e,t),i.mode!==void 0&&n.chmodFile(t,i.mode);let s=n.openFile(t,"r");try{n.syncFile(s)}finally{n.closeFile(s)}return p(o,f(r,n))}var re=Object.freeze({platform:process.platform,randomToken:()=>Le(),pathExists:e=>Oe(e),makeDirectory:e=>Pe(e,{recursive:!0}),openFile:(e,t,i)=>$e(e,t,i),writeFile:(e,t,i,n)=>_e(e,t,i,n),syncFile:e=>ke(e),closeFile:e=>Ne(e),renameFile:(e,t)=>Ce(e,t),linkFile:(e,t)=>qe(e,t),removeFile:e=>Te(e)});function $(e,t,i={}){let n=i.durability??"visibility",r=i.runtime??re,o=ne(e),s=n==="durable"?h(o,r):(r.makeDirectory(o),"not-requested"),a=`${e}.tmp-${r.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,d,c=!1;try{d=r.openFile(a,"wx",i.mode??384),c=!0,P(d,l,r,"atomic file"),n==="durable"&&r.syncFile(d),r.closeFile(d),d=void 0,r.renameFile(a,e),c=!1;let m=n==="durable"?p(s,f(o,r)):"not-requested";return oe(n,m)}finally{if(d!==void 0)try{r.closeFile(d)}catch{}if(c)try{r.removeFile(a)}catch{}}}function L(e,t,i={}){let n=i.durability??"visibility",r=i.runtime??re;if(!r.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let o=ne(e),s=n==="durable"?h(o,r):(r.makeDirectory(o),"not-requested"),a=`${e}.tmp-${r.randomToken()}`,l=typeof t=="string"?Buffer.from(t):t,d,c=!1;try{d=r.openFile(a,"wx",i.mode??384),c=!0,P(d,l,r,"exclusive atomic file"),n==="durable"&&r.syncFile(d),r.closeFile(d),d=void 0,r.linkFile(a,e);let m=n==="durable"?f(o,r):"not-requested";r.removeFile(a),c=!1;let b=n==="durable"?p(s,m,f(o,r)):"not-requested";return oe(n,b)}finally{if(d!==void 0)try{r.closeFile(d)}catch{}if(c)try{r.removeFile(a)}catch{}}}function oe(e,t){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":t==="synced"?"directory-durable":"file-flushed",directorySync:t}}function se(e,t,i={}){$(e,ae(t,i),{durability:"visibility",runtime:i.runtime})}function C(e,t,i={}){return $(e,ae(t,i),{durability:"durable",runtime:i.runtime})}function ae(e,t){let i=JSON.stringify(e,null,t.spacing);return t.trailingNewline?`${i}
|
|
2
|
-
`:i}import{createHash as T,randomUUID as pe}from"crypto";import{closeSync as Ue,existsSync as D,fstatSync as We,lstatSync as B,mkdirSync as Ke,openSync as ze,readdirSync as w,readSync as Xe,renameSync as _,rmSync as g}from"fs";import{basename as S,dirname as J,join as y}from"path";function de(e){return N(e,Je)}function St(e){return N(e,je)}function N(e,t){return Array.isArray(e)?`[${e.map(i=>N(i,t)).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([i],[n])=>t(i,n)).map(([i,n])=>`${JSON.stringify(i)}:${N(n,t)}`).join(",")}}`:JSON.stringify(e)}function Je(e,t){return e.localeCompare(t)}function je(e,t){return e<t?-1:e>t?1:0}var j=1,He=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}),x=class extends Error{constructor(i,n,r,o){let s=i==="item-too-large"?`request is ${o} bytes; per-item limit is ${r.maxItemBytes}`:i==="item-capacity"?`mailbox has ${n.totalItems} retained items; limit is ${r.maxItems}`:i==="byte-capacity"?`mailbox retains ${n.totalBytes} bytes and the request adds ${o}; limit is ${r.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=i;this.status=n;this.limits=r;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},ge=".owner.json",U={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function qt(e){return{rootDir:e,pendingDir:y(e,"pending"),inflightDir:y(e,"inflight"),responseDir:y(e,"responses"),deadLetterDir:y(e,"dead-letter"),legacyRequestDir:y(e,"requests")}}function I(e={}){let t={...He,...e};for(let[i,n]of Object.entries(t))if(!Number.isFinite(n)||n<=0||!Number.isInteger(n))throw new Error(`Mailbox limit ${i} must be a positive integer.`);return t}function k(e){let t=[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir].map(i=>h(i));return p(...t)}function Pt(e,t){return T("sha256").update(de({namespace:e,payload:t})).digest("hex")}function xe(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${e}`}function $t(e,t,i={}){let n=I(i.limits),r=i.nowMs??Date.now(),o=k(e);return st(t),K(e,n,i.admissionLockTimeoutMs??2e3,i.monotonicNow??v,i.durability??"durable",()=>{W(e,r,n);let s=y(e.pendingDir,`${t.id}.json`),a=y(e.responseDir,`${t.id}.json`),l=ce(e,t.id);if(l){let b=ue(l,t.operationKey,t.id);return{disposition:"duplicate",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:b.deadlineAtMs??t.deadlineAtMs}}let d=`${JSON.stringify(t)}
|
|
3
|
-
`,c=Buffer.byteLength(d),m=R(e);if(c>n.maxItemBytes)throw new x("item-too-large",m,n,c);if(m.totalItems+1>n.maxItems)throw new x("item-capacity",m,n,c);if(m.totalBytes+c>n.maxBytes)throw new x("byte-capacity",m,n,c);i.onBeforePublish?.();try{let b=i.durability??"durable",u=L(s,d,{durability:b}),M=b==="durable"?p(o,u.directorySync):"not-requested";return{disposition:"accepted",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:t.deadlineAtMs,achievedDurability:u.achievedDurability,directorySync:M}}catch(b){if(b.code!=="EEXIST")throw b;let u=ce(e,t.id);if(!u)throw b;let M=ue(u,t.operationKey,t.id);return{disposition:"duplicate",requestId:t.id,responsePath:a,authoritativeDeadlineAtMs:M.deadlineAtMs??t.deadlineAtMs}}})}function Ve(e,t){if(!t.ownerId.trim())throw new Error("Mailbox claim owner identity is required.");if(t.owner&&(!Number.isSafeInteger(t.owner.pid)||t.owner.pid<=0||t.owner.processIdentity!==void 0&&t.owner.processIdentity.pid!==t.owner.pid))throw new Error("Mailbox claim process identity is invalid.");let i=t.nowMs??Date.now(),n=I(t.limits),r=k(e);try{return K(e,n,2e3,t.monotonicNow??v,t.durability??"durable",()=>Ye(e,t.ownerId,i,n,t.liveness??U,t.owner??{pid:process.pid},r,t.durability??"durable",t.onClaimStage))}catch(o){if(o instanceof x&&o.code==="admission-busy")return[];throw o}}function Ct(e,t){return!be(e.pendingDir)&&!be(e.legacyRequestDir)?[]:Ve(e,t)}function Ye(e,t,i,n,r,o,s,a,l){W(e,i,n,r);let d=y(e.inflightDir,O(t)),c=[...me(e.pendingDir,!1),...me(e.legacyRequestDir,!0)].sort((u,M)=>u.orderAtMs-M.orderAtMs||u.header.id.localeCompare(M.header.id)||u.path.localeCompare(M.path)),m=a==="durable"?s:"not-requested";c.length>0&&(a==="durable"?m=p(m,h(d)):Ke(d,{recursive:!0}),l?.("after-owner-directory-durable"),rt(d,t,o,a),l?.("after-owner-record-published"));let b=[];for(let u of c){if(b.length>=n.maxBatch)break;let M=y(e.responseDir,`${u.header.id}.json`);if(D(M)){g(u.path,{force:!0});continue}let H=Math.max(i+n.claimLeaseMs,(u.header.deadlineAtMs??i)+5e3),we=`${O(u.originalFile)}.${H}.claim`,V=y(d,we);try{_(u.path,V)}catch(Y){let G=Y.code;if(G==="ENOENT"||G==="EEXIST")continue;throw Y}l?.("after-claim-renamed");let Ae=a==="durable"?f(J(u.path)):"not-requested";l?.("after-source-directory-synced");let Se=a==="durable"?f(d):"not-requested";l?.("after-destination-directory-synced");let Be=p(m,Ae,Se);b.push({requestId:u.header.id,ownerId:t,path:V,originalFile:u.originalFile,claimedAtMs:i,claimExpiresAtMs:H,byteLength:u.byteLength,...u.header.operationKey?{operationKey:u.header.operationKey}:{},...u.header.clientId?{clientId:u.header.clientId}:{},...u.header.enqueuedAtMs===void 0?{}:{enqueuedAtMs:u.header.enqueuedAtMs},...u.header.deadlineAtMs===void 0?{}:{deadlineAtMs:u.header.deadlineAtMs},legacy:u.legacy,directorySync:Be})}return b}function Tt(e,t={}){let i=I(t);if(e.byteLength>i.maxItemBytes)throw new x("item-too-large",{pending:0,inflight:1,responses:0,deadLetters:0,invalid:0,totalItems:1,totalBytes:e.byteLength},i,e.byteLength);return Z(e.path,{maxBytes:i.maxItemBytes,inputKind:"bounded mailbox item"})}function Ge(e,t,i,n={}){let r=n.nowMs??Date.now(),o=I(n.limits),s=t.deadlineAtMs===void 0?r+o.responseRetentionMs:Math.min(r+o.responseRetentionMs,Math.max(t.deadlineAtMs,r)+Me),a={mailboxVersion:j,operationKey:t.operationKey??`legacy-${t.requestId}`,clientId:t.clientId??"legacy",...t.deadlineAtMs===void 0?{}:{deadlineAtMs:t.deadlineAtMs},completedAtMs:r,expiresAtMs:s},l={...a,...i,...a},d=Buffer.byteLength(`${JSON.stringify(l)}
|
|
4
|
-
`),c=R(e);if(d>o.maxItemBytes)throw new x("item-too-large",c,o,d);let m=Math.max(0,c.totalBytes-t.byteLength)+d;if(m>o.maxBytes&&m>c.totalBytes&&(Ze(e,r).removed>0&&(c=R(e),m=Math.max(0,c.totalBytes-t.byteLength)+d),m>o.maxBytes&&m>c.totalBytes))throw new x("byte-capacity",c,o,d);let b=n.durability??"durable";if(et(e,t,l,b),n.onAfterResponsePublished?.(),g(t.path,{force:!0}),b==="durable"){let u=J(t.path);f(D(u)?u:e.inflightDir)}}var Me=3e4,Qe=4096;function Ze(e,t){let i={removed:0,bytesFreed:0},n;try{n=w(e.responseDir)}catch{return i}for(let r of n){if(!r.endsWith(".json"))continue;let o=y(e.responseDir,r),s,a;try{let m=ze(o,"r");try{a=We(m).size;let b=Buffer.alloc(Math.min(Qe,a));Xe(m,b,0,b.length,0),s=b.toString("utf8")}finally{Ue(m)}}catch{continue}let l=le(s,"expiresAtMs"),d=le(s,"deadlineAtMs");if(l!==null&&l<=t||d!==null&&d+Me<=t)try{g(o,{force:!0}),i.removed+=1,i.bytesFreed+=a}catch{}}return i}function le(e,t){let i=new RegExp(`"${t}":(\\d+)`).exec(e);if(!i)return null;let n=Number(i[1]);return Number.isSafeInteger(n)?n:null}function _t(e,t,i,n,r={}){let o=r.nowMs??Date.now(),s=I(r.limits);if(Ge(e,t,i,{...r,nowMs:o,limits:s}),!D(t.path)){let a=y(e.deadLetterDir,`${lt(t.requestId)}.${o}.${T("sha256").update(n).digest("hex").slice(0,12)}.json`),l={mailboxVersion:j,requestId:t.requestId,ownerId:t.ownerId,rejectedAtMs:o,reason:n,originalFile:t.originalFile},d=Buffer.byteLength(`${JSON.stringify(l,null,2)}
|
|
5
|
-
`),c=R(e);c.totalItems<s.maxItems&&c.totalBytes+d<=s.maxBytes&&C(a,l,{spacing:2,trailingNewline:!0})}}function Jt(e,t={}){let i=t.nowMs??Date.now(),n=I(t.limits);return k(e),K(e,n,2e3,t.monotonicNow??v,"durable",()=>W(e,i,n,t.liveness??U))}function W(e,t,i,n=U){let r={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=i.cleanupBatch;for(let s of X(e.inflightDir)){if(o<=0)break;let a=y(e.responseDir,`${s.requestId}.json`);if(D(a)){g(s.path,{force:!0}),r.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>t||ot(e,s.ownerId,n)!=="dead")continue;let l=y(e.pendingDir,s.originalFile);try{_(s.path,l),r.reclaimed++}catch(d){if(d.code!=="EEXIST")throw d;g(s.path,{force:!0})}f(J(s.path)),f(e.pendingDir),o--}o=ye(e.responseDir,o,(s,a)=>a+i.responseRetentionMs,t,()=>{r.responsesRemoved++}),o=ye(e.deadLetterDir,o,(s,a)=>a+i.deadLetterRetentionMs,t,()=>{r.deadLettersRemoved++});for(let s of[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir]){if(o<=0)break;for(let a of De(s)){if(o<=0)break;if(!S(a).includes(".tmp-"))continue;let l;try{l=B(a).mtimeMs}catch(d){if(d.code==="ENOENT")continue;throw d}l+i.temporaryRetentionMs>t||(g(a,{force:!0}),r.temporaryFilesRemoved++,o--)}}return at(e.inflightDir),r}function R(e){k(e);let t=[...A(e.pendingDir).map(l=>({path:l,pending:!0})),...A(e.legacyRequestDir).map(l=>({path:l,pending:!0}))],i=X(e.inflightDir).map(l=>({path:l.path,pending:!1})),n=A(e.responseDir).map(l=>({path:l,pending:!1})),r=A(e.deadLetterDir).map(l=>({path:l,pending:!1})),o=[...t,...i,...n,...r],s=0,a;for(let l of t){let d=E(l.path);if(!d){s++;continue}let c=d.enqueuedAtMs;if(c===void 0)try{c=B(l.path).mtimeMs}catch(m){if(m.code==="ENOENT")continue;throw m}a=a===void 0?c:Math.min(a,c)}return{pending:t.length,inflight:i.length,responses:n.length,deadLetters:r.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((l,d)=>l+dt(d.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function et(e,t,i,n){let r=y(e.responseDir,`${t.requestId}.json`),o=`${JSON.stringify(i)}
|
|
6
|
-
`;try{L(r,o,{durability:n})}catch(s){if(s.code!=="EEXIST")throw s;let a=E(r),l=t.operationKey??`legacy-${t.requestId}`;if(a?.operationKey!==l)throw new Error(`Mailbox completion ${t.requestId} conflicts with an existing operation.`,{cause:s})}}function K(e,t,i,n,r,o){let s=y(e.rootDir,".admission.lock"),a=`${process.pid}-${pe()}`,l=n()+Math.max(0,i);for(;!tt(e.rootDir,s,a,r);){if(it(s),n()>=l)throw new x("admission-busy",R(e),t,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{z(s).ownerToken===a&&(g(s,{recursive:!0,force:!0}),r==="durable"&&f(e.rootDir))}catch{}}}function tt(e,t,i,n){let r=`${JSON.stringify({ownerToken:i,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
7
|
-
`;try{return L(t,r,{durability:n}),!0}catch(o){if(o.code==="EEXIST")return!1;try{z(t).ownerToken===i&&(g(t,{force:!0}),n==="durable"&&f(e))}catch{}throw o}}function it(e){let t=null;try{let n=z(e);typeof n.ownerToken=="string"&&Number.isSafeInteger(n.pid)&&Number(n.pid)>0&&(t=Number(n.pid))}catch{}if(t===null||nt(t))return;let i=`${e}.stale-${pe()}`;try{_(e,i)}catch(n){let r=n.code;if(r==="ENOENT"||r==="EEXIST")return;throw n}g(i,{recursive:!0,force:!0})}function z(e){try{return JSON.parse(F(e,"mailbox lock record"))}catch(t){if(t.code!=="EISDIR"&&!(t instanceof Q&&t.reason==="not-regular"))throw t;return JSON.parse(F(y(e,"owner.json"),"mailbox lock owner record"))}}function nt(e){try{return process.kill(e,0),!0}catch(t){let i=t.code;return i==="EPERM"||i!=="ESRCH"}}function rt(e,t,i,n){let r=y(e,ge),o=i.processIdentity,s=he(r);if(s&&s.ownerId===t&&s.pid===i.pid&&(!s.processIdentity&&!o||s.processIdentity&&o&&q(s.processIdentity,o)))return;if(A(e).some(l=>l.endsWith(".claim")))throw new Error(`Mailbox owner identity ${t} collides with retained work from another process instance.`);let a={version:1,ownerId:t,pid:i.pid,...o?{processIdentity:o}:{}};n==="durable"?C(r,a):se(r,a)}function ot(e,t,i){let n=he(y(e.inflightDir,O(t),ge));if(!n)return"unknown";if(!i.isProcessAlive(n.pid))return"dead";if(!n.processIdentity)return"live";let r=i.readProcessIdentity(n.pid);return r?q(n.processIdentity,r)?"live":"dead":"unknown"}function he(e){try{let t=JSON.parse(F(e,"mailbox owner record"));if(t.version!==1||typeof t.ownerId!="string"||!t.ownerId||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0)return null;let i=t.processIdentity===void 0?null:ee(t.processIdentity);return t.processIdentity!==void 0&&(!i||i.pid!==t.pid)?null:{version:1,ownerId:t.ownerId,pid:t.pid,...i?{processIdentity:i}:{}}}catch{return null}}function ce(e,t){for(let i of[y(e.pendingDir,`${t}.json`),y(e.legacyRequestDir,`${t}.json`),y(e.responseDir,`${t}.json`)])if(D(i))return i;for(let i of X(e.inflightDir))if(i.requestId===t)return i.path;return null}function ue(e,t,i){let n=E(e);if(n?.operationKey===t)return n;if(S(e)===`${xe(t)}.json`)return{id:i,operationKey:t};throw new Error(`Mailbox operation ${i} conflicts with an existing retained record.`)}function st(e){if(e.mailboxVersion!==j||e.id!==xe(e.operationKey)||!e.clientId.trim()||!Number.isFinite(e.enqueuedAtMs)||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function me(e,t){return A(e).filter(i=>i.endsWith(".json")).map(i=>{let n=B(i),r=S(i,".json"),o=E(i)??{id:r};return{path:i,originalFile:S(i),header:o,byteLength:n.size,orderAtMs:o.enqueuedAtMs??n.mtimeMs,legacy:t}})}function X(e){if(!D(e))return[];let t=[];for(let i of w(e,{withFileTypes:!0})){if(!i.isDirectory())continue;let n=fe(i.name);if(n===null)continue;let r=y(e,i.name);for(let o of w(r,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=fe(s[1]),l=Number(s[2]);if(a===null||S(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(l))continue;let d=y(r,o.name),c=E(d)??{id:S(a,".json")},m;try{m=B(d)}catch(b){if(b.code==="ENOENT")continue;throw b}t.push({requestId:c.id,ownerId:n,path:d,originalFile:a,claimedAtMs:m.mtimeMs,claimExpiresAtMs:l,byteLength:m.size,...c.operationKey?{operationKey:c.operationKey}:{},...c.clientId?{clientId:c.clientId}:{},...c.enqueuedAtMs===void 0?{}:{enqueuedAtMs:c.enqueuedAtMs},...c.deadlineAtMs===void 0?{}:{deadlineAtMs:c.deadlineAtMs},legacy:c.operationKey===void 0})}}return t.sort((i,n)=>i.claimedAtMs-n.claimedAtMs||i.path.localeCompare(n.path))}function E(e){try{let t=JSON.parse(F(e,"mailbox record"));return typeof t.id!="string"||!t.id?null:{id:t.id,...typeof t.operationKey=="string"?{operationKey:t.operationKey}:{},...typeof t.clientId=="string"?{clientId:t.clientId}:{},...typeof t.enqueuedAtMs=="number"?{enqueuedAtMs:t.enqueuedAtMs}:{},...typeof t.deadlineAtMs=="number"?{deadlineAtMs:t.deadlineAtMs}:{}}}catch{return null}}function ye(e,t,i,n,r){for(let o of A(e)){if(t<=0)break;let s;try{s=B(o)}catch(a){if(a.code==="ENOENT")continue;throw a}i(o,s.mtimeMs)>n||(g(o,{force:!0}),r(),t--)}return t}function A(e){return D(e)?w(e,{withFileTypes:!0}).filter(t=>t.isFile()).map(t=>y(e,t.name)).sort():[]}function be(e){try{return w(e).some(t=>t.endsWith(".json"))}catch{return!1}}function De(e){if(!D(e))return[];let t=[];for(let i of w(e,{withFileTypes:!0})){let n=y(e,i.name);i.isFile()?t.push(n):i.isDirectory()&&t.push(...De(n))}return t.sort()}function at(e){if(D(e))for(let t of w(e,{withFileTypes:!0})){if(!t.isDirectory())continue;let i=y(e,t.name);w(i).some(n=>n.endsWith(".claim"))||g(i,{recursive:!0,force:!0})}}function dt(e){try{return B(e).size}catch{return 0}}function O(e){return Buffer.from(e,"utf8").toString("base64url")}function fe(e){try{let t=Buffer.from(e,"base64url").toString("utf8");return O(t)===e?t:null}catch{return null}}function lt(e){return/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)?e:`invalid-${T("sha256").update(e).digest("hex")}`}export{ve as a,se as b,C as c,de as d,St as e,j as f,x as g,qt as h,k as i,Pt as j,xe as k,$t as l,Ct as m,Tt as n,Ge as o,_t as p,Jt as q,R as r};
|
|
8
|
-
//# sourceMappingURL=chunk-T3CZAZSI.js.map
|
package/dist/chunk-T6DWDI5E.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as R}from"./chunk-WDSFQDPN.js";import{p as h}from"./chunk-FI7VGOR4.js";import{a as g}from"./chunk-2USA3S3P.js";import{i as p}from"./chunk-2VAHDDLM.js";import{a as m}from"./chunk-YXPUP5G2.js";import{g as d}from"./chunk-BL6DCHQP.js";function D(t,r,n={}){let e=g(t,r);if(!e)return[];let l=!d(e.symbol)&&!t.isIgnored(e.relativePath)?[{relativePath:e.relativePath,line:e.startLine}]:[],c=h(t,e,{semantic:n.semantic,semanticEvidence:R}).map(s=>({relativePath:s.file,line:s.line})),o=b(t,e),f=new Set,a=[];for(let s of[...l,...c,...o]){let u=`${s.relativePath}:${s.line}`;f.has(u)||(f.add(u),a.push(s))}return a}function b(t,r){if(!r.relativePath.endsWith(".rb"))return[];let n=S(r.symbol);if(n.length===0)return[];let e=[];for(let i of m(t,{extensions:[".rb"],includeIgnored:!1})){let l=p(t,i);if(!l)continue;let c=l.split(`
|
|
2
|
-
`);for(let o=0;o<c.length;o++){let f=c[o]??"";n.some(a=>new RegExp(`@${a}\\b|\\b${a}:`).test(f))&&e.push({relativePath:i,line:o})}}return e}function S(t){let n=(t.split(":").pop()??t).replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[^A-Za-z0-9_]+/g,"_").toLowerCase().replace(/^_+|_+$/g,""),e=n.split("_").filter(Boolean),i=new Set;return n&&i.add(n),e.length>=1&&i.add(e[e.length-1]),e.length>=2&&i.add(e.slice(-2).join("_")),[...i]}export{D as a};
|
|
3
|
-
//# sourceMappingURL=chunk-T6DWDI5E.js.map
|
package/dist/chunk-T6HRIROJ.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as O}from"./chunk-CFE6PSG6.js";import{a as j,b,c as T}from"./chunk-GTZZVLKJ.js";import{e as $}from"./chunk-GG45PK4S.js";import{g as F,h as N}from"./chunk-OIOC5EHF.js";import{a as B}from"./chunk-VBV6ALJE.js";import{a as A}from"./chunk-BOJ5SVE2.js";import{b as v,c as R}from"./chunk-2BMSSRBH.js";import{a as _}from"./chunk-BGBBVSH4.js";import{b as D}from"./chunk-SKKXTABJ.js";import{C,d as I,e as S,f as y,m as E}from"./chunk-C7C6AKAT.js";import{b as W,q as P}from"./chunk-RBAD4GJ2.js";import{k}from"./chunk-ETC674NS.js";import{y as L}from"./chunk-KNLQGXVH.js";import{basename as m,extname as h}from"path";function De(n,t){let{scope:e,maxLoc:i=15,limit:r=30,scanLimit:a}=t??{},o=new R(n),s=re(o.fileDependencyGraph(e)),p=new Map,f=B({candidates:()=>U(n,o,e,i),orderCandidates:A,scanLimit:a,profile:{name:"wrapper-candidates"},prepare:c=>({callerFileMap:J(n,o,c,{semantic:t?.semantic!==!1}),reverseFanIn:s,receivers:p}),evaluate:(c,u)=>q(n,o,c,u),orderResults:(c,u)=>u.callerFanIn-c.callerFanIn||u.loc-c.loc,limit:r});return V(f,p)}function J(n,t,e,i){let r=j(n,t),a=b(r.forDefinitions(e,{semantic:!1,sourceFallback:!1})),o=[];i.semantic&&L("wrapper.semantic-candidates",()=>{o=e.filter(l=>M(n,t,l,a).length<=1)},()=>({symbols:e.length,semanticCandidates:o.length}));let s=o.length===0?new Map:b(r.forDefinitions(o,{semantic:!0,sourceFallback:!1})),p=s.size===0?a:v(a,s),f=new Map(e.map(l=>[l.symbolId,l])),c=new Map;for(let l of e){let d=M(n,t,l,p);if(d.length>1||(c.set(l.symbolId,l),d.length!==1))continue;let x=d[0],w=z(n,l.symbolId,x);if(!w)continue;let g=G(t,n,x,l.symbol,w);g?.isFunctionLike&&f.has(g.symbolId)&&c.set(g.symbolId,f.get(g.symbolId))}let u=[...c.values()];return u.length===0?p:v(p,b(r.forDefinitions(u,{semantic:!1,sourceFallback:!0})))}function q(n,t,e,i){let r=M(n,t,e,i.callerFileMap);if(r.length!==1)return null;let a=r[0],o=z(n,e.symbolId,a);if(!o)return null;let s=G(t,n,a,e.symbol,o);if(s&&E(s.symbol))return null;let{fanIn:p,source:f}=ee(i.callerFileMap,i.reverseFanIn,a,s);if(f==="function"?p<=3:p<=5)return null;let c=ie(n,e,a,s),u=Z(n,e);u==="helper"&&c.push("body computes or branches rather than forwarding one call");let l=u==="forwarding"?H(n,e):null;l&&i.receivers.set(e.symbol,l);let d=l&&K(n,e.relativePath,l)?l:null;return d&&c.push(`forwards through module-private state: ${d}`),{symbol:e.symbol,shortName:I(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:_(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?I(s.symbol):m(a),callerFanIn:p,actionTier:c.length>0?"signal":"direct",bodyShape:u,boundaryEvidence:c}}function H(n,t){let e=F(n,t);if(!e)return null;let i=W(N(e)).trim(),r=/^(?:return\s+)?(?:await\s+)?([A-Za-z_$][\w$]*)\s*[.(]/.exec(i)?.[1];return!r||r==="this"||r==="super"?null:r}function K(n,t,e){let i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`^(?:const|let|var)\\s+${i}\\b`);return k(n,t).some(a=>r.test(a))}var Q=3;function V(n,t){let e=new Map,i=r=>{let a=t.get(r.symbol);return a&&r.bodyShape==="forwarding"?`${r.file}\0${a}`:null};for(let r of n){let a=i(r);a&&e.set(a,(e.get(a)??0)+1)}return n.map(r=>{let a=i(r),o=a?e.get(a)??0:0;if(o<Q)return r;let s=t.get(r.symbol);return{...r,actionTier:"signal",boundaryEvidence:[...r.boundaryEvidence,`facade: ${o} sibling forwards from this file through ${s}`]}})}function Z(n,t){let e=F(n,t);return e&&$(e)?"forwarding":"helper"}function U(n,t,e,i){return t.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(r=>!P(n,r)).filter(r=>!X(r.leaf))}function X(n){return typeof n=="string"&&n.startsWith("<")&&n.endsWith(">")}function M(n,t,e,i){let r=m(e.relativePath,h(e.relativePath)),a=[...i.get(e.symbolId)??[]].filter(o=>o!==e.relativePath).filter(o=>m(o,h(o))!==r).filter(o=>{let s=t.fileKind(o);return s!=="barrel"&&s!=="entry"&&s!=="test"});return T(n,e,a).realConsumers}function z(n,t,e){return n.get(`SELECT c.start_line, c.end_line
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d ON c.document_id = d.id
|
|
5
|
-
WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
|
|
6
|
-
LIMIT 1`,t,e)}function G(n,t,e,i,r){let a=n.definitionsForFile(e);for(let o of Y(t,e,i,r.start_line,r.end_line)){let s=C(a,o);if(s?.isFunctionLike)return s}return C(a,ne(t,e,i,r.start_line,r.end_line))}function Y(n,t,e,i,r){let a=S(e);return a?(D(n,t).get(a)??[]).filter(o=>o>=i&&o<=r):[]}function ee(n,t,e,i){if(i?.isFunctionLike){let r=[...n.get(i.symbolId)??[]].filter(a=>a!==i.relativePath);if(r.length>0)return{fanIn:r.length,source:"function"}}return{fanIn:te(t,e),source:"file"}}function ne(n,t,e,i,r){let a=S(e);if(!a)return i;let o=D(n,t).get(a);if(!o||o.length===0)return i;for(let s of o)if(s>=i&&s<=r)return s;return i}function re(n){let t=new Map;for(let[e,i]of n){t.has(e)||t.set(e,t.get(e)??0);for(let r of i)t.set(r,(t.get(r)??0)+1)}return t}function te(n,t){let e=n.get(t)??0;if(e>0)return e;let i=m(t,h(t)),r=0;for(let[a,o]of n)a!==t&&m(a,h(a))===i&&o>r&&(r=o);return r}function ie(n,t,e,i){return O(n,t.relativePath,t.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:y(t.symbol),side:"self"},{label:"caller name",value:i?.symbol?y(i.symbol):m(e),side:"other"},{label:"wrapper path",value:t.relativePath,side:"self"},{label:"caller path",value:e,side:"other"}])}export{De as a,V as b};
|
|
7
|
-
//# sourceMappingURL=chunk-T6HRIROJ.js.map
|