scip-query 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +247 -1
- package/README.md +111 -124
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-PRVFAGTQ.js +2 -0
- package/dist/call-graph-DVPAQV2F.js +2 -0
- package/dist/{call-graph-evidence-BociKRpF.d.ts → call-graph-evidence-CUtj8V2I.d.ts} +1 -1
- package/dist/chunk-2FSBGL5P.js +2 -0
- package/dist/chunk-2HLAFUCY.js +2 -0
- package/dist/chunk-2IWUT6CJ.js +3 -0
- package/dist/chunk-2KNN7GTQ.js +2 -0
- package/dist/chunk-2LHXRE2B.js +8 -0
- package/dist/{chunk-E65ELFKU.js → chunk-2YXE77TJ.js} +2 -2
- package/dist/chunk-36SGVCGX.js +2 -0
- package/dist/chunk-3ABBFPTP.js +2 -0
- package/dist/chunk-3IVFU4FD.js +3 -0
- package/dist/chunk-3JIQS44J.js +7 -0
- package/dist/chunk-3ZRB6DNK.js +7 -0
- package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
- package/dist/{chunk-BHKK5RJY.js → chunk-4BHGBMNO.js} +2 -2
- package/dist/chunk-4BP3UBDG.js +2 -0
- package/dist/chunk-4D6RO7G4.js +2 -0
- package/dist/chunk-4FEWQ6RH.js +2 -0
- package/dist/chunk-4IGEOBG7.js +2 -0
- package/dist/chunk-4QZXBUKC.js +2 -0
- package/dist/chunk-4WBDEVX2.js +4 -0
- package/dist/chunk-4WCUBZU3.js +8 -0
- package/dist/chunk-4WTUBQ36.js +40 -0
- package/dist/chunk-4XQ4O6IM.js +3 -0
- package/dist/chunk-55UQAMZO.js +4 -0
- package/dist/chunk-5D2LVK7O.js +125 -0
- package/dist/chunk-5IYJ56TT.js +2 -0
- package/dist/chunk-5PLMJC7Q.js +2 -0
- package/dist/chunk-5TNQJUR2.js +5 -0
- package/dist/chunk-62BDNPMI.js +2 -0
- package/dist/chunk-64DZ5TXR.js +7 -0
- package/dist/chunk-65245JCM.js +2 -0
- package/dist/chunk-6FFVZZL4.js +2 -0
- package/dist/chunk-6KO5JHAR.js +2 -0
- package/dist/chunk-6LRXOOSX.js +2 -0
- package/dist/chunk-6LSEIIF7.js +2 -0
- package/dist/chunk-6YMNWD3H.js +6 -0
- package/dist/chunk-72AD6ZRR.js +5 -0
- package/dist/chunk-73AAKPUC.js +4 -0
- package/dist/chunk-76CZ77DF.js +2 -0
- package/dist/chunk-7VPEEAAG.js +2 -0
- package/dist/chunk-7WTPQ4NX.js +14 -0
- package/dist/chunk-7Y5T6XDP.js +2 -0
- package/dist/chunk-A2IIGFMJ.js +5 -0
- package/dist/chunk-AB5KCTEV.js +2 -0
- package/dist/chunk-AC566WBP.js +6 -0
- package/dist/chunk-AGWFSTXC.js +3 -0
- package/dist/chunk-AOSIYPTA.js +2 -0
- package/dist/chunk-AUVEWPIF.js +2 -0
- package/dist/chunk-B56T42J3.js +25 -0
- package/dist/chunk-BIQEF5NE.js +2 -0
- package/dist/chunk-BL6XJKTA.js +3 -0
- package/dist/chunk-BMKOQJRI.js +2 -0
- package/dist/chunk-BOZ4EXBB.js +3 -0
- package/dist/chunk-BUTWYEPH.js +2 -0
- package/dist/chunk-BZB4QPIP.js +2 -0
- package/dist/{chunk-6ILKOOGH.js → chunk-CE357GEE.js} +4 -4
- package/dist/chunk-CFN45HFP.js +2 -0
- package/dist/chunk-CFYMZFXT.js +368 -0
- package/dist/chunk-CN5EH7O3.js +2 -0
- package/dist/chunk-D254DNNQ.js +4 -0
- package/dist/chunk-D3FDISIC.js +2 -0
- package/dist/chunk-D3NX5XIE.js +3 -0
- package/dist/chunk-DA7RPPDF.js +3 -0
- package/dist/chunk-DDMC3FON.js +3 -0
- package/dist/chunk-DIO3FUSG.js +2 -0
- package/dist/chunk-DJ2NNSUK.js +3 -0
- package/dist/chunk-DKYQIM3C.js +18 -0
- package/dist/{chunk-OHIV323X.js → chunk-DOOEL2IV.js} +2 -2
- package/dist/chunk-DVFP6PZI.js +2 -0
- package/dist/chunk-E3FDPXZK.js +2 -0
- package/dist/chunk-E7YNJLCB.js +2 -0
- package/dist/chunk-EFGW5JPH.js +2 -0
- package/dist/chunk-EJVTR244.js +13 -0
- package/dist/chunk-EOV7RTRZ.js +2 -0
- package/dist/chunk-ETOIKRHO.js +2 -0
- package/dist/chunk-EYK3ZAO2.js +3 -0
- package/dist/chunk-F2V2LPET.js +52 -0
- package/dist/chunk-F4LUHJTF.js +2 -0
- package/dist/chunk-F4PUT6IT.js +2 -0
- package/dist/chunk-F56GCXXS.js +5 -0
- package/dist/chunk-FC2EVQRM.js +2 -0
- package/dist/chunk-FL7NBMHP.js +3 -0
- package/dist/chunk-FMRN2TRL.js +3 -0
- package/dist/chunk-FVULPZDF.js +20 -0
- package/dist/chunk-GCKCF5FL.js +43 -0
- package/dist/chunk-GH2PYF46.js +2 -0
- package/dist/chunk-GHJAGXIP.js +2 -0
- package/dist/{chunk-2GJSD5GY.js → chunk-GMVSHUKZ.js} +2 -2
- package/dist/chunk-GS6KDO4R.js +2 -0
- package/dist/chunk-GUUBXNN7.js +2 -0
- package/dist/chunk-GVWX5T43.js +80 -0
- package/dist/chunk-GZKFETP5.js +2 -0
- package/dist/chunk-H4EQHO6J.js +9 -0
- package/dist/chunk-H73WY2RM.js +2 -0
- package/dist/chunk-H75GSPRV.js +60 -0
- package/dist/chunk-HDR3AHSV.js +61 -0
- package/dist/chunk-HQBSL74Y.js +2 -0
- package/dist/chunk-HRRFKWPZ.js +2 -0
- package/dist/chunk-HXENDJC6.js +2 -0
- package/dist/chunk-IIBAZNSW.js +21 -0
- package/dist/chunk-INLMWEUU.js +12 -0
- package/dist/chunk-IWQPAF4F.js +2 -0
- package/dist/chunk-IZJ6YUKP.js +35 -0
- package/dist/chunk-J2TMAIN5.js +60 -0
- package/dist/chunk-J5FJMODQ.js +142 -0
- package/dist/chunk-J7HZPIO3.js +2 -0
- package/dist/chunk-JEVRKFRL.js +2 -0
- package/dist/chunk-JFXSGAEB.js +30 -0
- package/dist/chunk-JVRTHGFS.js +3 -0
- package/dist/chunk-JYWEX7RR.js +360 -0
- package/dist/chunk-K3YL22N6.js +2 -0
- package/dist/chunk-K4CN7GXK.js +12 -0
- package/dist/chunk-K5TBVXU4.js +30 -0
- package/dist/chunk-KDDIE2DP.js +9 -0
- package/dist/chunk-KHWRRPV4.js +2 -0
- package/dist/chunk-KI6NBKDY.js +14 -0
- package/dist/chunk-KU3QRSTH.js +2 -0
- package/dist/chunk-KZBJWZJB.js +2 -0
- package/dist/chunk-L7GFM3NP.js +3 -0
- package/dist/chunk-LMO6PK3V.js +35 -0
- package/dist/chunk-LN4YXJJU.js +2 -0
- package/dist/chunk-LOVIZBJ4.js +43 -0
- package/dist/chunk-LPCRK4A2.js +11 -0
- package/dist/chunk-MMHZKBFA.js +2 -0
- package/dist/{chunk-A4WEAK35.js → chunk-MOQQBQRD.js} +2 -2
- package/dist/chunk-N2WN6I3L.js +2 -0
- package/dist/chunk-N3ORQT7L.js +2 -0
- package/dist/chunk-NAZ3RAIW.js +2 -0
- package/dist/chunk-NDUNO5JQ.js +2 -0
- package/dist/chunk-NEIWRNAZ.js +4 -0
- package/dist/chunk-NJJMVD65.js +2 -0
- package/dist/chunk-NLOQOBXI.js +20 -0
- package/dist/chunk-NOLZOVCU.js +2 -0
- package/dist/chunk-NOWINRRN.js +2 -0
- package/dist/chunk-NZAXKGRL.js +16 -0
- package/dist/chunk-O2C4UILI.js +2 -0
- package/dist/chunk-O3RHA6ZT.js +3 -0
- package/dist/chunk-O4UZSPPI.js +3 -0
- package/dist/chunk-OGFV2BUX.js +2 -0
- package/dist/chunk-OZCJXZK6.js +499 -0
- package/dist/chunk-P6ODM7BY.js +2 -0
- package/dist/{chunk-GHNPACNP.js → chunk-PAVGPRHJ.js} +2 -2
- package/dist/chunk-PH52RA7D.js +2 -0
- package/dist/chunk-PKN354TH.js +3 -0
- package/dist/chunk-PWOASWEG.js +11 -0
- package/dist/chunk-QIWXRW72.js +2 -0
- package/dist/chunk-QJRMOK5N.js +2 -0
- package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
- package/dist/chunk-QXEUDXBT.js +3 -0
- package/dist/chunk-QYUVVBMR.js +6 -0
- package/dist/chunk-QZ7KQZRN.js +2 -0
- package/dist/chunk-R6LQBUDH.js +2 -0
- package/dist/chunk-RBS42E55.js +20 -0
- package/dist/chunk-RSJKPCFX.js +26 -0
- package/dist/chunk-S6CZA3MV.js +2 -0
- package/dist/chunk-STMVAHJP.js +2 -0
- package/dist/chunk-SYVPTTVW.js +2 -0
- package/dist/chunk-T6DK3ZP7.js +2 -0
- package/dist/chunk-TKD34PHN.js +4 -0
- package/dist/chunk-TNNQFH7W.js +2 -0
- package/dist/chunk-TNV7SSUF.js +2 -0
- package/dist/chunk-TO7ZR3EH.js +8 -0
- package/dist/chunk-TOU3CHK4.js +2 -0
- package/dist/chunk-TRBI4UKT.js +2 -0
- package/dist/chunk-TZCVNCAN.js +4 -0
- package/dist/chunk-U4LZA5LL.js +3 -0
- package/dist/chunk-U5RIG3JP.js +3 -0
- package/dist/chunk-UP5KXN2I.js +2 -0
- package/dist/chunk-UQFR3NDH.js +5 -0
- package/dist/chunk-UXYXF7GV.js +2 -0
- package/dist/chunk-VB3GOKOS.js +2 -0
- package/dist/{chunk-4FR6GQIT.js → chunk-VF5JZICY.js} +2 -2
- package/dist/chunk-VTY3VK6E.js +2 -0
- package/dist/chunk-VX2O4RIS.js +2 -0
- package/dist/chunk-WKPV2TDZ.js +2 -0
- package/dist/chunk-WOFQ5DTB.js +2 -0
- package/dist/chunk-WS4C6TCK.js +2 -0
- package/dist/chunk-WXU3DGPU.js +2 -0
- package/dist/{chunk-ATXPTSEI.js → chunk-X6RMKHJQ.js} +7 -7
- package/dist/{chunk-44IETFOU.js → chunk-XHMN6ZX7.js} +2 -2
- package/dist/chunk-XHTVFLWW.js +2 -0
- package/dist/chunk-XKIDJCIK.js +2 -0
- package/dist/chunk-XTYTYZPT.js +2 -0
- package/dist/chunk-Y2JHHTTA.js +2 -0
- package/dist/chunk-YGVRMGYN.js +4 -0
- package/dist/chunk-YNQCGEQE.js +2 -0
- package/dist/chunk-YOQVEXVE.js +14 -0
- package/dist/chunk-YRT2WLYY.js +2 -0
- package/dist/chunk-YTAP5Y2G.js +2 -0
- package/dist/chunk-YTYWI7VB.js +2 -0
- package/dist/chunk-YULZRALL.js +2 -0
- package/dist/chunk-Z33WQG4Q.js +2 -0
- package/dist/chunk-ZGTYGDMF.js +16 -0
- package/dist/chunk-ZHMRSZFD.js +43 -0
- package/dist/chunk-ZHSP366W.js +10 -0
- package/dist/chunk-ZIBYCYKK.js +7 -0
- package/dist/chunk-ZLADLUE6.js +3 -0
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-MZPXPSUJ.js → chunk-ZR4HBC2H.js} +2 -2
- package/dist/cli-main.js +6 -6
- package/dist/cli.js +1 -1
- package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
- package/dist/code-IL5WH3NZ.js +2 -0
- package/dist/code-result-json-ANTBEDFP.js +4 -0
- package/dist/command-descriptors-HEEMDHTU.js +222 -0
- package/dist/deps-EOWFC6FD.js +2 -0
- package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
- package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
- package/dist/files-K4AI3JUM.js +2 -0
- package/dist/{health-BI2a9WPy.d.ts → health-BtfmNrfa.d.ts} +5 -79
- package/dist/hierarchy-6W5NDIFI.js +2 -0
- package/dist/imports-WH365QY4.js +2 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/members-K3PHMF5S.js +2 -0
- package/dist/methods-E7KVMBX4.js +2 -0
- package/dist/output-continuation-command-BJSY67SN.js +3 -0
- package/dist/output-pagination-UZJ5ACIX.js +24 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-EP24WT4X.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +15 -4
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -0
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +3 -3
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity.d.ts +6 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +1 -7
- package/dist/queries/context.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/dependence-slice.d.ts +46 -22
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +1 -7
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -4
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +121 -61
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -0
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +15 -64
- package/dist/queries/index.js +1 -1
- package/dist/queries/locality-candidates.d.ts +4 -4
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -6
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +4 -14
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +4 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/review.d.ts +188 -0
- package/dist/queries/review.js +2 -0
- package/dist/queries/similar-files.d.ts +7 -10
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +19 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice-cohesion.d.ts +205 -0
- package/dist/queries/slice-cohesion.js +2 -0
- package/dist/queries/source-inspection.d.ts +6 -202
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -3
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stats.d.ts +1 -0
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +4 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/twin-drift.d.ts +1 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +3 -15
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +4 -4
- package/dist/refs-CCBJG7WK.js +2 -0
- package/dist/refs-pagination-DRNLVU4S.js +2 -0
- package/dist/reindex-worker.js +79 -29
- package/dist/reindex.js +45 -45
- package/dist/repository-cache-worker.js +2 -0
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +3 -4
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/service-queries-2WAJI7R6.js +6 -0
- package/dist/source-inspection-91U9zdO3.d.ts +341 -0
- package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
- package/dist/stats-G7DIV6VU.js +2 -0
- package/dist/surface-IO55UALI.js +2 -0
- package/dist/system-ZBMSHJXU.js +2 -0
- package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
- package/dist/typescript-indexer.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +3 -3
- package/docs/AGENT_GUIDE.md +19 -128
- package/docs/CLI_JSON_OUTPUT.md +21 -17
- package/docs/COMMAND_REFERENCE.md +34 -49
- package/docs/CURRENT_COMMANDS.md +123 -0
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
- package/docs/DETECTOR_GUIDE.md +27 -23
- package/docs/PRODUCT_VISION.md +135 -0
- package/docs/PROPERTY_TESTING.md +73 -0
- package/docs/REVIEW.md +76 -0
- package/docs/SKILLS.md +51 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
- package/docs/accuracy-audit-checklist.md +34 -0
- package/docs/analyzer-inventory.md +2 -2
- package/package.json +18 -80
- package/scripts/evidence-product-contract.mjs +7 -3
- package/scripts/record-review-coverage.mjs +118 -0
- package/scripts/scip-windows-provenance.mjs +29 -19
- package/skills/scip-architecture-review/SKILL.md +57 -0
- package/skills/scip-architecture-review/agents/openai.yaml +4 -0
- package/skills/scip-architecture-review/references/design-checks.md +17 -0
- package/skills/scip-explore/SKILL.md +15 -59
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/external-evidence.md +2 -2
- package/skills/scip-explore/references/information-model.md +26 -29
- package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
- package/skills/scip-integrity-audit/SKILL.md +53 -181
- package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
- package/skills/scip-plan/SKILL.md +39 -65
- package/skills/scip-plan/agents/openai.yaml +2 -2
- package/skills/scip-query/SKILL.md +28 -81
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-query/references/command-guide.md +169 -0
- package/skills/scip-setup/SKILL.md +4 -2
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/by-kind-H3P6BR5G.js +0 -2
- package/dist/call-graph-VTG2CUOQ.js +0 -2
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2BMSSRBH.js +0 -2
- package/dist/chunk-2M2LSIMY.js +0 -7
- package/dist/chunk-2N6WBNDC.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2USA3S3P.js +0 -3
- package/dist/chunk-2VAHDDLM.js +0 -133
- package/dist/chunk-2XWIUW5Z.js +0 -455
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D4BOXW6.js +0 -20
- package/dist/chunk-3LO4FST5.js +0 -16
- package/dist/chunk-3WTY4LP2.js +0 -3
- package/dist/chunk-3Z5AMSK6.js +0 -29
- package/dist/chunk-4KBTHJLP.js +0 -2
- package/dist/chunk-5BIKR67W.js +0 -2
- package/dist/chunk-5PROPLHI.js +0 -2
- package/dist/chunk-5V7EPTII.js +0 -2
- package/dist/chunk-62LPZCBQ.js +0 -3
- package/dist/chunk-64O2JHQA.js +0 -2
- package/dist/chunk-6D4F5VWG.js +0 -10
- package/dist/chunk-6ERFBC3X.js +0 -3
- package/dist/chunk-6MFXCMZC.js +0 -2
- package/dist/chunk-6O7FACKB.js +0 -2
- package/dist/chunk-6TS3KOXR.js +0 -2
- package/dist/chunk-76QOU4PK.js +0 -3
- package/dist/chunk-7DUI77BN.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7F7T6DCR.js +0 -2
- package/dist/chunk-7H6VHWWJ.js +0 -2
- package/dist/chunk-7HXT6YLU.js +0 -5
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-7R4V5ES6.js +0 -6
- package/dist/chunk-7RIRIADH.js +0 -7
- package/dist/chunk-7ZLWLOGT.js +0 -2
- package/dist/chunk-AADQLOQ4.js +0 -38
- package/dist/chunk-AN76MGUE.js +0 -2
- package/dist/chunk-ANLNLY66.js +0 -2
- package/dist/chunk-AX7IDVFT.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B7MPDEAK.js +0 -3
- package/dist/chunk-BBB5FBX4.js +0 -2
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BJWFVAA5.js +0 -2
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BKZYTLGE.js +0 -35
- package/dist/chunk-BL6DCHQP.js +0 -2
- package/dist/chunk-BOW7SSQH.js +0 -43
- package/dist/chunk-C4RHHCKL.js +0 -7
- package/dist/chunk-C7C6AKAT.js +0 -117
- package/dist/chunk-CD6M6LS2.js +0 -16
- package/dist/chunk-CFE6PSG6.js +0 -2
- package/dist/chunk-CFNIGQMT.js +0 -2
- package/dist/chunk-CKBUBRYD.js +0 -2
- package/dist/chunk-CZW5MZ5B.js +0 -2
- package/dist/chunk-DBBZ63ZX.js +0 -2
- package/dist/chunk-DBN7DMJB.js +0 -18
- package/dist/chunk-DUULLZHZ.js +0 -3
- package/dist/chunk-DV5Y5NOS.js +0 -2
- package/dist/chunk-DZOIKCTM.js +0 -3
- package/dist/chunk-E4PKTOL3.js +0 -2
- package/dist/chunk-E7QR35ST.js +0 -2
- package/dist/chunk-EFSXAINW.js +0 -2
- package/dist/chunk-EHVEIEQN.js +0 -18
- package/dist/chunk-EHYDXE3Z.js +0 -2
- package/dist/chunk-EP63Y6LD.js +0 -2
- package/dist/chunk-EPX6NQN6.js +0 -4
- package/dist/chunk-ETC674NS.js +0 -5
- package/dist/chunk-F5GSBHC6.js +0 -3
- package/dist/chunk-FH3DGXC6.js +0 -2
- package/dist/chunk-FI7VGOR4.js +0 -16
- package/dist/chunk-FJF6VO2P.js +0 -2
- package/dist/chunk-FLMTCX5R.js +0 -2
- package/dist/chunk-FVFDOIM3.js +0 -2
- package/dist/chunk-G2HU5WRN.js +0 -2
- package/dist/chunk-G4ALYS4J.js +0 -2
- package/dist/chunk-G56I7K4W.js +0 -26
- package/dist/chunk-GC4DG2V5.js +0 -2
- package/dist/chunk-GG45PK4S.js +0 -4
- package/dist/chunk-GINH3YQU.js +0 -20
- package/dist/chunk-GTZZVLKJ.js +0 -2
- package/dist/chunk-GXXW5ZHH.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HAXXKRTD.js +0 -4
- package/dist/chunk-HEZWBAZY.js +0 -2
- package/dist/chunk-HMEWLMML.js +0 -2
- package/dist/chunk-HOBOVYPO.js +0 -11
- package/dist/chunk-HRFQ6GW5.js +0 -8
- package/dist/chunk-HX4X7KG3.js +0 -2
- package/dist/chunk-HYT2R7LX.js +0 -4
- package/dist/chunk-IKQVBVQL.js +0 -40
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-J6GLBBRK.js +0 -4
- package/dist/chunk-J7A4PWFX.js +0 -3
- package/dist/chunk-JCSAZ35V.js +0 -2
- package/dist/chunk-JDU2IV3A.js +0 -2
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JFMI5SGB.js +0 -4
- package/dist/chunk-JJP37RGX.js +0 -57
- package/dist/chunk-JZ2A7LDM.js +0 -5
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KNLQGXVH.js +0 -80
- package/dist/chunk-KVQCECPR.js +0 -2
- package/dist/chunk-KXXORBZ2.js +0 -4
- package/dist/chunk-L5KYH6U3.js +0 -35
- package/dist/chunk-L6XHYJPZ.js +0 -21
- package/dist/chunk-L7KTFEAV.js +0 -43
- package/dist/chunk-LDXHR5EL.js +0 -23
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-MHGDSBFX.js +0 -2
- package/dist/chunk-MLQVVDG3.js +0 -74
- package/dist/chunk-MOKUWRHO.js +0 -3
- package/dist/chunk-MPYAPMNE.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV6SPXCR.js +0 -7
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N55KIE46.js +0 -2
- package/dist/chunk-NB4D3BNM.js +0 -2
- package/dist/chunk-NGKBOT6G.js +0 -23
- package/dist/chunk-NJGKXKQF.js +0 -2
- package/dist/chunk-NJQISBL4.js +0 -8
- package/dist/chunk-NJT3ZEKY.js +0 -16
- package/dist/chunk-NKMKZP6A.js +0 -2
- package/dist/chunk-NODFZ6ED.js +0 -2
- package/dist/chunk-NSM5IEVW.js +0 -2
- package/dist/chunk-NTGUVNR2.js +0 -3
- package/dist/chunk-NU3KFF2O.js +0 -57
- package/dist/chunk-NWLVNU66.js +0 -557
- package/dist/chunk-NYKZMCRC.js +0 -4
- package/dist/chunk-O6BUXZEH.js +0 -6
- package/dist/chunk-ODPDP7A4.js +0 -3
- package/dist/chunk-OIAPEKMT.js +0 -3
- package/dist/chunk-OIOC5EHF.js +0 -3
- package/dist/chunk-ONPPQM4G.js +0 -2
- package/dist/chunk-OUHEZBYI.js +0 -2
- package/dist/chunk-OVGYW7UD.js +0 -29
- package/dist/chunk-OYKU4B3Y.js +0 -2
- package/dist/chunk-POBJ6FR2.js +0 -5
- package/dist/chunk-PSZPMMWN.js +0 -2
- package/dist/chunk-PXTRBKRK.js +0 -3
- package/dist/chunk-Q5JRIHT3.js +0 -4
- package/dist/chunk-Q7ATHARX.js +0 -2
- package/dist/chunk-Q7CSKIDM.js +0 -5
- package/dist/chunk-QBQE7ZJ5.js +0 -3
- package/dist/chunk-QH22UIXP.js +0 -5
- package/dist/chunk-QXCKQTKR.js +0 -60
- package/dist/chunk-RBAD4GJ2.js +0 -13
- package/dist/chunk-RMDPFPNW.js +0 -2
- package/dist/chunk-ROPJDEJZ.js +0 -4
- package/dist/chunk-RVZC6TJE.js +0 -2
- package/dist/chunk-S4QZBKSR.js +0 -3
- package/dist/chunk-SCPMZ73U.js +0 -2
- package/dist/chunk-SIAP5RGI.js +0 -73
- package/dist/chunk-SIX4RFR3.js +0 -3
- package/dist/chunk-SKKXTABJ.js +0 -16
- package/dist/chunk-SSRFUQBD.js +0 -2
- package/dist/chunk-SYVJEEUJ.js +0 -3
- package/dist/chunk-T3CZAZSI.js +0 -8
- package/dist/chunk-T6DWDI5E.js +0 -3
- package/dist/chunk-T6HRIROJ.js +0 -7
- package/dist/chunk-TAA7HXHE.js +0 -2
- package/dist/chunk-TJ2JQYT3.js +0 -2
- package/dist/chunk-TULNMD5T.js +0 -368
- package/dist/chunk-U2FPY5XA.js +0 -3
- package/dist/chunk-U3SXIMII.js +0 -38
- package/dist/chunk-U6KCHXJ4.js +0 -2
- package/dist/chunk-UH3XSKS5.js +0 -9
- package/dist/chunk-UIFUZVCC.js +0 -2
- package/dist/chunk-UXKURIVI.js +0 -2
- package/dist/chunk-V2RBODHL.js +0 -2
- package/dist/chunk-VBKUWB6N.js +0 -2
- package/dist/chunk-VBV6ALJE.js +0 -2
- package/dist/chunk-VDGFWCQV.js +0 -2
- package/dist/chunk-VDSDOEWF.js +0 -2
- package/dist/chunk-VZPWVCLN.js +0 -20
- package/dist/chunk-WDSFQDPN.js +0 -2
- package/dist/chunk-WFA35BGR.js +0 -7
- package/dist/chunk-WLMP3OCW.js +0 -2
- package/dist/chunk-WSA52GOR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-X3YVZAKZ.js +0 -5
- package/dist/chunk-X6OGVFIT.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XKXTR6ZI.js +0 -9
- package/dist/chunk-Y5DFAW5W.js +0 -4
- package/dist/chunk-YSYPDRD5.js +0 -3
- package/dist/chunk-ZFVPWH62.js +0 -5
- package/dist/chunk-ZGIHTH27.js +0 -2
- package/dist/chunk-ZGIQN2SX.js +0 -2
- package/dist/chunk-ZHG4WAHR.js +0 -12
- package/dist/chunk-ZKB2XUEN.js +0 -4
- package/dist/chunk-ZLMXIQLC.js +0 -21
- package/dist/chunk-ZMCQIHI4.js +0 -2
- package/dist/code-TAVIKWJI.js +0 -2
- package/dist/code-result-json-5FEFQCAQ.js +0 -2
- package/dist/command-descriptors-7BKH53Y3.js +0 -343
- package/dist/dataflow-GFBTVDH3.js +0 -2
- package/dist/dependence-slice-GWGQCODG.js +0 -2
- package/dist/deps-4QHVDPYA.js +0 -2
- package/dist/direct-navigation-4UBC6HNW.js +0 -3
- package/dist/entry-map-QCTF4RVY.js +0 -2
- package/dist/files-M2UBF5HJ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-2UIHRLW4.js +0 -2
- package/dist/imports-WIE3YZOB.js +0 -2
- package/dist/members-YKD636DA.js +0 -2
- package/dist/methods-VDF4IMYG.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-4UMDOOLO.js +0 -3
- package/dist/output-pagination-2GME6OPY.js +0 -19
- package/dist/project-reindex-XEQTRCV5.js +0 -3
- package/dist/queries/anchors.d.ts +0 -123
- package/dist/queries/anchors.js +0 -2
- package/dist/queries/complexity-hotspots.d.ts +0 -40
- package/dist/queries/complexity-hotspots.js +0 -2
- package/dist/queries/convergence.d.ts +0 -33
- package/dist/queries/convergence.js +0 -2
- package/dist/queries/dataflow.d.ts +0 -77
- package/dist/queries/dataflow.js +0 -2
- package/dist/queries/deep-chains.d.ts +0 -5
- package/dist/queries/deep-chains.js +0 -2
- package/dist/queries/extract-candidates.d.ts +0 -79
- package/dist/queries/extract-candidates.js +0 -2
- package/dist/queries/isolated.d.ts +0 -24
- package/dist/queries/isolated.js +0 -2
- package/dist/queries/plan-context.d.ts +0 -33
- package/dist/queries/plan-context.js +0 -2
- package/dist/queries/reference-neighborhood.d.ts +0 -4
- package/dist/queries/reference-neighborhood.js +0 -2
- package/dist/queries/reference-reachability.d.ts +0 -48
- package/dist/queries/reference-reachability.js +0 -2
- package/dist/queries/self-audit.d.ts +0 -69
- package/dist/queries/self-audit.js +0 -2
- package/dist/queries/similar-chains.d.ts +0 -48
- package/dist/queries/similar-chains.js +0 -2
- package/dist/queries/slice.d.ts +0 -4
- package/dist/queries/slice.js +0 -2
- package/dist/queries/stale-abstractions.d.ts +0 -72
- package/dist/queries/stale-abstractions.js +0 -2
- package/dist/queries/system-map.d.ts +0 -449
- package/dist/queries/system-map.js +0 -2
- package/dist/queries/trace.js +0 -2
- package/dist/queries/twin-ab.d.ts +0 -66
- package/dist/queries/twin-ab.js +0 -2
- package/dist/queries/value-flow.d.ts +0 -43
- package/dist/queries/value-flow.js +0 -2
- package/dist/queries/wrapper-candidates.d.ts +0 -49
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-JNK5CLM7.js +0 -2
- package/dist/refs-pagination-6BLRYGMV.js +0 -2
- package/dist/slice-PHPVNCWX.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-MQX5MPIV.js +0 -2
- package/dist/symbol-resolution-DBLVXLBC.js +0 -2
- package/dist/system-JOPKV4OG.js +0 -2
- package/dist/trace-I2P2YFH4.js +0 -2
- package/dist/value-flow-JJVMF7NP.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
- package/skills/conductor/SKILL.md +0 -110
- package/skills/conductor/agents/openai.yaml +0 -4
- package/skills/principal-maintainability-review/SKILL.md +0 -273
- package/skills/principal-maintainability-review/agents/openai.yaml +0 -4
- package/skills/scip-calibrate/SKILL.md +0 -102
- package/skills/scip-calibrate/agents/openai.yaml +0 -4
- package/skills/scip-claim-audit/SKILL.md +0 -113
- package/skills/scip-claim-audit/agents/openai.yaml +0 -4
- package/skills/scip-probe-reachability/SKILL.md +0 -93
- package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
- package/skills/scip-root-cause/SKILL.md +0 -160
- package/skills/scip-root-cause/agents/openai.yaml +0 -4
- package/skills/scip-system-compression/SKILL.md +0 -252
- package/skills/scip-system-compression/agents/openai.yaml +0 -4
- package/skills/scip-system-compression/references/compression-atlas.md +0 -116
- package/skills/scip-system-compression/references/compression-patterns.md +0 -87
- package/skills/scip-twin-drift/SKILL.md +0 -109
- package/skills/scip-twin-drift/agents/openai.yaml +0 -4
package/dist/chunk-NYKZMCRC.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-POBJ6FR2.js";import{a as v}from"./chunk-WDSFQDPN.js";import{q as S}from"./chunk-FI7VGOR4.js";import{a as b}from"./chunk-2USA3S3P.js";import{Q as p,R as g,i as d}from"./chunk-2VAHDDLM.js";import{c as u,d as f,g as m}from"./chunk-BL6DCHQP.js";function q(e,t,i={}){let n=T(e,t,i);return{definitions:n.definitions,referencedBy:n.referencedBy.map(r=>({relativePath:r.relativePath,line:r.line,enclosingSymbol:r.enclosingSymbol,enclosingShort:r.enclosingShort}))}}function T(e,t,i={}){let n=R(e,t,i);return{definitions:n.definitions,referencedBy:n.referencedBy}}function R(e,t,i={}){let n=b(e,t);if(!n)return{definitions:[],referencedBy:[],referenceEvidence:[],claimSupport:null};let r=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),c=g(r?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:K(c,r?.display_name??null,n.symbol),source:B(e,n.relativePath,n.startLine,n.endLine)}],h=i.referenceContext??2,s=S(e,n,{semantic:i.semantic,semanticEvidence:v}).map(l=>{let a=y(e,l.file,l.line,h,f(n.symbol));return{relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?u(l.enclosingSymbol):"(top-level)",provenance:l.provenance,sourceStartLine:a?.startLine??null,sourceEndLine:a?.endLine??null,source:a?.source??null,sourceKind:a?.kind??"unavailable"}}),E=s.map(x);return{definitions:o,referencedBy:E,referenceEvidence:s.map(l=>({relativePath:l.relativePath,line:l.line,provenance:l.provenance,sourceKind:l.sourceKind})),claimSupport:P(s)}}function x(e){return{relativePath:e.relativePath,line:e.line,enclosingSymbol:e.enclosingSymbol,enclosingShort:e.enclosingShort,sourceStartLine:e.sourceStartLine,sourceEndLine:e.sourceEndLine,source:e.source}}function P(e){let t="resolved source-attributed or SCIP-indexed references to this exact symbol",i=["Dynamic dispatch, reflection, generated calls, and unindexed source are outside this scope."],n=e.filter(c=>c.sourceKind!=="complete-call-expression"&&c.sourceKind!=="non-call-reference"),r="direct, statically visible call expressions among the resolved reference sites";return{referenceAbsence:{status:"eligible",scope:t,limitations:i},callsitePredicates:n.length===0?{status:"eligible",scope:r,limitations:i}:{status:"ineligible",scope:r,reason:`${n.length} reference site(s) lack one unambiguous complete call expression.`,followup:L(n)}}}function L(e){let t=[...new Set(e.map(i=>`${i.relativePath}:${i.line+1}`))];return t.length===0||t.length>24?null:`scip-query inspect ${t.map(i=>`--at ${C(i)}`).join(" ")} --view behavior`}function C(e){return`'${e.replaceAll("'","'\\''")}'`}function B(e,t,i,n){let r=d(e,t);if(!r)return null;let o=r.split(`
|
|
2
|
-
`).slice(i,n+1).join(`
|
|
3
|
-
`).trimEnd();return o.length>0?o:null}function K(e,t,i){let n=p(e);if(n&&!A(n))return n;let r=(t??"").trim();return r?m(i)&&!r.endsWith("()")?`${r}()`:r:u(i)}function A(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{q as a,T as b,R as c};
|
|
4
|
-
//# sourceMappingURL=chunk-NYKZMCRC.js.map
|
package/dist/chunk-O6BUXZEH.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{a as ie}from"./chunk-3Z5AMSK6.js";import{a as oe}from"./chunk-KXXORBZ2.js";import{b as D}from"./chunk-UXKURIVI.js";import{a as te}from"./chunk-SCPMZ73U.js";import{b as ne}from"./chunk-ROPJDEJZ.js";import{a as W,b as ee}from"./chunk-E65ELFKU.js";import{b as Q}from"./chunk-PSZPMMWN.js";import{g as V}from"./chunk-OIOC5EHF.js";import{a as H}from"./chunk-VDSDOEWF.js";import{a as q}from"./chunk-HOBOVYPO.js";import{c as Y}from"./chunk-KVQCECPR.js";import{a as X}from"./chunk-XKXTR6ZI.js";import{d as Z}from"./chunk-A4WEAK35.js";import{b as K}from"./chunk-NSM5IEVW.js";import{a as J}from"./chunk-NJT3ZEKY.js";import{a as w}from"./chunk-ZFVPWH62.js";import{a as G}from"./chunk-6D4F5VWG.js";import{a as j,c as z}from"./chunk-F5GSBHC6.js";import{b as $}from"./chunk-FLMTCX5R.js";import{e as P,v as A}from"./chunk-C7C6AKAT.js";import{y as U}from"./chunk-KNLQGXVH.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-O6BUXZEH.js.map
|
package/dist/chunk-ODPDP7A4.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as m}from"./chunk-2OOY75BW.js";import{a as p}from"./chunk-JFMEXGFE.js";import{$ as P,X as d,aa as h}from"./chunk-7HXT6YLU.js";import{g as f}from"./chunk-7F45LJKI.js";import{realpathSync as c}from"fs";import{basename as x,dirname as L,join as T,relative as I,sep as O}from"path";import{fileURLToPath as S,pathToFileURL as y}from"url";function F(n,e){return e==="."||e==="./"?y(c(n)).href:y(d(n,e).absolutePath).href}function b(n,e){let r=S(e);return I(c(n),v(r)).split(O).join("/")}function v(n){try{return c(n)}catch{try{return T(c(L(n)),x(n))}catch{return n}}}function H(n,e,r){return{textDocument:{uri:F(n,e.relativePath)},position:z(n,e),context:{includeDeclaration:r}}}function z(n,e){let r={line:e.startLine,character:e.startChar??0};try{return M(P(n,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(t){if(!h(t))throw t;return r}}function M(n,e,r={line:e.startLine,character:e.startChar??0}){let t=n.split(/\r?\n/),o=t[e.startLine];if(o===void 0||e.leaf.length===0)return r;let i=Math.max(0,Math.min(r.character,o.length)),s=o.indexOf(e.leaf,i);if(s>=0)return{line:e.startLine,character:u(s,e.leaf)};let a=o.indexOf(e.leaf);if(a>=0)return{line:e.startLine,character:u(a,e.leaf)};let l=D(t,e.startLine,e.leaf);return l||r}function u(n,e){return n+Math.max(0,e.length-2)}function D(n,e,r){for(let t of[-1,1,-2,2]){let o=e+t;if(o<0||o>=n.length)continue;let i=n[o].indexOf(r);if(i>=0)return{line:o,character:u(i,r)}}return null}function K(n,e){return e.map(r=>({file:b(n,r.uri),line:r.range.start.line,column:r.range.start.character}))}function X(n){let e=new Map;for(let r of n)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,t)=>{let o=r.file.localeCompare(t.file);return o!==0?o:r.line!==t.line?r.line-t.line:r.column-t.column})}import{randomUUID as E}from"crypto";import{readdirSync as $,rmSync as j,writeFileSync as A}from"fs";import{join as g}from"path";var R="rust-analyzer-owner-",w=".json",U=16*1024;function Z(n,e){if(!n||!e.rootIdentity)return null;let r=g(n,`${R}${e.rootPid}-${E()}${w}`),t={version:1,rootIdentity:e.rootIdentity,ownsProcessGroup:e.ownsProcessGroup};return A(r,`${JSON.stringify(t)}
|
|
2
|
-
`,{encoding:"utf8",mode:384,flag:"wx"}),r}function ee(n){n&&j(n,{force:!0})}async function re(n,e){if(!n)return[];let r;try{r=$(n)}catch{return[]}let t=r.filter(s=>s.startsWith(R)&&s.endsWith(w)).map(s=>g(n,s)),o=[],i=[];for(let s of t){let a=C(s);a?i.push(a):o.push({reaped:!1,reason:"identity-unavailable",detail:`Rust analyzer ownership record ${s} could not be validated.`})}return o.push(...await Promise.all(i.map(s=>m(s,e)))),o}function C(n){try{let e=f(n,{maxBytes:U,inputKind:"rust-analyzer process ownership record"}),r=JSON.parse(e),t=p(r.rootIdentity);return r.version!==1||!t||typeof r.ownsProcessGroup!="boolean"?null:{rootPid:t.pid,rootIdentity:t,ownsProcessGroup:r.ownsProcessGroup,knownMembers:new Map([[t.pid,t]])}}catch{return null}}export{Z as a,ee as b,re as c,F as d,b as e,H as f,K as g,X as h};
|
|
3
|
-
//# sourceMappingURL=chunk-ODPDP7A4.js.map
|
package/dist/chunk-OIAPEKMT.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as me}from"./chunk-E7QR35ST.js";import{a as de}from"./chunk-4FR6GQIT.js";import{b as ue}from"./chunk-BOJ5SVE2.js";import{c as T}from"./chunk-2BMSSRBH.js";import{a as N}from"./chunk-BJWFVAA5.js";import{j as le}from"./chunk-YSYPDRD5.js";import{g as ae,h as ce}from"./chunk-U3SXIMII.js";import{i as oe}from"./chunk-SKKXTABJ.js";import{a as ie,b as re,c as se}from"./chunk-KK7GPALL.js";import{e as ee,f as te,h as ne}from"./chunk-NJQISBL4.js";import{b as Q}from"./chunk-FLMTCX5R.js";import{E as R,d as Z,e as $,i as G,j as J,k as K,l as q,m as V,u as X,z as Y}from"./chunk-C7C6AKAT.js";import{y as H}from"./chunk-RBAD4GJ2.js";import{A as z,E as _,a as E}from"./chunk-ZLMXIQLC.js";import{c as U,e as j,h as I,k as W}from"./chunk-ETC674NS.js";import{b as P,i as B,y as b}from"./chunk-KNLQGXVH.js";import{d as w}from"./chunk-JZ2A7LDM.js";var S=new WeakMap,fe=U({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:Te});function ye(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let i=I(e,t);if(!i)return[];let s=B(e,t,i),c=fe.read(e,t,s);if(c)return c;let u=n==="rust"?je(e,t):Me(e,t);return fe.write(e,t,s,u),u}function Te(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(ke);return n.some(r=>r===null)?null:n}catch{return null}}function ke(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"||t.containerName!==void 0&&typeof t.containerName!="string")return null;let n=t.disposition===void 0?Ye(t.reason):t.disposition;return n!=="exclude"&&n!=="implicit-usage"?null:{startLine:t.startLine,endLine:t.endLine,reason:t.reason,disposition:n,...t.containerName?{containerName:t.containerName}:{}}}var be=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),Ae=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Fe=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Me(e,t){let n=I(e,t);if(!n||!Oe(n))return[];let r=_(e,t);if(!r)return[];let i=S.get(r);if(i)return i;let s=!1,c=r.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let o=d.namedChild(0);if(!o)continue;let a=o.type==="member_expression"?o.namedChild(o.namedChildCount-1)?.text:o.text;if(a&&be.has(a)){s=!0;break}}let u=[];s&&u.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)",disposition:"exclude"});for(let l of c.namedChildren){let d=null,o=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,o=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,o=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let p=a.namedChild(0)?.text,f=a.namedChild(1);p&&(f?.type==="arrow_function"||f?.type==="function_expression")&&(d=p,o=a)}}d&&/^use[A-Z]/.test(d)&&o&&u.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...ge(r,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),S.set(r,u),u}function Oe(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of be)if(e.includes(n)){t=!0;break}return t&&Ae.test(e)?!0:e.includes("use")&&Fe.test(e)}var Be=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Ue(e){return Be.test(e)}function ge(e,t,n){let r=[],i=s=>{if(t.has(s.type)&&s.parent){let u=s.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===s.startIndex&&u[d].type===s.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let o=u[d];if(n.has(o.type)){if(Ue(o.text)){r.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"scip-query suppression comment",disposition:"exclude"});break}continue}if(!(o.type==="attribute_item"||o.type==="inner_attribute_item"))break}}for(let c of s.namedChildren)i(c)};return i(e.rootNode),r}function je(e,t){let n=_(e,t);if(!n)return[];let r=S.get(n);if(r)return r;let i=[],s=We(n);return s?(S.set(n,s),s):(he(n.rootNode,i,!1,!1),i.push(...ge(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),i.push(...Ve(n.rootNode)),S.set(n,i),i)}function We(e){return Qe(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function he(e,t,n,r){let i=n,s=r;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)",disposition:"implicit-usage"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(s=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)",disposition:"implicit-usage"})),e.type==="function_item"||e.type==="function_signature_item"?ze(e,t,n,r):r&&qe(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)",disposition:"implicit-usage"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?He(e,t,n):e.type==="mod_item"&&k(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(i=!0);for(let c of e.namedChildren)he(c,t,i,s)}function ze(e,t,n,r){let i=k(e),s=null;r?s={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(s={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of i){if(xe(c)){s={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=Je(c);if(u){s=u;break}}s&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:s.reason,disposition:s.disposition})}function He(e,t,n){let r=k(e),i=e.namedChildren.find(s=>s.type==="type_identifier")?.text;r.some(Ke)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:i}),r.some(xe)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:i}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:i})}function k(e){let t=e.parent;if(!t)return[];let n=t.children,r=-1;for(let s=0;s<n.length;s+=1)if(n[s].startIndex===e.startIndex&&n[s].type===e.type){r=s;break}if(r<=0)return[];let i=[];for(let s=r-1;s>=0;s-=1){let c=n[s];if(c.type==="attribute_item"||c.type==="inner_attribute_item")i.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return i}var Ze=new Set(["test","bench","tokio::test","async_std::test"]),$e=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),Ge=new Set(["allow","warn","deny","forbid","cfg","cfg_attr","doc","inline","cold","must_use","deprecated","repr","derive","automatically_derived","non_exhaustive","path","link","link_section","global_allocator","panic_handler"]);function Je(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=Xe(e);return t?Ze.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:$e.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:Ge.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function Ke(e){return/#\[\s*derive\s*\(/.test(e)}function xe(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function qe(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ve(e){let t=et(e);if(t.size===0)return[];let n=[];for(let r of e.descendantsOfType("mod_item")){let i=r.childForFieldName("name")?.text;i&&t.has(i)&&n.push({startLine:r.startPosition.row,endLine:r.endPosition.row,reason:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:i})}return n}function Xe(e){let t=/^#!?\[\s*([A-Za-z_][A-Za-z0-9_]*(?:\s*::\s*[A-Za-z_][A-Za-z0-9_]*)*)/.exec(e);return t?t[1].replace(/\s+/g,""):null}function Ye(e){return e==="#[tauri::command]"||e==="#[command]"||e==="#[wasm_bindgen]"||e==="#[no_mangle]"||e==="#[napi]"||e==="#[pyfunction]"||e==="#[pymethod]"||e==="#[pyo3]"||e==="#[doc(hidden)]"||e.startsWith("trait ")||e.startsWith("#[derive(<reflective>)]")||e.startsWith("#[derive(...)]")||e.startsWith('serde `with = "')||e.startsWith('attribute `with = "')||e.startsWith("Rust attribute macro #[")||e.startsWith("Rust ABI/export attribute #[")?"implicit-usage":"exclude"}function Qe(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var pe=/\bwith\s*=\s*"([^"]+)"/g;function et(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){pe.lastIndex=0;let r;for(;(r=pe.exec(n.text))!==null;){let i=r[1],s=i.split("::").pop()??i;s&&t.add(s)}}return t}function _e(e){let t=A(e);return(n,r,i,s)=>t(n,r,i,s)?.disposition==="exclude"}function A(e){let t=new Map,n=r=>{let i=t.get(r);if(i)return i;let s=ye(e,r),c=new Map;for(let u of s){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return i={ranges:s,containers:c},t.set(r,i),i};return(r,i,s,c)=>{let u=n(r),l=[];for(let o of u.ranges)i>=o.startLine&&i<=o.endLine&&l.push(o);let d=new Set;c&&d.add(c);for(let o of R(s))d.add(o);for(let o of d){let a=u.containers.get(o);a&&l.push(...a)}return tt(l)}}function tt(e){if(e.length===0)return null;let n=e.find(r=>r.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function Lt(e,t={}){P(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function Se(e,t,n={}){P(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function Ee(e,t){if(t.isIgnoredPath(e.relativePath))return y("ignored-file");if(K(e.symbol))return y("module-like-symbol");if(!C(e.symbol))return y("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&C(e.enclosingSymbol))return y("nested-non-callable-value");if(!t.includeTests&&!nt(e.relativePath))return y("test-file");if(!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName))return y("excluded-file-region");let n=$(e.symbol);if(n==="<constructor>")return y("implicit-constructor");if(e.symbol.startsWith("scip-python ")){if(n==="__all__")return y("python-runtime-metadata");if(/^__[^_].*__$/.test(n))return y("python-protocol-member")}return t.isDeclarationOnlyCallable()?y("declaration-only-callable"):t.isFrameworkContractCallable()?y("framework-contract-member"):q(e.symbol)?y("rust-trait-impl-member"):V(e.symbol)?y("rust-test-module"):!t.includeMembers&&!it(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}}function nt(e){return Q(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function C(e){return J(e)||e.endsWith("().")||e.endsWith(".")}function it(e){return G(e.symbol)||R(e.symbol).length===0}function Re(){return new Map}function Ce(e,t,n){let r=new Map;for(let i of ie(e,n))e.isIgnored(i.relative_path)||t.has(i.relative_path)||D(r,i.symbol_id,i.relative_path,i.ref_count,"scip-mention");return r}function ve(e,t,n,r={}){let i=new Set;if(r.conservative||n.size===0){for(let s of se(e,t))i.add(s.symbol_id);return i}for(let s of re(e,t))e.isIgnored(s.relative_path)||n.has(s.relative_path)||i.add(s.symbol_id);return i}function F(e,t){let n=e.get(t);if(!n)return!1;for(let r of n.values())if(r.occurrences>0)return!0;return!1}function v(e,t,n){let r=e.get(t);if(!r)return!1;for(let[i,s]of r)if(i!==n&&s.occurrences>0)return!0;return!1}function De(e){return e?.occurrences??0}function D(e,t,n,r,i="source-fallback"){if(r<=0)return;let s=we(e,t,n);s.occurrences+=r,s.sources.add(i)}function Le(e,t,n,r,i){if(r<=0)return;let s=we(e,t,n);s.occurrences=Math.max(r,s.occurrences),s.sources.add(i)}function we(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=r.get(n);return i||(i={occurrences:0,sources:new Set},r.set(n,i)),i}var rt=64,st=300;function nn(e,t={}){let{scope:n,minLoc:r=1,includeTests:i=!1,skipBarrels:s=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,o=0,a=b("dead.candidates",()=>{let m=ue(ot(e,{scope:n,minLoc:r,includeTests:i,includeMembers:c}),l);return o=m.length,m},()=>({definitions:o})),p=0,f=s?b("dead.inactive-barrels",()=>{let m=new Set(ee(e));return p=m.size,m},()=>({paths:p})):new Set,x=0,g=u?Re():b("dead.mention-reference-counts",()=>{let m=Ce(e,f,a.map(L=>L.symbolId));return x=m.size,m},()=>({definitions:a.length,symbolsWithReferences:x})),M=0,Ie=u?b("dead.mentioned-symbol-ids",()=>{let m=ve(e,a.map(L=>L.symbolId),f,{conservative:f.size===0});return M=m.size,m},()=>({definitions:a.length,referencedSymbols:M})):new Set,h=u?a.filter(m=>!Ie.has(m.symbolId)):a.filter(m=>!v(g,m.symbolId,m.relativePath));u?b("dead.source-fallback.dead-code-only",()=>ft(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0})):b("dead.source-fallback.ast",()=>mt(e,h,g,{inactiveBarrelPaths:f}),()=>({definitions:h.length,testReferencesIncluded:!0}));let O=u?h.filter(m=>!F(g,m.symbolId)):h.filter(m=>!v(g,m.symbolId,m.relativePath));b("dead.caller-map-supplement",()=>gt(e,O,g,{inactiveBarrelPaths:f,includeSemantic:!u&&d}),()=>({definitions:O.length,semantic:!u&&d}));let Ne=u?h.filter(m=>!F(g,m.symbolId)):a;return dt(e,lt(Ne,g))}function ot(e,t){let n=_e(e),r=[];for(let i of Y(e,{scope:t.scope,symbolMatches:C,sqlPrefilter:"function-like"}))Ee(i,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>ct(e,i),isFrameworkContractCallable:()=>me(e,i)}).accepted&&r.push(i);return r}var at=["method_signature","abstract_method_signature","call_signature","construct_signature"];function ct(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=_(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...at]).some(i=>i.startPosition.row<=t.startLine&&i.endPosition.row>=t.endLine);let r=W(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
|
|
2
|
-
`).trim();return r.endsWith(";")&&!r.includes("=>")&&!r.includes("{")}function lt(e,t){return e.map(n=>ut(n,t)).filter(n=>n.cross_file_refs===0).sort((n,r)=>r.loc-n.loc||n.relative_path.localeCompare(r.relative_path)||n.start_line-r.start_line)}function ut(e,t){let n=t.get(e.symbolId)??new Map,r=De(n.get(e.relativePath)),i=0;for(let[s,c]of n)s!==e.relativePath&&(i+=c.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,parent_type_name:e.parentTypeName,same_file_refs:r,cross_file_refs:i}}function dt(e,t){let n=A(e),r=[],i=0,s=0,c=0,u=0,l=0,d=0,o=0;for(let a of t){if(e.isIgnored(a.relative_path))continue;if(te(e,a.relative_path)){u++;continue}if(de(a.relative_path)){d++;continue}if(ne(e,a.symbol,a.relative_path)){l++;continue}let p=n(a.relative_path,a.start_line,a.symbol,a.parent_type_name),f=p?.disposition==="implicit-usage"?p.reason:void 0,x=f?"implicit-usage":a.same_file_refs===0?"dead-code":"file-internal";x==="dead-code"?i++:x==="file-internal"?s++:c++,o+=a.loc,r.push({relativePath:a.relative_path,startLine:a.start_line,endLine:a.end_line,loc:a.loc,symbol:a.symbol,shortName:Z(a.symbol),sameFileRefs:a.same_file_refs,kind:x,...f?{implicitUsageReason:f}:{}})}return{symbols:r,counts:{total:r.length,deadCode:i,fileInternal:s,implicitUsage:c,loc:o},applicability:{entrySurfaceExcluded:u,externalRootExcluded:l,generatedArtifactExcluded:d,implicitUsageSignals:c},totalCount:r.length,deadCodeCount:i,fileInternalCount:s,implicitUsageCount:c,totalLoc:o}}function mt(e,t,n,r){if(t.length===0)return;let i=new T(e),s=new Set(t.map(l=>l.symbolId)),c=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(i.sourceFiles());for(let l of E(e))u.add(l);i.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:l=>r.inactiveBarrelPaths.has(l)},l=>{s.has(l.target.symbolId)&&(yt(e,l)||D(n,l.target.symbolId,l.sourceFile,bt(l),"source-fallback"))})}function ft(e,t,n,r){if(t.length===0)return;let i=new T(e),s=X(t),c=new Set(i.sourceFiles());for(let o of E(e))c.add(o);let u=new Set(s.keys()),l=new Map,d=o=>{let a=l.get(o);return a||(a=oe(e,o),l.set(o,a)),a};i.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:o=>r.inactiveBarrelPaths.has(o),resolveTargets:({sourceFile:o,name:a,kind:p})=>{let f=s.get(a);return f?pt(o,a,f,()=>d(o),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:o=>{l.delete(o),Se(e,o)}},o=>{let a=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&Pe(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:a})||D(n,o.target.symbolId,o.sourceFile,a,"source-fallback")})}function pt(e,t,n,r,i){let s=n.filter(d=>d.relativePath===e);if(s.length>0)return s;if(!i.permissive&&n.length===1)return[...n];let c=r(),u=c.get(t);if(u)for(let d of u){let o=n.filter(a=>w(d,a.relativePath));if(o.length>0)return o}let l=new Set;for(let d of c.values())for(let o of d)l.add(o);for(let d of l){let o=n.filter(a=>w(d,a.relativePath));if(o.length>0&&o.length===n.length)return o}return i.permissive?[...n]:[]}function yt(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Pe(e,t)}function bt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Pe(e,t){return t.occurrences>1?!1:H(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function gt(e,t,n,r){let i=r.includeSemantic!==!1,s=i&&t.length>=rt&&E(e).length>=st,c=(o,a)=>{a===o.relativePath||e.isIgnored(a)||r.inactiveBarrelPaths.has(a)||Le(n,o.symbolId,a,1,"caller-map")};if(s?b("dead.caller-map.per-symbol-non-semantic",()=>{let o=ce(e,t,{semantic:!1,semanticEvidence:N});for(let a of t){let p=o.get(a.symbolId)??[];for(let f of p)c(a,f.file)}},()=>({definitions:t.length,semantic:!1,batched:!0})):b("dead.caller-map.per-symbol",()=>{for(let o of t){let a=ae(e,o,{semantic:i,semanticEvidence:N});if(a.length!==0)for(let p of a)c(o,p.file)}},()=>({definitions:t.length,semantic:i})),!s)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let o=t.filter(a=>!v(n,a.symbolId,a.relativePath));return u=o.length,o},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=le(e,l);for(let o of l){let a=d.get(o.symbolId);if(a)for(let p of a)c(o,p)}}export{Lt as a,nn as b};
|
|
3
|
-
//# sourceMappingURL=chunk-OIAPEKMT.js.map
|
package/dist/chunk-OIOC5EHF.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as E}from"./chunk-FJF6VO2P.js";import{c as d}from"./chunk-XKXTR6ZI.js";import{b as L}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-BGBBVSH4.js";import{j as x}from"./chunk-NJQISBL4.js";import{b}from"./chunk-FLMTCX5R.js";import{d as B,e as D,w as h}from"./chunk-C7C6AKAT.js";import{b as g}from"./chunk-RBAD4GJ2.js";import{k as f,n as y}from"./chunk-ETC674NS.js";import{createHash as G}from"crypto";var C=3;function Q(e,t={}){return T(e,t).groups}function T(e,t={}){let{scope:n,maxLoc:i=15,minLoc:o=C,limit:r,scanLimit:s}=t,a=d(e),l=v(e,{scope:n,maxLoc:i,scanLimit:s}).map(p=>P(e,p,a,o)).filter(p=>p!==null),{groups:u,exclusions:c}=F(e,M(l));return{groups:r?u.slice(0,r):u,exclusions:c}}var W=/^(?:GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD|default|loader|action|load|actions)$/;function F(e,t){let n=new Map,i=(r,s)=>{let a=n.get(r);a?a.count+=1:n.set(r,{reason:r,detail:s,count:1})},o=[];for(let r of t){let s=[];for(let a of r.functions){let l=O(e,a);if(l){i(l.reason,l.detail);continue}s.push(a)}s.length<2||new Set(s.map(a=>a.file)).size<2||o.push({hash:r.hash,canonical:s[0],functions:s})}return{groups:o,exclusions:[...n.values()].sort((r,s)=>r.reason.localeCompare(s.reason))}}function O(e,t){let n=D(t.symbol);return n.startsWith("<")&&n.endsWith(">")?{reason:"synthetic-members",detail:"duplicate constructors and other compiler-named members every class carries"}:b(t.file)==="test"?{reason:"test-file-members",detail:"duplicate bodies in test files (fixture reuse, not product duplication)"}:W.test(n)&&x(t.file)?{reason:"framework-route-exports",detail:"duplicate route-file verb exports whose identical glue the framework convention dictates"}:E(e,t.file)?{reason:"ui-kit-members",detail:"duplicate bodies in vendored UI-kit directories generated from one template"}:null}function Z(e,t,n={}){let{scope:i,maxLoc:o=15,minLoc:r=C,scanLimit:s}=n,a=d(e),l=v(e,{scope:i,maxLoc:o,scanLimit:s}).map(c=>P(e,c,a,r)).filter(c=>c!==null),u=l.find(c=>c.symbol===t);return u?l.filter(c=>c.symbol!==u.symbol&&c.normalizedBody===u.normalizedBody&&c.file!==u.file).sort(I).map(({normalizedBody:c,...p})=>p):[]}function w(e){let t=k(e);return g(t).replace(/\s+/g,"")}function M(e){let t=new Map;for(let i of e){if(i.normalizedBody.length<8)continue;let o=H(i.normalizedBody),r=t.get(o)??[];r.push(i),t.set(o,r)}let n=[];for(let[i,o]of t){let r=new Set(o.map(a=>a.file));if(o.length<2||r.size<2)continue;let s=[...o].sort(I).map(({normalizedBody:a,...l})=>l);n.push({hash:i,canonical:s[0],functions:s})}return n.sort((i,o)=>{let r=o.functions.length-i.functions.length;if(r!==0)return r;let s=z(o)-z(i);return s!==0?s:i.canonical.file.localeCompare(o.canonical.file)}),n}function v(e,t){let n=h(e,{scope:t.scope}).filter(i=>i.isFunctionLike&&!e.isIgnored(i.relativePath)).filter(i=>!y(e,i.relativePath,i.startLine,"similar")).filter(i=>m(i)<=t.maxLoc);return n.sort((i,o)=>m(o)-m(i)||i.relativePath.localeCompare(o.relativePath)),L(n,t.scanLimit)}function P(e,t,n,i){let o=A(e,t);if(!o||_(o)<i)return null;let r=R(e,t);return r?{symbol:t.symbol,shortName:B(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:n?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function R(e,t){let n=A(e,t);return n&&w(n)||null}function A(e,t){let n=f(e,t.relativePath);return n.length===0?null:n.slice(t.startLine,t.endLine+1).join(`
|
|
2
|
-
`)}function k(e){let t=0;for(let n=0;n<e.length;n+=1){let i=e[n];if(i==="("||i==="[")t+=1;else if(i===")"||i==="]")t=Math.max(0,t-1);else if(i==="{"){if(t===0)return S(e,n);t+=1}else if(i==="}")t=Math.max(0,t-1);else if(t===0&&i==="="&&e[n+1]===">"){let o=e.slice(n+2).trimStart();return o.startsWith("{")?S(o,0):o.replace(/;+\s*$/,"")}}return e}function S(e,t){let n=e.lastIndexOf("}");return n>t?e.slice(t+1,n):e}function _(e){return k(e).split(/\r?\n/).map(n=>n.trim()).filter(n=>n.length>0).length}function H(e){return G("sha256").update(e).digest("hex").slice(0,16)}function I(e,t){let n=e.ageCommits??-1;return(t.ageCommits??-1)-n||e.file.localeCompare(t.file)||e.startLine-t.startLine}function z(e){return e.functions.reduce((t,n)=>t+n.loc,0)}export{Q as a,T as b,Z as c,w as d,M as e,R as f,A as g,k as h};
|
|
3
|
-
//# sourceMappingURL=chunk-OIOC5EHF.js.map
|
package/dist/chunk-ONPPQM4G.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-ZGIQN2SX.js";import{f as o}from"./chunk-JZ2A7LDM.js";function g(e,r){return s(e).filter(t=>c({pattern:r,relativePath:t})).map(t=>({relativePath:t}))}function c(e,r){let t=typeof e=="string"?{pattern:e,relativePath:r}:e;if(typeof t.pattern!="string"||typeof t.relativePath!="string")throw new TypeError("pathMatchesGlob requires pattern and relativePath.");let n=o(t.pattern),a=o(t.relativePath);if(!/[*?]/.test(n))return a.includes(n);let l=n.includes("/")?n:`**/${n}`;return i(l.split("/"),a.split("/"))}function i(e,r){if(e.length===0)return r.length===0;let[t,...n]=e;return t==="**"?i(n,r)||r.length>0&&i(e,r.slice(1)):r.length===0||!f(t??"",r[0]??"")?!1:i(n,r.slice(1))}function f(e,r){let t="^";for(let n of e)n==="*"?t+="[^/]*":n==="?"?t+="[^/]":t+=p(n);return t+="$",new RegExp(t).test(r)}function p(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,c as b};
|
|
2
|
-
//# sourceMappingURL=chunk-ONPPQM4G.js.map
|
package/dist/chunk-OUHEZBYI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as f}from"./chunk-JFMI5SGB.js";import{a as L}from"./chunk-2USA3S3P.js";import{C as l,p as a}from"./chunk-2VAHDDLM.js";import{c as i,d as b,e as u,k as c}from"./chunk-BL6DCHQP.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-OUHEZBYI.js.map
|
package/dist/chunk-OVGYW7UD.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{A as R,C as ce,F as P,a as y,b as re,i as k,j as ie,v as T,w as se,y as j,z as ae}from"./chunk-DUULLZHZ.js";import{Kb as Z,Yb as h,Zb as ee,_b as C,ac as E,pc as te,q as H,r as X,rc as ne,vc as oe,y as w}from"./chunk-NWLVNU66.js";import{Bc as z,ac as q,dd as D,ed as x,gd as I,pd as _,qd as Q,sd as Y,vc as L}from"./chunk-2XWIUW5Z.js";function de(t,n,e){if(!Number.isSafeInteger(e.limit)||e.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=D(t,n);if(!o)return{rows:[],hasMore:!1,producer:e.producer??"source-keyset",semanticEnrichment:!1};if(e.producer==="complete-only"||e.semantic===!0||o.relativePath.endsWith(".rb"))return B(t,n,e);let s=_(t,o);if(!s)return B(t,n,e);let i=ue(t,o),c=De(t,i),a=[],l=e.producer==="source-keyset";for(let u of c){if(e.after&&u<e.after.relativePath)continue;e.instrumentation?.fileScanned?.(u);let p=Q(t,s,u);p.length>0&&(l=!0);let d=new Set(p);i?.relativePath===u&&d.add(i.line);for(let m of[...d].sort((f,Ne)=>f-Ne)){let f={relativePath:u,line:m};if(!(e.after&&b(f,e.after)<=0)&&(a.push(f),e.instrumentation?.rowAccepted?.(f),l&&a.length>e.limit))return le(a,e.limit)}}return l?le(a,e.limit):B(t,n,e,i)}function b(t,n){return(t.relativePath<n.relativePath?-1:t.relativePath>n.relativePath?1:0)||t.line-n.line}function le(t,n){return{rows:t.slice(0,n),hasMore:t.length>n,producer:"source-keyset",semanticEnrichment:!1}}function B(t,n,e,o){let r=D(t,n),s=e.semantic===!0||r?.relativePath.endsWith(".rb")?w(t,n,{semantic:e.semantic}):Le(t,n,o),i=Ie(s).filter(c=>!e.after||b(c,e.after)>0);for(let c of i.slice(0,e.limit+1))e.instrumentation?.rowAccepted?.(c);return{rows:i.slice(0,e.limit),hasMore:i.length>e.limit,producer:"complete-only",semanticEnrichment:e.semantic===!0}}function Le(t,n,e){let o=D(t,n);if(!o)return[];let r=e===void 0?ue(t,o):e,s=Y(t,o).map(i=>({relativePath:i.file,line:i.line}));return r?[r,...s]:s}function ue(t,n){return!z(n.symbol)&&!t.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function De(t,n){let e=q(t);return!n||e.includes(n.relativePath)?e:[...e,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function Ie(t){let n=new Map;for(let e of t)n.set(`${e.relativePath}\0${e.line}`,e);return[...n.values()].sort(b)}import{InvalidArgumentError as v}from"commander";var gt=Z,ke=/^[+-]?\d+$/u,Ae=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,pt=(t=>G(t,"an integer")),me=(t=>{let n=G(t,"a non-negative integer");if(n<0)throw new v(`Expected a non-negative integer, got "${t}".`);return n}),fe=(t=>{let n=G(t,"a positive integer");if(n<1)throw new v(`Expected a positive integer, got "${t}".`);return n}),ht=(t=>{if(!Ae.test(t))throw new v(`Expected a number, got "${t}".`);let n=Number(t);if(!Number.isFinite(n))throw new v(`Expected a finite number, got "${t}".`);return n});function G(t,n){if(!ke.test(t))throw new v(`Expected ${n}, got "${t}".`);let e=Number(t);if(!Number.isSafeInteger(e))throw new v(`Expected ${n}, got "${t}".`);return e}function g(t,n,e,...o){return o.length>0?{flags:t,description:n,parser:e,defaultValue:o[0]}:{flags:t,description:n,parser:e}}function Me(){return g("--json","Output as JSON for programmatic consumption")}function Te(){return g("--compact","Emit minified one-line JSON (use with --json)")}function je(){return g("--result-only","Emit only the command-owned result (use with --json)")}function ge(t=[]){return A(t)}function A(t=[]){let n=[Me(),je(),Te()],e=new Set(n.map(o=>o.flags));return[...t.filter(o=>!e.has(o.flags)),...n]}function $(t,n=[]){return{category:t,examples:n}}function Ct(t,n){return{origin:"mixed",observedSources:t,producerValidation:{status:"not-evaluated"},families:n}}function yt(t,n){return{origin:t,observedSources:n,producerValidation:{status:"not-evaluated"}}}function Rt(t,n,e){return{id:t,selector:n,origin:{kind:"fixed",origin:e}}}function bt(t,n,e,o){return{id:t,selector:n,origin:{kind:"result-field",field:e,values:o}}}function O(t,n,e,o,r,s,i){return{answers:typeof t=="string"?[t]:t,returns:typeof n=="string"?[n]:n,inputs:e,coverage:o,operation:s,semantic:i,...r?{scope:r}:{}}}function vt(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,F(i.join(" "),c.join("; "),["This command establishes only its declared result units and evidence contract."],void 0,{outputCost:o==="complete"?"bounded":"variable"}))}function pe(t,n,e,o,r,s=y){let i=typeof t=="string"?[t]:t,c=typeof n=="string"?[n]:n;return O(i,c,e,o,r,s,Be(c.join("; "),["This command does not establish repository graph relationships unless its result says so explicitly."]))}function he(t,n,e={ranking:"identity-only"}){return{kind:"locator",locates:t,nonClaims:n,outputCost:"small",frontierClosure:["evidence","inspect","code"],...e}}function St(t){return{kind:"graph-projection",outputCost:"bounded",frontierClosure:["inspect","code"],...t}}function Ce(t,n,e,o={}){return{kind:"source-read",reads:t,nonClaims:n,outputCost:"potentially-large",frontierClosure:[],...e?{compatibility:e}:{},...o}}function F(t,n,e,o,r={}){return{kind:"analysis",analysis:t,resultMeaning:n,nonClaims:e,outputCost:"bounded",frontierClosure:["inspect","code"],...o?{compatibility:o}:{},...r}}function Be(t,n,e,o={}){return{kind:"maintenance",effect:t,nonClaims:n,outputCost:"variable",frontierClosure:[],...e?{compatibility:e}:{},...o}}function V(t){return Buffer.from(JSON.stringify(t),"utf8").toString("base64url")}function M(t){return t.generation.identity}function J(t){return"after"in t?V({version:2,...t}):V({version:1,...t})}function ye(t,n){let e=Ve(t);if(!Ge(e)&&!Fe(e))throw new Error("Invalid result cursor. Run the command again without --cursor.");return Je(e,n),e}function Ge(t){if(!t||typeof t!="object")return!1;let n=t;return n.version===1&&typeof n.command=="string"&&typeof n.target=="string"&&Number.isSafeInteger(n.offset)&&(n.offset??-1)>=0&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Fe(t){if(!t||typeof t!="object")return!1;let n=t,e=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!e&&typeof e.relativePath=="string"&&e.relativePath.length>0&&Number.isSafeInteger(e.line)&&(e.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function Ve(t){try{return JSON.parse(Buffer.from(t,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function Je(t,n){if(t.command!==n.command||t.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(t.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function N(t,n){let e=x(t,n);return e.match?{matched:!0,resolved:{symbol:e.match.symbol,shortName:L(e.match.symbol),relativePath:e.match.relativePath},otherMatches:e.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:e.total}:{matched:!1,suggestions:I(t,n,5)}}function Re(t){let n=t.entries[0];return t.requested===1&&n?.status==="matched"&&n.kind==="source"&&(!n.rangeCoverage||n.rangeCoverage.referencedDefinitions===0)&&n.results.length===1?n.results[0]:null}function be(t,n,e){if(!e)return N(t,n);let o={file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
|
|
3
|
-
`).map((i,c)=>({line:S(e.startLine+c),text:i}))},r=N(t,n),s=r.totalMatches??0;return!r.matched||!r.resolved||s<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:s}}}function ve(t){return{requested:t.requested,matched:t.matched,ambiguous:t.ambiguous,missing:t.missing,entries:t.entries.map(n=>({selector:n.selector,status:n.status,kind:n.kind,totalCandidates:n.totalCandidates,sources:n.results.map(e=>({file:e.relativePath,symbol:e.shortName,language:e.language??"unknown",range:{startLine:S(e.startLine),endLine:S(e.endLine)},...e.freshness?{freshness:e.freshness}:{},lines:e.source.split(`
|
|
4
|
-
`).map((o,r)=>({line:S(e.startLine+r),text:o}))})),definitions:n.definitions,...n.fileCoverage?{fileCoverage:n.fileCoverage}:{},...n.rangeCoverage?{rangeCoverage:n.rangeCoverage}:{},candidates:n.candidates,omittedCandidates:n.omittedCandidates,suggestions:n.suggestions,...n.reason?{reason:n.reason}:{}})),literalValues:t.bindingClosure.inline}}function S(t){return t+1}function Se(t,n){let e=x(t,n),o=Ke(e);for(let r of o)console.log(r)}function xe(t,n,e="No results found for resolved symbol."){return x(t,n).match?e:U(n,I(t,n,5))}function K(t,n,e,o){return{...N(t,n),[o]:e}}function U(t,n){let e=`No definition matched '${t}'.`;return n.length>0?`${e} Suggestions: ${n.join(", ")}`:e}function Ke(t){if(!t.match||t.total<=1)return[];let n=t.match,e=Math.max(0,t.total-1),o=[`Resolved: ${L(n.symbol)} (${n.relativePath}) -- ${e} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=t.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${h(s.startLine)})`).join("; ")}`),o.push(""),o}var Ue=k(({db:t,args:n,opts:e})=>{let o=T(n,0),r=R(e,"signatures"),s=H(t,o);if(R(e,"json")){P("outline",n,e,s);return}if(console.log(`\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550
|
|
5
|
-
file=${JSON.stringify(o)}; signatures=${r?"shown":"hidden"}`),s.length===0){console.log(`
|
|
6
|
-
\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550
|
|
7
|
-
No compiler-owned constructs were found for ${JSON.stringify(o)}.`),console.log(`
|
|
8
|
-
\u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550
|
|
9
|
-
Missing compiler constructs do not establish that the current text file is empty or irrelevant.`),console.log(`
|
|
10
|
-
\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550
|
|
11
|
-
Compiler ownership is unavailable or empty for this exact file selector.`),console.log(`
|
|
12
|
-
\u2550\u2550\u2550 RECOVERY \u2550\u2550\u2550
|
|
13
|
-
Read current source exactly with: scip-query code ${W(o)}`);return}function i(c,a){for(let l of c){let u=" ".repeat(a),p=r&&l.signature?` - ${Ee(l.signature)}`:"";console.log(`${u}${ee(l.startLine,l.endLine)} ${l.shortName}${p}`),i(l.children,a+1)}}console.log(`
|
|
14
|
-
\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550`),i(s,0),console.log(`
|
|
15
|
-
\u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550
|
|
16
|
-
These are compiler-owned identities and source ranges. Ownership and nesting do not establish execution or task relevance.`),console.log(`
|
|
17
|
-
\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550
|
|
18
|
-
${we(s)} compiler construct(s) returned in ${s.length} top-level tree(s).`),console.log(`
|
|
19
|
-
\u2550\u2550\u2550 RECOVERY \u2550\u2550\u2550
|
|
20
|
-
Every displayed file:line is an exact evidence root. Exact top-level symbol selectors:`);for(let c of s){let a=`'${c.symbol.replaceAll("'","'\\''")}'`;console.log(` ${c.shortName}: ${a}`)}});function we(t){return t.reduce((n,e)=>n+1+we(e.children),0)}function Ee(t){return t.length>120?`${t.slice(0,117)}...`:t}var We=ie("refs",({db:t,args:n,opts:e,budget:o})=>{let r=T(n,0),s=j(e,"cursor"),i=ae(e,"limit"),c=M(t),a=s?ye(s,{command:"refs",target:r,indexGeneration:c}):void 0,l=!a&&i===void 0,u=l?qe(t,r,o.semantic):a?.version===1?ze(t,r,a.offset,i??50,o.semantic):_e(t,r,{limit:i??50,cursor:a,semantic:a?.semanticEnrichment??R(e,"full"),indexGeneration:c}),{rows:p,continuation:d,coverage:m}=u;if(R(e,"json")){let f={...K(t,r,p,"references"),pagination:u.pagination};P("refs",n,e,f,{analysisBudget:o.analysisBudget,coverage:m});return}if(p.length===0)return E.empty(xe(t,r,"No references found."));if(Se(t,r),E.groupedByFile(p,f=>` line ${h(f.line)}`),u.pagination.producer==="complete-only"&&!l&&console.error(`
|
|
21
|
-
This evidence provider required complete analysis; --limit bounded the returned rows, not analysis work.`),d){let f=m.totalKnown?`${m.omitted} omitted; `:"More references are available; ";console.log(`
|
|
22
|
-
${f}continue with --cursor ${d.cursor}`)}});function qe(t,n,e){let o=w(t,n,{semantic:e}).sort(b);return{rows:o,coverage:{complete:!0,totalKnown:!0,returned:o.length,total:o.length,omitted:0},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:e}}}function ze(t,n,e,o,r){let s=w(t,n,{semantic:r}).sort(b);if(e>s.length)throw new Error("This cursor points past the current result set. Run again without --cursor.");let i=s.slice(e,e+o),c=e+i.length,a=i[i.length-1],l=e===0&&i.length===s.length,u=c<s.length&&a?{cursor:J({command:"refs",target:n,after:a,producer:"complete-only",semanticEnrichment:r,indexGeneration:M(t)}),indexGeneration:M(t)}:void 0;return{rows:i,continuation:u,coverage:l?{complete:!0,totalKnown:!0,returned:i.length,total:i.length,omitted:0}:{complete:!1,totalKnown:!0,returned:i.length,total:s.length,omitted:s.length-i.length,...u?{continuation:u}:{}},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:r}}}function _e(t,n,e){let o=de(t,n,{limit:e.limit,after:e.cursor?.after,producer:e.cursor?.producer,semantic:e.semantic}),r=o.rows[o.rows.length-1],s=o.hasMore&&r?{cursor:J({command:"refs",target:n,after:r,producer:o.producer,semanticEnrichment:o.semanticEnrichment,indexGeneration:e.indexGeneration}),indexGeneration:e.indexGeneration}:void 0,i=!e.cursor&&!o.hasMore;return{rows:o.rows,continuation:s,coverage:i?{complete:!0,totalKnown:!0,returned:o.rows.length,total:o.rows.length,omitted:0}:{complete:!1,totalKnown:!1,returned:o.rows.length,...s?{continuation:s}:{}},pagination:{cursorVersion:2,producer:o.producer,semanticEnrichment:o.semanticEnrichment}}}var Qe=k(({db:t,args:n,opts:e})=>{oe(t.config.projectRoot,"code",e.session!==!1);let o=se(n,0),r=ce(e,"context",0),s=He(e),i=X(t,o,{context:r,members:s}),c=Re(i);if(R(e,"json")){if(c){let u=o[0];P("code",o,e,K(t,u,c,"code"),{resultOnly:be(t,u,c)});return}P("code",o,e,i,{coverage:{complete:!0,totalKnown:!0,returned:i.entries.length,total:i.requested,omitted:0},resultOnly:ve(i)});return}let a=c?et(c,i.bindingClosure,!0):Xe(i,!0);if(c){process.stdout.write(a);return}let l=i.entries[0];if(i.requested===1&&l?.status==="missing")return E.empty(U(l.selector,l.suggestions));process.stdout.write(a)}),Ye=k(({opts:t})=>{let n=R(t,"reset"),e=ne(n);if(!e.enabled){E.empty(e.reason??"Exploration-session deduplication is unavailable.");return}console.log(n?"Exploration-session ledger reset; subsequent exploration will emit evidence again.":`Exploration session: ${e.uniqueLines.toLocaleString()} unique source line(s) and ${e.evidenceItems.toLocaleString()} graph evidence item(s) delivered across ${e.emissions.toLocaleString()} emission(s).`),!n&&e.rows.length>0&&console.log(e.rows.join(`
|
|
23
|
-
`))});function He(t){let n=j(t,"members")??"exported";if(n==="exported"||n==="all")return n;throw new RangeError(`--members must be "exported" or "all", got "${n}".`)}function Xe(t,n=!1){let e=["\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550",` ${t.entries.map(a=>a.selector).join(", ")}`,"",`\u2550\u2550\u2550 OBSERVED FACTS (${t.requested} requested: ${t.matched} matched, ${t.ambiguous} ambiguous, ${t.missing} missing) \u2550\u2550\u2550`],o=new Set;for(let a of t.entries)for(let l of a.results){let u=`${l.relativePath}:${l.startLine}:${l.endLine}`;if(o.has(u)){e.push("",` ${a.selector}: source already included at ${C(l.relativePath,l.startLine,l.endLine)}.`);continue}o.add(u),(t.requested>1||a.status==="ambiguous")&&e.push("",` selector ${a.selector}`),$e(e,l,n)}let r=t.entries.filter(a=>a.kind==="file-source");if(r.length>0){e.push("","\u2550\u2550\u2550 FILE SOURCE COVERAGE \u2550\u2550\u2550");for(let a of r)tt(e,a)}let s=t.entries.filter(a=>a.rangeCoverage);if(s.length>0){e.push("","\u2550\u2550\u2550 RANGE SOURCE COVERAGE \u2550\u2550\u2550");for(let a of s)Ze(e,a)}let i=t.entries.filter(a=>a.status==="ambiguous");if(i.length>0){e.push("","\u2550\u2550\u2550 AMBIGUOUS SELECTORS \u2550\u2550\u2550");for(let a of i)nt(e,a)}let c=t.entries.filter(a=>a.status==="missing");if(c.length>0){e.push("","\u2550\u2550\u2550 MISSING SELECTORS \u2550\u2550\u2550");for(let a of c){let l=a.suggestions.length>0?` Suggestions: ${a.suggestions.join(", ")}`:"";e.push(` ${a.selector}: ${a.reason==="definition-source-unreadable"?"definition source unreadable.":"no definition matched."}${l}`)}}return Oe(e,t.bindingClosure),Pe(e,t.entries.flatMap(a=>a.results)),ot(e,t),`${e.join(`
|
|
24
|
-
`)}
|
|
25
|
-
`}function Ze(t,n){let e=n.rangeCoverage;if(e&&(t.push(` ${n.selector} \u2014 requested lines returned plus ${e.returnedBodies} same-file callable body(ies), covering ${e.returnedDefinitions}/${e.referencedDefinitions} statically attributed same-file definition(s).`,` basis: ${e.basis}; dynamic calls and references outside the requested lines are not claimed`),e.omittedLedger.length!==0)){t.push(" OMITTED REFERENCED DEFINITIONS");for(let o of e.omittedLedger)t.push(` ${C(o.relativePath,o.startLine,o.endLine)} ${o.shortName}`)}}function et(t,n,e=!1){let o=["\u2550\u2550\u2550 REQUEST \u2550\u2550\u2550",` resolved-selector=${t.symbol}`,"","\u2550\u2550\u2550 OBSERVED FACTS \u2550\u2550\u2550"];return $e(o,t,e),Oe(o,n),Pe(o,[t]),o.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550"," One exact selector resolved to the complete source body shown; callers and runtime relationships are not implied."),`${o.join(`
|
|
26
|
-
`)}
|
|
27
|
-
`}function Pe(t,n){let e=n.flatMap(r=>r.freshness?[r.freshness]:[]);if(t.push("","\u2550\u2550\u2550 EVIDENCE CALIBRATION \u2550\u2550\u2550"," Source bodies are exact working-tree bytes; compiler identity and bindings are limited to reported semantic coverage."),e.length===0){t.push(" No source-freshness overlay was available.");return}let o={aligned:e.filter(r=>r.semantic.state==="aligned").length,stale:e.filter(r=>r.semantic.state==="stale").length,unavailable:e.filter(r=>r.semantic.state==="unavailable").length};t.push(` Freshness: ${e.length}/${n.length} text current; semantics ${o.aligned} aligned, ${o.stale} stale, ${o.unavailable} unavailable.`)}function $e(t,n,e){if(e){t.push(te({relativePath:n.relativePath,startLine:n.startLine,source:n.source,sessionPolicy:"exact-unit",ownerSymbol:n.shortName,headerSuffix:` ${n.shortName} [${n.language??"unknown"}]`,indent:"",sourceIndent:" ",showFocusMarker:!1,lineNumberWidth:4,blankAfterHeader:!0}));return}t.push(`${C(n.relativePath,n.startLine,n.endLine)} ${n.shortName} [${n.language??"unknown"}]`,"");let o=n.source.split(`
|
|
28
|
-
`);for(let r=0;r<o.length;r++)t.push(` ${String(h(n.startLine+r)).padStart(4)} ${o[r]}`)}function tt(t,n){let e=n.fileCoverage;if(!e||(t.push(` ${n.selector} \u2014 ${e.returnedBodies} source body(ies) cover ${e.returnedDefinitions}/${e.totalDefinitions} indexed definition(s); ${e.omittedDefinitions} omitted definition(s) disclosed below.`,` basis: ${e.basis}; members=${e.members}`),e.omittedLedger.length===0))return;t.push(" OMITTED FILE-LOCAL DEFINITIONS");for(let r of e.omittedLedger){let s=r.signature?` \u2014 ${Ee(r.signature)}`:"",i=r.nestedDefinitions>0?` (+${r.nestedDefinitions} nested definition(s))`:"";t.push(` ${" ".repeat(r.depth)}${C(r.relativePath,r.startLine,r.endLine)} ${r.shortName}${s}${i}`)}let o=e.omittedLedger.filter(r=>r.depth===0);for(let r=0;r<o.length;r+=24){let s=o.slice(r,r+24);t.push(` Read omitted units together: scip-query code ${s.map(i=>W(`${i.relativePath}:${h(i.startLine)}-${h(i.endLine)}`)).join(" ")}`)}}function nt(t,n){t.push(` ${n.selector} \u2014 ${n.totalCandidates} candidate(s); ${n.results.length>0?"all candidate bodies returned above":"no body selected"}.`);for(let e of n.candidates)t.push(` ${C(e.relativePath,e.startLine,e.endLine)} ${e.shortName}`);n.omittedCandidates>0&&t.push(` ... ${n.omittedCandidates} additional candidate identity(ies).`),n.candidates.length>0&&t.push(` Read shown candidates together: scip-query code ${n.candidates.map(e=>W(`${e.relativePath}:${h(e.startLine)}-${h(e.endLine)}`)).join(" ")}`)}function Oe(t,n){if(!(!n||n.inline.length===0)){t.push("","LITERAL VALUES");for(let e of n.inline)t.push(` inline ${e.name} @ ${C(e.relativePath,e.startLine,e.endLine)}`),t.push(` ${e.source??""}`)}}function ot(t,n){let e=n.entries.flatMap(d=>d.fileCoverage?[d.fileCoverage]:[]),o=n.entries.flatMap(d=>d.rangeCoverage?[d.rangeCoverage]:[]);if(e.length===0&&o.length===0){t.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550",` ${n.requested}/${n.requested} selector(s) resolved to shown source bodies; referenced definitions and runtime relationships are not claimed. Source lines use absolute file line numbers and are citation-ready.`);return}let r=e.reduce((d,m)=>d+m.returnedBodies,0),s=e.reduce((d,m)=>d+m.returnedDefinitions,0),i=e.reduce((d,m)=>d+m.totalDefinitions,0),c=e.reduce((d,m)=>d+m.omittedDefinitions,0),a=o.reduce((d,m)=>d+m.referencedDefinitions,0),l=o.reduce((d,m)=>d+m.returnedDefinitions,0),u=o.reduce((d,m)=>d+m.omittedDefinitions,0),p=[...e.length>0?[`${e.length} file selector(s) returned ${r} source body(ies) covering ${s}/${i} indexed definition(s); ${c} file-local definition(s) omitted and disclosed`]:[],...o.length>0?[`${o.length} range selector(s) covered ${l}/${a} statically attributed same-file definition(s); ${u} referenced definition(s) omitted and disclosed`]:[]];t.push("","\u2550\u2550\u2550 COVERAGE \u2550\u2550\u2550",` ${n.requested}/${n.requested} selectors resolved; ${p.join("; ")}. Source lines use absolute file line numbers and are citation-ready.`)}function W(t){return`'${t.replaceAll("'","'\\''")}'`}var Qt=[{id:"session",command:"session",description:"Show evidence already delivered in this agent exploration session",options:[g("--reset","Clear this agent exploration-session ledger")],agent:pe("Which indexed source ranges and graph facts have already been delivered in this exploration session?","prior command ordinals, exact source ranges, and content-bound graph receipts",[],"complete","repository",re("repository-observation",[{when:{kind:"option",name:"reset",equals:!0},role:"mutation"}])),renderShape:"custom",docs:$("Navigation"),handler:Ye},{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:ge([g("--full","Run unbounded semantic analysis on large indexes"),g("-n, --limit <n>","Maximum reference sites to return",fe),g("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{operation:y,answers:["Which files reference this symbol?","Is this symbol used anywhere, or only defined?"],returns:["referencing file paths","reference line numbers grouped by file"],inputs:["symbol"],coverage:"bounded",semantic:F("Resolve the exact reference sites attributed to one compiler symbol identity.","Referencing file paths and reference line numbers grouped by file.",["Reference sites do not establish runtime execution, data flow, or task relevance."]),contrasts:[{command:"imported-by",distinction:"imported-by lists files importing the symbol; refs covers every reference site, imported or not."},{command:"affected",distinction:"refs is one hop out; affected is the transitive closure of what could break."}]},renderShape:"grouped-by-file",docs:$("Navigation",["scip-query refs login"]),handler:We},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:{...O("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete",void 0,y,he(["file","symbol","construct"],["File ownership and nesting do not establish execution or task relevance."],{ranking:"identity-only",manualInput:"One exact current project file path.",evidenceCeiling:"Exact compiler-owned constructs and ranges when the file is indexed; no invented semantic overlay."})),contrasts:[{command:"search",distinction:"outline enumerates constructs in one known file; search locates exact text across current project text."},{command:"code",distinction:"outline returns identities and ranges; code materializes exact source for selected identities."}]},options:A([g("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:$("Navigation"),handler:Ue},{id:"code",command:"code <selectors...>",description:"Read exact definitions, ranges with local call closure, or file export surfaces",agent:{...O("What exact source defines these symbols, ranges, or file surfaces?","per-selector resolution, complete definition source, exact ranges with statically attributed same-file call closure, file export surfaces, omitted-local ledgers, and line ranges",[["symbol","file"]],"complete",void 0,y,Ce(["construct","exact-source"],["Source materialization does not establish callers, runtime reachability, or task relevance by itself."],void 0,{manualInput:"One or more exact symbols, file:line ranges, or file paths.",evidenceCeiling:"Exact current source bytes for every resolved selector, with omitted file-local constructs disclosed."})),resultUnits:{kind:"field",field:"code"},contrasts:[{command:"inspect",distinction:"code materializes complete exact source; inspect batches bounded behavior or source gaps."},{command:"outline",distinction:"code reads selected implementations; outline enumerates file structure without reading every body."}]},options:A([g("-C, --context <n>","Extra lines of context above/below",me,0),g("--members <exported|all>","For file selectors, return the exported surface or the complete file",void 0,"exported")]),renderShape:"custom",docs:$("Navigation",["scip-query code parseRequest handleRequest","scip-query code src/api.ts src/web.ts"]),handler:Qe}];export{gt as a,pt as b,me as c,fe as d,ht as e,g as f,Te as g,ge as h,A as i,$ as j,Ct as k,yt as l,Rt as m,bt as n,O as o,vt as p,pe as q,he as r,St as s,Ce as t,F as u,N as v,Se as w,xe as x,K as y,Qt as z};
|
|
29
|
-
//# sourceMappingURL=chunk-OVGYW7UD.js.map
|
package/dist/chunk-OYKU4B3Y.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as x}from"./chunk-E7QR35ST.js";import{b as g}from"./chunk-BOJ5SVE2.js";import{c as k}from"./chunk-2BMSSRBH.js";import{a as n}from"./chunk-BGBBVSH4.js";import{i as v}from"./chunk-YSYPDRD5.js";import{b as L}from"./chunk-FLMTCX5R.js";import{d as S}from"./chunk-C7C6AKAT.js";import{y as a}from"./chunk-KNLQGXVH.js";function E(c,f={}){let{scope:P,minLoc:F=3,scanLimit:d}=f,l=new k(c),b=f.semantic!==!1,y=0,m=a("isolated.candidates",()=>{let s=g(l.productionCallableDefinitions({scope:P,minLoc:F,excludeEntrySurfaces:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:typeof d=="number"&&d>0}),d).filter(R=>!x(c,R));return y=s.length,s},()=>({definitions:y})),p=0,i=a("isolated.strict-callees",()=>{let e=l.symbolsWithNonSelfCallees(m,{additive:!1,semantic:!1});return p=e.size,e},()=>({definitions:m.length,symbols:p})),r=m.filter(e=>!i.has(e.symbolId)),C=0,N=a("isolated.scip-callers",()=>{let e=l.crossFileCallerMap(r,{semantic:!1});return C=e.size,e},()=>({definitions:r.length,symbols:C})),o=new Set(N.keys());for(let e of l.frameworkReferencedSymbolIds(r))o.add(e);let t=r.filter(e=>!o.has(e.symbolId));if(b&&t.length>0){for(let e of v(c,t).keys())o.add(e);for(let e of l.symbolsWithNonSelfCallees(t,{additive:!1,semantic:!0}))i.add(e);t=t.filter(e=>!o.has(e.symbolId)).filter(e=>!i.has(e.symbolId))}let h=0,W=a("isolated.source-fallback-callers",()=>{let e=l.sourceFallbackCallerFiles(t,{skipPath:s=>L(s)==="test"});return h=e.size,e},()=>({definitions:t.length,symbols:h}));for(let e of W.keys())o.add(e);let u=t.filter(e=>!o.has(e.symbolId)),I=0,M=a("isolated.additive-callees",()=>{let e=l.symbolsWithNonSelfCallees(u,{additive:!0,semantic:b});return I=e.size,e},()=>({definitions:u.length,symbols:I}));for(let e of M)i.add(e);return u.filter(e=>!i.has(e.symbolId)).sort((e,s)=>n(s)-n(e)||e.relativePath.localeCompare(s.relativePath)||e.startLine-s.startLine).map(e=>({symbol:e.symbol,shortName:S(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:n(e)}))}export{E as a};
|
|
2
|
-
//# sourceMappingURL=chunk-OYKU4B3Y.js.map
|
package/dist/chunk-POBJ6FR2.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{g as x}from"./chunk-HAXXKRTD.js";import{l as m,y as b}from"./chunk-2VAHDDLM.js";var y=new Set(["call","call_expression","command","command_call","function_call_expression","invocation_expression","macro_invocation","method_call","method_invocation","new_expression","object_creation_expression"]);function h(n,e,t,r){if(!Number.isSafeInteger(t)||t<0)return null;if(!Number.isSafeInteger(r)||r<0)throw new RangeError(`contextLines must be a non-negative safe integer; received ${r}`);let i=m(n,e);if(i.length===0||t>=i.length)return null;let o=Math.max(0,t-r),c=Math.min(i.length-1,t+r);return{relativePath:e,startLine:o,endLine:c,focusLine:t,source:i.slice(o,c+1).join(`
|
|
2
|
-
`)}}function F(n,e,t,r,i){let o=h(n,e,t,r);if(!o)return null;let c=b(n,e)?.rootNode??null;if(!c)return{...o,kind:"bounded-context"};let s=_(c,t,i);if(s.length!==1)return{...o,kind:s.length===0?"non-call-reference":"bounded-context"};let l=s[0],a=m(n,e),u=Math.max(0,l.startPosition.row),S=l.endPosition.column===0?l.endPosition.row-1:l.endPosition.row,p=Math.min(a.length-1,Math.max(u,S));return{relativePath:e,startLine:u,endLine:p,focusLine:t,source:a.slice(u,p+1).join(`
|
|
3
|
-
`),kind:"complete-call-expression"}}function L(n,e,t,r,i=6){if(!Number.isSafeInteger(r)||r<=0)throw new RangeError(`maxLines must be a positive safe integer; received ${r}`);let o=m(n,e);if(o.length===0||t<0||t>=o.length)return null;let c=x(n,e,t);if(!c){let d=h(n,e,t,i);return d?{...d,unitType:null,unitStartLine:d.startLine,unitEndLine:d.endLine,omittedLines:0}:null}let s=c.startLine,l=c.endLine,a=l-s+1,u=Math.min(a,r),S=t-s-Math.floor(u/2),p=Math.max(0,Math.min(a-u,S)),f=s+p,g=f+u-1;return{relativePath:e,startLine:f,endLine:g,focusLine:t,source:o.slice(f,g+1).join(`
|
|
4
|
-
`),unitType:c.type,unitStartLine:s,unitEndLine:l,omittedLines:a-u}}function _(n,e,t){let r=[];return N(n,e,t,r),r.filter(i=>!r.some(o=>o!==i&&o.startIndex>=i.startIndex&&o.endIndex<=i.endIndex))}function N(n,e,t,r){if(M(n,e)){y.has(n.type)&&w(n)===t&&r.push(n);for(let i of n.namedChildren)N(i,e,t,r)}}function w(n){let e=n.childForFieldName("function")??n.childForFieldName("constructor")??n.childForFieldName("method")??n.childForFieldName("name")??n.namedChild(0);return e?e.text.match(/[\p{L}_$][\p{L}\p{N}_$!?-]*/gu)?.at(-1)??null:null}function M(n,e){return n.startPosition.row<=e&&n.endPosition.row>=e}export{F as a,L as b};
|
|
5
|
-
//# sourceMappingURL=chunk-POBJ6FR2.js.map
|
package/dist/chunk-PSZPMMWN.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as a}from"./chunk-BOJ5SVE2.js";import{a as m}from"./chunk-BJWFVAA5.js";import{f as b,g as S}from"./chunk-U3SXIMII.js";import{o as y}from"./chunk-SKKXTABJ.js";import{a as f}from"./chunk-F5GSBHC6.js";import{d as r}from"./chunk-C7C6AKAT.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=a(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m}).map(n=>({symbol:n.symbol,file:n.file}))),s=a(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:m})),c=s.length>0?s:a(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
|
|
2
|
-
//# sourceMappingURL=chunk-PSZPMMWN.js.map
|
package/dist/chunk-PXTRBKRK.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as Z}from"./chunk-7H6VHWWJ.js";import{f as q}from"./chunk-Y5DFAW5W.js";import{e as B}from"./chunk-BOJ5SVE2.js";import{c as Y}from"./chunk-2BMSSRBH.js";import{b as _}from"./chunk-U3SXIMII.js";import{d as Q,f as V}from"./chunk-SKKXTABJ.js";import{v as T}from"./chunk-C7C6AKAT.js";import{n as O}from"./chunk-RBAD4GJ2.js";import{k as M}from"./chunk-ETC674NS.js";var ae=6;function ee(e,n,t){return`${e}\0${n}\0${t??n}`}function Ee(e,n,t,a={}){let o=a.limit??ae;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${o}`);let u=a.sourceAllowed??(()=>!0),d=new Map(n.nodes.map(c=>[c.id,c])),f=new Set(t.steps.map(c=>c.nodeId)),r=new Set(t.steps.flatMap(c=>{let g=z(d.get(c.nodeId));return g?[g]:[]})),h=new Set;for(let c of t.steps)for(let g of c.behavior?.supportingDeclarations??[])r.add(g.symbol),h.add(ee(g.file,g.line,g.endLine));let b=c=>c.symbol!==null&&r.has(c.symbol)||h.has(ee(c.file,c.line,c.endLine)),y=new Map(t.steps.flatMap(c=>{if(!c.location)return[];let g=z(d.get(c.nodeId));if(!g)return[];let w=T(e,c.location.file).find(R=>R.symbol===g);return w?[[c.id,w]]:[]})),x=new Y(e).calleeMap([...y.values()],{additive:!1,semantic:!0}),l=[],i=new Set,C=new Set,m=0,A=0,L=0,S=0,I=0,p=0,s=0,N=0;for(let c of t.steps){if(!c.location||!c.behavior)continue;let g=ce(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b});l.push(...g.candidates),p+=g.upstreamCandidates,N+=g.runtimeCandidates,s+=g.resultCandidates;let w=de(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},i);l.push(...w);let R=ue(c,{db:e,topology:n,nodeById:d,returnedNodeIds:f,sourceAllowed:u,alternativeAlreadyReturned:b},{evidencedCallsiteKeys:i,consideredCandidateKeys:C,calleeMap:x,stepDefinition:y.get(c.id)});l.push(...R.candidates),m+=R.scannedBehaviorSteps,A+=R.visibleCallsites,L+=R.identityCandidateCallsites,S+=R.ambiguousCallsites,I+=R.unresolvedCallsites}return oe(e,l,t.steps,o,{scannedBehaviorSteps:m,visibleCallsites:A,graphEvidencedCallsites:i.size,identityCandidateCallsites:L,ambiguousCallsites:S,unresolvedCallsites:I,upstreamCandidates:p,resultCandidates:s,runtimeCandidates:N},a.selectionTerms)}function ce(e,n){let t=[],a=0,o=0,u=0;if(!e.location||!e.behavior)return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u};let d=n.topology.edges.filter(r=>["call","runtime-boundary"].includes(r.kind)&&(r.fromNodeId===e.nodeId||r.toNodeId===e.nodeId)&&r.disposition!=="excluded"&&r.disposition!=="unsupported");for(let r of d){let h=r.toNodeId===e.nodeId,b=h?r.fromNodeId:r.toNodeId;if(n.returnedNodeIds.has(b))continue;let y=n.nodeById.get(b);if(!y?.location||!n.sourceAllowed(y.location.file))continue;let x=r.kind==="call"?G(n.db,y):X(y);if(!x||n.alternativeAlreadyReturned(x))continue;let l=H(r,y.location.file)??y.location,i=M(n.db,l.file)[l.line]?.trim(),C=h?"upstream":"downstream",m=r.kind==="runtime-boundary"?h?"runtime-producer":"runtime-consumer":h?"caller":"callee",A=W(r.evidence),L=K(y);t.push({anchor:{id:E(e.id,l.line,y.id),status:A,source:"graph-relation",direction:C,causalRole:m,relationKind:r.kind,fromStepId:e.id,fromLabel:e.label,callsite:{file:l.file,line:l.line,endLine:l.endLine??l.line,text:i||`${y.label} \u2192 ${e.label}`,signals:["call"],calleeLeaf:L},alternatives:[x],alternativeCount:1,evidence:r.evidence}}),h&&(a+=1),r.kind==="runtime-boundary"&&(u+=1)}let f=n.topology.edges.filter(r=>r.kind==="reference"&&r.fromNodeId===e.nodeId&&r.disposition!=="excluded"&&r.disposition!=="unsupported"&&!n.returnedNodeIds.has(r.toNodeId));for(let r of f){let h=n.nodeById.get(r.toNodeId);if(!h?.location||!n.sourceAllowed(h.location.file))continue;let b=G(n.db,h);if(!b||n.alternativeAlreadyReturned(b))continue;let y=K(h),x=H(r,e.location.file)?.line,l=e.behavior.lines.find(m=>(x===void 0||x>=m.line&&x<=m.endLine)&&m.text.includes(y));if(!l)continue;let i=le(l.signals),C=W(r.evidence);t.push({anchor:{id:E(e.id,l.line,h.id),status:C,source:"graph-relation",direction:"downstream",causalRole:i,relationKind:"reference",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:l.line,endLine:l.endLine,text:l.text,signals:l.signals,calleeLeaf:y},alternatives:[b],alternativeCount:1,evidence:r.evidence}}),i==="result-callback"&&(o+=1)}return{candidates:t,upstreamCandidates:a,resultCandidates:o,runtimeCandidates:u}}function de(e,n,t){let a=[];if(!e.location)return a;let o=_(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line),u=M(n.db,e.location.file),d=q(n.db,e.location.file,e.location.line,e.location.endLine??e.location.line);for(let f of o.targets){if(!n.sourceAllowed(f.definition.relativePath))continue;let r=k(e.location.file,f.sourceLine,f.calleeLeaf);if(t.has(r))continue;t.add(r);let h=U(d.get(f.sourceLine)),b={symbol:f.definition.symbol,label:f.definition.leaf,file:f.definition.relativePath,line:f.definition.startLine,endLine:f.definition.endLine};n.alternativeAlreadyReturned(b)||a.push({anchor:{id:E(e.id,f.sourceLine,f.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:f.sourceLine,endLine:f.sourceLine,text:u[f.sourceLine]?.trim()||`${f.calleeLeaf}()`,signals:h,calleeLeaf:f.calleeLeaf},alternatives:[b],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:f.definition.symbol,location:{file:e.location.file,line:f.sourceLine}}]}})}return a}function ue(e,n,t){let a={candidates:[],scannedBehaviorSteps:0,visibleCallsites:0,identityCandidateCallsites:0,ambiguousCallsites:0,unresolvedCallsites:0};if(!e.location||!e.behavior)return a;let o=e.behavior.lines.filter(i=>i.signals.includes("call"));if(o.length===0)return a;let u=[],d=0,f=0,r=0,h=(O(n.db,e.location.file)?.callSites??[]).filter(i=>o.some(C=>i.line>=C.line&&i.line<=C.endLine)),b=n.topology.edges.filter(i=>i.kind==="call"&&i.fromNodeId===e.nodeId&&i.disposition!=="excluded"&&i.disposition!=="unsupported"),y=new Map;for(let i of b){let C=n.nodeById.get(i.toNodeId);if(!C)continue;let m=K(C);y.set(m,(y.get(m)??0)+1)}let x=me(n.db,t.stepDefinition?t.calleeMap.get(t.stepDefinition.symbolId)??[]:[]),l=he(x);for(let i of x){if(!n.sourceAllowed(i.alternative.file)||n.alternativeAlreadyReturned(i.alternative))continue;let C=B(i.alternative.label),m=te(h,o,C,i.row.callsiteLine,l.get(C)===1);if(!m)continue;let A=$(o,m.line,C);if(!A)continue;let L=k(e.location.file,m.line,C);if(t.evidencedCallsiteKeys.has(L))continue;t.evidencedCallsiteKeys.add(L);let S=se(i.row.source);u.push({anchor:{id:E(e.id,m.line,i.alternative.symbol??i.alternative.file),status:S,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:A.line,endLine:A.endLine,text:A.text,signals:A.signals,calleeLeaf:C},alternatives:[i.alternative],alternativeCount:1,evidence:[{method:i.row.source,strength:S,identity:i.row.symbol,location:{file:e.location.file,line:m.line}}]}})}for(let i of b){if(n.returnedNodeIds.has(i.toNodeId))continue;let C=n.nodeById.get(i.toNodeId);if(!C?.location||!n.sourceAllowed(C.location.file))continue;let m=K(C),A=i.evidence.find(N=>{let c=N.location;return c!==null&&c.file===e.location?.file&&c.line>=0})?.location?.line,L=te(h,o,m,A,y.get(m)===1);if(!L)continue;let S=$(o,L.line,m);if(!S)continue;let I=k(e.location.file,L.line,m);if(t.evidencedCallsiteKeys.has(I))continue;t.evidencedCallsiteKeys.add(I);let p=X(C);if(!p||n.alternativeAlreadyReturned(p))continue;let s=W(i.evidence);u.push({anchor:{id:E(e.id,L.line,C.id),status:s,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:S.line,endLine:S.endLine,text:S.text,signals:S.signals,calleeLeaf:m},alternatives:[p],alternativeCount:1,evidence:i.evidence}})}for(let i of h){let C=k(e.location.file,i.line,i.calleeLeaf);if(t.evidencedCallsiteKeys.has(C))continue;let m=$(o,i.line,i.calleeLeaf);if(!m)continue;let A=Q(e.location.file,V(n.db).get(i.calleeLeaf)??[]).flatMap(p=>T(n.db,p.file).filter(s=>s.symbol===p.symbol&&s.isFunctionLike)).filter(p=>n.sourceAllowed(p.relativePath)&&!n.alternativeAlreadyReturned({symbol:p.symbol,label:p.leaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})),L=D(A.map(p=>({symbol:p.symbol,label:p.leaf??i.calleeLeaf,file:p.relativePath,line:p.startLine,endLine:p.endLine})));if(L.length===0){r+=1;continue}let S=`${e.id}\0${i.line}\0${i.calleeLeaf}`;if(t.consideredCandidateKeys.has(S))continue;t.consideredCandidateKeys.add(S);let I=L.length>1;I?f+=1:d+=1,u.push({anchor:{id:E(e.id,i.line,i.calleeLeaf),status:I?"ambiguous":"candidate",source:"leaf-identity-candidate",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:e.id,fromLabel:e.label,callsite:{file:e.location.file,line:m.line,endLine:m.endLine,text:m.text,signals:m.signals,calleeLeaf:i.calleeLeaf},alternatives:L.slice(0,3),alternativeCount:L.length,evidence:[]}})}return{candidates:u,scannedBehaviorSteps:1,visibleCallsites:h.length,identityCandidateCallsites:d,ambiguousCallsites:f,unresolvedCallsites:r}}function ke(e,n,t){let a=new Map(n.nodes.map(o=>[o.id,o]));for(let o of t.steps)if(!(!o.behavior||!o.location))for(let u of n.edges){if(u.kind!=="reference"||u.fromNodeId!==o.nodeId||u.disposition==="excluded"||u.disposition==="unsupported")continue;let d=a.get(u.toNodeId);if(!d?.location||!G(e,d))continue;let f=K(d),r=H(u,o.location.file)?.line,h=o.behavior.lines.find(b=>(r===void 0||r>=b.line&&r<=b.endLine)&&b.text.includes(f));!h||le(h.signals)!=="result-callback"||u.semantics?.some(({family:b,subtype:y})=>b==="control"&&y==="result-callback")||(u.semantics=[...u.semantics??[],{family:"control",subtype:"result-callback",attributes:{evidenceRole:"result-producing-callable-reference"}}])}}function le(e){return e.includes("call")&&e.some(n=>["return","mutation","shape","spread","binding"].includes(n))?"result-callback":"callable-reference"}function Me(e,n,t={}){let a=t.limit??ae;if(!Number.isSafeInteger(a)||a<=0)throw new RangeError(`next-anchor limit must be a positive safe integer; received ${a}`);let o=t.sourceAllowed??(()=>!0),u=[],d=n.map((l,i)=>({id:l.id,nodeId:l.id,order:i,role:"anchor",kind:"source-construct",label:l.label,location:{file:l.file,line:l.startLine,endLine:l.endLine},behavior:null})),f=n.map(l=>({file:l.file,startLine:l.startLine,endLine:l.endLine})),r=0,h=0,b=0,y=0,x=0;for(let l of n){let i=M(e,l.file),m=(O(e,l.file)?.callSites??[]).filter(s=>s.line>=l.startLine&&s.line<=l.endLine);r+=m.length;let A=q(e,l.file,l.startLine,l.endLine),L=_(e,l.file,l.startLine,l.endLine),S=new Set;for(let s of L.targets){if(!o(s.definition.relativePath)||f.some(w=>w.file===s.definition.relativePath&&w.startLine<=s.definition.startLine&&w.endLine>=s.definition.endLine))continue;let N=k(l.file,s.sourceLine,s.calleeLeaf);S.add(N);let c=U(A.get(s.sourceLine)),g={symbol:s.definition.symbol,label:s.definition.leaf,file:s.definition.relativePath,line:s.definition.startLine,endLine:s.definition.endLine};u.push({anchor:{id:E(l.id,s.sourceLine,s.definition.symbol),status:"exact",source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:s.sourceLine,endLine:s.sourceLine,text:i[s.sourceLine]?.trim()||`${s.calleeLeaf}()`,signals:c,calleeLeaf:s.calleeLeaf},alternatives:[g],alternativeCount:1,evidence:[{method:"scip-occurrence-callsite",strength:"exact",identity:s.definition.symbol,location:{file:l.file,line:s.sourceLine}}]}})}h+=L.resolvedCallsites;let I=Z(e,l.file,{ranges:[{startLine:l.startLine,endLine:l.endLine}]}),p=new Map;for(let s of I.targets){let N=m.find(w=>w.line===s.line)?.calleeLeaf??s.calleeLeaf,c=k(l.file,s.line,N),g=p.get(c)??[];g.push(s),p.set(c,g)}for(let[s,N]of p){if(S.has(s))continue;S.add(s);let c=N.filter(v=>o(v.targetFile)&&!f.some(j=>j.file===v.targetFile&&j.startLine<=v.targetStartLine&&j.endLine>=v.targetEndLine));if(c.length===0)continue;let g=c[0],w=m.find(v=>v.line===g.line)?.calleeLeaf??g.calleeLeaf,R=U(A.get(g.line)),P=D(c.map(v=>({symbol:v.targetSymbol??null,label:v.calleeLeaf,file:v.targetFile,line:v.targetStartLine,endLine:v.targetEndLine}))),J=c.some(v=>(v.resolutionAlternativeCount??0)>1)?"candidate":c.every(v=>v.strength==="exact")?"exact":"derived";u.push({anchor:{id:E(l.id,g.line,P.map(v=>`${v.file}:${v.line}`).join("|")),status:P.length>1?"ambiguous":J,source:"graph-call",direction:"downstream",causalRole:"callee",relationKind:"call",fromStepId:l.id,fromLabel:l.label,callsite:{file:l.file,line:g.line,endLine:g.line,text:i[g.line]?.trim()||`${g.calleeLeaf}()`,signals:R,calleeLeaf:w},alternatives:P.slice(0,3),alternativeCount:P.length,evidence:c.map(v=>({method:v.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":v.resolution==="factory-callback-member"?"ast-factory-callback-callsite":v.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-import-member-callsite",strength:J,identity:v.targetSymbol??`${v.targetFile}:${v.targetStartLine}-${v.targetEndLine}`,location:{file:l.file,line:g.line}}))}})}h+=p.size;for(let s of m){let N=k(l.file,s.line,s.calleeLeaf);S.has(N)||(x+=1)}}return oe(e,u,d,a,{scannedBehaviorSteps:n.length,visibleCallsites:r,graphEvidencedCallsites:h,identityCandidateCallsites:b,ambiguousCallsites:y,unresolvedCallsites:x,upstreamCandidates:0,resultCandidates:0,runtimeCandidates:0})}function oe(e,n,t,a,o,u=[]){let d=ge(n).sort(re),f=d.filter(i=>fe(e,i)).slice(0,a),r=new Set(f.map(i=>i.anchor.id)),h=d.filter(i=>!r.has(i.anchor.id)),b=f.map(i=>i.anchor),y=h.map(i=>i.anchor),x=D(b.flatMap(i=>i.alternativeCount===1?i.alternatives:[])),l=D(y.flatMap(i=>i.alternativeCount===1?i.alternatives:[]));return{anchors:b,withheldAnchors:y,candidateAnchors:d.length,omittedAnchors:Math.max(0,d.length-b.length),...o,inspectCommand:x.length===0?null:`scip-query inspect ${x.map(ie).join(" ")} --view behavior`,remainingInspectCommands:pe(l,8).map(i=>`scip-query inspect ${i.map(ie).join(" ")} --view behavior`)}}function re(e,n){let t=e.anchor.alternatives[0],a=n.anchor.alternatives[0];return F(e.anchor.status)-F(n.anchor.status)||(e.anchor.direction??"").localeCompare(n.anchor.direction??"")||(e.anchor.relationKind??"").localeCompare(n.anchor.relationKind??"")||(e.anchor.causalRole??"").localeCompare(n.anchor.causalRole??"")||e.anchor.fromStepId.localeCompare(n.anchor.fromStepId)||e.anchor.callsite.file.localeCompare(n.anchor.callsite.file)||e.anchor.callsite.line-n.anchor.callsite.line||(t?.file??"").localeCompare(a?.file??"")||(t?.line??0)-(a?.line??0)||e.anchor.id.localeCompare(n.anchor.id)}function fe(e,n){if(n.anchor.alternativeCount!==1)return!0;let t=n.anchor.alternatives[0],a=t.endLine??t.line;return M(e,t.file).slice(t.line,a+1).join(`
|
|
2
|
-
`).length<=2e4}function U(e){return e?.includes("call")?[...e]:["call",...e??[]]}function me(e,n){let t=new Map;for(let a of n){let o=T(e,a.file).find(f=>f.symbol===a.symbol&&f.isFunctionLike);if(!o)continue;let u={symbol:o.symbol,label:o.leaf,file:o.relativePath,line:o.startLine,endLine:o.endLine},d=t.get(o.symbol);!d||ne(a.source)>ne(d.row.source)?t.set(o.symbol,{row:{...a,...a.callsiteLine===void 0&&d?.row.callsiteLine!==void 0?{callsiteLine:d.row.callsiteLine}:{}},alternative:u}):d.row.callsiteLine===void 0&&a.callsiteLine!==void 0&&t.set(o.symbol,{...d,row:{...d.row,callsiteLine:a.callsiteLine}})}return[...t.values()]}function he(e){let n=new Map;for(let t of e){let a=B(t.alternative.label);n.set(a,(n.get(a)??0)+1)}return n}function se(e){return e==="semantic-callee"||e==="scip-chunk"||e==="scip-occurrence"?"exact":"derived"}function ne(e){return se(e)==="exact"?2:1}function $(e,n,t){return e.find(a=>n>=a.line&&n<=a.endLine&&a.text.includes(t))??e.find(a=>n>=a.line&&n<=a.endLine)??null}function te(e,n,t,a,o){if(a!==void 0)return e.find(d=>d.line===a&&d.calleeLeaf===t&&$(n,d.line,t)!==null)??null;let u=e.filter(d=>d.calleeLeaf===t&&$(n,d.line,d.calleeLeaf)!==null);return o&&u.length===1?u[0]:null}function K(e){let n=e.attributes.leaf;if(typeof n=="string"&&n.length>0)return B(n);let t=e.label.slice(e.label.lastIndexOf(":")+1);return B(t)}function z(e){if(e?.kind!=="symbol"||!e.id.startsWith("symbol:"))return null;try{return decodeURIComponent(e.id.slice(7))}catch{return null}}function X(e){return e.location?{symbol:z(e),label:e.label,file:e.location.file,line:e.location.line,endLine:e.location.endLine??null}:null}function G(e,n){let t=X(n);return t?.symbol&&T(e,t.file).some(o=>o.symbol===t.symbol&&o.isFunctionLike)?t:null}function H(e,n){return e.evidence.find(t=>t.location?.file===n)?.location??e.evidence.find(t=>t.location!==null)?.location??null}function W(e){let n={exact:5,derived:4,mixed:3,candidate:2,unknown:1};return e.reduce((t,a)=>n[a.strength]>n[t]?a.strength:t,"unknown")}function ge(e){let n=new Map;for(let t of e){let o=t.anchor.alternatives[0]?.symbol??`${t.anchor.callsite.file}:${t.anchor.callsite.line}:${t.anchor.callsite.calleeLeaf}`,u=n.get(o);(!u||be(t,u)<0)&&n.set(o,t)}return[...n.values()]}function be(e,n){return F(e.anchor.status)-F(n.anchor.status)||e.anchor.alternativeCount-n.anchor.alternativeCount||re(e,n)}function F(e){return{exact:0,derived:1,mixed:2,candidate:3,unknown:4,ambiguous:5}[e]}function D(e){let n=new Map;for(let t of e)n.set(t.symbol??`${t.file}:${t.line}`,t);return[...n.values()].sort((t,a)=>t.file.localeCompare(a.file)||t.line-a.line||t.label.localeCompare(a.label))}function ie(e){return`--at ${ve(`${e.file}:${e.line+1}`)}`}function pe(e,n){let t=[];for(let a=0;a<e.length;a+=n)t.push(e.slice(a,a+n));return t}function ve(e){return`'${e.replaceAll("'","'\\''")}'`}function k(e,n,t){return`${e}\0${n}\0${t}`}function E(e,n,t){return["next-anchor",e,String(n),t].map(encodeURIComponent).join(":")}export{Ee as a,ke as b,Me as c};
|
|
3
|
-
//# sourceMappingURL=chunk-PXTRBKRK.js.map
|
package/dist/chunk-Q5JRIHT3.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as v,b as L,c as $,d as B}from"./chunk-GTZZVLKJ.js";import{a as K}from"./chunk-VBV6ALJE.js";import{b as D,c as A}from"./chunk-2BMSSRBH.js";import{a as g}from"./chunk-BGBBVSH4.js";import{h as R}from"./chunk-NJQISBL4.js";import{b as M}from"./chunk-FLMTCX5R.js";import{b as k,d as F,e as b}from"./chunk-C7C6AKAT.js";import{u as w}from"./chunk-RBAD4GJ2.js";import{h as C}from"./chunk-ETC674NS.js";function me(t,e){let{scope:n,minLoc:s=3,maxLoc:i=80,limit:r=30,includeLowConfidence:l=!1,scanLimit:o}=e??{},m=e?.semantic!==!1,a=new A(t),d=a.scopedDefinitions(n),y=Q(a,n),p={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,d,{minLoc:s,maxLoc:i}),orderCandidates:(c,u)=>g(u)-g(c)||c.relativePath.localeCompare(u.relativePath),scanLimit:o,profile:{name:"stale-abstractions"},prepare:c=>{let u=U(c),f=W(t,a,c,u,{semantic:m}),h=c.filter(x=>{if(a.hasSuppressionComment(x))return!1;let I=S(t,x,f,u);return I.realConsumers.length<=1&&!I.transitivelyReachable&&j(x,I.realConsumers.length,y)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,d,h,{semantic:m}),candidateIndex:u}},evaluate:(c,u)=>{if(a.hasSuppressionComment(c)||u.singletonBackedClassIds.has(c.symbolId))return null;let f=S(t,c,u.consumerFileMap,u.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,y))return null;let h=V(t,f);return!l&&h.confidence==="low"?null:h},orderResults:(c,u)=>p[c.confidence]-p[u.confidence]||u.loc-c.loc||c.file.localeCompare(u.file)||c.startLine-u.startLine,limit:r})}function O(t,e,n,s){return n.filter(i=>i.isTypeLike&&g(i)>=s.minLoc).filter(i=>g(i)<=s.maxLoc).filter(i=>!t.isIgnored(i.relativePath)).filter(i=>!i.relativePath.endsWith(".d.ts")).filter(i=>M(i.relativePath)!=="test").filter(i=>!R(t,i.symbol,i.relativePath)).filter(i=>!X(i.symbol))}function T(t,e,n,s){return L(v(t,e).forDefinitions(n,{semantic:s.semantic,sourceFallback:s.sourceFallback}))}function W(t,e,n,s,i){let r=T(t,e,n,{semantic:!1,sourceFallback:!1}),l=n.filter(a=>{let d=S(t,a,r,s);return d.realConsumers.length<=1&&!(d.realConsumers.length>0&&P(a.relativePath))}),o=i.semantic&&l.length>0?D(r,T(t,e,l,{semantic:!0,sourceFallback:!1})):r,m=l.filter(a=>S(t,a,o,s).realConsumers.length<=1);return D(o,T(t,e,m,{semantic:!1,sourceFallback:!0}))}function U(t){let e=new Map;for(let n of t){let s=e.get(n.relativePath);s||(s=new Map,e.set(n.relativePath,s));let i=b(n.symbol);i&&s.set(i,n)}return e}function S(t,e,n,s){let r=[...n.get(e.symbolId)??new Set].filter(d=>d!==e.relativePath&&!t.isIgnored(d)),{realConsumers:l,barrelConsumers:o,importOnlyConsumers:m}=$(t,e,r),a=Y(t,e,n,s);return{definition:e,realConsumers:l,barrelConsumers:o+m,transitivelyReachable:a}}function V(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),s=P(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:i,reason:r}=ne(e.realConsumers.length,n,s),l=z(e.realConsumers.length,n,s);return{symbol:e.definition.symbol,shortName:F(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:g(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:s,confidence:i,reason:r,actionTier:l.actionTier,stalenessKind:l.stalenessKind,recommendation:l.recommendation}}function z(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,s,i){let r=_(t,Z(n),s),l=r.map(a=>a.singleton);if(r.length===0)return new Set;let o=L(v(t,e).forDefinitions(l,{semantic:i.semantic,sourceFallback:!0})),m=new Set;for(let{singleton:a,classId:d}of r)G(t,a,o)&&m.add(d);return m}function Z(t){let e=new Map;for(let n of t){let s=b(n.symbol);s&&e.set(N(n.relativePath,s),n)}return e}function _(t,e,n){let s=[];for(let i of n){let r=q(t,e,i);r&&s.push({singleton:r,classId:i.symbolId})}return s}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let s=b(n.symbol);if(!s)return null;let i=J(t,n.relativePath,s);return i?e.get(N(n.relativePath,i))??null:null}function G(t,e,n){let s=b(e.symbol),i=n.get(e.symbolId);return!s||!i?!1:[...i].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,s))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let s=C(t,e);if(!s)return null;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${i}\\s*\\(`);return s.match(r)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=k(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let s=n[n.length-1],i=n[n.length-2];return s?.suffix==="type"&&i?.suffix==="type"}function P(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(P(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,s){let i=w(t,e.relativePath),r=b(e.symbol);if(!r)return!1;let l=s.get(e.relativePath);if(!l)return!1;let o=[...i.get(r)??[]],m=new Set;for(;o.length>0;){let a=o.pop();if(m.has(a))continue;m.add(a);let d=l.get(a);if(!d)continue;let y=n.get(d.symbolId);if(y){for(let p of y)if(p!==e.relativePath&&!t.isIgnored(p))return!0}for(let p of i.get(a)??[])o.push(p)}return!1}function E(t,e,n){let s=C(t,e);if(!s)return"other";let i=s.split(`
|
|
2
|
-
`),r=Math.max(0,n-2),l=Math.min(i.length-1,n+2);for(let o=r;o<=l;o++){let a=(i[o]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function ee(t,e){let n=C(t,e.relativePath);if(!n)return!1;let s=b(e.symbol);if(!s)return!1;let i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${i}\\b`),l=n.split(`
|
|
3
|
-
`);for(let o=0;o<l.length;o++)if(!(o>=e.startLine&&o<=e.endLine)&&r.test(l[o]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{me as a};
|
|
4
|
-
//# sourceMappingURL=chunk-Q5JRIHT3.js.map
|
package/dist/chunk-Q7ATHARX.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as k}from"./chunk-G4ALYS4J.js";import{c as R,d as E}from"./chunk-JFMEXGFE.js";import{h as S}from"./chunk-7F45LJKI.js";import{randomUUID as q}from"crypto";import{getHeapStatistics as V}from"v8";import{resolve as H}from"path";import{createRequire as L}from"module";import{dirname as I,isAbsolute as j,relative as P,resolve as m,sep as b}from"path";var u=L(import.meta.url),_=1,D="0.4.0";function z(){try{let t=M();if(!t.available)return t;let{packageRoot:e}=t,r=u.resolve("typescript",{paths:[e]}),i=u(r),{FileIndexer:n}=u(m(e,"dist/src/FileIndexer.js")),{Input:s}=u(m(e,"dist/src/Input.js")),{Packages:o}=u(m(e,"dist/src/Packages.js")),c=u(m(e,"dist/src/scip.js"));if(!n||!s||!o||!c.scip?.Document||!c.scip.Index)return{available:!1,reason:"scip-typescript document runtime has an unsupported module shape"};let a={packageVersion:t.packageVersion,typescript:i,Document:c.scip.Document,Index:c.scip.Index,FileIndexer:n,Input:s,Packages:o};return{available:!0,runtime:a,producerIdentity:x(a)}}catch(t){return{available:!1,reason:`scip-typescript document runtime unavailable: ${t instanceof Error?t.message:String(t)}`}}}function J(){let t=M();return t.available?{available:!0,packageVersion:t.packageVersion,typescriptVersion:t.typescriptVersion,producerIdentity:t.producerIdentity}:t}function M(){try{let t=u.resolve("@sourcegraph/scip-typescript/package.json"),e=JSON.parse(S(t,"scip-typescript package manifest"));if(e.version!==D)return{available:!1,reason:`unsupported scip-typescript version ${String(e.version??"unknown")}; expected ${D}`};let r=I(t),i=u.resolve("typescript/package.json",{paths:[r]}),n=JSON.parse(S(i,"TypeScript package manifest"));return typeof n.version!="string"||!n.version?{available:!1,reason:"scip-typescript TypeScript compiler version is unavailable"}:{available:!0,packageRoot:r,packageVersion:e.version,typescriptVersion:n.version,producerIdentity:C(e.version,n.version)}}catch(t){return{available:!1,reason:`scip-typescript document producer unavailable: ${t instanceof Error?t.message:String(t)}`}}}function A(t){let e=t.runtime===void 0?z():t.runtime===null?{available:!1,reason:"scip-typescript document runtime unavailable"}:{available:!0,runtime:t.runtime,producerIdentity:x(t.runtime)};return e.available?{available:!0,emitter:new T(t,e.runtime)}:e}var T=class{producerIdentity;workspaceRoot;tsconfigPath;projectRoot;maxFileByteSize;runtime;host;config=null;includedFiles=new Set;program=null;checker=null;symbolTable=new Map;constructorTable=new Map;packages;fragments=new Map;stats={initializations:0,programUpdates:0,documentsEmitted:0,documentsRemoved:0,sourceNodesReused:0,sourceNodesReplaced:0,symbolEntriesPruned:0};constructor(e,r){this.workspaceRoot=m(e.workspaceRoot),this.tsconfigPath=m(this.workspaceRoot,e.tsconfigPath),this.projectRoot=e.projectRoot??O(this.workspaceRoot,I(this.tsconfigPath)),this.maxFileByteSize=e.maxFileByteSize??1024*1024,this.runtime=r,this.producerIdentity=x(r);let i=v(r.typescript,this.tsconfigPath);this.config=i,this.host=new w(r.typescript,i.options,this.workspaceRoot),this.packages=new r.Packages(this.projectRoot)}initialize(){let e=performance.now();this.initializeProgram();let r=[];for(let i of this.program.getSourceFiles())this.includedFiles.has(f(i.fileName))&&r.push(this.emitSourceFile(i));return this.result(r,e)}advance(e){if(!this.program||!this.checker||!this.config)return this.initializeAndAdvance(e);let r=performance.now(),i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);if(this.fragments.clear(),i.length===0&&n.length===0)return this.validateAffectedPaths(s),this.result(this.emitAffectedFiles(s),r);let o=v(this.runtime.typescript,this.tsconfigPath);this.config=o,this.includedFiles=new Set(o.fileNames.map(f));let c=this.program,a=new Map;for(let d of[...i,...n]){let p=y(this.workspaceRoot,d),l=c.getSourceFile(p);l&&(a.set(d,l),this.stats.symbolEntriesPruned+=F(this.symbolTable,l),this.stats.symbolEntriesPruned+=F(this.constructorTable,l)),this.host.invalidate(p)}this.program=this.runtime.typescript.createProgram(o.fileNames,o.options,this.host.compilerHost,c),this.checker=this.program.getTypeChecker(),this.stats.programUpdates+=1,this.validateIncrementalPaths(i,n,s),this.stats.documentsRemoved+=n.length;for(let[d,p]of a)this.program.getSourceFile(y(this.workspaceRoot,d))===p?this.stats.sourceNodesReused+=1:this.stats.sourceNodesReplaced+=1;return this.result(this.emitAffectedFiles(s),r)}fragment(e){return this.fragments.get(g(e))??null}snapshotStats(){return{...this.stats}}initializeAndAdvance(e){let r=performance.now();this.initializeProgram();let i=h(e.modifiedFiles),n=h(e.removedFiles??[]),s=h(e.affectedFiles);return this.fragments.clear(),this.validateIncrementalPaths(i,n,s,!0),this.stats.documentsRemoved+=n.length,this.result(this.emitAffectedFiles(s),r)}initializeProgram(){let e=this.config??v(this.runtime.typescript,this.tsconfigPath);this.includedFiles=new Set(e.fileNames.map(f)),this.program=this.runtime.typescript.createProgram(e.fileNames,e.options,this.host.compilerHost),this.checker=this.program.getTypeChecker(),this.stats.initializations+=1}validateIncrementalPaths(e,r,i,n=!1){if(!n&&e.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires a modified or removed file");if(i.length===0&&r.length===0)throw new Error("incremental TypeScript document update requires an affected or removed file");for(let s of e){let o=y(this.workspaceRoot,s);if(!this.program?.getSourceFile(o))throw new Error(`modified TypeScript dependency is unavailable to the configured project: ${s}`)}for(let s of r){let o=y(this.workspaceRoot,s);if(this.program?.getSourceFile(o))throw new Error(`removed TypeScript source is still present in the configured project: ${s}`)}this.validateAffectedPaths(i)}validateAffectedPaths(e){for(let r of e){let i=y(this.workspaceRoot,r);if(!this.includedFiles.has(f(i)))throw new Error(`affected TypeScript file is outside the configured project: ${r}`)}}emitAffectedFiles(e){return e.map(r=>{let i=this.program.getSourceFile(y(this.workspaceRoot,r));if(!i)throw new Error(`affected TypeScript source is unavailable: ${r}`);return this.emitSourceFile(i)})}emitSourceFile(e){if(!this.checker)throw new Error("TypeScript document emitter is not initialized");let r=g(P(this.workspaceRoot,e.fileName)),i=new this.runtime.Document({relative_path:r,occurrences:[]});if(new this.runtime.FileIndexer(this.checker,{cwd:this.workspaceRoot,projectRoot:this.projectRoot,projectDisplayName:this.projectRoot,maxFileByteSizeNumber:this.maxFileByteSize},new this.runtime.Input(e.fileName,e.getText()),i,this.symbolTable,this.constructorTable,this.packages,e).index(),this.stats.documentsEmitted+=1,i.occurrences.length===0)return this.fragments.delete(r),this.stats.documentsRemoved+=1,{relativePath:r,bytes:null,occurrences:0,symbols:i.symbols.length,referenceFragments:[]};let s=i.serializeBinary();return this.fragments.set(r,s),{relativePath:r,bytes:s,occurrences:i.occurrences.length,symbols:i.symbols.length,referenceFragments:U(r,i)}}result(e,r){return{producerIdentity:this.producerIdentity,fragments:e,durationMs:performance.now()-r,stats:this.snapshotStats()}}};function U(t,e){let r=new Map;for(let i of e.occurrences){if(!i.symbol||(i.symbol_roles&1)!==0||i.range.length<3)continue;let n=i.range[0],s=i.range[1];if(!Number.isInteger(n)||!Number.isInteger(s))continue;let o={targetSymbol:i.symbol,location:{file:t,line:n,column:s}};r.set(`${i.symbol}\0${n}\0${s}`,o)}return[...r.values()].sort((i,n)=>i.targetSymbol.localeCompare(n.targetSymbol)||i.location.line-n.location.line||i.location.column-n.location.column)}var w=class{compilerHost;sourceFiles=new Map;constructor(e,r,i){let n=e.createCompilerHost(r),s=n.getSourceFile.bind(n);this.compilerHost={...n,getCurrentDirectory:()=>i,getSourceFile:(o,c,a,d)=>{let p=f(o);if(this.sourceFiles.has(p))return this.sourceFiles.get(p);let l=s(o,c,a,d);return this.sourceFiles.set(p,l),l}}}invalidate(e){this.sourceFiles.delete(f(e))}};function v(t,e){let r=t.readConfigFile(e,t.sys.readFile);if(r.error)throw new Error(t.formatDiagnostics([r.error],t.createCompilerHost({})));let i=t.parseJsonConfigFileContent(r.config,t.sys,I(e)),n=i.errors.filter(s=>s.code!==18003);if(n.length>0)throw new Error(t.formatDiagnostics(n,t.createCompilerHost({})));return i}function x(t){return C(t.packageVersion,t.typescript.version)}function C(t,e){return`scip-typescript:${t}:typescript:${e}:document-adapter:${_}`}function O(t,e){return g(P(t,e))||"."}function y(t,e){if(j(e))throw new Error(`expected a project-relative path: ${e}`);let r=m(t,e),i=t.endsWith(b)?t:`${t}${b}`;if(r!==t&&!r.startsWith(i))throw new Error(`path escapes the project root: ${e}`);return r}function h(t){return[...new Set(t.map(g))].sort()}function g(t){return t.split(b).join("/").replace(/^\.\//,"")}function f(t){return m(t)}function F(t,e){let r=0;for(let i of t.keys())if($(i)){try{if(i.getSourceFile()!==e)continue}catch{continue}t.delete(i),r+=1}return r}function $(t){return!!(t&&typeof t=="object"&&"kind"in t&&"getSourceFile"in t)}var N=class{projectRoot;currentGeneration;createEmitter;wallNow;monotonicNow;maxActiveSessions;softMemoryLimitBytes;memoryUsage;active=new Map;requests=0;sessionsCreated=0;sessionsReplaced=0;sessionsEvicted=0;lastRequestAtMs=null;lastDurationMs=null;lastError=null;unavailable=!1;constructor(e){if(this.projectRoot=H(e.projectRoot),this.currentGeneration=e.currentGeneration,this.createEmitter=e.createEmitter??A,this.wallNow=e.wallNow??e.now??Date.now,this.monotonicNow=e.monotonicNow??e.now??E,e.maxActiveSessions!==void 0&&(!Number.isInteger(e.maxActiveSessions)||e.maxActiveSessions<1))throw new Error("TypeScript index maxActiveSessions must be a positive integer.");if(this.maxActiveSessions=e.maxActiveSessions??8,e.softMemoryLimitMb!==void 0&&(!Number.isInteger(e.softMemoryLimitMb)||e.softMemoryLimitMb<1))throw new Error("TypeScript index softMemoryLimitMb must be a positive integer.");this.softMemoryLimitBytes=e.softMemoryLimitMb===void 0?null:e.softMemoryLimitMb*1024*1024,this.memoryUsage=e.memoryUsage??(()=>({heapUsedBytes:process.memoryUsage().heapUsed,heapLimitBytes:V().heap_size_limit}))}handle(e,r){let i=this.monotonicNow();try{if(this.currentGeneration()!==e)throw new Error("TypeScript index request does not match the currently published generation.");let n=this.emitterFor(r);if(n.emitter.producerIdentity!==r.producerIdentity)throw new Error("TypeScript index producer identity changed.");let s=n.emitter.snapshotStats(),o=n.emitter.advance({modifiedFiles:r.modifiedFiles,removedFiles:r.removedFiles,affectedFiles:r.affectedFiles}),c=this.monotonicNow()-i;return this.requests+=1,this.lastRequestAtMs=this.wallNow(),this.lastDurationMs=c,this.lastError=null,this.unavailable=!1,{producerIdentity:o.producerIdentity,cold:o.stats.initializations>s.initializations,durationMs:c,fragments:o.fragments.map(a=>({relativePath:a.relativePath,bytesBase64:a.bytes===null?null:Buffer.from(a.bytes).toString("base64"),occurrences:a.occurrences,symbols:a.symbols,referenceFragments:a.referenceFragments}))}}catch(n){throw this.lastError=n instanceof Error?n.message:String(n),n}}status(e){let r=[...this.active.values()].map(o=>o.emitter.snapshotStats()),i=o=>r.reduce((c,a)=>c+a[o],0),n=this.memoryUsage(),s=this.softMemoryLimitBytes!==null&&n.heapUsedBytes>=this.softMemoryLimitBytes;return{protocolVersion:k,state:this.unavailable?"unavailable":this.lastError?"error":this.active.size>0?"ready":"idle",requests:this.requests,sessionsCreated:this.sessionsCreated,sessionsReplaced:this.sessionsReplaced,sessionsEvicted:this.sessionsEvicted,activeSessions:this.active.size,maxActiveSessions:this.maxActiveSessions,heapUsedBytes:n.heapUsedBytes,heapLimitBytes:n.heapLimitBytes,...this.softMemoryLimitBytes===null?{}:{softMemoryLimitBytes:this.softMemoryLimitBytes},retireRequested:s,initializations:i("initializations"),programUpdates:i("programUpdates"),documentsEmitted:i("documentsEmitted"),documentsRemoved:i("documentsRemoved"),...this.lastRequestAtMs===null?{}:{lastRequestAt:new Date(this.lastRequestAtMs).toISOString()},...this.lastDurationMs===null?{}:{lastDurationMs:this.lastDurationMs},...this.lastError?{lastError:this.lastError}:{},...e?{mailbox:e}:{}}}close(){this.active.clear()}emitterFor(e){let r=`${e.tsconfigPath}\0${e.projectArgument}`,i=this.active.get(r);if(i?.projectIdentity===e.projectIdentity)return this.active.delete(r),this.active.set(r,i),i;if(i)this.active.delete(r);else if(this.active.size>=this.maxActiveSessions){let o=this.active.keys().next().value;o!==void 0&&(this.active.delete(o),this.sessionsEvicted+=1)}let n=this.createEmitter({workspaceRoot:this.projectRoot,tsconfigPath:e.tsconfigPath,projectRoot:e.projectArgument});if(!n.available)throw this.unavailable=!0,new Error(n.reason);i&&(this.sessionsReplaced+=1);let s={projectIdentity:e.projectIdentity,emitter:n.emitter};return this.active.set(r,s),this.sessionsCreated+=1,s}};var se=`typescript-index-${process.pid}-${q()}`,B=R(process.pid),oe={pid:process.pid,...B?{processIdentity:B}:{}};export{J as a,N as b};
|
|
2
|
-
//# sourceMappingURL=chunk-Q7ATHARX.js.map
|
package/dist/chunk-Q7CSKIDM.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as q}from"./chunk-QOKYJ33H.js";import{a as _}from"./chunk-XKXTR6ZI.js";import{a as G}from"./chunk-SV2LEFVM.js";import{a as K,b as L,c as X,e as U,h as T}from"./chunk-ETC674NS.js";import{i as H,v as z,y as $}from"./chunk-KNLQGXVH.js";import{Ba as O,Da as S,xa as F}from"./chunk-JZ2A7LDM.js";function I(t,n){let e=et(t,n)??it(t,n)??rt(t,n)??ot(t,n);return st(t,e,n)}function et(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=N(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(N(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function N(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function it(t,n){if(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function rt(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(E(o)!==null)break;if(P(o)!==null)return null;e-=1}if(e<0)return null;let i=E(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=E(o);if(s!==null){if(s<=i)break;r+=1;continue}if(P(o)!==null)break;r+=1}return{start:e,end:r}}function E(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function ot(t,n){let e=t[n]??"";if(W(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&V(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&V(t[r]??"");)r+=1;return{start:i,end:r}}function V(t){return P(t)===null}function P(t){return t.trim().length===0?"blank":W(t)?"heading":N(t)?"fence":w(t)?"table":E(t)!==null?"list":null}function W(t){return/^#{1,6}\s+/.test(t.trim())}function st(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
|
|
2
|
-
`).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function A(t,n){return n.filter(e=>t.includes(e))}var ct=/<!--\s*scip-query:\s*snapshot\s*-->/i;function Z(t,n){if((t.config.docs?.snapshotPaths??[]).some(r=>G(r,n)))return!0;let i=T(t,n);return i.length>0&&ct.test(i)}var J={classifyCitation:lt,citationContexts:dt,citationKindLabel:ft,citationRemediation:gt,referenceTargets:ht,hasLineAnchoredCitation:at};function at(t){return t.some(n=>(n.lineReferences?.length??0)>0)}function lt(t){let n=t.join(`
|
|
3
|
-
`).toLowerCase(),e=[],i=A(n,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(i.length>0)return e.push(`configuration/example terms near citation: ${i.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:e};let r=A(n,["accepted","intentional","intentionally","retained","historical"]);if(r.length>0)return e.push(`intentional-record terms near citation: ${r.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:e};let o=A(n,["command","cli","usage","example","run","workflow"]);return o.length>0?(e.push(`guide/reference terms near citation: ${o.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:e}):(e.push(t.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:e})}function dt(t,n,e){let i=T(t,n);if(!i&&!S(t.config.projectRoot,n))return[];let r=i.split(/\r?\n/),o=e.flatMap(ut),s=[];for(let c=0;c<r.length;c+=1){let a=r[c]??"";o.some(d=>a.includes(d))&&s.push(I(r,c))}return s}function ut(t){let n=t.split("/");return[t,`./${t}`,n.slice(-3).join("/"),n.slice(-2).join("/")].filter((e,i,r)=>e.length>0&&r.indexOf(e)===i)}function ft(t){switch(t){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function gt(t,n){switch(t){case"behavioral-claim":return`Re-read ${n} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${n} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${n} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${n} is still meant to name this file.`}}function ht(t,n,e){let i=q(e),r=new Set;for(let o of n)pt(t,o,i.get(o)??[])&&r.add(o);return r}function pt(t,n,e){if(!mt.test(n)||!S(t.config.projectRoot,n))return!0;if(e.length===0)return!1;let i=O(t.config.projectRoot,n,{inputKind:"changed source file"}).split(/\r?\n/),r=yt(i);for(let o of e)for(let s=o.startLine;s<=o.endLine;s+=1)if((i[s]??"").trim()!==""&&!r.has(s))return!0;return!1}var mt=/\.(?:[cm]?[jt]sx?)$/i;function yt(t){let n=new Set,e=!1;for(let i=0;i<t.length;i+=1){let r=t[i].trim();!e&&Ct(r)&&(e=!0),e&&(n.add(i),r.endsWith(";")&&(e=!1))}return n}function Ct(t){return/^import(?:\s|$)/.test(t)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(t)}var Q=X({kind:"doc-path-evidence",invalidation:U("doc-path-evidence"),serialize:jt,deserialize:Lt}),v=/\.(?:md|mdx|rst|txt)$/i;function Dt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var bt=3,St=/([A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6})(?::([1-9][0-9]*))?\b/g;function en(t,n={}){let{doc:e,limit:i=20,minCoupling:r=bt,includeSnapshotExcluded:o=!1}=n,s=At(t,n.historyMode??"bounded");if(!s)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let a of s.docFiles){if(e!==void 0&&!a.includes(e)||e===void 0&&!Y(t,a)||e!==void 0&&!S(t.config.projectRoot,a))continue;let d=Z(t,a);if(d&&!o)continue;let{value:m,estimated:y}=xt(t,a,s.changeTimes.get(a)),g=Rt(t,a),u=new Map,{resolved:l,broken:h,citations:b}=wt(t,a,s.tracked,s.trackedBySuffix,s.everSeenInHistory),x=new Map(b.map(f=>[f.file,f]));for(let f of l){if(f===a||v.test(f))continue;let C=(s.changeTimes.get(f)??[]).filter(D=>D>m).length;if(C===0)continue;let p=x.get(f);u.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:C,...B("reference",g,p?.contexts),citationContexts:p?.contexts,citedLines:p?.lineReferences})}for(let[f,C]of s.coupling.get(a)??[]){if(C<r||!s.tracked.has(f))continue;let p=(s.changeTimes.get(f)??[]).filter(M=>M>m).length;if(p===0)continue;let D=u.get(f);D?(D.evidence="both",D.coChanges=C,Object.assign(D,B("both",g,D.citationContexts))):u.set(f,{file:f,evidence:"co-change",coChanges:C,changesSinceDocUpdate:p,...B("co-change",g)})}if(u.size===0&&h.length===0)continue;let R=[...u.values()].sort((f,C)=>C.changesSinceDocUpdate-f.changesSinceDocUpdate);c.push({doc:a,docLastChangedAt:m,staleness:R.reduce((f,C)=>f+C.changesSinceDocUpdate,0)+h.length*10,subjects:R.slice(0,8),brokenReferences:h,...d?{snapshotExcluded:!0}:{},...y?{docLastChangedAtEstimated:!0}:{}})}return c.sort((a,d)=>d.staleness-a.staleness),{available:!0,commitsAnalyzed:s.historyCommitCount,docsScanned:s.docFiles.length,findings:c.slice(0,i)}}function xt(t,n,e){if(e&&e.length>0)return{value:Math.max(...e),estimated:!1};try{return{value:Math.floor(F(t.config.projectRoot,n).mtimeMs/1e3),estimated:!0}}catch(i){if(S(t.config.projectRoot,n))throw i;return{value:0,estimated:!1}}}function Rt(t,n){let e=T(t,n).slice(0,6e3);if(!e)return{docIntent:"unknown",reasons:["doc text unavailable"]};let i=`${n}
|
|
4
|
-
${e}`.toLowerCase(),r=A(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=A(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function B(t,n,e=[]){let i=t==="co-change"||e.length===0?null:J.classifyCitation(e);return{actionTier:Tt(t,n.docIntent,i?.actionTier),docIntent:n.docIntent,docIntentReasons:n.reasons,...i?{citationKind:i.citationKind,citationKindReasons:i.reasons}:{}}}function Tt(t,n,e){return n==="historical-note"?"support":e||(t==="co-change"?"signal":"direct")}function At(t,n){let e=_(t,{historyMode:n}),i=e.commitHistory();if(!i)return null;let r=e.trackedFiles()??new Set,o=new Map,s=new Map,c=new Set;for(let a of i.commits){let d=[...new Set(a.files)],m=d.filter(g=>v.test(g)),y=d.filter(g=>!v.test(g));for(let g of d){c.add(g);let u=o.get(g)??[];u.push(a.timestamp),o.set(g,u)}for(let g of m){let u=s.get(g);u||(u=new Map,s.set(g,u));for(let l of y)u.set(l,(u.get(l)??0)+1)}}return{changeTimes:o,coupling:s,docFiles:[...r].filter(a=>v.test(a)),everSeenInHistory:c,historyCommitCount:i.commits.length,tracked:r,trackedBySuffix:tt(r)}}function rn(t,n){if(n.size===0)return[];let e=z(),i=0,r=0,o=0,s=0,c=0,a=0;return $("doc-reference.docs-citing-files",()=>{let d=_(t).trackedFiles()??new Set;i=d.size;let m=tt(d),y=Mt(n,m),g=[];for(let u of d){if(!Y(t,u))continue;e&&(r+=1);let l=T(t,u);if(!l&&!S(t.config.projectRoot,u)){e&&(o+=1);continue}if(!It(l,y)){e&&(s+=1);continue}let h=nt(t,u,l);if(!h)continue;e&&(c+=1);let b=vt(h.candidates,n,y,d,m);if(b.size===0)continue;let x=[...new Set([...b.values()].flatMap(p=>[...p]))],R=Et(h.contextsByCandidate,x),f=[...b].map(([p,D])=>({file:p,contexts:k([...D].flatMap(M=>R.get(M)??[])).slice(0,3),lineReferences:j([...D].flatMap(M=>h.lineReferencesByCandidate.get(M)??[]))})).filter(p=>p.contexts.length>0),C=[...b.keys()];if(C.length>0){e&&(a+=1);let p=C.sort();g.push({doc:u,cited:p,citations:f,citedClaims:k(f.flatMap(D=>D.contexts)).slice(0,3)})}}return g},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:a}))}function Y(t,n){return v.test(n)&&!Dt(n)&&S(t.config.projectRoot,n)}function tt(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function Mt(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function vt(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(n.has(s))c=s;else if(i.has(s))c=s;else{let d=r.get(s);d?.length===1&&(c=d[0])}if(!c||!n.has(c))continue;let a=o.get(c)??new Set;a.add(s),o.set(c,a)}return o}function wt(t,n,e,i,r){let o=new Set,s=new Set,c=nt(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let a=c.candidates,d=c.contextsByCandidate,m=c.lineReferencesByCandidate,y=new Map,g=new Map,u=(l,h)=>{let b=d.get(h);if(b&&b.length>0){let R=y.get(l)??[];R.push(...b),y.set(l,k(R).slice(0,3))}let x=m.get(h);x&&x.length>0&&g.set(l,j([...g.get(l)??[],...x]))};for(let l of a){if(e.has(l)){o.add(l),u(l,l);continue}let h=i.get(l);if(h&&h.length===1){o.add(h[0]),u(h[0],l);continue}h&&h.length>1||r.has(l)&&s.add(l)}return{resolved:o,broken:[...s],citations:[...y].map(([l,h])=>({file:l,contexts:h,lineReferences:g.get(l)}))}}function Et(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function nt(t,n,e){let i=e;if(i===void 0&&(i=T(t,n),!i&&!S(t.config.projectRoot,n)))return null;let r=H(t,n,i),o=Q.read(t,n,r);if(o)return o;let s=kt(i);return Q.write(t,n,r,s),s}function It(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function kt(t){let n=t.split(/\r?\n/),e=new Set,i=new Map,r=new Map;for(let o=0;o<n.length;o+=1){let s=n[o]??"";for(let c of s.matchAll(St)){let a=(c[1]??"").replace(/^\.?\//,"");if(a.length===0)continue;e.add(a);let d=c[2]?Number(c[2]):null;d!==null&&Number.isSafeInteger(d)&&r.set(a,j([...r.get(a)??[],d]));let m=I(n,o);if(m.length===0)continue;let y=i.get(a)??[];y.push(m),i.set(a,k(y).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i,lineReferencesByCandidate:r}}function jt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()],lineReferencesByCandidate:[...t.lineReferencesByCandidate.entries()]};return JSON.stringify(n)}function Lt(t){try{let n=JSON.parse(t);if(!K(n))return null;let e=L(n.candidates),i=Nt(n.contextsByCandidate),r=_t(n.lineReferencesByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i),lineReferencesByCandidate:new Map(r??[])}}catch{return null}}function _t(t){if(t===void 0)return[];if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||!Array.isArray(e[1]))return null;let i=[];for(let r of e[1]){if(typeof r!="number"||!Number.isSafeInteger(r))return null;i.push(r)}n.push([e[0],j(i)])}return n}function Nt(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=L(e[1]);if(!i)return null;n.push([e[0],i])}return n}function k(t){let n=[];for(let e of new Set(t))n.some(i=>Pt(i,e))||n.push(e);return n}function j(t){return[...new Set(t)].sort((n,e)=>n-e)}function Pt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{Dt as a,en as b,rn as c};
|
|
5
|
-
//# sourceMappingURL=chunk-Q7CSKIDM.js.map
|
package/dist/chunk-QBQE7ZJ5.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-JZ2A7LDM.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-QBQE7ZJ5.js.map
|
package/dist/chunk-QH22UIXP.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as ee,b as ne,c as te}from"./chunk-X3YVZAKZ.js";import{a as Q}from"./chunk-NTGUVNR2.js";import{c as Z}from"./chunk-PXTRBKRK.js";import{a as z,b as W,c as J}from"./chunk-WFA35BGR.js";import{a as Y,d as w}from"./chunk-A4WEAK35.js";import{d as K}from"./chunk-NSM5IEVW.js";import{a as V,d as X}from"./chunk-Y5DFAW5W.js";import{h as H}from"./chunk-NU3KFF2O.js";import{d as E}from"./chunk-BOJ5SVE2.js";import{a as F,b as x}from"./chunk-FLMTCX5R.js";import{y as G}from"./chunk-RBAD4GJ2.js";import{k as U}from"./chunk-ETC674NS.js";import{createHash as ue}from"crypto";var le=6,ve=12,be=48,Ce=2e4,ie=12,L=Number.MAX_SAFE_INTEGER,ye=["definition","callers","callees"],N={search:12,"exact-source":24,definition:24,caller:8,callee:8,"production-reference":6,"test-reference":2,dependency:6,consumer:6};function rn(e,t){if(t.cursor)throw new Error("Inspect no longer accepts semantic packet cursors. Run the original inspect selectors again.");let n=xe(t),r=Ee(e,n),i=r.candidates.sort((c,h)=>O(c,h));n.view==="behavior"&&Re(e,i),ke(e,i),n.view==="behavior"&&we(e,i);let o=ee(i.map(c=>T(c,n.view)),n.evidenceBudgets,(c,h)=>O(c.candidate,h.candidate)),{selected:u,omitted:a}=ne(o.selected,n.maxUnits,n.maxCharacters,(c,h)=>O(c.candidate,h.candidate),n.view==="source"),l=u.map(c=>c.candidate),s=[...o.omitted,...a].map(c=>c.candidate),d=l.map(Ae),m=W(l.map(c=>c.kind==="source"?c.bindingClosure:void 0),l.filter(c=>c.kind==="source").map(c=>({relativePath:c.relativePath,startLine:c.startLine,endLine:c.endLine}))),p=d.reduce((c,h)=>c+(h.kind==="source"?qe(h.source):0),0),g=d.reduce((c,h)=>c+(h.kind==="source"?h.source.length:0),0),y=d.reduce((c,h)=>c+pe(h,n.view),0),v=d.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).map(De),b=i.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).length,fe=d.filter(c=>c.kind==="source"&&(c.roles.includes("search")||c.roles.includes("location"))).length,k=r.searches.map(c=>Me(c,i,l)),ge=Fe(s),A=r.locations.every(c=>c.matched)&&r.evidence.every(c=>c.kind==="matched")&&r.searches.every(c=>Te(c.textCoverage))&&s.every(c=>!c.roles.some(h=>h==="location"||h==="definition")),D=k.reduce((c,h)=>c+h.omittedMatches,0),$=s.length===0&&D===0,B=$?void 0:me(n,!0),j=$e(n,s),Se=Le($,A,s.length+D,j,k,B),q=i.filter(c=>n.view==="behavior"&&c.kind==="source"&&c.roles.some(h=>h==="location"||h==="definition"||h==="search")).map(c=>({id:`inspect:${c.relativePath}:${c.startLine}-${c.endLine}`,label:c.ownerShort??`${c.relativePath}:${c.startLine+1}`,file:c.relativePath,startLine:c.startLine,endLine:c.endLine})),M=q.length>0?Z(e,q):void 0;return{searches:k,evidence:r.evidence,locations:r.locations,slices:v,candidateSlices:b,omittedSlices:b-fe,maxSlices:b,maxTotalLines:p,units:d,candidateUnits:i.length,omittedUnits:s.length,maxUnits:n.maxUnits,maxCharacters:n.maxCharacters,returnedLines:p,returnedCharacters:g,returnedViewCharacters:y,view:n.view,omissionGroups:j,packetCoverage:{mode:$?"complete":"bounded",candidateUnits:i.length,returnedUnits:d.length,omittedUnits:s.length,omittedByRole:ge,exactSelectorsComplete:A,maxUnits:n.maxUnits,maxCharacters:n.maxCharacters,channels:Oe(i,l,n.evidenceBudgets,n.view),...B?{expansionCommand:B}:{}},stoppingSummary:Se,...M&&M.candidateAnchors>0?{causalFrontier:M}:{},bindingClosure:m,continuation:null}}function Le(e,t,n,r,i,o){let u=f([...r.map(a=>a.drillCommand),...i.flatMap(a=>a.exactFollowup?[a.exactFollowup]:[]),...o?[o]:[]]);return e&&t?{queryStatus:"selection-complete",status:"stop-ready",openEvidence:0,guidance:"All evidence requested by this inspect query was materialized.",drillCommands:[]}:t?{queryStatus:"frontier-accounted",status:"relevance-check-required",openEvidence:n,guidance:"Withheld evidence is accounted for by recoverable groups; drill the groups relevant to the current decision.",drillCommands:u}:{queryStatus:"coverage-incomplete",status:"exact-evidence-withheld",openEvidence:n,guidance:"A requested identity, exact source unit, or current-text coverage requirement is unresolved; drill before relying on it.",drillCommands:u}}function xe(e){let t=E(e.searches),n=E(e.symbols),r=E(e.locations),i=t.length+n.length+r.length;if(i===0)throw new Error("inspect requires at least one --search, --symbol, or --at selector.");if(i>24)throw new RangeError(`inspect accepts at most ${24} selectors; received ${i}.`);let o=e.evidence??{};if(e.unitLines!==void 0&&C(e.unitLines,"unitLines"),e.totalLines!==void 0&&C(e.totalLines,"totalLines"),e.sliceLimit!==void 0&&C(e.sliceLimit,"sliceLimit"),e.maxCharacters!==void 0&&C(e.maxCharacters,"maxCharacters"),e.maxUnits!==void 0&&C(e.maxUnits,"maxUnits"),e.view!==void 0&&e.view!=="source"&&e.view!=="behavior")throw new Error(`Unknown inspect view: ${String(e.view)}. Use source or behavior.`);if(e.full&&(e.searchLimit!==void 0||e.maxUnits!==void 0||e.maxCharacters!==void 0||e.evidenceBudgets!==void 0))throw new Error("full inspect cannot be combined with searchLimit, maxUnits, maxCharacters, or evidenceBudgets.");let u=e.full??!1;return{searches:t,symbols:n,locations:r,...e.scope?.trim()?{scope:e.scope.trim()}:{},context:ae(e.context??le,"context"),searchLimit:C(e.searchLimit??(u?L:ve),"searchLimit"),maxUnits:C(u?L:e.maxUnits??be,"maxUnits"),maxCharacters:C(u?L:e.maxCharacters??Ce,"maxCharacters"),evidenceBudgets:u?Ue():Ie(e.evidenceBudgets??N),view:e.view??"source",evidence:{...o.parts?{parts:[...o.parts]}:n.length>0?{parts:[...ye]}:{},...o.referenceContext!==void 0?{referenceContext:ae(o.referenceContext,"referenceContext")}:{},relatedSourceLines:o.relatedSourceLines??60,...o.semantic!==void 0?{semantic:o.semantic}:{}}}}function Ie(e){let t={...N};for(let[n,r]of Object.entries(e)){if(!(n in t))throw new Error(`Unknown inspect evidence channel: ${n}.`);if(!Number.isSafeInteger(r)||(r??-1)<0)throw new RangeError(`Evidence budget ${n} must be a non-negative safe integer; received ${r}.`);t[n]=r}return t}function Ue(){return Object.fromEntries(Object.keys(N).map(e=>[e,L]))}function Ee(e,t){let n=[],r=0,i=te(e,t.searches,{scope:t.scope,context:0,limit:t.searchLimit,ranking:"structural"}).map((s,d)=>({pattern:t.searches[d],result:s,matches:s.matches})),o=Math.max(0,...i.map(s=>s.matches.length));for(let s=0;s<o;s+=1)for(let d of i){let m=d.matches[s];if(!m)continue;let p=w(e,m.relativePath,m.focusLine,L,t.context);p&&I(e,n,p,"search",`search:${d.pattern}`,m.ownerSymbol,m.ownerShort,1,r++)}let u=i.map(({pattern:s,result:d})=>{let m=d.omittedMatches>0?de(s,t.scope):void 0,p=d.fileCoverage??[],g=_e(s,p,t.scope);return{pattern:s,matchingLines:d.matchingLines,returnedMatches:d.matches.length,omittedMatches:d.omittedMatches,matchingFiles:p.length,returnedFiles:p.filter(y=>y.returnedMatches>0).length,omittedFiles:p.filter(y=>y.returnedMatches===0).length,candidateUnits:0,selectedUnits:0,omittedUnits:0,scopeHints:g.slice(0,ie),omittedScopeHints:Math.max(0,g.length-ie),textCoverage:d.textCoverage,...m?{exactFollowup:m}:{}}}),a=t.locations.map(s=>{let d=je(s),m=d?K(e,d.path):null,p=m?w(e,m,d.line-1,L,t.context):null;return p&&I(e,n,p,"location",`at:${s}`,null,null,0,r++),{target:s,matched:p!==null}}),l=t.symbols.map(s=>Q(e,s,t.evidence));for(let s of l)if(s.kind==="matched"){if(s.definition){let d=w(e,s.definition.relativePath,s.definition.startLine,L,t.context);d&&I(e,n,d,"definition",`definition:${s.shortName}`,s.symbol,s.shortName,0,r++)}for(let d of s.referenceWindows){let m=d.references[0];I(e,n,{...d,focusLine:m?.line??d.startLine,unitType:null,unitStartLine:d.startLine,unitEndLine:d.endLine,omittedLines:0},"reference",`reference:${s.shortName}`,m?.enclosingSymbol??null,m?.enclosingShort??null,x(d.relativePath)==="test"?5:4,r++,d.references.map(p=>p.line),s.symbol)}for(let d of s.callers)re(e,n,d,"caller",s,2,r++);for(let d of s.callees)re(e,n,d,"callee",s,3,r++);for(let d of s.dependencies)oe(e,n,"dependency",s.file,d.relativePath,s.symbol,t.context,6,r++);for(let d of s.consumers)oe(e,n,"consumer",d.relativePath,s.file,s.symbol,t.context,7,r++)}return{searches:u,evidence:l,locations:a,candidates:n}}function O(e,t){return e.priority-t.priority||t.roles.length-e.roles.length||t.reasons.length-e.reasons.length||F(x(e.relativePath))-F(x(t.relativePath))||e.sequence-t.sequence}function T(e,t){return{candidate:e,priority:e.priority,sequence:e.sequence,relativePath:e.relativePath,fileKind:x(e.relativePath),evidenceCharacters:pe(e,t),roles:e.roles,reasons:e.reasons,symbols:e.symbols,behaviorSignals:e.kind==="source"?e.behavior?.signals??[]:[],channel:_(e)}}function _(e){let t=e.roles;return t.includes("location")?"exact-source":t.includes("definition")?"definition":t.includes("caller")?"caller":t.includes("callee")?"callee":t.includes("reference")?x(e.relativePath)==="test"?"test-reference":"production-reference":t.includes("dependency")?"dependency":t.includes("consumer")?"consumer":"search"}function we(e,t){let n=t.filter(i=>i.kind==="source"),r=H(e,{files:f(n.map(i=>i.relativePath))});for(let i of n){i.behavior=V(e,i.relativePath,i.startLine,i.endLine,i.focusLines)??void 0;let o=r.filter(a=>a.source.file===i.relativePath&&a.source.startLine<=i.endLine&&a.source.endLine>=i.startLine),u=o.filter(a=>!Pe(a,o)).map(a=>({observationId:a.id,protocol:a.protocol,action:a.action,role:a.role,strength:a.strength,resolution:a.resolution,line:a.source.startLine,endLine:a.source.endLine,keyParts:a.keyParts.map(l=>({name:l.name,value:l.value,evidence:l.evidence})),derivation:{kind:a.derivation.kind,rule:a.derivation.rule,sourceSpans:a.derivation.sourceSpans.length}}));i.runtimeFacts=u.length>0?u:void 0}}function Pe(e,t){if(e.strength!=="candidate"||e.protocol!=="http")return!1;let n=e.keyParts.find(i=>i.name==="path")?.value,r=e.keyParts.find(i=>i.name==="method")?.value;return n?t.some(i=>{if(i===e||i.action!==e.action||i.role!==e.role||i.source.startLine!==e.source.startLine||i.derivation.rule!=="http.mount-prefix")return!1;let o=i.keyParts.find(a=>a.name==="path")?.value,u=i.keyParts.find(a=>a.name==="method")?.value;return!!(o&&o!==n&&o.endsWith(n)&&(!r||r===u))}):!1}function Re(e,t){for(let n of t){if(n.kind!=="source")continue;let r=X(e,n.relativePath,n.startLine,n.endLine,n.focusLines);r.startLine===n.startLine&&r.endLine===n.endLine||(n.startLine=r.startLine,n.endLine=r.endLine,n.source=U(e,n.relativePath).slice(r.startLine,r.endLine+1).join(`
|
|
2
|
-
`),n.unitStartLine=r.startLine,n.unitEndLine=r.endLine,n.omittedLines=0)}}function ke(e,t){for(let n of t)n.kind==="source"&&(n.bindingClosure=z(e,n.relativePath,n.startLine,n.endLine))}function $e(e,t){let n=new Map;for(let r of t){let i=R(r.relativePath),o=_(r),u=[...r.roles].sort().join(","),a=r.kind==="path"?r.relationship:"",l=`${i}|${o}|${u}|${a}`,s=n.get(l)??[];s.push(r),n.set(l,s)}return[...n.entries()].map(([r,i])=>{let o=i[0],u=f(i.flatMap(l=>[...l.roles])).sort(),a=f(i.flatMap(l=>l.kind==="source"?l.behavior?.signals??[]:[])).sort();return{id:`g-${ue("sha256").update(r).digest("hex").slice(0,8)}`,scope:R(o.relativePath),channel:_(o),roles:u,behaviorSignals:a,candidateUnits:i.length,sourceCharacters:i.reduce((l,s)=>l+(s.kind==="source"?s.source.length:0),0),anchors:i.map(l=>({relativePath:l.relativePath,line:l.kind==="source"?l.focusLine:0,ownerShort:l.kind==="source"?l.ownerShort:null,roles:[...l.roles],behaviorSignals:l.kind==="source"?[...l.behavior?.signals??[]]:[]})),drillCommand:Be(e,i)}}).sort((r,i)=>i.candidateUnits-r.candidateUnits||i.sourceCharacters-r.sourceCharacters||r.scope.localeCompare(i.scope)||r.id.localeCompare(i.id))}function Be(e,t){let n=f(t.flatMap(o=>o.reasons.filter(u=>u.startsWith("search:")).map(u=>u.slice(7)))),r=R(t[0].relativePath);if(n.length>0&&t.every(o=>o.kind==="source"&&o.roles.includes("search"))){let o=["scip-query inspect"];for(let u of n)o.push(`--search ${S(u)}`);return o.push(`--scope ${S(r)}`,"--full"),e.view==="behavior"&&o.push("--view behavior"),o.join(" ")}let i=t.filter(o=>o.kind==="source");if(i.length>0&&i.length<=24){let o=["scip-query inspect"];for(let u of i)o.push(`--at ${S(`${u.relativePath}:${u.focusLine+1}`)}`);return e.view==="behavior"&&o.push("--view behavior"),o.join(" ")}return t.length===1&&t[0].kind==="path"?t[0].exactFollowup:me(e,!0)}function Me(e,t,n){let r=`search:${e.pattern}`,i=t.filter(a=>a.reasons.includes(r)).length,o=new Set(n),u=t.filter(a=>a.reasons.includes(r)&&o.has(a)).length;return{...e,candidateUnits:i,selectedUnits:u,omittedUnits:i-u}}function Fe(e){let t={};for(let n of e)for(let r of n.roles)t[r]=(t[r]??0)+1;return t}function Oe(e,t,n,r){let i=e.map(u=>T(u,r).channel),o=t.map(u=>T(u,r).channel);return Object.fromEntries(Object.keys(n).map(u=>{let a=i.filter(s=>s===u).length,l=o.filter(s=>s===u).length;return[u,{candidateUnits:a,returnedUnits:l,omittedUnits:a-l,maxUnits:n[u]}]}))}function Te(e){return!!(e&&e.skippedUnreadablePaths.length===0&&e.skippedOversizedPaths.length===0)}function _e(e,t,n){let r=new Map;for(let i of t){let o=R(i.relativePath),u=r.get(o)??{matchingLines:0,returnedMatches:0};u.matchingLines+=i.matchingLines,u.returnedMatches+=i.returnedMatches,r.set(o,u)}return[...r.entries()].map(([i,o])=>({scope:i,...o,exactFollowup:de(e,i||n)})).sort((i,o)=>o.matchingLines-i.matchingLines||o.returnedMatches-i.returnedMatches||i.scope.localeCompare(o.scope))}function R(e){let t=e.lastIndexOf("/");return t<0?e:e.slice(0,t)}function de(e,t){return`scip-query inspect --search ${S(e)}${t?` --scope ${S(t)}`:""} --full`}function me(e,t){let n=["scip-query inspect"];for(let r of e.searches)n.push(`--search ${S(r)}`);for(let r of e.symbols)n.push(`--symbol ${S(r)}`);for(let r of e.locations)n.push(`--at ${S(r)}`);return e.scope&&n.push(`--scope ${S(e.scope)}`),e.context!==le&&n.push(`--context ${e.context}`),e.evidence.parts&&n.push(`--include ${S(e.evidence.parts.join(","))}`),t&&n.push("--full"),e.view==="behavior"&&n.push("--view behavior"),n.join(" ")}function re(e,t,n,r,i,o,u){I(e,t,{...n,unitType:null,unitStartLine:n.startLine,unitEndLine:n.endLine+n.omittedLines},r,`${r}:${i.shortName}`,n.symbol,n.shortName,o,u,[n.focusLine],i.symbol)}function oe(e,t,n,r,i,o,u,a,l){let s=`${r} -> ${i}`,d=G(e,r).filter(b=>b.sourcePath===i),m=U(e,r),p=Ne(m,d,i),g=p===null?null:Y(e,r,p,Math.min(u,4));if(g){I(e,t,{...g,unitType:null,unitStartLine:g.startLine,unitEndLine:g.endLine,omittedLines:0},n,`${n}:${s}`,null,null,a,l,[g.focusLine],o);return}let y=`scip-query inspect --search ${S(he(i))} --scope ${S(r)}`,v=t.find(b=>b.kind==="path"&&b.relativePath===r&&b.relationship===s);if(v){v.roles=f([...v.roles,n]),v.reasons=f([...v.reasons,`${n}:${s}`]),v.symbols=f([...v.symbols,o]),v.priority=Math.min(v.priority,a);return}t.push({kind:"path",roles:[n],relativePath:r,relationship:s,reasons:[`${n}:${s}`],symbols:[o],exactFollowup:y,priority:a,sequence:l})}function Ne(e,t,n){let r=f(t.flatMap(l=>[l.importedName,l.localName??""]).filter(l=>l.length>1)),i=he(n).replace(/\.[^.]+$/u,""),o=f([...r,i]).filter(Boolean),u=/\b(?:from|import|include|require|use)\b/u,a=e.findIndex(l=>u.test(l)&&o.some(s=>l.includes(s)));return a>=0?a:null}function I(e,t,n,r,i,o,u,a,l,s=[n.focusLine],d){let m=t.find(p=>p.kind==="source"&&p.relativePath===n.relativePath&&p.startLine<=n.endLine&&n.startLine<=p.endLine);if(m){let p=Math.min(m.startLine,n.startLine),g=Math.max(m.endLine,n.endLine);m.startLine=p,m.endLine=g,m.source=U(e,n.relativePath).slice(p,g+1).join(`
|
|
3
|
-
`),m.focusLine=Math.min(m.focusLine,n.focusLine),m.focusLines=ce([...m.focusLines,...s]),m.unitStartLine=Math.min(m.unitStartLine,n.unitStartLine),m.unitEndLine=Math.max(m.unitEndLine,n.unitEndLine),m.omittedLines=Math.max(m.omittedLines,n.omittedLines),m.reasons=f([...m.reasons,i]),m.roles=f([...m.roles,r]),m.symbols=f([...m.symbols,...d?[d]:[]]),!m.ownerSymbol&&o&&(m.ownerSymbol=o),!m.ownerShort&&u&&(m.ownerShort=u),m.priority=Math.min(m.priority,a);return}t.push({kind:"source",...n,reasons:[i],focusLines:ce(s),ownerSymbol:o,ownerShort:u,roles:[r],symbols:d?[d]:[],priority:a,sequence:l})}function Ae(e){if(e.kind==="path"){let{priority:o,sequence:u,...a}=e;return{...a,id:se(a)}}let{priority:t,sequence:n,bindingClosure:r,...i}=e;return{...i,id:se(i),omittedCharacters:0}}function De(e){let{kind:t,id:n,roles:r,symbols:i,omittedCharacters:o,behavior:u,runtimeFacts:a,...l}=e;return l}function se(e){return ue("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}function je(e){let t=e.match(/^(.+\.\w+):(\d+)$/u);if(!t)return null;let n=Number(t[2]);return Number.isSafeInteger(n)&&n>0?{path:t[1],line:n}:null}function f(e){return[...new Set(e)]}function ce(e){return f(e).sort((t,n)=>t-n)}function qe(e){return e.length===0?0:e.split(`
|
|
4
|
-
`).length}function pe(e,t){if(e.kind==="path")return e.relationship.length+e.exactFollowup.length;let n="bindingClosure"in e?J(e.bindingClosure):0,r=(e.runtimeFacts??[]).reduce((i,o)=>i+o.action.length+o.derivation.rule.length+o.keyParts.reduce((u,a)=>u+a.name.length+a.value.length+4,0)+24,0);return t!=="behavior"?e.source.length+n:e.behavior?e.behavior.lines.reduce((i,o)=>i+o.text.length+o.signals.join(",").length+12,0)+e.behavior.testCases.reduce((i,o)=>i+o.length+2,0)+r+n:e.source.length+n+r}function he(e){return e.split("/").at(-1)??e}function S(e){return`'${e.replaceAll("'","'\\''")}'`}function C(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new RangeError(`${t} must be a positive safe integer; received ${e}`);return e}function ae(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer; received ${e}`);return e}export{rn as a};
|
|
5
|
-
//# sourceMappingURL=chunk-QH22UIXP.js.map
|
package/dist/chunk-QXCKQTKR.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import{C as f,I as u}from"./chunk-JZ2A7LDM.js";import b from"ignore";import{existsSync as y,readdirSync as v}from"fs";import{dirname as d,isAbsolute as m,join as l,relative as T,resolve as S}from"path";function E(n){let t=b();return _(n,t)||t.add(F),{isIgnored:e=>g(t,n,e),filter:e=>e.filter(i=>!g(t,n,i))}}function _(n,t){let r=new Set,e=(s,a)=>{if(!(r.has(s)||!y(s)))try{let c=u(s,{maxBytes:f,inputKind:"gitignore file"});t.add(a?$(c,a):c),r.add(s)}catch{}},i=d(n),o=0;for(;i!==d(i)&&o<5&&(e(l(i,".gitignore"),""),!y(l(i,".git")));)i=d(i),o++;return h(n,"",t,e),r.size>0}function h(n,t,r,e){let i=t?l(n,t):n;e(l(i,".gitignore"),t);let o;try{o=v(i,{withFileTypes:!0})}catch{return}for(let s of o){if(!s.isDirectory()||s.name===".git")continue;let a=t?`${t}/${s.name}`:s.name;g(r,n,`${a}/`)||h(n,a,r,e)}}function $(n,t){let r=t.replaceAll("\\","/").replace(/\/+$/,"");return n.split(/\r?\n/).map(e=>A(e,r)).join(`
|
|
2
|
-
`)}function A(n,t){let r=n.trimStart();if(!r||r.startsWith("#"))return n;let e=n.slice(0,n.length-r.length),i=r.startsWith("!"),o=i?r.slice(1):r;if(!o||o.startsWith("#"))return n;let s=o.startsWith("/"),a=s?o.slice(1):o,p=(a.endsWith("/")?a.slice(0,-1):a).includes("/")||s?`${t}/${a}`:`${t}/**/${a}`;return`${e}${i?"!":""}${p}`}var F=`
|
|
3
|
-
# Dependencies
|
|
4
|
-
node_modules/
|
|
5
|
-
vendor/
|
|
6
|
-
.bundle/
|
|
7
|
-
|
|
8
|
-
# Build output
|
|
9
|
-
dist/
|
|
10
|
-
build/
|
|
11
|
-
out/
|
|
12
|
-
target/
|
|
13
|
-
bin/
|
|
14
|
-
obj/
|
|
15
|
-
|
|
16
|
-
# Python
|
|
17
|
-
__pycache__/
|
|
18
|
-
*.pyc
|
|
19
|
-
*.pyo
|
|
20
|
-
.venv/
|
|
21
|
-
venv/
|
|
22
|
-
.env/
|
|
23
|
-
env/
|
|
24
|
-
*.egg-info/
|
|
25
|
-
|
|
26
|
-
# Rust
|
|
27
|
-
target/
|
|
28
|
-
|
|
29
|
-
# Java / Kotlin / Scala
|
|
30
|
-
*.class
|
|
31
|
-
.gradle/
|
|
32
|
-
.mvn/
|
|
33
|
-
|
|
34
|
-
# C# / .NET
|
|
35
|
-
bin/
|
|
36
|
-
obj/
|
|
37
|
-
packages/
|
|
38
|
-
|
|
39
|
-
# Go
|
|
40
|
-
vendor/
|
|
41
|
-
|
|
42
|
-
# Dart
|
|
43
|
-
.dart_tool/
|
|
44
|
-
build/
|
|
45
|
-
|
|
46
|
-
# PHP
|
|
47
|
-
vendor/
|
|
48
|
-
|
|
49
|
-
# IDE / OS
|
|
50
|
-
.idea/
|
|
51
|
-
.vscode/
|
|
52
|
-
*.swp
|
|
53
|
-
*.swo
|
|
54
|
-
.DS_Store
|
|
55
|
-
Thumbs.db
|
|
56
|
-
|
|
57
|
-
# Type definitions (often noise in queries)
|
|
58
|
-
*.d.ts
|
|
59
|
-
`;function g(n,t,r){let e=x(t,r);if(!e)return!1;try{return n.ignores(e)}catch{return!1}}function x(n,t){if(!t||t===".")return null;if(!m(t)&&!t.startsWith(".."))return t.replaceAll("\\","/");let r=m(t)?t:S(n,t),e=T(n,r).replaceAll("\\","/");return!e||e==="."||e.startsWith("..")?null:e}export{E as a};
|
|
60
|
-
//# sourceMappingURL=chunk-QXCKQTKR.js.map
|