scip-query 0.23.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +491 -2
- package/README.md +111 -122
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-PRVFAGTQ.js +2 -0
- package/dist/call-graph-DVPAQV2F.js +2 -0
- package/dist/call-graph-evidence-CUtj8V2I.d.ts +19 -0
- package/dist/chunk-2FSBGL5P.js +2 -0
- package/dist/chunk-2HLAFUCY.js +2 -0
- package/dist/chunk-2IWUT6CJ.js +3 -0
- package/dist/chunk-2KNN7GTQ.js +2 -0
- package/dist/chunk-2LHXRE2B.js +8 -0
- package/dist/{chunk-EG2CPZMJ.js → chunk-2YXE77TJ.js} +2 -2
- package/dist/chunk-36SGVCGX.js +2 -0
- package/dist/chunk-3ABBFPTP.js +2 -0
- package/dist/chunk-3IVFU4FD.js +3 -0
- package/dist/chunk-3JIQS44J.js +7 -0
- package/dist/chunk-3ZRB6DNK.js +7 -0
- package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
- package/dist/{chunk-6I6L7Z62.js → chunk-4BHGBMNO.js} +2 -2
- package/dist/chunk-4BP3UBDG.js +2 -0
- package/dist/chunk-4D6RO7G4.js +2 -0
- package/dist/chunk-4FEWQ6RH.js +2 -0
- package/dist/chunk-4IGEOBG7.js +2 -0
- package/dist/chunk-4QZXBUKC.js +2 -0
- package/dist/chunk-4WBDEVX2.js +4 -0
- package/dist/chunk-4WCUBZU3.js +8 -0
- package/dist/chunk-4WTUBQ36.js +40 -0
- package/dist/chunk-4XQ4O6IM.js +3 -0
- package/dist/chunk-55UQAMZO.js +4 -0
- package/dist/chunk-5D2LVK7O.js +125 -0
- package/dist/chunk-5IYJ56TT.js +2 -0
- package/dist/chunk-5PLMJC7Q.js +2 -0
- package/dist/chunk-5TNQJUR2.js +5 -0
- package/dist/chunk-62BDNPMI.js +2 -0
- package/dist/chunk-64DZ5TXR.js +7 -0
- package/dist/chunk-65245JCM.js +2 -0
- package/dist/chunk-6FFVZZL4.js +2 -0
- package/dist/chunk-6KO5JHAR.js +2 -0
- package/dist/chunk-6LRXOOSX.js +2 -0
- package/dist/chunk-6LSEIIF7.js +2 -0
- package/dist/chunk-6YMNWD3H.js +6 -0
- package/dist/chunk-72AD6ZRR.js +5 -0
- package/dist/chunk-73AAKPUC.js +4 -0
- package/dist/chunk-76CZ77DF.js +2 -0
- package/dist/chunk-7VPEEAAG.js +2 -0
- package/dist/chunk-7WTPQ4NX.js +14 -0
- package/dist/chunk-7Y5T6XDP.js +2 -0
- package/dist/chunk-A2IIGFMJ.js +5 -0
- package/dist/chunk-AB5KCTEV.js +2 -0
- package/dist/chunk-AC566WBP.js +6 -0
- package/dist/chunk-AGWFSTXC.js +3 -0
- package/dist/chunk-AOSIYPTA.js +2 -0
- package/dist/chunk-AUVEWPIF.js +2 -0
- package/dist/chunk-B56T42J3.js +25 -0
- package/dist/chunk-BIQEF5NE.js +2 -0
- package/dist/chunk-BL6XJKTA.js +3 -0
- package/dist/chunk-BMKOQJRI.js +2 -0
- package/dist/chunk-BOZ4EXBB.js +3 -0
- package/dist/chunk-BUTWYEPH.js +2 -0
- package/dist/chunk-BZB4QPIP.js +2 -0
- package/dist/{chunk-ILTDAWEF.js → chunk-CE357GEE.js} +4 -4
- package/dist/chunk-CFN45HFP.js +2 -0
- package/dist/chunk-CFYMZFXT.js +368 -0
- package/dist/chunk-CN5EH7O3.js +2 -0
- package/dist/chunk-D254DNNQ.js +4 -0
- package/dist/chunk-D3FDISIC.js +2 -0
- package/dist/chunk-D3NX5XIE.js +3 -0
- package/dist/chunk-DA7RPPDF.js +3 -0
- package/dist/chunk-DDMC3FON.js +3 -0
- package/dist/chunk-DIO3FUSG.js +2 -0
- package/dist/chunk-DJ2NNSUK.js +3 -0
- package/dist/chunk-DKYQIM3C.js +18 -0
- package/dist/{chunk-JTQVMR42.js → chunk-DOOEL2IV.js} +2 -2
- package/dist/chunk-DVFP6PZI.js +2 -0
- package/dist/chunk-E3FDPXZK.js +2 -0
- package/dist/chunk-E7YNJLCB.js +2 -0
- package/dist/chunk-EFGW5JPH.js +2 -0
- package/dist/chunk-EJVTR244.js +13 -0
- package/dist/chunk-EOV7RTRZ.js +2 -0
- package/dist/chunk-ETOIKRHO.js +2 -0
- package/dist/chunk-EYK3ZAO2.js +3 -0
- package/dist/chunk-F2V2LPET.js +52 -0
- package/dist/chunk-F4LUHJTF.js +2 -0
- package/dist/chunk-F4PUT6IT.js +2 -0
- package/dist/chunk-F56GCXXS.js +5 -0
- package/dist/chunk-FC2EVQRM.js +2 -0
- package/dist/chunk-FL7NBMHP.js +3 -0
- package/dist/chunk-FMRN2TRL.js +3 -0
- package/dist/chunk-FVULPZDF.js +20 -0
- package/dist/chunk-GCKCF5FL.js +43 -0
- package/dist/chunk-GH2PYF46.js +2 -0
- package/dist/chunk-GHJAGXIP.js +2 -0
- package/dist/{chunk-WIWY3CRX.js → chunk-GMVSHUKZ.js} +2 -2
- package/dist/chunk-GS6KDO4R.js +2 -0
- package/dist/chunk-GUUBXNN7.js +2 -0
- package/dist/chunk-GVWX5T43.js +80 -0
- package/dist/chunk-GZKFETP5.js +2 -0
- package/dist/chunk-H4EQHO6J.js +9 -0
- package/dist/chunk-H73WY2RM.js +2 -0
- package/dist/chunk-H75GSPRV.js +60 -0
- package/dist/chunk-HDR3AHSV.js +61 -0
- package/dist/chunk-HQBSL74Y.js +2 -0
- package/dist/chunk-HRRFKWPZ.js +2 -0
- package/dist/chunk-HXENDJC6.js +2 -0
- package/dist/chunk-IIBAZNSW.js +21 -0
- package/dist/chunk-INLMWEUU.js +12 -0
- package/dist/chunk-IWQPAF4F.js +2 -0
- package/dist/chunk-IZJ6YUKP.js +35 -0
- package/dist/chunk-J2TMAIN5.js +60 -0
- package/dist/chunk-J5FJMODQ.js +142 -0
- package/dist/chunk-J7HZPIO3.js +2 -0
- package/dist/chunk-JEVRKFRL.js +2 -0
- package/dist/chunk-JFXSGAEB.js +30 -0
- package/dist/chunk-JVRTHGFS.js +3 -0
- package/dist/chunk-JYWEX7RR.js +360 -0
- package/dist/chunk-K3YL22N6.js +2 -0
- package/dist/chunk-K4CN7GXK.js +12 -0
- package/dist/chunk-K5TBVXU4.js +30 -0
- package/dist/chunk-KDDIE2DP.js +9 -0
- package/dist/chunk-KHWRRPV4.js +2 -0
- package/dist/chunk-KI6NBKDY.js +14 -0
- package/dist/chunk-KU3QRSTH.js +2 -0
- package/dist/chunk-KZBJWZJB.js +2 -0
- package/dist/chunk-L7GFM3NP.js +3 -0
- package/dist/chunk-LMO6PK3V.js +35 -0
- package/dist/chunk-LN4YXJJU.js +2 -0
- package/dist/chunk-LOVIZBJ4.js +43 -0
- package/dist/chunk-LPCRK4A2.js +11 -0
- package/dist/chunk-MMHZKBFA.js +2 -0
- package/dist/{chunk-M2O5NY6W.js → chunk-MOQQBQRD.js} +2 -2
- package/dist/chunk-N2WN6I3L.js +2 -0
- package/dist/chunk-N3ORQT7L.js +2 -0
- package/dist/chunk-NAZ3RAIW.js +2 -0
- package/dist/chunk-NDUNO5JQ.js +2 -0
- package/dist/chunk-NEIWRNAZ.js +4 -0
- package/dist/chunk-NJJMVD65.js +2 -0
- package/dist/chunk-NLOQOBXI.js +20 -0
- package/dist/chunk-NOLZOVCU.js +2 -0
- package/dist/chunk-NOWINRRN.js +2 -0
- package/dist/chunk-NZAXKGRL.js +16 -0
- package/dist/chunk-O2C4UILI.js +2 -0
- package/dist/chunk-O3RHA6ZT.js +3 -0
- package/dist/chunk-O4UZSPPI.js +3 -0
- package/dist/chunk-OGFV2BUX.js +2 -0
- package/dist/chunk-OZCJXZK6.js +499 -0
- package/dist/chunk-P6ODM7BY.js +2 -0
- package/dist/{chunk-XBGWL66K.js → chunk-PAVGPRHJ.js} +2 -2
- package/dist/chunk-PH52RA7D.js +2 -0
- package/dist/chunk-PKN354TH.js +3 -0
- package/dist/chunk-PWOASWEG.js +11 -0
- package/dist/chunk-QIWXRW72.js +2 -0
- package/dist/chunk-QJRMOK5N.js +2 -0
- package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
- package/dist/chunk-QXEUDXBT.js +3 -0
- package/dist/chunk-QYUVVBMR.js +6 -0
- package/dist/chunk-QZ7KQZRN.js +2 -0
- package/dist/chunk-R6LQBUDH.js +2 -0
- package/dist/chunk-RBS42E55.js +20 -0
- package/dist/chunk-RSJKPCFX.js +26 -0
- package/dist/chunk-S6CZA3MV.js +2 -0
- package/dist/chunk-STMVAHJP.js +2 -0
- package/dist/chunk-SYVPTTVW.js +2 -0
- package/dist/chunk-T3I6NHBH.js +2 -0
- package/dist/chunk-T6DK3ZP7.js +2 -0
- package/dist/chunk-TKD34PHN.js +4 -0
- package/dist/chunk-TNNQFH7W.js +2 -0
- package/dist/chunk-TNV7SSUF.js +2 -0
- package/dist/chunk-TO7ZR3EH.js +8 -0
- package/dist/chunk-TOU3CHK4.js +2 -0
- package/dist/chunk-TRBI4UKT.js +2 -0
- package/dist/chunk-TZCVNCAN.js +4 -0
- package/dist/chunk-U4LZA5LL.js +3 -0
- package/dist/chunk-U5RIG3JP.js +3 -0
- package/dist/chunk-UP5KXN2I.js +2 -0
- package/dist/chunk-UQFR3NDH.js +5 -0
- package/dist/chunk-UXYXF7GV.js +2 -0
- package/dist/chunk-VB3GOKOS.js +2 -0
- package/dist/chunk-VF5JZICY.js +2 -0
- package/dist/chunk-VTY3VK6E.js +2 -0
- package/dist/chunk-VX2O4RIS.js +2 -0
- package/dist/chunk-WKPV2TDZ.js +2 -0
- package/dist/chunk-WOFQ5DTB.js +2 -0
- package/dist/chunk-WS4C6TCK.js +2 -0
- package/dist/chunk-WXU3DGPU.js +2 -0
- package/dist/chunk-X6RMKHJQ.js +81 -0
- package/dist/{chunk-4ILJCCXV.js → chunk-XHMN6ZX7.js} +2 -2
- package/dist/chunk-XHTVFLWW.js +2 -0
- package/dist/chunk-XKIDJCIK.js +2 -0
- package/dist/chunk-XTYTYZPT.js +2 -0
- package/dist/chunk-Y2JHHTTA.js +2 -0
- package/dist/chunk-YGVRMGYN.js +4 -0
- package/dist/chunk-YNQCGEQE.js +2 -0
- package/dist/chunk-YOQVEXVE.js +14 -0
- package/dist/chunk-YRT2WLYY.js +2 -0
- package/dist/chunk-YTAP5Y2G.js +2 -0
- package/dist/chunk-YTYWI7VB.js +2 -0
- package/dist/chunk-YULZRALL.js +2 -0
- package/dist/chunk-Z33WQG4Q.js +2 -0
- package/dist/chunk-ZGTYGDMF.js +16 -0
- package/dist/chunk-ZHMRSZFD.js +43 -0
- package/dist/chunk-ZHSP366W.js +10 -0
- package/dist/chunk-ZIBYCYKK.js +7 -0
- package/dist/{chunk-GAS2LJMP.js → chunk-ZLADLUE6.js} +3 -3
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-HYO3NP5Q.js → chunk-ZR4HBC2H.js} +2 -2
- package/dist/cli-main.js +6 -6
- package/dist/cli.js +1 -1
- package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
- package/dist/code-IL5WH3NZ.js +2 -0
- package/dist/code-result-json-ANTBEDFP.js +4 -0
- package/dist/command-descriptors-HEEMDHTU.js +222 -0
- package/dist/deps-EOWFC6FD.js +2 -0
- package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
- package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
- package/dist/files-K4AI3JUM.js +2 -0
- package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
- package/dist/{health-CPp2Jf1Z.d.ts → health-BtfmNrfa.d.ts} +58 -74
- package/dist/hierarchy-6W5NDIFI.js +2 -0
- package/dist/imports-WH365QY4.js +2 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/members-K3PHMF5S.js +2 -0
- package/dist/methods-E7KVMBX4.js +2 -0
- package/dist/output-continuation-command-BJSY67SN.js +3 -0
- package/dist/output-pagination-UZJ5ACIX.js +24 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-EP24WT4X.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +15 -4
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +3 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -0
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +3 -3
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +20 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity.d.ts +6 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +1 -7
- package/dist/queries/context.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dead.d.ts +2 -0
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/dependence-slice.d.ts +46 -22
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +1 -7
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +29 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -4
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +121 -61
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -0
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +17 -65
- package/dist/queries/index.js +1 -1
- package/dist/queries/locality-candidates.d.ts +4 -4
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -6
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +9 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +19 -3
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +22 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +17 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +4 -14
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +4 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/review.d.ts +188 -0
- package/dist/queries/review.js +2 -0
- package/dist/queries/similar-files.d.ts +7 -10
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +19 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice-cohesion.d.ts +205 -0
- package/dist/queries/slice-cohesion.js +2 -0
- package/dist/queries/source-inspection.d.ts +6 -202
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -3
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stats.d.ts +1 -0
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +4 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -7
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +3 -15
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +4 -4
- package/dist/refs-CCBJG7WK.js +2 -0
- package/dist/refs-pagination-DRNLVU4S.js +2 -0
- package/dist/reindex-worker.js +79 -29
- package/dist/reindex.js +45 -45
- package/dist/repository-cache-worker.js +2 -0
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +3 -4
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/service-queries-2WAJI7R6.js +6 -0
- package/dist/source-inspection-91U9zdO3.d.ts +341 -0
- package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
- package/dist/stats-G7DIV6VU.js +2 -0
- package/dist/surface-IO55UALI.js +2 -0
- package/dist/system-ZBMSHJXU.js +2 -0
- package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
- package/dist/typescript-indexer.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +3 -3
- package/docs/AGENT_GUIDE.md +19 -128
- package/docs/CLI_JSON_OUTPUT.md +21 -17
- package/docs/COMMAND_REFERENCE.md +34 -49
- package/docs/CURRENT_COMMANDS.md +123 -0
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
- package/docs/DETECTOR_GUIDE.md +55 -12
- package/docs/PRODUCT_VISION.md +135 -0
- package/docs/PROPERTY_TESTING.md +73 -0
- package/docs/REVIEW.md +76 -0
- package/docs/SKILLS.md +51 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
- package/docs/accuracy-audit-checklist.md +70 -13
- package/docs/analyzer-inventory.md +2 -2
- package/docs/locality-analyzer-design.md +9 -9
- package/package.json +18 -80
- package/scripts/evidence-product-contract.mjs +7 -3
- package/scripts/record-review-coverage.mjs +118 -0
- package/scripts/scip-windows-provenance.mjs +29 -19
- package/skills/scip-architecture-review/SKILL.md +57 -0
- package/skills/scip-architecture-review/agents/openai.yaml +4 -0
- package/skills/scip-architecture-review/references/design-checks.md +17 -0
- package/skills/scip-explore/SKILL.md +15 -59
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/external-evidence.md +2 -2
- package/skills/scip-explore/references/information-model.md +26 -29
- package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
- package/skills/scip-integrity-audit/SKILL.md +53 -181
- package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
- package/skills/scip-plan/SKILL.md +39 -65
- package/skills/scip-plan/agents/openai.yaml +2 -2
- package/skills/scip-query/SKILL.md +28 -81
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-query/references/command-guide.md +169 -0
- package/skills/scip-setup/SKILL.md +4 -2
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/by-kind-XI2CSWEY.js +0 -2
- package/dist/call-graph-UONR6JR5.js +0 -2
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2E7CX53V.js +0 -2
- package/dist/chunk-2GRUZAQF.js +0 -43
- package/dist/chunk-2LDBDR6J.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2R3V3PSD.js +0 -4
- package/dist/chunk-2WC2OEDO.js +0 -4
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D3QG236.js +0 -2
- package/dist/chunk-3FHOF22C.js +0 -21
- package/dist/chunk-3JKSW6LJ.js +0 -2
- package/dist/chunk-3L2ZBPEX.js +0 -133
- package/dist/chunk-3PJABJSU.js +0 -2
- package/dist/chunk-3SVF22I5.js +0 -2
- package/dist/chunk-3WR4E3A3.js +0 -3
- package/dist/chunk-4FTZ4P5G.js +0 -2
- package/dist/chunk-4UX2F3JX.js +0 -2
- package/dist/chunk-4WNW27SX.js +0 -2
- package/dist/chunk-5ENOG4VP.js +0 -61
- package/dist/chunk-64BFSI5I.js +0 -2
- package/dist/chunk-66DVSJQG.js +0 -455
- package/dist/chunk-6HFCYNYE.js +0 -9
- package/dist/chunk-6PQNKL3G.js +0 -3
- package/dist/chunk-6V5CNXL6.js +0 -2
- package/dist/chunk-6VVV4WRR.js +0 -4
- package/dist/chunk-7BWFZPPZ.js +0 -2
- package/dist/chunk-7CYG22FH.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7IWV2EG3.js +0 -3
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-AFHTBORT.js +0 -2
- package/dist/chunk-AVRYW5OZ.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B5D7QPBE.js +0 -4
- package/dist/chunk-BBCIS4DX.js +0 -16
- package/dist/chunk-BDUVI7TO.js +0 -3
- package/dist/chunk-BE7ZZTMC.js +0 -2
- package/dist/chunk-BHVUJOCQ.js +0 -3
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BQGB4HBD.js +0 -2
- package/dist/chunk-BRV7PIFF.js +0 -2
- package/dist/chunk-CEEZJXEF.js +0 -2
- package/dist/chunk-CIYLO6SI.js +0 -7
- package/dist/chunk-CJZXN4NU.js +0 -2
- package/dist/chunk-CNO7TOKL.js +0 -2
- package/dist/chunk-COF23M5F.js +0 -2
- package/dist/chunk-CWFP7GM5.js +0 -2
- package/dist/chunk-D2DHWI3D.js +0 -2
- package/dist/chunk-D4N5SQ2M.js +0 -4
- package/dist/chunk-DBRSYFXR.js +0 -2
- package/dist/chunk-DHUIOLDT.js +0 -2
- package/dist/chunk-DIRJWYBM.js +0 -6
- package/dist/chunk-DIUFNHRJ.js +0 -35
- package/dist/chunk-DRENNWRG.js +0 -2
- package/dist/chunk-DTZCKZEU.js +0 -4
- package/dist/chunk-DULC3QFP.js +0 -5
- package/dist/chunk-DYGHBZ2N.js +0 -16
- package/dist/chunk-E5R6AQ73.js +0 -40
- package/dist/chunk-E73UNJTF.js +0 -38
- package/dist/chunk-EKV5HX33.js +0 -2
- package/dist/chunk-EQHFIL6T.js +0 -3
- package/dist/chunk-ESIQ66Z7.js +0 -2
- package/dist/chunk-EVFUMY4R.js +0 -3
- package/dist/chunk-F7DY272B.js +0 -2
- package/dist/chunk-FBN2FGXG.js +0 -2
- package/dist/chunk-FDLOBR6P.js +0 -4
- package/dist/chunk-FESCRNVV.js +0 -5
- package/dist/chunk-FFRKR4EQ.js +0 -2
- package/dist/chunk-FGA2U4OR.js +0 -8
- package/dist/chunk-FIQRSHVM.js +0 -2
- package/dist/chunk-FPYLNQPT.js +0 -2
- package/dist/chunk-FRUSVINH.js +0 -2
- package/dist/chunk-GSP44ENC.js +0 -2
- package/dist/chunk-GUFSG5TX.js +0 -2
- package/dist/chunk-GYIZ4NXB.js +0 -2
- package/dist/chunk-GZIUDL6G.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HCXEQRFF.js +0 -18
- package/dist/chunk-HEHOQQKH.js +0 -2
- package/dist/chunk-HKGFPJ4T.js +0 -4
- package/dist/chunk-HLZTEXRA.js +0 -2
- package/dist/chunk-HOENASQM.js +0 -3
- package/dist/chunk-HVF5VBG6.js +0 -2
- package/dist/chunk-I55I7XXP.js +0 -2
- package/dist/chunk-IDFEUFKS.js +0 -2
- package/dist/chunk-IHGQTTVW.js +0 -2
- package/dist/chunk-IICPE7B2.js +0 -20
- package/dist/chunk-IL676XCC.js +0 -18
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-IZDPJ2QI.js +0 -2
- package/dist/chunk-J66VOFW6.js +0 -5
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JGKUET5J.js +0 -3
- package/dist/chunk-JS4PGXMV.js +0 -3
- package/dist/chunk-JWTGMPIT.js +0 -80
- package/dist/chunk-JYR66JN5.js +0 -5
- package/dist/chunk-KFOYCQAJ.js +0 -9
- package/dist/chunk-KLFEXGQA.js +0 -2
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KYSDI3GE.js +0 -5
- package/dist/chunk-L6PJPETJ.js +0 -29
- package/dist/chunk-LDVT66YM.js +0 -2
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-LMZ5PRUV.js +0 -2
- package/dist/chunk-LQRQN2XA.js +0 -2
- package/dist/chunk-LXABEJX3.js +0 -2
- package/dist/chunk-MNV5FSBW.js +0 -3
- package/dist/chunk-MPQ4OTBM.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV3CDXPI.js +0 -38
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N2ZSIIGR.js +0 -117
- package/dist/chunk-N5B2NILC.js +0 -5
- package/dist/chunk-NJITK2GP.js +0 -2
- package/dist/chunk-NOGJXYFO.js +0 -2
- package/dist/chunk-NOYBFVJA.js +0 -554
- package/dist/chunk-NWQXSFFU.js +0 -3
- package/dist/chunk-ODDUPDP7.js +0 -13
- package/dist/chunk-OLIWTZI3.js +0 -3
- package/dist/chunk-OLNV6I6U.js +0 -2
- package/dist/chunk-OR2E3AGZ.js +0 -2
- package/dist/chunk-OSR2GEHQ.js +0 -2
- package/dist/chunk-OSSESPDX.js +0 -3
- package/dist/chunk-OWOOWNJ5.js +0 -7
- package/dist/chunk-P42EIXTA.js +0 -2
- package/dist/chunk-PJFGPYTU.js +0 -2
- package/dist/chunk-PP7KNN7L.js +0 -2
- package/dist/chunk-PU7T5QYQ.js +0 -2
- package/dist/chunk-PWWAJSKV.js +0 -74
- package/dist/chunk-PZL5T7SU.js +0 -73
- package/dist/chunk-QBE3YX64.js +0 -23
- package/dist/chunk-QGVTFRY2.js +0 -7
- package/dist/chunk-QOJONDS7.js +0 -2
- package/dist/chunk-QU5XRYB5.js +0 -4
- package/dist/chunk-QUU5OBVK.js +0 -11
- package/dist/chunk-RBLQNW26.js +0 -20
- package/dist/chunk-RTQ7NEKG.js +0 -81
- package/dist/chunk-SQXRS7BG.js +0 -4
- package/dist/chunk-SSK6LDPC.js +0 -2
- package/dist/chunk-SZHGTCPP.js +0 -7
- package/dist/chunk-T4N4P2K5.js +0 -16
- package/dist/chunk-TA3QKLLU.js +0 -2
- package/dist/chunk-TEBQMNVI.js +0 -43
- package/dist/chunk-TPFHAQ2G.js +0 -2
- package/dist/chunk-TQPCBMWT.js +0 -5
- package/dist/chunk-TQZV7KV4.js +0 -2
- package/dist/chunk-TRNAEQ6P.js +0 -3
- package/dist/chunk-TY7CRN3Z.js +0 -2
- package/dist/chunk-UHFYCMZO.js +0 -35
- package/dist/chunk-UICY4GTQ.js +0 -7
- package/dist/chunk-UVGEWT4Y.js +0 -26
- package/dist/chunk-UXW33INU.js +0 -29
- package/dist/chunk-VMPRET3I.js +0 -5
- package/dist/chunk-VNLGKHS6.js +0 -6
- package/dist/chunk-VQILFTEH.js +0 -2
- package/dist/chunk-VUPHCS7Y.js +0 -57
- package/dist/chunk-VVZSBTSU.js +0 -23
- package/dist/chunk-VZRNID6A.js +0 -2
- package/dist/chunk-W5OXRYGE.js +0 -7
- package/dist/chunk-W6STWDQI.js +0 -57
- package/dist/chunk-W7CXK74K.js +0 -2
- package/dist/chunk-WB3WYIRE.js +0 -4
- package/dist/chunk-WDNVY4E7.js +0 -20
- package/dist/chunk-WK46TNUM.js +0 -3
- package/dist/chunk-WNTFFKAX.js +0 -12
- package/dist/chunk-WOIKCX6A.js +0 -2
- package/dist/chunk-WUN6KBHV.js +0 -2
- package/dist/chunk-WYCTJDVR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XDQMU3BT.js +0 -2
- package/dist/chunk-XFA4SSO3.js +0 -3
- package/dist/chunk-XGZEP6GR.js +0 -8
- package/dist/chunk-XPDPNWTQ.js +0 -368
- package/dist/chunk-XRYABF57.js +0 -8
- package/dist/chunk-YBGKCQIS.js +0 -2
- package/dist/chunk-YEN6CYC7.js +0 -16
- package/dist/chunk-YF5IB2LF.js +0 -2
- package/dist/chunk-YI2AWIHC.js +0 -3
- package/dist/chunk-YPWBKGFU.js +0 -2
- package/dist/chunk-YPWHBBIS.js +0 -2
- package/dist/chunk-YSH6U3L4.js +0 -3
- package/dist/chunk-YU5DZUZI.js +0 -10
- package/dist/chunk-YWO5DDRC.js +0 -16
- package/dist/chunk-Z4CDXYNQ.js +0 -2
- package/dist/chunk-ZF5KHH7C.js +0 -2
- package/dist/chunk-ZOHS7AQV.js +0 -21
- package/dist/chunk-ZTI4SBFV.js +0 -3
- package/dist/code-MI6F2TTU.js +0 -2
- package/dist/code-result-json-FXALY4HE.js +0 -2
- package/dist/command-descriptors-P34VABY5.js +0 -343
- package/dist/dataflow-4KEMJPC6.js +0 -2
- package/dist/dependence-slice-R7FPWD5M.js +0 -2
- package/dist/deps-7EMQUYUT.js +0 -2
- package/dist/direct-navigation-6YO234F2.js +0 -3
- package/dist/entry-map-KOOLR26E.js +0 -2
- package/dist/files-OPIPJIGZ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-QPD2CAER.js +0 -2
- package/dist/imports-M6HUXRXC.js +0 -2
- package/dist/members-I5MEFOCT.js +0 -2
- package/dist/methods-5JYGGHXA.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-UPQAAKBP.js +0 -3
- package/dist/output-pagination-3OFL2MJV.js +0 -19
- package/dist/project-reindex-UKKQ5PLS.js +0 -3
- package/dist/queries/anchors.d.ts +0 -123
- package/dist/queries/anchors.js +0 -2
- package/dist/queries/complexity-hotspots.d.ts +0 -40
- package/dist/queries/complexity-hotspots.js +0 -2
- package/dist/queries/convergence.d.ts +0 -33
- package/dist/queries/convergence.js +0 -2
- package/dist/queries/dataflow.d.ts +0 -77
- package/dist/queries/dataflow.js +0 -2
- package/dist/queries/deep-chains.d.ts +0 -5
- package/dist/queries/deep-chains.js +0 -2
- package/dist/queries/extract-candidates.d.ts +0 -52
- package/dist/queries/extract-candidates.js +0 -2
- package/dist/queries/isolated.d.ts +0 -24
- package/dist/queries/isolated.js +0 -2
- package/dist/queries/plan-context.d.ts +0 -33
- package/dist/queries/plan-context.js +0 -2
- package/dist/queries/reference-neighborhood.d.ts +0 -4
- package/dist/queries/reference-neighborhood.js +0 -2
- package/dist/queries/reference-reachability.d.ts +0 -48
- package/dist/queries/reference-reachability.js +0 -2
- package/dist/queries/self-audit.d.ts +0 -63
- package/dist/queries/self-audit.js +0 -2
- package/dist/queries/similar-chains.d.ts +0 -48
- package/dist/queries/similar-chains.js +0 -2
- package/dist/queries/slice.d.ts +0 -4
- package/dist/queries/slice.js +0 -2
- package/dist/queries/stale-abstractions.d.ts +0 -72
- package/dist/queries/stale-abstractions.js +0 -2
- package/dist/queries/system-map.d.ts +0 -449
- package/dist/queries/system-map.js +0 -2
- package/dist/queries/trace.js +0 -2
- package/dist/queries/twin-ab.d.ts +0 -66
- package/dist/queries/twin-ab.js +0 -2
- package/dist/queries/value-flow.d.ts +0 -43
- package/dist/queries/value-flow.js +0 -2
- package/dist/queries/wrapper-candidates.d.ts +0 -34
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-PSU4JZZW.js +0 -2
- package/dist/refs-pagination-JG6CJMRC.js +0 -2
- package/dist/slice-HYRATV64.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-VTGDYWF5.js +0 -2
- package/dist/symbol-resolution-WD5EU5JE.js +0 -2
- package/dist/system-LRQNFOR2.js +0 -2
- package/dist/trace-F4B6OLL4.js +0 -2
- package/dist/value-flow-VRPZY72V.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
package/dist/chunk-T4N4P2K5.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as P}from"./chunk-CJZXN4NU.js";import{a as B}from"./chunk-OSSESPDX.js";import{d as E}from"./chunk-N2ZSIIGR.js";import{b as p,g as f,i as S,m as h,n as L}from"./chunk-ODDUPDP7.js";import{D as u}from"./chunk-ZOHS7AQV.js";import{Aa as g,Ba as y}from"./chunk-N5B2NILC.js";function $(n,t,s={}){let e=B(n,t);if(!e)return null;let a=new P(n),o=I(n,e),c=e.endLine-e.startLine+1,m=a.calleeMap([e],{additive:!0,semantic:s.semantic}).get(e.symbolId)??[],l=new Set(m.map(b=>b.symbol));return{symbol:e.symbol,shortName:E(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:c,branches:o.branches,estimateBasis:o.estimateBasis,cyclomaticEstimate:o.branches+1,calleeCount:l.size,fanIn:w(n,e.symbolId),fanOut:F(m,e.relativePath)}}function I(n,t){let s=u(n,t.relativePath);if(s){let e=S(s.rootNode,t.startLine,t.endLine);if(e)return{branches:D(e),estimateBasis:"ast"}}return{branches:M(N(n,t.relativePath,t.startLine,t.endLine),x(n,t.relativePath)),estimateBasis:"regex-fallback"}}function H(n,t){let s=new Map,e=new Map;for(let a of t){let o=e.get(a.relativePath)??[];o.push(a),e.set(a.relativePath,o)}for(let[a,o]of e){let c=new Map;for(let i of L(n,a)?.callables??[])i.branches!==void 0&&c.set(`${i.startLine}:${i.endLine}`,i.branches);let r=[];for(let i of o){let d=c.get(`${i.startLine}:${i.endLine}`);d===void 0?r.push(i):s.set(i.symbolId,{branches:d,estimateBasis:"ast"})}if(r.length===0)continue;let m=u(n,a),l=m===null?[]:r.filter(i=>m.rootNode.startPosition.row<=i.startLine&&m.rootNode.endPosition.row>=i.endLine),b=new Set(l.map(i=>i.symbolId));if(m&&l.length>0){for(let i of l)s.set(i.symbolId,{branches:0,estimateBasis:"ast"});_(m.rootNode,l,s)}for(let i of r)b.has(i.symbolId)||s.set(i.symbolId,v(n,i))}return s}function v(n,t){return{branches:M(N(n,t.relativePath,t.startLine,t.endLine),x(n,t.relativePath)),estimateBasis:"regex-fallback"}}function x(n,t){return n.get("SELECT language FROM documents WHERE relative_path = ?",t)?.language??"unknown"}function N(n,t,s,e){try{return g(n.config.projectRoot,t,{inputKind:"indexed source file"}).split(`
|
|
2
|
-
`).slice(s,e+1).join(`
|
|
3
|
-
`)}catch(a){if(!y(a))throw a;return""}}function w(n,t){return n.get(`SELECT COUNT(DISTINCT c.document_id) AS c
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN (
|
|
7
|
-
SELECT m2.symbol_id, c2.document_id
|
|
8
|
-
FROM mentions m2
|
|
9
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
-
WHERE m2.role = 1
|
|
11
|
-
GROUP BY m2.symbol_id
|
|
12
|
-
) sym_def ON sym_def.symbol_id = m.symbol_id
|
|
13
|
-
WHERE m.symbol_id = ?
|
|
14
|
-
AND m.role != 1
|
|
15
|
-
AND sym_def.document_id != c.document_id`,t)?.c??0}function F(n,t){return new Set(n.filter(s=>s.file!==t).map(s=>s.symbol)).size}function D(n){let t=0;return f(n,s=>{t+=h(s)}),t}function _(n,t,s){let e=[...t].sort((a,o)=>a.startLine-o.startLine||o.endLine-a.endLine);f(n,a=>{let o=h(a);if(o===0)return;let c=a.startPosition.row,r=a.endPosition.row;for(let m of e){if(m.startLine>c)break;if(m.endLine<r)continue;let l=s.get(m.symbolId);l&&(l.branches+=o)}})}function M(n,t){let s=p(n),e=0,a=[/\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];for(let o of a){let c=s.match(o);c&&(e+=c.length)}if(t==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let c of o){let r=s.match(c);r&&(e+=r.length)}}else if(t==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let c of o){let r=s.match(c);r&&(e+=r.length)}}else if(t==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let c of o){let r=s.match(c);r&&(e+=r.length)}}else if(t==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let c of o){let r=s.match(c);r&&(e+=r.length)}}return e}export{$ as a,I as b,H as c,D as d};
|
|
16
|
-
//# sourceMappingURL=chunk-T4N4P2K5.js.map
|
package/dist/chunk-TA3QKLLU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as y}from"./chunk-CJZXN4NU.js";import{b as h,e as b}from"./chunk-OSSESPDX.js";import{d as u,e as i,g as c}from"./chunk-N2ZSIIGR.js";import{n as m}from"./chunk-ODDUPDP7.js";import{z as l}from"./chunk-ZOHS7AQV.js";import{basename as f}from"path";function g(t,o){let n=o.className,e=h(t,n);return e.match?e.total>1?{kind:"ambiguous",query:n,total:e.total,candidates:[p(e.match),...e.candidates]}:{kind:"matched",query:n,owner:L(e.match),methods:M(t,e.match)}:{kind:"missing",query:n,suggestions:b(t,n,5)}}function j(t,o){let n=g(t,{className:o});if(n.kind==="missing")throw new Error(`No class definition matched '${o}'.`);if(n.kind==="ambiguous"){let e=n.candidates.map(s=>`${s.relativePath}:${s.startLine+1}`).join(", ");throw new Error(`Class '${o}' is ambiguous across ${n.total} definitions (${e}). Qualify it with a path or exact SCIP symbol identity.`)}return n.methods}function M(t,o){let n=i(o.symbol),s=new y(t).definitionsForFile(o.relativePath).filter(r=>c(r.symbol)),a=s.filter(r=>r.parentTypeName===n||r.symbol.includes(n)),d=(a.length>0?a:S(f(o.relativePath))===n?s.filter(r=>r.symbol.includes("<invalid-global-code>")):[]).map(r=>({startLine:r.startLine,endLine:r.endLine,name:i(r.symbol)}));return l(o.relativePath)!=="clojure"?d:R(d,w(t,o))}function p(t){return{symbol:t.symbol,shortName:u(t.symbol),relativePath:t.relativePath,startLine:t.startLine}}function L(t){return{...p(t),endLine:t.endLine}}function S(t){return t.replace(/\.[^.]+$/,"")}function w(t,o){let n=i(o.symbol);return n?(m(t,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===n).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function R(t,o){let n=new Map;for(let e of[...t,...o])n.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...n.values()].sort((e,s)=>e.startLine-s.startLine||e.endLine-s.endLine)}export{g as a,j as b};
|
|
2
|
-
//# sourceMappingURL=chunk-TA3QKLLU.js.map
|
package/dist/chunk-TEBQMNVI.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import{x as _,z as C}from"./chunk-ODDUPDP7.js";import{B as R,a as h}from"./chunk-ZOHS7AQV.js";import{d as x,e as I}from"./chunk-FESCRNVV.js";import{c as A,h as O,j as F,y as g}from"./chunk-JWTGMPIT.js";var P=x({kind:"file-dependency-graph",invalidation:I("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:L}),J=A("file-dep-graph",{clearGroups:["whole-project"]});function ee(e,n,r){if(r.length===0)return[];let t=new Set(r),i=M(e),s=new Set;if(n==="forward")for(let o of t)for(let c of i.get(o)??[])t.has(c)||s.add(c);else for(let[o,c]of i)if(!t.has(o))for(let d of t)c.has(d)&&s.add(o);return[...s].sort()}function M(e,n,r={}){let t=r.scipEdges??"all-references",i=r.sourceEdges??"imports-only",s=D(n,t,i);return J.get(e,s,()=>{let o=new Set(h(e,{includeIgnored:!1})),c=F(e),d=0,f=0,l=null,p=!1,u=0,N=0,G=null;return g("file-dep-graph.product",()=>{if(c){let a=P.read(e,s,c);if(a){p=!0,G=a.construction;let E=v(a);return d=a.sourceFileCount,f=a.sourceEdgeCount,u=a.scipEdgeCount,N=E.size,l=a.sourceDependencyFingerprint,E}}let S=i==="none"?{files:[],edges:[],fingerprint:O("no-source-dependency-fallback")}:g("file-dep-graph.source-imports",()=>{let a=j(e,o,n,i);return d=a.files.length,f=a.edges.length,l=a.fingerprint,a},()=>({scope:n??null,sourceEdges:i,files:d,edges:f})),y=new Map,b=(a,E)=>m(e,y,o,a,E);g("file-dep-graph.scip-edges",()=>{for(let a of H(e,n,t))u=(u??0)+1,b(a.from_file,a.to_file)},()=>({scope:n??null,edges:u}));for(let a of S.edges)b(a.fromFile,a.toFile);return N=y.size,c&&(G="full",P.write(e,s,c,{version:2,construction:"full",sourceDependencyFingerprint:S.fingerprint,sourceFileCount:S.files.length,sourceEdgeCount:S.edges.length,scipEdgeCount:u,edgeCount:k(y),graph:w(y)})),y},()=>({scope:n??null,available:c!==null,hit:p,construction:G,files:d,sourceEdges:f,sourceEdgeMode:i,scipEdges:u,graphFiles:N,sourceDependencyFingerprint:l}))})}function ne(e){return T(e,"none")}function re(e,n="imports-only"){let r=D(void 0,"all-references",n),t=F(e);if(!t)return null;let i=P.read(e,r,t);return i?{cacheKey:r,sourceEdges:n,graph:v(i)}:null}function T(e,n){let r=D(void 0,"all-references",n),t=M(e,void 0,{sourceEdges:n});return{cacheKey:r,sourceEdges:n,graph:t}}function te(e,n,r,t){let i=n.sourceEdges??"imports-only",s=F(e);if(!s)return!1;let o=t??$(e,n,r);if(!o)return!1;let c=new Set(h(e,{includeIgnored:!1})),d=D(void 0,"all-references",i);return P.write(e,d,s,{version:2,construction:"carried",sourceDependencyFingerprint:null,sourceFileCount:c.size,sourceEdgeCount:null,scipEdgeCount:null,edgeCount:k(o),graph:w(o)}),!0}function $(e,n,r,t=[]){let i=n.sourceEdges??"imports-only",s=D(void 0,"all-references",i);if(n.cacheKey!==s)return null;let o=g("file-dep-graph.carry.indexed-files",()=>new Set(h(e,{includeIgnored:!1}))),c=new Set(r),d=new Map;g("file-dep-graph.carry.reuse",()=>{if(t.length===0)for(let[l,p]of n.graph)c.has(l)||d.set(l,p);else for(let[l,p]of n.graph)if(!(c.has(l)||!o.has(l)))for(let u of p)m(e,d,o,l,u)});let f=g("file-dep-graph.carry.scip-edges",()=>B(e,c,"all-references"));for(let l of f)m(e,d,o,l.from_file,l.to_file);return g("file-dep-graph.carry.source-edges",()=>{for(let l of c)if(o.has(l)){if(i!=="none")for(let p of C(e,l))p.sourcePath&&m(e,d,o,l,p.sourcePath);if(i==="imports-and-reexports")for(let p of _(e,l))p.sourcePath&&m(e,d,o,l,p.sourcePath)}}),d}async function oe(e,n={}){let r=h(e,{includeIgnored:!1}),t=Math.max(1,Math.floor(n.batchSize??64)),i=n.collectGarbage??R,s=0;for(let o=0;o<r.length;o+=t){for(let c of r.slice(o,o+t))C(e,c),_(e,c),s+=1;n.onBatch?.({files:s,total:r.length}),i(),await n.yieldToEventLoop?.()}return{files:s}}function j(e,n,r,t){let i=[],s=[];for(let o of n)if(!(r&&!o.includes(r))){i.push(o);for(let c of C(e,o))c.sourcePath&&s.push({fromFile:o,toFile:c.sourcePath});if(t==="imports-and-reexports")for(let c of _(e,o))c.sourcePath&&s.push({fromFile:o,toFile:c.sourcePath})}return{files:i,edges:s,fingerprint:z(i,s)}}function z(e,n){let r=n.map(t=>`${t.fromFile}\0${t.toFile}`).sort();return O(JSON.stringify({files:e,edges:r}))}function D(e,n,r){return`edge-mode-v4:${n}:${r}:${e??"<all>"}`}function w(e){return[...e].map(([n,r])=>[n,[...r].sort()]).sort(([n],[r])=>n.localeCompare(r))}function v(e){return new Map(e.graph.map(([n,r])=>[n,new Set(r)]))}function L(e){let n=JSON.parse(e);return K(n)?n:null}function K(e){if(!e||typeof e!="object")return!1;let n=e;return n.version===2&&(n.construction==="full"||n.construction==="carried")&&(n.sourceDependencyFingerprint===null||typeof n.sourceDependencyFingerprint=="string")&&typeof n.sourceFileCount=="number"&&(n.sourceEdgeCount===null||typeof n.sourceEdgeCount=="number")&&(n.scipEdgeCount===null||typeof n.scipEdgeCount=="number")&&typeof n.edgeCount=="number"&&Array.isArray(n.graph)&&n.graph.every(W)}function k(e){let n=0;for(let r of e.values())n+=r.size;return n}function W(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(n=>typeof n=="string")}function H(e,n,r){let t=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[],s=r==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
|
|
2
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
${s}
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${t}`,...i)}function B(e,n,r){let t=[...n].sort();if(t.length===0)return[];let i=r==="imports-only"?"AND m.role = 2":"AND m.role != 1",s=[];for(let o=0;o<t.length;o+=500){let c=t.slice(o,o+500),d=c.map(()=>"?").join(", ");s.push(...e.all(`SELECT DISTINCT
|
|
20
|
-
d1.relative_path AS from_file,
|
|
21
|
-
d2.relative_path AS to_file
|
|
22
|
-
FROM documents d1
|
|
23
|
-
CROSS JOIN chunks c
|
|
24
|
-
CROSS JOIN mentions m
|
|
25
|
-
CROSS JOIN global_symbols gs
|
|
26
|
-
CROSS JOIN chunks c2
|
|
27
|
-
CROSS JOIN documents d2
|
|
28
|
-
WHERE d1.relative_path IN (${d})
|
|
29
|
-
AND c.document_id = d1.id
|
|
30
|
-
AND m.chunk_id = c.id
|
|
31
|
-
AND gs.id = m.symbol_id
|
|
32
|
-
AND c2.id = (
|
|
33
|
-
SELECT m2.chunk_id
|
|
34
|
-
FROM mentions m2
|
|
35
|
-
WHERE m2.symbol_id = gs.id AND m2.role = 1
|
|
36
|
-
ORDER BY m2.chunk_id
|
|
37
|
-
LIMIT 1
|
|
38
|
-
)
|
|
39
|
-
AND d2.id = c2.document_id
|
|
40
|
-
AND d1.id != d2.id
|
|
41
|
-
${i}
|
|
42
|
-
${e.pathExclusionsFor("d1","d2")}`,...c))}return s}function m(e,n,r,t,i){if(t===i||e.isIgnored(t)||e.isIgnored(i)||!r.has(i))return;let s=n.get(t);s||(s=new Set,n.set(t,s)),s.add(i)}export{ee as a,M as b,ne as c,re as d,te as e,$ as f,oe as g};
|
|
43
|
-
//# sourceMappingURL=chunk-TEBQMNVI.js.map
|
package/dist/chunk-TPFHAQ2G.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as D}from"./chunk-WOIKCX6A.js";import{d as H,e as J,f as ee,m as Z}from"./chunk-DYGHBZ2N.js";import{c as Y,t as T,u as U}from"./chunk-N2ZSIIGR.js";import{f as R,h as E,n as z,r as N,t as j,y as A}from"./chunk-ODDUPDP7.js";import{D as w}from"./chunk-ZOHS7AQV.js";import{h as X}from"./chunk-FESCRNVV.js";import{E as G,H as K,d as M}from"./chunk-N5B2NILC.js";var te=new WeakMap,ne=new WeakMap,re=new WeakMap,ie=new WeakMap,ae=new WeakMap;function qe(t,e){let n=ne.get(t);n||(n=new Map,ne.set(t,n));let r=n.get(e);if(r)return r;let i=w(t,e)?.rootNode;if(!i)return n.set(e,[]),[];let o=new Set;I(i,c=>{if(c.type!=="call_expression")return;let p=c.childForFieldName("function")??c.namedChild(0),s=/^([A-Za-z_$][\w$]*(?:\.Service)?)\.of$/u.exec(p?.text.replace(/\s+/gu,"")??"");s&&o.add(s[1])});let m=A(t,e).filter(c=>!!c.sourcePath),u=new Set;for(let c of o){let p=/^([A-Za-z_$][\w$]*)\.Service$/u.exec(c);if(p){for(let s of m)s.localName===p[1]&&u.add(s.sourcePath);continue}if(c==="Service"){T(t,e).some(s=>s.leaf==="Service")&&u.add(e);for(let s of m)(s.localName??s.importedName)==="Service"&&u.add(s.sourcePath)}}let l=Q([...u]).sort();return n.set(e,l),l}function Ge(t,e,n={}){let i=j(t,e)?.filter(a=>!n.ranges||n.ranges.some(d=>a.line>=d.startLine&&a.line<=d.endLine));if(!i)return{targets:[],unresolvedCallsites:0};let o=A(t,e).filter(a=>!!a.sourcePath),m=Fe(X(t,e)??""),u=w(t,e)?.rootNode??null,l=u?ge(u):se(),c=new Map,p=ee(t),s=[],f=0;for(let a of i){if(!a.memberAccess)continue;let d=H(e,p.get(a.calleeLeaf)??[]);if(n.excludeIndexedTargets!==!1&&J(t,e,d,!0,a.calleeQualifier))continue;let h=a.calleeQualifier,L=$e(t,e,a,o);if(L){s.push(L);continue}let S=pe(t,e,a,o,he(l,a.calleeQualifier,a.line));if(S.length>0){s.push(...S);continue}let x=ye(t,e,a);if(x.length>0){s.push(...x);continue}let y=h?m.get(h)??h:null,P=(y?Q(o.filter(g=>(g.localName??g.importedName)===y).map(g=>g.sourcePath)):[]).flatMap(g=>{let v=c.get(g);return v||(v=N(t,g)??[],c.set(g,v)),v.filter(b=>b.name===a.calleeLeaf).map(b=>({file:g,callable:b}))});if(P.length!==1){f+=1;continue}let _=P[0];s.push({calleeLeaf:a.calleeLeaf,line:a.line,sourceFile:e,targetFile:_.file,targetStartLine:_.callable.startLine,targetEndLine:_.callable.endLine,resolution:"direct-import-receiver",strength:"candidate"})}return{targets:s,unresolvedCallsites:f}}function pe(t,e,n,r,i){let o=n.calleeQualifier;if(!o||!/^[A-Za-z_$][\w$]*$/u.test(o))return[];if(i.size!==1)return[];let m=[...i][0],u=Q(r.filter(p=>p.localName===m||p.importedName===m).map(p=>p.sourcePath));if(u.length!==1)return[];let l=u[0],c=be(t,l,n.calleeLeaf);return c.map(p=>({calleeLeaf:p.name,line:n.line,sourceFile:e,targetFile:p.file,targetStartLine:p.startLine,targetEndLine:p.endLine,serviceFile:l,resolutionAlternativeCount:c.length,resolution:"imported-service-object-member",strength:"candidate"}))}function se(){return{declarations:new Map,callbacks:[]}}function ge(t){let e=se();return I(t,n=>{if(n.type==="variable_declarator"){let l=n.childForFieldName("name")??n.namedChild(0),c=n.childForFieldName("value")??n.namedChild(1);if(l?.type!=="identifier"||!c)return;let p=new Set;if(I(c,s=>{if(s.type!=="member_expression")return;let f=s.childForFieldName("object")??s.namedChild(0),a=s.childForFieldName("property")??s.namedChild(1);f?.type==="identifier"&&a?.text==="Service"&&p.add(f.text)}),p.size===1){let s=e.declarations.get(l.text)??[];s.push({line:n.startPosition.row,alias:[...p][0]}),e.declarations.set(l.text,s)}return}if(!["arrow_function","function_expression","generator_function"].includes(n.type))return;let r=n.childForFieldName("parameters")??n.childForFieldName("parameter");if(!r)return;let i=n.parent;for(;i&&i.type!=="call_expression";)i=i.parent;if(!i)return;let o=i.childForFieldName("function")??i.namedChild(0),m=/^([A-Za-z_$][\w$]*)\.Service\.use$/u.exec(o?.text??"");if(!m)return;let u=new Set;I(r,l=>{l.type==="identifier"&&u.add(l.text)}),u.size!==0&&e.callbacks.push({startLine:n.startPosition.row,endLine:n.endPosition.row,receivers:u,alias:m[1]})}),e}function he(t,e,n){if(!e||!/^[A-Za-z_$][\w$]*$/u.test(e))return new Set;let r=new Set((t.declarations.get(e)??[]).filter(i=>i.line<=n).map(i=>i.alias));for(let i of t.callbacks)i.startLine<=n&&i.endLine>=n&&i.receivers.has(e)&&r.add(i.alias);return r}function ye(t,e,n){let r=n.calleeQualifier;if(!r||!/^[A-Za-z_$][\w$]*$/u.test(r))return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=Le(t,e,i,n.line,n.calleeLeaf,r),m=o?xe(o,r):null;if(!m)return[];if(!Se(m))return[];let u=(N(t,e)??[]).filter(a=>a.startLine<=m.startPosition.row&&a.endLine>=m.endPosition.row).sort((a,d)=>a.endLine-a.startLine-(d.endLine-d.startLine))[0];if(!u)return[];let l=T(t,e).filter(a=>a.isFunctionLike&&a.leaf===u.name);if(l.length!==1)return[];let c=l[0],p=ie.get(t);p||(p=new Map,ie.set(t,p));let s=`${c.symbol}\0${n.calleeLeaf}`,f=p.get(s);if(!f){let a=[];for(let d of Z(t,c)){let h=w(t,d.file)?.rootNode;if(!h)continue;let L=R(h,"call_expression").filter(y=>y.startPosition.row>d.line||y.endPosition.row<d.line?!1:(y.childForFieldName("function")??y.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,"").match(/[A-Za-z_$][\w$]*$/u)?.[0]===c.leaf);if(L.length!==1)continue;let x=L[0].childForFieldName("arguments")?.namedChildren.find(y=>F(y).type==="object");if(x)for(let y of F(x).namedChildren){if(y.type==="shorthand_property_identifier"&&y.text===n.calleeLeaf){a.push(...O(t,d.file,n.calleeLeaf,y,y));continue}if(y.type!=="pair")continue;let $=y.childForFieldName("key")??y.namedChild(0),P=y.childForFieldName("value")??y.namedChild(1);k($?.text)!==n.calleeLeaf||!P||a.push(...O(t,d.file,n.calleeLeaf,P,y))}}f=a.filter((d,h,L)=>L.findIndex(S=>S.file===d.file&&S.startLine===d.startLine&&S.endLine===d.endLine&&S.name===d.name)===h),p.set(s,f)}return f.map(a=>({calleeLeaf:a.name,line:n.line,sourceFile:e,targetFile:a.file,targetStartLine:a.startLine,targetEndLine:a.endLine,resolutionAlternativeCount:f.length,resolution:"factory-callback-member",strength:f.length===1?"exact":"candidate"}))}function Le(t,e,n,r,i,o){let m=re.get(t);m||(m=new Map,re.set(t,m));let u=m.get(e);if(!u){u=new Map;for(let l of R(n,"call_expression")){let c=l.childForFieldName("function")??l.namedChild(0),p=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(c?.text.replace(/\s+/gu,"")??"");if(p)for(let s=l.startPosition.row;s<=l.endPosition.row;s+=1){let f=`${s}\0${p[1]}\0${p[2]}`,a=u.get(f);(!a||l.endIndex-l.startIndex<a.endIndex-a.startIndex)&&u.set(f,l)}}m.set(e,u)}return u.get(`${r}\0${o}\0${i}`)??null}function Se(t){return t.descendantsOfType("return_statement").some(e=>{let n=e.childForFieldName("argument")??e.namedChild(0);return!!(n&&F(n).type==="object")})}function xe(t,e){let n=t.parent;for(;n;){if(/(?:function|method|lambda)/u.test(n.type)||n.type==="arrow_function"){let r=n.childForFieldName("parameters")??n.childForFieldName("parameter"),i=!1;if(r&&I(r,o=>{o.type==="identifier"&&o.text===e&&(i=!0)}),i)return n}n=n.parent}return null}function O(t,e,n,r,i){if(r.type==="identifier")return(N(t,e)??[]).filter(l=>l.name===r.text).map(l=>({...l,file:e}));let o=B(t,e,r.text);if(o.length>0)return o;if(!W(r))return[];let u=(N(t,e)??[]).filter(l=>l.startLine>=i.startPosition.row&&l.endLine<=i.endPosition.row&&(l.name===n||l.name.startsWith("source@"))).sort((l,c)=>l.endLine-l.startLine-(c.endLine-c.startLine))[0];return[u?{...u,file:e}:{name:n,file:e,startLine:i.startPosition.row,endLine:i.endPosition.row}]}function be(t,e,n){let r=ae.get(t);r||(r=new Map,ae.set(t,r));let i=`${e}\0${n}`,o=r.get(i);if(o)return o;let m=ve(t,e).flatMap(u=>Ce(t,u,e,n));return r.set(i,m),m}function Ce(t,e,n,r){let i=w(t,e)?.rootNode,o=N(t,e)??[];if(!i)return[];let m=we(t,e,n);if(m.size===0)return[];let u=new Set,l=[],c=[],p=[];return I(i,f=>{if(Ne(f,m)){if(f.type==="pair"){let a=f.childForFieldName("key")??f.namedChild(0),d=f.childForFieldName("value")??f.namedChild(1);if(k(a?.text)!==r||!d)return;if(d.type==="identifier")u.add(d.text);else if(W(d))l.push({name:r,startLine:f.startPosition.row,endLine:f.endPosition.row});else{let h=Ie(t,e,d.text),L=B(t,e,d.text);if(h.length>0)p.push(...h);else if(L.length>0)p.push(...L);else{let S=Pe(f);S&&c.push(S)}}return}f.type==="shorthand_property_identifier"&&f.text===r&&u.add(r)}}),[...o.filter(f=>u.has(f.name)).map(f=>({...f,file:e})),...l.map(f=>({...f,file:e})),...c.map(f=>({...f,file:e})),...p].filter((f,a,d)=>d.findIndex(h=>h.file===f.file&&h.name===f.name&&h.startLine===f.startLine&&h.endLine===f.endLine)===a)}function Ne(t,e){let n=t,r=null;for(;n;){if(n.type==="object"&&(r=n),n.type==="call_expression"){if(!r)return!1;let i=n.childForFieldName("function")??n.namedChild(0);return i?e.has(i.text.replace(/\.of$/u,""))&&i.text.endsWith(".of"):!1}n=n.parent}return!1}function ve(t,e){let n=te.get(t);n||(n=new Map,te.set(t,n));let r=n.get(e);if(r)return r;let i=new Set([e]),o=T(t,e).filter(u=>u.leaf==="Service"&&u.isTypeLike);for(let u of o)for(let l of Z(t,u))i.add(l.file);let m=[...i].sort();return n.set(e,m),m}function we(t,e,n){let r=new Set;M(e,n)&&r.add("Service");for(let i of A(t,e)){if(!i.sourcePath||!M(i.sourcePath,n))continue;if(i.kind==="namespace"&&i.localName){r.add(`${i.localName}.Service`);continue}(i.importedName==="default"?i.localName:i.importedName)==="Service"?r.add(i.localName??i.importedName):i.localName&&i.importedName!=="default"&&r.add(`${i.localName}.Service`)}return r}function B(t,e,n){let r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!r)return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=oe(i,r[1]),m=o?le(o):null;if(!m)return[];let u=m.childForFieldName("function")??m.namedChild(0),l=u?ce(t,e,u.text):[];if(l.length!==1)return[];let c=l[0],p=w(t,c.relativePath)?.rootNode;if(!p)return[];let s=E(p,c.startLine,c.endLine);if(!s)return[];let f=[];for(let a of s.descendantsOfType("return_statement")){let d=a.childForFieldName("argument")??a.namedChild(0);if(!d)continue;let h=F(d);if(h.type==="object")for(let L of h.namedChildren){if(L.type==="shorthand_property_identifier"&&L.text===r[2]){for(let y of N(t,c.relativePath)??[])y.name===r[2]&&f.push({...y,file:c.relativePath});continue}if(L.type!=="pair")continue;let S=L.childForFieldName("key")??L.namedChild(0),x=L.childForFieldName("value")??L.namedChild(1);if(!(k(S?.text)!==r[2]||!x))if(x.type==="identifier")for(let y of N(t,c.relativePath)??[])y.name===x.text&&f.push({...y,file:c.relativePath});else W(x)&&f.push({name:r[2],startLine:L.startPosition.row,endLine:L.endPosition.row,file:c.relativePath})}}return f.filter((a,d,h)=>h.findIndex(L=>L.file===a.file&&L.name===a.name&&L.startLine===a.startLine&&L.endLine===a.endLine)===d)}function Ie(t,e,n){let r=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n.replace(/\s+/gu,""));if(!r)return[];let i=w(t,e)?.rootNode;if(!i)return[];let o=oe(i,r[1]),m=o?le(o):null,u=m?.childForFieldName("function")??m?.namedChild(0),l=u?ce(t,e,u.text):[];if(l.length!==1||!m)return[];let c=l[0],p=w(t,c.relativePath)?.rootNode;if(!p)return[];let s=E(p,c.startLine,c.endLine);if(!s)return[];let f=new Set,a=s.childForFieldName("parameters")??s.childForFieldName("parameter");if(a&&I(a,g=>{g.type==="identifier"&&f.add(g.text)}),f.size===0)return[];let d=B(t,e,n);if(d.length===0)return[];let h=(N(t,c.relativePath)??[]).filter(g=>g.startLine>=c.startLine&&g.endLine<=c.endLine),L=(j(t,c.relativePath)??[]).filter(g=>g.line>=c.startLine&&g.line<=c.endLine),S=new Set,x=d.map(g=>({name:g.name,startLine:g.startLine,endLine:g.endLine})),y=new Set;for(;x.length>0&&y.size<32;){let g=x.shift(),v=`${g.name}\0${g.startLine}\0${g.endLine}`;if(!y.has(v)){y.add(v);for(let b of L.filter(C=>C.line>=g.startLine&&C.line<=g.endLine)){if(b.memberAccess&&b.calleeQualifier&&f.has(b.calleeQualifier)){S.add(b.calleeLeaf);continue}if(b.memberAccess)continue;let C=h.filter(de=>de.name===b.calleeLeaf);C.length===1&&x.push(C[0])}}}if(S.size===0)return[];let P=m.childForFieldName("arguments")?.namedChildren.find(g=>F(g).type==="object");if(!P)return[];let _=[];for(let g of F(P).namedChildren){if(g.type==="shorthand_property_identifier"&&S.has(g.text)){_.push(...O(t,e,g.text,g,g));continue}if(g.type!=="pair")continue;let v=g.childForFieldName("key")??g.namedChild(0),b=g.childForFieldName("value")??g.namedChild(1),C=k(v?.text);!C||!S.has(C)||!b||_.push(...O(t,e,C,b,g))}return _.filter((g,v,b)=>b.findIndex(C=>C.file===g.file&&C.name===g.name&&C.startLine===g.startLine&&C.endLine===g.endLine)===v)}function oe(t,e){for(let n of R(t,"variable_declarator"))if((n.childForFieldName("name")??n.namedChild(0))?.text===e)return n.childForFieldName("value")??n.namedChild(1);return null}function le(t){return t.type==="call_expression"?t:t.descendantsOfType("call_expression")[0]??null}function ce(t,e,n){let r=n.replace(/\s+/gu,"").replace(/<[^<>]*>$/u,""),i=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(r);if(i){let s=A(t,e).filter(d=>d.localName===i[1]&&d.sourcePath);if(s.length!==1||!s[0].sourcePath)return[];let f=s[0].sourcePath,a=D(t,f,i[2]).filter(d=>d.isFunctionLike);return a.length>0?a:(N(t,f)??[]).filter(d=>d.name===i[2]).map(d=>({...d,relativePath:f}))}if(!/^[A-Za-z_$][\w$]*$/u.test(r))return[];let o=T(t,e).filter(s=>s.leaf===r&&s.isFunctionLike);if(o.length>0)return o;let m=(N(t,e)??[]).filter(s=>s.name===r).map(s=>({...s,relativePath:e}));if(m.length>0)return m;let u=A(t,e).filter(s=>s.localName===r&&s.sourcePath&&s.kind!=="namespace");if(u.length!==1||!u[0].sourcePath)return[];let l=u[0].sourcePath,c=u[0].importedName==="default"?r:u[0].importedName,p=D(t,l,c).filter(s=>s.isFunctionLike);return p.length>0?p:(N(t,l)??[]).filter(s=>s.name===c).map(s=>({...s,relativePath:l}))}function W(t){return["arrow_function","function_expression","generator_function"].includes(t.type)||t.descendantsOfType(["arrow_function","function_expression","generator_function"]).length>0}function Pe(t){let e=t.parent;for(;e;){if(e.type==="variable_declarator"){let n=e.childForFieldName("name")??e.namedChild(0);if(n?.type==="identifier")return{name:n.text,startLine:e.startPosition.row,endLine:e.endPosition.row}}e=e.parent}return null}function k(t){return t?t.replace(/^(?:['"])(.*)(?:['"])$/u,"$1"):null}function $e(t,e,n,r){let i=/^this\.([A-Za-z_$][\w$]*)$/u.exec(n.calleeQualifier??"");if(!i)return null;let o=w(t,e)?.rootNode;if(!o)return null;let m=_e(o,n.line);if(!m)return null;let u=new Set;if(I(m,h=>{if(h.type!=="assignment_expression")return;let L=h.childForFieldName("left")??h.namedChild(0),S=h.childForFieldName("right")??h.namedChild(h.namedChildCount-1);if(L?.text.replace(/\s+/gu,"")!==`this.${i[1]}`||!S)return;let x=F(S);if(x.type!=="new_expression")return;let $=(x.childForFieldName("constructor")??x.namedChild(0))?.text.match(/[A-Za-z_$][\w$]*$/u)?.[0];$&&u.add($)}),u.size!==1)return null;let l=[...u][0],c=r.filter(h=>h.localName===l);if(c.length!==1)return null;let p=c[0].importedName==="default"?l:c[0].importedName,s=c[0].importedName==="default"?D(t,c[0].sourcePath,l):[],f=s.length===1?s[0].leaf:p,a=T(t,c[0].sourcePath).filter(h=>h.isFunctionLike&&h.leaf===n.calleeLeaf&&Y(h.symbol)===f);if(a.length!==1)return null;let d=a[0];return{calleeLeaf:n.calleeLeaf,line:n.line,sourceFile:e,targetFile:d.relativePath,targetStartLine:d.startLine,targetEndLine:d.endLine,targetSymbol:d.symbol,resolution:"constructed-member-receiver",strength:"exact"}}function _e(t,e){let n=[];return I(t,r=>{["class","class_declaration","class_definition"].includes(r.type)&&r.startPosition.row<=e&&r.endPosition.row>=e&&n.push(r)}),n.sort((r,i)=>r.endPosition.row-r.startPosition.row-(i.endPosition.row-i.startPosition.row))[0]??null}function F(t){let e=t;for(;["parenthesized_expression","as_expression","type_assertion","satisfies_expression"].includes(e.type)&&e.namedChildCount===1;)e=e.namedChild(0);return e}function I(t,e){e(t);for(let n of t.namedChildren)I(n,e)}function Fe(t){let e=new Map,n=/\b(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*([A-Za-z_$][\w$]*)\s*;/gu;for(let r of t.matchAll(n)){let i=r[1],o=r[2];i&&o&&e.set(i,o)}return e}function Q(t){let e=[];for(let n of t)e.some(r=>M(r,n))||e.push(n);return e}import{existsSync as Te}from"fs";import{SymbolRole as Me}from"@c4312/scip";import{deserializeSCIP as Ae}from"@c4312/scip";function ue(t,e){return Ae(K(t,{inputKind:e,maxBytes:G}))}var V=new WeakMap;function rt(t,e,n,r){let i=z(t,e),o=(i?.callSites??[]).filter(a=>a.line>=n&&a.line<=r);if(!i||o.length===0)return{available:!!i,targets:[],resolvedCallsites:0,unresolvedCallsites:0};let m=q(t);if(!m)return{available:!1,targets:[],resolvedCallsites:0,unresolvedCallsites:o.length};let u=(m.byFile.get(e)??[]).filter(a=>a.sourceLine>=n&&a.sourceLine<=r).map(a=>({...a,calleeLeaf:a.definition.leaf})),l=fe(o.map(a=>({line:a.line,leaf:a.calleeLeaf}))),c=fe(u.map(a=>({line:a.sourceLine,leaf:a.calleeLeaf}))),p=new Set([...l].flatMap(([a,d])=>c.get(a)===d?[a]:[])),s=u.filter(a=>p.has(me(a.sourceLine,a.calleeLeaf))),f=[...p].reduce((a,d)=>a+(l.get(d)??0),0);return{available:!0,targets:s,resolvedCallsites:f,unresolvedCallsites:Math.max(0,o.length-f)}}function it(t,e,n,r){let i=q(t);return i?{available:!0,targets:(i.byFile.get(e)??[]).filter(o=>o.sourceLine>=n&&o.sourceLine<=r)}:{available:!1,targets:[]}}function at(t,e,n,r){let i=q(t);return i?{available:!0,targets:(i.byFile.get(e)??[]).filter(o=>o.sourceLine>=n&&o.sourceLine<=r&&De(t,o.definition)).map(o=>({...o,calleeLeaf:o.definition.leaf}))}:{available:!1,targets:[]}}function q(t){if(V.has(t))return V.get(t)??null;let e=Re(t);return V.set(t,e),e}function Re(t){if(!t.generation.indexPath||!Te(t.generation.indexPath))return null;try{let e=U(t),n=new Map(e.map(o=>[o.symbol,o])),r=ue(t.generation.indexPath,"SCIP source-range call-target index"),i=new Map;for(let o of r.documents??[]){let m=o.relativePath;if(!m||t.isIgnored(m))continue;let u=[];for(let l of o.occurrences??[]){if(!l.symbol||(l.symbolRoles&Me.Definition)!==0)continue;let c=n.get(l.symbol),p=l.range?.[0];!c||!Number.isInteger(p)||u.push({sourceLine:p,definition:c})}i.set(m,u)}return{byFile:i}}catch{return null}}function De(t,e){if(!e.isFunctionLike)return!1;let n=z(t,e.relativePath);return!n||n.callables.some(r=>r.name===e.leaf&&r.startLine===e.startLine&&r.endLine===e.endLine)?!0:Oe(e)}function Oe(t){let e=t.documentation;if(!e)return!1;let n=t.leaf.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`\\bfunction\\s+${n}\\s*(?:<[^>]*>)?\\s*\\(`,"u").test(e)||new RegExp(`\\b(?:const|let|var)\\s+${n}\\s*:\\s*(?:<[^>]*>\\s*)?\\([^\\n]*\\)\\s*=>`,"u").test(e)}function fe(t){let e=new Map;for(let n of t){let r=me(n.line,n.leaf);e.set(r,(e.get(r)??0)+1)}return e}function me(t,e){return`${t}\0${e}`}export{qe as a,Ge as b,rt as c,it as d,at as e,De as f};
|
|
2
|
-
//# sourceMappingURL=chunk-TPFHAQ2G.js.map
|
package/dist/chunk-TQPCBMWT.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as te,b as N,e as V,f as j,g as E,h as re,i as se}from"./chunk-KMVGRIO2.js";import{b as _}from"./chunk-BOJ5SVE2.js";import{c as q}from"./chunk-CJZXN4NU.js";import{a as ie}from"./chunk-W7CXK74K.js";import{a as ne}from"./chunk-E73UNJTF.js";import{a as D}from"./chunk-OSSESPDX.js";import{d as I,e as K,h as $}from"./chunk-N2ZSIIGR.js";import{a as B}from"./chunk-ODDUPDP7.js";import{a as Y}from"./chunk-ZOHS7AQV.js";import{c as Q,e as ee,h as U,k as H}from"./chunk-FESCRNVV.js";import{d as z,i as J,v as A,y}from"./chunk-JWTGMPIT.js";function ve(e,n,t={}){let{minSimilarity:i=.4,limit:r=20}=t,s=ze(e,n,{semantic:t.semantic!==!1});if(!s)return[];if(!$(s.symbol))return[];if(s.callees.size===0)return ae(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"});let a=Me(e,s,i,{scanLimit:t.scanLimit,semantic:t.semantic!==!1});return a.length>0?a.slice(0,r):ae(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"})}function Mn(e,n,t,i={}){let r=D(e,n),s=D(e,t);if(!r||!s)return null;let a=ve(e,r.symbol,{minSimilarity:0,limit:Number.POSITIVE_INFINITY,semantic:i.semantic,scanLimit:i.scanLimit}).find(m=>m.symbolB===s.symbol||m.symbolA===s.symbol);if(!a)return null;let l=r.endLine-r.startLine+1,c=s.endLine-s.startLine+1;return{symbolA:{symbol:r.symbol,shortName:I(r.symbol),file:r.relativePath,loc:l},symbolB:{symbol:s.symbol,shortName:I(s.symbol),file:s.relativePath,loc:c},similarity:a.similarity,similarityBasis:a.similarityBasis??"callees",sharedEvidence:a.sharedCallees,uniqueToA:a.uniqueToA,uniqueToB:a.uniqueToB,evidenceClass:a.evidenceClass,actionTier:a.actionTier,recommendation:a.recommendation,consolidationStrategy:we(a)}}function we(e){let n=e.similarityBasis==="source-tokens"?"source-token":"tracked callee";return e.sharedCallees.length===0?`No shared ${n} evidence survived similar's weighting. Inspect the source before attempting consolidation.`:e.uniqueToA.length===0&&e.uniqueToB.length===0?`The functions have identical ${n} evidence under similar's weighting. Verify signatures, guards, and return values before consolidating.`:e.uniqueToA.length===0?`A's ${n} evidence is a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic first.`:e.uniqueToB.length===0?`B's ${n} evidence is a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic first.`:e.uniqueToA.length<=2&&e.uniqueToB.length<=2?`Create a shared helper around the ${e.sharedCallees.length} shared ${n}(s). Pass the ${e.uniqueToA.length+e.uniqueToB.length} divergent point(s) as parameters or callbacks.`:`Extract the ${e.sharedCallees.length} shared ${n}(s) into a common helper. Keep each function's unique logic outside that helper (${e.uniqueToA.length} item(s) in A, ${e.uniqueToB.length} in B).`}function Me(e,n,t,i){let r=G(e).calleeIndex({minCallees:3,scanLimit:i.scanLimit,semantic:i.semantic}),s=je(n,r.corpus),a=Oe(s,r),l=Te(s,r),c=j(l),m=E(s.callees,l),g=[];for(let f of a){if(f.callees.size<3)continue;let o=E(f.callees,l),u=ue(s,f,l,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0,medianIdf:c,magnitudeA:m,magnitudeB:o});u&&g.push(u)}return g.sort((f,o)=>o.similarity-f.similarity),g}function Te(e,n){let t=new Map(n.docFreq);for(let i of e.callees)t.set(i,(t.get(i)??0)+1);return V(t,n.corpus.length+1)}function ue(e,n,t,i){let r=Re(e,n,t,i);if(!Ae(r,i))return null;let{similarity:s,significantShared:a,trivialShared:l}=r,c=a.length>0?a:l,m=Se(c,"callees");return{symbolA:e.symbol,shortNameA:I(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:I(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:c.map(I),uniqueToA:[...N(e.callees,n.callees)].map(I),uniqueToB:[...N(n.callees,e.callees)].map(I),...m}}function Le(e,n,t,i){let r=i.magnitudeA??E(e.callees,t),s=i.magnitudeB??E(n.callees,t),a=0,l=0,c=0,m=i.medianIdf??j(t);for(let o of e.callees){if(!n.callees.has(o))continue;let u=t.get(o)??0;a+=u*u,c+=1,u>=m&&(l+=1)}if(c===0)return!1;let g=r*s;return(g>0?a/g:0)<i.minSimilarity?!1:l>=i.requireSignificantShared||c>=i.requireSharedCount}function Re(e,n,t,i){return i.magnitudeA===void 0||i.magnitudeB===void 0?re(e.callees,n.callees,t,{medianIdf:i.medianIdf}):se(e.callees,n.callees,t,{medianIdf:i.medianIdf,magnitudeA:i.magnitudeA,magnitudeB:i.magnitudeB})}function Ae(e,n){if(e.similarity<n.minSimilarity)return!1;let t=e.significantShared.length+e.trivialShared.length;return e.significantShared.length>=n.requireSignificantShared||t>=n.requireSharedCount}function Tn(e,n={}){let{minSimilarity:t=.5,limit:i=20,scope:r,minCallees:s=4,crossFileOnly:a=!1,scanLimit:l}=n,c=n.semantic!==!1,m=A(),g=0,f=0,o=0,u=0,d=0,p=0,S=0;return y("similar.all",()=>{let b=G(e).calleeIndex({minCallees:s,scope:r,scanLimit:l,semantic:c}),C=b.corpus;g=C.length;let v=n.focusFiles,k=[],P=0;return y("similar.all.pair-scan",()=>{for(let x=0;x<C.length;x+=1){let F=C[x],T=v?.has(F.file)??!1,w=b.weightedMagnitudes[x],M=new Set;for(let O of F.callees){let L=b.candidateIndexesByCallee.get(O);if(L)for(let R of L)R<=x||v&&!T&&!v.has(C[R].file)||M.add(R)}m&&(o+=M.size,M.size>0&&(f+=1));for(let O of M){let L=C[O];if(a&&F.file===L.file){m&&(d+=1);continue}if(me(F,L)){m&&(p+=1);continue}m&&(u+=1);let R=ue(F,L,b.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:b.medianIdf,magnitudeA:w,magnitudeB:b.weightedMagnitudes[O]});R&&(Be(k,R,i,P),m&&(S+=1),P+=1)}}},()=>({corpusSize:g,candidateSets:f,candidatePairs:o,comparedPairs:u,crossFileSkips:d,signatureSkips:p,insertedResults:S,topResults:k.length})),y("similar.all.sort-project",()=>(k.sort((x,F)=>F.result.similarity-x.result.similarity||x.order-F.order),k.map(x=>x.result)),()=>({topResults:k.length}))},()=>({minSimilarity:t,limit:i,scope:r,minCallees:s,crossFileOnly:a,scanLimit:l,semantic:c,corpusSize:g,candidateSets:f,candidatePairs:o,comparedPairs:u,crossFileSkips:d,signatureSkips:p,insertedResults:S}))}function Ln(e,n={}){let{minSimilarity:t=.5,scope:i,minCallees:r=4,crossFileOnly:s=!1,scanLimit:a}=n,l=n.semantic!==!1,c=A(),m=0,g=0,f=0,o=0,u=0,d=0,p=0;return y("similar.all-count",()=>{let h=G(e).calleeIndex({minCallees:r,scope:i,scanLimit:a,semantic:l}),b=h.corpus;m=b.length;let C=n.focusFiles;return y("similar.all-count.pair-scan",()=>{for(let v=0;v<b.length;v+=1){let k=b[v],P=C?.has(k.file)??!1,x=h.weightedMagnitudes[v],F=new Set;for(let T of k.callees){let w=h.candidateIndexesByCallee.get(T);if(w)for(let M of w)M<=v||C&&!P&&!C.has(b[M].file)||F.add(M)}c&&(f+=F.size,F.size>0&&(g+=1));for(let T of F){let w=b[T];if(s&&k.file===w.file){c&&(u+=1);continue}if(me(k,w)){c&&(d+=1);continue}c&&(o+=1),Le(k,w,h.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:h.medianIdf,magnitudeA:x,magnitudeB:h.weightedMagnitudes[T]})&&(p+=1)}}},()=>({corpusSize:m,candidateSets:g,candidatePairs:f,comparedPairs:o,crossFileSkips:u,signatureSkips:d,insertedResults:p})),p},()=>({minSimilarity:t,scope:i,minCallees:r,crossFileOnly:s,scanLimit:a,semantic:l,corpusSize:m,candidateSets:g,candidatePairs:f,comparedPairs:o,crossFileSkips:u,signatureSkips:d,insertedResults:p}))}function me(e,n){if(e.paramCount<0||n.paramCount<0)return!1;let t=Math.abs(e.paramCount-n.paramCount),i=Math.max(2,Math.ceil(Math.max(e.paramCount,n.paramCount)*.5));return t>i}var de=Q({kind:"source-fingerprints",invalidation:ee("source-fingerprints"),serialize:cn,deserialize:ln});function Be(e,n,t,i){if(t<=0)return;if(e.length<t){e.push({result:n,order:i});return}let r=0;for(let a=1;a<e.length;a+=1){let l=e[a],c=e[r];(l.result.similarity<c.result.similarity||l.result.similarity===c.result.similarity&&l.order>c.order)&&(r=a)}let s=e[r];n.similarity<=s.result.similarity||(e[r]={result:n,order:i})}var Ee=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function ze(e,n,t){let i=D(e,n);if(!i||!$(i.symbol))return null;let r=new q(e),s=ne(e,i,{semantic:t.semantic,semanticEvidence:ie});return{symbol:i.symbol,file:i.relativePath,callees:pe(s.map(a=>a.symbol)),paramCount:r.callableSignature(i)?.paramCount??-1}}var De=z("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),qe=z("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function fe(e,n){let{minCallees:t,scope:i,excludeSymbol:r,scanLimit:s}=n,a=n.semantic!==!1,l=De.get(e,()=>new Map),c=`${t}|${i??""}|${s??""}|${a}`,m=!0,g=0,f=0;return y("similar.callee-fingerprints.resolve",()=>{let o=l.get(c);if(m=o!==void 0,o||(o=$e(e,{minCallees:t,scope:i,scanLimit:s,semantic:a}),l.set(c,o)),g=o.length,r===void 0)return o;let u=o.filter(d=>d.symbol!==r);return f=o.length-u.length,u},()=>({minCallees:t,scope:i,scanLimit:s,semantic:a,cacheHit:m,corpusSize:g,excludeSymbol:r!==void 0,excludedSymbols:f}))}function Ne(e,n){let{minCallees:t,scope:i,scanLimit:r}=n,s=n.semantic!==!1,a=qe.get(e,()=>new Map),l=`${t}|${i??""}|${r??""}|${s}`,c=!0,m=0,g=0,f=0;return y("similar.callee-index.resolve",()=>{let o=a.get(l);return c=o!==void 0,o||(o=Pe(fe(e,{minCallees:t,scope:i,scanLimit:r,semantic:s})),a.set(l,o)),m=o.corpus.length,g=o.docFreq.size,f=o.candidateIndexesByCallee.size,o},()=>({minCallees:t,scope:i,scanLimit:r,semantic:s,cacheHit:c,corpusSize:m,indexedCallees:g,candidateBuckets:f}))}function G(e){return{calleeCorpus:n=>fe(e,n),calleeIndex:n=>Ne(e,n),sourceCorpus:(n={})=>Fe(e,n),sourceIndex:(n={})=>ce(e,n),sourceCandidates:(n,t)=>(t.candidateMode??"full")==="target-pruned"?Qe(e,n,{minSimilarity:t.minSimilarity,scanLimit:t.scanLimit}):Ye(n,ce(e,{scanLimit:t.scanLimit}))}}function Pe(e){let n=A(),t=0,i=y("similar.callee-index.doc-frequency",()=>{let o=new Map;for(let u of e)for(let d of u.callees)o.set(d,(o.get(d)??0)+1);return t=o.size,o},()=>({corpusSize:e.length,uniqueCallees:t})),r=Math.max(8,Math.ceil(Math.sqrt(e.length))),s=y("similar.callee-index.idf-weights",()=>V(i,e.length),()=>({corpusSize:e.length,uniqueCallees:i.size})),a=y("similar.callee-index.weighted-magnitudes",()=>e.map(o=>E(o.callees,s)),()=>({corpusSize:e.length})),l=0,c=0,m=0,g=y("similar.callee-index.candidate-buckets",()=>{let o=new Map;for(let u=0;u<e.length;u+=1){let d=e[u];for(let p of d.callees){if((i.get(p)??0)>r){n&&(c+=1);continue}let S=o.get(p);S||(S=[],o.set(p,S)),S.push(u),n&&(l+=1)}}return n&&(m=o.size),o},()=>({corpusSize:e.length,buckets:m,candidateRefs:l,ubiquitousSkips:c,ubiquityThreshold:r})),f=y("similar.callee-index.median-idf",()=>j(s),()=>({uniqueCallees:s.size}));return{corpus:e,candidateIndexesByCallee:g,docFreq:i,idfWeights:s,weightedMagnitudes:a,medianIdf:f,ubiquityThreshold:r}}function Oe(e,n){let t=new Map;for(let i of e.callees)for(let r of n.candidateIndexesByCallee.get(i)??[]){let s=n.corpus[r];s.symbol!==e.symbol&&t.set(s.symbol,s)}return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function $e(e,n){let{minCallees:t,scope:i,scanLimit:r,semantic:s}=n,a=A(),l=new q(e),c=0,m=y("similar.callee-fingerprints.candidates",()=>{let p=_(l.productionCallableDefinitions({scope:i,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r);return c=p.length,p},()=>({scope:i,scanLimit:r,candidateCount:c})),g=0,f=y("similar.callee-fingerprints.callee-map",()=>{let p=l.calleeMap(m,{semantic:s});if(a)for(let S of p.values())g+=S.length;return p},()=>({candidateCount:c,semantic:s,calleeEdges:g})),o=0,u=0,d=0;return y("similar.callee-fingerprints.shape",()=>{let p=m.map(b=>({symbol:b.symbol,file:b.relativePath,callees:pe((f.get(b.symbolId)??[]).map(C=>C.symbol)),paramCount:l.callableSignature(b)?.paramCount??-1})),S=_e(p);a&&(d=S.filter((b,C)=>b.callees.size!==p[C].callees.size).length);let h=S.filter(b=>b.callees.size>=t);return o=h.length,a&&(u=h.reduce((b,C)=>b+C.callees.size,0)),h},()=>({candidateCount:c,fingerprintCount:o,retainedCalleeCount:u,minCallees:t,siblingSaturatedFingerprints:d}))}var ge=5;function _e(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=new Map,n.set(t.file,i));for(let r of t.callees)i.set(r,(i.get(r)??0)+1)}return e.map(t=>{let i=n.get(t.file);if(!i)return t;let r=[...t.callees].filter(a=>(i.get(a)??0)>=ge);if(r.length===0)return t;let s=new Set(t.callees);for(let a of r)s.delete(a);return{...t,callees:s}})}function je(e,n){let t=new Map;for(let s of n)if(!(s.file!==e.file||s.symbol===e.symbol))for(let a of s.callees)t.set(a,(t.get(a)??0)+1);let i=[...e.callees].filter(s=>(t.get(s)??0)+1>=ge);if(i.length===0)return e;let r=new Set(e.callees);for(let s of i)r.delete(s);return{...e,callees:r}}function pe(e){return new Set([...e].filter(n=>!Ge(n)))}function Ge(e){return Ee.some(n=>e.includes(n))}function ae(e,n,t){let i=Ve(e,n);if(!i||i.tokens.size<3)return[];let r=t.minSimilarity>=.5?t.minSimilarity:.3,s=[],a=t.candidateMode??"full",l=0,c=0,m=0,g=0;return y("similar.source-shape",()=>{let o=G(e).sourceCandidates(i,{minSimilarity:r,scanLimit:t.scanLimit,candidateMode:a});l=o.length;for(let u of o){if(u.symbol===i.symbol||u.tokens.size<3)continue;c+=1;let d=te(i.tokens,u.tokens);if(d.size<2){m+=1;continue}let p=new Set([...i.tokens,...u.tokens]),S=p.size>0?d.size/p.size:0;if(S<r){g+=1;continue}s.push({symbolA:i.symbol,shortNameA:I(i.symbol),fileA:i.file,symbolB:u.symbol,shortNameB:I(u.symbol),fileB:u.file,similarity:S,similarityBasis:"source-tokens",sharedCallees:[...d].sort(),uniqueToA:[...N(i.tokens,u.tokens)].sort(),uniqueToB:[...N(u.tokens,i.tokens)].sort(),...Se([...d],"source-tokens")})}return s.sort((u,d)=>d.similarity-u.similarity||u.shortNameB.localeCompare(d.shortNameB)),s.slice(0,t.limit)},()=>({symbol:i.symbol,file:i.file,targetTokens:i.tokens.size,candidateMode:a,candidates:l,comparedPairs:c,sharedSkips:m,similaritySkips:g,results:s.length}))}function Se(e,n){let t=e.flatMap(W),i=e.flatMap(S=>oe(S,n)),r=Z(t,be),s=Z(t,ye),a=Z(i,X),l=[...new Set(i.filter(le))],c=e.filter(S=>{let h=oe(S,n);return h.some(b=>X.has(b))&&h.some(le)}).length,m=[];r.length>0&&m.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),s.length>0&&m.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),a.length>0&&m.push(`domain behavior verbs: ${a.slice(0,5).join(", ")}`),a.length>0&&l.length>0&&m.push(`domain-specific terms: ${l.slice(0,5).join(", ")}`);let g=n==="source-tokens"&&t.length>0&&t.every(S=>he.has(S));g&&m.push("shared source tokens are generic scaffolding");let f=a.length>0&&l.length>0,o=r.length+s.length>0,u=n==="callees"&&f&&e.length>=4&&l.length>=4&&c>=2,d=u?"domain-behavior":f?o?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":s.length>0||g?"framework-scaffolding":"structural-overlap";d==="structural-overlap"&&e.length>0&&m.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let p=d==="domain-behavior"&&(e.length>=3||u)?"direct":"signal";return{evidenceClass:d,actionTier:p,evidenceClassReasons:m,recommendation:Ue(d,p)}}function Ue(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function Z(e,n){return[...new Set(e.filter(t=>n.has(t)))]}function W(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function oe(e,n){if(n==="source-tokens")return W(e);let t=K(e);return W(t.length>0?t:He(e))}function He(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(i=>i.trim()).filter(i=>/[A-Za-z]/.test(i)).at(-1)?.replace(/\.$/,"")??e}function le(e){return e.length>3&&!X.has(e)&&!be.has(e)&&!ye.has(e)&&!he.has(e)&&!Ke.has(e)}var X=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),be=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),ye=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),he=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),Ke=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function Ve(e,n){let t=D(e,n);if(!t||!$(t.symbol))return null;let i=Ze(e,t);return i?{symbol:t.symbol,file:t.relativePath,tokens:i}:null}function Ze(e,n){let t=K(n.symbol),i=sn(e,n.relativePath,n.startLine,n.endLine,t),r=Ie(i,t);return r.size>0?r:null}var We=z("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),Xe=z("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function Ce(e){return`${e.scanLimit??""}`}function Fe(e,n={}){let t=We.get(e,()=>new Map),i=Ce(n),r=t.get(i);return r||(r=rn(e,n),t.set(i,r)),r}function ce(e,n={}){let t=Xe.get(e,()=>new Map),i=Ce(n),r=t.get(i);return r||(r=Je(Fe(e,n)),t.set(i,r)),r}function Je(e){let n=new Map;for(let r of e)for(let s of r.tokens)n.set(s,(n.get(s)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=new Map;for(let r of e)for(let s of r.tokens){if((n.get(s)??0)>t)continue;let a=i.get(s);a||(a=[],i.set(s,a)),a.push(r)}return{corpus:e,candidateByToken:i,docFreq:n,ubiquityThreshold:t}}function Ye(e,n){let t=new Map;for(let i of e.tokens)for(let r of n.candidateByToken.get(i)??[])r.symbol!==e.symbol&&t.set(r.symbol,r);return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function Qe(e,n,t){let i=A(),r=new q(e),s=en(n.tokens.size,t.minSimilarity),a=0,l=0,c=0,m=y("similar.source-shape.target-files",()=>{let d=[...n.tokens],p=[];for(let S of Y(e,{includeIgnored:!1})){a+=1;let h=U(e,S);h&&(l+=1,nn(h,d,s)&&p.push(S))}return c=p.length,p},()=>({symbol:n.symbol,targetTokens:n.tokens.size,requiredSharedTokens:s,scannedFiles:a,readableFiles:l,candidateFiles:c})),g=0,f=y("similar.source-shape.target-definitions",()=>{let d=_(r.productionCallableDefinitions({files:m,sortByLocDesc:typeof t.scanLimit=="number"&&t.scanLimit>0}),t.scanLimit);return g=d.length,d},()=>({symbol:n.symbol,candidateFiles:c,scanLimit:t.scanLimit,definitionCount:g})),o=0;return y("similar.source-shape.target-fingerprints",()=>{let d=xe(e,f);return i&&(o=d.length),d},()=>({symbol:n.symbol,definitionCount:g,fingerprintCount:o})).filter(d=>d.symbol!==n.symbol)}function en(e,n){return Math.max(2,Math.ceil(e*n))}function nn(e,n,t){if(n.length<t)return!1;let i=e.toLowerCase(),r=0;for(let s of n)if(tn(i,s)&&(r+=1,r>=t))return!0;return!1}function tn(e,n){return n==="num"?/\b\d+\b/.test(e):e.includes(n)}function rn(e,n={}){let t=new q(e),{scanLimit:i}=n,r=_(t.productionCallableDefinitions({sortByLocDesc:typeof i=="number"&&i>0}),i);return xe(e,r)}function xe(e,n){let t=new Map;for(let r of n){let s=t.get(r.relativePath)??[];s.push(r),t.set(r.relativePath,s)}let i=new Map;for(let[r,s]of t){let a=U(e,r);if(!a)continue;let l=J(e,r,a),c=on(e,r,l),m=!1,g=null;for(let f of s){let o=an(f),u=c.get(o),d=u?new Set(u.tokens):null;d||(g??=H(e,r),d=Ie(ke(g,f.startLine,f.endLine,f.leaf),f.leaf),c.set(o,{key:o,symbol:f.symbol,startLine:f.startLine,endLine:f.endLine,leaf:f.leaf,tokens:[...d].sort()}),m=!0),d.size>0&&i.set(f.symbol,{symbol:f.symbol,file:f.relativePath,tokens:d})}m&&un(e,r,l,c)}return n.map(r=>i.get(r.symbol)).filter(r=>!!r)}function sn(e,n,t,i,r){let s=H(e,n);return s.length===0?"":ke(s,t,i,r)}function ke(e,n,t,i){if(t>=n&&t-n<=12)return e.slice(n,t+1).join(`
|
|
2
|
-
`);let r=[new RegExp(`\\bdef\\s+${B(i)}\\b`),new RegExp(`\\bfun\\s+${B(i)}\\b`),new RegExp(`\\bfn\\s+${B(i)}\\b`),new RegExp(`\\bfunction\\s+${B(i)}\\b`),new RegExp(`\\b${B(i)}\\s*\\(`)],s=e.findIndex(a=>r.some(l=>l.test(a)));if(s>=0){let a=s;for(let l=s+1;l<e.length&&l<=s+8;l++){let c=e[l]??"";if(l>s&&dn(c)||(a=l,c.trim()===""&&l>s+1))break}return e.slice(s,a+1).join(`
|
|
3
|
-
`)}return e.slice(n,Math.min(e.length,n+8)).join(`
|
|
4
|
-
`)}function an(e){return`${e.symbol}\0${e.startLine}\0${e.endLine}\0${e.leaf}`}function on(e,n,t){return de.read(e,n,t)??new Map}function ln(e){try{let n=JSON.parse(e);if(!Array.isArray(n.entries))return null;let t=new Map;for(let i of n.entries){if(!i||typeof i.key!="string"||typeof i.symbol!="string"||typeof i.startLine!="number"||typeof i.endLine!="number"||typeof i.leaf!="string"||!Array.isArray(i.tokens)||!i.tokens.every(r=>typeof r=="string"))return null;t.set(i.key,i)}return t}catch{return null}}function cn(e){let n={entries:[...e.values()].sort((t,i)=>t.key.localeCompare(i.key))};return JSON.stringify(n)}function un(e,n,t,i){de.write(e,n,t,new Map(i))}function Ie(e,n){if(!e)return new Set;let t=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),i=mn(n),s=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(a=>a.trim()).filter(a=>a.length>1).filter(a=>!t.has(a)).filter(a=>!i.has(a));return new Set(s)}function mn(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function dn(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}export{ve as a,Mn as b,Te as c,ue as d,Tn as e,Ln as f,Be as g,fe as h,Ne as i,G as j,Pe as k,Oe as l,ge as m,_e as n,pe as o,Se as p};
|
|
5
|
-
//# sourceMappingURL=chunk-TQPCBMWT.js.map
|
package/dist/chunk-TQZV7KV4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var R=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function C(n){let t=n.toLowerCase();return R.some(e=>t.endsWith(e))}import{createRequire as b}from"module";var d=b(import.meta.url),c,l;function F(){if(c!==void 0)return c;try{c=d("ts-morph")}catch{c=null}return c}function j(){if(l)return l;let n=F();if(!n)return"ts-morph:unavailable";let t="unknown";try{t=d("ts-morph/package.json").version??"unknown"}catch{}return l=`ts-morph:${t}:typescript:${n.ts.version}`,l}function v(n,t){return t.map(e=>({tsconfigPath:e,project:new n.Project({tsConfigFilePath:e,skipFileDependencyResolution:!0})}))}function $(n,t,e){return{language:"typescript",availability:()=>({available:!1,reason:n,tsconfigPath:t,tsconfigPaths:e}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}function w(n,t){let e=M(n);for(let r of t.values())e.add(r);return e.finish()}function M(n){let t=new Map(n.map(r=>[r.symbol,r])),e=new Map(n.map(r=>[r.symbolId,[]]));return{add(r){for(let o of r){let a=t.get(o.targetSymbol);a&&e.get(a.symbolId).push(o.location)}},finish(){for(let[r,o]of e)e.set(r,h(o));return e}}}function D(n,t,e){let r=g(n,t),o=g(n,e),a=[...r].filter(s=>!o.has(s)).sort(),i=[...o].filter(s=>!r.has(s)).sort(),f=y(n,t),m=y(n,e),u=[...f].filter(s=>!m.has(s)).sort(),p=[...m].filter(s=>!f.has(s)).sort();return{passed:a.length===0&&i.length===0,expectedCount:r.size,actualCount:o.size,missing:a,extra:i,callerFiles:{passed:u.length===0&&p.length===0,expectedCount:f.size,actualCount:m.size,missing:u,extra:p}}}function y(n,t){let e=new Set;for(let r of n)for(let o of t.get(r.symbolId)??[])o.file!==r.relativePath&&e.add(`${r.symbol}\0${o.file}`);return e}function k(n,t,e){let r=new Set(e),o=new Map(e.map(a=>[a,[]]));for(let a of n)for(let i of t.get(a.symbolId)??[])r.has(i.file)&&o.get(i.file).push({targetSymbol:a.symbol,location:i});for(let[a,i]of o)o.set(a,x(i));return o}function g(n,t){let e=new Set;for(let r of n)for(let o of t.get(r.symbolId)??[])e.add(`${r.symbol}\0${o.file}\0${o.line}\0${o.column}`);return e}function h(n){let t=new Map;for(let e of n)t.set(`${e.file}\0${e.line}\0${e.column}`,e);return[...t.values()].sort(S)}function x(n){let t=new Map;for(let e of n){let{location:r}=e;t.set(`${e.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,e)}return[...t.values()].sort((e,r)=>e.targetSymbol.localeCompare(r.targetSymbol)||S(e.location,r.location))}function S(n,t){return n.file.localeCompare(t.file)||n.line-t.line||n.column-t.column}export{R as a,C as b,F as c,j as d,v as e,$ as f,w as g,M as h,D as i,k as j};
|
|
2
|
-
//# sourceMappingURL=chunk-TQZV7KV4.js.map
|
package/dist/chunk-TRNAEQ6P.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{M as T,P as g,R as h,S as m,T as d,U as p}from"./chunk-N5B2NILC.js";var G=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function j(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let r=e;return r.version!==1||typeof r.pid!="number"||!Number.isSafeInteger(r.pid)||r.pid<=0||typeof r.platform!="string"||!G.has(r.platform)||typeof r.startToken!="string"||r.startToken.trim()===""?null:{version:1,pid:r.pid,platform:r.platform,startToken:r.startToken}}function f(e,r){return e.version===r.version&&e.pid===r.pid&&e.platform===r.platform&&e.startToken===r.startToken}import{execFileSync as K}from"child_process";import{platform as Y}from"os";var q=1e3,x=16*1024,P;function D(e,r=F){if(!Number.isSafeInteger(e)||e<=0)return null;let t=e===process.pid&&r===F;if(t&&P)return{...P};try{let i=z(e,r);if(!i)return null;let n={version:1,pid:e,platform:r.platform,startToken:i};return t&&(P=n),{...n}}catch{return null}}function z(e,r){if(r.platform==="linux"||r.platform==="android")return H(r.readFile(`/proc/${e}/stat`));if(r.platform==="win32"){let t=`([DateTimeOffset](Get-Process -Id ${e} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return I(r.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",t]))}return r.platform==="darwin"||r.platform==="freebsd"||r.platform==="openbsd"||r.platform==="netbsd"?I(r.run("ps",["-p",String(e),"-o","lstart="])):null}function H(e){let r=e.lastIndexOf(")");if(r<0)return null;let i=e.slice(r+1).trim().split(/\s+/)[19];return i&&/^\d+$/.test(i)?i:null}function I(e){let r=e.trim();return r===""?null:r}var F={platform:Y(),readFile(e){return T(e,{maxBytes:x,inputKind:"process identity pseudo-file"})},run(e,r){return K(e,[...r],{encoding:"utf8",timeout:q,maxBuffer:x,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function De(e){try{return process.kill(e,0),!0}catch(r){return typeof r=="object"&&r!==null&&"code"in r&&r.code==="EPERM"}}function Ee(){return performance.now()}import{randomUUID as re}from"crypto";import{closeSync as te,existsSync as ne,fsyncSync as ie,linkSync as oe,mkdirSync as se,openSync as ae,renameSync as le,unlinkSync as ce,writeSync as ue}from"fs";import{dirname as E}from"path";import{chmodSync as X,constants as V,copyFileSync as Q}from"fs";import{dirname as Z}from"path";var R=Object.freeze({...h,copyFile:(e,r)=>Q(e,r,V.COPYFILE_FICLONE),chmodFile:(e,r)=>X(e,r)});function ee(e,r,t={}){let i=t.runtime??R,n=Z(r),s=m(n,i);i.copyFile(e,r),t.mode!==void 0&&i.chmodFile(r,t.mode);let o=i.openFile(r,"r");try{i.syncFile(o)}finally{i.closeFile(o)}return p(s,d(n,i))}var M=Object.freeze({platform:process.platform,randomToken:()=>re(),pathExists:e=>ne(e),makeDirectory:e=>se(e,{recursive:!0}),openFile:(e,r,t)=>ae(e,r,t),writeFile:(e,r,t,i)=>ue(e,r,t,i),syncFile:e=>ie(e),closeFile:e=>te(e),renameFile:(e,r)=>le(e,r),linkFile:(e,r)=>oe(e,r),removeFile:e=>ce(e)});function S(e,r,t={}){let i=t.durability??"visibility",n=t.runtime??M,s=E(e),o=i==="durable"?m(s,n):(n.makeDirectory(s),"not-requested"),l=`${e}.tmp-${n.randomToken()}`,u=typeof r=="string"?Buffer.from(r):r,a,c=!1;try{a=n.openFile(l,"wx",t.mode??384),c=!0,g(a,u,n,"atomic file"),i==="durable"&&n.syncFile(a),n.closeFile(a),a=void 0,n.renameFile(l,e),c=!1;let b=i==="durable"?p(o,d(s,n)):"not-requested";return A(i,b)}finally{if(a!==void 0)try{n.closeFile(a)}catch{}if(c)try{n.removeFile(l)}catch{}}}function We(e,r,t={}){let i=t.durability??"visibility",n=t.runtime??M;if(!n.linkFile)throw new Error("Exclusive atomic file publication requires hard-link support.");let s=E(e),o=i==="durable"?m(s,n):(n.makeDirectory(s),"not-requested"),l=`${e}.tmp-${n.randomToken()}`,u=typeof r=="string"?Buffer.from(r):r,a,c=!1;try{a=n.openFile(l,"wx",t.mode??384),c=!0,g(a,u,n,"exclusive atomic file"),i==="durable"&&n.syncFile(a),n.closeFile(a),a=void 0,n.linkFile(l,e);let b=i==="durable"?d(s,n):"not-requested";n.removeFile(l),c=!1;let $=i==="durable"?p(o,b,d(s,n)):"not-requested";return A(i,$)}finally{if(a!==void 0)try{n.closeFile(a)}catch{}if(c)try{n.removeFile(l)}catch{}}}function A(e,r){return{requestedDurability:e,achievedDurability:e==="visibility"?"visibility":r==="synced"?"directory-durable":"file-flushed",directorySync:r}}function je(e,r,t={}){S(e,v(r,t),{durability:"visibility",runtime:t.runtime})}function Ke(e,r,t={}){return S(e,v(r,t),{durability:"durable",runtime:t.runtime})}function v(e,r){let t=JSON.stringify(e,null,r.spacing);return r.trailingNewline?`${t}
|
|
2
|
-
`:t}import{execFileSync as O,spawnSync as ze}from"child_process";import{platform as de}from"os";import{resolve as me}from"path";var k=de()==="win32";function Ve(e){let r=k?"where":"which";try{return O(r,[e],{stdio:"pipe",timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}var pe=/\.(?:c|m)?js$/i,fe=/\.(?:exe|com)$/i;function Qe(e,r){return pe.test(e)?{binary:process.execPath,args:[e,...r]}:{binary:e,args:[...r]}}function ye(e,r){return O(e,r,{stdio:["ignore","pipe","ignore"],encoding:"utf8",timeout:1e4,killSignal:"SIGKILL"})}function Ze(e,r={}){let t=r.isWindows??k,i=r.lookup??ye,n;try{n=i(t?"where":"which",[e])}catch{return null}let s=n.split(/\r?\n/).map(o=>o.trim()).filter(Boolean);if(!t){let o=s[0];return o?me(o):null}return s.find(o=>fe.test(o))??null}import{execFileSync as C}from"child_process";import{platform as be}from"os";var L=1e3,B=2*1024*1024,ge=25;function ir(e,r,t=U){let i=t.readIdentity(e),n=new Map;return i&&n.set(e,i),{rootPid:e,rootIdentity:i,ownsProcessGroup:r,knownMembers:n}}async function or(e,r,t=U){if(!e.rootIdentity){let u=await y(e,r.gracefulMs+r.forceMs,t);return{reaped:u,reason:u?"terminated":"identity-unavailable",detail:u?void 0:`Could not establish the birth identity of process ${e.rootPid}.`}}let i=W(e,t);if(i==="mismatch")return{reaped:!1,reason:"identity-mismatch",detail:`Process ${e.rootPid} no longer has the identity owned by this runner.`};if(i==="exited"&&!J(e,t))return{reaped:!0,reason:"terminated"};if(t.platform==="win32"){try{t.terminateWindowsTree(e.rootPid)}catch(a){let c=await y(e,r.forceMs,t);return{reaped:c,reason:c?"terminated":"signal-failed",detail:c?void 0:w(a)}}let u=await y(e,r.forceMs,t);return{reaped:u,reason:u?"terminated":"deadline"}}let n=N(e,"SIGTERM",t);if(await y(e,r.gracefulMs,t))return{reaped:!0,reason:"terminated"};let o=N(e,"SIGKILL",t);return await y(e,r.forceMs,t)?{reaped:!0,reason:"terminated"}:o?{reaped:!1,reason:o.reason,detail:o.detail}:n?{reaped:!1,reason:n.reason,detail:n.detail}:{reaped:!1,reason:"deadline",detail:`Process tree ${e.rootPid} did not exit before its termination deadline.`}}function W(e,r){let t=r.readIdentity(e.rootPid);if(!t)return"exited";if(!e.rootIdentity||!f(e.rootIdentity,t))return"mismatch";e.knownMembers.set(e.rootPid,t);for(let i of r.listDescendantPids(e.rootPid)){let n=r.readIdentity(i);n&&e.knownMembers.set(i,n)}return"owned"}function N(e,r,t){let i=W(e,t);if(i==="mismatch")return{reason:"identity-mismatch",detail:`Process ${e.rootPid} changed identity before ${r}.`};if(i==="owned"&&e.ownsProcessGroup)try{return t.signal(-e.rootPid,r),null}catch(s){if(!_(s))return{reason:"signal-failed",detail:w(s)}}let n=null;for(let s of e.knownMembers.values()){let o=t.readIdentity(s.pid);if(!(!o||!f(s,o)))try{t.signal(s.pid,r)}catch(l){!_(l)&&n===null&&(n=w(l))}}return n===null?null:{reason:"signal-failed",detail:n}}async function y(e,r,t){let i=t.now()+r;for(;J(e,t);){if(t.now()>=i)return!1;await t.sleep(Math.min(ge,Math.max(1,i-t.now())))}return!0}function J(e,r){if(!e.rootIdentity&&r.isProcessAlive(e.rootPid))return!0;for(let t of e.knownMembers.values()){let i=r.readIdentity(t.pid);if(i&&f(t,i))return!0}return!!(e.ownsProcessGroup&&r.isProcessGroupAlive(e.rootPid))}function Pe(e){let r=Se(!1),t=new Map;for(let o of r.split(/\r?\n/)){let l=/^\s*(\d+)\s+(\d+)\s*$/.exec(o);if(!l)continue;let u=Number(l[1]),a=Number(l[2]),c=t.get(a)??[];c.push(u),t.set(a,c)}let i=[],n=[...t.get(e)??[]],s=new Set;for(;n.length>0;){let o=n.pop();s.has(o)||(s.add(o),i.push(o),n.push(...t.get(o)??[]))}return i}function Se(e){return C("ps",["-axo",e?"pid=,ppid=,rss=":"pid=,ppid="],{encoding:"utf8",timeout:L,maxBuffer:B,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}function _(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ESRCH"}function w(e){return e instanceof Error?e.message:String(e)}var U={platform:be(),now:Date.now,readIdentity:D,isProcessAlive(e){try{return process.kill(e,0),!0}catch(r){return typeof r=="object"&&r!==null&&"code"in r&&r.code==="EPERM"}},isProcessGroupAlive(e){if(this.platform==="win32")return!1;try{return process.kill(-e,0),!0}catch(r){return typeof r=="object"&&r!==null&&"code"in r&&r.code==="EPERM"}},listDescendantPids(e){if(this.platform==="win32")return[];try{return Pe(e)}catch{return[]}},signal(e,r){process.kill(e,r)},terminateWindowsTree(e){C("taskkill.exe",["/PID",String(e),"/T","/F"],{timeout:L,maxBuffer:B,stdio:"ignore",windowsHide:!0})},async sleep(e){await new Promise(r=>setTimeout(r,e))}};export{j as a,f as b,D as c,De as d,Ee as e,ee as f,S as g,We as h,je as i,Ke as j,Ve as k,Qe as l,Ze as m,ir as n,or as o};
|
|
3
|
-
//# sourceMappingURL=chunk-TRNAEQ6P.js.map
|
package/dist/chunk-TY7CRN3Z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as Q,m as X,v as P,x as I}from"./chunk-IZDPJ2QI.js";import{a as L,b as G,d as R}from"./chunk-GUFSG5TX.js";import{a as d,f as w,g as B,h as p}from"./chunk-H5EXS3HM.js";import{G as H,H as W,T as Y,ba as J,c as O,da as K,e as q,ga as z,r as U}from"./chunk-KYSDI3GE.js";import{a as V,g as F,h as S}from"./chunk-7F45LJKI.js";import{existsSync as Re}from"fs";import{randomUUID as ze}from"crypto";import{isAbsolute as Xe,join as Pe,relative as Ze,resolve as et}from"path";var f=1,m=2,ue="./node_modules/scip-query/docs/schemas/project-config.schema.json";function Z(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(c){return{kind:"malformed",reason:`invalid JSON: ${c instanceof Error?c.message:String(c)}`}}if(!d(t))return{kind:"malformed",reason:"project config must be a JSON object"};let n=t.schemaVersion;if(n!==void 0&&!Number.isInteger(n))return{kind:"malformed",reason:"schemaVersion must be an integer"};let r=n===void 0?f:n;if(r!==f&&r!==m)return{kind:"unsupported",schemaVersion:r,direction:r<f?"older":"future"};let s=t.$schema;if(s!==void 0&&(typeof s!="string"||s.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let i=ee(t),a=r!==m||typeof t.$schema!="string";return r===f?{kind:"legacy",sourceVersion:f,config:i,needsMigration:a}:{kind:"supported",sourceVersion:m,config:i,needsMigration:a}}function ee(e){let t=e,{$schema:n,schemaVersion:r,...s}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:ue,schemaVersion:m,...s}}import{createHash as pe}from"crypto";var k=1,te=2,ne=1,_=1,E="sha256";function Be(e,t,n){if(!p(e)||!w(t))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:ne,canonicalizationVersion:_,hashAlgorithm:E,projection:{name:e,version:t},digest:pe(E).update(le(e,t,n)).digest("hex")}}function le(e,t,n){return`{"canonicalizationVersion":${_},"projection":${JSON.stringify(e)},"projectionVersion":${t},"value":${JSON.stringify(n)}}`}function fe(e){if(!d(e))return{kind:"malformed",reason:"observation receipt must be an object"};let t=e.schemaVersion;if(!Number.isInteger(t))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(t===k)return ge(e)?{kind:"legacy",schemaVersion:k,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(t===te)return he(e)?{kind:"supported",schemaVersion:te,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let n=t;return{kind:"unsupported",schemaVersion:n,direction:n<k?"older":"future"}}function re(e){let t=fe(e);return t.kind==="legacy"||t.kind==="supported"}function me(e,t){return e.schemaVersion===t.schemaVersion&&e.canonicalizationVersion===t.canonicalizationVersion&&e.hashAlgorithm===t.hashAlgorithm&&e.projection.name===t.projection.name&&e.projection.version===t.projection.version}function ge(e){if(!d(e))return!1;let t=e.index,n=e.worktree;return oe(e.observedAt)&&p(e.projectIdentity)&&Oe(e.authorityKind)&&(t===void 0||d(t)&&p(t.generationIdentity)&&(t.source==="immutable"||t.source==="legacy")&&(t.alignment==="not-certified"||t.alignment==="leased"))&&(n===void 0||d(n)&&p(n.identity)&&typeof n.clean=="boolean"&&(n.headCommit===void 0||p(n.headCommit))&&(n.treeOid===void 0||p(n.treeOid)))&&Se(e.authorityKind,t,n)}function he(e){if(!d(e))return!1;let t=e.facts,n=e.observedSources,r=e.stabilityProofs;if(!oe(e.observedAt)||!d(t)||!Array.isArray(n)||n.length===0||!n.every(be)||!A(n,o=>o.kind)||!Array.isArray(r)||!r.every(ve)||!A(r,o=>o.source)||r.some(o=>!n.some(u=>u.kind===o.source))||!r.every(o=>xe(o,t))||["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(o=>t[o]!==void 0&&!l(t[o])))return!1;let i=t.relevantInputs;if(i!==void 0&&(!Array.isArray(i)||!i.every(ye)||!A(i,o=>`${o.subject}\0${o.identity.projection.name}`)))return!1;let a=t.index;if(a!==void 0&&(!d(a)||!l(a.generation)||a.inputs!==void 0&&!l(a.inputs)||a.source!=="immutable"&&a.source!=="legacy"))return!1;let c=e.diagnostics;return(c===void 0||d(c)&&(c.clean===void 0||typeof c.clean=="boolean")&&(c.headCommit===void 0||p(c.headCommit))&&(c.treeOid===void 0||p(c.treeOid)))&&Ce(t,n)}function l(e){return!d(e)||!d(e.projection)?!1:e.schemaVersion===ne&&e.canonicalizationVersion===_&&e.hashAlgorithm===E&&p(e.projection.name)&&w(e.projection.version)&&B(e.digest)}function ye(e){return d(e)&&p(e.subject)&&l(e.identity)}function be(e){return d(e)&&ie(e.kind)&&(e.identity===void 0||l(e.identity))}function ve(e){return d(e)&&ie(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Ce(e,t){let n=e.index,r=t.find(o=>o.kind==="index-generation");if(r){if(!d(n)||!l(n.generation)||r.identity&&!j(r.identity,n.generation))return!1}else if(n!==void 0)return!1;let s=e.workspaceInstance,i=t.find(o=>o.kind==="live-workspace");if(i?.identity&&(!l(s)||!j(i.identity,s)))return!1;let a=e.wholeContent,c=t.find(o=>o.kind==="repository-snapshot");return!(c?.identity&&(!l(a)||!j(c.identity,a)))}function xe(e,t){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&d(t.index)&&t.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function j(e,t){return me(e,t)&&e.digest===t.digest}function Se(e,t,n){return e==="index-worktree"?t!==void 0&&n!==void 0:e==="index-only"?t!==void 0&&n===void 0:e==="worktree-only"?t===void 0&&n!==void 0:e==="process-local"&&t===void 0&&n===void 0}function Oe(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function ie(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function oe(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function A(e,t){return new Set(e.map(t)).size===e.length}function He(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.kind==="automated-adjudication"&&t.policyVersion===1&&(t.decidedBy==="agent"||t.decidedBy==="human")&&G.includes(t.reasonCode)&&Array.isArray(t.evidence)&&t.evidence.length>0&&t.evidence.every(we)&&(t.observation===void 0||re(t.observation))&&!!t.invalidateOn&&typeof t.invalidateOn=="object"&&typeof t.invalidateOn.targetContentChange=="boolean"&&typeof t.invalidateOn.detectorMajorChange=="boolean"}function we(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return(t.kind==="source"||t.kind==="config"||t.kind==="test"||t.kind==="graph")&&typeof t.referent=="string"&&t.referent.trim()!==""&&typeof t.claim=="string"&&t.claim.trim()!==""&&(t.contentHash===void 0||/^[a-f0-9]{64}$/u.test(t.contentHash))&&(t.generation===void 0||typeof t.generation=="string"&&t.generation.length>0)}var h=".scipquery.json",Ie=2e3,se=5e3,ae=se,ke=15*6e4,ce={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},je={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:Ie,cooldownMs:ae,gitPollMs:2e3,idleTimeoutMs:ke,autoRefresh:!0,ignore:[],resourceBudget:ce};var it=new Set(L);function ot(e){let t=Pe(e,h);if(!Re(t))return{};let n;try{n=F(t,{maxBytes:V,inputKind:"scip-query project config"})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${h} at ${t}: ${s}`,{cause:r})}return Ae(Z(n),t,"read").config}function st(e){return{...je,...e.watch,cooldownMs:Math.max(se,e.watch?.cooldownMs??ae),resourceBudget:{...ce,...e.watch?.resourceBudget}}}function Ae(e,t,n){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let s=n==="read"?`invalid ${h} at ${t}: ${e.reason}`:`Cannot update ${t}: the latest project config is ${e.reason}.`;throw new Error(`${s} The file was left untouched.`)}let r=n==="read"?`invalid ${h} at ${t}`:`Cannot update ${t}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${f} and current v${m}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as y,lstatSync as Ee}from"fs";import{resolve as _e}from"path";function xt(e,t,n,r={}){let s=new Date().toISOString();if(!y(n.dbPath))return{state:"missing",checkedAt:s,metaPath:n.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(n.metaPath))return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let i=R(S(n.metaPath,"reindex metadata"));if(i.kind==="unsupported")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Reindex metadata version ${i.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(i.kind==="malformed")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not decode reindex metadata: ${i.reason}`,remedy:"Run: scip-query reindex"};let a=i.metadata,c=t.languages??Q(e),o=a.fingerprint,u=n.cacheDir&&r.gitContext&&I(r.gitContext,n.cacheDir,o)?o:void 0,g=n.cacheDir&&r.gitContext&&u&&Ne(u,c,t)&&Te(e,u,t)?r.gitObservation?.context===r.gitContext?r.gitContext:H(r.gitContext):void 0,de=r.gitObservation&&r.gitObservation.context===r.gitContext?r.gitObservation.projectFileInventorySequence:void 0,M=g?.clean&&W(e,void 0,{cachedInventoryAfterSequence:de})?g:void 0,b=n.cacheDir&&M&&u&&I(M,n.cacheDir,u)?u:Me(e,c,t),N=[...a.indexedLanguages??[]].sort(),v=i.capabilities.publishableGeneration&&q(O(a.fingerprint),b)&&JSON.stringify(N)===JSON.stringify(b.languages),C=P(n.dbPath,n.metaPath),T=C.state==="invalid"||C.state==="drifted",x=v?X(n.dbPath,b,N):void 0,$=x?.state==="incomplete",D=v&&!T&&!$;return{state:D?"fresh":"stale",checkedAt:s,metaPath:n.metaPath,updatedAt:a.updatedAt,lastRefresh:a.lastRefresh,reason:T?`SQLite generation requires repair: ${C.reason}`:$?`SQLite generation is missing ${x.missingDocumentCount} indexed source document(s): ${x.missingPaths.join(", ")}`:v?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:D?void 0:"Run: scip-query reindex"}}catch(i){return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not read reindex metadata: ${i instanceof Error?i.message:String(i)}`,remedy:"Run: scip-query reindex"}}}function St(e){let t=new Date().toISOString();if(!y(e.dbPath))return{state:"missing",checkedAt:t,metaPath:e.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(e.metaPath))return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let n=R(S(e.metaPath,"reindex metadata"));if(n.kind==="unsupported")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Reindex metadata version ${n.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(n.kind==="malformed")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not decode reindex metadata: ${n.reason}`,remedy:"Run: scip-query reindex"};let r=n.metadata,s=[...r.indexedLanguages??[]].sort(),i=O(r.fingerprint),a=[...i?.languages??[]].sort(),c=n.capabilities.publishableGeneration&&i!==null&&JSON.stringify(s)===JSON.stringify(a),o=P(e.dbPath,e.metaPath),u=o.state==="invalid"||o.state==="drifted",g=c&&!u;return{state:g?"fresh":"stale",checkedAt:t,metaPath:e.metaPath,updatedAt:r.updatedAt,lastRefresh:r.lastRefresh,reason:u?`SQLite generation requires repair: ${o.reason}`:c?"Watcher accepted the newly published index generation with no later changes pending.":"Published index metadata is not a complete queryable generation.",remedy:g?void 0:"Run: scip-query reindex"}}catch(n){return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not read reindex metadata: ${n instanceof Error?n.message:String(n)}`,remedy:"Run: scip-query reindex"}}}function Me(e,t,n){return K(e,t,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath})}function Ne(e,t,n){let r=$e(t,n);return e.version===r.version&&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 Te(e,t,n){if(!(t.languages.includes("typescript")||!!t.clojureConfigPath))return!0;let s=J(e);if(t.clojureConfigPath){let i=U(t.clojureConfigPath);if(!s.includes(i))return!1;try{if(!Ee(_e(e,i)).isFile())return!1}catch{return!1}}return!t.languages.includes("typescript")||Y(e,n.indexer?.typescript?.projectMode,n.indexer?.typescript?.projects??[],s)}function $e(e,t){return z(e,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath})}export{te as a,Be as b,He as c,ot as d,st as e,xt as f,St as g};
|
|
2
|
-
//# sourceMappingURL=chunk-TY7CRN3Z.js.map
|
package/dist/chunk-UHFYCMZO.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{a as g}from"./chunk-BRV7PIFF.js";import{g as p}from"./chunk-NWQXSFFU.js";import{a as f}from"./chunk-OSSESPDX.js";import{d as u,e as _,i as N}from"./chunk-N2ZSIIGR.js";import{y as d}from"./chunk-ODDUPDP7.js";import{a as I,z as l}from"./chunk-ZOHS7AQV.js";import{h as b}from"./chunk-FESCRNVV.js";import{c}from"./chunk-N5B2NILC.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d ON c.document_id = d.id
|
|
5
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
WHERE gs.symbol LIKE ?
|
|
7
|
-
AND m.role = 2
|
|
8
|
-
ORDER BY d.relative_path`,`%${t}%`).filter(s=>!e.isIgnored(s.importer)).map(s=>({symbol:s.symbol,shortName:u(s.symbol),fromFile:s.importer}))}function k(e,t,r=f(e,t)){let s=r?.relativePath??null,o=r?_(r.symbol):t.replace(/\(\)$/,""),n=r?N(r.symbol):!1,i=new Set;for(let a of I(e,{includeIgnored:!1}))for(let F of d(e,a))M(F,a,{targetFile:s,targetLeaf:o,targetIsModule:n,targetPattern:t})&&i.add(a);let m=h(t)?t.trim():null;return[...i].sort().map(a=>({symbol:m??r?.symbol??o,shortName:m??(r?u(r.symbol):o),fromFile:a}))}function x(e){return!!(e&&(e.symbol.startsWith("scip-clojure ")||l(e.relativePath)==="clojure"))}function D(e){let t=new Set,r=[];for(let s of e){let o=`${s.symbol}|${s.fromFile}`;t.has(o)||(t.add(o),r.push(s))}return r.sort((s,o)=>s.fromFile.localeCompare(o.fromFile)||s.shortName.localeCompare(o.shortName))}function M(e,t,r){return!e.sourcePath||r.targetFile&&c(e.sourcePath)!==c(r.targetFile)?!1:e.kind==="side-effect"||r.targetFile&&$(t)||e.kind==="namespace"&&P(e,r.targetPattern)||r.targetIsModule||e.kind==="named"&&e.importedName===r.targetLeaf?!0:e.kind==="namespace"&&e.usedMembers.includes(r.targetLeaf)}function P(e,t){let r=t.trim().replace(/\(\)$/,"");return h(r)?e.importedName===r||e.localName===r:!1}function h(e){let t=e.trim().replace(/\(\)$/,"");return t.includes(".")&&!t.includes("/")&&!t.includes(":")}function T(e,t,r={}){let s=g(e,t);return s?L(e,s,r)??(r.semantic===!1?null:E(e,s))??S(e,s):null}function L(e,t,r){let o=e.all(`SELECT DISTINCT
|
|
9
|
-
gs.symbol,
|
|
10
|
-
def_d.relative_path AS from_file,
|
|
11
|
-
imp_d.relative_path AS importer,
|
|
12
|
-
EXISTS (
|
|
13
|
-
SELECT 1
|
|
14
|
-
FROM mentions ref_m
|
|
15
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
16
|
-
WHERE ref_m.symbol_id = gs.id
|
|
17
|
-
AND ref_m.role != 1
|
|
18
|
-
AND ref_c.document_id = imp_d.id
|
|
19
|
-
) AS used
|
|
20
|
-
FROM mentions m
|
|
21
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
22
|
-
JOIN documents imp_d ON c.document_id = imp_d.id
|
|
23
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
24
|
-
LEFT JOIN (
|
|
25
|
-
SELECT m2.symbol_id, c2.document_id
|
|
26
|
-
FROM mentions m2
|
|
27
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
28
|
-
WHERE m2.role = 1
|
|
29
|
-
GROUP BY m2.symbol_id
|
|
30
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
31
|
-
LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
32
|
-
WHERE imp_d.relative_path = ?
|
|
33
|
-
AND m.role = 2
|
|
34
|
-
ORDER BY def_d.relative_path, gs.symbol`,t).filter(n=>!e.isIgnored(n.importer));if(o.length>0){let n=r.semantic===!1?[]:p(e,t);return o.map(i=>({symbol:i.symbol,shortName:u(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||n.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function E(e,t){let r=p(e,t);return r.length>0?r.map(s=>{let o=y(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function S(e,t){let r=A(t,b(e,t));return d(e,t).map(s=>{let o=y(s.importedName,s.localName,s.kind),n=s.kind==="side-effect"||v(t,s)||r.has(s.localName??s.importedName)?!0:s.used;return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:n}})}function A(e,t){let r=new Set;if(l(e)!=="python")return r;let s=/(?:^|\n)\s*__all__\s*(?:\+?=)\s*[[(]([\s\S]*?)[\])]/g;for(let o of t.matchAll(s)){let n=o[1]??"";for(let i of n.matchAll(/(['"])([A-Za-z_]\w*)\1/g))r.add(i[2])}return r}function v(e,t){if(l(e)!=="rust"||t.used||t.kind==="side-effect")return!1;let r=t.localName??t.importedName;return r==="_"||/^[A-Z]/.test(r)}function y(e,t,r){return r==="namespace"&&e==="*"&&t?`* as ${t}`:r==="default"&&t?`default as ${t}`:r==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function $(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{Y as a,Z as b,G as c};
|
|
35
|
-
//# sourceMappingURL=chunk-UHFYCMZO.js.map
|
package/dist/chunk-UICY4GTQ.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{b as k}from"./chunk-EVFUMY4R.js";import{c as D}from"./chunk-CJZXN4NU.js";import{m as S}from"./chunk-DYGHBZ2N.js";import{f as v,h as L}from"./chunk-XRYABF57.js";import{d as h,t as y}from"./chunk-N2ZSIIGR.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(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 s=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 s?y(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=y(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
|
|
7
|
-
//# sourceMappingURL=chunk-UICY4GTQ.js.map
|
package/dist/chunk-UVGEWT4Y.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-W7CXK74K.js";import{b as l}from"./chunk-E73UNJTF.js";import{d as r,u as m}from"./chunk-N2ZSIIGR.js";function u(o,t={}){let{limit:i=30,scope:e}=t,n=e?"AND def_d.relative_path LIKE ?":"",f=e?[`%${e}%`]:[],c=o.all(`SELECT
|
|
2
|
-
gs.symbol,
|
|
3
|
-
COUNT(*) AS ref_count,
|
|
4
|
-
COUNT(DISTINCT ref_d.id) AS file_count,
|
|
5
|
-
def_d.relative_path AS defined_in
|
|
6
|
-
FROM mentions m
|
|
7
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
8
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
9
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
10
|
-
JOIN (
|
|
11
|
-
SELECT m2.symbol_id, c2.document_id
|
|
12
|
-
FROM mentions m2
|
|
13
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
14
|
-
WHERE m2.role = 1
|
|
15
|
-
GROUP BY m2.symbol_id
|
|
16
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
17
|
-
JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
18
|
-
WHERE m.role != 1
|
|
19
|
-
AND def_d.id != ref_d.id
|
|
20
|
-
${o.pathExclusionsFor("def_d")}
|
|
21
|
-
${o.symbolNoiseFor("gs")}
|
|
22
|
-
${n}
|
|
23
|
-
GROUP BY gs.id
|
|
24
|
-
ORDER BY ref_count DESC
|
|
25
|
-
LIMIT ?`,...f,i).filter(s=>!o.isIgnored(s.defined_in)).map(s=>({symbol:s.symbol,shortName:r(s.symbol),refCount:s.ref_count,fileCount:s.file_count,definedIn:s.defined_in,basis:"scip-cross-file-mentions",countUnit:"reference-occurrences"}));return c.length>0?c:a(o,e,i)}function C(o,t={}){return u(o,t)}function a(o,t,i){return m(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>p(o,e)).filter(e=>e.refCount>0).sort((e,n)=>n.refCount-e.refCount||n.fileCount-e.fileCount).slice(0,i)}function p(o,t){let e=l(o,t,{limit:500,semanticEvidence:d}).filter(n=>n.file!==t.relativePath);return{symbol:t.symbol,shortName:r(t.symbol),refCount:e.length,fileCount:new Set(e.map(n=>n.file)).size,definedIn:t.relativePath,basis:"source-backed-incoming-evidence",countUnit:"distinct-incoming-evidence-rows"}}export{u as a,C as b};
|
|
26
|
-
//# sourceMappingURL=chunk-UVGEWT4Y.js.map
|
package/dist/chunk-UXW33INU.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import{b as a}from"./chunk-EKV5HX33.js";import{e as l}from"./chunk-2WC2OEDO.js";import{c as o,f as i}from"./chunk-DRENNWRG.js";function _(e,t){let r=a(e,t);return r.length===0?[]:u([...c(e,r),...f(e,r)]).filter(s=>!e.isIgnored(s.relative_path)).map(d)}function R(e,t){let r=a(e,t);return r.length===0?[]:u(c(e,r)).filter(s=>!e.isIgnored(s.relative_path)).map(s=>({...d(s),basis:"external-reference"}))}function c(e,t){let r=t.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
5
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
WHERE d1.relative_path NOT IN (${r})
|
|
7
|
-
AND (
|
|
8
|
-
EXISTS (
|
|
9
|
-
SELECT 1
|
|
10
|
-
FROM defn_enclosing_ranges der
|
|
11
|
-
JOIN documents d2 ON der.document_id = d2.id
|
|
12
|
-
WHERE der.symbol_id = gs.id
|
|
13
|
-
AND d2.relative_path IN (${r})
|
|
14
|
-
)
|
|
15
|
-
OR EXISTS (
|
|
16
|
-
SELECT 1
|
|
17
|
-
FROM mentions def_m
|
|
18
|
-
JOIN chunks def_c ON def_m.chunk_id = def_c.id
|
|
19
|
-
JOIN documents d2 ON def_c.document_id = d2.id
|
|
20
|
-
WHERE def_m.symbol_id = gs.id
|
|
21
|
-
AND def_m.role = 1
|
|
22
|
-
AND d2.relative_path IN (${r})
|
|
23
|
-
)
|
|
24
|
-
)
|
|
25
|
-
AND m.role != 1
|
|
26
|
-
AND ${e.localSymbolPredicate}
|
|
27
|
-
${e.pathExclusionsFor("d1")}
|
|
28
|
-
ORDER BY d1.relative_path`,...t,...t,...t)}function f(e,t){let r=new l(e);return t.flatMap(s=>r.definitionsForFile(s).filter(n=>i(n.symbol)).map(n=>({relative_path:s,symbol:n.symbol})))}function u(e){let t=new Set;return e.filter(r=>{let s=`${r.relative_path}|${r.symbol}`;return t.has(s)?!1:(t.add(s),!0)})}function d(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:o(e.symbol)}}export{_ as a,R as b};
|
|
29
|
-
//# sourceMappingURL=chunk-UXW33INU.js.map
|
package/dist/chunk-VMPRET3I.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{b as L}from"./chunk-3SVF22I5.js";import{d as S}from"./chunk-OR2E3AGZ.js";import{a as h,b as T}from"./chunk-NJITK2GP.js";import{a as C}from"./chunk-DHEQMPLW.js";import{A as I,d as f,i as w,t as F}from"./chunk-N2ZSIIGR.js";import{n as v}from"./chunk-ODDUPDP7.js";import{J as x}from"./chunk-ZOHS7AQV.js";import{j as g}from"./chunk-FESCRNVV.js";function z(e,t,n){let r=[],o=[],s=new Map;for(let i of[...e].sort(n)){let l=i.channel??"default",d=t[l]??Number.MAX_SAFE_INTEGER,a=s.get(l)??0;if(a>=d){o.push(i);continue}r.push(i),s.set(l,a+1)}return{selected:r,omitted:o}}function k(e,t,n,r,o=!1){let s=[...e],i=[],l=new Set,d=0;for(;s.length>0&&i.length<t;){let a=s.filter(u=>d+u.evidenceCharacters<=n||o&&i.length===0);if(a.length===0)break;let c=a.filter(u=>u.roles.includes("location")||u.roles.includes("definition")).sort(r);a.sort((u,p)=>R(p,l)-R(u,l)||r(u,p));let m=c[0]??a[0];i.push(m),d+=m.evidenceCharacters;for(let u of P(m))l.add(u.key);s.splice(s.indexOf(m),1)}return{selected:i,omitted:s.sort(r)}}function R(e,t){let n=P(e).reduce((s,i)=>s+(t.has(i.key)?0:i.weight),0),r=Math.max(0,8-e.priority)*20,o=Math.min(500,Math.ceil(e.evidenceCharacters/160));return n+r-o}function P(e){return[...e.reasons.map(K),...e.roles.map(t=>({key:`role:${t}`,weight:$(t)})),{key:`file:${e.relativePath}`,weight:180},{key:`scope:${A(e.relativePath)}`,weight:120},{key:`kind:${e.fileKind}`,weight:40},...e.symbols.map(t=>({key:`symbol:${t}`,weight:100})),...e.behaviorSignals.map(t=>({key:`behavior:${t}`,weight:70}))]}function K(e){let t=e.indexOf(":"),n=t<0?e:e.slice(0,t);return n==="dependency"||n==="consumer"?{key:`reason:${n}`,weight:220}:{key:`reason:${e}`,weight:n==="location"||n==="definition"?1400:800}}function $(e){switch(e){case"location":return 1200;case"definition":return 1100;case"reference":return 600;case"caller":case"callee":return 550;case"dependency":case"consumer":return 500;case"search":return 400;default:return 300}}function A(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(0,t)}var E=64,M=12;function te(e,t,n={}){if(t.length===0)return[];let r=n.context??6;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`context must be a non-negative safe integer; received ${r}`);let o=n.limit??12;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`limit must be a positive safe integer; received ${o}`);let s=t.map(i=>{if(i.length===0)throw new Error("The source search pattern must not be empty.");return{pattern:i,regexp:n.regexp?C(i,"source search pattern",n.ignoreCase?"iu":"u"):null,literal:n.ignoreCase?i.toLocaleLowerCase():i,identities:[],fileCoverage:[],textByPath:new Map}});if(!n.regexp&&!n.ignoreCase){let i=s.map(d=>Buffer.from(d.pattern,"utf8")),l=S(e,{scope:n.scope,literalBytes:i.length===1?i[0]:i},(d,a)=>{let c=g(d.text);if(c.length!==0)for(let m of a){let u=s[m];u&&_(e,u,d,c,n)}});return s.map(d=>B(d,l,r,o,n))}return s.map(i=>{let l=S(e,{scope:n.scope},d=>{let a=g(d.text);a.length>0&&_(e,i,d,a,n)});return B(i,l,r,o,n)})}function _(e,t,n,r,o){let s=[];for(let a=0;a<r.length;a+=1){let c=r[a]??"",m=c.endsWith("\r")?c.slice(0,-1):c;(t.regexp?t.regexp.test(m):(o.ignoreCase?m.toLocaleLowerCase():m).includes(t.literal))&&s.push(a)}if(s.length===0)return;let i=n.relativePath;t.textByPath.set(i,n.text);let l=n.freshness.semantic.state!=="stale"&&n.freshness.semantic.basis!=="no-compiler-document"?F(e,i):[],d=v(e,i)?.callables??[];for(let a of s){let c=I(l,a),m=x(d,a),u=c&&!w(c.symbol)?c:null,p=u?.startLine??m?.startLine??c?.startLine??a,y=u?.endLine??m?.endLine??c?.endLine??a,b=L(e,i,a,p,y);t.identities.push({relativePath:i,focusLine:a,ownerSymbol:u?.symbol??null,ownerShort:u?f(u.symbol):m?.name??(c?f(c.symbol):null),ownerStartLine:b.startLine,ownerEndLine:b.endLine,fileKind:T(i),freshness:n.freshness})}t.fileCoverage.push({relativePath:i,matchingLines:s.length,returnedMatches:0,freshness:n.freshness})}function B(e,t,n,r,o){e.identities.sort(N);let s=e.identities.length>E?O(e.identities,E):e.identities,l=(r===Number.MAX_SAFE_INTEGER?e.identities:o.ranking?O(e.identities,r):e.identities.slice(0,r)).flatMap(c=>{let m=e.textByPath.get(c.relativePath),u=m===void 0?null:D(c.relativePath,m,c.focusLine,n);return u?[{...u,...c}]:[]}),d=new Map;for(let c of l)d.set(c.relativePath,(d.get(c.relativePath)??0)+1);for(let c of e.fileCoverage)c.returnedMatches=d.get(c.relativePath)??0;let a=H(e.fileCoverage);return{pattern:e.pattern,mode:o.regexp?"regexp":"literal",identities:e.identities,...s.length<e.identities.length?{identityManifest:s}:{},identityCoverage:{mode:s.length===e.identities.length?"complete":"bounded",returned:s.length,total:e.identities.length,omitted:e.identities.length-s.length},matches:l,matchingLines:e.identities.length,matchingFiles:e.fileCoverage.length,omittedMatches:Math.max(0,e.identities.length-l.length),fileCoverage:e.fileCoverage,scopeHints:a.slice(0,M),omittedScopeHints:Math.max(0,a.length-M),scannedFiles:t.scannedTextFiles,textCoverage:{basis:"current-project-text-files",candidateFiles:t.candidateFiles,scannedTextFiles:t.scannedTextFiles,scannedBytes:t.scannedBytes,skippedBinaryPaths:t.skippedBinaryPaths,skippedUnreadablePaths:t.skippedUnreadablePaths,skippedOversizedPaths:t.skippedOversizedPaths,semanticFiles:t.semanticFiles}}}function D(e,t,n,r){let o=t.split(`
|
|
2
|
-
`),s=t.endsWith(`
|
|
3
|
-
`)?o.length-1:o.length;if(n<0||n>=s)return null;let i=Math.max(0,n-r),l=Math.min(s-1,n+r);return{relativePath:e,startLine:i,endLine:l,focusLine:n,source:o.slice(i,l+1).join(`
|
|
4
|
-
`)}}function H(e){let t=new Map;for(let n of e){let r=j(n.relativePath),o=t.get(r)??{matchingLines:0,matchingFiles:0};o.matchingLines+=n.matchingLines,o.matchingFiles+=1,t.set(r,o)}return[...t.entries()].map(([n,r])=>({scope:n,...r})).sort((n,r)=>r.matchingLines-n.matchingLines||r.matchingFiles-n.matchingFiles||n.scope.localeCompare(r.scope))}function j(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(0,t)}function O(e,t){let n=e.map((o,s)=>({...o,priority:h(o.fileKind),sequence:s,evidenceCharacters:1,roles:["search"],reasons:["search"],symbols:o.ownerSymbol?[o.ownerSymbol]:[],behaviorSignals:[]})),r=[];for(let o of[0,1,2]){let s=t-r.length;if(s===0)break;let i=n.filter(l=>h(l.fileKind)===o);r.push(...k(i,s,Number.MAX_SAFE_INTEGER,N).selected)}return r.map(({priority:o,sequence:s,evidenceCharacters:i,roles:l,reasons:d,symbols:a,behaviorSignals:c,...m})=>m)}function N(e,t){return h(e.fileKind)-h(t.fileKind)||+(t.ownerSymbol!==null)-+(e.ownerSymbol!==null)||e.relativePath.localeCompare(t.relativePath)||e.focusLine-t.focusLine}export{z as a,k as b,te as c};
|
|
5
|
-
//# sourceMappingURL=chunk-VMPRET3I.js.map
|
package/dist/chunk-VNLGKHS6.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as ie}from"./chunk-2LDBDR6J.js";import{a as oe}from"./chunk-FDLOBR6P.js";import{b as D}from"./chunk-7BWFZPPZ.js";import{a as te}from"./chunk-D2DHWI3D.js";import{b as ne}from"./chunk-2R3V3PSD.js";import{a as W,b as ee}from"./chunk-EG2CPZMJ.js";import{b as Q}from"./chunk-CWFP7GM5.js";import{f as V}from"./chunk-JGKUET5J.js";import{a as H}from"./chunk-ZF5KHH7C.js";import{a as q}from"./chunk-QUU5OBVK.js";import{b as Y}from"./chunk-DHUIOLDT.js";import{a as X}from"./chunk-6HFCYNYE.js";import{d as Z}from"./chunk-M2O5NY6W.js";import{b as K}from"./chunk-BRV7PIFF.js";import{a as J}from"./chunk-T4N4P2K5.js";import{a as w}from"./chunk-TQPCBMWT.js";import{a as G}from"./chunk-YU5DZUZI.js";import{a as j,c as z}from"./chunk-OSSESPDX.js";import{b as $}from"./chunk-NJITK2GP.js";import{e as P,t as A}from"./chunk-N2ZSIIGR.js";import{y as U}from"./chunk-JWTGMPIT.js";function se(n){let e=new Set(n.filter(o=>o.definition?.isFunctionLike).map(o=>`${o.role}:${o.definition.relativePath}`));return n.flatMap(o=>o.definition?!o.definition.isFunctionLike&&e.has(`${o.role}:${o.definition.relativePath}`)?[]:[{definition:o.definition,role:o.role}]:[])}var me=6,I=10,M=3,T=8,de=.7,re=24,_=200,fe=12,le=80,ce=600;function Ze(n,e,o={}){let l=o.impactDepth??3,a=o.sliceDepth??3,u=o.semantic,c=Ee(e)?Ce(n,e):null,S=c?c.primary?.symbol??null:e,{traceResult:r,callGraphResult:C,complexityResult:R,dataflowResult:t,backwardSliceResult:d,forwardSliceResult:s,affectedResults:p,reuseCandidates:b,targetSymbol:i,affectedConsumerReuse:y}=ye(n,S,o,l,a),h=f("change-surface",e,()=>q(n,e,{semantic:u}),m=>({symbols:m?.symbols.length??0,externalConsumers:m?.totalExternalConsumers??0})),x=f("system",e,()=>oe(n,e),m=>({files:m.files.length,symbols:m.symbols.length})),L=x.files.length===1,B=f("deps",e,()=>L?x.dependsOn.map(m=>({relativePath:m,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):W(n,e),m=>({files:m.length,reusedSystem:L})),k=f("rdeps",e,()=>L?x.dependedOnBy.map(m=>({relativePath:m,edgeBasis:"symbol-references",evidence:"cross-file SCIP references plus resolved source imports"})):ee(n,e),m=>({files:m.length,reusedSystem:L})),N=f("surface",e,()=>ie(n,e),m=>({consumers:m.length})),g={symbol:r.definitions.length>0||r.referencedBy.length>0||C!==null||R!==null||t!==null||d!==null||s!==null||p.length>0,file:h!==null||B.length>0||k.length>0,module:x.files.length>0||x.symbols.length>0||N.length>0},E=[];c&&!c.primary&&c.callableCount>1&&E.push(`File target has ${c.callableCount} callable symbols; use one callable name for compiler-resolved flow.`);let F=[...new Set(r.referencedBy.map(m=>m.relativePath))];F.length>0&&F.every(m=>$(m)==="test")&&E.push("Only test references were found for this target. For replacement or retirement work, map the currently wired owner or one production entry point before planning; this target does not describe the live affected surface."),!g.symbol&&!g.file&&!g.module&&E.push("No symbol, file, or module matched target.");let O=h?.file??r.definitions[0]?.relativePath??null;return{target:e,...c?.primary?{primaryCallable:{symbol:c.primary.symbol,shortName:P(c.primary.symbol),file:c.primary.relativePath}}:{},matched:g,history:f("history",O??e,()=>ge(n,O,o.gitHead)),trace:pe(r),callGraph:C,complexity:R,dataflow:t,backwardSlice:d,forwardSlice:s,affected:p,changeSurface:h,deps:B,rdeps:k,system:x,surface:N,reuseCandidates:b,affectedConsumerReuse:y,sourcePacket:be(n,i,r,y,b),warnings:E}}function ye(n,e,o,l,a){let u=o.semantic,c=e?f("trace",e,()=>ne(n,e,{semantic:u,referenceContext:fe}),i=>({definitions:i.definitions.length,references:i.referencedBy.length})):{definitions:[],referencedBy:[],claimSupport:null},S=e?f("call-graph",e,()=>H(n,e,{semantic:u}),i=>({callers:i?.callers.length??0,callees:i?.callees.length??0})):null,r=e?f("complexity",e,()=>J(n,e,{semantic:u}),i=>({callees:i?.calleeCount??0})):null,C=e?f("dataflow",e,()=>Q(n,e,{semantic:u}),i=>({references:i?.usageSites.length??0,producers:i?.producers.length??0,consumers:i?.consumers.length??0})):null,R=e?f("backward-slice",e,()=>D(n,e,{direction:"backward",maxDepth:a,semantic:u}),i=>({maxDepth:a,connectedSymbols:i?.connectedSymbols.length??0})):null,t=e?f("forward-slice",e,()=>D(n,e,{direction:"forward",maxDepth:a,semantic:u}),i=>({maxDepth:a,connectedSymbols:i?.connectedSymbols.length??0})):null,d=e?f("affected",e,()=>G(n,e,{maxDepth:l,scope:o.scope}),i=>({maxDepth:l,affectedSymbols:i.length})):[],s=e?f("reuse-candidates",e,()=>w(n,e,{minSimilarity:.4,limit:5,semantic:u,sourceCandidateMode:"target-pruned"}),i=>({candidates:i.length,direct:i.filter(y=>y.actionTier==="direct").length})):[],p=e?j(n,e)?.symbol??null:null,b=e?f("affected-consumer-reuse",e,()=>Se(c,p,i=>w(n,i,{minSimilarity:.4,limit:I,semantic:u,sourceCandidateMode:"target-pruned"}),{consumerLimit:me,perConsumerSearchLimit:I,perConsumerCandidateLimit:M,candidateLimit:T}),i=>({totalConsumers:i.coverage.totalConsumers,analyzedConsumers:i.coverage.analyzedConsumers,candidates:i.candidates.length})):Le();return{traceResult:c,callGraphResult:S,complexityResult:r,dataflowResult:C,backwardSliceResult:R,forwardSliceResult:t,affectedResults:d,reuseCandidates:s,targetSymbol:p,affectedConsumerReuse:b}}function pe(n){return{definitions:n.definitions,referencedBy:n.referencedBy.map(e=>({relativePath:e.relativePath,line:e.line,enclosingSymbol:e.enclosingSymbol,enclosingShort:e.enclosingShort}))}}function Ce(n,e){let o=K(n,e);if(o.length!==1)return{primary:null,callableCount:0};let l=A(n,o[0]).filter(c=>c.isFunctionLike),a=l.filter(c=>c.enclosingSymbol===null),u=a.length>0?a:l;return{primary:u.length===1?u[0]:null,callableCount:u.length}}function be(n,e,o,l,a){let u=[...e?[{definition:ae(n,e),role:"target"}]:[],...[...l.candidates.map(t=>t.candidate),...a].map(t=>({definition:ae(n,t.symbolB),role:"reuse-candidate"}))],c=new Map;for(let t of se(u)){if(c.has(t.definition.symbol))continue;let d=t.role==="target"?_:le,s=t.definition.endLine<=t.definition.startLine?Z(n,t.definition.relativePath,t.definition.startLine,d):null,p=s?.unitType?s.source:V(n,t.definition);if(!p)continue;let b=p.split(`
|
|
2
|
-
`),i=Math.min(b.length,d),y=s?.unitType?s.startLine:t.definition.startLine;c.set(t.definition.symbol,{role:t.role,symbol:t.definition.symbol,shortName:P(t.definition.symbol),file:t.definition.relativePath,startLine:y,endLine:y+i-1,source:b.slice(0,i).join(`
|
|
3
|
-
`),omittedLines:(s?.unitType?s.omittedLines:0)+Math.max(0,b.length-i)})}let S=new Map;for(let t of o.referencedBy){if(t.source===void 0||t.source===null||t.sourceStartLine===void 0||t.sourceStartLine===null||t.sourceEndLine===void 0||t.sourceEndLine===null)continue;let d=`${t.relativePath}:${t.sourceStartLine}-${t.sourceEndLine}`,s=S.get(d);if(s){s.focusLines=[...new Set([...s.focusLines??[],t.line])].sort((p,b)=>p-b);continue}S.set(d,{role:"consumer",symbol:t.enclosingSymbol??`${t.relativePath}:${t.line}`,shortName:t.enclosingShort,file:t.relativePath,startLine:t.sourceStartLine,endLine:t.sourceEndLine,source:t.source,omittedLines:0,focusLines:[t.line]})}let r=[...[...c.values()].filter(t=>t.role==="target"),...S.values(),...[...c.values()].filter(t=>t.role==="reuse-candidate")],C=[],R=ce;for(let t of r){if(C.length>=re||R<=0)break;let d=t.source.split(`
|
|
4
|
-
`),s=Math.min(d.length,R);C.push({...t,endLine:t.startLine+s-1,source:d.slice(0,s).join(`
|
|
5
|
-
`),omittedLines:t.omittedLines+Math.max(0,d.length-s),...t.focusLines?{focusLines:t.focusLines.filter(p=>p<=t.startLine+s-1)}:{}}),R-=s}return{slices:C,candidateSlices:r.length,omittedSlices:Math.max(0,r.length-C.length),maxSlices:re,maxLinesPerSlice:_,maxTotalLines:ce,targetLineLimit:_,consumerContextLines:fe,reuseLineLimit:le}}function ae(n,e){let o=z(n,e);return o?A(n,o.relativePath).find(l=>l.symbol===e)??null:null}function Se(n,e,o,l={}){let a=v(l.consumerLimit,me),u=v(l.perConsumerSearchLimit,I),c=v(l.perConsumerCandidateLimit,M),S=v(l.candidateLimit,T),r=Re(n),C=r.slice(0,a),R=new Set(r.map(s=>s.symbol));e&&R.add(e);let t=new Map;for(let s of C){let p=o(s.symbol).slice(0,u),b=0;for(let i of p){let y=he(i,s.symbol);if(!y||R.has(y.symbolB))continue;let h=t.get(y.symbolB);if(h?(h.consumers.some(x=>x.symbol===s.symbol)||h.consumers.push(s),y.similarity>h.candidate.similarity&&(h.candidate=y)):t.set(y.symbolB,{candidate:y,consumers:[s]}),b+=1,b>=c)break}}let d=[...t.values()].filter(s=>s.candidate.actionTier==="direct"||s.candidate.similarity>=de||s.consumers.length>1).sort(xe).slice(0,S);return{candidates:d,coverage:{totalConsumers:r.length,analyzedConsumers:C.length,omittedConsumers:Math.max(0,r.length-C.length),perConsumerSearchLimit:u,perConsumerCandidateLimit:c,candidateLimit:S,returnedCandidates:d.length}}}function Re(n){let e=new Map;for(let o of n.referencedBy){if(!o.enclosingSymbol)continue;let l=e.get(o.enclosingSymbol);if(l){l.referenceCount+=1;continue}e.set(o.enclosingSymbol,{symbol:o.enclosingSymbol,shortName:P(o.enclosingSymbol)||o.enclosingShort,file:o.relativePath,referenceCount:1})}return[...e.values()].sort((o,l)=>l.referenceCount-o.referenceCount||o.symbol.localeCompare(l.symbol))}function he(n,e){return n.symbolA===e?n:n.symbolB!==e?null:{...n,symbolA:n.symbolB,shortNameA:n.shortNameB,fileA:n.fileB,symbolB:n.symbolA,shortNameB:n.shortNameA,fileB:n.fileA,uniqueToA:n.uniqueToB,uniqueToB:n.uniqueToA}}function xe(n,e){let o=ue(e.candidate.actionTier)-ue(n.candidate.actionTier);if(o!==0)return o;let l=e.consumers.length-n.consumers.length;if(l!==0)return l;let a=e.candidate.similarity-n.candidate.similarity;return a!==0?a:n.candidate.symbolB.localeCompare(e.candidate.symbolB)}function ue(n){return n==="direct"?1:0}function v(n,e){return typeof n=="number"&&Number.isFinite(n)?Math.max(1,Math.floor(n)):e}function Le(){return{candidates:[],coverage:{totalConsumers:0,analyzedConsumers:0,omittedConsumers:0,perConsumerSearchLimit:I,perConsumerCandidateLimit:M,candidateLimit:T,returnedCandidates:0}}}function f(n,e,o,l=()=>({})){let a;return U(`context.${n}`,()=>(a=o(),a),()=>({target:e,...l(a)}))}function ge(n,e,o){let l={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return l;let a=X(n,o?{head:o}:{}),u=f("history.churn",e,()=>a.fileChurn(),r=>({files:r?.size??0}));if(!u)return l;let c=f("history.co-change",e,()=>Y(n,e,{limit:5,...o?{head:o}:{}}),r=>({commits:r.commitsAnalyzed,partners:r.findings.length})),S=f("history.suppressions",e,()=>te(n).byFile.get(e)??0,r=>({suppressions:r}));return{available:!0,file:e,churn:u.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:c.findings.map(r=>({file:r.fileA===e?r.fileB:r.fileA,together:r.together,confidence:r.confidence,subjectContext:r.subjectContext})),suppressionsInFile:S}}function Ee(n){return n.includes("/")||n.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(n)}export{Ze as a,Se as b};
|
|
6
|
-
//# sourceMappingURL=chunk-VNLGKHS6.js.map
|
package/dist/chunk-VQILFTEH.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as f}from"./chunk-CJZXN4NU.js";import{a as L}from"./chunk-OSSESPDX.js";import{d as i,e as b,f as u,l as c}from"./chunk-N2ZSIIGR.js";import{n as l}from"./chunk-ODDUPDP7.js";import{z as a}from"./chunk-ZOHS7AQV.js";function S(o,s){let t=L(o,s);if(!t)return[];let e=new f(o).definitionsForFile(t.relativePath).filter(r=>r.symbol!==t.symbol).filter(r=>c(t.symbol,r.symbol)).sort((r,m)=>r.startLine-m.startLine||r.endLine-m.endLine).map(r=>({symbol:r.symbol,shortName:i(r.symbol),startLine:r.startLine,endLine:r.endLine,kind:u(r.symbol)??"unknown"}));return a(t.relativePath)!=="clojure"?e:d(e,y(o,t))}function y(o,s){let t=b(s.symbol);if(!t)return[];let n=i(s.symbol);return(l(o,s.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({symbol:`${s.symbol}${e.memberName}().`,shortName:`${n}:${e.memberName}()`,startLine:e.startLine,endLine:e.endLine,kind:e.memberKind}))}function d(o,s){let t=new Map;for(let n of[...o,...s])t.set(`${n.shortName}:${n.startLine}:${n.endLine}`,n);return[...t.values()].sort((n,e)=>n.startLine-e.startLine||n.endLine-e.endLine)}export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-VQILFTEH.js.map
|