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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as w}from"./chunk-ILMHV3KM.js";import{a as $,b as M}from"./chunk-SMNXQT5Z.js";import{a as N,b as _}from"./chunk-IZYYAFN5.js";import{j as H,l as b,m as S}from"./chunk-WUPW3UN3.js";import{a as d}from"./chunk-MNE7YG56.js";import m from"process";import{existsSync as Oe}from"fs";import{dirname as B,join as Be,resolve as j,sep as je}from"path";import{fileURLToPath as qe}from"url";import{spawn as fe}from"child_process";import{platform as U}from"os";var c=class extends Error{},p=class extends Error{},L=class extends Error{constructor(r,n,i){super(`rust-analyzer LSP request ${n} failed: ${i}`);this.code=r}code},de=3e4,me=16*1024,pe=64*1024*1024,J=64*1024,K=256*1024*1024,g=Buffer.from(`\r
|
|
2
|
+
\r
|
|
3
|
+
`,"ascii"),P=class{constructor(e,r={}){this.transport=e;this.requestTimeoutMs=r.requestTimeoutMs??de,this.configuration=r.configuration??{};let n=he(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(Le(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;transportKillPromise=null;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 we(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 L&&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(G());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(l=>l!==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}}}async shutdownAndReap(e={}){let r;try{await this.shutdown(e)}catch(n){r=n}try{await this.killTransportOnce()}catch(n){throw new Error(`rust-analyzer process-tree cleanup failed: ${n instanceof Error?n.message:String(n)}`,{cause:n})}if(r)throw r}request(e,r,n={}){if(this.transportFailure)return Promise.reject(this.transportFailure);let i=z(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,l)=>{let f=setTimeout(()=>{let y=i.deadlineLimited?new c(`rust-analyzer readiness deadline expired during LSP request ${e}`):new Error(`rust-analyzer LSP request ${e} timed out after ${i.timeoutMs}ms`);this.cancelAndFailTimedOutRequest(s,y)},i.timeoutMs);this.pending.set(s,{method:e,deadlineMs:n.deadlineMs,resolve:y=>u(y),reject:l,timeout:f}),this.transport.write(v(o))})}notify(e,r){this.transportFailure||this.transport.write(v({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 l;try{l=ve(u)}catch{this.failProtocol("rust-analyzer LSP response body was not a valid JSON object");continue}try{this.dispatchMessage(l)}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=ye(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().catch(()=>{}),this.rejectPending(e),this.resolveDiagnosticWaiters(!1))}killTransportOnce(){return this.transportKilled?this.transportKillPromise??Promise.resolve():(this.transportKilled=!0,this.transportKillPromise=Promise.resolve(this.transport.kill()),this.transportKillPromise)}async cancelAndFailTimedOutRequest(e,r){let n=this.pending.get(e);if(!n)return;this.pending.delete(e);try{this.transport.write(v({jsonrpc:"2.0",method:"$/cancelRequest",params:{id:e}}))}catch{}this.transportFailure||(this.transportFailure=r,this.headerLength=0,this.bodyBuffer=null,this.bodyLength=0);let i=r;try{await this.killTransportOnce()}catch(s){i=new Error(`${r.message}; rust-analyzer cleanup failed: ${s instanceof Error?s.message:String(s)}`,{cause:s})}n.reject(i),this.rejectPending(i),this.resolveDiagnosticWaiters(!1)}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 L(e.error.code,r.method,e.error.message));return}if(r.deadlineMs!==void 0&&this.monotonicNow()>=r.deadlineMs){r.reject(new c(`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||!ge(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(G());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(v({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"?Re(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 he(t=me,e=pe){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>J)throw new RangeError(`maxHeaderBytes cannot exceed ${J} bytes for rust-analyzer LSP.`);if(t+g.length+e>K)throw new RangeError(`Combined rust-analyzer LSP header and message limits cannot exceed ${K} bytes.`);return{maxHeaderBytes:t,maxMessageBytes:e}}function ye(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 z(t,e,r=d){if(e===void 0)return{timeoutMs:t,deadlineLimited:!1};let n=e-r();if(n<=0)throw new c("rust-analyzer readiness deadline expired before LSP operation");return{timeoutMs:Math.min(t,n),deadlineLimited:n<=t}}function ge(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 G(){return new c("rust-analyzer reported error health before reaching readiness")}function Re(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 we(t){return t?(Array.isArray(t)?t:[t]).flatMap(r=>be(r)?[r]:Se(r)?[{uri:r.targetUri,range:r.targetSelectionRange}]:[]):[]}function be(t){return!!(t&&typeof t=="object"&&typeof t.uri=="string")}function Se(t){return!!(t&&typeof t=="object"&&typeof t.targetUri=="string")}function Y(t,e,r=process.env,n){let i=fe(t,[],{cwd:e,env:r,detached:U()!=="win32",stdio:["pipe","pipe","pipe"]}),s=i.pid===void 0?null:N(i.pid,U()!=="win32"),o=s?$(n,s):null,u=null;return i.on("close",()=>M(o)),{write(l){i.stdin.write(l)},onData(l){i.stdout.on("data",l)},onClose(l){i.on("close",l)},onError(l){i.on("error",l)},kill(){if(!s){i.kill();return}return u??=_(s,{gracefulMs:1e3,forceMs:1e3}).then(l=>{if(!l.reaped)throw new Error(l.detail??`rust-analyzer process tree ${s.rootPid} was not reaped.`);M(o)}),u}}}function v(t){let e=JSON.stringify(t);return`Content-Length: ${Buffer.byteLength(e,"utf8")}\r
|
|
5
|
+
\r
|
|
6
|
+
${e}`}function ve(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 Le(t,e){return`rust-analyzer LSP transport closed${e?` by ${e}`:t===null?"":` with code ${t}`}`}async function Z(t,e,r,n=d){let i=r-n();if(i<=0)throw new c("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 c("rust-analyzer reported error health before reaching readiness");if(!s.quiescent)throw new c("rust-analyzer did not report quiescence before reaching readiness");return s}catch(s){throw s instanceof c?s:new c(s instanceof Error?s.message:String(s))}}async function ht(t,e,r,n,i,s=d,o=k){let u=await Z(t,e,n,s);if(r===0)return u;let l=t.serverStatusSnapshot();if(!l)throw new c("rust-analyzer status is unavailable after initial document open");return await Pe(t,l,r,n,i,s,o)??u}async function Pe(t,e,r,n,i,s=d,o=k){if(r===0)return null;if(!e)throw new c("rust-analyzer status is unavailable before document open");Q(e.status,"before document open");try{await t.readinessBarrier({deadlineMs:n}),x(n,s,"during post-open synchronization")}catch(f){throw f instanceof c?f:new c(f instanceof Error?f.message:String(f))}let u=t.serverStatusSnapshot();if(!u||u.generation<e.generation)throw new c("rust-analyzer status is unavailable after document open");let l;return u.generation===e.generation?(Q(u.status,"after document open"),l=u.status):l=await Z(t,e.generation,n,s),await E(i,n,s,o),l}async function yt(t,e,r,n=d){let i=z(e,r,n);await t(i.timeoutMs),x(r,n,"during diagnostics")}async function E(t,e,r=d,n=k){if(t<=0)return;if(z(t,e,r).deadlineLimited)throw new c("rust-analyzer readiness deadline cannot accommodate delay");await n(t),x(e,r,"during delay")}async function gt(t,e){try{return await t()}catch(r){throw r instanceof c&&await e(),r}}function Rt(t){return t instanceof c?{ok:!1,error:t.message}:null}function x(t,e,r){if(t-e()<=0)throw new c(`rust-analyzer readiness deadline expired ${r}`)}function Q(t,e){if(t.health==="error")throw new c(`rust-analyzer reported error health ${e}`);if(!t.quiescent)throw new c(`rust-analyzer did not report quiescence ${e}`)}function k(t){return new Promise(e=>setTimeout(e,t))}import{realpathSync as A}from"fs";import{basename as ze,dirname as xe,join as Ae,relative as Te,sep as Ce}from"path";import{fileURLToPath as De,pathToFileURL as X}from"url";function T(t,e){return e==="."||e==="./"?X(A(t)).href:X(H(t,e).absolutePath).href}function O(t,e){let r=De(e);return Te(A(t),Me(r)).split(Ce).join("/")}function Me(t){try{return A(t)}catch{try{return Ae(A(xe(t)),ze(t))}catch{return t}}}function C(t,e,r){return{textDocument:{uri:T(t,e.relativePath)},position:Ee(t,e),context:{includeDeclaration:r}}}function Ee(t,e){let r={line:e.startLine,character:e.startChar??0};try{return ke(b(t,e.relativePath,{inputKind:"indexed Rust source file"}),e,r)}catch(n){if(!S(n))throw n;return r}}function ke(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:I(o,e.leaf)};let u=i.indexOf(e.leaf);if(u>=0)return{line:e.startLine,character:I(u,e.leaf)};let l=Ie(n,e.startLine,e.leaf);return l||r}function I(t,e){return t+Math.max(0,e.length-2)}function Ie(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:I(s,r)}}return null}function V(t,e){return e.map(r=>({file:O(t,r.uri),line:r.range.start.line,column:r.range.start.character}))}function ee(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 We(t){let e=t.includeReferences!==!1,r=t.includeCallees===!0,n=t.includeSignatures===!0,i={timeoutMs:t.requestTimeoutMs},s=Fe(t),o=re(t),u=ne(t),l=ie(t),f=Ye(t.projectRoot,s),y=Ge(t.projectRoot,f),q=Ke(f),h=new P(Y(t.rustAnalyzerBinary,y),{requestTimeoutMs:t.requestTimeoutMs,configuration:q});try{let D=await h.initialize({processId:m.pid,rootUri:T(y,"."),capabilities:{textDocument:{references:{dynamicRegistration:!1},callHierarchy:{dynamicRegistration:!1},hover:{dynamicRegistration:!1}}},initializationOptions:q});if(e&&!D.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&&!D.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:l.map(a=>[a.symbolId,null])}:{}};if(n&&!D.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:l.map(a=>[a.symbolId,null])};let ue=Qe(h,t.projectRoot,s);await Ze(h,ue,t.diagnosticsTimeoutMs??1e4),await ae(t.settleDelayMs??5e3);let W=e?await w(o,t.concurrency??8,async a=>{let F=await se(h,C(t.projectRoot,a,!1),{requestTimeoutMs:t.requestTimeoutMs,retryTimeoutMs:t.referenceRetryTimeoutMs});return{symbolId:a.symbolId,references:ee(V(t.projectRoot,F.locations)),complete:F.complete}}):o.map(a=>({symbolId:a.symbolId,references:[],complete:!0})),le=r?await w(u,t.concurrency??8,async a=>({symbolId:a.symbolId,callees:await Ve(h,t.projectRoot,a,i)})):[],ce=n?await w(l,t.concurrency??8,async a=>({symbolId:a.symbolId,signature:await He(h,t.projectRoot,a,i)})):[];return{available:!0,references:W.filter(a=>a.complete).map(a=>[a.symbolId,a.references]),incompleteReferenceSymbolIds:W.filter(a=>!a.complete).map(a=>a.symbolId),...r?{callees:le.map(a=>[a.symbolId,a.callees])}:{},...n?{signatures:ce.map(a=>[a.symbolId,a.signature])}:{}}}finally{await h.shutdown().catch(()=>{})}}function re(t){return t.referenceDefinitions??t.definitions}function ne(t){return t.calleeDefinitions??t.definitions}function ie(t){return t.signatureDefinitions??t.definitions}function Fe(t){return[...t.includeReferences!==!1?re(t):[],...t.includeCallees===!0?ne(t):[],...t.includeSignatures===!0?ie(t):[]]}async function He(t,e,r,n={}){let i=C(e,r,!1),s=await Ne(t,{textDocument:i.textDocument,position:i.position},n);return _e(s)}async function Ne(t,e,r={}){try{return await t.hover(e,r)}catch(n){if(R(n),!(n instanceof Error?n.message:String(n)).includes("content modified"))return null;await oe(r.deadlineMs);try{return await t.hover(e,r)}catch(s){return R(s),null}}}function _e(t){if(!t)return null;let e=$e(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&&Je(s))return s}return null}function $e(t){return typeof t=="string"?t:Array.isArray(t)?t.map(Ue).join(`
|
|
7
|
+
`):"value"in t?t.value:""}function Ue(t){return typeof t=="string"?t:t.value}function Je(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 Ke(t){return{...t.length>0?{linkedProjects:t}:{},references:{excludeImports:!1,excludeTests:!1}}}function Ge(t,e){return e.length===1?B(e[0]):j(t)}function Ye(t,e){let r=j(t),n=[],i=new Set;for(let s of e){let o=B(j(r,s.relativePath));for(;it(r,o);){let u=Be(o,"Cargo.toml");if(Oe(u)){i.has(u)||(i.add(u),n.push(u));break}let l=B(o);if(l===o)break;o=l}}return n}function Qe(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=T(e,s.relativePath);t.didOpenTextDocument({uri:o,languageId:"rust",version:1,text:b(e,s.relativePath,{inputKind:"indexed Rust source file"})}),i.push(o)}catch(o){if(!S(o))throw o}}return i}async function Ze(t,e,r){await Promise.all(e.map(n=>t.waitForDiagnostics(n,r).catch(()=>!1)))}async function It(t,e){return(await se(t,e)).locations}async function se(t,e,r={}){try{return{locations:await t.references(e,{timeoutMs:r.requestTimeoutMs,deadlineMs:r.deadlineMs}),complete:!0}}catch(n){R(n);let i=n instanceof Error?n.message:String(n);if(te(n))return{locations:[],complete:!1};if(!i.includes("content modified"))return{locations:[],complete:!0};await oe(r.deadlineMs);try{return{locations:await t.references(e,Xe(r)),complete:!0}}catch(s){return R(s),{locations:[],complete:!te(s)}}}}function Xe(t){return{...t.retryTimeoutMs&&t.retryTimeoutMs>0?{timeoutMs:t.retryTimeoutMs}:{},...t.deadlineMs!==void 0?{deadlineMs:t.deadlineMs}:{}}}function te(t){let e=t instanceof Error?t.message:String(t);return e.includes("rust-analyzer LSP request")&&e.includes("timed out after")}async function Ve(t,e,r,n={}){let i=C(e,r,!1),s=await et(t,{textDocument:i.textDocument,position:i.position},n),o=(await Promise.all(s.map(u=>tt(t,u,n)))).flat();return nt(rt(e,o))}async function et(t,e,r={}){try{return await t.prepareCallHierarchy(e,r)}catch(n){return R(n),[]}}async function tt(t,e,r={}){try{return await t.outgoingCalls(e,r)}catch(n){return R(n),[]}}async function oe(t){if(t===void 0){await ae(1e3);return}await E(1e3,t)}function R(t){if(t instanceof c)throw t}function rt(t,e){return e.map(r=>({symbol:r.to.name,file:O(t,r.to.uri),line:r.to.selectionRange.start.line}))}function nt(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 ae(t){return t<=0?Promise.resolve():new Promise(e=>setTimeout(e,t))}function it(t,e){return e===t||e.startsWith(`${t}${je}`)}async function st(){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 ot(){try{let t=JSON.parse(await st()),e=await We(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]&&qe(import.meta.url)===m.argv[1]&&ot();export{P as a,Y as b,ht as c,Pe as d,yt as e,gt as f,Rt as g,T as h,O as i,C as j,V as k,ee as l,We as m,re as n,ne as o,ie as p,Fe as q,He as r,Ne as s,_e as t,Ke as u,Ge as v,Ye as w,Qe as x,Ze as y,It as z,se as A,Ve as B,ae as C};
|
|
8
|
+
//# sourceMappingURL=chunk-DQLPXMH6.js.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import{a as _,g as C,j as T,o as $,p as A}from"./chunk-UJPRPGCO.js";import{A as O}from"./chunk-GH74ASD6.js";import{A as M,J as k,K as N,k as S,l as h,r as D,y as E}from"./chunk-WCCFZ7V7.js";import{a as x}from"./chunk-NGEXCJJW.js";import{c as y,d as R}from"./chunk-7S5E7KWT.js";var ne={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function u(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let n=e.split(" ");if(n.length<4)return{scheme:n[0]??"",manager:n[1]??"",packageName:n[2]??"",version:"",descriptors:[],raw:e};let t=n[0],i=n[1],r=e.slice(t.length+1+i.length+1),s;if(r.startsWith("`")){let l=r.indexOf("`",1);l===-1?(s=r.slice(1),r=""):(s=r.slice(1,l),r=r.slice(l+2))}else{let l=r.indexOf(" ");l===-1?(s=r,r=""):(s=r.slice(0,l),r=r.slice(l+1))}let o,a=r.indexOf(" ");a===-1?(o=r,r=""):(o=r.slice(0,a),r=r.slice(a+1));let c=te(r);return{scheme:t,manager:i,packageName:s,version:o,descriptors:c,raw:e}}function m(e){let n=u(e);if("kind"in n)return null;for(let t=n.descriptors.length-2;t>=0;t--){let i=n.descriptors[t];if(i?.suffix==="type")return i.name}return null}function te(e){let n=[],t=0;for(;t<e.length;){if(e[t]==="["){let s=e.indexOf("]",t+1);if(s===-1){n.push({name:e.slice(t+1),suffix:"type-param"});break}n.push({name:e.slice(t+1,s),suffix:"type-param"}),t=s+1;continue}if(e[t]==="("&&(n.length===0||t===0||w(e[t-1]))){let s=e.indexOf(")",t+1);if(s!==-1&&e[s+1]!=="."){n.push({name:e.slice(t+1,s),suffix:"parameter"}),t=s+1;continue}}let i;if(e[t]==="`"){let s=e.indexOf("`",t+1);if(s===-1){i=e.slice(t+1),n.push({name:i,suffix:"term"});break}i=e.slice(t+1,s),t=s+1}else{let s=t;for(;t<e.length&&!w(e[t]);)t++;i=e.slice(s,t)}if(t>=e.length){i&&n.push({name:i,suffix:"term"});break}let r=e[t];if(r==="("){let s=e.indexOf(")",t+1);s!==-1&&e[s+1]==="."?(n.push({name:i,suffix:"method"}),t=s+2):s!==-1?(n.push({name:i,suffix:"method"}),t=s+1):(n.push({name:i,suffix:"term"}),t++)}else{let s=ne[r];s&&n.push({name:i,suffix:s}),t+=1}}return n}function w(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function v(e){let n=u(e);if("kind"in n&&n.kind==="local")return`local:${n.id}`;let t=n;if(t.descriptors.length===0)return t.raw;let i=[];for(let r of t.descriptors){let s=ie(r);s&&i.push(s)}return i.join(":")}function ie(e){let n=e.suffix==="namespace"?re(e.name):e.name;return n?e.suffix==="method"?`${n}()`:n:""}function re(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function P(e){let n=u(e);if("kind"in n&&n.kind==="local")return n.id;let t=n;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let n=u(e);if("kind"in n&&n.kind==="local")return null;let t=n;return t.descriptors[t.descriptors.length-1]?.suffix??null}function Qe(e){return e.endsWith("().")||p(e)==="method"}function Q(e){let n=p(e);return n==="method"?!0:n!=="term"?!1:e.endsWith("().")?!0:e.startsWith("rust-analyzer ")&&e.includes("#")?!1:e.startsWith("scip-typescript ")?!/#[A-Za-z0-9_$]+\.$/.test(e):!0}function je(e){return p(e)==="namespace"}var se=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function Be(e){return se.test(e)}var oe=new Set(["test","tests","_tests"]);function Je(e){let n=u(e);if("kind"in n)return!1;for(let t=0;t<n.descriptors.length-1;t+=1){let i=n.descriptors[t];if(i?.suffix==="namespace"&&i.name&&oe.has(i.name))return!0}return!1}function We(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length!==r.length+1)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function ze(e,n){let t=u(e),i=u(n);if("kind"in t||"kind"in i)return!1;let r=t.descriptors,s=i.descriptors;if(s.length<=r.length)return!1;for(let o=0;o<r.length;o++){let a=r[o],c=s[o];if(a.name!==c.name||a.suffix!==c.suffix)return!1}return!0}function Ue(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.start_char, der.end_line, der.end_char, d.relative_path, gs.display_name, gs.documentation
|
|
2
|
+
FROM global_symbols gs
|
|
3
|
+
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
|
+
JOIN documents d ON der.document_id = d.id
|
|
5
|
+
WHERE ${n.where}
|
|
6
|
+
${e.pathExclusionsFor("d")}
|
|
7
|
+
${B(n.orderBy)}
|
|
8
|
+
${J(n.limit)}`,...n.params??[])}function Ge(e,n){return e.all(`SELECT
|
|
9
|
+
gs.id,
|
|
10
|
+
gs.symbol,
|
|
11
|
+
c.document_id,
|
|
12
|
+
MIN(c.start_line) AS start_line,
|
|
13
|
+
0 AS start_char,
|
|
14
|
+
MAX(c.end_line) AS end_line,
|
|
15
|
+
0 AS end_char,
|
|
16
|
+
d.relative_path,
|
|
17
|
+
gs.display_name,
|
|
18
|
+
gs.documentation
|
|
19
|
+
FROM global_symbols gs
|
|
20
|
+
JOIN mentions m ON m.symbol_id = gs.id
|
|
21
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
22
|
+
JOIN documents d ON c.document_id = d.id
|
|
23
|
+
WHERE m.role = 1
|
|
24
|
+
AND ${n.where}
|
|
25
|
+
${e.pathExclusionsFor("d")}
|
|
26
|
+
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
27
|
+
${B(n.orderBy)}
|
|
28
|
+
${J(n.limit)}`,...n.params??[])}function B(e){return e?`ORDER BY ${e}`:""}function J(e){return typeof e=="number"?`LIMIT ${e}`:""}function W(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function z(e){if(!e)return null;let n=j(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(j(i)??i).replace(/\n/g," ")}function j(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function g(e){return{forFile(n,t){return H(e,n,t)},forFiles(n,t){let i=new Map;for(let r of n)i.set(r,H(e,r,t));return i}}}function H(e,n,t){let i={file:n},r=t.facts||t.identifiers;if(t.text&&(i.text=k(e,n)),t.lines&&(i.lines=N(e,n)),t.ast&&(i.ast=O(e,n)),t.imports&&(i.imports=A(e,n)),t.reexports&&(i.reexports=$(e,n)),r){let s=C(e,n),o=s.facts;t.facts&&(i.facts=o),s.unavailable&&(i.sourceFactsUnavailable=s.unavailable),t.identifiers&&o&&(i.identifiers=o.fileIdentifiers,i.identifierLineMap=o.identifierLineMap)}return i}function ae(e,n={}){if(m(e.symbol)!==null)return n.includeClassMemberFallbacks===!0;let r=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(r)}function I(e,n,t={}){let i=new Map;for(let s of n)e.length>0&&!ae(s,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||i.set(s.id,s);for(let s of e)i.set(s.id,s);let r=[...i.values()];return t.sort?r.sort((s,o)=>s.start_line-o.start_line||s.end_line-o.end_line||s.symbol.localeCompare(o.symbol)):r}var le=y("file-definitions",{clearGroups:["definition-catalog"]}),ce=R("scoped-matched-definitions",{clearGroups:["definition-catalog"]}),de=y("file-function-like-definitions",{clearGroups:["definition-catalog"]}),U=new WeakMap;function F(e,n,t={}){return t.includeClassMemberFallbacks?L(e,n,void 0,{includeClassMemberFallbacks:!0}):le.get(e,n,()=>{let i=X(e,n);if(i)return i;let r=L(e,n),s=h(e),o=g(e).forFile(n,{text:!0}).text;return s&&o&&Y.write(e,n,S(e,n,o),{projectFingerprint:s,definitions:r.map(a=>({...a}))}),r})}function ue(e,n){return de.get(e,n,()=>{let t=X(e,n);return t?t.filter(i=>i.isFunctionLike):L(e,n,i=>i.isFunctionLike)})}var Y=E({kind:"file-definitions",invalidation:M("file-definitions"),serialize:fe,deserialize:me});function X(e,n){let t=h(e);if(!t)return null;let i=g(e).forFile(n,{text:!0}).text;if(!i)return null;let r=Y.read(e,n,S(e,n,i));return r?pe(r,t,n):null}function fe(e){return JSON.stringify(e)}function me(e){try{let n=JSON.parse(e);return!D(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function pe(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let s=ge(r,t);if(!s)return null;i.push(s)}return i}function ge(e,n){return!D(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.startChar!="number"&&e.startChar!==void 0||typeof e.endLine!="number"||typeof e.endChar!="number"&&e.endChar!==void 0||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,startChar:e.startChar,endLine:e.endLine,endChar:e.endChar,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function L(e,n,t,i={}){let r=I(be(e,n),ye(e,n),{sort:!0,includeClassMemberFallbacks:i.includeClassMemberFallbacks}).map(Z);return t&&(r=r.filter(t)),V(e,n,r)}function be(e,n){return e.all(`SELECT
|
|
29
|
+
gs.id,
|
|
30
|
+
gs.symbol,
|
|
31
|
+
der.document_id,
|
|
32
|
+
der.start_line,
|
|
33
|
+
der.start_char,
|
|
34
|
+
der.end_line,
|
|
35
|
+
der.end_char,
|
|
36
|
+
d.relative_path,
|
|
37
|
+
gs.display_name,
|
|
38
|
+
gs.kind,
|
|
39
|
+
gs.documentation,
|
|
40
|
+
gs.enclosing_symbol
|
|
41
|
+
FROM global_symbols gs
|
|
42
|
+
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
43
|
+
JOIN documents d ON der.document_id = d.id
|
|
44
|
+
WHERE d.relative_path = ?
|
|
45
|
+
${e.symbolNoiseFor("gs")}
|
|
46
|
+
ORDER BY der.start_line, der.end_line`,n)}function ye(e,n){return e.all(`SELECT
|
|
47
|
+
gs.id,
|
|
48
|
+
gs.symbol,
|
|
49
|
+
c.document_id,
|
|
50
|
+
MIN(c.start_line) AS start_line,
|
|
51
|
+
0 AS start_char,
|
|
52
|
+
MAX(c.end_line) AS end_line,
|
|
53
|
+
0 AS end_char,
|
|
54
|
+
d.relative_path,
|
|
55
|
+
gs.display_name,
|
|
56
|
+
gs.kind,
|
|
57
|
+
gs.documentation,
|
|
58
|
+
gs.enclosing_symbol
|
|
59
|
+
FROM global_symbols gs
|
|
60
|
+
JOIN mentions m ON m.symbol_id = gs.id
|
|
61
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
62
|
+
JOIN documents d ON c.document_id = d.id
|
|
63
|
+
WHERE d.relative_path = ?
|
|
64
|
+
AND m.role = 1
|
|
65
|
+
${e.symbolNoiseFor("gs")}
|
|
66
|
+
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
67
|
+
ORDER BY start_line, end_line`,n)}function Z(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,startChar:e.start_char??0,endLine:e.end_line,endChar:e.end_char??0,relativePath:e.relative_path,leaf:P(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:Q(e.symbol),isTypeLike:p(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function pn(e,n={}){return Se(e,n.scope)}function Se(e,n){return x(e,{scope:n,includeIgnored:!1}).flatMap(t=>F(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function gn(e,n){return x(e,{scope:n,includeIgnored:!1}).flatMap(t=>ue(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function bn(e,n){let t=ce.get(e,()=>new WeakMap),i=t.get(n.symbolMatches);i||(i=new Map,t.set(n.symbolMatches,i));let r=JSON.stringify({scope:n.scope??null,sqlPrefilter:n.sqlPrefilter??null}),s=i.get(r);if(s)return[...s];let o=G(he(e,n.scope,n.sqlPrefilter)),a=G(xe(e,n.scope,n.sqlPrefilter)),c=new Set([...o.keys(),...a.keys()]),l=[];for(let d of[...c].sort()){if(e.isIgnored(d))continue;let f=I(o.get(d)??[],a.get(d)??[],{sort:!0}).filter(ee=>n.symbolMatches(ee.symbol));f.length!==0&&l.push(...V(e,d,f.map(Z)))}return i.set(r,l),[...l]}function he(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${q("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
68
|
+
gs.id,
|
|
69
|
+
gs.symbol,
|
|
70
|
+
der.document_id,
|
|
71
|
+
der.start_line,
|
|
72
|
+
der.start_char,
|
|
73
|
+
der.end_line,
|
|
74
|
+
der.end_char,
|
|
75
|
+
d.relative_path,
|
|
76
|
+
gs.display_name,
|
|
77
|
+
gs.kind,
|
|
78
|
+
gs.documentation,
|
|
79
|
+
gs.enclosing_symbol
|
|
80
|
+
FROM global_symbols gs
|
|
81
|
+
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
82
|
+
JOIN documents d ON der.document_id = d.id
|
|
83
|
+
WHERE 1 = 1
|
|
84
|
+
${e.pathExclusionsFor("d")}
|
|
85
|
+
${i}
|
|
86
|
+
${r}
|
|
87
|
+
${e.symbolNoiseFor("gs")}
|
|
88
|
+
ORDER BY d.relative_path, der.start_line, der.end_line`,...s)}function xe(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${q("gs",t)}`:"",s=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
89
|
+
gs.id,
|
|
90
|
+
gs.symbol,
|
|
91
|
+
c.document_id,
|
|
92
|
+
MIN(c.start_line) AS start_line,
|
|
93
|
+
0 AS start_char,
|
|
94
|
+
MAX(c.end_line) AS end_line,
|
|
95
|
+
0 AS end_char,
|
|
96
|
+
d.relative_path,
|
|
97
|
+
gs.display_name,
|
|
98
|
+
gs.kind,
|
|
99
|
+
gs.documentation,
|
|
100
|
+
gs.enclosing_symbol
|
|
101
|
+
FROM global_symbols gs
|
|
102
|
+
JOIN mentions m ON m.symbol_id = gs.id
|
|
103
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
104
|
+
JOIN documents d ON c.document_id = d.id
|
|
105
|
+
WHERE m.role = 1
|
|
106
|
+
AND NOT EXISTS (
|
|
107
|
+
SELECT 1
|
|
108
|
+
FROM defn_enclosing_ranges existing_der
|
|
109
|
+
WHERE existing_der.symbol_id = gs.id
|
|
110
|
+
)
|
|
111
|
+
${e.pathExclusionsFor("d")}
|
|
112
|
+
${i}
|
|
113
|
+
${r}
|
|
114
|
+
${e.symbolNoiseFor("gs")}
|
|
115
|
+
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
116
|
+
ORDER BY d.relative_path, start_line, end_line`,...s)}function De(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function q(e,n){return n==="callable"?De(e):_e(e)}function _e(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function G(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function yn(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>F(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,s)=>r.relativePath.localeCompare(s.relativePath)||r.startLine-s.startLine||r.endLine-s.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:W(z(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function Ie(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function Sn(e,n){let t=U.get(e);return t||(t=Ie(e),U.set(e,t)),t.get(n)??null}function hn(e,n){let t=F(e,n.relative_path).find(i=>i.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,startChar:t.startChar,endLine:t.endLine,endChar:t.endChar,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,startChar:n.start_char??0,endLine:n.end_line,endChar:n.end_char??0,relativePath:n.relative_path}}function V(e,n,t){let i=g(e).forFile(n,{text:!0}).text,r=T(e,n);return r?ke(t,r,i):i?Le(t,i):t}function Le(e,n){let t=n.split(/\r?\n/),i=Fe(e,t),r=Re(e,i),s=Ee(r,t);return Me(e,s)}function Fe(e,n){let t=e.some(r=>b(r.symbol))?we(n):null,i=new Map;for(let r of e)i.set(r.symbolId,Ae(n,t,r));return i}function Re(e,n){return e.filter(t=>b(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function Ee(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],s=e[i+1],o=s?Math.max(r.startLine,s.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:ve(n,r.definition,r.startLine,o)})}return t}function Me(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function ke(e,n,t=null){let i=new Map;for(let r of n){let s=i.get(r.name);s?s.push(r):i.set(r.name,[r])}return e.map(r=>{if(!$e(r)||!r.leaf)return K(r,t);let s=i.get(r.leaf);if(!s||s.length===0)return K(r,t);let o=t?Ne(r,s,t):null;if(o)return{...r,startLine:o.startLine,endLine:o.endLine};let a=s[0],c=Math.abs(a.startLine-r.startLine);for(let l=1;l<s.length;l+=1){let d=s[l],f=Math.abs(d.startLine-r.startLine);f<c&&(a=d,c=f)}return{...r,startLine:a.startLine,endLine:a.endLine}})}function Ne(e,n,t){let i=Oe(e.symbol);if(!i)return null;let r=t.split(/\r?\n/),s=new RegExp(`\\b${_(i)}\\b`);for(let o of n){let a=Ce(r,o.startLine);if(a&&s.test(a))return o}return null}function Oe(e){return e.match(/\/impl#\[([^\]]+)\]/)?.[1]??null}function Ce(e,n){for(let t=n;t>=0;t-=1){let i=e[t]?.trim()??"";if(i){if(/^impl\b/.test(i))return Te(e,t,n);if(/^(?:struct|enum|trait|mod)\b/.test(i))return null}}return null}function Te(e,n,t){let i=[];for(let r=n;r<=t;r+=1){let s=e[r]??"";if(i.push(s),s.includes("{"))break}return i.join(" ")}function $e(e){return b(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function K(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=_(e.leaf),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),s=n.split(/\r?\n/).findIndex(o=>i.test(o));return s>=0?{...e,startLine:s,endLine:s}:e}function Ae(e,n,t){if(!b(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let s=null;for(let o of r){let a=Math.abs(o-t.startLine);(!s||a<s.distance)&&(s={line:o,distance:a})}return s?.line??i}function we(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,s=new Map,o=(a,c)=>{let l=s.get(a);if(!l){s.set(a,[c]);return}l[l.length-1]!==c&&l.push(c)};for(let a=0;a<e.length;a+=1){let c=e[a]??"";for(let d of c.matchAll(n))d[1]&&o(d[1],a);for(let d of c.matchAll(t))d[1]&&o(d[1],a);let l=c.match(i);l?.[1]&&o(l[1],a);for(let d of c.matchAll(r))d[1]&&o(d[1],a)}return s}function ve(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),s=Math.max(t,Math.min(r,n.endLine)),o=0,a=0,c=!1;for(let l=t;l<=r;l+=1){let d=Pe(e[l]??"");for(let f of d)f==="{"?(o+=1,c=!0):f==="}"?o=Math.max(0,o-1):f==="("?a+=1:f===")"&&(a=Math.max(0,a-1));if(c&&o===0||!c&&a===0&&l>=s)return l}return s}function Pe(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let s=e[r],o=e[r+1];if(!t&&s==="/"&&o==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(s==="\\"){i=!0,n+=" ";continue}s===t&&(t=null),n+=" ";continue}if(s==='"'||s==="'"||s==="`"){t=s,n+=" ";continue}n+=s}return n}function b(e){return e.includes("().")}function xn(e){let n=u(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{g as a,u as b,m as c,v as d,P as e,p as f,Qe as g,Q as h,je as i,Be as j,Je as k,We as l,ze as m,Ue as n,Ge as o,W as p,z as q,I as r,F as s,pn as t,Se as u,gn as v,bn as w,yn as x,Ie as y,Sn as z,hn as A,xn as B};
|
|
117
|
+
//# sourceMappingURL=chunk-EKZTZXHZ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as x}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as x}from"./chunk-6SHPK5ZE.js";import{c as k}from"./chunk-UJCOIXDY.js";import{c as L}from"./chunk-26QA6FAI.js";import{b as g}from"./chunk-B75HZHUP.js";import{a as n}from"./chunk-BGBBVSH4.js";import{l as v}from"./chunk-HX7M4BDI.js";import{d as S}from"./chunk-EKZTZXHZ.js";import{v as a}from"./chunk-WCCFZ7V7.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-EN3O7VJA.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as S}from"./chunk-
|
|
1
|
+
import{c as S}from"./chunk-YTQVETEO.js";import{c as m}from"./chunk-UJCOIXDY.js";import{c as h}from"./chunk-26QA6FAI.js";import{j as y}from"./chunk-HX7M4BDI.js";import{p}from"./chunk-UJPRPGCO.js";import{a as g}from"./chunk-NGEXCJJW.js";import f from"path";function W(e,t){let{scope:i,minDeviation:r=5,limit:n=50}=t??{},a=t?.semantic!==!1,u=t?.includePatternDeviations===!0,o=new m(e).fileDependencyGraph(i),l=S(e,{scope:i}),c=x([...D(e,o,{scope:i,semantic:a}),...R(l.forbiddenEdges),...u?E(o,r):[]]);return t?.includeArchitecture===!0&&(c.architecture=l),n<=0||c.results.length<=n?c:{...c,results:c.results.slice(0,n),totalResults:c.results.length}}function D(e,t,i){let r=_(e,i.scope),n=[],a=new Set;for(let[s,o]of t){if(d(s))continue;let l=r.get(s)??new Set;for(let c of o)d(c)||l.has(c)||v(e,s,c,i)||(n.push({file:s,dep:c}),a.add(s))}a.size>0&&w(e,r,{paths:[...a]});let u=[];for(let{file:s,dep:o}of n)(r.get(s)??new Set).has(o)||u.push({file:s,kind:"unused-import",description:`Depends on ${o} but references none of its symbols`,dep:o,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${s} to ${o}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return u}function v(e,t,i,r){return C(e,t,i)||M(e,t,i)||O(i)||P(e,t,i)||N(i)?!0:r.semantic&&A(e,t,i)}function R(e){return e.flatMap(t=>{let i=t.examples[0];return i?[{file:i.fromFile,kind:"architecture-violation",description:`${t.from} depends on forbidden boundary ${t.to} through ${t.fileEdgeCount} file edge(s)`,dep:i.toFile,detail:`${t.from} may not depend on ${t.to}`,actionTier:"direct",policyBasis:"explicit",architecture:{fromBoundary:t.from,toBoundary:t.to,fileEdgeCount:t.fileEdgeCount,importerCount:t.importerCount,importedFileCount:t.importedFileCount,examples:t.examples},evidenceReasons:[`configured dependency row for ${t.from} does not allow ${t.to}`,`${t.fileEdgeCount} file edge(s) connect ${t.importerCount} importer(s) to ${t.importedFileCount} imported file(s)`,...t.examples.map(r=>`${r.fromFile} imports ${r.toFile}`)],recommendation:"Move the dependency behind an allowed boundary, reverse the dependency through an owned interface, or deliberately update the project architecture rule."}]:[]})}function E(e,t){let i=[];for(let[r,n]of k(e)){let a=n.filter(s=>!d(s));if(a.length<t)continue;let u=I(e,a);for(let s of a)for(let o of e.get(s)??[])d(o)||(u.get(o)??0)===1&&f.dirname(o)!==r&&f.dirname(o)!==f.dirname(r)&&i.push({file:s,kind:"pattern-deviation",description:`Only file in ${r}/ that depends on ${o}`,dep:o,actionTier:"signal",evidenceReasons:[`${a.length} sibling file(s) in ${r}/ were compared`,`${s} is the only non-skipped sibling depending on ${o}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."})}return i}function x(e){let t=e.filter(i=>i.kind==="architecture-violation").length;return{results:e,unusedImports:e.filter(i=>i.kind==="unused-import").length,architectureViolations:t,layerViolations:t,patternDeviations:e.filter(i=>i.kind==="pattern-deviation").length}}function k(e){let t=new Map;for(let i of e.keys()){let r=f.dirname(i),n=t.get(r);n||(n=[],t.set(r,n)),n.push(i)}return t}function I(e,t){let i=new Map;for(let r of t)for(let n of e.get(r)??[])d(n)||i.set(n,(i.get(n)??0)+1);return i}function _(e,t){let i=new Map;return $(e,i,t),i}function $(e,t,i){for(let r of F(e,i))b(e,t,r.from_file,r.to_file)}function F(e,t){let i=t?"AND d1.relative_path LIKE ?":"",r=t?[`%${t}%`]:[];return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d1 ON c.document_id = d1.id
|
|
@@ -15,4 +15,4 @@ import{c as S}from"./chunk-7VCOXZH3.js";import{c as m}from"./chunk-2SNGN6U4.js";
|
|
|
15
15
|
AND m.role != 1
|
|
16
16
|
${e.pathExclusionsFor("d1","d2")}
|
|
17
17
|
${i}`,...r)}function w(e,t,i={}){new m(e).scanSourceReferences({paths:i.paths??g(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},n=>{n.target.relativePath!==n.sourceFile&&(e.isIgnored(n.target.relativePath)||b(e,t,n.sourceFile,n.target.relativePath))})}function b(e,t,i,r){if(e.isIgnored(i)||e.isIgnored(r))return;let n=t.get(i);n||(n=new Set,t.set(i,n)),n.add(r)}function O(e){return e.includes("types")||e.endsWith(".d.ts")}function A(e,t,i){let r=y(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.some(n=>n.isUsed)}function C(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.some(n=>n.used)}function M(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length>0&&r.every(n=>n.isTypeOnly===!0)}function N(e){return e.endsWith(".vue")}function P(e,t,i){let r=p(e,t).filter(n=>n.sourcePath===i);return r.length===0?!1:r.every(n=>n.kind==="side-effect"||n.kind==="namespace"&&n.usedMembers.length===0&&!n.used)}function d(e){let t=h(e);return!!(t==="entry"||t==="barrel"||t==="test"||t==="worker"||T(f.basename(e)))}function T(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{W as a};
|
|
18
|
-
//# sourceMappingURL=chunk-
|
|
18
|
+
//# sourceMappingURL=chunk-EW2NTSFA.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{$ as F,$e as Y,Bb as P,Ke as p,Le as H,Mb as _,Me as X,Oe as w,_e as L,ca as I,ea as V,ha as v,ia as x,ja as D,ka as B,kf as C,la as W,ma as U,mf as Z,nf as q,of as g,qf as ee,sd as Q,tf as N,wf as k,xe as z}from"./chunk-JFGGXWQF.js";function ne(e,n,t){if(!Number.isSafeInteger(t.limit)||t.limit<=0)throw new Error("Reference page limit must be a positive safe integer.");let o=v(e,n);if(!o)return{rows:[],hasMore:!1,producer:t.producer??"source-keyset",semanticEnrichment:!1};if(t.producer==="complete-only"||t.semantic===!0||o.relativePath.endsWith(".rb"))return G(e,n,t);let s=B(e,o);if(!s)return G(e,n,t);let i=oe(e,o),u=ue(e,i),a=[],c=t.producer==="source-keyset";for(let l of u){if(t.after&&l<t.after.relativePath)continue;t.instrumentation?.fileScanned?.(l);let f=W(e,s,l);f.length>0&&(c=!0);let R=new Set(f);i?.relativePath===l&&R.add(i.line);for(let b of[...R].sort((m,ce)=>m-ce)){let m={relativePath:l,line:b};if(!(t.after&&h(m,t.after)<=0)&&(a.push(m),t.instrumentation?.rowAccepted?.(m),c&&a.length>t.limit))return te(a,t.limit)}}return c?te(a,t.limit):G(e,n,t,i)}function h(e,n){return(e.relativePath<n.relativePath?-1:e.relativePath>n.relativePath?1:0)||e.line-n.line}function te(e,n){return{rows:e.slice(0,n),hasMore:e.length>n,producer:"source-keyset",semanticEnrichment:!1}}function G(e,n,t,o){let r=v(e,n),s=t.semantic===!0||r?.relativePath.endsWith(".rb")?P(e,n,{semantic:t.semantic}):le(e,n,o),i=me(s).filter(u=>!t.after||h(u,t.after)>0);for(let u of i.slice(0,t.limit+1))t.instrumentation?.rowAccepted?.(u);return{rows:i.slice(0,t.limit),hasMore:i.length>t.limit,producer:"complete-only",semanticEnrichment:t.semantic===!0}}function le(e,n,t){let o=v(e,n);if(!o)return[];let r=t===void 0?oe(e,o):t,s=U(e,o).map(i=>({relativePath:i.file,line:i.line}));return r?[r,...s]:s}function oe(e,n){return!V(n.symbol)&&!e.isIgnored(n.relativePath)?{relativePath:n.relativePath,line:n.startLine}:null}function ue(e,n){let t=F(e);return!n||t.includes(n.relativePath)?t:[...t,n.relativePath].sort((o,r)=>o<r?-1:o>r?1:0)}function me(e){let n=new Map;for(let t of e)n.set(`${t.relativePath}\0${t.line}`,t);return[...n.values()].sort(h)}import{InvalidArgumentError as y}from"commander";var Ae=z,de=/^[+-]?\d+$/u,fe=/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/u,Fe=(e=>M(e,"an integer")),re=(e=>{let n=M(e,"a non-negative integer");if(n<0)throw new y(`Expected a non-negative integer, got "${e}".`);return n}),ie=(e=>{let n=M(e,"a positive integer");if(n<1)throw new y(`Expected a positive integer, got "${e}".`);return n}),Ve=(e=>{if(!fe.test(e))throw new y(`Expected a number, got "${e}".`);let n=Number(e);if(!Number.isFinite(n))throw new y(`Expected a finite number, got "${e}".`);return n});function M(e,n){if(!de.test(e))throw new y(`Expected ${n}, got "${e}".`);let t=Number(e);if(!Number.isSafeInteger(t))throw new y(`Expected ${n}, got "${e}".`);return t}function d(e,n,t,...o){return o.length>0?{flags:e,description:n,parser:t,defaultValue:o[0]}:{flags:e,description:n,parser:t}}function pe(){return d("--json","Output as JSON for programmatic consumption")}function ge(){return d("--compact","Emit minified one-line JSON (use with --json)")}function he(){return d("--result-only","Emit only the command-owned result (use with --json)")}function se(e=[]){return S(e)}function S(e=[]){let n=[pe(),he(),ge()],t=new Set(n.map(o=>o.flags));return[...e.filter(o=>!t.has(o.flags)),...n]}function E(e,n=[]){return{category:e,examples:n}}function K(e,n,t,o,r){return{answers:typeof e=="string"?[e]:e,returns:typeof n=="string"?[n]:n,inputs:t,coverage:o,...r?{scope:r}:{}}}function $(e){return e.generation.identity}function j(e){return"after"in e?k({version:2,...e}):k({version:1,...e})}function ae(e,n){let t=be(e);if(!ye(t)&&!Re(t))throw new Error("Invalid result cursor. Run the command again without --cursor.");return Pe(t,n),t}function ye(e){if(!e||typeof e!="object")return!1;let n=e;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 Re(e){if(!e||typeof e!="object")return!1;let n=e,t=n.after;return n.version===2&&typeof n.command=="string"&&typeof n.target=="string"&&!!t&&typeof t.relativePath=="string"&&t.relativePath.length>0&&Number.isSafeInteger(t.line)&&(t.line??-1)>=0&&(n.producer==="source-keyset"||n.producer==="complete-only")&&typeof n.semanticEnrichment=="boolean"&&typeof n.indexGeneration=="string"&&n.indexGeneration.length>0}function be(e){try{return JSON.parse(Buffer.from(e,"base64url").toString("utf8"))}catch{throw new Error("Invalid result cursor. Run the command again without --cursor.")}}function Pe(e,n){if(e.command!==n.command||e.target!==n.target)throw new Error("This cursor belongs to a different command or target. Run again without --cursor.");if(e.indexGeneration!==n.indexGeneration)throw new Error("The index changed after this cursor was issued. Run again without --cursor.")}function J(e,n){let t=x(e,n),o=ve(t);for(let r of o)console.log(r)}function T(e,n,t="No results found for resolved symbol."){return x(e,n).match?t:we(n,D(e,n,5))}function A(e,n,t,o){return{...O(e,n),[o]:t}}function O(e,n){let t=x(e,n);return t.match?{matched:!0,resolved:{symbol:t.match.symbol,shortName:I(t.match.symbol),relativePath:t.match.relativePath},otherMatches:t.candidates.map(o=>({shortName:o.shortName,relativePath:o.relativePath,startLine:o.startLine})),totalMatches:t.total}:{matched:!1,suggestions:D(e,n,5)}}function we(e,n){let t=`No definition matched '${e}'.`;return n.length>0?`${t} Suggestions: ${n.join(", ")}`:t}function ve(e){if(!e.match||e.total<=1)return[];let n=e.match,t=Math.max(0,e.total-1),o=[`Resolved: ${I(n.symbol)} (${n.relativePath}) -- ${t} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=e.candidates.slice(0,3);return r.length>0&&o.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${p(s.startLine)})`).join("; ")}`),o.push(""),o}var xe=L(({db:e,args:n,opts:t})=>{let o=C(n,0),r=g(t,"signatures"),s=_(e,o);if(g(t,"json")){N("outline",n,t,s);return}if(s.length===0)return w.empty(`No symbols found for "${o}".`);function i(u,a){for(let c of u){let l=" ".repeat(a),f=r&&c.signature?` - ${Ce(c.signature)}`:"";console.log(`${l}${H(c.startLine,c.endLine)} ${c.shortName}${f}`),i(c.children,a+1)}}i(s,0)});function Ce(e){return e.length>120?`${e.slice(0,117)}...`:e}var Ne=Y("refs",({db:e,args:n,opts:t,budget:o})=>{let r=C(n,0),s=Z(t,"cursor"),i=q(t,"limit"),u=$(e),a=s?ae(s,{command:"refs",target:r,indexGeneration:u}):void 0,c=!a&&i===void 0,l=c?Se(e,r,o.semantic):a?.version===1?Ee(e,r,a.offset,i??50,o.semantic):$e(e,r,{limit:i??50,cursor:a,semantic:a?.semanticEnrichment??g(t,"full"),indexGeneration:u}),{rows:f,continuation:R,coverage:b}=l;if(g(t,"json")){let m={...A(e,r,f,"references"),pagination:l.pagination};N("refs",n,t,m,{analysisBudget:o.analysisBudget,coverage:b});return}if(f.length===0)return w.empty(T(e,r,"No references found."));if(J(e,r),w.groupedByFile(f,m=>` line ${p(m.line)}`),l.pagination.producer==="complete-only"&&!c&&console.error(`
|
|
3
|
+
This evidence provider required complete analysis; --limit bounded the returned rows, not analysis work.`),R){let m=b.totalKnown?`${b.omitted} omitted; `:"More references are available; ";console.log(`
|
|
4
|
+
${m}continue with --cursor ${R.cursor}`)}});function Se(e,n,t){let o=P(e,n,{semantic:t}).sort(h);return{rows:o,coverage:{complete:!0,totalKnown:!0,returned:o.length,total:o.length,omitted:0},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:t}}}function Ee(e,n,t,o,r){let s=P(e,n,{semantic:r}).sort(h);if(t>s.length)throw new Error("This cursor points past the current result set. Run again without --cursor.");let i=s.slice(t,t+o),u=t+i.length,a=i[i.length-1],c=t===0&&i.length===s.length,l=u<s.length&&a?{cursor:j({command:"refs",target:n,after:a,producer:"complete-only",semanticEnrichment:r,indexGeneration:$(e)}),indexGeneration:$(e)}:void 0;return{rows:i,continuation:l,coverage:c?{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,...l?{continuation:l}:{}},pagination:{cursorVersion:2,producer:"complete-only",semanticEnrichment:r}}}function $e(e,n,t){let o=ne(e,n,{limit:t.limit,after:t.cursor?.after,producer:t.cursor?.producer,semantic:t.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:t.indexGeneration}),indexGeneration:t.indexGeneration}:void 0,i=!t.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 Oe=L(({db:e,args:n,opts:t})=>{let o=C(n,0),r=Q(e,o,{context:ee(t,"context",0)});if(g(t,"json")){N("code",n,t,A(e,o,r,"code"),{resultOnly:Ie(e,o,r)});return}if(!r)return w.empty(T(e,o,"Symbol found, but source was unreadable."));J(e,o),console.log(`${X(r.relativePath,r.startLine,r.endLine)} ${r.shortName} [${r.language??"unknown"}]
|
|
5
|
+
`);let s=r.source.split(`
|
|
6
|
+
`);for(let i=0;i<s.length;i++)console.log(` ${String(p(r.startLine+i)).padStart(4)} ${s[i]}`)});function Ie(e,n,t){if(!t)return O(e,n);let o={file:t.relativePath,symbol:t.shortName,language:t.language??"unknown",range:{startLine:p(t.startLine),endLine:p(t.endLine)},lines:t.source.split(`
|
|
7
|
+
`).map((i,u)=>({line:p(t.startLine+u),text:i}))},r=O(e,n),s=r.totalMatches??0;return!r.matched||!r.resolved||s<=1?o:{...o,resolution:{selected:r.resolved,alternatives:r.otherMatches??[],totalMatches:s}}}var it=[{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:se([d("--full","Run unbounded semantic analysis on large indexes"),d("-n, --limit <n>","Maximum reference sites to return",ie),d("--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:E("Navigation",["scip-query refs login"]),handler:Ne},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",agent:K("What symbols and nesting exist in this file?","symbol names, nesting, and line ranges",["file"],"complete"),options:S([d("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:E("Navigation"),handler:xe},{id:"code",command:"code <symbol>",description:"Read the source code for a symbol (bounded to its definition range)",agent:{...K("What is the compiler-resolved definition source for this symbol?","definition identity, source, and line range",["symbol"],"complete"),resultUnits:{kind:"field",field:"code"}},options:S([d("-C, --context <n>","Extra lines of context above/below",re,0)]),renderShape:"custom",docs:E("Navigation"),handler:Oe}];export{Ae as a,Fe as b,re as c,ie as d,Ve as e,d as f,ge as g,se as h,S as i,E as j,K as k,J as l,T as m,A as n,O as o,it as p};
|
|
8
|
+
//# sourceMappingURL=chunk-F3Z4OUDS.js.map
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import{a as m,g as b}from"./chunk-46XGSFNI.js";import y from"ignore";import{existsSync as v,readdirSync as P}from"fs";import{dirname as g,isAbsolute as D,join as d,relative as V,resolve as _}from"path";function R(t){let e=y();return A(t,e)||e.add(F),{isIgnored:s=>h(e,t,s),filter:s=>s.filter(i=>!h(e,t,i))}}function A(t,e){let r=new Set,s=(a,o)=>{if(!(r.has(a)||!v(a)))try{let c=b(a,{maxBytes:m,inputKind:"gitignore file"});e.add(o?E(c,o):c),r.add(a)}catch{}},i=g(t),n=0;for(;i!==g(i)&&n<5&&(s(d(i,".gitignore"),""),!v(d(i,".git")));)i=g(i),n++;return C(t,"",e,s),r.size>0}function C(t,e,r,s){let i=e?d(t,e):t;s(d(i,".gitignore"),e);let n;try{n=P(i,{withFileTypes:!0})}catch{return}for(let a of n){if(!a.isDirectory()||a.name===".git")continue;let o=e?`${e}/${a.name}`:a.name;h(r,t,`${o}/`)||C(t,o,r,s)}}function E(t,e){let r=e.replaceAll("\\","/").replace(/\/+$/,"");return t.split(/\r?\n/).map(s=>I(s,r)).join(`
|
|
2
|
+
`)}function I(t,e){let r=t.trimStart();if(!r||r.startsWith("#"))return t;let s=t.slice(0,t.length-r.length),i=r.startsWith("!"),n=i?r.slice(1):r;if(!n||n.startsWith("#"))return t;let a=n.startsWith("/"),o=a?n.slice(1):n,u=(o.endsWith("/")?o.slice(0,-1):o).includes("/")||a?`${e}/${o}`:`${e}/**/${o}`;return`${s}${i?"!":""}${u}`}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 h(t,e,r){let s=M(e,r);if(!s)return!1;try{return t.ignores(s)}catch{return!1}}function M(t,e){if(!e||e===".")return null;if(!D(e)&&!e.startsWith(".."))return e.replaceAll("\\","/");let r=D(e)?e:_(t,e),s=V(t,r).replaceAll("\\","/");return!s||s==="."||s.startsWith("..")?null:s}var O=[];function p(t){t.groups.length>0&&O.push(t)}function S(){let t=new WeakMap;return{cache:t,ensure(e){let r=t.get(e);return r||(r=new Map,t.set(e,r)),r}}}function x(t,e){let{cache:r,ensure:s}=S(),i={get(n,a,o){let c=s(n);if(c.has(a))return c.get(a);let l=o();return c.set(a,l),l},invalidate(n,a){r.get(n)?.delete(a)},invalidateAll(n){r.delete(n)},size(n){return r.get(n)?.size??0}};return p({name:t,groups:e.clearGroups,clearAll:n=>i.invalidateAll(n),clearFile:(n,a)=>i.invalidate(n,a)}),i}function H(t,e){let r=new WeakMap,s={get(i,n){let a=r.get(i);if(a)return a.value;let o=n();return r.set(i,{value:o}),o},invalidate(i){r.delete(i)},has(i){return r.has(i)}};return p({name:t,groups:e.clearGroups,clearAll:i=>s.invalidate(i)}),s}var $={clearGroups:["whole-project","source-file"]};function j(t){return G(t,$)}function G(t,e){let{cache:r,ensure:s}=S(),i={get(n,a,o,c){let l=s(n),u=l.get(a);if(u&&u.source===o)return u.value;let f=c();return l.set(a,{source:o,value:f}),f},invalidate(n,a){r.get(n)?.delete(a)},invalidateAll(n){r.delete(n)}};return p({name:t,groups:e.clearGroups,clearAll:n=>i.invalidateAll(n),clearFile:(n,a)=>i.invalidate(n,a)}),i}import{basename as J}from"path";var K=x("indexed-document-paths",{clearGroups:["whole-project"]});function Y(t,e={}){let r=w(e);return[...K.get(t,r,()=>{let i=e.scope?"AND relative_path LIKE ?":"",n=e.like?"AND relative_path LIKE ?":"",a=[...e.scope?[`%${e.scope}%`]:[],...e.like?[e.like]:[]],o=t.all(`SELECT relative_path
|
|
60
|
+
FROM documents
|
|
61
|
+
WHERE 1 = 1
|
|
62
|
+
${t.pathExclusionsFor("documents")}
|
|
63
|
+
${i}
|
|
64
|
+
${n}
|
|
65
|
+
ORDER BY relative_path`,...a).map(l=>l.relative_path),c=e.extensions?o.filter(l=>e.extensions.some(u=>l.toLowerCase().endsWith(u.toLowerCase()))):o;return e.includeIgnored===!1?c.filter(l=>!t.isIgnored(l)):c})]}function w(t){let e=t.extensions?[...new Set(t.extensions.map(r=>r.toLowerCase()))].sort():null;return JSON.stringify({scope:t.scope??null,like:t.like??null,extensions:e,includeIgnored:t.includeIgnored!==!1})}export{p as a,x as b,H as c,j as d,G as e,Y as f,R as g};
|
|
66
|
+
//# sourceMappingURL=chunk-FJH2NW7J.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as g}from"./chunk-ZTETIQ35.js";import{c as d}from"./chunk-UJCOIXDY.js";import{a as c}from"./chunk-7O5IKBTZ.js";import{d as p}from"./chunk-EKZTZXHZ.js";import{f as o}from"./chunk-UJPRPGCO.js";import{x as u}from"./chunk-GH74ASD6.js";function F(r,a={}){let{scope:l,limit:s=30,scanLimit:b}=a,f=new d(r);return g({candidates:()=>f.productionCallableDefinitions({scope:l,files:a.files,minLoc:2,excludeRootedSymbols:!0,requireFunctionLikeSymbol:!0}),filterCandidate:e=>y(e.relativePath),scanLimit:b,profile:{name:"unused-params"},evaluate:e=>{let n=o(r,e.relativePath)?.callables.find(t=>t.startLine===e.startLine&&t.endLine===e.endLine);if(!n||n.params.length===0||n.params.some(t=>!t.simple)||n.paramsEndLine>=n.endLine)return null;let L=c(r,e.relativePath),m=[];for(let t=n.params.length-1;t>=0;t--){let i=n.params[t];if(i.name===""||i.name.startsWith("_")||h(L.get(i.name),n.paramsEndLine,n.endLine))break;m.unshift(i.name)}return m.length===0?null:{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,paramCount:n.paramCount,unusedTrailing:m}},orderResults:(e,n)=>n.unusedTrailing.length-e.unusedTrailing.length||e.file.localeCompare(n.file)||e.startLine-n.startLine,limit:s})}function y(r){let a=u(r);return a==="typescript"||a==="tsx"||a==="javascript"}function h(r,a,l){return r?r.some(s=>s>a&&s<=l):!1}export{F as a};
|
|
2
|
+
//# sourceMappingURL=chunk-FKSELJQF.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{a as S}from"./chunk-S7OYBOCK.js";import{c as y}from"./chunk-UJCOIXDY.js";import{a as R,b as k,c as C,i as b}from"./chunk-26QA6FAI.js";import{l as v}from"./chunk-HX7M4BDI.js";import{d as h}from"./chunk-EKZTZXHZ.js";import{E as f,F as g}from"./chunk-WCCFZ7V7.js";import{c as m}from"./chunk-C3KV2II6.js";function _(e,a){let n=m(a),t=[],r="complete",o=C(n);o==="entry"&&s(t,"operational-root","structural entrypoint path"),o==="worker"&&s(t,"operational-root","worker launch convention"),b(n)&&s(t,"operational-root","framework-discovered entrypoint"),L(e,n)&&s(t,"operational-root","configured entry root");let l=!1;try{l=R(e,n),l&&s(t,"published-api","package manifest export");for(let i of k(e,n))s(t,"operational-root",i)}catch(i){r="partial",s(t,"metadata-unavailable",`package metadata unavailable: ${x(i)}`)}try{let i=f(e.config.projectRoot,n,{maxBytes:8388608,inputKind:"change-surface source"});w(i)&&s(t,"operational-root","module contains a direct-execution process guard")}catch(i){r="partial",s(t,"metadata-unavailable",g(i)?"indexed source file is unavailable on disk":`source metadata unavailable: ${x(i)}`)}return{operationalRoot:t.some(i=>i.kind==="operational-root"),publishedApi:l,coverage:r,reasons:t}}function L(e,a){let n=e.config.entryRoots;return n?n.files?.some(t=>m(t)===a)?!0:n.pathPrefixes?.some(t=>a.startsWith(m(t)))??!1:!1}function w(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,a,n){e.some(t=>t.kind===a&&t.detail===n)||e.push({kind:a,detail:n})}function x(e){return e instanceof Error?e.message:String(e)}function q(e,a,n={}){let t=S(e,a);if(!t)return null;let r=D(e,t);if(!r||e.isIgnored(r.relative_path))return null;let o=[],l=0,i=M(e,r.relative_path),p=_(e,r.relative_path),F=n.semantic===!1?new Map:v(e,i);for(let u of i){let c=I(e,r,u,F.get(u.symbolId)??new Set);l+=c;let d=N(c),E=[...p.reasons,...c>0?[{kind:"external-consumers",detail:`${c} external consumer${c===1?"":"s"}`}]:[]];o.push({symbol:u.symbol,shortName:h(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:c,externalConsumerRiskLevel:d,riskLevel:P(d,p),riskReasons:E})}return{file:r.relative_path,symbols:o,totalExternalConsumers:l,fileRisk:p}}function D(e,a){return e.get(`SELECT id, relative_path FROM documents
|
|
2
|
+
WHERE relative_path = ?
|
|
3
|
+
${e.pathExclusionsFor("documents")}
|
|
4
|
+
LIMIT 1`,a)??null}function M(e,a){return new y(e).definitionsForFile(a).sort((n,t)=>n.startLine-t.startLine||n.endLine-t.endLine)}function I(e,a,n,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
|
|
5
|
+
FROM mentions m
|
|
6
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
+
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
8
|
+
WHERE m.symbol_id = ?
|
|
9
|
+
AND m.role != 1
|
|
10
|
+
AND c.document_id != ?`,n.symbolId,a.id);return new Set([...r.map(o=>o.relative_path),...[...t].filter(o=>o!==a.relative_path)]).size}function N(e){return e>10?"high":e>0?"medium":"low"}function P(e,a){return e==="high"?"high":e==="medium"||a.operationalRoot||a.publishedApi||a.coverage==="partial"?"medium":"low"}export{q as a};
|
|
11
|
+
//# sourceMappingURL=chunk-FTFP6O3L.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as m,d}from"./chunk-26QA6FAI.js";import{a as $}from"./chunk-C43RDDP4.js";function v(r,e={}){return P(r,e).cycles}function P(r,e={}){let{scope:s,maxDepth:i=10}=e,n=$(r,s,{scipEdges:"imports-only"}),c=[],a=new Set,l=new Set,f=[],g=!1;function b(t,o){if(o>i){g=!0;return}if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),y=u.indexOf(u.reduce((C,D)=>C<D?C:D)),p=[...u.slice(y,-1),...u.slice(0,y),u[y]],k=p.join(" -> ");S.has(k)||(S.add(k),c.push({path:p,kind:w(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let x=n.get(t);if(x)for(let h of x)b(h,o+1);f.pop(),l.delete(t)}let S=new Set;for(let t of n.keys())a.has(t)||b(t,0);return c.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),{cycles:c,truncated:g,maxDepth:i}}function w(r){for(let i of r){let n=m(i);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(r.length!==3)return"real";let[e,s]=r;return!e||!s?"real":d(e)||d(s)||B(e,s)||B(s,e)||R(e,s)||R(s,e)||m(e)==="entry"||m(s)==="entry"?"module-hierarchy":"real"}function B(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=e.replace(/\.rs$/,"/");return r.startsWith(s)?!r.slice(s.length).includes("/"):!1}function R(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=r.replace(/\.rs$/,""),i=e.replace(/\.rs$/,"");if(s===i+"_tests"||s===i+"/tests")return!0;let n=r.split("/"),c=e.split("/");if(n.length===c.length&&n.includes("tests")&&c.includes("src")){let a=n[n.length-1],l=c[c.length-1];if(a&&a===l)return!0}return!1}export{v as a,P as b};
|
|
2
|
+
//# sourceMappingURL=chunk-FYLK2DEJ.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as Pe,J as g,K as Ee,j as Te,k as _e,r as Le,s as y,y as Fe}from"./chunk-WCCFZ7V7.js";import{a as X}from"./chunk-NGEXCJJW.js";import{c as I,d as q,e as L,f as ke}from"./chunk-7S5E7KWT.js";import{m as M}from"./chunk-2KAZEZ6M.js";import{c as v}from"./chunk-C3KV2II6.js";import{existsSync as le,readdirSync as Rt,statSync as Vt}from"fs";import{join as w,relative as jt}from"path";function we(e){let t=Bt(e)??Dt(e);if(!t||t.length===0)return[];let n=[],r=new Set;for(let o of t)for(let s of Wt(e,o)){if(r.has(s))continue;r.add(s);let i=Ut(e,s);i&&n.push(i)}return n}function Bt(e){let t=w(e,"pnpm-workspace.yaml");if(!le(t))return null;try{return It(M(t,"pnpm workspace manifest"))}catch{return null}}function It(e){let t=[],n=!1;for(let r of e.split(/\r?\n/)){let o=$t(r);if(!n){/^packages\s*:\s*$/.test(o.trim())&&(n=!0);continue}let s=/^\s+-\s*(.+)$/.exec(o);if(s){let i=Ot(s[1].trim());i&&t.push(i);continue}if(o.trim()!=="")break}return t}function $t(e){let t=e.indexOf("#");return t===-1?e:e.slice(0,t)}function Ot(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function Dt(e){let t=w(e,"package.json");if(!le(t))return null;try{let n=JSON.parse(M(t,"workspace package manifest"));return n.workspaces?Array.isArray(n.workspaces)?n.workspaces:n.workspaces.packages??[]:null}catch{return null}}function Wt(e,t){if(!t||t.startsWith("!")||t.includes("node_modules"))return[];if(!t.includes("*")){let i=w(e,t);return ce(i)?[i]:[]}let n=t.indexOf("*"),r=t.slice(0,n).replace(/\/$/,""),o=t.slice(n+1).replace(/^\//,""),s=w(e,r||".");return ce(s)?Rt(s).map(i=>w(s,i,o)).filter(ce):[]}function ce(e){try{return Vt(e).isDirectory()}catch{return!1}}function Ut(e,t){let n=w(t,"package.json");if(!le(n))return null;try{let r=JSON.parse(M(n,"workspace package manifest"));return typeof r.name!="string"||r.name.length===0?null:{name:r.name,relativeDir:jt(e,t).replace(/\\/g,"/"),exports:r.exports}}catch{return null}}import{extname as Ae}from"path";var zt={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb",".clj":"clojure",".cljs":"clojure",".cljc":"clojure"};function H(e){return zt[Ae(e).toLowerCase()]??null}function Re(e){return Ae(e).toLowerCase()===".vue"}import{createRequire as Mt}from"module";var d=Mt(import.meta.url),J=null,Ve=!1;function qt(){if(Ve)return null;if(J)return J;try{return J=d("tree-sitter"),J}catch{return Ve=!0,null}}var je=new Map,Z=new Set;function Xt(e){if(Z.has(e))return null;let t=je.get(e);if(t)return t;let n;try{switch(e){case"rust":n=d("tree-sitter-rust");break;case"typescript":n=d("tree-sitter-typescript").typescript;break;case"tsx":n=d("tree-sitter-typescript").tsx;break;case"javascript":n=d("tree-sitter-javascript");break;case"python":n=d("tree-sitter-python");break;case"java":n=d("tree-sitter-java");break;case"kotlin":n=d("tree-sitter-kotlin");break;case"scala":n=d("tree-sitter-scala");break;case"ruby":n=d("tree-sitter-ruby");break;case"c":n=d("tree-sitter-c");break;case"cpp":n=d("tree-sitter-cpp");break;case"csharp":n=d("tree-sitter-c-sharp");break;case"php":n=d("tree-sitter-php").php;break;case"vb":{let r=d("tree-sitter-vb-dotnet");n=r.language??r;break}case"clojure":return Z.add(e),null}}catch{return Z.add(e),null}return je.set(e,n),n}var Be=new Map;function Ht(e){let t=Be.get(e);if(t)return t;let n=Xt(e);if(!n)return null;let r=qt();if(!r)return null;let o=new r;try{o.setLanguage(n)}catch{return Z.add(e),null}return Be.set(e,o),o}function Jt(e,t){return e.parse(r=>r>=t.length?null:t.slice(r,Math.min(t.length,r+16384)))}function $(e,t){let n=Ht(e);if(!n)return null;try{return Jt(n,t)}catch{return null}}import{posix as ue}from"path";import{parse as Zt}from"@vue/compiler-sfc";var Gt=L("vue-sfc-units");function A(e,t){let n=Oe(t),r=g(e,n);return Gt.get(e,n,r,()=>pe(e,n,r))}function Oe(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function Kt(e){let t=e?.toLowerCase();return!t||t==="js"||t==="javascript"||t==="jsx"?"javascript":t==="ts"||t==="typescript"?"typescript":t==="tsx"?"tsx":null}function F(e){return!e||e.body.length===0?0:e.body.split(`
|
|
2
2
|
`).length}function pe(e,t,n){let r={relativePath:t,template:null,scripts:[],styles:[],customBlocks:[],errors:[]};if(!n)return r;let o;try{o=Zt(n,{filename:t})}catch(i){return r.errors.push($e(i)),r}r.errors.push(...o.errors.map($e));let{descriptor:s}=o;return s.template&&(r.template=G(e,t,"template",s.template)),s.script&&r.scripts.push(Ie(e,t,s.script,!1)),s.scriptSetup&&r.scripts.push(Ie(e,t,s.scriptSetup,!0)),r.styles=s.styles.map(i=>G(e,t,"style",i)),r.customBlocks=s.customBlocks.map(i=>G(e,t,"custom",i)),r.errors.push(...[r.template,...r.scripts,...r.styles,...r.customBlocks].flatMap(i=>i?.errors??[])),r}function Ie(e,t,n,r){let o=G(e,t,"script",n);return{...o,kind:"script",setup:r,astLanguage:Kt(o.lang)}}function G(e,t,n,r){let o=Yt(r.attrs),s=typeof o.lang=="string"?o.lang:null,i=typeof o.src=="string"?o.src:typeof r.src=="string"?r.src:void 0;if(i){let c=Qt(t,i);if(!c)return{kind:n,ownerPath:t,sourcePath:t,external:!0,src:i,attrs:o,lang:s,body:"",startLine:0,endLine:0,errors:[`Could not resolve Vue ${n} block source: ${i}`]};let l=g(e,c),f=l?Math.max(0,l.split(`
|
|
3
3
|
`).length-1):0;return{kind:n,ownerPath:t,sourcePath:c,external:!0,src:i,attrs:o,lang:s,body:l,startLine:0,endLine:f,errors:l?[]:[`Vue ${n} block source not found: ${c}`]}}let a=Math.max(0,r.loc.start.line-1);return{kind:n,ownerPath:t,sourcePath:t,external:!1,attrs:o,lang:s,body:r.content,startLine:a,endLine:Math.max(a,r.loc.end.line-1),errors:[]}}function Qt(e,t){let n=t.split(/[?#]/,1)[0];if(!n||n.startsWith("/")||n.includes("://"))return null;let r=Oe(ue.normalize(ue.join(ue.dirname(e),n)));return r===".."||r.startsWith("../")?null:r}function Yt(e){return{...e}}function $e(e){return e instanceof Error?e.message:String(e)}function De(e,t,n){let o=pe(e,t,n).scripts.filter(i=>i.astLanguage&&i.body.length>0),s=o[0]?.astLanguage;return s?{body:o.map(i=>`${`
|
|
4
4
|
`.repeat(i.startLine)}${i.body}`).join(`
|
|
@@ -8,4 +8,4 @@ import{D as Fe,F as Pe,O as g,P as Ee,k as I,l as q,m as L,n as ke,o as Te,p as
|
|
|
8
8
|
`)))}var No=new Set(["in","key","of"]),Co=new Set(["computed","defineEmits","defineProps","reactive","ref","watch","watchEffect"]),bo=L("vue-component-behavior-profiles");function Et(e,t={}){let n=O(e,{extensions:[".vue"]}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).map(o=>be(e,o)).filter(o=>(t.minTemplateTokens===void 0||o.templateTokens.size>=t.minTemplateTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function be(e,t){let n=t.replace(/\\/g,"/"),r=g(e,n),o=bo.get(e,n,r,()=>ko(e,n,r));return _o(o)}function ko(e,t,n){let r=A(e,t),o=oe(e,t),s=re(r),i=Po(o),a=o.expressionIdentifiers.map(m=>m.name).filter(m=>!i.includes(m)).filter((m,C,B)=>B.indexOf(m)===C).sort(),c=o.componentTags.map(m=>m.normalized).filter((m,C,B)=>B.indexOf(m)===C).sort(),l=n?n.split(`
|
|
9
9
|
`).length:0,f=F(r.template),u=s.lineCount,N=r.styles.reduce((m,C)=>m+F(C),0),j=r.customBlocks.reduce((m,C)=>m+F(C),0),{lines:ie,paths:ae}=To(e,t,s);return{file:t,sfc:r,templateFacts:o,scriptFacts:s,templateTokens:new Set(o.structuralTokens),behaviorTokens:Fo(o,s,a),templateBindingNames:a,templateLocalNames:i,componentNames:c,sfcLines:l,totalLines:l+s.externalLineCount,templateLines:f,scriptLines:u,styleLines:N,externalScriptLines:s.externalLineCount,externalScriptPaths:s.externalScriptPaths,customBlockLines:j,delegatedComposableLines:ie,delegatedComposablePaths:ae}}function To(e,t,n){let r=new Set;for(let i of n.composables){let a=n.imports.find(l=>l.local===i);if(!a)continue;let c=Ft(e,a.sourcePath,a.source);!c||c===t||r.add(c)}let o=[...r].sort();return{lines:o.reduce((i,a)=>{let c=g(e,a);return i+(c?c.split(`
|
|
10
10
|
`).length:0)},0),paths:o}}function _o(e){let t=Lo(e.scriptFacts);return{...e,scriptFacts:t,templateTokens:new Set(e.templateTokens),behaviorTokens:new Set(e.behaviorTokens),templateBindingNames:[...e.templateBindingNames],templateLocalNames:[...e.templateLocalNames],componentNames:[...e.componentNames],externalScriptPaths:t.externalScriptPaths,delegatedComposablePaths:[...e.delegatedComposablePaths]}}function Lo(e){return{...e,imports:e.imports.map(t=>({...t})),functions:e.functions.map(t=>({...t})),calls:e.calls.map(t=>({...t,categories:[...t.categories]})),composables:[...e.composables],stores:[...e.stores],reactivity:[...e.reactivity],lifecycle:[...e.lifecycle],requests:[...e.requests],macros:[...e.macros],externalScriptPaths:[...e.externalScriptPaths],unresolvedScripts:e.unresolvedScripts.map(t=>({...t}))}}function Fo(e,t,n){let r=new Set;for(let o of t.composables)r.add(`composable:${o}`);for(let o of t.stores)r.add(`store:${o}`);for(let o of t.reactivity)r.add(`reactivity:${o}`);for(let o of t.lifecycle)r.add(`lifecycle:${o}`);for(let o of t.requests)r.add(`request:${o}`);for(let o of t.macros)r.add(`macro:${o}`);for(let o of t.functions){if(Co.has(o.name))continue;r.add(`function:${o.name}`);let s=/^[a-z]+/.exec(o.name)?.[0]??null;s&&s.length>2&&s!==o.name&&r.add(`function-verb:${s}`)}for(let o of e.events)r.add(`template-event:${o.name}`);for(let o of n)r.add(`template-binding:${o}`);return r}function Po(e){let t=new Set;for(let n of e.directives)if(n.name==="for"&&n.value)for(let r of Eo(n.value))t.add(r);for(let n of e.slots)if(n.value)for(let r of wt(n.value))t.add(r);return[...t].sort()}function Eo(e){let t=/^(.*?)\s+(?:in|of)\s+/.exec(e.trim());return t?wt(t[1]??""):[]}function wt(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let r=n[0];No.has(r)||t.push(r)}return t}function li(e){return{capability:(t,n)=>wo(t,n),reactProfiles:(t={})=>Qe(e,t),reactProfilesForFile:t=>me(e,t),vueProfiles:(t={})=>Et(e,t),vueProfileForFile:t=>be(e,t),vueTemplateFacts:t=>oe(e,t),vueScriptFacts:t=>re(A(e,t))}}function wo(e,t){let n=e.startsWith("react-")?"react":"vue";if(t===void 0)return{slot:e,available:!0,framework:n};let r=t.replace(/\\/g,"/").toLowerCase();return n==="react"&&!r.endsWith(".tsx")&&!r.endsWith(".jsx")?{slot:e,available:!1,framework:n,reason:"React behavior profiles are only available for .tsx and .jsx files"}:n==="vue"&&!r.endsWith(".vue")?{slot:e,available:!1,framework:n,reason:"Vue behavior facts are only available for .vue files"}:{slot:e,available:!0,framework:n}}export{we as a,Wt as b,z as c,gt as d,ht as e,St as f,yt as g,xt as h,vt as i,Nt as j,Ct as k,se as l,Hs as m,Zr as n,Ft as o,lo as p,uo as q,po as r,fo as s,mo as t,go as u,ho as v,Js as w,H as x,Re as y,De as z,Ue as A,Y as B,Q as C,it as D,ut as E,os as F,Xe as G,O as H,ss as I,li as J};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-GH74ASD6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as C}from"./chunk-35NLDRZC.js";import{a as b}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as C}from"./chunk-35NLDRZC.js";import{a as b}from"./chunk-C43RDDP4.js";function L(t,n={}){let{limit:s=10,scope:c,minDepth:l=3}=n,p=b(t,c),{components:h,componentOf:m}=C(p),d=new Map;for(let e=0;e<h.length;e++)d.set(e,new Set);for(let[e,r]of p){let o=m.get(e);for(let a of r){let i=m.get(a);i!==o&&d.get(o).add(i)}}let f=new Array(h.length),S=new Array(h.length);for(let e=0;e<h.length;e++){let r=[],o=0;for(let a of d.get(e)){let i=S[a];i>o&&(o=i,r=f[a])}f[e]=[e,...r],S[e]=1+o}function D(e){return f[e]}let R=h.map(e=>[...e].sort()),y=new Set,u=[];for(let e=0;e<h.length;e++){let o=D(e).map(g=>R[g]),a=o.map(g=>g[0]);if(o.length<l)continue;let i=a.join(" ");y.has(i)||(y.add(i),u.push(w(a,o)))}return u.sort((e,r)=>r.depth-e.depth),I(u).slice(0,s)}function w(t,n){let s=n.reduce((l,p)=>l+p.length,0),c=n.filter(l=>l.length>1).length;return{chain:t,components:n,depth:n.length,fileCount:s,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${n.length} condensed dependency component(s) form the representative transitive path`,`${s} file(s) are represented; ${c} component(s) contain a dependency cycle`,"cycles count once toward depth and retain their full membership separately"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function I(t){let n=[];for(let s of t)n.some(c=>v(s.chain,c.chain))||n.push(s);return n}function v(t,n){if(t.length>=n.length)return!1;let s=n.length-t.length;for(let c=0;c<t.length;c++)if(t[c]!==n[s+c])return!1;return!0}export{L as a};
|
|
2
|
+
//# sourceMappingURL=chunk-GMXWZP2B.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as le}from"./chunk-6SHPK5ZE.js";import{c as T}from"./chunk-UJCOIXDY.js";import{c as Q,f as ee,g as te,h as ne}from"./chunk-26QA6FAI.js";import{b as ce}from"./chunk-B75HZHUP.js";import{b as P}from"./chunk-Z4N3MZYA.js";import{h as oe,o as N}from"./chunk-7O5IKBTZ.js";import{a as ie,b as re,c as se,m as ae}from"./chunk-HX7M4BDI.js";import{B as E,d as $,e as J,g as K,h as q,i as G,j as V,k as X,w as Y}from"./chunk-EKZTZXHZ.js";import{p as Z}from"./chunk-UJPRPGCO.js";import{A as x,x as H}from"./chunk-GH74ASD6.js";import{A as W,J as I,K as z,k as U,v as b,y as j}from"./chunk-WCCFZ7V7.js";import{a as S}from"./chunk-NGEXCJJW.js";import{b as w}from"./chunk-7S5E7KWT.js";import{d as L}from"./chunk-C3KV2II6.js";var _=new WeakMap,ue=j({kind:"definition-exclusions",invalidation:W("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:Ie});function fe(e,t){let n=H(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=I(e,t);if(!r)return[];let o=U(e,t,r),c=ue.read(e,t,o);if(c)return c;let u=n==="rust"?Oe(e,t):ke(e,t);return ue.write(e,t,o,u),u}function Ie(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(Pe);return n.some(i=>i===null)?null:n}catch{return null}}function Pe(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?Ge(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 me=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),Ne=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Te=/\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 ke(e,t){let n=I(e,t);if(!n||!Ae(n))return[];let i=x(e,t);if(!i)return[];let r=_.get(i);if(r)return r;let o=!1,c=i.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 s=d.namedChild(0);if(!s)continue;let a=s.type==="member_expression"?s.namedChild(s.namedChildCount-1)?.text:s.text;if(a&&me.has(a)){o=!0;break}}let u=[];o&&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,s=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,s=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,s=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let m=a.namedChild(0)?.text,p=a.namedChild(1);m&&(p?.type==="arrow_function"||p?.type==="function_expression")&&(d=m,s=a)}}d&&/^use[A-Z]/.test(d)&&s&&u.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...pe(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),_.set(i,u),u}function Ae(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of me)if(e.includes(n)){t=!0;break}return t&&Ne.test(e)?!0:e.includes("use")&&Te.test(e)}var Fe=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Me(e){return Fe.test(e)}function pe(e,t,n){let i=[],r=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===o.startIndex&&u[d].type===o.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let s=u[d];if(n.has(s.type)){if(Me(s.text)){i.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment",disposition:"exclude"});break}continue}if(!(s.type==="attribute_item"||s.type==="inner_attribute_item"))break}}for(let c of o.namedChildren)r(c)};return r(e.rootNode),i}function Oe(e,t){let n=x(e,t);if(!n)return[];let i=_.get(n);if(i)return i;let r=[],o=Be(n);return o?(_.set(n,o),o):(ye(n.rootNode,r,!1,!1),r.push(...pe(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"]))),r.push(...Ke(n.rootNode)),_.set(n,r),r)}function Be(e){return Ve(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function ye(e,t,n,i){let r=n,o=i;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")&&(o=!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"?Ue(e,t,n,i):i&&Je(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"?je(e,t,n):e.type==="mod_item"&&k(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(r=!0);for(let c of e.namedChildren)ye(c,t,r,o)}function Ue(e,t,n,i){let r=k(e),o=null;i?o={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(o={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of r){if(be(c)){o={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=Ze(c);if(u){o=u;break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o.reason,disposition:o.disposition})}function je(e,t,n){let i=k(e),r=e.namedChildren.find(o=>o.type==="type_identifier")?.text;i.some($e)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:r}),i.some(be)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:r})}function k(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){i=o;break}if(i<=0)return[];let r=[];for(let o=i-1;o>=0;o-=1){let c=n[o];if(c.type==="attribute_item"||c.type==="inner_attribute_item")r.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return r}var We=new Set(["test","bench","tokio::test","async_std::test"]),ze=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),He=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 Ze(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=qe(e);return t?We.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:ze.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:He.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function $e(e){return/#\[\s*derive\s*\(/.test(e)}function be(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Je(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ke(e){let t=Xe(e);if(t.size===0)return[];let n=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&t.has(r)&&n.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:r})}return n}function qe(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 Ge(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 Ve(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 de=/\bwith\s*=\s*"([^"]+)"/g;function Xe(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){de.lastIndex=0;let i;for(;(i=de.exec(n.text))!==null;){let r=i[1],o=r.split("::").pop()??r;o&&t.add(o)}}return t}function ge(e){let t=A(e);return(n,i,r,o)=>t(n,i,r,o)?.disposition==="exclude"}function A(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let o=fe(e,i),c=new Map;for(let u of o){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return r={ranges:o,containers:c},t.set(i,r),r};return(i,r,o,c)=>{let u=n(i),l=[];for(let s of u.ranges)r>=s.startLine&&r<=s.endLine&&l.push(s);let d=new Set;c&&d.add(c);for(let s of E(o))d.add(s);for(let s of d){let a=u.containers.get(s);a&&l.push(...a)}return Ye(l)}}function Ye(e){if(e.length===0)return null;let n=e.find(i=>i.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function vt(e,t={}){w(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function he(e,t,n={}){w(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function xe(e,t){if(t.isIgnoredPath(e.relativePath))return y("ignored-file");if(G(e.symbol))return y("module-like-symbol");if(!R(e.symbol))return y("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&R(e.enclosingSymbol))return y("nested-non-callable-value");if(!t.includeTests&&!Qe(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=J(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"):V(e.symbol)?y("rust-trait-impl-member"):X(e.symbol)?y("rust-test-module"):!t.includeMembers&&!et(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}}function Qe(e){return Q(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function R(e){return q(e)||e.endsWith("().")||e.endsWith(".")}function et(e){return K(e.symbol)||E(e.symbol).length===0}function _e(){return new Map}function Se(e,t,n){let i=new Map;for(let r of ie(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||v(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function Ee(e,t,n,i={}){let r=new Set;if(i.conservative||n.size===0){for(let o of se(e,t))r.add(o.symbol_id);return r}for(let o of re(e,t))e.isIgnored(o.relative_path)||n.has(o.relative_path)||r.add(o.symbol_id);return r}function F(e,t){let n=e.get(t);if(!n)return!1;for(let i of n.values())if(i.occurrences>0)return!0;return!1}function C(e,t,n){let i=e.get(t);if(!i)return!1;for(let[r,o]of i)if(r!==n&&o.occurrences>0)return!0;return!1}function Re(e){return e?.occurrences??0}function v(e,t,n,i,r="source-fallback"){if(i<=0)return;let o=ve(e,t,n);o.occurrences+=i,o.sources.add(r)}function Ce(e,t,n,i,r){if(i<=0)return;let o=ve(e,t,n);o.occurrences=Math.max(i,o.occurrences),o.sources.add(r)}function ve(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r={occurrences:0,sources:new Set},i.set(n,r)),r}var tt=1e3,nt=300;function Qt(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:o=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,s=0,a=b("dead.candidates",()=>{let f=ce(it(e,{scope:n,minLoc:i,includeTests:r,includeMembers:c}),l);return s=f.length,f},()=>({definitions:s})),m=0,p=o?b("dead.inactive-barrels",()=>{let f=new Set(ee(e));return m=f.size,f},()=>({paths:m})):new Set,M=0,g=u?_e():b("dead.mention-reference-counts",()=>{let f=Se(e,p,a.map(D=>D.symbolId));return M=f.size,f},()=>({definitions:a.length,symbolsWithReferences:M})),O=0,Le=u?b("dead.mentioned-symbol-ids",()=>{let f=Ee(e,a.map(D=>D.symbolId),p,{conservative:p.size===0});return O=f.size,f},()=>({definitions:a.length,referencedSymbols:O})):new Set,h=u?a.filter(f=>!Le.has(f.symbolId)):a.filter(f=>!C(g,f.symbolId,f.relativePath));u?b("dead.source-fallback.dead-code-only",()=>ut(e,h,g,{inactiveBarrelPaths:p}),()=>({definitions:h.length,testReferencesIncluded:!0})):b("dead.source-fallback.ast",()=>lt(e,h,g,{inactiveBarrelPaths:p}),()=>({definitions:h.length,testReferencesIncluded:!0}));let B=u?h.filter(f=>!F(g,f.symbolId)):h.filter(f=>!C(g,f.symbolId,f.relativePath));b("dead.caller-map-supplement",()=>yt(e,B,g,{inactiveBarrelPaths:p,includeSemantic:!u&&d}),()=>({definitions:B.length,semantic:!u&&d}));let we=u?h.filter(f=>!F(g,f.symbolId)):a;return ct(e,ot(we,g))}function it(e,t){let n=ge(e),i=[];for(let r of Y(e,{scope:t.scope,symbolMatches:R,sqlPrefilter:"function-like"}))xe(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>st(e,r),isFrameworkContractCallable:()=>le(e,r)}).accepted&&i.push(r);return i}var rt=["method_signature","abstract_method_signature","call_signature","construct_signature"];function st(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=x(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...rt]).some(r=>r.startPosition.row<=t.startLine&&r.endPosition.row>=t.endLine);let i=z(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
|
|
2
|
+
`).trim();return i.endsWith(";")&&!i.includes("=>")&&!i.includes("{")}function ot(e,t){return e.map(n=>at(n,t)).filter(n=>n.cross_file_refs===0).sort((n,i)=>i.loc-n.loc||n.relative_path.localeCompare(i.relative_path)||n.start_line-i.start_line)}function at(e,t){let n=t.get(e.symbolId)??new Map,i=Re(n.get(e.relativePath)),r=0;for(let[o,c]of n)o!==e.relativePath&&(r+=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:i,cross_file_refs:r}}function ct(e,t){let n=A(e),i=[],r=0,o=0,c=0,u=0,l=0,d=0;for(let s of t){if(e.isIgnored(s.relative_path))continue;if(te(e,s.relative_path)){u++;continue}if(ne(e,s.symbol,s.relative_path)){l++;continue}let a=n(s.relative_path,s.start_line,s.symbol,s.parent_type_name),m=a?.disposition==="implicit-usage"?a.reason:void 0,p=m?"implicit-usage":s.same_file_refs===0?"dead-code":"file-internal";p==="dead-code"?r++:p==="file-internal"?o++:c++,d+=s.loc,i.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:$(s.symbol),sameFileRefs:s.same_file_refs,kind:p,...m?{implicitUsageReason:m}:{}})}return{symbols:i,counts:{total:i.length,deadCode:r,fileInternal:o,implicitUsage:c,loc:d},applicability:{entrySurfaceExcluded:u,externalRootExcluded:l,implicitUsageSignals:c},totalCount:i.length,deadCodeCount:r,fileInternalCount:o,implicitUsageCount:c,totalLoc:d}}function lt(e,t,n,i){if(t.length===0)return;let r=new T(e),o=new Set(t.map(l=>l.symbolId)),c=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let l of S(e))u.add(l);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:l=>i.inactiveBarrelPaths.has(l)},l=>{o.has(l.target.symbolId)&&(mt(e,l)||v(n,l.target.symbolId,l.sourceFile,pt(l),"source-fallback"))})}function ut(e,t,n,i){if(t.length===0)return;let r=new T(e),o=dt(t),c=new Set(r.sourceFiles());for(let s of S(e))c.add(s);let u=new Set(o.keys()),l=new Map,d=s=>{let a=l.get(s);return a||(a=oe(e,s),l.set(s,a)),a};r.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:s=>i.inactiveBarrelPaths.has(s),resolveTargets:({sourceFile:s,name:a,kind:m})=>{let p=o.get(a);return p?ft(s,a,p,()=>d(s),{permissive:m!=="cross-language-dispatch"}):[]},afterPath:s=>{l.delete(s),he(e,s)}},s=>{let a=s.kind==="identifier"&&s.sourceFile===s.target.relativePath?Math.max(0,s.occurrences-1):s.occurrences;s.kind==="identifier"&&De(e,{sourceFile:s.sourceFile,name:s.name,target:s.target,occurrences:a})||v(n,s.target.symbolId,s.sourceFile,a,"source-fallback")})}function dt(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let i=t.get(n.leaf)??[];i.push(n),t.set(n.leaf,i)}return t}function ft(e,t,n,i,r){let o=n.filter(d=>d.relativePath===e);if(o.length>0)return o;if(!r.permissive&&n.length===1)return[...n];let c=i(),u=c.get(t);if(u)for(let d of u){let s=n.filter(a=>L(d,a.relativePath));if(s.length>0)return s}let l=new Set;for(let d of c.values())for(let s of d)l.add(s);for(let d of l){let s=n.filter(a=>L(d,a.relativePath));if(s.length>0&&s.length===n.length)return s}return r.permissive?[...n]:[]}function mt(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&De(e,t)}function pt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function De(e,t){return t.occurrences>1?!1:Z(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function yt(e,t,n,i){let r=i.includeSemantic!==!1,o=r&&t.length>=tt&&S(e).length>=nt,c=(s,a)=>{a===s.relativePath||e.isIgnored(a)||i.inactiveBarrelPaths.has(a)||Ce(n,s.symbolId,a,1,"caller-map")};if(o?b("dead.caller-map.per-symbol-non-semantic",()=>{for(let s of t){let a=P(e,s,{semantic:!1,semanticEvidence:N});for(let m of a)c(s,m.file)}},()=>({definitions:t.length,semantic:!1})):b("dead.caller-map.per-symbol",()=>{for(let s of t){let a=P(e,s,{semantic:r,semanticEvidence:N});if(a.length!==0)for(let m of a)c(s,m.file)}},()=>({definitions:t.length,semantic:r})),!o)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let s=t.filter(a=>!C(n,a.symbolId,a.relativePath));return u=s.length,s},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=ae(e,l);for(let s of l){let a=d.get(s.symbolId);if(a)for(let m of a)c(s,m)}}export{vt as a,Qt as b};
|
|
3
|
+
//# sourceMappingURL=chunk-GOUBFH5O.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{c as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{c as f}from"./chunk-UJCOIXDY.js";import{a as L}from"./chunk-T7YQSHPQ.js";import{d as i,e as b,f as u,l as c}from"./chunk-EKZTZXHZ.js";import{f as l}from"./chunk-UJPRPGCO.js";import{x as a}from"./chunk-GH74ASD6.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-HLF2TX6R.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as j}from"./chunk-
|
|
1
|
+
import{a as j}from"./chunk-N5W4YZMK.js";import{a as N,b as g,c as R}from"./chunk-MV7OWDUX.js";import{a as _}from"./chunk-ZTETIQ35.js";import{b as C,c as P}from"./chunk-UJCOIXDY.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as k}from"./chunk-BGBBVSH4.js";import{a as w}from"./chunk-7O5IKBTZ.js";import{d,e as y,k as v,z as L}from"./chunk-EKZTZXHZ.js";import{i as S}from"./chunk-UJPRPGCO.js";import{v as x}from"./chunk-WCCFZ7V7.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=N(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&x("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=T(t,c.symbolId,D);if(!M)continue;let p=W(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=T(t,e.symbolId,o);if(!r)return null;let s=W(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(a=>!S(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return R(t,e,o).realConsumers}function T(t,n,e){return t.get(`SELECT c.start_line, c.end_line
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents d ON c.document_id = d.id
|
|
5
5
|
WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
|
|
6
6
|
LIMIT 1`,n,e)}function W(t,n,e,i,a){let o=t.definitionsForFile(e),r=q(n,e,i,a.start_line,a.end_line);return L(o,r)}function J(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:G(n,e),source:"file"}}function q(t,n,e,i,a){let o=y(e);if(!o)return i;let r=w(t,n).get(o);if(!r||r.length===0)return i;for(let s of r)if(s>=i&&s<=a)return s;return i}function z(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function G(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,b(n)),a=0;for(let[o,r]of t)o!==n&&m(o,b(o))===i&&r>a&&(a=r);return a}function H(t,n,e,i){return j(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ae as a};
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-HX4GQPZP.js.map
|