scip-query 0.23.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +491 -2
- package/README.md +111 -122
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-PRVFAGTQ.js +2 -0
- package/dist/call-graph-DVPAQV2F.js +2 -0
- package/dist/call-graph-evidence-CUtj8V2I.d.ts +19 -0
- package/dist/chunk-2FSBGL5P.js +2 -0
- package/dist/chunk-2HLAFUCY.js +2 -0
- package/dist/chunk-2IWUT6CJ.js +3 -0
- package/dist/chunk-2KNN7GTQ.js +2 -0
- package/dist/chunk-2LHXRE2B.js +8 -0
- package/dist/{chunk-EG2CPZMJ.js → chunk-2YXE77TJ.js} +2 -2
- package/dist/chunk-36SGVCGX.js +2 -0
- package/dist/chunk-3ABBFPTP.js +2 -0
- package/dist/chunk-3IVFU4FD.js +3 -0
- package/dist/chunk-3JIQS44J.js +7 -0
- package/dist/chunk-3ZRB6DNK.js +7 -0
- package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
- package/dist/{chunk-6I6L7Z62.js → chunk-4BHGBMNO.js} +2 -2
- package/dist/chunk-4BP3UBDG.js +2 -0
- package/dist/chunk-4D6RO7G4.js +2 -0
- package/dist/chunk-4FEWQ6RH.js +2 -0
- package/dist/chunk-4IGEOBG7.js +2 -0
- package/dist/chunk-4QZXBUKC.js +2 -0
- package/dist/chunk-4WBDEVX2.js +4 -0
- package/dist/chunk-4WCUBZU3.js +8 -0
- package/dist/chunk-4WTUBQ36.js +40 -0
- package/dist/chunk-4XQ4O6IM.js +3 -0
- package/dist/chunk-55UQAMZO.js +4 -0
- package/dist/chunk-5D2LVK7O.js +125 -0
- package/dist/chunk-5IYJ56TT.js +2 -0
- package/dist/chunk-5PLMJC7Q.js +2 -0
- package/dist/chunk-5TNQJUR2.js +5 -0
- package/dist/chunk-62BDNPMI.js +2 -0
- package/dist/chunk-64DZ5TXR.js +7 -0
- package/dist/chunk-65245JCM.js +2 -0
- package/dist/chunk-6FFVZZL4.js +2 -0
- package/dist/chunk-6KO5JHAR.js +2 -0
- package/dist/chunk-6LRXOOSX.js +2 -0
- package/dist/chunk-6LSEIIF7.js +2 -0
- package/dist/chunk-6YMNWD3H.js +6 -0
- package/dist/chunk-72AD6ZRR.js +5 -0
- package/dist/chunk-73AAKPUC.js +4 -0
- package/dist/chunk-76CZ77DF.js +2 -0
- package/dist/chunk-7VPEEAAG.js +2 -0
- package/dist/chunk-7WTPQ4NX.js +14 -0
- package/dist/chunk-7Y5T6XDP.js +2 -0
- package/dist/chunk-A2IIGFMJ.js +5 -0
- package/dist/chunk-AB5KCTEV.js +2 -0
- package/dist/chunk-AC566WBP.js +6 -0
- package/dist/chunk-AGWFSTXC.js +3 -0
- package/dist/chunk-AOSIYPTA.js +2 -0
- package/dist/chunk-AUVEWPIF.js +2 -0
- package/dist/chunk-B56T42J3.js +25 -0
- package/dist/chunk-BIQEF5NE.js +2 -0
- package/dist/chunk-BL6XJKTA.js +3 -0
- package/dist/chunk-BMKOQJRI.js +2 -0
- package/dist/chunk-BOZ4EXBB.js +3 -0
- package/dist/chunk-BUTWYEPH.js +2 -0
- package/dist/chunk-BZB4QPIP.js +2 -0
- package/dist/{chunk-ILTDAWEF.js → chunk-CE357GEE.js} +4 -4
- package/dist/chunk-CFN45HFP.js +2 -0
- package/dist/chunk-CFYMZFXT.js +368 -0
- package/dist/chunk-CN5EH7O3.js +2 -0
- package/dist/chunk-D254DNNQ.js +4 -0
- package/dist/chunk-D3FDISIC.js +2 -0
- package/dist/chunk-D3NX5XIE.js +3 -0
- package/dist/chunk-DA7RPPDF.js +3 -0
- package/dist/chunk-DDMC3FON.js +3 -0
- package/dist/chunk-DIO3FUSG.js +2 -0
- package/dist/chunk-DJ2NNSUK.js +3 -0
- package/dist/chunk-DKYQIM3C.js +18 -0
- package/dist/{chunk-JTQVMR42.js → chunk-DOOEL2IV.js} +2 -2
- package/dist/chunk-DVFP6PZI.js +2 -0
- package/dist/chunk-E3FDPXZK.js +2 -0
- package/dist/chunk-E7YNJLCB.js +2 -0
- package/dist/chunk-EFGW5JPH.js +2 -0
- package/dist/chunk-EJVTR244.js +13 -0
- package/dist/chunk-EOV7RTRZ.js +2 -0
- package/dist/chunk-ETOIKRHO.js +2 -0
- package/dist/chunk-EYK3ZAO2.js +3 -0
- package/dist/chunk-F2V2LPET.js +52 -0
- package/dist/chunk-F4LUHJTF.js +2 -0
- package/dist/chunk-F4PUT6IT.js +2 -0
- package/dist/chunk-F56GCXXS.js +5 -0
- package/dist/chunk-FC2EVQRM.js +2 -0
- package/dist/chunk-FL7NBMHP.js +3 -0
- package/dist/chunk-FMRN2TRL.js +3 -0
- package/dist/chunk-FVULPZDF.js +20 -0
- package/dist/chunk-GCKCF5FL.js +43 -0
- package/dist/chunk-GH2PYF46.js +2 -0
- package/dist/chunk-GHJAGXIP.js +2 -0
- package/dist/{chunk-WIWY3CRX.js → chunk-GMVSHUKZ.js} +2 -2
- package/dist/chunk-GS6KDO4R.js +2 -0
- package/dist/chunk-GUUBXNN7.js +2 -0
- package/dist/chunk-GVWX5T43.js +80 -0
- package/dist/chunk-GZKFETP5.js +2 -0
- package/dist/chunk-H4EQHO6J.js +9 -0
- package/dist/chunk-H73WY2RM.js +2 -0
- package/dist/chunk-H75GSPRV.js +60 -0
- package/dist/chunk-HDR3AHSV.js +61 -0
- package/dist/chunk-HQBSL74Y.js +2 -0
- package/dist/chunk-HRRFKWPZ.js +2 -0
- package/dist/chunk-HXENDJC6.js +2 -0
- package/dist/chunk-IIBAZNSW.js +21 -0
- package/dist/chunk-INLMWEUU.js +12 -0
- package/dist/chunk-IWQPAF4F.js +2 -0
- package/dist/chunk-IZJ6YUKP.js +35 -0
- package/dist/chunk-J2TMAIN5.js +60 -0
- package/dist/chunk-J5FJMODQ.js +142 -0
- package/dist/chunk-J7HZPIO3.js +2 -0
- package/dist/chunk-JEVRKFRL.js +2 -0
- package/dist/chunk-JFXSGAEB.js +30 -0
- package/dist/chunk-JVRTHGFS.js +3 -0
- package/dist/chunk-JYWEX7RR.js +360 -0
- package/dist/chunk-K3YL22N6.js +2 -0
- package/dist/chunk-K4CN7GXK.js +12 -0
- package/dist/chunk-K5TBVXU4.js +30 -0
- package/dist/chunk-KDDIE2DP.js +9 -0
- package/dist/chunk-KHWRRPV4.js +2 -0
- package/dist/chunk-KI6NBKDY.js +14 -0
- package/dist/chunk-KU3QRSTH.js +2 -0
- package/dist/chunk-KZBJWZJB.js +2 -0
- package/dist/chunk-L7GFM3NP.js +3 -0
- package/dist/chunk-LMO6PK3V.js +35 -0
- package/dist/chunk-LN4YXJJU.js +2 -0
- package/dist/chunk-LOVIZBJ4.js +43 -0
- package/dist/chunk-LPCRK4A2.js +11 -0
- package/dist/chunk-MMHZKBFA.js +2 -0
- package/dist/{chunk-M2O5NY6W.js → chunk-MOQQBQRD.js} +2 -2
- package/dist/chunk-N2WN6I3L.js +2 -0
- package/dist/chunk-N3ORQT7L.js +2 -0
- package/dist/chunk-NAZ3RAIW.js +2 -0
- package/dist/chunk-NDUNO5JQ.js +2 -0
- package/dist/chunk-NEIWRNAZ.js +4 -0
- package/dist/chunk-NJJMVD65.js +2 -0
- package/dist/chunk-NLOQOBXI.js +20 -0
- package/dist/chunk-NOLZOVCU.js +2 -0
- package/dist/chunk-NOWINRRN.js +2 -0
- package/dist/chunk-NZAXKGRL.js +16 -0
- package/dist/chunk-O2C4UILI.js +2 -0
- package/dist/chunk-O3RHA6ZT.js +3 -0
- package/dist/chunk-O4UZSPPI.js +3 -0
- package/dist/chunk-OGFV2BUX.js +2 -0
- package/dist/chunk-OZCJXZK6.js +499 -0
- package/dist/chunk-P6ODM7BY.js +2 -0
- package/dist/{chunk-XBGWL66K.js → chunk-PAVGPRHJ.js} +2 -2
- package/dist/chunk-PH52RA7D.js +2 -0
- package/dist/chunk-PKN354TH.js +3 -0
- package/dist/chunk-PWOASWEG.js +11 -0
- package/dist/chunk-QIWXRW72.js +2 -0
- package/dist/chunk-QJRMOK5N.js +2 -0
- package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
- package/dist/chunk-QXEUDXBT.js +3 -0
- package/dist/chunk-QYUVVBMR.js +6 -0
- package/dist/chunk-QZ7KQZRN.js +2 -0
- package/dist/chunk-R6LQBUDH.js +2 -0
- package/dist/chunk-RBS42E55.js +20 -0
- package/dist/chunk-RSJKPCFX.js +26 -0
- package/dist/chunk-S6CZA3MV.js +2 -0
- package/dist/chunk-STMVAHJP.js +2 -0
- package/dist/chunk-SYVPTTVW.js +2 -0
- package/dist/chunk-T3I6NHBH.js +2 -0
- package/dist/chunk-T6DK3ZP7.js +2 -0
- package/dist/chunk-TKD34PHN.js +4 -0
- package/dist/chunk-TNNQFH7W.js +2 -0
- package/dist/chunk-TNV7SSUF.js +2 -0
- package/dist/chunk-TO7ZR3EH.js +8 -0
- package/dist/chunk-TOU3CHK4.js +2 -0
- package/dist/chunk-TRBI4UKT.js +2 -0
- package/dist/chunk-TZCVNCAN.js +4 -0
- package/dist/chunk-U4LZA5LL.js +3 -0
- package/dist/chunk-U5RIG3JP.js +3 -0
- package/dist/chunk-UP5KXN2I.js +2 -0
- package/dist/chunk-UQFR3NDH.js +5 -0
- package/dist/chunk-UXYXF7GV.js +2 -0
- package/dist/chunk-VB3GOKOS.js +2 -0
- package/dist/chunk-VF5JZICY.js +2 -0
- package/dist/chunk-VTY3VK6E.js +2 -0
- package/dist/chunk-VX2O4RIS.js +2 -0
- package/dist/chunk-WKPV2TDZ.js +2 -0
- package/dist/chunk-WOFQ5DTB.js +2 -0
- package/dist/chunk-WS4C6TCK.js +2 -0
- package/dist/chunk-WXU3DGPU.js +2 -0
- package/dist/chunk-X6RMKHJQ.js +81 -0
- package/dist/{chunk-4ILJCCXV.js → chunk-XHMN6ZX7.js} +2 -2
- package/dist/chunk-XHTVFLWW.js +2 -0
- package/dist/chunk-XKIDJCIK.js +2 -0
- package/dist/chunk-XTYTYZPT.js +2 -0
- package/dist/chunk-Y2JHHTTA.js +2 -0
- package/dist/chunk-YGVRMGYN.js +4 -0
- package/dist/chunk-YNQCGEQE.js +2 -0
- package/dist/chunk-YOQVEXVE.js +14 -0
- package/dist/chunk-YRT2WLYY.js +2 -0
- package/dist/chunk-YTAP5Y2G.js +2 -0
- package/dist/chunk-YTYWI7VB.js +2 -0
- package/dist/chunk-YULZRALL.js +2 -0
- package/dist/chunk-Z33WQG4Q.js +2 -0
- package/dist/chunk-ZGTYGDMF.js +16 -0
- package/dist/chunk-ZHMRSZFD.js +43 -0
- package/dist/chunk-ZHSP366W.js +10 -0
- package/dist/chunk-ZIBYCYKK.js +7 -0
- package/dist/{chunk-GAS2LJMP.js → chunk-ZLADLUE6.js} +3 -3
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-HYO3NP5Q.js → chunk-ZR4HBC2H.js} +2 -2
- package/dist/cli-main.js +6 -6
- package/dist/cli.js +1 -1
- package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
- package/dist/code-IL5WH3NZ.js +2 -0
- package/dist/code-result-json-ANTBEDFP.js +4 -0
- package/dist/command-descriptors-HEEMDHTU.js +222 -0
- package/dist/deps-EOWFC6FD.js +2 -0
- package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
- package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
- package/dist/files-K4AI3JUM.js +2 -0
- package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
- package/dist/{health-CPp2Jf1Z.d.ts → health-BtfmNrfa.d.ts} +58 -74
- package/dist/hierarchy-6W5NDIFI.js +2 -0
- package/dist/imports-WH365QY4.js +2 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/members-K3PHMF5S.js +2 -0
- package/dist/methods-E7KVMBX4.js +2 -0
- package/dist/output-continuation-command-BJSY67SN.js +3 -0
- package/dist/output-pagination-UZJ5ACIX.js +24 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-EP24WT4X.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +15 -4
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +3 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -0
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +3 -3
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +20 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity.d.ts +6 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +1 -7
- package/dist/queries/context.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dead.d.ts +2 -0
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/dependence-slice.d.ts +46 -22
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +1 -7
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +29 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -4
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +121 -61
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -0
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +17 -65
- package/dist/queries/index.js +1 -1
- package/dist/queries/locality-candidates.d.ts +4 -4
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -6
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +9 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +19 -3
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +22 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +17 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +4 -14
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +4 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/review.d.ts +188 -0
- package/dist/queries/review.js +2 -0
- package/dist/queries/similar-files.d.ts +7 -10
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +19 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice-cohesion.d.ts +205 -0
- package/dist/queries/slice-cohesion.js +2 -0
- package/dist/queries/source-inspection.d.ts +6 -202
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -3
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stats.d.ts +1 -0
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +4 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -7
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +3 -15
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +4 -4
- package/dist/refs-CCBJG7WK.js +2 -0
- package/dist/refs-pagination-DRNLVU4S.js +2 -0
- package/dist/reindex-worker.js +79 -29
- package/dist/reindex.js +45 -45
- package/dist/repository-cache-worker.js +2 -0
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +3 -4
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/service-queries-2WAJI7R6.js +6 -0
- package/dist/source-inspection-91U9zdO3.d.ts +341 -0
- package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
- package/dist/stats-G7DIV6VU.js +2 -0
- package/dist/surface-IO55UALI.js +2 -0
- package/dist/system-ZBMSHJXU.js +2 -0
- package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
- package/dist/typescript-indexer.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +3 -3
- package/docs/AGENT_GUIDE.md +19 -128
- package/docs/CLI_JSON_OUTPUT.md +21 -17
- package/docs/COMMAND_REFERENCE.md +34 -49
- package/docs/CURRENT_COMMANDS.md +123 -0
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
- package/docs/DETECTOR_GUIDE.md +55 -12
- package/docs/PRODUCT_VISION.md +135 -0
- package/docs/PROPERTY_TESTING.md +73 -0
- package/docs/REVIEW.md +76 -0
- package/docs/SKILLS.md +51 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
- package/docs/accuracy-audit-checklist.md +70 -13
- package/docs/analyzer-inventory.md +2 -2
- package/docs/locality-analyzer-design.md +9 -9
- package/package.json +18 -80
- package/scripts/evidence-product-contract.mjs +7 -3
- package/scripts/record-review-coverage.mjs +118 -0
- package/scripts/scip-windows-provenance.mjs +29 -19
- package/skills/scip-architecture-review/SKILL.md +57 -0
- package/skills/scip-architecture-review/agents/openai.yaml +4 -0
- package/skills/scip-architecture-review/references/design-checks.md +17 -0
- package/skills/scip-explore/SKILL.md +15 -59
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/external-evidence.md +2 -2
- package/skills/scip-explore/references/information-model.md +26 -29
- package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
- package/skills/scip-integrity-audit/SKILL.md +53 -181
- package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
- package/skills/scip-plan/SKILL.md +39 -65
- package/skills/scip-plan/agents/openai.yaml +2 -2
- package/skills/scip-query/SKILL.md +28 -81
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-query/references/command-guide.md +169 -0
- package/skills/scip-setup/SKILL.md +4 -2
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/by-kind-XI2CSWEY.js +0 -2
- package/dist/call-graph-UONR6JR5.js +0 -2
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2E7CX53V.js +0 -2
- package/dist/chunk-2GRUZAQF.js +0 -43
- package/dist/chunk-2LDBDR6J.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2R3V3PSD.js +0 -4
- package/dist/chunk-2WC2OEDO.js +0 -4
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D3QG236.js +0 -2
- package/dist/chunk-3FHOF22C.js +0 -21
- package/dist/chunk-3JKSW6LJ.js +0 -2
- package/dist/chunk-3L2ZBPEX.js +0 -133
- package/dist/chunk-3PJABJSU.js +0 -2
- package/dist/chunk-3SVF22I5.js +0 -2
- package/dist/chunk-3WR4E3A3.js +0 -3
- package/dist/chunk-4FTZ4P5G.js +0 -2
- package/dist/chunk-4UX2F3JX.js +0 -2
- package/dist/chunk-4WNW27SX.js +0 -2
- package/dist/chunk-5ENOG4VP.js +0 -61
- package/dist/chunk-64BFSI5I.js +0 -2
- package/dist/chunk-66DVSJQG.js +0 -455
- package/dist/chunk-6HFCYNYE.js +0 -9
- package/dist/chunk-6PQNKL3G.js +0 -3
- package/dist/chunk-6V5CNXL6.js +0 -2
- package/dist/chunk-6VVV4WRR.js +0 -4
- package/dist/chunk-7BWFZPPZ.js +0 -2
- package/dist/chunk-7CYG22FH.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7IWV2EG3.js +0 -3
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-AFHTBORT.js +0 -2
- package/dist/chunk-AVRYW5OZ.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B5D7QPBE.js +0 -4
- package/dist/chunk-BBCIS4DX.js +0 -16
- package/dist/chunk-BDUVI7TO.js +0 -3
- package/dist/chunk-BE7ZZTMC.js +0 -2
- package/dist/chunk-BHVUJOCQ.js +0 -3
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BQGB4HBD.js +0 -2
- package/dist/chunk-BRV7PIFF.js +0 -2
- package/dist/chunk-CEEZJXEF.js +0 -2
- package/dist/chunk-CIYLO6SI.js +0 -7
- package/dist/chunk-CJZXN4NU.js +0 -2
- package/dist/chunk-CNO7TOKL.js +0 -2
- package/dist/chunk-COF23M5F.js +0 -2
- package/dist/chunk-CWFP7GM5.js +0 -2
- package/dist/chunk-D2DHWI3D.js +0 -2
- package/dist/chunk-D4N5SQ2M.js +0 -4
- package/dist/chunk-DBRSYFXR.js +0 -2
- package/dist/chunk-DHUIOLDT.js +0 -2
- package/dist/chunk-DIRJWYBM.js +0 -6
- package/dist/chunk-DIUFNHRJ.js +0 -35
- package/dist/chunk-DRENNWRG.js +0 -2
- package/dist/chunk-DTZCKZEU.js +0 -4
- package/dist/chunk-DULC3QFP.js +0 -5
- package/dist/chunk-DYGHBZ2N.js +0 -16
- package/dist/chunk-E5R6AQ73.js +0 -40
- package/dist/chunk-E73UNJTF.js +0 -38
- package/dist/chunk-EKV5HX33.js +0 -2
- package/dist/chunk-EQHFIL6T.js +0 -3
- package/dist/chunk-ESIQ66Z7.js +0 -2
- package/dist/chunk-EVFUMY4R.js +0 -3
- package/dist/chunk-F7DY272B.js +0 -2
- package/dist/chunk-FBN2FGXG.js +0 -2
- package/dist/chunk-FDLOBR6P.js +0 -4
- package/dist/chunk-FESCRNVV.js +0 -5
- package/dist/chunk-FFRKR4EQ.js +0 -2
- package/dist/chunk-FGA2U4OR.js +0 -8
- package/dist/chunk-FIQRSHVM.js +0 -2
- package/dist/chunk-FPYLNQPT.js +0 -2
- package/dist/chunk-FRUSVINH.js +0 -2
- package/dist/chunk-GSP44ENC.js +0 -2
- package/dist/chunk-GUFSG5TX.js +0 -2
- package/dist/chunk-GYIZ4NXB.js +0 -2
- package/dist/chunk-GZIUDL6G.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HCXEQRFF.js +0 -18
- package/dist/chunk-HEHOQQKH.js +0 -2
- package/dist/chunk-HKGFPJ4T.js +0 -4
- package/dist/chunk-HLZTEXRA.js +0 -2
- package/dist/chunk-HOENASQM.js +0 -3
- package/dist/chunk-HVF5VBG6.js +0 -2
- package/dist/chunk-I55I7XXP.js +0 -2
- package/dist/chunk-IDFEUFKS.js +0 -2
- package/dist/chunk-IHGQTTVW.js +0 -2
- package/dist/chunk-IICPE7B2.js +0 -20
- package/dist/chunk-IL676XCC.js +0 -18
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-IZDPJ2QI.js +0 -2
- package/dist/chunk-J66VOFW6.js +0 -5
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JGKUET5J.js +0 -3
- package/dist/chunk-JS4PGXMV.js +0 -3
- package/dist/chunk-JWTGMPIT.js +0 -80
- package/dist/chunk-JYR66JN5.js +0 -5
- package/dist/chunk-KFOYCQAJ.js +0 -9
- package/dist/chunk-KLFEXGQA.js +0 -2
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KYSDI3GE.js +0 -5
- package/dist/chunk-L6PJPETJ.js +0 -29
- package/dist/chunk-LDVT66YM.js +0 -2
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-LMZ5PRUV.js +0 -2
- package/dist/chunk-LQRQN2XA.js +0 -2
- package/dist/chunk-LXABEJX3.js +0 -2
- package/dist/chunk-MNV5FSBW.js +0 -3
- package/dist/chunk-MPQ4OTBM.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV3CDXPI.js +0 -38
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N2ZSIIGR.js +0 -117
- package/dist/chunk-N5B2NILC.js +0 -5
- package/dist/chunk-NJITK2GP.js +0 -2
- package/dist/chunk-NOGJXYFO.js +0 -2
- package/dist/chunk-NOYBFVJA.js +0 -554
- package/dist/chunk-NWQXSFFU.js +0 -3
- package/dist/chunk-ODDUPDP7.js +0 -13
- package/dist/chunk-OLIWTZI3.js +0 -3
- package/dist/chunk-OLNV6I6U.js +0 -2
- package/dist/chunk-OR2E3AGZ.js +0 -2
- package/dist/chunk-OSR2GEHQ.js +0 -2
- package/dist/chunk-OSSESPDX.js +0 -3
- package/dist/chunk-OWOOWNJ5.js +0 -7
- package/dist/chunk-P42EIXTA.js +0 -2
- package/dist/chunk-PJFGPYTU.js +0 -2
- package/dist/chunk-PP7KNN7L.js +0 -2
- package/dist/chunk-PU7T5QYQ.js +0 -2
- package/dist/chunk-PWWAJSKV.js +0 -74
- package/dist/chunk-PZL5T7SU.js +0 -73
- package/dist/chunk-QBE3YX64.js +0 -23
- package/dist/chunk-QGVTFRY2.js +0 -7
- package/dist/chunk-QOJONDS7.js +0 -2
- package/dist/chunk-QU5XRYB5.js +0 -4
- package/dist/chunk-QUU5OBVK.js +0 -11
- package/dist/chunk-RBLQNW26.js +0 -20
- package/dist/chunk-RTQ7NEKG.js +0 -81
- package/dist/chunk-SQXRS7BG.js +0 -4
- package/dist/chunk-SSK6LDPC.js +0 -2
- package/dist/chunk-SZHGTCPP.js +0 -7
- package/dist/chunk-T4N4P2K5.js +0 -16
- package/dist/chunk-TA3QKLLU.js +0 -2
- package/dist/chunk-TEBQMNVI.js +0 -43
- package/dist/chunk-TPFHAQ2G.js +0 -2
- package/dist/chunk-TQPCBMWT.js +0 -5
- package/dist/chunk-TQZV7KV4.js +0 -2
- package/dist/chunk-TRNAEQ6P.js +0 -3
- package/dist/chunk-TY7CRN3Z.js +0 -2
- package/dist/chunk-UHFYCMZO.js +0 -35
- package/dist/chunk-UICY4GTQ.js +0 -7
- package/dist/chunk-UVGEWT4Y.js +0 -26
- package/dist/chunk-UXW33INU.js +0 -29
- package/dist/chunk-VMPRET3I.js +0 -5
- package/dist/chunk-VNLGKHS6.js +0 -6
- package/dist/chunk-VQILFTEH.js +0 -2
- package/dist/chunk-VUPHCS7Y.js +0 -57
- package/dist/chunk-VVZSBTSU.js +0 -23
- package/dist/chunk-VZRNID6A.js +0 -2
- package/dist/chunk-W5OXRYGE.js +0 -7
- package/dist/chunk-W6STWDQI.js +0 -57
- package/dist/chunk-W7CXK74K.js +0 -2
- package/dist/chunk-WB3WYIRE.js +0 -4
- package/dist/chunk-WDNVY4E7.js +0 -20
- package/dist/chunk-WK46TNUM.js +0 -3
- package/dist/chunk-WNTFFKAX.js +0 -12
- package/dist/chunk-WOIKCX6A.js +0 -2
- package/dist/chunk-WUN6KBHV.js +0 -2
- package/dist/chunk-WYCTJDVR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XDQMU3BT.js +0 -2
- package/dist/chunk-XFA4SSO3.js +0 -3
- package/dist/chunk-XGZEP6GR.js +0 -8
- package/dist/chunk-XPDPNWTQ.js +0 -368
- package/dist/chunk-XRYABF57.js +0 -8
- package/dist/chunk-YBGKCQIS.js +0 -2
- package/dist/chunk-YEN6CYC7.js +0 -16
- package/dist/chunk-YF5IB2LF.js +0 -2
- package/dist/chunk-YI2AWIHC.js +0 -3
- package/dist/chunk-YPWBKGFU.js +0 -2
- package/dist/chunk-YPWHBBIS.js +0 -2
- package/dist/chunk-YSH6U3L4.js +0 -3
- package/dist/chunk-YU5DZUZI.js +0 -10
- package/dist/chunk-YWO5DDRC.js +0 -16
- package/dist/chunk-Z4CDXYNQ.js +0 -2
- package/dist/chunk-ZF5KHH7C.js +0 -2
- package/dist/chunk-ZOHS7AQV.js +0 -21
- package/dist/chunk-ZTI4SBFV.js +0 -3
- package/dist/code-MI6F2TTU.js +0 -2
- package/dist/code-result-json-FXALY4HE.js +0 -2
- package/dist/command-descriptors-P34VABY5.js +0 -343
- package/dist/dataflow-4KEMJPC6.js +0 -2
- package/dist/dependence-slice-R7FPWD5M.js +0 -2
- package/dist/deps-7EMQUYUT.js +0 -2
- package/dist/direct-navigation-6YO234F2.js +0 -3
- package/dist/entry-map-KOOLR26E.js +0 -2
- package/dist/files-OPIPJIGZ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-QPD2CAER.js +0 -2
- package/dist/imports-M6HUXRXC.js +0 -2
- package/dist/members-I5MEFOCT.js +0 -2
- package/dist/methods-5JYGGHXA.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-UPQAAKBP.js +0 -3
- package/dist/output-pagination-3OFL2MJV.js +0 -19
- package/dist/project-reindex-UKKQ5PLS.js +0 -3
- package/dist/queries/anchors.d.ts +0 -123
- package/dist/queries/anchors.js +0 -2
- package/dist/queries/complexity-hotspots.d.ts +0 -40
- package/dist/queries/complexity-hotspots.js +0 -2
- package/dist/queries/convergence.d.ts +0 -33
- package/dist/queries/convergence.js +0 -2
- package/dist/queries/dataflow.d.ts +0 -77
- package/dist/queries/dataflow.js +0 -2
- package/dist/queries/deep-chains.d.ts +0 -5
- package/dist/queries/deep-chains.js +0 -2
- package/dist/queries/extract-candidates.d.ts +0 -52
- package/dist/queries/extract-candidates.js +0 -2
- package/dist/queries/isolated.d.ts +0 -24
- package/dist/queries/isolated.js +0 -2
- package/dist/queries/plan-context.d.ts +0 -33
- package/dist/queries/plan-context.js +0 -2
- package/dist/queries/reference-neighborhood.d.ts +0 -4
- package/dist/queries/reference-neighborhood.js +0 -2
- package/dist/queries/reference-reachability.d.ts +0 -48
- package/dist/queries/reference-reachability.js +0 -2
- package/dist/queries/self-audit.d.ts +0 -63
- package/dist/queries/self-audit.js +0 -2
- package/dist/queries/similar-chains.d.ts +0 -48
- package/dist/queries/similar-chains.js +0 -2
- package/dist/queries/slice.d.ts +0 -4
- package/dist/queries/slice.js +0 -2
- package/dist/queries/stale-abstractions.d.ts +0 -72
- package/dist/queries/stale-abstractions.js +0 -2
- package/dist/queries/system-map.d.ts +0 -449
- package/dist/queries/system-map.js +0 -2
- package/dist/queries/trace.js +0 -2
- package/dist/queries/twin-ab.d.ts +0 -66
- package/dist/queries/twin-ab.js +0 -2
- package/dist/queries/value-flow.d.ts +0 -43
- package/dist/queries/value-flow.js +0 -2
- package/dist/queries/wrapper-candidates.d.ts +0 -34
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-PSU4JZZW.js +0 -2
- package/dist/refs-pagination-JG6CJMRC.js +0 -2
- package/dist/slice-HYRATV64.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-VTGDYWF5.js +0 -2
- package/dist/symbol-resolution-WD5EU5JE.js +0 -2
- package/dist/system-LRQNFOR2.js +0 -2
- package/dist/trace-F4B6OLL4.js +0 -2
- package/dist/value-flow-VRPZY72V.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
package/dist/chunk-PP7KNN7L.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as x}from"./chunk-4UX2F3JX.js";import{f,g as p}from"./chunk-JGKUET5J.js";import{a as L}from"./chunk-CNO7TOKL.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{c as v}from"./chunk-CJZXN4NU.js";import{a as E}from"./chunk-BGBBVSH4.js";import{a as C}from"./chunk-W7CXK74K.js";import{a as y}from"./chunk-E73UNJTF.js";import{b}from"./chunk-OSSESPDX.js";import{d as m,t as g}from"./chunk-N2ZSIIGR.js";import{c as u,n as h}from"./chunk-ODDUPDP7.js";var A=/^(?:validate|verify|check|assert)(?:[A-Z].*)?$/,N=/^(?:is|has)(?:[A-Z].*)?$/,k=/[{,]\s*(?:ok|success|valid|isValid)\s*:\s*false\b/,d=/\breturn\b/g,I=/\bfunction\b|=>|\)\s*(?::\s*[^{;=]+)?\s*\{/,_=/\.(?:addIssue|push)\s*\(/;function M(e,t={}){let{scope:n,limit:i=30,scanLimit:l}=t,a=new v(e),r=D(a.productionCallableDefinitions({scope:n,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),s=[];for(let o of r){let c=P(e,o);c&&s.push({symbol:o.symbol,shortName:m(o.symbol),file:o.relativePath,startLine:o.startLine,endLine:o.endLine,loc:E(o),...c})}return s.sort((o,c)=>o.file.localeCompare(c.file)||o.startLine-c.startLine||o.loc-c.loc),i?s.slice(0,i):s}function w(e){return A.test(e)?"imperative":N.test(e)?"predicate":null}function P(e,t){let n=w(t.leaf);if(!n||L(e,t))return null;let i=f(e,t);if(!i||!I.test(i))return null;let l=h(e,t.relativePath)?.callables.find(r=>r.startLine===t.startLine&&r.endLine===t.endLine);if(n==="predicate"&&l?.paramCount===0)return null;if(x(i)){let r=O(e,t);return!r||S(r.body,T(r.snippet))||R(r.body)?null:{nameKind:n,resolvedVia:"one-hop-delegate",delegateTarget:r.shortName}}let a=p(i);return S(a,T(i))||R(a)?null:{nameKind:n,resolvedVia:"direct"}}var F=new Set(["if","for","while","switch","catch","function"]);function R(e){let t=u(e);for(let n of t.matchAll(/\b([A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*)\s*\(/g))if(!F.has(n[1]))return!0;return!1}function T(e){let t=e.indexOf("=>");return t===-1?!1:!/^\s*\{/.test(e.slice(t+2))}function S(e,t){let n=u(e);if(/\bthrow\b/.test(n)||/\.reject\s*\(/.test(n)||k.test(n)||_.test(n))return!0;let i=K(n);if(t&&i.length===0){let l=n.trim();return l!==""&&l!=="true"}for(let l of i)if(l!==""&&l!=="true")return!0;return!1}function K(e){let t=[];d.lastIndex=0;let n;for(;n=d.exec(e);){let i=n.index+n[0].length,l=0,a=e.length;for(let r=i;r<e.length;r+=1){let s=e[r];if(s==="("||s==="["||s==="{")l+=1;else if(s===")"||s==="]"||s==="}"){if(l===0){a=r;break}l-=1}else if(s===";"&&l===0){a=r;break}}t.push(e.slice(i,a).trim()),d.lastIndex=a}return t}function O(e,t){let n=y(e,t,{callableOnly:!0,limit:3,semanticEvidence:C}),i=[...new Set(n.map(o=>o.symbol))].filter(o=>o!==t.symbol);if(i.length!==1)return null;let a=b(e,i[0]).match;if(!a)return null;let r=g(e,a.relativePath).find(o=>o.symbolId===a.symbolId);if(!r)return null;let s=f(e,r);return s?{body:p(s),snippet:s,shortName:m(r.symbol)}:null}export{M as a};
|
|
2
|
-
//# sourceMappingURL=chunk-PP7KNN7L.js.map
|
package/dist/chunk-PU7T5QYQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-QOJONDS7.js";import{a as d}from"./chunk-WIWY3CRX.js";import{a as P}from"./chunk-WUN6KBHV.js";import{a as v}from"./chunk-BOJ5SVE2.js";import{c as b}from"./chunk-CJZXN4NU.js";import{a as p}from"./chunk-BGBBVSH4.js";import{a as g,h}from"./chunk-XRYABF57.js";import{d as l,h as u}from"./chunk-N2ZSIIGR.js";import{p as f,q as m}from"./chunk-ODDUPDP7.js";import{basename as x,extname as L}from"path";function z(i,e){let{scope:r,maxLoc:n=15,limit:o=30,scanLimit:s}=e??{},a=new b(i);return P({candidates:()=>E(i,a,r,n),orderCandidates:v,scanLimit:s,profile:{name:"passthrough-candidates"},prepare:t=>a.calleeMap(t,{semantic:e?.semantic!==!1}),evaluate:(t,c)=>S(i,t,c.get(t.symbolId)??[]),orderResults:(t,c)=>t.loc-c.loc||t.file.localeCompare(c.file),limit:o})}function S(i,e,r){let n=w(r);if(n.size!==1||!f(i,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...n.entries()][0],s=D(i,e,o),a=T(i,e),t=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:t,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:I(t,s,a)}}function D(i,e,r){return y(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(r.symbol)},{label:"passthrough module",value:x(e.relativePath,L(e.relativePath))},{label:"callee module",value:x(r.file,L(r.file))}])}function I(i,e,r){if(i==="signal"){if(r.length>0)return`Review the public API before inlining; public-facade evidence: ${r.slice(0,2).join("; ")}.`;let n=e.filter(C);return n.length>0?`Review the public API before inlining; public-surface evidence: ${n.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(i,e){return d(i,e)?g(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:h(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(i){return i.includes("public surface")}function w(i){let e=i.some(n=>u(n.symbol))?i.filter(n=>u(n.symbol)):i,r=new Map;for(let n of e)r.has(n.symbol)||r.set(n.symbol,n);return r}function E(i,e,r,n){return e.productionCallableDefinitions({scope:r,minLoc:3,maxLoc:n,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(o=>!m(i,o))}export{z as a};
|
|
2
|
-
//# sourceMappingURL=chunk-PU7T5QYQ.js.map
|
package/dist/chunk-PWWAJSKV.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import{c as f}from"./chunk-CJZXN4NU.js";import{a as b,d as g}from"./chunk-XRYABF57.js";import{d as m}from"./chunk-N2ZSIIGR.js";import{B as a,x as u,y as _}from"./chunk-ODDUPDP7.js";import{a as l}from"./chunk-ZOHS7AQV.js";import{h as p}from"./chunk-FESCRNVV.js";function B(e,t={}){let{scope:o,limit:r}=t,i=new f(e),s=T([...x(e,o),...y(e,i,o)]);return F(s),r?s.slice(0,r):s}function x(e,t){let o=[];for(let r of N(e,t)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||g(e,r.barrel_path)||p(e,r.barrel_path)&&a(e,r.barrel_path).length===0)continue;let i=I(e,r),s=i?.barrel_consumers??0,n=i?.direct_consumers??0;s!==0||n!==0||o.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:m(r.symbol),originalFile:r.original_path,barrelConsumers:s,directConsumers:n,...h(e,r.barrel_path)})}return o}function N(e,t){let o=t?"AND barrel_d.relative_path LIKE ?":"",r=t?[`%${t}%`]:[];return e.all(`WITH barrel_refs AS MATERIALIZED (
|
|
2
|
-
SELECT DISTINCT
|
|
3
|
-
barrel_d.id AS barrel_doc_id,
|
|
4
|
-
barrel_d.relative_path AS barrel_path,
|
|
5
|
-
m.symbol_id
|
|
6
|
-
FROM documents barrel_d
|
|
7
|
-
JOIN chunks c ON c.document_id = barrel_d.id
|
|
8
|
-
JOIN mentions m ON m.chunk_id = c.id
|
|
9
|
-
WHERE m.role != 1
|
|
10
|
-
AND (barrel_d.relative_path LIKE '%/index.ts'
|
|
11
|
-
OR barrel_d.relative_path LIKE '%/index.js'
|
|
12
|
-
OR barrel_d.relative_path = 'index.ts'
|
|
13
|
-
OR barrel_d.relative_path = 'index.js')
|
|
14
|
-
${e.pathExclusionsFor("barrel_d")}
|
|
15
|
-
${o}
|
|
16
|
-
),
|
|
17
|
-
sym_def AS MATERIALIZED (
|
|
18
|
-
SELECT m2.symbol_id, c2.document_id
|
|
19
|
-
FROM barrel_refs br
|
|
20
|
-
-- Keep the bounded barrel-symbol set on the outer side. An ordinary
|
|
21
|
-
-- JOIN lets SQLite scan every definition mention before applying the
|
|
22
|
-
-- barrel-symbol bloom filter on large indexes.
|
|
23
|
-
CROSS JOIN mentions m2 ON m2.symbol_id = br.symbol_id
|
|
24
|
-
AND m2.role = 1
|
|
25
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
26
|
-
GROUP BY m2.symbol_id
|
|
27
|
-
)
|
|
28
|
-
SELECT DISTINCT
|
|
29
|
-
br.barrel_doc_id,
|
|
30
|
-
br.barrel_path,
|
|
31
|
-
gs.id AS symbol_id,
|
|
32
|
-
gs.symbol AS symbol,
|
|
33
|
-
orig_d.id AS original_doc_id,
|
|
34
|
-
orig_d.relative_path AS original_path
|
|
35
|
-
FROM barrel_refs br
|
|
36
|
-
JOIN global_symbols gs ON br.symbol_id = gs.id
|
|
37
|
-
JOIN sym_def ON sym_def.symbol_id = gs.id
|
|
38
|
-
JOIN documents orig_d ON sym_def.document_id = orig_d.id
|
|
39
|
-
WHERE orig_d.id != br.barrel_doc_id
|
|
40
|
-
${e.pathExclusionsFor("orig_d")}
|
|
41
|
-
${e.symbolNoiseFor("gs")}
|
|
42
|
-
-- Only function-level symbols (ending with ().), not module-level
|
|
43
|
-
AND gs.symbol LIKE '%().'
|
|
44
|
-
ORDER BY br.barrel_path, gs.symbol`,...r)}function I(e,t){return e.get(`SELECT
|
|
45
|
-
SUM(CASE WHEN uses_barrel = 1 THEN 1 ELSE 0 END) AS barrel_consumers,
|
|
46
|
-
SUM(CASE WHEN uses_barrel = 0 THEN 1 ELSE 0 END) AS direct_consumers
|
|
47
|
-
FROM (
|
|
48
|
-
SELECT
|
|
49
|
-
consumer_d.id AS consumer_doc_id,
|
|
50
|
-
MAX(CASE WHEN EXISTS (
|
|
51
|
-
SELECT 1
|
|
52
|
-
FROM mentions barrel_m
|
|
53
|
-
JOIN chunks barrel_c ON barrel_m.chunk_id = barrel_c.id
|
|
54
|
-
WHERE barrel_c.document_id = consumer_d.id
|
|
55
|
-
AND barrel_m.role != 1
|
|
56
|
-
AND barrel_m.symbol_id IN (
|
|
57
|
-
SELECT m2.symbol_id
|
|
58
|
-
FROM mentions m2
|
|
59
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
60
|
-
WHERE c2.document_id = ?
|
|
61
|
-
AND m2.role != 1
|
|
62
|
-
)
|
|
63
|
-
) THEN 1 ELSE 0 END) AS uses_barrel
|
|
64
|
-
FROM mentions ref_m
|
|
65
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
66
|
-
JOIN documents consumer_d ON ref_c.document_id = consumer_d.id
|
|
67
|
-
WHERE ref_m.symbol_id = ?
|
|
68
|
-
AND ref_m.role != 1
|
|
69
|
-
AND consumer_d.id != ?
|
|
70
|
-
AND consumer_d.id != ?
|
|
71
|
-
${e.pathExclusionsFor("consumer_d")}
|
|
72
|
-
GROUP BY consumer_d.id
|
|
73
|
-
)`,t.barrel_doc_id,t.symbol_id,t.barrel_doc_id,t.original_doc_id)}function y(e,t,o){let r=[],i=C(e);for(let s of O(e,o))E(i,s,s)>0||r.push(...D(e,t,s,i));return r}function O(e,t){return l(e,{scope:t,includeIgnored:!1}).filter(o=>a(e,o).length>0||u(e,o).length>0)}function D(e,t,o,r){let i=a(e,o).filter(n=>n.sourcePath&&!e.isIgnored(n.sourcePath)).flatMap(n=>R(e,t,o,n.sourcePath,r,[A(n.specifier)])),s=u(e,o).filter(n=>n.sourcePath&&!e.isIgnored(n.sourcePath)).flatMap(n=>R(e,t,o,n.sourcePath,r,n.kind==="named"&&n.names.length>0?n.names:[n.kind==="star"?`* from ${n.sourcePath}`:`* namespace from ${n.sourcePath}`]));return[...i,...s]}function R(e,t,o,r,i,s){let n=t.definitionsForFile(r);return s.map(c=>{let d=n.find(S=>S.leaf===c);return{barrelFile:o,symbol:d?.symbol??`source-reexport:${o}:${c}`,shortName:d?m(d.symbol):c,originalFile:r,barrelConsumers:0,directConsumers:E(i,r,o),...h(e,o)}})}function A(e){return e.split("::").at(-1)?.split("/").at(-1)?.replace(/\.[^.]+$/,"")??e}function h(e,t){return b(e,t)?{actionTier:"signal",surfaceEvidence:["barrel file is declared on the package public surface"],recommendation:"Review the package API before removing this re-export; local consumers are zero, but external consumers may import through the public barrel."}:{actionTier:"direct",surfaceEvidence:[],recommendation:"Remove this unused re-export when the barrel is not part of an external API surface."}}function C(e){let t=new Map;for(let o of l(e,{includeIgnored:!1}))for(let r of _(e,o)){if(!r.sourcePath)continue;let i=t.get(r.sourcePath)??new Set;i.add(o),t.set(r.sourcePath,i)}return t}function E(e,t,o){let r=e.get(t);return r?r.size-(r.has(o)?1:0):0}function T(e){let t=new Set,o=[];for(let r of e){let i=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;t.has(i)||(t.add(i),o.push(r))}return o}function F(e){e.sort((t,o)=>o.directConsumers-t.directConsumers||t.barrelFile.localeCompare(o.barrelFile)||t.shortName.localeCompare(o.shortName))}export{B as a};
|
|
74
|
-
//# sourceMappingURL=chunk-PWWAJSKV.js.map
|
package/dist/chunk-PZL5T7SU.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import{a as c}from"./chunk-BRV7PIFF.js";import{a as r}from"./chunk-OSSESPDX.js";import{b as l}from"./chunk-TEBQMNVI.js";import{d as m}from"./chunk-N2ZSIIGR.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-PZL5T7SU.js.map
|
package/dist/chunk-QBE3YX64.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import{a as b,b as y,c as m}from"./chunk-MTDBHTSF.js";import{b as f,d as g,f as d,u as p}from"./chunk-N2ZSIIGR.js";import{a as c}from"./chunk-ZOHS7AQV.js";import{SymbolInformation_Kind as o}from"@c4312/scip";var _=500;function K(n){let s=parseInt(n,10);if(!isNaN(s))return s;let t=n.toLowerCase(),e=y.get(t);if(e!==void 0)return e;for(let[i,l]of b)if(l.toLowerCase().includes(t))return i;return null}function v(n,s,t={}){let{scope:e,limit:i=100}=t,l=K(s);return l===null?[]:h(n,e).map(r=>({row:r,resolvedKind:k(r)})).filter(r=>r.resolvedKind===l).slice(0,i).map(({row:r,resolvedKind:a})=>({symbol:r.symbol,shortName:g(r.symbol),kind:a,kindName:m(a),relativePath:r.relative_path,startLine:r.start_line,endLine:r.end_line}))}function T(n,s={}){let t=I(n,s.scope);for(let e of S(n,s.scope)){let i=k(e);i===null||i===0||t.set(i,(t.get(i)??0)+1)}return[...t.entries()].sort((e,i)=>i[1]-e[1]||e[0]-i[0]).map(([e,i])=>({kind:e,kindName:m(e),count:i}))}function h(n,s){return p(n,{scope:s}).map(R)}function I(n,s){let t=new Map;for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", "),l=n.all(`SELECT gs.kind AS kind, COUNT(*) AS count
|
|
2
|
-
FROM defn_enclosing_ranges der
|
|
3
|
-
JOIN global_symbols gs ON der.symbol_id = gs.id
|
|
4
|
-
JOIN documents d ON der.document_id = d.id
|
|
5
|
-
WHERE gs.kind IS NOT NULL
|
|
6
|
-
AND gs.kind != 0
|
|
7
|
-
AND gs.symbol NOT LIKE '%#'
|
|
8
|
-
AND d.relative_path IN (${i})
|
|
9
|
-
GROUP BY gs.kind`,...e);for(let u of l)t.set(u.kind,(t.get(u.kind)??0)+u.count)}return t}function S(n,s){let t=[];for(let e of N(c(n,{scope:s,includeIgnored:!1}))){let i=e.map(()=>"?").join(", ");t.push(...n.all(`SELECT gs.symbol,
|
|
10
|
-
gs.kind,
|
|
11
|
-
gs.documentation,
|
|
12
|
-
gs.enclosing_symbol,
|
|
13
|
-
d.relative_path,
|
|
14
|
-
der.start_line,
|
|
15
|
-
der.end_line
|
|
16
|
-
FROM defn_enclosing_ranges der
|
|
17
|
-
JOIN global_symbols gs ON der.symbol_id = gs.id
|
|
18
|
-
JOIN documents d ON der.document_id = d.id
|
|
19
|
-
WHERE (gs.kind IS NULL OR gs.kind = 0 OR gs.symbol LIKE '%#')
|
|
20
|
-
${n.symbolNoiseFor("gs")}
|
|
21
|
-
AND d.relative_path IN (${i})
|
|
22
|
-
ORDER BY d.relative_path, der.start_line, der.end_line, gs.symbol`,...e))}return t}function N(n){let s=[];for(let t=0;t<n.length;t+=_)s.push(n.slice(t,t+_));return s}function R(n){return{symbol:n.symbol,kind:n.kind,documentation:n.documentation,enclosing_symbol:n.enclosingSymbol,relative_path:n.relativePath,start_line:n.startLine,end_line:n.endLine}}function k(n){return n.kind!==null&&n.kind!==0?D(n.kind,n.symbol,n.documentation):C(n.symbol,n.documentation,n.enclosing_symbol)}function D(n,s,t){let e=(t??"").toLowerCase();if(d(s)==="type"){if(e.includes("type "))return o.TypeAlias;if(e.includes("interface "))return o.Interface;if(e.includes("struct "))return o.Struct;if(e.includes("trait "))return o.Trait;if(e.includes("class "))return o.Class}return n}function C(n,s,t){let e=f(n);if("kind"in e)return null;let i=e.descriptors,l=i[i.length-2]??null,u=d(n),r=(s??"").toLowerCase();return u==="type"?r.includes("type ")?o.TypeAlias:r.includes("interface ")?o.Interface:r.includes("struct ")?o.Struct:r.includes("trait ")?o.Trait:r.includes("class ")?o.Class:o.Class:u==="method"?l?.suffix==="type"?o.Method:o.Function:u==="namespace"?o.Module:u!=="term"?null:r.includes("async def ")||r.includes("def ")?o.Function:(t?d(t):l?.suffix??null)==="type"?o.Field:o.Variable}export{v as a,T as b};
|
|
23
|
-
//# sourceMappingURL=chunk-QBE3YX64.js.map
|
package/dist/chunk-QGVTFRY2.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as R}from"./chunk-QOJONDS7.js";import{a as j,b as g,c as N}from"./chunk-HLZTEXRA.js";import{a as _}from"./chunk-WUN6KBHV.js";import{a as E}from"./chunk-BOJ5SVE2.js";import{b as C,c as P}from"./chunk-CJZXN4NU.js";import{a as k}from"./chunk-BGBBVSH4.js";import{b as w}from"./chunk-DYGHBZ2N.js";import{A as L,d,e as y,k as v}from"./chunk-N2ZSIIGR.js";import{q as S}from"./chunk-ODDUPDP7.js";import{y as x}from"./chunk-JWTGMPIT.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=j(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&x("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=T(t,c.symbolId,D);if(!M)continue;let p=W(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=T(t,e.symbolId,o);if(!r)return null;let s=W(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(a=>!S(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return N(t,e,o).realConsumers}function T(t,n,e){return t.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`,n,e)}function W(t,n,e,i,a){let o=t.definitionsForFile(e),r=q(n,e,i,a.start_line,a.end_line);return L(o,r)}function J(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:G(n,e),source:"file"}}function q(t,n,e,i,a){let o=y(e);if(!o)return i;let r=w(t,n).get(o);if(!r||r.length===0)return i;for(let s of r)if(s>=i&&s<=a)return s;return i}function z(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function G(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,b(n)),a=0;for(let[o,r]of t)o!==n&&m(o,b(o))===i&&r>a&&(a=r);return a}function H(t,n,e,i){return R(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ae as a};
|
|
7
|
-
//# sourceMappingURL=chunk-QGVTFRY2.js.map
|
package/dist/chunk-QOJONDS7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{k as c,l}from"./chunk-FESCRNVV.js";function h(e,a,i,r,n,o){let t=new Set;d(e,a,i,r)&&t.add(n);for(let s of o)s.value&&p(t,s.label,s.value);return[...t].slice(0,6)}function p(e,a,i){let r=u(i);a.endsWith("name")&&y(r)&&e.add(`${a} has type-guard boundary shape`);for(let n of r){let o=f.get(n);o&&e.add(`${a} has ${o} term: ${n}`)}}function d(e,a,i,r){if(i<=0)return!1;let n=c(e,a);if(n.length===0)return!1;for(let o=i-1;o>=0&&o>=i-5;o-=1){let t=(n[o]??"").trim();if(t!==""){if(l(t)===r)return!0;if(!t.startsWith("//")&&!t.startsWith("*")&&!t.startsWith("/*")&&!t.startsWith("@")&&!t.startsWith("#"))return!1}}return!1}function u(e){return e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function y(e){return e.some(a=>g.has(a))&&e.some(a=>m.has(a))}var f=new Map([["access","access policy"],["accessible","access policy"],["adapter","adapter"],["adapters","adapter"],["allow","access policy"],["allowed","access policy"],["animation","animation calculation"],["api","api surface"],["apply","settings/application"],["audit","side-effect boundary"],["auth","authorization"],["authorize","authorization"],["audio","audio side-effect"],["can","access policy"],["capabilities","capability boundary"],["capability","capability boundary"],["boundary","boundary"],["begin","lifecycle"],["bridge","bridge"],["bridges","bridge"],["cache","state cache"],["chase","gameplay action"],["command","command boundary"],["context","context policy"],["cooldown","temporal state"],["cooldowns","temporal state"],["controller","controller"],["controllers","controller"],["diagnostic","diagnostics"],["diagnostics","diagnostics"],["effect","side-effect boundary"],["effects","side-effect boundary"],["energy","gameplay calculation"],["expired","temporal state"],["facade","facade"],["facades","facade"],["fire","gameplay action"],["gateway","gateway"],["gateways","gateway"],["guard","guard"],["guards","guard"],["haptic","haptic side-effect"],["haptics","haptic side-effect"],["head","sequence boundary"],["history","state history"],["input","input boundary"],["jump","gameplay action"],["keyboard","input boundary"],["log","side-effect boundary"],["logger","side-effect boundary"],["lock","coordination boundary"],["middleware","middleware"],["multiplier","gameplay calculation"],["mute","audio side-effect"],["normalize","normalization"],["normalise","normalization"],["normalizer","normalization"],["oscillate","animation calculation"],["oscillation","animation calculation"],["overlap","collision predicate"],["performance","diagnostics"],["permission","access policy"],["permissions","access policy"],["policy","policy"],["pool","state pool"],["pooled","state pool"],["pools","state pool"],["predict","prediction"],["presenter","presenter"],["presenters","presenter"],["projectile","gameplay entity"],["provider","provider boundary"],["providers","provider boundary"],["public","public surface"],["quality","settings/application"],["rate","calculation"],["register","registry"],["registry","registry"],["relay","relay"],["relays","relay"],["reseed","state lifecycle"],["reset","state lifecycle"],["respond","response boundary"],["response","response boundary"],["resolve","resolution"],["resolver","resolution"],["route","route boundary"],["routes","route boundary"],["run","lifecycle"],["sample","diagnostics"],["score","gameplay calculation"],["scope","scope policy"],["scroll","position state"],["scrolled","position state"],["seed","state lifecycle"],["seeded","state lifecycle"],["segment","segment boundary"],["segments","segment boundary"],["setting","settings/application"],["settings","settings/application"],["spawn","gameplay lifecycle"],["spawning","gameplay lifecycle"],["speed","gameplay calculation"],["surface","public surface"],["tail","sequence boundary"],["tick","temporal state"],["transaction","transaction"],["transactional","transaction"],["transform","transformation"],["transformer","transformation"],["translate","translation"],["translator","translation"],["try","fallible action"],["validate","validation"],["validation","validation"],["validator","validation"],["visual","diagnostics"],["window","settings/application"],["socket","transport boundary"],["websocket","transport boundary"]]),g=new Set(["can","has","is","should"]),m=new Set(["access","api","auth","collision","expired","input","keyboard","overlap","permission","permissions","policy","projectile","response","route","routes","scope"]);export{h as a};
|
|
2
|
-
//# sourceMappingURL=chunk-QOJONDS7.js.map
|
package/dist/chunk-QU5XRYB5.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as C}from"./chunk-WUN6KBHV.js";import{c as M}from"./chunk-T4N4P2K5.js";import{b as f,c as I}from"./chunk-CJZXN4NU.js";import{e as d}from"./chunk-NWQXSFFU.js";import{d as h}from"./chunk-MTDBHTSF.js";import{d as g}from"./chunk-N2ZSIIGR.js";import{n as y}from"./chunk-ODDUPDP7.js";var x=new Set(h());function N(e,n){let{scope:o,minLoc:r=10,limit:i=30,scanLimit:t}=n??{},s=new I(e);return C({candidates:()=>s.productionCallableDefinitions({scope:o,minLoc:r,requireFunctionLikeSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof t=="number"&&t>0}),scanLimit:t,filterCandidate:S,profile:{name:"complexity-hotspots"},prepare:a=>{let l=B(e,a),m=n?.semantic!==!1,c=m?d(e):null;c?.materializeReferences(a,{prefetchCallees:!0});let u=s.crossFileCallerMap(a,{semantic:!1});return{callerMap:c?f(u,c.callerMap(a)):u,calleeMap:s.calleeMap(a,{semantic:m}),languageByFile:l,clojureCallableIds:D(e,a,l),branchEstimates:M(e,a)}},evaluate:(a,l)=>L(a,l,r),orderResults:(a,l)=>l.score-a.score||l.loc-a.loc,limit:i})}function S(e){return e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&x.has(e.kind):!0}function L(e,n,o){if(n.languageByFile.get(e.relativePath)==="clojure"&&!n.clojureCallableIds.has(e.symbolId))return null;let r=e.endLine-e.startLine+1;if(r<o)return null;let i=n.callerMap.get(e.symbolId)?.size??0,t=n.calleeMap.get(e.symbolId)??[],s=new Set,a=new Set;for(let p of t){let b=`${p.symbol}|${p.file}`;s.add(b),p.file!==e.relativePath&&a.add(b)}let l=a.size,m=s.size,c=n.branchEstimates.get(e.symbolId)??{branches:0,estimateBasis:"regex-fallback"},u=c.branches+1;return{symbol:e.symbol,shortName:g(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:r,fanIn:i,fanOut:l,calleeCount:m,branches:c.branches,estimateBasis:c.estimateBasis,score:Math.round(r/50*(i/5)*Math.max(l/5,1)*Math.max(u/5,1)*100)/100}}function B(e,n){let o=[...new Set(n.map(t=>t.relativePath))];if(o.length===0)return new Map;let r=o.map(()=>"?").join(", "),i=e.all(`SELECT relative_path, language
|
|
2
|
-
FROM documents
|
|
3
|
-
WHERE relative_path IN (${r})`,...o);return new Map(i.map(t=>[t.relative_path,t.language?.toLowerCase()??null]))}function D(e,n,o){let r=new Set,i=new Map;for(let t of n){if(o.get(t.relativePath)!=="clojure")continue;let s=i.get(t.relativePath);s||(s=new Set((y(e,t.relativePath)?.callables??[]).map(a=>`${a.name}:${a.startLine}`)),i.set(t.relativePath,s)),s.has(`${t.leaf}:${t.startLine}`)&&r.add(t.symbolId)}return r}export{N as a};
|
|
4
|
-
//# sourceMappingURL=chunk-QU5XRYB5.js.map
|
package/dist/chunk-QUU5OBVK.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-BRV7PIFF.js";import{c as y}from"./chunk-CJZXN4NU.js";import{i as v}from"./chunk-NWQXSFFU.js";import{a as R,b as k,j as b}from"./chunk-XRYABF57.js";import{b as C}from"./chunk-NJITK2GP.js";import{d as h}from"./chunk-N2ZSIIGR.js";import{Aa as f,Ba as g,c as m}from"./chunk-N5B2NILC.js";function _(e,a){let n=m(a),t=[],r="complete",o=C(n);o==="entry"&&s(t,"operational-root","structural entrypoint path"),o==="worker"&&s(t,"operational-root","worker launch convention"),b(n)&&s(t,"operational-root","framework-discovered entrypoint"),L(e,n)&&s(t,"operational-root","configured entry root");let l=!1;try{l=R(e,n),l&&s(t,"published-api","package manifest export");for(let i of k(e,n))s(t,"operational-root",i)}catch(i){r="partial",s(t,"metadata-unavailable",`package metadata unavailable: ${x(i)}`)}try{let i=f(e.config.projectRoot,n,{maxBytes:8388608,inputKind:"change-surface source"});w(i)&&s(t,"operational-root","module contains a direct-execution process guard")}catch(i){r="partial",s(t,"metadata-unavailable",g(i)?"indexed source file is unavailable on disk":`source metadata unavailable: ${x(i)}`)}return{operationalRoot:t.some(i=>i.kind==="operational-root"),publishedApi:l,coverage:r,reasons:t}}function L(e,a){let n=e.config.entryRoots;return n?n.files?.some(t=>m(t)===a)?!0:n.pathPrefixes?.some(t=>a.startsWith(m(t)))??!1:!1}function w(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,a,n){e.some(t=>t.kind===a&&t.detail===n)||e.push({kind:a,detail:n})}function x(e){return e instanceof Error?e.message:String(e)}function q(e,a,n={}){let t=S(e,a);if(!t)return null;let r=D(e,t);if(!r||e.isIgnored(r.relative_path))return null;let o=[],l=0,i=M(e,r.relative_path),p=_(e,r.relative_path),F=n.semantic===!1?new Map:v(e,i);for(let u of i){let c=I(e,r,u,F.get(u.symbolId)??new Set);l+=c;let d=N(c),E=[...p.reasons,...c>0?[{kind:"external-consumers",detail:`${c} external consumer${c===1?"":"s"}`}]:[]];o.push({symbol:u.symbol,shortName:h(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:c,externalConsumerRiskLevel:d,riskLevel:P(d,p),riskReasons:E})}return{file:r.relative_path,symbols:o,totalExternalConsumers:l,fileRisk:p}}function D(e,a){return e.get(`SELECT id, relative_path FROM documents
|
|
2
|
-
WHERE relative_path = ?
|
|
3
|
-
${e.pathExclusionsFor("documents")}
|
|
4
|
-
LIMIT 1`,a)??null}function M(e,a){return new y(e).definitionsForFile(a).sort((n,t)=>n.startLine-t.startLine||n.endLine-t.endLine)}function I(e,a,n,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
|
|
5
|
-
FROM mentions m
|
|
6
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
-
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
8
|
-
WHERE m.symbol_id = ?
|
|
9
|
-
AND m.role != 1
|
|
10
|
-
AND c.document_id != ?`,n.symbolId,a.id);return new Set([...r.map(o=>o.relative_path),...[...t].filter(o=>o!==a.relative_path)]).size}function N(e){return e>10?"high":e>0?"medium":"low"}function P(e,a){return e==="high"?"high":e==="medium"||a.operationalRoot||a.publishedApi||a.coverage==="partial"?"medium":"low"}export{q as a};
|
|
11
|
-
//# sourceMappingURL=chunk-QUU5OBVK.js.map
|
package/dist/chunk-RBLQNW26.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{Nb as q,Ob as N,Pb as ot,Qb as V,Sb as at,mc as it,oc as U,tc as L,uc as B}from"./chunk-NOYBFVJA.js";import{Ca as I,Ge as st,Md as et,Nd as nt,Od as rt,Pd as z,Wd as j,u as A}from"./chunk-66DVSJQG.js";import{createHash as T,randomBytes as lt}from"crypto";import{chmodSync as Wt,closeSync as x,fstatSync as ct,lstatSync as Xt,mkdirSync as yt,openSync as W,readSync as Yt,readdirSync as Ot,renameSync as wt,rmSync as X,statSync as Qt,writeSync as St}from"fs";import{tmpdir as Zt}from"os";import{dirname as Kt,join as _,resolve as te}from"path";import{StringDecoder as Y}from"string_decoder";import{InvalidArgumentError as pt}from"commander";var Gt=/^[A-Za-z0-9_@%+=:,./-]+$/u;function ut(t,e={}){return e.omitSafeQuotes&&Gt.test(t)?t:(e.platform??process.platform)==="win32"?`"${t.replaceAll("%","%%").replaceAll('"','\\"')}"`:`'${t.replaceAll("'",`'"'"'`)}'`}var vt="scip-query-output-page",bt=1,ee="continue",S=256,E=1e5,$=4096,l=32e6,Ct=64*1024*1024,ne=256*1024*1024,re=32,Pt=32768,It=16,se=V*It,R=4096,ht=Ct,Et=3600*1e3,oe="scip-query-json-export",ae=1,Tt=3;function xt(){return _(Zt(),`scip-query-output-pages-${typeof process.getuid=="function"?process.getuid():"user"}`)}var Q=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u,_t=/^[A-Za-z0-9_][A-Za-z0-9_-]{11}$/u,ie=/^4\.([A-Za-z0-9_-]{22})\.([0-9a-z]{1,10})$/u,ue=/^([A-Za-z0-9_][A-Za-z0-9_-]{11})(?:\.([0-9a-z]{1,10}))?$/u,At=1,ce="quota.lock",pe=2e3,he=5,dt=1024*1024,de=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)),D,ge=Object.freeze({maxSnapshotBytes:Ct,maxAggregateBytes:ne,maxSnapshotCount:re});var Nt={writeStdout:t=>{process.stdout.write(t)},writeStderr:t=>{process.stderr.write(t)}};async function fe(t,e,n=Nt){return it({command:t.command,cwd:t.cwd,argv:t.argv,json:t.json,sessionEnabled:t.sourceSession,reemit:t.reemitSource},async()=>{try{await me(t,e,n)}finally{U(!1)}})}async function me(t,e,n){let s=t.pageSize??q,r=t.snapshotRoot??xt(),a=Pe(t.snapshotLimits),o=t.maxOutputCharacters??l;if(!Number.isSafeInteger(o)||o<=0)throw new Error("Output character safety limit must be a positive integer.");let i=Math.min(o,l,t.agentOutput?se:l);if(Ut(s),t.cursor!==void 0&&t.cursor.length>$)throw new Error(`Output cursor exceeds the ${$}-character limit. Run the command again without --output-cursor.`);if(t.jsonOutputPath!==void 0){if(!t.json)throw new Error("--json-output requires --json.");if(t.agentOutput||t.pageSize!==void 0||t.cursor!==void 0)throw new Error("--json-output cannot be combined with --agent-output or output pagination.");t.command==="system-map"&&B(t.cwd,t.sourceSession!==!1),await le(t,e,n,i);return}if(t.json&&!t.agentOutput&&t.pageSize===void 0&&t.cursor===void 0){t.command==="system-map"&&B(t.cwd,t.sourceSession!==!1),await Oe(t,e,n);return}let p=jt(t.argv),h=Dt(t.invocationPrefix),d=zt(t.command,t.cwd,h,p),g=t.cursor===void 0?void 0:Re(t.cursor,d);t.command==="system-map"&&!g&&B(t.cwd,t.sourceSession!==!1);let c=g?.snapshotId,u;if(g)try{u=Se(g,d,s,i,r,t.onSnapshotRead)}catch(y){let M=y instanceof Error?y.message:String(y);throw new Error(`${M} Restart with: ${qt(h,p,s)}`,{cause:y})}else{let y=new F(d,h,t.command,t.cwd,p,s,i,Le(t,h),r,a,t.agentOutput?It:Pt,!t.json,Z(i,t.agentOutput===!0)),M=Lt(k=>y.write(k)),tt=!1;try{await e(),tt=!0}finally{M(),tt||y.abort()}let P;try{P=y.complete()}catch(k){throw y.abort(),k}c=P.snapshotId,u={content:P.content,offset:0,pageIndex:0,pageCount:P.pageCount,totalCharacters:P.totalCharacters,outputHash:P.outputHash}}let w=u.offset+u.content.length,f=u.pageIndex+1>=u.pageCount,m=f?void 0:Ue({invocationPrefix:h,nextPageIndex:u.pageIndex+1,snapshotId:Ae(c)});if(L(t.command,t.cwd,f,t.sourceSession!==!1,m?.command),u.offset===0&&f&&t.cursor===void 0){n.writeStdout(u.content),U(!0),c&&b(c,r);return}let C={kind:vt,schemaVersion:bt,producer:{name:"scip-query",version:t.producerVersion},command:t.command,contentType:t.json?"application/json":"text/plain",agentInstruction:m?"INCOMPLETE EVIDENCE: do not draw conclusions or report completion from this partial page. Run page.continuation.command exactly, then repeat until page.complete is true.":"OUTPUT COMPLETE: all rendered characters have been retrieved. Evaluate the command result's own coverage separately.",page:m?{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-w,complete:!1,outputHash:u.outputHash,continuation:m}:{offset:u.offset,returnedCharacters:u.content.length,totalCharacters:u.totalCharacters,omittedCharacters:u.totalCharacters-u.content.length,remainingCharacters:u.totalCharacters-w,complete:!0,outputHash:u.outputHash},content:u.content};if(t.json){n.writeStdout(`${JSON.stringify(C)}
|
|
3
|
-
`),f&&c&&b(c,r);return}n.writeStdout(je(C)),f&&c&&b(c,r)}async function un(t,e,n=xt(),s=Nt){if(t.length>$)throw new Error(`Output cursor exceeds the ${$}-character limit.`);let r=kt(t);if(!r)throw new Error("Invalid output cursor. Run the original command again.");let a=Rt(r.snapshotId,n);await fe({command:a.command,producerVersion:e,invocationPrefix:a.invocationPrefix,argv:[...a.argv,"--output-page-size",String(a.pageSize),"--output-cursor",t],cwd:a.cwd,json:a.argv.some(o=>o==="--json"||o.startsWith("--json=")),sourceSession:!a.argv.some(o=>o==="--no-session"),agentOutput:a.argv.some(o=>o==="--agent-output"),pageSize:a.pageSize,cursor:t,snapshotRoot:n},()=>{throw new Error("Output continuation attempted to rerun the original command.")},s)}async function le(t,e,n,s){let r=t.jsonOutputPath;if(r===void 0||r.length===0||Buffer.byteLength(r)>R||r.includes("\0"))throw new Error(`--json-output requires a path from 1 through ${R} UTF-8 bytes.`);let a=te(t.cwd,r);if(Buffer.byteLength(a)>R)throw new Error(`The resolved --json-output path exceeds ${R} UTF-8 bytes.`);let o=new Y("utf8"),i=T("sha256"),p=0,h=0,d=m=>{if(h+=m.length,!Number.isSafeInteger(h)||h>s)throw new Error(Z(s,!1))};yt(Kt(a),{recursive:!0});let g=`${a}.tmp-${lt(12).toString("hex")}`,c=W(g,"wx",384),u=!0,w=Lt(m=>{let C=p+m.length;if(!Number.isSafeInteger(C)||C>ht)throw new Error(`JSON export exceeds the ${ht}-byte file safety limit. Narrow the query before retrying.`);if(d(o.write(m)),c===void 0)throw new Error("JSON export writer is closed.");ye(c,m),i.update(m),p=C});try{await e(),d(o.end()),w(),x(c),c=void 0,wt(g,a),u=!1}finally{if(w(),c!==void 0)try{x(c)}catch{}u&&X(g,{force:!0})}let f={kind:oe,schemaVersion:ae,producer:{name:"scip-query",version:t.producerVersion},command:t.command,path:a,bytes:p,sha256:i.digest("hex")};n.writeStdout(`${JSON.stringify(f)}
|
|
4
|
-
`),L(t.command,t.cwd,!0,t.sourceSession!==!1),U(!0)}function ye(t,e){let n=0;for(;n<e.length;){let s=St(t,e,n,e.length-n);if(s<=0)throw new Error("JSON export write made no forward progress.");n+=s}}function Z(t,e){let n=`Command output exceeds the ${t}-character safety limit. Narrow the query before retrying.`;return e?`${n} For the complete machine result, use --json --json-output <path> and inspect the file programmatically.`:n}function cn(t){if(!/^\d+$/u.test(t))throw new pt(`Output page size must be an integer from ${S} through ${E}.`);let e=Number(t);try{Ut(e)}catch{throw new pt(`Output page size must be an integer from ${S} through ${E}.`)}return e}function Ut(t){if(!Number.isSafeInteger(t)||t<S||t>E)throw new Error(`Output page size must be an integer from ${S} through ${E}.`)}async function Oe(t,e,n){let s=new J(N,t.maxOutputCharacters??l),r=process.stdout.write,a=!1,o=`${at(`scip-query: JSON output exceeds the ${N}-byte client-safe budget and may be truncated by the client. Do not use possibly partial client output as evidence. Read every page with: ${qt(Dt(t.invocationPrefix),ke(jt(t.argv)),q)}`)}
|
|
5
|
-
`;process.stdout.write=((i,p,h)=>{let d=s.push(i,p);return d!==void 0&&(a||(a=!0,n.writeStderr(o)),r.call(process.stdout,d)),Bt(p,h),!0});try{await e();let i=s.finish();i.crossedPageBoundary&&!a&&(a=!0,n.writeStderr(o)),i.bytes.length>0&&r.call(process.stdout,i.bytes),a&&n.writeStderr(o),L(t.command,t.cwd,!0,t.sourceSession!==!1)}finally{process.stdout.write=r}}function Lt(t){let e=process.stdout.write;return process.stdout.write=((n,s,r)=>{let a=we(n,s);return t(a),Bt(s,r),!0}),()=>{process.stdout.write=e}}function we(t,e){return typeof t=="string"?Buffer.from(t,typeof e=="string"?e:"utf8"):Buffer.from(t)}function Bt(t,e){let n=typeof t=="function"?t:e;typeof n=="function"&&n()}var J=class{constructor(e,n){this.byteLimit=e;this.maxOutputCharacters=n}byteLimit;maxOutputCharacters;decoder=new Y("utf8");chunks=[];overflowed=!1;totalCharacters=0;totalBytes=0;push(e,n){let s=typeof e=="string"?Buffer.from(e,typeof n=="string"?n:"utf8"):Buffer.from(e);if(this.totalBytes+=s.length,this.addCharacters(this.decoder.write(s)),this.overflowed)return s;if(this.chunks.push(s),this.totalBytes<=this.byteLimit)return;this.overflowed=!0;let r=Buffer.concat(this.chunks);return this.chunks.length=0,r}finish(){this.addCharacters(this.decoder.end());let e=this.totalBytes>this.byteLimit,n=Buffer.concat(this.chunks);return this.chunks.length=0,{bytes:n,crossedPageBoundary:e}}addCharacters(e){if(this.totalCharacters+=e.length,!Number.isSafeInteger(this.totalCharacters)||this.totalCharacters>this.maxOutputCharacters)throw new Error(`Command output exceeds the ${this.maxOutputCharacters}-character safety limit. Narrow the query before retrying.`)}},F=class{constructor(e,n,s,r,a,o,i,p,h,d,g,c,u=Z(i,!1)){this.invocationHash=e;this.invocationPrefix=n;this.command=s;this.cwd=r;this.argv=a;this.pageSize=o;this.maxOutputCharacters=i;this.pageContentByteLimit=p;this.snapshotRoot=h;this.limits=d;this.maxPages=g;this.preferLineBoundaries=c;this.overflowMessage=u;K(h);do this.snapshotId=lt(9).toString("base64url");while(this.snapshotId.startsWith("-"));this.temporaryPath=O(h,this.snapshotId,"tmp")}invocationHash;invocationPrefix;command;cwd;argv;pageSize;maxOutputCharacters;pageContentByteLimit;snapshotRoot;limits;maxPages;preferLineBoundaries;overflowMessage;snapshotId;temporaryPath;decoder=new Y("utf8");hash=T("sha256");pages=[];descriptor=null;pending="";firstPageContent="";totalCharacters=0;pageCharacterOffset=0;byteLength=0;reservedBytes=0;opened=!1;finished=!1;write(e){if(this.finished)throw new Error("Output snapshot writer is closed.");this.appendDecoded(this.decoder.write(e))}complete(){if(this.finished)throw new Error("Output snapshot writer is closed.");if(this.appendDecoded(this.decoder.end()),this.finished=!0,!this.opened){let r=this.pending,a=Buffer.from(r);return this.assertWithinByteLimit(a.length),this.hash.update(a),this.pending="",{content:r,totalCharacters:this.totalCharacters,outputHash:this.hash.digest("hex"),pageCount:1}}if((this.pending.length>0||this.pages.length===0)&&(this.flushPage(this.pending),this.pending=""),this.descriptor===null)throw new Error("Output snapshot writer is not open.");x(this.descriptor),this.descriptor=null;let e=this.hash.digest("hex"),n=O(this.snapshotRoot,this.snapshotId,"output"),s=O(this.snapshotRoot,this.snapshotId,"json");try{wt(this.temporaryPath,n);let r={version:Tt,snapshotId:this.snapshotId,invocationHash:this.invocationHash,invocationPrefix:[...this.invocationPrefix],command:this.command,cwd:this.cwd,argv:[...this.argv],outputHash:e,pageSize:this.pageSize,pages:this.pages,totalCharacters:this.totalCharacters,byteLength:this.byteLength,createdAtMs:Date.now()};return j(s,r),gt(this.snapshotRoot,this.snapshotId,this.byteLength,"complete",this.limits),this.reservedBytes=this.byteLength,{content:this.firstPageContent,totalCharacters:this.totalCharacters,outputHash:e,pageCount:this.pages.length,snapshotId:this.snapshotId}}catch(r){throw b(this.snapshotId,this.snapshotRoot),r}}abort(){this.descriptor!==null&&(x(this.descriptor),this.descriptor=null),this.finished=!0,b(this.snapshotId,this.snapshotRoot)}appendDecoded(e){if(e.length===0)return;let n=this.totalCharacters+e.length;if(!Number.isSafeInteger(n)||n>this.maxOutputCharacters)throw new Error(this.overflowMessage);for(this.totalCharacters=n,this.pending+=e,this.assertWithinByteLimit(this.byteLength+Buffer.byteLength(this.pending));this.pending.length>this.pageSize||Buffer.byteLength(this.pending)>this.pageContentByteLimit;){this.open();let s=Ne(this.pending,this.pageSize,this.pageContentByteLimit,this.preferLineBoundaries),r=this.pending.slice(0,s);this.pending=this.pending.slice(s),this.flushPage(r)}}open(){if(!this.opened){Ie(this.snapshotRoot,this.snapshotId,0,this.limits);try{this.descriptor=W(this.temporaryPath,"wx",384),this.opened=!0}catch(e){throw Ee(this.snapshotRoot,this.snapshotId),e}}}flushPage(e){if(this.descriptor===null)throw new Error("Output snapshot writer is not open.");if(this.pages.length>=this.maxPages)throw new Error(`Command output requires more than ${this.maxPages} snapshot pages. Retry with a larger --output-page-size, narrow the query, or use --json --json-output <path>.`);let n=Buffer.from(e),s=this.byteLength+n.length;if(this.assertWithinByteLimit(s),s>this.reservedBytes){let o=Math.min(this.limits.maxSnapshotBytes,Math.ceil(s/dt)*dt);gt(this.snapshotRoot,this.snapshotId,o,"active",this.limits),this.reservedBytes=o}let r=0;for(;r<n.length;){let o=St(this.descriptor,n,r,n.length-r);if(o<=0)throw new Error("Output snapshot write made no progress.");r+=o}let a={characterOffset:this.pageCharacterOffset,characterLength:e.length,byteOffset:this.byteLength,byteLength:n.length,hash:T("sha256").update(n).digest("hex")};this.pages.length===0&&(this.firstPageContent=e),this.pages.push(a),this.hash.update(n),this.pageCharacterOffset+=e.length,this.byteLength=s}assertWithinByteLimit(e){if(!Number.isSafeInteger(e)||e>this.limits.maxSnapshotBytes)throw new Error(`Command output exceeds the ${this.limits.maxSnapshotBytes}-byte snapshot limit. Narrow the query before retrying.`)}};function Se(t,e,n,s,r,a){K(r);let o=Rt(t.snapshotId,r);if(o.invocationHash!==e)throw new Error("This output cursor belongs to a different command, working directory, or argument set. Run again without --output-cursor.");if(o.snapshotId!==t.snapshotId||t.version===3&&(o.invocationHash!==t.invocationHash||o.outputHash!==t.outputHash))throw new Error("Output snapshot identity does not match this cursor.");if(o.pageSize!==n||t.version===3&&t.pageSize!==n)throw new Error(`Output page size changed after this cursor was issued; use ${o.pageSize}.`);let i=o.pages[t.pageIndex];if(!i)throw new Error("Output cursor points past the current result.");if(o.totalCharacters>s)throw new Error(`Output snapshot exceeds the ${s}-character safety limit.`);if(Date.now()-o.createdAtMs>Et)throw b(t.snapshotId,r),new Error("Output snapshot expired before all pages were read.");let p=O(r,t.snapshotId,"output"),h=W(p,"r");try{let d=ct(h);if(!d.isFile()||d.size!==o.byteLength)throw new Error("Output snapshot size or type changed.");let g=Buffer.allocUnsafe(i.byteLength),c=0;for(;c<g.length;){let f=Yt(h,g,c,g.length-c,i.byteOffset+c);if(f===0)break;c+=f,a?.(f)}let u=ct(h);if(u.dev!==d.dev||u.ino!==d.ino||u.size!==d.size||c!==i.byteLength)throw new Error("Output snapshot changed while it was being read.");if(T("sha256").update(g).digest("hex")!==i.hash)throw new Error("Output snapshot page no longer matches its metadata.");let w=g.toString("utf8");if(w.length!==i.characterLength)throw new Error("Output snapshot page character count changed.");return{content:w,offset:i.characterOffset,pageIndex:t.pageIndex,pageCount:o.pages.length,totalCharacters:o.totalCharacters,outputHash:o.outputHash}}catch(d){throw b(t.snapshotId,r),d}finally{x(h)}}function Rt(t,e){if(!v(t))throw new Error("Output snapshot identifier is invalid.");let n;try{n=JSON.parse(A(O(e,t,"json"),"output snapshot metadata"))}catch(s){throw new Error("Output snapshot is unavailable.",{cause:s})}if(!ve(n))throw new Error("Output snapshot metadata is invalid.");return n}function ve(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===Tt&&typeof e.snapshotId=="string"&&v(e.snapshotId)&&I(e.invocationHash)&&Jt(e.invocationPrefix)&&typeof e.command=="string"&&e.command.length>0&&e.command.length<=256&&typeof e.cwd=="string"&&e.cwd.length>0&&e.cwd.length<=8192&&ze(e.argv)&&zt(e.command,e.cwd,e.invocationPrefix,e.argv)===e.invocationHash&&I(e.outputHash)&&Number.isSafeInteger(e.pageSize)&&(e.pageSize??0)>=S&&(e.pageSize??0)<=E&&Array.isArray(e.pages)&&e.pages.length>1&&e.pages.length<=Pt&&e.pages.every(be)&&Ce(e.pages)&&Number.isSafeInteger(e.totalCharacters)&&(e.totalCharacters??-1)>=0&&e.pages.reduce((n,s)=>n+s.characterLength,0)===e.totalCharacters&&Number.isSafeInteger(e.byteLength)&&(e.byteLength??-1)>=0&&e.pages.reduce((n,s)=>n+s.byteLength,0)===e.byteLength&&Number.isSafeInteger(e.createdAtMs)&&(e.createdAtMs??-1)>=0}function be(t){if(!t||typeof t!="object")return!1;let e=t;return Number.isSafeInteger(e.characterOffset)&&(e.characterOffset??-1)>=0&&Number.isSafeInteger(e.characterLength)&&(e.characterLength??0)>0&&Number.isSafeInteger(e.byteOffset)&&(e.byteOffset??-1)>=0&&Number.isSafeInteger(e.byteLength)&&(e.byteLength??0)>0&&I(e.hash)}function Ce(t){let e=0,n=0;for(let s of t){if(s.characterOffset!==e||s.byteOffset!==n)return!1;e+=s.characterLength,n+=s.byteLength}return!0}function K(t){yt(t,{recursive:!0,mode:448});let e=Xt(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Output snapshot root is not a private directory: ${t}`);if(typeof process.getuid=="function"&&e.uid!==process.getuid())throw new Error(`Output snapshot root is not owned by the current user: ${t}`);process.platform!=="win32"&&Wt(t,448)}function Pe(t){let e={...ge,...t};for(let[n,s]of Object.entries(e))if(!Number.isSafeInteger(s)||s<=0)throw new Error(`Output snapshot ${n} must be a positive integer.`);if(e.maxSnapshotBytes>e.maxAggregateBytes)throw new Error("Output snapshot maxSnapshotBytes cannot exceed maxAggregateBytes.");return e}function Ie(t,e,n,s){H(t,()=>{xe(t),$t(t,e,n,"active",s)})}function gt(t,e,n,s,r){if(!Number.isSafeInteger(n)||n<0||n>r.maxSnapshotBytes)throw new Error(`Command output exceeds the ${r.maxSnapshotBytes}-byte snapshot limit.`);H(t,()=>{$t(t,e,n,s,r)})}function $t(t,e,n,s,r){if(!Number.isSafeInteger(n)||n<0||n>r.maxSnapshotBytes)throw new Error(`Command output exceeds the ${r.maxSnapshotBytes}-byte snapshot limit.`);let a=Te(t),o=a.find(g=>g.snapshotId===e),i=a.reduce((g,c)=>g+c.reservedBytes,0)-(o?.reservedBytes??0)+n,p=a.length+(o?0:1);if(p>r.maxSnapshotCount||i>r.maxAggregateBytes)throw new Error(`Output snapshot capacity is full (${p}/${r.maxSnapshotCount} snapshots, ${i}/${r.maxAggregateBytes} bytes). Narrow the query or finish an existing pagination sequence before retrying.`);let h=Date.now(),d={version:At,snapshotId:e,pid:process.pid,...G()?{processIdentity:G()}:{},reservedBytes:n,state:s,createdAtMs:o?.createdAtMs??h,updatedAtMs:h};j(O(t,e,"reserve"),d)}function Ee(t,e){H(t,()=>{X(O(t,e,"reserve"),{force:!0})})}function Te(t){let e=[];for(let n of Ot(t,{withFileTypes:!0})){if(!n.isFile()||!n.name.endsWith(".reserve"))continue;let s=n.name.slice(0,-8);if(v(s))try{let r=JSON.parse(A(_(t,n.name),"output snapshot reservation"));if(!Ht(r)||r.snapshotId!==s)throw new Error("reservation identity is invalid");e.push(r)}catch(r){throw new Error(`Output snapshot reservation ${n.name} is invalid; retry after its owning process or snapshot expires.`,{cause:r})}}return e}function Ht(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===At&&typeof e.snapshotId=="string"&&v(e.snapshotId)&&Number.isSafeInteger(e.pid)&&(e.pid??0)>0&&(e.processIdentity===void 0||nt(e.processIdentity)!==null&&e.processIdentity.pid===e.pid)&&Number.isSafeInteger(e.reservedBytes)&&(e.reservedBytes??-1)>=0&&(e.state==="active"||e.state==="complete")&&Number.isSafeInteger(e.createdAtMs)&&Number.isSafeInteger(e.updatedAtMs)}function xe(t){let e=Date.now();for(let n of Ot(t,{withFileTypes:!0})){if(!n.isFile()||!n.name.endsWith(".reserve"))continue;let s=n.name.slice(0,-8);if(!v(s))continue;let r=null;try{let p=JSON.parse(A(_(t,n.name),"output snapshot reservation"));r=Ht(p)?p:null}catch{r=null}let a=_e(O(t,s,"json")),o=r?.state==="active"&&et(r.pid)&&(r.processIdentity===void 0||(()=>{let p=z(r.pid);return p!==null&&rt(r.processIdentity,p)})()),i=r?e-r.updatedAtMs>Et:!1;o||a&&!i||!a&&r&&!i&&r.state==="complete"||Mt(s,t)}}function _e(t){try{return Qt(t),!0}catch{return!1}}function H(t,e){K(t);let n=_(t,ce),s=Date.now()+pe;for(;;){let r=st(n,{kind:"output-snapshot-quota",processIdentity:G()});if(r.kind==="acquired")try{return e()}finally{r.lock.release()}if(Date.now()>=s)throw new Error("Output snapshot quota is busy. Retry the command.");Atomics.wait(de,0,0,he)}}function G(){return D===void 0&&(D=z(process.pid)),D}function b(t,e){v(t)&&H(e,()=>Mt(t,e))}function Mt(t,e){for(let n of["json","output","tmp","reserve"])X(O(e,t,n),{force:!0})}function O(t,e,n){if(!v(e))throw new Error("Output snapshot identifier is invalid.");return _(t,`${e}.${n}`)}function Ae(t){if(!t)throw new Error("Incomplete output did not create a resumable snapshot.");return t}function ft(t){return t>=55296&&t<=56319}function Ne(t,e,n,s){let r=Math.min(t.length,e);if(ft(t.charCodeAt(r-1))&&(r-=1),Buffer.byteLength(t.slice(0,r))>n){let a=0,o=r;for(;a<o;){let i=Math.ceil((a+o)/2);Buffer.byteLength(t.slice(0,i))<=n?a=i:o=i-1}r=a,ft(t.charCodeAt(r-1))&&(r-=1)}if(r<=0)throw new Error("Output page byte limit cannot contain one UTF-8 character.");if(s){let a=t.lastIndexOf(`
|
|
6
|
-
`,r-1);if(a>=0)return a+1}return r}function Ue(t){let e=Be({pageIndex:t.nextPageIndex,snapshotId:t.snapshotId});return{cursor:e,command:Vt(t.invocationPrefix,e)}}function Le(t,e){let n="c".repeat(64),s={cursor:n,command:Vt(e,n)};if(!t.json){let o="9".repeat(String(l).length),i=`[scip-query output page: characters ${o}-${o} of ${o}]
|
|
7
|
-
|
|
8
|
-
[Incomplete: ${o} characters remain. Continue exactly:
|
|
9
|
-
${s.command}]
|
|
10
|
-
`;return mt(ot,Buffer.byteLength(i),1)}let r={kind:vt,schemaVersion:bt,producer:{name:"scip-query",version:t.producerVersion},command:t.command,contentType:"application/json",agentInstruction:"INCOMPLETE EVIDENCE: do not draw conclusions or report completion from this partial page. Run page.continuation.command exactly, then repeat until page.complete is true.",page:{offset:l,returnedCharacters:l,totalCharacters:l,omittedCharacters:l,remainingCharacters:l,complete:!1,outputHash:"f".repeat(64),continuation:s},content:""},a=Buffer.byteLength(`${JSON.stringify(r)}
|
|
11
|
-
`);return mt(V,a,2)}function mt(t,e,n){let s=Math.floor((N-e)/n);if(s<S)throw new Error(`The command invocation leaves fewer than ${S} bytes for client-safe output content. Use a shorter executable path.`);return Math.min(t,s)}function Be(t){return _t.test(t.snapshotId)?t.pageIndex===1?t.snapshotId:`${t.snapshotId}.${t.pageIndex.toString(36)}`:`4.${He(t.snapshotId)}.${t.pageIndex.toString(36)}`}function Re(t,e){let n=kt(t);if(!n)throw new Error("Invalid output cursor. Run the command again without --output-cursor.");if(n.version===3&&n.invocationHash!==e)throw new Error("This output cursor belongs to a different command, working directory, or argument set. Run again without --output-cursor.");return n}function kt(t){let e=ue.exec(t);if(e){let s=e[2]??"1",r=Number.parseInt(s,36);return Number.isSafeInteger(r)&&r>=1&&r.toString(36)===s?{version:4,pageIndex:r,snapshotId:e[1]}:null}let n=ie.exec(t);if(n){let s=Me(n[1]),r=Number.parseInt(n[2],36);return s&&Number.isSafeInteger(r)&&r>=1&&r.toString(36)===n[2]?{version:4,pageIndex:r,snapshotId:s}:null}try{let s=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return $e(s)?s:null}catch{return null}}function $e(t){if(!t||typeof t!="object")return!1;let e=t;return e.version===3&&I(e.invocationHash)&&Number.isSafeInteger(e.pageIndex)&&(e.pageIndex??-1)>=1&&Number.isSafeInteger(e.pageSize)&&(e.pageSize??0)>=S&&(e.pageSize??0)<=E&&I(e.outputHash)&&typeof e.snapshotId=="string"&&v(e.snapshotId)}function He(t){if(!Q.test(t))throw new Error("Output snapshot identifier is invalid.");return Buffer.from(t.replaceAll("-",""),"hex").toString("base64url")}function Me(t){let e=Buffer.from(t,"base64url");if(e.length!==16)return null;let n=e.toString("hex"),s=`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`;return Q.test(s)?s:null}function v(t){return typeof t=="string"&&(_t.test(t)||Q.test(t))}function zt(t,e,n,s){return T("sha256").update(JSON.stringify({command:t,cwd:e,invocationPrefix:n,argv:s})).digest("hex")}function jt(t){let e=[];for(let n=0;n<t.length;n+=1){let s=t[n];if(s==="--output-page-size"||s==="--output-cursor"){n+=1;continue}s.startsWith("--output-page-size=")||s.startsWith("--output-cursor=")||e.push(s)}return e}function ke(t){return t.filter(e=>e!=="--raw-json"&&e!=="--raw-json=true")}function qt(t,e,n){return Ft([...t,...e,"--output-page-size",String(n)])}function Vt(t,e){return Ft([...t,ee,e])}function Dt(t){let e=t===void 0?["scip-query"]:[...t];if(!Jt(e))throw new Error("Output pagination invocation prefix must contain one to sixteen non-empty shell arguments.");return e}function Jt(t){return Array.isArray(t)&&t.length>0&&t.length<=16&&t.every(e=>typeof e=="string"&&e.length>0&&e.length<=2048&&!e.includes("\0")&&!e.includes("\r")&&!e.includes(`
|
|
12
|
-
`))}function ze(t){return Array.isArray(t)&&t.length>0&&t.length<=256&&t.every(e=>typeof e=="string"&&e.length<=8192&&!e.includes("\0")&&!e.includes("\r")&&!e.includes(`
|
|
13
|
-
`))}function Ft(t){return t.map(e=>ut(e,{omitSafeQuotes:!0})).join(" ")}function je(t){let e=t.page.continuation,n=Math.max(t.page.offset,t.page.offset+t.page.returnedCharacters-1),s=`[scip-query output page: characters ${t.page.offset}-${n} of ${t.page.totalCharacters}]
|
|
14
|
-
`,r=e?`
|
|
15
|
-
[Incomplete: ${t.page.remainingCharacters} characters remain. Continue exactly:
|
|
16
|
-
${e.command}]
|
|
17
|
-
`:`
|
|
18
|
-
[scip-query transport complete; evaluate command coverage separately]
|
|
19
|
-
`;return`${s}${t.content}${r}`}export{ee as a,fe as b,un as c,cn as d};
|
|
20
|
-
//# sourceMappingURL=chunk-RBLQNW26.js.map
|
package/dist/chunk-RTQ7NEKG.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import{d as y}from"./chunk-GUFSG5TX.js";import{c as g}from"./chunk-IW5XQG5G.js";import{createHash as C}from"crypto";import{existsSync as A,mkdirSync as F}from"fs";import{dirname as T,join as b}from"path";import _ from"better-sqlite3";var O="evidence.db";var w=["source-facts","definition-exclusions","doc-path-tokens","react-component-behavior-profiles"],h=new Set(w),I=25e4,x=512*1024*1024,k=6e4,u=new WeakMap,M=g("evidence-content-hash",{clearGroups:["whole-project","source-file"]}),j=g("evidence-project-fingerprint",{clearGroups:["whole-project"]}),s="evidence-v1",d="version NOT LIKE 'evidence-%'";function N(r){return C("sha256").update(r).digest("hex")}function Y(r,n,e){return M.get(r,n,()=>N(e))}function V(r){return j.get(r,"current",()=>{try{if(!r.generation.metadataRaw)return null;let n=y(r.generation.metadataRaw);if(n.kind!=="legacy"&&n.kind!=="supported"||!n.capabilities.usableForEvidenceCache)return null;let e=n.metadata,a=[...e.indexedLanguages??[]].sort();return N(JSON.stringify({fingerprint:e.fingerprint,indexedLanguages:a,status:e.status}))}catch(n){return E("project fingerprint unavailable",n),null}})}function E(r,n){process.env.SCIP_QUERY_DEBUG&&console.error(`evidence-cache: ${r}: ${n instanceof Error?n.message:String(n)}`)}function o(r){if(u.has(r))return u.get(r)??null;let n=null;try{let e=new _(r.config.evidenceDbPath??b(T(r.config.dbPath),O));e.pragma("journal_mode = WAL"),e.pragma("busy_timeout = 5000"),e.pragma("synchronous = NORMAL"),e.exec(`
|
|
2
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
3
|
-
kind TEXT NOT NULL,
|
|
4
|
-
relative_path TEXT NOT NULL,
|
|
5
|
-
content_hash TEXT NOT NULL,
|
|
6
|
-
version TEXT NOT NULL,
|
|
7
|
-
payload TEXT NOT NULL,
|
|
8
|
-
PRIMARY KEY (kind, relative_path)
|
|
9
|
-
);
|
|
10
|
-
CREATE TABLE IF NOT EXISTS project_evidence (
|
|
11
|
-
kind TEXT NOT NULL,
|
|
12
|
-
cache_key TEXT NOT NULL,
|
|
13
|
-
project_fingerprint TEXT NOT NULL,
|
|
14
|
-
version TEXT NOT NULL,
|
|
15
|
-
payload TEXT NOT NULL,
|
|
16
|
-
PRIMARY KEY (kind, cache_key)
|
|
17
|
-
);
|
|
18
|
-
CREATE TABLE IF NOT EXISTS semantic_callees (
|
|
19
|
-
relative_path TEXT NOT NULL,
|
|
20
|
-
symbol TEXT NOT NULL,
|
|
21
|
-
content_hash TEXT NOT NULL,
|
|
22
|
-
deps_digest TEXT NOT NULL,
|
|
23
|
-
version TEXT NOT NULL,
|
|
24
|
-
payload TEXT NOT NULL,
|
|
25
|
-
PRIMARY KEY (relative_path, symbol)
|
|
26
|
-
);
|
|
27
|
-
CREATE TABLE IF NOT EXISTS semantic_references (
|
|
28
|
-
relative_path TEXT NOT NULL,
|
|
29
|
-
symbol TEXT NOT NULL,
|
|
30
|
-
project_fingerprint TEXT NOT NULL,
|
|
31
|
-
version TEXT NOT NULL,
|
|
32
|
-
payload TEXT NOT NULL,
|
|
33
|
-
PRIMARY KEY (relative_path, symbol)
|
|
34
|
-
);
|
|
35
|
-
`),n={evidence:e,shared:U(r.config.sharedEvidenceDbPath),readFileEvidence:e.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),readLegacyFileEvidence:e.prepare(`SELECT payload FROM file_evidence
|
|
36
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${d}
|
|
37
|
-
ORDER BY version DESC
|
|
38
|
-
LIMIT 1`),existsFileEvidence:e.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsLegacyFileEvidence:e.prepare(`SELECT 1 AS present FROM file_evidence
|
|
39
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND ${d}
|
|
40
|
-
LIMIT 1`),writeFileEvidence:e.prepare("INSERT OR REPLACE INTO file_evidence (kind, relative_path, content_hash, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyFileEvidence:e.prepare("UPDATE file_evidence SET content_hash = ?, version = ? WHERE kind = ? AND relative_path = ? AND content_hash = ?"),readProjectEvidence:e.prepare("SELECT payload FROM project_evidence WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND version = ?"),readLegacyProjectEvidence:e.prepare(`SELECT payload FROM project_evidence
|
|
41
|
-
WHERE kind = ? AND cache_key = ? AND project_fingerprint = ? AND ${d}
|
|
42
|
-
ORDER BY version DESC
|
|
43
|
-
LIMIT 1`),writeProjectEvidence:e.prepare("INSERT OR REPLACE INTO project_evidence (kind, cache_key, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)"),rekeyProjectEvidenceKind:e.prepare("UPDATE project_evidence SET project_fingerprint = ?, version = ? WHERE kind = ? AND project_fingerprint = ?"),readCallees:e.prepare(`SELECT payload FROM semantic_callees
|
|
44
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCallees:e.prepare(`SELECT payload FROM semantic_callees
|
|
45
|
-
WHERE relative_path = ? AND symbol = ? AND content_hash = ? AND deps_digest = ? AND ${d}
|
|
46
|
-
ORDER BY version DESC
|
|
47
|
-
LIMIT 1`),readCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
48
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND version = ?`),readLegacyCalleesForFile:e.prepare(`SELECT symbol, payload FROM semantic_callees
|
|
49
|
-
WHERE relative_path = ? AND content_hash = ? AND deps_digest = ? AND ${d}
|
|
50
|
-
ORDER BY symbol, version DESC`),writeCallees:e.prepare(`INSERT OR REPLACE INTO semantic_callees
|
|
51
|
-
(relative_path, symbol, content_hash, deps_digest, version, payload) VALUES (?, ?, ?, ?, ?, ?)`),dropStaleCallees:e.prepare("DELETE FROM semantic_callees WHERE relative_path = ? AND content_hash != ?"),readReferences:e.prepare(`SELECT payload FROM semantic_references
|
|
52
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferences:e.prepare(`SELECT payload FROM semantic_references
|
|
53
|
-
WHERE relative_path = ? AND symbol = ? AND project_fingerprint = ? AND ${d}
|
|
54
|
-
ORDER BY version DESC
|
|
55
|
-
LIMIT 1`),readReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
|
|
56
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND version = ?`),readLegacyReferencesForFile:e.prepare(`SELECT symbol, payload FROM semantic_references
|
|
57
|
-
WHERE relative_path = ? AND project_fingerprint = ? AND ${d}
|
|
58
|
-
ORDER BY symbol, version DESC`),writeReferences:e.prepare(`INSERT OR REPLACE INTO semantic_references
|
|
59
|
-
(relative_path, symbol, project_fingerprint, version, payload) VALUES (?, ?, ?, ?, ?)`),dropStaleReferences:e.prepare("DELETE FROM semantic_references WHERE relative_path = ? AND project_fingerprint != ?")}}catch(e){E("disabled (open failed)",e)}return u.set(r,n),n}function l(r,n,e){E(`disabled (${n})`,e),u.set(r,null)}function U(r){if(!r)return null;try{F(T(r),{recursive:!0});let n=new _(r);return n.pragma("journal_mode = WAL"),n.pragma("busy_timeout = 250"),n.pragma("synchronous = NORMAL"),n.exec(`
|
|
60
|
-
CREATE TABLE IF NOT EXISTS file_evidence (
|
|
61
|
-
kind TEXT NOT NULL,
|
|
62
|
-
relative_path TEXT NOT NULL,
|
|
63
|
-
content_hash TEXT NOT NULL,
|
|
64
|
-
version TEXT NOT NULL,
|
|
65
|
-
payload TEXT NOT NULL,
|
|
66
|
-
last_accessed_at INTEGER NOT NULL,
|
|
67
|
-
PRIMARY KEY (kind, relative_path, content_hash, version)
|
|
68
|
-
);
|
|
69
|
-
CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
|
|
70
|
-
ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version);
|
|
71
|
-
`),{evidence:n,readFileEvidence:n.prepare("SELECT payload FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),existsFileEvidence:n.prepare("SELECT 1 AS present FROM file_evidence WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?"),writeFileEvidence:n.prepare(`INSERT INTO file_evidence (kind, relative_path, content_hash, version, payload, last_accessed_at)
|
|
72
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
73
|
-
ON CONFLICT(kind, relative_path, content_hash, version)
|
|
74
|
-
DO UPDATE SET payload = excluded.payload, last_accessed_at = excluded.last_accessed_at`),touchFileEvidence:n.prepare(`UPDATE file_evidence
|
|
75
|
-
SET last_accessed_at = ?
|
|
76
|
-
WHERE kind = ? AND relative_path = ? AND content_hash = ? AND version = ?
|
|
77
|
-
AND last_accessed_at < ?`)}}catch(n){return E("shared cache disabled (open failed)",n),null}}function v(r,n,e){E(`shared cache disabled (${n})`,e);try{r.shared?.evidence.close()}catch{}r.shared=null}function $(r,n={}){if(!A(r))return null;let e;try{e=new _(r),e.pragma("busy_timeout = 50"),e.exec(`CREATE INDEX IF NOT EXISTS idx_file_evidence_lru
|
|
78
|
-
ON file_evidence(last_accessed_at, kind, relative_path, content_hash, version)`),e.pragma("wal_checkpoint(TRUNCATE)");let a=e.prepare("SELECT COUNT(*) AS count FROM file_evidence").get().count,t=n.maxRows??I,i=n.budgetBytes??x,c=Number(e.pragma("page_size",{simple:!0})),S=Number(e.pragma("page_count",{simple:!0})),R=Number(e.pragma("freelist_count",{simple:!0})),f=Math.max(0,S-R)*c,L=a>0&&f>i?Math.min(a,Math.ceil((f-i)/Math.max(1,f/a))):0,p=Math.max(a-t,L);return p>0&&(e.prepare(`DELETE FROM file_evidence WHERE rowid IN (
|
|
79
|
-
SELECT rowid FROM file_evidence ORDER BY last_accessed_at ASC, rowid ASC LIMIT ?
|
|
80
|
-
)`).run(p),e.pragma("wal_checkpoint(TRUNCATE)")),{deletedRows:p,remainingRows:a-p}}catch(a){return E("shared cache maintenance skipped",a),null}finally{try{e?.close()}catch{}}}function G(r,n,e,a){let t=o(r);if(!t)return null;try{let i=t.readFileEvidence.get(n,e,a,s)??t.readLegacyFileEvidence.get(n,e,a);if(i?.payload!==void 0)return i.payload;if(!h.has(n)||!t.shared)return null;try{let c=t.shared.readFileEvidence.get(n,e,a,s);return c?.payload!==void 0&&D(t.shared,n,e,a),c?.payload??null}catch(c){return v(t,"file_evidence read",c),null}}catch(i){return l(r,"file_evidence read",i),null}}function J(r,n,e,a){let t=o(r);if(!t)return!1;try{if((t.existsFileEvidence.get(n,e,a,s)??t.existsLegacyFileEvidence.get(n,e,a))?.present!==void 0)return!0;if(!h.has(n)||!t.shared)return!1;try{return t.shared.existsFileEvidence.get(n,e,a,s)?.present===void 0?!1:(D(t.shared,n,e,a),!0)}catch(c){return v(t,"file_evidence exists",c),!1}}catch(i){return l(r,"file_evidence exists",i),!1}}function D(r,n,e,a){let t=Date.now();try{r.touchFileEvidence.run(t,n,e,a,s,t-k)}catch(i){E("shared file_evidence recency touch skipped",i)}}function z(r,n,e,a,t){let i=o(r);if(i)try{if(i.writeFileEvidence.run(n,e,a,s,t),h.has(n)&&i.shared)try{i.shared.writeFileEvidence.run(n,e,a,s,t,Date.now())}catch(c){v(i,"file_evidence write",c)}}catch(c){l(r,"file_evidence write",c)}}function Q(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{for(let t of n)e.writeFileEvidence.run(t.kind,t.relativePath,t.contentHash,s,t.payload)})();try{e.evidence.pragma("wal_checkpoint(TRUNCATE)")}catch{}let a=n.filter(t=>h.has(t.kind));if(a.length>0&&e.shared)try{e.shared.evidence.transaction(()=>{for(let t of a)e.shared.writeFileEvidence.run(t.kind,t.relativePath,t.contentHash,s,t.payload,Date.now())})()}catch(t){v(e,"file_evidence batch write",t)}}catch(a){l(r,"file_evidence batch write",a)}}function q(r,n,e,a){let t=o(r);if(!t)return null;try{return(t.readProjectEvidence.get(n,e,a,s)??t.readLegacyProjectEvidence.get(n,e,a))?.payload??null}catch(i){return l(r,"project_evidence read",i),null}}function Z(r,n,e,a,t){let i=o(r);if(i)try{i.writeProjectEvidence.run(n,e,a,s,t)}catch(c){l(r,"project_evidence write",c)}}function ee(r,n,e,a){if(e===a)return 0;let t=o(r);if(!t)return 0;try{return t.rekeyProjectEvidenceKind.run(a,s,n,e).changes}catch(i){return l(r,"project_evidence kind rekey",i),0}}function ne(r,n,e,a){let t=o(r);if(!t)return new Map;try{let i=t.readCalleesForFile.all(n,e,a,s),c=t.readLegacyCalleesForFile.all(n,e,a);return m([...c,...i])}catch(i){return l(r,"semantic_callees bulk read",i),new Map}}function te(r,n,e){let a=o(r);if(!a)return new Map;try{let t=a.readReferencesForFile.all(n,e,s),i=a.readLegacyReferencesForFile.all(n,e);return m([...i,...t])}catch(t){return l(r,"semantic_references bulk read",t),new Map}}function m(r){let n=new Map;for(let e of r)n.set(e.symbol,e.payload);return n}function re(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let t of n){let i=`${t.relativePath}\0${t.contentHash}`;a.has(i)||(a.add(i),e.dropStaleCallees.run(t.relativePath,t.contentHash)),e.writeCallees.run(t.relativePath,t.symbol,t.contentHash,t.depsDigest,s,t.payload)}})()}catch(a){l(r,"semantic_callees write",a)}}function ae(r,n){if(n.length===0)return;let e=o(r);if(e)try{e.evidence.transaction(()=>{let a=new Set;for(let t of n){let i=`${t.relativePath}\0${t.projectFingerprint}`;a.has(i)||(a.add(i),e.dropStaleReferences.run(t.relativePath,t.projectFingerprint)),e.writeReferences.run(t.relativePath,t.symbol,t.projectFingerprint,s,t.payload)}})()}catch(a){l(r,"semantic_references write",a)}}function ce(r){return typeof r=="object"&&r!==null}function se(r){return Array.isArray(r)&&r.every(n=>typeof n=="string")?r:null}export{O as a,N as b,Y as c,V as d,$ as e,G as f,J as g,z as h,Q as i,q as j,Z as k,ee as l,ne as m,te as n,re as o,ae as p,ce as q,se as r};
|
|
81
|
-
//# sourceMappingURL=chunk-RTQ7NEKG.js.map
|
package/dist/chunk-SQXRS7BG.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as i}from"./chunk-EKV5HX33.js";import{a as o}from"./chunk-2GRUZAQF.js";import{Y as l}from"./chunk-3L2ZBPEX.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
|
|
2
|
-
WHERE relative_path IN (${a})
|
|
3
|
-
ORDER BY relative_path`,...s).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)),p=l(e,n,{onlyDocumented:!0,sort:!0}).map(({relativePath:t,...f})=>f),m=o(e,"forward",s).filter(t=>!e.isIgnored(t)),d=o(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:n,symbols:p,dependsOn:m,dependedOnBy:d}}function g(e,r){return y(e,r)}export{y as a,g as b};
|
|
4
|
-
//# sourceMappingURL=chunk-SQXRS7BG.js.map
|
package/dist/chunk-SSK6LDPC.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Ie,i as De,j as W}from"./chunk-4WNW27SX.js";import{c as we,h as Ae}from"./chunk-GAS2LJMP.js";import{a as Me,e as he,i as Ee}from"./chunk-DRENNWRG.js";import{d as A,f as k,h as ke,j as q,k as U,l as xe}from"./chunk-FGA2U4OR.js";import{a as be}from"./chunk-B3PYOSCX.js";import{a as S,c as ye,d as M,e as p,f as Q,g as J,i as Se}from"./chunk-H5EXS3HM.js";import{a as C,e as X,g as v}from"./chunk-HGFDYOVB.js";import{a as fe,b as Re,c as me,d as w}from"./chunk-JFMEXGFE.js";import{ca as ge}from"./chunk-KYSDI3GE.js";import{a as ce,b as E,c as de,f as pe,g as x,l as $}from"./chunk-7F45LJKI.js";import{createHash as cn}from"crypto";import{resolve as dn}from"path";var b=3;function F(e){return cn("sha256").update(A({kind:"scip-query-durable-rust-mailbox",protocolVersion:b,sessionDir:dn(e)})).digest("hex")}function pn(e,n){if(!S(e)||typeof e.id!="string"||!e.id)return T("Durable Rust semantic helper received an invalid mailbox request.");if(e.id!==n.claimRequestId)return T("Durable Rust semantic request identity does not match its mailbox path.");if(e.protocolVersion===void 0){if(e.mailboxVersion!==void 0||e.operationKey!==void 0||e.clientId!==void 0||e.enqueuedAtMs!==void 0||e.deadlineAtMs!==void 0||e.sessionIdentity!==void 0)return T("Durable Rust semantic helper received a partially versioned request without a protocol version.");let s=_e(e.request);if(!s)return T("Durable Rust semantic helper received an invalid legacy request kind or payload.");let i=n.nowMs+Math.max(1,s.timeoutMs);return{ok:!0,compatibility:"legacy-v2",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:q("rust-semantic-v2",{id:e.id,request:s}),clientId:"legacy-v2",enqueuedAtMs:n.nowMs,deadlineAtMs:i,sessionIdentity:n.sessionIdentity,request:s}}}let t=fn(e,n);if(!t.ok)return t;if(e.protocolVersion!==b)return{ok:!1,code:"unsupported-protocol",error:`Durable Rust semantic helper does not support mailbox protocol ${String(e.protocolVersion)}.`,responseIdentity:t.responseIdentity};let r=_e(e.request);return r?t.operationKey!==q("rust-semantic-v3",r)?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a mismatched mailbox operation identity.",responseIdentity:t.responseIdentity}:t.deadlineAtMs-t.enqueuedAtMs!==r.timeoutMs?{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received a deadline that does not match the request timeout.",responseIdentity:t.responseIdentity}:t.deadlineAtMs<n.nowMs?{ok:!1,code:"expired-request",error:"Durable Rust semantic request expired before processing.",responseIdentity:t.responseIdentity}:{ok:!0,compatibility:t.priorSessionIdentity?"prior-v3":"current-v3",value:{mailboxVersion:k,protocolVersion:b,id:e.id,operationKey:t.operationKey,clientId:t.clientId,enqueuedAtMs:t.enqueuedAtMs,deadlineAtMs:t.deadlineAtMs,sessionIdentity:n.sessionIdentity,request:r}}:{ok:!1,code:"malformed-request",error:"Durable Rust semantic helper received an invalid request kind or payload.",responseIdentity:t.responseIdentity}}function ne(e,n){return S(e)?e.protocolVersion!==b?ve(e.protocolVersion===void 0?"helper wrote a prior uncorrelated response protocol":`helper wrote unsupported response protocol ${String(e.protocolVersion)}`):e.mailboxVersion!==k||e.id!==n.requestId||e.operationKey!==n.operationKey||e.sessionIdentity!==n.sessionIdentity||e.deadlineAtMs!==n.deadlineAtMs?ve("helper wrote an incompatible response identity"):typeof e.completedAtMs!="number"||!Number.isFinite(e.completedAtMs)||e.completedAtMs>n.deadlineAtMs||n.nowMs>n.deadlineAtMs?{ok:!1,code:"expired-request",error:"helper response arrived after the durable request deadline"}:e.ok===!1?typeof e.error!="string"||!In(e.errorCode)?Z("helper wrote an invalid rejection response"):{ok:!1,code:e.errorCode,error:e.error}:e.ok!==!0||e.session!=="created"&&e.session!=="reused"&&e.session!=="invalidated"||!Sn(e.response,n.requestKind)?Z("helper wrote an invalid success response"):{ok:!0,session:e.session,response:e.response}:Z("helper wrote an invalid response object")}function fn(e,n){if(e.mailboxVersion!==k||typeof e.protocolVersion!="number"||!Number.isInteger(e.protocolVersion)||typeof e.operationKey!="string"||!J(e.operationKey)||e.id!==U(e.operationKey)||typeof e.clientId!="string"||!e.clientId||typeof e.enqueuedAtMs!="number"||!Number.isFinite(e.enqueuedAtMs)||typeof e.deadlineAtMs!="number"||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs||e.sessionIdentity!==void 0&&(typeof e.sessionIdentity!="string"||!J(e.sessionIdentity))||e.sessionIdentity===void 0&&e.protocolVersion!==b)return T("Durable Rust semantic helper received an invalid mailbox lifecycle.");let t={id:n.claimRequestId,sessionIdentity:n.sessionIdentity,deadlineAtMs:e.deadlineAtMs};return e.sessionIdentity!==void 0&&e.sessionIdentity!==n.sessionIdentity?{ok:!1,code:"malformed-request",error:"Durable Rust semantic request belongs to a different mailbox session.",responseIdentity:t}:{ok:!0,responseIdentity:t,operationKey:e.operationKey,clientId:e.clientId,enqueuedAtMs:e.enqueuedAtMs,deadlineAtMs:e.deadlineAtMs,priorSessionIdentity:e.sessionIdentity===void 0}}function _e(e){return!S(e)||typeof e.identityKey!="string"||!e.identityKey||!Q(e.timeoutMs)||e.workerEnvironment!==void 0&&!ye(e.workerEnvironment)?null:e.kind==="semantic"&&Rn(e.request)?{kind:"semantic",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:e.kind==="import-definitions"&&mn(e.request)?{kind:"import-definitions",identityKey:e.identityKey,...e.workerEnvironment===void 0?{}:{workerEnvironment:e.workerEnvironment},request:e.request,timeoutMs:e.timeoutMs}:null}function Rn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!Te(e.definitions)?!1:G(e.referenceDefinitions)&&G(e.calleeDefinitions)&&G(e.signatureDefinitions)&&I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.referenceRetryTimeoutMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)&&ee(e.includeReferences)&&ee(e.includeCallees)&&ee(e.includeSignatures)}function mn(e){return!S(e)||!M(e.projectRoot)||!M(e.rustAnalyzerBinary)||!M(e.file)||!Array.isArray(e.positions)||!e.positions.every(n=>S(n)&&M(n.id)&&M(n.file)&&p(n.line)&&p(n.column))?!1:I(e.requestTimeoutMs)&&I(e.readinessDeadlineMs)&&I(e.diagnosticsTimeoutMs)&&I(e.settleDelayMs)&&Pe(e.concurrency)}function Te(e){return Array.isArray(e)&&e.every(yn)}function G(e){return e===void 0||Te(e)}function yn(e){return S(e)&&p(e.symbolId)&&p(e.documentId)&&p(e.startLine)&&qe(e.startChar)&&p(e.endLine)&&qe(e.endChar)&&typeof e.symbol=="string"&&typeof e.relativePath=="string"&&typeof e.leaf=="string"&&(e.parentTypeName===null||typeof e.parentTypeName=="string")&&typeof e.isFunctionLike=="boolean"&&typeof e.isTypeLike=="boolean"&&(e.kind===null||Number.isSafeInteger(e.kind))&&(e.documentation===null||typeof e.documentation=="string")&&(e.enclosingSymbol===null||typeof e.enclosingSymbol=="string")}function Sn(e,n){return!S(e)||typeof e.available!="boolean"||e.available===!1&&(typeof e.reason!="string"||e.reason.length===0)||e.available===!0&&e.reason!==void 0?!1:n==="import-definitions"?Array.isArray(e.sourcePaths)&&e.sourcePaths.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"&&(t[1]===null||typeof t[1]=="string")):Ce(e.references,bn)&&(e.incompleteReferenceSymbolIds===void 0||Array.isArray(e.incompleteReferenceSymbolIds)&&e.incompleteReferenceSymbolIds.every(t=>Number.isSafeInteger(t)))&&(e.callees===void 0||Ce(e.callees,gn))&&(e.signatures===void 0||Array.isArray(e.signatures)&&e.signatures.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&(t[1]===null||typeof t[1]=="string")))}function Ce(e,n){return Array.isArray(e)&&e.every(t=>Array.isArray(t)&&t.length===2&&Number.isSafeInteger(t[0])&&Array.isArray(t[1])&&t[1].every(n))}function bn(e){return S(e)&&typeof e.file=="string"&&p(e.line)&&p(e.column)}function gn(e){return S(e)&&typeof e.symbol=="string"&&typeof e.file=="string"&&p(e.line)&&(e.callsiteLine===void 0||p(e.callsiteLine))}function In(e){return e==="unsupported-protocol"||e==="malformed-request"||e==="expired-request"||e==="handler-error"}function T(e){return{ok:!1,code:"malformed-request",error:e}}function Z(e){return{ok:!1,code:"malformed-response",error:e}}function ve(e){return{ok:!1,code:"incompatible-response",error:e}}function Pe(e){return e===void 0||Q(e)}function qe(e){return e===void 0||p(e)}function I(e){return e===void 0||Se(e)}function ee(e){return e===void 0||typeof e=="boolean"}import{spawn as Tn}from"child_process";import{createHash as Pn,randomUUID as Bn}from"crypto";import{existsSync as He,realpathSync as Nn,rmSync as On}from"fs";import{tmpdir as Un}from"os";import{resolve as _}from"path";import{execFileSync as An}from"child_process";import{existsSync as Dn}from"fs";import{deserializeSCIP as Mn,SymbolRole as hn}from"@c4312/scip";var te=new WeakMap,En="SCIP_RUST_SCIP_OCCURRENCE_REFERENCE_MODE";function kt(e,n){let t=new Map,r=L(),s=n.filter(u=>Ne(u,r));if(s.length===0)return t;let i=Oe(e);if(!i)return t;for(let u of s){let l=Be(i,u);l!==null&&t.set(u.symbolId,l)}return t}function xt(e,n){if(!Ne(n,L()))return null;let t=Oe(e);return t?Be(t,n):null}function Be(e,n){return e.referencesBySymbol.get(n.symbol)??[]}function Ne(e,n="safe"){if(!e.symbol.startsWith("rust-analyzer ")||!e.relativePath.endsWith(".rs")||Ee(e.symbol)||/impl#\[[^\]]+\]\[Default\]default\(\)\.$/.test(e.symbol))return!1;if(n==="all")return!0;let t=he(e.symbol);if(t==="method")return!0;if(t!=="term")return!1;let r=Me(e.symbol);return"kind"in r?!1:!kn(r)}function kn(e){for(let n=0;n<e.descriptors.length-1;n+=1)if(e.descriptors[n]?.suffix==="type")return!0;return!1}function Oe(e){if(te.has(e))return te.get(e)??null;let n=xn(e);return te.set(e,n),n}function xn(e){if(!e.generation.indexPath||!Dn(e.generation.indexPath))return null;try{let n=Mn(pe(e.generation.indexPath,{inputKind:"SCIP occurrence-reference index",maxBytes:de})),t=new Map;for(let r of n.documents??[]){let s=r.relativePath;if(!(!s||e.isIgnored(s)))for(let i of r.occurrences??[]){if(!i.symbol||(i.symbolRoles&hn.Definition)!==0)continue;let u=wn(s,i.range);if(!u)continue;let l=t.get(i.symbol)??[];l.push(u),t.set(i.symbol,l)}}for(let[r,s]of t)t.set(r,Ae(s));return{referencesBySymbol:t}}catch{return null}}function wn(e,n){if(n.length<3)return null;let t=n[0],r=n[1];return!Number.isInteger(t)||!Number.isInteger(r)?null:{file:e,line:t,column:r}}function L(){return process.env[En]==="all"?"all":"safe"}function Ue(e){let n=De(Ie,e),t=n.runnable;return t?{available:!0,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,note:"rust-analyzer semantic reference queries are enabled."}:{available:!1,dependencyAvailable:t,resolvedBinary:n.resolvedBinary??void 0,reason:"rust-analyzer is not runnable; Rust semantic checks will use SCIP/source evidence only."}}var We=new Map;function re(e){let t=Ue(e).resolvedBinary??null;return{engine:"rust-analyzer",resolvedBinary:t,version:t?_n(e,t):"unavailable"}}function Tt(e){return{...re(e),scipOccurrenceReferenceMode:L()}}function _n(e,n){let t=`${e}\0${n}`,r=We.get(t);if(r)return r;let s;try{s=An(n,["--version"],{cwd:e,encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim()}catch{s="unknown"}return We.set(t,s),s}import{createHash as Cn}from"crypto";var vn=new Set(["Cargo.lock","Cargo.toml","rust-project.json","rust-toolchain","rust-toolchain.toml"]);function Fe(e){let n=ge(e,{includePath:qn});return Cn("sha256").update(JSON.stringify(n)).digest("hex")}function qn(e){let n=e.replaceAll("\\","/"),t=n.split("/").at(-1)??n;return n.endsWith(".rs")||vn.has(t)?!0:n===".cargo/config"||n===".cargo/config.toml"||n.endsWith("/.cargo/config")||n.endsWith("/.cargo/config.toml")}var Wn=5e3,$e=10,Fn=3e4;function Le(e,n,t,r=en){let s=r.engineIdentity(e),i={protocolVersion:b,projectRoot:r.canonicalProjectRoot(e),projectFingerprint:r.projectFingerprint(e),engine:{engine:s.engine,resolvedBinary:s.resolvedBinary,version:s.version},workerFingerprint:r.fileFingerprint(n),environment:Je(r.environment())};return{key:se(A(i)),...i}}var je=class{constructor(n,t=Kn){this.createRequester=n;this.applyEnvironment=t}createRequester;applyEnvironment;requester=null;identityKey=null;semanticResponseCache=null;handle(n){this.applyEnvironment(n.workerEnvironment??{});let t;if(this.requester?this.identityKey!==n.identityKey?(this.semanticResponseCache=null,this.requester.shutdown(),this.requester=this.createRequester(),this.identityKey=n.identityKey,t="invalidated"):t="reused":(this.requester=this.createRequester(),this.identityKey=n.identityKey,t="created"),n.kind==="semantic"){let r=Ln(n.request),s=t==="reused"&&r!==null&&this.semanticResponseCache?.identityKey===n.identityKey&&this.semanticResponseCache.requestKey===r?this.semanticResponseCache.response:null;if(s)return Ke(!0,n.request.definitions.length),{session:t,response:s};let i=this.requester.requestSemantic(n.request,n.timeoutMs);return r!==null&&jn(i)&&(this.semanticResponseCache={identityKey:n.identityKey,requestKey:r,response:i}),Ke(!1,n.request.definitions.length),{session:t,response:i}}return{session:t,response:this.requester.requestImportDefinitions(n.request,n.timeoutMs)}}shutdown(){this.requester?.shutdown(),this.requester=null,this.identityKey=null,this.semanticResponseCache=null}};function Ln(e){if(e.includeReferences===!1||e.includeCallees!==!0||e.includeSignatures===!0||(e.referenceDefinitions?.length??0)===0||(e.calleeDefinitions?.length??0)===0)return null;let{readinessDeadlineMs:n,...t}=e;return se(A(t))}function jn(e){return e.available&&Array.isArray(e.callees)&&(e.incompleteReferenceSymbolIds?.length??0)===0}function Ke(e,n){C()&&v({type:"span",name:"rust.semantic.durable-session.response-cache",durationMs:0,ok:!0,hit:e,definitions:n})}function j(e,n,t,r){if(e.protocolVersion!==b||!t(e.pid))return!1;if(!e.processIdentity)return!0;let s=r?.(e.pid);return s!=null&&Re(e.processIdentity,s)}function Qe(e,n,t){let r;try{r=$(n,{maxBytes:E,inputKind:"Rust semantic engine artifact"})}catch{r="missing"}let s=se(A({projectRoot:_(e),serverPath:_(n),serverFingerprint:r})).slice(0,20);return _(t,`scip-query-rust-session-${s}`)}function ze(e){let n=e===void 0?Number.NaN:Number(e);return Number.isInteger(n)&&n>=0?n:0}function Je(e){return Object.fromEntries(Object.entries(e).filter(([n])=>Ge(n)).sort(([n],[t])=>n.localeCompare(t)).map(([n,t])=>[n,t??null]))}function Xe(e,n){let t=n.runtime??$n,r=n.identityRuntime??en,s=Qe(e,n.serverPath,n.tempRoot??Un()),i=!1,u=(l,d)=>{if(i)throw new Error("Durable Rust semantic session was already disposed.");return Vn(s,n.serverPath,n.semanticWorkerPath,l,d,t,n.mailboxLimits)};return{requestSemantic(l,d){let R=Le(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"semantic",identityKey:R.key,workerEnvironment:Ye(),request:{...o,referenceRetryTimeoutMs:zn(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,l.referenceRetryTimeoutMs),settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},requestImportDefinitions(l,d){let R=Le(e,n.semanticWorkerPath,l,r),{readinessDeadlineMs:c,...o}=l;return u({kind:"import-definitions",identityKey:R.key,workerEnvironment:Ye(),request:{...o,settleDelayMs:process.env.SCIP_RUST_SEMANTIC_SETTLE_MS===void 0?l.settleDelayMs:ze(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS)},timeoutMs:d},d)},shutdown(){i=!0}}}function Kn(e){for(let n of Object.keys(process.env))Ze(n)&&delete process.env[n];for(let[n,t]of Object.entries(e))t!==null&&(process.env[n]=t)}function zn(e,n){return n!==void 0?n:e===void 0?Fn:void 0}function Vn(e,n,t,r,s,i,u={}){let l=i.now(),d=l+s,R=(i.monotonicNow??w)(),c=R+s,o=q("rust-semantic-v3",r),a=U(o),f=ke(e),m=F(e),y=xe(f,{mailboxVersion:k,protocolVersion:b,id:a,operationKey:o,clientId:i.randomId(),enqueuedAtMs:l,deadlineAtMs:d,sessionIdentity:m,request:r},{nowMs:l,limits:u});for(Ve(e,n,t,c,i);(i.monotonicNow??w)()<=c;){if(He(y.responsePath)){let D=Yn(x(y.responsePath,{maxBytes:u.maxItemBytes??E,inputKind:"durable Rust semantic mailbox response"}),{requestId:a,operationKey:o,sessionIdentity:m,deadlineAtMs:y.authoritativeDeadlineAtMs,requestKind:r.kind,nowMs:i.now()});if(!D.ok)throw new Error(D.error);return C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:(i.monotonicNow??w)()-R,ok:!0,session:D.session,kind:r.kind}),D.response}let h=K(e);(!h||!j(h,i.now(),i.isProcessAlive,i.readProcessIdentity))&&Ve(e,n,t,c,i),i.sleep($e)}throw new Error(`Durable Rust semantic session timed out after ${(s/1e3).toFixed(0)}s.`)}function Ve(e,n,t,r,s){let i=K(e);if(i&&j(i,s.now(),s.isProcessAlive,s.readProcessIdentity))return;On(_(e,"server.json"),{force:!0}),s.spawnServer(n,e,t);let u=s.monotonicNow??w,l=Math.min(r,u()+Wn);for(;u()<=l;){let d=K(e);if(d&&j(d,s.now(),s.isProcessAlive,s.readProcessIdentity))return;s.sleep($e)}throw new Error("Durable Rust semantic session helper did not become ready within 5s.")}function K(e){try{let n=JSON.parse(x(_(e,"server.json"),{maxBytes:ce,inputKind:"durable Rust session state"}));if(typeof n.protocolVersion!="number"||n.sessionIdentity!==void 0&&(typeof n.sessionIdentity!="string"||n.sessionIdentity!==F(e))||typeof n.pid!="number"||typeof n.heartbeatAtMs!="number"||n.busyUntilMs!==void 0&&typeof n.busyUntilMs!="number"||n.mailbox!==void 0&&!Hn(n.mailbox))return null;let t=n.processIdentity===void 0?null:fe(n.processIdentity);return n.processIdentity!==void 0&&(!t||t.pid!==n.pid)?null:{protocolVersion:n.protocolVersion,...n.sessionIdentity===void 0?{}:{sessionIdentity:n.sessionIdentity},pid:n.pid,...t?{processIdentity:t}:{},heartbeatAtMs:n.heartbeatAtMs,...n.busyUntilMs===void 0?{}:{busyUntilMs:n.busyUntilMs},...n.mailbox===void 0?{}:{mailbox:n.mailbox}}}catch{return null}}function Yn(e,n){try{return ne(JSON.parse(e),n)}catch(t){return{ok:!1,code:"malformed-response",error:`helper wrote malformed JSON: ${t instanceof Error?t.message:String(t)}`}}}function Hn(e){if(!e||typeof e!="object")return!1;let n=e;return p(n.pending)&&p(n.inflight)&&p(n.responses)&&p(n.deadLetters)&&p(n.invalid)&&p(n.totalItems)&&typeof n.totalBytes=="number"&&Number.isFinite(n.totalBytes)&&n.totalBytes>=0&&(n.oldestPendingAt===void 0||Number.isFinite(Date.parse(n.oldestPendingAt)))}function Ye(){return Object.fromEntries(Object.entries(process.env).filter(([e])=>Ze(e)).sort(([e],[n])=>e.localeCompare(n)).map(([e,n])=>[e,n??null]))}function Ge(e){return e==="HOME"||e==="PATH"||e.startsWith("CARGO_")||e.startsWith("RA_")||e.startsWith("RUST")}function Ze(e){return Ge(e)||e.startsWith("SCIP_RUST_")||e==="SCIP_QUERY_PROFILE"||e==="SCIP_QUERY_PROFILE_CACHE_STATE"||e==="SCIP_QUERY_PROFILE_COMMAND"||e==="SCIP_QUERY_PROFILE_OUT"||e==="SCIP_QUERY_PROFILE_RUN_ID"||e==="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY"||e==="SCIP_QUERY_PROFILE_WORKLOAD_IDENTITY_KIND"||e==="SCIP_QUERY_PROFILE_MIN_MS"}var en={canonicalProjectRoot(e){try{return Nn(e)}catch{return _(e)}},projectFingerprint(e){return Fe(e)},engineIdentity:re,fileFingerprint(e){return $(e,{maxBytes:E,inputKind:"Rust semantic engine artifact"})},environment(){return Je(process.env)}},$n={now:Date.now,monotonicNow:w,randomId:Bn,isProcessAlive:be,readProcessIdentity:me,spawnServer(e,n,t){if(!He(e))throw new Error(`Durable Rust semantic session helper was not found at ${e}. Run npm run build first.`);Tn(process.execPath,[e,n,t],{detached:!0,stdio:"ignore"}).unref()},sleep(e){let n=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(n,0,0,e)}};function se(e){return Pn("sha256").update(e).digest("hex")}import{existsSync as Qn,mkdtempSync as nn,rmSync as oe}from"fs";import{tmpdir as tn}from"os";import{join as ae}from"path";import{fileURLToPath as H,pathToFileURL as Jn}from"url";import{SHARE_ENV as Xn,Worker as Gn}from"worker_threads";function z(e,n,t=new Set){let r=new Map;for(let s of e)t.has(s.symbolId)||r.set(s.symbolId,n.get(s.symbolId)??[]);return r}function ie(e,n,t){let r=W(process.env.SCIP_RUST_SEMANTIC_BATCH_TIMEOUT_MS)??0;if(r>0)return r;let s=Math.max(1,Math.ceil(e/Math.max(1,t)));return Math.max(12e4,3e4+s*n)}var rn=15e3,sn=8,an=5e3,Zn=64,et=96,le=class{constructor(n,t,r={}){this.projectRoot=n;this.status=t;this.opts=r;this.requester=r.requester??it(n,process.env.SCIP_RUST_SEMANTIC_DURABLE_SESSION)}projectRoot;status;opts;requester;referencesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),references:N(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!0});return{...P(r),resolvedBinary:t.resolvedBinary,references:z(n,new Map(r.references),new Set(r.incompleteReferenceSymbolIds??[]))}}catch(r){return this.opts.fallbackReferenceResolver?.referencesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),references:N(n)}}}calleesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),callees:O(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!0});return{...P(r),resolvedBinary:t.resolvedBinary,callees:ue(n,new Map(r.callees??[]))}}catch(r){return this.opts.fallbackCalleeResolver?.calleesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),callees:O(n)}}}referencesAndCalleesForDefinitions(n,t){let r=this.status(this.projectRoot);if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:B(r),references:N(n),callees:O(t)};let s=[...n,...t];try{let i=this.requestSession(r.resolvedBinary,s,{includeReferences:n.length>0,includeCallees:t.length>0,referenceDefinitions:n,calleeDefinitions:t});return{...P(i),resolvedBinary:r.resolvedBinary,references:z(n,new Map(i.references),new Set(i.incompleteReferenceSymbolIds??[])),callees:ue(t,new Map(i.callees??[]))}}catch(i){return this.fallbackReferencesAndCallees(r,n,t,i)}}signaturesForDefinitions(n){let t=this.status(this.projectRoot);if(!t.available||!t.resolvedBinary)return{available:!1,resolvedBinary:t.resolvedBinary,reason:B(t),signatures:on(n)};try{let r=this.requestSession(t.resolvedBinary,n,{includeReferences:!1,includeCallees:!1,includeSignatures:!0});return{...P(r),resolvedBinary:t.resolvedBinary,signatures:ct(n,new Map(r.signatures??[]))}}catch(r){return this.opts.fallbackSignatureResolver?.signaturesForDefinitions(n)??{available:!1,resolvedBinary:t.resolvedBinary,reason:r instanceof Error?r.message:String(r),signatures:on(n)}}}importDefinitionsForFile(n,t){let r=this.status(this.projectRoot);if(t.length===0)return r.available?{available:!0,resolvedBinary:r.resolvedBinary,sourcePaths:new Map}:{available:!1,reason:r.reason,resolvedBinary:r.resolvedBinary,sourcePaths:new Map};if(!r.available||!r.resolvedBinary)return{available:!1,resolvedBinary:r.resolvedBinary,reason:B(r),sourcePaths:new Map(t.map(s=>[s.id,null]))};try{let s=this.requestImportDefinitions(r.resolvedBinary,n,t);return{...P(s),resolvedBinary:r.resolvedBinary,sourcePaths:new Map(s.sourcePaths)}}catch(s){return{available:!1,resolvedBinary:r.resolvedBinary,reason:s instanceof Error?s.message:String(s),sourcePaths:new Map(t.map(i=>[i.id,null]))}}}dispose(){this.requester.shutdown()}requestSession(n,t,r){let s=V(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,rn),i=Y(process.env.SCIP_RUST_SEMANTIC_REFERENCE_RETRY_TIMEOUT_MS,0),u=V(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,sn),l=Y(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),d=r.referenceDefinitions?[...r.referenceDefinitions]:void 0,R=r.calleeDefinitions?[...r.calleeDefinitions]:void 0,c=r.signatureDefinitions?[...r.signatureDefinitions]:void 0,o=nt(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,{definitionCount:t.length,...r}),a={projectRoot:this.projectRoot,rustAnalyzerBinary:n,definitions:[...t],...d?{referenceDefinitions:d}:{},...R?{calleeDefinitions:R}:{},...c?{signatureDefinitions:c}:{},requestTimeoutMs:s,...r.includeReferences!==!1&&i>0?{referenceRetryTimeoutMs:i}:{},diagnosticsTimeoutMs:l,settleDelayMs:o,concurrency:u,includeReferences:r.includeReferences,includeCallees:r.includeCallees,includeSignatures:r.includeSignatures},f=dt(a);return X("rust.semantic.session.request",()=>this.requester.requestSemantic(a,ie(f,pt(s,a.referenceRetryTimeoutMs),u)),()=>({definitions:t.length,operationDefinitions:f,referenceDefinitions:a.referenceDefinitions?.length,calleeDefinitions:a.calleeDefinitions?.length,signatureDefinitions:a.signatureDefinitions?.length,references:a.includeReferences!==!1,callees:a.includeCallees===!0,signatures:a.includeSignatures===!0,referenceRetryTimeoutMs:a.referenceRetryTimeoutMs}))}fallbackReferencesAndCallees(n,t,r,s){let i=t.length===0?{available:!0,resolvedBinary:n.resolvedBinary,references:N(t)}:this.opts.fallbackReferenceResolver?.referencesForDefinitions(t),u=r.length===0?{available:!0,resolvedBinary:n.resolvedBinary,callees:O(r)}:this.opts.fallbackCalleeResolver?.calleesForDefinitions(r);if(i&&u){let l={resolvedBinary:i.resolvedBinary??u.resolvedBinary??n.resolvedBinary,references:z(t,i.references),callees:ue(r,u.callees)};return i.available&&u.available?{available:!0,...l}:{available:!1,reason:(i.available?void 0:i.reason)??(u.available?void 0:u.reason)??"Rust semantic fallback was unavailable.",...l}}return{available:!1,resolvedBinary:n.resolvedBinary,reason:s instanceof Error?s.message:String(s),references:N(t),callees:O(r)}}requestImportDefinitions(n,t,r){let s=V(process.env.SCIP_RUST_SEMANTIC_REQUEST_TIMEOUT_MS,rn),i=V(process.env.SCIP_RUST_SEMANTIC_CONCURRENCY,sn),u=Y(process.env.SCIP_RUST_SEMANTIC_DIAGNOSTICS_TIMEOUT_MS,Math.min(s,1e4)),l=Y(process.env.SCIP_RUST_SEMANTIC_SETTLE_MS,an),d={projectRoot:this.projectRoot,rustAnalyzerBinary:n,file:t,positions:[...r],requestTimeoutMs:s,diagnosticsTimeoutMs:u,settleDelayMs:l,concurrency:i};return X("rust.semantic.import-definitions.session.request",()=>this.requester.requestImportDefinitions(d,ie(r.length,s,i)),()=>({file:t,positions:r.length}))}};function P(e){return e.available?{available:!0}:{available:!1,reason:e.reason}}function B(e){return e.available?"rust-analyzer binary path is unavailable.":e.reason}function mr(e,n,t={}){return new le(e,n,t)}function nt(e,n){let t=ln(e);if(t!==null)return t;let r=n.includeReferences!==!1;return r&&n.includeCallees!==!0&&n.includeSignatures!==!0&&n.definitionCount<=Zn||r&&n.includeCallees===!0&&n.includeSignatures!==!0&&n.definitionCount<=et?0:an}function tt(e){let n=e?.trim().toLowerCase(),t=n==="0"||n==="false"||n==="off"||n==="worker",r=n==="1"||n==="true"||n==="on"||n==="durable",s=n===void 0||n==="";return{transport:t||!s&&!r?"worker":"durable",source:s?"default":"environment",fallback:"worker",valid:s||t||r,optOut:"SCIP_RUST_SEMANTIC_DURABLE_SESSION=0"}}function rt(e){return tt(e).transport}function st(e,n){let t=null,r=!1,s=!1,i=!1,u=()=>t??=n(),l=()=>{s||(e.shutdown(),s=!0)},d=(c,o,a)=>{let f=lt(c);r=!0;try{l()}catch{}C()&&v({type:"span",name:"rust.semantic.durable-session.request",durationMs:a,ok:!1,kind:o,session:"worker-fallback",reason:f})},R=(c,o,a)=>{if(i)throw new Error("Rust semantic failover session was already disposed.");if(r)return a(u());let f=performance.now();try{return o(e)}catch(m){d(m,c,performance.now()-f)}return a(u())};return{requestSemantic(c,o){return R("semantic",a=>a.requestSemantic(c,o),a=>a.requestSemantic(c,o))},requestImportDefinitions(c,o){return R("import-definitions",a=>a.requestImportDefinitions(c,o),a=>a.requestImportDefinitions(c,o))},shutdown(){if(i)return;i=!0;let c=[];try{l()}catch(o){c.push(o)}try{t?.shutdown()}catch(o){c.push(o)}if(c.length>0)throw c[0]}}}function it(e,n,t={worker:()=>ot(),durable:()=>Xe(e,{serverPath:H(ft()),semanticWorkerPath:H(un())})}){return rt(n)==="durable"?st(t.durable(),t.worker):t.worker()}function ot(e={}){let n=null,t=null,r=1,s=!1,i=null,u=null,l=o=>{o&&oe(o,{recursive:!0,force:!0})},d=()=>{if(i)return;let o=n,a=t;n=null,t=null;let f=o?o.terminate():Promise.resolve(0);i=Promise.allSettled([f,we(a,{gracefulMs:1e3,forceMs:1e3})]).then(([m,y])=>{let D=(y.status==="fulfilled"?y.value:[{reaped:!1,detail:String(y.reason)}]).filter(g=>!g.reaped);if(m.status==="rejected"||D.length>0){u=new Error(`Rust semantic worker cleanup did not complete; ownership evidence remains at ${a??"unknown"}.`);return}l(a)}).finally(()=>{i=null})},R=()=>{if(n)return n;if(i)throw new Error("The previous Rust semantic session worker is still terminating; retry the request.");if(u)throw u;let o=e.semanticWorkerPath?Jn(e.semanticWorkerPath):un();if(!Qn(H(o)))throw new Error(`Rust semantic session worker was not found at ${H(o)}. Run npm run build before using built semantic Rust queries.`);return t=nn(ae(tn(),"scip-query-rust-session-")),n=new Gn(o,e.shareEnvironment?{env:Xn}:void 0),n.unref(),n},c=()=>{let o=t??nn(ae(tn(),"scip-query-rust-session-"));return t=o,ae(o,`${r++}.json`)};return{requestSemantic(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"semantic",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=at(x(m,{maxBytes:E,inputKind:"Rust semantic worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{oe(m,{force:!0})}},requestImportDefinitions(o,a){if(s)throw new Error("Rust semantic session was already disposed.");let f=R(),m=c(),y=new SharedArrayBuffer(4),h=new Int32Array(y);if(f.postMessage({kind:"import-definitions",request:o,responsePath:m,sharedBuffer:y}),Atomics.wait(h,0,0,a)==="timed-out")throw d(),new Error(`Rust semantic import-definition session worker timed out after ${(a/1e3).toFixed(0)}s`);try{let g=ut(x(m,{maxBytes:E,inputKind:"Rust import-definition worker response"}));if(!g.ok)throw new Error(g.error);return g.response}finally{oe(m,{force:!0})}},shutdown(){if(s)return;if(s=!0,!n){l(t),t=null;return}let o=c(),a=new SharedArrayBuffer(4),f=new Int32Array(a);n.postMessage({kind:"shutdown",responsePath:o,sharedBuffer:a}),Atomics.wait(f,0,0,5e3),d()}}}function at(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function ut(e){let n=JSON.parse(e);if(!n||typeof n!="object")return{ok:!1,error:"Rust semantic session worker wrote a non-object response."};let t=n;return t.ok===!0&&"response"in t?{ok:!0,response:t.response}:{ok:!1,error:typeof n.error=="string"?n.error:"Rust semantic session worker failed."}}function lt(e){let n=e instanceof Error?`${e.name} ${e.message}`.toLowerCase():String(e).toLowerCase();return n.includes("readiness")?"readiness":n.includes("timeout")||n.includes("timed out")?"timeout":n.includes("helper")?"helper":"request"}function N(e){return new Map(e.map(n=>[n.symbolId,[]]))}function O(e){return new Map(e.map(n=>[n.symbolId,[]]))}function on(e){return new Map(e.map(n=>[n.symbolId,null]))}function ue(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??[]]))}function ct(e,n){return new Map(e.map(t=>[t.symbolId,n.get(t.symbolId)??null]))}function dt(e){let n=0;return e.includeReferences!==!1&&(n+=(e.referenceDefinitions??e.definitions).length),e.includeCallees===!0&&(n+=(e.calleeDefinitions??e.definitions).length),e.includeSignatures===!0&&(n+=(e.signatureDefinitions??e.definitions).length),Math.max(1,n)}function pt(e,n){return n&&n>0?Math.max(e,n):e}function un(){return new URL("./rust-semantic-session-worker.js",import.meta.url)}function ft(){return new URL("./rust-semantic-session-server.js",import.meta.url)}function V(e,n){return W(e)??n}function Y(e,n){return ln(e)??n}function ln(e){if(!e)return null;let n=Number(e);return Number.isInteger(n)&&n>=0?n:null}export{kt as a,xt as b,Ue as c,Tt as d,b as e,F as f,pn as g,je as h,z as i,ie as j,mr as k,nt as l,ot as m,pt as n};
|
|
2
|
-
//# sourceMappingURL=chunk-SSK6LDPC.js.map
|
package/dist/chunk-SZHGTCPP.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as U,b as j}from"./chunk-2OOY75BW.js";import{a as J}from"./chunk-GUFSG5TX.js";import{b as K}from"./chunk-3AF4TUFK.js";import{b as z,e as I,i as B}from"./chunk-H5EXS3HM.js";import{d as X}from"./chunk-JFMEXGFE.js";import{d as S,e as N,f as F,h as G}from"./chunk-7F45LJKI.js";var V=class extends Error{constructor(t){super(t),this.name="ReindexLockUnavailableError"}};import{existsSync as ee,statSync as Se}from"fs";import{dirname as re,join as ie}from"path";import{appendFileSync as ce,existsSync as ge,mkdirSync as fe,renameSync as me,rmSync as pe,statSync as ye,truncateSync as Re}from"fs";import{basename as be,dirname as xe}from"path";var T=".previous",Be=".rotation.lock",Ae=2e3,M=class extends Error{constructor(n,r){super(`Timed out after ${r}ms waiting for rotating JSONL lock: ${n}`);this.lockPath=n;this.timeoutMs=r;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},C=class extends Error{constructor(n){super(`Rotating JSONL lock ownership changed before release: ${n}`);this.lockPath=n;this.name="RotatingJsonlLockReleaseError"}lockPath;code="ROTATING_JSONL_LOCK_RELEASE_FAILED"},q=Object.freeze({monotonicNow:X,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=K(e,{kind:"rotating-jsonl",detail:{target:be(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){fe(e,{recursive:!0})},exists:ge,readBytes(e){return F(e,{maxBytes:S,inputKind:"rotating JSONL segment"})},size(e){return ye(e).size},truncate:Re,remove(e){pe(e,{force:!0})},rename:me,append:ce});function Y(e,t,n){let r=n.runtime??q,a=JSON.stringify(t);if(a===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let s=Buffer.from(`${a}
|
|
2
|
-
`),i=Math.max(1,Math.floor(n.maxSegmentBytes),s.length);return Z(e,n.lockTimeoutMs,r,()=>{r.makeDirectory(xe(e));let c=he(e,S,r);n.onPhase?.("tail-repaired");let o=`${e}${n.previousSuffix??T}`,l=!1,g=!1;return r.exists(e)&&r.size(e)+s.length>i&&(r.exists(o)&&(r.remove(o),g=!0),n.onPhase?.("previous-pruned"),r.rename(e,o),l=!0,n.onPhase?.("current-rotated")),r.append(e,s),n.onPhase?.("record-appended"),{lineBytes:s.length,segmentLimitBytes:i,repairedTailBytes:c,rotated:l,prunedPrevious:g}})}function H(e,t={}){let n=t.runtime??q,r=ve(t.maxSegmentBytes);return Z(e,t.lockTimeoutMs,n,()=>{let a=[],s=0,i=`${e}${t.previousSuffix??T}`;for(let c of[i,e]){if(!n.exists(c))continue;let o=Le(Q(c,r,n));a.push(...o.lines),s+=o.partialTailBytes}return{lines:a,ignoredPartialTailBytes:s}})}function Z(e,t,n,r){let a=`${e}${Be}`,s=Math.max(0,t??Ae),i=n.monotonicNow()+s,c;for(;;){let u=n.tryAcquireLock(a,e);if(u.kind==="acquired"){c=u.lock;break}let y=i-n.monotonicNow();if(y<=0)throw new M(a,s);n.wait(Math.min(5,y))}let o=!1,l,g;try{g=r()}catch(u){o=!0,l=u}let m=!1;try{m=c.release()}catch(u){if(!o)throw u}if(o)throw l;if(!m)throw new C(a);return g}function he(e,t,n){if(!n.exists(e))return 0;let r=Q(e,t,n);if(r.length===0||r[r.length-1]===10)return 0;let a=r.lastIndexOf(10),s=a<0?0:a+1;return n.truncate(e,s),r.length-s}function ve(e){let t=e??S;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function Q(e,t,n){let r=n.size(e);if(r>t)throw new N("rotating JSONL segment",e,"too-large",r,t);let a=n.readBytes(e),s=n.size(e);if(s!==r||a.byteLength!==r)throw new N("rotating JSONL segment",e,"changed-during-read",s,t);return a}function Le(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
|
|
3
|
-
`).filter(a=>a.length>0),partialTailBytes:e.length-n}}var Te="reindex-activity.jsonl",O=T,Oe=1024*1024,ke=1440*60*1e3,te=e=>G(e,"reindex activity segment");function k(e){return ie(re(e),Te)}function ae(e){if(e.reused)return 0;let n=(e.shards?.some(r=>!r.reused&&r.strategy==="incremental")??!1?0:W(e.indexPath))+W(e.dbPath);for(let r of e.shards??[]){if(r.reused)continue;let a=r.producedOutputBytes??r.outputBytes;a!==null&&(n+=a)}return n}function Pe(e){let t=ae(e),n=e.writeTelemetry;return n?Math.max(0,t-n.reflinkedBytes)+n.fallbackCopiedBytes+(n.incrementalWrittenBytes??0):t}function ot(e,t){let n=t.lastRefresh;if(!n)return{state:"failed",reason:"reindex result has no refresh metadata"};let r=ae(t);return D(k(e),{version:1,event:"run",recordedAt:n.completedAt,trigger:n.trigger,result:n.result,durationMs:n.durationMs,estimatedLogicalOutputBytes:r,estimatedWriteBytes:Pe(t),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,incrementalWrittenBytes:t.writeTelemetry?.incrementalWrittenBytes??0,byLanguage:We(t)})}function ut(e,t){return D(k(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function dt(e,t,n=new Date){return D(k(e),{version:1,event:"suppressed",recordedAt:n.toISOString(),trigger:t,reason:"completed-index-is-fresh"})}function Ee(e,t,n=Oe,r){Y(e,t,{maxSegmentBytes:n,previousSuffix:O,...r?{runtime:r}:{}})}function _e(e,t=new Date,n=ke,r=te){let a=t.getTime(),s=a-n,i={confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(s).toISOString(),windowEndedAt:t.toISOString(),runs:0,rebuilt:0,fullRebuilds:0,reused:0,failed:0,suppressed:0,estimatedLogicalOutputBytes:0,estimatedWriteBytes:0,reflinkedBytes:0,fallbackCopiedBytes:0,languageAttribution:"complete",attributedRuns:0,unattributedRuns:0,invalidLanguageDetails:0,byLanguage:{},byTrigger:{},automatic:{runs:0,rebuilt:0,fullRebuilds:0,estimatedWriteBytes:0}},c=i.automatic,o=k(e),l=[];if(r===te){if(!ee(o)&&!ee(`${o}${O}`))return i;try{let g=H(o,{previousSuffix:O});l=g.lines,i.ignoredPartialTailBytes=g.ignoredPartialTailBytes}catch{i.readErrors+=1,i.confidence="unavailable"}}else{let g=0;for(let m of[`${o}${O}`,o])try{l.push(...je(r(m))),g+=1}catch{i.readErrors+=1}g===0?i.confidence="unavailable":i.readErrors>0&&(i.confidence="partial")}for(let g of l){i.recordsRead+=1;let m=we(g);if(!m){i.invalidRecords+=1,i.confidence!=="unavailable"&&(i.confidence="partial");continue}let{record:u}=m,y=Date.parse(u.recordedAt);if(y<s||y>a){i.skippedRecords+=1;continue}if(i.invalidLanguageDetails=(i.invalidLanguageDetails??0)+m.invalidLanguageDetails,i.byTrigger[u.trigger.kind]=(i.byTrigger[u.trigger.kind]??0)+1,u.event==="suppressed"){i.suppressed+=1;continue}i.runs+=1,i[u.result]+=1,i.estimatedLogicalOutputBytes+=u.estimatedLogicalOutputBytes;let b=Ne(u);i.estimatedWriteBytes=(i.estimatedWriteBytes??0)+b,i.reflinkedBytes=(i.reflinkedBytes??0)+(u.reflinkedBytes??0),i.fallbackCopiedBytes=(i.fallbackCopiedBytes??0)+(u.fallbackCopiedBytes??0),u.result!=="failed"&&(m.hasLanguageDetails?i.attributedRuns=(i.attributedRuns??0)+1:i.unattributedRuns=(i.unattributedRuns??0)+1);for(let[R,A]of se(u.byLanguage)){let x=(i.byLanguage??={})[R]??=Ge();x.runs+=1,x[A.result]+=1,x.producedOutputBytes+=A.producedOutputBytes,x.durationMs+=A.durationMs}let p=Me(u);p&&i.oldestRebuildAt===void 0&&(i.oldestRebuildAt=u.recordedAt),p&&(i.fullRebuilds=(i.fullRebuilds??0)+1),b>0&&i.oldestWriteAt===void 0&&(i.oldestWriteAt=u.recordedAt),Ie(u.trigger)&&(c.runs+=1,u.result==="rebuilt"&&(c.rebuilt+=1),p&&(c.fullRebuilds+=1,c.oldestRebuildAt??=u.recordedAt),c.estimatedWriteBytes+=b,b>0&&(c.oldestWriteAt??=u.recordedAt))}return i.ignoredPartialTailBytes>0&&i.confidence!=="unavailable"&&(i.confidence="partial"),i.languageAttribution=Ue(i),i}function D(e,t){try{return Ee(e,t),{state:"recorded"}}catch(n){return{state:"failed",reason:n instanceof Error?n.message:String(n)}}}function we(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(n.version!==1||!z(n.recordedAt)||!n.trigger||!Ce(n.trigger.kind))return null;if(n.event==="suppressed")return n.reason==="completed-index-is-fresh"?{record:n,hasLanguageDetails:!1,invalidLanguageDetails:0}:null;if(n.event!=="run"||n.result!=="rebuilt"&&n.result!=="reused"&&n.result!=="failed"||!B(n.durationMs)||!B(n.estimatedLogicalOutputBytes)||n.estimatedWriteBytes!==void 0&&!B(n.estimatedWriteBytes)||n.reflinkedBytes!==void 0&&!B(n.reflinkedBytes)||n.fallbackCopiedBytes!==void 0&&!B(n.fallbackCopiedBytes)||n.incrementalWrittenBytes!==void 0&&!B(n.incrementalWrittenBytes))return null;let r=n,{byLanguage:a,...s}=r,i=De(a);return{record:{...s,...i.byLanguage?{byLanguage:i.byLanguage}:{}},hasLanguageDetails:i.hasLanguageDetails,invalidLanguageDetails:i.invalidLanguageDetails}}catch{return null}}function Ne(e){return e.reflinkedBytes===void 0?e.estimatedWriteBytes??e.estimatedLogicalOutputBytes:Math.max(0,e.estimatedLogicalOutputBytes-e.reflinkedBytes)+(e.fallbackCopiedBytes??0)+(e.incrementalWrittenBytes??0)}function lt(e,t,n=new Date){return t.enabled?Je(_e(e,n,t.windowMs),t,n.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function Ie(e){return e.kind.startsWith("watch-")}function Je(e,t,n){let r=e.automatic??{fullRebuilds:e.fullRebuilds??e.rebuilt,estimatedWriteBytes:e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,oldestRebuildAt:e.oldestRebuildAt,oldestWriteAt:e.oldestWriteAt},a=r.estimatedWriteBytes,s=r.fullRebuilds,i={rebuilt:s,estimatedWriteBytes:a};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:n+t.windowMs,...i,detail:`reindex activity evidence is ${e.confidence}`}:s>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:ne(r.oldestRebuildAt,t.windowMs,n),...i,detail:`${s}/${t.maxRebuilds} expensive full rebuild slots consumed by automatic refreshes`}:a>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:ne(r.oldestWriteAt,t.windowMs,n),...i,detail:`${a}/${t.maxEstimatedWriteBytes} estimated write bytes consumed by automatic refreshes`}:{state:"allowed",...i}:{state:"allowed",...i}}function Me(e){if(e.result!=="rebuilt")return!1;let t=se(e.byLanguage);return t.length===0?!0:t.some(([,n])=>n.result==="rebuilt"&&n.strategy!=="incremental"&&n.strategy!=="reused")}function ne(e,t,n){let r=e?Date.parse(e):Number.NaN;return Number.isFinite(r)&&r+t>n?r+t:n+t}function Ce(e){return e==="manual-cli"||e==="setup"||e==="watch-source"||e==="watch-startup"||e==="watch-demand"||e==="watch-git-head"||e==="watch-git-index"||e==="watch-git-state"||e==="unknown"}function W(e){try{return Se(e).size}catch{return 0}}function We(e){let t={};for(let n of e.languages){let r=(e.shards??[]).filter(l=>l.language===n),a=r.find(l=>l.id===n),s=e.reused||(a?a.reused:r.length>0&&r.every(l=>l.reused)),i=W(ie(re(e.dbPath),"language-indexes",`${n}.scip`)),c=i>0?i:a?.outputBytes??i,o=s?0:a?.durationMs??r.filter(l=>!l.reused).reduce((l,g)=>l+g.durationMs,0);t[n]={result:s?"reused":"rebuilt",strategy:s?"reused":a?.strategy??"full",...a?.strategy==="full"&&(a.fallbackReason??a.missReason)?{fallbackReason:a.fallbackReason??a.missReason}:{},outputBytes:c,producedOutputBytes:s?0:a?.producedOutputBytes??c,durationMs:o}}return t}function De(e){if(e===void 0)return{hasLanguageDetails:!1,invalidLanguageDetails:0};if(!e||typeof e!="object"||Array.isArray(e))return{hasLanguageDetails:!1,invalidLanguageDetails:1};let t={},n=0;for(let[a,s]of Object.entries(e)){if(!Fe(a)||!$e(s)){n+=1;continue}t[a]=s}let r=Object.keys(t).length>0;return{...r?{byLanguage:t}:{},hasLanguageDetails:r,invalidLanguageDetails:n}}function $e(e){if(!e||typeof e!="object")return!1;let t=e;return(t.result==="rebuilt"||t.result==="reused")&&(t.strategy===void 0||t.strategy==="reused"||t.strategy==="incremental"||t.strategy==="full")&&(t.fallbackReason===void 0||typeof t.fallbackReason=="string")&&I(t.outputBytes)&&I(t.producedOutputBytes)&&B(t.durationMs)&&(t.result!=="reused"||t.producedOutputBytes===0&&t.durationMs===0)&&t.producedOutputBytes<=t.outputBytes}function Fe(e){return J.includes(e)}function se(e){return e?J.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}):[]}function Ge(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function Ue(e){let t=e.invalidLanguageDetails??0,n=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":n===0?"unavailable":"partial"}function je(e){return e.endsWith(`
|
|
4
|
-
`)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
|
|
5
|
-
`)+1))),e.split(`
|
|
6
|
-
`).filter(t=>t.length>0)}function gt(e){let t=JSON.stringify(e);return Buffer.byteLength(t)<=65536?t:void 0}function ft(e){if(!(!e||Buffer.byteLength(e)>65536))try{return ze(JSON.parse(e))}catch{return}}function ze(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e;if(t.version!==1||t.baseGeneration!==null&&typeof t.baseGeneration!="string"||typeof t.complete!="boolean"||!Array.isArray(t.entries)||t.entries.length>1024||t.incompleteReason!==void 0&&typeof t.incompleteReason!="string")return;let n=[],r=new Set;for(let a of t.entries){if(!a||typeof a!="object"||Array.isArray(a))return;let s=a;if(typeof s.path!="string"||!Xe(s.path)||s.kind!=="add"&&s.kind!=="change"&&s.kind!=="delete"||r.has(s.path))return;r.add(s.path),n.push({path:s.path,kind:s.kind})}if(!(t.complete&&t.incompleteReason!==void 0)&&!(!t.complete&&(!t.incompleteReason||t.incompleteReason.trim()==="")))return{version:1,baseGeneration:t.baseGeneration,complete:t.complete,...t.incompleteReason===void 0?{}:{incompleteReason:t.incompleteReason},entries:n}}function Xe(e){return!e||e.includes("\0")||e.includes("\\")||e.startsWith("/")||/^[A-Za-z]:\//.test(e)?!1:e.split("/").every(t=>t!==""&&t!=="."&&t!=="..")}import{spawn as Ke}from"child_process";import{platform as oe}from"os";import{performance as ue}from"perf_hooks";var xt={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},L=class extends Error{constructor(n,r,a,s={}){super(a,s.cause===void 0?void 0:{cause:s.cause});this.kind=n;this.label=r;this.name="BoundedProcessError",this.timedOut=s.timedOut??!1,this.reaped=s.reaped??!1,this.stdout=s.stdout??"",this.stderr=s.stderr??"",this.stdoutTruncated=s.stdoutTruncated??!1,this.stderrTruncated=s.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function v(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function de(e,t,n,r){let a=Math.max(0,r-n);a>0&&e.push(t.subarray(0,a))}function le(e,t,n){let r=Buffer.concat([...e,t]);e.length=0,e.push(r.subarray(Math.max(0,r.length-n)))}function Bt(e){v(e.timeoutMs,"timeoutMs"),v(e.maxStdoutBytes,"maxStdoutBytes"),v(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;v(t,"terminationGraceMs");let n=e.terminationForceMs??t;return v(n,"terminationForceMs"),new Promise((r,a)=>{let s=ue.now(),i=oe()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",c=oe()!=="win32"&&!i,o;try{o=Ke(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:c?!0:e.detached,stdio:["pipe","pipe","pipe"]})}catch(d){let f=d instanceof Error?d.message:String(d);a(new L("spawn",e.label,`${e.label} could not start: ${f}`,{cause:d,reaped:!0}));return}let l=[],g=[],m=0,u=0,y=!1,b=!1,p=null,R=!1,A=o.pid===void 0?null:U(o.pid,c),x=()=>{clearTimeout($),e.signal?.removeEventListener("abort",E)},P=d=>{if(R||!p)return;R=!0,x();let f=Buffer.concat(l).toString("utf8"),_=Buffer.concat(g).toString("utf8"),w=d.reaped||!d.detail?"":` Process-tree cleanup failed: ${d.detail}`;a(new L(p.kind,e.label,`${p.message}${w}`,{timedOut:p.timedOut,reaped:d.reaped,stdout:f,stderr:_,stdoutTruncated:y,stderrTruncated:b}))},h=d=>{if(!(p||R)){if(p=d,!A){P({reaped:o.pid===void 0,reason:o.pid===void 0?"terminated":"identity-unavailable"});return}j(A,{gracefulMs:t,forceMs:n}).then(P,f=>{P({reaped:!1,reason:"signal-failed",detail:f instanceof Error?f.message:String(f)})})}},$=setTimeout(()=>{h({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);$.unref();let E=()=>{h({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",E,{once:!0}),e.signal?.aborted&&E(),o.stdout.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?le(l,f,e.maxStdoutBytes):de(l,f,m,e.maxStdoutBytes),m+=f.length,m>e.maxStdoutBytes&&(y=!0,e.outputLimitBehavior!=="truncate-tail"&&h({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),o.stderr.on("data",d=>{let f=Buffer.isBuffer(d)?d:Buffer.from(d);e.outputLimitBehavior==="truncate-tail"?le(g,f,e.maxStderrBytes):de(g,f,u,e.maxStderrBytes),u+=f.length,u>e.maxStderrBytes&&(b=!0,e.outputLimitBehavior!=="truncate-tail"&&h({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),o.on("error",d=>{if(!R&&!p){if(o.pid===void 0){x(),R=!0,a(new L("spawn",e.label,`${e.label} could not start: ${d.message}`,{cause:d,reaped:!0}));return}h({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${d.message}`})}}),o.on("close",(d,f)=>{if(R||p)return;R=!0,x();let _=Buffer.concat(l).toString("utf8"),w=Buffer.concat(g).toString("utf8");r({status:d,signal:f,stdout:_,stderr:w,timedOut:!1,durationMs:ue.now()-s,stdoutTruncated:y,stderrTruncated:b})}),e.input===void 0?o.stdin.end():o.stdin.end(e.input)})}export{xt as a,L as b,Bt as c,V as d,T as e,Y as f,Te as g,ot as h,ut as i,dt as j,_e as k,lt as l,gt as m,ft as n};
|
|
7
|
-
//# sourceMappingURL=chunk-SZHGTCPP.js.map
|