scip-query 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +247 -1
- package/README.md +111 -124
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-PRVFAGTQ.js +2 -0
- package/dist/call-graph-DVPAQV2F.js +2 -0
- package/dist/{call-graph-evidence-BociKRpF.d.ts → call-graph-evidence-CUtj8V2I.d.ts} +1 -1
- package/dist/chunk-2FSBGL5P.js +2 -0
- package/dist/chunk-2HLAFUCY.js +2 -0
- package/dist/chunk-2IWUT6CJ.js +3 -0
- package/dist/chunk-2KNN7GTQ.js +2 -0
- package/dist/chunk-2LHXRE2B.js +8 -0
- package/dist/{chunk-E65ELFKU.js → chunk-2YXE77TJ.js} +2 -2
- package/dist/chunk-36SGVCGX.js +2 -0
- package/dist/chunk-3ABBFPTP.js +2 -0
- package/dist/chunk-3IVFU4FD.js +3 -0
- package/dist/chunk-3JIQS44J.js +7 -0
- package/dist/chunk-3ZRB6DNK.js +7 -0
- package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
- package/dist/{chunk-BHKK5RJY.js → chunk-4BHGBMNO.js} +2 -2
- package/dist/chunk-4BP3UBDG.js +2 -0
- package/dist/chunk-4D6RO7G4.js +2 -0
- package/dist/chunk-4FEWQ6RH.js +2 -0
- package/dist/chunk-4IGEOBG7.js +2 -0
- package/dist/chunk-4QZXBUKC.js +2 -0
- package/dist/chunk-4WBDEVX2.js +4 -0
- package/dist/chunk-4WCUBZU3.js +8 -0
- package/dist/chunk-4WTUBQ36.js +40 -0
- package/dist/chunk-4XQ4O6IM.js +3 -0
- package/dist/chunk-55UQAMZO.js +4 -0
- package/dist/chunk-5D2LVK7O.js +125 -0
- package/dist/chunk-5IYJ56TT.js +2 -0
- package/dist/chunk-5PLMJC7Q.js +2 -0
- package/dist/chunk-5TNQJUR2.js +5 -0
- package/dist/chunk-62BDNPMI.js +2 -0
- package/dist/chunk-64DZ5TXR.js +7 -0
- package/dist/chunk-65245JCM.js +2 -0
- package/dist/chunk-6FFVZZL4.js +2 -0
- package/dist/chunk-6KO5JHAR.js +2 -0
- package/dist/chunk-6LRXOOSX.js +2 -0
- package/dist/chunk-6LSEIIF7.js +2 -0
- package/dist/chunk-6YMNWD3H.js +6 -0
- package/dist/chunk-72AD6ZRR.js +5 -0
- package/dist/chunk-73AAKPUC.js +4 -0
- package/dist/chunk-76CZ77DF.js +2 -0
- package/dist/chunk-7VPEEAAG.js +2 -0
- package/dist/chunk-7WTPQ4NX.js +14 -0
- package/dist/chunk-7Y5T6XDP.js +2 -0
- package/dist/chunk-A2IIGFMJ.js +5 -0
- package/dist/chunk-AB5KCTEV.js +2 -0
- package/dist/chunk-AC566WBP.js +6 -0
- package/dist/chunk-AGWFSTXC.js +3 -0
- package/dist/chunk-AOSIYPTA.js +2 -0
- package/dist/chunk-AUVEWPIF.js +2 -0
- package/dist/chunk-B56T42J3.js +25 -0
- package/dist/chunk-BIQEF5NE.js +2 -0
- package/dist/chunk-BL6XJKTA.js +3 -0
- package/dist/chunk-BMKOQJRI.js +2 -0
- package/dist/chunk-BOZ4EXBB.js +3 -0
- package/dist/chunk-BUTWYEPH.js +2 -0
- package/dist/chunk-BZB4QPIP.js +2 -0
- package/dist/{chunk-6ILKOOGH.js → chunk-CE357GEE.js} +4 -4
- package/dist/chunk-CFN45HFP.js +2 -0
- package/dist/chunk-CFYMZFXT.js +368 -0
- package/dist/chunk-CN5EH7O3.js +2 -0
- package/dist/chunk-D254DNNQ.js +4 -0
- package/dist/chunk-D3FDISIC.js +2 -0
- package/dist/chunk-D3NX5XIE.js +3 -0
- package/dist/chunk-DA7RPPDF.js +3 -0
- package/dist/chunk-DDMC3FON.js +3 -0
- package/dist/chunk-DIO3FUSG.js +2 -0
- package/dist/chunk-DJ2NNSUK.js +3 -0
- package/dist/chunk-DKYQIM3C.js +18 -0
- package/dist/{chunk-OHIV323X.js → chunk-DOOEL2IV.js} +2 -2
- package/dist/chunk-DVFP6PZI.js +2 -0
- package/dist/chunk-E3FDPXZK.js +2 -0
- package/dist/chunk-E7YNJLCB.js +2 -0
- package/dist/chunk-EFGW5JPH.js +2 -0
- package/dist/chunk-EJVTR244.js +13 -0
- package/dist/chunk-EOV7RTRZ.js +2 -0
- package/dist/chunk-ETOIKRHO.js +2 -0
- package/dist/chunk-EYK3ZAO2.js +3 -0
- package/dist/chunk-F2V2LPET.js +52 -0
- package/dist/chunk-F4LUHJTF.js +2 -0
- package/dist/chunk-F4PUT6IT.js +2 -0
- package/dist/chunk-F56GCXXS.js +5 -0
- package/dist/chunk-FC2EVQRM.js +2 -0
- package/dist/chunk-FL7NBMHP.js +3 -0
- package/dist/chunk-FMRN2TRL.js +3 -0
- package/dist/chunk-FVULPZDF.js +20 -0
- package/dist/chunk-GCKCF5FL.js +43 -0
- package/dist/chunk-GH2PYF46.js +2 -0
- package/dist/chunk-GHJAGXIP.js +2 -0
- package/dist/{chunk-2GJSD5GY.js → chunk-GMVSHUKZ.js} +2 -2
- package/dist/chunk-GS6KDO4R.js +2 -0
- package/dist/chunk-GUUBXNN7.js +2 -0
- package/dist/chunk-GVWX5T43.js +80 -0
- package/dist/chunk-GZKFETP5.js +2 -0
- package/dist/chunk-H4EQHO6J.js +9 -0
- package/dist/chunk-H73WY2RM.js +2 -0
- package/dist/chunk-H75GSPRV.js +60 -0
- package/dist/chunk-HDR3AHSV.js +61 -0
- package/dist/chunk-HQBSL74Y.js +2 -0
- package/dist/chunk-HRRFKWPZ.js +2 -0
- package/dist/chunk-HXENDJC6.js +2 -0
- package/dist/chunk-IIBAZNSW.js +21 -0
- package/dist/chunk-INLMWEUU.js +12 -0
- package/dist/chunk-IWQPAF4F.js +2 -0
- package/dist/chunk-IZJ6YUKP.js +35 -0
- package/dist/chunk-J2TMAIN5.js +60 -0
- package/dist/chunk-J5FJMODQ.js +142 -0
- package/dist/chunk-J7HZPIO3.js +2 -0
- package/dist/chunk-JEVRKFRL.js +2 -0
- package/dist/chunk-JFXSGAEB.js +30 -0
- package/dist/chunk-JVRTHGFS.js +3 -0
- package/dist/chunk-JYWEX7RR.js +360 -0
- package/dist/chunk-K3YL22N6.js +2 -0
- package/dist/chunk-K4CN7GXK.js +12 -0
- package/dist/chunk-K5TBVXU4.js +30 -0
- package/dist/chunk-KDDIE2DP.js +9 -0
- package/dist/chunk-KHWRRPV4.js +2 -0
- package/dist/chunk-KI6NBKDY.js +14 -0
- package/dist/chunk-KU3QRSTH.js +2 -0
- package/dist/chunk-KZBJWZJB.js +2 -0
- package/dist/chunk-L7GFM3NP.js +3 -0
- package/dist/chunk-LMO6PK3V.js +35 -0
- package/dist/chunk-LN4YXJJU.js +2 -0
- package/dist/chunk-LOVIZBJ4.js +43 -0
- package/dist/chunk-LPCRK4A2.js +11 -0
- package/dist/chunk-MMHZKBFA.js +2 -0
- package/dist/{chunk-A4WEAK35.js → chunk-MOQQBQRD.js} +2 -2
- package/dist/chunk-N2WN6I3L.js +2 -0
- package/dist/chunk-N3ORQT7L.js +2 -0
- package/dist/chunk-NAZ3RAIW.js +2 -0
- package/dist/chunk-NDUNO5JQ.js +2 -0
- package/dist/chunk-NEIWRNAZ.js +4 -0
- package/dist/chunk-NJJMVD65.js +2 -0
- package/dist/chunk-NLOQOBXI.js +20 -0
- package/dist/chunk-NOLZOVCU.js +2 -0
- package/dist/chunk-NOWINRRN.js +2 -0
- package/dist/chunk-NZAXKGRL.js +16 -0
- package/dist/chunk-O2C4UILI.js +2 -0
- package/dist/chunk-O3RHA6ZT.js +3 -0
- package/dist/chunk-O4UZSPPI.js +3 -0
- package/dist/chunk-OGFV2BUX.js +2 -0
- package/dist/chunk-OZCJXZK6.js +499 -0
- package/dist/chunk-P6ODM7BY.js +2 -0
- package/dist/{chunk-GHNPACNP.js → chunk-PAVGPRHJ.js} +2 -2
- package/dist/chunk-PH52RA7D.js +2 -0
- package/dist/chunk-PKN354TH.js +3 -0
- package/dist/chunk-PWOASWEG.js +11 -0
- package/dist/chunk-QIWXRW72.js +2 -0
- package/dist/chunk-QJRMOK5N.js +2 -0
- package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
- package/dist/chunk-QXEUDXBT.js +3 -0
- package/dist/chunk-QYUVVBMR.js +6 -0
- package/dist/chunk-QZ7KQZRN.js +2 -0
- package/dist/chunk-R6LQBUDH.js +2 -0
- package/dist/chunk-RBS42E55.js +20 -0
- package/dist/chunk-RSJKPCFX.js +26 -0
- package/dist/chunk-S6CZA3MV.js +2 -0
- package/dist/chunk-STMVAHJP.js +2 -0
- package/dist/chunk-SYVPTTVW.js +2 -0
- package/dist/chunk-T6DK3ZP7.js +2 -0
- package/dist/chunk-TKD34PHN.js +4 -0
- package/dist/chunk-TNNQFH7W.js +2 -0
- package/dist/chunk-TNV7SSUF.js +2 -0
- package/dist/chunk-TO7ZR3EH.js +8 -0
- package/dist/chunk-TOU3CHK4.js +2 -0
- package/dist/chunk-TRBI4UKT.js +2 -0
- package/dist/chunk-TZCVNCAN.js +4 -0
- package/dist/chunk-U4LZA5LL.js +3 -0
- package/dist/chunk-U5RIG3JP.js +3 -0
- package/dist/chunk-UP5KXN2I.js +2 -0
- package/dist/chunk-UQFR3NDH.js +5 -0
- package/dist/chunk-UXYXF7GV.js +2 -0
- package/dist/chunk-VB3GOKOS.js +2 -0
- package/dist/{chunk-4FR6GQIT.js → chunk-VF5JZICY.js} +2 -2
- package/dist/chunk-VTY3VK6E.js +2 -0
- package/dist/chunk-VX2O4RIS.js +2 -0
- package/dist/chunk-WKPV2TDZ.js +2 -0
- package/dist/chunk-WOFQ5DTB.js +2 -0
- package/dist/chunk-WS4C6TCK.js +2 -0
- package/dist/chunk-WXU3DGPU.js +2 -0
- package/dist/{chunk-ATXPTSEI.js → chunk-X6RMKHJQ.js} +7 -7
- package/dist/{chunk-44IETFOU.js → chunk-XHMN6ZX7.js} +2 -2
- package/dist/chunk-XHTVFLWW.js +2 -0
- package/dist/chunk-XKIDJCIK.js +2 -0
- package/dist/chunk-XTYTYZPT.js +2 -0
- package/dist/chunk-Y2JHHTTA.js +2 -0
- package/dist/chunk-YGVRMGYN.js +4 -0
- package/dist/chunk-YNQCGEQE.js +2 -0
- package/dist/chunk-YOQVEXVE.js +14 -0
- package/dist/chunk-YRT2WLYY.js +2 -0
- package/dist/chunk-YTAP5Y2G.js +2 -0
- package/dist/chunk-YTYWI7VB.js +2 -0
- package/dist/chunk-YULZRALL.js +2 -0
- package/dist/chunk-Z33WQG4Q.js +2 -0
- package/dist/chunk-ZGTYGDMF.js +16 -0
- package/dist/chunk-ZHMRSZFD.js +43 -0
- package/dist/chunk-ZHSP366W.js +10 -0
- package/dist/chunk-ZIBYCYKK.js +7 -0
- package/dist/chunk-ZLADLUE6.js +3 -0
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-MZPXPSUJ.js → chunk-ZR4HBC2H.js} +2 -2
- package/dist/cli-main.js +6 -6
- package/dist/cli.js +1 -1
- package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
- package/dist/code-IL5WH3NZ.js +2 -0
- package/dist/code-result-json-ANTBEDFP.js +4 -0
- package/dist/command-descriptors-HEEMDHTU.js +222 -0
- package/dist/deps-EOWFC6FD.js +2 -0
- package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
- package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
- package/dist/files-K4AI3JUM.js +2 -0
- package/dist/{health-BI2a9WPy.d.ts → health-BtfmNrfa.d.ts} +5 -79
- package/dist/hierarchy-6W5NDIFI.js +2 -0
- package/dist/imports-WH365QY4.js +2 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/members-K3PHMF5S.js +2 -0
- package/dist/methods-E7KVMBX4.js +2 -0
- package/dist/output-continuation-command-BJSY67SN.js +3 -0
- package/dist/output-pagination-UZJ5ACIX.js +24 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-EP24WT4X.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +15 -4
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -0
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +3 -3
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity.d.ts +6 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +1 -7
- package/dist/queries/context.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/dependence-slice.d.ts +46 -22
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +1 -7
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -4
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +121 -61
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -0
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +15 -64
- package/dist/queries/index.js +1 -1
- package/dist/queries/locality-candidates.d.ts +4 -4
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -6
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +4 -14
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +4 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/review.d.ts +188 -0
- package/dist/queries/review.js +2 -0
- package/dist/queries/similar-files.d.ts +7 -10
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +19 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice-cohesion.d.ts +205 -0
- package/dist/queries/slice-cohesion.js +2 -0
- package/dist/queries/source-inspection.d.ts +6 -202
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -3
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stats.d.ts +1 -0
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +4 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/twin-drift.d.ts +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +3 -15
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +4 -4
- package/dist/refs-CCBJG7WK.js +2 -0
- package/dist/refs-pagination-DRNLVU4S.js +2 -0
- package/dist/reindex-worker.js +79 -29
- package/dist/reindex.js +45 -45
- package/dist/repository-cache-worker.js +2 -0
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +3 -4
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/service-queries-2WAJI7R6.js +6 -0
- package/dist/source-inspection-91U9zdO3.d.ts +341 -0
- package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
- package/dist/stats-G7DIV6VU.js +2 -0
- package/dist/surface-IO55UALI.js +2 -0
- package/dist/system-ZBMSHJXU.js +2 -0
- package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
- package/dist/typescript-indexer.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +3 -3
- package/docs/AGENT_GUIDE.md +19 -128
- package/docs/CLI_JSON_OUTPUT.md +21 -17
- package/docs/COMMAND_REFERENCE.md +34 -49
- package/docs/CURRENT_COMMANDS.md +123 -0
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
- package/docs/DETECTOR_GUIDE.md +27 -23
- package/docs/PRODUCT_VISION.md +135 -0
- package/docs/PROPERTY_TESTING.md +73 -0
- package/docs/REVIEW.md +76 -0
- package/docs/SKILLS.md +51 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
- package/docs/accuracy-audit-checklist.md +34 -0
- package/docs/analyzer-inventory.md +2 -2
- package/package.json +18 -80
- package/scripts/evidence-product-contract.mjs +7 -3
- package/scripts/record-review-coverage.mjs +118 -0
- package/scripts/scip-windows-provenance.mjs +29 -19
- package/skills/scip-architecture-review/SKILL.md +57 -0
- package/skills/scip-architecture-review/agents/openai.yaml +4 -0
- package/skills/scip-architecture-review/references/design-checks.md +17 -0
- package/skills/scip-explore/SKILL.md +15 -59
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/external-evidence.md +2 -2
- package/skills/scip-explore/references/information-model.md +26 -29
- package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
- package/skills/scip-integrity-audit/SKILL.md +53 -181
- package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
- package/skills/scip-plan/SKILL.md +39 -65
- package/skills/scip-plan/agents/openai.yaml +2 -2
- package/skills/scip-query/SKILL.md +28 -81
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-query/references/command-guide.md +169 -0
- package/skills/scip-setup/SKILL.md +4 -2
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/by-kind-H3P6BR5G.js +0 -2
- package/dist/call-graph-VTG2CUOQ.js +0 -2
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2BMSSRBH.js +0 -2
- package/dist/chunk-2M2LSIMY.js +0 -7
- package/dist/chunk-2N6WBNDC.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2USA3S3P.js +0 -3
- package/dist/chunk-2VAHDDLM.js +0 -133
- package/dist/chunk-2XWIUW5Z.js +0 -455
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D4BOXW6.js +0 -20
- package/dist/chunk-3LO4FST5.js +0 -16
- package/dist/chunk-3WTY4LP2.js +0 -3
- package/dist/chunk-3Z5AMSK6.js +0 -29
- package/dist/chunk-4KBTHJLP.js +0 -2
- package/dist/chunk-5BIKR67W.js +0 -2
- package/dist/chunk-5PROPLHI.js +0 -2
- package/dist/chunk-5V7EPTII.js +0 -2
- package/dist/chunk-62LPZCBQ.js +0 -3
- package/dist/chunk-64O2JHQA.js +0 -2
- package/dist/chunk-6D4F5VWG.js +0 -10
- package/dist/chunk-6ERFBC3X.js +0 -3
- package/dist/chunk-6MFXCMZC.js +0 -2
- package/dist/chunk-6O7FACKB.js +0 -2
- package/dist/chunk-6TS3KOXR.js +0 -2
- package/dist/chunk-76QOU4PK.js +0 -3
- package/dist/chunk-7DUI77BN.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7F7T6DCR.js +0 -2
- package/dist/chunk-7H6VHWWJ.js +0 -2
- package/dist/chunk-7HXT6YLU.js +0 -5
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-7R4V5ES6.js +0 -6
- package/dist/chunk-7RIRIADH.js +0 -7
- package/dist/chunk-7ZLWLOGT.js +0 -2
- package/dist/chunk-AADQLOQ4.js +0 -38
- package/dist/chunk-AN76MGUE.js +0 -2
- package/dist/chunk-ANLNLY66.js +0 -2
- package/dist/chunk-AX7IDVFT.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B7MPDEAK.js +0 -3
- package/dist/chunk-BBB5FBX4.js +0 -2
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BJWFVAA5.js +0 -2
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BKZYTLGE.js +0 -35
- package/dist/chunk-BL6DCHQP.js +0 -2
- package/dist/chunk-BOW7SSQH.js +0 -43
- package/dist/chunk-C4RHHCKL.js +0 -7
- package/dist/chunk-C7C6AKAT.js +0 -117
- package/dist/chunk-CD6M6LS2.js +0 -16
- package/dist/chunk-CFE6PSG6.js +0 -2
- package/dist/chunk-CFNIGQMT.js +0 -2
- package/dist/chunk-CKBUBRYD.js +0 -2
- package/dist/chunk-CZW5MZ5B.js +0 -2
- package/dist/chunk-DBBZ63ZX.js +0 -2
- package/dist/chunk-DBN7DMJB.js +0 -18
- package/dist/chunk-DUULLZHZ.js +0 -3
- package/dist/chunk-DV5Y5NOS.js +0 -2
- package/dist/chunk-DZOIKCTM.js +0 -3
- package/dist/chunk-E4PKTOL3.js +0 -2
- package/dist/chunk-E7QR35ST.js +0 -2
- package/dist/chunk-EFSXAINW.js +0 -2
- package/dist/chunk-EHVEIEQN.js +0 -18
- package/dist/chunk-EHYDXE3Z.js +0 -2
- package/dist/chunk-EP63Y6LD.js +0 -2
- package/dist/chunk-EPX6NQN6.js +0 -4
- package/dist/chunk-ETC674NS.js +0 -5
- package/dist/chunk-F5GSBHC6.js +0 -3
- package/dist/chunk-FH3DGXC6.js +0 -2
- package/dist/chunk-FI7VGOR4.js +0 -16
- package/dist/chunk-FJF6VO2P.js +0 -2
- package/dist/chunk-FLMTCX5R.js +0 -2
- package/dist/chunk-FVFDOIM3.js +0 -2
- package/dist/chunk-G2HU5WRN.js +0 -2
- package/dist/chunk-G4ALYS4J.js +0 -2
- package/dist/chunk-G56I7K4W.js +0 -26
- package/dist/chunk-GC4DG2V5.js +0 -2
- package/dist/chunk-GG45PK4S.js +0 -4
- package/dist/chunk-GINH3YQU.js +0 -20
- package/dist/chunk-GTZZVLKJ.js +0 -2
- package/dist/chunk-GXXW5ZHH.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HAXXKRTD.js +0 -4
- package/dist/chunk-HEZWBAZY.js +0 -2
- package/dist/chunk-HMEWLMML.js +0 -2
- package/dist/chunk-HOBOVYPO.js +0 -11
- package/dist/chunk-HRFQ6GW5.js +0 -8
- package/dist/chunk-HX4X7KG3.js +0 -2
- package/dist/chunk-HYT2R7LX.js +0 -4
- package/dist/chunk-IKQVBVQL.js +0 -40
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-J6GLBBRK.js +0 -4
- package/dist/chunk-J7A4PWFX.js +0 -3
- package/dist/chunk-JCSAZ35V.js +0 -2
- package/dist/chunk-JDU2IV3A.js +0 -2
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JFMI5SGB.js +0 -4
- package/dist/chunk-JJP37RGX.js +0 -57
- package/dist/chunk-JZ2A7LDM.js +0 -5
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KNLQGXVH.js +0 -80
- package/dist/chunk-KVQCECPR.js +0 -2
- package/dist/chunk-KXXORBZ2.js +0 -4
- package/dist/chunk-L5KYH6U3.js +0 -35
- package/dist/chunk-L6XHYJPZ.js +0 -21
- package/dist/chunk-L7KTFEAV.js +0 -43
- package/dist/chunk-LDXHR5EL.js +0 -23
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-MHGDSBFX.js +0 -2
- package/dist/chunk-MLQVVDG3.js +0 -74
- package/dist/chunk-MOKUWRHO.js +0 -3
- package/dist/chunk-MPYAPMNE.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV6SPXCR.js +0 -7
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N55KIE46.js +0 -2
- package/dist/chunk-NB4D3BNM.js +0 -2
- package/dist/chunk-NGKBOT6G.js +0 -23
- package/dist/chunk-NJGKXKQF.js +0 -2
- package/dist/chunk-NJQISBL4.js +0 -8
- package/dist/chunk-NJT3ZEKY.js +0 -16
- package/dist/chunk-NKMKZP6A.js +0 -2
- package/dist/chunk-NODFZ6ED.js +0 -2
- package/dist/chunk-NSM5IEVW.js +0 -2
- package/dist/chunk-NTGUVNR2.js +0 -3
- package/dist/chunk-NU3KFF2O.js +0 -57
- package/dist/chunk-NWLVNU66.js +0 -557
- package/dist/chunk-NYKZMCRC.js +0 -4
- package/dist/chunk-O6BUXZEH.js +0 -6
- package/dist/chunk-ODPDP7A4.js +0 -3
- package/dist/chunk-OIAPEKMT.js +0 -3
- package/dist/chunk-OIOC5EHF.js +0 -3
- package/dist/chunk-ONPPQM4G.js +0 -2
- package/dist/chunk-OUHEZBYI.js +0 -2
- package/dist/chunk-OVGYW7UD.js +0 -29
- package/dist/chunk-OYKU4B3Y.js +0 -2
- package/dist/chunk-POBJ6FR2.js +0 -5
- package/dist/chunk-PSZPMMWN.js +0 -2
- package/dist/chunk-PXTRBKRK.js +0 -3
- package/dist/chunk-Q5JRIHT3.js +0 -4
- package/dist/chunk-Q7ATHARX.js +0 -2
- package/dist/chunk-Q7CSKIDM.js +0 -5
- package/dist/chunk-QBQE7ZJ5.js +0 -3
- package/dist/chunk-QH22UIXP.js +0 -5
- package/dist/chunk-QXCKQTKR.js +0 -60
- package/dist/chunk-RBAD4GJ2.js +0 -13
- package/dist/chunk-RMDPFPNW.js +0 -2
- package/dist/chunk-ROPJDEJZ.js +0 -4
- package/dist/chunk-RVZC6TJE.js +0 -2
- package/dist/chunk-S4QZBKSR.js +0 -3
- package/dist/chunk-SCPMZ73U.js +0 -2
- package/dist/chunk-SIAP5RGI.js +0 -73
- package/dist/chunk-SIX4RFR3.js +0 -3
- package/dist/chunk-SKKXTABJ.js +0 -16
- package/dist/chunk-SSRFUQBD.js +0 -2
- package/dist/chunk-SYVJEEUJ.js +0 -3
- package/dist/chunk-T3CZAZSI.js +0 -8
- package/dist/chunk-T6DWDI5E.js +0 -3
- package/dist/chunk-T6HRIROJ.js +0 -7
- package/dist/chunk-TAA7HXHE.js +0 -2
- package/dist/chunk-TJ2JQYT3.js +0 -2
- package/dist/chunk-TULNMD5T.js +0 -368
- package/dist/chunk-U2FPY5XA.js +0 -3
- package/dist/chunk-U3SXIMII.js +0 -38
- package/dist/chunk-U6KCHXJ4.js +0 -2
- package/dist/chunk-UH3XSKS5.js +0 -9
- package/dist/chunk-UIFUZVCC.js +0 -2
- package/dist/chunk-UXKURIVI.js +0 -2
- package/dist/chunk-V2RBODHL.js +0 -2
- package/dist/chunk-VBKUWB6N.js +0 -2
- package/dist/chunk-VBV6ALJE.js +0 -2
- package/dist/chunk-VDGFWCQV.js +0 -2
- package/dist/chunk-VDSDOEWF.js +0 -2
- package/dist/chunk-VZPWVCLN.js +0 -20
- package/dist/chunk-WDSFQDPN.js +0 -2
- package/dist/chunk-WFA35BGR.js +0 -7
- package/dist/chunk-WLMP3OCW.js +0 -2
- package/dist/chunk-WSA52GOR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-X3YVZAKZ.js +0 -5
- package/dist/chunk-X6OGVFIT.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XKXTR6ZI.js +0 -9
- package/dist/chunk-Y5DFAW5W.js +0 -4
- package/dist/chunk-YSYPDRD5.js +0 -3
- package/dist/chunk-ZFVPWH62.js +0 -5
- package/dist/chunk-ZGIHTH27.js +0 -2
- package/dist/chunk-ZGIQN2SX.js +0 -2
- package/dist/chunk-ZHG4WAHR.js +0 -12
- package/dist/chunk-ZKB2XUEN.js +0 -4
- package/dist/chunk-ZLMXIQLC.js +0 -21
- package/dist/chunk-ZMCQIHI4.js +0 -2
- package/dist/code-TAVIKWJI.js +0 -2
- package/dist/code-result-json-5FEFQCAQ.js +0 -2
- package/dist/command-descriptors-7BKH53Y3.js +0 -343
- package/dist/dataflow-GFBTVDH3.js +0 -2
- package/dist/dependence-slice-GWGQCODG.js +0 -2
- package/dist/deps-4QHVDPYA.js +0 -2
- package/dist/direct-navigation-4UBC6HNW.js +0 -3
- package/dist/entry-map-QCTF4RVY.js +0 -2
- package/dist/files-M2UBF5HJ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-2UIHRLW4.js +0 -2
- package/dist/imports-WIE3YZOB.js +0 -2
- package/dist/members-YKD636DA.js +0 -2
- package/dist/methods-VDF4IMYG.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-4UMDOOLO.js +0 -3
- package/dist/output-pagination-2GME6OPY.js +0 -19
- package/dist/project-reindex-XEQTRCV5.js +0 -3
- package/dist/queries/anchors.d.ts +0 -123
- package/dist/queries/anchors.js +0 -2
- package/dist/queries/complexity-hotspots.d.ts +0 -40
- package/dist/queries/complexity-hotspots.js +0 -2
- package/dist/queries/convergence.d.ts +0 -33
- package/dist/queries/convergence.js +0 -2
- package/dist/queries/dataflow.d.ts +0 -77
- package/dist/queries/dataflow.js +0 -2
- package/dist/queries/deep-chains.d.ts +0 -5
- package/dist/queries/deep-chains.js +0 -2
- package/dist/queries/extract-candidates.d.ts +0 -79
- package/dist/queries/extract-candidates.js +0 -2
- package/dist/queries/isolated.d.ts +0 -24
- package/dist/queries/isolated.js +0 -2
- package/dist/queries/plan-context.d.ts +0 -33
- package/dist/queries/plan-context.js +0 -2
- package/dist/queries/reference-neighborhood.d.ts +0 -4
- package/dist/queries/reference-neighborhood.js +0 -2
- package/dist/queries/reference-reachability.d.ts +0 -48
- package/dist/queries/reference-reachability.js +0 -2
- package/dist/queries/self-audit.d.ts +0 -69
- package/dist/queries/self-audit.js +0 -2
- package/dist/queries/similar-chains.d.ts +0 -48
- package/dist/queries/similar-chains.js +0 -2
- package/dist/queries/slice.d.ts +0 -4
- package/dist/queries/slice.js +0 -2
- package/dist/queries/stale-abstractions.d.ts +0 -72
- package/dist/queries/stale-abstractions.js +0 -2
- package/dist/queries/system-map.d.ts +0 -449
- package/dist/queries/system-map.js +0 -2
- package/dist/queries/trace.js +0 -2
- package/dist/queries/twin-ab.d.ts +0 -66
- package/dist/queries/twin-ab.js +0 -2
- package/dist/queries/value-flow.d.ts +0 -43
- package/dist/queries/value-flow.js +0 -2
- package/dist/queries/wrapper-candidates.d.ts +0 -49
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-JNK5CLM7.js +0 -2
- package/dist/refs-pagination-6BLRYGMV.js +0 -2
- package/dist/slice-PHPVNCWX.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-MQX5MPIV.js +0 -2
- package/dist/symbol-resolution-DBLVXLBC.js +0 -2
- package/dist/system-JOPKV4OG.js +0 -2
- package/dist/trace-I2P2YFH4.js +0 -2
- package/dist/value-flow-JJVMF7NP.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
- package/skills/conductor/SKILL.md +0 -110
- package/skills/conductor/agents/openai.yaml +0 -4
- package/skills/principal-maintainability-review/SKILL.md +0 -273
- package/skills/principal-maintainability-review/agents/openai.yaml +0 -4
- package/skills/scip-calibrate/SKILL.md +0 -102
- package/skills/scip-calibrate/agents/openai.yaml +0 -4
- package/skills/scip-claim-audit/SKILL.md +0 -113
- package/skills/scip-claim-audit/agents/openai.yaml +0 -4
- package/skills/scip-probe-reachability/SKILL.md +0 -93
- package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
- package/skills/scip-root-cause/SKILL.md +0 -160
- package/skills/scip-root-cause/agents/openai.yaml +0 -4
- package/skills/scip-system-compression/SKILL.md +0 -252
- package/skills/scip-system-compression/agents/openai.yaml +0 -4
- package/skills/scip-system-compression/references/compression-atlas.md +0 -116
- package/skills/scip-system-compression/references/compression-patterns.md +0 -87
- package/skills/scip-twin-drift/SKILL.md +0 -109
- package/skills/scip-twin-drift/agents/openai.yaml +0 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var o=[{id:"general-interprocedural-value-flow",families:["dataflow"],capability:"Whole-program definition-use flow through arbitrary calls and returns is unavailable.",consequence:"Missing dataflow edges cannot establish that a value never crosses an unmodeled call.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"heap-aliasing",families:["dataflow","state"],capability:"Heap points-to and cross-instance alias analysis are unavailable.",consequence:"Missing field or state edges cannot establish that two references never reach the same object.",recoverWith:["value-flow","dependence-slice","inspect","code"]},{id:"exceptional-flow",families:["execution","dataflow","temporal"],capability:"Interprocedural exception propagation and finally completion flow are unavailable.",consequence:"Normal-path reachability and ordering do not establish behavior after a throw or rejection.",recoverWith:["dependence-slice","inspect","code"]},{id:"dynamic-callable-dispatch",families:["execution","dataflow"],capability:"General virtual dispatch and interprocedural replacement of callable values are unavailable.",consequence:"A static declaration target does not establish a unique runtime implementation or all possible overrides.",recoverWith:["hierarchy","inspect","code"]},{id:"reflection",families:["execution","runtime","identity","dependencies"],capability:"Reflective lookup, dynamic loading, and name-computed invocation are unavailable without exact evidence.",consequence:"Missing static edges cannot establish that a construct is unreachable through reflection.",recoverWith:["search","inspect","code"]},{id:"generated-dispatch",families:["execution","runtime","identity"],capability:"Dispatch tables or names created only by generated or unavailable source are unavailable.",consequence:"Missing dispatch edges cannot establish that no generated consumer exists.",recoverWith:["search","inspect","code"]},{id:"unsupported-framework-adapters",families:["runtime","dataflow","state","temporal"],capability:"Framework runtime crossings without a registered source adapter are unavailable.",consequence:"Missing boundary edges cannot establish that no producer, consumer, state effect, or ordering exists.",recoverWith:["search","inspect","code"]}];function s(t){let i=new Set(t);return o.filter(n=>n.families.some(r=>i.has(r)))}function u(t){return s(t).map(i=>`[${i.id}] ${i.capability} ${i.consequence} Recover selected paths with: ${i.recoverWith.map(n=>`scip-query ${n}`).join(", ")}.`)}var c=["incoming","outgoing","both"];function e(t,i,n,r={}){return{family:t,subtype:i,...r.match?{match:r.match}:{},directions:c,evidenceStrengths:r.strengths??["exact","derived","mixed"],supportCeiling:r.supportCeiling??"partial",establishes:n,nonClaims:r.nonClaims??[],recoverWith:r.recoverWith??["inspect","code"]}}var l=["predicate-consequence","predicate-alternative","predicate-fallthrough","predicate-case","predicate-default","predicate-return","predicate-throw","loop-iteration","loop-exit","exception-handler","finally-cleanup","handler-return","handler-throw"],d=["captured-value-to-state","constant-to-state","expression-to-state","property-to-state","return-to-state","value-to-state"],p=["await-completion-before","awaits-completion","inside-lock-scope","lexical-successor"],h=[{id:"indexed-program-identity",label:"SCIP/compiler identity and source ownership",requirements:["indexed-graph"],relations:[e("execution","call","The source construct may call the resolved target.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["Static may-call reachability does not prove that an invocation occurred at runtime.","Compiler declaration identity does not resolve virtual dispatch, cross-file callable replacement, or runtime receiver identity.","Candidate call edges preserve declaration leads; consult the invocation frontier for implementation resolution. A declaration reference is not an established implementation target."],recoverWith:["call-graph","inspect","code"]}),e("execution","result-callback","The referenced callable can produce the result consumed by this path.",{nonClaims:["A callback relationship does not prove invocation order or runtime selection."],recoverWith:["call-graph","inspect","code"]}),e("contract","uses-contract-symbol","The source construct refers to the identified contract symbol.",{supportCeiling:"exact",nonClaims:["Contract identity does not prove runtime invocation or behavioral conformance."],recoverWith:["hierarchy","inspect","code"]}),e("identity","references","The occurrence resolves to the identified compiler-owned symbol.",{supportCeiling:"exact",nonClaims:["A reference does not establish execution or value transfer."],recoverWith:["refs","inspect"]}),e("ownership","contains","The owner contains the identified program construct.",{supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),e("ownership","contains-","The owner contains the identified program construct.",{match:"prefix",supportCeiling:"exact",nonClaims:["Structural containment does not establish runtime lifetime or sharing scope."],recoverWith:["outline","inspect"]}),e("ownership","owns-","The owner owns the identified source or runtime observation.",{match:"prefix",supportCeiling:"exact",nonClaims:["Observation ownership does not establish singleton lifetime or exclusive ownership."],recoverWith:["inspect","code"]}),e("dependencies","imports","The source file or module statically imports the indexed target.",{nonClaims:["An import does not establish that imported code executes."],recoverWith:["imports","deps","code"]}),e("dependencies","imports-external","The source region statically imports an external package.",{nonClaims:["An external import does not establish which package behavior executes."],recoverWith:["imports","code"]})]},{id:"runtime-boundary-join",label:"source-grounded runtime-boundary joins",requirements:["indexed-graph","source-facts"],relations:[e("runtime","runtime-handoff","A producer and consumer share a source-grounded runtime rendezvous.",{strengths:["exact","derived","candidate","mixed"],nonClaims:["A candidate or unresolved join does not prove a runtime handoff."],recoverWith:["evidence","inspect","code"]}),e("runtime","discriminator-dispatch","A serialized discriminator selects the reported consumer.",{strengths:["exact","derived","mixed"],nonClaims:["The dispatch edge does not prove delivery, retry, or successful handling."],recoverWith:["evidence","inspect","code"]}),e("dataflow","serialized-discriminator-transfer","The producer serializes the discriminator consumed by dispatch.",{strengths:["exact","derived","mixed"],nonClaims:["This edge does not establish the flow of every payload field."],recoverWith:["value-flow","inspect","code"]}),e("temporal","enqueue-before-consume","The reported enqueue precedes a possible consume through the queue.",{strengths:["exact","derived","mixed"],nonClaims:["Queue order does not establish delivery time, uniqueness, retry count, or durability."],recoverWith:["evidence","inspect","code"]})]},{id:"parser-control-dependence",label:"parser-proved intraprocedural control dependence",requirements:["indexed-graph","source-facts"],relations:[...l.map(t=>e("execution",t,"The outcome is control-dependent on the reported predicate or handler.",{strengths:["exact"],nonClaims:["Local control dependence does not establish that the containing function executes."],recoverWith:["dependence-slice","inspect","code"]})),e("execution","returns","The selected construct contains the reported return terminal.",{strengths:["exact"],nonClaims:["A local return terminal does not establish that the containing callable executes."],recoverWith:["inspect","code"]}),e("execution","throws","The selected construct contains the reported throw terminal.",{strengths:["exact"],nonClaims:["A local throw terminal does not establish propagation, handling, or callable execution."],recoverWith:["inspect","code"]})]},{id:"bounded-static-value-flow",label:"compiler callsites and bounded static value evaluation",requirements:["indexed-graph","source-facts"],relations:["argument-to-parameter","constant-to-parameter","property-to-parameter","return-to-parameter","return-to-call-result"].map(t=>e("dataflow",t,"The reported value may reach the target through the evidenced callsite transfer.",{strengths:["exact","derived","mixed"],nonClaims:["This provider does not establish general local definition-use, alias, field, or heap flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}))},{id:"typescript-local-dependence",label:"TypeScript compiler identities, control-flow graph, and reaching definitions",requirements:["typescript-semantic"],relations:[e("dataflow","definition-to-use","The definition reaches the reported read on a feasible local control-flow path.",{strengths:["exact"],nonClaims:["Local reaching definitions do not establish heap aliasing, exceptional flow, or the runtime order of closure invocation."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("dataflow","value-to-definition","The reported right-hand-side read supplies the assigned local definition.",{strengths:["exact"],nonClaims:["A local assignment edge does not establish field or heap points-to flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("dataflow","closure-capture","The nested callable reads the reported binding from an enclosing callable.",{strengths:["candidate"],supportCeiling:"candidate",nonClaims:["Closure capture does not establish whether or when the nested callable executes."],recoverWith:["call-graph","inspect","code"]}),e("dataflow","field-definition-to-use","The reported same-owner field definition can reach the field read.",{strengths:["exact","candidate"],nonClaims:["Field-name identity does not establish whole-program heap aliasing or cross-instance flow."],recoverWith:["value-flow","dependence-slice","inspect","code"]}),e("execution","control-dependence","Execution of the reported statement depends on the outcome of the predicate.",{strengths:["exact"],nonClaims:["Intraprocedural control dependence does not establish that the containing callable executes."],recoverWith:["dependence-slice","inspect","code"]})]},{id:"parser-state-temporal",label:"parser-proved local state and temporal facts",requirements:["indexed-graph","source-facts"],relations:[...d.map(t=>e("dataflow",t,"The reported source value is assigned into the identified state resource.",{strengths:["exact"],nonClaims:["The edge does not establish alias, heap, or later read flow."],recoverWith:["value-flow","inspect","code"]})),...["writes-resource","deletes-resource","reads-resource","enqueues-resource","consumes-resource"].map(t=>e("state",t,"The reported construct performs the named operation on the identified resource.",{strengths:["exact"],nonClaims:["A state operation does not establish transactionality, durability, or exclusive ownership."],recoverWith:["evidence","inspect","code"]})),...p.map(t=>e("temporal",t,"The reported source constructs have the named local ordering relationship.",{strengths:["exact"],nonClaims:["Local source order does not establish cross-process happens-before or durable completion."],recoverWith:["evidence","inspect","code"]}))]}];function m(t,i){let n=h.flatMap(r=>r.relations.filter(a=>a.family===t&&(a.match==="prefix"?i.startsWith(a.subtype):i===a.subtype)).map(a=>({provider:r,relation:a})));if(n.length>1)throw new Error(`Ambiguous graph relation provider for ${t}/${i}: ${n.map(r=>r.provider.id).join(", ")}`);return n[0]??null}export{u as a,m as b};
|
|
2
|
+
//# sourceMappingURL=chunk-2FSBGL5P.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function f(o,r,e,i){let t=0;for(;t<r.length;){let n=e.writeFile(o,r,t,r.length-t);if(!Number.isSafeInteger(n)||n<=0||n>r.length-t)throw new Error(`${i} write did not make valid forward progress`);t+=n}}function l(o,r){if(r!=="win32")return!1;let e=o.code;return e==="EACCES"||e==="EBADF"||e==="EINVAL"||e==="EISDIR"||e==="EPERM"}export{f as a,l as b};
|
|
2
|
+
//# sourceMappingURL=chunk-2HLAFUCY.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as c}from"./chunk-T6DK3ZP7.js";function d(e,r,n){e!==void 0&&typeof e!="boolean"&&n.push({level:"error",path:r,message:"Must be a boolean."})}function $(e,r){if(e.architecture===void 0)return;if(!c(e.architecture)){r.push({level:"error",path:"architecture",message:"Must be an object."});return}let n=e.architecture,t=n.boundaries;if(!Array.isArray(t)||t.length===0){r.push({level:"error",path:"architecture.boundaries",message:"Must be a non-empty array."});return}let o={names:new Set,paths:new Set};for(let[i,s]of t.entries())g(s,`architecture.boundaries[${i}]`,o,r);y(n.allowedDependencies,o.names,r),b(n,r),P(n,o.names,r)}function g(e,r,n,t){if(!c(e)){t.push({level:"error",path:r,message:"Architecture boundary must be an object."});return}let o=e.name;typeof o!="string"||o.trim()===""?t.push({level:"error",path:`${r}.name`,message:"Boundary name is required."}):n.names.has(o)?t.push({level:"error",path:`${r}.name`,message:`Duplicate boundary name: ${o}`}):n.names.add(o);let i=e.subUnits;i!==void 0&&i!=="directory"&&i!=="file"&&t.push({level:"error",path:`${r}.subUnits`,message:"Must be 'directory' or 'file'."}),p(e.maxFiles,`${r}.maxFiles`,t),h(e.paths,`${r}.paths`,n.paths,t)}function h(e,r,n,t){if(!Array.isArray(e)||e.length===0){t.push({level:"error",path:r,message:"Boundary paths must be a non-empty array."});return}for(let[o,i]of e.entries()){let s=`${r}[${o}]`;if(typeof i!="string"||i.trim()===""){t.push({level:"error",path:s,message:"Boundary path must be a non-empty string."});continue}v(i)||t.push({level:"error",path:s,message:"Boundary path must be project-relative and may use only one trailing /* or /** glob."}),n.has(i)?t.push({level:"error",path:s,message:`Duplicate boundary path: ${i}`}):n.add(i)}}function y(e,r,n){if(e!==void 0){if(!c(e)){n.push({level:"error",path:"architecture.allowedDependencies",message:"Must be an object keyed by boundary name."});return}for(let[t,o]of Object.entries(e))C(t,o,r,n)}}function C(e,r,n,t){let o=`architecture.allowedDependencies.${e}`;if(n.has(e)||t.push({level:"error",path:o,message:`Unknown source boundary: ${e}`}),!Array.isArray(r)){t.push({level:"error",path:o,message:"Dependency row must be an array."});return}let i=new Set;for(let[s,a]of r.entries()){let l=`${o}[${s}]`;typeof a!="string"||a.trim()===""?t.push({level:"error",path:l,message:"Target boundary name is required."}):n.has(a)?i.has(a)?t.push({level:"error",path:l,message:`Duplicate target boundary: ${a}`}):i.add(a):t.push({level:"error",path:l,message:`Unknown target boundary: ${a}`})}}function b(e,r){for(let t of["requireAcyclic","requireCompleteCoverage","requireResolvedBoundaries","requireMinimalPolicy"])d(e[t],`architecture.${t}`,r);for(let t of["maxBoundaryFanOut","maxBoundaryFiles"])p(e[t],`architecture.${t}`,r);let n=e.testPaths;n!==void 0&&(!Array.isArray(n)||n.some(t=>typeof t!="string"))&&r.push({level:"error",path:"architecture.testPaths",message:"Must be an array of strings."})}function P(e,r,n){if(d(e.requireCompletePolicy,"architecture.requireCompletePolicy",n),e.requireCompletePolicy!==!0)return;let t=c(e.allowedDependencies)?e.allowedDependencies:{};for(let o of[...r].sort())Object.hasOwn(t,o)||n.push({level:"error",path:`architecture.allowedDependencies.${o}`,message:"A dependency row is required by architecture.requireCompletePolicy."})}function p(e,r,n){e!==void 0&&(typeof e!="number"||!Number.isInteger(e)||e<0)&&n.push({level:"error",path:r,message:"Must be a non-negative integer."})}function v(e){let r=e.replace(/\\/g,"/");if(/^(?:\/|[a-z]:)/i.test(r)||r==="."||r===".."||r.split("/").includes(".."))return!1;let n=r.replace(/\/\*\*?$/,"");return n.length>0&&!/[*?[\]]/.test(n)}var u=1,f=2,j="./node_modules/scip-query/docs/schemas/project-config.schema.json";function _(e){let r=e;if(typeof e=="string")try{r=JSON.parse(e)}catch(n){return{kind:"malformed",reason:`invalid JSON: ${n instanceof Error?n.message:String(n)}`}}return c(r)?w(r):{kind:"malformed",reason:"project config must be a JSON object"}}function w(e){let r=e.schemaVersion;if(r!==void 0&&!Number.isInteger(r))return{kind:"malformed",reason:"schemaVersion must be an integer"};let n=r===void 0?u:r;return n!==u&&n!==f?{kind:"unsupported",schemaVersion:n,direction:n<u?"older":"future"}:A(e,n)}function A(e,r){let n=e.$schema;if(n!==void 0&&(typeof n!="string"||n.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let t=m(e),o=r!==f||typeof e.$schema!="string";return r===u?{kind:"legacy",sourceVersion:u,config:t,needsMigration:o}:{kind:"supported",sourceVersion:f,config:t,needsMigration:o}}function m(e){let r=e,{$schema:n,schemaVersion:t,...o}=r;return{$schema:typeof n=="string"&&n.trim()!==""?n:j,schemaVersion:f,...o}}function E(e){return`${JSON.stringify(m(e),null,2)}
|
|
2
|
+
`}export{$ as a,u as b,f as c,_ as d,m as e,E as f};
|
|
3
|
+
//# sourceMappingURL=chunk-2IWUT6CJ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as u,c as m}from"./chunk-NOLZOVCU.js";function x(e){let n=[],r=[],s=[];for(let t of e.primitiveGroups)t.values.length!==0&&g(t.bucket,r,s).push(`${t.reasonPrefix}: ${t.values.join(", ")}`);for(let t of e.nameGroups)f(t.names,t.label,e.genericWords,e.stripPrefixes??[],n,g(t.fallbackBucket,r,s));let o=v(n,r,s);return{actionTier:o==="domain-behavior"||o==="mixed"?"signal":"support",evidenceClass:o,reasons:[...n,...s,...r].slice(0,6),recommendation:e.recommendation(o)}}function b(e,n){if(e.size===0||n.size===0)return 0;let o=u(e,n).size/Math.min(e.size,n.size)*Math.min(1,Math.min(e.size,n.size)/(.35*Math.max(e.size,n.size)));return Math.max(m(e,n),o)}function y(e,n){let r=Object.fromEntries(e.map(s=>[s.name,s.count]));for(let s of n)if(Object.entries(s.min).every(([a,t])=>(r[a]??0)>=t))return{pass:!0,reason:s.reason,counts:r};return{pass:!1,reason:"shared tokens did not meet calibrated overlap thresholds",counts:r}}function A(e,n,r){let s=n.map(i=>{let l=i.value(e),d=i.weightedValue?i.weightedValue(e,l):l;return{axis:i,value:l,weighted:d,qualifies:i.qualifies?i.qualifies(e,l):l>0}}),o=s.filter(i=>i.qualifies&&i.axis.reason).map(i=>i.axis.reason(e,i.value)),a=s.filter(i=>i.qualifies&&i.axis.dominantEligible!==!1).sort((i,l)=>l.weighted-i.weighted)[0],t=a&&a.weighted>0?a.axis.axis:r,c=[...new Set(s.filter(i=>i.qualifies).map(i=>i.axis.axis).concat(o.length>0?[]:[t]))];return{dominantPressure:t,pressureKinds:c,reasons:o}}function P(e,n){return[...e].filter(r=>r.startsWith(n)).map(r=>r.slice(n.length)).sort()}function B(e){return[...e].sort()}function f(e,n,r,s,o,a){let t=[],c=[];for(let i of e)p(i,s).filter(d=>!r.has(d)).length>0?t.push(i):c.push(i);t.length&&o.push(`${n} has name(s) outside the generic vocabulary: ${t.slice(0,6).join(", ")}`),c.length&&a.push(`${n} matches the generic-name vocabulary: ${c.slice(0,6).join(", ")}`)}function p(e,n){let r=e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2");for(let s of n)r=r.replace(s,"");return r.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function g(e,n,r){return e==="generic"?n:r}function F(e,n){return+(e.actionTier!=="signal")-+(n.actionTier!=="signal")||n.similarity-e.similarity||e.fileA.localeCompare(n.fileA)||e.componentA.localeCompare(n.componentA)||e.fileB.localeCompare(n.fileB)||e.componentB.localeCompare(n.componentB)}function v(e,n,r){let s=e.length>0,o=n.length>0,a=r.length>0;return s?o||a?"mixed":"domain-behavior":a?"shared-abstraction":"generic-workflow-scaffolding"}export{x as a,b,y as c,A as d,P as e,B as f,F as g};
|
|
2
|
+
//# sourceMappingURL=chunk-2KNN7GTQ.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as F}from"./chunk-NJJMVD65.js";import{a as V,b as q}from"./chunk-6FFVZZL4.js";import{a as C}from"./chunk-JEVRKFRL.js";import{c as X}from"./chunk-BL6XJKTA.js";import{b as j,e as k,i as x}from"./chunk-HRRFKWPZ.js";import{d as z}from"./chunk-QZ7KQZRN.js";import{d as h,e as N,f as $,i as G}from"./chunk-62BDNPMI.js";var H=class extends Error{constructor(t){super(t),this.name="ReindexLockUnavailableError"}};import{existsSync as te,statSync as Ee}from"fs";import{dirname as ie,join as re}from"path";import{appendFileSync as me,existsSync as ye,mkdirSync as pe,renameSync as Re,rmSync as be,statSync as xe,truncateSync as Ae}from"fs";import{basename as Be,dirname as he}from"path";var v=".previous",ve=".rotation.lock",Te=2e3,J=class extends Error{constructor(n,i){super(`Timed out after ${i}ms waiting for rotating JSONL lock: ${n}`);this.lockPath=n;this.timeoutMs=i;this.name="RotatingJsonlLockTimeoutError"}lockPath;timeoutMs;code="ROTATING_JSONL_LOCK_TIMEOUT"},I=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"},Y=Object.freeze({monotonicNow:z,wait(e){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,e)},tryAcquireLock(e,t){let n=X(e,{kind:"rotating-jsonl",detail:{target:Be(t)}});return n.kind==="acquired"?{kind:"acquired",lock:n.lock}:{kind:"contended"}},makeDirectory(e){pe(e,{recursive:!0})},exists:ye,readBytes(e){return $(e,{maxBytes:h,inputKind:"rotating JSONL segment"})},size(e){return xe(e).size},truncate:Ae,remove(e){be(e,{force:!0})},rename:Re,append:me});function K(e,t,n){let i=n.runtime??Y,r=JSON.stringify(t);if(r===void 0)throw new TypeError("Rotating JSONL records must be JSON-serializable values.");let a=Buffer.from(`${r}
|
|
2
|
+
`),s=Math.max(1,Math.floor(n.maxSegmentBytes),a.length);return Q(e,n.lockTimeoutMs,i,()=>{i.makeDirectory(he(e));let l=Se(e,h,i);n.onPhase?.("tail-repaired");let o=`${e}${n.previousSuffix??v}`,c=!1,f=!1;return i.exists(e)&&i.size(e)+a.length>s&&(i.exists(o)&&(i.remove(o),f=!0),n.onPhase?.("previous-pruned"),i.rename(e,o),c=!0,n.onPhase?.("current-rotated")),i.append(e,a),n.onPhase?.("record-appended"),{lineBytes:a.length,segmentLimitBytes:s,repairedTailBytes:l,rotated:c,prunedPrevious:f}})}function Z(e,t={}){let n=t.runtime??Y,i=Le(t.maxSegmentBytes);return Q(e,t.lockTimeoutMs,n,()=>{let r=[],a=0,s=`${e}${t.previousSuffix??v}`;for(let l of[s,e]){if(!n.exists(l))continue;let o=Oe(ee(l,i,n));r.push(...o.lines),a+=o.partialTailBytes}return{lines:r,ignoredPartialTailBytes:a}})}function Q(e,t,n,i){let r=`${e}${ve}`,a=Math.max(0,t??Te),s=n.monotonicNow()+a,l;for(;;){let g=n.tryAcquireLock(r,e);if(g.kind==="acquired"){l=g.lock;break}let R=s-n.monotonicNow();if(R<=0)throw new J(r,a);n.wait(Math.min(5,R))}let o=!1,c,f;try{f=i()}catch(g){o=!0,c=g}let p=!1;try{p=l.release()}catch(g){if(!o)throw g}if(o)throw c;if(!p)throw new I(r);return f}function Se(e,t,n){if(!n.exists(e))return 0;let i=ee(e,t,n);if(i.length===0||i[i.length-1]===10)return 0;let r=i.lastIndexOf(10),a=r<0?0:r+1;return n.truncate(e,a),i.length-a}function Le(e){let t=e??h;if(!Number.isSafeInteger(t)||t<=0)throw new RangeError(`maxSegmentBytes must be a positive safe integer; received ${t}`);return t}function ee(e,t,n){let i=n.size(e);if(i>t)throw new N("rotating JSONL segment",e,"too-large",i,t);let r=n.readBytes(e),a=n.size(e);if(a!==i||r.byteLength!==i)throw new N("rotating JSONL segment",e,"changed-during-read",a,t);return r}function Oe(e){let t=e.lastIndexOf(10),n=t<0?0:t+1;return{lines:e.subarray(0,n).toString("utf8").split(`
|
|
3
|
+
`).filter(r=>r.length>0),partialTailBytes:e.length-n}}var Pe="reindex-activity.jsonl",T=v,we=1024*1024,_e=1440*60*1e3,ae=e=>G(e,"reindex activity segment");function S(e){return re(ie(e),Pe)}function se(e){if(e.reused)return 0;let n=(e.shards?.some(i=>!i.reused&&i.strategy==="incremental")??!1?0:M(e.indexPath))+M(e.dbPath);for(let i of e.shards??[]){if(i.reused)continue;let r=i.producedOutputBytes??i.outputBytes;r!==null&&(n+=r)}return n}function Ne(e){let t=se(e),n=e.writeTelemetry;return n?Math.max(0,t-n.reflinkedBytes)+n.fallbackCopiedBytes+(n.incrementalWrittenBytes??0):t}function Wt(e,t){let n=t.lastRefresh;if(!n)return{state:"failed",reason:"reindex result has no refresh metadata"};let i=se(t);return D(S(e),{version:1,event:"run",recordedAt:n.completedAt,trigger:n.trigger,result:n.result,durationMs:n.durationMs,estimatedLogicalOutputBytes:i,estimatedWriteBytes:Ne(t),reflinkedBytes:t.writeTelemetry?.reflinkedBytes??0,fallbackCopiedBytes:t.writeTelemetry?.fallbackCopiedBytes??0,incrementalWrittenBytes:t.writeTelemetry?.incrementalWrittenBytes??0,byLanguage:qe(t)})}function Ut(e,t){return D(S(e),{version:1,event:"run",recordedAt:t.completedAt,trigger:t.trigger,result:"failed",durationMs:t.durationMs,estimatedLogicalOutputBytes:0})}function Ft(e,t,n=new Date){return D(S(e),{version:1,event:"suppressed",recordedAt:n.toISOString(),trigger:t,reason:"completed-index-is-fresh"})}function ke(e,t,n=we,i){K(e,t,{maxSegmentBytes:n,previousSuffix:T,...i?{runtime:i}:{}})}function Ce(e,t=new Date,n=_e,i=ae){let r=t.getTime(),a=r-n,s=Je(a,t),l=Ie(S(e),i,s);if(l===null)return s;for(let o of l){let c=Me(o,a,r,s);if(!c)continue;let{record:f}=c;if(s.invalidLanguageDetails+=c.invalidLanguageDetails,s.byTrigger[f.trigger.kind]=(s.byTrigger[f.trigger.kind]??0)+1,f.event==="suppressed"){s.suppressed+=1;continue}De(s,c,f)}return s.ignoredPartialTailBytes>0&&s.confidence!=="unavailable"&&(s.confidence="partial"),s.languageAttribution=at(s),s}function Je(e,t){return{confidence:"complete",recordsRead:0,invalidRecords:0,skippedRecords:0,readErrors:0,ignoredPartialTailBytes:0,windowStartedAt:new Date(e).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}}}function Ie(e,t,n){let i=[];if(t===ae){if(!te(e)&&!te(`${e}${T}`))return null;try{let r=Z(e,{previousSuffix:T});i=r.lines,n.ignoredPartialTailBytes=r.ignoredPartialTailBytes}catch{n.readErrors+=1,n.confidence="unavailable"}}else{let r=0;for(let a of[`${e}${T}`,e])try{i.push(...st(t(a))),r+=1}catch{n.readErrors+=1}r===0?n.confidence="unavailable":n.readErrors>0&&(n.confidence="partial")}return i}function Me(e,t,n,i){i.recordsRead+=1;let r=Fe(e);if(!r)return i.invalidRecords+=1,i.confidence!=="unavailable"&&(i.confidence="partial"),null;let{record:a}=r,s=Date.parse(a.recordedAt);return s<t||s>n?(i.skippedRecords+=1,null):r}function De(e,t,n){e.runs+=1,e[n.result]+=1,e.estimatedLogicalOutputBytes+=n.estimatedLogicalOutputBytes;let i=je(n);e.estimatedWriteBytes+=i,e.reflinkedBytes+=n.reflinkedBytes??0,e.fallbackCopiedBytes+=n.fallbackCopiedBytes??0,We(e,t,n);let r=Ve(n);r&&e.oldestRebuildAt===void 0&&(e.oldestRebuildAt=n.recordedAt),r&&(e.fullRebuilds+=1),i>0&&e.oldestWriteAt===void 0&&(e.oldestWriteAt=n.recordedAt),Ue(e.automatic,n,r,i)}function We(e,t,n){n.result!=="failed"&&(t.hasLanguageDetails?e.attributedRuns+=1:e.unattributedRuns+=1);for(let[i,r]of oe(n.byLanguage)){let a=e.byLanguage[i]??=rt();a.runs+=1,a[r.result]+=1,a.producedOutputBytes+=r.producedOutputBytes,a.durationMs+=r.durationMs}}function Ue(e,t,n,i){ze(t.trigger)&&(e.runs+=1,t.result==="rebuilt"&&(e.rebuilt+=1),n&&(e.fullRebuilds+=1,e.oldestRebuildAt??=t.recordedAt),e.estimatedWriteBytes+=i,i>0&&(e.oldestWriteAt??=t.recordedAt))}function D(e,t){try{return ke(e,t),{state:"recorded"}}catch(n){return{state:"failed",reason:n instanceof Error?n.message:String(n)}}}function Fe(e){try{let t=JSON.parse(e);if(!t||typeof t!="object")return null;let n=t;if(!$e(n))return null;if(n.event==="suppressed")return n.reason==="completed-index-is-fresh"?{record:n,hasLanguageDetails:!1,invalidLanguageDetails:0}:null;if(!Ge(n))return null;let i=n,{byLanguage:r,...a}=i,s=Qe(r);return{record:{...a,...s.byLanguage?{byLanguage:s.byLanguage}:{}},hasLanguageDetails:s.hasLanguageDetails,invalidLanguageDetails:s.invalidLanguageDetails}}catch{return null}}function $e(e){return e.version===1&&j(e.recordedAt)&&!!e.trigger&&F(e.trigger.kind)}function Ge(e){return e.event!=="run"||e.result!=="rebuilt"&&e.result!=="reused"&&e.result!=="failed"||!x(e.durationMs)||!x(e.estimatedLogicalOutputBytes)?!1:[e.estimatedWriteBytes,e.reflinkedBytes,e.fallbackCopiedBytes,e.incrementalWrittenBytes].every(t=>t===void 0||x(t))}function je(e){return e.reflinkedBytes===void 0?e.estimatedWriteBytes??e.estimatedLogicalOutputBytes:Math.max(0,e.estimatedLogicalOutputBytes-e.reflinkedBytes)+(e.fallbackCopiedBytes??0)+(e.incrementalWrittenBytes??0)}function $t(e,t,n=new Date){return t.enabled?Xe(Ce(e,n,t.windowMs),t,n.getTime()):{state:"allowed",rebuilt:0,estimatedWriteBytes:0}}function ze(e){return e.kind.startsWith("watch-")}function Xe(e,t,n){let i=e.automatic??{fullRebuilds:e.fullRebuilds??e.rebuilt,estimatedWriteBytes:e.estimatedWriteBytes??e.estimatedLogicalOutputBytes,oldestRebuildAt:e.oldestRebuildAt,oldestWriteAt:e.oldestWriteAt},r=i.estimatedWriteBytes,a=i.fullRebuilds,s={rebuilt:a,estimatedWriteBytes:r};return t.enabled?e.confidence!==void 0&&e.confidence!=="complete"?{state:"paused",reason:"activity-evidence",until:n+t.windowMs,...s,detail:`reindex activity evidence is ${e.confidence}`}:a>=t.maxRebuilds?{state:"paused",reason:"rebuild-count",until:ne(i.oldestRebuildAt,t.windowMs,n),...s,detail:`${a}/${t.maxRebuilds} expensive full rebuild slots consumed by automatic refreshes`}:r>=t.maxEstimatedWriteBytes?{state:"paused",reason:"estimated-write-bytes",until:ne(i.oldestWriteAt,t.windowMs,n),...s,detail:`${r}/${t.maxEstimatedWriteBytes} estimated write bytes consumed by automatic refreshes`}:{state:"allowed",...s}:{state:"allowed",...s}}function Ve(e){if(e.result!=="rebuilt")return!1;let t=oe(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 i=e?Date.parse(e):Number.NaN;return Number.isFinite(i)&&i+t>n?i+t:n+t}function M(e){try{return Ee(e).size}catch{return 0}}function qe(e){let t={};for(let n of e.languages)t[n]=He(e,n);return t}function He(e,t){let n=(e.shards??[]).filter(o=>o.language===t),i=n.find(o=>o.id===t),r=Ke(e.reused,n,i),a=M(re(ie(e.dbPath),"language-indexes",`${t}.scip`)),s=a>0?a:i?.outputBytes??a,l=Ze(r,n,i);return{result:r?"reused":"rebuilt",strategy:r?"reused":i?.strategy??"full",...Ye(i),outputBytes:s,producedOutputBytes:r?0:i?.producedOutputBytes??s,durationMs:l}}function Ye(e){return e?.strategy==="full"&&(e.fallbackReason??e.missReason)?{fallbackReason:e.fallbackReason??e.missReason}:{}}function Ke(e,t,n){return e||(n?n.reused:t.length>0&&t.every(i=>i.reused))}function Ze(e,t,n){return e?0:n?.durationMs??t.filter(i=>!i.reused).reduce((i,r)=>i+r.durationMs,0)}function Qe(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[r,a]of Object.entries(e)){if(!it(r)||!et(a)){n+=1;continue}t[r]=a}let i=Object.keys(t).length>0;return{...i?{byLanguage:t}:{},hasLanguageDetails:i,invalidLanguageDetails:n}}function et(e){if(!e||typeof e!="object")return!1;let t=e;return tt(t)&&nt(t)}function tt(e){return(e.result==="rebuilt"||e.result==="reused")&&(e.strategy===void 0||e.strategy==="reused"||e.strategy==="incremental"||e.strategy==="full")&&(e.fallbackReason===void 0||typeof e.fallbackReason=="string")}function nt(e){return k(e.outputBytes)&&k(e.producedOutputBytes)&&x(e.durationMs)&&(e.result!=="reused"||e.producedOutputBytes===0&&e.durationMs===0)&&e.producedOutputBytes<=e.outputBytes}function it(e){return C.includes(e)}function oe(e){return e?C.flatMap(t=>{let n=e[t];return n?[[t,n]]:[]}):[]}function rt(){return{runs:0,rebuilt:0,reused:0,producedOutputBytes:0,durationMs:0}}function at(e){let t=e.invalidLanguageDetails??0,n=e.attributedRuns??0;return(e.unattributedRuns??0)===0&&t===0?"complete":n===0?"unavailable":"partial"}function st(e){return e.endsWith(`
|
|
4
|
+
`)||(e=e.slice(0,Math.max(0,e.lastIndexOf(`
|
|
5
|
+
`)+1))),e.split(`
|
|
6
|
+
`).filter(t=>t.length>0)}var ot=new Map([[8,"\u2408"],[9,"\u2409"],[10,"\u2424"],[13,"\u240D"]]);function ut(e,t={}){let n=t.allowNewlines??!0,i=t.allowTabs??!0,r="";for(let a=0;a<e.length;){let s=e.charCodeAt(a);if(s===27){a=ct(e,a);continue}if(s===155){a=ue(e,a+1);continue}if(dt(s)){a=de(e,a+1);continue}if(mt(s)){r+=lt(s,n,i),a+=1;continue}if(yt(s)){r+="\uFFFD",a+=1;continue}r+=e[a],a+=1}return r}function dt(e){return e===144||e===152||e===157||e===158||e===159}function lt(e,t,n){return e===10&&t?`
|
|
7
|
+
`:e===9&&n?" ":ot.get(e)??"\uFFFD"}function jt(e){return ut(e,{allowNewlines:!1,allowTabs:!1})}function ct(e,t){let n=e.charCodeAt(t+1);if(Number.isNaN(n))return e.length;if(n===91)return ue(e,t+2);if(pt.has(n))return de(e,t+2);let i=t+1;for(;i<e.length&&ft(e.charCodeAt(i));)i+=1;return i<e.length&>(e.charCodeAt(i))?i+1:t+1}function ue(e,t){let n=t;for(;n<e.length;){let i=e.charCodeAt(n);if(n+=1,i>=64&&i<=126)return n}return e.length}function de(e,t){let n=t;for(;n<e.length;){let i=e.charCodeAt(n);if(i===7||i===156)return n+1;if(i===27&&e.charCodeAt(n+1)===92)return n+2;n+=1}return e.length}function ft(e){return e>=32&&e<=47}function gt(e){return e>=48&&e<=126}function mt(e){return e<=31||e>=127&&e<=159}function yt(e){return e===1564||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297}var pt=new Set([80,88,93,94,95]);function Xt(e){let t=JSON.stringify(e);return Buffer.byteLength(t)<=65536?t:void 0}function Vt(e){if(!(!e||Buffer.byteLength(e)>65536))try{return ht(JSON.parse(e))}catch{return}}function Rt(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.version===1&&(t.baseGeneration===null||typeof t.baseGeneration=="string")&&typeof t.complete=="boolean"&&bt(t.entries)&&(t.incompleteReason===void 0||typeof t.incompleteReason=="string")}function bt(e){return Array.isArray(e)&&e.length<=1024}function xt(e){if(!e||typeof e!="object"||Array.isArray(e))return;let t=e;if(!(typeof t.path!="string"||!vt(t.path))&&!(t.kind!=="add"&&t.kind!=="change"&&t.kind!=="delete"))return{path:t.path,kind:t.kind}}function At(e){let t=[],n=new Set;for(let i of e){let r=xt(i);if(!r||n.has(r.path))return;n.add(r.path),t.push(r)}return t}function Bt(e){return e.complete?e.incompleteReason===void 0:e.incompleteReason!==void 0&&e.incompleteReason.trim()!==""}function ht(e){if(!Rt(e))return;let t=At(e.entries);if(!(!t||!Bt(e)))return{version:1,baseGeneration:e.baseGeneration,complete:e.complete,...e.incompleteReason===void 0?{}:{incompleteReason:e.incompleteReason},entries:t}}function vt(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 Tt}from"child_process";import{platform as le}from"os";import{performance as ce}from"perf_hooks";var Qt={probe:1e4,git:3e4,analysis:18e4,install:3e5,indexer:6e5},B=class extends Error{constructor(n,i,r,a={}){super(r,a.cause===void 0?void 0:{cause:a.cause});this.kind=n;this.label=i;this.name="BoundedProcessError",this.timedOut=a.timedOut??!1,this.reaped=a.reaped??!1,this.stdout=a.stdout??"",this.stderr=a.stderr??"",this.stdoutTruncated=a.stdoutTruncated??!1,this.stderrTruncated=a.stderrTruncated??!1}kind;label;timedOut;reaped;stdout;stderr;stdoutTruncated;stderrTruncated};function A(e,t){if(!Number.isFinite(e)||e<=0)throw new TypeError(`${t} must be a positive finite number.`)}function fe(e,t,n,i){let r=Math.max(0,i-n);r>0&&e.push(t.subarray(0,r))}function ge(e,t,n){let i=Buffer.concat([...e,t]);e.length=0,e.push(i.subarray(Math.max(0,i.length-n)))}function en(e){A(e.timeoutMs,"timeoutMs"),A(e.maxStdoutBytes,"maxStdoutBytes"),A(e.maxStderrBytes,"maxStderrBytes");let t=e.terminationGraceMs??1e3;A(t,"terminationGraceMs");let n=e.terminationForceMs??t;return A(n,"terminationForceMs"),new Promise((i,r)=>{let a=ce.now(),s=le()!=="win32"&&process.env.SCIP_REINDEX_PROCESS_GROUP_LEADER==="1",l=le()!=="win32"&&!s,o;try{o=Tt(e.command,[...e.args??[]],{cwd:e.cwd,env:e.env,detached:l?!0:e.detached,stdio:["pipe","pipe","pipe"]})}catch(u){let d=u instanceof Error?u.message:String(u);r(new B("spawn",e.label,`${e.label} could not start: ${d}`,{cause:u,reaped:!0}));return}let c=[],f=[],p=0,g=0,R=!1,L=!1,m=null,y=!1,W=o.pid===void 0?null:V(o.pid,l),O=()=>{clearTimeout(U),e.signal?.removeEventListener("abort",P)},E=u=>{if(y||!m)return;y=!0,O();let d=Buffer.concat(c).toString("utf8"),w=Buffer.concat(f).toString("utf8"),_=u.reaped||!u.detail?"":` Process-tree cleanup failed: ${u.detail}`;r(new B(m.kind,e.label,`${m.message}${_}`,{timedOut:m.timedOut,reaped:u.reaped,stdout:d,stderr:w,stdoutTruncated:R,stderrTruncated:L}))},b=u=>{if(!(m||y)){if(m=u,!W){E({reaped:o.pid===void 0,reason:o.pid===void 0?"terminated":"identity-unavailable"});return}q(W,{gracefulMs:t,forceMs:n}).then(E,d=>{E({reaped:!1,reason:"signal-failed",detail:d instanceof Error?d.message:String(d)})})}},U=setTimeout(()=>{b({kind:"timeout",timedOut:!0,message:`${e.label} timed out after ${e.timeoutMs}ms.`})},e.timeoutMs);U.unref();let P=()=>{b({kind:"aborted",timedOut:!1,message:`${e.label} was cancelled.`})};e.signal?.addEventListener("abort",P,{once:!0}),e.signal?.aborted&&P(),o.stdout.on("data",u=>{let d=Buffer.isBuffer(u)?u:Buffer.from(u);e.outputLimitBehavior==="truncate-tail"?ge(c,d,e.maxStdoutBytes):fe(c,d,p,e.maxStdoutBytes),p+=d.length,p>e.maxStdoutBytes&&(R=!0,e.outputLimitBehavior!=="truncate-tail"&&b({kind:"stdout-limit",timedOut:!1,message:`${e.label} exceeded stdout limit (${e.maxStdoutBytes} bytes).`}))}),o.stderr.on("data",u=>{let d=Buffer.isBuffer(u)?u:Buffer.from(u);e.outputLimitBehavior==="truncate-tail"?ge(f,d,e.maxStderrBytes):fe(f,d,g,e.maxStderrBytes),g+=d.length,g>e.maxStderrBytes&&(L=!0,e.outputLimitBehavior!=="truncate-tail"&&b({kind:"stderr-limit",timedOut:!1,message:`${e.label} exceeded stderr limit (${e.maxStderrBytes} bytes).`}))}),o.on("error",u=>{if(!y&&!m){if(o.pid===void 0){O(),y=!0,r(new B("spawn",e.label,`${e.label} could not start: ${u.message}`,{cause:u,reaped:!0}));return}b({kind:"spawn",timedOut:!1,message:`${e.label} failed after start: ${u.message}`})}}),o.on("close",(u,d)=>{if(y||m)return;y=!0,O();let w=Buffer.concat(c).toString("utf8"),_=Buffer.concat(f).toString("utf8");i({status:u,signal:d,stdout:w,stderr:_,timedOut:!1,durationMs:ce.now()-a,stdoutTruncated:R,stderrTruncated:L})}),e.input===void 0?o.stdin.end():o.stdin.end(e.input)})}export{Qt as a,B as b,en as c,H as d,v as e,K as f,Pe as g,Wt as h,Ut as i,Ft as j,Ce as k,$t as l,jt as m,Xt as n,Vt as o};
|
|
8
|
+
//# sourceMappingURL=chunk-2LHXRE2B.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as i}from"./chunk-OGFV2BUX.js";import{a as t}from"./chunk-LOVIZBJ4.js";function a(e,o){let r=i(e,o);return r?t(e,"forward",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}function p(e,o){let r=i(e,o);return r?t(e,"reverse",[r]).filter(s=>!e.isIgnored(s)).map(s=>({relativePath:s,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):[]}export{a,p as b};
|
|
2
|
+
//# sourceMappingURL=chunk-2YXE77TJ.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as $,b as T,c as D,e as E,f as B,h as J,k as N,l as O}from"./chunk-AGWFSTXC.js";import{t as U}from"./chunk-73AAKPUC.js";import{b as j}from"./chunk-GCKCF5FL.js";import{a as C}from"./chunk-A2IIGFMJ.js";import{c as v,d as S,m as A,o as P,q as L,t as u}from"./chunk-GVWX5T43.js";import{Ca as R}from"./chunk-5TNQJUR2.js";var ce={references:J,referenceMap:N,callerMap:(t,a)=>E(t).callerMap(a),calleeMap:q};function q(t,a){let r=L(),s=new Map,l=B(t,a),o=[],i=[],g=0,m=0,f=0,h=0,I=0,F=0,k=0;for(let{definition:e,callees:n}of l.hits)I+=1,n.length>0&&(F+=1,k+=n.length,s.set(e.symbolId,n));let d=K(t,l.hits);d.entries.length>0&&u("semantic.callees.prefetch-cache-write",()=>P(t,d.entries),()=>({entries:d.entries.length,sourceMissing:d.sourceMissing,skippedUnsupportedLanguage:d.skippedUnsupportedLanguage}));function z(e,n){if(!D(e)){r&&(g+=n.length);return}let c=C(t,e);if(!c){r&&(m+=n.length),i.push(...n);return}let y=S(t,e,c),p=_(t,e);if(!p){i.push(...n);return}let b=A(t,e,y,p);G(n,b,y,p)}function G(e,n,c,y){for(let p of e){let b=n.get(p.symbol)??null;Y(p,b)||o.push({def:p,contentHash:c,depsDigest:y})}}function Y(e,n){if(n===null)return!1;let c=V(n);return c?(r&&(f+=1),c.length>0&&s.set(e.symbolId,c),!0):(r&&(h+=1),!1)}if(u("semantic.callees.cache-scan",()=>{for(let[e,n]of $(l.misses))z(e,n)},()=>({definitions:a.length,skippedUnsupportedLanguage:g,sourceMissing:m,cacheHits:f,parseFailures:h,misses:o.length,unkeyed:i.length,inMemoryHits:I,inMemoryRows:F,inMemoryCalleeCount:k,resultRows:s.size,missSample:o.slice(0,8).map(e=>`${e.def.relativePath}#${e.def.symbol}`),unkeyedSample:i.slice(0,4).map(e=>`${e.relativePath}#${e.symbol}`)})),o.length===0&&i.length===0)return s;let w=[...i,...o.map(e=>e.def)],H=0,x=u("semantic.callees.compute-misses",()=>{let e=O(t,w);return H=e.size,e},()=>({definitions:w.length,misses:o.length,unkeyed:i.length,rows:H}));for(let[e,n]of x)s.set(e,n);let M=o.filter(e=>E(t).capability("semantic-callees",e.def.relativePath).available).map(e=>({relativePath:e.def.relativePath,symbol:e.def.symbol,contentHash:e.contentHash,depsDigest:e.depsDigest,payload:JSON.stringify(x.get(e.def.symbolId)??[])}));return M.length>0?u("semantic.callees.cache-write",()=>P(t,M),()=>({entries:M.length})):u("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:o.length})),s}function K(t,a){let r=[],s=new Map,l=0,o=0;for(let{definition:i,callees:g}of a){if(!D(i.relativePath)){o+=1;continue}if(!s.has(i.relativePath)){let f=C(t,i.relativePath),h=f?_(t,i.relativePath):null;s.set(i.relativePath,f&&h?{contentHash:S(t,i.relativePath,f),depsDigest:h}:null)}let m=s.get(i.relativePath);if(!m){l+=1;continue}r.push({relativePath:i.relativePath,symbol:i.symbol,contentHash:m.contentHash,depsDigest:m.depsDigest,payload:JSON.stringify(g)})}return{entries:r,sourceMissing:l,skippedUnsupportedLanguage:o}}var Q="typescript-callees-v4-lexical-owner";function _(t,a){let r=D(a);if(r==="typescript")return U(t,a,Q)?.key??null;let s=X(t,a);return r==="rust"?v(JSON.stringify({kind:"semantic-callees",language:r,engine:T(t.config.projectRoot),positionMapping:"nearby-leaf-v2-callsite-line",depsDigest:s})):s}function V(t){try{return JSON.parse(t)}catch{return null}}var W=R("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function X(t,a){return W.get(t,a,()=>{let s=[...j(t).get(a)??[]].sort().map(l=>`${l}:${S(t,l,C(t,l))}`);return v(s.join("|"))})}export{ce as a};
|
|
2
|
+
//# sourceMappingURL=chunk-36SGVCGX.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as T,b as A}from"./chunk-E7YNJLCB.js";import{b as F}from"./chunk-6LSEIIF7.js";import{b as k}from"./chunk-FMRN2TRL.js";import{d as v}from"./chunk-5D2LVK7O.js";import{a as y}from"./chunk-FVULPZDF.js";import{b as p}from"./chunk-5TNQJUR2.js";import{posix as h}from"path";var O=20,_=1,G=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),q=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Te(e,n={}){let t=w(n.limit,O),i=w(n.minConsumers,_),r=new F(e),o=r.fileDependencyGraph(),s=fe(y(e,{includeIgnored:!1})),a=ye(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?K(e,r,n.target):J(e,n.scope,n.scanLimit)).map(c=>Q(e,r,o,c,n,s,a)).filter(c=>c.consumerFiles.length>=i||n.target).sort(ge).slice(0,t)}function K(e,n,t){let i=Z(e,t);if(i)return[I(i)];let r=k(e,t);if(r.candidates.length>0)throw new Error(`Ambiguous symbol: ${t}. Use an exact symbol.`);let o=r.match;if(!o)return[];let s=n.definitionsForFile(o.relativePath).find(a=>a.symbolId===o.symbolId);return s?[ee(s)]:[{unit:{kind:"symbol",file:o.relativePath,shortName:v(o.symbol),symbol:o.symbol,startLine:o.startLine,endLine:o.endLine}}]}function J(e,n,t){let i=y(e,{scope:n,includeIgnored:!1}),r=w(t,i.length);return i.slice(0,r).map(o=>I(o))}function Q(e,n,t,i,r,o,s){let a=i.definition?V(e,n,i.definition,r.semantic):X(t,i.unit.file),d=i.definition?a.length>0?"symbol-observations":"none":a.length>0?"file-level":"none",f=i.unit.file,c=l(h.dirname(f)),u=te(a),B=ne(c),W=x([...C(c),...u?C(u):[]]),b=ie(i.unit,c,u,a),g=oe(b,i.unit,c,u,a,o,s),j=ue(i.unit,d,u,a,c,g.whyNoSuggestedHome),z=de(i.unit,c,u,a,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:f,currentDirectory:c,directoryAncestry:B,consumerFiles:a,consumerCoverage:d,nearestCommonDirectory:u,boundaryMarkers:W,recommendedTier:b,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:j,reasons:z,recommendation:me(b,g.suggestedHome,d)}}function V(e,n,t,i){let r=A(T(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}));return H(r.get(t.symbolId)??[])}function X(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return H(t)}function Z(e,n){let t=p(n),i=y(e,{includeIgnored:!1}),r=i.find(s=>s===t);if(r)return r;let o=i.filter(s=>s.endsWith(`/${t}`));return o.length===1?o[0]:null}function ee(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:v(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function I(e){return{unit:{kind:"file",file:e,shortName:h.basename(e)}}}function ne(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:D(r)})}return n}function C(e){return e==="."?[]:$(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function D(e){return x($(e).map(({marker:n})=>n))}function $(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=G.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function te(e){if(e.length===0)return null;let n=e.map(i=>l(h.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),o=[],s=Math.min(t.length,r.length);for(let a=0;a<s&&t[a]===r[a];a+=1)o.push(t[a]);t=o}return t.length===0?".":t.join("/")}function ie(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":re(t,n):"no-observed-consumers"}function re(e,n){return U(e,"package")?"package-level-shared":U(e,"app")?"app-level-shared":N(e,["feature","domain","module"])||N(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder"}function oe(e,n,t,i,r,o,s){let a=se(e,i);if(a)return m(a);let d=he(n.file),f=ae(e,t,d,r,s);if(f)return f;let c=i;if(l(t)===l(c))return m(`${t} is already the nearest common directory for its consumers.`);let u=ce(c,t,d,s);return u||le(c,t,d,o,s)}function se(e,n){return n?e==="no-observed-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an suggested destination.":null:"No shared consumer directory was observed in the current evidence."}function ae(e,n,t,i,r){if(e==="same-file"){let o=i[0]??null;return o?S(o):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let o=l(h.dirname(i[0])),s=E(n,t,o,r);return s?m(s):S(o)}return null}function ce(e,n,t,i){return ve(e)?P(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function le(e,n,t,i,r){if(e===".")return m("The nearest common directory is the repository root.");let o=`${e}/shared`,s=P(o,n,t,r,`Proposed home ${o} is outside source root ${t}.`);return s.confidence==="withheld"||i.has(o)?s:m(`${o} does not exist in the indexed project.`)}function P(e,n,t,i,r){if(!M(e,t))return m(r);let o=E(n,t,e,i);return o?m(o):S(e)}function S(e){return{suggestedHome:e,confidence:"candidate",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function ue(e,n,t,i,r,o){let s=["Path and observed-consumer heuristic; confirm conceptual ownership, complete consumers and behavior before moving files."];return n==="none"&&s.push("No consumers were found in the current index."),n==="file-level"&&s.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&s.push("Nearest common directory is broad, so this is not enough evidence for automatic placement."),i.length===1&&s.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&s.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&s.push("Candidate already lives under the nearest common directory."),o&&s.push(`No suggested home: ${o}`),s}function de(e,n,t,i,r,o){let s=[];return s.push(`${e.shortName} currently lives in ${n}.`),t?s.push(`${i.length} consumer file(s) share ${t} as their nearest common directory.`):s.push("No shared consumer directory was observed in the current evidence."),r?s.push(`Suggested home is ${r}.`):o&&s.push(`No suggested home: ${o}`),s}function me(e,n,t){return e==="no-observed-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="symbol-observations"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function ge(e,n){return R(n)-R(e)||e.candidatePath.localeCompare(n.candidatePath)}function R(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="symbol-observations"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-observed-consumers"&&(n*=.05),n}function fe(e){let n=new Set(["."]);for(let t of e){let i=l(h.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=l(h.dirname(i))}return n}function he(e){let n=L(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function M(e,n){let t=l(e),i=l(n);return i==="."||t===i||t.startsWith(`${i}/`)}function pe(e,n,t){let i=L(e),r=L(n);return(M(e,n)?i.slice(r.length):i).some(s=>t.has(s.toLowerCase()))}function E(e,n,t,i){return l(e)===l(t)||!pe(e,n,i)?null:`${e} matches a protected directory-name marker; a move to ${t} needs human design.`}function ye(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=be(i);r&&n.add(r)}return n}function be(e){let n=e.trim().toLowerCase();return n===""?null:n}function U(e,n){return D(e).includes(n)}function N(e,n){let t=D(e);return n.some(i=>t.includes(i))}function ve(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?q.has(t):!1}function l(e){let n=p(e);return n===""?".":n}function L(e){let n=p(e);return n==="."?[]:n.split("/").filter(Boolean)}function w(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function H(e){return x([...e]).sort((n,t)=>n.localeCompare(t))}function x(e){return[...new Set(e)]}export{Te as a};
|
|
2
|
+
//# sourceMappingURL=chunk-3ABBFPTP.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as A}from"./chunk-KDDIE2DP.js";import{b as y}from"./chunk-BOJ5SVE2.js";import{c as k}from"./chunk-E3FDPXZK.js";import{d as E}from"./chunk-7WTPQ4NX.js";import{Z as T}from"./chunk-FVULPZDF.js";import{a as x}from"./chunk-A2IIGFMJ.js";import{ts as p}from"@ts-morph/common";var N=60;function rt(t,s={}){let{scope:n,limit:e=30,scanLimit:i,rotDays:r=N}=s,o=y(T(t,{extensions:[".ts",".tsx",".js",".jsx",".mjs",".cjs"]}).filter(l=>k(l)==="test").filter(l=>!n||l.includes(n)).filter(l=>!t.isIgnored(l)).sort(),i),c=[],a=[],d=[];for(let l of o)C(t,l,r,{assertionFree:c,skipped:a,mockEcho:d});return{assertionFree:e?c.slice(0,e):c,skipped:e?a.slice(0,e):a,mockEcho:e?d.slice(0,e):d}}function C(t,s,n,e){let{assertionFree:i,skipped:r,mockEcho:o}=e,c=x(t,s);if(!c)return;let a=E(c),d=P(c);for(let u of Q(a,d))d.add(u);let l=O(c,s);for(let u of l){if(u.skip){r.push(W(t,s,u,n));continue}if(u.kind==="describe")continue;let b=w(c,u.argsStart),m=a.slice(u.argsStart,u.callEnd),L=c.slice(u.argsStart,u.callEnd);F(m,d)||i.push({file:s,startLine:f(c,u.callStart),endLine:f(c,u.callEnd),title:b,severity:/\bawait\b/.test(m)?"low":"high"});let S=Y(m,L);S&&o.push({file:s,startLine:f(c,u.callStart),endLine:f(c,u.callEnd),title:b,echoedValue:S})}}function O(t,s){let n=[],e=p.createSourceFile(s,t,p.ScriptTarget.Latest,!0);function i(r){if(p.isCallExpression(r)){let o=_(r,e);o&&n.push(o)}p.forEachChild(r,i)}return i(e),n}function _(t,s){let n=v(t.expression);if(!n)return;let{kind:e,skip:i,skipKind:r}=n,o=t.arguments.at(-1);if(!(!i&&!D(o)))return{kind:e,skip:i,skipKind:r,callStart:t.getStart(s),argsStart:t.arguments.pos,callEnd:t.end}}function v(t){let s=t,n;if(p.isPropertyAccessExpression(t)&&(s=t.expression,n=t.name.text),!p.isIdentifier(s))return;let e=/^(x?)(it|test|describe)$/.exec(s.text);if(!e||n!==void 0&&!["skip","only","todo"].includes(n))return;let i=!!e[1]||n==="skip"||n==="todo";return{kind:e[2],skip:i,skipKind:n==="todo"?"todo":"skip"}}function D(t){return t!==void 0&&(p.isArrowFunction(t)||p.isFunctionExpression(t))}function g(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0))return e}return t.length-1}function f(t,s){let n=0;for(let e=0;e<s&&e<t.length;e+=1)t[e]===`
|
|
2
|
+
`&&(n+=1);return n}function w(t,s){let n=t.slice(s,s+400),e=/^\s*(['"`])((?:\\.|(?!\1)[\s\S])*)\1/.exec(n);return e?e[2]:"(anonymous)"}var K=new Set(["vitest","chai","jest","@jest/globals","assert","node:assert","node:assert/strict","assert/strict","uvu/assert","expect","chai-as-promised"]),R=new Set(["expect","assert","expectTypeOf","assertType","should"]),M=new Set(["vitest","jest","@jest/globals","chai","chai-as-promised"]);function P(t){let s=new Set(["expect","assert"]),n=p.createSourceFile("assertion-vocabulary.ts",t,p.ScriptTarget.Latest,!0);for(let e of n.statements){if(!p.isImportDeclaration(e)||!p.isStringLiteral(e.moduleSpecifier))continue;let i=e.moduleSpecifier.text,r=e.importClause;if(!(!K.has(i)||!r||r.isTypeOnly))for(let o of $(r,M.has(i)))s.add(o)}return s}function $(t,s){let n=[],e=r=>{if(s)for(let o of R)n.push(`${r}.${o}`);else n.push(r)};t.name&&e(t.name.text);let i=t.namedBindings;if(!i)return n;if(p.isNamespaceImport(i))return e(i.name.text),n;for(let r of i.elements){if(r.isTypeOnly)continue;let o=(r.propertyName??r.name).text;s&&!R.has(o)||["AssertionError","CallTracker"].includes(o)||n.push(r.name.text)}return n}function F(t,s){if(/\.should\b/.test(t)||/\bawait\s+(?:[\w$.]+\.)?findBy[A-Z]\w*\s*\(/.test(t)||/\bawait\s+\w*waitFor(?:Text|Value|Condition|Result|Event)\s*\(/.test(t)||/\bthrow\b/.test(t))return!0;for(let n of s){let e=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`(?<![\\w$.])${e}\\s*(?:<[^<>]*>)?\\s*[.(]`).test(t))return!0}return!1}var j=/\bfunction\s+(\w+)\s*\(/g,U=/\b(?:const|let)\s+(\w+)\s*=\s*(?:async\s*)?\(/g,V=60;function Q(t,s){let n=new Set;for(let e of[j,U]){e.lastIndex=0;let i;for(;i=e.exec(t);){let r=i[1],o=i.index+i[0].length-1,c=g(t,o),a=t.indexOf("{",c+1);if(a===-1||a-c>V)continue;let d=B(t,a),l=t.slice(a+1,d);F(l,s)&&n.add(r)}}return n}function B(t,s){let n=0;for(let e=s;e<t.length;e+=1){let i=t[e];if(i==="{")n+=1;else if(i==="}"&&(n-=1,n===0))return e}return t.length-1}var q=/\bmock(?:ReturnValue|ResolvedValue)(?:Once)?\s*\(/g,h=/\bexpect\s*\(/g,G=/^\s*\.\s*(?:toBe|toEqual|toStrictEqual)\s*\(/,I=/^(?:-?\d+(?:\.\d+)?|(['"`]).+\1)$/;function Y(t,s){let n=H(t,s,q);if(n.length===0)return null;let e=X(t,s);for(let i of e)if(n.includes(i))return i;return null}function H(t,s,n){let e=[];n.lastIndex=0;let i;for(;i=n.exec(t);){let r=i.index+i[0].length-1,o=g(t,r),c=s.slice(r+1,o).trim();I.test(c)&&e.push(c),n.lastIndex=o+1}return e}function X(t,s){let n=[];h.lastIndex=0;let e;for(;e=h.exec(t);){let i=e.index+e[0].length-1,r=g(t,i),o=t.slice(r+1),c=G.exec(o);if(h.lastIndex=r+1,!c)continue;let a=r+1+c[0].length-1,d=g(t,a),l=s.slice(a+1,d).trim();I.test(l)&&n.push(l)}return n}function W(t,s,n,e){let i=x(t,s),r=w(i,n.argsStart),o=f(i,n.callStart),c=Z(t.config.projectRoot,s,o),a=c===null?"unknown":c>=e?"rot":"workflow";return{file:s,startLine:o,title:r,skipKind:n.skipKind,blockKind:n.kind,ageDays:c,rot:a}}function Z(t,s,n){let e=n+1;try{let i=A(t,["blame","-L",`${e},${e}`,"--porcelain","--",s]),r=/^author-time (\d+)$/m.exec(i);if(!r)return null;let o=Number(r[1]);return Number.isFinite(o)?Math.max(0,Math.round((Date.now()/1e3-o)/86400)):null}catch{return null}}export{rt as a};
|
|
3
|
+
//# sourceMappingURL=chunk-3IVFU4FD.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b as L,c as Y,d as k}from"./chunk-O4UZSPPI.js";import{a as Q,b as $,d as P}from"./chunk-QZ7KQZRN.js";import{b as F,c as g,d as R}from"./chunk-TKD34PHN.js";import{e as V,h as G,i as S}from"./chunk-62BDNPMI.js";import{createHash as q,randomUUID as se}from"crypto";import{closeSync as Me,existsSync as p,fstatSync as pe,lstatSync as A,mkdirSync as xe,openSync as ge,readdirSync as h,readSync as he,renameSync as T,rmSync as f}from"fs";import{basename as I,dirname as _,join as u}from"path";function Z(e){return C(e,fe)}function Qe(e){return C(e,ye)}function C(e,n){return Array.isArray(e)?`[${e.map(t=>C(t,n)).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).sort(([t],[i])=>n(t,i)).map(([t,i])=>`${JSON.stringify(t)}:${C(i,n)}`).join(",")}}`:JSON.stringify(e)}function fe(e,n){return e.localeCompare(n)}function ye(e,n){return e<n?-1:e>n?1:0}var j=1,we=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),M=class extends Error{constructor(t,i,r,o){let s=t==="item-too-large"?`request is ${o} bytes; per-item limit is ${r.maxItemBytes}`:t==="item-capacity"?`mailbox has ${i.totalItems} retained items; limit is ${r.maxItems}`:t==="byte-capacity"?`mailbox retains ${i.totalBytes} bytes and the request adds ${o}; limit is ${r.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=t;this.status=i;this.limits=r;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},ae=".owner.json",J={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function un(e){return{rootDir:e,pendingDir:u(e,"pending"),inflightDir:u(e,"inflight"),responseDir:u(e,"responses"),deadLetterDir:u(e,"dead-letter"),legacyRequestDir:u(e,"requests")}}function D(e={}){let n={...we,...e};for(let[t,i]of Object.entries(n))if(!Number.isFinite(i)||i<=0||!Number.isInteger(i))throw new Error(`Mailbox limit ${t} must be a positive integer.`);return n}function N(e){let n=[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir].map(t=>F(t));return R(...n)}function cn(e,n){return q("sha256").update(Z({namespace:e,payload:n})).digest("hex")}function de(e){if(!/^[a-f0-9]{64}$/.test(e))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${e}`}function mn(e,n,t={}){let i=D(t.limits),r=t.nowMs??Date.now(),o=N(e);return je(n),z(e,i,t.admissionLockTimeoutMs??2e3,t.monotonicNow??P,t.durability??"durable",()=>{K(e,r,i);let s=u(e.pendingDir,`${n.id}.json`),a=u(e.responseDir,`${n.id}.json`),d=ne(e,n.id);if(d){let c=te(d,n.operationKey,n.id);return{disposition:"duplicate",requestId:n.id,responsePath:a,authoritativeDeadlineAtMs:c.deadlineAtMs??n.deadlineAtMs}}let l=`${JSON.stringify(n)}
|
|
2
|
+
`,m=Buffer.byteLength(l);Ge(e,m,i),t.onBeforePublish?.();try{let c=t.durability??"durable",b=L(s,l,{durability:c}),y=c==="durable"?R(o,b.directorySync):"not-requested";return{disposition:"accepted",requestId:n.id,responsePath:a,authoritativeDeadlineAtMs:n.deadlineAtMs,achievedDurability:b.achievedDurability,directorySync:y}}catch(c){if(c.code!=="EEXIST")throw c;let b=ne(e,n.id);if(!b)throw c;let y=te(b,n.operationKey,n.id);return{disposition:"duplicate",requestId:n.id,responsePath:a,authoritativeDeadlineAtMs:y.deadlineAtMs??n.deadlineAtMs}}})}function Be(e,n){if(!n.ownerId.trim())throw new Error("Mailbox claim owner identity is required.");We(n.owner);let t=n.nowMs??Date.now(),i=D(n.limits),r=N(e);try{return z(e,i,2e3,n.monotonicNow??P,n.durability??"durable",()=>De(e,n.ownerId,t,i,n.liveness??J,n.owner??{pid:process.pid},r,n.durability??"durable",n.onClaimStage))}catch(o){if(o instanceof M&&o.code==="admission-busy")return[];throw o}}function bn(e,n){return!oe(e.pendingDir)&&!oe(e.legacyRequestDir)?[]:Be(e,n)}function Ie(e,n){let{paths:t,ownerId:i,ownerDirectory:r,nowMs:o,limits:s,ownerDirectorySync:a,durability:d,onClaimStage:l}=n,m=u(t.responseDir,`${e.header.id}.json`);if(p(m))return f(e.path,{force:!0}),null;let c=Math.max(o+s.claimLeaseMs,(e.header.deadlineAtMs??o)+5e3),b=`${O(e.originalFile)}.${c}.claim`,y=u(r,b);try{T(e.path,y)}catch(X){let W=X.code;if(W==="ENOENT"||W==="EEXIST")return null;throw X}l?.("after-claim-renamed");let w=d==="durable"?g(_(e.path)):"not-requested";l?.("after-source-directory-synced");let x=d==="durable"?g(r):"not-requested";l?.("after-destination-directory-synced");let be=R(a,w,x);return Ae(e,n,y,c,be)}function Ae(e,n,t,i,r){let{ownerId:o,nowMs:s}=n;return{requestId:e.header.id,ownerId:o,path:t,originalFile:e.originalFile,claimedAtMs:s,claimExpiresAtMs:i,byteLength:e.byteLength,...e.header.operationKey?{operationKey:e.header.operationKey}:{},...e.header.clientId?{clientId:e.header.clientId}:{},...e.header.enqueuedAtMs===void 0?{}:{enqueuedAtMs:e.header.enqueuedAtMs},...e.header.deadlineAtMs===void 0?{}:{deadlineAtMs:e.header.deadlineAtMs},legacy:e.legacy,directorySync:r}}function De(e,n,t,i,r,o,s,a,d){K(e,t,i,r);let l=u(e.inflightDir,O(n)),m=[...ie(e.pendingDir,!1),...ie(e.legacyRequestDir,!0)].sort((w,x)=>w.orderAtMs-x.orderAtMs||w.header.id.localeCompare(x.header.id)||w.path.localeCompare(x.path)),c=a==="durable"?s:"not-requested";m.length>0&&(a==="durable"?c=R(c,F(l)):xe(l,{recursive:!0}),d?.("after-owner-directory-durable"),Te(l,n,o,a),d?.("after-owner-record-published"));let b={paths:e,ownerId:n,ownerDirectory:l,nowMs:t,limits:i,ownerDirectorySync:c,durability:a,onClaimStage:d},y=[];for(let w of m){if(y.length>=i.maxBatch)break;let x=Ie(w,b);x&&y.push(x)}return y}function fn(e,n={}){let t=D(n);if(e.byteLength>t.maxItemBytes)throw new M("item-too-large",{pending:0,inflight:1,responses:0,deadLetters:0,invalid:0,totalItems:1,totalBytes:e.byteLength},t,e.byteLength);return G(e.path,{maxBytes:t.maxItemBytes,inputKind:"bounded mailbox item"})}function Se(e,n,t,i={}){let r=i.nowMs??Date.now(),o=D(i.limits),s=Re(n,t,r,o),a=Buffer.byteLength(`${JSON.stringify(s)}
|
|
3
|
+
`);Ee(e,n,a,o,r);let d=i.durability??"durable";if(Fe(e,n,s,d),i.onAfterResponsePublished?.(),f(n.path,{force:!0}),d==="durable"){let l=_(n.path);g(p(l)?l:e.inflightDir)}}function Re(e,n,t,i){let r=e.deadlineAtMs===void 0?t+i.responseRetentionMs:Math.min(t+i.responseRetentionMs,Math.max(e.deadlineAtMs,t)+le),o={mailboxVersion:j,operationKey:e.operationKey??`legacy-${e.requestId}`,clientId:e.clientId??"legacy",...e.deadlineAtMs===void 0?{}:{deadlineAtMs:e.deadlineAtMs},completedAtMs:t,expiresAtMs:r};return{...o,...n,...o}}function Ee(e,n,t,i,r){let o=E(e);if(t>i.maxItemBytes)throw new M("item-too-large",o,i,t);let s=Math.max(0,o.totalBytes-n.byteLength)+t;if(s>i.maxBytes&&s>o.totalBytes&&(Le(e,r).removed>0&&(o=E(e),s=Math.max(0,o.totalBytes-n.byteLength)+t),s>i.maxBytes&&s>o.totalBytes))throw new M("byte-capacity",o,i,t)}var le=3e4,ve=4096;function Le(e,n){let t={removed:0,bytesFreed:0},i;try{i=h(e.responseDir)}catch{return t}for(let r of i){if(!r.endsWith(".json"))continue;let o=u(e.responseDir,r),s,a;try{let c=ge(o,"r");try{a=pe(c).size;let b=Buffer.alloc(Math.min(ve,a));he(c,b,0,b.length,0),s=b.toString("utf8")}finally{Me(c)}}catch{continue}let d=ee(s,"expiresAtMs"),l=ee(s,"deadlineAtMs");if(d!==null&&d<=n||l!==null&&l+le<=n)try{f(o,{force:!0}),t.removed+=1,t.bytesFreed+=a}catch{}}return t}function ee(e,n){let t=new RegExp(`"${n}":(\\d+)`).exec(e);if(!t)return null;let i=Number(t[1]);return Number.isSafeInteger(i)?i:null}function yn(e,n,t,i,r={}){let o=r.nowMs??Date.now(),s=D(r.limits);if(Se(e,n,t,{...r,nowMs:o,limits:s}),!p(n.path)){let a=u(e.deadLetterDir,`${Xe(n.requestId)}.${o}.${q("sha256").update(i).digest("hex").slice(0,12)}.json`),d={mailboxVersion:j,requestId:n.requestId,ownerId:n.ownerId,rejectedAtMs:o,reason:i,originalFile:n.originalFile},l=Buffer.byteLength(`${JSON.stringify(d,null,2)}
|
|
4
|
+
`),m=E(e);m.totalItems<s.maxItems&&m.totalBytes+l<=s.maxBytes&&k(a,d,{spacing:2,trailingNewline:!0})}}function Mn(e,n={}){let t=n.nowMs??Date.now(),i=D(n.limits);return N(e),z(e,i,2e3,n.monotonicNow??P,"durable",()=>K(e,t,i,n.liveness??J))}function Pe(e,n,t,i,r){let o=u(e.responseDir,`${n.requestId}.json`);if(p(o))return f(n.path,{force:!0}),r.completedClaimsRemoved++,!0;if(n.claimExpiresAtMs>t||_e(e,n.ownerId,i)!=="dead")return!1;let s=u(e.pendingDir,n.originalFile);try{T(n.path,s),r.reclaimed++}catch(a){if(a.code!=="EEXIST")throw a;f(n.path,{force:!0})}return g(_(n.path)),g(e.pendingDir),!0}function Ce(e,n,t,i,r){for(let o of H(e.inflightDir)){if(t<=0)break;Pe(e,o,n,i,r)&&t--}return t}function Ne(e,n,t){if(!I(e).includes(".tmp-"))return!1;let i;try{i=A(e).mtimeMs}catch(r){if(r.code==="ENOENT")return!1;throw r}return i+t>n?!1:(f(e,{force:!0}),!0)}function Oe(e,n,t,i,r){for(let o of[e.pendingDir,e.inflightDir,e.responseDir,e.deadLetterDir,e.legacyRequestDir]){if(i<=0)break;for(let s of ce(o)){if(i<=0)break;Ne(s,n,t.temporaryRetentionMs)&&(r.temporaryFilesRemoved++,i--)}}}function K(e,n,t,i=J){let r={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=t.cleanupBatch;return o=Ce(e,n,o,i,r),o=re(e.responseDir,o,(s,a)=>a+t.responseRetentionMs,n,()=>{r.responsesRemoved++}),o=re(e.deadLetterDir,o,(s,a)=>a+t.deadLetterRetentionMs,n,()=>{r.deadLettersRemoved++}),Oe(e,n,t,o,r),Ue(e.inflightDir),r}function E(e){N(e);let n=[...B(e.pendingDir).map(d=>({path:d,pending:!0})),...B(e.legacyRequestDir).map(d=>({path:d,pending:!0}))],t=H(e.inflightDir).map(d=>({path:d.path,pending:!1})),i=B(e.responseDir).map(d=>({path:d,pending:!1})),r=B(e.deadLetterDir).map(d=>({path:d,pending:!1})),o=[...n,...t,...i,...r],s=0,a;for(let d of n){let l=v(d.path);if(!l){s++;continue}let m=l.enqueuedAtMs;if(m===void 0)try{m=A(d.path).mtimeMs}catch(c){if(c.code==="ENOENT")continue;throw c}a=a===void 0?m:Math.min(a,m)}return{pending:n.length,inflight:t.length,responses:i.length,deadLetters:r.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((d,l)=>d+He(l.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function Fe(e,n,t,i){let r=u(e.responseDir,`${n.requestId}.json`),o=`${JSON.stringify(t)}
|
|
5
|
+
`;try{L(r,o,{durability:i})}catch(s){if(s.code!=="EEXIST")throw s;let a=v(r),d=n.operationKey??`legacy-${n.requestId}`;if(a?.operationKey!==d)throw new Error(`Mailbox completion ${n.requestId} conflicts with an existing operation.`,{cause:s})}}function z(e,n,t,i,r,o){let s=u(e.rootDir,".admission.lock"),a=`${process.pid}-${se()}`,d=i()+Math.max(0,t);for(;!ke(e.rootDir,s,a,r);){if($e(s),i()>=d)throw new M("admission-busy",E(e),n,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{U(s).ownerToken===a&&(f(s,{recursive:!0,force:!0}),r==="durable"&&g(e.rootDir))}catch{}}}function ke(e,n,t,i){let r=`${JSON.stringify({ownerToken:t,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
6
|
+
`;try{return L(n,r,{durability:i}),!0}catch(o){if(o.code==="EEXIST")return!1;try{U(n).ownerToken===t&&(f(n,{force:!0}),i==="durable"&&g(e))}catch{}throw o}}function $e(e){let n=null;try{let i=U(e);typeof i.ownerToken=="string"&&Number.isSafeInteger(i.pid)&&Number(i.pid)>0&&(n=Number(i.pid))}catch{}if(n===null||qe(n))return;let t=`${e}.stale-${se()}`;try{T(e,t)}catch(i){let r=i.code;if(r==="ENOENT"||r==="EEXIST")return;throw i}f(t,{recursive:!0,force:!0})}function U(e){try{return JSON.parse(S(e,"mailbox lock record"))}catch(n){if(n.code!=="EISDIR"&&!(n instanceof V&&n.reason==="not-regular"))throw n;return JSON.parse(S(u(e,"owner.json"),"mailbox lock owner record"))}}function qe(e){try{return process.kill(e,0),!0}catch(n){let t=n.code;return t==="EPERM"||t!=="ESRCH"}}function Te(e,n,t,i){let r=u(e,ae),o=t.processIdentity,s=ue(r);if(s&&s.ownerId===n&&s.pid===t.pid&&Ye(s.processIdentity,o))return;if(B(e).some(d=>d.endsWith(".claim")))throw new Error(`Mailbox owner identity ${n} collides with retained work from another process instance.`);let a={version:1,ownerId:n,pid:t.pid,...o?{processIdentity:o}:{}};i==="durable"?k(r,a):Y(r,a)}function _e(e,n,t){let i=ue(u(e.inflightDir,O(n),ae));if(!i)return"unknown";if(!t.isProcessAlive(i.pid))return"dead";if(!i.processIdentity)return"live";let r=t.readProcessIdentity(i.pid);return r?$(i.processIdentity,r)?"live":"dead":"unknown"}function ue(e){try{let n=JSON.parse(S(e,"mailbox owner record"));if(!Ve(n))return null;let t=n.processIdentity===void 0?null:Q(n.processIdentity);return n.processIdentity!==void 0&&(!t||t.pid!==n.pid)?null:{version:1,ownerId:n.ownerId,pid:n.pid,...t?{processIdentity:t}:{}}}catch{return null}}function ne(e,n){for(let t of[u(e.pendingDir,`${n}.json`),u(e.legacyRequestDir,`${n}.json`),u(e.responseDir,`${n}.json`)])if(p(t))return t;for(let t of H(e.inflightDir))if(t.requestId===n)return t.path;return null}function te(e,n,t){let i=v(e);if(i?.operationKey===n)return i;if(I(e)===`${de(n)}.json`)return{id:t,operationKey:n};throw new Error(`Mailbox operation ${t} conflicts with an existing retained record.`)}function je(e){if(e.mailboxVersion!==j||e.id!==de(e.operationKey)||!e.clientId.trim()||!Number.isFinite(e.enqueuedAtMs)||!Number.isFinite(e.deadlineAtMs)||e.deadlineAtMs<e.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function ie(e,n){return B(e).filter(t=>t.endsWith(".json")).map(t=>{let i=A(t),r=I(t,".json"),o=v(t)??{id:r};return{path:t,originalFile:I(t),header:o,byteLength:i.size,orderAtMs:o.enqueuedAtMs??i.mtimeMs,legacy:n}})}function Je(e){let n=/^(.*)\.(\d+)\.claim$/.exec(e);if(!n)return null;let t=me(n[1]),i=Number(n[2]);return t===null||I(t)!==t||!t.endsWith(".json")||!Number.isSafeInteger(i)?null:{originalFile:t,claimExpiresAtMs:i}}function Ke(e,n,t){let i=Je(t);if(!i)return null;let{originalFile:r,claimExpiresAtMs:o}=i,s=u(e,t),a=v(s)??{id:I(r,".json")},d;try{d=A(s)}catch(l){if(l.code==="ENOENT")return null;throw l}return{requestId:a.id,ownerId:n,path:s,originalFile:r,claimedAtMs:d.mtimeMs,claimExpiresAtMs:o,byteLength:d.size,...a.operationKey?{operationKey:a.operationKey}:{},...a.clientId?{clientId:a.clientId}:{},...a.enqueuedAtMs===void 0?{}:{enqueuedAtMs:a.enqueuedAtMs},...a.deadlineAtMs===void 0?{}:{deadlineAtMs:a.deadlineAtMs},legacy:a.operationKey===void 0}}function ze(e,n){let t=[];for(let i of h(e,{withFileTypes:!0})){if(!i.isFile()||!i.name.endsWith(".claim"))continue;let r=Ke(e,n,i.name);r&&t.push(r)}return t}function H(e){if(!p(e))return[];let n=[];for(let t of h(e,{withFileTypes:!0})){if(!t.isDirectory())continue;let i=me(t.name);i!==null&&n.push(...ze(u(e,t.name),i))}return n.sort((t,i)=>t.claimedAtMs-i.claimedAtMs||t.path.localeCompare(i.path))}function v(e){try{let n=JSON.parse(S(e,"mailbox record"));return typeof n.id!="string"||!n.id?null:{id:n.id,...typeof n.operationKey=="string"?{operationKey:n.operationKey}:{},...typeof n.clientId=="string"?{clientId:n.clientId}:{},...typeof n.enqueuedAtMs=="number"?{enqueuedAtMs:n.enqueuedAtMs}:{},...typeof n.deadlineAtMs=="number"?{deadlineAtMs:n.deadlineAtMs}:{}}}catch{return null}}function re(e,n,t,i,r){for(let o of B(e)){if(n<=0)break;let s;try{s=A(o)}catch(a){if(a.code==="ENOENT")continue;throw a}t(o,s.mtimeMs)>i||(f(o,{force:!0}),r(),n--)}return n}function B(e){return p(e)?h(e,{withFileTypes:!0}).filter(n=>n.isFile()).map(n=>u(e,n.name)).sort():[]}function oe(e){try{return h(e).some(n=>n.endsWith(".json"))}catch{return!1}}function ce(e){if(!p(e))return[];let n=[];for(let t of h(e,{withFileTypes:!0})){let i=u(e,t.name);t.isFile()?n.push(i):t.isDirectory()&&n.push(...ce(i))}return n.sort()}function Ue(e){if(p(e))for(let n of h(e,{withFileTypes:!0})){if(!n.isDirectory())continue;let t=u(e,n.name);h(t).some(i=>i.endsWith(".claim"))||f(t,{recursive:!0,force:!0})}}function He(e){try{return A(e).size}catch{return 0}}function O(e){return Buffer.from(e,"utf8").toString("base64url")}function me(e){try{let n=Buffer.from(e,"base64url").toString("utf8");return O(n)===e?n:null}catch{return null}}function Xe(e){return/^[a-z0-9][a-z0-9-]{0,127}$/i.test(e)?e:`invalid-${q("sha256").update(e).digest("hex")}`}function We(e){if(e&&(!Number.isSafeInteger(e.pid)||e.pid<=0||e.processIdentity!==void 0&&e.processIdentity.pid!==e.pid))throw new Error("Mailbox claim process identity is invalid.")}function Ve(e){return!(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)}function Ge(e,n,t){let i=E(e);if(n>t.maxItemBytes)throw new M("item-too-large",i,t,n);if(i.totalItems+1>t.maxItems)throw new M("item-capacity",i,t,n);if(i.totalBytes+n>t.maxBytes)throw new M("byte-capacity",i,t,n)}function Ye(e,n){return!!(!e&&!n||e&&n&&$(e,n))}export{Z as a,Qe as b,j as c,M as d,un as e,N as f,cn as g,de as h,mn as i,bn as j,fn as k,Se as l,yn as m,Mn as n,E as o};
|
|
7
|
+
//# sourceMappingURL=chunk-3JIQS44J.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{b as C}from"./chunk-O3RHA6ZT.js";import{b as E}from"./chunk-6LSEIIF7.js";import{n as D}from"./chunk-NZAXKGRL.js";import{e as L,g as P}from"./chunk-4WCUBZU3.js";import{d as y,x as v}from"./chunk-5D2LVK7O.js";import{g as S}from"./chunk-A2IIGFMJ.js";function W(e,n={}){let{scope:r,minLoc:t=1,maxDepth:c=5,scanLimit:d}=n,s=new E(e),o=B(e,r,t,d),a=new I;for(let i of o)a.add(i);let u=[],b=new Map;o.length>0&&u.push(k(e,0,o,a));let g=o.map(i=>i.definition).filter(i=>i!==null),x=new Set(o.map(i=>i.symbol)),h=new Set,N=i=>{let f=s.calleeMap(i,{semantic:!1}),l=new Set(h);for(let m of i)for(let p of f.get(m.symbolId)??[])x.has(p.symbol)||l.add(p.symbol);return l},R=i=>{let f=[];for(let l of i){let m=M(e,s,l);if(!m)continue;let p=j(e,m,a);p.removable?(x.add(l),h.delete(l),b.delete(l),f.push(O(m,"cascade"))):p.blockingFiles.length>0&&(h.add(l),b.set(l,{shortName:y(m.symbol),file:m.relativePath,blockingFiles:p.blockingFiles}))}return f};for(let i=1;i<=c&&g.length>0;i++){let f=R(N(g));if(f.length===0)break;for(let l of f)a.add(l);u.push(k(e,i,f,a)),g=f.map(l=>l.definition).filter(l=>l!==null)}let w=u.reduce((i,f)=>i+f.loc,0),_=u.reduce((i,f)=>i+f.entries.length,0);return{batches:u,totalSymbols:_,totalLoc:w,blocked:[...b.values()]}}function B(e,n,r,t){let c=C(e,{scope:n,minLoc:r,skipBarrels:!0,deadCodeOnly:!0,scanLimit:t,semantic:!1}),d=[];for(let s of c.symbols)s.kind==="dead-code"&&(L(e,s.relativePath)||P(e,s.symbol,s.relativePath)||d.push({symbol:s.symbol,shortName:s.shortName,file:s.relativePath,startLine:s.startLine,endLine:s.endLine,loc:s.loc,evidence:"graph-fact",definition:F(e,s.symbol)}));return d}function M(e,n,r){let t=F(e,r);if(t&&!e.isIgnored(t.relativePath)&&!L(e,t.relativePath)&&!P(e,t.symbol,t.relativePath)&&n.fileKind(t.relativePath)!=="test"&&!S(e,t.relativePath,t.startLine,"dead"))return t}function O(e,n){return{symbol:e.symbol,shortName:y(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let r=e.get(`SELECT d.relative_path
|
|
2
|
+
FROM global_symbols gs
|
|
3
|
+
JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
4
|
+
JOIN documents d ON d.id = der.document_id
|
|
5
|
+
WHERE gs.symbol = ?
|
|
6
|
+
LIMIT 1`,n);return r?v(e,r.relative_path).find(t=>t.symbol===n)??null:null}function j(e,n,r){let t=D(e,n);if(t.length===0)return{removable:!1,blockingFiles:[]};let c=new Set;for(let d of t)d.file===n.relativePath&&d.line>=n.startLine&&d.line<=n.endLine||r.contains(d.file,d.line)||c.add(d.file);return{removable:c.size===0,blockingFiles:[...c]}}function k(e,n,r,t){let c=[...r].sort((o,a)=>o.file.localeCompare(a.file)||o.startLine-a.startLine),d=new Set(c.map(o=>o.file)),s=[];for(let o of d){let a=v(e,o);a.length>0&&a.every(u=>t.contains(o,u.startLine))&&s.push(o)}return{depth:n,entries:c.map(({definition:o,...a})=>a),loc:c.reduce((o,a)=>o+a.loc,0),filesEmptied:s.sort()}}var I=class{ranges=new Map;add(n){let r=this.ranges.get(n.file)??[];r.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,r)}contains(n,r){let t=this.ranges.get(n);return t?t.some(c=>r>=c.start&&r<=c.end):!1}};export{W as a,I as b};
|
|
7
|
+
//# sourceMappingURL=chunk-3ZRB6DNK.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{statSync as r}from"fs";function o(t){let e=t.get("SELECT COUNT(*) as c FROM documents").c,s=t.get("SELECT COUNT(*) as c FROM global_symbols").c,n=t.get("SELECT COUNT(*) as c FROM mentions WHERE role = 1").c,i=t.get("SELECT COUNT(*) as c FROM mentions WHERE role != 1").c;return{documents:e,symbols:s,definitions:n,references:i,...a(t.generation.databasePath)}}function a(t){try{let e=r(t);return{indexSizeBytes:e.size,lastBuilt:e.mtime}}catch{return{indexSizeBytes:0,lastBuilt:null}}}export{o as a};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
//# sourceMappingURL=chunk-42EOW5VI.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as r}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as r}from"./chunk-F56GCXXS.js";function s(o,e,t={}){if(e.length===0)throw new Error("The source search pattern must not be empty.");return r(o,[e],t)[0]}export{s as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4BHGBMNO.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as d}from"./chunk-FVULPZDF.js";import{Da as p,c as u,qa as f,ra as l}from"./chunk-5TNQJUR2.js";import{existsSync as S,readdirSync as h,statSync as D}from"fs";import{join as c}from"path";var m="components.json",U=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),K=3,b=/(?:^|\/)components\/ui$/i,A=p("ui-kit-surface",{clearGroups:["whole-project"]});function N(t){return A.get(t,()=>E(t))}function x(t,i){let r=u(i),n=r.lastIndexOf("/");if(n<0)return null;let e=r.slice(0,n);for(let o of N(t).directories)if(e===o.directory)return o;return b.test(e)?{directory:e,source:"ui-directory-convention"}:null}function R(t,i){return x(t,i)!==null}function E(t){let i=new Map;for(let r of M(t.config.projectRoot)){let n=_(t,r);n&&!i.has(n)&&i.set(n,{directory:n,source:"shadcn-components-manifest",manifest:r})}return{directories:[...i.values()].sort((r,n)=>r.directory.localeCompare(n.directory))}}function M(t){let i=[],r=(n,e)=>{let o=n?c(t,n):t,s=n?`${n}/${m}`:m;if(S(c(t,s))&&i.push(s),e>=K)return;let g=T(o);for(let a of g)!a.isDirectory()||U.has(a.name)||a.name.startsWith(".")||r(n?`${n}/${a.name}`:a.name,e+1)};return r("",0),i}function _(t,i){let r;try{r=JSON.parse(f(t.config.projectRoot,i,{inputKind:"components manifest"}))}catch(o){return o instanceof Error&&l(o),null}if(!y(r))return null;let n=r.aliases;if(!y(n))return null;let e=j(n);return e?I(t,i,e):null}function I(t,i,r){let n=i.includes("/")?i.slice(0,i.lastIndexOf("/")):"",e=[];if(r.startsWith("./")||r.startsWith("../")||r.startsWith("/"))e.push(u(c(n,r)));else{let o=d(t,i,r);o&&e.push(o);let s=r.replace(/^[@~]\//,"");e.push(u(c(n,"src",s)),u(c(n,s)))}for(let o of e){let s=c(t.config.projectRoot,o);if(S(s)&&D(s).isDirectory())return o.replace(/\/+$/,"")}return null}function y(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function T(t){try{return h(t,{withFileTypes:!0})}catch{return[]}}function j(t){let i=typeof t.ui=="string"?t.ui:null,r=typeof t.components=="string"?t.components:null;return i??(r?`${r}/ui`:null)}export{x as a,R as b};
|
|
2
|
+
//# sourceMappingURL=chunk-4BP3UBDG.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as p}from"./chunk-QXEUDXBT.js";import{H as u,T as h,Y as a,s as c}from"./chunk-J5FJMODQ.js";import{c as m,d as y,e as L,k as g}from"./chunk-YULZRALL.js";function $(n,o){let r=p(n,o);if(!r)return[];let s=a(n,r.relativePath),t=new Set(s.map(e=>e.symbol)),l=h(n,r.relativePath),i=a(n,r.relativePath,{includeClassMemberFallbacks:!0}).filter(e=>e.symbol!==r.symbol).filter(e=>g(r.symbol,e.symbol)).map(e=>({symbol:e.symbol,shortName:m(e.symbol),startLine:t.has(e.symbol)?e.startLine:l.get(e.symbol)?.start_line??e.startLine,endLine:t.has(e.symbol)?e.endLine:l.get(e.symbol)?.end_line??e.endLine,kind:L(e.symbol)??"unknown"})).sort((e,b)=>e.startLine-b.startLine||e.endLine-b.endLine);return c(r.relativePath)!=="clojure"?i:M(i,f(n,r))}function f(n,o){let r=y(o.symbol);if(!r)return[];let s=m(o.symbol);return(u(n,o.relativePath)?.clojureMembers??[]).filter(t=>t.ownerName===r).map(t=>({symbol:`${o.symbol}${t.memberName}().`,shortName:`${s}:${t.memberName}()`,startLine:t.startLine,endLine:t.endLine,kind:t.memberKind}))}function M(n,o){let r=new Map;for(let s of[...n,...o])r.set(`${s.shortName}:${s.startLine}:${s.endLine}`,s);return[...r.values()].sort((s,t)=>s.startLine-t.startLine||s.endLine-t.endLine)}export{$ as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4D6RO7G4.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as i,k as p}from"./chunk-U5RIG3JP.js";import f from"better-sqlite3";var d=25,S=new Set(["typescript","javascript"]);function L(r,c,t){let n=null;try{n=new f(r,{readonly:!0,fileMustExist:!0});let e=new Set(n.prepare("SELECT relative_path FROM documents").pluck().all().map(p)),o=h(c,t),a=new Set([...o.values()].flatMap(s=>[...s])),u=[...a].filter(s=>!e.has(s)).sort();if(u.length===0)return{state:"complete",expectedDocumentCount:a.size,actualDocumentCount:e.size};let g=new Set(u),l=t.filter(s=>[...o.get(s)??[]].some(m=>g.has(m)));return{state:"incomplete",expectedDocumentCount:a.size,actualDocumentCount:e.size,missingDocumentCount:u.length,missingPaths:u.slice(0,d),affectedLanguages:l}}catch(e){return{state:"unavailable",reason:e instanceof Error?e.message:String(e)}}finally{n?.close()}}function h(r,c){let t=new Map,n=c.filter(e=>S.has(e));for(let e of n)t.set(e,new Set);for(let e of r.files){let o=p(e.path);for(let a of n)i(o,[a])==="source"&&t.get(a).add(o)}return t}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-4FEWQ6RH.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as W,c as H,d as Y}from"./chunk-KU3QRSTH.js";import{a as U}from"./chunk-4FEWQ6RH.js";import{A as v,C,s as G}from"./chunk-BIQEF5NE.js";import{a as N,b as F,d as b}from"./chunk-JEVRKFRL.js";import{a,b as h,f as y,g as T,h as d}from"./chunk-HRRFKWPZ.js";import{C as B,f as $,n as V,x as L,z as q}from"./chunk-TKD34PHN.js";import{L as M,c as g,e as k,o as j,u as _,v as D}from"./chunk-U5RIG3JP.js";import{a as A,h as E,i as m}from"./chunk-62BDNPMI.js";import{existsSync as Ee}from"fs";import{randomUUID as pn}from"crypto";import{isAbsolute as fn,join as _e,relative as gn,resolve as mn}from"path";import{createHash as re}from"crypto";var S=1,K=2,J=1,P=1,x="sha256";function en(e,n,t){if(!d(e)||!y(n))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:J,canonicalizationVersion:P,hashAlgorithm:x,projection:{name:e,version:n},digest:re(x).update(ie(e,n,t)).digest("hex")}}function ie(e,n,t){return`{"canonicalizationVersion":${P},"projection":${JSON.stringify(e)},"projectionVersion":${n},"value":${JSON.stringify(t)}}`}function oe(e){if(!a(e))return{kind:"malformed",reason:"observation receipt must be an object"};let n=e.schemaVersion;if(!Number.isInteger(n))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(n===S)return ae(e)?{kind:"legacy",schemaVersion:S,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(n===K)return ue(e)?{kind:"supported",schemaVersion:K,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let t=n;return{kind:"unsupported",schemaVersion:t,direction:t<S?"older":"future"}}function z(e){let n=oe(e);return n.kind==="legacy"||n.kind==="supported"}function se(e,n){return e.schemaVersion===n.schemaVersion&&e.canonicalizationVersion===n.canonicalizationVersion&&e.hashAlgorithm===n.hashAlgorithm&&e.projection.name===n.projection.name&&e.projection.version===n.projection.version}function ae(e){if(!a(e))return!1;let n=e.index,t=e.worktree;return h(e.observedAt)&&d(e.projectIdentity)&&Oe(e.authorityKind)&&ce(n)&&de(t)&&xe(e.authorityKind,n,t)}function ce(e){return e===void 0||a(e)&&d(e.generationIdentity)&&(e.source==="immutable"||e.source==="legacy")&&(e.alignment==="not-certified"||e.alignment==="leased")}function de(e){return e===void 0||a(e)&&d(e.identity)&&typeof e.clean=="boolean"&&(e.headCommit===void 0||d(e.headCommit))&&(e.treeOid===void 0||d(e.treeOid))}function ue(e){if(!a(e))return!1;let n=e.facts,t=e.observedSources;return!h(e.observedAt)||!a(n)||!pe(t)||!le(e.stabilityProofs,t,n)||!fe(n)?!1:he(e.diagnostics)&&Ce(n,t)}function pe(e){return Array.isArray(e)&&e.length>0&&e.every(be)&&R(e,n=>n.kind)}function le(e,n,t){return Array.isArray(e)&&e.every(ve)&&R(e,r=>r.source)&&!e.some(r=>!n.some(i=>i.kind===r.source))&&e.every(r=>Se(r,t))}function fe(e){return["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(t=>e[t]!==void 0&&!p(e[t]))?!1:ge(e.relevantInputs)&&me(e.index)}function ge(e){return e===void 0||Array.isArray(e)&&e.every(ye)&&R(e,n=>`${n.subject}\0${n.identity.projection.name}`)}function me(e){return e===void 0||a(e)&&p(e.generation)&&(e.inputs===void 0||p(e.inputs))&&(e.source==="immutable"||e.source==="legacy")}function he(e){return e===void 0||a(e)&&(e.clean===void 0||typeof e.clean=="boolean")&&(e.headCommit===void 0||d(e.headCommit))&&(e.treeOid===void 0||d(e.treeOid))}function p(e){return!a(e)||!a(e.projection)?!1:e.schemaVersion===J&&e.canonicalizationVersion===P&&e.hashAlgorithm===x&&d(e.projection.name)&&y(e.projection.version)&&T(e.digest)}function ye(e){return a(e)&&d(e.subject)&&p(e.identity)}function be(e){return a(e)&&Q(e.kind)&&(e.identity===void 0||p(e.identity))}function ve(e){return a(e)&&Q(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Ce(e,n){let t=e.index,r=n.find(u=>u.kind==="index-generation");if(!Pe(t,r))return!1;let i=e.workspaceInstance,o=n.find(u=>u.kind==="live-workspace");if(o?.identity&&(!p(i)||!O(o.identity,i)))return!1;let s=e.wholeContent,c=n.find(u=>u.kind==="repository-snapshot");return!(c?.identity&&(!p(s)||!O(c.identity,s)))}function Se(e,n){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&a(n.index)&&n.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function O(e,n){return se(e,n)&&e.digest===n.digest}function xe(e,n,t){return e==="index-worktree"?n!==void 0&&t!==void 0:e==="index-only"?n!==void 0&&t===void 0:e==="worktree-only"?n===void 0&&t!==void 0:e==="process-local"&&n===void 0&&t===void 0}function Oe(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function Q(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function R(e,n){return new Set(e.map(n)).size===e.length}function Pe(e,n){if(n){if(!a(e)||!p(e.generation)||n.identity&&!O(n.identity,e.generation))return!1}else if(e!==void 0)return!1;return!0}function on(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let n=e;return Re(n)&&Ie(n)&&we(n)}function Re(e){return e.kind==="automated-adjudication"&&e.policyVersion===1&&(e.decidedBy==="agent"||e.decidedBy==="human")&&F.includes(e.reasonCode)}function Ie(e){return Array.isArray(e.evidence)&&e.evidence.length>0&&e.evidence.every(ke)&&(e.observation===void 0||z(e.observation))}function we(e){return!!e.invalidateOn&&typeof e.invalidateOn=="object"&&typeof e.invalidateOn.targetContentChange=="boolean"&&typeof e.invalidateOn.detectorMajorChange=="boolean"}function ke(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let n=e;return je(n)&&Ae(n)}function je(e){return(e.kind==="source"||e.kind==="config"||e.kind==="test"||e.kind==="graph")&&typeof e.referent=="string"&&e.referent.trim()!==""&&typeof e.claim=="string"&&e.claim.trim()!==""}function Ae(e){return(e.contentHash===void 0||/^[a-f0-9]{64}$/u.test(e.contentHash))&&(e.generation===void 0||typeof e.generation=="string"&&e.generation.length>0)}var l=".scipquery.json",De=2e3,X=5e3,Z=X,Me=15*6e4,ee={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},Te={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:De,cooldownMs:Z,gitPollMs:2e3,idleTimeoutMs:Me,autoRefresh:!0,ignore:[],resourceBudget:ee};var vn=new Set(N);function Cn(e){let n=_e(e,l);if(!Ee(n))return{};let t;try{t=E(n,{maxBytes:A,inputKind:"scip-query project config"})}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${l} at ${n}: ${i}`,{cause:r})}return Ne(Y(t),n,"read").config}function Sn(e){return{...Te,...e.watch,cooldownMs:Math.max(X,e.watch?.cooldownMs??Z),resourceBudget:{...ee,...e.watch?.resourceBudget}}}function Ne(e,n,t){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let i=t==="read"?`invalid ${l} at ${n}: ${e.reason}`:`Cannot update ${n}: the latest project config is ${e.reason}.`;throw new Error(`${i} The file was left untouched.`)}let r=t==="read"?`invalid ${l} at ${n}`:`Cannot update ${n}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${W} and current v${H}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as f,lstatSync as Fe}from"fs";import{dirname as $e,resolve as Ve}from"path";function $n(e,n,t,r={}){let i=new Date().toISOString();if(!f(t.dbPath))return{state:"missing",checkedAt:i,metaPath:t.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!f(t.metaPath))return{state:"unknown",checkedAt:i,metaPath:t.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let o=b(m(t.metaPath,"reindex metadata"));return o.kind==="unsupported"?{state:"unknown",checkedAt:i,metaPath:t.metaPath,reason:`Reindex metadata version ${o.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"}:o.kind==="malformed"?{state:"unknown",checkedAt:i,metaPath:t.metaPath,reason:`Could not decode reindex metadata: ${o.reason}`,remedy:"Run: scip-query reindex"}:Le(e,n,t,r,o,i)}catch(o){return{state:"unknown",checkedAt:i,metaPath:t.metaPath,reason:`Could not read reindex metadata: ${o instanceof Error?o.message:String(o)}`,remedy:"Run: scip-query reindex"}}}function Le(e,n,t,r,i,o){let s=i.metadata,c=n.languages??G(e),u=qe(e,n,t,r,c,s.fingerprint),I=[...s.indexedLanguages??[]].sort(),ne=i.capabilities.publishableGeneration&&k(g(s.fingerprint),u)&&JSON.stringify(I)===JSON.stringify(u.languages),{accepted:w,reason:te}=Ue(t,u,I,ne);return{state:w?"fresh":"stale",checkedAt:o,metaPath:t.metaPath,updatedAt:s.updatedAt,lastRefresh:s.lastRefresh,reason:te,remedy:w?void 0:"Run: scip-query reindex"}}function qe(e,n,t,r,i,o){return Be(e,n,t,r,i,o)??Ke(e,i,n,t.cacheDir??$e(t.dbPath))}function Be(e,n,t,r,i,o){if(!t.cacheDir||!r.gitContext||!C(r.gitContext,t.cacheDir,o))return;let s=Ge(e,n,i,r.gitContext,r.gitObservation,o);if(!(!s||!C(s,t.cacheDir,o)))return o}function Ge(e,n,t,r,i,o){if(!Je(o,t,n)||!ze(e,o,n))return;let s=i?.context===r?r:_(r),c=i&&i.context===r?i.projectFileInventorySequence:void 0;return s?.clean&&D(e,void 0,{cachedInventoryAfterSequence:c})?s:void 0}function Ue(e,n,t,r){let i=v(e.dbPath,e.metaPath),o=i.state==="invalid"||i.state==="drifted",s=r?U(e.dbPath,n,t):void 0,c=s?.state==="incomplete";return{accepted:r&&!o&&!c,reason:We(i,s,r)}}function We(e,n,t){return e.state==="invalid"||e.state==="drifted"?`SQLite generation requires repair: ${e.reason}`:n?.state==="incomplete"?`SQLite generation is missing ${n.missingDocumentCount} indexed source document(s): ${n.missingPaths.join(", ")}`:t?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files."}function Vn(e){let n=new Date().toISOString();if(!f(e.dbPath))return{state:"missing",checkedAt:n,metaPath:e.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!f(e.metaPath))return{state:"unknown",checkedAt:n,metaPath:e.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let t=b(m(e.metaPath,"reindex metadata"));return t.kind==="unsupported"?{state:"unknown",checkedAt:n,metaPath:e.metaPath,reason:`Reindex metadata version ${t.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"}:t.kind==="malformed"?{state:"unknown",checkedAt:n,metaPath:e.metaPath,reason:`Could not decode reindex metadata: ${t.reason}`,remedy:"Run: scip-query reindex"}:He(e,n,t)}catch(t){return{state:"unknown",checkedAt:n,metaPath:e.metaPath,reason:`Could not read reindex metadata: ${t instanceof Error?t.message:String(t)}`,remedy:"Run: scip-query reindex"}}}function He(e,n,t){let r=t.metadata,i=Ye(t),o=v(e.dbPath,e.metaPath),s=o.state==="invalid"||o.state==="drifted",c=i&&!s;return{state:c?"fresh":"stale",checkedAt:n,metaPath:e.metaPath,updatedAt:r.updatedAt,lastRefresh:r.lastRefresh,reason:s?`SQLite generation requires repair: ${o.reason}`:i?"Watcher accepted the newly published index generation with no later changes pending.":"Published index metadata is not a complete queryable generation.",remedy:c?void 0:"Run: scip-query reindex"}}function Ye(e){let n=e.metadata,t=[...n.indexedLanguages??[]].sort(),r=g(n.fingerprint),i=[...r?.languages??[]].sort();return e.capabilities.publishableGeneration&&r!==null&&JSON.stringify(t)===JSON.stringify(i)}function Ke(e,n,t,r=$(e,t)){return V(e,r,()=>q(e,n,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath}))}function Je(e,n,t){let r=Qe(n,t);return e.version===r.version&&e.typescriptSymbolIdentityVersion===r.typescriptSymbolIdentityVersion&&JSON.stringify([...e.languages].sort())===JSON.stringify(r.languages)&&e.pnpmWorkspaces===r.pnpmWorkspaces&&e.typescriptProjectMode===r.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(r.typescriptProjects)&&e.clojureConfigPath===r.clojureConfigPath}function ze(e,n,t){if(!(n.languages.includes("typescript")||!!n.clojureConfigPath))return!0;let i=L(e);if(n.clojureConfigPath){let o=j(n.clojureConfigPath);if(!i.includes(o))return!1;try{if(!Fe(Ve(e,o)).isFile())return!1}catch{return!1}}return!n.languages.includes("typescript")||M(e,t.indexer?.typescript?.projectMode,t.indexer?.typescript?.projects??[],i)}function Qe(e,n){return B(e,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath})}export{K as a,en as b,on as c,Cn as d,Sn as e,$n as f,Vn as g};
|
|
2
|
+
//# sourceMappingURL=chunk-4IGEOBG7.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as g}from"./chunk-GMVSHUKZ.js";import{a as C}from"./chunk-NOWINRRN.js";import{a as E}from"./chunk-BOJ5SVE2.js";import{b as T}from"./chunk-6LSEIIF7.js";import{a as x}from"./chunk-BGBBVSH4.js";import{a as S,g as P}from"./chunk-4WCUBZU3.js";import{d,f as p,g as u,j as f}from"./chunk-5D2LVK7O.js";import{i as v,j as w}from"./chunk-7WTPQ4NX.js";import{d as b,e as y,g as h}from"./chunk-A2IIGFMJ.js";import{basename as $,extname as F}from"path";function D(i,e,o,t,n,r){let a=new Set;R(i,e,o,t)&&a.add(n);let l=I(r);for(let s of r)s.value&&k(a,s.label,s.value,l);return[...a].slice(0,6)}function I(i){let e={self:new Set,other:new Set},o=0;for(let t of i)if(!(!t.side||!t.value)){o+=1;for(let n of L(t.value))e[t.side].add(n)}return o===0||e.self.size===0||e.other.size===0?new Set:new Set([...e.self].filter(t=>e.other.has(t)))}function k(i,e,o,t){let n=L(o);e.endsWith("name")&&z(n)&&i.add(`${e} has type-guard boundary shape`);for(let r of n){if(t.has(r))continue;let a=B.get(r);a&&i.add(`${e} has ${a} term: ${r}`)}}function R(i,e,o,t){if(o<=0)return!1;let n=b(i,e);if(n.length===0)return!1;for(let r=o-1;r>=0&&r>=o-5;r-=1){let a=(n[r]??"").trim();if(a!==""){if(y(a)===t)return!0;if(!_(a))return!1}}return!1}function L(i){return i.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 z(i){return i.some(e=>j.has(e))&&i.some(e=>N.has(e))}var B=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"]]),j=new Set(["can","has","is","should"]),N=new Set(["access","api","auth","collision","expired","input","keyboard","overlap","permission","permissions","policy","projectile","response","route","routes","scope"]);function _(i){return["//","*","/*","@","#"].some(e=>i.startsWith(e))}function ae(i,e){let{scope:o,maxLoc:t=15,limit:n=30,scanLimit:r}=e??{},a=new T(i),l=C({candidates:()=>Y(i,a,o,t),orderCandidates:E,scanLimit:r,profile:{name:"passthrough-candidates"},prepare:s=>a.calleeMap(s,{semantic:e?.semantic!==!1}),evaluate:(s,c)=>q(i,s,c.get(s.symbolId)??[]),orderResults:(s,c)=>s.loc-c.loc||s.file.localeCompare(c.file)});return M(l).slice(0,n===void 0?l.length:n)}var m=3;function M(i){let e=new Map,o=new Map;for(let t of i){if(t.file===t.forwardsToFile)continue;let n=`${t.file}\0${t.forwardsToFile}`;e.set(n,(e.get(n)??0)+1);let r=u(t.symbol),a=u(t.forwardsTo);if(!r||!a||r===a)continue;let l=`${t.file}\0${r}`;o.set(l,(o.get(l)??0)+1)}return i.map(t=>{let n=e.get(`${t.file}\0${t.forwardsToFile}`)??0,r=u(t.symbol),a=r?o.get(`${t.file}\0${r}`)??0:0;if(n<m&&a<m)return t;let l=n>=m?`facade: ${n} sibling forwards from this file to ${t.forwardsToFile}`:`facade: ${a} methods of ${r} forward to members of its collaborators`,s=[...t.boundaryEvidence,l];return{...t,boundaryEvidence:s,actionTier:"signal",recommendation:A("signal",s,t.publicFacadeEvidence)}})}function q(i,e,o){let t=U(o);if(t.size!==1||!v(i,e.relativePath,e.startLine,e.endLine))return null;let[,n]=[...t.entries()][0],r=O(i,e,n),a=G(i,e),l=r.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:x(e),forwardsTo:n.symbol,forwardsToShort:d(n.symbol),forwardsToFile:n.file,actionTier:l,boundaryEvidence:r,publicFacadeEvidence:a,recommendation:A(l,r,a)}}function O(i,e,o){return D(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:p(e.symbol),side:"self"},{label:"callee name",value:p(o.symbol),side:"other"},{label:"passthrough module",value:$(e.relativePath,F(e.relativePath)),side:"self"},{label:"callee module",value:$(o.file,F(o.file)),side:"other"}])}function A(i,e,o){if(i==="signal"){if(o.length>0)return`Review the public API before inlining; public-facade evidence: ${o.slice(0,2).join("; ")}.`;let t=e.filter(K);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.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 G(i,e){return g(i,e)?S(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:P(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function K(i){return i.includes("public surface")}function U(i){let e=i.some(t=>f(t.symbol))?i.filter(t=>f(t.symbol)):i,o=new Map;for(let t of e)o.has(t.symbol)||o.set(t.symbol,t);return o}function Y(i,e,o,t){return e.productionCallableDefinitions({scope:o,minLoc:3,maxLoc:t,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(n=>!w(i,n)).filter(n=>!h(i,n.relativePath,n.startLine,"passthrough"))}export{ae as a,M as b};
|
|
2
|
+
//# sourceMappingURL=chunk-4QZXBUKC.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{a as w}from"./chunk-KI6NBKDY.js";import{b as v}from"./chunk-6LSEIIF7.js";import{b as E}from"./chunk-FMRN2TRL.js";import{b as P,d as M}from"./chunk-72AD6ZRR.js";import{d as L,e as x}from"./chunk-5D2LVK7O.js";import{b as p,f as d,g as B}from"./chunk-7WTPQ4NX.js";import{D as h,F as S,O as g}from"./chunk-FVULPZDF.js";import{qa as f,ra as y}from"./chunk-5TNQJUR2.js";function Q(n,e,s={}){let r=E(n,e);if(r.candidates.length>0)throw new Error(`Ambiguous symbol: ${e}. Use an exact SCIP symbol or file:line.`);let t=r.match;if(!t)return null;let a=N(n,t),i=t.endLine-t.startLine+1,o=new v(n).callableCallees(t,s),c=o.filter(m=>m.evidenceStrength==="exact"),l=new Set(c.map(m=>m.symbol)),D=new Set(o.filter(m=>!l.has(m.symbol)).map(m=>m.symbol));return{symbol:t.symbol,shortName:L(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:i,branches:a.branches,estimateBasis:a.estimateBasis,metricRules:a.metricRules??`${a.estimateBasis}-estimate-v1`,cyclomaticEstimate:a.branches+1,calleeCount:l.size,candidateCalleeCount:D.size,fanIn:w(n,t.symbolId),fanOut:$(c,t.relativePath)}}function N(n,e){b(n,e.relativePath,e.startLine,e.endLine);let s=F(e,C(n,e.relativePath));if(s)return s;let r=g(n,e.relativePath);if(r){let t=S(r.rootNode,e.startLine,e.endLine);if(t)return{branches:O(t),estimateBasis:"ast"}}return{branches:I(b(n,e.relativePath,e.startLine,e.endLine),R(n,e.relativePath)),estimateBasis:"regex-fallback"}}function V(n,e){let s=new Map,r=new Map;for(let t of e){b(n,t.relativePath,t.startLine,t.endLine);let a=r.get(t.relativePath)??[];a.push(t),r.set(t.relativePath,a)}for(let[t,a]of r)j(n,t,a,s);return s}function j(n,e,s,r){let t=C(n,e),a=new Map;for(let o of B(n,e)?.callables??[])o.branches!==void 0&&a.set(`${o.startLine}:${o.endLine}`,o.branches);let i=[];for(let o of s){let c=F(o,t);if(c){r.set(o.symbolId,c);continue}let l=a.get(`${o.startLine}:${o.endLine}`);l===void 0?i.push(o):r.set(o.symbolId,{branches:l,estimateBasis:"ast"})}i.length>0&&k(n,e,i,r)}function k(n,e,s,r){let t=g(n,e),a=t===null?[]:s.filter(o=>t.rootNode.startPosition.row<=o.startLine&&t.rootNode.endPosition.row>=o.endLine),i=new Set(a.map(o=>o.symbolId));if(t&&a.length>0){for(let o of a)r.set(o.symbolId,{branches:0,estimateBasis:"ast"});z(t.rootNode,a,r)}for(let o of s)i.has(o.symbolId)||r.set(o.symbolId,A(n,o))}function C(n,e){if(!/\.[cm]?[jt]sx?$/i.test(e))return[];try{return M(e,f(n.config.projectRoot,e)).functions}catch(s){if(!y(s))throw s;return[]}}function F(n,e){let s=x(n.symbol),r=e.filter(t=>t.startLine-1>=n.startLine&&t.endLine-1<=n.endLine&&t.name.split(".").at(-1)?.replace(/^(get|set) /,"")===s);if(r.length===1)return{branches:r[0].cyclomatic-1,estimateBasis:"ast",metricRules:P}}function A(n,e){return{branches:I(b(n,e.relativePath,e.startLine,e.endLine),R(n,e.relativePath)),estimateBasis:"regex-fallback"}}function R(n,e){return n.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function b(n,e,s,r){let t=f(n.config.projectRoot,e,{inputKind:"indexed source file"}).split(`
|
|
2
|
+
`),a=t.slice(s,r+1).join(`
|
|
3
|
+
`);if(s<0||r<s||r>=t.length||!a.trim())throw new Error(`Current source does not cover the indexed definition in ${e}. Reindex before measuring complexity.`);return a}function $(n,e){return new Set(n.filter(s=>s.file!==e).map(s=>s.symbol)).size}function O(n){let e=0;return h(n,s=>{e+=d(s)}),e}function z(n,e,s){let r=[...e].sort((t,a)=>t.startLine-a.startLine||a.endLine-t.endLine);h(n,t=>{let a=d(t);if(a===0)return;let i=t.startPosition.row,o=t.endPosition.row;for(let c of r){if(c.startLine>i)break;if(c.endLine<o)continue;let l=s.get(c.symbolId);l&&(l.branches+=a)}})}function I(n,e){let s=p(n),r=0;return r+=u(s,[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g]),e==="python"?r+=u(s,[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g]):e==="rust"?r+=u(s,[/\bmatch\b/g,/=>/g,/\bloop\b/g]):e==="ruby"?r+=u(s,[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g]):e==="go"&&(r+=u(s,[/\bselect\b/g,/\bdefer\b/g])),r}function u(n,e){let s=0;for(let r of e){let t=n.match(r);t&&(s+=t.length)}return s}export{Q as a,N as b,V as c,O as d};
|
|
4
|
+
//# sourceMappingURL=chunk-4WBDEVX2.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{c as m}from"./chunk-E3FDPXZK.js";import{a as _}from"./chunk-DHEQMPLW.js";import{b as N}from"./chunk-GCKCF5FL.js";import{a as A,e as b,x as v}from"./chunk-5D2LVK7O.js";import{r as O}from"./chunk-7WTPQ4NX.js";import{a as S}from"./chunk-FVULPZDF.js";import{d as D}from"./chunk-A2IIGFMJ.js";import{Da as u,c as f,qa as l,ra as d,sa as F}from"./chunk-5TNQJUR2.js";import{existsSync as y,readdirSync as M}from"fs";import{join as h}from"path";var ft={files:new Set,pathPrefixes:[]},ut={reasonsByFile:new Map},k=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,gt=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,$=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],lt=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),pt=4,dt=u("package-surface",{clearGroups:["whole-project"]}),St=u("package-operational-surface",{clearGroups:["whole-project"]});function L(t){return dt.get(t,()=>ht(t.config.projectRoot))}function E(t,e){let r=L(t);return r.files.has(e)?!0:r.pathPrefixes.some(n=>e.startsWith(n))}function G(t,e){return L(t).files.has(e)}function mt(t){return St.get(t,()=>bt(t.config.projectRoot))}function ve(t,e){return mt(t).reasonsByFile.get(e)??[]}function ht(t){let e=new Set,r=[];for(let{manifest:n,packageRoot:s}of V(t))for(let i of yt(n))W(t,s,i,e,r);return e.size===0&&r.length===0?ft:{files:e,pathPrefixes:r}}function bt(t){let e=new Map;for(let{manifest:r,packageRoot:n}of V(t)){let s=Pt(r);for(let o of s)C(t,n,o,"package binary",e);let i=r.scripts;if(!(!i||typeof i!="object")){for(let[o,a]of Object.entries(i))if(typeof a=="string")for(let c of xt(a))C(t,n,c,`package script "${o}"`,e)}}return e.size===0?ut:{reasonsByFile:e}}function V(t){let e=[],r=U(t,"");return r&&e.push({manifest:r,packageRoot:""}),X(t,"",e,0),e}function X(t,e,r,n){if(n>=pt)return;let s=h(t,e);if(y(s))for(let i of M(s,{withFileTypes:!0})){if(!i.isDirectory()||lt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name,a=U(t,o);a&&r.push({manifest:a,packageRoot:o}),X(t,o,r,n+1)}}function U(t,e){let r;try{r=l(t,h(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(n){if(!d(n))throw n;return null}try{let n=JSON.parse(r);return n&&typeof n=="object"?n:null}catch{return null}}function yt(t){let e=[];for(let n of["main","module","types","browser"])typeof t[n]=="string"&&e.push(t[n]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let n of Object.values(r))typeof n=="string"&&e.push(n);return B(t.exports,e),e}function Pt(t){let e=t.bin;return typeof e=="string"?[e]:!e||typeof e!="object"?[]:Object.values(e).filter(r=>typeof r=="string")}function xt(t){let e=[],r=/(?:^|&&|\|\||;)\s*(?:(?:cross-env|env)(?:\s+[A-Za-z_][A-Za-z0-9_]*=\S+)*\s+)?(?:node|bun|tsx|ts-node|vite-node|python3?|deno\s+run)\s+(?:(?:--?[A-Za-z0-9-]+(?:=\S+)?)\s+)*["']?([^"'`\s]+\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|py))["']?/g;for(let n of t.matchAll(r)){let s=n[1];s&&!s.startsWith("node_modules/")&&!s.startsWith("./node_modules/")&&e.push(s)}return e}function C(t,e,r,n,s){let i=new Set;W(t,e,r,i,[]);for(let o of i){let a=s.get(o)??[];a.includes(n)||a.push(n),s.set(o,a)}}function B(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))B(r,e)}function W(t,e,r,n,s){let i=r.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let o=i.indexOf("*");if(o>=0){let c=i.slice(0,o);for(let p of I(c))p!==""&&s.push(g(e,p));return}let a=i.replace(gt,"");for(let c of I(a)){c===a&&c===i&&n.add(g(e,i));for(let p of $)kt(t,n,e,c+p)}n.add(g(e,i))}function I(t){let e=[t];return k.test(t)&&(e.push(t.replace(k,"src/")),e.push(t.replace(k,""))),e}function kt(t,e,r,n){let s=g(r,n);if(e.add(s),!n.startsWith("src/")||y(h(t,s)))return;let i=$.find(x=>n.endsWith(x));if(!i)return;let o=n.slice(0,-i.length);Et(t,e,r,o,i);let a=o.lastIndexOf("/");if(a<=4)return;let c=o.slice(0,a),p=o.slice(a+1);for(let x of K(t,r,c,`${p}${i}`))e.add(x)}function Et(t,e,r,n,s){let i=g(r,`${n}/index${s}`);y(h(t,i))&&e.add(i)}function K(t,e,r,n){let s=h(t,e,r);if(!y(s))return[];let i=[];for(let o of M(s,{withFileTypes:!0})){let a=`${r}/${o.name}`;o.isDirectory()?i.push(...K(t,e,a,n)):o.isFile()&&o.name===n&&i.push(g(e,a))}return i}function g(t,e){return t?`${t}/${e}`:e}import{existsSync as T,readdirSync as Tt}from"fs";import{dirname as Rt,join as R}from"path";var wt={rootFiles:new Set,sourcePrefixes:[]},jt=new Set([".git",".scipquery","node_modules","target"]),_t=6,Ft=u("rust-library-surface",{clearGroups:["whole-project"]});function H(t,e,r){if(!r.endsWith(".rs")||!Nt(Dt(t),r))return!1;let n=v(t,r).find(s=>s.symbol===e);return n?At(D(t,r)[n.startLine]??""):!1}function Dt(t){return Ft.get(t,()=>Ot(t.config.projectRoot))}function Ot(t){let e=new Set,r=new Set;for(let n of vt(t)){let s=l(t,R(n,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=Ct(s),o=g(n,"src/lib.rs"),a=i?g(n,i):!It(s)&&F(t,o)?o:null;if(!a)continue;e.add(a);let c=Rt(a).replaceAll("\\","/");r.add(c==="."?"":`${c}/`)}return e.size===0?wt:{rootFiles:e,sourcePrefixes:[...r].sort()}}function Nt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:Mt(e)?!1:t.sourcePrefixes.some(r=>e.startsWith(r)):!1}function At(t){return/^\s*pub\s+(?!\()/.test(t)}function vt(t){if(!T(t))return[];let e=[];return q(t,"",e,0),e}function q(t,e,r,n){let s=R(t,e);if(T(s)&&(T(R(s,"Cargo.toml"))&&r.push(e),!(n>=_t)))for(let i of Tt(s,{withFileTypes:!0})){if(!i.isDirectory()||jt.has(i.name))continue;let o=e?`${e}/${i.name}`:i.name;q(t,o,r,n+1)}}function Ct(t){let e=!1;for(let r of t.split(`
|
|
2
|
+
`)){let n=r.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(n);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(n)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function It(t){let e=!1;for(let r of t.split(`
|
|
3
|
+
`)){let n=r.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(n);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(n))return!0}return!1}function Mt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}import{existsSync as $t,readdirSync as Lt}from"fs";import{join as Gt}from"path";var Vt=/^(?:[\w.-]+\.config\.[cm]?[jt]s|package\.json)$/,Xt=/(?:\.{1,2}\/)?[\w@./-]+\.(?:[cm]?[jt]sx?)\b/g,Ut=u("config-referenced-files",{clearGroups:["whole-project"]});function Bt(t){return Ut.get(t,()=>Wt(t))}function Y(t,e){return Bt(t).has(f(e))}function Wt(t){let e=new Set,r=t.config.projectRoot,n;try{n=Lt(r)}catch{return e}let s=n.filter(o=>Vt.test(o)&&$t(Gt(r,o)));if(s.length===0)return e;let i=new Set(S(t,{includeIgnored:!1}).map(o=>f(o)));for(let o of s){let a;try{a=l(r,o,{inputKind:"root configuration file"})}catch(c){if(d(c))continue;continue}Kt(a,i,e)}return e}function Kt(t,e,r){for(let n of t.matchAll(Xt)){let s=f(n[0]).replace(/^\.\//,"");s.startsWith("..")||s.startsWith("/")||e.has(s)&&r.add(s)}}import{existsSync as w,readdirSync as Ht}from"fs";import{join as P}from"path";var qt=["trigger.config.ts","trigger.config.mts","trigger.config.js","trigger.config.mjs"],Yt=["./src/trigger","./trigger"],Zt=/\bdirs\s*:\s*\[([^\]]*)\]/,Jt=/["'`]([^"'`]+)["'`]/g,Qt=["","apps","packages","services"],zt=u("framework-task-surface",{clearGroups:["whole-project"]});function te(t){return zt.get(t,()=>ee(t))}function Z(t,e){let r=f(e);return te(t).directories.some(n=>r===n.directory||r.startsWith(`${n.directory}/`))}function ee(t){let e=new Map;for(let r of re(t.config.projectRoot))for(let n of ne(t,r))e.has(n)||e.set(n,{directory:n,framework:"trigger.dev",config:r});return{directories:[...e.values()].sort((r,n)=>r.directory.localeCompare(n.directory))}}function re(t){let e=[],r=n=>{for(let s of qt){let i=n?`${n}/${s}`:s;w(P(t,i))&&e.push(i)}};r("");for(let n of Qt.slice(1)){let s=P(t,n);if(!w(s))continue;let i;try{i=Ht(s)}catch{continue}for(let o of i)r(`${n}/${o}`)}return e}function ne(t,e){let r;try{r=l(t.config.projectRoot,e,{inputKind:"framework task config"})}catch(a){return d(a)?[]:[]}let n=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",s=Zt.exec(r)?.[1],i=s?[...s.matchAll(Jt)].map(a=>a[1]):Yt,o=[];for(let a of i){let c=f(P(n,a)).replace(/\/+$/,"");c===""||c.startsWith("..")||w(P(t.config.projectRoot,c))&&o.push(c)}return o}function se(t){return m(t)==="barrel"}function Q(t){return ie.get(t,()=>{let r=S(t,{includeIgnored:!1}).filter(o=>{let a=m(o);return a==="entry"||a==="worker"});if(r.length===0)return new Set;let n=N(t),s=new Set,i=new Set;for(;r.length>0;){let o=r.shift();if(!s.has(o)){s.add(o),m(o)==="barrel"&&i.add(o);for(let a of n.get(o)??[])s.has(a)||r.push(a)}}return i})}var ie=u("live-barrels",{clearGroups:["whole-project"]});function oe(t,e){return Q(t).has(f(e))}function hr(t){let e=Q(t);return S(t,{includeIgnored:!1}).filter(r=>se(r)&&!e.has(r)&&!ae(t,r))}function ae(t,e){let r=f(e),n=A(t).forFile(r,{facts:!0}).facts?.callables;return n&&n.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
4
|
+
FROM defn_enclosing_ranges der
|
|
5
|
+
JOIN documents d ON d.id = der.document_id
|
|
6
|
+
WHERE d.relative_path = ?
|
|
7
|
+
AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function br(t,e){let r=f(e),n=m(e);return n==="entry"||n==="worker"||Re(r)||Z(t,r)||Y(t,r)||oe(t,r)}function ce(t,e,r){let n=f(r),s=[];E(t,n)&&s.push("package-surface-file"),ge(t,e,n)&&s.push("transitive-package-surface"),H(t,e,n)&&s.push("rust-public-library"),Te(e,n)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(o=>f(o)===n)&&s.push("configured-file"),i.pathPrefixes?.some(o=>n.startsWith(f(o)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(o=>je(e,o))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(o=>{try{return _(o,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function yr(t,e,r){return ce(t,e,r).length>0}var fe=u("package-surface-reachability",{clearGroups:["whole-project"]}),ue=u("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function ge(t,e,r){let n=le(t).get(r);return n===void 0?!1:n===null||n.has(b(e))}function Pr(t,e,r){let n=pe(t).get(r);return n===void 0?!1:n===null||n.has(b(e))}function le(t){return fe.get(t,()=>z(t,e=>E(t,e)))}function pe(t){return ue.get(t,()=>z(t,e=>G(t,e)))}function z(t,e){let r=new Map,n=[];for(let s of S(t,{includeIgnored:!1}))e(s)&&(r.set(s,null),n.push(s));for(;n.length>0;){let s=n.shift(),i=r.get(s);i!==void 0&&_e(t,s,i,r,n)}return r}function de(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(n=>t.has(n))?null:void 0;let r=e.names.filter(n=>t.has(n));return r.length>0?new Set(r):void 0}function Se(t,e,r){if(!t.has(e))return t.set(e,r),!0;let n=t.get(e);if(n===void 0)return!1;if(n===null||r===null)return n===null?!1:(t.set(e,null),!0);let s=!1;for(let i of r)n.has(i)||(n.add(i),s=!0);return s}var tt=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),me=new Set(["default","generateMetadata","generateStaticParams"]),he=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),be=new Set(["default","middleware","config"]),ye=new Set(["register","onRequestError"]),Pe=new Set(["onRouterTransitionStart"]),xe=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),ke=new Set(["load","actions","entries",...tt]),Ee=new Set(["default"]);function Te(t,e){let r=b(t);return r===""?!1:Fe(e,r)}function Re(t){return et(t)||rt(t)||nt(t)||st(t)||it(t)||ot(t)||at(t)||ct(t)}function et(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function rt(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function nt(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return j(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function it(t){return j(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function ot(t){return j(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function j(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function at(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function ct(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function we(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function je(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let n=e.slice(0,r),s=e.slice(r+1);return t.includes(J(n)+"/")&&t.includes(J(s)+".")}function J(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}function _e(t,e,r,n,s){for(let i of O(t,e)){if(!i.sourcePath||t.isIgnored(i.sourcePath))continue;let o=de(r,i);o!==void 0&&Se(n,i.sourcePath,o)&&s.push(i.sourcePath)}}function Fe(t,e){return et(t)?tt.has(e):rt(t)?me.has(e):nt(t)?he.has(e):st(t)?be.has(e):it(t)?ye.has(e):ot(t)?Pe.has(e):at(t)?xe.has(e):ct(t)?ke.has(e):we(t)?Ee.has(e):!1}export{E as a,ve as b,se as c,hr as d,br as e,ce as f,yr as g,Pr as h,Re as i};
|
|
8
|
+
//# sourceMappingURL=chunk-4WCUBZU3.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{c as ze,d as me,e as We,f as Ue,o as He}from"./chunk-NZAXKGRL.js";import{b as K}from"./chunk-YNQCGEQE.js";import{a as Qe}from"./chunk-KHWRRPV4.js";import{e as qe}from"./chunk-72AD6ZRR.js";import{a as Be}from"./chunk-GCKCF5FL.js";import{d as Ge,e as Je}from"./chunk-DVFP6PZI.js";import{E as Ke,F as $e,e as k,i as je,x as N,y as Z,z as Ve}from"./chunk-5D2LVK7O.js";import{g as X,n as j,o as V,r as ke,s as Fe,u as _e}from"./chunk-7WTPQ4NX.js";import{A as fe,C as Me,D as Y,G as de,H as pe,I as P,O,S as Pe,q as Ae}from"./chunk-FVULPZDF.js";import{b as De}from"./chunk-D3FDISIC.js";import{d as Q}from"./chunk-A2IIGFMJ.js";import{c as Oe,d as Te}from"./chunk-PH52RA7D.js";import{Ba as ve,Da as M,d as ue,q as Ne,t as Ie}from"./chunk-5TNQJUR2.js";function F(e){return e?`${e.startLine}:${e.startColumn}:${e.endLine}:${e.endColumn}`:""}function $(e,n,r,t){let i=new Map;if(r.length===0)return i;t??=j(e,n)??[];let s=new Set;for(let a of r){let o=Ye(e,n,a,t);if(!o||o.startColumn===void 0||o.endColumn===void 0)continue;let l=F({...o,startColumn:o.startColumn,endColumn:o.endColumn});i.has(l)?s.add(l):i.set(l,a)}for(let a of s)i.delete(a);return i}function Ye(e,n,r,t=j(e,n)??[]){let i=k(r.symbol),s=i==="<constructor>"?"constructor":i,a=t.filter(l=>l.name===s&&l.startLine>=r.startLine&&l.endLine<=r.endLine&&(l.startLine!==r.startLine||l.startColumn===void 0||l.startColumn>=(r.startChar??0))&&(l.endLine!==r.endLine||l.endColumn===void 0||!r.endChar||l.endColumn<=r.endChar)),o=a.filter(l=>!a.some(f=>f!==l&&(f.startLine<l.startLine||f.startLine===l.startLine&&(f.startColumn??0)<(l.startColumn??0))&&(f.endLine>l.endLine||f.endLine===l.endLine&&(f.endColumn??Number.MAX_SAFE_INTEGER)>=(l.endColumn??0))));return o.length===1?o[0]:void 0}import{extname as Yn}from"path";import{ts as y}from"@ts-morph/common";import{ts as S}from"@ts-morph/common";function ee(e){for(let n=e.parent;n;n=n.parent)if(S.isFunctionLike(n))return n;return null}function ne(e,n,r=new Set){let t=new Set;for(e=C(e);S.isIdentifier(e)&&!t.has(e);){t.add(e);let i=D(e,n);if(!i||r.has(i))return;if(!S.isVariableDeclaration(i)||!i.initializer||!(i.parent.flags&S.NodeFlags.Const)||!S.isIdentifier(C(i.initializer)))return i;e=C(i.initializer)}}function D(e,n){if(S.isIdentifier(e)){let r=S.isShorthandPropertyAssignment(e.parent)?n.getShorthandAssignmentValueSymbol(e.parent):n.getSymbolAtLocation(e);return r?.valueDeclaration??r?.declarations?.find(t=>S.isImportSpecifier(t)||S.isImportClause(t)||S.isNamespaceImport(t))}if(e.kind===S.SyntaxKind.ThisKeyword){for(let r=e.parent;r;r=r.parent)if(S.isFunctionLike(r)&&!S.isArrowFunction(r))return r}}function Xe(e){for(;S.isBindingElement(e);)e=e.parent.parent;return S.isParameter(e)}function C(e){for(;S.isParenthesizedExpression(e)||S.isAsExpression(e)||S.isTypeAssertionExpression(e)||S.isSatisfiesExpression(e)||S.isNonNullExpression(e);)e=e.expression;return e}function z(e,n,r=new Set,t=new Set){if(e=C(e),S.isPropertyAccessExpression(e)||S.isElementAccessExpression(e)){let a=z(e.expression,n,r,t);if(!a)return;let o=S.isPropertyAccessExpression(e)?e.name.text:I(e.argumentExpression);return{...a,path:[...a.path,o]}}let i=D(e,n);if(!i||t.has(i))return;if(t.add(i),r.has(i))return{binding:i,path:[],reassigned:!0};let s=In(i);return s?z(s,n,r,t):{binding:i,path:[],reassigned:!1}}function In(e){if(!S.isVariableDeclaration(e)||!e.initializer||!(e.parent.flags&S.NodeFlags.Const))return;let n=C(e.initializer);return S.isIdentifier(n)||S.isPropertyAccessExpression(n)||S.isElementAccessExpression(n)?n:void 0}function I(e){return e=C(e),S.isStringLiteralLike(e)||S.isNumericLiteral(e)?e.text:null}function W(e,n){return e.slice(0,Math.min(e.length,n.length)).every((r,t)=>r===null||n[t]===null||r===n[t])}function Ze(e,n,r){let t=C(e),i=new Set;for(;S.isIdentifier(t);){let s=D(t,n);if(!s||i.has(s))return null;let a=vn(s,r);if(!a)return null;i.add(s),t=C(a)}return t}function vn(e,n){return S.isVariableDeclaration(e)&&e.parent.flags&S.NodeFlags.Const&&!n.has(e)?e.initializer:void 0}import{ts as c}from"@ts-morph/common";function en(e,n){let r=new Set,t=u=>{for(let d of Pn(u)){let x=D(d,n);x&&r.add(x)}c.isCallExpression(u)&&Mn(u,n,r),c.forEachChild(u,t)};t(e);let i,s=()=>i??=An(e,n),a,o=()=>a??=On(s(),n),l,f=()=>l??=Tn(e,n,s().aliases);return{written:r,hasEscapedValue(u,d){return v(u,n,s().aliases,new Set,d).some(x=>f().some(b=>b.binding===x.binding&&b.path.length<=x.path.length&&W(b.path,x.path)))},usesParameter(u){return v(u,n,s().aliases).some(({binding:d})=>Xe(d))},hasWrite(u,d,x,b,R=u){let h=z(u,n,r);if(h)return h.reassigned||d&&v(u,n,s().aliases,new Set,x).some(w=>(o().get(w.binding)??[]).some(m=>(!R||!(m.source.getStart()<=R.getStart()&&m.source.end>=R.end))&&(b||m.path.length<=w.path.length)&&W(m.path,w.path)))}}}function An(e,n){let r=new Map,t=[],i=[],s=a=>{Bn(a,n,r),t.push(...kn(a)),(c.isCallExpression(a)||c.isNewExpression(a))&&i.push(a),c.forEachChild(a,s)};s(e);for(let a of i)Fn(a,n,r);return{aliases:r,memberWrites:t,calls:i}}function On({aliases:e,memberWrites:n,calls:r},t){let i=new Map,s=(a,o,l,f)=>{for(let u of v(a,t,e,new Set,o)){let d=i.get(u.binding)??[];d.push({path:u.path,source:l,unknown:f}),i.set(u.binding,d)}};for(let a of n)s(a,[],a,!1);for(let a of r)for(let o of _n(a,t)){if(!o.unknown){s(o.target,o.path,a,!1);continue}for(let l of re(o.target,t,e,new Set,o.path.slice(0,-1))){let f=i.get(l.binding)??[];f.push({path:l.path,source:a,unknown:!0}),i.set(l.binding,f)}}return i}function Tn(e,n,r){let t=n.getSymbolAtLocation(e);return t?n.getExportsOfModule(t).flatMap(i=>{let a=(i.flags&c.SymbolFlags.Alias?n.getAliasedSymbol(i):i).valueDeclaration;if(!a||a.getSourceFile()!==e)return[];let o=c.isVariableDeclaration(a)?a.initializer:a;return o?re(o,n,r,new Set).filter(l=>l.binding!==a):[]}):[]}function Mn(e,n,r){if(!c.isCallExpression(e)||e.questionDotToken)return;let t=C(e.expression);if(!(!c.isIdentifier(t)||t.text!=="eval"||D(t,n)))for(let i of n.getSymbolsInScope(e,c.SymbolFlags.Value|c.SymbolFlags.Alias)){let s=i.valueDeclaration??i.declarations?.[0];s&&r.add(s)}}function nn(e){if(c.isBinaryExpression(e)&&e.operatorToken.kind>=c.SyntaxKind.FirstAssignment&&e.operatorToken.kind<=c.SyntaxKind.LastAssignment)return e.left;if((c.isPrefixUnaryExpression(e)||c.isPostfixUnaryExpression(e))&&(e.operator===c.SyntaxKind.PlusPlusToken||e.operator===c.SyntaxKind.MinusMinusToken))return e.operand;if(c.isForOfStatement(e)||c.isForInStatement(e))return e.initializer}function Pn(e){let n=nn(e);return n?rn(n):[]}function tn(e){let n=C(e);return n!==e?[n]:c.isSpreadElement(e)||c.isSpreadAssignment(e)?[e.expression]:c.isArrayLiteralExpression(e)?e.elements:c.isObjectLiteralExpression(e)?e.properties:c.isPropertyAssignment(e)?[e.initializer]:c.isBinaryExpression(e)&&e.operatorToken.kind===c.SyntaxKind.EqualsToken?[e.left]:[]}function rn(e){return c.isIdentifier(e)?[e]:c.isShorthandPropertyAssignment(e)?[e.name]:tn(e).flatMap(rn)}function kn(e){let n=c.isDeleteExpression(e)?e.expression:nn(e);return n?sn(n):[]}function sn(e){return c.isPropertyAccessExpression(e)||c.isElementAccessExpression(e)?[e]:tn(e).flatMap(sn)}function Fn(e,n,r){let t=ie(e.expression,n);if(!t)return;let i=C(e.expression);(c.isPropertyAccessExpression(i)||c.isElementAccessExpression(i))&&ge(t,{expression:i.expression,path:[]},r);for(let[s,a]of t.parameters.entries()){let o=e.arguments?.[s];o&&!c.isSpreadElement(o)&&!a.dotDotDotToken&&_(a.name,{expression:o,path:[]},n,r)}}function ie(e,n){if(e=C(e),c.isArrowFunction(e)||c.isFunctionExpression(e))return e;let r=c.isElementAccessExpression(e)?I(e.argumentExpression):null,t=r!==null&&c.isElementAccessExpression(e)?n.getTypeAtLocation(e.expression).getProperty(r):n.getSymbolAtLocation(e),i=c.isIdentifier(e)?D(e,n):t?.valueDeclaration,s=i&&(c.isVariableDeclaration(i)||c.isPropertyAssignment(i))?i.initializer:i;return s&&c.isFunctionLike(s)&&"body"in s&&s.body?s:void 0}function se(e){let n=e.body;if(!n)return[];if(!c.isBlock(n))return[n];let r=[],t=i=>{c.isFunctionLike(i)||(c.isReturnStatement(i)&&i.expression&&r.push(i.expression),c.forEachChild(i,t))};return t(n),r}function _n(e,n){let r=C(e.expression),t=e.arguments??[],i=Jn(e,n);if(i)return i;if(ie(r,n))return[];let s=[...t];return(c.isPropertyAccessExpression(r)||c.isElementAccessExpression(r))&&s.push(r.expression),s.map(a=>({target:c.isSpreadElement(a)?a.expression:a,path:c.isIdentifier(a)&&c.isNamespaceImport(D(a,n)??a)?[null,null]:[null],unknown:!0}))}function Bn(e,n,r){if(c.isVariableDeclaration(e)&&e.initializer&&_(e.name,{expression:e.initializer,path:[]},n,r),c.isBinaryExpression(e)&&[c.SyntaxKind.EqualsToken,c.SyntaxKind.AmpersandAmpersandEqualsToken,c.SyntaxKind.BarBarEqualsToken,c.SyntaxKind.QuestionQuestionEqualsToken].includes(e.operatorToken.kind)&&_(e.left,{expression:e.right,path:[]},n,r),c.isForOfStatement(e)){let t=c.isVariableDeclarationList(e.initializer)?e.initializer.declarations[0]?.name:e.initializer;t&&_(t,{expression:e.expression,path:[null]},n,r)}}function _(e,n,r,t){if(e=C(e),c.isPropertyAccessExpression(e)||c.isElementAccessExpression(e)){let i=z(e,r);i&&ge(i.binding,{...n,targetPath:i.path},t);return}if(c.isIdentifier(e)){ge(D(e,r),n,t);return}for(let i of jn(e))_(i.target,{...n,path:[...n.path,...i.path],shallowCopy:n.shallowCopy||i.shallowCopy,arrayRestOffset:i.arrayRestOffset??n.arrayRestOffset},r,t),i.fallback&&_(i.target,{expression:i.fallback,path:[]},r,t)}function ge(e,n,r){if(!e)return;let t=r.get(e)??[];t.push(n),r.set(e,t)}function jn(e){return c.isObjectBindingPattern(e)||c.isArrayBindingPattern(e)?e.elements.flatMap((n,r)=>{if(!c.isBindingElement(n))return[];if(n.dotDotDotToken)return[{target:n.name,path:[],shallowCopy:!0,...c.isArrayBindingPattern(e)?{arrayRestOffset:r}:{}}];let t=c.isArrayBindingPattern(e)?String(r):te(n.propertyName??n.name);return[{target:n.name,path:[t],fallback:n.initializer}]}):c.isObjectLiteralExpression(e)?e.properties.flatMap(n=>c.isSpreadAssignment(n)?[{target:n.expression,path:[],shallowCopy:!0}]:c.isPropertyAssignment(n)?[{target:n.initializer,path:[te(n.name)]}]:c.isShorthandPropertyAssignment(n)?[{target:n.name,path:[n.name.text],fallback:n.objectAssignmentInitializer}]:[]):c.isArrayLiteralExpression(e)?e.elements.map((n,r)=>({target:n,path:[String(r)]})):c.isBinaryExpression(e)&&e.operatorToken.kind===c.SyntaxKind.EqualsToken?[{target:e.left,path:[],fallback:e.right}]:[]}function te(e){return c.isIdentifier(e)?e.text:I(c.isComputedPropertyName(e)?e.expression:e)}function v(e,n,r,t=new Set,i=[]){if(e=C(e),c.isPropertyAccessExpression(e)||c.isElementAccessExpression(e)){let l=c.isPropertyAccessExpression(e)?e.name.text:I(e.argumentExpression);return v(e.expression,n,r,t,[l,...i])}let s=Hn(e);if(s)return s.flatMap(l=>v(l,n,r,t,i));if(c.isCallExpression(e))return Gn(e,n,r,t,i);if(c.isObjectLiteralExpression(e)||c.isArrayLiteralExpression(e))return on(e,i).flatMap(l=>v(l.expression,n,r,t,l.path));let a=D(e,n);if(!a||t.has(a))return[];let o=new Set(t).add(a);return[{binding:a,path:i},...(r.get(a)??[]).flatMap(l=>{let f=an(l,i);return f?v(l.expression,n,r,o,f):[]})]}function an(e,n){let r=e.targetPath??[];if(e.targetPath&&n.length<=r.length||r.length>n.length||!W(r,n))return null;let t=n.slice(r.length);if(e.shallowCopy&&t.length<2)return null;if(e.arrayRestOffset!==void 0){let[i,...s]=t;return[...e.path,i===null?null:String(Number(i)+e.arrayRestOffset),...s]}return[...e.path,...t]}function on(e,n){return n.length<2?[]:c.isObjectLiteralExpression(e)?Vn(e,n):$n(e,n)}function Vn(e,n){let r=[];for(let t of[...e.properties].reverse()){if(c.isSpreadAssignment(t)){r.push({expression:t.expression,path:n});continue}let i=te(t.name);if(!(n[0]!==null&&i!==null&&i!==n[0])&&(r.push(...Kn(t).map(s=>({expression:s,path:n.slice(1)}))),n[0]!==null&&i===n[0]))break}return r}function Kn(e){return c.isPropertyAssignment(e)?[e.initializer]:c.isShorthandPropertyAssignment(e)?[e.name]:c.isGetAccessorDeclaration(e)?se(e):c.isMethodDeclaration(e)?[e]:[]}function $n(e,n){let r=n[0]===null||e.elements.some(c.isSpreadElement);return e.elements.flatMap((t,i)=>!r&&String(i)!==n[0]?[]:c.isSpreadElement(t)?[{expression:t.expression,path:[null,...n.slice(1)]}]:[{expression:t,path:n.slice(1)}])}function re(e,n,r,t,i=[]){let s=C(e);if(t.has(s))return[];let a=new Set(t).add(s),o=f=>re(f.expression,n,r,a,f.path);if(c.isPropertyAccessExpression(s)||c.isElementAccessExpression(s)){let f=c.isPropertyAccessExpression(s)?s.name.text:I(s.argumentExpression);return o({expression:s.expression,path:[f,...i]})}let l=D(s,n);if(l){if(t.has(l))return[];let f=(r.get(l)??[]).flatMap(u=>{let d=zn(u,i);return d?re(u.expression,n,r,new Set(a).add(l),d):[]});return[{binding:l,path:[...i,null]},...f]}return Wn(s,i,n).flatMap(o)}function zn(e,n){let r=e.targetPath;if(r&&n.length<r.length&&W(r,n))return e.path;let t=e.shallowCopy&&n.length===0?[null,null]:[...n,null],i=an(e,t);return i?i.slice(0,-1):null}function Wn(e,n,r){if(c.isFunctionLike(e)&&"body"in e&&e.body)return se(e).map(t=>({expression:t,path:n}));if(c.isObjectLiteralExpression(e)||c.isArrayLiteralExpression(e)){let t=n.length?[...n,null]:[null,null];return on(e,t).map(i=>({...i,path:i.path.slice(0,-1)}))}return c.isConditionalExpression(e)?[e.whenTrue,e.whenFalse].map(t=>({expression:t,path:n})):c.isBinaryExpression(e)?[e.left,e.right].map(t=>({expression:t,path:n})):c.isCallExpression(e)||c.isNewExpression(e)?Un(e,n,r):[]}function Un(e,n,r){let t=ie(e.expression,r);return(t?se(t):[...e.arguments??[]]).map(s=>({expression:c.isSpreadElement(s)?s.expression:s,path:n}))}function Hn(e){if(c.isConditionalExpression(e))return[e.whenTrue,e.whenFalse];if(!c.isBinaryExpression(e))return null;let n=e.operatorToken.kind;return n===c.SyntaxKind.EqualsToken?[e.right]:[c.SyntaxKind.AmpersandAmpersandToken,c.SyntaxKind.BarBarToken,c.SyntaxKind.QuestionQuestionToken,c.SyntaxKind.AmpersandAmpersandEqualsToken,c.SyntaxKind.BarBarEqualsToken,c.SyntaxKind.QuestionQuestionEqualsToken].includes(n)?[e.left,e.right]:null}function Gn(e,n,r,t,i){if(cn(e,n)==="Object.assign")return e.arguments.flatMap((a,o)=>o===0||i.length>=2?v(a,n,r,t,i):[]);let s=ie(e.expression,n);return!s||t.has(s)?[]:se(s).flatMap(a=>v(a,n,r,new Set(t).add(s),i))}function Jn(e,n){let r=e.arguments??[],t=r[0];if(!t)return null;switch(cn(e,n)){case"Reflect.set":return qn(t,r,n);case"Object.defineProperty":return ln(r[2])?[{target:t,path:[null],unknown:!0}]:[{target:t,path:[r[1]?I(r[1]):null],unknown:!1}];case"Object.defineProperties":return Qn(r[1])?[{target:t,path:[null],unknown:!0}]:ye(r[1]).map(i=>({target:t,path:[i],unknown:!1}));case"Object.assign":return r.slice(1).flatMap(ye).map(i=>({target:t,path:[i],unknown:!1}));default:return null}}function qn(e,n,r){let t=n[1]?I(n[1]):null,i=n[3]??e,s=t===null?void 0:r.getTypeAtLocation(e).getProperty(t)?.valueDeclaration,a=C(e),o=!!s&&[c.SyntaxKind.PropertyAssignment,c.SyntaxKind.PropertyDeclaration,c.SyntaxKind.MethodDeclaration].includes(s.kind),f=c.isObjectLiteralExpression(a)&&a.properties.length===0||n[3]===void 0&&o;return[{target:i,path:f?[t]:[null],unknown:!f}]}function ln(e){return!e||ye(e).some(n=>n===null||n==="get"||n==="set")}function Qn(e){let n=e&&C(e);return!n||!c.isObjectLiteralExpression(n)?!0:n.properties.some(r=>!c.isPropertyAssignment(r)||ln(r.initializer))}function ye(e){let n=C(e);return c.isObjectLiteralExpression(n)?n.properties.map(r=>c.isSpreadAssignment(r)?null:te(r.name)):[null]}function cn(e,n){let r=C(e.expression);return!c.isCallExpression(e)||!c.isPropertyAccessExpression(r)||!c.isIdentifier(r.expression)||D(r.expression,n)?null:`${r.expression.text}.${r.name.text}`}var Xn=new Set([".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"]),un=new WeakMap;function A(e,n){let r=un.get(n);if(r)return r;let t=Xn.has(Yn(e))?qe(e,n.text):null,i=t&&t.errors.length===0?t:null,s,a=()=>s??=Zn(n,i),o,l=()=>o??=et(n),f,u=()=>f===void 0?f=i?en(i.sourceFile,i.checker):null:f,d=new Set,x=()=>u()?.written??d,b=m=>a().expressions.get(`${m.startIndex}:${m.endIndex}`),R=m=>{let p=a().identifiers.get(m.startIndex);if(!(!p||!t))return D(p,t.checker)},h=(m,p=!1,g=[],E=!0,L=m)=>{let T=b(m);if(!T||!t)return!1;let ce=L?b(L)??T:null;return u()?.hasWrite(T,p,g,E,ce)??!!R(ae(m))},w={available:!!t&&t.errors.length===0,moduleReferences(){return t&&t.errors.length===0?Qe(t.sourceFile,()=>t.checker).map(m=>({...m,line:m.line+n.startPosition.row})):[]},constantInitializer(m){let p=R(m);return!p||!y.isVariableDeclaration(p)||!p.initializer||!(p.parent.flags&y.NodeFlags.Const)||x().has(p)?null:l().get(`${p.initializer.getStart()}:${p.initializer.end}`)??null},callableValue(m){let p=b(m);if(!p||!t)return null;let g=ne(p,t.checker,x()),E=g&&y.isVariableDeclaration(g)?g.initializer:g;return ot(E,l())},hasObservedWrite:h,hasEscapedValue(m,p){let g=b(m);return!!g&&!!u()?.hasEscapedValue(g,p)},hasObservedCallableWrite(m,p=[],g=m){return h(m,!0,p,!1,g)},callableParameters(m){let p=[...a().expressions.values()].filter(g=>y.isFunctionLike(g)&&g.end+n.startIndex===m.endIndex&&g.getStart()+n.startIndex<=m.startIndex);return p.length!==1||!y.isFunctionLike(p[0])?null:p[0].parameters.filter(g=>g.name.getText()!=="this").map(g=>g.dotDotDotToken?"rest":g.initializer?"default":y.isIdentifier(g.name)?"direct":"destructured")},hasLocalBinding(m){let p=a().identifiers.get(ae(m).startIndex);return!!p&&!!t?.checker.getSymbolAtLocation(p)?.declarations?.length},isParameterBinding(m){let p=b(m);return!!p&&!!u()?.usesParameter(p)},valueDeclaration(m){if(!t)return null;let p=b(m),g=p&&ne(p,t.checker,x());if(!g||!y.isVariableDeclaration(g)||!y.isIdentifier(g.name))return null;let E=t.sourceFile.getLineAndCharacterOfPosition(g.getStart()),L=t.sourceFile.getLineAndCharacterOfPosition(g.end);return{name:g.name.text,startLine:E.line+n.startPosition.row,startColumn:E.character+(E.line===0?n.startPosition.column:0),endLine:L.line+n.startPosition.row,endColumn:L.character+(L.line===0?n.startPosition.column:0)}},importedValue(m){let p=b(m);return p&&t?U(p,t.checker,new Set):null},constructedValue(m){let p=b(m);return p&&t?fn(p,t.checker,new Set):null},resource(m){let p=ae(m),g=R(p);if(!g)return{resourceKey:`access:${m.startIndex}:${m.endIndex}`,identityBasis:"source-access-occurrence"};let E=m.text.slice(p.endIndex-m.startIndex).trim();return{resourceKey:`binding:${g.getStart()}:${g.end}:${E}`,identityBasis:"compiler-binding-access-path"}},isCaptured(m){let p=a().identifiers.get(m.startIndex),g=R(m),E=g&&ee(g),L=p&&ee(p);return!!E&&!!L&&E!==L},directParameterPosition(m){let p=b(m),g=p&&C(p);if(!g||!y.isIdentifier(g)||!t)return null;let E=ne(g,t.checker,x());if(!E||!y.isParameter(E)||!y.isIdentifier(E.name)||ee(g)!==E.parent||x().has(E))return null;let T=E.parent.parameters.filter(ce=>ce.name.getText()!=="this").indexOf(E);return T>=0?T:null},tupleElements(m){let p=b(m);if(!p||!t||h(m,!0))return null;let g=Ze(p,t.checker,x());if(!g||!y.isArrayLiteralExpression(g)||g.elements.some(L=>y.isSpreadElement(L)||y.isOmittedExpression(L)))return null;let E=g.elements.map(L=>l().get(`${L.getStart()}:${L.end}`));return E.every(L=>!!L)?E:null}};return un.set(n,w),w}function Zn(e,n){let r=new Map,t=new Map;if(n){let i=s=>{let a=s.getStart(n.sourceFile)+e.startIndex;y.isIdentifier(s)&&r.set(a,s),t.set(`${a}:${s.end+e.startIndex}`,s),y.forEachChild(s,i)};i(n.sourceFile)}return{identifiers:r,expressions:t}}function et(e){let n=new Map,r=t=>{n.set(`${t.startIndex-e.startIndex}:${t.endIndex-e.startIndex}`,t);for(let i of t.namedChildren)r(i)};return r(e),n}function fn(e,n,r){if(r.has(e))return null;if(r.add(e),y.isCallExpression(e)||y.isNewExpression(e))return U(e.expression,n,new Set);if(!y.isIdentifier(e))return null;let t=n.getSymbolAtLocation(e)?.valueDeclaration;return t&&y.isVariableDeclaration(t)&&t.initializer&&t.parent.flags&y.NodeFlags.Const?fn(t.initializer,n,r):null}function U(e,n,r){if(r.has(e))return null;if(r.add(e),e=C(e),y.isPropertyAccessExpression(e)||y.isElementAccessExpression(e)){let t=U(e.expression,n,r),i=y.isPropertyAccessExpression(e)?e.name.text:I(e.argumentExpression);return t&&i!==null&&(t.member===null||t.member==="default")?{module:t.module,member:i}:null}return y.isCallExpression(e)?tt(e,n):nt(e,n,r)}function nt(e,n,r){if(!y.isIdentifier(e))return null;let t=n.getSymbolAtLocation(e)?.declarations?.[0];return t?y.isVariableDeclaration(t)&&t.initializer&&t.parent.flags&y.NodeFlags.Const?U(t.initializer,n,r):y.isBindingElement(t)?st(t,n,r):it(t):null}function tt(e,n){if(!y.isIdentifier(e.expression)||e.expression.text!=="require")return null;let r=e.arguments[0];return n.getSymbolAtLocation(e.expression)?.valueDeclaration||e.arguments.length!==1||!r||!y.isStringLiteralLike(r)?null:{module:r.text,member:null}}function rt(e){return y.isImportSpecifier(e)&&!e.isTypeOnly?{member:(e.propertyName??e.name).text}:y.isNamespaceImport(e)?{member:null}:y.isImportClause(e)&&!e.isTypeOnly?{member:"default"}:null}function it(e){let n=rt(e);if(!n)return null;let{member:r}=n;for(let t=e.parent;t;t=t.parent){if(y.isImportClause(t)&&t.isTypeOnly)return null;if(y.isImportDeclaration(t))return y.isStringLiteralLike(t.moduleSpecifier)?{module:t.moduleSpecifier.text,member:r}:null}return null}function st(e,n,r){if(!y.isObjectBindingPattern(e.parent)||e.dotDotDotToken||e.initializer)return null;let t=e.parent.parent;if(!y.isVariableDeclaration(t)||!t.initializer||!(t.parent.flags&y.NodeFlags.Const))return null;let i=U(t.initializer,n,r),s=e.propertyName??e.name;if(!i||i.member!==null)return null;let a=at(s);return a===null?null:{module:i.module,member:a}}function at(e){return y.isIdentifier(e)||y.isStringLiteralLike(e)?e.text:null}function ae(e){let n=e.childForFieldName("object")??e.childForFieldName("array");return n?ae(n):e}function ot(e,n){if(!e||!(y.isFunctionDeclaration(e)||y.isFunctionExpression(e)||y.isArrowFunction(e)))return null;let r=n.get(`${e.getStart()}:${e.end}`);return r?.type==="export_statement"?r.childForFieldName("declaration"):r??null}var lt=4;function dn(e,n,r,t={}){return pn(e,n,r,t.maxReexportDepth??lt,0,new Set)}function pn(e,n,r,t,i,s){let a=`${n}\0${r}`;if(s.has(a)||i>t)return[];s.add(a);let o=N(e,n).filter(l=>l.leaf===r);return o.length>0?o:ke(e,n).flatMap(l=>l.sourcePath?l.kind==="named"&&!l.names.includes(r)?[]:pn(e,l.sourcePath,r,t,i+1,new Set(s)):[])}import{ts as B}from"@ts-morph/common";var be=new WeakMap;function mn(e){if(e.type!=="string"&&e.type!=="template_string")return null;if(be.has(e))return be.get(e);let n=ct(e.text);return be.set(e,n),n}function ct(e){let n=B.createSourceFile("literal.ts",e,B.ScriptTarget.Latest,!1,B.ScriptKind.TS);if(n.parseDiagnostics.length>0||n.statements.length!==1)return null;let r=n.statements[0];if(!B.isExpressionStatement(r))return null;let t=r.expression;return B.isStringLiteralLike(t)?{value:t.text,interpolated:!1}:B.isTemplateExpression(t)?{value:t.head.text+t.templateSpans.map(i=>"{}"+i.literal.text).join(""),interpolated:!0}:null}function H(e,n,r){if(e.length!==3&&e.length!==4)return;let t=e[0],i=e.length===4?e[2]:t,s=gn(r[t],e[1],n),a=gn(r[i],e[e.length-1],n);if(!(s===void 0||a===void 0)&&!(i<t||i===t&&a<s))return{startLine:t,startColumn:s,endLine:i,endColumn:a}}function gn(e,n,r){if(e===void 0||!Number.isSafeInteger(n)||n<0)return;let t=r||([...e.slice(0,n)].every(i=>i.charCodeAt(0)<128)?"UTF-16":void 0);switch(t){case"UTF-16":return n<=e.length?n:void 0;case"UTF-8":case"UTF-32":return ut(e,n,t);default:return}}function ut(e,n,r){let t=0,i=0;for(let s of e){if(t===n)return i;if(t+=r==="UTF-8"?Buffer.byteLength(s,"utf8"):1,i+=s.length,t>n)return}return t===n?i:void 0}import{fromBinary as ft}from"@bufbuild/protobuf";import{DocumentSchema as dt,SymbolRole as oe}from"@c4312/scip";import{zstdDecompressSync as pt}from"zlib";var mt=ve("scip-chunk-occurrence-targets",{clearGroups:["whole-project","definition-catalog","source-file"],maxEntries:256}),gt=M("scip-chunk-occurrence-definitions",{clearGroups:["whole-project","definition-catalog"]}),yn=1,yt=M("scip-chunk-occurrence-data-present",{clearGroups:["whole-project"]});function Se(e){return yt.get(e,()=>{let n=e.get("SELECT length(occurrences) AS size FROM chunks LIMIT 1");return n!==void 0&&(n.size??0)>yn})}function G(e,n){return mt.get(e,n,()=>bt(e,n))}function xe(e,n){return`${e}\0${n}`}function bt(e,n){let r=e.get("SELECT id, position_encoding FROM documents WHERE relative_path = ?",n);if(!r)return{available:!1,reason:"no-document"};let t=e.all("SELECT occurrences FROM chunks WHERE document_id = ? ORDER BY chunk_index",r.id);if(t.length===0)return Se(e)?{available:!0,targets:[],externalLeafKeys:new Set,locals:[]}:{available:!1,reason:"no-occurrence-data"};let i={targets:[],externalLeafKeys:new Set,locals:[],externalRanges:[]},s=Q(e,n);for(let a of t){let o=St(a.occurrences);if(!o)return{available:!1,reason:"no-occurrence-data"};let l=xt(e,o);for(let f of o)ht(f,r.position_encoding,s,l,i)}return{available:!0,...i}}function St(e){if(!e||e.length<=yn)return null;try{return ft(dt,new Uint8Array(pt(e))).occurrences}catch{return null}}function xt(e,n){let r=gt.get(e,()=>new Map),t=new Set(n.filter(a=>a.symbol&&!a.symbol.startsWith("local ")&&!(a.symbolRoles&oe.Definition)).map(a=>a.symbol)),i=[...t].filter(a=>!r.has(a)),s=Ve(e,i);for(let a of i)r.set(a,null);for(let a of s)r.set(a.symbol,a);for(let a of t){let o=r.get(a);o&&Te(o.relativePath)}return r}function ht(e,n,r,t,i){if(!e.symbol)return;let s=e.range[0];if(!Number.isInteger(s))return;let a=H(e.range,n,r);if(e.symbol.startsWith("local ")){a&&i.externalRanges.push(a),a&&i.locals.push(Ct(e.symbol,a,e.symbolRoles));return}if((e.symbolRoles&oe.Definition)!==0)return;let o=t.get(e.symbol);if(o){i.targets.push({sourceLine:s,...a?{sourceRange:a}:{},definition:o});return}a&&i.externalRanges.push(a);let l=Et(e.symbol);l&&i.externalLeafKeys.add(xe(s,l))}function Ct(e,n,r){return{symbol:e,line:n.startLine,startChar:n.startColumn,endLine:n.endLine,endChar:n.endColumn,definition:(r&oe.Definition)!==0,write:(r&oe.WriteAccess)!==0}}function Et(e){if(e.startsWith("local "))return null;try{let n=k(e);return n.length>0?n:null}catch{return null}}function J(e,n){return!!(e&&n&&e.startLine===n.startLine&&e.startColumn===n.startColumn&&e.endLine===n.endLine&&e.endColumn===n.endColumn)}function bn(e,n,r){let t=A(e.file,e.root).importedValue(n),i=t?.member??r;if(!t||!i)return null;let s=t.member!==null?Rt(e,n):null;if(s)return s;let a=Ae(e.db,e.file,t.module),o=a?dn(e.db,a,i):[];return o.length===1?o[0]:null}function Rt(e,n){let r=P(n);if(r.type!=="identifier"||K(e.db,e.file)?.freshness.semantic.state==="stale")return null;let t={startLine:r.startPosition.row,startColumn:r.startPosition.column,endLine:r.endPosition.row,endColumn:r.endPosition.column},i=G(e.db,e.file);if(!i.available)return null;let s=i.targets.filter(o=>o.definition.relativePath!==e.file&&J(o.sourceRange,t)),a=new Map(s.map(o=>[o.definition.symbol,o.definition]));return a.size===1?[...a.values()][0]:null}function Sn(e,n){let r=O(e.db,n.relativePath)?.rootNode,t=r&&Nt(r,n);return r&&t?{context:{...e,file:n.relativePath,root:r},declaration:t}:null}function ii(e,n,r){let t=A(e.file,e.root);if(t.hasEscapedValue(n,r))return!0;let i=t.valueDeclaration(n);if(!i)return!1;let s=N(e.db,e.file).filter(l=>l.leaf===i.name&&l.startLine===i.startLine&&(l.startChar??0)<=i.startColumn&&l.endLine>=i.endLine);if(s.length!==1)return!1;let a=s[0].symbol,o=Lt(e.db,a);return Oe(a,o),o.some(l=>l!==e.file&&wt(e,l,a,r))}function Lt(e,n){return e.all(`SELECT DISTINCT d.relative_path FROM global_symbols gs
|
|
2
|
+
JOIN mentions m ON m.symbol_id = gs.id JOIN chunks c ON c.id = m.chunk_id
|
|
3
|
+
JOIN documents d ON d.id = c.document_id WHERE gs.symbol = ?`,n).map(r=>r.relative_path).sort()}function wt(e,n,r,t){let i=K(e.db,n),s=O(e.db,n)?.rootNode,a=G(e.db,n);if(!s||!i||i.freshness.semantic.state==="stale"||!a.available)return!0;let o=a.targets.filter(d=>d.definition.symbol===r),l=A(n,s);if(!l.available||o.length===0)return!0;let f=new Set(o),u=!1;return Y(s,d=>{if(u||!["identifier","property_identifier","shorthand_property_identifier","string","string_fragment","number"].includes(d.type))return;let x={startLine:d.startPosition.row,startColumn:d.startPosition.column,endLine:d.endPosition.row,endColumn:d.endPosition.column},b=o.filter(h=>J(h.sourceRange,x));if(b.length===0)return;for(let h of b)f.delete(h);let R=Dt(d);u=!R||l.hasObservedWrite(R,!0,t,!1,null)}),u||f.size>0}function Dt(e){let n=e.type==="string_fragment"?e.parent??e:e,r=n.parent&&(e.type==="property_identifier"||n.parent.type==="subscript_expression")?n.parent:n;return["identifier","shorthand_property_identifier","member_expression","subscript_expression"].includes(r.type)?r:null}function xn(e,n){let r=A(e.file,e.root).callableValue(n);if(r)return{context:e,callable:r};let t=bn(e,n),i=t&&Sn(e,t);if(!i)return null;let s=i.declaration,a=["function_declaration","function_expression","arrow_function","generator_function_declaration"].includes(s.type)?s:A(i.context.file,i.context.root).callableValue(s);return a?{context:i.context,callable:a}:null}function Nt(e,n){let r=[];for(let t of Me(e,["variable_declarator","function_declaration","generator_function_declaration","function_expression","arrow_function"])){let i=t.childForFieldName("name"),s=!i&&n.symbol.endsWith("/default().")&&vt(t);!s&&i?.text!==n.leaf||t.startPosition.row!==n.startLine||t.endPosition.row>n.endLine||t.startPosition.column<(n.startChar??0)||t.endPosition.row===n.endLine&&n.endChar&&t.endPosition.column>n.endChar||r.push(s?t:i)}return r.length===1?r[0]:null}function le(e,n,r=[],t=new Set,i={file:e.file,node:n}){let s=P(n),a=`${e.file}:${s.startIndex}:${s.endIndex}:${JSON.stringify(r)}`;if(t.has(a))return!1;let o=new Set(t).add(a),l=A(e.file,e.root);if(l.hasObservedCallableWrite(s,r,i.file===e.file?i.node:void 0))return!0;let f=hn(s),u=f?.base??s,d=[...f?.properties??[],...r],x=l.constantInitializer(u);if(x)return le(e,x,d,o,i);let b=l.importedValue(u);if(!b)return!1;let R=bn(e,u,d[0]),h=R&&Sn(e,R);if(!h)return!1;let w=b.member===null?d.slice(1):d;return le(h.context,h.declaration,w,o,i)}function hn(e){let n=P(e);if(!["member_expression","subscript_expression"].includes(n.type))return null;let r=n.childForFieldName("object"),t=n.type==="member_expression"?n.childForFieldName("property"):n.childForFieldName("index"),i=t?It(t):null;if(!r||i===null)return null;let s=hn(r);return s?{base:s.base,properties:[...s.properties,i]}:{base:P(r),properties:[i]}}function It(e){if(e.type==="property_identifier")return e.text;if(e.type==="number"){let r=Number(e.text.replaceAll("_",""));return Number.isFinite(r)?String(r):null}let n=mn(e);return n&&!n.interpolated?n.value:null}function vt(e){let n=e;for(;n.parent;){let r=P(n.parent);if(r.startIndex!==e.startIndex||r.endIndex!==e.endIndex)break;n=n.parent}return n.parent?.type==="export_statement"}import{existsSync as Ot}from"fs";import{SymbolRole as Tt}from"@c4312/scip";import{deserializeSCIP as At}from"@c4312/scip";function Cn(e,n){return At(Ie(e,{inputKind:n,maxBytes:Ne}))}var he=new WeakMap;function q(e,n){if(K(e,n)?.freshness.semantic.state==="stale")return null;let r=G(e,n);if(r.available)return{targets:r.targets,externalLeafKeys:r.externalLeafKeys,externalRanges:r.externalRanges,locals:r.locals};if(r.reason==="no-document")return null;if(Se(e))return{targets:[],externalLeafKeys:new Set,locals:[]};let t=_t(e);return t?{targets:t.byFile.get(n)??[],externalLeafKeys:new Set,externalRanges:t.externalByFile.get(n)??[],locals:[]}:null}function wi(e,n,r,t,i){let s=V(e,n)??X(e,n)?.callSites,a=(s??[]).filter(b=>b.line>=r&&b.line<=t);if(!s||a.length===0)return{available:!!s,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let o=q(e,n);if(!o)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:a.length};let l=[],f=[],u=0,d=0,x=0;for(let b of a){let R=o.targets.filter(p=>J(p.sourceRange,b.targetRange)),h=new Map(R.map(p=>[p.definition.symbol,p]));if(i&&![...h.keys()].some(p=>i.has(p))||(x++,f.push(...[...h.values()].map(p=>({...p,sourceLine:b.line,sourceOwner:b.owner,calleeLeaf:p.definition.leaf}))),Ee(e,n,b))||h.size!==1)continue;let w=[...h.values()][0],m=Ce(e,n,b,w.definition);m.implementationStatus==="established"&&d++,u++,l.push({...w,...m,sourceLine:b.line,sourceOwner:b.owner,calleeLeaf:w.definition.leaf})}return{available:!0,targets:l,resolvedCallsites:u,unresolvedCallsites:x-u,declarations:f,implementationUnresolvedCallsites:x-d}}function Ce(e,n,r,t){let i=Re(e,n,r);if(!i?.bindings.available){let a=X(e,n)?.language;return a==="typescript"||a==="javascript"?{implementationStatus:"unresolved",implementationReason:"source-binding-unavailable"}:{implementationStatus:"established"}}if(r.kind==="new"&&!r.memberAccess&&(t.isTypeLike||t.leaf==="<constructor>"))return Pt(e,t);let s=xn({db:e,file:n,root:i.root},i.target);return s&&s.context.file===t.relativePath&&Mt(t,s.callable)?{implementationStatus:"established"}:{implementationStatus:"unresolved",implementationReason:r.memberAccess?"member-value-and-runtime-dispatch-unproved":"indirect-callable-value-unproved"}}function Mt(e,n){let{startLine:r,startChar:t,endLine:i,endChar:s}=e;if(t===void 0||s===void 0||r===i&&t>=s)return!1;let a=n.startPosition,o=n.endPosition;return(a.row>r||a.row===r&&a.column>=t)&&(o.row<i||o.row===i&&o.column<=s)}function Pt(e,n){let r=O(e,n.relativePath)?.rootNode,t;return r&&Y(r,s=>{["class_declaration","abstract_class_declaration","class"].includes(s.type)&&kt(s,n)&&(!t||s.endIndex-s.startIndex<t.endIndex-t.startIndex)&&(t=s)}),t?t.namedChildren.some(s=>s.type==="decorator")||t.parent?.type==="export_statement"&&t.parent.namedChildren.some(s=>s.type==="decorator")?{implementationStatus:"unresolved",implementationReason:"class-decorator-runtime-constructor-unproved"}:{implementationStatus:"established"}:{implementationStatus:"unresolved",implementationReason:"constructor-source-unproved"}}function kt(e,n){let{startLine:r,startChar:t,endLine:i,endChar:s}=n;return t===void 0||s===void 0?!1:(e.startPosition.row<r||e.startPosition.row===r&&e.startPosition.column<=t)&&(e.endPosition.row>i||e.endPosition.row===i&&e.endPosition.column>=s)}function Ee(e,n,r){let t=Re(e,n,r);return t?le({db:e,file:n,root:t.root},t.target):!1}function Di(e,n,r){let t=Re(e,n,r);return t?.bindings.isParameterBinding(t.target)??!1}function Re(e,n,r){let t=r.targetExpressionRange??r.targetRange,i=O(e,n)?.rootNode;if(!t||!i)return null;let s=pe(i,t.startLine,t.endLine,de,t);return s?{root:i,target:s,bindings:A(n,i)}:null}function Ft(e,n,r,t){let i=q(e,n);return i?{available:!0,targets:i.targets.filter(s=>s.sourceLine>=r&&s.sourceLine<=t)}:{available:!1,targets:[]}}function Ni(e,n,r,t){let i=q(e,n);return i?{available:!0,targets:i.targets.filter(s=>s.sourceLine>=r&&s.sourceLine<=t&&Vt(e,s.definition)).map(s=>En(e,n,s))}:{available:!1,targets:[]}}function Ii(e,n,r,t){let i=Ft(e,n,r,t);return{available:i.available,targets:i.targets.filter(s=>s.definition.isTypeLike).map(s=>En(e,n,s))}}function En(e,n,r){let t=O(e,n),i=X(e,n)?.language,s=r.sourceRange,a=t&&s&&pe(t.rootNode,s.startLine,s.endLine,de,s),o=a&&i?Pe(a,i):void 0;if(o){let u=$(e,n,N(e,n)).get(F(o));return{...r,calleeLeaf:r.definition.leaf,sourceOwner:o,sourceDefinition:u??null}}let l=s?N(e,n).filter(u=>u.startLine<=s.startLine&&u.endLine>=s.endLine&&(u.startLine!==s.startLine||(u.startChar??0)<=s.startColumn)&&(u.endLine!==s.endLine||u.endChar===void 0||u.endChar>=s.endColumn)):[],f=l.filter(u=>!l.some(d=>d!==u&&d.startLine>=u.startLine&&d.endLine<=u.endLine&&(d.startLine!==u.startLine||(d.startChar??0)>=(u.startChar??0))&&(d.endLine!==u.endLine||(d.endChar??1/0)<=(u.endChar??1/0))));return{...r,calleeLeaf:r.definition.leaf,sourceOwner:o??void 0,sourceDefinition:f.length===1?f[0]:null}}function _t(e){if(De(),he.has(e))return he.get(e)??null;let n=Bt(e);return he.set(e,n),n}function Bt(e){if(!e.generation.indexPath||!Ot(e.generation.indexPath))return null;try{let n=Z(e),r=new Map(n.map(a=>[a.symbol,a])),t=Cn(e.generation.indexPath,"SCIP source-range call-target index"),i=new Map,s=new Map;for(let a of t.documents??[]){let o=a.relativePath;if(!o||e.isIgnored(o))continue;let{targets:l,externalRanges:f}=jt(e,o,a,r);i.set(o,l),s.set(o,f)}return{byFile:i,externalByFile:s}}catch{return null}}function jt(e,n,r,t){let i=[],s=[],a=Q(e,n),o={1:"UTF-8",2:"UTF-16",3:"UTF-32"}[r.positionEncoding];for(let l of r.occurrences??[]){if(!l.symbol||(l.symbolRoles&Tt.Definition)!==0)continue;let f=t.get(l.symbol),u=l.range?.[0];if(!Number.isInteger(u))continue;let d=H(l.range,o,a);if(!f){d&&s.push(d);continue}i.push({sourceLine:u,...d?{sourceRange:d}:{},definition:f})}return{targets:i,externalRanges:s}}function Vt(e,n){if(!n.isFunctionLike)return!1;let r=j(e,n.relativePath);return!r||r.some(t=>t.name===n.leaf&&t.startLine===n.startLine&&t.endLine===n.endLine)?!0:Kt(n)}function Kt(e){let n=e.documentation;if(!n)return!1;let r=e.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${r}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(n)||new RegExp(`\\b(?:const|let|var)\\s+${r}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(n)}function Wi(e,n,r={}){let t=Dn(e,[n],{additive:r.additive,semantic:r.semantic,semanticEvidence:r.semanticEvidence}),i=r.callableOnly?(t.get(n.symbolId)??[]).filter(s=>je(s.symbol)||s.source==="ast-callsite"||s.source==="scip-occurrence"||s.source==="scip-declaration"):t.get(n.symbolId)??[];return typeof r.limit=="number"?i.slice(0,r.limit):i}function Ui(e,n,r){return $t(e,[n],r).get(n.symbolId)??[]}function $t(e,n,r){let t=Ht(e)?Jt(e,n,{semantic:r.semantic!==!1,semanticEvidence:r.semanticEvidence}):Gt(e,r.semanticEvidence);return typeof r.limit!="number"?new Map(n.map(i=>[i.symbolId,t.get(i.symbolId)??[]])):new Map(n.map(i=>[i.symbolId,(t.get(i.symbolId)??[]).slice(0,r.limit)]))}var zt=M("caller-rows",{clearGroups:["whole-project"]}),Wt=M("targeted-caller-strategy",{clearGroups:["whole-project"]}),Ut=2e4;function Ht(e){return Wt.get(e,()=>(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Ut)}function Gt(e,n){return zt.get(e,()=>{let r=Z(e),t=Dn(e,r,{semanticEvidence:n}),i=new Map;for(let o of r)i.set(o.symbol,o.symbolId);let s=new Map,a=new Map;for(let o of r){let l=t.get(o.symbolId);!l||l.length===0||pr(o,l,i,s,a)}return s})}function Jt(e,n,r){let t=r.semantic&&r.semanticEvidence?n.flatMap(u=>{let d=Xt(e,u);return d?[d]:[]}):[],i=new Map(t.map(u=>[u.symbolId,u])),s=r.semanticEvidence?.referenceMap(e,t)??new Map,a=He(e,n),o=qt(e,n),l=new Map,f={astCallersByTarget:o,resolvedReferences:a,definitionBySymbolId:i,semanticReferences:s};for(let u of n)l.set(u.symbolId,Qt(e,u,f));return l}function qt(e,n){let r=new Set(n.map(o=>o.symbol)),i=[...new Set(n.flatMap(o=>Be(e,"reverse",[o.relativePath])))].flatMap(o=>N(e,o)),s=new Map,a=Nn(e,i);for(let o of i)for(let l of a.get(o.symbolId)??[]){if(!r.has(l.symbol))continue;let f=s.get(l.symbol)??[];f.push({symbol:o.symbol,file:o.relativePath,source:"caller-map-inversion",callEvidence:l.source}),s.set(l.symbol,f)}return s}function Qt(e,n,r){let t=[],i=new Set,s=a=>{if(a.symbol===n.symbol)return;let o=`${a.symbol}|${a.file}`;i.has(o)||(i.add(o),t.push(a))};for(let a of r.astCallersByTarget.get(n.symbol)??[])s(a);for(let a of r.resolvedReferences.get(n.symbolId)??[])a.file!==n.relativePath&&s({symbol:a.enclosingSymbol??a.file,file:a.file,source:"resolved-reference"});return Yt(e,n,r,s),t}function Yt(e,n,r,t){let i=r.definitionBySymbolId.get(n.symbolId);if(i)for(let s of r.semanticReferences.get(i.symbolId)??[]){if(s.file===n.relativePath||e.isIgnored(s.file))continue;let a=$e(N(e,s.file),s.line);t({symbol:a?.symbol??s.file,file:s.file,source:"semantic-reference"})}}function Xt(e,n){let r=Ge().join(", "),t=Je().join(", ");return e.get(`SELECT
|
|
4
|
+
d.id AS documentId,
|
|
5
|
+
gs.id AS symbolId,
|
|
6
|
+
gs.symbol,
|
|
7
|
+
d.relative_path AS relativePath,
|
|
8
|
+
COALESCE(der.start_line, c.start_line) AS startLine,
|
|
9
|
+
COALESCE(der.end_line, c.end_line) AS endLine,
|
|
10
|
+
COALESCE(gs.display_name, '') AS leaf,
|
|
11
|
+
NULL AS parentTypeName,
|
|
12
|
+
CASE WHEN gs.kind IN (${r}) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
13
|
+
CASE WHEN gs.kind IN (${t}) THEN 1 ELSE 0 END AS isTypeLike,
|
|
14
|
+
gs.kind AS kind,
|
|
15
|
+
gs.documentation AS documentation,
|
|
16
|
+
gs.enclosing_symbol AS enclosingSymbol
|
|
17
|
+
FROM global_symbols gs
|
|
18
|
+
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
19
|
+
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
20
|
+
JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
|
|
21
|
+
WHERE gs.id = ?
|
|
22
|
+
LIMIT 1`,n.symbolId)??null}function Dn(e,n,r={}){if(n.length===0)return new Map;let t=r.additive??!1,{astDefs:i,chunkOnlyDefs:s}=mr(e,n),a=new Map,o=new Map,l=u=>{for(let[d,x]of u){let b=a.get(d);b||(b=[],a.set(d,b));let R=o.get(d);R||(R=new Map,o.set(d,R));for(let h of x){let w=`${h.symbol}|${h.chunkId}`,m=R.get(w);if(m){Ln(m.source)==="candidate"&&Ln(h.source)==="exact"&&Object.assign(m,h);continue}let p={...h};R.set(w,p),b.push(p)}}};i.length>0&&l(Nn(e,i)),r.semantic!==!1&&r.semanticEvidence&&l(dr(r.semanticEvidence.calleeMap(e,n)));let f=t?n:s;return f.length>0&&l(sr(e,f)),a}function Nn(e,n){let r=new Map,t=tr(n,r),i=Ue(e);for(let[s,a]of t){let o=V(e,s);if(!o)continue;let l=Ke(a),f=$(e,s,a),u=er(q(e,s));for(let d of o){let x=d.owner===void 0?l.get(d.line):f.get(F(d.owner));if(!x)continue;let b=Zt(e,s,i,d,u);b&&r.get(x.symbolId).push(b)}}return r}function Zt(e,n,r,t,i){if(Ee(e,n,t))return null;let s=t.targetRange?we(t.targetRange):null;if(i&&s){let o=nr(i,s);if(o){let f=Ce(e,n,t,o.definition).implementationStatus==="unresolved"?"scip-declaration":t.owner!==void 0?"scip-occurrence":"ast-callsite";return Rn(o,t,f)}if(i.targetsByRange.has(s)||i.externalRanges.has(s))return null}if(i?.externalLeafKeys.has(xe(t.line,t.calleeLeaf)))return null;let a=rr(e,n,r,t);return a?Rn(a,t,"ast-callsite"):null}function Rn(e,n,r){return{symbol:e.symbol,file:e.file,chunkId:n.line,source:r,callsiteLine:n.line,...n.kind==="jsx-render"?{kind:"jsx-render"}:{}}}function we(e){return`${e.startLine}:${e.startColumn}:${e.endLine}:${e.endColumn}`}function er(e){if(!e)return null;let n=new Map;for(let r of e.targets){if(!r.sourceRange)continue;let t=we(r.sourceRange),i=n.get(t)??[];i.push(r.definition),n.set(t,i)}return{targetsByRange:n,externalLeafKeys:e.externalLeafKeys,externalRanges:new Set((e.externalRanges??[]).map(we))}}function nr(e,n){let r=e.targetsByRange.get(n);if(!r?.length)return null;let t=r[0];return r.some(i=>i.symbol!==t.symbol)?null:{symbol:t.symbol,file:t.relativePath,definition:t}}function Ln(e){return e==="scip-occurrence"||e==="semantic-callee"?"exact":"candidate"}function tr(e,n){let r=new Map;for(let t of e){let i=r.get(t.relativePath);i?i.push(t):r.set(t.relativePath,[t]),n.set(t.symbolId,[])}for(let t of r.values())t.sort((i,s)=>i.endLine-i.startLine-(s.endLine-s.startLine));return r}function rr(e,n,r,t){let i=_e(e,n,t.calleeLeaf);if(i){let o=me(n,r.get(i.importedName)??[]).filter(l=>ue(i.sourcePath,l.file));return o.length===1?o[0]:null}let s=me(n,r.get(t.calleeLeaf)??[]);if(s.length===0)return null;let a=ir(e,n,s,t.calleeQualifier);return a||We(e,n,s,t.memberAccess,t.calleeQualifier)}function ir(e,n,r,t){if(!t||fe(n)!=="clojure")return null;let s=Fe(e,n).filter(a=>a.kind==="namespace"&&a.localName===t&&a.sourcePath).map(a=>a.sourcePath);for(let a of s){let o=r.find(l=>ue(a,l.file));if(o)return o}return r.find(a=>/`([^`]+)`\//.exec(a.symbol)?.[1]===t)??null}function sr(e,n){if(n.length===0)return new Map;let r=ar(e,n),t=new Map;for(let[i,s]of fr(n)){let a=r.byDoc.get(i)??[];for(let[o,l]of or(e,s,a,r))t.set(o,l)}return t}function ar(e,n){let t=Le(n.map(u=>u.documentId)).flatMap(u=>e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
|
|
23
|
+
FROM mentions m
|
|
24
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
25
|
+
WHERE m.role != 1
|
|
26
|
+
AND c.document_id IN (${u.map(()=>"?").join(",")})`,...u)),i=new Map;for(let u of t)i.has(u.document_id)||i.set(u.document_id,[]),i.get(u.document_id).push(u);let a=Le(t.map(u=>u.symbol_id)).flatMap(u=>e.all(`SELECT gs.id AS symbol_id, gs.symbol,
|
|
27
|
+
COALESCE(der.document_id, def_chunk.document_id) AS document_id
|
|
28
|
+
FROM global_symbols gs
|
|
29
|
+
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
30
|
+
LEFT JOIN (
|
|
31
|
+
SELECT m.symbol_id, MIN(c.document_id) AS document_id
|
|
32
|
+
FROM mentions m
|
|
33
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
34
|
+
WHERE m.role = 1
|
|
35
|
+
AND m.symbol_id IN (${u.map(()=>"?").join(",")})
|
|
36
|
+
GROUP BY m.symbol_id
|
|
37
|
+
) def_chunk ON def_chunk.symbol_id = gs.id
|
|
38
|
+
WHERE gs.id IN (${u.map(()=>"?").join(",")})`,...u,...u)),o=Le([...n.map(u=>u.documentId),...a.flatMap(u=>u.document_id===null?[]:[u.document_id])]),l=new Map(o.flatMap(u=>e.all(`SELECT id, relative_path FROM documents
|
|
39
|
+
WHERE id IN (${u.map(()=>"?").join(",")})`,...u).map(d=>[d.id,d.relative_path]))),f=new Map;for(let u of a)f.has(u.symbol_id)||f.set(u.symbol_id,{symbol:u.symbol,file:u.document_id!==null?l.get(u.document_id)??"":""});return{byDoc:i,docPaths:l,calleeInfo:f}}function or(e,n,r,t){let i=new Map,s=[...r].sort((f,u)=>f.start_line-u.start_line||f.end_line-u.end_line),a=[...n].sort((f,u)=>f.startLine-u.startLine||f.endLine-u.endLine),o=new Set,l=0;for(let f of a){for(;l<s.length&&s[l].start_line<=f.endLine;)o.add(s[l]),l+=1;for(let u of o)u.end_line<f.startLine&&o.delete(u);i.set(f.symbolId,ur(e,f,o,t))}return i}function lr(e,n,r){let t=new Set;if(!n)return t;let i=ze(e,n),s=Math.max(0,r.startLine),a=Math.min(i.length-1,r.endLine);for(let o=s;o<=a;o+=1)for(let l of i[o])t.add(l);return t}function cr(e,n,r,t){if(!(e.start_line>=n.startLine&&e.end_line<=n.endLine)){if(!(e.start_line<=n.endLine&&e.end_line>=n.startLine))return!1;let a=k(r);if(!a||!t().has(a))return!1}return!0}function ur(e,n,r,{docPaths:t,calleeInfo:i}){let s=new Set,a=[],o=null,l=()=>o??=lr(e,t.get(n.documentId)??"",n);for(let f of r){if(f.symbol_id===n.symbolId)continue;let u=i.get(f.symbol_id);if(!u||!cr(f,n,u.symbol,l))continue;let d=`${u.symbol}|${f.chunk_id}`;s.has(d)||(s.add(d),a.push({...u,chunkId:f.chunk_id,source:"scip-chunk"}))}return a}var wn=500;function Le(e){let n=[...new Set(e)],r=[];for(let t=0;t<n.length;t+=wn)r.push(n.slice(t,t+wn));return r}function fr(e){let n=new Map;for(let r of e){let t=n.get(r.documentId);t?t.push(r):n.set(r.documentId,[r])}return n}function dr(e){let n=new Map;for(let[r,t]of e){let i=[];for(let s of t)i.push({symbol:s.symbol,file:s.file,chunkId:-1,source:"semantic-callee",...s.callsiteLine===void 0?{}:{callsiteLine:s.callsiteLine},...s.kind==="jsx-render"?{kind:"jsx-render"}:{}});n.set(r,i)}return n}function pr(e,n,r,t,i){for(let s of n){let a=r.get(s.symbol);if(a===void 0||a===e.symbolId)continue;let o=t.get(a);o||(o=[],t.set(a,o),i.set(a,new Set));let l=`${e.symbol}|${e.relativePath}`;i.get(a).has(l)||(i.get(a).add(l),o.push({symbol:e.symbol,file:e.relativePath,source:"caller-map-inversion",callEvidence:s.source}))}}function mr(e,n){let r=[],t=[];for(let i of n)fe(i.relativePath)&&V(e,i.relativePath)!==null?r.push(i):t.push(i);return{astDefs:r,chunkOnlyDefs:t}}export{F as a,$ as b,Ye as c,A as d,dn as e,mn as f,H as g,J as h,bn as i,Sn as j,ii as k,Lt as l,xn as m,Nt as n,le as o,hn as p,q,wi as r,Di as s,Ft as t,Ni as u,Ii as v,En as w,Vt as x,Wi as y,Ui as z,$t as A,Dn as B,Ln as C};
|
|
40
|
+
//# sourceMappingURL=chunk-4WTUBQ36.js.map
|