scip-query 0.19.8 → 0.20.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 +97 -0
- package/README.md +158 -48
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-26QA6FAI.js +8 -0
- package/dist/{chunk-KJ2IIBZN.js → chunk-2HPVVXM5.js} +2 -2
- package/dist/chunk-2KAZEZ6M.js +2 -0
- package/dist/chunk-32LVLCLN.js +40 -0
- package/dist/{chunk-24GTWJ3N.js → chunk-3CLX5EOX.js} +2 -2
- package/dist/{chunk-QGGLL3UH.js → chunk-3G66UZBH.js} +2 -2
- package/dist/{chunk-AA4UWRNL.js → chunk-3ORVDL3H.js} +2 -2
- package/dist/chunk-4MAK2HOY.js +6 -0
- package/dist/{chunk-QIQ63BHW.js → chunk-4TURLRL5.js} +2 -2
- package/dist/chunk-4UQVNCQE.js +2 -0
- package/dist/chunk-55Q3WLZX.js +2 -0
- package/dist/{chunk-CTF2GDEX.js → chunk-5E4WNAVD.js} +2 -2
- package/dist/{chunk-ZCEJ63SP.js → chunk-5I5G2QOX.js} +2 -2
- package/dist/chunk-6LDJQXAH.js +2 -0
- package/dist/{chunk-3EDFLQ6A.js → chunk-6O5TICIZ.js} +2 -2
- package/dist/{chunk-ACAM6O5R.js → chunk-6SHPK5ZE.js} +2 -2
- package/dist/chunk-7BAVHKMJ.js +49 -0
- package/dist/chunk-7O5IKBTZ.js +16 -0
- package/dist/{chunk-WJL2L6MV.js → chunk-7PIO7NKH.js} +2 -2
- package/dist/chunk-7S5E7KWT.js +2 -0
- package/dist/{chunk-YLFORA5G.js → chunk-7SQQWSY3.js} +2 -2
- package/dist/chunk-7WPLAODU.js +5 -0
- package/dist/chunk-A73XVBCR.js +20 -0
- package/dist/chunk-AFHORGLH.js +42 -0
- package/dist/chunk-AIE7TFJW.js +9 -0
- package/dist/{chunk-TWMJ3Y3G.js → chunk-AZJQQKDD.js} +2 -2
- package/dist/{chunk-BDOIKGDI.js → chunk-B2PX5I6M.js} +2 -2
- package/dist/{chunk-DQBCO2UY.js → chunk-B7PBSLZN.js} +2 -2
- package/dist/chunk-BBW6JFHN.js +2 -0
- package/dist/{chunk-YTVWB7YJ.js → chunk-BDCC2NPY.js} +2 -2
- package/dist/{chunk-O23I56NA.js → chunk-BNXCIFVY.js} +2 -2
- package/dist/{chunk-MLFZP76A.js → chunk-BPAPWKP6.js} +2 -2
- package/dist/chunk-BS2NMXQZ.js +4 -0
- package/dist/chunk-C3KV2II6.js +2 -0
- package/dist/chunk-C43RDDP4.js +20 -0
- package/dist/{chunk-K2WO7XY7.js → chunk-CJST5ETY.js} +2 -2
- package/dist/chunk-DAFAHMNB.js +42 -0
- package/dist/{chunk-KKME5ZAI.js → chunk-DQGFVPUV.js} +2 -2
- package/dist/chunk-DQLPXMH6.js +8 -0
- package/dist/chunk-EKZTZXHZ.js +117 -0
- package/dist/{chunk-FJ5UDTQF.js → chunk-EN3O7VJA.js} +2 -2
- package/dist/{chunk-HZYDQPNY.js → chunk-EW2NTSFA.js} +2 -2
- package/dist/chunk-F3Z4OUDS.js +8 -0
- package/dist/chunk-FJH2NW7J.js +66 -0
- package/dist/{chunk-MSBDMFER.js → chunk-FKSELJQF.js} +2 -2
- package/dist/chunk-FTFP6O3L.js +11 -0
- package/dist/chunk-FYLK2DEJ.js +2 -0
- package/dist/{chunk-WUW7YUAH.js → chunk-GH74ASD6.js} +2 -2
- package/dist/{chunk-464PLI5O.js → chunk-GMXWZP2B.js} +2 -2
- package/dist/chunk-GOUBFH5O.js +3 -0
- package/dist/{chunk-FIJCV235.js → chunk-HLF2TX6R.js} +2 -2
- package/dist/{chunk-WWKWUPSU.js → chunk-HX4GQPZP.js} +2 -2
- package/dist/chunk-HX7M4BDI.js +30 -0
- package/dist/chunk-HZ72SESS.js +128 -0
- package/dist/{chunk-SERUIGV5.js → chunk-IB2N4FIY.js} +2 -2
- package/dist/chunk-ILMHV3KM.js +2 -0
- package/dist/chunk-IZYYAFN5.js +2 -0
- package/dist/{chunk-GNC4JVAN.js → chunk-JAYYFEQY.js} +2 -2
- package/dist/{chunk-QJIVBYEK.js → chunk-JDOEX4E6.js} +2 -2
- package/dist/chunk-JFGGXWQF.js +947 -0
- package/dist/chunk-JN4NMBEX.js +8 -0
- package/dist/{chunk-6M7RONVB.js → chunk-JVYA47YU.js} +2 -2
- package/dist/{chunk-7KYNAMMH.js → chunk-JW56N3KI.js} +2 -2
- package/dist/{chunk-OUBAF226.js → chunk-JZ2OXNWB.js} +2 -2
- package/dist/chunk-KMKTIO2G.js +8 -0
- package/dist/chunk-L5GJNV2T.js +8 -0
- package/dist/{chunk-MNSTUIDD.js → chunk-L7AW2QB5.js} +2 -2
- package/dist/chunk-L7JDSCDF.js +4 -0
- package/dist/chunk-LU47HG23.js +14 -0
- package/dist/chunk-LVY7NPF7.js +2 -0
- package/dist/chunk-LY4WC4AD.js +74 -0
- package/dist/{chunk-7FT5Y65S.js → chunk-MKCDWWGV.js} +2 -2
- package/dist/chunk-MNE7YG56.js +2 -0
- package/dist/{chunk-7QHY3H7P.js → chunk-MRXBEXSY.js} +2 -2
- package/dist/chunk-MV7OWDUX.js +2 -0
- package/dist/{chunk-ZJ5CBXK3.js → chunk-N5W4YZMK.js} +2 -2
- package/dist/chunk-NGEXCJJW.js +11 -0
- package/dist/{chunk-7SWJEWJF.js → chunk-NIW6JDC5.js} +2 -2
- package/dist/{chunk-O3O4XXO6.js → chunk-O64IZ6UX.js} +2 -2
- package/dist/{chunk-3ZSJ3PWF.js → chunk-PBUQFCNB.js} +2 -2
- package/dist/{chunk-7RAG65VK.js → chunk-POAVPHH7.js} +2 -2
- package/dist/{chunk-A3QXWFBK.js → chunk-PQCI4SQX.js} +2 -2
- package/dist/{chunk-4BV4QAZJ.js → chunk-PXY7F6Y4.js} +2 -2
- package/dist/chunk-RDO52JGY.js +2 -0
- package/dist/chunk-RJT3TUUZ.js +2 -0
- package/dist/{chunk-S4S2WOIX.js → chunk-RUJURYSV.js} +2 -2
- package/dist/{chunk-JAY7YWS3.js → chunk-RVLDN63O.js} +2 -2
- package/dist/chunk-RXOXSKY3.js +2 -0
- package/dist/chunk-S7OYBOCK.js +2 -0
- package/dist/chunk-SMNXQT5Z.js +3 -0
- package/dist/{chunk-NE3TZUCI.js → chunk-SRAFT254.js} +2 -2
- package/dist/{chunk-ELLMY7XJ.js → chunk-SXP2MBJH.js} +2 -2
- package/dist/chunk-T7YQSHPQ.js +3 -0
- package/dist/{chunk-WY45BHKQ.js → chunk-TFRAYKN6.js} +2 -2
- package/dist/{chunk-2SNGN6U4.js → chunk-UJCOIXDY.js} +2 -2
- package/dist/{chunk-MZZBAITE.js → chunk-UJPRPGCO.js} +2 -2
- package/dist/chunk-W4ETQAXM.js +2 -0
- package/dist/chunk-WCCFZ7V7.js +113 -0
- package/dist/chunk-WUPW3UN3.js +3 -0
- package/dist/{chunk-7LSVMFX7.js → chunk-WXZLAAWK.js} +2 -2
- package/dist/{chunk-5ML2BNRH.js → chunk-X54AGLVX.js} +2 -2
- package/dist/chunk-XKWKXZKW.js +20 -0
- package/dist/{chunk-5YLUDDAF.js → chunk-XSRF6Q77.js} +2 -2
- package/dist/chunk-Y2MVPNKY.js +5 -0
- package/dist/{chunk-JHF3E4YM.js → chunk-YKUU5AIC.js} +2 -2
- package/dist/{chunk-E3HYEQO7.js → chunk-YLCJLTPL.js} +2 -2
- package/dist/{chunk-7VCOXZH3.js → chunk-YTQVETEO.js} +2 -2
- package/dist/chunk-Z4N3MZYA.js +38 -0
- package/dist/chunk-ZHXX42OH.js +18 -0
- package/dist/chunk-ZJOOT3BG.js +2 -0
- package/dist/{chunk-P3UO3EH3.js → chunk-ZK26BAQL.js} +2 -2
- package/dist/{chunk-33KUO7CG.js → chunk-ZTETIQ35.js} +2 -2
- package/dist/cli.js +3 -8
- package/dist/command-descriptors-DSS46KXI.js +642 -0
- package/dist/{config-types-B6MEoRNy.d.ts → config-types-jVM3D7MA.d.ts} +68 -2
- package/dist/{db-DYLKr9Wn.d.ts → db-B5PM5yNk.d.ts} +20 -2
- package/dist/{diff-gate-types-C9BoYwYD.d.ts → diff-gate-types-B0QYpDv1.d.ts} +2 -1
- package/dist/direct-navigation-6YHV6IB5.js +3 -0
- package/dist/{health-DgxIDXJC.d.ts → health-Do5TKSJI.d.ts} +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +2 -2
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.d.ts +2 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +22 -3
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +2 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +3 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +3 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +2 -2
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +2 -2
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +40 -7
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +84 -6
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +3 -3
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +3 -3
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +2 -2
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +12 -3
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- 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 +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +8 -6
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +141 -10
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- 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.d.ts +34 -3
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +3 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +3 -3
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +2 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +14 -3
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +21 -21
- package/dist/reindex.d.ts +3 -3
- package/dist/reindex.js +33 -33
- package/dist/runtime.d.ts +5 -3
- package/dist/runtime.js +3 -3
- 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/{scip-cli-Cc6c00-a.d.ts → scip-cli-BnEwZRLJ.d.ts} +1 -1
- package/dist/{symbol-types-BgWU6lhL.d.ts → symbol-types-BIQwfoAx.d.ts} +7 -1
- package/dist/typescript-mailbox-worker.js +2 -0
- package/dist/watch-server.js +2 -42
- package/docs/AGENT_GUIDE.md +13 -6
- package/docs/CLI_JSON_OUTPUT.md +110 -22
- package/docs/COMMAND_REFERENCE.md +88 -88
- package/docs/COMMITTED_RECORD_COMPATIBILITY.md +55 -18
- package/docs/DURABILITY.md +88 -38
- package/docs/INDEX_GENERATIONS.md +65 -19
- package/docs/MAILBOX_LIFECYCLE.md +28 -1
- package/docs/REINDEX_METADATA_COMPATIBILITY.md +18 -8
- package/docs/SECURITY_MODEL.md +31 -14
- package/docs/TELEMETRY_RETENTION.md +11 -4
- package/docs/WATCH_REFRESH_REQUESTS.md +34 -21
- package/docs/WINDOWS_SIDECAR_RELEASE.md +9 -4
- package/docs/analyzer-inventory.md +31 -22
- package/docs/analyzer-validation-ledger.md +8 -0
- package/docs/schemas/outcome-event-record.schema.json +57 -1
- package/docs/schemas/project-config.schema.json +82 -1
- package/docs/schemas/suppression-record.schema.json +84 -3
- package/package.json +5 -5
- package/skills/_shared/SKILL.md +2 -2
- package/skills/_shared/references/agent-contract-catalog.md +1 -1
- package/skills/_shared/references/detector-precision-and-diffgate.md +1 -1
- package/skills/scip-audit/SKILL.md +6 -6
- package/skills/scip-audit/references/claims.md +1 -1
- package/skills/scip-audit/references/cleanup.md +19 -20
- package/skills/scip-audit/references/directory.md +4 -4
- package/skills/scip-audit/references/frontend.md +10 -10
- package/skills/scip-audit/references/twin-drift.md +2 -2
- package/skills/scip-diagnose/references/debug.md +8 -8
- package/skills/scip-diagnose/references/root-cause.md +3 -3
- package/skills/scip-diagnose/references/triage.md +10 -10
- package/skills/scip-explore/SKILL.md +3 -3
- package/skills/scip-improve/SKILL.md +10 -10
- package/skills/scip-improve/references/cleanup-batches.md +3 -3
- package/skills/scip-improve/references/directory-moves.md +3 -3
- package/skills/scip-improve/references/doc-reconcile.md +1 -1
- package/skills/scip-improve/references/frontend-extraction.md +2 -2
- package/skills/scip-improve/references/twin-drift.md +3 -3
- package/skills/scip-plan/SKILL.md +2 -2
- package/skills/scip-plan/references/api-impact.md +5 -5
- package/skills/scip-plan/references/conductor.md +2 -2
- package/skills/scip-plan/references/hyper-optimization.md +1 -1
- package/skills/scip-query/SKILL.md +15 -5
- package/skills/scip-setup/references/bootstrap-workflow.md +7 -8
- package/skills/scip-setup/references/language-verification.md +2 -2
- package/skills/scip-setup/references/per-repo-triage.md +1 -1
- package/skills/scip-verify/SKILL.md +10 -10
- package/skills/scip-verify/references/calibrate-detectors.md +7 -7
- package/dist/chunk-2465DLHK.js +0 -3
- package/dist/chunk-2U3OLUNJ.js +0 -61
- package/dist/chunk-33XTHFKR.js +0 -2
- package/dist/chunk-43KC6EQZ.js +0 -2
- package/dist/chunk-47BU5Z4T.js +0 -8
- package/dist/chunk-4YTUWQ6M.js +0 -18
- package/dist/chunk-64MNV6AB.js +0 -8
- package/dist/chunk-67QRR5YC.js +0 -6
- package/dist/chunk-6GXYN7YA.js +0 -40
- package/dist/chunk-A2TNXAXO.js +0 -8
- package/dist/chunk-APMMR5Y2.js +0 -2
- package/dist/chunk-AZFUMCQB.js +0 -2
- package/dist/chunk-BNXICU42.js +0 -33
- package/dist/chunk-C5Q44Q5D.js +0 -3
- package/dist/chunk-DQGSM7RZ.js +0 -20
- package/dist/chunk-E2LAW7SL.js +0 -30
- package/dist/chunk-E4NFOAD4.js +0 -6
- package/dist/chunk-E5HNT4X2.js +0 -3
- package/dist/chunk-FD3HFKXR.js +0 -5
- package/dist/chunk-GHKEJTCE.js +0 -35
- package/dist/chunk-GLZTVKAB.js +0 -16
- package/dist/chunk-HIB452NU.js +0 -949
- package/dist/chunk-IF6FP6B2.js +0 -66
- package/dist/chunk-JORHF5AL.js +0 -108
- package/dist/chunk-KSGTULOS.js +0 -9
- package/dist/chunk-KXDJAG4N.js +0 -38
- package/dist/chunk-L4S2A7BV.js +0 -2
- package/dist/chunk-LP3ARJKF.js +0 -8
- package/dist/chunk-LSOR3LQG.js +0 -3
- package/dist/chunk-NTUMF2X3.js +0 -56
- package/dist/chunk-QOXBSI6G.js +0 -20
- package/dist/chunk-QXK6UUSM.js +0 -2
- package/dist/chunk-RA3AYNWP.js +0 -112
- package/dist/chunk-RJMDJR3A.js +0 -2
- package/dist/chunk-RLH5VUMG.js +0 -2
- package/dist/chunk-SMQWE25B.js +0 -3
- package/dist/chunk-TAVELHYR.js +0 -2
- package/dist/chunk-VAXNI5NE.js +0 -146
- package/dist/chunk-VVY2G5ET.js +0 -2
- package/dist/chunk-W3DBTGL4.js +0 -11
- package/dist/chunk-WANA4KAQ.js +0 -5
- package/dist/chunk-X4FR5BZF.js +0 -9
- package/dist/chunk-X6RKPDY7.js +0 -2
- package/dist/chunk-YCPASUCX.js +0 -2
- package/dist/chunk-ZL2OGDCD.js +0 -2
- package/dist/command-descriptors-ZW5J4ZEM.js +0 -631
- package/dist/direct-navigation-42YHQPOI.js +0 -3
package/dist/chunk-2U3OLUNJ.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import{c as R}from"./chunk-2SNGN6U4.js";import{a as _,d as f}from"./chunk-LP3ARJKF.js";import{d as l}from"./chunk-RA3AYNWP.js";import{o as u,p,q as a}from"./chunk-MZZBAITE.js";import{O as m}from"./chunk-JORHF5AL.js";import{a as d}from"./chunk-64MNV6AB.js";function $(e,o={}){let{scope:n,limit:r}=o,i=new R(e),t=D([...x(e,n),...O(e,i,n)]);return y(t),r?t.slice(0,r):t}function x(e,o){let n=[];for(let r of S(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||f(e,r.barrel_path)||m(e,r.barrel_path)&&a(e,r.barrel_path).length===0)continue;let i=N(e,r),t=i?.barrel_consumers??0,s=i?.direct_consumers??0;t!==0||s!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:l(r.symbol),originalFile:r.original_path,barrelConsumers:t,directConsumers:s,...b(e,r.barrel_path)})}return n}function S(e,o){let n=o?"AND barrel_d.relative_path LIKE ?":"",r=o?[`%${o}%`]:[];return e.all(`SELECT DISTINCT
|
|
2
|
-
barrel_d.id AS barrel_doc_id,
|
|
3
|
-
barrel_d.relative_path AS barrel_path,
|
|
4
|
-
gs.id AS symbol_id,
|
|
5
|
-
gs.symbol AS symbol,
|
|
6
|
-
orig_d.id AS original_doc_id,
|
|
7
|
-
orig_d.relative_path AS original_path
|
|
8
|
-
FROM mentions m
|
|
9
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
-
JOIN documents barrel_d ON c.document_id = barrel_d.id
|
|
11
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
12
|
-
JOIN (
|
|
13
|
-
SELECT m2.symbol_id, c2.document_id
|
|
14
|
-
FROM mentions m2
|
|
15
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
16
|
-
WHERE m2.role = 1
|
|
17
|
-
GROUP BY m2.symbol_id
|
|
18
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
19
|
-
JOIN documents orig_d ON sym_def.document_id = orig_d.id
|
|
20
|
-
WHERE m.role != 1
|
|
21
|
-
AND (barrel_d.relative_path LIKE '%/index.ts'
|
|
22
|
-
OR barrel_d.relative_path LIKE '%/index.js'
|
|
23
|
-
OR barrel_d.relative_path = 'index.ts'
|
|
24
|
-
OR barrel_d.relative_path = 'index.js')
|
|
25
|
-
AND orig_d.id != barrel_d.id
|
|
26
|
-
${e.pathExclusionsFor("barrel_d","orig_d")}
|
|
27
|
-
${e.symbolNoiseFor("gs")}
|
|
28
|
-
-- Only function-level symbols (ending with ().), not module-level
|
|
29
|
-
AND gs.symbol LIKE '%().'
|
|
30
|
-
${n}
|
|
31
|
-
ORDER BY barrel_d.relative_path, gs.symbol`,...r)}function N(e,o){return e.get(`SELECT
|
|
32
|
-
SUM(CASE WHEN uses_barrel = 1 THEN 1 ELSE 0 END) AS barrel_consumers,
|
|
33
|
-
SUM(CASE WHEN uses_barrel = 0 THEN 1 ELSE 0 END) AS direct_consumers
|
|
34
|
-
FROM (
|
|
35
|
-
SELECT
|
|
36
|
-
consumer_d.id AS consumer_doc_id,
|
|
37
|
-
MAX(CASE WHEN EXISTS (
|
|
38
|
-
SELECT 1
|
|
39
|
-
FROM mentions barrel_m
|
|
40
|
-
JOIN chunks barrel_c ON barrel_m.chunk_id = barrel_c.id
|
|
41
|
-
WHERE barrel_c.document_id = consumer_d.id
|
|
42
|
-
AND barrel_m.role != 1
|
|
43
|
-
AND barrel_m.symbol_id IN (
|
|
44
|
-
SELECT m2.symbol_id
|
|
45
|
-
FROM mentions m2
|
|
46
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
47
|
-
WHERE c2.document_id = ?
|
|
48
|
-
AND m2.role != 1
|
|
49
|
-
)
|
|
50
|
-
) THEN 1 ELSE 0 END) AS uses_barrel
|
|
51
|
-
FROM mentions ref_m
|
|
52
|
-
JOIN chunks ref_c ON ref_m.chunk_id = ref_c.id
|
|
53
|
-
JOIN documents consumer_d ON ref_c.document_id = consumer_d.id
|
|
54
|
-
WHERE ref_m.symbol_id = ?
|
|
55
|
-
AND ref_m.role != 1
|
|
56
|
-
AND consumer_d.id != ?
|
|
57
|
-
AND consumer_d.id != ?
|
|
58
|
-
${e.pathExclusionsFor("consumer_d")}
|
|
59
|
-
GROUP BY consumer_d.id
|
|
60
|
-
)`,o.barrel_doc_id,o.symbol_id,o.barrel_doc_id,o.original_doc_id)}function O(e,o,n){let r=[];for(let i of C(e,n))h(e,i,i)>0||r.push(...I(e,o,i));return r}function C(e,o){return d(e,{scope:o,includeIgnored:!1}).filter(n=>a(e,n).length>0||u(e,n).length>0)}function I(e,o,n){let r=a(e,n).filter(t=>t.sourcePath&&!e.isIgnored(t.sourcePath)).flatMap(t=>g(e,o,n,t.sourcePath,[A(t.specifier)])),i=u(e,n).filter(t=>t.sourcePath&&!e.isIgnored(t.sourcePath)).flatMap(t=>g(e,o,n,t.sourcePath,t.kind==="named"&&t.names.length>0?t.names:[t.kind==="star"?`* from ${t.sourcePath}`:`* namespace from ${t.sourcePath}`]));return[...r,...i]}function g(e,o,n,r,i){let t=o.definitionsForFile(r);return i.map(s=>{let c=t.find(E=>E.leaf===s);return{barrelFile:n,symbol:c?.symbol??`source-reexport:${n}:${s}`,shortName:c?l(c.symbol):s,originalFile:r,barrelConsumers:0,directConsumers:h(e,r,n),...b(e,n)}})}function A(e){return e.split("::").at(-1)?.split("/").at(-1)?.replace(/\.[^.]+$/,"")??e}function b(e,o){return _(e,o)?{actionTier:"signal",surfaceEvidence:["barrel file is declared on the package public surface"],recommendation:"Review the package API before removing this re-export; local consumers are zero, but external consumers may import through the public barrel."}:{actionTier:"direct",surfaceEvidence:[],recommendation:"Remove this unused re-export when the barrel is not part of an external API surface."}}function h(e,o,n){let r=new Set;for(let i of d(e,{includeIgnored:!1}))if(i!==n)for(let t of p(e,i))t.sourcePath===o&&r.add(i);return r.size}function D(e){let o=new Set,n=[];for(let r of e){let i=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;o.has(i)||(o.add(i),n.push(r))}return n}function y(e){e.sort((o,n)=>n.directConsumers-o.directConsumers||o.barrelFile.localeCompare(n.barrelFile)||o.shortName.localeCompare(n.shortName))}export{$ as a};
|
|
61
|
-
//# sourceMappingURL=chunk-2U3OLUNJ.js.map
|
package/dist/chunk-33XTHFKR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-SMQWE25B.js";import{a as c}from"./chunk-64MNV6AB.js";import{existsSync as m}from"fs";import{basename as p,isAbsolute as g,join as d}from"path";function S(t,r){let e=f(t,r,{allowMultiple:!1})[0]?.relativePath;return e||x(t,r)}function j(t,r){return f(t,r,{allowMultiple:!0}).map(e=>e.relativePath)}function x(t,r){if(!r)return null;let e=r.replace(/\\/g,"/").replace(/^\.\//,""),s=g(e)&&e.startsWith(t.config.projectRoot)?e.slice(t.config.projectRoot.length).replace(/^\/+/,""):e,i=d(t.config.projectRoot,s);return m(i)?s:null}function f(t,r,e){let s=h(r);if(!s)return[];let i=c(t,{includeIgnored:!1}).map(o=>({relativePath:o,score:v(o,s)})).filter(o=>o.score>0).sort((o,l)=>l.score-o.score||o.relativePath.localeCompare(l.relativePath));if(i.length===0){let o=u(t,r);return!o||t.isIgnored(o.relativePath)?[]:[{relativePath:o.relativePath,score:700}]}let n=i.filter(o=>o.score>=1100);if(n.length>0)return e.allowMultiple?n:[n[0]];let a=i.filter(o=>o.score>=800);return a.length>0?e.allowMultiple?a:[a[0]]:e.allowMultiple?i:[i[0]]}function v(t,r){let e=h(t),s=p(e),i=p(r),n=0;return e===r&&(n+=1200),e.endsWith(`/${r}`)&&(n+=1100),s===i&&(n+=900),e.startsWith(`${r}/`)&&(n+=850),e.includes(r)&&(n+=250),n}function h(t){return t.trim().replace(/\\/g,"/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}export{S as a,j as b};
|
|
2
|
-
//# sourceMappingURL=chunk-33XTHFKR.js.map
|
package/dist/chunk-43KC6EQZ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{H as c}from"./chunk-WUW7YUAH.js";import{O as p,Q as u,l as a}from"./chunk-JORHF5AL.js";var l=a("suppression-inventory",{clearGroups:["whole-project"]});function b(e){return l.get(e,()=>f(e))}function f(e){let r={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,twin:0,uncategorized:0},t=new Map,s=0;for(let o of c(e)){let n=p(e,o);if(!(!n||!n.includes("scip-query")))for(let g of n.split(/\r?\n/)){let i=u(g);if(i===null)continue;s+=1,t.set(o,(t.get(o)??0)+1);let y=d(i);r[y]+=1}}return{total:s,byCategory:r,byFile:t}}function d(e){if(!e)return"uncategorized";let r=e.toLowerCase();return r==="dead-code"?"dead":r}export{b as a};
|
|
2
|
-
//# sourceMappingURL=chunk-43KC6EQZ.js.map
|
package/dist/chunk-47BU5Z4T.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as T,c as E,g as L,h as D}from"./chunk-4YTUWQ6M.js";import{j as O,o as A}from"./chunk-WANA4KAQ.js";import{d as H}from"./chunk-KMVGRIO2.js";import{c as _}from"./chunk-2SNGN6U4.js";import{d as C,e as F}from"./chunk-RA3AYNWP.js";import{a as w}from"./chunk-MZZBAITE.js";var J=5;function ae(e,t={}){let{base:a="HEAD",minContainment:o=.7,minCallees:r=3,minSiteCoverage:n=.4,maxHelpers:c=Number.POSITIVE_INFINITY,limit:m=20,scanLimit:g}=t,f=t.semantic!==!1,s=t.diffPlan??E(e,{base:a}),l={available:s.note!==T,base:a,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!l.available||s.changedFiles.length===0)return l;let x=new _(e),k=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from])),j=t.baseContentAt??L(e.config.projectRoot,a,D(s)),h=Z(x,k,$,j);if(h.length===0)return l;let R=h.slice(0,c);h.length>c&&(l.note=`helper scoring capped at ${c} of ${h.length} new symbols`);let q=x.calleeMap(R,{semantic:f}),B=R.map(i=>({def:i,callees:A((q.get(i.symbolId)??[]).map(p=>p.symbol))})),V=O(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,r),scanLimit:g,semantic:f}),M);for(let{def:i,callees:p}of B){let d=C(i.symbol);if(p.size<r){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:`fewer than ${r} meaningful callees \u2014 too small to score`});continue}let P=G(),N=Y(p,P);if(N===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let b=Q(e,i.symbolId);if(b.length===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}l.helpersChecked+=1;let I=K({candidateIndex:P,changed:k,helperCallees:p,helperFile:i.relativePath,helperSymbol:i.symbol,minContainment:o,minSiteCoverage:n,migratedFiles:b});I.length!==0&&(I.sort((u,S)=>z(S.migrationScope)-z(u.migrationScope)||S.containment-u.containment||S.siteCoverage-u.siteCoverage||u.file.localeCompare(S.file)),l.findings.push({helperSymbol:i.symbol,helperShortName:d,helperFile:i.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:N,migratedFiles:b.sort(),leftovers:I.slice(0,J)}))}return l.findings.sort((i,p)=>(p.leftovers[0]?.containment??0)-(i.leftovers[0]?.containment??0)||i.helperFile.localeCompare(p.helperFile)),l.findings=l.findings.slice(0,m),l}function K(e){let t=[],a=U(e.helperSymbol,e.helperFile,e.migratedFiles),o=new Set;for(let r of e.helperCallees)for(let n of e.candidateIndex.candidateIndexesByCallee.get(r)??[])o.add(n);for(let r of o){let n=e.candidateIndex.corpus[r];if(n.symbol===e.helperSymbol||e.changed.has(n.file)||n.callees.has(e.helperSymbol))continue;let c=H(e.helperCallees,n.callees);if(c<e.minContainment)continue;let m=[...e.helperCallees].filter(s=>n.callees.has(s)),g=n.callees.size===0?0:m.length/n.callees.size;if(g<e.minSiteCoverage||!m.some(s=>(e.candidateIndex.docFreq.get(s)??0)<=e.candidateIndex.ubiquityThreshold))continue;let f=W(a,n.symbol,n.file);t.push({symbol:n.symbol,shortName:C(n.symbol),file:n.file,...f,containment:c,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,n.callees.size-m.length),sharedCallees:m.map(C).sort()})}return t}function z(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,t,a){let o=new Set([...y(t),...v(F(e))]);for(let r of a)for(let n of y(r))o.add(n);return o}function W(e,t,a){let o=new Set([...y(a),...v(F(t))]);if(e.size===0||o.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let r=[...o].filter(n=>e.has(n)).sort();return r.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${r.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function y(e){return v(e.replace(/\.[^.]+$/,""))}function v(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>1&&!X.has(t))}function Y(e,t){let a=0;for(let o of e)(t.docFreq.get(o)??0)<=t.ubiquityThreshold&&(a+=1);return a}function Z(e,t,a,o){return e.productionCallableDefinitions({files:[...t],requireFunctionLikeSymbol:!0}).filter(r=>{if(!t.has(r.relativePath))return!1;let n=a.get(r.relativePath)??r.relativePath,c=o(n);return c===null||!new RegExp(`\\b${w(r.leaf)}\\b`).test(c)})}function Q(e,t){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
${e.pathExclusionsFor("ref_d")}`,t).map(o=>o.relative_path)}export{ae as a};
|
|
8
|
-
//# sourceMappingURL=chunk-47BU5Z4T.js.map
|
package/dist/chunk-4YTUWQ6M.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{a as A}from"./chunk-QOKYJ33H.js";import{a as _,c as B}from"./chunk-2SNGN6U4.js";import{l as v}from"./chunk-E2LAW7SL.js";import{n as y}from"./chunk-LSOR3LQG.js";import{d as M,g as b,i as N}from"./chunk-RA3AYNWP.js";import{A as x}from"./chunk-WUW7YUAH.js";import{J as w}from"./chunk-JORHF5AL.js";import{execFileSync as g}from"child_process";import{existsSync as q}from"fs";import{basename as P}from"path";var H="Unable to compute git diff.";function Ae(e,n={}){let i=n.plan??J(e,n);return i.note?V(i.note,i.changedFileLines):i.changedFiles.length===0?K(i.changedFileLines):Y(i.changedFiles,[Z(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function J(e,n={}){let{base:i="HEAD"}=n;try{let t=y(e.config.projectRoot,i),r=Q(e.config.projectRoot,t),s=r.changedFileLines,a=se(e,s),o=oe(e,r.changedRanges);return{changedFileLines:s,changedFiles:a,changedRanges:o,renamedFiles:te(e.config.projectRoot,t,a,r),note:s.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:H}}}function Z(e,n,i,t=[]){let r=new B(e),s=new Set(i),a=A(t),o=[],c=new Map,u=n.flatMap(f=>r.definitionsForFile(f)).filter(Le),d=u.filter(f=>le(f,a)),l=de(e,u,d,a),m=me([...d,...l.definitions]).sort((f,h)=>f.relativePath.localeCompare(h.relativePath)||f.startLine-h.startLine),p=m.map(f=>f.symbolId),F=ye(e,p),G=be(e,p,i),I=m.filter(f=>(F.get(f.symbolId)??0)===0),R=$(()=>v(e,I)),j=I.filter(f=>(R.get(f.symbolId)?.size??0)===0),U=$(()=>_(e,j));for(let f of m)he(e,f,s,o,c,R.get(f.symbolId)??new Set,U.get(f.symbolId)??new Set,F.get(f.symbolId)??0,G.get(f.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...c.entries()].map(([f,h])=>({file:f,symbols:[...h].sort()})),attributionNotes:l.notes}}function Y(e,n){let i=new Map,t=n.flatMap(a=>a.changedSymbols),r=n.flatMap(a=>a.attributionNotes??[]);for(let a of n)for(let o of a.consumerEntries){let c=i.get(o.file);c||(c=new Set,i.set(o.file,c));for(let u of o.symbols)c.add(u)}let s=Se(i);return{changedFiles:[...e],changedSymbols:t,affectedConsumers:s,attributionNotes:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:t.length,totalAffectedFiles:s.length}}}function V(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function K(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function Q(e,n){let i=g("git",["diff","--name-status","--find-renames",n,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864}),t=g("git",["diff","--name-status","--find-renames","--cached",n,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),s=g("git",["diff","--unified=0",n,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),a=g("git",["diff","--unified=0","--cached",n,"--"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),o=ie([i,t]);return{changedFileLines:[...new Set([...o.changedFiles,...O(r)])],changedRanges:z([...T(s),...T(a)]),renamedFiles:o.renamedFiles,deletedFiles:o.deletedFiles}}function D(e,n,i){try{let t=y(e,n);return X(e,t,i)}catch{return null}}function X(e,n,i){try{return g("git",["show",`${n}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function Pe(e,n,i=[]){let t=ee(e,n,i);return r=>(t.has(r)||t.set(r,D(e,n,r)),t.get(r)??null)}function Ee(e,n=e.changedFiles){let i=new Map(e.renamedFiles.map(t=>[t.to,t.from]));return[...new Set(n.map(t=>i.get(t)??t))]}function ee(e,n,i){let t=[...new Set(i)],r=new Map;if(t.length===0)return r;try{let s=y(e,n),a=t.map(c=>`${s}:./${c}
|
|
2
|
-
`).join(""),o=g("git",["cat-file","--batch"],{cwd:e,input:a,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"]});return ne(o,t)}catch{for(let s of t)r.set(s,D(e,n,s));return r}}function ne(e,n){let i=new Map,t=0;for(let r of n){let s=e.indexOf(10,t);if(s<0)throw new Error("git cat-file batch output ended before object header");let a=e.subarray(t,s).toString("utf-8");if(t=s+1,a.endsWith(" missing")){i.set(r,null);continue}let o=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(a);if(!o)throw new Error(`unexpected git cat-file batch header: ${a}`);let[,c,u]=o,d=Number(u);if(!Number.isFinite(d)||d<0)throw new Error(`unexpected git cat-file batch size: ${a}`);if(t+d>e.length)throw new Error("git cat-file batch output ended before blob payload");let l=e.subarray(t,t+d);i.set(r,c==="blob"?l.toString("utf-8"):null),t+=d,e[t]===10&&(t+=1)}return i}function te(e,n,i,t){if(i.length===0)return[];let r=new Map,s=new Set;for(let o of t.renamedFiles)i.includes(o.to)&&(r.set(o.to,o),s.add(o.from));let a=t.deletedFiles;if(a.length===0)return[...r.values()].sort((o,c)=>o.to.localeCompare(c.to));for(let o of i){if(r.has(o)||!q(`${e}/${o}`))continue;let c=a.filter(l=>!s.has(l)).filter(l=>P(l)===P(o));if(c.length===0)continue;let u=w(e,o),d=c.map(l=>({from:l,to:o,similarity:re(D(e,n,l)??"",u)})).sort((l,m)=>m.similarity-l.similarity)[0];d&&d.similarity>=.45&&(r.set(o,d),s.add(d.from))}return[...r.values()].sort((o,c)=>o.to.localeCompare(c.to))}function ie(e){let n=new Set,i=new Map,t=new Set;for(let r of e.flatMap(s=>O(s))){let[s,a,o]=r.split(" ");if(!(!s||!a)){if(s.startsWith("R")&&o){n.add(o),i.set(o,{from:a,to:o,similarity:Number(s.slice(1))/100});continue}n.add(a),s.startsWith("D")&&t.add(a)}}return{changedFiles:[...n],renamedFiles:[...i.values()],deletedFiles:[...t]}}function re(e,n){let i=new Set(E(e)),t=new Set(E(n));if(i.size===0&&t.size===0)return 1;if(i.size===0||t.size===0)return 0;let r=0;for(let s of i)t.has(s)&&(r+=1);return 2*r/(i.size+t.size)}function E(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function O(e){return e.split(`
|
|
3
|
-
`).map(n=>n.trim()).filter(n=>n.length>0)}function se(e,n){let i=k(e),t=[];for(let r of n){let s=i(r);s&&!e.isIgnored(s)&&t.push(s)}return t}function oe(e,n){let i=k(e),t=[];for(let r of n){let s=i(r.file);s&&!e.isIgnored(s)&&t.push({...r,file:s})}return z(t)}function k(e){let n=e.all(`SELECT relative_path FROM documents
|
|
4
|
-
ORDER BY id`).map(t=>t.relative_path),i=new Map(n.map(t=>[t,t]));return t=>{let r=t.replace(/\\/g,"/"),s=i.get(r);return s||(n.find(a=>a.endsWith(r))??null)}}function T(e){let n=[],i=null;for(let t of e.split(`
|
|
5
|
-
`)){if(t.startsWith("+++ ")){i=ae(t.slice(4).trim());continue}if(!i||!t.startsWith("@@ "))continue;let r=/@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/.exec(t);if(!r)continue;let s=Math.max(0,Number(r[1])-1),a=r[2]===void 0?1:Number(r[2]);n.push({file:i,startLine:s,endLine:Math.max(s,s+Math.max(a,1)-1)})}return n}function ae(e){return e==="/dev/null"?null:e.startsWith("a/")||e.startsWith("b/")?e.slice(2):e}function z(e){let n=new Set,i=[];for(let t of e){let r=`${t.file}:${t.startLine}:${t.endLine}`;n.has(r)||(n.add(r),i.push(t))}return i}function le(e,n){let i=n.get(e.relativePath);return!i||i.length===0?!0:i.some(t=>C(e.startLine,e.endLine,t.startLine,t.endLine))}function ce(e,n,i){let t=new Map,r=[],s=W(e),a=ge(i);for(let o of n){let c=s.get(o.file)??[];if(c.some(l=>C(l.startLine,l.endLine,o.startLine,o.endLine)))continue;let u=a.get(o.file)??[],d=pe(u,o);if(d){let l=c.find(m=>m.startLine>=d.startLine&&m.startLine<=d.endLine);if(l){t.set(l.symbolId,l),r.push(S(o,"ast-widened"));continue}}if(u.length===0){let l=[...c].filter(m=>m.startLine<=o.startLine).sort((m,p)=>p.startLine-m.startLine||m.endLine-p.endLine)[0];if(l){t.set(l.symbolId,l),r.push(S(o,"nearest-preceding"));continue}}r.push(S(o,"unattributed"))}return{definitions:[...t.values()],notes:r}}function de(e,n,i,t){let r=W(i),s=[],a=[],o=[...new Set(n.map(c=>c.relativePath))];for(let c of o){let u=t.get(c)??[];if(u.length===0)continue;let d=r.get(c)??[];for(let l of u)d.some(m=>C(m.startLine,m.endLine,l.startLine,l.endLine))||s.push(l);s.some(l=>l.file===c)&&a.push(...fe(e,c))}return ce(n,s,a)}function fe(e,n){let i=x(e,n);return i?i.rootNode.namedChildren.filter(ue).map(t=>({file:n,startLine:t.startPosition.row,endLine:t.endPosition.row})).filter(t=>t.endLine>=t.startLine):[]}function ue(e){return e.endPosition.row<e.startPosition.row?!1:!new Set(["import_statement","comment"]).has(e.type)}function me(e){let n=new Map;for(let i of e)n.set(i.symbolId,i);return[...n.values()]}function W(e){let n=new Map;for(let i of e){let t=n.get(i.relativePath)??[];t.push(i),n.set(i.relativePath,t)}return n}function ge(e){let n=new Map;for(let i of e){let t=n.get(i.file)??[];t.push(i),n.set(i.file,t)}return n}function pe(e,n){return e.filter(i=>i.startLine<=n.startLine&&i.endLine>=n.endLine).sort((i,t)=>i.endLine-i.startLine-(t.endLine-t.startLine))[0]}function S(e,n){return{file:e.file,startLine:e.startLine,endLine:e.endLine,method:n}}function C(e,n,i,t){return e<=t&&i<=n}function he(e,n,i,t,r,s,a,o,c){let u=Math.max(o,s.size,a.size);if(!De(n,u))return;let d=M(n.symbol);t.push({symbol:n.symbol,shortName:d,file:n.relativePath,startLine:n.startLine,endLine:n.endLine,fanIn:u});for(let l of c)L(e,i,r,l,d);for(let l of s)L(e,i,r,l,d);for(let l of a)L(e,i,r,l,d)}function $(e){try{return e()}catch(n){return console.error(`warning: diff-impact enrichment scan failed, continuing without it: ${n instanceof Error?n.message:n}`),new Map}}function ye(e,n){if(n.length===0)return new Map;let i=e.all(`SELECT m.symbol_id, COUNT(DISTINCT c.document_id) AS fan_in
|
|
6
|
-
FROM mentions m
|
|
7
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
8
|
-
WHERE m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
9
|
-
AND m.role != 1
|
|
10
|
-
GROUP BY m.symbol_id`,...n);return new Map(i.map(t=>[t.symbol_id,t.fan_in]))}function be(e,n,i){if(n.length===0||i.length===0)return new Map;let t=e.all(`SELECT DISTINCT m.symbol_id, ref_d.relative_path
|
|
11
|
-
FROM mentions m
|
|
12
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
13
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
14
|
-
WHERE m.symbol_id IN (${n.map(()=>"?").join(",")})
|
|
15
|
-
AND m.role != 1
|
|
16
|
-
AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
|
|
17
|
-
${e.pathExclusionsFor("ref_d")}`,...n,...i),r=new Map;for(let s of t){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function L(e,n,i,t,r){if(e.isIgnored(t)||n.has(t))return;let s=i.get(t);s||(s=new Set,i.set(t,s)),s.add(r)}function Se(e){return[...e.entries()].map(([n,i])=>({file:n,consumedSymbols:i.size})).sort((n,i)=>i.consumedSymbols-n.consumedSymbols)}function Le(e){return!(N(e.symbol)||e.parentTypeName!==null&&!b(e.symbol))}function De(e,n){return b(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{H as a,Ae as b,J as c,Z as d,Y as e,D as f,Pe as g,Ee as h,ee as i,ce as j};
|
|
18
|
-
//# sourceMappingURL=chunk-4YTUWQ6M.js.map
|
package/dist/chunk-64MNV6AB.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
function c(n,e={}){let s=e.scope?"AND relative_path LIKE ?":"",o=e.like?"AND relative_path LIKE ?":"",r=[...e.scope?[`%${e.scope}%`]:[],...e.like?[e.like]:[]],i=n.all(`SELECT relative_path
|
|
2
|
-
FROM documents
|
|
3
|
-
WHERE 1 = 1
|
|
4
|
-
${n.pathExclusionsFor("documents")}
|
|
5
|
-
${s}
|
|
6
|
-
${o}
|
|
7
|
-
ORDER BY relative_path`,...r).map(t=>t.relative_path),a=e.extensions?i.filter(t=>e.extensions.some(l=>t.toLowerCase().endsWith(l.toLowerCase()))):i;return e.includeIgnored===!1?a.filter(t=>!n.isIgnored(t)):a}export{c as a};
|
|
8
|
-
//# sourceMappingURL=chunk-64MNV6AB.js.map
|
package/dist/chunk-67QRR5YC.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{$e as C,Ge as R,He as B,Se as b,Ue as A,Ve as F,Wc as M,We as p,Ye as V,_ as N,cf as W,da as y,ea as v,ee as G,kb as J,qe as u,re as k,se as T,ue as d,vb as E}from"./chunk-HIB452NU.js";var ae=G,q=(e=>parseInt(e,10)),K=(e=>{let t=parseInt(e,10);if(!Number.isFinite(t)||t<1)throw new Error(`Expected a positive integer, got ${e}`);return t}),me=parseFloat,le=parseInt;function l(e,t,o,...n){return n.length>0?{flags:e,description:t,parser:o,defaultValue:n[0]}:{flags:e,description:t,parser:o}}function X(){return l("--json","Output as JSON for programmatic consumption")}function Y(){return l("--compact","Emit minified one-line JSON (use with --json)")}function Q(e=[]){let t=w(e);return t.some(o=>o.flags==="--compact")?t:[...t,Y()]}function w(e=[]){return e.some(t=>t.flags==="--json")?e:[...e,X()]}function x(e,t=[]){return{category:e,examples:t}}function S(e,t,o,n,r){return{answers:typeof e=="string"?[e]:e,returns:typeof t=="string"?[t]:t,inputs:o,coverage:n,...r?{scope:r}:{}}}function z(e){return e.generation.identity}function H(e){return W({version:1,...e})}function U(e,t){let o;try{o=JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}if(!Z(o))throw new Error("Invalid result cursor. Run the command again without --cursor.");if(o.command!==t.command||o.target!==t.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(o.indexGeneration!==t.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.");return o}function Z(e){if(!e||typeof e!="object")return!1;let t=e;return t.version===1&&typeof t.command=="string"&&typeof t.target=="string"&&Number.isSafeInteger(t.offset)&&(t.offset??-1)>=0&&typeof t.indexGeneration=="string"&&t.indexGeneration.length>0}function P(e,t){let o=y(e,t),n=te(o);for(let r of n)console.log(r)}function $(e,t,o="No results found for resolved symbol."){return y(e,t).match?o:ee(t,v(e,t,5))}function O(e,t,o,n){return{..._(e,t),[n]:o}}function _(e,t){let o=y(e,t);return o.match?{matched:!0,resolved:{symbol:o.match.symbol,shortName:N(o.match.symbol),relativePath:o.match.relativePath},otherMatches:o.candidates.map(n=>({shortName:n.shortName,relativePath:n.relativePath,startLine:n.startLine})),totalMatches:o.total}:{matched:!1,suggestions:v(e,t,5)}}function ee(e,t){let o=`No definition matched '${e}'.`;return t.length>0?`${o} Suggestions: ${t.join(", ")}`:o}function te(e){if(!e.match||e.total<=1)return[];let t=e.match,o=Math.max(0,e.total-1),n=[`Resolved: ${N(t.symbol)} (${t.relativePath}) -- ${o} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=e.candidates.slice(0,3);return r.length>0&&n.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${u(s.startLine)})`).join("; ")}`),n.push(""),n}var oe=R(({db:e,args:t,opts:o})=>{let n=b(t,0),r=p(o,"signatures"),s=E(e,n);if(p(o,"json")){C("outline",t,o,s);return}if(s.length===0)return d.empty(`No symbols found for "${n}".`);function i(D,f){for(let a of D){let c=" ".repeat(f),m=r&&a.signature?` - ${ne(a.signature)}`:"";console.log(`${c}${k(a.startLine,a.endLine)} ${a.shortName}${m}`),i(a.children,f+1)}}i(s,0)});function ne(e){return e.length>120?`${e.slice(0,117)}...`:e}var re=B("refs",({db:e,args:t,opts:o,budget:n})=>{let r=b(t,0),s=J(e,r,{semantic:n.semantic}).sort((h,j)=>h.relativePath.localeCompare(j.relativePath)||h.line-j.line),i=A(o,"cursor"),f=F(o,"limit")??(i?50:s.length),a=z(e),c=i?U(i,{command:"refs",target:r,indexGeneration:a}).offset:0;if(c>s.length)throw new Error("This cursor points past the current result set. Run again without --cursor.");let m=s.slice(c,c+f),L=c+m.length,g=L<s.length?{cursor:H({command:"refs",target:r,offset:L,indexGeneration:a}),indexGeneration:a}:void 0,I={complete:c===0&&m.length===s.length,totalKnown:!0,returned:m.length,total:s.length,omitted:s.length-m.length,...g?{continuation:g}:{}};if(p(o,"json")){C("refs",t,o,O(e,r,m,"references"),{analysisBudget:n.analysisBudget,coverage:I});return}if(m.length===0)return d.empty($(e,r,"No references found."));P(e,r),d.groupedByFile(m,h=>` line ${u(h.line)}`),g&&console.log(`
|
|
3
|
-
${I.omitted} omitted; continue with --cursor ${g.cursor}`)}),se=R(({db:e,args:t,opts:o})=>{let n=b(t,0),r=M(e,n,{context:V(o,"context",0)});if(p(o,"json")){C("code",t,o,O(e,n,r,"code"));return}if(!r)return d.empty($(e,n,"Symbol found, but source was unreadable."));P(e,n),console.log(`${T(r.relativePath,r.startLine,r.endLine)} ${r.shortName} [${r.language??"unknown"}]
|
|
4
|
-
`);let s=r.source.split(`
|
|
5
|
-
`);for(let i=0;i<s.length;i++)console.log(` ${String(u(r.startLine+i)).padStart(4)} ${s[i]}`)}),Se=[{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:Q([l("--full","Run unbounded semantic analysis on large indexes"),l("-n, --limit <n>","Maximum reference sites to return",K),l("--cursor <cursor>","Continue a prior bounded result (implies --limit 50 when omitted)")]),budget:"semantic",agent:{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",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:x("Navigation",["scip-query refs login"]),handler:re},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:S("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete"),options:w([l("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:x("Navigation"),handler:oe},{id:"code",command:"code <symbol>",description:"Read the source code for a symbol (bounded to its definition range)",agent:S("What is the compiler-resolved definition source for this symbol?","definition identity, source, and line range",["symbol"],"complete"),options:w([l("-C, --context <n>","Extra lines of context above/below",q,0)]),renderShape:"custom",docs:x("Navigation"),handler:se}];export{ae as a,q as b,K as c,me as d,le as e,l as f,X as g,Y as h,Q as i,w as j,x as k,S as l,P as m,$ as n,O as o,_ as p,Se as q};
|
|
6
|
-
//# sourceMappingURL=chunk-67QRR5YC.js.map
|
package/dist/chunk-6GXYN7YA.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{b as w}from"./chunk-3EDFLQ6A.js";import{b as g}from"./chunk-SMQWE25B.js";import{c as h,d as f}from"./chunk-MTDBHTSF.js";import{d as c,e as u,h as m,p as b,q as p}from"./chunk-RA3AYNWP.js";import{dirname as $,relative as T,resolve as k}from"path";var A=new Set(f());function O(t,n){return`tests/generated/twin-ab/${y(t)}-vs-${y(n)}.test.ts`}function y(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function I(t,n,a,e){let o=d(t,n);if(!o.ok)return o;let i=d(t,a);if(!i.ok)return i;let r=o.symbol.paramCount===null||i.symbol.paramCount===null?null:o.symbol.paramCount===i.symbol.paramCount,s=v(o.symbol,i.symbol,t.config.projectRoot,e,r);return{ok:!0,a:o.symbol,b:i.symbol,signatureCompatible:r,testSource:s}}function d(t,n){let e=g(t,n).match;if(!e)return{ok:!1,reason:`${n} does not resolve to an indexed symbol.`};let i=t.get("SELECT kind FROM global_symbols WHERE id = ?",e.symbolId)?.kind??null;if(!(i!==null?A.has(i):m(e.symbol)))return{ok:!1,reason:`${n} resolves to ${c(e.symbol)}${i!==null?` with SCIP kind ${h(i)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!w(t,e))return{ok:!1,reason:`${n} (${c(e.symbol)} at ${e.relativePath}:${e.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let s=t.get("SELECT documentation FROM global_symbols WHERE id = ?",e.symbolId),l=b(p(s?.documentation??null));return{ok:!0,symbol:{ref:n,symbol:e.symbol,shortName:u(e.symbol)||c(e.symbol),file:e.relativePath,startLine:e.startLine,signature:l,paramCount:l?x(l):null}}}function x(t){let n=t.indexOf("(");if(n===-1)return null;let a=0,e=-1;for(let s=n;s<t.length;s+=1){let l=t[s];if(l==="(")a+=1;else if(l===")"&&(a-=1,a===0)){e=s;break}}if(e===-1)return null;let o=t.slice(n+1,e).trim();if(!o)return 0;let i=1,r=0;for(let s of o)s==="("||s==="["||s==="{"?r+=1:s===")"||s==="]"||s==="}"?r=Math.max(0,r-1):s===","&&r===0&&(i+=1);return i}function S(t,n,a){let e=$(n),o=k(t,a),r=T(e,o).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function v(t,n,a,e,o){let i=S(a,e,t.file),r=S(a,e,n.file),s=o===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":o?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
|
-
* Generated by 'scip-query twin-ab'. scip-audit integrity scenario.
|
|
3
|
-
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
|
-
* more than one place, feed both the same input and require the same
|
|
5
|
-
* answer. Disagreement between twins means at least one is wrong \u2014
|
|
6
|
-
* determine which before consolidating.
|
|
7
|
-
*
|
|
8
|
-
* Twin A: ${t.shortName} (${t.file}:${t.startLine+1})
|
|
9
|
-
* ${t.signature??"(signature unavailable)"}
|
|
10
|
-
* Twin B: ${n.shortName} (${n.file}:${n.startLine+1})
|
|
11
|
-
* ${n.signature??"(signature unavailable)"}
|
|
12
|
-
* ${s}
|
|
13
|
-
*
|
|
14
|
-
* Fill in the TODO input table below with inputs both twins should agree
|
|
15
|
-
* on, then run this file with vitest.
|
|
16
|
-
*/
|
|
17
|
-
import { describe, expect, it } from 'vitest';
|
|
18
|
-
import { ${t.shortName} as twinA } from '${i}';
|
|
19
|
-
import { ${n.shortName} as twinB } from '${r}';
|
|
20
|
-
|
|
21
|
-
// TODO: fill in shared inputs both twins should agree on \u2014 one arg array per call.
|
|
22
|
-
const inputs: any[][] = [
|
|
23
|
-
// [/* arg1, arg2, ... */],
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
// Cast to a variadic signature so the input table can hold any arg shape \u2014
|
|
27
|
-
// the real twins have fixed, non-rest parameter lists, and TS rejects
|
|
28
|
-
// spreading a generic args array into those (TS2556) even when the array
|
|
29
|
-
// itself is 'any'; casting the callee's signature, not the args, satisfies
|
|
30
|
-
// the checker without weakening the twins' real exported types elsewhere.
|
|
31
|
-
const callA = twinA as (...callArgs: any[]) => any;
|
|
32
|
-
const callB = twinB as (...callArgs: any[]) => any;
|
|
33
|
-
|
|
34
|
-
describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${n.shortName}', () => {
|
|
35
|
-
it.each(inputs)('agrees on input %#', (...args) => {
|
|
36
|
-
expect(callA(...args)).toEqual(callB(...args));
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
`}export{O as a,I as b};
|
|
40
|
-
//# sourceMappingURL=chunk-6GXYN7YA.js.map
|
package/dist/chunk-A2TNXAXO.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{j as H,l as w,m as b}from"./chunk-C5Q44Q5D.js";import{a as d}from"./chunk-APMMR5Y2.js";import m from"process";import{existsSync as De}from"fs";import{dirname as O,join as ke,resolve as B,sep as Ee}from"path";import{fileURLToPath as Ie}from"url";import{spawn as ae}from"child_process";var l=class extends Error{},p=class extends Error{},S=class extends Error{constructor(r,n,i){super(`rust-analyzer LSP request ${n} failed: ${i}`);this.code=r}code},ue=3e4,le=16*1024,ce=64*1024*1024,N=64*1024,_=256*1024*1024,g=Buffer.from(`\r
|
|
2
|
-
\r
|
|
3
|
-
`,"ascii"),L=class{constructor(e,r={}){this.transport=e;this.requestTimeoutMs=r.requestTimeoutMs??ue,this.configuration=r.configuration??{};let n=fe(r.maxHeaderBytes,r.maxMessageBytes);this.maxHeaderBytes=n.maxHeaderBytes,this.maxMessageBytes=n.maxMessageBytes,this.monotonicNow=r.monotonicNow??d,this.headerBuffer=Buffer.allocUnsafe(this.maxHeaderBytes+g.length),this.transport.onData(i=>this.handleData(i)),this.transport.onClose((i,s)=>this.failTransport(new Error(we(i,s)),!1)),this.transport.onError(i=>this.failTransport(i,!0))}transport;nextId=1;pending=new Map;diagnosedUris=new Set;diagnosticWaiters=new Map;readinessWaiters=new Set;requestTimeoutMs;configuration;maxHeaderBytes;maxMessageBytes;monotonicNow;headerBuffer;headerLength=0;bodyBuffer=null;bodyLength=0;transportFailure=null;transportKilled=!1;currentServerStatusGeneration=0;latestServerStatus=null;shutdownStarted=!1;async initialize(e,r={}){let n=e.capabilities??{},i=n.experimental&&typeof n.experimental=="object"&&!Array.isArray(n.experimental)?n.experimental:{},s=await this.request("initialize",{...e,capabilities:{...n,experimental:{...i,serverStatusNotification:!0}}},r);return this.notify("initialized",{}),s}async references(e,r={}){let n=await this.request("textDocument/references",e,r);return Array.isArray(n)?n:[]}async definition(e,r={}){let n=await this.request("textDocument/definition",e,r);return ye(n)}async prepareCallHierarchy(e,r={}){let n=await this.request("textDocument/prepareCallHierarchy",e,r);return Array.isArray(n)?n:[]}async outgoingCalls(e,r={}){let n=await this.request("callHierarchy/outgoingCalls",{item:e},r);return Array.isArray(n)?n:[]}async hover(e,r={}){let n=await this.request("textDocument/hover",e,r);return n&&typeof n=="object"?n:null}async readinessBarrier(e={}){try{await this.request("scip-query/readinessBarrier",null,e)}catch(r){if(r instanceof S&&r.code===-32601)return;throw r}}serverStatusGeneration(){return this.currentServerStatusGeneration}serverStatusSnapshot(){let e=this.latestServerStatus;return e?{generation:e.generation,status:{...e.status}}:null}waitForQuiescence(e,r){if(this.transportFailure)return Promise.reject(this.transportFailure);let n=this.latestServerStatus;if(n&&n.generation>e){if(n.status.health==="error")return Promise.reject(U());if(n.status.quiescent)return Promise.resolve(n.status)}return new Promise((i,s)=>{let o={afterGeneration:e,resolve:i,reject:s,timeout:setTimeout(()=>{this.readinessWaiters.delete(o),s(new Error(`rust-analyzer readiness timed out after ${r}ms`))},r)};this.readinessWaiters.add(o)})}didOpenTextDocument(e){this.notify("textDocument/didOpen",{textDocument:e})}waitForDiagnostics(e,r){return this.transportFailure?Promise.resolve(!1):this.diagnosedUris.has(e)?Promise.resolve(!0):new Promise(n=>{let i=u=>{clearTimeout(s),n(u)},s=setTimeout(()=>{let u=this.diagnosticWaiters.get(e)?.filter(c=>c!==i);u&&u.length>0?this.diagnosticWaiters.set(e,u):this.diagnosticWaiters.delete(e),n(!1)},r),o=this.diagnosticWaiters.get(e)??[];o.push(i),this.diagnosticWaiters.set(e,o)})}async shutdown(e={}){if(!this.shutdownStarted){this.shutdownStarted=!0;try{await this.request("shutdown",null,e),this.notify("exit",null)}catch(r){throw this.notify("exit",null),this.killTransportOnce(),r}}}request(e,r,n={}){if(this.transportFailure)return Promise.reject(this.transportFailure);let i=v(n.timeoutMs??this.requestTimeoutMs,n.deadlineMs,this.monotonicNow),s=this.nextId++,o={jsonrpc:"2.0",id:s,method:e,params:r};return new Promise((u,c)=>{let f=setTimeout(()=>{this.pending.delete(s),c(i.deadlineLimited?new l(`rust-analyzer readiness deadline expired during LSP request ${e}`):new Error(`rust-analyzer LSP request ${e} timed out after ${i.timeoutMs}ms`))},i.timeoutMs);this.pending.set(s,{method:e,deadlineMs:n.deadlineMs,resolve:R=>u(R),reject:c,timeout:f}),this.transport.write(C(o))})}notify(e,r){this.transportFailure||this.transport.write(C({jsonrpc:"2.0",method:e,params:r}))}handleData(e){if(this.transportFailure||e.length===0)return;let r=0;for(;r<e.length&&!this.transportFailure;){if(this.bodyBuffer){let o=Math.min(e.length-r,this.bodyBuffer.length-this.bodyLength);if(e.copy(this.bodyBuffer,this.bodyLength,r,r+o),r+=o,this.bodyLength+=o,this.bodyLength===this.bodyBuffer.length){let u=this.bodyBuffer.toString("utf8");this.bodyBuffer=null,this.bodyLength=0;let c;try{c=Re(u)}catch{this.failProtocol("rust-analyzer LSP response body was not a valid JSON object");continue}try{this.dispatchMessage(c)}catch{this.failTransport(new Error("rust-analyzer LSP message handling failed"),!0)}}continue}if(this.headerLength===this.headerBuffer.length){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}if(this.headerBuffer[this.headerLength++]=e[r++],!this.headerDelimiterComplete())continue;let n=this.headerLength-g.length;if(n>this.maxHeaderBytes){this.failProtocol(`rust-analyzer LSP header exceeded ${this.maxHeaderBytes} byte limit`);return}let i=this.headerBuffer.subarray(0,n).toString("ascii");this.headerLength=0;let s;try{s=de(i,this.maxMessageBytes)}catch(o){this.failProtocol(o instanceof Error?o.message:String(o));return}this.bodyBuffer=Buffer.allocUnsafe(s),this.bodyLength=0,s===0&&(this.bodyBuffer=null,this.failProtocol("rust-analyzer LSP response body was not a valid JSON object"))}}headerDelimiterComplete(){if(this.headerLength<g.length)return!1;let e=this.headerLength-g.length;return this.headerBuffer.subarray(e,this.headerLength).equals(g)}failProtocol(e){this.failTransport(new p(e),!0)}failTransport(e,r){this.transportFailure||(this.transportFailure=e,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0,r&&this.killTransportOnce(),this.rejectPending(e),this.resolveDiagnosticWaiters(!1))}killTransportOnce(){this.transportKilled||(this.transportKilled=!0,this.transport.kill())}dispatchMessage(e){if(this.recordDiagnosticNotification(e),this.recordServerStatusNotification(e),e.id!==void 0&&e.id!==null&&e.method){this.respondToServerRequest(e);return}if(e.id===void 0||e.id===null)return;let r=this.pending.get(e.id);if(r){if(clearTimeout(r.timeout),this.pending.delete(e.id),e.error){r.reject(new S(e.error.code,r.method,e.error.message));return}if(r.deadlineMs!==void 0&&this.monotonicNow()>=r.deadlineMs){r.reject(new l(`rust-analyzer readiness deadline expired during LSP request ${r.method}`));return}r.resolve(e.result)}}recordDiagnosticNotification(e){if(e.method!=="textDocument/publishDiagnostics")return;let r=e.params,n=r&&typeof r=="object"&&typeof r.uri=="string"?r.uri:null;if(!n)return;this.diagnosedUris.add(n);let i=this.diagnosticWaiters.get(n)??[];this.diagnosticWaiters.delete(n),i.forEach(s=>s(!0))}recordServerStatusNotification(e){if(e.method!=="experimental/serverStatus"||e.id!==void 0||!me(e.params))return;let r=e.params,n={health:r.health,quiescent:r.quiescent,...typeof r.message=="string"?{message:r.message}:{}},i=++this.currentServerStatusGeneration;if(this.latestServerStatus={generation:i,status:n},n.health==="error"){this.rejectReadinessWaiters(U());return}if(n.quiescent)for(let s of this.readinessWaiters)i<=s.afterGeneration||(clearTimeout(s.timeout),this.readinessWaiters.delete(s),s.resolve(n))}respondToServerRequest(e){if(e.id===void 0||e.id===null||!e.method)return;let r=e.method==="workspace/configuration"?this.workspaceConfiguration(e.params):null;this.transport.write(C({jsonrpc:"2.0",id:e.id,result:r}))}workspaceConfiguration(e){return(e&&typeof e=="object"&&Array.isArray(e.items)?e.items:[]).map(n=>typeof n.section=="string"?pe(this.configuration,n.section):this.configuration)}rejectPending(e){for(let[r,n]of this.pending)clearTimeout(n.timeout),n.reject(e),this.pending.delete(r);this.rejectReadinessWaiters(e)}resolveDiagnosticWaiters(e){for(let r of this.diagnosticWaiters.values())r.forEach(n=>n(e));this.diagnosticWaiters.clear()}rejectReadinessWaiters(e){for(let r of this.readinessWaiters)clearTimeout(r.timeout),r.reject(e),this.readinessWaiters.delete(r)}};function fe(t=le,e=ce){if(!Number.isSafeInteger(t)||t<=0)throw new TypeError("maxHeaderBytes must be a positive safe integer.");if(!Number.isSafeInteger(e)||e<=0)throw new TypeError("maxMessageBytes must be a positive safe integer.");if(t>N)throw new RangeError(`maxHeaderBytes cannot exceed ${N} bytes for rust-analyzer LSP.`);if(t+g.length+e>_)throw new RangeError(`Combined rust-analyzer LSP header and message limits cannot exceed ${_} bytes.`);return{maxHeaderBytes:t,maxMessageBytes:e}}function de(t,e){let r=[];for(let s of t.split(`\r
|
|
4
|
-
`)){let o=s.indexOf(":");o<0||s.slice(0,o).trim().toLowerCase()!=="content-length"||r.push(s.slice(o+1).trim())}if(r.length===0)throw new p("rust-analyzer LSP response missing Content-Length header");if(r.length>1){let s=new Set(r).size>1?"rust-analyzer LSP response has conflicting Content-Length headers":"rust-analyzer LSP response has duplicate Content-Length headers";throw new p(s)}let n=r[0];if(!/^\d+$/.test(n))throw new p("rust-analyzer LSP Content-Length must be a non-negative safe integer");let i=Number(n);if(!Number.isSafeInteger(i))throw new p("rust-analyzer LSP Content-Length must be a non-negative safe integer");if(i>e)throw new p(`rust-analyzer LSP Content-Length exceeds ${e} byte message limit`);return i}function v(t,e,r=d){if(e===void 0)return{timeoutMs:t,deadlineLimited:!1};let n=e-r();if(n<=0)throw new l("rust-analyzer readiness deadline expired before LSP operation");return{timeoutMs:Math.min(t,n),deadlineLimited:n<=t}}function me(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return(e.health==="ok"||e.health==="warning"||e.health==="error")&&typeof e.quiescent=="boolean"&&(e.message===void 0||e.message===null||typeof e.message=="string")}function U(){return new l("rust-analyzer reported error health before reaching readiness")}function pe(t,e){let r=e.startsWith("rust-analyzer.")?e.slice(14):e;if(r===""||r==="rust-analyzer")return t;let n=t;for(let i of r.split(".")){if(!n||typeof n!="object")return null;n=n[i]}return n??null}function ye(t){return t?(Array.isArray(t)?t:[t]).flatMap(r=>he(r)?[r]:ge(r)?[{uri:r.targetUri,range:r.targetSelectionRange}]:[]):[]}function he(t){return!!(t&&typeof t=="object"&&typeof t.uri=="string")}function ge(t){return!!(t&&typeof t=="object"&&typeof t.targetUri=="string")}function $(t,e,r=process.env){let n=ae(t,[],{cwd:e,env:r,stdio:["pipe","pipe","pipe"]});return{write(i){n.stdin.write(i)},onData(i){n.stdout.on("data",i)},onClose(i){n.on("close",i)},onError(i){n.on("error",i)},kill(){n.kill()}}}function C(t){let e=JSON.stringify(t);return`Content-Length: ${Buffer.byteLength(e,"utf8")}\r
|
|
5
|
-
\r
|
|
6
|
-
${e}`}function Re(t){let e=JSON.parse(t);if(!e||typeof e!="object")throw new Error("rust-analyzer LSP response was not a JSON object");return e}function we(t,e){return`rust-analyzer LSP transport closed${e?` by ${e}`:t===null?"":` with code ${t}`}`}async function G(t,e,r,n=d){let i=r-n();if(i<=0)throw new l("rust-analyzer readiness deadline expired before quiescence");try{let s=await t.waitForQuiescence(e,i);if(x(r,n,"during quiescence"),s.health==="error")throw new l("rust-analyzer reported error health before reaching readiness");if(!s.quiescent)throw new l("rust-analyzer did not report quiescence before reaching readiness");return s}catch(s){throw s instanceof l?s:new l(s instanceof Error?s.message:String(s))}}async function ut(t,e,r,n,i,s=d,o=D){let u=await G(t,e,n,s);if(r===0)return u;let c=t.serverStatusSnapshot();if(!c)throw new l("rust-analyzer status is unavailable after initial document open");return await be(t,c,r,n,i,s,o)??u}async function be(t,e,r,n,i,s=d,o=D){if(r===0)return null;if(!e)throw new l("rust-analyzer status is unavailable before document open");J(e.status,"before document open");try{await t.readinessBarrier({deadlineMs:n}),x(n,s,"during post-open synchronization")}catch(f){throw f instanceof l?f:new l(f instanceof Error?f.message:String(f))}let u=t.serverStatusSnapshot();if(!u||u.generation<e.generation)throw new l("rust-analyzer status is unavailable after document open");let c;return u.generation===e.generation?(J(u.status,"after document open"),c=u.status):c=await G(t,e.generation,n,s),await M(i,n,s,o),c}async function lt(t,e,r,n=d){let i=v(e,r,n);await t(i.timeoutMs),x(r,n,"during diagnostics")}async function M(t,e,r=d,n=D){if(t<=0)return;if(v(t,e,r).deadlineLimited)throw new l("rust-analyzer readiness deadline cannot accommodate delay");await n(t),x(e,r,"during delay")}async function ct(t,e){try{return await t()}catch(r){throw r instanceof l&&await e(),r}}function ft(t){return t instanceof l?{ok:!1,error:t.message}:null}function x(t,e,r){if(t-e()<=0)throw new l(`rust-analyzer readiness deadline expired ${r}`)}function J(t,e){if(t.health==="error")throw new l(`rust-analyzer reported error health ${e}`);if(!t.quiescent)throw new l(`rust-analyzer did not report quiescence ${e}`)}function D(t){return new Promise(e=>setTimeout(e,t))}import{realpathSync as P}from"fs";import{basename as Se,dirname as Le,join as ve,relative as xe,sep as Pe}from"path";import{fileURLToPath as ze,pathToFileURL as Y}from"url";function z(t,e){return e==="."||e==="./"?Y(P(t)).href:Y(H(t,e).absolutePath).href}function E(t,e){let r=ze(e);return xe(P(t),Ae(r)).split(Pe).join("/")}function Ae(t){try{return P(t)}catch{try{return ve(P(Le(t)),Se(t))}catch{return t}}}function A(t,e,r){return{textDocument:{uri:z(t,e.relativePath)},position:Te(t,e),context:{includeDeclaration:r}}}function Te(t,e){let r={line:e.startLine,character:e.startChar??0};try{return Ce(w(t,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(n){if(!b(n))throw n;return r}}function Ce(t,e,r={line:e.startLine,character:e.startChar??0}){let n=t.split(/\r?\n/),i=n[e.startLine];if(i===void 0||e.leaf.length===0)return r;let s=Math.max(0,Math.min(r.character,i.length)),o=i.indexOf(e.leaf,s);if(o>=0)return{line:e.startLine,character:k(o,e.leaf)};let u=i.indexOf(e.leaf);if(u>=0)return{line:e.startLine,character:k(u,e.leaf)};let c=Me(n,e.startLine,e.leaf);return c||r}function k(t,e){return t+Math.max(0,e.length-2)}function Me(t,e,r){for(let n of[-1,1,-2,2]){let i=e+n;if(i<0||i>=t.length)continue;let s=t[i].indexOf(r);if(s>=0)return{line:i,character:k(s,r)}}return null}function K(t,e){return e.map(r=>({file:E(t,r.uri),line:r.range.start.line,column:r.range.start.character}))}function Q(t){let e=new Map;for(let r of t)e.set(`${r.file}\0${r.line}\0${r.column}`,r);return[...e.values()].sort((r,n)=>{let i=r.file.localeCompare(n.file);return i!==0?i:r.line!==n.line?r.line-n.line:r.column-n.column})}async function Oe(t){let e=t.includeReferences!==!1,r=t.includeCallees===!0,n=t.includeSignatures===!0,i={timeoutMs:t.requestTimeoutMs},s=Be(t),o=Z(t),u=X(t),c=V(t),f=$e(t.projectRoot,s),R=Ue(t.projectRoot,f),j=_e(f),y=new L($(t.rustAnalyzerBinary,R),{requestTimeoutMs:t.requestTimeoutMs,configuration:j});try{let T=await y.initialize({processId:m.pid,rootUri:z(R,"."),capabilities:{textDocument:{references:{dynamicRegistration:!1},callHierarchy:{dynamicRegistration:!1},hover:{dynamicRegistration:!1}}},initializationOptions:j});if(e&&!T.capabilities.referencesProvider)return{available:!1,reason:"rust-analyzer initialized without textDocument/references support.",references:o.map(a=>[a.symbolId,[]]),...r?{callees:u.map(a=>[a.symbolId,[]])}:{}};if(r&&!T.capabilities.callHierarchyProvider)return{available:!1,reason:"rust-analyzer initialized without call hierarchy support.",references:o.map(a=>[a.symbolId,[]]),callees:u.map(a=>[a.symbolId,[]]),...n?{signatures:c.map(a=>[a.symbolId,null])}:{}};if(n&&!T.capabilities.hoverProvider)return{available:!1,reason:"rust-analyzer initialized without hover support.",references:o.map(a=>[a.symbolId,[]]),...r?{callees:u.map(a=>[a.symbolId,[]])}:{},signatures:c.map(a=>[a.symbolId,null])};let ie=Je(y,t.projectRoot,s);await Ge(y,ie,t.diagnosticsTimeoutMs??1e4),await ne(t.settleDelayMs??5e3);let q=e?await I(o,t.concurrency??8,async a=>{let F=await ee(y,A(t.projectRoot,a,!1),{requestTimeoutMs:t.requestTimeoutMs,retryTimeoutMs:t.referenceRetryTimeoutMs});return{symbolId:a.symbolId,references:Q(K(t.projectRoot,F.locations)),complete:F.complete}}):o.map(a=>({symbolId:a.symbolId,references:[],complete:!0})),se=r?await I(u,t.concurrency??8,async a=>({symbolId:a.symbolId,callees:await Ke(y,t.projectRoot,a,i)})):[],oe=n?await I(c,t.concurrency??8,async a=>({symbolId:a.symbolId,signature:await We(y,t.projectRoot,a,i)})):[];return{available:!0,references:q.filter(a=>a.complete).map(a=>[a.symbolId,a.references]),incompleteReferenceSymbolIds:q.filter(a=>!a.complete).map(a=>a.symbolId),...r?{callees:se.map(a=>[a.symbolId,a.callees])}:{},...n?{signatures:oe.map(a=>[a.symbolId,a.signature])}:{}}}finally{await y.shutdown().catch(()=>{})}}function Z(t){return t.referenceDefinitions??t.definitions}function X(t){return t.calleeDefinitions??t.definitions}function V(t){return t.signatureDefinitions??t.definitions}function Be(t){return[...t.includeReferences!==!1?Z(t):[],...t.includeCallees===!0?X(t):[],...t.includeSignatures===!0?V(t):[]]}async function We(t,e,r,n={}){let i=A(e,r,!1),s=await je(t,{textDocument:i.textDocument,position:i.position},n);return qe(s)}async function je(t,e,r={}){try{return await t.hover(e,r)}catch(n){if(h(n),!(n instanceof Error?n.message:String(n)).includes("content modified"))return null;await re(r.deadlineMs);try{return await t.hover(e,r)}catch(s){return h(s),null}}}function qe(t){if(!t)return null;let e=Fe(t.contents),r=/```(?:rust)?\s*([\s\S]*?)```/i.exec(e),n=r?r[1]:e;for(let i of n.split(/\r?\n/)){let s=i.replace(/^`+|`+$/g,"").trim();if(s&&Ne(s))return s}return null}function Fe(t){return typeof t=="string"?t:Array.isArray(t)?t.map(He).join(`
|
|
7
|
-
`):"value"in t?t.value:""}function He(t){return typeof t=="string"?t:t.value}function Ne(t){return/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?(?:unsafe\s+)?(?:extern\s+(?:"[^"]+"\s+)?)?(?:fn|struct|enum|trait|type|const|static|mod)\b/.test(t)}function _e(t){return{...t.length>0?{linkedProjects:t}:{},references:{excludeImports:!1,excludeTests:!1}}}function Ue(t,e){return e.length===1?O(e[0]):B(t)}function $e(t,e){let r=B(t),n=[],i=new Set;for(let s of e){let o=O(B(r,s.relativePath));for(;et(r,o);){let u=ke(o,"Cargo.toml");if(De(u)){i.has(u)||(i.add(u),n.push(u));break}let c=O(o);if(c===o)break;o=c}}return n}function Je(t,e,r){let n=new Set,i=[];for(let s of r)if(!n.has(s.relativePath)){n.add(s.relativePath);try{let o=z(e,s.relativePath);t.didOpenTextDocument({uri:o,languageId:"rust",version:1,text:w(e,s.relativePath,{inputKind:"indexed Rust source file"})}),i.push(o)}catch(o){if(!b(o))throw o}}return i}async function Ge(t,e,r){await Promise.all(e.map(n=>t.waitForDiagnostics(n,r).catch(()=>!1)))}async function zt(t,e){return(await ee(t,e)).locations}async function ee(t,e,r={}){try{return{locations:await t.references(e,{timeoutMs:r.requestTimeoutMs,deadlineMs:r.deadlineMs}),complete:!0}}catch(n){h(n);let i=n instanceof Error?n.message:String(n);if(W(n))return Ye(t,e,r);if(!i.includes("content modified"))return{locations:[],complete:!0};await re(r.deadlineMs);try{return{locations:await t.references(e,te(r)),complete:!0}}catch(s){return h(s),{locations:[],complete:!W(s)}}}}async function Ye(t,e,r){if(!r.retryTimeoutMs||r.retryTimeoutMs<=0)return{locations:[],complete:!1};let n=te(r);try{return{locations:await t.references(e,n),complete:!0}}catch(i){return h(i),{locations:[],complete:!W(i)}}}function te(t){return{...t.retryTimeoutMs&&t.retryTimeoutMs>0?{timeoutMs:t.retryTimeoutMs}:{},...t.deadlineMs!==void 0?{deadlineMs:t.deadlineMs}:{}}}function W(t){let e=t instanceof Error?t.message:String(t);return e.includes("rust-analyzer LSP request")&&e.includes("timed out after")}async function Ke(t,e,r,n={}){let i=A(e,r,!1),s=await Qe(t,{textDocument:i.textDocument,position:i.position},n),o=(await Promise.all(s.map(u=>Ze(t,u,n)))).flat();return Ve(Xe(e,o))}async function Qe(t,e,r={}){try{return await t.prepareCallHierarchy(e,r)}catch(n){return h(n),[]}}async function Ze(t,e,r={}){try{return await t.outgoingCalls(e,r)}catch(n){return h(n),[]}}async function re(t){if(t===void 0){await ne(1e3);return}await M(1e3,t)}function h(t){if(t instanceof l)throw t}function Xe(t,e){return e.map(r=>({symbol:r.to.name,file:E(t,r.to.uri),line:r.to.selectionRange.start.line}))}function Ve(t){let e=new Set,r=[];for(let n of t){let i=`${n.symbol}\0${n.file}\0${n.line}`;e.has(i)||(e.add(i),r.push(n))}return r.sort((n,i)=>n.file.localeCompare(i.file)||n.line-i.line||n.symbol.localeCompare(i.symbol))}function ne(t){return t<=0?Promise.resolve():new Promise(e=>setTimeout(e,t))}function et(t,e){return e===t||e.startsWith(`${t}${Ee}`)}async function I(t,e,r){let n=new Array(t.length),i=0,s=Math.max(1,Math.min(t.length,Math.floor(e)));return await Promise.all(Array.from({length:s},async()=>{for(;i<t.length;){let o=i++;n[o]=await r(t[o])}})),n}async function tt(){return new Promise((t,e)=>{let r=[];m.stdin.on("data",n=>r.push(n)),m.stdin.on("error",e),m.stdin.on("end",()=>t(Buffer.concat(r).toString("utf8")))})}async function rt(){try{let t=JSON.parse(await tt()),e=await Oe(t);m.stdout.write(JSON.stringify(e))}catch(t){let e={available:!1,reason:t instanceof Error?t.message:String(t),references:[]};m.stdout.write(JSON.stringify(e)),m.exitCode=1}}m.argv[1]&&Ie(import.meta.url)===m.argv[1]&&rt();export{L as a,$ as b,ut as c,be as d,lt as e,ct as f,ft as g,z as h,E as i,A as j,K as k,Q as l,Oe as m,Z as n,X as o,V as p,Be as q,We as r,je as s,qe as t,_e as u,Ue as v,$e as w,Je as x,Ge as y,zt as z,ee as A,Ke as B,ne as C,I as D};
|
|
8
|
-
//# sourceMappingURL=chunk-A2TNXAXO.js.map
|
package/dist/chunk-APMMR5Y2.js
DELETED
package/dist/chunk-AZFUMCQB.js
DELETED
package/dist/chunk-BNXICU42.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-33XTHFKR.js";function m(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
5
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
JOIN (
|
|
7
|
-
SELECT m2.symbol_id, c2.document_id
|
|
8
|
-
FROM mentions m2
|
|
9
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
-
WHERE m2.role = 1
|
|
11
|
-
GROUP BY m2.symbol_id
|
|
12
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
13
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
14
|
-
WHERE d1.relative_path = ?
|
|
15
|
-
AND d2.relative_path <> d1.relative_path
|
|
16
|
-
AND ${e.localSymbolPredicate}
|
|
17
|
-
ORDER BY d2.relative_path`,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}function o(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d1.relative_path
|
|
18
|
-
FROM mentions m
|
|
19
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
20
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
21
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
22
|
-
JOIN (
|
|
23
|
-
SELECT m2.symbol_id, c2.document_id
|
|
24
|
-
FROM mentions m2
|
|
25
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
26
|
-
WHERE m2.role = 1
|
|
27
|
-
GROUP BY m2.symbol_id
|
|
28
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
29
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
30
|
-
WHERE d2.relative_path = ?
|
|
31
|
-
AND d1.relative_path != ?
|
|
32
|
-
ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{m as a,o as b};
|
|
33
|
-
//# sourceMappingURL=chunk-BNXICU42.js.map
|
package/dist/chunk-C5Q44Q5D.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as y}from"./chunk-46XGSFNI.js";import{execFileSync as _}from"child_process";import{createHash as k}from"crypto";import{closeSync as A,fstatSync as C,lstatSync as I,openSync as N,readdirSync as W,readFileSync as B,readlinkSync as U,realpathSync as g}from"fs";import{isAbsolute as $,join as v,relative as D,resolve as K,sep as G}from"path";function R(e,t){let n=e.split("/").at(-1)??e;if(F.has(n)||n===".scipquery.json"||/^tsconfig(?:\..+)?\.json$/.test(n))return"config";if(/\.d\.(?:ts|mts|cts)$/.test(e.toLowerCase()))return"ambient";let r=e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:"";return t.some(o=>(x[o]??[]).includes(r))?"source":"other"}function b(e,t,n){let r=e.split("/").at(-1)??e;if(n?.includes(e)||n?.includes(r)||F.has(r))return!0;let o=e.includes(".")?`.${e.split(".").at(-1).toLowerCase()}`:"";return(x[t]??[]).includes(o)}function ne(e){if(typeof e!="object"||e===null)return null;let t=e;return typeof t.version!="number"||!j(t.languages)||typeof t.pnpmWorkspaces!="boolean"||typeof t.typescriptProjectMode!="string"||!j(t.typescriptProjects)||t.clojureConfigPath!==void 0&&typeof t.clojureConfigPath!="string"||!Array.isArray(t.files)||!t.files.every(M)?null:t}function re(e,t){let n=new Map((e?.files??[]).map(s=>[s.path,s])),r=new Map(t.files.map(s=>[s.path,s])),o=new Set([...n.keys(),...r.keys()]),a=[];for(let s of[...o].sort()){let c=n.get(s),p=r.get(s),u=R(s,t.languages);!c&&p?a.push({kind:"added",path:s,inputKind:u,after:p}):c&&!p?a.push({kind:"deleted",path:s,inputKind:u,before:c}):c&&p&&(c.hash!==p.hash||c.size!==p.size)&&a.push({kind:"modified",path:s,inputKind:u,before:c,after:p})}let i=new Set;return e||i.add("prior-snapshot-unavailable"),e&&e.version!==t.version&&i.add("snapshot-version-changed"),(m(e?.files??[])||m(t.files))&&i.add("duplicate-input-path"),[...e?.files??[],...t.files].some(L)&&i.add("unreadable-input"),{version:1,changes:a,projectIdentityChanged:e?!E(e,t):!0,uncertainty:[...i].sort()}}function j(e){return Array.isArray(e)&&e.every(t=>typeof t=="string")}function m(e){return new Set(e.map(t=>t.path)).size!==e.length}function M(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.path=="string"&&typeof t.size=="number"&&Number.isFinite(t.size)&&typeof t.hash=="string"}function L(e){return e.hash==="unreadable"||e.size<0}function E(e,t){return P(e.languages,t.languages)&&e.pnpmWorkspaces===t.pnpmWorkspaces&&e.typescriptProjectMode===t.typescriptProjectMode&&P(e.typescriptProjects,t.typescriptProjects)&&e.clojureConfigPath===t.clojureConfigPath}function P(e,t){if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((o,a)=>o===r[a])}var F=new Set(["package.json","package-lock.json","pnpm-lock.yaml","yarn.lock","bun.lockb","tsconfig.json","tsconfig.base.json","pyproject.toml","setup.py","setup.cfg","Cargo.toml","Cargo.lock","go.mod","go.sum","pom.xml","build.gradle","build.gradle.kts","build.sbt","compile_commands.json","CMakeLists.txt","Makefile","Gemfile","Gemfile.lock","composer.json","composer.lock","pubspec.yaml","pubspec.lock","deps.edn","project.clj","bb.edn","shadow-cljs.edn"]),x={typescript:[".ts",".tsx",".mts",".cts"],javascript:[".js",".jsx",".mjs",".cjs"],java:[".java"],scala:[".scala"],kotlin:[".kt",".kts"],rust:[".rs"],python:[".py",".pyi"],ruby:[".rb"],go:[".go"],cpp:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"],c:[".c",".h"],csharp:[".cs"],vb:[".vb"],dart:[".dart"],php:[".php"],clojure:[".clj",".cljs",".cljc"]};import{isAbsolute as S,relative as O}from"path";var l=class extends Error{constructor(n,r){super(`refusing unsafe project file path ${JSON.stringify(n)} (${r})`);this.relativePath=n;this.reason=r;this.name="UnsafeProjectPathError"}relativePath;reason;code="SCIP_QUERY_UNSAFE_PROJECT_PATH"};function T(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function se(e){return e.replace(/\\/g,"/")}function f(e,t){let n=O(e,t);return n===""||!n.startsWith("..")&&!S(n)}function w(e){if(!e)throw new l(e,"empty-path");if(e.includes("\0"))throw new l(e,"nul-byte");if(S(e)||/^[A-Za-z]:/.test(e)||e.startsWith("//")||e.startsWith("\\\\"))throw new l(e,"absolute-path");let t=T(e);if(t.split("/").some(r=>r===".."))throw new l(e,"parent-traversal");if(!t||t===".")throw new l(e,"empty-path");return t}var h=64*1024*1024,d=class extends Error{constructor(n,r,o,a){super(`${n} ${JSON.stringify(r)} is ${o} bytes; the safety limit is ${a} bytes`);this.inputKind=n;this.inputPath=r;this.observedBytes=o;this.limitBytes=a;this.name="InputTooLargeError"}inputKind;inputPath;observedBytes;limitBytes;code="SCIP_QUERY_INPUT_TOO_LARGE"};function J(e){return[...new Set((e??[]).map(t=>t.trim()).filter(Boolean))].sort((t,n)=>t.localeCompare(n))}function q(e,t,n={}){let r=w(t),o=g(e),a=K(o,...r.split("/"));if(!f(o,a)||a===o)throw new l(t,"outside-project");let i=g(a);if(!f(o,i)||i===o)throw new l(t,"outside-project");let s=I(i);if(!s.isFile())throw new l(t,"not-a-file");let c={projectRoot:o,relativePath:r,absolutePath:i,size:s.size,mtimeMs:s.mtimeMs,device:s.dev,inode:s.ino},p=n.maxBytes??h;if(H(p),c.size>p)throw new d(n.inputKind??"project file",c.relativePath,c.size,p);return c}function Y(e,t,n={}){let r=q(e,t,n),o=n.maxBytes??h,a=N(r.absolutePath,"r");try{let i=C(a);if(!i.isFile()||i.dev!==r.device||i.ino!==r.inode||i.size!==r.size)throw new l(t,"changed-during-read");if(i.size>o)throw new d(n.inputKind??"project file",r.relativePath,i.size,o);let s=B(a),c=C(a);if(c.dev!==i.dev||c.ino!==i.ino||c.size!==i.size||s.byteLength!==i.size)throw new l(t,"changed-during-read");return s}finally{A(a)}}function he(e,t,n={}){return Y(e,t,n).toString("utf8")}function ye(e){return typeof e=="object"&&e!==null&&"code"in e&&(e.code==="ENOENT"||e.code==="ENOTDIR")}function H(e){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`maxBytes must be a non-negative safe integer; received ${e}`)}function Q(e){return(V(e)??ee(e)).filter(t=>t&&!z(t)).sort()}function X(e,t={}){let n=Q(e).filter(o=>!t.language||b(o,t.language,t.markerFiles)).filter(o=>!t.includePath||t.includePath(o)),r=g(e);return n.map(o=>{let a=v(e,o);try{if(I(a).isSymbolicLink()){let c=g(a),p=D(r,c);if(p===".."||p.startsWith(`..${G}`)||$(p))throw new Error("external symlink");let u=U(a);return{path:o,size:Buffer.byteLength(u),hash:k("sha256").update("symlink\0").update(u).digest("hex")}}let i=k("sha256"),s=y(a,{inputKind:"project fingerprint input",maxBytes:h},c=>i.update(c));return{path:o,size:s,hash:i.digest("hex")}}catch{return{path:o,size:-1,hash:"unreadable"}}})}function je(e,t,n){return{version:2,languages:[...t].sort(),pnpmWorkspaces:n.typescriptProjectMode!=="workspace"&&n.pnpmWorkspaces===!0,typescriptProjectMode:n.typescriptProjectMode??"single",typescriptProjects:J(n.typescriptProjects),clojureConfigPath:Z(n.clojureConfigPath),files:X(e)}}function Z(e){return e?.trim()||void 0}function V(e){try{return _("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"],timeout:3e4,killSignal:"SIGKILL"}).split(`
|
|
2
|
-
`).filter(Boolean)}catch{return null}}function ee(e){let t=[],n=[""];for(;n.length>0;){let r=n.pop(),o=r?v(e,r):e,a;try{a=W(o,{withFileTypes:!0})}catch{continue}for(let i of a){let s=r?`${r}/${i.name}`:i.name;if(i.isDirectory()){z(s)||n.push(s);continue}t.push(s)}}return t}function z(e){let t=e.split("/");return e==="meta.json"||t.some(n=>te.has(n))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var te=new Set([".git","node_modules",".scipquery-cache",".scipquery-generations",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);export{R as a,ne as b,re as c,M as d,l as e,se as f,f as g,w as h,J as i,q as j,Y as k,he as l,ye as m,X as n,je as o};
|
|
3
|
-
//# sourceMappingURL=chunk-C5Q44Q5D.js.map
|
package/dist/chunk-DQGSM7RZ.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{o as O,p as A}from"./chunk-MZZBAITE.js";import{A as y,E as C,F as N,k as F,o as S,q as _}from"./chunk-JORHF5AL.js";import{a as P}from"./chunk-64MNV6AB.js";var G=C({kind:"file-dependency-graph",invalidation:N("file-dependency-graph"),serialize:e=>JSON.stringify(e),deserialize:k}),I=F("file-dep-graph",{clearGroups:["whole-project"]});function W(e,n,t={}){let s=t.scipEdges??"all-references",i=t.sourceEdges??"imports-only",o=v(n,s,i);return I.get(e,o,()=>{let d=new Set(P(e,{includeIgnored:!1})),c=_(e),p=0,l=0,m=null,E=!1,a=0,h=0;return y("file-dep-graph.product",()=>{if(c){let r=G.read(e,o,c);if(r){E=!0;let f=R(r);return p=r.sourceFileCount,l=r.sourceEdgeCount,a=r.scipEdgeCount,h=f.size,m=r.sourceDependencyFingerprint,f}}let g=y("file-dep-graph.source-imports",()=>{let r=M(e,d,n,i);return p=r.files.length,l=r.edges.length,m=r.fingerprint,r},()=>({scope:n??null,sourceEdges:i,files:p,edges:l})),u=new Map,D=(r,f)=>j(e,u,d,r,f);y("file-dep-graph.scip-edges",()=>{for(let r of $(e,n,s))a+=1,D(r.from_file,r.to_file)},()=>({scope:n??null,edges:a}));for(let r of g.edges)D(r.fromFile,r.toFile);return h=u.size,c&&G.write(e,o,c,{sourceDependencyFingerprint:g.fingerprint,sourceFileCount:g.files.length,sourceEdgeCount:g.edges.length,scipEdgeCount:a,graph:w(u)}),u},()=>({scope:n??null,available:c!==null,hit:E,files:p,sourceEdges:l,sourceEdgeMode:i,scipEdges:a,graphFiles:h,sourceDependencyFingerprint:m}))})}function M(e,n,t,s){let i=[],o=[];for(let d of n)if(!(t&&!d.includes(t))){i.push(d);for(let c of A(e,d))c.sourcePath&&o.push({fromFile:d,toFile:c.sourcePath});if(s==="imports-and-reexports")for(let c of O(e,d))c.sourcePath&&o.push({fromFile:d,toFile:c.sourcePath})}return{files:i,edges:o,fingerprint:b(i,o)}}function b(e,n){let t=n.map(s=>`${s.fromFile}\0${s.toFile}`).sort();return S(JSON.stringify({files:e,edges:t}))}function v(e,n,t){return`edge-mode-v3:${n}:${t}:${e??"<all>"}`}function w(e){return[...e].map(([n,t])=>[n,[...t]])}function R(e){return new Map(e.graph.map(([n,t])=>[n,new Set(t)]))}function k(e){let n=JSON.parse(e);return x(n)?n:null}function x(e){if(!e||typeof e!="object")return!1;let n=e;return typeof n.sourceDependencyFingerprint=="string"&&typeof n.sourceFileCount=="number"&&typeof n.sourceEdgeCount=="number"&&typeof n.scipEdgeCount=="number"&&Array.isArray(n.graph)&&n.graph.every(J)}function J(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(n=>typeof n=="string")}function $(e,n,t){let s=n?"AND d1.relative_path LIKE ?":"",i=n?[`%${n}%`]:[],o=t==="imports-only"?"AND m.role = 2":"AND m.role != 1";return e.all(`SELECT DISTINCT
|
|
2
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
${o}
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${s}`,...i)}function j(e,n,t,s,i){if(s===i||e.isIgnored(s)||e.isIgnored(i)||!t.has(i))return;let o=n.get(s);o||(o=new Set,n.set(s,o)),o.add(i)}export{W as a};
|
|
20
|
-
//# sourceMappingURL=chunk-DQGSM7RZ.js.map
|